From d7a883506657d751435839244e0cd4c24761fa4d Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Wed, 8 Jan 2014 23:43:34 -0800 Subject: [PATCH 001/656] Initial pass at fixing provide-* for custom themes --- deploy/settings/default/default.behaviors | 66 +++++++++++------------ src/lt/objs/style.cljs | 26 ++++----- 2 files changed, 47 insertions(+), 45 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 572a77c1d..731c91cff 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -58,39 +58,39 @@ :lt.objs.workspace/init-workspace-cache-dir (:lt.objs.keyboard/chord-timeout 1000) (:lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|\\.nrepl-port") - (:lt.objs.style/provide-skin "dark" "/core/css/skins/new-dark.css") - (:lt.objs.style/provide-skin "light" "/core/css/skins/new-dark.css") - (:lt.objs.style/provide-skin "new-dark" "/core/css/skins/new-dark.css") - (:lt.objs.style/provide-theme "3024-day" "/core/css/themes/3024-day.css") - (:lt.objs.style/provide-theme "3024-night" "/core/css/themes/3024-night.css") - (:lt.objs.style/provide-theme "ambiance" "/core/css/themes/ambiance.css") - (:lt.objs.style/provide-theme "base16-dark" "/core/css/themes/base16-dark.css") - (:lt.objs.style/provide-theme "base16-light" "/core/css/themes/base16-light.css") - (:lt.objs.style/provide-theme "blackboard" "/core/css/themes/blackboard.css") - (:lt.objs.style/provide-theme "cobalt" "/core/css/themes/cobalt.css") - (:lt.objs.style/provide-theme "codemirror" "/core/css/themes/codemirror.css") - (:lt.objs.style/provide-theme "default" "/core/css/themes/default.css") - (:lt.objs.style/provide-theme "eclipse" "/core/css/themes/eclipse.css") - (:lt.objs.style/provide-theme "elegant" "/core/css/themes/elegant.css") - (:lt.objs.style/provide-theme "erlang-dark" "/core/css/themes/erlang-dark.css") - (:lt.objs.style/provide-theme "ibdknox" "/core/css/themes/ibdknox.css") - (:lt.objs.style/provide-theme "lesser-dark" "/core/css/themes/lesser-dark.css") - (:lt.objs.style/provide-theme "midnight" "/core/css/themes/midnight.css") - (:lt.objs.style/provide-theme "monokai" "/core/css/themes/monokai.css") - (:lt.objs.style/provide-theme "neat" "/core/css/themes/neat.css") - (:lt.objs.style/provide-theme "night" "/core/css/themes/night.css") - (:lt.objs.style/provide-theme "paraiso-dark" "/core/css/themes/paraiso-dark.css") - (:lt.objs.style/provide-theme "paraiso-light" "/core/css/themes/paraiso-light.css") - (:lt.objs.style/provide-theme "rubyblue" "/core/css/themes/rubyblue.css") - (:lt.objs.style/provide-theme "solarized-light" "/core/css/themes/solarized-light.css") - (:lt.objs.style/provide-theme "solarized" "/core/css/themes/solarized.css") - (:lt.objs.style/provide-theme "the-matrix" "/core/css/themes/the-matrix.css") - (:lt.objs.style/provide-theme "tomorrow-night-eighties" "/core/css/themes/tomorrow-night-eighties.css") - (:lt.objs.style/provide-theme "tomorrow-night" "/core/css/themes/tomorrow-night.css") - (:lt.objs.style/provide-theme "twilight" "/core/css/themes/twilight.css") - (:lt.objs.style/provide-theme "vibrant-ink" "/core/css/themes/vibrant-ink.css") - (:lt.objs.style/provide-theme "xq-dark" "/core/css/themes/xq-dark.css") - (:lt.objs.style/provide-theme "xq-light" "/core/css/themes/xq-light.css") + (:lt.objs.style/provide-skin "dark" "/core/css/skins/new-dark.css" true) + (:lt.objs.style/provide-skin "light" "/core/css/skins/new-dark.css" true) + (:lt.objs.style/provide-skin "new-dark" "/core/css/skins/new-dark.css" true) + (:lt.objs.style/provide-theme "3024-day" "/core/css/themes/3024-day.css" true) + (:lt.objs.style/provide-theme "3024-night" "/core/css/themes/3024-night.css" true) + (:lt.objs.style/provide-theme "ambiance" "/core/css/themes/ambiance.css" true) + (:lt.objs.style/provide-theme "base16-dark" "/core/css/themes/base16-dark.css" true) + (:lt.objs.style/provide-theme "base16-light" "/core/css/themes/base16-light.css" true) + (:lt.objs.style/provide-theme "blackboard" "/core/css/themes/blackboard.css" true) + (:lt.objs.style/provide-theme "cobalt" "/core/css/themes/cobalt.css" true) + (:lt.objs.style/provide-theme "codemirror" "/core/css/themes/codemirror.css" true) + (:lt.objs.style/provide-theme "default" "/core/css/themes/default.css" true) + (:lt.objs.style/provide-theme "eclipse" "/core/css/themes/eclipse.css" true) + (:lt.objs.style/provide-theme "elegant" "/core/css/themes/elegant.css" true) + (:lt.objs.style/provide-theme "erlang-dark" "/core/css/themes/erlang-dark.css" true) + (:lt.objs.style/provide-theme "ibdknox" "/core/css/themes/ibdknox.css" true) + (:lt.objs.style/provide-theme "lesser-dark" "/core/css/themes/lesser-dark.css" true) + (:lt.objs.style/provide-theme "midnight" "/core/css/themes/midnight.css" true) + (:lt.objs.style/provide-theme "monokai" "/core/css/themes/monokai.css" true) + (:lt.objs.style/provide-theme "neat" "/core/css/themes/neat.css" true) + (:lt.objs.style/provide-theme "night" "/core/css/themes/night.css" true) + (:lt.objs.style/provide-theme "paraiso-dark" "/core/css/themes/paraiso-dark.css" true) + (:lt.objs.style/provide-theme "paraiso-light" "/core/css/themes/paraiso-light.css" true) + (:lt.objs.style/provide-theme "rubyblue" "/core/css/themes/rubyblue.css" true) + (:lt.objs.style/provide-theme "solarized-light" "/core/css/themes/solarized-light.css" true) + (:lt.objs.style/provide-theme "solarized" "/core/css/themes/solarized.css" true) + (:lt.objs.style/provide-theme "the-matrix" "/core/css/themes/the-matrix.css" true) + (:lt.objs.style/provide-theme "tomorrow-night-eighties" "/core/css/themes/tomorrow-night-eighties.css" true) + (:lt.objs.style/provide-theme "tomorrow-night" "/core/css/themes/tomorrow-night.css" true) + (:lt.objs.style/provide-theme "twilight" "/core/css/themes/twilight.css" true) + (:lt.objs.style/provide-theme "vibrant-ink" "/core/css/themes/vibrant-ink.css" true) + (:lt.objs.style/provide-theme "xq-dark" "/core/css/themes/xq-dark.css" true) + (:lt.objs.style/provide-theme "xq-light" "/core/css/themes/xq-light.css" true) (:lt.objs.style/set-skin "dark") :lt.objs.editor/init-codemirror] :browser [:lt.objs.browser/forward! :lt.objs.browser/init! diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index 909d684be..8dff8e6ea 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -34,8 +34,7 @@ :id "skin-style" :href (bound (subatom this [:skin]) #(-> (object/raise-reduce app/app :skins+ {}) - (get % "/core/css/skins/dark.css") - (plugins/adjust-path)))}]) + (get % "/core/css/skins/dark.css")))}]) (object/object* ::styles :init (fn [this] @@ -82,10 +81,12 @@ :desc "Style: Provide skin" :triggers #{:skins+} :type :user - :params [{:label "name"} {:label "path"}] - :reaction (fn [this skins name path] - (assoc skins name path) - )) + :params [{:label "name"} {:label "path"} {:label "native"}] + :reaction (fn [this skins name path native] + (let [adjusted-path (plugins/adjust-path path)] + (assoc skins name (if (not native) + (str "file://" adjusted-path) + adjusted-path))))) (defn get-skins [] (sort-by #(.-text %) @@ -123,8 +124,7 @@ :type "text/css" :id (str "theme-" name) :href (-> (object/raise-reduce app/app :themes+ {}) - (get name "/core/css/themes/default.css") - (plugins/adjust-path))}]) + (get name "/core/css/themes/default.css"))}]) (defn load-theme [name] (when-not (empty? prev-theme) @@ -138,10 +138,12 @@ :desc "Style: Provide editor theme" :triggers #{:themes+} :type :user - :params [{:label "name"} {:label "path"}] - :reaction (fn [this themes name path] - (assoc themes name path) - )) + :params [{:label "name"} {:label "path"} {:label "native"}] + :reaction (fn [this themes name path native] + (let [adjusted-path (plugins/adjust-path path)] + (assoc themes name (if (not native) + (str "file://" adjusted-path) + adjusted-path))))) (behavior ::remove-theme :triggers #{:deactivated :destroy} From aaa0f14406ca126b9d66545bc4970719abc6c4f0 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Thu, 9 Jan 2014 22:03:53 -0800 Subject: [PATCH 002/656] Revert "Initial pass at fixing provide-* for custom themes" This reverts commit d7a883506657d751435839244e0cd4c24761fa4d. --- deploy/settings/default/default.behaviors | 66 +++++++++++------------ src/lt/objs/style.cljs | 26 +++++---- 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index dacafab49..01d88c51f 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -58,39 +58,39 @@ :lt.objs.workspace/init-workspace-cache-dir (:lt.objs.keyboard/chord-timeout 1000) (:lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|\\.nrepl-port") - (:lt.objs.style/provide-skin "dark" "/core/css/skins/new-dark.css" true) - (:lt.objs.style/provide-skin "light" "/core/css/skins/new-dark.css" true) - (:lt.objs.style/provide-skin "new-dark" "/core/css/skins/new-dark.css" true) - (:lt.objs.style/provide-theme "3024-day" "/core/css/themes/3024-day.css" true) - (:lt.objs.style/provide-theme "3024-night" "/core/css/themes/3024-night.css" true) - (:lt.objs.style/provide-theme "ambiance" "/core/css/themes/ambiance.css" true) - (:lt.objs.style/provide-theme "base16-dark" "/core/css/themes/base16-dark.css" true) - (:lt.objs.style/provide-theme "base16-light" "/core/css/themes/base16-light.css" true) - (:lt.objs.style/provide-theme "blackboard" "/core/css/themes/blackboard.css" true) - (:lt.objs.style/provide-theme "cobalt" "/core/css/themes/cobalt.css" true) - (:lt.objs.style/provide-theme "codemirror" "/core/css/themes/codemirror.css" true) - (:lt.objs.style/provide-theme "default" "/core/css/themes/default.css" true) - (:lt.objs.style/provide-theme "eclipse" "/core/css/themes/eclipse.css" true) - (:lt.objs.style/provide-theme "elegant" "/core/css/themes/elegant.css" true) - (:lt.objs.style/provide-theme "erlang-dark" "/core/css/themes/erlang-dark.css" true) - (:lt.objs.style/provide-theme "ibdknox" "/core/css/themes/ibdknox.css" true) - (:lt.objs.style/provide-theme "lesser-dark" "/core/css/themes/lesser-dark.css" true) - (:lt.objs.style/provide-theme "midnight" "/core/css/themes/midnight.css" true) - (:lt.objs.style/provide-theme "monokai" "/core/css/themes/monokai.css" true) - (:lt.objs.style/provide-theme "neat" "/core/css/themes/neat.css" true) - (:lt.objs.style/provide-theme "night" "/core/css/themes/night.css" true) - (:lt.objs.style/provide-theme "paraiso-dark" "/core/css/themes/paraiso-dark.css" true) - (:lt.objs.style/provide-theme "paraiso-light" "/core/css/themes/paraiso-light.css" true) - (:lt.objs.style/provide-theme "rubyblue" "/core/css/themes/rubyblue.css" true) - (:lt.objs.style/provide-theme "solarized-light" "/core/css/themes/solarized-light.css" true) - (:lt.objs.style/provide-theme "solarized" "/core/css/themes/solarized.css" true) - (:lt.objs.style/provide-theme "the-matrix" "/core/css/themes/the-matrix.css" true) - (:lt.objs.style/provide-theme "tomorrow-night-eighties" "/core/css/themes/tomorrow-night-eighties.css" true) - (:lt.objs.style/provide-theme "tomorrow-night" "/core/css/themes/tomorrow-night.css" true) - (:lt.objs.style/provide-theme "twilight" "/core/css/themes/twilight.css" true) - (:lt.objs.style/provide-theme "vibrant-ink" "/core/css/themes/vibrant-ink.css" true) - (:lt.objs.style/provide-theme "xq-dark" "/core/css/themes/xq-dark.css" true) - (:lt.objs.style/provide-theme "xq-light" "/core/css/themes/xq-light.css" true) + (:lt.objs.style/provide-skin "dark" "/core/css/skins/new-dark.css") + (:lt.objs.style/provide-skin "light" "/core/css/skins/new-dark.css") + (:lt.objs.style/provide-skin "new-dark" "/core/css/skins/new-dark.css") + (:lt.objs.style/provide-theme "3024-day" "/core/css/themes/3024-day.css") + (:lt.objs.style/provide-theme "3024-night" "/core/css/themes/3024-night.css") + (:lt.objs.style/provide-theme "ambiance" "/core/css/themes/ambiance.css") + (:lt.objs.style/provide-theme "base16-dark" "/core/css/themes/base16-dark.css") + (:lt.objs.style/provide-theme "base16-light" "/core/css/themes/base16-light.css") + (:lt.objs.style/provide-theme "blackboard" "/core/css/themes/blackboard.css") + (:lt.objs.style/provide-theme "cobalt" "/core/css/themes/cobalt.css") + (:lt.objs.style/provide-theme "codemirror" "/core/css/themes/codemirror.css") + (:lt.objs.style/provide-theme "default" "/core/css/themes/default.css") + (:lt.objs.style/provide-theme "eclipse" "/core/css/themes/eclipse.css") + (:lt.objs.style/provide-theme "elegant" "/core/css/themes/elegant.css") + (:lt.objs.style/provide-theme "erlang-dark" "/core/css/themes/erlang-dark.css") + (:lt.objs.style/provide-theme "ibdknox" "/core/css/themes/ibdknox.css") + (:lt.objs.style/provide-theme "lesser-dark" "/core/css/themes/lesser-dark.css") + (:lt.objs.style/provide-theme "midnight" "/core/css/themes/midnight.css") + (:lt.objs.style/provide-theme "monokai" "/core/css/themes/monokai.css") + (:lt.objs.style/provide-theme "neat" "/core/css/themes/neat.css") + (:lt.objs.style/provide-theme "night" "/core/css/themes/night.css") + (:lt.objs.style/provide-theme "paraiso-dark" "/core/css/themes/paraiso-dark.css") + (:lt.objs.style/provide-theme "paraiso-light" "/core/css/themes/paraiso-light.css") + (:lt.objs.style/provide-theme "rubyblue" "/core/css/themes/rubyblue.css") + (:lt.objs.style/provide-theme "solarized-light" "/core/css/themes/solarized-light.css") + (:lt.objs.style/provide-theme "solarized" "/core/css/themes/solarized.css") + (:lt.objs.style/provide-theme "the-matrix" "/core/css/themes/the-matrix.css") + (:lt.objs.style/provide-theme "tomorrow-night-eighties" "/core/css/themes/tomorrow-night-eighties.css") + (:lt.objs.style/provide-theme "tomorrow-night" "/core/css/themes/tomorrow-night.css") + (:lt.objs.style/provide-theme "twilight" "/core/css/themes/twilight.css") + (:lt.objs.style/provide-theme "vibrant-ink" "/core/css/themes/vibrant-ink.css") + (:lt.objs.style/provide-theme "xq-dark" "/core/css/themes/xq-dark.css") + (:lt.objs.style/provide-theme "xq-light" "/core/css/themes/xq-light.css") (:lt.objs.style/set-skin "dark") :lt.objs.editor/init-codemirror] :browser [:lt.objs.browser/forward! :lt.objs.browser/init! diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index 8dff8e6ea..909d684be 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -34,7 +34,8 @@ :id "skin-style" :href (bound (subatom this [:skin]) #(-> (object/raise-reduce app/app :skins+ {}) - (get % "/core/css/skins/dark.css")))}]) + (get % "/core/css/skins/dark.css") + (plugins/adjust-path)))}]) (object/object* ::styles :init (fn [this] @@ -81,12 +82,10 @@ :desc "Style: Provide skin" :triggers #{:skins+} :type :user - :params [{:label "name"} {:label "path"} {:label "native"}] - :reaction (fn [this skins name path native] - (let [adjusted-path (plugins/adjust-path path)] - (assoc skins name (if (not native) - (str "file://" adjusted-path) - adjusted-path))))) + :params [{:label "name"} {:label "path"}] + :reaction (fn [this skins name path] + (assoc skins name path) + )) (defn get-skins [] (sort-by #(.-text %) @@ -124,7 +123,8 @@ :type "text/css" :id (str "theme-" name) :href (-> (object/raise-reduce app/app :themes+ {}) - (get name "/core/css/themes/default.css"))}]) + (get name "/core/css/themes/default.css") + (plugins/adjust-path))}]) (defn load-theme [name] (when-not (empty? prev-theme) @@ -138,12 +138,10 @@ :desc "Style: Provide editor theme" :triggers #{:themes+} :type :user - :params [{:label "name"} {:label "path"} {:label "native"}] - :reaction (fn [this themes name path native] - (let [adjusted-path (plugins/adjust-path path)] - (assoc themes name (if (not native) - (str "file://" adjusted-path) - adjusted-path))))) + :params [{:label "name"} {:label "path"}] + :reaction (fn [this themes name path] + (assoc themes name path) + )) (behavior ::remove-theme :triggers #{:deactivated :destroy} From 70bea77458f41e1fa5692390fa8ab8c67298ff8d Mon Sep 17 00:00:00 2001 From: Christopher Elwell Date: Tue, 14 Jan 2014 10:20:19 -0500 Subject: [PATCH 003/656] grammatical and stylistic changes to readme Just some suggestions. --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d93e9067d..a3291398e 100755 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ chmod -R u+rwx deploy/ On Windows (manual): 1. Clone the repo https://github.com/LightTable/LightTable.git -2. download http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/LightTableWin.zip -3. unzip LightTableWin.zip -4. copy the following files from the zip into the cloned repo at LightTable/deploy/ +2. Download http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/LightTableWin.zip +3. Unzip LightTableWin.zip +4. Copy the following files from the zip into the cloned repo at LightTable/deploy/ - ffmpegsumo.dll - icudt.dll - libEGL.dll @@ -50,9 +50,9 @@ On Windows (manual): I'll assume you already know how to eval code (ctrl-enter), how to open the command bar (ctrl-space) and how to open files with the navigator (ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). -Add `light-table-core/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a clojurescript compiler. When it's finished starting up it will ask you where to send the emitted javascript code - choose Light Table UI from the menu. Now you should be able to eval clojurescript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. +Add `light-table-core/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. -The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for clojurescript and clojure vars, all of which are very useful for exploring the codebase. In clojurescript these features are only aware of vars that have been evaled in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. +The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. @@ -64,7 +64,7 @@ Light Table is organised around behaviors, objects and tags. Objects are just plain data-structures stored in an atom with a globally unique id. Whenever possible, state in Light Table is stored in objects. Use `lt.object/object*` to create an object template and `lt.object/create` to instantiate a new object from a template. -The jump-stack object here stores a stack of file/pos pairs. Every time you used jump-to-definition, your old file/pos is added to the stack. When you jump back the file/pos is popped from the stack. +The jump-stack object here stores a stack of file/pos pairs. Every time you use jump-to-definition, your old file/pos is added to the stack. When you jump back the file/pos is popped from the stack. ``` clj (def jump-stack (object/create (object/object* ::jump-stack @@ -86,7 +86,7 @@ Behaviors are defined with `lt.macros/behavior`. The required fields are `:trigg (object/update! jump-stack [:stack] conj [old-file old-pos])))))) ``` -You can add documentation to behaviors eg +You can add documentation to behaviors. E.g., ``` clj (behavior ::run-on-init @@ -99,7 +99,7 @@ You can add documentation to behaviors eg :reaction (fn [this & commands] ...)) ``` -You can also debounce (or similarly throttle) the reaction function eg +You can also debounce (or similarly throttle) the reaction function. E.g., ``` clj (behavior ::show-info-on-move @@ -126,7 +126,7 @@ If you highlight `jump-stack` and hit eval you will see the current state of the The most interesting keys here are `:stack`, which was added in the template and is used to store the file/pos stack, and `:listeners`, which maps triggers to behaviors. If we were to eval something like `(lt.object/raise jump-stack :jump-stack.push! editor file pos)` then the behavior `lt.objs.jump-stack/jump-stack.push` would be called with arguments `[editor file pos]`. -This is much like traditional event systems, the main difference being the object/behavior relationship is expressed as simple data-structures which can be easily introspected and modified at runtime. You can see the defaults for that data-structure by running the command `Settings: Default behaviors`. In that file there is a line that adds the `::jump-stack.push` and `::jump-stack.pop` behaviors to any object with the `:jump-stack` tag. +This is much like traditional event systems, the main difference being the object/behavior relationship is expressed as simple data-structures which can be easily introspected and modified at runtime. You can see the defaults for that data-structure by running the command `Settings: Default behaviors`. In that file, there is a line that adds the `::jump-stack.push` and `::jump-stack.pop` behaviors to any object with the `:jump-stack` tag. ``` clj :jump-stack [:lt.objs.jump-stack/jump-stack.push :lt.objs.jump-stack/jump-stack.pop] @@ -211,4 +211,4 @@ Commands can also be bound to key chords. Run the command `Settings: Default key # Plugins -See [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier) for an example clojurescript plugin. +See [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier) for an example ClojureScript plugin. From d449cb7a4bb413ad9615302a1bd5aad98b5bde2e Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Tue, 14 Jan 2014 21:35:14 -0600 Subject: [PATCH 004/656] Add Ability to Remove Recent Workspace Fix issue #1051 by providing a contextual menu when right clicking a recent workspace. --- deploy/settings/default/default.behaviors | 4 +++- src/lt/objs/sidebar/workspace.cljs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 331ef707b..a1dd05ddb 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -370,7 +370,9 @@ :sidebar.workspace [:lt.objs.sidebar.workspace/sidebar-menu :lt.objs.sidebar.workspace/on-drop :lt.objs.sidebar.workspace/recent! :lt.objs.sidebar.workspace/tree! - :lt.objs.sidebar.workspace/recent.select!] + :lt.objs.sidebar.workspace/recent.select! + :lt.objs.sidebar.workspace/sidebar-recents-menu + :lt.objs.sidebar.workspace/recent.remove!] :skin-selector [:lt.objs.style/set-skin-on-select] :statusbar-container-item [:lt.objs.statusbar/on-show! :lt.objs.statusbar/on-hide! diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 724446471..38cbd79da 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -491,6 +491,10 @@ [:ul.files (for [f (:files r)] [:li (files/basename f)])]] + :contextmenu (fn [e] + (object/raise this :recents.menu! r e) + (dom/prevent e) + (dom/stop-propagation e)) :click (fn [] (object/raise this :recent.select! r))) @@ -525,6 +529,12 @@ (object/raise this :tree!) )) +(behavior ::recent.remove! + :triggers #{:recent.remove!} + :reaction (fn [this sel] + (files/delete! (:path sel)) + (object/raise this :recent!))) + (defn ws-class [ws] (str "workspace" (when (:recents ws) " recents"))) @@ -581,6 +591,13 @@ (show-menu (.-clientX e) (.-clientY e))) )) +(behavior ::sidebar-recents-menu + :triggers #{:recents.menu!} + :reaction (fn [this r e] + (-> (menu [{:label "Remove" + :click (fn [] (object/raise this :recent.remove! r))}]) + (show-menu (.-clientX e) (.-clientY e))))) + (behavior ::workspace.open-on-start :triggers #{:init} :type :user From 5ad8759e79440140d1e541fe4889c0855ab0baae Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Wed, 15 Jan 2014 21:35:23 -0800 Subject: [PATCH 005/656] Renames :on-active-active-tabset to :tab-active --- deploy/settings/default/default.behaviors | 2 +- src/lt/objs/tabs.cljs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 331ef707b..8780a6c4d 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -389,7 +389,7 @@ :lt.objs.tabs/no-anim-on-drag :lt.objs.tabs/active-tab-num :lt.objs.tabs/set-dragging] :tabset.tab [:lt.objs.tabs/on-destroy-remove - :lt.objs.tabs/on-active-active-tabset] + :lt.objs.tabs/tab-active] :tcp.client [:lt.objs.clients.tcp/send!] :theme-selector [:lt.objs.style/set-theme-on-select] :tree-item [:lt.objs.sidebar.workspace/rename-submit diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 90255d0f1..5b817a5ea 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -335,7 +335,7 @@ (dom/add-class (object/->content ts) :active) true)) -(behavior ::on-active-active-tabset +(behavior ::tab-active :triggers #{:active} :reaction (fn [this] (activate-tabset (::tabset @this)))) From 2cf19c1c43aae63fc186db0d2237d8218ecae7e5 Mon Sep 17 00:00:00 2001 From: Morgawr Date: Fri, 17 Jan 2014 07:22:42 +0100 Subject: [PATCH 006/656] fixed font line-height bug with 0 spacing --- platform/linux/LightTable | 0 platform/linux64/LightTable | 0 src/lt/objs/style.cljs | 3 ++- 3 files changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 platform/linux/LightTable mode change 100644 => 100755 platform/linux64/LightTable diff --git a/platform/linux/LightTable b/platform/linux/LightTable old mode 100644 new mode 100755 diff --git a/platform/linux64/LightTable b/platform/linux64/LightTable old mode 100644 new mode 100755 diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index c065c2429..4d3e2688e 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -61,7 +61,8 @@ final (if size (assoc final :font-size size) final) - final (if line-height + final (if (and line-height + (< 0 line-height)) (assoc final :line-height line-height) final)] (object/merge! styles final)))) From 9f3e5bc7ba4025228fd9ef2dede8b4d1a3f4370c Mon Sep 17 00:00:00 2001 From: Morgawr Date: Fri, 17 Jan 2014 07:26:45 +0100 Subject: [PATCH 007/656] fixed wrong permission change commit --- platform/linux/LightTable | 0 platform/linux64/LightTable | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 platform/linux/LightTable mode change 100755 => 100644 platform/linux64/LightTable diff --git a/platform/linux/LightTable b/platform/linux/LightTable old mode 100755 new mode 100644 diff --git a/platform/linux64/LightTable b/platform/linux64/LightTable old mode 100755 new mode 100644 From e38cb4dee1c1202ffa6eb9733643fa455328168a Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Thu, 16 Jan 2014 08:42:11 -0600 Subject: [PATCH 008/656] Refactor Recent Menu Behavior Update behaviors used to implement right click menu for a recent workspace to reuse existing behaviors. Refactor the sidebar-menu behavior to utilize the same on-menu behavior. --- deploy/settings/default/default.behaviors | 10 ++-- src/lt/objs/sidebar/workspace.cljs | 73 ++++++++++++++--------- src/lt/objs/workspace.cljs | 5 ++ 3 files changed, 55 insertions(+), 33 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index a1dd05ddb..0bcaebde5 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -368,11 +368,13 @@ :lt.plugins.doc/cur-from-last-editor ] :sidebar.workspace [:lt.objs.sidebar.workspace/sidebar-menu + :lt.objs.sidebar.workspace/on-menu :lt.objs.sidebar.workspace/on-drop - :lt.objs.sidebar.workspace/recent! :lt.objs.sidebar.workspace/tree! - :lt.objs.sidebar.workspace/recent.select! - :lt.objs.sidebar.workspace/sidebar-recents-menu - :lt.objs.sidebar.workspace/recent.remove!] + :lt.objs.sidebar.workspace/recent! :lt.objs.sidebar.workspace/tree!] + :recent-workspace [:lt.objs.sidebar.workspace/on-menu + :lt.objs.sidebar.workspace/recent-menu + :lt.objs.sidebar.workspace/recent.delete! + :lt.objs.sidebar.workspace/recent.select!] :skin-selector [:lt.objs.style/set-skin-on-select] :statusbar-container-item [:lt.objs.statusbar/on-show! :lt.objs.statusbar/on-hide! diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 38cbd79da..9fcb41192 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -483,27 +483,27 @@ (defn recent [this] (object/raise this :recent!)) -(defui recents-item [this r] +(defui recents-item [this] [:li [:ul.folders - (for [f (:folders r)] + (for [f (:folders @this)] [:li (files/basename f) files/separator])] [:ul.files - (for [f (:files r)] + (for [f (:files @this)] [:li (files/basename f)])]] :contextmenu (fn [e] - (object/raise this :recents.menu! r e) + (object/raise this :menu! e) (dom/prevent e) (dom/stop-propagation e)) :click (fn [] - (object/raise this :recent.select! r))) + (object/raise this :recent.select!))) (defui recents [this rs] [:div (back-button this) [:ul (for [r rs] - (recents-item this r))]]) + (object/->content r))]]) (defui back-button [this] [:h2 "Select a workspace"] @@ -513,7 +513,7 @@ (behavior ::recent! :triggers #{:recent!} :reaction (fn [this] - (object/merge! this {:recents (recents this (workspace/all))}) + (object/merge! this {:recents (recents this (map #(object/create ::recent-workspace %) (workspace/all)))}) )) (behavior ::tree! @@ -524,16 +524,25 @@ (behavior ::recent.select! :triggers #{:recent.select!} - :reaction (fn [this sel] - (workspace/open workspace/current-ws (:path sel)) - (object/raise this :tree!) + :reaction (fn [this] + (workspace/open workspace/current-ws (:path @this)) + (object/raise sidebar-workspace :tree!) )) -(behavior ::recent.remove! - :triggers #{:recent.remove!} - :reaction (fn [this sel] - (files/delete! (:path sel)) - (object/raise this :recent!))) +(behavior ::recent.delete! + :triggers #{:delete!} + :reaction (fn [this] + (when (= (:file @workspace/current-ws) + (files/basename (:path @this))) + (object/raise tree :clear!)) + (workspace/delete workspace/current-ws) + (object/raise sidebar-workspace :recent!))) + +(object/object* ::recent-workspace + :tags #{:recent-workspace} + :init (fn [this r] + (object/merge! this r) + (recents-item this))) (defn ws-class [ws] (str "workspace" (when (:recents ws) @@ -577,19 +586,25 @@ ;(dom/trigger (input) :click) (behavior ::sidebar-menu - :triggers #{:menu!} - :reaction (fn [this e] - (-> (menu [{:label "Add folder" - :click (fn [] (cmd/exec! :workspace.add-folder))} - {:label "Add file" - :click (fn [] (cmd/exec! :workspace.add-file))} - {:label "Open recent workspace" - :click (fn [] (cmd/exec! :workspace.show-recents))} - {:type "separator"} - {:label "Clear workspace" - :click (fn [] (object/raise tree :clear!))}]) - (show-menu (.-clientX e) (.-clientY e))) - )) + :triggers #{:menu-items} + :reaction (fn [this items] + (conj items + {:label "Add folder" + :click (fn [] (cmd/exec! :workspace.add-folder))} + {:label "Add file" + :click (fn [] (cmd/exec! :workspace.add-file))} + {:label "Open recent workspace" + :click (fn [] (cmd/exec! :workspace.show-recents))} + {:type "separator"} + {:label "Clear workspace" + :click (fn [] (object/raise tree :clear!))}))) + +(behavior ::recent-menu + :triggers #{:menu-items} + :reaction (fn [this items] + (conj items + {:label "Delete Workspace" + :click (fn [] (object/raise this :delete!))}))) (behavior ::sidebar-recents-menu :triggers #{:recents.menu!} @@ -642,4 +657,4 @@ :desc "Workspace: Open recent workspace" :exec (fn [] (cmd/exec! :workspace.show :force) - (recent sidebar-workspace))}) \ No newline at end of file + (recent sidebar-workspace))}) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 983a6867e..387ddc871 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -160,6 +160,11 @@ (files/save (files/join workspace-cache-path file) (pr-str (serialize @ws))) (object/raise ws :save)) +(defn delete [ws] + (let [path (files/join workspace-cache-path + (:file @ws))] + (files/delete! path))) + (defn cached [] (filter #(> (.indexOf % ".clj") -1) (files/full-path-ls workspace-cache-path))) From 9822771e164b70dcb78a27b826f2c54e2169c7cd Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Sat, 18 Jan 2014 04:28:52 -0600 Subject: [PATCH 009/656] Remove extraneous behavior --- src/lt/objs/sidebar/workspace.cljs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 9fcb41192..4435df1c1 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -606,13 +606,6 @@ {:label "Delete Workspace" :click (fn [] (object/raise this :delete!))}))) -(behavior ::sidebar-recents-menu - :triggers #{:recents.menu!} - :reaction (fn [this r e] - (-> (menu [{:label "Remove" - :click (fn [] (object/raise this :recent.remove! r))}]) - (show-menu (.-clientX e) (.-clientY e))))) - (behavior ::workspace.open-on-start :triggers #{:init} :type :user From 0e1b22e17dbc273e42fb97bd9223cfb1a5b77744 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Mon, 20 Jan 2014 09:28:47 -0600 Subject: [PATCH 010/656] Ensure destruction of recent workspaces --- src/lt/objs/sidebar/workspace.cljs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 4435df1c1..b79688b7f 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -496,7 +496,7 @@ (dom/prevent e) (dom/stop-propagation e)) :click (fn [] - (object/raise this :recent.select!))) + (object/raise this :select!))) (defui recents [this rs] [:div @@ -513,17 +513,22 @@ (behavior ::recent! :triggers #{:recent!} :reaction (fn [this] - (object/merge! this {:recents (recents this (map #(object/create ::recent-workspace %) (workspace/all)))}) - )) + (doseq [r (:recents @this)] + (object/destroy! r)) + (->> (workspace/all) + (map #(object/create ::recent-workspace %)) + (hash-map :recents) + (object/merge! this)))) (behavior ::tree! :triggers #{:tree!} :reaction (fn [this] - (object/merge! this {:recents nil}) - )) + (doseq [r (:recents @this)] + (object/destroy! r)) + (object/merge! this {:recents nil}))) (behavior ::recent.select! - :triggers #{:recent.select!} + :triggers #{:select!} :reaction (fn [this] (workspace/open workspace/current-ws (:path @this)) (object/raise sidebar-workspace :tree!) @@ -562,7 +567,8 @@ [:ul.root (object/->content tree)]] [:div.recent - (bound this :recents) + (bound this (fn [sw] + (recents this (:recents sw)))) ]] :dragover (fn [e] (set! (.-dataTransfer.dropEffect e) "move") From 61661cfc96e664fca377494597a3fb871aa48f88 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Thu, 23 Jan 2014 10:46:17 -0600 Subject: [PATCH 011/656] Fix Recent Workspace Delete Remove the extra workspace delete function that is basically just another name for the "file/delete!" function. This fixes the bug created by trying to delete "path" when that variable doesn't exist. --- src/lt/objs/sidebar/workspace.cljs | 2 +- src/lt/objs/workspace.cljs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 2912cb0fb..914cbfdb2 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -540,7 +540,7 @@ (when (= (:file @workspace/current-ws) (files/basename (:path @this))) (object/raise tree :clear!)) - (workspace/delete (:path @this)) + (files/delete! (:path @this)) (object/raise sidebar-workspace :recent!))) (object/object* ::recent-workspace diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index d7d32a8bc..983a6867e 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -160,9 +160,6 @@ (files/save (files/join workspace-cache-path file) (pr-str (serialize @ws))) (object/raise ws :save)) -(defn delete [file] - (files/delete! path)) - (defn cached [] (filter #(> (.indexOf % ".clj") -1) (files/full-path-ls workspace-cache-path))) From 4fa79196667bb3bbd9273009cadd9014593a07ed Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 23 Jan 2014 16:04:51 -0800 Subject: [PATCH 012/656] use cm4 Signed-off-by: Chris Granger --- deploy/core/css/codemirror.css | 78 +- .../node_modules/codemirror/active-line.js | 55 +- .../node_modules/codemirror/codemirror.js | 2854 ++++++++++------- 3 files changed, 1736 insertions(+), 1251 deletions(-) diff --git a/deploy/core/css/codemirror.css b/deploy/core/css/codemirror.css index 095e89c26..2350b28d3 100644 --- a/deploy/core/css/codemirror.css +++ b/deploy/core/css/codemirror.css @@ -2,7 +2,13 @@ .CodeMirror { /* Set height, width, borders, and global font properties here */ + height:auto; } + +.CodeMirror * { + box-sizing:content-box !important; +} + .CodeMirror-scroll { /* Set scrolling behaviour here */ overflow: auto; @@ -30,7 +36,6 @@ } .CodeMirror-linenumbers {} .CodeMirror-linenumber { - box-sizing:content-box; padding: 0 3px 0 5px; min-width: 20px; text-align: right; @@ -41,7 +46,6 @@ .CodeMirror div.CodeMirror-cursor { border-left: 1px solid black; - z-index: 3; } /* Shown when moving in bi-directional text */ .CodeMirror div.CodeMirror-secondarycursor { @@ -51,15 +55,12 @@ width: auto; border: 0; background: #7e7; - z-index: 1; } /* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} +div.CodeMirror-overwrite div.CodeMirror-cursor {} .cm-tab { display: inline-block; } -/* STOP */ - /* The rest of this file contains styles related to the mechanics of the editor. You probably shouldn't touch them. */ @@ -162,6 +163,7 @@ border-right: 30px solid transparent; width: -webkit-fit-content; width: -moz-fit-content; + width: fit-content; } .CodeMirror-wrap .CodeMirror-code pre { border-right: none; @@ -196,11 +198,15 @@ .CodeMirror div.CodeMirror-cursor { position: absolute; - visibility: hidden; border-right: none; width: 0; } -.CodeMirror-focused div.CodeMirror-cursor { + +div.CodeMirror-cursors { + visibility: hidden; + z-index: 3; +} +.CodeMirror-focused div.CodeMirror-cursors { visibility: visible; } @@ -215,60 +221,12 @@ /* IE7 hack to prevent it from returning funny offsetTops on the spans */ .CodeMirror span { *vertical-align: text-bottom; } +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + @media print { /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursor { + .CodeMirror div.CodeMirror-cursors { visibility: hidden; } } - -.CodeMirror-hints { - position: absolute; - z-index: 1000000000000000; - overflow: hidden; - list-style: none; - - margin: 0; - padding: 2px; - - font-size: 90%; - font-family: monospace; - - max-height: 20em; - overflow-y: auto; -} - -.CodeMirror-hint { - margin: 0; - padding: 0 4px; - border-radius: 2px; - overflow: hidden; - white-space: pre; - cursor: pointer; -} - -.CodeMirror-hint-active { -} - -/* foldgutter.css */ -.CodeMirror-foldmarker { - color: blue; - text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; - font-family: arial; - line-height: .3; - cursor: pointer; -} -.CodeMirror-foldgutter { - width: .7em; -} -.CodeMirror-foldgutter-open, -.CodeMirror-foldgutter-folded { - color: #555; - cursor: pointer; -} -.CodeMirror-foldgutter-open:after { - content: "\25BE"; -} -.CodeMirror-foldgutter-folded:after { - content: "\25B8"; -} diff --git a/deploy/core/node_modules/codemirror/active-line.js b/deploy/core/node_modules/codemirror/active-line.js index 839e8bccc..a818f109b 100644 --- a/deploy/core/node_modules/codemirror/active-line.js +++ b/deploy/core/node_modules/codemirror/active-line.js @@ -4,7 +4,14 @@ // active line's wrapping
the CSS class "CodeMirror-activeline", // and gives its background
the class "CodeMirror-activeline-background". -(function() { +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { "use strict"; var WRAP_CLASS = "CodeMirror-activeline"; var BACK_CLASS = "CodeMirror-activeline-background"; @@ -12,34 +19,48 @@ CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { var prev = old && old != CodeMirror.Init; if (val && !prev) { - updateActiveLine(cm, cm.getCursor().line); + cm.state.activeLines = []; + updateActiveLines(cm, cm.listSelections()); cm.on("beforeSelectionChange", selectionChange); } else if (!val && prev) { cm.off("beforeSelectionChange", selectionChange); - clearActiveLine(cm); - delete cm.state.activeLine; + clearActiveLines(cm); + delete cm.state.activeLines; } }); - function clearActiveLine(cm) { - if ("activeLine" in cm.state) { - cm.removeLineClass(cm.state.activeLine, "wrap", WRAP_CLASS); - cm.removeLineClass(cm.state.activeLine, "background", BACK_CLASS); + function clearActiveLines(cm) { + for (var i = 0; i < cm.state.activeLines.length; i++) { + cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); + cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); } } - function updateActiveLine(cm, selectedLine) { - var line = cm.getLineHandleVisualStart(selectedLine); - if (cm.state.activeLine == line) return; + function sameArray(a, b) { + if (a.length != b.length) return false; + for (var i = 0; i < a.length; i++) + if (a[i] != b[i]) return false; + return true; + } + + function updateActiveLines(cm, ranges) { + var active = []; + for (var i = 0; i < ranges.length; i++) { + var line = cm.getLineHandleVisualStart(ranges[i].head.line); + if (active[active.length - 1] != line) active.push(line); + } + if (sameArray(cm.state.activeLines, active)) return; cm.operation(function() { - clearActiveLine(cm); - cm.addLineClass(line, "wrap", WRAP_CLASS); - cm.addLineClass(line, "background", BACK_CLASS); - cm.state.activeLine = line; + clearActiveLines(cm); + for (var i = 0; i < active.length; i++) { + cm.addLineClass(active[i], "wrap", WRAP_CLASS); + cm.addLineClass(active[i], "background", BACK_CLASS); + } + cm.state.activeLines = active; }); } function selectionChange(cm, sel) { - updateActiveLine(cm, sel.head.line); + updateActiveLines(cm, sel.ranges); } -})(); \ No newline at end of file +}); diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/codemirror.js index ac7e4ce6a..4959db2c6 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/codemirror.js @@ -1,5 +1,11 @@ -// CodeMirror is the only global var we claim -window.CodeMirror = (function() { +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + module.exports = mod(); + else if (typeof define == "function" && define.amd) // AMD + return define([], mod); + else // Plain browser env + this.CodeMirror = mod(); +})(function() { "use strict"; // BROWSER SNIFFING @@ -7,9 +13,8 @@ window.CodeMirror = (function() { // Crude, but necessary to handle a number of hard-to-feature-detect // bugs and behavior differences. var gecko = /gecko\/\d/i.test(navigator.userAgent); - // IE11 currently doesn't count as 'ie', since it has almost none of - // the same bugs as earlier versions. Use ie_gt10 to handle - // incompatibilities in that version. + // old_ie refers to any Internet Explorer before 11 (which has + // almost none of the same bugs as earlier versions). var old_ie = /MSIE \d/.test(navigator.userAgent); var ie_lt8 = old_ie && (document.documentMode == null || document.documentMode < 8); var ie_lt9 = old_ie && (document.documentMode == null || document.documentMode < 9); @@ -18,7 +23,7 @@ window.CodeMirror = (function() { var webkit = /WebKit\//.test(navigator.userAgent); var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); var chrome = /Chrome\//.test(navigator.userAgent); - var opera = /Opera\//.test(navigator.userAgent); + var presto = /Opera\//.test(navigator.userAgent); var safari = /Apple Computer/.test(navigator.vendor); var khtml = /KHTML\//.test(navigator.userAgent); var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent); @@ -31,12 +36,12 @@ window.CodeMirror = (function() { var mac = ios || /Mac/.test(navigator.platform); var windows = /win/i.test(navigator.platform); - var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/); - if (opera_version) opera_version = Number(opera_version[1]); - if (opera_version && opera_version >= 15) { opera = false; webkit = true; } + var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) presto_version = Number(presto_version[1]); + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11)); - var captureMiddleClick = gecko || (old_ie && !ie_lt9); + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (old_ie && !ie_lt9); // Optimize some code when these features are not used var sawReadOnlySpans = false, sawCollapsedSpans = false; @@ -72,21 +77,23 @@ window.CodeMirror = (function() { this.display.wrapper.className += " CodeMirror-wrap"; var doc = options.value; - if (typeof doc == "string") doc = new Doc(options.value, options.mode); - operation(this, attachDoc)(this, doc); + if (typeof doc == "string") doc = new Doc(doc, options.mode); // Override magic textarea content restore that IE sometimes does // on our hidden textarea on reload if (old_ie) setTimeout(bind(resetInput, this, true), 20); registerEventHandlers(this); - // IE throws unspecified error in certain cases, when - // trying to access activeElement before onload - var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { } - if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20); - else onBlur(this); operation(this, function() { + attachDoc(this, doc); + + // IE throws unspecified error in certain cases, when + // trying to access activeElement before onload + var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { } + if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20); + else onBlur(this); + for (var opt in optionHandlers) if (optionHandlers.propertyIsEnumerable(opt)) optionHandlers[opt](this, options[opt], Init); @@ -116,15 +123,13 @@ window.CodeMirror = (function() { // DIVs containing the selection and the actual code d.lineDiv = elt("div", null, "CodeMirror-code"); d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - // Blinky cursor, and element used to ensure cursor fits at the end of a line - d.cursor = elt("div", "\u00a0", "CodeMirror-cursor"); - // Secondary cursor, shown when on a 'jump' in bi-directional text - d.otherCursor = elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); // Used to measure text size d.measure = elt("div", null, "CodeMirror-measure"); + d.lineMeasure = elt("div", null, "CodeMirror-measure"); // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor], - null, "position: relative; outline: none"); + d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.lineDiv, d.cursorDiv], + null, "position: relative; outline: none"); // Moved around its parent to cover visible view d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); // Set to the height of the text, causes scrolling @@ -154,13 +159,20 @@ window.CodeMirror = (function() { // Current visible range (may be bigger than the view window). d.viewOffset = d.lastSizeC = 0; - d.showingFrom = d.showingTo = docStart; + d.viewFrom = d.viewTo = docStart; + d.view = []; + d.updateLineNumbers = null; // Used to only resize the line number gutter when necessary (when // the amount of lines crosses a boundary that makes its width change) d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; // See readInput and resetInput - d.prevInput = ""; + if (!ie_lt9) { + d.prevInput = d.input.value = "_"; + d.input.setSelectionRange(1, 1); + } else { + d.prevInput = ""; + } // Set to true when a non-horizontal-scrolling widget is added. As // an optimization, widget aligning is skipped when d is false. d.alignWidgets = false; @@ -172,8 +184,6 @@ window.CodeMirror = (function() { d.poll = new Delayed(); d.cachedCharWidth = d.cachedTextHeight = null; - d.measureLineCache = []; - d.measureLineCachePos = 0; // Tracks when resetInput has punted to just putting a short // string instead of the (large) selection. @@ -188,6 +198,10 @@ window.CodeMirror = (function() { // Used for measuring wheel scrolling granularity d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + d.shift = false; + + d.externalMeasured = null; + return d; } @@ -276,21 +290,24 @@ window.CodeMirror = (function() { } } gutters.style.display = i ? "" : "none"; + var width = gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + if (i) cm.display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; } - function lineLength(doc, line) { + function lineLength(line) { if (line.height == 0) return 0; var len = line.text.length, merged, cur = line; while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(); - cur = getLine(doc, found.from.line); + var found = merged.find(0, true); + cur = found.from.line; len += found.from.ch - found.to.ch; } cur = line; while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(); + var found = merged.find(0, true); len -= cur.text.length - found.from.ch; - cur = getLine(doc, found.to.line); + cur = found.to.line; len += cur.text.length - found.to.ch; } return len; @@ -299,10 +316,10 @@ window.CodeMirror = (function() { function computeMaxLength(cm) { var d = cm.display, doc = cm.doc; d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(doc, d.maxLine); + d.maxLineLength = lineLength(d.maxLine); d.maxLineChanged = true; doc.iter(function(line) { - var len = lineLength(doc, line); + var len = lineLength(line); if (len > d.maxLineLength) { d.maxLineLength = len; d.maxLine = line; @@ -324,22 +341,34 @@ window.CodeMirror = (function() { // SCROLLBARS + function measureForScrollbars(cm) { + var scroll = cm.display.scroller; + return { + scrollHeight: scroll.scrollHeight, clientHeight: scroll.clientHeight, + barHeight: cm.display.scrollbarV.clientHeight, + scrollWidth: scroll.scrollWidth, clientWidth: scroll.clientWidth, + barWidth: cm.display.scrollbarH.clientWidth, + paddingVert: paddingVert(cm.display) + }; + } + // Re-synchronize the fake scrollbars with the actual size of the // content. Optionally force a scrollTop. - function updateScrollbars(cm) { + function updateScrollbars(cm, measure) { + if (!measure) measure = measureForScrollbars(cm); var d = cm.display, docHeight = cm.doc.height; - var totalHeight = docHeight + paddingVert(d); + var totalHeight = docHeight + measure.paddingVert; d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px"; - d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px"; - var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight); - var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1); - var needsV = scrollHeight > (d.scroller.clientHeight + 1); + d.gutters.style.height = Math.max(totalHeight, measure.clientHeight - scrollerCutOff) + "px"; + var scrollHeight = Math.max(totalHeight, measure.scrollHeight); + var needsH = measure.scrollWidth > (measure.clientWidth + 1); + var needsV = scrollHeight > (measure.clientHeight + 1); if (needsV) { d.scrollbarV.style.display = "block"; d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0"; // A bug in IE8 can cause this value to be negative, so guard it. d.scrollbarV.firstChild.style.height = - Math.max(0, scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px"; + Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + "px"; } else { d.scrollbarV.style.display = ""; d.scrollbarV.firstChild.style.height = "0"; @@ -348,7 +377,7 @@ window.CodeMirror = (function() { d.scrollbarH.style.display = "block"; d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0"; d.scrollbarH.firstChild.style.width = - (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px"; + (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + "px"; } else { d.scrollbarH.style.display = ""; d.scrollbarH.firstChild.style.width = "0"; @@ -369,24 +398,39 @@ window.CodeMirror = (function() { } } + // viewPort may contain top, height, and ensure (see op.scrollToPos) properties function visibleLines(display, doc, viewPort) { - var top = display.scroller.scrollTop, height = display.wrapper.clientHeight; - if (typeof viewPort == "number") top = viewPort; - else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;} + var top = viewPort && viewPort.top != null ? viewPort.top : display.scroller.scrollTop; + var height = viewPort && viewPort.height || display.wrapper.clientHeight; top = Math.floor(top - paddingTop(display)); var bottom = Math.ceil(top + height); - return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)}; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + if (viewPort && viewPort.ensure) { + var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line; + if (ensureFrom < from) + return {from: ensureFrom, + to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) - display.wrapper.clientHeight)}; + if (Math.min(ensureTo, doc.lastLine()) >= to) + return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) + display.wrapper.clientHeight), + to: ensureTo}; + } + return {from: from, to: to}; } // LINE NUMBERS function alignHorizontally(cm) { - var display = cm.display; + var display = cm.display, view = display.view; if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, l = comp + "px"; - for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) { - for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) if (!view[i].hidden) { + if (cm.options.fixedGutter && view[i].gutter) + view[i].gutter.style.left = left; + var align = view[i].alignable; + if (align) for (var j = 0; j < align.length; j++) + align[j].style.left = left; } if (cm.options.fixedGutter) display.gutters.style.left = (comp + gutterW) + "px"; @@ -404,6 +448,9 @@ window.CodeMirror = (function() { display.lineNumWidth = display.lineNumInnerWidth + padding; display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; display.lineGutter.style.width = display.lineNumWidth + "px"; + var width = display.gutters.offsetWidth; + display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; + display.sizer.style.marginLeft = width + "px"; return true; } return false; @@ -413,21 +460,21 @@ window.CodeMirror = (function() { return String(options.lineNumberFormatter(i + options.firstLineNumber)); } function compensateForHScroll(display) { - return getRect(display.scroller).left - getRect(display.sizer).left; + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; } // DISPLAY DRAWING - function updateDisplay(cm, changes, viewPort, forced) { - var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated; + function updateDisplay(cm, viewChanged, viewPort, forced) { + var oldFrom = cm.display.viewFrom, oldTo = cm.display.viewTo, updated; var visible = visibleLines(cm.display, cm.doc, viewPort); for (var first = true;; first = false) { var oldWidth = cm.display.scroller.clientWidth; - if (!updateDisplayInner(cm, changes, visible, forced)) break; + if (!updateDisplayInner(cm, !updated && viewChanged, visible, forced)) break; updated = true; - changes = []; + var barMeasure = measureForScrollbars(cm); updateSelection(cm); - updateScrollbars(cm); + updateScrollbars(cm, barMeasure); if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) { forced = true; continue; @@ -435,18 +482,18 @@ window.CodeMirror = (function() { forced = false; // Clip forced viewport to actual scrollable area - if (viewPort) - viewPort = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, - typeof viewPort == "number" ? viewPort : viewPort.top); + if (viewPort && viewPort.top != null) + viewPort = {top: Math.min(barMeasure.scrollHeight - barMeasure.clientHeight, viewPort.top)}; visible = visibleLines(cm.display, cm.doc, viewPort); - if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo) + if (visible.from >= cm.display.viewFrom && visible.to <= cm.display.viewTo) break; } + cm.display.updateLineNumbers = null; if (updated) { signalLater(cm, "update", cm); - if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo) - signalLater(cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo); + if (cm.display.viewFrom != oldFrom || cm.display.viewTo != oldTo) + signalLater(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); } return updated; } @@ -454,96 +501,66 @@ window.CodeMirror = (function() { // Uses a set of changes plus the current scroll position to // determine which DOM updates have to be made, and makes the // updates. - function updateDisplayInner(cm, changes, visible, forced) { + function updateDisplayInner(cm, viewChanged, visible, forced) { var display = cm.display, doc = cm.doc; if (!display.wrapper.offsetWidth) { - display.showingFrom = display.showingTo = doc.first; - display.viewOffset = 0; + resetView(cm); return; } // Bail out if the visible area is already rendered and nothing changed. - if (!forced && changes.length == 0 && - visible.from > display.showingFrom && visible.to < display.showingTo) + if (!forced && !viewChanged && + visible.from > display.viewFrom && visible.to < display.viewTo) return; if (maybeUpdateLineNumberWidth(cm)) - changes = [{from: doc.first, to: doc.first + doc.size}]; - var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + "px"; - display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : "0"; - - // Used to determine which lines need their line numbers updated - var positionsChangedFrom = Infinity; - if (cm.options.lineNumbers) - for (var i = 0; i < changes.length; ++i) - if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; } + resetView(cm); + var dims = getDimensions(cm); var end = doc.first + doc.size; var from = Math.max(visible.from - cm.options.viewportMargin, doc.first); var to = Math.min(end, visible.to + cm.options.viewportMargin); - if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom); - if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo); + if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); + if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); if (sawCollapsedSpans) { - from = lineNo(visualLine(doc, getLine(doc, from))); - while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to; - } - - // Create a range of theoretically intact lines, and punch holes - // in that using the change info. - var intact = [{from: Math.max(display.showingFrom, doc.first), - to: Math.min(display.showingTo, end)}]; - if (intact[0].from >= intact[0].to) intact = []; - else intact = computeIntact(intact, changes); - // When merged lines are present, we might have to reduce the - // intact ranges because changes in continued fragments of the - // intact lines do require the lines to be redrawn. - if (sawCollapsedSpans) - for (var i = 0; i < intact.length; ++i) { - var range = intact[i], merged; - while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) { - var newTo = merged.find().from.line; - if (newTo > range.from) range.to = newTo; - else { intact.splice(i--, 1); break; } - } - } - - // Clip off the parts that won't be visible - var intactLines = 0; - for (var i = 0; i < intact.length; ++i) { - var range = intact[i]; - if (range.from < from) range.from = from; - if (range.to > to) range.to = to; - if (range.from >= range.to) intact.splice(i--, 1); - else intactLines += range.to - range.from; + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); } - if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) { - updateViewOffset(cm); - return; + + var different = from != display.viewFrom || to != display.viewTo || + display.lastSizeC != display.wrapper.clientHeight; + adjustView(cm, from, to); + + var toUpdate = 0; + for (var i = 0; i < display.view.length; i++) { + var v = display.view[i]; + if (!v.hidden && (!v.node || v.changes)) ++toUpdate; } - intact.sort(function(a, b) {return a.from - b.from;}); - // Avoid crashing on IE's "unspecified error" when in iframes - try { + updateViewOffset(cm); + if (!different && toUpdate == 0 && !forced) return; + + if (toUpdate > 4) { var focused = document.activeElement; - } catch(e) {} - if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none"; - patchDisplay(cm, from, to, intact, positionsChangedFrom); - display.lineDiv.style.display = ""; - if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus(); + display.lineDiv.style.display = "none"; + } + patchDisplay(cm, display.updateLineNumbers, dims); + if (toUpdate > 4) { + display.lineDiv.style.display = ""; + if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus(); + } + + // Prevent these from interfering with the scroll size + display.gutters.style.height = ""; + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); - var different = from != display.showingFrom || to != display.showingTo || - display.lastSizeC != display.wrapper.clientHeight; - // This is just a bogus formula that detects when the editor is - // resized or the font size changes. if (different) { display.lastSizeC = display.wrapper.clientHeight; startWorker(cm, 400); } - display.showingFrom = from; display.showingTo = to; - display.gutters.style.height = ""; updateHeightsInViewport(cm); - updateViewOffset(cm); return true; } @@ -551,53 +568,39 @@ window.CodeMirror = (function() { function updateHeightsInViewport(cm) { var display = cm.display; var prevBottom = display.lineDiv.offsetTop; - for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) { + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height; + if (cur.hidden) continue; if (ie_lt8) { - var bot = node.offsetTop + node.offsetHeight; + var bot = cur.node.offsetTop + cur.node.offsetHeight; height = bot - prevBottom; prevBottom = bot; } else { - var box = getRect(node); + var box = cur.node.getBoundingClientRect(); height = box.bottom - box.top; } - var diff = node.lineObj.height - height; + var diff = cur.line.height - height; if (height < 2) height = textHeight(display); if (diff > .001 || diff < -.001) { - updateLineHeight(node.lineObj, height); - var widgets = node.lineObj.widgets; - if (widgets) for (var i = 0; i < widgets.length; ++i) - widgets[i].height = widgets[i].node.offsetHeight; + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) for (var j = 0; j < cur.rest.length; j++) + updateWidgetHeight(cur.rest[j]); } } } + function updateWidgetHeight(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) + line.widgets[i].height = line.widgets[i].node.offsetHeight; + } + function updateViewOffset(cm) { - var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom)); + var off = cm.display.viewOffset = heightAtLine(getLine(cm.doc, cm.display.viewFrom)); // Position the mover div to align with the current virtual scroll position cm.display.mover.style.top = off + "px"; } - function computeIntact(intact, changes) { - for (var i = 0, l = changes.length || 0; i < l; ++i) { - var change = changes[i], intact2 = [], diff = change.diff || 0; - for (var j = 0, l2 = intact.length; j < l2; ++j) { - var range = intact[j]; - if (change.to <= range.from && change.diff) { - intact2.push({from: range.from + diff, to: range.to + diff}); - } else if (change.to <= range.from || change.from >= range.to) { - intact2.push(range); - } else { - if (change.from > range.from) - intact2.push({from: range.from, to: change.from}); - if (change.to < range.to) - intact2.push({from: change.to + diff, to: range.to + diff}); - } - } - intact = intact2; - } - return intact; - } - function getDimensions(cm) { var d = cm.display, left = {}, width = {}; for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { @@ -611,154 +614,189 @@ window.CodeMirror = (function() { wrapperWidth: d.wrapper.clientWidth}; } - function patchDisplay(cm, from, to, intact, updateNumbersFrom) { - var dims = getDimensions(cm); + function patchDisplay(cm, updateNumbersFrom, dims) { var display = cm.display, lineNumbers = cm.options.lineNumbers; - if (!intact.length && (!webkit || !cm.display.currentWheelTarget)) - removeChildren(display.lineDiv); var container = display.lineDiv, cur = container.firstChild; function rm(node) { var next = node.nextSibling; - if (webkit && mac && cm.display.currentWheelTarget == node) { + if (webkit && mac && cm.display.currentWheelTarget == node) node.style.display = "none"; - node.lineObj = null; - } else { + else node.parentNode.removeChild(node); - } return next; } - var nextIntact = intact.shift(), lineN = from; - cm.doc.iter(from, to, function(line) { - if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift(); - if (lineIsHidden(cm.doc, line)) { - if (line.height != 0) updateLineHeight(line, 0); - if (line.widgets && cur && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) { - var w = line.widgets[i]; - if (w.showIfHidden) { - var prev = cur.previousSibling; - if (/pre/i.test(prev.nodeName)) { - var wrap = elt("div", null, null, "position: relative"); - prev.parentNode.replaceChild(wrap, prev); - wrap.appendChild(prev); - prev = wrap; - } - var wnode = prev.appendChild(elt("div", [w.node], "CodeMirror-linewidget")); - if (!w.handleMouseEvents) wnode.ignoreEvents = true; - positionLineWidget(w, wnode, prev, dims); - } + var view = display.view, lineN = display.viewFrom; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) { + } else if (!lineView.node) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) cur = rm(cur); + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; + updateLineForChanges(cm, lineView, lineN, dims); } - } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) { - // This line is intact. Skip to the actual node. Update its - // line number if needed. - while (cur.lineObj != line) cur = rm(cur); - if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber) - setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN)); - cur = cur.nextSibling; - } else { - // For lines with widgets, make an attempt to find and reuse - // the existing element, so that widgets aren't needlessly - // removed and re-inserted into the dom - if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling) - if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; } - // This line needs to be generated. - var lineNode = buildLineElement(cm, line, lineN, dims, reuse); - if (lineNode != reuse) { - container.insertBefore(lineNode, cur); - } else { - while (cur != reuse) cur = rm(cur); - cur = cur.nextSibling; + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); } - - lineNode.lineObj = line; + cur = lineView.node.nextSibling; } - ++lineN; - }); + lineN += lineView.size; + } while (cur) cur = rm(cur); } - function buildLineElement(cm, line, lineNo, dims, reuse) { - var built = buildLineContent(cm, line), lineElement = built.pre; - var markers = line.gutterMarkers, display = cm.display, wrap; + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") updateLineText(cm, lineView); + else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); + else if (type == "class") updateLineClasses(lineView); + else if (type == "widget") updateLineWidgets(lineView, dims); + } + lineView.changes = null; + } - var bgClass = built.bgClass ? built.bgClass + " " + (line.bgClass || "") : line.bgClass; - if (!cm.options.lineNumbers && !markers && !bgClass && !line.wrapClass && !line.widgets) - return lineElement; + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + lineView.node.appendChild(lineView.text); + if (ie_lt8) lineView.node.style.zIndex = 2; + } + return lineView.node; + } - // Lines with gutter elements, widgets or a background class need - // to be wrapped again, and have the extra elements added to the - // wrapper div + function updateLineBackground(lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) cls += " CodeMirror-linebackground"; + if (lineView.background) { + if (cls) lineView.background.className = cls; + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + } + } - if (reuse) { - reuse.alignable = null; - var isOk = true, widgetsSeen = 0, insertBefore = null; - for (var n = reuse.firstChild, next; n; n = next) { - next = n.nextSibling; - if (!/\bCodeMirror-linewidget\b/.test(n.className)) { - reuse.removeChild(n); - } else { - for (var i = 0; i < line.widgets.length; ++i) { - var widget = line.widgets[i]; - if (widget.node == n.firstChild) { - if (!widget.above && !insertBefore) insertBefore = n; - positionLineWidget(widget, n, reuse, dims); - ++widgetsSeen; - break; - } - } - if (i == line.widgets.length) { isOk = false; break; } - } - } - reuse.insertBefore(lineElement, insertBefore); - if (isOk && widgetsSeen == line.widgets.length) { - wrap = reuse; - reuse.className = line.wrapClass || ""; - } + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; } - if (!wrap) { - wrap = elt("div", null, line.wrapClass, "position: relative"); - wrap.appendChild(lineElement); + return buildLineContent(cm, lineView); + } + + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) lineView.node = built.pre; + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(lineView) { + updateLineBackground(lineView); + if (lineView.line.wrapClass) + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + else if (lineView.node != lineView.text) + lineView.node.className = ""; + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; } - // Kludge to make sure the styled element lies behind the selection (by z-index) - if (bgClass) - wrap.insertBefore(elt("div", null, bgClass + " CodeMirror-linebackground"), wrap.firstChild); + var markers = lineView.line.gutterMarkers; if (cm.options.lineNumbers || markers) { - var gutterWrap = wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "position: absolute; left: " + - (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"), - lineElement); - if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap); + var wrap = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = + wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "position: absolute; left: " + + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"), + lineView.text); if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - wrap.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineNo), + lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " - + display.lineNumInnerWidth + "px")); - if (markers) - for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; - if (found) - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + - dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } + + cm.display.lineNumInnerWidth + "px")); + if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + + function updateLineWidgets(lineView, dims) { + if (lineView.alignable) lineView.alignable = null; + for (var node = lineView.node.firstChild, next; node; node = next) { + var next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") + lineView.node.removeChild(node); } - if (ie_lt8) wrap.style.zIndex = 2; - if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + insertLineWidgets(lineView, dims); + } + + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) lineView.bgClass = built.bgClass; + if (built.textClass) lineView.textClass = built.textClass; + + updateLineClasses(lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(lineView, dims); + return lineView.node; + } + + function insertLineWidgets(lineView, dims) { + insertLineWidgetsFor(lineView.line, lineView, dims, true); + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + insertLineWidgetsFor(lineView.rest[i], lineView, dims, false); + } + + function insertLineWidgetsFor(line, lineView, dims, allowAbove) { + if (!line.widgets) return; + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); if (!widget.handleMouseEvents) node.ignoreEvents = true; - positionLineWidget(widget, node, wrap, dims); - if (widget.above) - wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement); + positionLineWidget(widget, node, lineView, dims); + if (allowAbove && widget.above) + wrap.insertBefore(node, lineView.gutter || lineView.text); else wrap.appendChild(node); signalLater(widget, "redraw"); } - return wrap; } - function positionLineWidget(widget, node, wrap, dims) { + function positionLineWidget(widget, node, lineView, dims) { if (widget.noHScroll) { - (wrap.alignable || (wrap.alignable = [])).push(node); + (lineView.alignable || (lineView.alignable = [])).push(node); var width = dims.wrapperWidth; node.style.left = dims.fixedPos + "px"; if (!widget.coverGutter) { @@ -776,48 +814,131 @@ window.CodeMirror = (function() { // SELECTION / CURSOR + function Selection(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + } + + Selection.prototype = { + primary: function() { return this.ranges[this.primIndex]; }, + equals: function(other) { + if (other == this) return true; + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; + for (var i = 0; i < this.ranges.length; i++) { + var here = this.ranges[i], there = other.ranges[i]; + if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; + } + return true; + }, + deepCopy: function() { + for (var out = [], i = 0; i < this.ranges.length; i++) + out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); + return new Selection(out, this.primIndex); + }, + somethingSelected: function() { + for (var i = 0; i < this.ranges.length; i++) + if (!this.ranges[i].empty()) return true; + return false; + }, + contains: function(pos, end) { + if (!end) end = pos; + for (var i = 0; i < this.ranges.length; i++) { + var range = this.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + return i; + } + return -1; + } + }; + + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = from == prev.head || from == cur.head; + if (i <= primIndex) --primIndex; + ranges.splice(i-- - 1, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex); + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } + + function Range(anchor, head) { + this.anchor = anchor; this.head = head; + } + + Range.prototype = { + from: function() { + return cmp(this.anchor, this.head) < 0 ? this.anchor : this.head; + }, + to: function() { + return cmp(this.anchor, this.head) > 0 ? this.anchor : this.head; + }, + empty: function() { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + } + }; + function updateSelection(cm) { - var display = cm.display; - var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to); - if (collapsed || cm.options.showCursorWhenSelecting) - updateSelectionCursor(cm); - else - display.cursor.style.display = display.otherCursor.style.display = "none"; - if (!collapsed) - updateSelectionRange(cm); - else - display.selectionDiv.style.display = "none"; + var display = cm.display, doc = cm.doc; + var curFragment = document.createDocumentFragment(); + var selFragment = document.createDocumentFragment(); + + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + updateSelectionCursor(cm, range, curFragment); + if (!collapsed) + updateSelectionRange(cm, range, selFragment); + } // Move the hidden textarea near the cursor to prevent scrolling artifacts if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, cm.doc.sel.head, "div"); - var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv); - display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)) + "px"; - display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)) + "px"; + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + var top = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + var left = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + display.inputDiv.style.top = top + "px"; + display.inputDiv.style.left = left + "px"; } + + removeChildrenAndAdd(display.cursorDiv, curFragment); + removeChildrenAndAdd(display.selectionDiv, selFragment); } // No selection, plain cursor - function updateSelectionCursor(cm) { - var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div"); - display.cursor.style.left = pos.left + "px"; - display.cursor.style.top = pos.top + "px"; - display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - display.cursor.style.display = ""; + function updateSelectionCursor(cm, range, output) { + var pos = cursorCoords(cm, range.head, "div"); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; if (pos.other) { - display.otherCursor.style.display = ""; - display.otherCursor.style.left = pos.other.left + "px"; - display.otherCursor.style.top = pos.other.top + "px"; - display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } else { display.otherCursor.style.display = "none"; } + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } } // Highlight selection - function updateSelectionRange(cm) { - var display = cm.display, doc = cm.doc, sel = cm.doc.sel; + function updateSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc; var fragment = document.createDocumentFragment(); var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display); @@ -864,13 +985,14 @@ window.CodeMirror = (function() { return {start: start, end: end}; } - if (sel.from.line == sel.to.line) { - drawForLine(sel.from.line, sel.from.ch, sel.to.ch); + var sFrom = range.from(), sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); } else { - var fromLine = getLine(doc, sel.from.line), toLine = getLine(doc, sel.to.line); - var singleVLine = visualLine(doc, fromLine) == visualLine(doc, toLine); - var leftEnd = drawForLine(sel.from.line, sel.from.ch, singleVLine ? fromLine.text.length : null).end; - var rightStart = drawForLine(sel.to.line, singleVLine ? 0 : null, sel.to.ch).start; + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; if (singleVLine) { if (leftEnd.top < rightStart.top - 2) { add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); @@ -883,8 +1005,7 @@ window.CodeMirror = (function() { add(pl, leftEnd.bottom, null, rightStart.top); } - removeChildrenAndAdd(display.selectionDiv, fragment); - display.selectionDiv.style.display = ""; + output.appendChild(fragment); } // Cursor-blinking @@ -893,37 +1014,35 @@ window.CodeMirror = (function() { var display = cm.display; clearInterval(display.blinker); var on = true; - display.cursor.style.visibility = display.otherCursor.style.visibility = ""; + display.cursorDiv.style.visibility = ""; if (cm.options.cursorBlinkRate > 0) display.blinker = setInterval(function() { - display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden"; + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, cm.options.cursorBlinkRate); } // HIGHLIGHT WORKER function startWorker(cm, time) { - if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo) + if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) cm.state.highlight.set(time, bind(highlightWorker, cm)); } function highlightWorker(cm) { var doc = cm.doc; if (doc.frontier < doc.first) doc.frontier = doc.first; - if (doc.frontier >= cm.display.showingTo) return; + if (doc.frontier >= cm.display.viewTo) return; var end = +new Date + cm.options.workTime; var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); - var changed = [], prevChange; - doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) { - if (doc.frontier >= cm.display.showingFrom) { // Visible + + operation(cm, function() { + doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { + if (doc.frontier >= cm.display.viewFrom) { // Visible var oldStyles = line.styles; line.styles = highlightLine(cm, line, state, true); var ischange = !oldStyles || oldStyles.length != line.styles.length; for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; - if (ischange) { - if (prevChange && prevChange.end == doc.frontier) prevChange.end++; - else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1}); - } + if (ischange) regLineChange(cm, doc.frontier, "text"); line.stateAfter = copyState(doc.mode, state); } else { processLine(cm, line.text, state); @@ -935,11 +1054,7 @@ window.CodeMirror = (function() { return true; } }); - if (changed.length) - operation(cm, function() { - for (var i = 0; i < changed.length; ++i) - regChange(this, changed[i].start, changed[i].end); - })(); + }); } // Finds the line to start with when starting a parse. Tries to @@ -971,7 +1086,7 @@ window.CodeMirror = (function() { else state = copyState(doc.mode, state); doc.iter(pos, n, function(line) { processLine(cm, line.text, state); - var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo; + var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; line.stateAfter = save ? copyState(doc.mode, state) : null; ++pos; }); @@ -988,177 +1103,189 @@ window.CodeMirror = (function() { return e.offsetLeft; } - function measureChar(cm, line, ch, data, bias) { - var dir = -1; - data = data || measureLine(cm, line); - if (data.crude) { - var left = data.left + ch * data.width; - return {left: left, right: left + data.width, top: data.top, bottom: data.bottom}; - } - - for (var pos = ch;; pos += dir) { - var r = data[pos]; - if (r) break; - if (dir < 0 && pos == 0) dir = 1; - } - bias = pos > ch ? "left" : pos < ch ? "right" : bias; - if (bias == "left" && r.leftSide) r = r.leftSide; - else if (bias == "right" && r.rightSide) r = r.rightSide; - return {left: pos < ch ? r.right : r.left, - right: pos > ch ? r.left : r.right, - top: r.top, - bottom: r.bottom}; - } - - function findCachedMeasurement(cm, line) { - var cache = cm.display.measureLineCache; - for (var i = 0; i < cache.length; ++i) { - var memo = cache[i]; - if (memo.text == line.text && memo.markedSpans == line.markedSpans && - cm.display.scroller.clientWidth == memo.width && - memo.classes == line.textClass + "|" + line.wrapClass) - return memo; - } - } - - function clearCachedMeasurement(cm, line) { - var exists = findCachedMeasurement(cm, line); - if (exists) exists.text = exists.measure = exists.markedSpans = null; - } - - function measureLine(cm, line) { - // First look in the cache - var cached = findCachedMeasurement(cm, line); - if (cached) return cached.measure; - - // Failing that, recompute and store result in cache - var measure = measureLineInner(cm, line); - var cache = cm.display.measureLineCache; - var memo = {text: line.text, width: cm.display.scroller.clientWidth, - markedSpans: line.markedSpans, measure: measure, - classes: line.textClass + "|" + line.wrapClass}; - if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo; - else cache.push(memo); - return measure; - } - - function measureLineInner(cm, line) { - if (!cm.options.lineWrapping && line.text.length >= cm.options.crudeMeasuringFrom) - return crudelyMeasureLine(cm, line); - - var display = cm.display, measure = emptyArray(line.text.length); - var pre = buildLineContent(cm, line, measure, true).pre; - - // IE does not cache element positions of inline elements between - // calls to getBoundingClientRect. This makes the loop below, - // which gathers the positions of all the characters on the line, - // do an amount of layout work quadratic to the number of - // characters. When line wrapping is off, we try to improve things - // by first subdividing the line into a bunch of inline blocks, so - // that IE can reuse most of the layout information from caches - // for those blocks. This does interfere with line wrapping, so it - // doesn't work when wrapping is on, but in that case the - // situation is slightly better, since IE does cache line-wrapping - // information and only recomputes per-line. - if (old_ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) { - var fragment = document.createDocumentFragment(); - var chunk = 10, n = pre.childNodes.length; - for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) { - var wrap = elt("div", null, null, "display: inline-block"); - for (var j = 0; j < chunk && n; ++j) { - wrap.appendChild(pre.firstChild); - --n; - } - fragment.appendChild(wrap); + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && cm.display.scroller.clientWidth; + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) + heights.push((rects[i].bottom + rects[i + 1].top) / 2 - rect.top); } - pre.appendChild(fragment); + heights.push(rect.bottom - rect.top); } + } - removeChildrenAndAdd(display.measure, pre); + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + return {map: lineView.measure.map, cache: lineView.measure.cache}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineView.rest[i] == line) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineNo(lineView.rest[i]) > lineN) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; + } - var outer = getRect(display.lineDiv); - var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight; - // Work around an IE7/8 bug where it will sometimes have randomly - // replaced our pre with a clone at this point. - if (ie_lt9 && display.measure.first != pre) - removeChildrenAndAdd(display.measure, pre); + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } - function measureRect(rect) { - var top = rect.top - outer.top, bot = rect.bottom - outer.top; - if (bot > maxBot) bot = maxBot; - if (top < 0) top = 0; - for (var i = vranges.length - 2; i >= 0; i -= 2) { - var rtop = vranges[i], rbot = vranges[i+1]; - if (rtop > bot || rbot < top) continue; - if (rtop <= top && rbot >= bot || - top <= rtop && bot >= rbot || - Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) { - vranges[i] = Math.min(top, rtop); - vranges[i+1] = Math.max(bot, rbot); - break; - } + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } + + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + return cm.display.view[findViewIndex(cm, lineN)]; + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + return ext; + } + + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) + view = null; + else if (view && view.changes) + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + if (!view) + view = updateExternalMeasurement(cm, line); + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + }; + } + + function measureCharPrepared(cm, prepared, ch, bias) { + if (prepared.before) ch = -1; + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + prepared.rect = prepared.view.text.getBoundingClientRect(); + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; } - if (i < 0) { i = vranges.length; vranges.push(top, bot); } - return {left: rect.left - outer.left, - right: rect.right - outer.left, - top: i, bottom: null}; - } - function finishRect(rect) { - rect.bottom = vranges[rect.top+1]; - rect.top = vranges[rect.top]; - } - - for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) { - var node = cur, rect = null; - // A widget might wrap, needs special care - if (/\bCodeMirror-widget\b/.test(cur.className) && cur.getClientRects) { - if (cur.firstChild.nodeType == 1) node = cur.firstChild; - var rects = node.getClientRects(); - if (rects.length > 1) { - rect = data[i] = measureRect(rects[0]); - rect.rightSide = measureRect(rects[rects.length - 1]); - } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) prepared.cache[key] = found; + } + return {left: found.left, right: found.right, top: found.top, bottom: found.bottom}; + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function measureCharInner(cm, prepared, ch, bias) { + var map = prepared.map; + + var node, start, end, collapse; + for (var i = 0; i < map.length; i += 3) { + var mStart = map[i], mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) collapse = "right"; + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + collapse = bias; + if (bias == "left" && start == 0) + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + if (bias == "right" && start == mEnd - mStart) + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + break; } - if (!rect) rect = data[i] = measureRect(getRect(node)); - if (cur.measureRight) rect.right = getRect(cur.measureRight).left - outer.left; - if (cur.leftSide) rect.leftSide = measureRect(getRect(cur.leftSide)); - } - removeChildren(cm.display.measure); - for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) { - finishRect(cur); - if (cur.leftSide) finishRect(cur.leftSide); - if (cur.rightSide) finishRect(cur.rightSide); } - return data; - } - function crudelyMeasureLine(cm, line) { - var copy = new Line(line.text.slice(0, 100), null); - if (line.textClass) copy.textClass = line.textClass; - var measure = measureLineInner(cm, copy); - var left = measureChar(cm, copy, 0, measure, "left"); - var right = measureChar(cm, copy, 99, measure, "right"); - return {crude: true, top: left.top, left: left.left, bottom: left.bottom, width: (right.right - left.left) / 100}; + var rect; + if (node.nodeType == 3) { + while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; + while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; + if (ie_lt9 && start == 0 && end == mEnd - mStart) { + rect = node.parentNode.getBoundingClientRect(); + } else if (ie && cm.options.lineWrapping) { + var rects = range(node, start, end).getClientRects(); + if (rects.length) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = nullRect; + } else { + rect = range(node, start, end).getBoundingClientRect(); + } + } else { + if (start > 0) collapse = bias = "right"; + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = node.getBoundingClientRect(); + } + if (ie_lt9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; + else + rect = nullRect; + } + + var top, bot = (rect.bottom + rect.top) / 2 - prepared.rect.top; + var heights = prepared.view.measure.heights; + for (var i = 0; i < heights.length - 1; i++) + if (bot < heights[i]) break; + top = i ? heights[i - 1] : 0; bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) result.bogus = true; + return result; } - function measureLineWidth(cm, line) { - var hasBadSpan = false; - if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) { - var sp = line.markedSpans[i]; - if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true; + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + lineView.measure.caches[i] = {}; } - var cached = !hasBadSpan && findCachedMeasurement(cm, line); - if (cached || line.text.length >= cm.options.crudeMeasuringFrom) - return measureChar(cm, line, line.text.length, cached && cached.measure, "right").right; + } - var pre = buildLineContent(cm, line, null, true).pre; - var end = pre.appendChild(zeroWidthElement(cm.display.measure)); - removeChildrenAndAdd(cm.display.measure, pre); - return getRect(end).right - getRect(cm.display.lineDiv).left; + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + clearLineMeasurementCacheFor(cm.display.view[i]); } function clearCaches(cm) { - cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0; + clearLineMeasurementCache(cm); cm.display.cachedCharWidth = cm.display.cachedTextHeight = null; if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; cm.display.lineNumChars = null; @@ -1175,11 +1302,11 @@ window.CodeMirror = (function() { } if (context == "line") return rect; if (!context) context = "local"; - var yOff = heightAtLine(cm, lineObj); + var yOff = heightAtLine(lineObj); if (context == "local") yOff += paddingTop(cm.display); else yOff -= cm.display.viewOffset; if (context == "page" || context == "window") { - var lOff = getRect(cm.display.lineSpace); + var lOff = cm.display.lineSpace.getBoundingClientRect(); yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); rect.left += xOff; rect.right += xOff; @@ -1198,25 +1325,25 @@ window.CodeMirror = (function() { left -= pageScrollX(); top -= pageScrollY(); } else if (context == "local" || !context) { - var localBox = getRect(cm.display.sizer); + var localBox = cm.display.sizer.getBoundingClientRect(); left += localBox.left; top += localBox.top; } - var lineSpaceBox = getRect(cm.display.lineSpace); + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; } function charCoords(cm, pos, context, lineObj, bias) { if (!lineObj) lineObj = getLine(cm.doc, pos.line); - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, null, bias), context); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); } - function cursorCoords(cm, pos, context, lineObj, measurement) { + function cursorCoords(cm, pos, context, lineObj, preparedMeasure) { lineObj = lineObj || getLine(cm.doc, pos.line); - if (!measurement) measurement = measureLine(cm, lineObj); + if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); function get(ch, right) { - var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left"); + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left"); if (right) m.left = m.right; else m.right = m.left; return intoCoordSystem(cm, lineObj, m, context); } @@ -1242,6 +1369,14 @@ window.CodeMirror = (function() { return val; } + function estimateCoords(cm, pos) { + var left = 0; + if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height}; + } + function PosWithInfo(line, ch, outside, xRel) { var pos = new Pos(line, ch); pos.xRel = xRel; @@ -1254,31 +1389,30 @@ window.CodeMirror = (function() { var doc = cm.doc; y += cm.display.viewOffset; if (y < 0) return PosWithInfo(doc.first, 0, true, -1); - var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineNo > last) + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); if (x < 0) x = 0; + var lineObj = getLine(doc, lineN); for (;;) { - var lineObj = getLine(doc, lineNo); - var found = coordsCharInner(cm, lineObj, lineNo, x, y); + var found = coordsCharInner(cm, lineObj, lineN, x, y); var merged = collapsedSpanAtEnd(lineObj); - var mergedPos = merged && merged.find(); + var mergedPos = merged && merged.find(0, true); if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - lineNo = mergedPos.to.line; + lineN = lineNo(lineObj = mergedPos.to.line); else return found; } } function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(cm, lineObj); + var innerOff = y - heightAtLine(lineObj); var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; - var measurement = measureLine(cm, lineObj); + var preparedMeasure = prepareMeasureForLine(cm, lineObj); function getX(ch) { - var sp = cursorCoords(cm, Pos(lineNo, ch), "line", - lineObj, measurement); + var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); wrongLine = true; if (innerOff > sp.bottom) return sp.left - adjust; else if (innerOff < sp.top) return sp.left + adjust; @@ -1298,7 +1432,7 @@ window.CodeMirror = (function() { var xDiff = x - (ch == from ? fromX : toX); while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, - xDiff < 0 ? -1 : xDiff ? 1 : 0); + xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); return pos; } var step = Math.ceil(dist / 2), middle = from + step; @@ -1354,15 +1488,16 @@ window.CodeMirror = (function() { cm.curOp = { // An array of ranges of lines that have to be updated. See // updateDisplay. - changes: [], + viewChanged: false, forceUpdate: false, updateInput: null, userSelChange: null, - textChanged: null, + changeObjs: null, selectionChanged: false, cursorActivity: false, updateMaxLine: false, - updateScrollPos: false, + scrollLeft: null, scrollTop: null, + scrollToPos: null, id: ++nextOpId }; if (!delayedCallbackDepth++) delayedCallbacks = []; @@ -1372,39 +1507,41 @@ window.CodeMirror = (function() { var op = cm.curOp, doc = cm.doc, display = cm.display; cm.curOp = null; + if (op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo)) { + var updated = updateDisplay(cm, op.viewChanged, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop; + } + if (!updated && op.selectionChanged) updateSelection(cm); + if (op.updateMaxLine) computeMaxLength(cm); if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) { - var width = measureLineWidth(cm, display.maxLine); - display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + "px"; + var width = measureChar(cm, display.maxLine, display.maxLine.text.length).left; display.maxLineChanged = false; - var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth); - if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos) + var minWidth = Math.max(0, width + 3 + scrollerCutOff); + var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + minWidth - display.scroller.clientWidth); + display.sizer.style.minWidth = minWidth + "px"; + if (maxScrollLeft < doc.scrollLeft && op.scrollLeft == null) setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true); + updateScrollbars(cm); } - var newScrollPos, updated; - if (op.updateScrollPos) { - newScrollPos = op.updateScrollPos; - } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible - var coords = cursorCoords(cm, doc.sel.head); - newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom); - } - if (op.changes.length || op.forceUpdate || newScrollPos && newScrollPos.scrollTop != null) { - updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop, op.forceUpdate); - if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop; - } - if (!updated && op.selectionChanged) updateSelection(cm); - if (op.updateScrollPos) { - var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, newScrollPos.scrollTop)); - var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, newScrollPos.scrollLeft)); + + if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) { + var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top; + } + if (op.scrollLeft != null && display.scroller.scrollLeft != op.scrollLeft) { + var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)); display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left; alignHorizontally(cm); - if (op.scrollToPos) - scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from), - clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin); - } else if (newScrollPos) { - scrollCursorIntoView(cm); } + if (op.scrollToPos) { + var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from), + clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin); + if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); + } + if (op.selectionChanged) restartBlink(cm); if (cm.state.focused && op.updateInput) @@ -1421,8 +1558,8 @@ window.CodeMirror = (function() { delayed = delayedCallbacks; delayedCallbacks = null; } - if (op.textChanged) - signal(cm, "change", cm, op.textChanged); + if (op.changeObjs) for (var i = 0; i < op.changeObjs.length; i++) + signal(cm, "change", cm, op.changeObjs[i]); if (op.cursorActivity) signal(cm, "cursorActivity", cm); if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i](); } @@ -1454,10 +1591,123 @@ window.CodeMirror = (function() { return result; } + // CHANGE TRACKING + + // Updates the display.view data structure for a given change to + // the document. From and to are in pre-change coordinates. Lendiff + // is the amount of lines added or subtracted by the change. function regChange(cm, from, to, lendiff) { if (from == null) from = cm.doc.first; if (to == null) to = cm.doc.first + cm.doc.size; - cm.curOp.changes.push({from: from, to: to, diff: lendiff}); + if (!lendiff) lendiff = 0; + + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + display.updateLineNumbers = from; + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + } else if (to <= display.viewFrom) { // Change before + display.viewFrom += lendiff; + display.viewTo += lendiff; + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + display.view = display.view.slice(findViewIndex(cm, to)); + display.viewFrom = to + lendiff; + display.viewTo += lendiff; + } else if (to >= display.viewTo) { // Bottom overlap + display.view = display.view.slice(0, findViewIndex(cm, from)); + display.viewTo = from; + } else { // Gap in the middle + display.view = display.view.slice(0, findViewIndex(cm, from)) + .concat(buildViewArray(cm, from, to + lendiff)) + .concat(display.view.slice(findViewIndex(cm, to))); + display.viewTo += lendiff; + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + ext.lineN += lendiff; + else if (from < ext.lineN + ext.size) + display.externalMeasured = null; + } + } + + // Type must be one of "text", "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + display.externalMeasured = null; + + if (line < display.viewFrom || line >= display.viewTo) return; + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) return; + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) arr.push(type); + } + + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) return null; + n -= cm.display.viewFrom; + if (n < 0) return null; + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) return i; + } + } + + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + else if (display.viewFrom < from) + display.view = display.view.slice(findViewIndex(cm, from)); + display.viewFrom = from; + if (display.viewTo < to) + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + else if (display.viewTo > to) + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + display.viewTo = to; + } + + function LineView(doc, line, lineN) { + this.line = line; + this.rest = visualLineContinued(line); + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; } // INPUT HANDLING @@ -1487,48 +1737,54 @@ window.CodeMirror = (function() { // events that indicate IME taking place, but these are not widely // supported or compatible enough yet to rely on.) function readInput(cm) { - var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel; + var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc; if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.options.disableInput) return false; if (cm.state.pasteIncoming && cm.state.fakedLastChar) { input.value = input.value.substring(0, input.value.length - 1); cm.state.fakedLastChar = false; } var text = input.value; - if (text == prevInput && posEq(sel.from, sel.to)) return false; - if (ie && !ie_lt9 && cm.display.inputHasSelection === text) { + if (text == prevInput && !cm.somethingSelected()) return false; + if (old_ie && !ie_lt9 && cm.display.inputHasSelection === text) { resetInput(cm, true); return false; } var withOp = !cm.curOp; if (withOp) startOperation(cm); - sel.shift = false; + cm.display.shift = false; var same = 0, l = Math.min(prevInput.length, text.length); while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - var from = sel.from, to = sel.to; - var inserted = text.slice(same); - if (same < prevInput.length) - from = Pos(from.line, from.ch - (prevInput.length - same)); - else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming) - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + inserted.length)); - - var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: splitLines(inserted), - origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; - makeChange(cm.doc, changeEvent, "end"); - cm.curOp.updateInput = updateInput; - signalLater(cm, "inputRead", cm, changeEvent); - if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && - cm.options.smartIndent && sel.head.ch < 100) { - var electric = cm.getModeAt(sel.head).electricChars; - if (electric) for (var i = 0; i < electric.length; i++) - if (inserted.indexOf(electric.charAt(i)) > -1) { - indentLine(cm, sel.head.line, "smart"); - break; - } + var inserted = text.slice(same), textLines = splitLines(inserted); + var multiPaste = cm.state.pasteIncoming && textLines.length > 1 && doc.sel.ranges.length == textLines.length; + + for (var i = doc.sel.ranges.length - 1; i >= 0; i--) { + var range = doc.sel.ranges[i]; + var from = range.from(), to = range.to(); + if (same < prevInput.length) + from = Pos(from.line, from.ch - (prevInput.length - same)); + else if (cm.state.overwrite && cmp(from, to) == 0 && !cm.state.pasteIncoming) + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + var updateInput = cm.curOp.updateInput; + var changeEvent = {from: from, to: to, text: multiPaste ? [textLines[i]] : textLines, + origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && + cm.options.smartIndent && range.head.ch < 100 && + (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) { + var electric = cm.getModeAt(range.head).electricChars; + if (electric) for (var j = 0; j < electric.length; j++) + if (inserted.indexOf(electric.charAt(j)) > -1) { + indentLine(cm, range.head.line, "smart"); + break; + } + } } + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; - if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = ""; + if (text.length > 1000 || text.indexOf("\n") > -1) clearInput(cm); else cm.display.prevInput = text; if (withOp) endOperation(cm); cm.state.pasteIncoming = cm.state.cutIncoming = false; @@ -1537,21 +1793,31 @@ window.CodeMirror = (function() { function resetInput(cm, user) { var minimal, selected, doc = cm.doc; - if (!posEq(doc.sel.from, doc.sel.to)) { + var range = doc.sel.primary(); + if (!range.empty()) { cm.display.prevInput = ""; minimal = hasCopyEvent && - (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000); + (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); var content = minimal ? "-" : selected || cm.getSelection(); cm.display.input.value = content; if (cm.state.focused) selectInput(cm.display.input); - if (ie && !ie_lt9) cm.display.inputHasSelection = content; + if (old_ie && !ie_lt9) cm.display.inputHasSelection = content; } else if (user) { - cm.display.prevInput = cm.display.input.value = ""; - if (ie && !ie_lt9) cm.display.inputHasSelection = null; + clearInput(cm); } cm.display.inaccurateSelection = minimal; } + function clearInput(cm) { + if (ie_lt9) { + cm.display.prevInput = cm.display.input.value = "_"; + cm.display.input.setSelectionRange(1, 1); + if (old_ie && !ie_lt9) cm.display.inputHasSelection = null; + } else { + cm.display.prevInput = cm.display.input.value = ""; + } + } + function focusInput(cm) { if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input)) cm.display.input.focus(); @@ -1583,7 +1849,7 @@ window.CodeMirror = (function() { // Gecko browsers fire contextmenu *after* opening the menu, at // which point we can't mess with it anymore. Context menu is // handled in onMouseDown for Gecko. - if (!captureMiddleClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); on(d.scroller, "scroll", function() { if (d.scroller.clientHeight) { @@ -1630,11 +1896,11 @@ window.CodeMirror = (function() { setTimeout(unregister, 5000); on(d.input, "keyup", operation(cm, function(e) { - if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; - if (e.keyCode == 16) cm.doc.sel.shift = false; + if (signalDOMEvent(cm, e)) return; + if (e.keyCode == 16) cm.display.shift = false; })); on(d.input, "input", function() { - if (ie && !ie_lt9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; + if (old_ie && !ie_lt9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; fastPoll(cm); }); on(d.input, "keydown", operation(cm, onKeyDown)); @@ -1643,7 +1909,7 @@ window.CodeMirror = (function() { on(d.input, "blur", bind(onBlur, cm)); function drag_(e) { - if (signalDOMEvent(cm, e) || cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return; + if (signalDOMEvent(cm, e)) return; e_stop(e); } if (cm.options.dragDrop) { @@ -1697,7 +1963,7 @@ window.CodeMirror = (function() { } } - function posFromMouse(cm, e, liberal) { + function posFromMouse(cm, e, liberal, forRect) { var display = cm.display; if (!liberal) { var target = e_target(e); @@ -1705,17 +1971,20 @@ window.CodeMirror = (function() { target == display.scrollbarV || target == display.scrollbarV.firstChild || target == display.scrollbarFiller || target == display.gutterFiller) return null; } - var x, y, space = getRect(display.lineSpace); + var x, y, space = display.lineSpace.getBoundingClientRect(); // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX; y = e.clientY; } catch (e) { return null; } - return coordsChar(cm, x - space.left, y - space.top); + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null; } + var coords = coordsChar(cm, x, y); + if (forRect && coords.ch == getLine(cm.doc, coords.line).text.length && coords.xRel == 1) + coords = Pos(coords.line, Math.round((x - paddingLeft(cm.display)) / charWidth(cm.display))); + return coords; } - var lastClick, lastDoubleClick; function onMouseDown(e) { if (signalDOMEvent(this, e)) return; - var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel; - sel.shift = e.shiftKey; + var cm = this, display = cm.display; + display.shift = e.shiftKey; if (eventInWidget(display, e)) { if (!webkit) { @@ -1728,90 +1997,135 @@ window.CodeMirror = (function() { var start = posFromMouse(cm, e); switch (e_button(e)) { - case 3: - if (captureMiddleClick) onContextMenu.call(cm, cm, e); - return; + case 1: + if (start) + leftButtonDown(cm, e, start); + else if (e_target(e) == display.scroller) + e_preventDefault(e); + break; case 2: if (webkit) cm.state.lastMiddleDown = +new Date; if (start) extendSelection(cm.doc, start); setTimeout(bind(focusInput, cm), 20); e_preventDefault(e); - return; + break; + case 3: + if (captureRightClick) onContextMenu.call(cm, cm, e); + break; } - // For button 1, if it was clicked inside the editor - // (posFromMouse returning non-null), we have to adjust the - // selection. - if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;} + } + var lastClick, lastDoubleClick; + function leftButtonDown(cm, e, start) { if (!cm.state.focused) onFocus(cm); - var now = +new Date, type = "single"; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) { + var now = +new Date, type; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { type = "triple"; - e_preventDefault(e); - setTimeout(bind(focusInput, cm), 20); - selectLine(cm, start.line); - } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) { + } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { type = "double"; lastDoubleClick = {time: now, pos: start}; - e_preventDefault(e); - var word = findWordAt(getLine(doc, start.line).text, start); - extendSelection(cm.doc, word.from, word.to); - } else { lastClick = {time: now, pos: start}; } - - var last = start; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) && - !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") { - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - cm.state.draggingText = false; - off(document, "mouseup", dragEnd); - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - extendSelection(cm.doc, start); - focusInput(cm); - // Work around unexplainable focus problem in IE9 (#2127) - if (old_ie && !ie_lt9) - setTimeout(function() {document.body.focus(); focusInput(cm);}, 20); - } - }); - // Let the drag handler handle this. - if (webkit) display.scroller.draggable = true; - cm.state.draggingText = dragEnd; - // IE's approach to draggable - if (display.scroller.dragDrop) display.scroller.dragDrop(); - on(document, "mouseup", dragEnd); - on(display.scroller, "drop", dragEnd); - return; + } else { + type = "single"; + lastClick = {time: now, pos: start}; } - e_preventDefault(e); - if (type == "single") extendSelection(cm.doc, clipPos(doc, start)); - - var startstart = sel.from, startend = sel.to, lastPos = start; - function doSelect(cur) { - if (posEq(lastPos, cur)) return; - lastPos = cur; + var sel = cm.doc.sel; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !sel.primary().empty() && + type == "single" && sel.contains(start) > -1 && sel.somethingSelected()) + leftButtonStartDrag(cm, e, start); + else + leftButtonNoDrag(cm, e, start, type); + } - if (type == "single") { - extendSelection(cm.doc, clipPos(doc, start), cur); - return; + function leftButtonStartDrag(cm, e, start) { + var display = cm.display; + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + extendSelection(cm.doc, start); + focusInput(cm); + // Work around unexplainable focus problem in IE9 (#2127) + if (old_ie && !ie_lt9) + setTimeout(function() {document.body.focus(); focusInput(cm);}, 20); } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + cm.state.draggingText = dragEnd; + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + } - startstart = clipPos(doc, startstart); - startend = clipPos(doc, startend); - if (type == "double") { - var word = findWordAt(getLine(doc, cur.line).text, cur); - if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend); - else extendSelection(cm.doc, startstart, word.to); - } else if (type == "triple") { - if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0))); - else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0))); + function leftButtonNoDrag(cm, e, start, type) { + var display = cm.display, doc = cm.doc; + e_preventDefault(e); + + if (mac ? e.metaKey : e.ctrlKey) { + var inside = doc.sel.contains(start); + if (inside > -1) + setSelection(doc, new Selection(doc.sel.ranges, inside), false); + else + setSelection(doc, normalizeSelection(doc.sel.ranges.concat([new Range(start, start)]), + doc.sel.ranges.length), false); + } else if (e.altKey) { + setSimpleSelection(doc, start, start); + type = "rect"; + start = posFromMouse(cm, e, true, true); + } else { + extendSelection(doc, start, start); + } + + var lastPos = start, startSel = doc.sel; + function extendTo(pos, force) { + if (!force && cmp(lastPos, pos) == 0) return; + lastPos = pos; + + if (type == "rect") { + var ranges = []; + var left = Math.min(start.ch, pos.ch), right = Math.max(start.ch, pos.ch); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text; + if (text.length >= left) + ranges.push(new Range(Pos(line, left), Pos(line, Math.min(text.length, right)))); + } + if (!ranges.length) ranges.push(new Range(start, start)); + setSelection(doc, new Selection(ranges, ranges.length - 1)); + } else { + var oldRange = startSel.primary(); + var anchor = oldRange.anchor, head = pos; + if (type != "single") { + if (type == "double") + var range = findWordAt(getLine(doc, pos.line).text, pos); + else + var range = {from: Pos(pos.line, 0), to: clipPos(doc, Pos(pos.line + 1, 0))}; + if (cmp(range.to, anchor) > 0) { + head = range.to; + anchor = minPos(oldRange.from(), range.from); + } else { + head = range.from; + anchor = maxPos(oldRange.to(), range.to); + } + } + var ranges = startSel.ranges.slice(0); + ranges[startSel.primIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges, startSel.primIndex)); } } - var editorSize = getRect(display.wrapper); + if (type == "double" || type == "triple") { + extendTo(start, true); + startSel = doc.sel; + } + + var editorSize = display.wrapper.getBoundingClientRect(); // Used to ensure timeout re-tries don't fire when another extend // happened in the meantime (clearTimeout isn't reliable -- at // least on Chrome, the timeouts still happen even when cleared, @@ -1820,12 +2134,11 @@ window.CodeMirror = (function() { function extend(e) { var curCount = ++counter; - var cur = posFromMouse(cm, e, true); + var cur = posFromMouse(cm, e, true, type == "rect"); if (!cur) return; - if (!posEq(cur, last)) { + if (cmp(cur, lastPos) != 0) { if (!cm.state.focused) onFocus(cm); - last = cur; - doSelect(cur); + extendTo(cur); var visible = visibleLines(display, doc); if (cur.line >= visible.to || cur.line < visible.from) setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); @@ -1859,18 +2172,18 @@ window.CodeMirror = (function() { function gutterEvent(cm, e, type, prevent, signalfn) { try { var mX = e.clientX, mY = e.clientY; } catch(e) { return false; } - if (mX >= Math.floor(getRect(cm.display.gutters).right)) return false; + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; if (prevent) e_preventDefault(e); var display = cm.display; - var lineBox = getRect(display.lineDiv); + var lineBox = display.lineDiv.getBoundingClientRect(); if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); mY -= lineBox.top - display.viewOffset; for (var i = 0; i < cm.options.gutters.length; ++i) { var g = display.gutters.childNodes[i]; - if (g && getRect(g).right >= mX) { + if (g && g.getBoundingClientRect().right >= mX) { var line = lineAtHeight(cm.doc, mY); var gutter = cm.options.gutters[i]; signalfn(cm, type, cm, line, gutter, e); @@ -1894,10 +2207,10 @@ window.CodeMirror = (function() { function onDrop(e) { var cm = this; - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e)))) + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; e_preventDefault(e); - if (ie) lastDrop = +new Date; + if (old_ie) lastDrop = +new Date; var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; if (!pos || isReadOnly(cm)) return; if (files && files.length && window.FileReader && window.File) { @@ -1908,7 +2221,9 @@ window.CodeMirror = (function() { text[i] = reader.result; if (++read == n) { pos = clipPos(cm.doc, pos); - makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around"); + var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; + makeChange(cm.doc, change); + setSelectionAddToHistory(cm.doc, simpleSelection(pos, changeEnd(change))); } }; reader.readAsText(file); @@ -1916,7 +2231,7 @@ window.CodeMirror = (function() { for (var i = 0; i < n; ++i) loadFile(files[i], i); } else { // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) { + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { cm.state.draggingText(e); // Ensure the editor is re-focused setTimeout(bind(focusInput, cm), 20); @@ -1925,10 +2240,11 @@ window.CodeMirror = (function() { try { var text = e.dataTransfer.getData("Text"); if (text) { - var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to; - setSelection(cm.doc, pos, pos); - if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste"); - cm.replaceSelection(text, null, "paste"); + var selected = cm.state.draggingText && cm.listSelections(); + setSimpleSelection(cm.doc, pos); + if (selected) for (var i = 0; i < selected.length; ++i) + replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); + cm.replaceSelection(text, "around", "paste"); focusInput(cm); } } @@ -1937,7 +2253,7 @@ window.CodeMirror = (function() { } function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (old_ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; var txt = cm.getSelection(); @@ -1948,24 +2264,24 @@ window.CodeMirror = (function() { if (e.dataTransfer.setDragImage && !safari) { var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (opera) { + if (presto) { img.width = img.height = 1; cm.display.wrapper.appendChild(img); // Force a relayout, or Opera won't use our image for some obscure reason img._top = img.offsetTop; } e.dataTransfer.setDragImage(img, 0, 0); - if (opera) img.parentNode.removeChild(img); + if (presto) img.parentNode.removeChild(img); } } function setScrollTop(cm, val) { if (Math.abs(cm.doc.scrollTop - val) < 2) return; cm.doc.scrollTop = val; - if (!gecko) updateDisplay(cm, [], val); + if (!gecko) updateDisplay(cm, false, {top: val}); if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; - if (gecko) updateDisplay(cm, []); + if (gecko) updateDisplay(cm, false); startWorker(cm, 100); } function setScrollLeft(cm, val, isScroller) { @@ -2014,10 +2330,12 @@ window.CodeMirror = (function() { // This hack (see related code in patchDisplay) makes sure the // element is kept around. if (dy && mac && webkit) { - for (var cur = e.target; cur != scroll; cur = cur.parentNode) { - if (cur.lineObj) { - cm.display.currentWheelTarget = cur; - break; + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } } } } @@ -2028,7 +2346,7 @@ window.CodeMirror = (function() { // estimated pixels/delta value, we just handle horizontal // scrolling entirely here. It'll be slightly off from native, but // better than glitching out. - if (dx && !gecko && !opera && wheelPixelsPerUnit != null) { + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { if (dy) setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); @@ -2042,7 +2360,7 @@ window.CodeMirror = (function() { var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; if (pixels < 0) top = Math.max(0, top + pixels - 50); else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplay(cm, [], {top: top, bottom: bot}); + updateDisplay(cm, false, {top: top, bottom: bot}); } if (wheelSamples < 20) { @@ -2074,13 +2392,13 @@ window.CodeMirror = (function() { // Ensure previous input has been read, so that the handler sees a // consistent view of the document if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; - var doc = cm.doc, prevShift = doc.sel.shift, done = false; + var prevShift = cm.display.shift, done = false; try { if (isReadOnly(cm)) cm.state.suppressEdits = true; - if (dropShift) doc.sel.shift = false; + if (dropShift) cm.display.shift = false; done = bound(cm) != Pass; } finally { - doc.sel.shift = prevShift; + cm.display.shift = prevShift; cm.state.suppressEdits = false; } return done; @@ -2146,14 +2464,13 @@ window.CodeMirror = (function() { function onKeyDown(e) { var cm = this; if (!cm.state.focused) onFocus(cm); - if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + if (signalDOMEvent(cm, e)) return; if (old_ie && e.keyCode == 27) e.returnValue = false; var code = e.keyCode; // IE does strange things with escape. - cm.doc.sel.shift = code == 16 || e.shiftKey; - // First give onKeyEvent option a chance to handle this. + cm.display.shift = code == 16 || e.shiftKey; var handled = handleKeyBinding(cm, e); - if (opera) { + if (presto) { lastStoppedKey = handled ? code : null; // Opera has no cut event... we try to at least catch the key combo if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) @@ -2163,13 +2480,13 @@ window.CodeMirror = (function() { function onKeyPress(e) { var cm = this; - if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + if (signalDOMEvent(cm, e)) return; var keyCode = e.keyCode, charCode = e.charCode; - if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; var ch = String.fromCharCode(charCode == null ? keyCode : charCode); if (handleCharBinding(cm, e, ch)) return; - if (ie && !ie_lt9) cm.display.inputHasSelection = null; + if (old_ie && !ie_lt9) cm.display.inputHasSelection = null; fastPoll(cm); } @@ -2195,23 +2512,23 @@ window.CodeMirror = (function() { cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-focused", ""); } clearInterval(cm.display.blinker); - setTimeout(function() {if (!cm.state.focused) cm.doc.sel.shift = false;}, 150); + setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); } var detectingSelectAll; function onContextMenu(cm, e) { if (signalDOMEvent(cm, e, "contextmenu")) return; - var display = cm.display, sel = cm.doc.sel; + var display = cm.display; if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return; var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || opera) return; // Opera is difficult. + if (!pos || presto) return; // Opera is difficult. // Reset the current text selection only if the click is done outside of the selection // and 'resetSelectionOnContextMenu' option is true. var reset = cm.options.resetSelectionOnContextMenu; - if (reset && (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))) - operation(cm, setSelection)(cm.doc, pos, pos); + if (reset && cm.doc.sel.contains(pos) == -1) + operation(cm, setSelection)(cm.doc, simpleSelection(pos), false); var oldCSS = display.input.style.cssText; display.inputDiv.style.position = "absolute"; @@ -2221,11 +2538,12 @@ window.CodeMirror = (function() { focusInput(cm); resetInput(cm, true); // Adds "Select all" to context menu in FF - if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " "; + var hasSelection = cm.somethingSelected(); + if (!hasSelection) clearInput(cm); function prepareSelectAllHack() { if (display.input.selectionStart != null) { - var extval = display.input.value = "\u200b" + (posEq(sel.from, sel.to) ? "" : display.input.value); + var extval = display.input.value = "\u200b" + (hasSelection ? display.input.value : ""); display.prevInput = "\u200b"; display.input.selectionStart = 1; display.input.selectionEnd = extval.length; } @@ -2251,7 +2569,7 @@ window.CodeMirror = (function() { } if (old_ie && !ie_lt9) prepareSelectAllHack(); - if (captureMiddleClick) { + if (captureRightClick) { e_stop(e); var mouseup = function() { off(window, "mouseup", mouseup); @@ -2271,44 +2589,50 @@ window.CodeMirror = (function() { lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); }; - // Make sure a position will be valid after the given change. - function clipPostChange(doc, change, pos) { - if (!posLess(change.from, pos)) return clipPos(doc, pos); - var diff = (change.text.length - 1) - (change.to.line - change.from.line); - if (pos.line > change.to.line + diff) { - var preLine = pos.line - diff, lastLine = doc.first + doc.size - 1; - if (preLine > lastLine) return Pos(lastLine, getLine(doc, lastLine).text.length); - return clipToLen(pos, getLine(doc, preLine).text.length); - } - if (pos.line == change.to.line + diff) - return clipToLen(pos, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0) + - getLine(doc, change.to.line).text.length - change.to.ch); - var inside = pos.line - change.from.line; - return clipToLen(pos, change.text[inside].length + (inside ? 0 : change.from.ch)); - } - - // Hint can be null|"end"|"start"|"around"|{anchor,head} - function computeSelAfterChange(doc, change, hint) { - if (hint && typeof hint == "object") // Assumed to be {anchor, head} object - return {anchor: clipPostChange(doc, change, hint.anchor), - head: clipPostChange(doc, change, hint.head)}; - - if (hint == "start") return {anchor: change.from, head: change.from}; - - var end = changeEnd(change); - if (hint == "around") return {anchor: change.from, head: end}; - if (hint == "end") return {anchor: end, head: end}; - - // hint is null, leave the selection alone as much as possible - var adjustPos = function(pos) { - if (posLess(pos, change.from)) return pos; - if (!posLess(change.to, pos)) return end; - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) ch += end.ch - change.to.ch; - return Pos(line, ch); - }; - return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)}; + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) return pos; + if (cmp(pos, change.to) <= 0) return changeEnd(change); + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; + return Pos(line, ch); + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + return Pos(nw.line, pos.ch - old.ch + nw.ch); + else + return Pos(nw.line + (pos.line - old.line), pos.ch); + } + + // Hint can be "start"|"around" + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); } function filterChange(doc, change, update) { @@ -2335,9 +2659,9 @@ window.CodeMirror = (function() { // Replace the range from from to to by the strings in replacement. // change is a {from, to, text [, origin]} object - function makeChange(doc, change, selUpdate, ignoreReadOnly) { + function makeChange(doc, change, ignoreReadOnly) { if (doc.cm) { - if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, selUpdate, ignoreReadOnly); + if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); if (doc.cm.state.suppressEdits) return; } @@ -2350,18 +2674,16 @@ window.CodeMirror = (function() { // of read-only spans in its range. var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); if (split) { - for (var i = split.length - 1; i >= 1; --i) - makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: [""]}); - if (split.length) - makeChangeNoReadonly(doc, {from: split[0].from, to: split[0].to, text: change.text}, selUpdate); + for (var i = split.length - 1; i >= 0; --i) + makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); } else { - makeChangeNoReadonly(doc, change, selUpdate); + makeChangeNoReadonly(doc, change); } } - function makeChangeNoReadonly(doc, change, selUpdate) { - if (change.text.length == 1 && change.text[0] == "" && posEq(change.from, change.to)) return; - var selAfter = computeSelAfterChange(doc, change, selUpdate); + function makeChangeNoReadonly(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; + var selAfter = computeSelAfterChange(doc, change); addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); @@ -2383,8 +2705,7 @@ window.CodeMirror = (function() { var event = (type == "undo" ? hist.done : hist.undone).pop(); if (!event) return; - var anti = {changes: [], anchorBefore: event.anchorAfter, headBefore: event.headAfter, - anchorAfter: event.anchorBefore, headAfter: event.headBefore, + var anti = {changes: [], selBefore: event.selAfter, selAfter: event.selBefore, generation: hist.generation}; (type == "undo" ? hist.undone : hist.done).push(anti); hist.generation = event.generation || ++hist.maxGeneration; @@ -2401,8 +2722,7 @@ window.CodeMirror = (function() { anti.changes.push(historyChangeFromChange(doc, change)); - var after = i ? computeSelAfterChange(doc, change, null) - : {anchor: event.anchorBefore, head: event.headBefore}; + var after = i ? computeSelAfterChange(doc, change, null) : event.selBefore; makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); var rebased = []; @@ -2417,11 +2737,12 @@ window.CodeMirror = (function() { } function shiftDoc(doc, distance) { - function shiftPos(pos) {return Pos(pos.line + distance, pos.ch);} doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function(range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance); - doc.sel.head = shiftPos(doc.sel.head); doc.sel.anchor = shiftPos(doc.sel.anchor); - doc.sel.from = shiftPos(doc.sel.from); doc.sel.to = shiftPos(doc.sel.to); } function makeChangeSingleDoc(doc, change, selAfter, spans) { @@ -2459,7 +2780,7 @@ window.CodeMirror = (function() { var recomputeMaxLength = false, checkWidthStart = from.line; if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(doc, getLine(doc, from.line))); + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); doc.iter(checkWidthStart, to.line + 1, function(line) { if (line == display.maxLine) { recomputeMaxLength = true; @@ -2468,14 +2789,14 @@ window.CodeMirror = (function() { }); } - if (!posLess(doc.sel.head, change.from) && !posLess(change.to, doc.sel.head)) + if (doc.sel.contains(change.from, change.to) > -1) cm.curOp.cursorActivity = true; updateDoc(doc, change, spans, selAfter, estimateHeight(cm)); if (!cm.options.lineWrapping) { doc.iter(checkWidthStart, from.line + change.text.length, function(line) { - var len = lineLength(doc, line); + var len = lineLength(line); if (len > display.maxLineLength) { display.maxLine = line; display.maxLineLength = len; @@ -2492,25 +2813,25 @@ window.CodeMirror = (function() { var lendiff = change.text.length - (to.line - from.line) - 1; // Remember that these lines changed, for updating the display - regChange(cm, from.line, to.line + 1, lendiff); - - if (hasHandler(cm, "change")) { - var changeObj = {from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin}; - if (cm.curOp.textChanged) { - for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {} - cur.next = changeObj; - } else cm.curOp.textChanged = changeObj; - } + if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + regLineChange(cm, from.line, "text"); + else + regChange(cm, from.line, to.line + 1, lendiff); + + if (hasHandler(cm, "change")) + (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push({ + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }); } function replaceRange(doc, code, from, to, origin) { if (!to) to = from; - if (posLess(to, from)) { var tmp = to; to = from; from = tmp; } + if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } if (typeof code == "string") code = splitLines(code); - makeChange(doc, {from: from, to: to, text: code, origin: origin}, null); + makeChange(doc, {from: from, to: to, text: code, origin: origin}); } // POSITION OBJECT @@ -2521,10 +2842,10 @@ window.CodeMirror = (function() { } CodeMirror.Pos = Pos; - function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} - function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} - function cmp(a, b) {return a.line - b.line || a.ch - b.ch;} + var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; function copyPos(x) {return Pos(x.line, x.ch);} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } // SELECTION @@ -2542,71 +2863,119 @@ window.CodeMirror = (function() { else return pos; } function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + function clipPosArray(doc, array) { + for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); + return out; + } - // If shift is held, this will move the selection anchor. Otherwise, - // it'll set the whole selection. - function extendSelection(doc, pos, other, bias) { - if (doc.sel.shift || doc.sel.extend) { - var anchor = doc.sel.anchor; + function extendRange(doc, range, head, other) { + if (doc.cm && doc.cm.display.shift || doc.extend) { + var anchor = range.anchor; if (other) { - var posBefore = posLess(pos, anchor); - if (posBefore != posLess(other, anchor)) { - anchor = pos; - pos = other; - } else if (posBefore != posLess(pos, other)) { - pos = other; + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; } } - setSelection(doc, anchor, pos, bias); + return new Range(anchor, head); } else { - setSelection(doc, pos, other || pos, bias); + return new Range(other || head, head); } - if (doc.cm) doc.cm.curOp.userSelChange = true; } - function filterSelectionChange(doc, anchor, head) { - var obj = {anchor: anchor, head: head}; + // If shift is held, this will move the selection anchor. Otherwise, + // it'll set the whole selection. + function extendSelection(doc, head, other, scroll) { + setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), scroll); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, scroll) { + for (var out = [], i = 0; i < doc.sel.ranges.length; i++) + out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, scroll); + } + + function replaceOneSelection(doc, i, range) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex)); + } + + function setSimpleSelection(doc, anchor, head, scroll) { + setSelection(doc, simpleSelection(anchor, head), scroll); + } + + function setSelectionAddToHistory(doc, sel) { + setSelection(doc, sel); + var lstSel = lst(doc.history.done); + if (lstSel) lstSel.selAfter = sel; + } + + function filterSelectionChange(doc, sel) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); + } + }; signal(doc, "beforeSelectionChange", doc, obj); if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - obj.anchor = clipPos(doc, obj.anchor); obj.head = clipPos(doc, obj.head); - return obj; + if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); + else return sel; } // Update the selection. Last two args are only used by // updateDoc, since they have to be expressed in the line // numbers before the update. - function setSelection(doc, anchor, head, bias, checkAtomic) { - if (!checkAtomic && hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) { - var filtered = filterSelectionChange(doc, anchor, head); - head = filtered.head; - anchor = filtered.anchor; - } + function setSelection(doc, sel, scroll) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + sel = filterSelectionChange(doc, sel); - var sel = doc.sel; - sel.goalColumn = null; - if (bias == null) bias = posLess(head, sel.head) ? -1 : 1; - // Skip over atomic spans. - if (checkAtomic || !posEq(anchor, sel.anchor)) - anchor = skipAtomic(doc, anchor, bias, checkAtomic != "push"); - if (checkAtomic || !posEq(head, sel.head)) - head = skipAtomic(doc, head, bias, checkAtomic != "push"); + var bias = cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1; + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return; + if (scroll !== false && doc.cm) { + doc.cm.curOp.userSelChange = true; + ensureCursorVisible(doc.cm); + } + } - sel.anchor = anchor; sel.head = head; - var inv = posLess(head, anchor); - sel.from = inv ? head : anchor; - sel.to = inv ? anchor : head; + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) return; + + doc.sel = sel; if (doc.cm) doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = doc.cm.curOp.cursorActivity = true; - signalLater(doc, "cursorActivity", doc); } - function reCheckSelection(cm) { - setSelection(cm.doc, cm.doc.sel.from, cm.doc.sel.to, null, "push"); + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), false); + } + + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) out = sel.ranges.slice(0, i); + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; } function skipAtomic(doc, pos, bias, mayClear) { @@ -2628,8 +2997,8 @@ window.CodeMirror = (function() { } } if (!m.atomic) continue; - var newPos = m.find()[dir < 0 ? "from" : "to"]; - if (posEq(newPos, curPos)) { + var newPos = m.find(dir < 0 ? -1 : 1); + if (cmp(newPos, curPos) == 0) { newPos.ch += dir; if (newPos.ch < 0) { if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); @@ -2661,10 +3030,14 @@ window.CodeMirror = (function() { // SCROLLING - function scrollCursorIntoView(cm) { - var coords = scrollPosIntoView(cm, cm.doc.sel.head, null, cm.options.cursorScrollMargin); - if (!cm.state.focused) return; - var display = cm.display, box = getRect(display.sizer), doScroll = null; + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin, isCursor: true}; + } + + function maybeScrollWindow(cm, coords) { + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; if (coords.top + box.top < 0) doScroll = true; else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; if (doScroll != null && !phantom) { @@ -2709,7 +3082,8 @@ window.CodeMirror = (function() { function calculateScrollPos(cm, x1, y1, x2, y2) { var display = cm.display, snapMargin = textHeight(cm.display); if (y1 < 0) y1 = 0; - var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {}; + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = display.scroller.clientHeight - scrollerCutOff, result = {}; var docBottom = cm.doc.height + paddingVert(display); var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; if (y1 < screentop) { @@ -2719,7 +3093,8 @@ window.CodeMirror = (function() { if (newTop != screentop) result.scrollTop = newTop; } - var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft; + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = display.scroller.clientWidth - scrollerCutOff; x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth; var gutterw = display.gutters.offsetWidth; var atLeft = x1 < gutterw + 10; @@ -2732,16 +3107,25 @@ window.CodeMirror = (function() { return result; } - function updateScrollPos(cm, left, top) { - cm.curOp.updateScrollPos = {scrollLeft: left == null ? cm.doc.scrollLeft : left, - scrollTop: top == null ? cm.doc.scrollTop : top}; + function addToScrollPos(cm, left, top) { + if (left != null || top != null) resolveScrollToPos(cm); + if (left != null) + cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; + if (top != null) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; } - function addToScrollPos(cm, left, top) { - var pos = cm.curOp.updateScrollPos || (cm.curOp.updateScrollPos = {scrollLeft: cm.doc.scrollLeft, scrollTop: cm.doc.scrollTop}); - var scroll = cm.display.scroller; - pos.scrollTop = Math.max(0, Math.min(scroll.scrollHeight - scroll.clientHeight, pos.scrollTop + top)); - pos.scrollLeft = Math.max(0, Math.min(scroll.scrollWidth - scroll.clientWidth, pos.scrollLeft + left)); + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); + var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), + Math.min(from.top, to.top) - range.margin, + Math.max(from.right, to.right), + Math.max(from.bottom, to.bottom) + range.margin); + cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } } // API UTILITIES @@ -2784,23 +3168,51 @@ window.CodeMirror = (function() { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} if (pos < indentation) indentString += spaceStr(indentation - pos); - if (indentString != curSpaceString) + if (indentString != curSpaceString) { replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - else if (doc.sel.head.line == n && doc.sel.head.ch < curSpaceString.length) - setSelection(doc, Pos(n, curSpaceString.length), Pos(n, curSpaceString.length), 1); + } else { + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i, new Range(pos, pos)); + break; + } + } + } line.stateAfter = null; } - function changeLine(cm, handle, op) { + function changeLine(cm, handle, changeType, op) { var no = handle, line = handle, doc = cm.doc; if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); else no = lineNo(handle); if (no == null) return null; - if (op(line, no)) regChange(cm, no, no + 1); + if (op(line, no)) regLineChange(cm, no, changeType); else return null; return line; } + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + cm.operation(function() { + for (var i = kill.length - 1; i >= 0; i--) + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + ensureCursorVisible(cm); + }); + } + function findPosH(doc, pos, dir, unit, visually) { var line = pos.line, ch = pos.ch, origDir = dir; var lineObj = getLine(doc, line); @@ -2877,10 +3289,6 @@ window.CodeMirror = (function() { return {from: Pos(pos.line, start), to: Pos(pos.line, end)}; } - function selectLine(cm, line) { - extendSelection(cm.doc, Pos(line, 0), clipPos(cm.doc, Pos(line + 1, 0))); - } - // PROTOTYPE // The publicly visible API. Note that operation(null, f) means @@ -2941,10 +3349,21 @@ window.CodeMirror = (function() { if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); }), indentSelection: operation(null, function(how) { - var sel = this.doc.sel; - if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how, true); - var e = sel.to.line - (sel.to.ch ? 0 : 1); - for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how); + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var start = Math.max(end, range.from().line); + var to = range.to(); + end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + indentLine(this, j, how); + } else if (range.head.line > end) { + indentLine(this, range.head.line, how, true); + end = range.head.line; + if (i == this.doc.sel.primIndex) ensureCursorVisible(this); + } + } }), // Fetch the parser token for a given character. Useful for hacks @@ -2962,7 +3381,6 @@ window.CodeMirror = (function() { return {start: stream.start, end: stream.pos, string: stream.current(), - className: style || null, // Deprecated, use 'type' instead type: style || null, state: state}; }, @@ -3021,10 +3439,10 @@ window.CodeMirror = (function() { }, cursorCoords: function(start, mode) { - var pos, sel = this.doc.sel; - if (start == null) pos = sel.head; + var pos, range = this.doc.sel.primary(); + if (start == null) pos = range.head; else if (typeof start == "object") pos = clipPos(this.doc, start); - else pos = start ? sel.from : sel.to; + else pos = start ? range.from() : range.to(); return cursorCoords(this, pos, mode || "page"); }, @@ -3054,7 +3472,7 @@ window.CodeMirror = (function() { defaultCharWidth: function() { return charWidth(this.display); }, setGutterMarker: operation(null, function(line, gutterID, value) { - return changeLine(this, line, function(line) { + return changeLine(this, line, "gutter", function(line) { var markers = line.gutterMarkers || (line.gutterMarkers = {}); markers[gutterID] = value; if (!value && isEmpty(markers)) line.gutterMarkers = null; @@ -3067,7 +3485,7 @@ window.CodeMirror = (function() { doc.iter(function(line) { if (line.gutterMarkers && line.gutterMarkers[gutterID]) { line.gutterMarkers[gutterID] = null; - regChange(cm, i, i + 1); + regLineChange(cm, i, "gutter"); if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; } ++i; @@ -3075,7 +3493,7 @@ window.CodeMirror = (function() { }), addLineClass: operation(null, function(handle, where, cls) { - return changeLine(this, handle, function(line) { + return changeLine(this, handle, "class", function(line) { var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; if (!line[prop]) line[prop] = cls; else if (new RegExp("(?:^|\\s)" + cls + "(?:$|\\s)").test(line[prop])) return false; @@ -3085,7 +3503,7 @@ window.CodeMirror = (function() { }), removeLineClass: operation(null, function(handle, where, cls) { - return changeLine(this, handle, function(line) { + return changeLine(this, handle, "class", function(line) { var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; var cur = line[prop]; if (!cur) return false; @@ -3121,7 +3539,7 @@ window.CodeMirror = (function() { widgets: line.widgets}; }, - getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};}, + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, addWidget: function(pos, node, scroll, vert, horiz) { var display = this.display; @@ -3174,18 +3592,24 @@ window.CodeMirror = (function() { }, moveH: operation(null, function(dir, unit) { - var sel = this.doc.sel, pos; - if (sel.shift || sel.extend || posEq(sel.from, sel.to)) - pos = findPosH(this.doc, sel.head, dir, unit, this.options.rtlMoveVisually); - else - pos = dir < 0 ? sel.from : sel.to; - extendSelection(this.doc, pos, pos, dir); + var cm = this; + cm.extendSelectionsBy(function(range) { + if (cm.display.shift || cm.doc.extend || range.empty()) + return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); + else + return dir < 0 ? range.from() : range.to(); + }); }), deleteH: operation(null, function(dir, unit) { - var sel = this.doc.sel; - if (!posEq(sel.from, sel.to)) replaceRange(this.doc, "", sel.from, sel.to, "+delete"); - else replaceRange(this.doc, "", sel.from, findPosH(this.doc, sel.head, dir, unit, false), "+delete"); + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + doc.replaceSelection("", null, "+delete"); + else + deleteNearSelection(this, function(range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; + }); this.curOp.userSelChange = true; }), @@ -3203,31 +3627,37 @@ window.CodeMirror = (function() { }, moveV: operation(null, function(dir, unit) { - var sel = this.doc.sel, target, goal; - if (sel.shift || sel.extend || posEq(sel.from, sel.to)) { - var pos = cursorCoords(this, sel.head, "div"); - if (sel.goalColumn != null) pos.left = sel.goalColumn; - target = findPosV(this, pos, dir, unit); - if (unit == "page") addToScrollPos(this, 0, charCoords(this, target, "div").top - pos.top); - goal = pos.left; - } else { - target = dir < 0 ? sel.from : sel.to; - } - extendSelection(this.doc, target, target, dir); - if (goal != null) sel.goalColumn = goal; + var cm = this, doc = this.doc, goals = [], addScroll; + var collapse = !cm.display.shift && !doc.sel.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function(range) { + if (collapse) + return dir < 0 ? range.from() : range.to(); + var headPos = cursorCoords(cm, range.head, "div"); + if (range.goalColumn != null) headPos.left = range.goalColumn; + goals.push(headPos.left); + var pos = findPosV(cm, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) + addScroll = charCoords(cm, pos, "div").top - headPos.top; + return pos; + }); + if (addScroll) addToScrollPos(this, 0, addScroll); + if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) + doc.sel.ranges[i].goalColumn = goals[i]; }), toggleOverwrite: function(value) { if (value != null && value == this.state.overwrite) return; if (this.state.overwrite = !this.state.overwrite) - this.display.cursor.className += " CodeMirror-overwrite"; + this.display.cursorDiv.className += " CodeMirror-overwrite"; else - this.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", ""); + this.display.cursorDiv.className = this.display.cursorDiv.className.replace(" CodeMirror-overwrite", ""); }, hasFocus: function() { return document.activeElement == this.display.input; }, scrollTo: operation(null, function(x, y) { - updateScrollPos(this, x, y); + if (x != null || y != null) resolveScrollToPos(this); + if (x != null) this.curOp.scrollLeft = x; + if (y != null) this.curOp.scrollTop = y; }), getScrollInfo: function() { var scroller = this.display.scroller, co = scrollerCutOff; @@ -3237,23 +3667,22 @@ window.CodeMirror = (function() { }, scrollIntoView: operation(null, function(range, margin) { - if (range == null) range = {from: this.doc.sel.head, to: null}; + if (range == null) range = {from: this.doc.sel.primary().head, to: null}; else if (typeof range == "number") range = {from: Pos(range, 0), to: null}; else if (range.from == null) range = {from: range, to: null}; if (!range.to) range.to = range.from; - if (!margin) margin = 0; + range.margin = margin || 0; - var coords = range; if (range.from.line != null) { - this.curOp.scrollToPos = {from: range.from, to: range.to, margin: margin}; - coords = {from: cursorCoords(this, range.from), - to: cursorCoords(this, range.to)}; - } - var sPos = calculateScrollPos(this, Math.min(coords.from.left, coords.to.left), - Math.min(coords.from.top, coords.to.top) - margin, - Math.max(coords.from.right, coords.to.right), - Math.max(coords.from.bottom, coords.to.bottom) + margin); - updateScrollPos(this, sPos.scrollLeft, sPos.scrollTop); + resolveScrollToPos(this); + this.curOp.scrollToPos = range; + } else { + var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), + Math.min(range.from.top, range.to.top) - range.margin, + Math.max(range.from.right, range.to.right), + Math.max(range.from.bottom, range.to.bottom) + range.margin); + this.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } }), setSize: operation(null, function(width, height) { @@ -3262,20 +3691,21 @@ window.CodeMirror = (function() { } if (width != null) this.display.wrapper.style.width = interpret(width); if (height != null) this.display.wrapper.style.height = interpret(height); - if (this.options.lineWrapping) - this.display.measureLineCache.length = this.display.measureLineCachePos = 0; + if (this.options.lineWrapping) clearLineMeasurementCache(this); this.curOp.forceUpdate = true; + signal(this, "refresh", this); }), operation: function(f){return runInOp(this, f);}, refresh: operation(null, function() { var oldHeight = this.display.cachedTextHeight; - clearCaches(this); - updateScrollPos(this, this.doc.scrollLeft, this.doc.scrollTop); regChange(this); + clearCaches(this); + this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) estimateLineHeights(this); + signal(this, "refresh", this); }), swapDoc: operation(null, function(doc) { @@ -3284,7 +3714,7 @@ window.CodeMirror = (function() { attachDoc(this, doc); clearCaches(this); resetInput(this, true); - updateScrollPos(this, doc.scrollLeft, doc.scrollTop); + this.scrollTo(doc.scrollLeft, doc.scrollTop); signalLater(this, "swapDoc", this, old); return old; }), @@ -3345,9 +3775,6 @@ window.CodeMirror = (function() { option("keyMap", "default", keyMapChanged); option("extraKeys", null); - option("onKeyEvent", null); - option("onDragEvent", null); - option("lineWrapping", false, wrappingChanged, true); option("gutters", [], function(cm) { setGuttersForLineNumbers(cm.options); @@ -3393,7 +3820,6 @@ window.CodeMirror = (function() { option("historyEventDelay", 500); option("viewportMargin", 10, function(cm){cm.refresh();}, true); option("maxHighlightLength", 10000, resetModeState, true); - option("crudeMeasuringFrom", 10000); option("moveInputWithCursor", true, function(cm, val) { if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0; }); @@ -3529,48 +3955,68 @@ window.CodeMirror = (function() { // STANDARD COMMANDS var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()));}, + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), false);}, + singleSelection: function(cm) { + cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), false); + }, killLine: function(cm) { - var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); - if (!sel && cm.getLine(from.line).length == from.ch) - cm.replaceRange("", from, Pos(from.line + 1, 0), "+delete"); - else cm.replaceRange("", from, sel ? to : Pos(from.line), "+delete"); + deleteNearSelection(cm, function(range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + return {from: range.head, to: Pos(range.head.line + 1, 0)}; + else + return {from: range.head, to: Pos(range.head.line, len)}; + } else { + return {from: range.from(), to: range.to()}; + } + }); }, deleteLine: function(cm) { - var l = cm.getCursor().line; - cm.replaceRange("", Pos(l, 0), Pos(l), "+delete"); + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; + }); }, delLineLeft: function(cm) { - var cur = cm.getCursor(); - cm.replaceRange("", Pos(cur.line, 0), cur, "+delete"); + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), to: range.from()}; + }); }, undo: function(cm) {cm.undo();}, redo: function(cm) {cm.redo();}, goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, goLineStart: function(cm) { - cm.extendSelection(lineStart(cm, cm.getCursor().line)); + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }); }, goLineStartSmart: function(cm) { - var cur = cm.getCursor(), start = lineStart(cm, cur.line); - var line = cm.getLineHandle(start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch; - cm.extendSelection(Pos(start.line, inWS ? 0 : firstNonWS)); - } else cm.extendSelection(start); + cm.extendSelectionsBy(function(range) { + var start = lineStart(cm, range.head.line); + var line = cm.getLineHandle(start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = range.head.line == start.line && range.head.ch <= firstNonWS && range.head.ch; + return Pos(start.line, inWS ? 0 : firstNonWS); + } + return start; + }); }, goLineEnd: function(cm) { - cm.extendSelection(lineEnd(cm, cm.getCursor().line)); + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }); }, goLineRight: function(cm) { - var top = cm.charCoords(cm.getCursor(), "div").top + 5; - cm.extendSelection(cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")); + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + }); }, goLineLeft: function(cm) { - var top = cm.charCoords(cm.getCursor(), "div").top + 5; - cm.extendSelection(cm.coordsChar({left: 0, top: top}, "div")); + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div"); + }); }, goLineUp: function(cm) {cm.moveV(-1, "line");}, goLineDown: function(cm) {cm.moveV(1, "line");}, @@ -3594,22 +4040,32 @@ window.CodeMirror = (function() { indentMore: function(cm) {cm.indentSelection("add");}, indentLess: function(cm) {cm.indentSelection("subtract");}, insertTab: function(cm) { - cm.replaceSelection("\t", "end", "+input"); + cm.replaceSelection("\t", null, "+input"); }, defaultTab: function(cm) { if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.replaceSelection("\t", "end", "+input"); + else cm.replaceSelection("\t", null, "+input"); }, transposeChars: function(cm) { - var cur = cm.getCursor(), line = cm.getLine(cur.line); - if (cur.ch > 0 && cur.ch < line.length - 1) - cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), - Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + cm.operation(function() { + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var cur = ranges[i].head, line = getLine(cm.doc, cur.line); + if (cur.ch > 0 && cur.ch < line.length - 1) + cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), + Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + } + }); }, newlineAndIndent: function(cm) { operation(cm, function() { - cm.replaceSelection("\n", "end", "+input"); - cm.indentLine(cm.getCursor().line, null, true); + var len = cm.listSelections().length; + for (var i = 0; i < len; i++) { + var range = cm.listSelections()[i]; + cm.replaceRange("\n", range.anchor, range.head, "+input"); + cm.indentLine(range.from().line + 1, null, true); + ensureCursorVisible(cm); + } })(); }, toggleOverwrite: function(cm) {cm.toggleOverwrite();} @@ -3623,7 +4079,8 @@ window.CodeMirror = (function() { "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite" + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" }; // Note that the save and find-related commands aren't defined by // default. Unknown commands are simply ignored. @@ -3689,7 +4146,7 @@ window.CodeMirror = (function() { return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; } function keyName(event, noShift) { - if (opera && event.keyCode == 34 && event["char"]) return false; + if (presto && event.keyCode == 34 && event["char"]) return false; var name = keyNames[event.keyCode]; if (name == null || event.altGraphKey) return false; if (event.altKey) name = "Alt-" + name; @@ -3858,15 +4315,17 @@ window.CodeMirror = (function() { for (var i = 0; i < this.lines.length; ++i) { var line = this.lines[i]; var span = getMarkedSpanFor(line.markedSpans, this); - if (span.to != null) max = lineNo(line); + if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); + else if (cm) { + if (span.to != null) max = lineNo(line); + if (span.from != null) min = lineNo(line); + } line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from != null) - min = lineNo(line); - else if (this.collapsed && !lineIsHidden(this.doc, line) && cm) + if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) updateLineHeight(line, textHeight(cm.display)); } if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { - var visual = visualLine(cm.doc, this.lines[i]), len = lineLength(cm.doc, visual); + var visual = visualLine(this.lines[i]), len = lineLength(visual); if (len > cm.display.maxLineLength) { cm.display.maxLine = visual; cm.display.maxLineLength = len; @@ -3874,42 +4333,45 @@ window.CodeMirror = (function() { } } - if (min != null && cm) regChange(cm, min, max + 1); + if (min != null) regChange(cm, min, max + 1); this.lines.length = 0; this.explicitlyCleared = true; if (this.atomic && this.doc.cantEdit) { this.doc.cantEdit = false; - if (cm) reCheckSelection(cm); + if (cm) reCheckSelection(cm.doc); } if (withOp) endOperation(cm); }; - TextMarker.prototype.find = function(bothSides) { + // Side can be 0 (both), -1 (left), 1 (right) + TextMarker.prototype.find = function(side, lineObj) { + if (side == null && this.type == "bookmark") side = 1; var from, to; for (var i = 0; i < this.lines.length; ++i) { var line = this.lines[i]; var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null || span.to != null) { - var found = lineNo(line); - if (span.from != null) from = Pos(found, span.from); - if (span.to != null) to = Pos(found, span.to); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) return from; + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) return to; } } - if (this.type == "bookmark" && !bothSides) return from; return from && {from: from, to: to}; }; TextMarker.prototype.changed = function() { - var pos = this.find(), cm = this.doc.cm; + var pos = this.find(-1, true), cm = this.doc.cm; if (!pos || !cm) return; - if (this.type != "bookmark") pos = pos.from; - var line = getLine(this.doc, pos.line); - clearCachedMeasurement(cm, line); - if (pos.line >= cm.display.showingFrom && pos.line < cm.display.showingTo) { - for (var node = cm.display.lineDiv.firstChild; node; node = node.nextSibling) if (node.lineObj == line) { - if (node.offsetHeight != line.height) updateLineHeight(line, node.offsetHeight); - break; - } + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) clearLineMeasurementCacheFor(view); + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { + var lineView = cm.display.view[findViewIndex(cm, lineN)]; + if (!lineView.hidden && lineView.node && lineView.node.offsetHeight != line.height) + updateLineHeight(line, lineView.node.offsetHeight); runInOp(cm, function() { cm.curOp.selectionChanged = cm.curOp.forceUpdate = cm.curOp.updateMaxLine = true; }); @@ -3938,14 +4400,15 @@ window.CodeMirror = (function() { if (options && options.shared) return markTextShared(doc, from, to, options, type); if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); - var marker = new TextMarker(doc, type); + var marker = new TextMarker(doc, type), diff = cmp(from, to); if (options) copyObj(options, marker); - if (posLess(to, from) || posEq(from, to) && marker.clearWhenEmpty !== false) + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) return marker; if (marker.replacedWith) { marker.collapsed = true; marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget"); if (!options.handleMouseEvents) marker.replacedWith.ignoreEvents = true; + if (options.insertLeft) marker.replacedWith.insertLeft = true; } if (marker.collapsed) { if (conflictingCollapsedRange(doc, from.line, from, to, marker) || @@ -3955,12 +4418,11 @@ window.CodeMirror = (function() { } if (marker.addToHistory) - addToHistory(doc, {from: from, to: to, origin: "markText"}, - {head: doc.sel.head, anchor: doc.sel.anchor}, NaN); + addToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); var curLine = from.line, cm = doc.cm, updateMaxLine; doc.iter(curLine, to.line + 1, function(line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.display.maxLine) + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) updateMaxLine = true; var span = {from: null, to: null, marker: marker}; if (curLine == from.line) span.from = from.ch; @@ -3986,9 +4448,11 @@ window.CodeMirror = (function() { } if (cm) { if (updateMaxLine) cm.curOp.updateMaxLine = true; - if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.collapsed) + if (marker.collapsed) regChange(cm, from.line, to.line + 1); - if (marker.atomic) reCheckSelection(cm); + else if (marker.className || marker.title || marker.startStyle || marker.endStyle) + for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); + if (marker.atomic) reCheckSelection(cm.doc); } return marker; } @@ -4013,8 +4477,8 @@ window.CodeMirror = (function() { this.markers[i].clear(); signalLater(this, "clear"); }; - SharedTextMarker.prototype.find = function() { - return this.primary.find(); + SharedTextMarker.prototype.find = function(side, lineObj) { + return this.primary.find(side, lineObj); }; function markTextShared(doc, from, to, options, type) { @@ -4083,7 +4547,7 @@ window.CodeMirror = (function() { var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; if (!oldFirst && !oldLast) return null; - var startCh = change.from.ch, endCh = change.to.ch, isInsert = posEq(change.from, change.to); + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; // Get the spans that 'stick out' on both sides var first = markedSpansBefore(oldFirst, startCh, isInsert); var last = markedSpansAfter(oldLast, endCh, isInsert); @@ -4181,14 +4645,14 @@ window.CodeMirror = (function() { if (!markers) return null; var parts = [{from: from, to: to}]; for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(); + var mk = markers[i], m = mk.find(0); for (var j = 0; j < parts.length; ++j) { var p = parts[j]; - if (posLess(p.to, m.from) || posLess(m.to, p.from)) continue; - var newParts = [j, 1]; - if (posLess(p.from, m.from) || !mk.inclusiveLeft && posEq(p.from, m.from)) + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) newParts.push({from: p.from, to: m.from}); - if (posLess(m.to, p.to) || !mk.inclusiveRight && posEq(p.to, m.to)) + if (dto > 0 || !mk.inclusiveRight && !dto) newParts.push({from: m.to, to: p.to}); parts.splice.apply(parts, newParts); j += newParts.length - 1; @@ -4230,7 +4694,7 @@ window.CodeMirror = (function() { if (sps) for (var i = 0; i < sps.length; ++i) { var sp = sps[i]; if (!sp.marker.collapsed) continue; - var found = sp.marker.find(true); + var found = sp.marker.find(0); var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; @@ -4240,13 +4704,36 @@ window.CodeMirror = (function() { } } - function visualLine(doc, line) { + function visualLine(line) { var merged; while (merged = collapsedSpanAtStart(line)) - line = getLine(doc, merged.find().from.line); + line = merged.find(-1, true).line; return line; } + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) return lineN; + return lineNo(vis); + } + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) return lineN; + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) return lineN; + while (merged = collapsedSpanAtEnd(line)) + line = merged.find(1, true).line; + return lineNo(line) + 1; + } + function lineIsHidden(doc, line) { var sps = sawCollapsedSpans && line.markedSpans; if (sps) for (var sp, i = 0; i < sps.length; ++i) { @@ -4260,8 +4747,8 @@ window.CodeMirror = (function() { } function lineIsHiddenInner(doc, line, span) { if (span.to == null) { - var end = span.marker.find().to, endLine = getLine(doc, end.line); - return lineIsHiddenInner(doc, endLine, getMarkedSpanFor(endLine.markedSpans, span.marker)); + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); } if (span.marker.inclusiveRight && span.to == line.text.length) return true; @@ -4312,10 +4799,10 @@ window.CodeMirror = (function() { if (no == null || !ws) return; for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); if (!ws.length) this.line.widgets = null; - var aboveVisible = heightAtLine(this.cm, this.line) < this.cm.doc.scrollTop; + var aboveVisible = heightAtLine(this.line) < this.cm.doc.scrollTop; updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this))); if (aboveVisible) addToScrollPos(this.cm, 0, -this.height); - regChange(this.cm, no, no + 1); + regLineChange(this.cm, no, "widget"); }); LineWidget.prototype.changed = widgetOperation(function() { var oldH = this.height; @@ -4324,7 +4811,7 @@ window.CodeMirror = (function() { if (!diff) return; updateLineHeight(this.line, this.line.height + diff); var no = lineNo(this.line); - regChange(this.cm, no, no + 1); + regLineChange(this.cm, no, "widget"); }); function widgetHeight(widget) { @@ -4337,13 +4824,13 @@ window.CodeMirror = (function() { function addLineWidget(cm, handle, node, options) { var widget = new LineWidget(cm, node, options); if (widget.noHScroll) cm.display.alignWidgets = true; - changeLine(cm, handle, function(line) { + changeLine(cm, handle, "widget", function(line) { var widgets = line.widgets || (line.widgets = []); if (widget.insertAt == null) widgets.push(widget); else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); widget.line = line; if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) { - var aboveVisible = heightAtLine(cm, line) < cm.doc.scrollTop; + var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; updateLineHeight(line, line.height + widgetHeight(widget)); if (aboveVisible) addToScrollPos(cm, 0, widget.height); } @@ -4492,54 +4979,44 @@ window.CodeMirror = (function() { (cache[style] = style.replace(/\S+/g, "cm-$&")); } - function buildLineContent(cm, realLine, measure, copyWidgets) { - var merged, line = realLine, empty = true; - while (merged = collapsedSpanAtStart(line)) - line = getLine(cm.doc, merged.find().from.line); - - var builder = {pre: elt("pre"), col: 0, pos: 0, - measure: null, measuredSomething: false, cm: cm, - copyWidgets: copyWidgets}; + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; + lineView.measure = {}; - do { - if (line.text) empty = false; - builder.measure = line == realLine && measure; + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order; builder.pos = 0; - builder.addToken = builder.measure ? buildTokenMeasure : buildToken; + builder.addToken = buildToken; if ((old_ie || webkit) && cm.getOption("lineWrapping")) builder.addToken = buildTokenSplitSpaces(builder.addToken); - var next = insertLineContent(line, builder, getLineStyles(cm, line)); - if (measure && line == realLine && !builder.measuredSomething) { - measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure)); - builder.measuredSomething = true; - } - if (next) line = getLine(cm.doc, next.to.line); - } while (next); - - if (measure && !builder.measuredSomething && !measure[0]) - measure[0] = builder.pre.appendChild(empty ? elt("span", "\u00a0") : zeroWidthElement(cm.display.measure)); - if (!builder.pre.firstChild && !lineIsHidden(cm.doc, realLine)) - builder.pre.appendChild(document.createTextNode("\u00a0")); - - var order; - // Work around problem with the reported dimensions of single-char - // direction spans on IE (issue #1129). See also the comment in - // cursorCoords. - if (measure && ie && (order = getOrder(line))) { - var l = order.length - 1; - if (order[l].from == order[l].to) --l; - var last = order[l], prev = order[l - 1]; - if (last.from + 1 == last.to && prev && last.level < prev.level) { - var span = measure[builder.pos - 1]; - if (span) span.parentNode.insertBefore(span.measureRight = zeroWidthElement(cm.display.measure), - span.nextSibling); - } - } - - var textClass = builder.textClass ? builder.textClass + " " + (realLine.textClass || "") : realLine.textClass; + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) + builder.addToken = buildTokenBadBidi(builder.addToken, order); + builder.map = []; + insertLineContent(line, builder, getLineStyles(cm, line)); + + if (builder.map.length == 0) + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + if (!builder.content.firstChild) + builder.content.appendChild(document.createTextNode("\u00a0")); + + var textClass = builder.textClass ? builder.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; if (textClass) builder.pre.className = textClass; - signal(cm, "renderLine", cm, realLine, builder.pre); + signal(cm, "renderLine", cm, lineView.line, builder.pre); return builder; } @@ -4551,10 +5028,13 @@ window.CodeMirror = (function() { function buildToken(builder, text, style, startStyle, endStyle, title) { if (!text) return; - var special = builder.cm.options.specialChars; + var special = builder.cm.options.specialChars, mustWrap = false; if (!special.test(text)) { builder.col += text.length; var content = document.createTextNode(text); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie_lt9) mustWrap = true; + builder.pos += text.length; } else { var content = document.createDocumentFragment(), pos = 0; while (true) { @@ -4562,56 +5042,38 @@ window.CodeMirror = (function() { var m = special.exec(text); var skipped = m ? m.index - pos : text.length - pos; if (skipped) { - content.appendChild(document.createTextNode(text.slice(pos, pos + skipped))); + var txt = document.createTextNode(text.slice(pos, pos + skipped)); + if (ie_lt9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.map.push(builder.pos, builder.pos + skipped, txt); builder.col += skipped; + builder.pos += skipped; } if (!m) break; pos += skipped + 1; if (m[0] == "\t") { var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); builder.col += tabWidth; } else { - var token = builder.cm.options.specialCharPlaceholder(m[0]); - content.appendChild(token); + var txt = builder.cm.options.specialCharPlaceholder(m[0]); + if (ie_lt9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); builder.col += 1; } + builder.map.push(builder.pos, builder.pos + 1, txt); + builder.pos++; } } - if (style || startStyle || endStyle || builder.measure) { + if (style || startStyle || endStyle || mustWrap) { var fullStyle = style || ""; if (startStyle) fullStyle += startStyle; if (endStyle) fullStyle += endStyle; var token = elt("span", [content], fullStyle); if (title) token.title = title; - return builder.pre.appendChild(token); - } - builder.pre.appendChild(content); - } - - function buildTokenMeasure(builder, text, style, startStyle, endStyle) { - var wrapping = builder.cm.options.lineWrapping; - for (var i = 0; i < text.length; ++i) { - var start = i == 0, to = i + 1; - while (to < text.length && isExtendingChar(text.charAt(to))) ++to; - var ch = text.slice(i, to); - i = to - 1; - if (i && wrapping && spanAffectsWrapping(text, i)) - builder.pre.appendChild(elt("wbr")); - var old = builder.measure[builder.pos]; - var span = builder.measure[builder.pos] = - buildToken(builder, ch, style, - start && startStyle, i == text.length - 1 && endStyle); - if (old) span.leftSide = old.leftSide || old; - // In IE single-space nodes wrap differently than spaces - // embedded in larger text nodes, except when set to - // white-space: normal (issue #1268). - if (old_ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) && - i < text.length - 1 && !/\s/.test(text.charAt(i + 1))) - span.style.whiteSpace = "normal"; - builder.pos += ch.length; - } - if (text.length) builder.measuredSomething = true; + return builder.content.appendChild(token); + } + builder.content.appendChild(content); } function buildTokenSplitSpaces(inner) { @@ -4622,29 +5084,34 @@ window.CodeMirror = (function() { return out; } return function(builder, text, style, startStyle, endStyle, title) { - return inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); + inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); + }; + } + + function buildTokenBadBidi(inner, order) { + return function(builder, text, style, startStyle, endStyle, title) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + for (var i = 0; i < order.length; i++) { + var part = order[i]; + if (part.to > start && part.from <= start) break; + } + if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } }; } function buildCollapsedSpan(builder, size, marker, ignoreWidget) { var widget = !ignoreWidget && marker.replacedWith; if (widget) { - if (builder.copyWidgets) widget = widget.cloneNode(true); - builder.pre.appendChild(widget); - if (builder.measure) { - if (size) { - builder.measure[builder.pos] = widget; - } else { - var elt = zeroWidthElement(builder.cm.display.measure); - if (marker.type == "bookmark" && !marker.insertLeft) - builder.measure[builder.pos] = builder.pre.appendChild(elt); - else if (builder.measure[builder.pos]) - return; - else - builder.measure[builder.pos] = builder.pre.insertBefore(elt, widget); - } - builder.measuredSomething = true; - } + builder.map.push(builder.pos, builder.pos + size, widget); + builder.content.appendChild(widget); } builder.pos += size; } @@ -4684,7 +5151,7 @@ window.CodeMirror = (function() { if (collapsed && (collapsed.from || 0) == pos) { buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos, collapsed.marker, collapsed.from == null); - if (collapsed.to == null) return collapsed.marker.find(); + if (collapsed.to == null) return; } if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) buildCollapsedSpan(builder, 0, foundBookmarks[j]); @@ -4712,6 +5179,11 @@ window.CodeMirror = (function() { // DOCUMENT DATA STRUCTURE + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) { function spansFor(n) {return markedSpans ? markedSpans[n] : null;} function update(line, text, spans) { @@ -4724,8 +5196,7 @@ window.CodeMirror = (function() { var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; // First adjust the line structure - if (from.ch == 0 && to.ch == 0 && lastText == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore)) { + if (isWholeLineUpdate(doc, change)) { // This is a whole-line replace. Treated specially to make // sure line objects move the way they are supposed to. for (var i = 0, e = text.length - 1, added = []; i < e; ++i) @@ -4756,7 +5227,7 @@ window.CodeMirror = (function() { } signalLater(doc, "change", doc, change); - setSelection(doc, selAfter.anchor, selAfter.head, null, true); + setSelection(doc, selAfter, false); } function LeafChunk(lines) { @@ -4901,12 +5372,12 @@ window.CodeMirror = (function() { this.cleanGeneration = 1; this.frontier = firstLine; var start = Pos(firstLine, 0); - this.sel = {from: start, to: start, head: start, anchor: start, shift: false, extend: false, goalColumn: null}; + this.sel = simpleSelection(start); this.id = ++nextDocId; this.modeOption = mode; if (typeof text == "string") text = splitLines(text); - updateDoc(this, {from: start, to: start, text: text}, null, {head: start, anchor: start}); + updateDoc(this, {from: start, to: start, text: text}, null, simpleSelection(start)); }; Doc.prototype = createObj(BranchChunk.prototype, { @@ -4928,12 +5399,12 @@ window.CodeMirror = (function() { if (lineSep === false) return lines; return lines.join(lineSep || "\n"); }, - setValue: function(code) { + setValue: docOperation(function(code) { var top = Pos(this.first, 0), last = this.first + this.size - 1; makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: splitLines(code), origin: "setValue"}, - {head: top, anchor: top}, true); - }, + text: splitLines(code), origin: "setValue"}, true); + setSelectionAddToHistory(this, simpleSelection(top)); + }), replaceRange: function(code, from, to, origin) { from = clipPos(this, from); to = to ? clipPos(this, to) : from; @@ -4946,21 +5417,13 @@ window.CodeMirror = (function() { }, getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, - setLine: function(line, text) { - if (isLine(this, line)) - replaceRange(this, text, Pos(line, 0), clipPos(this, Pos(line))); - }, - removeLine: function(line) { - if (line) replaceRange(this, "", clipPos(this, Pos(line - 1)), clipPos(this, Pos(line))); - else replaceRange(this, "", Pos(0, 0), clipPos(this, Pos(1, 0))); - }, getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, getLineNumber: function(line) {return lineNo(line);}, getLineHandleVisualStart: function(line) { if (typeof line == "number") line = getLine(this, line); - return visualLine(this, line); + return visualLine(line); }, lineCount: function() {return this.size;}, @@ -4970,35 +5433,85 @@ window.CodeMirror = (function() { clipPos: function(pos) {return clipPos(this, pos);}, getCursor: function(start) { - var sel = this.sel, pos; - if (start == null || start == "head") pos = sel.head; - else if (start == "anchor") pos = sel.anchor; - else if (start == "end" || start === false) pos = sel.to; - else pos = sel.from; - return copyPos(pos); + var range = this.sel.primary(), pos; + if (start == null || start == "head") pos = range.head; + else if (start == "anchor") pos = range.anchor; + else if (start == "end" || start == "to" || start === false) pos = range.to(); + else pos = range.from(); + return pos; }, - somethingSelected: function() {return !posEq(this.sel.head, this.sel.anchor);}, + listSelections: function() { return this.sel.ranges; }, + somethingSelected: function() {return this.sel.somethingSelected();}, - setCursor: docOperation(function(line, ch, extend) { - var pos = clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line); - if (extend) extendSelection(this, pos); - else setSelection(this, pos, pos); + setCursor: docOperation(function(line, ch, scroll) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, scroll); + }), + setSelection: docOperation(function(anchor, head, scroll) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), scroll); + }), + extendSelection: docOperation(function(head, other, scroll) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), scroll); + }), + extendSelections: docOperation(function(heads, scroll) { + extendSelections(this, clipPosArray(this, heads, scroll)); + }), + extendSelectionsBy: docOperation(function(f, scroll) { + extendSelections(this, map(this.sel.ranges, f), scroll); }), - setSelection: docOperation(function(anchor, head, bias) { - setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), bias); + setSelections: docOperation(function(ranges, primary, scroll) { + if (!ranges.length) return; + for (var i = 0, out = []; i < ranges.length; i++) + out[i] = new Range(clipPos(this, ranges[i].anchor), + clipPos(this, ranges[i].head)); + if (primary == null) primary = ranges.length - 1; + setSelection(this, normalizeSelection(out, primary), scroll); }), - extendSelection: docOperation(function(from, to, bias) { - extendSelection(this, clipPos(this, from), to && clipPos(this, to), bias); + addSelection: docOperation(function(anchor, head) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), false); }), - getSelection: function(lineSep) {return this.getRange(this.sel.from, this.sel.to, lineSep);}, - replaceSelection: function(code, collapse, origin) { - makeChange(this, {from: this.sel.from, to: this.sel.to, text: splitLines(code), origin: origin}, collapse || "around"); + getSelection: function(lineSep) { + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) return lines; + else return lines.join(lineSep || "\n"); + }, + getSelections: function(lineSep) { + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) sel = sel.join(lineSep || "\n"); + parts[i] = sel; + } + return parts; + }, + replaceSelection: docOperation(function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + dup[i] = code; + this.replaceSelections(dup, collapse, origin); + }), + replaceSelections: function(code, collapse, origin) { + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i = changes.length - 1; i >= 0; i--) + makeChange(this, changes[i]); + if (newSel) setSelectionAddToHistory(this, newSel); + else if (this.cm) ensureCursorVisible(this.cm); }, undo: docOperation(function() {makeChangeFromHistory(this, "undo");}), redo: docOperation(function() {makeChangeFromHistory(this, "redo");}), - setExtending: function(val) {this.sel.extend = val;}, + setExtending: function(val) {this.extend = val;}, historySize: function() { var hist = this.history; @@ -5024,8 +5537,8 @@ window.CodeMirror = (function() { }, setHistory: function(histData) { var hist = this.history = makeHistory(this.history.maxGeneration); - hist.done = histData.done.slice(0); - hist.undone = histData.undone.slice(0); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); }, markText: function(from, to, options) { @@ -5082,8 +5595,8 @@ window.CodeMirror = (function() { copy: function(copyHistory) { var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = {from: this.sel.from, to: this.sel.to, head: this.sel.head, anchor: this.sel.anchor, - shift: this.sel.shift, extend: false, goalColumn: this.sel.goalColumn}; + doc.sel = this.sel; + doc.extend = false; if (copyHistory) { doc.history.undoDepth = this.history.undoDepth; doc.setHistory(this.getHistory()); @@ -5195,7 +5708,7 @@ window.CodeMirror = (function() { function updateLineHeight(line, height) { var diff = height - line.height; - for (var n = line; n; n = n.parent) n.height += diff; + if (diff) for (var n = line; n; n = n.parent) n.height += diff; } function lineNo(line) { @@ -5229,8 +5742,9 @@ window.CodeMirror = (function() { return n + i; } - function heightAtLine(cm, lineObj) { - lineObj = visualLine(cm.doc, lineObj); + + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); var h = 0, chunk = lineObj.parent; for (var i = 0; i < chunk.lines.length; ++i) { @@ -5299,7 +5813,7 @@ window.CodeMirror = (function() { change.origin.charAt(0) == "*"))) { // Merge this change into the last event var last = lst(cur.changes); - if (posEq(change.from, change.to) && posEq(change.from, last.to)) { + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { // Optimized case for simple insertion -- don't want to add // new changesets for every character typed last.to = changeEnd(change); @@ -5307,13 +5821,12 @@ window.CodeMirror = (function() { // Add new sub-event cur.changes.push(historyChangeFromChange(doc, change)); } - cur.anchorAfter = selAfter.anchor; cur.headAfter = selAfter.head; + cur.selAfter = selAfter; } else { // Can not be merged, start a new event. cur = {changes: [historyChangeFromChange(doc, change)], generation: hist.generation, - anchorBefore: doc.sel.anchor, headBefore: doc.sel.head, - anchorAfter: selAfter.anchor, headAfter: selAfter.head}; + selBefore: doc.sel, selAfter: selAfter}; hist.done.push(cur); while (hist.done.length > hist.undoDepth) hist.done.shift(); @@ -5341,13 +5854,21 @@ window.CodeMirror = (function() { return nw; } + function copyHistorySel(sel, instantiate) { + if (!instantiate) return sel; + for (var out = [], i = 0; i < sel.ranges.length; i++) + out[i] = new Range(sel.ranges[i].anchor, sel.ranges[i].head); + return new Selection(out, sel.primIndex); + } + // Used both to provide a JSON-safe object in .getHistory, and, when // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup) { + function copyHistoryArray(events, newGroup, instantiateSel) { for (var i = 0, copy = []; i < events.length; ++i) { var event = events[i], changes = event.changes, newChanges = []; - copy.push({changes: newChanges, anchorBefore: event.anchorBefore, headBefore: event.headBefore, - anchorAfter: event.anchorAfter, headAfter: event.headAfter}); + copy.push({changes: newChanges, + selBefore: copyHistorySel(event.selBefore, instantiateSel), + selAfter: copyHistorySel(event.selAfter, instantiateSel)}); for (var j = 0; j < changes.length; ++j) { var change = changes[j], m; newChanges.push({from: change.from, to: change.to, text: change.text}); @@ -5364,7 +5885,13 @@ window.CodeMirror = (function() { // Rebasing/resetting history to deal with externally-sourced changes - function rebaseHistSel(pos, from, to, diff) { + function rebaseHistSel(array, from, to, diff) { + for (var i = 0; i < array.length; i++) { + rebaseHistSelSingle(array[i].anchor, from, to, diff); + rebaseHistSelSingle(array[i].head, from, to, diff); + } + } + function rebaseHistSelSingle(pos, from, to, diff) { if (to < pos.line) { pos.line += diff; } else if (from < pos.line) { @@ -5385,26 +5912,25 @@ window.CodeMirror = (function() { var sub = array[i], ok = true; for (var j = 0; j < sub.changes.length; ++j) { var cur = sub.changes[j]; - if (!sub.copied) { cur.from = copyPos(cur.from); cur.to = copyPos(cur.to); } if (to < cur.from.line) { - cur.from.line += diff; - cur.to.line += diff; + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); } else if (from <= cur.to.line) { ok = false; break; } } if (!sub.copied) { - sub.anchorBefore = copyPos(sub.anchorBefore); sub.headBefore = copyPos(sub.headBefore); - sub.anchorAfter = copyPos(sub.anchorAfter); sub.readAfter = copyPos(sub.headAfter); + sub.selBefore = sub.selBefore.deepCopy(); + sub.selAfter = sub.selAfter.deepCopy(); sub.copied = true; } if (!ok) { array.splice(0, i + 1); i = 0; } else { - rebaseHistSel(sub.anchorBefore); rebaseHistSel(sub.headBefore); - rebaseHistSel(sub.anchorAfter); rebaseHistSel(sub.headAfter); + rebaseHistSel(sub.selBefore, from, to, diff); + rebaseHistSel(sub.selAfter, from, to, diff); } } } @@ -5417,13 +5943,6 @@ window.CodeMirror = (function() { // EVENT OPERATORS - function stopMethod() {e_stop(this);} - // Ensure an event has a stop method. - function addStop(event) { - if (!event.stop) event.stop = stopMethod; - return event; - } - function e_preventDefault(e) { if (e.preventDefault) e.preventDefault(); else e.returnValue = false; @@ -5578,6 +6097,11 @@ window.CodeMirror = (function() { if (collection[i] == elt) return i; return -1; } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); + return out; + } function createObj(base, props) { function Obj() {} @@ -5593,11 +6117,6 @@ window.CodeMirror = (function() { return target; } - function emptyArray(size) { - for (var a = [], i = 0; i < size; ++i) a.push(undefined); - return a; - } - function bind(f) { var args = Array.prototype.slice.call(arguments, 1); return function(){return f.apply(null, args);}; @@ -5623,11 +6142,27 @@ window.CodeMirror = (function() { var e = document.createElement(tag); if (className) e.className = className; if (style) e.style.cssText = style; - if (typeof content == "string") setTextContent(e, content); + if (typeof content == "string") e.appendChild(document.createTextNode(content)); else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); return e; } + var range; + if (document.createRange) range = function(node, start, end) { + var r = document.createRange(); + r.setEnd(node, end); + r.setStart(node, start); + return r; + }; + else range = function(node, start, end) { + var r = document.body.createTextRange(); + r.moveToElementText(node.parentNode); + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + function removeChildren(e) { for (var count = e.childNodes.length; count > 0; --count) e.removeChild(e.firstChild); @@ -5638,18 +6173,6 @@ window.CodeMirror = (function() { return removeChildren(parent).appendChild(e); } - function setTextContent(e, str) { - if (ie_lt9) { - e.innerHTML = ""; - e.appendChild(document.createTextNode(str)); - } else e.textContent = str; - } - - function getRect(node) { - return node.getBoundingClientRect(); - } - CodeMirror.replaceGetRect = function(f) { getRect = f; }; - // FEATURE DETECTION // Detect drag-and-drop @@ -5661,36 +6184,6 @@ window.CodeMirror = (function() { return "draggable" in div || "dragDrop" in div; }(); - // For a reason I have yet to figure out, some browsers disallow - // word wrapping between certain characters *only* if a new inline - // element is started between them. This makes it hard to reliably - // measure the position of things, since that requires inserting an - // extra span. This terribly fragile set of tests matches the - // character combinations that suffer from this phenomenon on the - // various browsers. - function spanAffectsWrapping() { return false; } - if (gecko) // Only for "$'" - spanAffectsWrapping = function(str, i) { - return str.charCodeAt(i - 1) == 36 && str.charCodeAt(i) == 39; - }; - else if (safari && !/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)) - spanAffectsWrapping = function(str, i) { - return /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1)); - }; - else if (webkit && /Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)) - spanAffectsWrapping = function(str, i) { - var code = str.charCodeAt(i - 1); - return code >= 8208 && code <= 8212; - }; - else if (webkit) - spanAffectsWrapping = function(str, i) { - if (i > 1 && str.charCodeAt(i - 1) == 45) { - if (/\w/.test(str.charAt(i - 2)) && /[^\-?\.]/.test(str.charAt(i))) return true; - if (i > 2 && /[\d\.,]/.test(str.charAt(i - 2)) && /[\d\.,]/.test(str.charAt(i))) return false; - } - return /[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1)); - }; - var knownScrollbarWidth; function scrollbarWidth(measure) { if (knownScrollbarWidth != null) return knownScrollbarWidth; @@ -5713,6 +6206,17 @@ window.CodeMirror = (function() { else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); } + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) return badBidiRects; + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + if (r0.left == r0.right) return false; + var r1 = range(txt, 1, 2).getBoundingClientRect(); + return badBidiRects = (r1.right - r0.right < 3); + } + // See if "".split is the broken IE version, if so, provide an // alternative way to split lines. var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { @@ -5797,19 +6301,21 @@ window.CodeMirror = (function() { function lineStart(cm, lineN) { var line = getLine(cm.doc, lineN); - var visual = visualLine(cm.doc, line); + var visual = visualLine(line); if (visual != line) lineN = lineNo(visual); var order = getOrder(visual); var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); return Pos(lineN, ch); } function lineEnd(cm, lineN) { - var merged, line; - while (merged = collapsedSpanAtEnd(line = getLine(cm.doc, lineN))) - lineN = merged.find().to.line; + var merged, line = getLine(cm.doc, lineN); + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + lineN = null; + } var order = getOrder(line); var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); - return Pos(lineN, ch); + return Pos(lineN == null ? lineNo(line) : lineN, ch); } function compareBidiLevel(order, a, b) { @@ -6044,7 +6550,7 @@ window.CodeMirror = (function() { // THE END - CodeMirror.version = "3.21.1"; + CodeMirror.version = "4.0.0"; return CodeMirror; -})(); +}); From 8c9a679cf8587fb7d9b6d4c109fca068e6453d54 Mon Sep 17 00:00:00 2001 From: Morgawr Date: Fri, 24 Jan 2014 10:40:39 +0100 Subject: [PATCH 013/656] inverted condition for line height --- src/lt/objs/style.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index ff9f377a1..74ac1f9d0 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -63,7 +63,7 @@ (assoc final :font-size size) final) final (if (and line-height - (< 0 line-height)) + (> line-height 0)) (assoc final :line-height line-height) final)] (object/merge! styles final)))) From 46648c924a5a8afb95f4fe7d9b65fe539530ec9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCller?= Date: Fri, 24 Jan 2014 17:51:28 +0100 Subject: [PATCH 014/656] Matching bracket highlighting to tomorrow-night --- deploy/core/css/themes/tomorrow-night.css | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/css/themes/tomorrow-night.css b/deploy/core/css/themes/tomorrow-night.css index e58ba5880..6581a8bc0 100644 --- a/deploy/core/css/themes/tomorrow-night.css +++ b/deploy/core/css/themes/tomorrow-night.css @@ -15,3 +15,4 @@ .cm-s-tomorrow-night span.cm-builtin, .cm-s-tomorrow-night span.cm-minus { color: #cc6666 } .cm-s-tomorrow-night span.cm-variable,.cm-s-tomorrow-night span.cm-variable-2, .cm-s-tomorrow-night span.cm-variable-3, .cm-s-tomorrow-night span.cm-tag, .cm-s-tomorrow-night span.cm-rangeinfo { color: #81a2be } .cm-s-tomorrow-night span.cm-special { color: #f0c674; } +.cm-s-tomorrow-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} From 7a408a66ad48e5487264a8bcb4d735a9608ebca9 Mon Sep 17 00:00:00 2001 From: Morgawr Date: Sat, 25 Jan 2014 00:41:00 +0100 Subject: [PATCH 015/656] fixed issue #1165 - Tabsets don't properly resize after being removed --- src/lt/objs/tabs.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 90255d0f1..dce80cd6a 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -444,6 +444,7 @@ (add! t to-ts)) (object/update! multi [:tabsets] #(vec (remove #{ts} %))) (object/destroy! ts) + (equalize-tabset-widths) (object/raise to-ts :active)))) (defn menu! [obj ev] From 9d4048f92327b0ac1de2dfc01f51e2c5f6eae936 Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Sun, 26 Jan 2014 03:12:10 -0500 Subject: [PATCH 016/656] Updated the thread macro to be the background macro --- src/lt/objs/thread.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index 8acfa135d..4974790a5 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -4,7 +4,7 @@ [lt.objs.platform :as platform] [lt.objs.console :as console] [cljs.reader :as reader]) - (:require-macros [lt.macros :refer [behavior thread]])) + (:require-macros [lt.macros :refer [behavior background]])) (def cp (js/require "child_process")) @@ -108,7 +108,7 @@ (object/raise test :kill!) (object/destroy! test) -(def t (thread (fn [m] +(def t (background (fn [m] (.log js/console "this is a message! " m) ))) From 71e6020888b217cb305852bc6b442df36cb82a9c Mon Sep 17 00:00:00 2001 From: ndr Date: Mon, 27 Jan 2014 13:54:21 +0100 Subject: [PATCH 017/656] Include file extension in transient save dialog If extension information for the transient file is available (e.g. if the syntax has been manually set by the user), the Save As dialog suggests "editorname.ext" as filename. Otherwise, the dialog suggests "editorname" only. --- src/lt/objs/opener.cljs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index a6eba6a6f..df8cd2e6d 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -59,8 +59,13 @@ (behavior ::transient-save :triggers #{:save :save-as-rename!} :reaction (fn [this] - (let [s (save-input this (or (first (:folders @workspace/current-ws)) - (files/home)))] + (let [path (or (first (:folders @workspace/current-ws)) + (files/home)) + info (:info @this) + fname (:name info) + ext (when-let [e (:exts info)] + (str "." (name (first e)))) + s (save-input this (files/join path (str fname ext)))] (set! active-dialog s) (dom/trigger s :click)))) From 6018a7b23c61b37a1b44e30cc2b0405129e75a8b Mon Sep 17 00:00:00 2001 From: Carlos Cobo Date: Mon, 27 Jan 2014 17:07:51 +0100 Subject: [PATCH 018/656] Fix typo --- deploy/core/misc/example.keymap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/misc/example.keymap b/deploy/core/misc/example.keymap index a406f40da..34941c45d 100644 --- a/deploy/core/misc/example.keymap +++ b/deploy/core/misc/example.keymap @@ -1,8 +1,8 @@ ;; User keymap ;; ----------------------------- -;; Keymaps are stored as a set of diffs that are merged together together -;; to create the final set of keys. You can modify these diffs to either add -;; or subtract bindings. +;; Keymaps are stored as a set of diffs that are merged together to create +;; the final set of keys. You can modify these diffs to either add or +;; subtract bindings. ;; ;; Like behaviors, keys are bound by tag. When objects with those tags are active ;; the key bindings are live. Keys can be bound to any number of Light Table commands, From f03e5da0b0b45ae1433bc99f68b7db6e26b5d207 Mon Sep 17 00:00:00 2001 From: ndr Date: Mon, 27 Jan 2014 17:23:16 +0100 Subject: [PATCH 019/656] Add append-to-file function Defines files/append, a wrapper around node's .appendFileSync. Almost identical to files/save: same error-catching and sent triggers. --- src/lt/objs/files.cljs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 12fef9541..65b5cd583 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -160,6 +160,20 @@ (when cb (cb e)) ))) +(defn append [path content & [cb]] + (try + (.appendFileSync fs path content) + (object/raise files-obj :files.save path) + (when cb (cb)) + (catch js/global.Error e + (object/raise files-obj :files.save.error path e) + (when cb (cb e)) + ) + (catch js/Error e + (object/raise files-obj :files.save.error path e) + (when cb (cb e)) + ))) + (defn delete! [path] (if (dir? path) (.rmdirSyncRecursive wrench path) From af44e558bf0b88516056772504c8ea3b05dbddcd Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Mon, 27 Jan 2014 23:04:53 +0200 Subject: [PATCH 020/656] Support alt + N tab switching --- deploy/settings/default/default.keymap | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 9d6e080b2..db03e0574 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -42,6 +42,15 @@ "pmeta-7" [(:tabs.goto 6)] "pmeta-8" [(:tabs.goto 7)] "pmeta-9" [(:tabs.goto 8)] + "alt-1" [(:tabs.goto 0)] + "alt-2" [(:tabs.goto 1)] + "alt-3" [(:tabs.goto 2)] + "alt-4" [(:tabs.goto 3)] + "alt-5" [(:tabs.goto 4)] + "alt-6" [(:tabs.goto 5)] + "alt-7" [(:tabs.goto 6)] + "alt-8" [(:tabs.goto 7)] + "alt-9" [(:tabs.goto 8)] } :popup {"left" [(:popup.move-active 1)], "shift-tab" [(:popup.move-active -1)], From 9eb7949f87f1f135cfaaebeabf9320818a11c41c Mon Sep 17 00:00:00 2001 From: Cristi Mocanu Date: Tue, 28 Jan 2014 01:18:26 +0200 Subject: [PATCH 021/656] Implemented smart quoting in auto-paren plugin. --- src/lt/plugins/auto_paren.cljs | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 7c687d7ac..430703a68 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -2,6 +2,7 @@ (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.editor :as editor] + [lt.objs.editor.pool :as pool] [lt.objs.context :as ctx] [lt.objs.keyboard :refer [passthrough]]) (:require-macros [lt.macros :refer [behavior]])) @@ -30,11 +31,14 @@ (behavior ::open-pair :triggers #{:open-pair!} :reaction (fn [this ch] - (if (re-seq word-char (get-char this 1)) - (editor/insert-at-cursor this ch) - (do - (editor/insert-at-cursor this (str ch (pairs ch))) - (move-cursor this -1))))) + (let [current-selection (editor/selection this)] + (if-not (= current-selection "") + (editor/replace-selection this (str ch current-selection (pairs ch))) + (if (re-seq word-char (get-char this 1)) + (editor/insert-at-cursor this ch) + (do + (editor/insert-at-cursor this (str ch (pairs ch))) + (move-cursor this -1))))))) (behavior ::close-pair :triggers #{:close-pair!} @@ -47,13 +51,16 @@ (behavior ::repeat-pair :triggers #{:repeat-pair!} :reaction (fn [this ch] - (cond - (= ch (get-char this 1)) (move-cursor this 1) - (re-seq word-char (get-char this 1)) (editor/insert-at-cursor this ch) - (re-seq word-char (get-char this -1)) (editor/insert-at-cursor this ch) - :else (do - (editor/insert-at-cursor this (str ch ch)) - (move-cursor this -1))))) + (let [current-selection (editor/selection this)] + (if-not (= something-selected "") + (editor/replace-selection this (str ch current-selection ch)) + (cond + (= ch (get-char this 1)) (move-cursor this 1) + (re-seq word-char (get-char this 1)) (editor/insert-at-cursor this ch) + (re-seq word-char (get-char this -1)) (editor/insert-at-cursor this ch) + :else (do + (editor/insert-at-cursor this (str ch ch)) + (move-cursor this -1))))))) (behavior ::try-remove-pair :triggers #{:backspace!} From 57cf118ebffba5f040e061315a2d16218978efe5 Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Mon, 27 Jan 2014 23:17:03 +0200 Subject: [PATCH 022/656] tabs.goto 8 goes to last tab --- src/lt/objs/tabs.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index dce80cd6a..2146b98ce 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -558,9 +558,13 @@ (cmd/command {:command :tabs.goto :hidden true - :desc "Tab: Goto tab #" + :desc "Tab: Goto tab #; 8 for last tab" :exec (fn [x] - (object/raise (ctx/->obj :tabset) :tab x))}) + (let [ts (ctx/->obj :tabset) + tabcount (count (:objs @ts)) + idx (dec tabcount)] + (object/raise (ctx/->obj :tabset) + :tab (if (= x 8) idx x))))}) (cmd/command {:command :tabset.next :desc "Tabset: Next tabset" From e10cd181c93b5cd0e0aa0551ca1d48868d9210e7 Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Mon, 27 Jan 2014 23:25:41 +0200 Subject: [PATCH 023/656] use :last --- deploy/settings/default/default.keymap | 4 ++-- src/lt/objs/tabs.cljs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index db03e0574..e21e3105e 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -41,7 +41,7 @@ "pmeta-6" [(:tabs.goto 5)] "pmeta-7" [(:tabs.goto 6)] "pmeta-8" [(:tabs.goto 7)] - "pmeta-9" [(:tabs.goto 8)] + "pmeta-9" [(:tabs.goto :last)] "alt-1" [(:tabs.goto 0)] "alt-2" [(:tabs.goto 1)] "alt-3" [(:tabs.goto 2)] @@ -50,7 +50,7 @@ "alt-6" [(:tabs.goto 5)] "alt-7" [(:tabs.goto 6)] "alt-8" [(:tabs.goto 7)] - "alt-9" [(:tabs.goto 8)] + "alt-9" [(:tabs.goto :last)] } :popup {"left" [(:popup.move-active 1)], "shift-tab" [(:popup.move-active -1)], diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 2146b98ce..55978fc04 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -564,7 +564,7 @@ tabcount (count (:objs @ts)) idx (dec tabcount)] (object/raise (ctx/->obj :tabset) - :tab (if (= x 8) idx x))))}) + :tab (if (= x :last) idx x))))}) (cmd/command {:command :tabset.next :desc "Tabset: Next tabset" From ff3a7bc4d23c2febb0532636241aba63e8020be9 Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Tue, 28 Jan 2014 11:13:04 +0200 Subject: [PATCH 024/656] Improve docstring. --- src/lt/objs/tabs.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 55978fc04..a95b7c94f 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -558,7 +558,7 @@ (cmd/command {:command :tabs.goto :hidden true - :desc "Tab: Goto tab #; 8 for last tab" + :desc "Tab: Goto tab # or :last" :exec (fn [x] (let [ts (ctx/->obj :tabset) tabcount (count (:objs @ts)) From 3a7b19aea068fe80612a42df51cc55855e3eb161 Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Tue, 28 Jan 2014 11:13:20 +0200 Subject: [PATCH 025/656] clojure-y name --- src/lt/objs/tabs.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index a95b7c94f..ef6d11a83 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -561,8 +561,8 @@ :desc "Tab: Goto tab # or :last" :exec (fn [x] (let [ts (ctx/->obj :tabset) - tabcount (count (:objs @ts)) - idx (dec tabcount)] + tab-count (count (:objs @ts)) + idx (dec tab-count)] (object/raise (ctx/->obj :tabset) :tab (if (= x :last) idx x))))}) From ea62e8c780629940ae18d79bf79e24bb995ad40a Mon Sep 17 00:00:00 2001 From: ndr Date: Sun, 26 Jan 2014 15:23:23 +0100 Subject: [PATCH 026/656] Make msg* opts argument optional To avoid compiler warnings, change the opts argument of notifos/msg* into an optional one. --- src/lt/objs/notifos.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index a4b8014a1..1dfec66f3 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -20,7 +20,7 @@ (set-msg! msg) (statusbar/loader-dec))) -(defn msg* [m opts] +(defn msg* [m & [opts]] (let [m (if (string? m) m (pr-str m))] From 326f9da0f2325da0d7f94e69ee27f3513a2010c5 Mon Sep 17 00:00:00 2001 From: ndr Date: Sun, 26 Jan 2014 15:14:01 +0100 Subject: [PATCH 027/656] Extend set-msg! with custom timeout The function notifos/set-msg! accepts a :timeout key/value pair in the opts map to set a custom timeout. --- src/lt/objs/notifos.cljs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 1dfec66f3..c25575c45 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -26,10 +26,16 @@ (pr-str m))] (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts)))) -(defn set-msg! [msg opts] - (msg* msg opts) - (js/clearTimeout cur-timeout) - (set! cur-timeout (wait standard-timeout #(msg* "")))) +(defn set-msg! + ([msg] + (msg* msg) + (js/clearTimeout cur-timeout) + (set! cur-timeout (wait standard-timeout #(msg* "")))) + ([msg opts] + (msg* msg opts) + (js/clearTimeout cur-timeout) + (set! cur-timeout (wait (or (:timeout opts) + standard-timeout) #(msg* ""))))) (cmd/command {:command :reset-working :desc "Statusbar: Reset working indicator" From 848d8c125502e002b12ad174c5731bd357a0e854 Mon Sep 17 00:00:00 2001 From: "mark.fisher" Date: Tue, 28 Jan 2014 11:49:06 +0000 Subject: [PATCH 028/656] Copy across platform specific scripts, update version of zip, add .gitignore for env values --- .gitignore | 1 + osx_deps.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6812823f5..e124552da 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ deploy/logs .DS_Store deploy/core/node_modules/lighttable/bootstrap.js* .lein-deps-sum +.lein-env .lein-plugins/ *.so lib diff --git a/osx_deps.sh b/osx_deps.sh index c54b1ab6e..60354ddd0 100644 --- a/osx_deps.sh +++ b/osx_deps.sh @@ -11,12 +11,14 @@ rm -rf deploy/LightTable.app rm deploy/light #get the LightTable.app binary -curl -O http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/LightTableMac.zip +curl -O http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.2/LightTableMac.zip unzip LightTableMac.zip mv LightTable/* deploy/ rmdir LightTable/ rm LightTableMac.zip +cp -r platform/mac/* deploy/ + #build the core cljs of LightTable lein cljsbuild clean && lein cljsbuild once From 0afab092c4f0b196c9e23c76344566fbcc45f915 Mon Sep 17 00:00:00 2001 From: ndr Date: Tue, 28 Jan 2014 15:19:39 +0100 Subject: [PATCH 029/656] Display error message if OSX path sourcing fails If the process spawned by behavior :lt.objs.proc/set-path-OSX fails, notify the user and output the error to console. --- src/lt/objs/proc.cljs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/proc.cljs b/src/lt/objs/proc.cljs index 26f5c12e9..f39d25e3c 100644 --- a/src/lt/objs/proc.cljs +++ b/src/lt/objs/proc.cljs @@ -4,6 +4,7 @@ [lt.objs.files :as files] [lt.objs.platform :as platform] [lt.objs.app :as app] + [lt.objs.notifos :as notifos] [lt.util.load :as load] [clojure.string :as string]) (:require-macros [lt.macros :refer [behavior]])) @@ -134,8 +135,12 @@ (not (aget js/process.env "LTCLI"))) (.exec (js/require "child_process") (str (etc-paths->PATH) (get-path-command)) (fn [err out serr] - (when-not (empty? out) - (set! js/process.env.PATH out))))))) + (if-not (empty? err) + (do + (notifos/set-msg! "Failed to source PATH files. See console log for details." {:class "error"}) + (.error js/console err)) + (when-not (empty? out) + (set! js/process.env.PATH out)))))))) (behavior ::global-path :triggers #{:object.instant} From c28148750f6f01ca050a8a731dc7a8962f4f1e2c Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 28 Jan 2014 10:55:21 -0800 Subject: [PATCH 030/656] make behavior :- negate at the object level. So if some behavior is added to a more general tag, e.g. :editor, you can disable it in :editor.markdown using the :- diff. Signed-off-by: Chris Granger --- src/lt/object.cljs | 9 ++++++++- src/lt/objs/settings.cljs | 25 ++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index ce7932a38..c1e977fef 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -14,6 +14,7 @@ (def behaviors (atom {})) (def object-defs (atom {})) (def tags (atom {})) +(def negated-tags (atom {})) (def ^{:dynamic true} *behavior-meta* nil) (defn add [obj] @@ -46,6 +47,12 @@ (aloop [i arr] (aset arr i (aget arr i 2))) arr)) +(defn ts->negations [ts] + (let [seen (js-obj)] + (doseq [beh (apply concat (map @negated-tags ts))] + (aset seen (->behavior-name beh) true)) + seen)) + (defn tags->behaviors [ts] (let [duped (apply concat (map @tags (specificity-sort ts))) de-duped (reduce @@ -60,7 +67,7 @@ (aset (:seen res) (->behavior-name cur) true)) (conj! (:final res) cur) res))) - {:seen (js-obj) + {:seen (ts->negations ts) :final (transient [])} duped)] (reverse (persistent! (:final de-duped))))) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 36c631272..73fce8871 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -29,16 +29,22 @@ nil)))) (defn +behaviors [cur m] - (reduce (fn [res [k v]] - (update-in res [k] #(apply conj (or % '()) v))) - cur - m)) + (assoc cur :+ + (reduce (fn [res [k v]] + (update-in res [k] #(apply conj (or % '()) v))) + (:+ cur) + m))) (defn -behaviors [cur m] - (reduce (fn [res [k v]] - (update-in res [k] #(remove (set v) %))) - cur - m)) + (assoc cur + :+ (reduce (fn [res [k v]] + (update-in res [k] #(remove (set v) %))) + (:+ cur) + m) + :- (reduce (fn [res [k v]] + (update-in res [k] #(apply conj (or % '()) v))) + (:- cur) + m))) (defn behavior-diff [{add :+ rem :- :as diff} final] (if-not diff @@ -78,7 +84,8 @@ final (if (and ws-diff (not (empty? ws-diff))) (behavior-diff (safe-read ws-diff "workspace.behaviors") final) final)] - (reset! object/tags final))) + (reset! object/negated-tags (:- final)) + (reset! object/tags (:+ final)))) (defn refresh-diffed [diff] (->> (concat (keys (:+ diff)) From 138ca81acf322e4671005444faee6ff60807934f Mon Sep 17 00:00:00 2001 From: "Clinton N. Dreisbach" Date: Tue, 28 Jan 2014 19:20:00 -0500 Subject: [PATCH 031/656] Improve extension support Previously, extensions could be registered with MIME-type info and editor tags only by the last segment of their filename. For example, the extensions for the following files: index.html -> "html" index.html.erb -> "erb" Dockerfile -> nil Supporting different extension types is useful, but blinding taking all segments after the first dot isn't good either: i.like.to.name.files.with.periods.txt -> ".like.to..." The solution is to create a series of file segments, from most specific to least specific to check against. Taking our first examples again, we get the following: index.html -> ["index.html" "html"] index.html.erb -> ["index.html" "html.erb" "erb"] Dockerfile -> ["Dockerfile"] Now, if we look for registered "extensions" (these can be whole filenames), we can take the first one we see. For example, .erb represents a templating language often used in Ruby, and extensions before .erb are the target file type and will often have markup for that type. So, for a .html.erb file, you want to have :editor.html as a tag for sure, but probably also :editor.erb. For all other .erb files, just :editor.erb is needed. You could register both the extension .html.erb and .erb. "index.html.erb" would find the former, while mail.txt.erb would find the latter. This should allow much more flexibility in registering extensions. I specifically need this for a Hoplon plugin. --- src/lt/objs/files.cljs | 34 ++++++++++++++++++++++++++-------- src/lt/objs/jump_stack.cljs | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 65b5cd583..16aa886af 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -63,12 +63,26 @@ (set! available-drives (into #{} ds))) ))) +(defn basename + ([path] (.basename fpath path)) + ([path ext] (.basename fpath path ext))) (defn get-roots [] (if (= separator "\\") available-drives #{"/"})) +(defn get-file-parts [path] + (let [filename (basename path) + file-parts (string/split filename #"\.")] + (loop [parts file-parts + acc []] + (if (empty? parts) + acc + (recur (rest parts) (conj acc (string/join "." parts))))))) + +(get-file-parts "index.cljs.hl") + (defn ext [path] (let [i (.lastIndexOf path ".")] (when (> i 0) @@ -89,10 +103,18 @@ (:mime (ext->type ext))) (defn path->type [path] - (ext->type (keyword (ext path)))) + (->> path + get-file-parts + (map #(ext->type (keyword %))) + (remove nil?) + first)) (defn path->mode [path] - (ext->mode (keyword (ext path)))) + (->> path + get-file-parts + (map #(ext->mode (keyword %))) + (remove nil?) + first)) (defn determine-line-ending [text] (let [text (subs text 0 1000) @@ -116,7 +138,7 @@ (let [e (ext path)] (cb {:content content :line-ending (determine-line-ending content) - :type (or (ext->mode (keyword e)) e)}) + :type (or (path->mode path) e)}) (object/raise files-obj :files.open content)) )) (catch js/Error e @@ -228,10 +250,6 @@ (defn absolute? [path] (boolean (re-seq #"^[\\\/]|([\w]+:[\\\/])" path))) -(defn basename - ([path] (.basename fpath path)) - ([path ext] (.basename fpath path ext))) - (defn writable? [path] (let [perm (-> (.statSync fs path) (.mode.toString 8) @@ -250,7 +268,7 @@ (defn ->type [path] (let [e (ext path)] - (or (ext->mode (keyword e) e)))) + (or (ext->mode path) e))) (defn ls [path cb] (try diff --git a/src/lt/objs/jump_stack.cljs b/src/lt/objs/jump_stack.cljs index d2062f2c0..228d6450f 100644 --- a/src/lt/objs/jump_stack.cljs +++ b/src/lt/objs/jump_stack.cljs @@ -59,4 +59,4 @@ :desc "Editor: Jump to file/pos" :hidden true :exec (fn [file pos] - (jump-to file pos))}) \ No newline at end of file + (jump-to file pos))}) From 1b05610663acc4a8b692e7d806cde59276d0de03 Mon Sep 17 00:00:00 2001 From: manutter51 Date: Wed, 29 Jan 2014 08:13:01 -0500 Subject: [PATCH 032/656] Fix leiningen detection in osx_deps.sh. Current osx_deps.sh reports that Leiningen 2.2 is an old (1.x or 2.0) version. This changeset is a trivial tweak to make the version number detection a bit more robust. --- osx_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx_deps.sh b/osx_deps.sh index c54b1ab6e..f46f92c2d 100644 --- a/osx_deps.sh +++ b/osx_deps.sh @@ -1,6 +1,6 @@ # Check if lein is installed lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } -if [ "$(echo `lein version` | grep 'Leiningen 1.\|2.0')" ]; then +if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; fi From cd1eb87a59c080d5935fedeeaacaf25ccfb1f30d Mon Sep 17 00:00:00 2001 From: Lucas Stadler Date: Wed, 29 Jan 2014 19:31:00 +0100 Subject: [PATCH 033/656] update to wrench v1.5.6. this release supports copying directories with the file modes intact and fixes jetaggart/light-haskell#31. --- deploy/core/node_modules/wrench/.npmignore | 1 + deploy/core/node_modules/wrench/lib/wrench.js | 175 ++++++++++++++---- deploy/core/node_modules/wrench/lib/x.js | 1 - deploy/core/node_modules/wrench/package.json | 12 +- deploy/core/node_modules/wrench/readme.md | 43 ++++- .../core/node_modules/wrench/tests/readdir.js | 9 + .../wrench/tests/rmdirSyncRecursive.js | 74 ++++++++ .../core/node_modules/wrench/tests/runner.js | 3 +- 8 files changed, 270 insertions(+), 48 deletions(-) delete mode 100644 deploy/core/node_modules/wrench/lib/x.js create mode 100644 deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js diff --git a/deploy/core/node_modules/wrench/.npmignore b/deploy/core/node_modules/wrench/.npmignore index 93f136199..05ade97ff 100644 --- a/deploy/core/node_modules/wrench/.npmignore +++ b/deploy/core/node_modules/wrench/.npmignore @@ -1,2 +1,3 @@ node_modules npm-debug.log +.idea diff --git a/deploy/core/node_modules/wrench/lib/wrench.js b/deploy/core/node_modules/wrench/lib/wrench.js index cc5c18b4d..a293fdd40 100644 --- a/deploy/core/node_modules/wrench/lib/wrench.js +++ b/deploy/core/node_modules/wrench/lib/wrench.js @@ -12,8 +12,8 @@ */ var fs = require("fs"), - _path = require("path"); - + _path = require("path"), + isWindows = !!process.platform.match(/^win/); /* wrench.readdirSyncRecursive("directory_path"); * @@ -71,15 +71,16 @@ exports.readdirRecursive = function(baseDir, fn) { var waitCount = 0; function readdirRecursive(curDir) { - var files = [], - curFiles, - nextDirs, - prependcurDir = function(fname){ - return _path.join(curDir, fname); - }; + var prependcurDir = function(fname){ + return _path.join(curDir, fname); + }; waitCount++; fs.readdir(curDir, function(e, curFiles) { + if (e) { + fn(e); + return; + } waitCount--; curFiles = curFiles.map(prependcurDir); @@ -120,7 +121,9 @@ exports.readdirRecursive = function(baseDir, fn) { -/* wrench.rmdirSyncRecursive("directory_path", forceDelete, failSilent); + + +/* wrench.rmdirSyncRecursive("directory_path", failSilent); * * Recursively dives through directories and obliterates everything about it. This is a * Sync-function, which blocks things until it's done. No idea why anybody would want an @@ -132,22 +135,34 @@ exports.rmdirSyncRecursive = function(path, failSilent) { try { files = fs.readdirSync(path); } catch (err) { + if(failSilent) return; throw new Error(err.message); } /* Loop through and delete everything in the sub-tree after checking it */ for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(_path.join(path, files[i])); + var file = _path.join(path, files[i]); + var currFile = fs.lstatSync(file); - if(currFile.isDirectory()) // Recursive function back to the beginning - exports.rmdirSyncRecursive(_path.join(path, files[i])); + if(currFile.isDirectory()) { + // Recursive function back to the beginning + exports.rmdirSyncRecursive(file); + } else if(currFile.isSymbolicLink()) { + // Unlink symlinks + if (isWindows) { + fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. + } - else if(currFile.isSymbolicLink()) // Unlink symlinks - fs.unlinkSync(_path.join(path, files[i])); + fs.unlinkSync(file); + } else { + // Assume it's a file - perhaps a try/catch belongs here? + if (isWindows) { + fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. + } - else // Assume it's a file - perhaps a try/catch belongs here? - fs.unlinkSync(_path.join(path, files[i])); + fs.unlinkSync(file); + } } /* Now that we know everything in the sub-tree has been deleted, we can delete the main @@ -155,20 +170,75 @@ exports.rmdirSyncRecursive = function(path, failSilent) { return fs.rmdirSync(path); }; + + +function isFileIncluded(opts, dir, filename) { + + function isMatch(filter) { + if (typeof filter === 'function') { + return filter(filename, dir) === true; + } + else { + // Maintain backwards compatibility and use just the filename + return filename.match(filter); + } + } + + if (opts.include || opts.exclude) { + if (opts.exclude) { + if (isMatch(opts.exclude)) { + return false; + } + } + + if (opts.include) { + if (isMatch(opts.include)) { + return true; + } + else { + return false; + } + } + + return true; + } + else if (opts.filter) { + var filter = opts.filter; + + if (!opts.whitelist) { + // if !opts.whitelist is false every file or directory + // which does match opts.filter will be ignored + return isMatch(filter) ? false : true; + } else { + // if opts.whitelist is true every file or directory + // which doesn't match opts.filter will be ignored + return !isMatch(filter) ? false : true; + } + } + + return true; +} + /* wrench.copyDirSyncRecursive("directory_to_copy", "new_directory_location", opts); * * Recursively dives through a directory and moves all its files to a new location. This is a * Synchronous function, which blocks things until it's done. If you need/want to do this in - * an Asynchronous manner, look at wrench.copyDirRecursively() below. + * an Asynchronous manner, look at wrench.copyDirRecursively() below. Specify forceDelete to force directory overwrite. * * Note: Directories should be passed to this function without a trailing slash. */ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { - if (!opts || !opts.preserve) { - try { - if(fs.statSync(newDirLocation).isDirectory()) exports.rmdirSyncRecursive(newDirLocation); - } catch(e) { } - } + opts = opts || {}; + + try { + if(fs.statSync(newDirLocation).isDirectory()) { + if(opts.forceDelete) { + exports.rmdirSyncRecursive(newDirLocation); + } else { + return new Error('You are trying to delete a directory that already exists. Specify forceDelete in the opts argument to override this. Bailing~'); + } + } + } catch(e) { } /* Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */ var checkDir = fs.statSync(sourceDir); @@ -180,13 +250,18 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { } var files = fs.readdirSync(sourceDir); + var hasFilter = opts.filter || opts.include || opts.exclude; + var preserveFiles = opts.preserveFiles === true; for(var i = 0; i < files.length; i++) { // ignores all files or directories which match the RegExp in opts.filter - if(typeof opts !== 'undefined') { - if(!opts.whitelist && opts.filter && files[i].match(opts.filter)) continue; - // if opts.whitelist is true every file or directory which doesn't match opts.filter will be ignored - if(opts.whitelist && opts.filter && !files[i].match(opts.filter)) continue; + if(typeof opts !== 'undefined') { + if (hasFilter) { + if (!isFileIncluded(opts, sourceDir, files[i])) { + continue; + } + } + if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue; } @@ -197,6 +272,8 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { var contents = fs.readFileSync(srcFile); fs.writeFileSync(destFile, contents); + var stat = fs.lstatSync(srcFile); + fs.chmodSync(destFile, stat.mode); }; if(currFile.isDirectory()) { @@ -283,9 +360,17 @@ exports.chownSyncRecursive = function(sourceDir, uid, gid) { * * Recursively dives through directories and obliterates everything about it. */ -exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ - fs.readdir(dir, function(err, files){ - if (err) return clbk(err); +exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){ + if(clbk === null || typeof clbk == 'undefined') + clbk = function(err) {}; + + fs.readdir(dir, function(err, files) { + if(err && typeof failSilent === 'boolean' && !failSilent) + return clbk(err); + + if(typeof failSilent === 'function') + clbk = failSilent; + (function rmFile(err){ if (err) return clbk(err); @@ -305,18 +390,30 @@ exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ }); }; -/* wrench.copyDirRecursive("directory_to_copy", "new_location", callback); +/* wrench.copyDirRecursive("directory_to_copy", "new_location", {forceDelete: bool}, callback); * * Recursively dives through a directory and moves all its files to a new - * location. + * location. Specify forceDelete to force directory overwrite. * * Note: Directories should be passed to this function without a trailing slash. */ -exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { - fs.stat(newDir, function(err, newDirStat){ - if (!err) return exports.rmdirRecursive(newDir, function(err){ - copyDirRecursive(srcDir, newDir, clbk); - }); +exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, opts, clbk) { + var originalArguments = Array.prototype.slice.apply(arguments); + srcDir = _path.normalize(srcDir); + newDir = _path.normalize(newDir); + + fs.stat(newDir, function(err, newDirStat) { + if(!err) { + if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete) + return exports.rmdirRecursive(newDir, function(err) { + copyDirRecursive.apply(this, originalArguments); + }); + else + return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.')); + } + + if(typeof opts === 'function') + clbk = opts; fs.stat(srcDir, function(err, srcDirStat){ if (err) return clbk(err); @@ -329,7 +426,7 @@ exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { var filename = files.shift(); if (filename === null || typeof filename == 'undefined') - return clbk(); + return clbk(null); var file = srcDir+'/'+filename, newFile = newDir+'/'+filename; @@ -410,13 +507,13 @@ exports.LineReader.prototype = { if(this.currentPosition === -1) return false; } - if(this.buffer.indexOf("\n") > -1) return true; + if(this.buffer.indexOf("\n") > -1 || this.buffer.length !== 0) return true; return false; }, getNextLine: function() { var lineEnd = this.buffer.indexOf("\n"), - result = this.buffer.substring(0, lineEnd); + result = this.buffer.substring(0, lineEnd != -1 ? lineEnd : this.buffer.length); this.buffer = this.buffer.substring(result.length + 1, this.buffer.length); return result; diff --git a/deploy/core/node_modules/wrench/lib/x.js b/deploy/core/node_modules/wrench/lib/x.js deleted file mode 100644 index 3ddffd615..000000000 --- a/deploy/core/node_modules/wrench/lib/x.js +++ /dev/null @@ -1 +0,0 @@ -require('./wrench').mkdirsSyncRecursive('x/lol/b', 777); diff --git a/deploy/core/node_modules/wrench/package.json b/deploy/core/node_modules/wrench/package.json index 8f355f83e..55c367efe 100644 --- a/deploy/core/node_modules/wrench/package.json +++ b/deploy/core/node_modules/wrench/package.json @@ -1,7 +1,7 @@ { "name": "wrench", "description": "Recursive filesystem (and other) operations that Node *should* have.", - "version": "1.4.4", + "version": "1.5.6", "author": { "name": "Ryan McGrath", "email": "ryan@venodesigns.net" @@ -33,11 +33,13 @@ "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" } ], - "readme": "wrench.js - Recursive file operations in Node.js\n----------------------------------------------------------------------------\nWhile I love Node.js, I've found myself missing some functions. Things like\nrecursively deleting/chmodding a directory (or even deep copying a directory),\nor even a basic line reader, shouldn't need to be re-invented time and time again.\n\nThat said, here's my attempt at a re-usable solution, at least until something\nmore formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple\nto use - check out the documentation/examples below:\n\nInstallation\n-----------------------------------------------------------------------------\n\n npm install wrench\n\nUsage\n-----------------------------------------------------------------------------\n``` javascript\nvar wrench = require('wrench'),\n\tutil = require('util');\n```\n\n### Synchronous operations\n``` javascript\n// Recursively create directories, sub-trees and all.\nwrench.mkdirSyncRecursive(dir, 0777);\n\n// Recursively delete the entire sub-tree of a directory, then kill the directory\nwrench.rmdirSyncRecursive('my_directory_name', failSilently);\n\n// Recursively read directories contents.\nwrench.readdirSyncRecursive('my_directory_name');\n\n// Recursively chmod the entire sub-tree of a directory\nwrench.chmodSyncRecursive('my_directory_name', 0755);\n\n// Recursively chown the entire sub-tree of a directory\nwrench.chownSyncRecursive(\"directory\", uid, gid);\n\n// Deep-copy an existing directory\nwrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up');\n\n// Read lines in from a file until you hit the end\nvar f = new wrench.LineReader('x.txt');\nwhile(f.hasNextLine()) {\n\tutil.puts(x.getNextLine());\n}\n\n// Note: You will need to close that above line reader at some point, otherwise\n// you will run into a \"too many open files\" error. f.close() or fs.closeSync(f.fd) are\n// your friends, as only you know when it is safe to close.\n```\n\n### Asynchronous operations\n``` javascript\n// Recursively read directories contents\nvar files = [];\nwrench.readdirRecursive('my_directory_name', function(error, curFiles) {\n // curFiles is what you want\n});\n```\n\nQuestions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath)\n", + "readme": "wrench.js - Recursive file operations in Node.js\n----------------------------------------------------------------------------\nWhile I love Node.js, I've found myself missing some functions. Things like\nrecursively deleting/chmodding a directory (or even deep copying a directory),\nor even a basic line reader, shouldn't need to be re-invented time and time again.\n\nThat said, here's my attempt at a re-usable solution, at least until something\nmore formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple\nto use - check out the documentation/examples below:\n\nPossibly Breaking Change in v1.5.0\n-----------------------------------------------------------------------------\nIn previous versions of Wrench, we went against the OS-default behavior of not\ndeleting a directory unless the operation is forced. In 1.5.0, this has been\nchanged to be the behavior people expect there to be - if you try to copy over\na directory that already exists, you'll get an Error returned or thrown stating\nthat you need to force it.\n\nSomething like this will do the trick:\n\n``` javascript\nwrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', {\n forceDelete: true\n});\n```\n\nIf you desire the older behavior of Wrench... hit up your package.json. If you\nhappen to find bugs in the 1.5.0 release please feel free to file them on the \nGitHub issues tracker for this project, or send me a pull request and I'll get to\nit as fast as I can. Thanks!\n\n**If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.**\n\nInstallation\n-----------------------------------------------------------------------------\n\n npm install wrench\n\nUsage\n-----------------------------------------------------------------------------\n``` javascript\nvar wrench = require('wrench'),\n\tutil = require('util');\n```\n\n### Synchronous operations\n``` javascript\n// Recursively create directories, sub-trees and all.\nwrench.mkdirSyncRecursive(dir, 0777);\n\n// Recursively delete the entire sub-tree of a directory, then kill the directory\nwrench.rmdirSyncRecursive('my_directory_name', failSilently);\n\n// Recursively read directories contents.\nwrench.readdirSyncRecursive('my_directory_name');\n\n// Recursively chmod the entire sub-tree of a directory\nwrench.chmodSyncRecursive('my_directory_name', 0755);\n\n// Recursively chown the entire sub-tree of a directory\nwrench.chownSyncRecursive(\"directory\", uid, gid);\n\n// Deep-copy an existing directory\nwrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', {\n forceDelete: bool, // Whether to overwrite existing directory or not\n excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .)\n preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing\n inflateSymlinks: bool, // Whether to follow symlinks or not when copying files\n filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude).\n whitelist: bool, // if true every file or directory which doesn't match filter will be ignored\n include: regexpOrFunction, // An include filter (either a regexp or a function)\n exclude: regexpOrFunction // An exclude filter (either a regexp or a function)\n});\n\n// Note: If a RegExp is provided then then it will be matched against the filename. If a function is\n// provided then the signature should be the following:\n// function(filename, dir) { return result; }\n\n// Read lines in from a file until you hit the end\nvar f = new wrench.LineReader('x.txt');\nwhile(f.hasNextLine()) {\n\tutil.puts(f.getNextLine());\n}\n\n// Note: You will need to close that above line reader at some point, otherwise\n// you will run into a \"too many open files\" error. f.close() or fs.closeSync(f.fd) are\n// your friends, as only you know when it is safe to close.\n```\n\n### Asynchronous operations\n``` javascript\n// Recursively read directories contents\nvar files = [];\nwrench.readdirRecursive('my_directory_name', function(error, curFiles) {\n // curFiles is what you want\n});\n\n// If you're feeling somewhat masochistic\nwrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn);\n```\n\nQuestions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath)\n", "readmeFilename": "readme.md", - "_id": "wrench@1.4.4", + "homepage": "https://github.com/ryanmcgrath/wrench-js", + "_id": "wrench@1.5.6", "dist": { - "shasum": "7f523efdb71b0100e77dce834c06523cbe3d54e0" + "shasum": "437b1a15b042162db51dfcf6df1c1ba5f32cb472" }, - "_from": "wrench" + "_from": "wrench@", + "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.6.tgz" } diff --git a/deploy/core/node_modules/wrench/readme.md b/deploy/core/node_modules/wrench/readme.md index 243c0da59..a4e02421a 100644 --- a/deploy/core/node_modules/wrench/readme.md +++ b/deploy/core/node_modules/wrench/readme.md @@ -8,6 +8,29 @@ That said, here's my attempt at a re-usable solution, at least until something more formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple to use - check out the documentation/examples below: +Possibly Breaking Change in v1.5.0 +----------------------------------------------------------------------------- +In previous versions of Wrench, we went against the OS-default behavior of not +deleting a directory unless the operation is forced. In 1.5.0, this has been +changed to be the behavior people expect there to be - if you try to copy over +a directory that already exists, you'll get an Error returned or thrown stating +that you need to force it. + +Something like this will do the trick: + +``` javascript +wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { + forceDelete: true +}); +``` + +If you desire the older behavior of Wrench... hit up your package.json. If you +happen to find bugs in the 1.5.0 release please feel free to file them on the +GitHub issues tracker for this project, or send me a pull request and I'll get to +it as fast as I can. Thanks! + +**If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.** + Installation ----------------------------------------------------------------------------- @@ -38,12 +61,25 @@ wrench.chmodSyncRecursive('my_directory_name', 0755); wrench.chownSyncRecursive("directory", uid, gid); // Deep-copy an existing directory -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up'); +wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { + forceDelete: bool, // Whether to overwrite existing directory or not + excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .) + preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing + inflateSymlinks: bool, // Whether to follow symlinks or not when copying files + filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude). + whitelist: bool, // if true every file or directory which doesn't match filter will be ignored + include: regexpOrFunction, // An include filter (either a regexp or a function) + exclude: regexpOrFunction // An exclude filter (either a regexp or a function) +}); + +// Note: If a RegExp is provided then then it will be matched against the filename. If a function is +// provided then the signature should be the following: +// function(filename, dir) { return result; } // Read lines in from a file until you hit the end var f = new wrench.LineReader('x.txt'); while(f.hasNextLine()) { - util.puts(x.getNextLine()); + util.puts(f.getNextLine()); } // Note: You will need to close that above line reader at some point, otherwise @@ -58,6 +94,9 @@ var files = []; wrench.readdirRecursive('my_directory_name', function(error, curFiles) { // curFiles is what you want }); + +// If you're feeling somewhat masochistic +wrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn); ``` Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath) diff --git a/deploy/core/node_modules/wrench/tests/readdir.js b/deploy/core/node_modules/wrench/tests/readdir.js index 246020305..5e8abf016 100644 --- a/deploy/core/node_modules/wrench/tests/readdir.js +++ b/deploy/core/node_modules/wrench/tests/readdir.js @@ -46,6 +46,15 @@ module.exports = testCase({ checkResult(test, allFiles); } }); + }, + + test_readdirRecursiveWithNonExistentDirectory: function(test) { + wrench.readdirRecursive('', function (e, files) { + test.ok(e); + test.equal(e.code, 'ENOENT'); + test.equal(files, null); + test.done(); + }); } }); diff --git a/deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js b/deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js new file mode 100644 index 000000000..3415e84d0 --- /dev/null +++ b/deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js @@ -0,0 +1,74 @@ +var testCase = require('nodeunit').testCase; +var fs = require('fs'); +var wrench = require('../lib/wrench'); +var path = require('path'); + +module.exports = testCase({ + test_rmdirSyncRecursive: function(test) { + var dir = __dirname + '/_tmp2/foo/bar'; + + wrench.mkdirSyncRecursive(dir, '777'); + + var f1Path = path.join(dir, 'test1.txt'); + var f2Path = path.join(path.dirname(dir), 'test2.txt'); + var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); + + fs.writeFileSync(f1Path, 'foo bar baz'); + fs.writeFileSync(f2Path, 'foo bar baz'); + fs.writeFileSync(f3Path, 'foo bar baz'); + + fs.chmodSync(f1Path, '444'); + fs.chmodSync(f2Path, '444'); + fs.chmodSync(f3Path, '444'); + + test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); + test.equals(fs.existsSync(f1Path), true, 'File should exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(dir); + + test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); + test.equals(fs.existsSync(f1Path), false, 'File should not exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); + + test.done(); + }, + + test_rmdirSyncRecursiveFromRoot: function(test) { + var dir = __dirname + '/_tmp3/foo/bar'; + + wrench.mkdirSyncRecursive(dir, '777'); + + var f1Path = path.join(dir, 'test1.txt'); + var f2Path = path.join(path.dirname(dir), 'test2.txt'); + var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); + + fs.writeFileSync(f1Path, 'foo bar baz'); + fs.writeFileSync(f2Path, 'foo bar baz'); + fs.writeFileSync(f3Path, 'foo bar baz'); + + fs.chmodSync(f1Path, '444'); + fs.chmodSync(f2Path, '444'); + fs.chmodSync(f3Path, '444'); + + test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); + test.equals(fs.existsSync(f1Path), true, 'File should exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); + + test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); + test.equals(fs.existsSync(f1Path), false, 'File should not exist'); + test.equals(fs.existsSync(f2Path), false, 'File should not exist'); + test.equals(fs.existsSync(f3Path), false, 'File should not exist'); + + test.done(); + } +}); + +// vim: et ts=4 sw=4 diff --git a/deploy/core/node_modules/wrench/tests/runner.js b/deploy/core/node_modules/wrench/tests/runner.js index 8f90dae93..e321a1584 100644 --- a/deploy/core/node_modules/wrench/tests/runner.js +++ b/deploy/core/node_modules/wrench/tests/runner.js @@ -4,5 +4,6 @@ module.exports = { group_mkdir: require('./mkdir'), group_readdir: require('./readdir'), - group_copydir: require('./copydirsync_unix') + group_copydir: require('./copydirsync_unix'), + group_rmdir: require('./rmdirSyncRecursive') }; From b6bdde8da06f350d37a364f96846b167813f18a0 Mon Sep 17 00:00:00 2001 From: "Clinton N. Dreisbach" Date: Wed, 29 Jan 2014 15:10:36 -0500 Subject: [PATCH 034/656] Remove stray testing line --- src/lt/objs/files.cljs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 16aa886af..a32561ba7 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -81,8 +81,6 @@ acc (recur (rest parts) (conj acc (string/join "." parts))))))) -(get-file-parts "index.cljs.hl") - (defn ext [path] (let [i (.lastIndexOf path ".")] (when (> i 0) From daa0893120fa6b80131a3606083c2f79c729b34f Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Thu, 30 Jan 2014 00:17:09 +0200 Subject: [PATCH 035/656] make select-all include the whole first line --- src/lt/objs/editor.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index c7c6e9146..dfb60ff7e 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -251,7 +251,7 @@ (defn select-all [e] (set-selection e - {:line (first-line e)} + {:line (first-line e) :ch 0} {:line (last-line e)})) (defn clear-history [e] From c9923f5138d4c071d34804376108bf15805d17be Mon Sep 17 00:00:00 2001 From: "Clinton N. Dreisbach" Date: Wed, 29 Jan 2014 20:04:56 -0500 Subject: [PATCH 036/656] Removed unused files/->type fn --- src/lt/objs/files.cljs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index a32561ba7..c9e9178fb 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -264,10 +264,6 @@ (str f separator) (str f))) -(defn ->type [path] - (let [e (ext path)] - (or (ext->mode path) e))) - (defn ls [path cb] (try (let [fs (map (partial ->file|dir path) (.readdirSync fs path))] From 3c9dd6564aa548bf90bfbfc518900f93bc440e08 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 29 Jan 2014 21:24:32 -0800 Subject: [PATCH 037/656] fix recent workspace delete, auto-wrapping quotes around the selection, don't popup the context menu if it's been handled by the browser Signed-off-by: Chris Granger --- src/lt/objs/browser.cljs | 3 ++- src/lt/objs/sidebar/workspace.cljs | 2 +- src/lt/objs/workspace.cljs | 6 ++---- src/lt/plugins/auto_paren.cljs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 25e827a9b..03c0c2318 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -246,7 +246,8 @@ (object/raise this :inactive e))) (.document.addEventListener window "contextmenu" (fn [e] - (object/raise this :menu! e))) + (when-not (.-defaultPrevented e) + (object/raise this :menu! e)))) (.document.addEventListener window "click" (fn [e] (object/raise this :active) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index b79688b7f..2912cb0fb 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -540,7 +540,7 @@ (when (= (:file @workspace/current-ws) (files/basename (:path @this))) (object/raise tree :clear!)) - (workspace/delete workspace/current-ws) + (workspace/delete (:path @this)) (object/raise sidebar-workspace :recent!))) (object/object* ::recent-workspace diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 387ddc871..d7d32a8bc 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -160,10 +160,8 @@ (files/save (files/join workspace-cache-path file) (pr-str (serialize @ws))) (object/raise ws :save)) -(defn delete [ws] - (let [path (files/join workspace-cache-path - (:file @ws))] - (files/delete! path))) +(defn delete [file] + (files/delete! path)) (defn cached [] (filter #(> (.indexOf % ".clj") -1) (files/full-path-ls workspace-cache-path))) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 430703a68..55c4a07cb 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -52,7 +52,7 @@ :triggers #{:repeat-pair!} :reaction (fn [this ch] (let [current-selection (editor/selection this)] - (if-not (= something-selected "") + (if-not (= current-selection "") (editor/replace-selection this (str ch current-selection ch)) (cond (= ch (get-char this 1)) (move-cursor this 1) From 535001127fd0cdaf34c989e1de6061cf10224276 Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Sun, 2 Feb 2014 23:51:42 +0200 Subject: [PATCH 038/656] check for curl --- linux_deps.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux_deps.sh b/linux_deps.sh index 71a250c45..b3a1c880a 100755 --- a/linux_deps.sh +++ b/linux_deps.sh @@ -5,6 +5,12 @@ if [ "$(echo `lein version` | grep 'Leiningen 1.\|2.0')" ]; then echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; fi +which curl &> /dev/null +if [ $? -ne 0 ]; then + echo "Please install curl before running this." + exit +fi + echo "### Fetching binaries ###" BITS="" if [ $(getconf LONG_BIT) == "64" ]; then BITS="64"; fi From 501126f0e5d74da51d1758b537e6b0ab97c21ce4 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 3 Feb 2014 13:03:55 -0800 Subject: [PATCH 039/656] try pr-string in the console first since clojure errors might come through differently Signed-off-by: Chris Granger --- src/lt/objs/console.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 96b18b9ae..62f7e9630 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -129,7 +129,10 @@ (statusbar/console-class "error") (log (str (if (.-stack e) (.-stack e) - (str e))) + (let [pr-e (pr-str e)] + (if (not= pr-e "[object Object]") + pr-e + (str e))))) "error")) (defn clear [] From 4371ab5a5186f0b4c2ab299f95b04d4d0c7fc1dd Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 4 Feb 2014 13:16:18 -0800 Subject: [PATCH 040/656] don't let negated tags end up nil Signed-off-by: Chris Granger --- src/lt/objs/settings.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 73fce8871..5110c17aa 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -84,8 +84,8 @@ final (if (and ws-diff (not (empty? ws-diff))) (behavior-diff (safe-read ws-diff "workspace.behaviors") final) final)] - (reset! object/negated-tags (:- final)) - (reset! object/tags (:+ final)))) + (reset! object/negated-tags (or (:- final) {})) + (reset! object/tags (or (:+ final) {})))) (defn refresh-diffed [diff] (->> (concat (keys (:+ diff)) From 43fd269c66b9ae809908cfe754fcdaf0b5e7faa6 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 5 Feb 2014 17:26:28 -0800 Subject: [PATCH 041/656] for browser cljs just use pr-str so that we don't get weird mismatches with instance-of Signed-off-by: Chris Granger --- src/lt/objs/browser.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 03c0c2318..39e24323e 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -399,7 +399,7 @@ (doseq [form (:results info)] (try ;;TODO: this is a hack for bad compiler output. We need to just move to the latest cljs - (handle-cb (:cb msg) :editor.eval.cljs.result {:result (eval/cljs-result-format (.eval.call window window (string/replace (:code form) ")goog" ")\ngoog"))) + (handle-cb (:cb msg) :editor.eval.cljs.result {:result (pr-str (.eval.call window window (string/replace (:code form) ")goog" ")\ngoog"))) :meta (merge (:meta msg) (:meta form))}) (catch (.-Error window) e (handle-cb (:cb msg) :editor.eval.cljs.exception {:ex e From d33894879a4f128543b94bd471d6e80a11e7eaa8 Mon Sep 17 00:00:00 2001 From: ndr Date: Thu, 6 Feb 2014 21:00:22 +0100 Subject: [PATCH 042/656] Remove editor/compound editor/compound wraps CodeMirror's compoundChange method, which does not exist in versions above 3.0. --- src/lt/objs/editor.cljs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index dfb60ff7e..d7b074a96 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -272,10 +272,6 @@ (.operation (->cm-ed e) func) e) -(defn compound [e fun] - (.compoundChange (->cm-ed e) fun) - e) - (defn on-click [e func] (let [elem (->elem e)] (ev/capture elem :mousedown func) From 0dbe8223746fd86e3875d775bc7bd4a4d545aac4 Mon Sep 17 00:00:00 2001 From: Yuan Mai <4registration@gmail.com> Date: Fri, 7 Feb 2014 16:29:43 +0800 Subject: [PATCH 043/656] Fixed the namespace of print-length --- deploy/core/misc/example.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/misc/example.behaviors b/deploy/core/misc/example.behaviors index 573dfa3a2..4f8f85ace 100644 --- a/deploy/core/misc/example.behaviors +++ b/deploy/core/misc/example.behaviors @@ -19,7 +19,7 @@ (:lt.objs.style/set-theme "default")] ;; Here we can add behaviors to just clojure editors - :editor.clojure [(:lt.objs.langs.clj/print-length 1000)]} + :editor.clojure [(:lt.plugins.clojure/print-length 1000)]} ;; You can use the subtract key to remove behavior that may get added by ;; another diff From 894e20cdb52661329072e070d2a2e6caf0dbddbc Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 10 Feb 2014 17:29:09 -0800 Subject: [PATCH 044/656] catch all browser errors, changelog, 0.6.3 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 20 +++++++++++++++++++- deploy/core/version.json | 2 +- src/lt/objs/browser.cljs | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index d4090bc05..7003f7133 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -2,8 +2,26 @@ ##0.6.3 -* FIX: plugins now load correctly when installed +* FIX: Remove use of the removed `thread` macro (MarcoPolo) +* FIX: Tabsets don't properly resize after being removed (Morgawr) +* FIX: handle non-dommable errors better (e.g. you throw an object) +* FIX: Matching bracket highlighting for tomorrow-night theme (chmllr) +* FIX: don't let line-height 0 destroy the editor (Morgawr) +* FIX: plugins no longer require a restart * FIX: when user-dir and core contain the same plugin version, choose user-dir first +* FIX: copy over platform specific dir for mac build (mark.fisher) +* FIX: show an error of sourcing for the path fails on OSX (ndr-qef) +* FIX: select-all now correctly includes the first line (mihneadb) +* FIX: check for curl in the linux build script (mihneadb) +* CHANGE: behaviors that have been removed with :- will guarantee that the behavior is not applied to anything with that tag. +* ADDED: You can remove recent workspaces (mortalapeman) +* ADDED: paths like foo.html.erb are now correctly interpreted as their file type +* ADDED: notifications can now be set with custom timeouts (ndr-qef) +* ADDED: pmeta-9 and alt-9 now go to the last tab (mihneadb) +* ADDED: Using auto-pairing with a selection now wraps the selection in the pair (ThePawnBreak) +* ADDED: Suggest an extension in the save-as dialog (ndr-qef) +* ADDED: Support alt-# tab switching (mihneadb) +* UPDATED: Move to wrench 1.5.6 (heyLu) ##0.6.2 diff --git a/deploy/core/version.json b/deploy/core/version.json index 6b950ce8a..9588dcea8 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.6.2","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.6.3","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 39e24323e..5aa92443c 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -401,7 +401,7 @@ ;;TODO: this is a hack for bad compiler output. We need to just move to the latest cljs (handle-cb (:cb msg) :editor.eval.cljs.result {:result (pr-str (.eval.call window window (string/replace (:code form) ")goog" ")\ngoog"))) :meta (merge (:meta msg) (:meta form))}) - (catch (.-Error window) e + (catch :default e (handle-cb (:cb msg) :editor.eval.cljs.exception {:ex e :meta (merge (:meta msg) (:meta form))}))))))) From f184b3864bcd487c1e512444308c21fde90edd50 Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Tue, 11 Feb 2014 18:51:08 -0500 Subject: [PATCH 045/656] Created UI "X" button that allows user to close tabs when clicked. --- src/lt/objs/tabs.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index ef6d11a83..e279e658d 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -33,6 +33,7 @@ (set! (.-scrollLeft gp) (+ (- right pwidth) 50))) )))) + (behavior ::on-destroy-remove :triggers #{:destroy :closed} :reaction (fn [this] @@ -105,6 +106,10 @@ (str c (when (:dirty @e) " dirty"))) +(defui close-tab [obj] ;; TODO: Create x button + [:button "x"] + :click (fn [] (object/raise obj :close))) + (defui item [multi e pos] [:li {:class (-> " " (active? e multi) @@ -113,7 +118,8 @@ :title (->path e) :obj-id (object/->id e) :pos pos} - (->name e)] + (close-tab e) + (->name e)] ;; TODO: Add 'x' button next to file name :click (fn [] (active! e)) :contextmenu (fn [ev] @@ -363,7 +369,7 @@ [:div.list (bound this #(objs-list this (:objs %)))] [:div.items - (map-bound (partial tabbed-item (subatom this :active-obj)) this {:path [:objs]})] + (map-bound (partial tabbed-item (subatom this :active-obj)) this {:path [:objs]})] ;; TODO: Try putting x here (vertical-grip this)] :click (fn [] (object/raise this :active))) From e829fdbb6dfa8ec0254a5f3164834f391a8788e0 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 11 Feb 2014 16:05:52 -0800 Subject: [PATCH 046/656] fix plugin installing weirdness, 0.6.4 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 5 + deploy/core/node_modules/tar/README.md | 60 ++- .../core/node_modules/tar/lib/buffer-entry.js | 4 +- deploy/core/node_modules/tar/lib/entry.js | 273 ++++++------- .../tar/lib/extended-header-writer.js | 5 +- .../node_modules/tar/lib/extended-header.js | 3 +- .../node_modules/block-stream/package.json | 6 +- .../node_modules/fstream/lib/dir-reader.js | 1 + .../tar/node_modules/fstream/lib/reader.js | 5 +- .../fstream/node_modules/graceful-fs/LICENSE | 42 +- .../node_modules/graceful-fs/README.md | 29 +- .../node_modules/graceful-fs/graceful-fs.js | 369 +++++------------- .../node_modules/graceful-fs/package.json | 23 +- .../node_modules/graceful-fs/test/open.js | 13 +- .../fstream/node_modules/rimraf/README.md | 21 +- .../fstream/node_modules/rimraf/package.json | 15 +- .../fstream/node_modules/rimraf/rimraf.js | 104 +++-- .../tar/node_modules/fstream/package.json | 8 +- .../tar/node_modules/inherits/README.md | 93 ++--- .../tar/node_modules/inherits/inherits.js | 30 +- .../tar/node_modules/inherits/package.json | 25 +- deploy/core/node_modules/tar/package.json | 17 +- deploy/core/node_modules/tar/test/pack.js | 3 +- deploy/core/version.json | 2 +- src/lt/objs/deploy.cljs | 8 +- src/lt/objs/plugins.cljs | 7 +- 26 files changed, 535 insertions(+), 636 deletions(-) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 7003f7133..042a8c679 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,10 @@ #Changes +##0.6.4 + +* FIX: plugins would sometimes fail to install due to bad tar headers +* UPDATED: Move to npm-tar 0.1.19 + ##0.6.3 * FIX: Remove use of the removed `thread` macro (MarcoPolo) diff --git a/deploy/core/node_modules/tar/README.md b/deploy/core/node_modules/tar/README.md index 7cfe3bbca..5bcc82cd8 100644 --- a/deploy/core/node_modules/tar/README.md +++ b/deploy/core/node_modules/tar/README.md @@ -2,49 +2,45 @@ Tar for Node.js. -## Goals of this project +[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/) -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. +## API - At least, this includes every version of: +See `examples/` for usage examples. - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") +### var tar = require('tar') -2. Create tar files that can be extracted by any of the following tar - programs: +Returns an object with `.Pack`, `.Extract` and `.Parse` methods. - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") +### tar.Pack([properties]) -3. 100% test coverage. Speed is important. Correctness is slightly - more important. +Returns a through stream. Use +[fstream](https://npmjs.org/package/fstream) to write files into the +pack stream and you will receive tar archive data from the pack +stream. -4. Create the kind of tar interface that Node users would want to use. +The optional `properties` object are used to set properties in the tar +'Global Extended Header'. -5. Satisfy npm's needs for a portable tar implementation with a - JavaScript interface. +### tar.Extract([options]) -6. No excuses. No complaining. No tolerance for failure. +Returns a through stream. Write tar data to the stream and the files +in the tarball will be extracted onto the filesystem. -## But isn't there already a tar.js? +`options` can be: -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. +```js +{ + path: '/path/to/extract/tar/into', + strip: 0, // how many path segments to strip from the root when extracting +} +``` -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. +`options` also get passed to the `fstream.Writer` instance that `tar` +uses internally. -## Didn't you have something already? Where'd it go? +### tar.Parse() -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. +Returns a writable stream. Write tar data to it and it will emit +`entry` events for each entry parsed from the tarball. This is used by +`tar.Extract`. diff --git a/deploy/core/node_modules/tar/lib/buffer-entry.js b/deploy/core/node_modules/tar/lib/buffer-entry.js index 5322a28ab..6c1da2373 100644 --- a/deploy/core/node_modules/tar/lib/buffer-entry.js +++ b/deploy/core/node_modules/tar/lib/buffer-entry.js @@ -20,11 +20,11 @@ function BufferEntry () { }) } +inherits(BufferEntry, Entry) + // collect the bytes as they come in. BufferEntry.prototype.write = function (c) { c.copy(this._buffer, this._offset) this._offset += c.length Entry.prototype.write.call(this, c) } - -inherits(BufferEntry, Entry) diff --git a/deploy/core/node_modules/tar/lib/entry.js b/deploy/core/node_modules/tar/lib/entry.js index df72313bc..4af5c4108 100644 --- a/deploy/core/node_modules/tar/lib/entry.js +++ b/deploy/core/node_modules/tar/lib/entry.js @@ -45,168 +45,169 @@ function Entry (header, extended, global) { this._setProps() } -inherits(Entry, Stream, -{ write: function (c) { - if (this._ending) this.error("write() after end()", null, true) - if (this._remaining === 0) { - this.error("invalid bytes past eof") - } +inherits(Entry, Stream) - // often we'll get a bunch of \0 at the end of the last write, - // since chunks will always be 512 bytes when reading a tarball. - if (c.length > this._remaining) { - c = c.slice(0, this._remaining) - } - this._remaining -= c.length +Entry.prototype.write = function (c) { + if (this._ending) this.error("write() after end()", null, true) + if (this._remaining === 0) { + this.error("invalid bytes past eof") + } - // put it on the stack. - var ql = this._queueLen - this._queue.push(c) - this._queueLen ++ + // often we'll get a bunch of \0 at the end of the last write, + // since chunks will always be 512 bytes when reading a tarball. + if (c.length > this._remaining) { + c = c.slice(0, this._remaining) + } + this._remaining -= c.length - this._read() + // put it on the stack. + var ql = this._queueLen + this._queue.push(c) + this._queueLen ++ - // either paused, or buffered - if (this._paused || ql > 0) { - this._needDrain = true - return false - } + this._read() - return true + // either paused, or buffered + if (this._paused || ql > 0) { + this._needDrain = true + return false } -, end: function (c) { - if (c) this.write(c) - this._ending = true - this._read() - } + return true +} -, pause: function () { - this._paused = true - this.emit("pause") - } +Entry.prototype.end = function (c) { + if (c) this.write(c) + this._ending = true + this._read() +} -, resume: function () { - // console.error(" Tar Entry resume", this.path) - this.emit("resume") - this._paused = false - this._read() - return this._queueLen - this._index > 1 - } +Entry.prototype.pause = function () { + this._paused = true + this.emit("pause") +} + +Entry.prototype.resume = function () { + // console.error(" Tar Entry resume", this.path) + this.emit("resume") + this._paused = false + this._read() + return this._queueLen - this._index > 1 +} // This is bound to the instance -, _read: function () { - // console.error(" Tar Entry _read", this.path) +Entry.prototype._read = function () { + // console.error(" Tar Entry _read", this.path) - if (this._paused || this._reading || this._ended) return + if (this._paused || this._reading || this._ended) return - // set this flag so that event handlers don't inadvertently - // get multiple _read() calls running. - this._reading = true + // set this flag so that event handlers don't inadvertently + // get multiple _read() calls running. + this._reading = true - // have any data to emit? - while (this._index < this._queueLen && !this._paused) { - var chunk = this._queue[this._index ++] - this.emit("data", chunk) - } + // have any data to emit? + while (this._index < this._queueLen && !this._paused) { + var chunk = this._queue[this._index ++] + this.emit("data", chunk) + } - // check if we're drained - if (this._index >= this._queueLen) { - this._queue.length = this._queueLen = this._index = 0 - if (this._needDrain) { - this._needDrain = false - this.emit("drain") - } - if (this._ending) { - this._ended = true - this.emit("end") - } + // check if we're drained + if (this._index >= this._queueLen) { + this._queue.length = this._queueLen = this._index = 0 + if (this._needDrain) { + this._needDrain = false + this.emit("drain") } - - // if the queue gets too big, then pluck off whatever we can. - // this should be fairly rare. - var mql = this._maxQueueLen - if (this._queueLen > mql && this._index > 0) { - mql = Math.min(this._index, mql) - this._index -= mql - this._queueLen -= mql - this._queue = this._queue.slice(mql) + if (this._ending) { + this._ended = true + this.emit("end") } + } - this._reading = false + // if the queue gets too big, then pluck off whatever we can. + // this should be fairly rare. + var mql = this._maxQueueLen + if (this._queueLen > mql && this._index > 0) { + mql = Math.min(this._index, mql) + this._index -= mql + this._queueLen -= mql + this._queue = this._queue.slice(mql) } -, _setProps: function () { - // props = extended->global->header->{} - var header = this._header - , extended = this._extended - , global = this._global - , props = this.props - - // first get the values from the normal header. - var fields = tar.fields - for (var f = 0; fields[f] !== null; f ++) { - var field = fields[f] - , val = header[field] - if (typeof val !== "undefined") props[field] = val - } + this._reading = false +} - // next, the global header for this file. - // numeric values, etc, will have already been parsed. - ;[global, extended].forEach(function (p) { - Object.keys(p).forEach(function (f) { - if (typeof p[f] !== "undefined") props[f] = p[f] - }) - }) +Entry.prototype._setProps = function () { + // props = extended->global->header->{} + var header = this._header + , extended = this._extended + , global = this._global + , props = this.props + + // first get the values from the normal header. + var fields = tar.fields + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , val = header[field] + if (typeof val !== "undefined") props[field] = val + } - // no nulls allowed in path or linkpath - ;["path", "linkpath"].forEach(function (p) { - if (props.hasOwnProperty(p)) { - props[p] = props[p].split("\0")[0] - } + // next, the global header for this file. + // numeric values, etc, will have already been parsed. + ;[global, extended].forEach(function (p) { + Object.keys(p).forEach(function (f) { + if (typeof p[f] !== "undefined") props[f] = p[f] }) + }) + // no nulls allowed in path or linkpath + ;["path", "linkpath"].forEach(function (p) { + if (props.hasOwnProperty(p)) { + props[p] = props[p].split("\0")[0] + } + }) - // set date fields to be a proper date - ;["mtime", "ctime", "atime"].forEach(function (p) { - if (props.hasOwnProperty(p)) { - props[p] = new Date(props[p] * 1000) - } - }) - // set the type so that we know what kind of file to create - var type - switch (tar.types[props.type]) { - case "OldFile": - case "ContiguousFile": - type = "File" - break - - case "GNUDumpDir": - type = "Directory" - break - - case undefined: - type = "Unknown" - break - - case "Link": - case "SymbolicLink": - case "CharacterDevice": - case "BlockDevice": - case "Directory": - case "FIFO": - default: - type = tar.types[props.type] + // set date fields to be a proper date + ;["mtime", "ctime", "atime"].forEach(function (p) { + if (props.hasOwnProperty(p)) { + props[p] = new Date(props[p] * 1000) } + }) - this.type = type - this.path = props.path - this.size = props.size - - // size is special, since it signals when the file needs to end. - this._remaining = props.size + // set the type so that we know what kind of file to create + var type + switch (tar.types[props.type]) { + case "OldFile": + case "ContiguousFile": + type = "File" + break + + case "GNUDumpDir": + type = "Directory" + break + + case undefined: + type = "Unknown" + break + + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + default: + type = tar.types[props.type] } -, warn: fstream.warn -, error: fstream.error -}) + + this.type = type + this.path = props.path + this.size = props.size + + // size is special, since it signals when the file needs to end. + this._remaining = props.size +} + +Entry.prototype.warn = fstream.warn +Entry.prototype.error = fstream.error diff --git a/deploy/core/node_modules/tar/lib/extended-header-writer.js b/deploy/core/node_modules/tar/lib/extended-header-writer.js index 756bff2c1..1728c4583 100644 --- a/deploy/core/node_modules/tar/lib/extended-header-writer.js +++ b/deploy/core/node_modules/tar/lib/extended-header-writer.js @@ -8,7 +8,6 @@ inherits(ExtendedHeaderWriter, EntryWriter) var tar = require("../tar.js") , path = require("path") - , inherits = require("inherits") , TarHeader = require("./header.js") // props is the props of the thing we need to write an @@ -126,8 +125,8 @@ function encodeFields (fields, prefix, body, nop) { break case "nlink": - case "dev": // Truly a hero[-ine] among humankind, Creator of Star! - case "ino": // Speak their name with reverent awe! It is: + case "dev": // Truly a hero among men, Creator of Star! + case "ino": // Speak his name with reverent awe! It is: k = "SCHILY." + k break diff --git a/deploy/core/node_modules/tar/lib/extended-header.js b/deploy/core/node_modules/tar/lib/extended-header.js index 4346d6c59..74f432cee 100644 --- a/deploy/core/node_modules/tar/lib/extended-header.js +++ b/deploy/core/node_modules/tar/lib/extended-header.js @@ -30,7 +30,8 @@ function ExtendedHeader () { this._key = "" } -inherits(ExtendedHeader, Entry, { _parse: parse }) +inherits(ExtendedHeader, Entry) +ExtendedHeader.prototype._parse = parse var s = 0 , states = ExtendedHeader.states = {} diff --git a/deploy/core/node_modules/tar/node_modules/block-stream/package.json b/deploy/core/node_modules/tar/node_modules/block-stream/package.json index a381e22f2..97344dd09 100644 --- a/deploy/core/node_modules/tar/node_modules/block-stream/package.json +++ b/deploy/core/node_modules/tar/node_modules/block-stream/package.json @@ -6,7 +6,7 @@ }, "name": "block-stream", "description": "a stream of blocks", - "version": "0.0.6", + "version": "0.0.7", "repository": { "type": "git", "url": "git://github.com/isaacs/block-stream.git" @@ -16,7 +16,7 @@ }, "main": "block-stream.js", "dependencies": { - "inherits": "~1.0.0" + "inherits": "~2.0.0" }, "devDependencies": { "tap": "0.x" @@ -27,6 +27,6 @@ "license": "BSD", "readme": "# block-stream\n\nA stream of blocks.\n\nWrite data into it, and it'll output data in buffer blocks the size you\nspecify, padding with zeroes if necessary.\n\n```javascript\nvar block = new BlockStream(512)\nfs.createReadStream(\"some-file\").pipe(block)\nblock.pipe(fs.createWriteStream(\"block-file\"))\n```\n\nWhen `.end()` or `.flush()` is called, it'll pad the block with zeroes.\n", "readmeFilename": "README.md", - "_id": "block-stream@0.0.6", + "_id": "block-stream@0.0.7", "_from": "block-stream@*" } diff --git a/deploy/core/node_modules/tar/node_modules/fstream/lib/dir-reader.js b/deploy/core/node_modules/tar/node_modules/fstream/lib/dir-reader.js index dd9883b22..346ac2b83 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/lib/dir-reader.js +++ b/deploy/core/node_modules/tar/node_modules/fstream/lib/dir-reader.js @@ -212,6 +212,7 @@ DirReader.prototype.getChildProps = function (stat) { , follow: this.follow , filter: this.filter , sort: this.props.sort + , hardlinks: this.props.hardlinks } } diff --git a/deploy/core/node_modules/tar/node_modules/fstream/lib/reader.js b/deploy/core/node_modules/tar/node_modules/fstream/lib/reader.js index e4e1b482c..eaf921cd0 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/lib/reader.js +++ b/deploy/core/node_modules/tar/node_modules/fstream/lib/reader.js @@ -142,7 +142,6 @@ Reader.prototype._stat = function (currentStat) { var me = this , props = me.props , stat = props.follow ? "stat" : "lstat" - // console.error("Reader._stat", me._path, currentStat) if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) else fs[stat](me._path, statCb) @@ -163,8 +162,10 @@ Reader.prototype._stat = function (currentStat) { me.size = props.size var type = getType(props) + var handleHardlinks = props.hardlinks !== false + // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { + if (handleHardlinks && type !== "Directory" && props.nlink && props.nlink > 1) { var k = props.dev + ":" + props.ino // console.error("Reader has nlink", me._path, k) if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE index 05a401094..0c44ae716 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE @@ -1,23 +1,27 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +Copyright (c) Isaac Z. Schlueter ("Author") All rights reserved. -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 BSD License -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: -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. +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. 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 AUTHOR 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 THE AUTHOR OR CONTRIBUTORS +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. diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md index 7d2e681e3..eb1a10935 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md @@ -1,5 +1,26 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. +# graceful-fs -Useful in asynchronous situations where one needs to try to open lots -and lots of files. +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over fs module + +graceful-fs: + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js index fe9c3f4ca..1865f92cc 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js @@ -1,316 +1,159 @@ -// this keeps a queue of opened file descriptors, and will make -// fs operations wait until some have closed before trying to open more. +// Monkey-patching the fs module. +// It's ugly, but there is simply no other way to do this. +var fs = module.exports = require('fs') -var fs_ = require("fs") +var assert = require('assert') -var fs = module.exports = {} +// fix up some busted stuff, mostly on windows and old nodes +require('./polyfills.js') -Object.getOwnPropertyNames(fs_).forEach(function(prop) { - var desc = Object.getOwnPropertyDescriptor(fs_, prop) - Object.defineProperty(fs, prop, desc) -}) +// The EMFILE enqueuing stuff -var queue = [] - , constants = require("constants") +var util = require('util') + +function noop () {} -exports = module.exports = fs -fs._curOpen = 0 +var debug = noop +var util = require('util') +if (util.debuglog) + debug = util.debuglog('gfs') +else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') + console.error(m) + } + +if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug('fds', fds) + debug(queue) + assert.equal(queue.length, 0) + }) +} -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync +fs.open = open +function open(path, flags, mode, cb) { + if (typeof mode === "function") cb = mode, mode = null + if (typeof cb !== "function") cb = noop + new OpenReq(path, flags, mode, cb) +} -// prevent EMFILE errors -function OpenReq (path, flags, mode, cb) { +function OpenReq(path, flags, mode, cb) { this.path = path this.flags = flags this.mode = mode this.cb = cb + Req.call(this) } -function noop () {} +util.inherits(OpenReq, Req) -fs.open = gracefulOpen - -function gracefulOpen (path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new OpenReq(path, flags, mode, cb)) - setTimeout(flush) - return - } - open(path, flags, mode, function (er, fd) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - // that was too many. reduce max, get back in queue. - // this should only happen once in a great while, and only - // if the ulimit -n is set lower than 1024. - fs.MAX_OPEN = fs._curOpen - 1 - return fs.open(path, flags, mode, cb) - } - cb(er, fd) - }) +OpenReq.prototype.process = function() { + originalOpen.call(fs, this.path, this.flags, this.mode, this.done) } -function open (path, flags, mode, cb) { - cb = cb || noop - fs._curOpen ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) +var fds = {} +OpenReq.prototype.done = function(er, fd) { + debug('open done', er, fd) + if (fd) + fds['fd' + fd] = this.path + Req.prototype.done.call(this, er, fd) } -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.call(fs, path, flags, mode) - fs._curOpen ++ - return ret -} -function onclose () { - fs._curOpen -- - flush() -} +var originalReaddir = fs.readdir +fs.readdir = readdir -function flush () { - while (fs._curOpen < fs.MAX_OPEN) { - var req = queue.shift() - if (!req) return - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) +function readdir(path, cb) { + if (typeof cb !== "function") cb = noop + new ReaddirReq(path, cb) } -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) +function ReaddirReq(path, cb) { + this.path = path + this.cb = cb + Req.call(this) } +util.inherits(ReaddirReq, Req) -// (re-)implement some things that are known busted or missing. - -var constants = require("constants") - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } +ReaddirReq.prototype.process = function() { + originalReaddir.call(fs, this.path, this.done) +} - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } +ReaddirReq.prototype.done = function(er, files) { + Req.prototype.done.call(this, er, files) + onclose() } -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } +var originalClose = fs.close +fs.close = close - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } +function close (fd, cb) { + debug('close', fd) + if (typeof cb !== "function") cb = noop + delete fds['fd' + fd] + originalClose.call(fs, fd, function(er) { + onclose() + cb(er) + }) } -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) +var originalCloseSync = fs.closeSync +fs.closeSync = closeSync -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) +function closeSync (fd) { + try { + return originalCloseSync(fd) + } finally { + onclose() } } -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} -function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true +// Req class +function Req () { + // start processing + this.done = this.done.bind(this) + this.failures = 0 + this.process() } - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) +Req.prototype.done = function (er, result) { + var tryAgain = false + if (er) { + var code = er.code + var tryAgain = code === "EMFILE" + if (process.platform === "win32") + tryAgain = tryAgain || code === "OK" } - fs.lchownSync = function () {} -} - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) + if (tryAgain) { + this.failures ++ + enqueue(this) + } else { + var cb = this.cb + cb(er, result) } } +var queue = [] -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) +function enqueue(req) { + queue.push(req) + debug('enqueue %d %s', queue.length, req.constructor.name, req) } -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } +function onclose() { + var req = queue.shift() + if (req) { + debug('process', req.constructor.name, req) + req.process() } } diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json index 6c273a331..ef302fd7a 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json @@ -5,8 +5,8 @@ "url": "http://blog.izs.me" }, "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.2.0", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "2.0.1", "repository": { "type": "git", "url": "git://github.com/isaacs/node-graceful-fs.git" @@ -23,14 +23,23 @@ }, "keywords": [ "fs", - "EMFILE", + "module", + "reading", + "retry", + "retries", + "queue", "error", + "errors", "handling", - "monkeypatch" + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" ], "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", + "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n", "readmeFilename": "README.md", - "_id": "graceful-fs@1.2.0", - "_from": "graceful-fs@~1.2.0" + "_id": "graceful-fs@2.0.1", + "_from": "graceful-fs@~2.0.0" } diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js index 930d53257..104f36b0b 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js @@ -1,30 +1,25 @@ var test = require('tap').test var fs = require('../graceful-fs.js') -test('graceful fs is not fs', function (t) { - t.notEqual(fs, require('fs')) +test('graceful fs is monkeypatched fs', function (t) { + t.equal(fs, require('fs')) t.end() }) test('open an existing file works', function (t) { - var start = fs._curOpen var fd = fs.openSync(__filename, 'r') - t.equal(fs._curOpen, start + 1) fs.closeSync(fd) - t.equal(fs._curOpen, start) fs.open(__filename, 'r', function (er, fd) { if (er) throw er - t.equal(fs._curOpen, start + 1) fs.close(fd, function (er) { if (er) throw er - t.equal(fs._curOpen, start) + t.pass('works') t.end() }) }) }) test('open a non-existing file throws', function (t) { - var start = fs._curOpen var er try { var fd = fs.openSync('this file does not exist', 'r') @@ -34,13 +29,11 @@ test('open a non-existing file throws', function (t) { t.ok(er, 'should throw') t.notOk(fd, 'should not get an fd') t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) fs.open('neither does this file', 'r', function (er, fd) { t.ok(er, 'should throw') t.notOk(fd, 'should not get an fd') t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) t.end() }) }) diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md index 96ce9b2a0..cd123b652 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md @@ -1,4 +1,4 @@ -A `rm -rf` for node. +`rm -rf` for node. Install with `npm install rimraf`, or just drop rimraf.js somewhere. @@ -9,13 +9,22 @@ Install with `npm install rimraf`, or just drop rimraf.js somewhere. The callback will be called with an error if there is one. Certain errors are handled for you: -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. ## rimraf.sync It can remove stuff synchronously, too. But that's not so good. Use the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf ` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json index 679ee6b03..003a69972 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json @@ -1,6 +1,6 @@ { "name": "rimraf", - "version": "2.1.4", + "version": "2.2.6", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": { @@ -12,9 +12,6 @@ "type": "MIT", "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" }, - "optionalDependencies": { - "graceful-fs": "~1" - }, "repository": { "type": "git", "url": "git://github.com/isaacs/rimraf.git" @@ -22,6 +19,9 @@ "scripts": { "test": "cd test && bash run.sh" }, + "bin": { + "rimraf": "./bin.js" + }, "contributors": [ { "name": "Isaac Z. Schlueter", @@ -45,11 +45,8 @@ "email": "yosefd@microsoft.com" } ], - "readme": "A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n", + "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n", "readmeFilename": "README.md", - "_id": "rimraf@2.1.4", - "dependencies": { - "graceful-fs": "~1" - }, + "_id": "rimraf@2.2.6", "_from": "rimraf@2" } diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js index ed915f982..ce62051fc 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js @@ -2,27 +2,23 @@ module.exports = rimraf rimraf.sync = rimrafSync var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} +var fs = require("fs") // for EMFILE handling var timeout = 0 exports.EMFILE_MAX = 1000 exports.BUSYTRIES_MAX = 3 +var isWindows = (process.platform === "win32") + function rimraf (p, cb) { if (!cb) throw new Error("No callback passed to rimraf()") var busyTries = 0 rimraf_(p, function CB (er) { if (er) { - if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && + busyTries < exports.BUSYTRIES_MAX) { busyTries ++ var time = busyTries * 100 // try again, with the same exact callback as this one. @@ -60,20 +56,61 @@ function rimraf (p, cb) { // be made configurable somehow. But until then, YAGNI. function rimraf_ (p, cb) { fs.unlink(p, function (er) { - if (er && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) + if (er.code === "EISDIR") + return rmdir(p, er, cb) + } return cb(er) }) } +function fixWinEPERM (p, er, cb) { + fs.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + fs.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, er, cb) + else + fs.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, er, cb) { + try { + fs.chmodSync(p, 666) + } catch (er2) { + if (er2.code !== "ENOENT") + throw er + } + + try { + var stats = fs.statSync(p) + } catch (er3) { + if (er3 !== "ENOENT") + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, er) + else + fs.unlinkSync(p) +} + function rmdir (p, originalEr, cb) { // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. fs.rmdir(p, function (er) { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST")) + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) @@ -112,21 +149,30 @@ function rimrafSync (p) { } catch (er) { if (er.code === "ENOENT") return - if (er.code !== "EPERM" && er.code !== "EISDIR") + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er) + if (er.code !== "EISDIR") throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } + rmdirSync(p, er) + } +} + +function rmdirSync (p, originalEr) { + try { + fs.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p) } } + +function rmkidsSync (p) { + fs.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f)) + }) + fs.rmdirSync(p) +} diff --git a/deploy/core/node_modules/tar/node_modules/fstream/package.json b/deploy/core/node_modules/tar/node_modules/fstream/package.json index 46e6b0bb6..d0d664092 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/package.json +++ b/deploy/core/node_modules/tar/node_modules/fstream/package.json @@ -6,7 +6,7 @@ }, "name": "fstream", "description": "Advanced file system stream things", - "version": "0.1.22", + "version": "0.1.25", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream.git" @@ -18,8 +18,8 @@ "dependencies": { "rimraf": "2", "mkdirp": "0.3", - "graceful-fs": "~1.2.0", - "inherits": "~1.0.0" + "graceful-fs": "~2.0.0", + "inherits": "~2.0.0" }, "devDependencies": { "tap": "" @@ -30,6 +30,6 @@ "license": "BSD", "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", "readmeFilename": "README.md", - "_id": "fstream@0.1.22", + "_id": "fstream@0.1.25", "_from": "fstream@~0.1.8" } diff --git a/deploy/core/node_modules/tar/node_modules/inherits/README.md b/deploy/core/node_modules/tar/node_modules/inherits/README.md index b2beaed93..b1c566585 100644 --- a/deploy/core/node_modules/tar/node_modules/inherits/README.md +++ b/deploy/core/node_modules/tar/node_modules/inherits/README.md @@ -1,51 +1,42 @@ -A dead simple way to do inheritance in JS. - - var inherits = require("inherits") - - function Animal () { - this.alive = true - } - Animal.prototype.say = function (what) { - console.log(what) - } - - inherits(Dog, Animal) - function Dog () { - Dog.super.apply(this) - } - Dog.prototype.sniff = function () { - this.say("sniff sniff") - } - Dog.prototype.bark = function () { - this.say("woof woof") - } - - inherits(Chihuahua, Dog) - function Chihuahua () { - Chihuahua.super.apply(this) - } - Chihuahua.prototype.bark = function () { - this.say("yip yip") - } - - // also works - function Cat () { - Cat.super.apply(this) - } - Cat.prototype.hiss = function () { - this.say("CHSKKSS!!") - } - inherits(Cat, Animal, { - meow: function () { this.say("miao miao") } - }) - Cat.prototype.purr = function () { - this.say("purr purr") - } - - - var c = new Chihuahua - assert(c instanceof Chihuahua) - assert(c instanceof Dog) - assert(c instanceof Animal) - -The actual function is laughably small. 10-lines small. +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/deploy/core/node_modules/tar/node_modules/inherits/inherits.js b/deploy/core/node_modules/tar/node_modules/inherits/inherits.js index 061b39620..29f5e24f5 100644 --- a/deploy/core/node_modules/tar/node_modules/inherits/inherits.js +++ b/deploy/core/node_modules/tar/node_modules/inherits/inherits.js @@ -1,29 +1 @@ -module.exports = inherits - -function inherits (c, p, proto) { - proto = proto || {} - var e = {} - ;[c.prototype, proto].forEach(function (s) { - Object.getOwnPropertyNames(s).forEach(function (k) { - e[k] = Object.getOwnPropertyDescriptor(s, k) - }) - }) - c.prototype = Object.create(p.prototype, e) - c.super = p -} - -//function Child () { -// Child.super.call(this) -// console.error([this -// ,this.constructor -// ,this.constructor === Child -// ,this.constructor.super === Parent -// ,Object.getPrototypeOf(this) === Child.prototype -// ,Object.getPrototypeOf(Object.getPrototypeOf(this)) -// === Parent.prototype -// ,this instanceof Child -// ,this instanceof Parent]) -//} -//function Parent () {} -//inherits(Child, Parent) -//new Child +module.exports = require('util').inherits diff --git a/deploy/core/node_modules/tar/node_modules/inherits/package.json b/deploy/core/node_modules/tar/node_modules/inherits/package.json index fb5b6e286..1ac38223d 100644 --- a/deploy/core/node_modules/tar/node_modules/inherits/package.json +++ b/deploy/core/node_modules/tar/node_modules/inherits/package.json @@ -1,26 +1,29 @@ { "name": "inherits", - "description": "A tiny simple way to do classic inheritance in js", - "version": "1.0.0", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", "keywords": [ "inheritance", "class", "klass", "oop", - "object-oriented" + "object-oriented", + "inherits", + "browser", + "browserify" ], "main": "./inherits.js", + "browser": "./inherits_browser.js", "repository": { "type": "git", - "url": "https://github.com/isaacs/inherits" + "url": "git://github.com/isaacs/inherits" }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "license": "ISC", + "scripts": { + "test": "node test" }, - "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", "readmeFilename": "README.md", - "_id": "inherits@1.0.0", - "_from": "inherits@1.x" + "_id": "inherits@2.0.1", + "_from": "inherits@2" } diff --git a/deploy/core/node_modules/tar/package.json b/deploy/core/node_modules/tar/package.json index 557ace590..6d68aba7b 100644 --- a/deploy/core/node_modules/tar/package.json +++ b/deploy/core/node_modules/tar/package.json @@ -6,7 +6,7 @@ }, "name": "tar", "description": "tar for node", - "version": "0.1.16", + "version": "0.1.19", "repository": { "type": "git", "url": "git://github.com/isaacs/node-tar.git" @@ -15,11 +15,8 @@ "scripts": { "test": "tap test/*.js" }, - "engines": { - "node": "~0.5.9 || 0.6 || 0.7 || 0.8" - }, "dependencies": { - "inherits": "1.x", + "inherits": "2", "block-stream": "*", "fstream": "~0.1.8" }, @@ -28,8 +25,12 @@ "rimraf": "1.x" }, "license": "BSD", - "readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar\n programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly\n more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a\n JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", + "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", "readmeFilename": "README.md", - "_id": "tar@0.1.16", - "_from": "tar" + "_id": "tar@0.1.19", + "dist": { + "shasum": "bd31a1030d51bfbbbf4b3e174603500389a1250d" + }, + "_from": "tar@", + "_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.19.tgz" } diff --git a/deploy/core/node_modules/tar/test/pack.js b/deploy/core/node_modules/tar/test/pack.js index 8be4178bb..0f5099458 100644 --- a/deploy/core/node_modules/tar/test/pack.js +++ b/deploy/core/node_modules/tar/test/pack.js @@ -50,8 +50,7 @@ var tap = require("tap") "NODETAR.repository.type": pkg.repository.type, "NODETAR.repository.url": pkg.repository.url, "NODETAR.main": pkg.main, - "NODETAR.scripts.test": pkg.scripts.test, - "NODETAR.engines.node": pkg.engines.node } ] + "NODETAR.scripts.test": pkg.scripts.test } ] , [ 'entry', { path: 'fixtures/', diff --git a/deploy/core/version.json b/deploy/core/version.json index 9588dcea8..7f738181f 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.6.3","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.6.4","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index bf026d7c8..e18a6b9c0 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -20,6 +20,7 @@ (def fs (js/require "fs")) (def fs-path (js/require "path")) (def targz (load/node-module "tar.gz")) +(def zlib (js/require "zlib")) (def request (load/node-module "request")) (def tar (load/node-module "tar")) (def home-path (files/lt-home "")) @@ -84,8 +85,11 @@ (cb e r body))))) (defn untar [from to cb] - (let [t (targz.)] - (.extract t from to cb))) + (let [t (.createReadStream fs from)] + (.. t + (pipe (.createGunzip zlib)) + (pipe (.Extract tar (js-obj "path" to))) + (on "end" cb)))) (defn move-tmp [] (doseq [file (files/full-path-ls (str home-path "/tmp/"))] diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 352c37299..4e441eef0 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -174,9 +174,12 @@ (notifos/working "Extracting plugin...") (deploy/untar tmp-gz tmp-dir (fn [] - (let [munged-dir (first (files/full-path-ls tmp-dir))] + (let [munged-dir (first (files/full-path-ls tmp-dir)) + final-path (str user-plugins-dir "/" munged-name "/")] (when munged-dir - (files/move! munged-dir (str user-plugins-dir "/" munged-name "/"))) + (when (files/exists? final-path) + (files/delete! final-path)) + (files/move! munged-dir final-path)) (files/delete! tmp-dir) (files/delete! tmp-gz) (if munged-dir From d7ba06645989559e8560a5c87f76be85bbca8614 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 11 Feb 2014 16:14:55 -0800 Subject: [PATCH 047/656] remove tar.gz Signed-off-by: Chris Granger --- deploy/core/node_modules/tar.gz/.npmignore | 3 - deploy/core/node_modules/tar.gz/Cakefile | 75 -- deploy/core/node_modules/tar.gz/LICENSE | 20 - deploy/core/node_modules/tar.gz/README.md | 103 -- deploy/core/node_modules/tar.gz/bin/targz | 55 - .../tar.gz/example/example.coffee | 10 - .../node_modules/tar.gz/example/example.js | 10 - deploy/core/node_modules/tar.gz/lib/targz.js | 82 -- .../tar.gz/node_modules/commander/.npmignore | 4 - .../tar.gz/node_modules/commander/.travis.yml | 4 - .../tar.gz/node_modules/commander/History.md | 152 --- .../tar.gz/node_modules/commander/Makefile | 7 - .../tar.gz/node_modules/commander/Readme.md | 270 ---- .../tar.gz/node_modules/commander/index.js | 1131 ----------------- .../commander/node_modules/keypress/README.md | 101 -- .../commander/node_modules/keypress/index.js | 346 ----- .../node_modules/keypress/package.json | 28 - .../commander/node_modules/keypress/test.js | 28 - .../node_modules/commander/package.json | 37 - .../tar.gz/node_modules/fstream/.npmignore | 5 - .../tar.gz/node_modules/fstream/.travis.yml | 3 - .../tar.gz/node_modules/fstream/LICENSE | 27 - .../tar.gz/node_modules/fstream/README.md | 76 -- .../fstream/examples/filter-pipe.js | 131 -- .../node_modules/fstream/examples/pipe.js | 115 -- .../node_modules/fstream/examples/reader.js | 54 - .../fstream/examples/symlink-write.js | 24 - .../tar.gz/node_modules/fstream/fstream.js | 31 - .../node_modules/fstream/lib/abstract.js | 85 -- .../node_modules/fstream/lib/collect.js | 67 - .../node_modules/fstream/lib/dir-reader.js | 251 ---- .../node_modules/fstream/lib/dir-writer.js | 171 --- .../node_modules/fstream/lib/file-reader.js | 147 --- .../node_modules/fstream/lib/file-writer.js | 100 -- .../node_modules/fstream/lib/get-type.js | 32 - .../node_modules/fstream/lib/link-reader.js | 54 - .../node_modules/fstream/lib/link-writer.js | 95 -- .../node_modules/fstream/lib/proxy-reader.js | 93 -- .../node_modules/fstream/lib/proxy-writer.js | 109 -- .../tar.gz/node_modules/fstream/lib/reader.js | 260 ---- .../node_modules/fstream/lib/socket-reader.js | 38 - .../tar.gz/node_modules/fstream/lib/writer.js | 389 ------ .../node_modules/graceful-fs/.npmignore | 1 - .../fstream/node_modules/graceful-fs/LICENSE | 27 - .../node_modules/graceful-fs/README.md | 26 - .../node_modules/graceful-fs/graceful-fs.js | 159 --- .../node_modules/graceful-fs/package.json | 45 - .../node_modules/graceful-fs/test/open.js | 39 - .../fstream/node_modules/inherits/README.md | 42 - .../fstream/node_modules/inherits/inherits.js | 1 - .../node_modules/inherits/package.json | 29 - .../fstream/node_modules/mkdirp/.npmignore | 2 - .../fstream/node_modules/mkdirp/.travis.yml | 5 - .../fstream/node_modules/mkdirp/LICENSE | 21 - .../node_modules/mkdirp/examples/pow.js | 6 - .../fstream/node_modules/mkdirp/index.js | 82 -- .../fstream/node_modules/mkdirp/package.json | 30 - .../node_modules/mkdirp/readme.markdown | 63 - .../fstream/node_modules/mkdirp/test/chmod.js | 38 - .../node_modules/mkdirp/test/clobber.js | 37 - .../node_modules/mkdirp/test/mkdirp.js | 28 - .../fstream/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../fstream/node_modules/mkdirp/test/race.js | 41 - .../fstream/node_modules/mkdirp/test/rel.js | 32 - .../node_modules/mkdirp/test/return.js | 25 - .../node_modules/mkdirp/test/return_sync.js | 24 - .../fstream/node_modules/mkdirp/test/root.js | 18 - .../fstream/node_modules/mkdirp/test/sync.js | 32 - .../fstream/node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 32 - .../fstream/node_modules/rimraf/AUTHORS | 6 - .../fstream/node_modules/rimraf/LICENSE | 23 - .../fstream/node_modules/rimraf/README.md | 30 - .../fstream/node_modules/rimraf/package.json | 56 - .../fstream/node_modules/rimraf/rimraf.js | 178 --- .../fstream/node_modules/rimraf/test/run.sh | 10 - .../fstream/node_modules/rimraf/test/setup.sh | 47 - .../node_modules/rimraf/test/test-async.js | 5 - .../node_modules/rimraf/test/test-sync.js | 3 - .../tar.gz/node_modules/fstream/package.json | 39 - deploy/core/node_modules/tar.gz/package.json | 61 - .../core/node_modules/tar.gz/src/targz.coffee | 80 -- .../tar.gz/test/compress/test.txt | 47 - .../tar.gz/test/extract/placeholder | 0 .../fstream/node_modules/.bin/rimraf | 0 .../node_modules/graceful-fs/polyfills.js | 0 .../fstream/node_modules/rimraf/bin.js | 0 .../node_modules/inherits/LICENSE | 0 .../node_modules/inherits/inherits_browser.js | 0 .../node_modules/inherits/test.js | 0 src/lt/objs/deploy.cljs | 1 - 92 files changed, 6393 deletions(-) delete mode 100644 deploy/core/node_modules/tar.gz/.npmignore delete mode 100644 deploy/core/node_modules/tar.gz/Cakefile delete mode 100644 deploy/core/node_modules/tar.gz/LICENSE delete mode 100644 deploy/core/node_modules/tar.gz/README.md delete mode 100644 deploy/core/node_modules/tar.gz/bin/targz delete mode 100644 deploy/core/node_modules/tar.gz/example/example.coffee delete mode 100644 deploy/core/node_modules/tar.gz/example/example.js delete mode 100644 deploy/core/node_modules/tar.gz/lib/targz.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/.npmignore delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/.travis.yml delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/History.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/Makefile delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/Readme.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/index.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/README.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/index.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/package.json delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/test.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/commander/package.json delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/.npmignore delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/.travis.yml delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/LICENSE delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/README.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/examples/filter-pipe.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/examples/pipe.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/examples/reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/examples/symlink-write.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/fstream.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/abstract.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/collect.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-writer.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-writer.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/get-type.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-writer.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-writer.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/socket-reader.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/lib/writer.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/.npmignore delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/LICENSE delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/README.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/package.json delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/test/open.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/README.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/inherits.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/package.json delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.npmignore delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.travis.yml delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/LICENSE delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/examples/pow.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/index.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/package.json delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/readme.markdown delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/chmod.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/clobber.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/mkdirp.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm_sync.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/race.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/rel.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return_sync.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/root.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/sync.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask_sync.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/AUTHORS delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/LICENSE delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/README.md delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/package.json delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/rimraf.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/run.sh delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/setup.sh delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-async.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-sync.js delete mode 100644 deploy/core/node_modules/tar.gz/node_modules/fstream/package.json delete mode 100644 deploy/core/node_modules/tar.gz/package.json delete mode 100644 deploy/core/node_modules/tar.gz/src/targz.coffee delete mode 100644 deploy/core/node_modules/tar.gz/test/compress/test.txt delete mode 100644 deploy/core/node_modules/tar.gz/test/extract/placeholder rename deploy/core/node_modules/{tar.gz => tar}/node_modules/fstream/node_modules/.bin/rimraf (100%) rename deploy/core/node_modules/{tar.gz => tar}/node_modules/fstream/node_modules/graceful-fs/polyfills.js (100%) rename deploy/core/node_modules/{tar.gz => tar}/node_modules/fstream/node_modules/rimraf/bin.js (100%) rename deploy/core/node_modules/{tar.gz/node_modules/fstream => tar}/node_modules/inherits/LICENSE (100%) rename deploy/core/node_modules/{tar.gz/node_modules/fstream => tar}/node_modules/inherits/inherits_browser.js (100%) rename deploy/core/node_modules/{tar.gz/node_modules/fstream => tar}/node_modules/inherits/test.js (100%) diff --git a/deploy/core/node_modules/tar.gz/.npmignore b/deploy/core/node_modules/tar.gz/.npmignore deleted file mode 100644 index 80da007c7..000000000 --- a/deploy/core/node_modules/tar.gz/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.sublime-workspace -/*.sublime-project -/node_modules diff --git a/deploy/core/node_modules/tar.gz/Cakefile b/deploy/core/node_modules/tar.gz/Cakefile deleted file mode 100644 index bb955f07a..000000000 --- a/deploy/core/node_modules/tar.gz/Cakefile +++ /dev/null @@ -1,75 +0,0 @@ -# Basic Cakefile for project automation -# -# @author Alan Hoffmeister -# @version 0.0.1 -# @date 2012-12-06 128:41 GMT -3:00 -# @license MIT - -util = require 'util' -walker = require 'walk' -wrench = require 'wrench' -exec = require('child_process').exec -fs = require 'fs' - -options = - source : __dirname + '/src' - target : __dirname + '/lib' - convert : - 'coffee' : 'coffee -b --compile --output "{targetDir}" "{sourceFile}"' - blacklist : ['log'] - watch : - 'coffee' : 'coffee -b --compile --output "{targetDir}" "{sourceFile}"' - -totals = - converted : 0 - deleted : 0 - total : 0 - watched : 0 - -replace = (str, root, name) -> - str.replace('{sourceFile}', "#{root}/#{name}").replace('{targetDir}', root); - -task 'build', 'Main build task', -> - util.log "Build started at #{options.source}" - util.log "Cleaning up the target directory #{options.target}" - wrench.rmdirSyncRecursive options.target, true - util.log 'Creating empty target folder.' - wrench.mkdirSyncRecursive options.target, '0777' - util.log 'Coping files from source to target.' - wrench.copyDirSyncRecursive options.source, options.target - util.log 'Starting to convert files.' - walk = walker.walk options.target, followLinks: false - walk.on 'file', (root, stat, next) -> - totals.total++ - extension = stat.name.split('.').pop() - if options.blacklist.indexOf(extension) != -1 - fs.unlinkSync "#{root}/#{stat.name}" - util.log "Removing by blacklist: #{root}/#{stat.name}" - totals.deleted++ - next() - else if options.convert[extension] - util.log "Converting #{root}/#{stat.name}" - exec replace(options.convert[extension], root, stat.name), (err, stdout, stderr) -> - throw err if err - fs.unlinkSync "#{root}/#{stat.name}" - totals.converted++ - next() - - walk.on 'end', -> - util.log "Build script ended. #{totals.total} files copyed, #{totals.deleted} deleted and #{totals.converted} converted." - -task 'watch', 'Watch for filechanges.', -> - util.log "Watching files in #{options.source}" - walk = walker.walk options.source, followLinks: false - walk.on 'file', (root, stat, next) -> - extension = stat.name.split('.').pop() - if options.watch[extension] - totals.watched++ - util.log "Watching #{root}/#{stat.name}" - fs.watchFile "#{root}/#{stat.name}", (curt, pret) -> - util.log "File changed: #{root}/#{stat.name}" - exec 'cake build', (err, stdout, stderr) -> - throw err if err - next() - walk.on 'end', -> - util.log "Watching #{totals.watched} files." \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/LICENSE b/deploy/core/node_modules/tar.gz/LICENSE deleted file mode 100644 index 233454021..000000000 --- a/deploy/core/node_modules/tar.gz/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) 2012 Cranic Tecnologia e Informática LTDA - -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 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. \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/README.md b/deploy/core/node_modules/tar.gz/README.md deleted file mode 100644 index 695bfbcd4..000000000 --- a/deploy/core/node_modules/tar.gz/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# **node-tar.gz** -Native gzip compression and decompression utility for Node.js. - -### **Installation** - -For simple installation: - - npm install tar.gz - -If you want to use the `targz` command line: - - npm intall -g tar.gz - -### **Usage** - -At the moment this package can only compress a folder and everything that -is inside it. To compress something is easy: - - var targz = require('tar.gz'); - var compress = new targz().compress('/path/to/compress', '/path/to/store.tar.gz', function(err){ - if(err) - console.log(err); - - console.log('The compression has ended!'); - }); - -With the same easy you can extract a gziped file: - - var targz = require('tar.gz'); - var compress = new targz().extract('/path/to/stored.tar.gz', '/path/to/extract', function(err){ - if(err) - console.log(err); - - console.log('The extraction has ended!'); - }); - -You can pass some configuration parameters to the constructor before compress: - - var targz = require('tar.gz'); - - var level = 6 //the compression level from 0-9, default: 6 - var memLevel = 6 //the memory allocation level from 1-9, default: 6 - var proprietary = true //to include or not proprietary headers, default: true - - var compress = new targz(level, memLevel, proprietary).compress(...) - -### **Command line** - - $ targz -h - - Usage: targz [options] - - Options: - - -h, --help output usage information - -V, --version output the version number - -c, --compress Compress folder to archive - -x, --extract Extract archive to folder - -l, --level [n] Compression level from 0-9. Default 6. - -m, --memory [n] Memory allocation level from 1-9. Default 6. - -n, --noproprietary Remove proprietary headers. - - Examples: - - Default compression - $ targz -c /folder/to/compres /path/to/archive.tar.gz - - Extracting some archive - $ targz -x /path/to/archive.tar.gz /destination/folder - - Maximum compression - $ targz -l 9 -m 9 -c /folder/to/compres /path/to/archive.tar.gz - - -### **TODO** - - * Vows.js tests - * Single file compression - * Add more todos... - - -### **License (MIT)** - -Copyright (C) 2012 Cranic Tecnologia e Informática LTDA - -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 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. \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/bin/targz b/deploy/core/node_modules/tar.gz/bin/targz deleted file mode 100644 index 1f9992c1c..000000000 --- a/deploy/core/node_modules/tar.gz/bin/targz +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node - -var compress, level, memLevel, program, proprietary, targz; - -targz = require('../lib/targz'); - -program = require('commander'); - -program.version('0.0.1').option('-c, --compress', 'Compress folder to archive').option('-x, --extract', 'Extract archive to folder').option('-l, --level [n]', 'Compression level from 0-9. Default 6.', parseInt).option('-m, --memory [n]', 'Memory allocation level from 1-9. Default 6.', parseInt).option('-n, --noproprietary', 'Remove proprietary headers.'); - -program.on('--help', function() { - console.log(' Examples:'); - console.log(''); - console.log(' Default compression'); - console.log(' $ targz -c /folder/to/compres /path/to/archive.tar.gz'); - console.log(''); - console.log(' Extracting some archive'); - console.log(' $ targz -x /path/to/archive.tar.gz /destination/folder'); - console.log(''); - console.log(' Maximum compression'); - console.log(' $ targz -l 9 -m 9 -c /folder/to/compres /path/to/archive.tar.gz'); - return console.log(''); -}); - -program.parse(process.argv); - -if (program.level) { - level = program.level; -} else { - level = 6; -} - -if (program.memory) { - memLevel = program.memory; -} else { - memLevel = 6; -} - -if (program.noproprietary) { - proprietary = false; -} else { - proprietary = true; -} - -if (program.compress) { - console.log('Compressing...'); - compress = new targz(level, memLevel, proprietary).compress(program.args[0], program.args[1], function() { - return console.log('Done!'); - }); -} else if (program.extract) { - console.log('Extracting...'); - compress = new targz().extract(program.args[0], program.args[1], function() { - return console.log('Done!'); - }); -} diff --git a/deploy/core/node_modules/tar.gz/example/example.coffee b/deploy/core/node_modules/tar.gz/example/example.coffee deleted file mode 100644 index a084e9544..000000000 --- a/deploy/core/node_modules/tar.gz/example/example.coffee +++ /dev/null @@ -1,10 +0,0 @@ -targz = require '../index' -gzip = new targz() - -# Compressing this folder -gzip.compress __dirname + '/../test/compress', __dirname + '/../test/compress.tar.gz', (err) -> - console.log 'Done compressing' - - # Extracting a tar.gz file - gzip.extract __dirname + '/../test/compress.tar.gz', __dirname + '/../test/extract/', (err) -> - console.log 'Done extracting.' \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/example/example.js b/deploy/core/node_modules/tar.gz/example/example.js deleted file mode 100644 index 9c5a74ed0..000000000 --- a/deploy/core/node_modules/tar.gz/example/example.js +++ /dev/null @@ -1,10 +0,0 @@ -var gzip, targz; -targz = require('../index'); -gzip = new targz(); - -gzip.compress(__dirname + '/../test/compress', __dirname + '/../test/compress.tar.gz', function(err) { - console.log('Done compressing'); - return gzip.extract(__dirname + '/../test/compress.tar.gz', __dirname + '/../test/extract/', function(err) { - return console.log('Done extracting.'); - }); -}); \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/lib/targz.js b/deploy/core/node_modules/tar.gz/lib/targz.js deleted file mode 100644 index 31ee8bb26..000000000 --- a/deploy/core/node_modules/tar.gz/lib/targz.js +++ /dev/null @@ -1,82 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -var TarGz, fs, fstream, tar, zlib; - -fstream = require('fstream'); - -tar = require('tar'); - -zlib = require('zlib'); - -fs = require('fs'); - -TarGz = (function() { - - function TarGz(level, memLevel, proprietary) { - this.level = level != null ? level : 6; - this.memLevel = memLevel != null ? memLevel : 6; - this.proprietary = proprietary != null ? proprietary : true; - this; - - } - - TarGz.prototype.compress = function(source, destination, callback) { - var self; - self = this; - fs.stat(source, function(err, stat) { - var type; - type = 'Directory'; - return process.nextTick(function() { - var gzip, props, reader; - gzip = zlib.createGzip({ - level: self.level, - memLevel: self.memLevel - }); - if (type === 'Directory') { - reader = fstream.Reader({ - path: source, - type: type - }); - } - if (self.proprietary === true) { - props = { - noProprietary: false - }; - } - if (self.proprietary === false) { - props = { - noProprietary: true - }; - } - return reader.pipe(tar.Pack(props)).pipe(gzip).pipe(fstream.Writer(destination).on('close', function() { - if (typeof callback === 'function') { - return callback(null); - } - })); - }); - }); - return this; - }; - - TarGz.prototype.extract = function(source, destination, callback) { - var self; - self = this; - process.nextTick(function() { - return fstream.Reader({ - path: source, - type: 'File' - }).pipe(zlib.createGunzip()).pipe(tar.Extract({ - path: destination - })).on('end', function() { - if (typeof callback === 'function') { - return callback(null); - } - }); - }); - return this; - }; - - return TarGz; - -})(); - -module.exports = TarGz; diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/.npmignore b/deploy/core/node_modules/tar.gz/node_modules/commander/.npmignore deleted file mode 100644 index f1250e584..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/.travis.yml b/deploy/core/node_modules/tar.gz/node_modules/commander/.travis.yml deleted file mode 100644 index f1d0f13c8..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/History.md b/deploy/core/node_modules/tar.gz/node_modules/commander/History.md deleted file mode 100644 index 160dc6bd1..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/History.md +++ /dev/null @@ -1,152 +0,0 @@ - -1.1.1 / 2012-11-20 -================== - - * add more sub-command padding - * fix .usage() when args are present. Closes #106 - -1.1.0 / 2012-11-16 -================== - - * add git-style executable subcommand support. Closes #94 - -1.0.5 / 2012-10-09 -================== - - * fix `--name` clobbering. Closes #92 - * fix examples/help. Closes #89 - -1.0.4 / 2012-09-03 -================== - - * add `outputHelp()` method. - -1.0.3 / 2012-08-30 -================== - - * remove invalid .version() defaulting - -1.0.2 / 2012-08-24 -================== - - * add `--foo=bar` support [arv] - * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] - -1.0.1 / 2012-08-03 -================== - - * fix issue #56 - * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) - -1.0.0 / 2012-07-05 -================== - - * add support for optional option descriptions - * add defaulting of `.version()` to package.json's version - -0.6.1 / 2012-06-01 -================== - - * Added: append (yes or no) on confirmation - * Added: allow node.js v0.7.x - -0.6.0 / 2012-04-10 -================== - - * Added `.prompt(obj, callback)` support. Closes #49 - * Added default support to .choose(). Closes #41 - * Fixed the choice example - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/Makefile b/deploy/core/node_modules/tar.gz/node_modules/commander/Makefile deleted file mode 100644 index 007462553..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -TESTS = $(shell find test/test.*.js) - -test: - @./test/run $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/Readme.md b/deploy/core/node_modules/tar.gz/node_modules/commander/Readme.md deleted file mode 100644 index f93f3622a..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/Readme.md +++ /dev/null @@ -1,270 +0,0 @@ -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineappe'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineappe - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .prompt(msg, fn) - - Single-line prompt: - -```js -program.prompt('name: ', function(name){ - console.log('hi %s', name); -}); -``` - - Multi-line prompt: - -```js -program.prompt('description:', function(name){ - console.log('hi %s', name); -}); -``` - - Coercion: - -```js -program.prompt('Age: ', Number, function(age){ - console.log('age: %j', age); -}); -``` - -```js -program.prompt('Birthdate: ', Date, function(date){ - console.log('date: %s', date); -}); -``` - -## .password(msg[, mask], fn) - -Prompt for password without echoing: - -```js -program.password('Password: ', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -Prompt for password with mask char "*": - -```js -program.password('Password: ', '*', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -## .confirm(msg, fn) - - Confirm with the given `msg`: - -```js -program.confirm('continue? ', function(ok){ - console.log(' got %j', ok); -}); -``` - -## .choose(list, fn) - - Let the user choose from a `list`: - -```js -var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - -console.log('Choose the coolest pet:'); -program.choose(list, function(i){ - console.log('you chose %d "%s"', i, list[i]); -}); -``` - -## .outputHelp() - - Output help information without exiting. - -## .help() - - Output help information and exit immediately. - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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 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. \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/index.js b/deploy/core/node_modules/tar.gz/node_modules/commander/index.js deleted file mode 100644 index bddca73af..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/index.js +++ /dev/null @@ -1,1131 +0,0 @@ -/*! - * commander - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , spawn = require('child_process').spawn - , keypress = require('keypress') - , fs = require('fs') - , exists = fs.existsSync - , path = require('path') - , tty = require('tty') - , dirname = path.dirname - , basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description || ''; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this._args = []; - this._name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @param {String} [desc] - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name, desc){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - if (desc) cmd.description(desc); - if (desc) this.executables = true; - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - if (desc) return this; - return cmd; -}; - -/** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - -Command.prototype.addImplicitHelpCommand = function() { - this.command('help [cmd]', 'display help for [cmd]'); -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self._args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self._args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this._name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - // Leftover arguments need to be pushed back. Fixes issue #56 - if (parsed.args.length) args = parsed.args.concat(args); - - self._args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self._args.length) { - args[self._args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // implicit help - if (this.executables) this.addImplicitHelpCommand(); - - // store raw args - this.rawArgs = argv; - - // guess name - this._name = this._name || basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - var args = this.args = parsed.args; - - // executable sub-commands, skip .parseArgs() - if (this.executables) return this.executeSubCommand(argv, args, parsed.unknown); - - return this.parseArgs(this.args, parsed.unknown); -}; - -/** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @api private - */ - -Command.prototype.executeSubCommand = function(argv, args, unknown) { - args = args.concat(unknown); - - if (!args.length) this.help(); - if ('help' == args[0] && 1 == args.length) this.help(); - - // --help - if ('help' == args[0]) { - args[0] = args[1]; - args[1] = '--help'; - } - - // executable - var dir = dirname(argv[1]); - var bin = basename(argv[1]) + '-' + args[0]; - - // check for ./ first - var local = path.join(dir, bin); - if (exists(local)) bin = local; - - // run it - args = args.slice(1); - var proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); - proc.on('exit', function(code){ - if (code == 127) { - console.error('\n %s(1) does not exist\n', bin); - } - }); -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg - , index; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { - ret.push(arg.slice(0, index), arg.slice(index + 1)); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0]) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || '-' == arg[0]) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this._args.length ? ' ' + args : ''); - - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return pad(cmd._name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args, 22) - + (cmd.description() - ? ' ' + cmd.description() - : ''); - }).join('\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this._name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Prompt for a `Number`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForNumber = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseNumber(val){ - val = Number(val); - if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); - fn(val); - }); -}; - -/** - * Prompt for a `Date`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForDate = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseDate(val){ - val = new Date(val); - if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); - fn(val); - }); -}; - -/** - * Single-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptSingleLine = function(str, fn){ - if ('function' == typeof arguments[2]) { - return this['promptFor' + (fn.name || fn)](str, arguments[2]); - } - - process.stdout.write(str); - process.stdin.setEncoding('utf8'); - process.stdin.once('data', function(val){ - fn(val.trim()); - }).resume(); -}; - -/** - * Multi-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptMultiLine = function(str, fn){ - var buf = []; - console.log(str); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(val){ - if ('\n' == val || '\r\n' == val) { - process.stdin.removeAllListeners('data'); - fn(buf.join('\n')); - } else { - buf.push(val.trimRight()); - } - }).resume(); -}; - -/** - * Prompt `str` and callback `fn(val)` - * - * Commander supports single-line and multi-line prompts. - * To issue a single-line prompt simply add white-space - * to the end of `str`, something like "name: ", whereas - * for a multi-line prompt omit this "description:". - * - * - * Examples: - * - * program.prompt('Username: ', function(name){ - * console.log('hi %s', name); - * }); - * - * program.prompt('Description:', function(desc){ - * console.log('description was "%s"', desc.trim()); - * }); - * - * @param {String|Object} str - * @param {Function} fn - * @api public - */ - -Command.prototype.prompt = function(str, fn){ - var self = this; - - if ('string' == typeof str) { - if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); - this.promptMultiLine(str, fn); - } else { - var keys = Object.keys(str) - , obj = {}; - - function next() { - var key = keys.shift() - , label = str[key]; - - if (!key) return fn(obj); - self.prompt(label, function(val){ - obj[key] = val; - next(); - }); - } - - next(); - } -}; - -/** - * Prompt for password with `str`, `mask` char and callback `fn(val)`. - * - * The mask string defaults to '', aka no output is - * written while typing, you may want to use "*" etc. - * - * Examples: - * - * program.password('Password: ', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * program.password('Password: ', '*', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {String} mask - * @param {Function} fn - * @api public - */ - -Command.prototype.password = function(str, mask, fn){ - var self = this - , buf = ''; - - // default mask - if ('function' == typeof mask) { - fn = mask; - mask = ''; - } - - keypress(process.stdin); - - function setRawMode(mode) { - if (process.stdin.setRawMode) { - process.stdin.setRawMode(mode); - } else { - tty.setRawMode(mode); - } - }; - setRawMode(true); - process.stdout.write(str); - - // keypress - process.stdin.on('keypress', function(c, key){ - if (key && 'enter' == key.name) { - console.log(); - process.stdin.pause(); - process.stdin.removeAllListeners('keypress'); - setRawMode(false); - if (!buf.trim().length) return self.password(str, mask, fn); - fn(buf); - return; - } - - if (key && key.ctrl && 'c' == key.name) { - console.log('%s', buf); - process.exit(); - } - - process.stdout.write(mask); - buf += c; - }).resume(); -}; - -/** - * Confirmation prompt with `str` and callback `fn(bool)` - * - * Examples: - * - * program.confirm('continue? ', function(ok){ - * console.log(' got %j', ok); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - - -Command.prototype.confirm = function(str, fn, verbose){ - var self = this; - this.prompt(str, function(ok){ - if (!ok.trim()) { - if (!verbose) str += '(yes or no) '; - return self.confirm(str, fn, true); - } - fn(parseBool(ok)); - }); -}; - -/** - * Choice prompt with `list` of items and callback `fn(index, item)` - * - * Examples: - * - * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - * - * console.log('Choose the coolest pet:'); - * program.choose(list, function(i){ - * console.log('you chose %d "%s"', i, list[i]); - * process.stdin.destroy(); - * }); - * - * @param {Array} list - * @param {Number|Function} index or fn - * @param {Function} fn - * @api public - */ - -Command.prototype.choose = function(list, index, fn){ - var self = this - , hasDefault = 'number' == typeof index; - - if (!hasDefault) { - fn = index; - index = null; - } - - list.forEach(function(item, i){ - if (hasDefault && i == index) { - console.log('* %d) %s', i + 1, item); - } else { - console.log(' %d) %s', i + 1, item); - } - }); - - function again() { - self.prompt(' : ', function(val){ - val = parseInt(val, 10) - 1; - if (hasDefault && isNaN(val)) val = index; - - if (null == list[val]) { - again(); - } else { - fn(val, list[val]); - } - }); - } - - again(); -}; - - -/** - * Output help information for this command - * - * @api public - */ - -Command.prototype.outputHelp = function(){ - process.stdout.write(this.helpInformation()); - this.emit('--help'); -}; - -/** - * Output help information and exit. - * - * @api public - */ - -Command.prototype.help = function(){ - this.outputHelp(); - process.exit(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Parse a boolean `str`. - * - * @param {String} str - * @return {Boolean} - * @api private - */ - -function parseBool(str) { - return /^y|yes|ok|true$/i.test(str); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - cmd.outputHelp(); - process.exit(0); - } - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/README.md b/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/README.md deleted file mode 100644 index a768e8f59..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/README.md +++ /dev/null @@ -1,101 +0,0 @@ -keypress -======== -### Make any Node ReadableStream emit "keypress" events - - -Previous to Node `v0.8.x`, there was an undocumented `"keypress"` event that -`process.stdin` would emit when it was a TTY. Some people discovered this hidden -gem, and started using it in their own code. - -Now in Node `v0.8.x`, this `"keypress"` event does not get emitted by default, -but rather only when it is being used in conjuction with the `readline` (or by -extension, the `repl`) module. - -This module is the exact logic from the node `v0.8.x` releases ripped out into its -own module. - -__Bonus:__ Now with mouse support! - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install keypress -``` - -Or add it to the `"dependencies"` section of your _package.json_ file. - - -Example -------- - -#### Listening for "keypress" events - -``` js -var keypress = require('keypress'); - -// make `process.stdin` begin emitting "keypress" events -keypress(process.stdin); - -// listen for the "keypress" event -process.stdin.on('keypress', function (ch, key) { - console.log('got "keypress"', key); - if (key && key.ctrl && key.name == 'c') { - process.stdin.pause(); - } -}); - -process.stdin.setRawMode(true); -process.stdin.resume(); -``` - -#### Listening for "mousepress" events - -``` js -var keypress = require('keypress'); - -// make `process.stdin` begin emitting "mousepress" (and "keypress") events -keypress(process.stdin); - -// you must enable the mouse events before they will begin firing -keypress.enableMouse(process.stdout); - -process.stdin.on('mousepress', function (info) { - console.log('got "mousepress" event at %d x %d', info.x, info.y); -}); - -process.on('exit', function () { - // disable mouse on exit, so that the state - // is back to normal for the terminal - keypress.disableMouse(process.stdout); -}); -``` - - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> - -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 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. diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/index.js b/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/index.js deleted file mode 100644 index c2ba488ba..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/index.js +++ /dev/null @@ -1,346 +0,0 @@ - -/** - * This module offers the internal "keypress" functionality from node-core's - * `readline` module, for your own programs and modules to use. - * - * Usage: - * - * require('keypress')(process.stdin); - * - * process.stdin.on('keypress', function (ch, key) { - * console.log(ch, key); - * if (key.ctrl && key.name == 'c') { - * process.stdin.pause(); - * } - * }); - * proces.stdin.resume(); - */ -var exports = module.exports = keypress; - -exports.enableMouse = function (stream) { - stream.write('\x1b' +'[?1000h') -} - -exports.disableMouse = function (stream) { - stream.write('\x1b' +'[?1000l') -} - - -/** - * accepts a readable Stream instance and makes it emit "keypress" events - */ - -function keypress(stream) { - if (isEmittingKeypress(stream)) return; - stream._emitKeypress = true; - - function onData(b) { - if (stream.listeners('keypress').length > 0) { - emitKey(stream, b); - } else { - // Nobody's watching anyway - stream.removeListener('data', onData); - stream.on('newListener', onNewListener); - } - } - - function onNewListener(event) { - if (event == 'keypress') { - stream.on('data', onData); - stream.removeListener('newListener', onNewListener); - } - } - - if (stream.listeners('keypress').length > 0) { - stream.on('data', onData); - } else { - stream.on('newListener', onNewListener); - } -} - -/** - * Returns `true` if the stream is already emitting "keypress" events. - * `false` otherwise. - */ - -function isEmittingKeypress(stream) { - var rtn = stream._emitKeypress; - if (!rtn) { - // hack: check for the v0.6.x "data" event - stream.listeners('data').forEach(function (l) { - if (l.name == 'onData' && /emitKey/.test(l.toString())) { - rtn = true; - stream._emitKeypress = true; - } - }); - } - if (!rtn) { - // hack: check for the v0.6.x "newListener" event - stream.listeners('newListener').forEach(function (l) { - if (l.name == 'onNewListener' && /keypress/.test(l.toString())) { - rtn = true; - stream._emitKeypress = true; - } - }); - } - return rtn; -} - - -/* - Some patterns seen in terminal key escape codes, derived from combos seen - at http://www.midnight-commander.org/browser/lib/tty/key.c - - ESC letter - ESC [ letter - ESC [ modifier letter - ESC [ 1 ; modifier letter - ESC [ num char - ESC [ num ; modifier char - ESC O letter - ESC O modifier letter - ESC O 1 ; modifier letter - ESC N letter - ESC [ [ num ; modifier char - ESC [ [ 1 ; modifier letter - ESC ESC [ num char - ESC ESC O letter - - - char is usually ~ but $ and ^ also happen with rxvt - - modifier is 1 + - (shift * 1) + - (left_alt * 2) + - (ctrl * 4) + - (right_alt * 8) - - two leading ESCs apparently mean the same as one leading ESC -*/ - -// Regexes used for ansi escape code splitting -var metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/; -var functionKeyCodeRe = - /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/; - -function emitKey(stream, s) { - var ch, - key = { - name: undefined, - ctrl: false, - meta: false, - shift: false - }, - parts; - - if (Buffer.isBuffer(s)) { - if (s[0] > 127 && s[1] === undefined) { - s[0] -= 128; - s = '\x1b' + s.toString(stream.encoding || 'utf-8'); - } else { - s = s.toString(stream.encoding || 'utf-8'); - } - } - - key.sequence = s; - - if (s === '\r' || s === '\n') { - // enter - key.name = 'enter'; - - } else if (s === '\t') { - // tab - key.name = 'tab'; - - } else if (s === '\b' || s === '\x7f' || - s === '\x1b\x7f' || s === '\x1b\b') { - // backspace or ctrl+h - key.name = 'backspace'; - key.meta = (s.charAt(0) === '\x1b'); - - } else if (s === '\x1b' || s === '\x1b\x1b') { - // escape key - key.name = 'escape'; - key.meta = (s.length === 2); - - } else if (s === ' ' || s === '\x1b ') { - key.name = 'space'; - key.meta = (s.length === 2); - - } else if (s <= '\x1a') { - // ctrl+letter - key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1); - key.ctrl = true; - - } else if (s.length === 1 && s >= 'a' && s <= 'z') { - // lowercase letter - key.name = s; - - } else if (s.length === 1 && s >= 'A' && s <= 'Z') { - // shift+letter - key.name = s.toLowerCase(); - key.shift = true; - - } else if (parts = metaKeyCodeRe.exec(s)) { - // meta+character key - key.name = parts[1].toLowerCase(); - key.meta = true; - key.shift = /^[A-Z]$/.test(parts[1]); - - } else if (parts = functionKeyCodeRe.exec(s)) { - // ansi escape sequence - - // reassemble the key code leaving out leading \x1b's, - // the modifier key bitflag and any meaningless "1;" sequence - var code = (parts[1] || '') + (parts[2] || '') + - (parts[4] || '') + (parts[6] || ''), - modifier = (parts[3] || parts[5] || 1) - 1; - - // Parse the key modifier - key.ctrl = !!(modifier & 4); - key.meta = !!(modifier & 10); - key.shift = !!(modifier & 1); - key.code = code; - - // Parse the key itself - switch (code) { - /* xterm/gnome ESC O letter */ - case 'OP': key.name = 'f1'; break; - case 'OQ': key.name = 'f2'; break; - case 'OR': key.name = 'f3'; break; - case 'OS': key.name = 'f4'; break; - - /* xterm/rxvt ESC [ number ~ */ - case '[11~': key.name = 'f1'; break; - case '[12~': key.name = 'f2'; break; - case '[13~': key.name = 'f3'; break; - case '[14~': key.name = 'f4'; break; - - /* from Cygwin and used in libuv */ - case '[[A': key.name = 'f1'; break; - case '[[B': key.name = 'f2'; break; - case '[[C': key.name = 'f3'; break; - case '[[D': key.name = 'f4'; break; - case '[[E': key.name = 'f5'; break; - - /* common */ - case '[15~': key.name = 'f5'; break; - case '[17~': key.name = 'f6'; break; - case '[18~': key.name = 'f7'; break; - case '[19~': key.name = 'f8'; break; - case '[20~': key.name = 'f9'; break; - case '[21~': key.name = 'f10'; break; - case '[23~': key.name = 'f11'; break; - case '[24~': key.name = 'f12'; break; - - /* xterm ESC [ letter */ - case '[A': key.name = 'up'; break; - case '[B': key.name = 'down'; break; - case '[C': key.name = 'right'; break; - case '[D': key.name = 'left'; break; - case '[E': key.name = 'clear'; break; - case '[F': key.name = 'end'; break; - case '[H': key.name = 'home'; break; - - /* xterm/gnome ESC O letter */ - case 'OA': key.name = 'up'; break; - case 'OB': key.name = 'down'; break; - case 'OC': key.name = 'right'; break; - case 'OD': key.name = 'left'; break; - case 'OE': key.name = 'clear'; break; - case 'OF': key.name = 'end'; break; - case 'OH': key.name = 'home'; break; - - /* xterm/rxvt ESC [ number ~ */ - case '[1~': key.name = 'home'; break; - case '[2~': key.name = 'insert'; break; - case '[3~': key.name = 'delete'; break; - case '[4~': key.name = 'end'; break; - case '[5~': key.name = 'pageup'; break; - case '[6~': key.name = 'pagedown'; break; - - /* putty */ - case '[[5~': key.name = 'pageup'; break; - case '[[6~': key.name = 'pagedown'; break; - - /* rxvt */ - case '[7~': key.name = 'home'; break; - case '[8~': key.name = 'end'; break; - - /* rxvt keys with modifiers */ - case '[a': key.name = 'up'; key.shift = true; break; - case '[b': key.name = 'down'; key.shift = true; break; - case '[c': key.name = 'right'; key.shift = true; break; - case '[d': key.name = 'left'; key.shift = true; break; - case '[e': key.name = 'clear'; key.shift = true; break; - - case '[2$': key.name = 'insert'; key.shift = true; break; - case '[3$': key.name = 'delete'; key.shift = true; break; - case '[5$': key.name = 'pageup'; key.shift = true; break; - case '[6$': key.name = 'pagedown'; key.shift = true; break; - case '[7$': key.name = 'home'; key.shift = true; break; - case '[8$': key.name = 'end'; key.shift = true; break; - - case 'Oa': key.name = 'up'; key.ctrl = true; break; - case 'Ob': key.name = 'down'; key.ctrl = true; break; - case 'Oc': key.name = 'right'; key.ctrl = true; break; - case 'Od': key.name = 'left'; key.ctrl = true; break; - case 'Oe': key.name = 'clear'; key.ctrl = true; break; - - case '[2^': key.name = 'insert'; key.ctrl = true; break; - case '[3^': key.name = 'delete'; key.ctrl = true; break; - case '[5^': key.name = 'pageup'; key.ctrl = true; break; - case '[6^': key.name = 'pagedown'; key.ctrl = true; break; - case '[7^': key.name = 'home'; key.ctrl = true; break; - case '[8^': key.name = 'end'; key.ctrl = true; break; - - /* misc. */ - case '[Z': key.name = 'tab'; key.shift = true; break; - default: key.name = 'undefined'; break; - - } - } else if (s.length > 1 && s[0] !== '\x1b') { - // Got a longer-than-one string of characters. - // Probably a paste, since it wasn't a control sequence. - Array.prototype.forEach.call(s, function(c) { - emitKey(stream, c); - }); - return; - } - - if (key.code == '[M') { - key.name = 'mouse'; - var s = key.sequence; - var b = s.charCodeAt(3); - key.x = s.charCodeAt(4) - 040; - key.y = s.charCodeAt(5) - 040; - - key.scroll = 0; - - key.ctrl = !!(1<<4 & b); - key.meta = !!(1<<3 & b); - key.shift = !!(1<<2 & b); - - key.release = (3 & b) === 3; - - if (1<<6 & b) { //scroll - key.scroll = 1 & b ? 1 : -1; - } - - if (!key.release && !key.scroll) { - key.button = b & 3; - } - } - - // Don't emit a key if no name was found - if (key.name === undefined) { - key = undefined; - } - - if (s.length === 1) { - ch = s; - } - - if (key && key.name == 'mouse') { - stream.emit('mousepress', key) - } else if (key || ch) { - stream.emit('keypress', ch, key); - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/package.json b/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/package.json deleted file mode 100644 index 6cdf0856c..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "keypress", - "version": "0.1.0", - "description": "Make any Node ReadableStream emit \"keypress\" events", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://tootallnate.net" - }, - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/keypress.git" - }, - "keywords": [ - "keypress", - "readline", - "core" - ], - "license": "MIT", - "readme": "keypress\n========\n### Make any Node ReadableStream emit \"keypress\" events\n\n\nPrevious to Node `v0.8.x`, there was an undocumented `\"keypress\"` event that\n`process.stdin` would emit when it was a TTY. Some people discovered this hidden\ngem, and started using it in their own code.\n\nNow in Node `v0.8.x`, this `\"keypress\"` event does not get emitted by default,\nbut rather only when it is being used in conjuction with the `readline` (or by\nextension, the `repl`) module.\n\nThis module is the exact logic from the node `v0.8.x` releases ripped out into its\nown module.\n\n__Bonus:__ Now with mouse support!\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install keypress\n```\n\nOr add it to the `\"dependencies\"` section of your _package.json_ file.\n\n\nExample\n-------\n\n#### Listening for \"keypress\" events\n\n``` js\nvar keypress = require('keypress');\n\n// make `process.stdin` begin emitting \"keypress\" events\nkeypress(process.stdin);\n\n// listen for the \"keypress\" event\nprocess.stdin.on('keypress', function (ch, key) {\n console.log('got \"keypress\"', key);\n if (key && key.ctrl && key.name == 'c') {\n process.stdin.pause();\n }\n});\n\nprocess.stdin.setRawMode(true);\nprocess.stdin.resume();\n```\n\n#### Listening for \"mousepress\" events\n\n``` js\nvar keypress = require('keypress');\n\n// make `process.stdin` begin emitting \"mousepress\" (and \"keypress\") events\nkeypress(process.stdin);\n\n// you must enable the mouse events before they will begin firing\nkeypress.enableMouse(process.stdout);\n\nprocess.stdin.on('mousepress', function (info) {\n console.log('got \"mousepress\" event at %d x %d', info.x, info.y);\n});\n\nprocess.on('exit', function () {\n // disable mouse on exit, so that the state\n // is back to normal for the terminal\n keypress.disableMouse(process.stdout);\n});\n```\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "README.md", - "_id": "keypress@0.1.0", - "_from": "keypress@0.1.x" -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/test.js b/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/test.js deleted file mode 100644 index c3f61d79d..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/node_modules/keypress/test.js +++ /dev/null @@ -1,28 +0,0 @@ - -var keypress = require('./') -keypress(process.stdin) - -if (process.stdin.setRawMode) - process.stdin.setRawMode(true) -else - require('tty').setRawMode(true) - -process.stdin.on('keypress', function (c, key) { - console.log(0, c, key) - if (key && key.ctrl && key.name == 'c') { - process.stdin.pause() - } -}) -process.stdin.on('mousepress', function (mouse) { - console.log(mouse) -}) - -keypress.enableMouse(process.stdout) -process.on('exit', function () { - //disable mouse on exit, so that the state is back to normal - //for the terminal. - keypress.disableMouse(process.stdout) -}) - -process.stdin.resume() - diff --git a/deploy/core/node_modules/tar.gz/node_modules/commander/package.json b/deploy/core/node_modules/tar.gz/node_modules/commander/package.json deleted file mode 100644 index 0fbf99949..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/commander/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "commander", - "version": "1.1.1", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/commander.js.git" - }, - "dependencies": { - "keypress": "0.1.x" - }, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.6.x" - }, - "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineappe');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineappe\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Password: ', '*', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## .outputHelp()\n\n Output help information without exiting.\n\n## .help()\n\n Output help information and exit immediately.\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", - "readmeFilename": "Readme.md", - "_id": "commander@1.1.1", - "_from": "commander@1.1.x" -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/.npmignore b/deploy/core/node_modules/tar.gz/node_modules/fstream/.npmignore deleted file mode 100644 index 494272a81..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules/ -examples/deep-copy/ -examples/path/ -examples/filter-copy/ diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/.travis.yml b/deploy/core/node_modules/tar.gz/node_modules/fstream/.travis.yml deleted file mode 100644 index 2d26206d5..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/LICENSE b/deploy/core/node_modules/tar.gz/node_modules/fstream/LICENSE deleted file mode 100644 index 0c44ae716..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. 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 AUTHOR 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 THE AUTHOR OR CONTRIBUTORS -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. diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/README.md b/deploy/core/node_modules/tar.gz/node_modules/fstream/README.md deleted file mode 100644 index 9d8cb77e5..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/filter-pipe.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/filter-pipe.js deleted file mode 100644 index c6b55b3e0..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/filter-pipe.js +++ /dev/null @@ -1,131 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - !this.basename.match(/^filter-copy$/) - } - }) - -// this writer will only write directories -var w = fstream.Writer({ path: path.resolve(__dirname, "filter-copy") - , type: "Directory" - , filter: function () { - return this.type === "Directory" - } - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 1000) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -var i = 1 -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok " + (i ++) + " A WINNAR IS YOU") - ended = true - // now go through and verify that everything in there is a dir. - var p = path.resolve(__dirname, "filter-copy") - var checker = fstream.Reader({ path: p }) - checker.checker = true - checker.on("child", function (e) { - var ok = e.type === "Directory" - console.log((ok ? "" : "not ") + "ok " + (i ++) + - " should be a dir: " + - e.path.substr(checker.path.length + 1)) - }) -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok " + (i ++) + " ended") -}) - -r.pipe(w) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/pipe.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/pipe.js deleted file mode 100644 index 648ec8493..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/pipe.js +++ /dev/null @@ -1,115 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - } - }) - -var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy") - , type: "Directory" - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename, entry) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 10) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok 1 A WINNAR IS YOU") - ended = true -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok 2 ended") -}) - -r.pipe(w) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/reader.js deleted file mode 100644 index 9aa1a9538..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/reader.js +++ /dev/null @@ -1,54 +0,0 @@ -var fstream = require("../fstream.js") -var tap = require("tap") -var fs = require("fs") -var path = require("path") -var children = -1 -var dir = path.dirname(__dirname) - -var gotReady = false -var ended = false - -tap.test("reader test", function (t) { - - var r = fstream.Reader({ path: dir - , filter: function () { - // return this.parent === r - return this.parent === r || this === r - } - }) - - r.on("ready", function () { - gotReady = true - children = fs.readdirSync(dir).length - console.error("Setting expected children to "+children) - t.equal(r.type, "Directory", "should be a directory") - }) - - r.on("entry", function (entry) { - children -- - if (!gotReady) { - t.fail("children before ready!") - } - t.equal(entry.dirname, r.path, "basename is parent dir") - }) - - r.on("error", function (er) { - t.fail(er) - t.end() - process.exit(1) - }) - - r.on("end", function () { - t.equal(children, 0, "should have seen all children") - ended = true - }) - - var closed = false - r.on("close", function () { - t.ok(ended, "saw end before close") - t.notOk(closed, "close should only happen once") - closed = true - t.end() - }) - -}) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/symlink-write.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/symlink-write.js deleted file mode 100644 index d7816d24d..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/examples/symlink-write.js +++ /dev/null @@ -1,24 +0,0 @@ -var fstream = require("../fstream.js") - , closed = false - -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , isSymbolicLink: true - , mode: "0755" // octal strings supported - }) - .on("close", function () { - closed = true - var fs = require("fs") - var s = fs.lstatSync("path/to/symlink") - var isSym = s.isSymbolicLink() - console.log((isSym?"":"not ") +"ok 1 should be symlink") - var t = fs.readlinkSync("path/to/symlink") - var isTarget = t === "./file" - console.log((isTarget?"":"not ") +"ok 2 should link to ./file") - }) - .end() - -process.on("exit", function () { - console.log((closed?"":"not ")+"ok 3 should be closed") -}) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/fstream.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/fstream.js deleted file mode 100644 index c66d26f51..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/abstract.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/abstract.js deleted file mode 100644 index 11ef0e28f..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("inherits") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/collect.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/collect.js deleted file mode 100644 index a36f780eb..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-reader.js deleted file mode 100644 index 346ac2b83..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-reader.js +++ /dev/null @@ -1,251 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - , hardlinks: this.props.hardlinks - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-writer.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-writer.js deleted file mode 100644 index 7073b883e..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-reader.js deleted file mode 100644 index b1f986183..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-writer.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-writer.js deleted file mode 100644 index 681146258..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/file-writer.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = FileWriter - -var fs = require("graceful-fs") - , mkdir = require("mkdirp") - , Writer = require("./writer.js") - , inherits = require("inherits") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - // console.error("FW open", me._buffer, me._path) - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - // give this a kick just in case it needs it. - me.emit("drain") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - if (!Buffer.isBuffer(c) && typeof c !== 'string') - throw new Error('invalid write data') - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/get-type.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/get-type.js deleted file mode 100644 index cd65c41d8..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-reader.js deleted file mode 100644 index 7e7ab6ce5..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-writer.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-writer.js deleted file mode 100644 index 5c8f1e701..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("graceful-fs") - , Writer = require("./writer.js") - , inherits = require("inherits") - , path = require("path") - , rimraf = require("rimraf") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-reader.js deleted file mode 100644 index a0ece34a2..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , fs = require("graceful-fs") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-writer.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-writer.js deleted file mode 100644 index b0476633a..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].apply(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", [c]]) - return false - } - return this._proxy.end(c) -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/reader.js deleted file mode 100644 index eaf921cd0..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/reader.js +++ /dev/null @@ -1,260 +0,0 @@ - -module.exports = Reader - -var fs = require("graceful-fs") - , Stream = require("stream").Stream - , inherits = require("inherits") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - var handleHardlinks = props.hardlinks !== false - - // special little thing for handling hardlinks. - if (handleHardlinks && type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} - diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/socket-reader.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/socket-reader.js deleted file mode 100644 index e89c1731a..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/writer.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/writer.js deleted file mode 100644 index 5599fb222..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("graceful-fs") - , inherits = require("inherits") - , rimraf = require("rimraf") - , mkdir = require("mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - todo += 3 - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("utimes")) - } - - function next (what) { - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/.npmignore b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/LICENSE b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae716..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. 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 AUTHOR 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 THE AUTHOR OR CONTRIBUTORS -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. diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/README.md b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a10935..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over fs module - -graceful-fs: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92cc..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/package.json b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/package.json deleted file mode 100644 index ef302fd7a..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "A drop-in replacement for fs, making various improvements.", - "version": "2.0.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "BSD", - "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n", - "readmeFilename": "README.md", - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2.0.0" -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/test/open.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b0b..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.end() - }) -}) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/README.md b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/README.md deleted file mode 100644 index b1c566585..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/inherits.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24f5..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/package.json b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/package.json deleted file mode 100644 index 9fb3a6d94..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.1", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits" - }, - "license": "ISC", - "scripts": { - "test": "node test" - }, - "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", - "readmeFilename": "README.md", - "_id": "inherits@2.0.1", - "_from": "inherits@~2.0.0" -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.npmignore b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c347e..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.travis.yml b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca24..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/LICENSE b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb0..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -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 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. diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/examples/pow.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e6924212e..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/index.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8a2..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/package.json b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/package.json deleted file mode 100644 index 4038d5feb..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@0.3" -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/readme.markdown b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216ab..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/chmod.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8e9..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/clobber.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb709987..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/mkdirp.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70c1..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abbd2..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm_sync.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f6090..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/race.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a044763..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/rel.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 79858243a..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e561..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return_sync.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d355..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/root.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2f3..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/sync.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cada8..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe22..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask_sync.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cbbf..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/AUTHORS b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b75437..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/LICENSE b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a401094..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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 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. diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/README.md b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/README.md deleted file mode 100644 index cd123b652..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/README.md +++ /dev/null @@ -1,30 +0,0 @@ -`rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf ` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/package.json b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/package.json deleted file mode 100644 index bd1fea889..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "rimraf", - "version": "2.2.5", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "bin": { - "rimraf": "./bin.js" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - { - "name": "Wayne Larsen", - "email": "wayne@larsen.st", - "url": "http://github.com/wvl" - }, - { - "name": "ritch", - "email": "skawful@gmail.com" - }, - { - "name": "Marcel Laverdet" - }, - { - "name": "Yosef Dinerstein", - "email": "yosefd@microsoft.com" - } - ], - "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n", - "readmeFilename": "README.md", - "_id": "rimraf@2.2.5", - "dist": { - "shasum": "74966ae64e584dd1a5345f3c550b5370c6b3998b" - }, - "_from": "rimraf@2", - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.5.tgz" -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/rimraf.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/rimraf.js deleted file mode 100644 index a9258072e..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,178 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") -var fs = require("fs") - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -var isWindows = (process.platform === "win32") - -function rimraf (p, cb) { - if (!cb) throw new Error("No callback passed to rimraf()") - - var busyTries = 0 - rimraf_(p, function CB (er) { - if (er) { - if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && - busyTries < exports.BUSYTRIES_MAX) { - busyTries ++ - var time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, CB) - }, time) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { - return setTimeout(function () { - rimraf_(p, CB) - }, timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, cb) { - fs.unlink(p, function (er) { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) - if (er.code === "EISDIR") - return rmdir(p, er, cb) - } - return cb(er) - }) -} - -function fixWinEPERM (p, er, cb) { - fs.chmod(p, 666, function (er2) { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - fs.stat(p, function(er3, stats) { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, er, cb) - else - fs.unlink(p, cb) - }) - }) -} - -function fixWinEPERMSync (p, er, cb) { - try { - fs.chmodSync(p, 666) - } catch (er2) { - if (er2.code !== "ENOENT") - throw er - } - - try { - var stats = fs.statSync(p) - } catch (er3) { - if (er3 !== "ENOENT") - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, er) - else - fs.unlinkSync(p) -} - -function rmdir (p, originalEr, cb) { - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - fs.rmdir(p, function (er) { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST")) - rmkids(p, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -function rmkids(p, cb) { - fs.readdir(p, function (er, files) { - if (er) - return cb(er) - var n = files.length - if (n === 0) - return fs.rmdir(p, cb) - var errState - files.forEach(function (f) { - rimraf(path.join(p, f), function (er) { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - fs.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p) { - try { - fs.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er) - if (er.code !== "EISDIR") - throw er - rmdirSync(p, er) - } -} - -function rmdirSync (p, originalEr) { - try { - fs.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST") - rmkidsSync(p) - } -} - -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/run.sh b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f0163b..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -for i in test-*.js; do - echo -n $i ... - bash setup.sh - node $i - ! [ -d target ] - echo "pass" -done -rm -rf target diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/setup.sh b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e6316..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -files=10 -folders=2 -depth=4 -target="$PWD/target" - -rm -rf target - -fill () { - local depth=$1 - local files=$2 - local folders=$3 - local target=$4 - - if ! [ -d $target ]; then - mkdir -p $target - fi - - local f - - f=$files - while [ $f -gt 0 ]; do - touch "$target/f-$depth-$f" - let f-- - done - - let depth-- - - if [ $depth -le 0 ]; then - return 0 - fi - - f=$folders - while [ $f -gt 0 ]; do - mkdir "$target/folder-$depth-$f" - fill $depth $files $folders "$target/d-$depth-$f" - let f-- - done -} - -fill $depth $files $folders $target - -# sanity assert -[ -d $target ] diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-async.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7be..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-sync.js b/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f1047..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/package.json b/deploy/core/node_modules/tar.gz/node_modules/fstream/package.json deleted file mode 100644 index f7cae8292..000000000 --- a/deploy/core/node_modules/tar.gz/node_modules/fstream/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "fstream", - "description": "Advanced file system stream things", - "version": "0.1.25", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/fstream.git" - }, - "main": "fstream.js", - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "rimraf": "2", - "mkdirp": "0.3", - "graceful-fs": "~2.0.0", - "inherits": "~2.0.0" - }, - "devDependencies": { - "tap": "" - }, - "scripts": { - "test": "tap examples/*.js" - }, - "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", - "_id": "fstream@0.1.25", - "dist": { - "shasum": "cca977eec0cdc5382161b2feeeb567d5f95783b0" - }, - "_from": "fstream@0.1.x", - "_resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.25.tgz" -} diff --git a/deploy/core/node_modules/tar.gz/package.json b/deploy/core/node_modules/tar.gz/package.json deleted file mode 100644 index 7d1b1620d..000000000 --- a/deploy/core/node_modules/tar.gz/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "tar.gz", - "version": "0.1.1", - "description": "Native gzip compression and decompression utility for Node.js.", - "keywords": [ - "compression", - "decompression", - "compress", - "decompress", - "tar", - "tape archive", - "tape", - "archive", - "gzip", - "gz" - ], - "repository": { - "type": "git", - "url": "http://github.com/cranic/node-tar.gz.git" - }, - "author": { - "name": "Cranic Tecnologia", - "email": "contato@cranic.com.br" - }, - "contributors": [ - { - "name": "Alan Hoffmeister", - "email": "alan@cranic.com.br" - } - ], - "dependencies": { - "fstream": "0.1.x", - "tar": "0.1.x", - "commander": "1.1.x" - }, - "devDependencies": { - "coffee-script": "1.4.x", - "walk": "2.2.x", - "wrench": "1.4.x", - "vows": "0.7.x" - }, - "main": "./lib/targz", - "engines": { - "node": ">=0.6.0" - }, - "maint.me": true, - "scripts": { - "prepublish": "cake build" - }, - "bin": { - "targz": "./bin/targz" - }, - "bugs": { - "url": "http://github.com/cranic/node-tar.gz/issues" - }, - "license": "MIT ", - "readme": "# **node-tar.gz**\nNative gzip compression and decompression utility for Node.js.\n\n### **Installation**\n\nFor simple installation:\n\n npm install tar.gz\n\nIf you want to use the `targz` command line:\n\n npm intall -g tar.gz\n\n### **Usage**\n\nAt the moment this package can only compress a folder and everything that\nis inside it. To compress something is easy:\n\n var targz = require('tar.gz');\n var compress = new targz().compress('/path/to/compress', '/path/to/store.tar.gz', function(err){\n if(err)\n console.log(err);\n\n console.log('The compression has ended!');\n });\n\nWith the same easy you can extract a gziped file:\n\n var targz = require('tar.gz');\n var compress = new targz().extract('/path/to/stored.tar.gz', '/path/to/extract', function(err){\n if(err)\n console.log(err);\n\n console.log('The extraction has ended!');\n });\n\nYou can pass some configuration parameters to the constructor before compress:\n\n var targz = require('tar.gz');\n\n var level = 6 //the compression level from 0-9, default: 6\n var memLevel = 6 //the memory allocation level from 1-9, default: 6\n var proprietary = true //to include or not proprietary headers, default: true\n\n var compress = new targz(level, memLevel, proprietary).compress(...)\n\n### **Command line**\n\n $ targz -h\n\n Usage: targz [options]\n\n Options:\n\n -h, --help output usage information\n -V, --version output the version number\n -c, --compress Compress folder to archive\n -x, --extract Extract archive to folder\n -l, --level [n] Compression level from 0-9. Default 6.\n -m, --memory [n] Memory allocation level from 1-9. Default 6.\n -n, --noproprietary Remove proprietary headers.\n\n Examples:\n\n Default compression\n $ targz -c /folder/to/compres /path/to/archive.tar.gz\n\n Extracting some archive\n $ targz -x /path/to/archive.tar.gz /destination/folder\n\n Maximum compression\n $ targz -l 9 -m 9 -c /folder/to/compres /path/to/archive.tar.gz\n\n\n### **TODO**\n\n * Vows.js tests\n * Single file compression\n * Add more todos...\n\n\n### **License (MIT)**\n\nCopyright (C) 2012 Cranic Tecnologia e Informática LTDA\n\nPermission is hereby granted, free of charge, to any person obtaining \na copy of this software and associated documentation files \n(the \"Software\"), to deal in the Software without restriction, \nincluding without limitation the rights to use, copy, modify, merge, \npublish, distribute, sublicense, and/or sell copies of the Software, \nand to permit persons to whom the Software is furnished to do so, \nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be \nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS \nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY \nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE \nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", - "readmeFilename": "README.md", - "_id": "tar.gz@0.1.1", - "_from": "tar.gz@" -} diff --git a/deploy/core/node_modules/tar.gz/src/targz.coffee b/deploy/core/node_modules/tar.gz/src/targz.coffee deleted file mode 100644 index decd308c0..000000000 --- a/deploy/core/node_modules/tar.gz/src/targz.coffee +++ /dev/null @@ -1,80 +0,0 @@ -# node-tar.gz main class -# -# @version 0.0.1 -# @author Alan Hoffmeister -# @date 2012-12-06 10:22 AM GTM - 3:00 - -fstream = require 'fstream' -tar = require 'tar' -zlib = require 'zlib' -fs = require 'fs' - -class TarGz - - # The construcor, you can change the compresion levels - # - # @public - # @param level Integer The compression level from 0-9. Default 6. - # @param memLevel Integer The memory allocation level from 1-9. Default 6. - # @return Object the main class methods. - constructor : (@level = 6, @memLevel = 6, @proprietary = true) -> - @ - - # The compress method - # - # @public - # @param source String The path from a folder to be compressed - # @param destination String The path for the file to be extracted. Its - # a good idea to end with .tar.gz - # @param callback Function A function that will be called when the compression - # ended and will have the error object - # @return Object the main class methods. - compress : (source, destination, callback) -> - self = @ - - fs.stat source, (err, stat) -> - type = 'Directory' #if stat.isDirectory() - #type = 'File' if stat.isFile() - # Single file support need to be implemented. - - process.nextTick -> - gzip = zlib.createGzip - level : self.level - memLevel : self.memLevel - - #if type == 'File' - # reader = fs.createReadStream(source) - - if type == 'Directory' - reader = fstream.Reader - path : source - type : type - - props = noProprietary : false if self.proprietary == true - props = noProprietary : true if self.proprietary == false - - reader.pipe(tar.Pack(props)).pipe(gzip).pipe fstream.Writer(destination).on 'close', -> - callback null if typeof callback == 'function' - @ - - # The extraction method - # - # @public - # @param source String The path from an .tar.gz to be extracted - # @param destination String The path from a folder where the itens will be extracted - # @param callback Function A function that will be called when the extraction - # ended and will have the error object - # @return Object the main class methods. - extract : (source, destination, callback) -> - self = @ - - process.nextTick -> - fstream.Reader( - path : source - type : 'File' - ).pipe(zlib.createGunzip()).pipe(tar.Extract({path: destination})).on 'end', -> - callback null if typeof callback == 'function' - - @ - -module.exports = TarGz \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/test/compress/test.txt b/deploy/core/node_modules/tar.gz/test/compress/test.txt deleted file mode 100644 index e203bb98e..000000000 --- a/deploy/core/node_modules/tar.gz/test/compress/test.txt +++ /dev/null @@ -1,47 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non massa et augue -molestie lacinia. Ut purus sem, bibendum at blandit vitae, bibendum sed turpis. -Fusce eros libero, fringilla non dapibus in, cursus elementum ipsum. Fusce -ultrices magna ac quam iaculis faucibus. Quisque bibendum posuere mi sed -dignissim. Etiam dictum eros et turpis lobortis nec accumsan eros laoreet. Proin -arcu turpis, faucibus eu posuere pulvinar, cursus vel odio. Lorem ipsum dolor -sit amet, consectetur adipiscing elit. - -Donec auctor blandit nisl, sit amet -cursus ipsum commodo ut. Curabitur egestas odio at dui luctus non aliquam ante -luctus. Nam nisl enim, convallis eget consectetur ut, gravida in dolor. Morbi eu -est at nibh sodales rutrum et at elit. Aenean augue velit, sodales sit amet -vulputate eu, ultrices quis sapien. Ut aliquam eros ac diam laoreet auctor. -Integer malesuada, massa vitae tempus dictum, dolor sem lacinia lacus, a -sollicitudin velit tellus in lacus. Nullam nec risus vitae odio blandit gravida. -Sed eleifend posuere dictum. - -Ut ac tellus enim, suscipit mollis libero. -Nullam eleifend imperdiet erat, sit amet lobortis nisl facilisis eget. Donec at -mauris eget turpis facilisis feugiat nec rhoncus quam. Donec nec nisi elit. -Pellentesque sodales tristique aliquet. In tincidunt, eros in sollicitudin -varius, enim lectus viverra mauris, vel accumsan dolor lectus id dolor. Donec -non tortor sed magna molestie rhoncus. Vestibulum rhoncus, velit sed cursus -imperdiet, tortor justo suscipit nisl, id mattis augue tellus ut libero. -Phasellus lacinia tempor accumsan. Duis euismod porta urna a sagittis. -Pellentesque ullamcorper vehicula metus, non lacinia ipsum congue a. Praesent -laoreet enim ut neque blandit luctus. Praesent eu nulla ut ipsum aliquet -sollicitudin vel sit amet nisi. Nunc nec ornare dolor. Quisque id nisl vel eros -suscipit imperdiet. Aenean pellentesque porttitor egestas. - -Vivamus ut dolor a -eros porta iaculis quis a tortor. In hendrerit rutrum consectetur. Morbi -molestie ipsum vel augue pellentesque quis pulvinar purus tincidunt. Vestibulum -pharetra dolor vitae felis ullamcorper dignissim. Duis vel nisl eu dui congue -molestie vel quis nulla. Duis tempus sapien in velit posuere egestas. Vestibulum -vestibulum rutrum nibh, venenatis consectetur arcu pulvinar ut. - -Sed sed massa -quis lacus elementum porta. Etiam aliquet lacus sit amet metus eleifend congue. -Suspendisse bibendum gravida dolor sed semper. Nullam luctus nisl in lorem -pretium rutrum. Integer auctor, enim sit amet cursus aliquet, massa mauris -pharetra tortor, id volutpat velit dui et nisl. Nullam eget euismod ante. Ut -malesuada, ligula nec pellentesque adipiscing, massa mi ultricies orci, eu -consectetur nunc elit vel tortor. Aenean id nulla nulla. Cum sociis natoque -penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus nunc -risus, feugiat sed venenatis a, porttitor vel lacus. In odio ligula, scelerisque -vel iaculis ac, aliquet ac risus. \ No newline at end of file diff --git a/deploy/core/node_modules/tar.gz/test/extract/placeholder b/deploy/core/node_modules/tar.gz/test/extract/placeholder deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/.bin/rimraf b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/.bin/rimraf similarity index 100% rename from deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/.bin/rimraf rename to deploy/core/node_modules/tar/node_modules/fstream/node_modules/.bin/rimraf diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/polyfills.js b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js similarity index 100% rename from deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/graceful-fs/polyfills.js rename to deploy/core/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/bin.js b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/bin.js similarity index 100% rename from deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/rimraf/bin.js rename to deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/bin.js diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/LICENSE b/deploy/core/node_modules/tar/node_modules/inherits/LICENSE similarity index 100% rename from deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/LICENSE rename to deploy/core/node_modules/tar/node_modules/inherits/LICENSE diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/inherits_browser.js b/deploy/core/node_modules/tar/node_modules/inherits/inherits_browser.js similarity index 100% rename from deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/inherits_browser.js rename to deploy/core/node_modules/tar/node_modules/inherits/inherits_browser.js diff --git a/deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/test.js b/deploy/core/node_modules/tar/node_modules/inherits/test.js similarity index 100% rename from deploy/core/node_modules/tar.gz/node_modules/fstream/node_modules/inherits/test.js rename to deploy/core/node_modules/tar/node_modules/inherits/test.js diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index e18a6b9c0..94ee7cf6f 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -19,7 +19,6 @@ (def shell (load/node-module "shelljs")) (def fs (js/require "fs")) (def fs-path (js/require "path")) -(def targz (load/node-module "tar.gz")) (def zlib (js/require "zlib")) (def request (load/node-module "request")) (def tar (load/node-module "tar")) From 9a1d723b431ba6043ec00234d246a54f620deb43 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 11 Feb 2014 16:29:04 -0800 Subject: [PATCH 048/656] remove old less mode that apparently doesn't work Signed-off-by: Chris Granger --- .../node_modules/codemirror/modes/less.js | 344 ------------------ 1 file changed, 344 deletions(-) delete mode 100644 deploy/core/node_modules/codemirror/modes/less.js diff --git a/deploy/core/node_modules/codemirror/modes/less.js b/deploy/core/node_modules/codemirror/modes/less.js deleted file mode 100644 index ec6231908..000000000 --- a/deploy/core/node_modules/codemirror/modes/less.js +++ /dev/null @@ -1,344 +0,0 @@ -/* - LESS mode - http://www.lesscss.org/ - Ported to CodeMirror by Peter Kroon - Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues - GitHub: @peterkroon -*/ - -CodeMirror.defineMode("less", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - var selectors = /(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/; - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch == "@") {stream.eatWhile(/[\w\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } else if (ch == "=") ret(null, "compare"); - else if (ch == "|" && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "/") { // e.g.: .png will not be parsed as a class - if(stream.eat("/")){ - state.tokenize = tokenSComment; - return tokenSComment(stream, state); - } else { - if(type == "string" || type == "(") return ret("string", "string"); - if(state.stack[state.stack.length-1] !== undefined) return ret(null, ch); - stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/); - if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() === ")")) || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string - } - } else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (/[,+<>*\/]/.test(ch)) { - if(stream.peek() == "=" || type == "a")return ret("string", "string"); - if(ch === ",")return ret(null, ch); - return ret(null, "select-op"); - } else if (/[;{}:\[\]()~\|]/.test(ch)) { - if(ch == ":"){ - stream.eatWhile(/[a-z\\\-]/); - if( selectors.test(stream.current()) ){ - return ret("tag", "tag"); - } else if(stream.peek() == ":"){//::-webkit-search-decoration - stream.next(); - stream.eatWhile(/[a-z\\\-]/); - if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string"); - if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag"); - return ret(null, ch); - } else { - return ret(null, ch); - } - } else if(ch == "~"){ - if(type == "r")return ret("string", "string"); - } else { - return ret(null, ch); - } - } else if (ch == ".") { - if(type == "(")return ret("string", "string"); // allow url(../image.png) - stream.eatWhile(/[\a-zA-Z0-9\-_]/); - if(stream.peek() === " ")stream.eatSpace(); - if(stream.peek() === ")" || type === ":")return ret("number", "unit");//rgba(0,0,0,.25); - else if(state.stack[state.stack.length-1] === "rule" && stream.peek().match(/{|,|\+|\(/) === null)return ret("number", "unit"); - return ret("tag", "tag"); - } else if (ch == "#") { - //we don't eat white-space, we want the hex color and or id only - stream.eatWhile(/[A-Za-z0-9]/); - //check if there is a proper hex color length e.g. #eee || #eeeEEE - if(stream.current().length == 4 || stream.current().length == 7){ - if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream - //when not a valid hex value, parse as id - if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag"); - //eat white-space - stream.eatSpace(); - //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,] - if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) ){ - if(type === "select-op")return ret("number", "unit"); else return ret("atom", "tag"); - } - //#time { color: #aaa } - else if(stream.peek() == "}" )return ret("number", "unit"); - //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa - else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret("atom", "tag"); - //when a hex value is on the end of a line, parse as id - else if(stream.eol())return ret("atom", "tag"); - //default - else return ret("number", "unit"); - } else {//when not a valid hexvalue in the current stream e.g. #footer - stream.eatWhile(/[\w\\\-]/); - return ret("atom", stream.current()); - } - } else {//when not a valid hexvalue length - stream.eatWhile(/[\w\\\-]/); - if(state.stack[state.stack.length-1] === "rule")return ret("atom", stream.current());return ret("atom", stream.current()); - return ret("atom", "tag"); - } - } else if (ch == "&") { - stream.eatWhile(/[\w\-]/); - return ret(null, ch); - } else { - stream.eatWhile(/[\w\\\-_%.{]/); - if(stream.current().match(/\\/) !== null){ - if(stream.current().charAt(stream.current().length-1) === "\\"){ - stream.eat(/\'|\"|\)|\(/); - while(stream.eatWhile(/[\w\\\-_%.{]/)){ - stream.eat(/\'|\"|\)|\(/); - } - return ret("string", stream.current()); - } - } //else if(type === "tag")return ret("tag", "tag"); - else if(type == "string"){ - if(state.stack[state.stack.length-1] === "{" && stream.peek() === ":")return ret("variable", "variable"); - if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/); - return ret(type, stream.current()); - } else if(stream.current().match(/(^http$|^https$)/) != null){ - stream.eatWhile(/[\w\\\-_%.{:\/]/); - if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/); - return ret("string", "string"); - } else if(stream.peek() == "<" || stream.peek() == ">" || stream.peek() == "+"){ - if(type === "(" && (stream.current() === "n" || stream.current() === "-n"))return ret("string", stream.current()); - return ret("tag", "tag"); - } else if( /\(/.test(stream.peek()) ){ - if(stream.current() === "when")return ret("variable","variable"); - else if(state.stack[state.stack.length-1] === "@media" && stream.current() === "and")return ret("variable",stream.current()); - return ret(null, ch); - } else if (stream.peek() == "/" && state.stack[state.stack.length-1] !== undefined){ // url(dir/center/image.png) - if(stream.peek() === "/")stream.eatWhile(/[\w\\\-_%.{:\/]/); - return ret("string", stream.current()); - } else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign - //commment out these 2 comment if you want the minus sign to be parsed as null -500px - //stream.backUp(stream.current().length-1); - //return ret(null, ch); - return ret("number", "unit"); - } else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){ - if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){ - stream.backUp(1); - return ret("tag", "tag"); - }//end if - stream.eatSpace(); - if( /[{<>.a-zA-Z\/]/.test(stream.peek()) || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plus - return ret("string", "string"); // let url(/images/logo.png) without quotes return as string - } else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){ - - if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1); - else if(state.stack[state.stack.length-1] === "border-color" || state.stack[state.stack.length-1] === "background-position" || state.stack[state.stack.length-1] === "font-family")return ret(null, stream.current()); - else if(type === "tag")return ret("tag", "tag"); - else if((type === ":" || type === "unit") && state.stack[state.stack.length-1] === "rule")return ret(null, stream.current()); - else if(state.stack[state.stack.length-1] === "rule" && type === "tag")return ret("string", stream.current()); - else if(state.stack[state.stack.length-1] === ";" && type === ":")return ret(null, stream.current()); - //else if(state.stack[state.stack.length-1] === ";" || type === "")return ret("variable", stream.current()); - else if(stream.peek() === "#" && type !== undefined && type.match(/\+|,|tag|select\-op|}|{|;/g) === null)return ret("string", stream.current()); - else if(type === "variable")return ret(null, stream.current()); - else if(state.stack[state.stack.length-1] === "{" && type === "comment")return ret("variable", stream.current()); - else if(state.stack.length === 0 && (type === ";" || type === "comment"))return ret("tag", stream.current()); - else if((state.stack[state.stack.length-1] === "{" || type === ";") && state.stack[state.stack.length-1] !== "@media{")return ret("variable", stream.current()); - else if(state.stack[state.stack.length-2] === "{" && state.stack[state.stack.length-1] === ";")return ret("variable", stream.current()); - - return ret("tag", "tag"); - } else if(type == "compare" || type == "a" || type == "("){ - return ret("string", "string"); - } else if(type == "|" || stream.current() == "-" || type == "["){ - if(type == "|" && stream.peek().match(/\]|=|\~/) !== null)return ret("number", stream.current()); - else if(type == "|" )return ret("tag", "tag"); - else if(type == "["){ - stream.eatWhile(/\w\-/); - return ret("number", stream.current()); - } - return ret(null, ch); - } else if((stream.peek() == ":") || ( stream.eatSpace() && stream.peek() == ":")) { - stream.next(); - var t_v = stream.peek() == ":" ? true : false; - if(!t_v){ - var old_pos = stream.pos; - var sc = stream.current().length; - stream.eatWhile(/[a-z\\\-]/); - var new_pos = stream.pos; - if(stream.current().substring(sc-1).match(selectors) != null){ - stream.backUp(new_pos-(old_pos-1)); - return ret("tag", "tag"); - } else stream.backUp(new_pos-(old_pos-1)); - } else { - stream.backUp(1); - } - if(t_v)return ret("tag", "tag"); else return ret("variable", "variable"); - } else if(state.stack[state.stack.length-1] === "font-family" || state.stack[state.stack.length-1] === "background-position" || state.stack[state.stack.length-1] === "border-color"){ - return ret(null, null); - } else { - - if(state.stack[state.stack.length-1] === null && type === ":")return ret(null, stream.current()); - - //else if((type === ")" && state.stack[state.stack.length-1] === "rule") || (state.stack[state.stack.length-2] === "{" && state.stack[state.stack.length-1] === "rule" && type === "variable"))return ret(null, stream.current()); - - else if(/\^|\$/.test(stream.current()) && stream.peek().match(/\~|=/) !== null)return ret("string", "string");//att^=val - - else if(type === "unit" && state.stack[state.stack.length-1] === "rule")return ret(null, "unit"); - else if(type === "unit" && state.stack[state.stack.length-1] === ";")return ret(null, "unit"); - else if(type === ")" && state.stack[state.stack.length-1] === "rule")return ret(null, "unit"); - else if(type.match("@") !== null && state.stack[state.stack.length-1] === "rule")return ret(null, "unit"); - //else if(type === "unit" && state.stack[state.stack.length-1] === "rule")return ret(null, stream.current()); - - else if((type === ";" || type === "}" || type === ",") && state.stack[state.stack.length-1] === ";")return ret("tag", stream.current()); - else if((type === ";" && stream.peek() !== undefined && stream.peek().match(/{|./) === null) || (type === ";" && stream.eatSpace() && stream.peek().match(/{|./) === null))return ret("variable", stream.current()); - else if((type === "@media" && state.stack[state.stack.length-1] === "@media") || type === "@namespace")return ret("tag", stream.current()); - - else if(type === "{" && state.stack[state.stack.length-1] === ";" && stream.peek() === "{")return ret("tag", "tag"); - else if((type === "{" || type === ":") && state.stack[state.stack.length-1] === ";")return ret(null, stream.current()); - else if((state.stack[state.stack.length-1] === "{" && stream.eatSpace() && stream.peek().match(/.|#/) === null) || type === "select-op" || (state.stack[state.stack.length-1] === "rule" && type === ",") )return ret("tag", "tag"); - else if(type === "variable" && state.stack[state.stack.length-1] === "rule")return ret("tag", "tag"); - else if((stream.eatSpace() && stream.peek() === "{") || stream.eol() || stream.peek() === "{")return ret("tag", "tag"); - //this one messes up indentation - //else if((type === "}" && stream.peek() !== ":") || (type === "}" && stream.eatSpace() && stream.peek() !== ":"))return(type, "tag"); - - else if(type === ")" && (stream.current() == "and" || stream.current() == "and "))return ret("variable", "variable"); - else if(type === ")" && (stream.current() == "when" || stream.current() == "when "))return ret("variable", "variable"); - else if(type === ")" || type === "comment" || type === "{")return ret("tag", "tag"); - else if(stream.sol())return ret("tag", "tag"); - else if((stream.eatSpace() && stream.peek() === "#") || stream.peek() === "#")return ret("tag", "tag"); - else if(state.stack.length === 0)return ret("tag", "tag"); - else if(type === ";" && stream.peek() !== undefined && stream.peek().match(/^[.|\#]/g) !== null)return ret("tag", "tag"); - - else if(type === ":"){stream.eatSpace();return ret(null, stream.current());} - - else if(stream.current() === "and " || stream.current() === "and")return ret("variable", stream.current()); - else if(type === ";" && state.stack[state.stack.length-1] === "{")return ret("variable", stream.current()); - - else if(state.stack[state.stack.length-1] === "rule")return ret(null, stream.current()); - - return ret("tag", stream.current()); - } - } - } - - function tokenSComment(stream, state) { // SComment = Slash comment - stream.skipToEnd(); - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = null; //"tag" - else if (!context || context == "@media{") { - style = stream.current() == "when" ? "variable" : - /[\s,|\s\)|\s]/.test(stream.peek()) ? "tag" : type; - } - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (stream.current() === "font-family") state.stack[state.stack.length-1] = "font-family"; - else if (stream.current() === "background-position") state.stack[state.stack.length-1] = "background-position"; - else if (stream.current() === "border-color") state.stack[state.stack.length-1] = "border-color"; - else if (context == "{" && type != "comment" && type !== "tag") state.stack.push("rule"); - else if (stream.peek() === ":" && stream.current().match(/@|#/) === null) style = type; - if(type === ";" && (state.stack[state.stack.length-1] == "font-family" || state.stack[state.stack.length-1] == "background-position" || state.stack[state.stack.length-1] == "border-color"))state.stack[state.stack.length-1] = stream.current(); - else if(type === "tag" && stream.peek() === ")" && stream.current().match(/\:/) === null){type = null; style = null;} - // ???? - else if((type === "variable" && stream.peek() === ")") || (type === "variable" && stream.eatSpace() && stream.peek() === ")"))return ret(null,stream.current()); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] === "rule" ? 2 : 1; - else if (state.stack[state.stack.length-2] === "{") - n -= state.stack[state.stack.length-1] === "rule" ? 1 : 0; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-less", "less"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/css")) - CodeMirror.defineMIME("text/css", "less"); From d61497fbecb261b8ab32e8cc23f2ebaad54f382f Mon Sep 17 00:00:00 2001 From: "mark.fisher" Date: Wed, 12 Feb 2014 10:43:22 +0000 Subject: [PATCH 049/656] Show update button below uninstall and source when there is one available. This fixes Issue #1272 by making the update button appear below other 2 if available instead of replacing the uninstall button. --- deploy/core/css/skins/new-dark.css | 2 +- src/lt/objs/plugins.cljs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 3d81040ea..aa94650c4 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -279,7 +279,7 @@ input { color: var(highlight-fg); background:var(highlight-bg); } .plugin-manager button {background: var(highlight-bg); } .plugin-manager .install { box-sizing:border-box; color:var(secondary-accent-bg); background:var(secondary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; } .plugin-manager .uninstall { box-sizing:border-box; color:var(tertiary-accent-bg); background:var(tertiary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; } -.plugin-manager .update { box-sizing:border-box; background:var(error-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; } +.plugin-manager .update { box-sizing:border-box; background:var(error-fg); display:inline-block; height:25px; position:absolute; right:0; top:50px; width:5px; -webkit-transition:width 0.1s ease-in-out; } .plugin-manager li:hover .update { width:70px; overflow:hidden; } .plugin-manager li:hover .update:before { color:var(error-bg); padding:4px 8px; display:inline-block; content: "update"; } .plugin-manager li:hover .uninstall { width:70px; overflow:hidden; } diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 4e441eef0..277477a8b 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -352,9 +352,9 @@ (deploy/is-newer? (:version plugin) cached))] [:li {:class (if update? "has-update")} - (if update? - (update-button (assoc plugin :version cached)) - (uninstall-button plugin)) + (when update? + (update-button (assoc plugin :version cached))) + (uninstall-button plugin) (source-button plugin) [:h1 (:name plugin) [:span.version (:version plugin)]] [:h3 (:author plugin)] From daead71d7fee6a2ed3e262547bb11dddd9a50a95 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 12 Feb 2014 10:37:39 -0800 Subject: [PATCH 050/656] print ex-data for websocket cljs errors Signed-off-by: Chris Granger --- deploy/core/node_modules/lighttable/ws.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/node_modules/lighttable/ws.js b/deploy/core/node_modules/lighttable/ws.js index 9932c0e62..30c3bec7c 100644 --- a/deploy/core/node_modules/lighttable/ws.js +++ b/deploy/core/node_modules/lighttable/ws.js @@ -116,7 +116,7 @@ var res = eval.call(window, prev.data.results[i].code); socket.emit("result", toMessage(prev, "editor.eval.cljs.result", {result: cljs.core.pr_str(res), meta: prev.data.results[i].meta})); } catch (e) { - socket.emit("result", toMessage(prev, "editor.eval.cljs.exception", {ex: e.stack || cljs.core.pr_str(cljs.core.type(e)), meta: prev.data.results[i].meta})); + socket.emit("result", toMessage(prev, "editor.eval.cljs.exception", {ex: e.stack || cljs.core.pr_str(cljs.core.type(e)) + ": " + cljs.core.pr_str(cljs.core.ex_data(e)), meta: prev.data.results[i].meta})); } } }); From af34216b048a96b697858062671fac5d7f5704cd Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 12 Feb 2014 11:21:37 -0800 Subject: [PATCH 051/656] better cljs websocket errors in general Signed-off-by: Chris Granger --- deploy/core/node_modules/lighttable/ws.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/deploy/core/node_modules/lighttable/ws.js b/deploy/core/node_modules/lighttable/ws.js index 30c3bec7c..4056e719e 100644 --- a/deploy/core/node_modules/lighttable/ws.js +++ b/deploy/core/node_modules/lighttable/ws.js @@ -112,11 +112,24 @@ var prev = fromMessage(message); for(var i = 0; i < prev.data.results.length; i++) { var data = prev.data.results[i]; + var meta = prev.data.results[i].meta; + meta.verbatim = true; try { var res = eval.call(window, prev.data.results[i].code); - socket.emit("result", toMessage(prev, "editor.eval.cljs.result", {result: cljs.core.pr_str(res), meta: prev.data.results[i].meta})); + socket.emit("result", toMessage(prev, "editor.eval.cljs.result", {result: cljs.core.pr_str(res), meta: meta})); } catch (e) { - socket.emit("result", toMessage(prev, "editor.eval.cljs.exception", {ex: e.stack || cljs.core.pr_str(cljs.core.type(e)) + ": " + cljs.core.pr_str(cljs.core.ex_data(e)), meta: prev.data.results[i].meta})); + var exdata = cljs.core.ex_data(e); + var error = ""; + if (exdata) { + error = e.message + ": " + cljs.core.pr_str(exdata); + } else { + error = cljs.core.pr_str(e); + } + + if(e.stack) { + error += "\n" + e.stack; + } + socket.emit("result", toMessage(prev, "editor.eval.cljs.exception", {ex: error, meta: meta})); } } }); From 1dc73c10acdc4bdc069f0e95f66e023ef82bf2a4 Mon Sep 17 00:00:00 2001 From: Jamie Brandon Date: Fri, 14 Feb 2014 01:48:11 +0000 Subject: [PATCH 052/656] Add behaviour to set zoom --- src/lt/objs/app.cljs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 20be094a0..fe94d2a0f 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -10,6 +10,7 @@ (def gui (js/require "nw.gui")) (def win (.Window.get gui)) (def closing true) +(def default-zoom 0) (defn window-number [] (let [n (last (string/split js/window.location.search "="))] @@ -180,8 +181,15 @@ (apply cmd/exec! c) (cmd/exec! c))))))) - - +(behavior ::set-default-zoom-level + :triggers #{:init} + :desc "App: Set the default zoom level" + :params [{:label "default-zoom-level" + :type :number}] + :type :user + :reaction (fn [this default] + (set! default-zoom default) + (set! (.-zoomLevel win) default))) ;;********************************************************* ;; Object @@ -242,6 +250,7 @@ (cmd/command {:command :window.zoom-reset :desc "Window: Zoom reset" :exec (fn [] - (set! (.-zoomLevel win) 0) + (set! (.-zoomLevel win) default-zoom) )}) + From f97aafc2dff12fb6f8884972c2edd55943344644 Mon Sep 17 00:00:00 2001 From: flaviozantut Date: Sat, 15 Feb 2014 16:29:14 -0200 Subject: [PATCH 053/656] fixed php ext editor --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 9a80f3114..a119313b7 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -252,7 +252,7 @@ {:name "OCaml" :exts [:ocaml :ml] :mime "text/x-ocaml" :tags [:editor.ocaml]} {:name "Pascal" :exts [:pas] :mime "text/x-pascal" :tags [:editor.pascal]} {:name "Perl" :exts [:pl] :mime "text/x-perl" :tags [:editor.perl]} - {:name "PHP" :exts [:php] :mime "text/x-perl" :tags [:editor.perl]} + {:name "PHP" :exts [:php] :mime "text/x-php" :tags [:editor.php]} {:name "Plain Text" :exts [:txt] :mime "plaintext" :tags [:editor.plaintext]} {:name "Python" :exts [:py :pyw] :mime "text/x-python" :tags [:editor.python]} {:name "R" :exts [:r] :mime "text/x-rsrc" :tags [:editor.r]} From ced1f440f138c5802d7d5191706f4d4184538998 Mon Sep 17 00:00:00 2001 From: Jamie Brandon Date: Sun, 16 Feb 2014 00:32:14 +0000 Subject: [PATCH 054/656] Add behaviors for app pre/post-init --- src/lt/objs/app.cljs | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index fe94d2a0f..4e53dbdc8 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -164,22 +164,42 @@ (.focus win) )) +(defn run-commands [this & commands] + (when (seq commands) + (let [commands (if (-> commands first vector?) + (first commands) + commands)] + (doseq [c commands] + (if (coll? c) + (apply cmd/exec! c) + (cmd/exec! c)))))) + +(behavior ::run-pre-init + :triggers #{:pre-init} + :desc "App: Run commands before init" + :params [{:label "commands" + :type :list + :items cmd/completions}] + :type :user + :reaction run-commands) + (behavior ::run-on-init :triggers #{:init} - :desc "App: Run commands on start" + :desc "App: Run commands on init" + :params [{:label "commands" + :type :list + :items cmd/completions}] + :type :user + :reaction run-commands) + +(behavior ::run-post-init + :triggers #{:post-init} + :desc "App: Run commands after init" :params [{:label "commands" :type :list :items cmd/completions}] :type :user - :reaction (fn [this & commands] - (when (seq commands) - (let [commands (if (-> commands first vector?) - (first commands) - commands)] - (doseq [c commands] - (if (coll? c) - (apply cmd/exec! c) - (cmd/exec! c))))))) + :reaction run-commands) (behavior ::set-default-zoom-level :triggers #{:init} From 1ca916dd326ac332b8fee0b52b204d92c03600e0 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Mon, 17 Feb 2014 22:35:15 +1100 Subject: [PATCH 055/656] Close tab with middle / cmd + click --- src/lt/objs/tabs.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index ef6d11a83..c1efb8787 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -114,8 +114,10 @@ :obj-id (object/->id e) :pos pos} (->name e)] - :click (fn [] - (active! e)) + :click (fn [ev] + (if (or (= 1 (.-button ev)) (.-metaKey ev)) + (object/raise e :close) + (active! e))) :contextmenu (fn [ev] (menu! e ev) (dom/prevent ev) From ccc3b4fb1c978c61bc2891fec3c6c8e083054f6a Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 17 Feb 2014 11:42:13 -0800 Subject: [PATCH 056/656] add in command Signed-off-by: Chris Granger --- src/lt/objs/files.cljs | 3 +++ src/lt/objs/plugins.cljs | 27 ++++++++++++++++++++++----- src/lt/util/load.cljs | 16 ++++++++++------ 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index c9e9178fb..17f1b6d77 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -259,6 +259,9 @@ (defn resolve [base cur] (.resolve fpath base cur)) +(defn real-path [c] + (.realpathSync fs c)) + (defn ->file|dir [path f] (if (dir? (str path separator f)) (str f separator) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 4e441eef0..fb4721448 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -28,6 +28,8 @@ (def plugins-url "http://plugins.lighttable.com") (def ^:dynamic *plugin-dir* nil) +(declare manager) + (defn EOF-read [s] (when (and s (seq s)) @@ -69,6 +71,14 @@ (when-let [ed (pool/last-active)] (object/raise ed :build)))}) +(cmd/command {:command :behaviors.force-reload + :desc "Plugins: Ignore cache and force reload the current behaviors file" + :exec (fn [] + (when-let [ed (pool/last-active)] + (when (object/has-tag? ed :editor.behaviors) + (swap! manager update-in [::force-reload] #(conj (or % #{}) (get-in @ed [:info :path]))) + (cmd/exec! :behaviors.reload))))}) + ;;********************************************************* ;; Plugin reading ;;********************************************************* @@ -119,13 +129,17 @@ (defn plugin-behaviors [plug] (let [{:keys [behaviors dir]} plug file (files/join dir behaviors) + file (files/real-path file) behs (-> (files/open-sync file) (:content) - (settings/safe-read file))] + (settings/safe-read file)) + force? (get (::force-reload @manager) file)] + (when force? + (swap! manager update-in [::force-reload] disj file)) (when behs (walk/prewalk (fn [x] (when (list? x) - (alter-meta! x assoc ::dir dir)) + (alter-meta! x assoc ::dir dir ::force-reload force?)) x) behs) behs))) @@ -545,13 +559,15 @@ :params [{:label "path"}] :type :user :reaction (fn [this path] - (binding [*plugin-dir* (::dir object/*behavior-meta*)] + (binding [*plugin-dir* (::dir object/*behavior-meta*) + load/*force-reload* (::force-reload object/*behavior-meta*)] (let [paths (if (coll? path) path [path])] (doseq [path paths] (let [path (adjust-path path)] - (when-not (get (::loaded-files @this) path) + (when (or load/*force-reload* + (not (get (::loaded-files @this) path))) (try (load/js path true) (object/update! this [::loaded-files] #(conj (or % #{}) path)) @@ -569,7 +585,8 @@ :type :user :reaction (fn [this path] (let [path (adjust-path path)] - (when-not (get (::loaded-files @this) path) + (when (or load/*force-reload* + (not (get (::loaded-files @this) path))) (object/update! this [::loaded-files] #(conj (or % #{}) path)) (load/css path))))) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index c57db0c85..294d9ba27 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -6,6 +6,8 @@ (def pwd (.resolve fpath ".")) +(def ^:dynamic *force-reload* false) + (defn absolute? [path] (boolean (re-seq #"^\s*[\\\/]|([\w]+:[\\\/])" path))) @@ -57,9 +59,11 @@ (<= (.-length (js/Object.keys cur)) (provided-ancestors s))) (defn provided? [s] - (let [res (if (aget provided s) - true - (when-let [cur (obj-exists? s)] - (not (only-ancestors? cur s))))] - (aset provided s true) - res)) + (if *force-reload* + false + (let [res (if (aget provided s) + true + (when-let [cur (obj-exists? s)] + (not (only-ancestors? cur s))))] + (aset provided s true) + res))) From 6bf91ac4ab7abe05531b4fa5a1207fa8b6148735 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 17 Feb 2014 11:42:13 -0800 Subject: [PATCH 057/656] add 'Plugins: Ignore cache and force reload the current behaviors file' command Signed-off-by: Chris Granger --- src/lt/objs/files.cljs | 3 +++ src/lt/objs/plugins.cljs | 27 ++++++++++++++++++++++----- src/lt/util/load.cljs | 16 ++++++++++------ 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index c9e9178fb..17f1b6d77 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -259,6 +259,9 @@ (defn resolve [base cur] (.resolve fpath base cur)) +(defn real-path [c] + (.realpathSync fs c)) + (defn ->file|dir [path f] (if (dir? (str path separator f)) (str f separator) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 4e441eef0..fb4721448 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -28,6 +28,8 @@ (def plugins-url "http://plugins.lighttable.com") (def ^:dynamic *plugin-dir* nil) +(declare manager) + (defn EOF-read [s] (when (and s (seq s)) @@ -69,6 +71,14 @@ (when-let [ed (pool/last-active)] (object/raise ed :build)))}) +(cmd/command {:command :behaviors.force-reload + :desc "Plugins: Ignore cache and force reload the current behaviors file" + :exec (fn [] + (when-let [ed (pool/last-active)] + (when (object/has-tag? ed :editor.behaviors) + (swap! manager update-in [::force-reload] #(conj (or % #{}) (get-in @ed [:info :path]))) + (cmd/exec! :behaviors.reload))))}) + ;;********************************************************* ;; Plugin reading ;;********************************************************* @@ -119,13 +129,17 @@ (defn plugin-behaviors [plug] (let [{:keys [behaviors dir]} plug file (files/join dir behaviors) + file (files/real-path file) behs (-> (files/open-sync file) (:content) - (settings/safe-read file))] + (settings/safe-read file)) + force? (get (::force-reload @manager) file)] + (when force? + (swap! manager update-in [::force-reload] disj file)) (when behs (walk/prewalk (fn [x] (when (list? x) - (alter-meta! x assoc ::dir dir)) + (alter-meta! x assoc ::dir dir ::force-reload force?)) x) behs) behs))) @@ -545,13 +559,15 @@ :params [{:label "path"}] :type :user :reaction (fn [this path] - (binding [*plugin-dir* (::dir object/*behavior-meta*)] + (binding [*plugin-dir* (::dir object/*behavior-meta*) + load/*force-reload* (::force-reload object/*behavior-meta*)] (let [paths (if (coll? path) path [path])] (doseq [path paths] (let [path (adjust-path path)] - (when-not (get (::loaded-files @this) path) + (when (or load/*force-reload* + (not (get (::loaded-files @this) path))) (try (load/js path true) (object/update! this [::loaded-files] #(conj (or % #{}) path)) @@ -569,7 +585,8 @@ :type :user :reaction (fn [this path] (let [path (adjust-path path)] - (when-not (get (::loaded-files @this) path) + (when (or load/*force-reload* + (not (get (::loaded-files @this) path))) (object/update! this [::loaded-files] #(conj (or % #{}) path)) (load/css path))))) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index c57db0c85..294d9ba27 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -6,6 +6,8 @@ (def pwd (.resolve fpath ".")) +(def ^:dynamic *force-reload* false) + (defn absolute? [path] (boolean (re-seq #"^\s*[\\\/]|([\w]+:[\\\/])" path))) @@ -57,9 +59,11 @@ (<= (.-length (js/Object.keys cur)) (provided-ancestors s))) (defn provided? [s] - (let [res (if (aget provided s) - true - (when-let [cur (obj-exists? s)] - (not (only-ancestors? cur s))))] - (aset provided s true) - res)) + (if *force-reload* + false + (let [res (if (aget provided s) + true + (when-let [cur (obj-exists? s)] + (not (only-ancestors? cur s))))] + (aset provided s true) + res))) From ac49a5110299be5e505165e6c4454cb9f72d8c8c Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 17 Feb 2014 12:04:59 -0800 Subject: [PATCH 058/656] LT UI doesn't really have a defined dir, you should be able to eval anything into it, fixes #1176 Signed-off-by: Chris Granger --- src/lt/objs/clients/local.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lt/objs/clients/local.cljs b/src/lt/objs/clients/local.cljs index 0d1c37c3a..9b1b09f75 100644 --- a/src/lt/objs/clients/local.cljs +++ b/src/lt/objs/clients/local.cljs @@ -63,7 +63,6 @@ (defn init [] (clients/handle-connection! {:name client-name :tags [:client.local] - :dir (files/lt-home) :root-relative (files/lt-home "core") :commands #{:editor.eval.cljs.exec :editor.eval.js From 7477614b97f306b471ff8044c67c2c2e411accb8 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 17 Feb 2014 13:35:48 -0800 Subject: [PATCH 059/656] check for missing deps on getting available plugins, this should fix the personal plugin dependencies issue Signed-off-by: Chris Granger --- src/lt/objs/plugins.cljs | 82 +++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 17 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index fb4721448..387ca81a8 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -18,6 +18,7 @@ [lt.util.kahn :as kahn] [lt.util.load :as load] [lt.util.dom :as dom] + [clojure.set :as set] [clojure.string :as string] [clojure.walk :as walk]) (:require-macros [lt.macros :refer [behavior defui]])) @@ -108,22 +109,69 @@ (defn plugin-info [dir] (or (plugin-json dir) (plugin-edn dir))) +(defn missing-deps [all] + (let [deps (->> (vals all) + (mapcat (comp seq :dependencies)))] + (-> (reduce (fn [final [name version]] + (let [name (cljs.core/name name)] + (if-let [cur (or (get all name) (get final name))] + ;;check if it's newer + (if (deploy/is-newer? (:version cur) version) + (assoc! final name {:name name + :version version}) + final) + (assoc! final name {:name name + :version version})))) + (transient {}) + deps) + (persistent!) + (vals) + (seq)))) + +(defn install-missing [missing] + (let [counter (atom (count missing)) + count-down (fn [] + (swap! counter dec) + ;;then install the actual plugin + (when (<= @counter 0) + (cmd/exec! :behaviors.reload) + (object/raise manager :refresh!) + (notifos/set-msg! "All missing dependencies installed.") + ))] + ;;first get and install all the deps + ;;count them down and then install the real plugin and reload. + (doseq [dep missing] + (discover-deps dep count-down)))) + (defn available-plugins [] (let [ds (concat (files/dirs user-plugins-dir) (files/dirs plugins-dir)) plugins (->> ds (map plugin-info) - (filterv identity))] - (-> (reduce (fn [final p] - (if-let [cur (get final (:name p))] - ;;check if it's newer - (if (deploy/is-newer? (:version cur) (:version p)) - (assoc! final (:name p) p) - final) - (assoc! final (:name p) p))) - (transient {}) - plugins) - (persistent!)))) + (filterv identity)) + final (-> (reduce (fn [final p] + (if-let [cur (get final (:name p))] + ;;check if it's newer + (if (deploy/is-newer? (:version cur) (:version p)) + (assoc! final (:name p) p) + final) + (assoc! final (:name p) p))) + (transient {}) + plugins) + (persistent!)) + missing? (missing-deps final)] + (when missing? + (popup/popup! {:header "Some plugin dependencies are missing." + :body [:div + [:span "We found that the following plugin dependencies are missing: "] + (for [{:keys [name version]} missing?] + [:div name " " version " "]) + [:span "Would you like us to install them?"]] + :buttons [{:label "Cancel"} + {:label "Install all" + :action (fn [] + (install-missing missing?))}]})) + final)) (defn plugin-behaviors [plug] @@ -215,7 +263,6 @@ (object/update! app/app [::plugins] assoc name {}) (fetch-and-install (-> plugin :tar) name (fn [] - (object/raise manager :refresh!) (when cb (cb true)) ))) @@ -234,10 +281,7 @@ (when (<= @counter 0) (install-version (deps cur) (fn [installed?] (when cb - (cb installed?)) - (when installed? - ;;a new plugin has been installed, we should reload everything - (cmd/exec! :behaviors.reload))))))] + (cb installed?))))))] ;;first get and install all the deps ;;count them down and then install the real plugin and reload. (if (seq others) @@ -318,7 +362,9 @@ :click (fn [e] (dom/prevent e) (dom/stop-propagation e) - (discover-deps plugin nil))) + (discover-deps plugin (fn [] + (cmd/exec! :behaviors.reload) + (object/raise manager :refresh!))))) (defui install-button [plugin] [:span.install] @@ -326,6 +372,8 @@ (this-as me (discover-deps plugin (fn [] (dom/remove (dom/parent me)) + (cmd/exec! :behaviors.reload) + (object/raise manager :refresh!) ))) (dom/prevent e) (dom/stop-propagation e))) From c53c04581cf7fada88380682e76f0fbed9aa744a Mon Sep 17 00:00:00 2001 From: ndr Date: Mon, 17 Feb 2014 22:19:24 +0100 Subject: [PATCH 060/656] Allow editor/adjust-loc to specify line movement editor/adjust-loc accepts an optional argument of value :line or :ch to specify the axis along which to move. For backward compatibility, adjust-loc moves along :ch by default if no optional argument is passed. --- src/lt/objs/editor.cljs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index d7b074a96..343d4f75e 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -319,9 +319,12 @@ (-> (js/CodeMirror.innerMode (.getMode (->cm-ed e)) state) (.-mode)))) -(defn adjust-loc [loc dir] - (when loc - (update-in loc [:ch] + dir))) +(defn adjust-loc + ([loc dir] + (adjust-loc loc dir :ch)) + ([loc dir axis] + (when loc + (update-in loc [axis] + dir)))) (defn get-char [ed dir] (let [loc (->cursor ed)] From ba12e10ac39d921aea933056680d3d2c48a758c0 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 17 Feb 2014 13:52:29 -0800 Subject: [PATCH 061/656] remove alt-# as it breaks a bunch of international keyboards, #1284 Signed-off-by: Chris Granger --- deploy/settings/default/default.keymap | 9 --------- 1 file changed, 9 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index e21e3105e..7c911be79 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -42,15 +42,6 @@ "pmeta-7" [(:tabs.goto 6)] "pmeta-8" [(:tabs.goto 7)] "pmeta-9" [(:tabs.goto :last)] - "alt-1" [(:tabs.goto 0)] - "alt-2" [(:tabs.goto 1)] - "alt-3" [(:tabs.goto 2)] - "alt-4" [(:tabs.goto 3)] - "alt-5" [(:tabs.goto 4)] - "alt-6" [(:tabs.goto 5)] - "alt-7" [(:tabs.goto 6)] - "alt-8" [(:tabs.goto 7)] - "alt-9" [(:tabs.goto :last)] } :popup {"left" [(:popup.move-active 1)], "shift-tab" [(:popup.move-active -1)], From 282dc7c00509b0b9de224d379d1e7423dff29837 Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Tue, 18 Feb 2014 02:17:04 -0500 Subject: [PATCH 062/656] Added a fix for being able to report GitHub issues within Light Table. One can click the GitHub button on the welcome page or select "Report an Issue" from within the Help menu. --- deploy/core/css/structure.css | 4 +++ deploy/settings/default/default.behaviors | 1 + src/lt/objs/intro.cljs | 7 ++++ src/lt/objs/menu.cljs | 1 + src/lt/objs/reports.cljs | 44 +++++++++++++++++++++++ src/lt/objs/tabs.cljs | 4 +-- 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/lt/objs/reports.cljs diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index dc7c6811a..5cf0e1508 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -296,6 +296,10 @@ body { -webkit-user-select: none; } .docs iframe { width:100%; height:100%; } .docs .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } +.reports { width:100%; height:100%; } /* TODO: Add reports to css file [3 lines] - TWM */ +.reports iframe { width:100%; height:100%; } +.reports .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } + #browser iframe { height:-webkit-calc(100% - 35px); width:100%; } #browser .frame-shade { height:-webkit-calc(100% - 35px); width:100%; background:transparent; position:absolute; display:none; } #browser input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 9a80f3114..564cd7c93 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -137,6 +137,7 @@ :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document] :document.linked [:lt.objs.document/close-linked-document] :docs [:lt.objs.docs/on-close-destroy] + :reports [:lt.objs.reports/on-close-destroy] ;; TODO: Add close tab behavior to report - TWM :docable [:lt.plugins.doc/editor.doc.show! :lt.plugins.doc/doc-menu+] :editor [:lt.objs.document/close-document-on-editor-close diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index 3b6ec630a..50bb1eed3 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -26,6 +26,12 @@ :click (fn [] (cmd/exec! :show-docs))) +(defui reports [] ;; TODO: Added report button to click - TWM + [:button "GitHub"] + :click (fn [] + (cmd/exec! :show-reports))) + + (defui changelog [] [:button "changelog"] :click (fn [] @@ -41,6 +47,7 @@ [:img {:height 40 :src (bound style/styles ->lt-image)}]] [:p "Welcome to the latest version of Light Table. To see the full list of what's been added/changed, checkout the " (changelog) ". Some of the highlights include deeper Javascript support, inline browsers, and Python eval! If you're new, you might want to take a look at " (docs) "to get started."] + [:p "If you run into any problems, report the issue on " (reports) "!"] ;; TODO: Added button to click for reporting issue - TWM ])) (behavior ::show-intro diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 7cf764dff..dd7cc9678 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -155,6 +155,7 @@ (cmd-item "Maximize" :window.maximize) (cmd-item "Fullscreen" :window.fullscreen)]} {:label "Help" :submenu [(cmd-item "Documentation" :show-docs) + (cmd-item "Report an Issue" :show-reports) ;; TODO: Add report an issue on GitHub menu item - TWM (when-not (platform/mac?) (cmd-item "About Light Table" :version))]} ])) diff --git a/src/lt/objs/reports.cljs b/src/lt/objs/reports.cljs new file mode 100644 index 000000000..d0c29b73b --- /dev/null +++ b/src/lt/objs/reports.cljs @@ -0,0 +1,44 @@ +;; File created by Tyrieke Morton - TWM + +(ns lt.objs.reports + (:require [lt.object :as object] + [lt.objs.command :as cmd] + [lt.objs.tabs :as tabs]) + (:require-macros [lt.macros :refer [behavior]])) + +;;********************************************************* +;; Object +;;********************************************************* + +(object/object* ::reports + :tags #{:reports} + :name "Report Issue" + :init (fn [this] + [:div.reports + [:div.frame-shade] + [:iframe {:src "https://github.com/LightTable/LightTable/issues/new" :nwdisable "true" :nwfaketop "true"}]])) + +;;********************************************************* +;; Behaviors +;;********************************************************* + +(behavior ::on-close-destroy + :triggers #{:close} + :reaction (fn [this] + (when-let [ts (:lt.objs.tabs/tabset @this)] + (when (= (count (:objs @ts)) 1) + (tabs/rem-tabset ts))) + (object/raise this :destroy))) + +;;********************************************************* +;; Commands +;;********************************************************* + +(cmd/command {:command :show-reports + :desc "Reports: Report an Issue" + :exec (fn [] + (let [reports (object/create ::reports) + ts (tabs/spawn-tabset)] + (tabs/equalize-tabset-widths) + (tabs/add! reports ts) + (tabs/active! reports)))}) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 86a14bba0..db4ce3a8e 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -105,7 +105,7 @@ (str c (when (:dirty @e) " dirty"))) -(defui close-tab [obj] ;; TODO: Create x button +(defui close-tab [obj] ;; TODO: Create x button - TWM [:button "x"] :click (fn [] (object/raise obj :close))) @@ -117,7 +117,7 @@ :title (->path e) :obj-id (object/->id e) :pos pos} - (close-tab e) ;; TODO: Add 'x' button next to file name + (close-tab e) ;; TODO: Add 'x' button next to file name - TWM (->name e)] :click (fn [] (active! e)) From 20ecf1aa9a55e606f33c0347d99b52c381a5e88e Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Tue, 18 Feb 2014 02:57:16 -0500 Subject: [PATCH 063/656] Reverting tabs.cljs file back to original repo. I do not want to merge this file with the changes specific to this branch. --- src/lt/objs/tabs.cljs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index db4ce3a8e..ef6d11a83 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -105,10 +105,6 @@ (str c (when (:dirty @e) " dirty"))) -(defui close-tab [obj] ;; TODO: Create x button - TWM - [:button "x"] - :click (fn [] (object/raise obj :close))) - (defui item [multi e pos] [:li {:class (-> " " (active? e multi) @@ -117,7 +113,6 @@ :title (->path e) :obj-id (object/->id e) :pos pos} - (close-tab e) ;; TODO: Add 'x' button next to file name - TWM (->name e)] :click (fn [] (active! e)) From 6f93de5a7e762fad402bf7c743fe3f1529dcf107 Mon Sep 17 00:00:00 2001 From: statesside Date: Tue, 18 Feb 2014 09:58:13 -0500 Subject: [PATCH 064/656] Added Leiningen and run directions to READ.md... Since these directions are recommended, I added them to the README for a better starting place for potential developers. Also added a direction for running the scripts. --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb2c4c189..bf558c3f4 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # Initial setup -First install or update [leiningen](http://leiningen.org/). Then we have to do some juggling (unless you fancy building node-webkit from source). +First install or update [leiningen](http://leiningen.org/). + +1. Download the lein script. For Windows, download lein.bat. +2. Place it on your $PATH where your shell can find it (eg. ~/bin). +3. Set it to be an executable (chmod a+x ~/bin/lein). +4. Run the Lein script (eg. "./lein" or "sh lein") without quotes. + +You can check your package manager. However, be sure you get version 2.x. Windows users can use this installer. + +Then we have to do some juggling (unless you fancy building node-webkit from source). On OS X: From b314110209e0ccbff60a2799a4da5812a945b820 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Feb 2014 15:39:29 -0800 Subject: [PATCH 065/656] wrap pair insertion and deletion in editor operations Signed-off-by: Chris Granger --- src/lt/plugins/auto_paren.cljs | 40 +++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 55c4a07cb..fe8235318 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -31,14 +31,16 @@ (behavior ::open-pair :triggers #{:open-pair!} :reaction (fn [this ch] - (let [current-selection (editor/selection this)] - (if-not (= current-selection "") - (editor/replace-selection this (str ch current-selection (pairs ch))) - (if (re-seq word-char (get-char this 1)) - (editor/insert-at-cursor this ch) - (do - (editor/insert-at-cursor this (str ch (pairs ch))) - (move-cursor this -1))))))) + (editor/operation this + (fn [] + (let [current-selection (editor/selection this)] + (if-not (= current-selection "") + (editor/replace-selection this (str ch current-selection (pairs ch))) + (if (re-seq word-char (get-char this 1)) + (editor/insert-at-cursor this ch) + (do + (editor/insert-at-cursor this (str ch (pairs ch))) + (move-cursor this -1))))))))) (behavior ::close-pair :triggers #{:close-pair!} @@ -51,16 +53,18 @@ (behavior ::repeat-pair :triggers #{:repeat-pair!} :reaction (fn [this ch] - (let [current-selection (editor/selection this)] - (if-not (= current-selection "") - (editor/replace-selection this (str ch current-selection ch)) - (cond - (= ch (get-char this 1)) (move-cursor this 1) - (re-seq word-char (get-char this 1)) (editor/insert-at-cursor this ch) - (re-seq word-char (get-char this -1)) (editor/insert-at-cursor this ch) - :else (do - (editor/insert-at-cursor this (str ch ch)) - (move-cursor this -1))))))) + (editor/operation this + (fn [] + (let [current-selection (editor/selection this)] + (if-not (= current-selection "") + (editor/replace-selection this (str ch current-selection ch)) + (cond + (= ch (get-char this 1)) (move-cursor this 1) + (re-seq word-char (get-char this 1)) (editor/insert-at-cursor this ch) + (re-seq word-char (get-char this -1)) (editor/insert-at-cursor this ch) + :else (do + (editor/insert-at-cursor this (str ch ch)) + (move-cursor this -1))))))))) (behavior ::try-remove-pair :triggers #{:backspace!} From 86e582232cd0267e8785252d08cc5160b8568640 Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Wed, 19 Feb 2014 00:38:13 -0500 Subject: [PATCH 066/656] Reverted files back to originals from Light Table master repo; I only want this (my personal branch) to address the use "X" icon to close issue. --- deploy/core/css/structure.css | 4 --- deploy/settings/default/default.behaviors | 1 - src/lt/objs/intro.cljs | 7 ---- src/lt/objs/menu.cljs | 1 - src/lt/objs/reports.cljs | 44 ----------------------- 5 files changed, 57 deletions(-) delete mode 100644 src/lt/objs/reports.cljs diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 5cf0e1508..dc7c6811a 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -296,10 +296,6 @@ body { -webkit-user-select: none; } .docs iframe { width:100%; height:100%; } .docs .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } -.reports { width:100%; height:100%; } /* TODO: Add reports to css file [3 lines] - TWM */ -.reports iframe { width:100%; height:100%; } -.reports .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } - #browser iframe { height:-webkit-calc(100% - 35px); width:100%; } #browser .frame-shade { height:-webkit-calc(100% - 35px); width:100%; background:transparent; position:absolute; display:none; } #browser input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 564cd7c93..9a80f3114 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -137,7 +137,6 @@ :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document] :document.linked [:lt.objs.document/close-linked-document] :docs [:lt.objs.docs/on-close-destroy] - :reports [:lt.objs.reports/on-close-destroy] ;; TODO: Add close tab behavior to report - TWM :docable [:lt.plugins.doc/editor.doc.show! :lt.plugins.doc/doc-menu+] :editor [:lt.objs.document/close-document-on-editor-close diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index 50bb1eed3..3b6ec630a 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -26,12 +26,6 @@ :click (fn [] (cmd/exec! :show-docs))) -(defui reports [] ;; TODO: Added report button to click - TWM - [:button "GitHub"] - :click (fn [] - (cmd/exec! :show-reports))) - - (defui changelog [] [:button "changelog"] :click (fn [] @@ -47,7 +41,6 @@ [:img {:height 40 :src (bound style/styles ->lt-image)}]] [:p "Welcome to the latest version of Light Table. To see the full list of what's been added/changed, checkout the " (changelog) ". Some of the highlights include deeper Javascript support, inline browsers, and Python eval! If you're new, you might want to take a look at " (docs) "to get started."] - [:p "If you run into any problems, report the issue on " (reports) "!"] ;; TODO: Added button to click for reporting issue - TWM ])) (behavior ::show-intro diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index dd7cc9678..7cf764dff 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -155,7 +155,6 @@ (cmd-item "Maximize" :window.maximize) (cmd-item "Fullscreen" :window.fullscreen)]} {:label "Help" :submenu [(cmd-item "Documentation" :show-docs) - (cmd-item "Report an Issue" :show-reports) ;; TODO: Add report an issue on GitHub menu item - TWM (when-not (platform/mac?) (cmd-item "About Light Table" :version))]} ])) diff --git a/src/lt/objs/reports.cljs b/src/lt/objs/reports.cljs deleted file mode 100644 index d0c29b73b..000000000 --- a/src/lt/objs/reports.cljs +++ /dev/null @@ -1,44 +0,0 @@ -;; File created by Tyrieke Morton - TWM - -(ns lt.objs.reports - (:require [lt.object :as object] - [lt.objs.command :as cmd] - [lt.objs.tabs :as tabs]) - (:require-macros [lt.macros :refer [behavior]])) - -;;********************************************************* -;; Object -;;********************************************************* - -(object/object* ::reports - :tags #{:reports} - :name "Report Issue" - :init (fn [this] - [:div.reports - [:div.frame-shade] - [:iframe {:src "https://github.com/LightTable/LightTable/issues/new" :nwdisable "true" :nwfaketop "true"}]])) - -;;********************************************************* -;; Behaviors -;;********************************************************* - -(behavior ::on-close-destroy - :triggers #{:close} - :reaction (fn [this] - (when-let [ts (:lt.objs.tabs/tabset @this)] - (when (= (count (:objs @ts)) 1) - (tabs/rem-tabset ts))) - (object/raise this :destroy))) - -;;********************************************************* -;; Commands -;;********************************************************* - -(cmd/command {:command :show-reports - :desc "Reports: Report an Issue" - :exec (fn [] - (let [reports (object/create ::reports) - ts (tabs/spawn-tabset)] - (tabs/equalize-tabset-widths) - (tabs/add! reports ts) - (tabs/active! reports)))}) From b3cdcef33570b777ebb9ecaafbe539a083de1763 Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Thu, 20 Feb 2014 11:20:29 -0500 Subject: [PATCH 067/656] Changed the URL which the Report Bug button takes the user to. Users will now be taken to the Light Table issues page instead of a new page for creating the issue. This is done to prevent duplicatoin of bugs. --- src/lt/objs/reports.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/reports.cljs b/src/lt/objs/reports.cljs index d0c29b73b..a78ed2873 100644 --- a/src/lt/objs/reports.cljs +++ b/src/lt/objs/reports.cljs @@ -16,7 +16,7 @@ :init (fn [this] [:div.reports [:div.frame-shade] - [:iframe {:src "https://github.com/LightTable/LightTable/issues/new" :nwdisable "true" :nwfaketop "true"}]])) + [:iframe {:src "https://github.com/LightTable/LightTable/issues?state=open" :nwdisable "true" :nwfaketop "true"}]])) ;;********************************************************* ;; Behaviors From 21dffbe03dae88ca450e74248796c8ac4d7b34b5 Mon Sep 17 00:00:00 2001 From: nickgieschen Date: Sat, 22 Feb 2014 21:42:32 -0500 Subject: [PATCH 068/656] rewrite sourceMappingURL with full path so source maps can be found for 3rd party plugins --- src/lt/util/load.cljs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 294d9ba27..55086406a 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -8,14 +8,30 @@ (def ^:dynamic *force-reload* false) +(def fpath (js/require "path")) + +(def separator (.-sep fpath)) + (defn absolute? [path] (boolean (re-seq #"^\s*[\\\/]|([\w]+:[\\\/])" path))) (defn node-module [path] (js/require (str pwd "/core/node_modules/" path))) +(defn- abs-source-mapping-url [code file] + (if-let [path-to-source-map (second (re-find #"\n//# sourceMappingURL=(.*)" code))] + (if-not (absolute? path-to-source-map) + (let [abs-path-to-source-map (->> path-to-source-map + (string/replace-first file (re-pattern (str "[^" separator "]*$"))) + js/encodeURI)] + (string/replace-first code #"\n//# sourceMappingURL=.*" (str "\n//# sourceMappingURL=" abs-path-to-source-map))) + code) + code)) + (defn- prep [code file] - (str code "\n\n//# sourceURL=" file)) + (-> code + (abs-source-mapping-url file) + (str "\n\n//# sourceURL=" file))) (defn js ([file] (js file false)) From 62aff45207752fb12514101032bf88dd09c0b8a7 Mon Sep 17 00:00:00 2001 From: Piyush Srivastava Date: Sat, 22 Feb 2014 21:29:52 -0600 Subject: [PATCH 069/656] Adding a command to close all tabs --- src/lt/objs/tabs.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index c1efb8787..56d8dd0a6 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -558,6 +558,13 @@ (object/raise ts :tab.close))) )}) +(cmd/command {:command :tabs.close-all + :desc "Tab: Close all tabs" + :exec (fn [] + (let [objs (ctx/->obj :tabset)] + (doseq [obj (@objs :objs)] + (object/raise obj :close))))}) + (cmd/command {:command :tabs.goto :hidden true :desc "Tab: Goto tab # or :last" From 8a96d7f9b721f0f05c8b10df1dbbeb2c514fe293 Mon Sep 17 00:00:00 2001 From: Piyush Srivastava Date: Mon, 24 Feb 2014 13:15:02 -0600 Subject: [PATCH 070/656] Closing tabs in all tabsets with close-all --- src/lt/objs/tabs.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 56d8dd0a6..148c543c0 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -561,8 +561,8 @@ (cmd/command {:command :tabs.close-all :desc "Tab: Close all tabs" :exec (fn [] - (let [objs (ctx/->obj :tabset)] - (doseq [obj (@objs :objs)] + (let [objs (object/by-tag :tabset.tab)] + (doseq [obj objs] (object/raise obj :close))))}) (cmd/command {:command :tabs.goto From f6219028383b775b380853b3d11ba1c04646baaf Mon Sep 17 00:00:00 2001 From: statesside Date: Mon, 24 Feb 2014 14:47:48 -0500 Subject: [PATCH 071/656] Updated pull request #1291 added the link to the Windows installer --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf558c3f4..48649b0f9 100755 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ First install or update [leiningen](http://leiningen.org/). 3. Set it to be an executable (chmod a+x ~/bin/lein). 4. Run the Lein script (eg. "./lein" or "sh lein") without quotes. -You can check your package manager. However, be sure you get version 2.x. Windows users can use this installer. +You can check your package manager. However, be sure you get version 2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). Then we have to do some juggling (unless you fancy building node-webkit from source). From 774e9c72ca18ea4e5c719ae21d945ed9f96b0a23 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 24 Feb 2014 12:19:29 -0800 Subject: [PATCH 072/656] make the close tab button look nice Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 6 ++++-- deploy/core/css/structure.css | 6 ++++++ src/lt/objs/tabs.cljs | 9 +++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index aa94650c4..63113cccf 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -108,12 +108,14 @@ input { color: var(highlight-fg); background:var(highlight-bg); } #multi-container { background: var(bg); } #multi .list { background:transparent; } -#multi .list li { box-sizing:border-box; height:29px;} +#multi .list li { box-sizing:border-box; height:29px; } #multi .list .active, #multi .list li:hover { background:var(multi); color:var(highlight-fg); } #multi .list .dirty { color:var(accent-foreground); } -#multi .list .dirty:after { content: "*"; } +#multi .list .dirty .file-name:after { content: "*"; } #multi .list.dragging li { background:transparent !important; } #multi .dirty.ui-sortable-placeholder:after { content:"" !important; } +#multi .list .tab-close { background:rgba(125,125,125, 0.7); color:var(fg); } +#multi .tab-close:hover { background:var(error-bg); color:var(error-fg); } #multi .tabset + .tabset { border-left:2px solid var(bg); } #bottombar .content { background:var(bg); border-top:0px solid var(border); } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index dc7c6811a..47e27e2e0 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -71,6 +71,11 @@ body { -webkit-user-select: none; } #multi .list ul { height:36px; width:auto; white-space:nowrap; } #multi .list li { float:none; overflow:hidden; border-radius:0px; border-top-left-radius:0; border-top-right-radius:0; vertical-align:top; height:29px; box-sizing:border-box; display:inline-block; padding:5px 10px; cursor:default; } +#multi .list span { display:inline-block; vertical-align:middle; } + +#multi .list .tab-close { width:0; overflow:hidden; box-sizing:border-box; margin-left:5px; border-radius:2px; } +#multi li:hover .tab-close { width:17px; padding:0 5px; } + #multi .content { left:0px; right:10px; position:absolute; top:36px; bottom:0; padding-left:10px; white-space:normal;} #multi .content > * { width:100%; height:100%; box-sizing:border-box; } @@ -377,6 +382,7 @@ body { -webkit-user-select: none; } .animated #side { -webkit-transition:width 0.1s ease-in-out; } .animated #right-bar { -webkit-transition:width 0.10s ease-in-out; } .animated #find-bar { -webkit-transition:height 0.1s ease-in-out;} +.animated #multi .tab-close { -webkit-transition:width 0.2s ease-in-out, padding 0.2s ease-in-out; } .dragging .frame-shade { display:block !important; } diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 03a80f54f..a8a3c625e 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -105,8 +105,8 @@ (str c (when (:dirty @e) " dirty"))) -(defui close-tab [obj] ;; TODO: Create x button - TWM - [:button "x"] +(defui close-tab [obj] + [:span.tab-close "x"] :click (fn [] (object/raise obj :close))) (defui item [multi e pos] @@ -117,8 +117,9 @@ :title (->path e) :obj-id (object/->id e) :pos pos} - (close-tab e) ;; TODO: Add 'x' button next to file name - TWM - (->name e)] + [:span.file-name + (->name e)] + (close-tab e)] :click (fn [ev] (if (or (= 1 (.-button ev)) (.-metaKey ev)) (object/raise e :close) From 09eb5ad928252c248c4546cb915ef24c4f6a3834 Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Tue, 25 Feb 2014 12:32:52 -0500 Subject: [PATCH 073/656] Changed implementation of Reporting Issue. The GitHub site is now opened in a new browser tab; this allows use of browser functions (eg. back and forward functions). --- deploy/core/css/structure.css | 9 ++--- deploy/settings/default/default.behaviors | 16 ++++++++- src/lt/objs/browser.cljs | 34 ++++++++++++++++++ src/lt/objs/intro.cljs | 2 +- src/lt/objs/menu.cljs | 2 +- src/lt/objs/reports.cljs | 44 ----------------------- 6 files changed, 56 insertions(+), 51 deletions(-) delete mode 100644 src/lt/objs/reports.cljs diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 5cf0e1508..f280d8ce2 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -296,15 +296,16 @@ body { -webkit-user-select: none; } .docs iframe { width:100%; height:100%; } .docs .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } -.reports { width:100%; height:100%; } /* TODO: Add reports to css file [3 lines] - TWM */ -.reports iframe { width:100%; height:100%; } -.reports .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } - #browser iframe { height:-webkit-calc(100% - 35px); width:100%; } #browser .frame-shade { height:-webkit-calc(100% - 35px); width:100%; background:transparent; position:absolute; display:none; } #browser input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} #browser button { width:20px; height:26px; padding:4px 5px; box-sizing:border-box; border-radius:0px; vertical-align:middle; } +#browseReport iframe { height:-webkit-calc(100% - 35px); width:100%; } +#browseReport .frame-shade { height:-webkit-calc(100% - 35px); width:100%; background:transparent; position:absolute; display:none; } +#browseReport input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} +#browseReport button { width:20px; height:26px; padding:4px 5px; box-sizing:border-box; border-radius:0px; vertical-align:middle; } + #side .tab-settings .filter-list { position:relative; } #side .tab-settings .filter-list ul {height: 100px; overflow:auto; display:none; position:absolute; top:35px; width:100%; z-index:10; border-radius:2px; padding:5px 0px; box-sizing:border-box;} #side .tab-settings .filter-list li { padding:0 10px; border-radius:2px; } diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 564cd7c93..702971b6c 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -112,6 +112,21 @@ :lt.objs.browser/menu! :lt.objs.browser/menu+ :lt.objs.browser/back!] + :browseReport [:lt.objs.browser/forward! :lt.objs.browser/init! + :lt.objs.browser/destroy-on-close :lt.objs.browser/focus! + :lt.objs.browser/url-focus! + :lt.objs.browser/focus-on-show + :lt.objs.browser/set-client-name :lt.objs.browser/rem-client + :lt.objs.browser/store-history :lt.objs.browser/refresh! + :lt.objs.browser/set-active :lt.objs.browser/navigate! + :lt.objs.browser/active-context + :lt.objs.browser/inactive-context + :lt.objs.browser/window-load-click-handler + :lt.objs.browser/window-load-key-handler + :lt.objs.browser/window-load-lttools + :lt.objs.browser/menu! + :lt.objs.browser/menu+ + :lt.objs.browser/back!] :client [:lt.objs.clients/on-connect-drain :lt.objs.clients/queue! :lt.objs.clients/try-send] :client.local [:lt.objs.clients.local/send!] @@ -137,7 +152,6 @@ :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document] :document.linked [:lt.objs.document/close-linked-document] :docs [:lt.objs.docs/on-close-destroy] - :reports [:lt.objs.reports/on-close-destroy] ;; TODO: Add close tab behavior to report - TWM :docable [:lt.plugins.doc/editor.doc.show! :lt.plugins.doc/doc-menu+] :editor [:lt.objs.document/close-document-on-editor-close diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 5aa92443c..3a2cb167f 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -97,6 +97,11 @@ (tabs/active! browser) browser)) +(defn add-reports [] ;; TODO: Add add function for report browser - TWM + (let [browser (object/create ::browseReport)] + (tabs/add! browser) + (tabs/active! browser) + browser)) ;;********************************************************* ;; Object @@ -121,6 +126,26 @@ (refresh this)] ])) +(object/object* ::browseReport ;; TODO: Create report browswer object - TWM + :name "Browser" + :tags #{:browseReport} + :history [] + :history-pos -1 + :url "https://github.com/LightTable/LightTable/issues?state=open" + :urlvalue "https://github.com/LightTable/LightTable/issues?state=open" + :init (fn [this] + (object/merge! this {:client (connect-client this)}) + [:div#browseReport + [:div.frame-shade] + (iframe this) + [:nav + (backward this) + (forward this) + (url-bar this) + (refresh this)] + ])) + + ;;********************************************************* ;; Behaviors ;;********************************************************* @@ -485,6 +510,14 @@ (object/raise b :focus!) (object/raise b :navigate! loc))))}) +(cmd/command {:command :add-report-tab ;; TODO: add command to create browser tab - TWM + :desc "Browser: Report an Issue on GitHub" + :exec (fn [loc] + (let [b (add-reports)] + (if-not loc + (object/raise b :focus!) + (object/raise b :navigate! loc))))}) + (cmd/command {:command :refresh-connected-browser :desc "Browser: refresh active browser tab" :exec (fn [] @@ -502,6 +535,7 @@ (cmd/exec! :add-browser-tab)) (object/raise (ctx/->obj :global.browser) :navigate! (str "file://" (-> @ed :info :path))))))}) + ;;********************************************************* ;; Misc ;;********************************************************* diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index 50bb1eed3..ed5802265 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -29,7 +29,7 @@ (defui reports [] ;; TODO: Added report button to click - TWM [:button "GitHub"] :click (fn [] - (cmd/exec! :show-reports))) + (cmd/exec! :add-report-tab))) (defui changelog [] diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index dd7cc9678..67eb4ab51 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -155,7 +155,7 @@ (cmd-item "Maximize" :window.maximize) (cmd-item "Fullscreen" :window.fullscreen)]} {:label "Help" :submenu [(cmd-item "Documentation" :show-docs) - (cmd-item "Report an Issue" :show-reports) ;; TODO: Add report an issue on GitHub menu item - TWM + (cmd-item "Report an Issue" :add-report-tab) ;; TODO: Add report an issue on GitHub menu item - TWM (when-not (platform/mac?) (cmd-item "About Light Table" :version))]} ])) diff --git a/src/lt/objs/reports.cljs b/src/lt/objs/reports.cljs deleted file mode 100644 index a78ed2873..000000000 --- a/src/lt/objs/reports.cljs +++ /dev/null @@ -1,44 +0,0 @@ -;; File created by Tyrieke Morton - TWM - -(ns lt.objs.reports - (:require [lt.object :as object] - [lt.objs.command :as cmd] - [lt.objs.tabs :as tabs]) - (:require-macros [lt.macros :refer [behavior]])) - -;;********************************************************* -;; Object -;;********************************************************* - -(object/object* ::reports - :tags #{:reports} - :name "Report Issue" - :init (fn [this] - [:div.reports - [:div.frame-shade] - [:iframe {:src "https://github.com/LightTable/LightTable/issues?state=open" :nwdisable "true" :nwfaketop "true"}]])) - -;;********************************************************* -;; Behaviors -;;********************************************************* - -(behavior ::on-close-destroy - :triggers #{:close} - :reaction (fn [this] - (when-let [ts (:lt.objs.tabs/tabset @this)] - (when (= (count (:objs @ts)) 1) - (tabs/rem-tabset ts))) - (object/raise this :destroy))) - -;;********************************************************* -;; Commands -;;********************************************************* - -(cmd/command {:command :show-reports - :desc "Reports: Report an Issue" - :exec (fn [] - (let [reports (object/create ::reports) - ts (tabs/spawn-tabset)] - (tabs/equalize-tabset-widths) - (tabs/add! reports ts) - (tabs/active! reports)))}) From d6c1e1d5a81036db4d0f007e4ff04e0bb0f122d9 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 27 Feb 2014 09:42:06 -0800 Subject: [PATCH 074/656] don't let the mac menu only partially pick up keyboard shortcuts Signed-off-by: Chris Granger --- src/lt/objs/menu.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 7cf764dff..b0b157c59 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -83,8 +83,9 @@ (defn command->menu-binding [cmd] (let [ks (first (keyboard/cmd->current-binding cmd)) + multi-part? (next (string/split ks " ")) ks (string/split ks "-")] - (when (seq ks) + (when (and (seq ks) (not multi-part?)) {:key (if (= "space" (last ks)) " " (last ks)) From 4125c009c436116f20e8071fb14e89ba353cd400 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Fri, 28 Feb 2014 16:41:17 +1100 Subject: [PATCH 075/656] Change cursor to pointer for plugin install / uninstall / update --- deploy/core/css/skins/new-dark.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 63113cccf..c32c1d7b0 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -279,9 +279,9 @@ input { color: var(highlight-fg); background:var(highlight-bg); } .plugin-manager .tabs { margin-bottom:15px; display:flex; -webkit-flex-direction:row; -webkit-align-items:stretch; height:30px; width:100%; } .plugin-manager input {background: var(highlight-bg); -webkit-flex:1; } .plugin-manager button {background: var(highlight-bg); } -.plugin-manager .install { box-sizing:border-box; color:var(secondary-accent-bg); background:var(secondary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; } -.plugin-manager .uninstall { box-sizing:border-box; color:var(tertiary-accent-bg); background:var(tertiary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; } -.plugin-manager .update { box-sizing:border-box; background:var(error-fg); display:inline-block; height:25px; position:absolute; right:0; top:50px; width:5px; -webkit-transition:width 0.1s ease-in-out; } +.plugin-manager .install { box-sizing:border-box; color:var(secondary-accent-bg); background:var(secondary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} +.plugin-manager .uninstall { box-sizing:border-box; color:var(tertiary-accent-bg); background:var(tertiary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} +.plugin-manager .update { box-sizing:border-box; background:var(error-fg); display:inline-block; height:25px; position:absolute; right:0; top:50px; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} .plugin-manager li:hover .update { width:70px; overflow:hidden; } .plugin-manager li:hover .update:before { color:var(error-bg); padding:4px 8px; display:inline-block; content: "update"; } .plugin-manager li:hover .uninstall { width:70px; overflow:hidden; } From 0584277e603b7225a22c54fb625c2fc4647db313 Mon Sep 17 00:00:00 2001 From: snufkon Date: Sun, 2 Mar 2014 17:34:33 +0900 Subject: [PATCH 076/656] Adding a command to close tabs except current tab --- src/lt/objs/tabs.cljs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index b91bd0ad9..c358e44f5 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -571,6 +571,15 @@ (doseq [obj objs] (object/raise obj :close))))}) +(cmd/command {:command :tabs.close-others + :desc "Tab: Close tabs except current tab" + :exec (fn [] + (let [cur (active-tab) + objs (object/by-tag :tabset.tab)] + (doseq [obj objs] + (if-not (identical? cur obj) + (object/raise obj :close)))))}) + (cmd/command {:command :tabs.goto :hidden true :desc "Tab: Goto tab # or :last" From 16c5d5fee0c747f2f6a602b46f950757daa0745b Mon Sep 17 00:00:00 2001 From: Santiago Pelufo Date: Sun, 2 Mar 2014 23:57:50 -0200 Subject: [PATCH 077/656] Prevent opening multiple console tabs. --- src/lt/objs/console.cljs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 62f7e9630..f3c0577b5 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -182,9 +182,10 @@ (cmd/command {:command :console-tab :desc "Console: Open the console in a tab" :exec (fn [] - (object/merge! console {:current-ui :tab}) - (tabs/add! console) - )}) + (when (not= :tab (:current-ui @console)) ; Running the command when tab is already opened in a tab was creating another new tab each time. + (object/merge! console {:current-ui :tab}) + (tabs/add! console) + ))}) (cmd/command {:command :toggle-console :desc "Console: Toggle console" From 0692650f6f2f761648e1dd055b52bfbb18dd772f Mon Sep 17 00:00:00 2001 From: Irakli Gozalishvili Date: Mon, 3 Mar 2014 11:37:55 -0800 Subject: [PATCH 078/656] Add a `trigger` to args of an `:object.behavior.time` event. --- src/lt/object.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index c1e977fef..ebf214bdb 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -179,7 +179,7 @@ (binding [*behavior-meta* meta] (apply func obj args)) (when-not (= trigger :object.behavior.time) - (raise obj :object.behavior.time r time))) + (raise obj :object.behavior.time r time trigger))) (catch js/Error e (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) (safe-report-error e) @@ -376,6 +376,8 @@ (behavior ::report-time :triggers #{:object.behavior.time} - :reaction (fn [this beh time] + :reaction (fn [this beh time trigger] (when js/lt.objs.console - (js/lt.objs.console.log (str beh " took " time "ms"))))) + (js/lt.objs.console.log (str beh " triggered by " + trigger " took " + time "ms"))))) From e4ce69098bfd9f45a24e35d6ce953fe1dc0a2d95 Mon Sep 17 00:00:00 2001 From: snufkon Date: Wed, 5 Mar 2014 14:48:39 +0900 Subject: [PATCH 079/656] Adding a command to move tab to new tabset --- src/lt/objs/tabs.cljs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index b91bd0ad9..6c4f5f1da 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -521,6 +521,19 @@ (append (object/->content canvas/canvas) (:content @multi)) +(defn move-tab-to-tabset [obj ts] + (rem! obj) + (add! obj ts) + (active! obj)) + +(cmd/command {:command :tabs.move-new-tabset + :desc "Tab: Move tab to new tabset" + :exec (fn [] + (when-let [ts (ctx/->obj :tabset)] + (when-let [cur (@ts :active-obj)] + (let [new (cmd/exec! :tabset.new)] + (move-tab-to-tabset cur new)))))}) + (cmd/command {:command :tabs.move-next-tabset :desc "Tab: Move tab to next tabset" :exec (fn [] @@ -528,9 +541,7 @@ (let [cur (@ts :active-obj) next (or (next-tabset ts) (prev-tabset ts))] (when (and cur next (not= next ts)) - (rem! cur) - (add! cur next) - (active! cur)))))}) + (move-tab-to-tabset cur next)))))}) (cmd/command {:command :tabs.move-prev-tabset :desc "Tab: Move tab to previous tabset" @@ -539,9 +550,7 @@ (let [cur (@ts :active-obj) next (or (prev-tabset ts) (next-tabset ts))] (when (and cur next (not= next ts)) - (rem! cur) - (add! cur next) - (active! cur)))))}) + (move-tab-to-tabset cur next)))))}) (cmd/command {:command :tabs.next :desc "Tab: Next tab" @@ -605,8 +614,9 @@ (cmd/command {:command :tabset.new :desc "Tabset: Add a tabset" :exec (fn [] - (spawn-tabset) - (equalize-tabset-widths))}) + (let [ts (spawn-tabset)] + (equalize-tabset-widths) + ts))}) (cmd/command {:command :tabs.focus-active :desc "Tab: focus active" From 1c2233de3fb00b11d1f4d67540d3eb6a3f652fe8 Mon Sep 17 00:00:00 2001 From: snufkon Date: Wed, 5 Mar 2014 15:03:03 +0900 Subject: [PATCH 080/656] Adding a menu item to move tab to new tabset --- src/lt/objs/tabs.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 6c4f5f1da..f98aef8b9 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -456,7 +456,9 @@ (object/raise to-ts :active)))) (defn menu! [obj ev] - (-> (menu/menu [{:label "Close tab" + (-> (menu/menu [{:label "Move tab to new tabset" + :click (fn [] (cmd/exec! :tabs.move-new-tabset))} + {:label "Close tab" :click (fn [] (object/raise obj :close))}]) (menu/show-menu (.-clientX ev) (.-clientY ev)))) From a2faae5120272712c0fe2dfc054eecd990a19898 Mon Sep 17 00:00:00 2001 From: ndr Date: Wed, 5 Mar 2014 09:57:12 +0100 Subject: [PATCH 081/656] Add ellipsis to truncated results --- src/lt/objs/eval.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 5f3534c55..a62386255 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -168,7 +168,7 @@ nl (:trunc-length opts 50))] (if (> (count r) len) - (subs r 0 len) + (str (subs r 0 len) " …") r)))) (defui ->inline-res [this info] From 96093e885a94a590b680a8f6288c66011418f245 Mon Sep 17 00:00:00 2001 From: ndr Date: Wed, 5 Mar 2014 17:34:53 +0100 Subject: [PATCH 082/656] Add setting for number of files indexed by the navigator User may add `(:lt.objs.sidebar.navigate/set-file-limit n)`, with n integer, to customize the maximum number of workspace files that will be indexed by the navigator for each top workspace folder. Defaults to 8000. --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/sidebar/navigate.cljs | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d491270ab..c4634eb3c 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -307,7 +307,8 @@ :navigate.selector [:lt.objs.sidebar.navigate/escape! :lt.objs.sidebar.navigate/pop-transient-on-select :lt.objs.sidebar.navigate/open-on-select] - :navigator [:lt.objs.sidebar.navigate/focus! :lt.objs.sidebar.navigate/focus-on-show :lt.objs.sidebar.navigate/workspace-files] + :navigator [:lt.objs.sidebar.navigate/focus! :lt.objs.sidebar.navigate/focus-on-show :lt.objs.sidebar.navigate/workspace-files + (:lt.objs.sidebar.navigate/set-file-limit 8000)] :object [:lt.objs.clients/on-destroy-remove-cb] :opener [:lt.objs.opener/open-from-info :lt.objs.opener/open-transient-editor :lt.objs.opener/open-standard-editor diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index bfa5db2f5..5e8f3369d 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -24,14 +24,14 @@ fs (map #(do {:full % :rel (files/basename %)}) (:files ws))] (vec (filter #(files/file? (:full %)) (remove #(-> % :rel file-filters) (concat files fs)))))) -(def populate-bg (background (fn [obj-id {:keys [ws pattern]}] +(def populate-bg (background (fn [obj-id {:keys [lim pattern ws]}] (let [fs (js/require "fs") fpath (js/require "path") walkdir (js/require (str js/ltpath "/core/node_modules/lighttable/background/walkdir2.js")) grab-files (fn [all-files folder] (let [root-length (inc (count (.dirname fpath folder))) walked (walkdir folder (js-obj "filter" (js/RegExp. pattern) - "limit" 8000))] + "limit" lim))] (.concat all-files (.map (.-paths walked) #(js-obj "full" % "rel" (subs % root-length)))))) @@ -52,7 +52,8 @@ :triggers #{:updated :refresh} :debounce 150 :reaction (fn [ws] - (populate-bg sidebar-navigate {:pattern (.-source files/ignore-pattern) + (populate-bg sidebar-navigate {:lim (dec (:file-limit @sidebar-navigate)) + :pattern (.-source files/ignore-pattern) :ws (workspace/serialize @ws)}))) (behavior ::watched.create @@ -98,12 +99,22 @@ :reaction (fn [this] (object/raise sidebar/rightbar :close!))) +(behavior ::set-file-limit + :triggers #{:object.instant} + :type :user + :desc "Navigate: set maximum number of indexed files" + :params [{:label "Number" + :example 8000}] + :reaction (fn [this n] + (object/merge! this {:file-limit n}))) + (object/object* ::sidebar.navigate :tags #{:navigator} :label "navigate" :order -3 :selected 0 :files [] + :file-limit 8000 :search "" :init (fn [this] (let [list (cmd/filter-list {:key :rel From 647d59e598bcf30173681aab463b08c85dd3da87 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 5 Mar 2014 19:13:18 -0500 Subject: [PATCH 083/656] fix last remaining references to light-table-core --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9309fc144..c234aac30 100755 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ After the initial setup, you can compile the ClojureScript source at any time wi I'll assume you already know how to eval code (ctrl-enter), how to open the command bar (ctrl-space) and how to open files with the navigator (ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). -Add `light-table-core/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. +Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. @@ -134,7 +134,7 @@ If you highlight `jump-stack` and hit eval you will see the current state of the :listeners {:jump-stack.push! [:lt.objs.jump-stack/jump-stack.push], :jump-stack.pop! [:lt.objs.jump-stack/jump-stack.pop], :destroy [:lt.objs.clients/on-destroy-remove-cb]}, - :stack [["/home/jamie/light-table-core/src/lt/objs/jump_stack.cljs" {:line 48, :ch 48}]]} + :stack [["/home/jamie/LightTable/src/lt/objs/jump_stack.cljs" {:line 48, :ch 48}]]} ``` The most interesting keys here are `:stack`, which was added in the template and is used to store the file/pos stack, and `:listeners`, which maps triggers to behaviors. If we were to eval something like `(lt.object/raise jump-stack :jump-stack.push! editor file pos)` then the behavior `lt.objs.jump-stack/jump-stack.push` would be called with arguments `[editor file pos]`. From 80ac532b88d9bcc8732732ff904e2c8fcf52b8bf Mon Sep 17 00:00:00 2001 From: Patrick Connelly Date: Wed, 5 Mar 2014 21:34:30 -0500 Subject: [PATCH 084/656] add common lisp .lisp file extension --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c4634eb3c..49acef7da 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -228,7 +228,7 @@ {:name "C++ Header" :exts [:h] :mime "text/x-c++hdr" :tags [:editor.cpph]} {:name "C#" :exts [:cs] :mime "text/x-csharpr" :tags [:editor.csharp]} {:name "CoffeeScript" :exts [:coffee] :mime "text/x-coffeescript" :tags [:editor.coffee]} - {:name "Common Lisp" :exts [:cl] :mime "text/x-common-lisp" :tags [:editor.common-lisp]} + {:name "Common Lisp" :exts [:cl :lisp] :mime "text/x-common-lisp" :tags [:editor.common-lisp]} {:name "Diff" :exts [:diff :patch] :mime "text/x-diff" :tags [:editor.diff]} {:name "EDN" :exts [:edn] :mime "text/x-clojure" :tags [:editor.clj :editor.edn]} {:name "Erlang" :exts [:erl] :mime "text/x-erlang" :tags [:editor.erlang]} From 873ea2b7f07f1270fbdb833725da0b7f02a1063f Mon Sep 17 00:00:00 2001 From: Curtis Rasmussen Date: Thu, 6 Mar 2014 19:51:17 -0500 Subject: [PATCH 085/656] focussing url bar highlights url --- src/lt/objs/browser.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 5aa92443c..3dae012d4 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -168,7 +168,9 @@ (behavior ::url-focus! :triggers #{:url.focus!} :reaction (fn [this] - (dom/focus (dom/$ :input (object/->content this))))) + (let [url-input (dom/$ :input (object/->content this))] + (dom/focus url-input) + (.select url-input)))) (behavior ::focus! :triggers #{:focus!} From bf054b892f54787e36587ee158a207921969d0f5 Mon Sep 17 00:00:00 2001 From: snufkon Date: Fri, 7 Mar 2014 14:45:54 +0900 Subject: [PATCH 086/656] add default input to searcher --- src/lt/objs/search.cljs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index a2d01a603..0c89ab116 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -14,7 +14,9 @@ [crate.binding :refer [computed bound]] [lt.util.js :refer [wait now]] [lt.util.load :as load] - [clojure.string :as string]) + [clojure.string :as string] + [lt.objs.editor :as editor] + [lt.objs.editor.pool :as pool]) (:require-macros [lt.macros :refer [behavior defui extract foreach background]])) (def search! (background (fn [obj-id opts] @@ -246,6 +248,11 @@ (cmd/command {:command :searcher.show :desc "Searcher: Show" :exec (fn [] + (when-let [e (pool/last-active)] + (when-let [sel (editor/selection e)] + (when-not (string/blank? sel) + (let [search (dom/$ :.search (object/->content searcher))] + (dom/val search sel))))) (tabs/add-or-focus! searcher))}) (cmd/command {:command :searcher.next From a7ec88bf78dd107588aa8e01593abe32a30e6a0a Mon Sep 17 00:00:00 2001 From: Piyush Srivastava Date: Mon, 10 Mar 2014 10:03:56 -0500 Subject: [PATCH 087/656] Adding a set-line function to editor.cljs --- src/lt/objs/editor.cljs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 343d4f75e..c97f4718d 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -289,6 +289,9 @@ (defn line [e l] (.getLine (->cm-ed e) l)) +(defn set-line [e l text] + (.setLine (->cm-ed e) l text)) + (defn first-line [e] (.firstLine (->cm-ed e))) From 4134a91ff999499e068e3bba53a2da159f39b036 Mon Sep 17 00:00:00 2001 From: ndr Date: Tue, 4 Mar 2014 00:40:29 +0100 Subject: [PATCH 088/656] Add command to update all outdated plugins Command `:plugin-manager.update-outdated`. Behaviors are reloaded only after the install process for the last plugin is completed; the user is also notified of what has been updated. Caveat: notifos events from `:behaviors.reload` may override the update list notification. --- src/lt/objs/plugins.cljs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 84b393d37..9ad387926 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -173,6 +173,10 @@ (install-missing missing?))}]})) final)) +(defn outdated? [plugin] + (let [cached (-> @manager :version-cache (get (:name plugin)))] + (if cached + (deploy/is-newer? (:version plugin) cached)))) (defn plugin-behaviors [plug] (let [{:keys [behaviors dir]} plug @@ -553,6 +557,26 @@ (tabs/add-or-focus! manager) (cmd/exec! :plugin-manager.refresh))}) +(cmd/command {:command :plugin-manager.update-outdated + :desc "Plugins: Update all outdated" + :exec (fn [] + (let [outdated (filter outdated? (->> @app/app ::plugins vals)) + names (atom #{}) + countdown (atom (count outdated))] + (doseq [plugin outdated + :when (seq outdated) + :let [cached (-> @manager :version-cache (get (:name plugin)))]] + (discover-deps (assoc plugin :version cached) + (fn [] + (swap! names conj (:name plugin)) + (swap! countdown dec) + (object/raise manager :refresh!) + (when (<= @countdown 0) + (cmd/exec! :behaviors.reload) + (notifos/set-msg! (apply str "Updated: " + (interpose ", " @names)))))))))}) + + ;;********************************************************* ;; App-level plugin behaviors ;;********************************************************* From 403892257e0a77d923dd3b79524eca29b9355d78 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 11 Mar 2014 10:53:17 -0700 Subject: [PATCH 089/656] fix #1357, move the selected tab not just the active one Signed-off-by: Chris Granger --- src/lt/objs/tabs.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 237acc7e0..ef3be7ebe 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -457,7 +457,7 @@ (defn menu! [obj ev] (-> (menu/menu [{:label "Move tab to new tabset" - :click (fn [] (cmd/exec! :tabs.move-new-tabset))} + :click (fn [] (cmd/exec! :tabs.move-new-tabset obj))} {:label "Close tab" :click (fn [] (object/raise obj :close))}]) (menu/show-menu (.-clientX ev) (.-clientY ev)))) @@ -530,9 +530,9 @@ (cmd/command {:command :tabs.move-new-tabset :desc "Tab: Move tab to new tabset" - :exec (fn [] + :exec (fn [tab] (when-let [ts (ctx/->obj :tabset)] - (when-let [cur (@ts :active-obj)] + (when-let [cur (or tab (@ts :active-obj))] (let [new (cmd/exec! :tabset.new)] (move-tab-to-tabset cur new)))))}) From 6a36c85b7eda563e86af45891d6ab91ca8dff230 Mon Sep 17 00:00:00 2001 From: ndr Date: Sun, 9 Mar 2014 08:14:25 +0100 Subject: [PATCH 090/656] Add function to assoc-in objects Defines `lt.object/assoc-in!`, a function that allows the caller to `assoc-in` objects conforming to the BOT model. The function takes an object, a sequence of keys, and the value to be set. If the key already exists in the nested associative structure described by the sequence, its value is reset; if it doesn't, the new key-value pair is created, fully reproducing the sequence as hash-maps if necessary. Useful to update and create deeply-nested keyvals in a concise fashion, i.e. without passing full maps as required by `object/merge!`. --- src/lt/object.cljs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index c1e977fef..7246f1983 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -220,6 +220,11 @@ (defn update! [obj & r] (swap! obj #(apply update-in % r))) +(defn assoc-in! [obj k v] + (when (and k (not (sequential? k))) + (throw (js/Error. (str "Associate requires a sequence of keys: " k)))) + (swap! obj #(assoc-in % k v))) + (defn ->id [obj] (if (deref? obj) (::id @obj) From abf22ea21e161ca09b5b54e8d677de5706765823 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 11 Mar 2014 12:39:25 -0700 Subject: [PATCH 091/656] add explicit console.show and console.hide commands, when opening the console in a tab, close the bottombar #1327 Signed-off-by: Chris Granger --- deploy/settings/default/default.behaviors | 10 +++++- src/lt/objs/bottombar.cljs | 27 +++++++++++------ src/lt/objs/console.cljs | 37 +++++++++++++++++++++-- 3 files changed, 61 insertions(+), 13 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 49acef7da..bb34d7111 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -97,6 +97,12 @@ (:lt.objs.style/provide-theme "xq-light" "core/css/themes/xq-light.css") (:lt.objs.style/set-skin "dark") :lt.objs.editor/init-codemirror] + :bottombar [:lt.objs.bottombar/item-toggled + :lt.objs.bottombar/height! + :lt.objs.bottombar/no-anim-on-drag + :lt.objs.bottombar/reanim-on-drop + :lt.objs.bottombar/show-item + :lt.objs.bottombar/hide-item] :browser [:lt.objs.browser/forward! :lt.objs.browser/init! :lt.objs.browser/destroy-on-close :lt.objs.browser/focus! :lt.objs.browser/url-focus! @@ -381,7 +387,9 @@ :statusbar-container-item [:lt.objs.statusbar/on-show! :lt.objs.statusbar/on-hide! :lt.objs.statusbar/init-statusbar-container] - :statusbar.console-toggle [:lt.objs.console/statusbar-console-toggle] + :statusbar.console-toggle [:lt.objs.console/statusbar-console-toggle + :lt.objs.console/statusbar-console-hide + :lt.objs.console/statusbar-console-show] :tab-options [:lt.objs.editor.pool/focus-options] :tabs [:lt.objs.tabs/on-destroy-eds :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/tabset-bottom! diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index d8126d7d7..88a9f5913 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -43,7 +43,6 @@ (object/object* ::bottombar :tags #{:bottombar} - :behaviors [::item-toggled ::height! ::no-anim-on-drag ::reanim-on-drop] :items (sorted-map-by >) :height 0 :max-height default-height @@ -86,17 +85,27 @@ :max-height height}))) )) +(behavior ::show-item + :triggers #{:show!} + :reaction (fn [this item] + (when (or (not= item (:active @this))) + (object/merge! this {:active item + :height (:max-height @this)}) + (object/raise tabs/multi :bottom! (:max-height @this))))) + +(behavior ::hide-item + :triggers #{:hide!} + :reaction (fn [this item force?] + (when (or (= item (:active @this)) force?) + (object/raise tabs/multi :bottom! (- (:max-height @this))) + (object/merge! this {:active nil + :height 0})))) + (behavior ::item-toggled :triggers #{:toggle} :reaction (fn [this item force?] (if (or (not= item (:active @this)) force?) - (do - (object/merge! this {:active item - :height (:max-height @this)}) - (object/raise tabs/multi :bottom! (:max-height @this))) - (do - (object/raise tabs/multi :bottom! (- (:max-height @this))) - (object/merge! this {:active nil - :height 0}))))) + (object/raise this :show! item) + (object/raise this :hide! item)))) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index f3c0577b5..268762505 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -3,12 +3,10 @@ [lt.objs.app :as app] [lt.objs.files :as files] [lt.objs.bottombar :as bottombar] - [lt.objs.sidebar.command :as cmd] + [lt.objs.command :as cmd] [lt.objs.statusbar :as statusbar] [lt.objs.tabs :as tabs] - [crate.binding :refer [bound]] [clojure.string :as string] - [lt.util.js :refer [wait]] [lt.util.dom :refer [$ append empty] :as dom]) (:require-macros [crate.def-macros :refer [defpartial]] [lt.macros :refer [behavior defui]])) @@ -177,16 +175,49 @@ (statusbar/clean)) )) +(behavior ::statusbar-console-show + :triggers #{:show!} + :reaction (fn [this] + (object/raise bottombar/bottombar :show! console) + (when (bottombar/active? console) + (dom/scroll-top (object/->content console) 10000000000) + (statusbar/clean)) + )) + +(behavior ::statusbar-console-hide + :triggers #{:hide!} + :reaction (fn [this] + (object/raise bottombar/bottombar :hide! console))) + + (bottombar/add-item console) (cmd/command {:command :console-tab :desc "Console: Open the console in a tab" :exec (fn [] (when (not= :tab (:current-ui @console)) ; Running the command when tab is already opened in a tab was creating another new tab each time. + (object/raise statusbar/console-toggle :hide!) (object/merge! console {:current-ui :tab}) (tabs/add! console) ))}) + +(cmd/command {:command :console.show + :desc "Console: Show console" + :hidden true + :exec (fn [] + (if (= (:current-ui @console) :tab) + (do (tabs/active! console) (statusbar/clean)) + (object/raise statusbar/console-toggle :show!)))}) + +(cmd/command {:command :console.hide + :desc "Console: Hide console" + :hidden true + :exec (fn [] + (if (= (:current-ui @console) :tab) + (object/raise console :close) + (object/raise statusbar/console-toggle :hide!)))}) + (cmd/command {:command :toggle-console :desc "Console: Toggle console" :exec (fn [] From e2f2d1c05ea1bb56d55c20201995669e07678d9e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 14 Mar 2014 08:31:04 -0400 Subject: [PATCH 092/656] allow options to be set for line commenting --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/editor/pool.cljs | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index bb34d7111..6fb3165f8 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -221,7 +221,8 @@ :editor.pool [:lt.objs.editor.pool/add-tab-settings :lt.objs.editor.pool/options-changed :lt.objs.editor.pool/line-numbers-changed - :lt.objs.editor.pool/theme-changed] + :lt.objs.editor.pool/theme-changed + (:lt.objs.editor.pool/line-comment-options {})] :editor.read-only [:lt.objs.editor/read-only] :editor.structural [:lt.plugins.struct/rem-on-close] :editor.transient [:lt.objs.editor.file/dirty-on-change diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 4a1119926..9ae715b48 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -248,14 +248,26 @@ ;; Editor commands ;;**************************************************** +;; See https://github.com/marijnh/CodeMirror/blob/master/addon/comment/comment.js for options +(def line-comment-options {}) + +(behavior ::line-comment-options + :triggers #{:object.instant} + :type :user + :desc "Editor: Set options for line commenting" + :params [{:label "map" + :example "{:indent true}"}] + :reaction (fn [this options] + (set! line-comment-options options))) + (cmd/command {:command :comment-selection :desc "Editor: Comment line(s)" :exec (fn [] (when-let [cur (last-active)] (let [cursor (editor/->cursor cur "start")] (if (editor/selection? cur) - (editor/line-comment cur cursor (editor/->cursor cur "end")) - (editor/line-comment cur cursor cursor)))))}) + (editor/line-comment cur cursor (editor/->cursor cur "end") line-comment-options) + (editor/line-comment cur cursor cursor line-comment-options)))))}) (cmd/command {:command :uncomment-selection :desc "Editor: Uncomment line(s)" @@ -275,7 +287,7 @@ [cursor (editor/->cursor cur "end")] [cursor cursor])] (when-not (editor/uncomment cur start end) - (editor/line-comment cur cursor (editor/->cursor cur "end"))))))}) + (editor/line-comment cur cursor (editor/->cursor cur "end") line-comment-options)))))}) (cmd/command {:command :indent-selection :desc "Editor: Indent line(s)" From b21114ce8b287ec3ff04d3531808250cc3b28d61 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 15 Mar 2014 14:16:38 -0400 Subject: [PATCH 093/656] fix typo in catch argument --- src/lt/objs/eval.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index a62386255..7319d7494 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -146,7 +146,7 @@ (reader/read-string r) (catch js/Error e r) - (catch js/globa.Error e + (catch js/global.Error e r))) ;;**************************************************** From e6b16d80c82505a5ed79e479ba6ad42c86fbad91 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Mar 2014 10:17:04 -0700 Subject: [PATCH 094/656] fix replaces with '(' in them Signed-off-by: Chris Granger --- deploy/core/node_modules/codemirror/search.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deploy/core/node_modules/codemirror/search.js b/deploy/core/node_modules/codemirror/search.js index eb1898bcb..4d49ff6df 100644 --- a/deploy/core/node_modules/codemirror/search.js +++ b/deploy/core/node_modules/codemirror/search.js @@ -40,12 +40,14 @@ // Heuristic: if the query string is all lowercase, do a case insensitive search. return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase()); } + function isRegex(s) { + return s.match(/^\/(.+)\/([a-z]*)$/); + } function parseQuery(query) { var ignoreCase = query == query.toLowerCase(); - var isRE = query.match(/^\/(.+)\/([a-z]*)$/); try { var rx = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); - if(isRE && !"".match(rx)) { + if(isRegex(query) && !"".match(rx)) { return rx; } else { return query; @@ -130,7 +132,10 @@ var cursor = getSearchCursor(cm, state.query, state.posFrom); if(cursor.findNext(rev)) { cm.setSelection(cursor.from(), cursor.to()); - var match = cm.getRange(cursor.from(), cursor.to()).match(state.query); + var match = {}; + if(isRegex(state.query)) { + match = cm.getRange(cursor.from(), cursor.to()).match(state.query); + } cursor.replace(typeof state.query == "string" ? text : text.replace(/\$(\d)/, function(_, i) {return match[i];})); } From 856d21884e7b92faefcd4acea30b56975a718aa8 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Mar 2014 14:12:26 -0700 Subject: [PATCH 095/656] fix sourceMappingURL path for windows :( fixes #1375 Signed-off-by: Chris Granger --- deploy/core/version.json | 2 +- src/lt/util/load.cljs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/deploy/core/version.json b/deploy/core/version.json index 7f738181f..91f9f9bcd 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.6.4","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.6.5","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 55086406a..9f8d0c3bb 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -21,10 +21,11 @@ (defn- abs-source-mapping-url [code file] (if-let [path-to-source-map (second (re-find #"\n//# sourceMappingURL=(.*)" code))] (if-not (absolute? path-to-source-map) - (let [abs-path-to-source-map (->> path-to-source-map - (string/replace-first file (re-pattern (str "[^" separator "]*$"))) - js/encodeURI)] - (string/replace-first code #"\n//# sourceMappingURL=.*" (str "\n//# sourceMappingURL=" abs-path-to-source-map))) + (let [abs-path-to-source-map (string/replace (.join fpath (.dirname fpath file) path-to-source-map) "\\" "/") + abs-path-to-source-map (if (= separator "\\") + (str "/" abs-path-to-source-map) + abs-path-to-source-map)] + (string/replace-first code #"\n//# sourceMappingURL=.*" (str "\n//# sourceMappingURL=" (js/encodeURI abs-path-to-source-map)))) code) code)) From 4eea1b7eeafa123827e3cda4844ea988acb49d09 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Mar 2014 14:48:59 -0700 Subject: [PATCH 096/656] tab -> tabs for commands that affect tabs Signed-off-by: Chris Granger --- src/lt/objs/tabs.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index ef3be7ebe..52afddb50 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -576,14 +576,14 @@ )}) (cmd/command {:command :tabs.close-all - :desc "Tab: Close all tabs" + :desc "Tabs: Close all tabs" :exec (fn [] (let [objs (object/by-tag :tabset.tab)] (doseq [obj objs] (object/raise obj :close))))}) (cmd/command {:command :tabs.close-others - :desc "Tab: Close tabs except current tab" + :desc "Tabs: Close tabs except current tab" :exec (fn [] (let [cur (active-tab) objs (object/by-tag :tabset.tab)] From a3041c0d3008c173fed2a78c9e6e8478e58d8776 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Mar 2014 14:49:13 -0700 Subject: [PATCH 097/656] 0.6.5 changelog Signed-off-by: Chris Granger --- deploy/core/changelog.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 042a8c679..9c9787373 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,38 @@ #Changes +##0.6.5 + +* FIX: Less syntax highlighting would cause errors +* FIX: Show update button below uninstall button in the plugin manager (mark.fisher) +* FIX: better cljs errors in external browser connections +* FIX: php syntax highlighting was set incorrectly (flaviozantut) +* FIX: Evaling CSS into LT UI fails +* FIX: remove the alt-# keybindings as it screws up international keyboards +* FIX: rewrite sourceMappingURL with full path (nickgieschen) +* FIX: on OSX chorded shortcuts were being intercepted by the menus (e.g. ctrl-f) +* FIX: change cursor to pointer in the plugin manager (seancaffrey) +* FIX: prevent opening multiple console tabs (spelufo) +* FIX: add ellipsis to truncated inline results (ndr-qef) +* FIX: remove last remaining refs to light-table-core (cldwalker) +* FIX: add common lisp extension (patrickconnelly) +* FIX: focusing the url bar in the internal browser selects the url (Curtis Rasmussen) +* FIX: find/replace with '(' now works +* ADDED: `Plugins: Update all outdated` command (ndr-qef) +* ADDED: Searcher picks up your selection by default (snufkon) +* ADDED: `Navigate: set maximum number of indexed files` behavior (ndr-qef) +* ADDED: `Tab: Move tab to new tabset` command and context menu item (snufkon) +* ADDED: `Tabs: Close tabs except current tab` command (snufkon) +* ADDED: a close tab button on hover of tabs (Tyrieke Morton) +* ADDED: `Tabs: Close all tabs` command (piyushi0101) +* ADDED: Plugins now check for missing deps on startup allowing you to use the dependencies key of a personal plugin as your "dotfiles" +* ADDED: `Plugins: Ignore cache and force reload the current behaviors file` command for plugin development +* ADDED: close tab with middle/cmd+click (seancaffery) +* ADDED: `App: Set the default zoom level` behavior for hidpi +* ADDED: leiningen directions to readme (statesside) +* API: allow editor/adjust-loc to specify line movement (ndr-qef) +* API: added `trigger` to `:object.behavior.time` event for complete event introspection +* API: added object/assoc-in! (ndr-qef) + ##0.6.4 * FIX: plugins would sometimes fail to install due to bad tar headers From 2e67df1883a6973c095374029f0593a08923bde4 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 18 Mar 2014 18:20:32 -0400 Subject: [PATCH 098/656] combine try-read catches now that :default is available in cljs --- src/lt/objs/eval.cljs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 7319d7494..80ed813ba 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -144,9 +144,7 @@ (defn try-read [r] (try (reader/read-string r) - (catch js/Error e - r) - (catch js/global.Error e + (catch :default e r))) ;;**************************************************** From 0ef026c4fff64121b2c71ad45f4249089ac077de Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 18 Mar 2014 19:27:06 -0400 Subject: [PATCH 099/656] update comment-options to be per editor instance --- deploy/settings/default/default.behaviors | 4 ++-- src/lt/objs/editor/pool.cljs | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 6fb3165f8..fb0236478 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -161,6 +161,7 @@ :lt.plugins.auto-paren/close-pair :lt.objs.editor.pool/track-active :lt.objs.editor.pool/ed-close :lt.objs.editor/menu! :lt.objs.editor.pool/warn-on-active :lt.objs.editor/refresh! + (:lt.objs.editor.pool/line-comment-options {}) :lt.plugins.auto-paren/repeat-pair :lt.plugins.auto-complete/async-hint-tokens :lt.objs.editor/copy-paste-menu+ @@ -221,8 +222,7 @@ :editor.pool [:lt.objs.editor.pool/add-tab-settings :lt.objs.editor.pool/options-changed :lt.objs.editor.pool/line-numbers-changed - :lt.objs.editor.pool/theme-changed - (:lt.objs.editor.pool/line-comment-options {})] + :lt.objs.editor.pool/theme-changed] :editor.read-only [:lt.objs.editor/read-only] :editor.structural [:lt.plugins.struct/rem-on-close] :editor.transient [:lt.objs.editor.file/dirty-on-change diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 9ae715b48..ec66459c3 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -249,8 +249,6 @@ ;;**************************************************** ;; See https://github.com/marijnh/CodeMirror/blob/master/addon/comment/comment.js for options -(def line-comment-options {}) - (behavior ::line-comment-options :triggers #{:object.instant} :type :user @@ -258,7 +256,7 @@ :params [{:label "map" :example "{:indent true}"}] :reaction (fn [this options] - (set! line-comment-options options))) + (object/merge! this {::comment-options options}))) (cmd/command {:command :comment-selection :desc "Editor: Comment line(s)" @@ -266,8 +264,8 @@ (when-let [cur (last-active)] (let [cursor (editor/->cursor cur "start")] (if (editor/selection? cur) - (editor/line-comment cur cursor (editor/->cursor cur "end") line-comment-options) - (editor/line-comment cur cursor cursor line-comment-options)))))}) + (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)) + (editor/line-comment cur cursor cursor (::comment-options @cur))))))}) (cmd/command {:command :uncomment-selection :desc "Editor: Uncomment line(s)" @@ -287,7 +285,7 @@ [cursor (editor/->cursor cur "end")] [cursor cursor])] (when-not (editor/uncomment cur start end) - (editor/line-comment cur cursor (editor/->cursor cur "end") line-comment-options)))))}) + (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur))))))}) (cmd/command {:command :indent-selection :desc "Editor: Indent line(s)" From 7f6b2c88b645bf852339ffb00c43a119d91a4d7c Mon Sep 17 00:00:00 2001 From: snufkon Date: Thu, 20 Mar 2014 07:55:12 +0900 Subject: [PATCH 100/656] tweak show-docs command to open only one doc --- src/lt/objs/docs.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/docs.cljs b/src/lt/objs/docs.cljs index 87a0f8e2a..e68344bbe 100644 --- a/src/lt/objs/docs.cljs +++ b/src/lt/objs/docs.cljs @@ -35,8 +35,11 @@ (cmd/command {:command :show-docs :desc "Docs: Open Light Table's documentation" :exec (fn [] - (let [docs (object/create ::docs) - ts (tabs/spawn-tabset)] - (tabs/equalize-tabset-widths) - (tabs/add! docs ts) - (tabs/active! docs)))}) + (if (empty? (object/by-tag :docs)) + (let [docs (object/create ::docs) + ts (tabs/spawn-tabset)] + (tabs/equalize-tabset-widths) + (tabs/add! docs ts) + (tabs/active! docs)) + (let [docs (first (object/by-tag :docs))] + (tabs/add-or-focus! docs))))}) From 1dac7a81431058919e57e9748835e54953275a70 Mon Sep 17 00:00:00 2001 From: ccspell Date: Thu, 20 Mar 2014 12:06:35 -0400 Subject: [PATCH 101/656] Update solarized.css Changed the comment color for a cleaner view when highlights. Request #1261 --- deploy/core/css/themes/solarized.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/css/themes/solarized.css b/deploy/core/css/themes/solarized.css index 802e5657c..fda817fff 100644 --- a/deploy/core/css/themes/solarized.css +++ b/deploy/core/css/themes/solarized.css @@ -55,7 +55,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png .cm-s-solarized .cm-property { color: #2aa198; } .cm-s-solarized .cm-operator {color: #6c71c4;} -.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } +.cm-s-solarized .cm-comment { color: #00FF99; font-style:italic; } .cm-s-solarized .cm-string { color: #859900; } .cm-s-solarized .cm-string-2 { color: #b58900; } From 2ca275106f4cc2c67d5b79a9367fc9c86be03fad Mon Sep 17 00:00:00 2001 From: Tyrieke Morton Date: Thu, 20 Mar 2014 18:00:02 -0400 Subject: [PATCH 102/656] Modified files for more simple implementation of Reporting Issues within Light Table. --- deploy/core/css/structure.css | 5 ---- deploy/settings/default/default.behaviors | 15 ----------- src/lt/objs/browser.cljs | 33 ----------------------- src/lt/objs/intro.cljs | 2 +- src/lt/objs/menu.cljs | 3 ++- 5 files changed, 3 insertions(+), 55 deletions(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 8707bee00..47e27e2e0 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -306,11 +306,6 @@ body { -webkit-user-select: none; } #browser input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} #browser button { width:20px; height:26px; padding:4px 5px; box-sizing:border-box; border-radius:0px; vertical-align:middle; } -#browseReport iframe { height:-webkit-calc(100% - 35px); width:100%; } -#browseReport .frame-shade { height:-webkit-calc(100% - 35px); width:100%; background:transparent; position:absolute; display:none; } -#browseReport input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} -#browseReport button { width:20px; height:26px; padding:4px 5px; box-sizing:border-box; border-radius:0px; vertical-align:middle; } - #side .tab-settings .filter-list { position:relative; } #side .tab-settings .filter-list ul {height: 100px; overflow:auto; display:none; position:absolute; top:35px; width:100%; z-index:10; border-radius:2px; padding:5px 0px; box-sizing:border-box;} #side .tab-settings .filter-list li { padding:0 10px; border-radius:2px; } diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 6df79a0d1..bb34d7111 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -118,21 +118,6 @@ :lt.objs.browser/menu! :lt.objs.browser/menu+ :lt.objs.browser/back!] - :browseReport [:lt.objs.browser/forward! :lt.objs.browser/init! - :lt.objs.browser/destroy-on-close :lt.objs.browser/focus! - :lt.objs.browser/url-focus! - :lt.objs.browser/focus-on-show - :lt.objs.browser/set-client-name :lt.objs.browser/rem-client - :lt.objs.browser/store-history :lt.objs.browser/refresh! - :lt.objs.browser/set-active :lt.objs.browser/navigate! - :lt.objs.browser/active-context - :lt.objs.browser/inactive-context - :lt.objs.browser/window-load-click-handler - :lt.objs.browser/window-load-key-handler - :lt.objs.browser/window-load-lttools - :lt.objs.browser/menu! - :lt.objs.browser/menu+ - :lt.objs.browser/back!] :client [:lt.objs.clients/on-connect-drain :lt.objs.clients/queue! :lt.objs.clients/try-send] :client.local [:lt.objs.clients.local/send!] diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 49d2fe5b8..4c26acc53 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -97,12 +97,6 @@ (tabs/active! browser) browser)) -(defn add-reports [] ;; TODO: Add add function for report browser - TWM - (let [browser (object/create ::browseReport)] - (tabs/add! browser) - (tabs/active! browser) - browser)) - ;;********************************************************* ;; Object ;;********************************************************* @@ -126,25 +120,6 @@ (refresh this)] ])) -(object/object* ::browseReport ;; TODO: Create report browswer object - TWM - :name "Browser" - :tags #{:browseReport} - :history [] - :history-pos -1 - :url "https://github.com/LightTable/LightTable/issues?state=open" - :urlvalue "https://github.com/LightTable/LightTable/issues?state=open" - :init (fn [this] - (object/merge! this {:client (connect-client this)}) - [:div#browseReport - [:div.frame-shade] - (iframe this) - [:nav - (backward this) - (forward this) - (url-bar this) - (refresh this)] - ])) - ;;********************************************************* ;; Behaviors @@ -512,14 +487,6 @@ (object/raise b :focus!) (object/raise b :navigate! loc))))}) -(cmd/command {:command :add-report-tab ;; TODO: add command to create browser tab - TWM - :desc "Browser: Report an Issue on GitHub" - :exec (fn [loc] - (let [b (add-reports)] - (if-not loc - (object/raise b :focus!) - (object/raise b :navigate! loc))))}) - (cmd/command {:command :refresh-connected-browser :desc "Browser: refresh active browser tab" :exec (fn [] diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index ed5802265..d6438a898 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -29,7 +29,7 @@ (defui reports [] ;; TODO: Added report button to click - TWM [:button "GitHub"] :click (fn [] - (cmd/exec! :add-report-tab))) + (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))) (defui changelog [] diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 6f9997bfe..9d13a2ba0 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -156,7 +156,8 @@ (cmd-item "Maximize" :window.maximize) (cmd-item "Fullscreen" :window.fullscreen)]} {:label "Help" :submenu [(cmd-item "Documentation" :show-docs) - (cmd-item "Report an Issue" :add-report-tab) ;; TODO: Add report an issue on GitHub menu item - TWM + {:label "Report an Issue" :click #(do + (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))} ;; TODO: Add report an issue on GitHub menu item - TWM (when-not (platform/mac?) (cmd-item "About Light Table" :version))]} ])) From 3ffe9bc52adca81c583b7e4e68ef46c8eb6d4983 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 21 Mar 2014 14:57:18 -0400 Subject: [PATCH 103/656] expose open-path for external use --- src/lt/objs/opener.cljs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index df8cd2e6d..a967f2d04 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -113,6 +113,19 @@ (tabs/add! ed) (tabs/active! ed)))) +(defn open-path + "Always open a path given an ::opener object and path" + [obj path] + (doc/open path + (fn [doc] + (let [type (files/path->type path) + ed (pool/create (merge {:doc doc :line-ending (-> @doc :line-ending)} (lt.objs.opener/path->info path)))] + (metrics/capture! :editor.open {:type (or (:name type) (files/ext path)) + :lines (editor/last-line ed)}) + (object/add-tags ed [:editor.file-backed]) + (object/raise obj :open ed) + (lt.objs.tabs/add! ed) + (lt.objs.tabs/active! ed))))) (behavior ::open-standard-editor :triggers #{:open!} @@ -123,16 +136,7 @@ (notifos/set-msg! (str "No such file: " path))) (if-let [ed (first (pool/by-path path))] (tabs/active! ed) - (doc/open path - (fn [doc] - (let [type (files/path->type path) - ed (pool/create (merge {:doc doc :line-ending (-> @doc :line-ending)} (path->info path)))] - (metrics/capture! :editor.open {:type (or (:name type) (files/ext path)) - :lines (editor/last-line ed)}) - (object/add-tags ed [:editor.file-backed]) - (object/raise obj :open ed) - (tabs/add! ed) - (tabs/active! ed)))))))) + (open-path obj path))))) (behavior ::track-open-files :triggers #{:open} From 368067762f9eb9e49592932ec3bb7fac0e2a0ed1 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 21 Mar 2014 15:11:26 -0400 Subject: [PATCH 104/656] add copy and paste --- src/lt/objs/platform.cljs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index b04d10678..7fe223958 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -13,6 +13,16 @@ (defn open [path] (.Shell.openExternal (js/require "nw.gui") path)) +(defn copy + "Copies given text to platform's clipboard" + [text] + (.set (.Clipboard.get (js/require "nw.gui")) text "text")) + +(defn paste + "Returns text of last copy to platform's clipboard" + [] + (.get (.Clipboard.get (js/require "nw.gui")) "text")) + (def platform (normalize (.-platform js/process))) (defn mac? [] From 739dec72e8182327d66b7252c2cb43938a5bcd70 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 21 Mar 2014 16:01:39 -0400 Subject: [PATCH 105/656] require command keys to avoid missing keys breaking commandbar --- src/lt/objs/command.cljs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lt/objs/command.cljs b/src/lt/objs/command.cljs index 1f6cbbe80..358693739 100644 --- a/src/lt/objs/command.cljs +++ b/src/lt/objs/command.cljs @@ -3,7 +3,11 @@ (declare manager) +(def required-keys #{:command :desc :exec}) + (defn command [cmd] + (assert (every? cmd required-keys) + (str "Command doesn't have required keys: " required-keys)) (object/update! manager [:commands] assoc (:command cmd) cmd) (when (:options cmd) (object/add-tags (:options cmd) [:command.options])) From b2b8ef02e8ccfa649273c9ae243261c5949c2df7 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Sat, 22 Mar 2014 10:14:10 -0500 Subject: [PATCH 106/656] Make tab and tabset context menus extensible Update code for creating context menus to use *-menu-items triggers. Add :order key so item order can be specified by other plugins or behaviors. --- deploy/settings/default/default.behaviors | 5 ++-- src/lt/objs/tabs.cljs | 35 +++++++++++++++++------ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index bb34d7111..ba994150b 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -401,9 +401,10 @@ :lt.objs.tabs/tab-close :lt.objs.tabs/prev-tab :lt.objs.tabs/reanim-on-drop :lt.objs.tabs/tabset-menu :lt.objs.tabs/no-anim-on-drag :lt.objs.tabs/active-tab-num - :lt.objs.tabs/set-dragging] + :lt.objs.tabs/tabset-menu-items :lt.objs.tabs/set-dragging] :tabset.tab [:lt.objs.tabs/on-destroy-remove - :lt.objs.tabs/tab-active] + :lt.objs.tabs/tab-active + :lt.objs.tabs/tab-menu-items] :tcp.client [:lt.objs.clients.tcp/send!] :theme-selector [:lt.objs.style/set-theme-on-select] :tree-item [:lt.objs.sidebar.workspace/rename-submit diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 52afddb50..24008903e 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -81,6 +81,17 @@ (catch js/global.Error e (js/lt.objs.console.error e))))) +(behavior ::tab-menu-items + :triggers #{:tab-menu-items} + :reaction (fn [this items] + (conj items + {:label "Move tab to new tabset" + :order 1 + :click (fn [] (cmd/exec! :tabs.move-new-tabset obj))} + {:label "Close tab" + :order 2 + :click (fn [] (object/raise obj :close))}))) + (defn ->index [obj] (when (and obj @obj (::tabset @obj)) (first (first (filter #(= obj (second %)) (map-indexed vector (:objs @(::tabset @obj)))))))) @@ -125,7 +136,8 @@ (object/raise e :close) (active! e))) :contextmenu (fn [ev] - (menu! e ev) + (-> (menu/menu (sort-by :order (object/raise-reduce e :tab-menu-items []))) + (menu/show-menu (.-clientX ev) (.-clientY ev))) (dom/prevent ev) (dom/stop-propagation ev)) ) @@ -358,13 +370,20 @@ (behavior ::tabset-menu :triggers #{:menu!} :reaction (fn [this ev] - (-> (menu/menu [{:label "New tabset" - :click (fn [] (cmd/exec! :tabset.new))} - {:label "Close tabset" - :click (fn [] (rem-tabset this))} - ]) - (menu/show-menu (.-clientX ev) (.-clientY ev))) - )) + (-> (menu/menu (sort-by :order (object/raise-reduce this :tabset-menu-items []))) + (menu/show-menu (.-clientX ev) (.-clientY ev))))) + +(behavior ::tabset-menu-items + :triggers #{:tabset-menu-items} + :reaction (fn [this items] + (conj items + {:label "New tabset" + :order 1 + :click (fn [] (cmd/exec! :tabset.new))} + {:label "Close tabset" + :order 2 + :click (fn [] (rem-tabset this))}))) + (defui tabset-ui [this] [:div.tabset {:style {:width (bound (subatom this :width) ->perc)}} From 96ed41b0fce31608d516f17c5197e68967db045f Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Sat, 22 Mar 2014 10:20:20 -0500 Subject: [PATCH 107/656] Update rem-tabset def to remove compiler warning --- src/lt/objs/tabs.cljs | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 24008903e..313b30371 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -460,26 +460,21 @@ ;(object/raise ts :active) ) -(defn rem-tabset [ts prev?] - (let [to-ts (if prev? - (or (prev-tabset ts) (next-tabset ts)) - (or (next-tabset ts) (prev-tabset ts)))] - (when to-ts - (object/merge! to-ts {:width (floored (+ (:width @to-ts) (:width @ts)))}) - (dom/remove (object/->content ts)) - (doseq [t (:objs @ts)] - (add! t to-ts)) - (object/update! multi [:tabsets] #(vec (remove #{ts} %))) - (object/destroy! ts) - (equalize-tabset-widths) - (object/raise to-ts :active)))) - -(defn menu! [obj ev] - (-> (menu/menu [{:label "Move tab to new tabset" - :click (fn [] (cmd/exec! :tabs.move-new-tabset obj))} - {:label "Close tab" - :click (fn [] (object/raise obj :close))}]) - (menu/show-menu (.-clientX ev) (.-clientY ev)))) +(defn rem-tabset + ([ts] (rem-tabset ts false)) + ([ts prev?] + (let [to-ts (if prev? + (or (prev-tabset ts) (next-tabset ts)) + (or (next-tabset ts) (prev-tabset ts)))] + (when to-ts + (object/merge! to-ts {:width (floored (+ (:width @to-ts) (:width @ts)))}) + (dom/remove (object/->content ts)) + (doseq [t (:objs @ts)] + (add! t to-ts)) + (object/update! multi [:tabsets] #(vec (remove #{ts} %))) + (object/destroy! ts) + (equalize-tabset-widths) + (object/raise to-ts :active))))) (defn rem! [obj] (when (and obj @obj (::tabset @obj)) From e943f03423f65290ab7db68be0b26e93bbd6bfe5 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Sat, 22 Mar 2014 12:25:17 -0500 Subject: [PATCH 108/656] Fix this variable reference in tab-menu-items --- src/lt/objs/tabs.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 313b30371..0b340c7bd 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -87,10 +87,10 @@ (conj items {:label "Move tab to new tabset" :order 1 - :click (fn [] (cmd/exec! :tabs.move-new-tabset obj))} + :click (fn [] (cmd/exec! :tabs.move-new-tabset this))} {:label "Close tab" :order 2 - :click (fn [] (object/raise obj :close))}))) + :click (fn [] (object/raise this :close))}))) (defn ->index [obj] (when (and obj @obj (::tabset @obj)) From 17c20115640a4fdc1bcb1a230e72e76a64567ec8 Mon Sep 17 00:00:00 2001 From: ndr Date: Sun, 23 Mar 2014 19:05:57 +0100 Subject: [PATCH 109/656] Log context changes Removes dead code for context logging and adds: - `lt.objs.context/enqueue`, a function that pushes an item to a queue unless the queue has reached its maximum predefined size. (Practically, a laxly defined ring buffer.) - `lt.objs.context/context`, an object that stores a log of context changes in the `history` key. - `lt.objs.context/log`, a behavior that dispatches context changes to the history log. Caveat: logging relies on debouncing to decide whether subsequent calls amount to a single context change or multiple ones. --- deploy/settings/default/default.behaviors | 1 + src/lt/objs/context.cljs | 42 ++++++++++++----------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index bb34d7111..d80367399 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -140,6 +140,7 @@ :console [:lt.objs.console/on-close :lt.objs.menu/menu! :lt.objs.console/menu+] + :context [:lt.objs.context/log] :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document] :document.linked [:lt.objs.document/close-linked-document] :docs [:lt.objs.docs/on-close-destroy] diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index 9d15c899d..f22896701 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -7,7 +7,6 @@ (def ctx->obj (atom {})) (def ctx->group (atom {})) (def group->ctxs (atom {})) -(def ctx-obj nil) (defn append-group [group name] (swap! groups (fn [all] @@ -24,10 +23,7 @@ [ctxs])] (swap! contexts #(apply disj % ctxs)) (swap! ctx->obj #(apply dissoc % ctxs)) - (object/raise ctx-obj :out! ctxs) - (doseq [c ctxs - :when (in? c)] - (object/raise ctx-obj (keyword (str "out!" (name c))))))) + (object/raise ctx-obj :log!))) (defn in! [ctxs & [obj]] (let [ctxs (if (coll? ctxs) @@ -35,11 +31,10 @@ [ctxs])] (swap! contexts #(apply conj % ctxs)) (swap! ctx->obj #(merge % (zipmap ctxs (repeat obj)))) - (object/raise ctx-obj :in! ctxs) + (object/raise ctx-obj :log!) (doseq [c ctxs] (when-let [group (@group->ctxs (@ctx->group c))] - (out! group)) - (object/raise ctx-obj (keyword (str "in!" (name c))))))) + (out! group))))) (defn toggle! [ctxs & [obj]] (doseq [c ctxs] @@ -57,20 +52,27 @@ (defn ->obj [ctx] (@ctx->obj ctx)) -(behavior ::log-on-in - :triggers #{:in!} - :reaction (fn [obj ctxs] - (log :context-in ctxs)) - ) +(defn enqueue [coll buffer size] + (if (= size + (count buffer)) + (conj (pop buffer) coll) + (conj buffer coll))) -(behavior ::log-on-out - :triggers #{:out!} - :reaction (fn [obj ctxs] - (log :context-out ctxs)) - ) +(behavior ::log + :triggers #{:log!} + :debounce 16 + :reaction (fn [this] + (let [size (:buffer-size @this) + ctx @contexts] + (object/update! this + [:history] + #(enqueue ctx % size))))) (object/object* ::context - :init (fn [])) + :tags #{:context} + :history cljs.core.PersistentQueue.EMPTY + :buffer-size 8 + :init (fn [this])) -(set! ctx-obj (object/create ::context)) +(def ctx-obj (object/create ::context)) From c5917192d78ee8886da40e0929c5602bbaac5457 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 24 Mar 2014 19:11:31 -0700 Subject: [PATCH 110/656] cm4 official Signed-off-by: Chris Granger --- .../node_modules/codemirror/codemirror.js | 2950 +++++++++++------ 1 file changed, 1876 insertions(+), 1074 deletions(-) diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/codemirror.js index 4959db2c6..703ac2fb6 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/codemirror.js @@ -1,3 +1,9 @@ +// This is CodeMirror (http://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS module.exports = mod(); @@ -10,16 +16,17 @@ // BROWSER SNIFFING - // Crude, but necessary to handle a number of hard-to-feature-detect - // bugs and behavior differences. + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var gecko = /gecko\/\d/i.test(navigator.userAgent); - // old_ie refers to any Internet Explorer before 11 (which has - // almost none of the same bugs as earlier versions). - var old_ie = /MSIE \d/.test(navigator.userAgent); - var ie_lt8 = old_ie && (document.documentMode == null || document.documentMode < 8); - var ie_lt9 = old_ie && (document.documentMode == null || document.documentMode < 9); - var ie_gt10 = /Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent); - var ie = old_ie || ie_gt10; + // ie_uptoN means Internet Explorer version N or lower + var ie_upto10 = /MSIE \d/.test(navigator.userAgent); + var ie_upto7 = ie_upto10 && (document.documentMode == null || document.documentMode < 8); + var ie_upto8 = ie_upto10 && (document.documentMode == null || document.documentMode < 9); + var ie_upto9 = ie_upto10 && (document.documentMode == null || document.documentMode < 10); + var ie_11up = /Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent); + var ie = ie_upto10 || ie_11up; var webkit = /WebKit\//.test(navigator.userAgent); var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); var chrome = /Chrome\//.test(navigator.userAgent); @@ -41,152 +48,177 @@ if (presto_version && presto_version >= 15) { presto = false; webkit = true; } // Some browsers use the wrong event properties to signal cmd/ctrl on OS X var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (old_ie && !ie_lt9); + var captureRightClick = gecko || (ie && !ie_upto8); - // Optimize some code when these features are not used + // Optimize some code when these features are not used. var sawReadOnlySpans = false, sawCollapsedSpans = false; - // CONSTRUCTOR + // EDITOR CONSTRUCTOR + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. function CodeMirror(place, options) { if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); this.options = options = options || {}; // Determine effective options based on given values and defaults. - for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt)) + for (var opt in defaults) if (!options.hasOwnProperty(opt)) options[opt] = defaults[opt]; setGuttersForLineNumbers(options); - var docStart = typeof options.value == "string" ? 0 : options.value.first; - var display = this.display = makeDisplay(place, docStart); + var doc = options.value; + if (typeof doc == "string") doc = new Doc(doc, options.mode); + this.doc = doc; + + var display = this.display = new Display(place, doc); display.wrapper.CodeMirror = this; updateGutters(this); - if (options.autofocus && !mobile) focusInput(this); - - this.state = {keyMaps: [], - overlays: [], - modeGen: 0, - overwrite: false, focused: false, - suppressEdits: false, - pasteIncoming: false, cutIncoming: false, - draggingText: false, - highlight: new Delayed()}; - themeChanged(this); if (options.lineWrapping) this.display.wrapper.className += " CodeMirror-wrap"; + if (options.autofocus && !mobile) focusInput(this); - var doc = options.value; - if (typeof doc == "string") doc = new Doc(doc, options.mode); + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in readInput + draggingText: false, + highlight: new Delayed() // stores highlight worker timeout + }; // Override magic textarea content restore that IE sometimes does // on our hidden textarea on reload - if (old_ie) setTimeout(bind(resetInput, this, true), 20); + if (ie_upto10) setTimeout(bind(resetInput, this, true), 20); registerEventHandlers(this); - operation(this, function() { - attachDoc(this, doc); + var cm = this; + runInOp(this, function() { + cm.curOp.forceUpdate = true; + attachDoc(cm, doc); - // IE throws unspecified error in certain cases, when - // trying to access activeElement before onload - var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { } - if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20); - else onBlur(this); + if ((options.autofocus && !mobile) || activeElt() == display.input) + setTimeout(bind(onFocus, cm), 20); + else + onBlur(cm); - for (var opt in optionHandlers) - if (optionHandlers.propertyIsEnumerable(opt)) - optionHandlers[opt](this, options[opt], Init); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); - })(); + for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) + optionHandlers[opt](cm, options[opt], Init); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](cm); + }); } // DISPLAY CONSTRUCTOR - function makeDisplay(place, docStart) { - var d = {}; + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. - var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;"); + function Display(place, doc) { + var d = this; + + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. if (webkit) input.style.width = "1000px"; else input.setAttribute("wrap", "off"); - // if border: 0; -- iOS fails to open keyboard (issue #1287) + // If border: 0; -- iOS fails to open keyboard (issue #1287) if (ios) input.style.border = "1px solid black"; input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false"); // Wraps and hides input textarea d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The actual fake scrollbars. - d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar"); - d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar"); + // The fake scrollbar elements. + d.scrollbarH = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + d.scrollbarV = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + // Covers bottom-right square when both scrollbars are present. d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - // DIVs containing the selection and the actual code + // Will contain the actual code, positioned to cover the viewport. d.lineDiv = elt("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // Used to measure text size + // A visibility: hidden element used to find the size of things. d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. d.lineMeasure = elt("div", null, "CodeMirror-measure"); // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.lineDiv, d.cursorDiv], + d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); - // Moved around its parent to cover visible view + // Moved around its parent to cover visible view. d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); - // Set to the height of the text, causes scrolling + // Set to the height of the document, allowing scrolling. d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;"); - // Will contain the gutters, if any + // Will contain the gutters, if any. d.gutters = elt("div", null, "CodeMirror-gutters"); d.lineGutter = null; - // Provides scrolling + // Actual scrollable element. d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); d.scroller.setAttribute("tabIndex", "-1"); // The element in which the editor lives. d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV, d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - // Work around IE7 z-index bug - if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper); + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie_upto7) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } // Needed to hide big blue blinking cursor on Mobile Safari if (ios) input.style.width = "0px"; if (!webkit) d.scroller.draggable = true; // Needed to handle Tab key in KHTML if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px"; + if (ie_upto7) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = "18px"; + + if (place.appendChild) place.appendChild(d.wrapper); + else place(d.wrapper); - // Current visible range (may be bigger than the view window). - d.viewOffset = d.lastSizeC = 0; - d.viewFrom = d.viewTo = docStart; + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + // Information about the rendered lines. d.view = []; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastSizeC = 0; d.updateLineNumbers = null; // Used to only resize the line number gutter when necessary (when // the amount of lines crosses a boundary that makes its width change) d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; // See readInput and resetInput - if (!ie_lt9) { - d.prevInput = d.input.value = "_"; - d.input.setSelectionRange(1, 1); - } else { - d.prevInput = ""; - } - // Set to true when a non-horizontal-scrolling widget is added. As - // an optimization, widget aligning is skipped when d is false. + d.prevInput = ""; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. d.alignWidgets = false; - // Flag that indicates whether we currently expect input to appear - // (after some event like 'keypress' or 'input') and are polling - // intensively. + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. d.pollingFast = false; // Self-resetting timeout for the poller d.poll = new Delayed(); - d.cachedCharWidth = d.cachedTextHeight = null; + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; // Tracks when resetInput has punted to just putting a short - // string instead of the (large) selection. + // string into the textarea instead of the full selection. d.inaccurateSelection = false; // Tracks the maximum line length so that the horizontal scrollbar @@ -198,11 +230,8 @@ // Used for measuring wheel scrolling granularity d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + // True when shift is held down. d.shift = false; - - d.externalMeasured = null; - - return d; } // STATE UPDATES @@ -231,7 +260,7 @@ cm.display.sizer.style.minWidth = ""; } else { cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", ""); - computeMaxLength(cm); + findMaxLine(cm); } estimateLineHeights(cm); regChange(cm); @@ -239,16 +268,24 @@ setTimeout(function(){updateScrollbars(cm);}, 100); } + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). function estimateHeight(cm) { var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); return function(line) { - if (lineIsHidden(cm.doc, line)) - return 0; - else if (wrapping) - return (Math.ceil(line.text.length / perLine) || 1) * th; + if (lineIsHidden(cm.doc, line)) return 0; + + var widgetsHeight = 0; + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; + } + + if (wrapping) + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; else - return th; + return widgetsHeight + th; }; } @@ -278,6 +315,8 @@ setTimeout(function(){alignHorizontally(cm);}, 20); } + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. function updateGutters(cm) { var gutters = cm.display.gutters, specs = cm.options.gutters; removeChildren(gutters); @@ -295,6 +334,9 @@ if (i) cm.display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; } + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. function lineLength(line) { if (line.height == 0) return 0; var len = line.text.length, merged, cur = line; @@ -313,7 +355,8 @@ return len; } - function computeMaxLength(cm) { + // Find the longest line in the document. + function findMaxLine(cm) { var d = cm.display, doc = cm.doc; d.maxLine = getLine(doc, doc.first); d.maxLineLength = lineLength(d.maxLine); @@ -341,28 +384,27 @@ // SCROLLBARS + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. function measureForScrollbars(cm) { var scroll = cm.display.scroller; return { - scrollHeight: scroll.scrollHeight, clientHeight: scroll.clientHeight, + clientHeight: scroll.clientHeight, barHeight: cm.display.scrollbarV.clientHeight, scrollWidth: scroll.scrollWidth, clientWidth: scroll.clientWidth, barWidth: cm.display.scrollbarH.clientWidth, - paddingVert: paddingVert(cm.display) + docHeight: Math.round(cm.doc.height + paddingVert(cm.display)) }; } // Re-synchronize the fake scrollbars with the actual size of the - // content. Optionally force a scrollTop. + // content. function updateScrollbars(cm, measure) { if (!measure) measure = measureForScrollbars(cm); - var d = cm.display, docHeight = cm.doc.height; - var totalHeight = docHeight + measure.paddingVert; - d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px"; - d.gutters.style.height = Math.max(totalHeight, measure.clientHeight - scrollerCutOff) + "px"; - var scrollHeight = Math.max(totalHeight, measure.scrollHeight); - var needsH = measure.scrollWidth > (measure.clientWidth + 1); - var needsV = scrollHeight > (measure.clientHeight + 1); + var d = cm.display; + var scrollHeight = measure.docHeight + scrollerCutOff; + var needsH = measure.scrollWidth > measure.clientWidth; + var needsV = scrollHeight > measure.clientHeight; if (needsV) { d.scrollbarV.style.display = "block"; d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0"; @@ -394,25 +436,33 @@ if (mac_geLion && scrollbarWidth(d.measure) === 0) { d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px"; - d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = "none"; + var barMouseDown = function(e) { + if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH) + operation(cm, onMouseDown)(e); + }; + on(d.scrollbarV, "mousedown", barMouseDown); + on(d.scrollbarH, "mousedown", barMouseDown); } } - // viewPort may contain top, height, and ensure (see op.scrollToPos) properties + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewPort may contain top, + // height, and ensure (see op.scrollToPos) properties. function visibleLines(display, doc, viewPort) { var top = viewPort && viewPort.top != null ? viewPort.top : display.scroller.scrollTop; - var height = viewPort && viewPort.height || display.wrapper.clientHeight; top = Math.floor(top - paddingTop(display)); - var bottom = Math.ceil(top + height); + var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight; var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). if (viewPort && viewPort.ensure) { var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line; if (ensureFrom < from) return {from: ensureFrom, - to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) - display.wrapper.clientHeight)}; + to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)}; if (Math.min(ensureTo, doc.lastLine()) >= to) - return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) + display.wrapper.clientHeight), + return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight), to: ensureTo}; } return {from: from, to: to}; @@ -420,6 +470,8 @@ // LINE NUMBERS + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. function alignHorizontally(cm) { var display = cm.display, view = display.view; if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; @@ -436,6 +488,9 @@ display.gutters.style.left = (comp + gutterW) + "px"; } + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. function maybeUpdateLineNumberWidth(cm) { if (!cm.options.lineNumbers) return false; var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; @@ -459,21 +514,37 @@ function lineNumberFor(options, i) { return String(options.lineNumberFormatter(i + options.firstLineNumber)); } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. function compensateForHScroll(display) { return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; } // DISPLAY DRAWING - function updateDisplay(cm, viewChanged, viewPort, forced) { + // Updates the display, selection, and scrollbars, using the + // information in display.view to find out which nodes are no longer + // up-to-date. Tries to bail out early when no changes are needed, + // unless forced is true. + // Returns true if an actual update happened, false otherwise. + function updateDisplay(cm, viewPort, forced) { var oldFrom = cm.display.viewFrom, oldTo = cm.display.viewTo, updated; var visible = visibleLines(cm.display, cm.doc, viewPort); for (var first = true;; first = false) { var oldWidth = cm.display.scroller.clientWidth; - if (!updateDisplayInner(cm, !updated && viewChanged, visible, forced)) break; + if (!updateDisplayInner(cm, visible, forced)) break; updated = true; + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + if (cm.display.maxLineChanged && !cm.options.lineWrapping) + adjustContentWidth(cm); + var barMeasure = measureForScrollbars(cm); updateSelection(cm); + setDocumentHeight(cm, barMeasure); updateScrollbars(cm, barMeasure); if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) { forced = true; @@ -481,9 +552,11 @@ } forced = false; - // Clip forced viewport to actual scrollable area + // Clip forced viewport to actual scrollable area. if (viewPort && viewPort.top != null) - viewPort = {top: Math.min(barMeasure.scrollHeight - barMeasure.clientHeight, viewPort.top)}; + viewPort = {top: Math.min(barMeasure.docHeight - scrollerCutOff - barMeasure.clientHeight, viewPort.top)}; + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. visible = visibleLines(cm.display, cm.doc, viewPort); if (visible.from >= cm.display.viewFrom && visible.to <= cm.display.viewTo) break; @@ -498,10 +571,10 @@ return updated; } - // Uses a set of changes plus the current scroll position to - // determine which DOM updates have to be made, and makes the - // updates. - function updateDisplayInner(cm, viewChanged, visible, forced) { + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayInner(cm, visible, forced) { var display = cm.display, doc = cm.doc; if (!display.wrapper.offsetWidth) { resetView(cm); @@ -509,14 +582,15 @@ } // Bail out if the visible area is already rendered and nothing changed. - if (!forced && !viewChanged && - visible.from > display.viewFrom && visible.to < display.viewTo) + if (!forced && visible.from >= display.viewFrom && visible.to <= display.viewTo && + countDirtyView(cm) == 0) return; if (maybeUpdateLineNumberWidth(cm)) resetView(cm); var dims = getDimensions(cm); + // Compute a suitable new viewport (from & to) var end = doc.first + doc.size; var from = Math.max(visible.from - cm.options.viewportMargin, doc.first); var to = Math.min(end, visible.to + cm.options.viewportMargin); @@ -531,27 +605,25 @@ display.lastSizeC != display.wrapper.clientHeight; adjustView(cm, from, to); - var toUpdate = 0; - for (var i = 0; i < display.view.length; i++) { - var v = display.view[i]; - if (!v.hidden && (!v.node || v.changes)) ++toUpdate; - } + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; - updateViewOffset(cm); + var toUpdate = countDirtyView(cm); if (!different && toUpdate == 0 && !forced) return; - if (toUpdate > 4) { - var focused = document.activeElement; - display.lineDiv.style.display = "none"; - } + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var focused = activeElt(); + if (toUpdate > 4) display.lineDiv.style.display = "none"; patchDisplay(cm, display.updateLineNumbers, dims); - if (toUpdate > 4) { - display.lineDiv.style.display = ""; - if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus(); - } + if (toUpdate > 4) display.lineDiv.style.display = ""; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); - // Prevent these from interfering with the scroll size - display.gutters.style.height = ""; + // Prevent selection and cursors from interfering with the scroll + // width. removeChildren(display.cursorDiv); removeChildren(display.selectionDiv); @@ -565,13 +637,31 @@ return true; } + function adjustContentWidth(cm) { + var display = cm.display; + var width = measureChar(cm, display.maxLine, display.maxLine.text.length).left; + display.maxLineChanged = false; + var minWidth = Math.max(0, width + 3); + var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + minWidth + scrollerCutOff - display.scroller.clientWidth); + display.sizer.style.minWidth = minWidth + "px"; + if (maxScrollLeft < cm.doc.scrollLeft) + setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true); + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = Math.max(measure.docHeight, measure.clientHeight - scrollerCutOff) + "px"; + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. function updateHeightsInViewport(cm) { var display = cm.display; var prevBottom = display.lineDiv.offsetTop; for (var i = 0; i < display.view.length; i++) { var cur = display.view[i], height; if (cur.hidden) continue; - if (ie_lt8) { + if (ie_upto7) { var bot = cur.node.offsetTop + cur.node.offsetHeight; height = bot - prevBottom; prevBottom = bot; @@ -590,17 +680,15 @@ } } + // Read and store the height of line widgets associated with the + // given line. function updateWidgetHeight(line) { if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) line.widgets[i].height = line.widgets[i].node.offsetHeight; } - function updateViewOffset(cm) { - var off = cm.display.viewOffset = heightAtLine(getLine(cm.doc, cm.display.viewFrom)); - // Position the mover div to align with the current virtual scroll position - cm.display.mover.style.top = off + "px"; - } - + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. function getDimensions(cm) { var d = cm.display, left = {}, width = {}; for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { @@ -614,12 +702,17 @@ wrapperWidth: d.wrapper.clientWidth}; } + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. function patchDisplay(cm, updateNumbersFrom, dims) { var display = cm.display, lineNumbers = cm.options.lineNumbers; var container = display.lineDiv, cur = container.firstChild; function rm(node) { var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit if (webkit && mac && cm.display.currentWheelTarget == node) node.style.display = "none"; else @@ -628,6 +721,8 @@ } var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. for (var i = 0; i < view.length; i++) { var lineView = view[i]; if (lineView.hidden) { @@ -653,6 +748,9 @@ while (cur) cur = rm(cur); } + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. function updateLineForChanges(cm, lineView, lineN, dims) { for (var j = 0; j < lineView.changes.length; j++) { var type = lineView.changes[j]; @@ -672,7 +770,7 @@ if (lineView.text.parentNode) lineView.text.parentNode.replaceChild(lineView.node, lineView.text); lineView.node.appendChild(lineView.text); - if (ie_lt8) lineView.node.style.zIndex = 2; + if (ie_upto7) lineView.node.style.zIndex = 2; } return lineView.node; } @@ -689,6 +787,8 @@ } } + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. function getLineContent(cm, lineView) { var ext = cm.display.externalMeasured; if (ext && ext.line == lineView.line) { @@ -699,6 +799,9 @@ return buildLineContent(cm, lineView); } + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. function updateLineText(cm, lineView) { var cls = lineView.text.className; var built = getLineContent(cm, lineView); @@ -761,6 +864,7 @@ insertLineWidgets(lineView, dims); } + // Build a line's DOM representation from scratch function buildLineElement(cm, lineView, lineN, dims) { var built = getLineContent(cm, lineView); lineView.text = lineView.node = built.pre; @@ -773,6 +877,8 @@ return lineView.node; } + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. function insertLineWidgets(lineView, dims) { insertLineWidgetsFor(lineView.line, lineView, dims, true); if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) @@ -812,8 +918,29 @@ } } + // POSITION OBJECT + + // A Pos instance represents a position within the text. + var Pos = CodeMirror.Pos = function(line, ch) { + if (!(this instanceof Pos)) return new Pos(line, ch); + this.line = line; this.ch = ch; + }; + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; + + function copyPos(x) {return Pos(x.line, x.ch);} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } + // SELECTION / CURSOR + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). function Selection(ranges, primIndex) { this.ranges = ranges; this.primIndex = primIndex; @@ -851,6 +978,21 @@ } }; + function Range(anchor, head) { + this.anchor = anchor; this.head = head; + } + + Range.prototype = { + from: function() { return minPos(this.anchor, this.head); }, + to: function() { return maxPos(this.anchor, this.head); }, + empty: function() { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + } + }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). function normalizeSelection(ranges, primIndex) { var prim = ranges[primIndex]; ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); @@ -859,9 +1001,9 @@ var cur = ranges[i], prev = ranges[i - 1]; if (cmp(prev.to(), cur.from()) >= 0) { var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = from == prev.head || from == cur.head; + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; if (i <= primIndex) --primIndex; - ranges.splice(i-- - 1, 2, new Range(inv ? to : from, inv ? from : to)); + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); } } return new Selection(ranges, primIndex); @@ -871,22 +1013,213 @@ return new Selection([new Range(anchor, head || anchor)], 0); } - function Range(anchor, head) { - this.anchor = anchor; this.head = head; + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} + function clipPos(doc, pos) { + if (pos.line < doc.first) return Pos(doc.first, 0); + var last = doc.first + doc.size - 1; + if (pos.line > last) return Pos(last, getLine(doc, last).text.length); + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) return Pos(pos.line, linelen); + else if (ch < 0) return Pos(pos.line, 0); + else return pos; + } + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + function clipPosArray(doc, array) { + for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); + return out; } - Range.prototype = { - from: function() { - return cmp(this.anchor, this.head) < 0 ? this.anchor : this.head; - }, - to: function() { - return cmp(this.anchor, this.head) > 0 ? this.anchor : this.head; - }, - empty: function() { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + // SELECTION UPDATES + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(doc, range, head, other) { + if (doc.cm && doc.cm.display.shift || doc.extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); } - }; + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options) { + setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + for (var out = [], i = 0; i < doc.sel.ranges.length; i++) + out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); + } + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); + else return sel; + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + sel = filterSelectionChange(doc, sel); + + var bias = cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1; + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm) + ensureCursorVisible(doc.cm); + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) return; + + doc.sel = sel; + + if (doc.cm) + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = + doc.cm.curOp.cursorActivity = true; + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) out = sel.ranges.slice(0, i); + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, bias, mayClear) { + var flipped = false, curPos = pos; + var dir = bias || 1; + doc.cantEdit = false; + search: for (;;) { + var line = getLine(doc, curPos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} + } + } + if (!m.atomic) continue; + var newPos = m.find(dir < 0 ? -1 : 1); + if (cmp(newPos, curPos) == 0) { + newPos.ch += dir; + if (newPos.ch < 0) { + if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); + else newPos = null; + } else if (newPos.ch > line.text.length) { + if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); + else newPos = null; + } + if (!newPos) { + if (flipped) { + // Driven in a corner -- no valid cursor position found at all + // -- try again *with* clearing, if we didn't already + if (!mayClear) return skipAtomic(doc, pos, bias, true); + // Otherwise, turn off editing until further notice, and return the start of the doc + doc.cantEdit = true; + return Pos(doc.first, 0); + } + flipped = true; newPos = pos; dir = -dir; + } + } + curPos = newPos; + continue search; + } + } + } + return curPos; + } + } + + // SELECTION DRAWING + // Redraw the selection and/or cursor function updateSelection(cm) { var display = cm.display, doc = cm.doc; var curFragment = document.createDocumentFragment(); @@ -917,7 +1250,7 @@ removeChildrenAndAdd(display.selectionDiv, selFragment); } - // No selection, plain cursor + // Draws a cursor for the given range function updateSelectionCursor(cm, range, output) { var pos = cursorCoords(cm, range.head, "div"); @@ -936,16 +1269,16 @@ } } - // Highlight selection + // Draws the given range as a highlighted selection function updateSelectionRange(cm, range, output) { var display = cm.display, doc = cm.doc; var fragment = document.createDocumentFragment(); - var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display); + var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right; function add(left, top, width, bottom) { if (top < 0) top = 0; fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + - "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) + + "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px; height: " + (bottom - top) + "px")); } @@ -968,18 +1301,18 @@ left = leftPos.left; right = rightPos.right; } - if (fromArg == null && from == 0) left = pl; + if (fromArg == null && from == 0) left = leftSide; if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part add(left, leftPos.top, null, leftPos.bottom); - left = pl; + left = leftSide; if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); } - if (toArg == null && to == lineLen) right = clientWidth; + if (toArg == null && to == lineLen) right = rightSide; if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) start = leftPos; if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) end = rightPos; - if (left < pl + 1) left = pl; + if (left < leftSide + 1) left = leftSide; add(left, rightPos.top, right - left, rightPos.bottom); }); return {start: start, end: end}; @@ -991,18 +1324,18 @@ } else { var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length : null).end; + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; if (singleVLine) { if (leftEnd.top < rightStart.top - 2) { add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(pl, rightStart.top, rightStart.left, rightStart.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); } else { add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); } } if (leftEnd.bottom < rightStart.top) - add(pl, leftEnd.bottom, null, rightStart.top); + add(leftSide, leftEnd.bottom, null, rightStart.top); } output.appendChild(fragment); @@ -1035,7 +1368,7 @@ var end = +new Date + cm.options.workTime; var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); - operation(cm, function() { + runInOp(cm, function() { doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { if (doc.frontier >= cm.display.viewFrom) { // Visible var oldStyles = line.styles; @@ -1098,11 +1431,18 @@ function paddingTop(display) {return display.lineSpace.offsetTop;} function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} - function paddingLeft(display) { - var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x")); - return e.offsetLeft; - } - + function paddingH(display) { + if (display.cachedPaddingH) return display.cachedPaddingH; + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + return display.cachedPaddingH = {left: parseInt(style.paddingLeft), + right: parseInt(style.paddingRight)}; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. function ensureLineHeights(cm, lineView, rect) { var wrapping = cm.options.lineWrapping; var curWidth = wrapping && cm.display.scroller.clientWidth; @@ -1111,13 +1451,19 @@ if (wrapping) { lineView.measure.width = curWidth; var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) - heights.push((rects[i].bottom + rects[i + 1].top) / 2 - rect.top); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + heights.push((cur.bottom + next.top) / 2 - rect.top); + } } heights.push(rect.bottom - rect.top); } } + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) function mapFromLineView(lineView, line, lineN) { if (lineView.line == line) return {map: lineView.measure.map, cache: lineView.measure.cache}; @@ -1129,6 +1475,8 @@ return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; } + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. function updateExternalMeasurement(cm, line) { line = visualLine(line); var lineN = lineNo(line); @@ -1140,10 +1488,13 @@ return view; } + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. function measureChar(cm, line, ch, bias) { return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); } + // Find a line view that corresponds to the given line number. function findViewForLine(cm, lineN) { if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) return cm.display.view[findViewIndex(cm, lineN)]; @@ -1152,6 +1503,11 @@ return ext; } + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. function prepareMeasureForLine(cm, line) { var lineN = lineNo(line); var view = findViewForLine(cm, lineN); @@ -1170,6 +1526,8 @@ }; } + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). function measureCharPrepared(cm, prepared, ch, bias) { if (prepared.before) ch = -1; var key = ch + (bias || ""), found; @@ -1194,6 +1552,8 @@ var map = prepared.map; var node, start, end, collapse; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. for (var i = 0; i < map.length; i += 3) { var mStart = map[i], mEnd = map[i + 1]; if (ch < mStart) { @@ -1226,10 +1586,10 @@ } var rect; - if (node.nodeType == 3) { + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; - if (ie_lt9 && start == 0 && end == mEnd - mStart) { + if (ie_upto8 && start == 0 && end == mEnd - mStart) { rect = node.parentNode.getBoundingClientRect(); } else if (ie && cm.options.lineWrapping) { var rects = range(node, start, end).getClientRects(); @@ -1240,7 +1600,7 @@ } else { rect = range(node, start, end).getBoundingClientRect(); } - } else { + } else { // If it is a widget, simply get the box for the whole widget. if (start > 0) collapse = bias = "right"; var rects; if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) @@ -1248,7 +1608,7 @@ else rect = node.getBoundingClientRect(); } - if (ie_lt9 && !start && (!rect || !rect.left && !rect.right)) { + if (ie_upto8 && !start && (!rect || !rect.left && !rect.right)) { var rSpan = node.parentNode.getClientRects()[0]; if (rSpan) rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; @@ -1286,7 +1646,7 @@ function clearCaches(cm) { clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = null; + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; cm.display.lineNumChars = null; } @@ -1294,7 +1654,9 @@ function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } - // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page" + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"/null (editor), or "page". function intoCoordSystem(cm, lineObj, rect, context) { if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { var size = widgetHeight(lineObj.widgets[i]); @@ -1315,8 +1677,8 @@ return rect; } - // Context may be "window", "page", "div", or "local"/null - // Result is in "div" coords + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"/null. function fromCoordSystem(cm, coords, context) { if (context == "div") return coords; var left = coords.left, top = coords.top; @@ -1339,6 +1701,9 @@ return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); } + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. function cursorCoords(cm, pos, context, lineObj, preparedMeasure) { lineObj = lineObj || getLine(cm.doc, pos.line); if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); @@ -1369,22 +1734,31 @@ return val; } + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. function estimateCoords(cm, pos) { - var left = 0; + var left = 0, pos = clipPos(cm.doc, pos); if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; var lineObj = getLine(cm.doc, pos.line); var top = heightAtLine(lineObj) + paddingTop(cm.display); return {left: left, right: left, top: top, bottom: top + lineObj.height}; } + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. function PosWithInfo(line, ch, outside, xRel) { - var pos = new Pos(line, ch); + var pos = Pos(line, ch); pos.xRel = xRel; if (outside) pos.outside = true; return pos; } - // Coords must be lineSpace-local + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). function coordsChar(cm, x, y) { var doc = cm.doc; y += cm.display.viewOffset; @@ -1447,6 +1821,7 @@ } var measureText; + // Compute the default text height. function textHeight(display) { if (display.cachedTextHeight != null) return display.cachedTextHeight; if (measureText == null) { @@ -1466,67 +1841,65 @@ return height || 1; } + // Compute the default character width. function charWidth(display) { if (display.cachedCharWidth != null) return display.cachedCharWidth; - var anchor = elt("span", "x"); + var anchor = elt("span", "xxxxxxxxxx"); var pre = elt("pre", [anchor]); removeChildrenAndAdd(display.measure, pre); - var width = anchor.offsetWidth; + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; if (width > 2) display.cachedCharWidth = width; return width || 10; } // OPERATIONS - // Operations are used to wrap changes in such a way that each - // change won't have to update the cursor and display (which would - // be awkward, slow, and error-prone), but instead updates are - // batched and then all combined and executed at once. + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. var nextOpId = 0; + // Start a new operation. function startOperation(cm) { cm.curOp = { - // An array of ranges of lines that have to be updated. See - // updateDisplay. - viewChanged: false, - forceUpdate: false, - updateInput: null, - userSelChange: null, - changeObjs: null, - selectionChanged: false, - cursorActivity: false, - updateMaxLine: false, - scrollLeft: null, scrollTop: null, - scrollToPos: null, - id: ++nextOpId + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivity: false, // Whether to fire a cursorActivity event + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + id: ++nextOpId // Unique ID }; if (!delayedCallbackDepth++) delayedCallbacks = []; } + // Finish an operation, updating the display and signalling delayed events function endOperation(cm) { var op = cm.curOp, doc = cm.doc, display = cm.display; cm.curOp = null; + if (op.updateMaxLine) findMaxLine(cm); + + // If it looks like an update might be needed, call updateDisplay if (op.viewChanged || op.forceUpdate || op.scrollTop != null || op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo)) { - var updated = updateDisplay(cm, op.viewChanged, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping) { + var updated = updateDisplay(cm, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop; } + // If no update was run, but the selection changed, redraw that. if (!updated && op.selectionChanged) updateSelection(cm); + if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm); - if (op.updateMaxLine) computeMaxLength(cm); - if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) { - var width = measureChar(cm, display.maxLine, display.maxLine.text.length).left; - display.maxLineChanged = false; - var minWidth = Math.max(0, width + 3 + scrollerCutOff); - var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + minWidth - display.scroller.clientWidth); - display.sizer.style.minWidth = minWidth + "px"; - if (maxScrollLeft < doc.scrollLeft && op.scrollLeft == null) - setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true); - updateScrollbars(cm); - } - + // Propagate the scroll position to the actual DOM scroller if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) { var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top; @@ -1536,6 +1909,7 @@ display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left; alignHorizontally(cm); } + // If we need to scroll a specific position into view, do so. if (op.scrollToPos) { var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from), clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin); @@ -1545,8 +1919,10 @@ if (op.selectionChanged) restartBlink(cm); if (cm.state.focused && op.updateInput) - resetInput(cm, op.userSelChange); + resetInput(cm, op.typing); + // Fire events for markers that are hidden/unidden by editing or + // undoing var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; if (hidden) for (var i = 0; i < hidden.length; ++i) if (!hidden[i].lines.length) signal(hidden[i], "hide"); @@ -1558,53 +1934,89 @@ delayed = delayedCallbacks; delayedCallbacks = null; } - if (op.changeObjs) for (var i = 0; i < op.changeObjs.length; i++) - signal(cm, "change", cm, op.changeObjs[i]); + // Fire change events, and delayed event handlers + if (op.changeObjs) { + for (var i = 0; i < op.changeObjs.length; i++) + signal(cm, "change", cm, op.changeObjs[i]); + signal(cm, "changes", cm, op.changeObjs); + } if (op.cursorActivity) signal(cm, "cursorActivity", cm); if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i](); } + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) return f(); + startOperation(cm); + try { return f(); } + finally { endOperation(cm); } + } // Wraps a function in an operation. Returns the wrapped function. - function operation(cm1, f) { + function operation(cm, f) { return function() { - var cm = cm1 || this, withOp = !cm.curOp; - if (withOp) startOperation(cm); - try { var result = f.apply(cm, arguments); } - finally { if (withOp) endOperation(cm); } - return result; + if (cm.curOp) return f.apply(cm, arguments); + startOperation(cm); + try { return f.apply(cm, arguments); } + finally { endOperation(cm); } }; } - function docOperation(f) { + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { return function() { - var withOp = this.cm && !this.cm.curOp, result; - if (withOp) startOperation(this.cm); - try { result = f.apply(this, arguments); } - finally { if (withOp) endOperation(this.cm); } - return result; + if (this.curOp) return f.apply(this, arguments); + startOperation(this); + try { return f.apply(this, arguments); } + finally { endOperation(this); } }; } - function runInOp(cm, f) { - var withOp = !cm.curOp, result; - if (withOp) startOperation(cm); - try { result = f(); } - finally { if (withOp) endOperation(cm); } - return result; + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) return f.apply(this, arguments); + startOperation(cm); + try { return f.apply(this, arguments); } + finally { endOperation(cm); } + }; } - // CHANGE TRACKING - - // Updates the display.view data structure for a given change to - // the document. From and to are in pre-change coordinates. Lendiff - // is the amount of lines added or subtracted by the change. - function regChange(cm, from, to, lendiff) { - if (from == null) from = cm.doc.first; - if (to == null) to = cm.doc.first + cm.doc.size; - if (!lendiff) lendiff = 0; + // VIEW TRACKING - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); } + return array; + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) from = cm.doc.first; + if (to == null) to = cm.doc.first + cm.doc.size; + if (!lendiff) lendiff = 0; var display = cm.display; if (lendiff && to < display.viewTo && @@ -1614,23 +2026,45 @@ cm.curOp.viewChanged = true; if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + resetView(cm); } else if (to <= display.viewFrom) { // Change before - display.viewFrom += lendiff; - display.viewTo += lendiff; + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap resetView(cm); } else if (from <= display.viewFrom) { // Top overlap - display.view = display.view.slice(findViewIndex(cm, to)); - display.viewFrom = to + lendiff; - display.viewTo += lendiff; + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } } else if (to >= display.viewTo) { // Bottom overlap - display.view = display.view.slice(0, findViewIndex(cm, from)); - display.viewTo = from; + var cut = viewCuttingPoint(cm, from, from, -1); + if (cut) { + display.view = display.view.slice(0, cut.index); + display.viewTo = cut.lineN; + } else { + resetView(cm); + } } else { // Gap in the middle - display.view = display.view.slice(0, findViewIndex(cm, from)) - .concat(buildViewArray(cm, from, to + lendiff)) - .concat(display.view.slice(findViewIndex(cm, to))); - display.viewTo += lendiff; + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } } var ext = display.externalMeasured; @@ -1642,7 +2076,8 @@ } } - // Type must be one of "text", "gutter", "class", "widget" + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" function regLineChange(cm, line, type) { cm.curOp.viewChanged = true; var display = cm.display, ext = cm.display.externalMeasured; @@ -1656,12 +2091,15 @@ if (indexOf(arr, type) == -1) arr.push(type); } + // Clear the view. function resetView(cm) { cm.display.viewFrom = cm.display.viewTo = cm.doc.first; cm.display.view = []; cm.display.viewOffset = 0; } + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. function findViewIndex(cm, n) { if (n >= cm.display.viewTo) return null; n -= cm.display.viewFrom; @@ -1673,6 +2111,31 @@ } } + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans) return {index: index, lineN: newN}; + for (var i = 0, n = cm.display.viewFrom; i < index; i++) + n += view[i].size; + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) return null; + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) return null; + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN}; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. function adjustView(cm, from, to) { var display = cm.display, view = display.view; if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { @@ -1692,26 +2155,21 @@ display.viewTo = to; } - function LineView(doc, line, lineN) { - this.line = line; - this.rest = visualLineContinued(line); - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; } - return array; + return dirty; } // INPUT HANDLING + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. function slowPoll(cm) { if (cm.display.pollingFast) return; cm.display.poll.set(cm.options.pollInterval, function() { @@ -1720,6 +2178,9 @@ }); } + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. function fastPoll(cm) { var missed = false; cm.display.pollingFast = true; @@ -1731,45 +2192,56 @@ cm.display.poll.set(20, p); } - // prevInput is a hack to work with IME. If we reset the textarea - // on every change, that breaks IME. So we look for changes - // compared to the previous content instead. (Modern browsers have - // events that indicate IME taking place, but these are not widely - // supported or compatible enough yet to rely on.) + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). function readInput(cm) { var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.options.disableInput) return false; - if (cm.state.pasteIncoming && cm.state.fakedLastChar) { - input.value = input.value.substring(0, input.value.length - 1); - cm.state.fakedLastChar = false; - } var text = input.value; + // If nothing changed, bail. if (text == prevInput && !cm.somethingSelected()) return false; - if (old_ie && !ie_lt9 && cm.display.inputHasSelection === text) { - resetInput(cm, true); + // Work around nonsensical selection resetting in IE9/10 + if (ie && !ie_upto8 && cm.display.inputHasSelection === text) { + resetInput(cm); return false; } var withOp = !cm.curOp; if (withOp) startOperation(cm); cm.display.shift = false; + + // Find the part of the input that is actually new var same = 0, l = Math.min(prevInput.length, text.length); while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; var inserted = text.slice(same), textLines = splitLines(inserted); + + // When pasing N lines into N selections, insert one line per selection var multiPaste = cm.state.pasteIncoming && textLines.length > 1 && doc.sel.ranges.length == textLines.length; + // Normal behavior is to insert the new text into every selection for (var i = doc.sel.ranges.length - 1; i >= 0; i--) { var range = doc.sel.ranges[i]; var from = range.from(), to = range.to(); + // Handle deletion if (same < prevInput.length) from = Pos(from.line, from.ch - (prevInput.length - same)); - else if (cm.state.overwrite && cmp(from, to) == 0 && !cm.state.pasteIncoming) + // Handle overwrite + else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming) to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); var updateInput = cm.curOp.updateInput; var changeEvent = {from: from, to: to, text: multiPaste ? [textLines[i]] : textLines, origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; makeChange(cm.doc, changeEvent); signalLater(cm, "inputRead", cm, changeEvent); + // When an 'electric' character is inserted, immediately trigger a reindent if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && cm.options.smartIndent && range.head.ch < 100 && (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) { @@ -1783,74 +2255,78 @@ } ensureCursorVisible(cm); cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; - if (text.length > 1000 || text.indexOf("\n") > -1) clearInput(cm); + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = ""; else cm.display.prevInput = text; if (withOp) endOperation(cm); cm.state.pasteIncoming = cm.state.cutIncoming = false; return true; } - function resetInput(cm, user) { + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + function resetInput(cm, typing) { var minimal, selected, doc = cm.doc; - var range = doc.sel.primary(); - if (!range.empty()) { + if (cm.somethingSelected()) { cm.display.prevInput = ""; + var range = doc.sel.primary(); minimal = hasCopyEvent && (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); var content = minimal ? "-" : selected || cm.getSelection(); cm.display.input.value = content; if (cm.state.focused) selectInput(cm.display.input); - if (old_ie && !ie_lt9) cm.display.inputHasSelection = content; - } else if (user) { - clearInput(cm); - } - cm.display.inaccurateSelection = minimal; - } - - function clearInput(cm) { - if (ie_lt9) { - cm.display.prevInput = cm.display.input.value = "_"; - cm.display.input.setSelectionRange(1, 1); - if (old_ie && !ie_lt9) cm.display.inputHasSelection = null; - } else { + if (ie && !ie_upto8) cm.display.inputHasSelection = content; + } else if (!typing) { cm.display.prevInput = cm.display.input.value = ""; + if (ie && !ie_upto8) cm.display.inputHasSelection = null; } + cm.display.inaccurateSelection = minimal; } function focusInput(cm) { - if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input)) + if (cm.options.readOnly != "nocursor" && (!mobile || activeElt() != cm.display.input)) cm.display.input.focus(); } + function ensureFocus(cm) { + if (!cm.state.focused) { focusInput(cm); onFocus(cm); } + } + function isReadOnly(cm) { return cm.options.readOnly || cm.doc.cantEdit; } // EVENT HANDLERS + // Attach the necessary event handlers when initializing the editor function registerEventHandlers(cm) { var d = cm.display; on(d.scroller, "mousedown", operation(cm, onMouseDown)); - if (old_ie) + // Older IE's will not fire a second mousedown for a double click + if (ie_upto10) on(d.scroller, "dblclick", operation(cm, function(e) { if (signalDOMEvent(cm, e)) return; var pos = posFromMouse(cm, e); if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; e_preventDefault(e); - var word = findWordAt(getLine(cm.doc, pos.line).text, pos); - extendSelection(cm.doc, word.from, word.to); + var word = findWordAt(cm.doc, pos); + extendSelection(cm.doc, word.anchor, word.head); })); else on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); + // Prevent normal selection in the editor (we handle our own) on(d.lineSpace, "selectstart", function(e) { if (!eventInWidget(d, e)) e_preventDefault(e); }); - // Gecko browsers fire contextmenu *after* opening the menu, at + // Some browsers fire contextmenu *after* opening the menu, at // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for Gecko. + // handled in onMouseDown for these browsers. if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. on(d.scroller, "scroll", function() { if (d.scroller.clientHeight) { setScrollTop(cm, d.scroller.scrollTop); @@ -1865,42 +2341,40 @@ if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft); }); + // Listen to wheel events in order to try and update the viewport on time. on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); + // Prevent clicks in the scrollbars from killing focus function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); } on(d.scrollbarH, "mousedown", reFocus); on(d.scrollbarV, "mousedown", reFocus); // Prevent wrapper from ever scrolling on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + // When the window resizes, we need to refresh active editors. var resizeTimer; function onResize() { if (resizeTimer == null) resizeTimer = setTimeout(function() { resizeTimer = null; // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = knownScrollbarWidth = null; - clearCaches(cm); - runInOp(cm, bind(regChange, cm)); + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = knownScrollbarWidth = null; + cm.setSize(); }, 100); } on(window, "resize", onResize); - // Above handler holds on to the editor and its data structures. - // Here we poll to unregister it when the editor is no longer in - // the document, so that it can be garbage-collected. + // The above handler holds on to the editor and its data + // structures. Here we poll to unregister it when the editor is no + // longer in the document, so that it can be garbage-collected. function unregister() { - for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {} - if (p) setTimeout(unregister, 5000); + if (contains(document.body, d.wrapper)) setTimeout(unregister, 5000); else off(window, "resize", onResize); } setTimeout(unregister, 5000); - on(d.input, "keyup", operation(cm, function(e) { - if (signalDOMEvent(cm, e)) return; - if (e.keyCode == 16) cm.display.shift = false; - })); + on(d.input, "keyup", operation(cm, onKeyUp)); on(d.input, "input", function() { - if (old_ie && !ie_lt9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; + if (ie && !ie_upto8 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; fastPoll(cm); }); on(d.input, "keydown", operation(cm, onKeyDown)); @@ -1909,8 +2383,7 @@ on(d.input, "blur", bind(onBlur, cm)); function drag_(e) { - if (signalDOMEvent(cm, e)) return; - e_stop(e); + if (!signalDOMEvent(cm, e)) e_stop(e); } if (cm.options.dragDrop) { on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); @@ -1920,20 +2393,11 @@ } on(d.scroller, "paste", function(e) { if (eventInWidget(d, e)) return; + cm.state.pasteIncoming = true; focusInput(cm); fastPoll(cm); }); on(d.input, "paste", function() { - // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206 - // Add a char to the end of textarea before paste occur so that - // selection doesn't span to the end of textarea. - if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) { - var start = d.input.selectionStart, end = d.input.selectionEnd; - d.input.value += "$"; - d.input.selectionStart = start; - d.input.selectionEnd = end; - cm.state.fakedLastChar = true; - } cm.state.pasteIncoming = true; fastPoll(cm); }); @@ -1952,35 +2416,49 @@ // Needed to handle Tab key in KHTML if (khtml) on(d.sizer, "mouseup", function() { - if (document.activeElement == d.input) d.input.blur(); + if (activeElt() == d.input) d.input.blur(); focusInput(cm); }); } + // MOUSE EVENTS + + // Return true when the given mouse event happened in a widget function eventInWidget(display, e) { for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true; } } + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. function posFromMouse(cm, e, liberal, forRect) { var display = cm.display; if (!liberal) { var target = e_target(e); - if (target == display.scrollbarH || target == display.scrollbarH.firstChild || - target == display.scrollbarV || target == display.scrollbarV.firstChild || + if (target == display.scrollbarH || target == display.scrollbarV || target == display.scrollbarFiller || target == display.gutterFiller) return null; } var x, y, space = display.lineSpace.getBoundingClientRect(); // Fails unpredictably on IE[67] when mouse is dragged around quickly. try { x = e.clientX - space.left; y = e.clientY - space.top; } catch (e) { return null; } - var coords = coordsChar(cm, x, y); - if (forRect && coords.ch == getLine(cm.doc, coords.line).text.length && coords.xRel == 1) - coords = Pos(coords.line, Math.round((x - paddingLeft(cm.display)) / charWidth(cm.display))); + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff); + } return coords; } + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. function onMouseDown(e) { if (signalDOMEvent(this, e)) return; var cm = this, display = cm.display; @@ -1988,6 +2466,8 @@ if (eventInWidget(display, e)) { if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. display.scroller.draggable = false; setTimeout(function(){display.scroller.draggable = true;}, 100); } @@ -1995,6 +2475,7 @@ } if (clickInGutter(cm, e)) return; var start = posFromMouse(cm, e); + window.focus(); switch (e_button(e)) { case 1: @@ -2010,14 +2491,14 @@ e_preventDefault(e); break; case 3: - if (captureRightClick) onContextMenu.call(cm, cm, e); + if (captureRightClick) onContextMenu(cm, e); break; } } var lastClick, lastDoubleClick; function leftButtonDown(cm, e, start) { - if (!cm.state.focused) onFocus(cm); + setTimeout(bind(ensureFocus, cm), 0); var now = +new Date, type; if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { @@ -2030,14 +2511,16 @@ lastClick = {time: now, pos: start}; } - var sel = cm.doc.sel; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !sel.primary().empty() && + var sel = cm.doc.sel, addNew = mac ? e.metaKey : e.ctrlKey; + if (cm.options.dragDrop && dragAndDrop && !addNew && !isReadOnly(cm) && type == "single" && sel.contains(start) > -1 && sel.somethingSelected()) leftButtonStartDrag(cm, e, start); else - leftButtonNoDrag(cm, e, start, type); + leftButtonSelect(cm, e, start, type, addNew); } + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. function leftButtonStartDrag(cm, e, start) { var display = cm.display; var dragEnd = operation(cm, function(e2) { @@ -2050,7 +2533,7 @@ extendSelection(cm.doc, start); focusInput(cm); // Work around unexplainable focus problem in IE9 (#2127) - if (old_ie && !ie_lt9) + if (ie_upto10 && !ie_upto8) setTimeout(function() {document.body.focus(); focusInput(cm);}, 20); } }); @@ -2063,68 +2546,96 @@ on(display.scroller, "drop", dragEnd); } - function leftButtonNoDrag(cm, e, start, type) { + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, e, start, type, addNew) { var display = cm.display, doc = cm.doc; e_preventDefault(e); - if (mac ? e.metaKey : e.ctrlKey) { - var inside = doc.sel.contains(start); - if (inside > -1) - setSelection(doc, new Selection(doc.sel.ranges, inside), false); + var ourRange, ourIndex, startSel = doc.sel; + if (addNew) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + ourRange = doc.sel.ranges[ourIndex]; else - setSelection(doc, normalizeSelection(doc.sel.ranges.concat([new Range(start, start)]), - doc.sel.ranges.length), false); - } else if (e.altKey) { - setSimpleSelection(doc, start, start); + ourRange = new Range(start, start); + } else { + ourRange = doc.sel.primary(); + } + + if (e.altKey) { type = "rect"; + if (!addNew) ourRange = new Range(start, start); start = posFromMouse(cm, e, true, true); + ourIndex = -1; + } else if (type == "double") { + var word = findWordAt(doc, start); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, word.anchor, word.head); + else + ourRange = word; + } else if (type == "triple") { + var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, line.anchor, line.head); + else + ourRange = line; } else { - extendSelection(doc, start, start); + ourRange = extendRange(doc, ourRange, start); } - var lastPos = start, startSel = doc.sel; - function extendTo(pos, force) { - if (!force && cmp(lastPos, pos) == 0) return; + if (!addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + } else if (ourIndex > -1) { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } else { + ourIndex = doc.sel.ranges.length; + setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) return; lastPos = pos; if (type == "rect") { - var ranges = []; - var left = Math.min(start.ch, pos.ch), right = Math.max(start.ch, pos.ch); + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc, line).text; - if (text.length >= left) - ranges.push(new Range(Pos(line, left), Pos(line, Math.min(text.length, right)))); + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + else if (text.length > leftPos) + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } if (!ranges.length) ranges.push(new Range(start, start)); - setSelection(doc, new Selection(ranges, ranges.length - 1)); + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), sel_mouse); } else { - var oldRange = startSel.primary(); + var oldRange = ourRange; var anchor = oldRange.anchor, head = pos; if (type != "single") { if (type == "double") - var range = findWordAt(getLine(doc, pos.line).text, pos); + var range = findWordAt(doc, pos); else - var range = {from: Pos(pos.line, 0), to: clipPos(doc, Pos(pos.line + 1, 0))}; - if (cmp(range.to, anchor) > 0) { - head = range.to; - anchor = minPos(oldRange.from(), range.from); + var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); } else { - head = range.from; - anchor = maxPos(oldRange.to(), range.to); + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); } } var ranges = startSel.ranges.slice(0); - ranges[startSel.primIndex] = new Range(clipPos(doc, anchor), head); - setSelection(doc, normalizeSelection(ranges, startSel.primIndex)); + ranges[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); } } - if (type == "double" || type == "triple") { - extendTo(start, true); - startSel = doc.sel; - } - var editorSize = display.wrapper.getBoundingClientRect(); // Used to ensure timeout re-tries don't fire when another extend // happened in the meantime (clearTimeout isn't reliable -- at @@ -2137,7 +2648,7 @@ var cur = posFromMouse(cm, e, true, type == "rect"); if (!cur) return; if (cmp(cur, lastPos) != 0) { - if (!cm.state.focused) onFocus(cm); + ensureFocus(cm); extendTo(cur); var visible = visibleLines(display, doc); if (cur.line >= visible.to || cur.line < visible.from) @@ -2158,10 +2669,11 @@ focusInput(cm); off(document, "mousemove", move); off(document, "mouseup", up); + doc.history.lastSelOrigin = null; } var move = operation(cm, function(e) { - if (!old_ie && !e_button(e)) done(e); + if ((ie && !ie_upto9) ? !e.buttons : !e_button(e)) done(e); else extend(e); }); var up = operation(cm, done); @@ -2169,6 +2681,8 @@ on(document, "mouseup", up); } + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. function gutterEvent(cm, e, type, prevent, signalfn) { try { var mX = e.clientX, mY = e.clientY; } catch(e) { return false; } @@ -2192,11 +2706,6 @@ } } - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) return false; - return gutterEvent(cm, e, "gutterContextMenu", false, signal); - } - function clickInGutter(cm, e) { return gutterEvent(cm, e, "gutterClick", true, signalLater); } @@ -2210,9 +2719,11 @@ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; e_preventDefault(e); - if (old_ie) lastDrop = +new Date; + if (ie_upto10) lastDrop = +new Date; var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; if (!pos || isReadOnly(cm)) return; + // Might be a file drop, in which case we simply extract the text + // and insert it. if (files && files.length && window.FileReader && window.File) { var n = files.length, text = Array(n), read = 0; var loadFile = function(file, i) { @@ -2223,13 +2734,13 @@ pos = clipPos(cm.doc, pos); var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; makeChange(cm.doc, change); - setSelectionAddToHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); } }; reader.readAsText(file); }; for (var i = 0; i < n; ++i) loadFile(files[i], i); - } else { + } else { // Normal drop // Don't do a replace if the drop happened inside of the selected text. if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { cm.state.draggingText(e); @@ -2241,7 +2752,7 @@ var text = e.dataTransfer.getData("Text"); if (text) { var selected = cm.state.draggingText && cm.listSelections(); - setSimpleSelection(cm.doc, pos); + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); if (selected) for (var i = 0; i < selected.length; ++i) replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); cm.replaceSelection(text, "around", "paste"); @@ -2253,11 +2764,10 @@ } function onDragStart(cm, e) { - if (old_ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (ie_upto10 && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; - var txt = cm.getSelection(); - e.dataTransfer.setData("Text", txt); + e.dataTransfer.setData("Text", cm.getSelection()); // Use dummy image instead of default browsers image. // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. @@ -2275,15 +2785,21 @@ } } + // SCROLL EVENTS + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. function setScrollTop(cm, val) { if (Math.abs(cm.doc.scrollTop - val) < 2) return; cm.doc.scrollTop = val; - if (!gecko) updateDisplay(cm, false, {top: val}); + if (!gecko) updateDisplay(cm, {top: val}); if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; - if (gecko) updateDisplay(cm, false); + if (gecko) updateDisplay(cm); startWorker(cm, 100); } + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. function setScrollLeft(cm, val, isScroller) { if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); @@ -2309,7 +2825,7 @@ // know one. These don't have to be accurate -- the result of them // being wrong would just be a slight flicker on the first wheel // scroll (if it is large enough). - if (old_ie) wheelPixelsPerUnit = -.53; + if (ie) wheelPixelsPerUnit = -.53; else if (gecko) wheelPixelsPerUnit = 15; else if (chrome) wheelPixelsPerUnit = -.7; else if (safari) wheelPixelsPerUnit = -1/3; @@ -2355,12 +2871,14 @@ return; } + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). if (dy && wheelPixelsPerUnit != null) { var pixels = dy * wheelPixelsPerUnit; var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; if (pixels < 0) top = Math.max(0, top + pixels - 50); else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplay(cm, false, {top: top, bottom: bot}); + updateDisplay(cm, {top: top, bottom: bot}); } if (wheelSamples < 20) { @@ -2384,6 +2902,9 @@ } } + // KEY EVENTS + + // Run a handler that was bound to a key. function doHandleBinding(cm, bound, dropShift) { if (typeof bound == "string") { bound = commands[bound]; @@ -2404,6 +2925,7 @@ return done; } + // Collect the currently active keymaps. function allKeyMaps(cm) { var maps = cm.state.keyMaps.slice(0); if (cm.options.extraKeys) maps.push(cm.options.extraKeys); @@ -2412,8 +2934,9 @@ } var maybeTransition; + // Handle a key from the keydown event. function handleKeyBinding(cm, e) { - // Handle auto keymap transitions + // Handle automatic keymap transitions var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto; clearTimeout(maybeTransition); if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { @@ -2443,12 +2966,12 @@ if (handled) { e_preventDefault(e); restartBlink(cm); - if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; } signalLater(cm, "keyHandled", cm, name, e); } return handled; } + // Handle a key from the keypress event function handleCharBinding(cm, e, ch) { var handled = lookupKey("'" + ch + "'", allKeyMaps(cm), function(b) { return doHandleBinding(cm, b, true); }); @@ -2463,19 +2986,43 @@ var lastStoppedKey = null; function onKeyDown(e) { var cm = this; - if (!cm.state.focused) onFocus(cm); + ensureFocus(cm); if (signalDOMEvent(cm, e)) return; - if (old_ie && e.keyCode == 27) e.returnValue = false; - var code = e.keyCode; // IE does strange things with escape. + if (ie_upto10 && e.keyCode == 27) e.returnValue = false; + var code = e.keyCode; cm.display.shift = code == 16 || e.shiftKey; var handled = handleKeyBinding(cm, e); if (presto) { lastStoppedKey = handled ? code : null; // Opera has no cut event... we try to at least catch the key combo if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - cm.replaceSelection(""); + cm.replaceSelection("", null, "cut"); } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + showCrossHair(cm); + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + lineDiv.className += " CodeMirror-crosshair"; + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + lineDiv.className = lineDiv.className.replace(" CodeMirror-crosshair", ""); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (signalDOMEvent(this, e)) return; + if (e.keyCode == 16) this.doc.sel.shift = false; } function onKeyPress(e) { @@ -2486,10 +3033,12 @@ if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; var ch = String.fromCharCode(charCode == null ? keyCode : charCode); if (handleCharBinding(cm, e, ch)) return; - if (old_ie && !ie_lt9) cm.display.inputHasSelection = null; + if (ie && !ie_upto8) cm.display.inputHasSelection = null; fastPoll(cm); } + // FOCUS/BLUR EVENTS + function onFocus(cm) { if (cm.options.readOnly == "nocursor") return; if (!cm.state.focused) { @@ -2498,7 +3047,7 @@ if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1) cm.display.wrapper.className += " CodeMirror-focused"; if (!cm.curOp) { - resetInput(cm, true); + resetInput(cm); if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730 } } @@ -2515,7 +3064,12 @@ setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); } + // CONTEXT MENU HANDLING + var detectingSelectAll; + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. function onContextMenu(cm, e) { if (signalDOMEvent(cm, e, "contextmenu")) return; var display = cm.display; @@ -2528,22 +3082,25 @@ // and 'resetSelectionOnContextMenu' option is true. var reset = cm.options.resetSelectionOnContextMenu; if (reset && cm.doc.sel.contains(pos) == -1) - operation(cm, setSelection)(cm.doc, simpleSelection(pos), false); + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); var oldCSS = display.input.style.cssText; display.inputDiv.style.position = "absolute"; display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: transparent; outline: none;" + - "border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);"; + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; focusInput(cm); - resetInput(cm, true); + resetInput(cm); // Adds "Select all" to context menu in FF - var hasSelection = cm.somethingSelected(); - if (!hasSelection) clearInput(cm); + if (!cm.somethingSelected()) display.input.value = display.prevInput = " "; + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. function prepareSelectAllHack() { if (display.input.selectionStart != null) { - var extval = display.input.value = "\u200b" + (hasSelection ? display.input.value : ""); + var extval = display.input.value = "\u200b" + (cm.somethingSelected() ? display.input.value : ""); display.prevInput = "\u200b"; display.input.selectionStart = 1; display.input.selectionEnd = extval.length; } @@ -2551,12 +3108,12 @@ function rehide() { display.inputDiv.style.position = "relative"; display.input.style.cssText = oldCSS; - if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; + if (ie_upto8) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; slowPoll(cm); // Try to detect the user choosing select-all if (display.input.selectionStart != null) { - if (!old_ie || ie_lt9) prepareSelectAllHack(); + if (!ie || ie_upto8) prepareSelectAllHack(); clearTimeout(detectingSelectAll); var i = 0, poll = function(){ if (display.prevInput == "\u200b" && display.input.selectionStart == 0) @@ -2568,7 +3125,7 @@ } } - if (old_ie && !ie_lt9) prepareSelectAllHack(); + if (ie && !ie_upto8) prepareSelectAllHack(); if (captureRightClick) { e_stop(e); var mouseup = function() { @@ -2581,14 +3138,23 @@ } } + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) return false; + return gutterEvent(cm, e, "gutterContextMenu", false, signal); + } + // UPDATING + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). var changeEnd = CodeMirror.changeEnd = function(change) { if (!change.text) return change.to; return Pos(change.from.line + change.text.length - 1, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); }; + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. function adjustForChange(pos, change) { if (cmp(pos, change.from) < 0) return pos; if (cmp(pos, change.to) <= 0) return changeEnd(change); @@ -2615,7 +3181,8 @@ return Pos(nw.line + (pos.line - old.line), pos.ch); } - // Hint can be "start"|"around" + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". function computeReplacedSel(doc, changes, hint) { var out = []; var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; @@ -2635,6 +3202,7 @@ return new Selection(out, doc.sel.primIndex); } + // Allow "beforeChange" event handlers to influence a change function filterChange(doc, change, update) { var obj = { canceled: false, @@ -2657,8 +3225,8 @@ return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; } - // Replace the range from from to to by the strings in replacement. - // change is a {from, to, text [, origin]} object + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. function makeChange(doc, change, ignoreReadOnly) { if (doc.cm) { if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); @@ -2675,16 +3243,16 @@ var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); if (split) { for (var i = split.length - 1; i >= 0; --i) - makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); + makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); } else { - makeChangeNoReadonly(doc, change); + makeChangeInner(doc, change); } } - function makeChangeNoReadonly(doc, change) { + function makeChangeInner(doc, change) { if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; var selAfter = computeSelAfterChange(doc, change); - addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); var rebased = []; @@ -2698,16 +3266,41 @@ }); } - function makeChangeFromHistory(doc, type) { + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { if (doc.cm && doc.cm.state.suppressEdits) return; - var hist = doc.history; - var event = (type == "undo" ? hist.done : hist.undone).pop(); - if (!event) return; + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + for (var i = 0; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + break; + } + if (i == source.length) return; + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return; + } + selAfter = event; + } + else break; + } - var anti = {changes: [], selBefore: event.selAfter, selAfter: event.selBefore, - generation: hist.generation}; - (type == "undo" ? hist.undone : hist.done).push(anti); + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); hist.generation = event.generation || ++hist.maxGeneration; var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); @@ -2716,16 +3309,18 @@ var change = event.changes[i]; change.origin = type; if (filter && !filterChange(doc, change, false)) { - (type == "undo" ? hist.done : hist.undone).length = 0; + source.length = 0; return; } - anti.changes.push(historyChangeFromChange(doc, change)); + antiChanges.push(historyChangeFromChange(doc, change)); - var after = i ? computeSelAfterChange(doc, change, null) : event.selBefore; + var after = i ? computeSelAfterChange(doc, change, null) : lst(source); makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (doc.cm) ensureCursorVisible(doc.cm); var rebased = []; + // Propagate to the linked documents linkedDocs(doc, function(doc, sharedHist) { if (!sharedHist && indexOf(rebased, doc.history) == -1) { rebaseHist(doc.history, change); @@ -2736,15 +3331,19 @@ } } + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. function shiftDoc(doc, distance) { doc.first += distance; doc.sel = new Selection(map(doc.sel.ranges, function(range) { return new Range(Pos(range.anchor.line + distance, range.anchor.ch), Pos(range.head.line + distance, range.head.ch)); }), doc.sel.primIndex); - if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance); + if (doc.cm) regChange(doc.cm, doc.first, doc.first - distance, distance); } + // More lower-level change function, handling only a single document + // (not linked ones). function makeChangeSingleDoc(doc, change, selAfter, spans) { if (doc.cm && !doc.cm.curOp) return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); @@ -2771,278 +3370,83 @@ change.removed = getBetween(doc, change.from, change.to); if (!selAfter) selAfter = computeSelAfterChange(doc, change, null); - if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans, selAfter); - else updateDoc(doc, change, spans, selAfter); - } - - function makeChangeSingleDocInEditor(cm, change, spans, selAfter) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function(line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - cm.curOp.cursorActivity = true; - - updateDoc(doc, change, spans, selAfter, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function(line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) cm.curOp.updateMaxLine = true; - } - - // Adjust frontier, schedule worker - doc.frontier = Math.min(doc.frontier, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - regLineChange(cm, from.line, "text"); - else - regChange(cm, from.line, to.line + 1, lendiff); - - if (hasHandler(cm, "change")) - (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push({ - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }); - } - - function replaceRange(doc, code, from, to, origin) { - if (!to) to = from; - if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } - if (typeof code == "string") code = splitLines(code); - makeChange(doc, {from: from, to: to, text: code, origin: origin}); + if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); + else updateDoc(doc, change, spans); + setSelectionNoUndo(doc, selAfter, sel_dontScroll); } - - // POSITION OBJECT - - function Pos(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - } - CodeMirror.Pos = Pos; - - var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; - function copyPos(x) {return Pos(x.line, x.ch);} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } - - // SELECTION - - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} - function clipPos(doc, pos) { - if (pos.line < doc.first) return Pos(doc.first, 0); - var last = doc.first + doc.size - 1; - if (pos.line > last) return Pos(last, getLine(doc, last).text.length); - return clipToLen(pos, getLine(doc, pos.line).text.length); - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) return Pos(pos.line, linelen); - else if (ch < 0) return Pos(pos.line, 0); - else return pos; - } - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} - function clipPosArray(doc, array) { - for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); - return out; - } - - function extendRange(doc, range, head, other) { - if (doc.cm && doc.cm.display.shift || doc.extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - - // If shift is held, this will move the selection anchor. Otherwise, - // it'll set the whole selection. - function extendSelection(doc, head, other, scroll) { - setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), scroll); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, scroll) { - for (var out = [], i = 0; i < doc.sel.ranges.length; i++) - out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); - var newSel = normalizeSelection(out, doc.sel.primIndex); - setSelection(doc, newSel, scroll); - } - - function replaceOneSelection(doc, i, range) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex)); - } - - function setSimpleSelection(doc, anchor, head, scroll) { - setSelection(doc, simpleSelection(anchor, head), scroll); - } - - function setSelectionAddToHistory(doc, sel) { - setSelection(doc, sel); - var lstSel = lst(doc.history.done); - if (lstSel) lstSel.selAfter = sel; - } - - function filterSelectionChange(doc, sel) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); - } - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); - else return sel; - } - - // Update the selection. Last two args are only used by - // updateDoc, since they have to be expressed in the line - // numbers before the update. - function setSelection(doc, sel, scroll) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - sel = filterSelectionChange(doc, sel); - - var bias = cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1; - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - - if (scroll !== false && doc.cm) { - doc.cm.curOp.userSelChange = true; - ensureCursorVisible(doc.cm); - } - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) return; - - doc.sel = sel; - - if (doc.cm) - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = - doc.cm.curOp.cursorActivity = true; - signalLater(doc, "cursorActivity", doc); - } - - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), false); - } - - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) out = sel.ranges.slice(0, i); - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(out, sel.primIndex) : sel; - } - - function skipAtomic(doc, pos, bias, mayClear) { - var flipped = false, curPos = pos; - var dir = bias || 1; - doc.cantEdit = false; - search: for (;;) { - var line = getLine(doc, curPos.line); - if (line.markedSpans) { - for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) break; - else {--i; continue;} - } - } - if (!m.atomic) continue; - var newPos = m.find(dir < 0 ? -1 : 1); - if (cmp(newPos, curPos) == 0) { - newPos.ch += dir; - if (newPos.ch < 0) { - if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); - else newPos = null; - } else if (newPos.ch > line.text.length) { - if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); - else newPos = null; - } - if (!newPos) { - if (flipped) { - // Driven in a corner -- no valid cursor position found at all - // -- try again *with* clearing, if we didn't already - if (!mayClear) return skipAtomic(doc, pos, bias, true); - // Otherwise, turn off editing until further notice, and return the start of the doc - doc.cantEdit = true; - return Pos(doc.first, 0); - } - flipped = true; newPos = pos; dir = -dir; - } - } - curPos = newPos; - continue search; - } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; } - } - return curPos; + }); } - } - // SCROLLING + if (doc.sel.contains(change.from, change.to) > -1) + cm.curOp.cursorActivity = true; + + updateDoc(doc, change, spans, estimateHeight(cm)); - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(); - cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin, isCursor: true}; + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function(line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + doc.frontier = Math.min(doc.frontier, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + regLineChange(cm, from.line, "text"); + else + regChange(cm, from.line, to.line + 1, lendiff); + + if (hasHandler(cm, "change") || hasHandler(cm, "changes")) + (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push({ + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }); + } + + function replaceRange(doc, code, from, to, origin) { + if (!to) to = from; + if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } + if (typeof code == "string") code = splitLines(code); + makeChange(doc, {from: from, to: to, text: code, origin: origin}); } + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. function maybeScrollWindow(cm, coords) { var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; if (coords.top + box.top < 0) doScroll = true; else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; if (doScroll != null && !phantom) { var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + - (coords.top - display.viewOffset) + "px; height: " + + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + (coords.bottom - coords.top + scrollerCutOff) + "px; left: " + coords.left + "px; width: 2px;"); cm.display.lineSpace.appendChild(scrollNode); @@ -3051,6 +3455,9 @@ } } + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). function scrollPosIntoView(cm, pos, end, margin) { if (margin == null) margin = 0; for (;;) { @@ -3073,12 +3480,17 @@ } } + // Scroll a given set of coordinates into view (immediately). function scrollIntoView(cm, x1, y1, x2, y2) { var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); } + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. function calculateScrollPos(cm, x1, y1, x2, y2) { var display = cm.display, snapMargin = textHeight(cm.display); if (y1 < 0) y1 = 0; @@ -3107,6 +3519,8 @@ return result; } + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). function addToScrollPos(cm, left, top) { if (left != null || top != null) resolveScrollToPos(cm); if (left != null) @@ -3115,6 +3529,22 @@ cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; } + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(), from = cur, to = cur; + if (!cm.options.lineWrapping) { + from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; + to = Pos(cur.line, cur.ch + 1); + } + cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. function resolveScrollToPos(cm) { var range = cm.curOp.scrollToPos; if (range) { @@ -3130,16 +3560,24 @@ // API UTILITIES + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. function indentLine(cm, n, how, aggressive) { - var doc = cm.doc; + var doc = cm.doc, state; if (how == null) how = "add"; if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. if (!cm.doc.mode.indent) how = "prev"; - else var state = getStateBefore(cm, n); + else state = getStateBefore(cm, n); } var tabSize = cm.options.tabSize; var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) line.stateAfter = null; var curSpaceString = line.text.match(/^\s*/)[0], indentation; if (!aggressive && !/\S/.test(line.text)) { indentation = 0; @@ -3171,6 +3609,8 @@ if (indentString != curSpaceString) { replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. for (var i = 0; i < doc.sel.ranges.length; i++) { var range = doc.sel.ranges[i]; if (range.head.line == n && range.head.ch < curSpaceString.length) { @@ -3183,6 +3623,9 @@ line.stateAfter = null; } + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. function changeLine(cm, handle, changeType, op) { var no = handle, line = handle, doc = cm.doc; if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); @@ -3193,8 +3636,12 @@ return line; } + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. function deleteNearSelection(cm, compute) { var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. for (var i = 0; i < ranges.length; i++) { var toKill = compute(ranges[i]); while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { @@ -3206,13 +3653,23 @@ } kill.push(toKill); } - cm.operation(function() { + // Next, remove those actual ranges. + runInOp(cm, function() { for (var i = kill.length - 1; i >= 0; i--) replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); ensureCursorVisible(cm); }); } + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. function findPosH(doc, pos, dir, unit, visually) { var line = pos.line, ch = pos.ch, origDir = dir; var lineObj = getLine(doc, line); @@ -3242,13 +3699,15 @@ if (dir < 0 && !moveOnce(!first)) break; var cur = lineObj.text.charAt(ch) || "\n"; var type = isWordChar(cur) ? "w" - : !group ? null - : /\s/.test(cur) ? null + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null : "p"; + if (group && !first && !type) type = "s"; if (sawType && sawType != type) { if (dir < 0) {dir = 1; moveOnce();} break; } + if (type) sawType = type; if (dir > 0 && !moveOnce(!first)) break; } @@ -3258,6 +3717,9 @@ return result; } + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. function findPosV(cm, pos, dir, unit) { var doc = cm.doc, x = pos.left, y; if (unit == "page") { @@ -3275,7 +3737,9 @@ return target; } - function findWordAt(line, pos) { + // Find the word at the given position (as returned by coordsChar). + function findWordAt(doc, pos) { + var line = getLine(doc, pos.line).text; var start = pos.ch, end = pos.ch; if (line) { if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; @@ -3286,13 +3750,18 @@ while (start > 0 && check(line.charAt(start - 1))) --start; while (end < line.length && check(line.charAt(end))) ++end; } - return {from: Pos(pos.line, start), to: Pos(pos.line, end)}; + return new Range(Pos(pos.line, start), Pos(pos.line, end)); } - // PROTOTYPE + // EDITOR METHODS - // The publicly visible API. Note that operation(null, f) means - // 'wrap f in an operation, performed on its `this` parameter' + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. CodeMirror.prototype = { constructor: CodeMirror, @@ -3321,14 +3790,14 @@ } }, - addOverlay: operation(null, function(spec, options) { + addOverlay: methodOp(function(spec, options) { var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); if (mode.startState) throw new Error("Overlays may not be stateful."); this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); this.state.modeGen++; regChange(this); }), - removeOverlay: operation(null, function(spec) { + removeOverlay: methodOp(function(spec) { var overlays = this.state.overlays; for (var i = 0; i < overlays.length; ++i) { var cur = overlays[i].modeSpec; @@ -3341,14 +3810,14 @@ } }), - indentLine: operation(null, function(n, dir, aggressive) { + indentLine: methodOp(function(n, dir, aggressive) { if (typeof dir != "string" && typeof dir != "number") { if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; else dir = dir ? "add" : "subtract"; } if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); }), - indentSelection: operation(null, function(how) { + indentSelection: methodOp(function(how) { var ranges = this.doc.sel.ranges, end = -1; for (var i = 0; i < ranges.length; i++) { var range = ranges[i]; @@ -3464,14 +3933,14 @@ if (line < this.doc.first) line = this.doc.first; else if (line > last) { line = last; end = true; } var lineObj = getLine(this.doc, line); - return intoCoordSystem(this, getLine(this.doc, line), {top: 0, left: 0}, mode || "page").top + - (end ? lineObj.height : 0); + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + + (end ? this.doc.height - heightAtLine(lineObj) : 0); }, defaultTextHeight: function() { return textHeight(this.display); }, defaultCharWidth: function() { return charWidth(this.display); }, - setGutterMarker: operation(null, function(line, gutterID, value) { + setGutterMarker: methodOp(function(line, gutterID, value) { return changeLine(this, line, "gutter", function(line) { var markers = line.gutterMarkers || (line.gutterMarkers = {}); markers[gutterID] = value; @@ -3480,7 +3949,7 @@ }); }), - clearGutter: operation(null, function(gutterID) { + clearGutter: methodOp(function(gutterID) { var cm = this, doc = cm.doc, i = doc.first; doc.iter(function(line) { if (line.gutterMarkers && line.gutterMarkers[gutterID]) { @@ -3492,7 +3961,7 @@ }); }), - addLineClass: operation(null, function(handle, where, cls) { + addLineClass: methodOp(function(handle, where, cls) { return changeLine(this, handle, "class", function(line) { var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; if (!line[prop]) line[prop] = cls; @@ -3502,7 +3971,7 @@ }); }), - removeLineClass: operation(null, function(handle, where, cls) { + removeLineClass: methodOp(function(handle, where, cls) { return changeLine(this, handle, "class", function(line) { var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; var cur = line[prop]; @@ -3518,7 +3987,7 @@ }); }), - addLineWidget: operation(null, function(handle, node, options) { + addLineWidget: methodOp(function(handle, node, options) { return addLineWidget(this, handle, node, options); }), @@ -3574,7 +4043,9 @@ scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); }, - triggerOnKeyDown: operation(null, onKeyDown), + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: methodOp(onKeyUp), execCommand: function(cmd) { if (commands.hasOwnProperty(cmd)) @@ -3591,17 +4062,17 @@ return cur; }, - moveH: operation(null, function(dir, unit) { + moveH: methodOp(function(dir, unit) { var cm = this; cm.extendSelectionsBy(function(range) { if (cm.display.shift || cm.doc.extend || range.empty()) return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); else return dir < 0 ? range.from() : range.to(); - }); + }, sel_move); }), - deleteH: operation(null, function(dir, unit) { + deleteH: methodOp(function(dir, unit) { var sel = this.doc.sel, doc = this.doc; if (sel.somethingSelected()) doc.replaceSelection("", null, "+delete"); @@ -3610,7 +4081,6 @@ var other = findPosH(doc, range.head, dir, unit, false); return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; }); - this.curOp.userSelChange = true; }), findPosV: function(from, amount, unit, goalColumn) { @@ -3626,9 +4096,9 @@ return cur; }, - moveV: operation(null, function(dir, unit) { - var cm = this, doc = this.doc, goals = [], addScroll; - var collapse = !cm.display.shift && !doc.sel.extend && doc.sel.somethingSelected(); + moveV: methodOp(function(dir, unit) { + var cm = this, doc = this.doc, goals = []; + var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); doc.extendSelectionsBy(function(range) { if (collapse) return dir < 0 ? range.from() : range.to(); @@ -3637,10 +4107,9 @@ goals.push(headPos.left); var pos = findPosV(cm, headPos, dir, unit); if (unit == "page" && range == doc.sel.primary()) - addScroll = charCoords(cm, pos, "div").top - headPos.top; + addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); return pos; - }); - if (addScroll) addToScrollPos(this, 0, addScroll); + }, sel_move); if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) doc.sel.ranges[i].goalColumn = goals[i]; }), @@ -3651,10 +4120,12 @@ this.display.cursorDiv.className += " CodeMirror-overwrite"; else this.display.cursorDiv.className = this.display.cursorDiv.className.replace(" CodeMirror-overwrite", ""); + + signal(this, "overwriteToggle", this, this.state.overwrite); }, - hasFocus: function() { return document.activeElement == this.display.input; }, + hasFocus: function() { return activeElt() == this.display.input; }, - scrollTo: operation(null, function(x, y) { + scrollTo: methodOp(function(x, y) { if (x != null || y != null) resolveScrollToPos(this); if (x != null) this.curOp.scrollLeft = x; if (y != null) this.curOp.scrollTop = y; @@ -3666,10 +4137,15 @@ clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co}; }, - scrollIntoView: operation(null, function(range, margin) { - if (range == null) range = {from: this.doc.sel.primary().head, to: null}; - else if (typeof range == "number") range = {from: Pos(range, 0), to: null}; - else if (range.from == null) range = {from: range, to: null}; + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) margin = this.options.cursorScrollMargin; + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null}; + } else if (range.from == null) { + range = {from: range, to: null}; + } if (!range.to) range.to = range.from; range.margin = margin || 0; @@ -3685,7 +4161,7 @@ } }), - setSize: operation(null, function(width, height) { + setSize: methodOp(function(width, height) { function interpret(val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; } @@ -3698,7 +4174,7 @@ operation: function(f){return runInOp(this, f);}, - refresh: operation(null, function() { + refresh: methodOp(function() { var oldHeight = this.display.cachedTextHeight; regChange(this); clearCaches(this); @@ -3708,12 +4184,12 @@ signal(this, "refresh", this); }), - swapDoc: operation(null, function(doc) { + swapDoc: methodOp(function(doc) { var old = this.doc; old.cm = null; attachDoc(this, doc); clearCaches(this); - resetInput(this, true); + resetInput(this); this.scrollTo(doc.scrollLeft, doc.scrollTop); signalLater(this, "swapDoc", this, old); return old; @@ -3728,10 +4204,10 @@ // OPTION DEFAULTS - var optionHandlers = CodeMirror.optionHandlers = {}; - // The default configuration options. var defaults = CodeMirror.defaults = {}; + // Functions to run when options are changed. + var optionHandlers = CodeMirror.optionHandlers = {}; function option(name, deflt, handle, notOnInit) { CodeMirror.defaults[name] = deflt; @@ -3739,6 +4215,7 @@ notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; } + // Passed to option handlers when there is no old value. var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; // These two are, on init, called from the constructor because they @@ -3802,10 +4279,10 @@ cm.display.disabled = true; } else { cm.display.disabled = false; - if (!val) resetInput(cm, true); + if (!val) resetInput(cm); } }); - option("disableInput", false, function(cm, val) {if (!val) resetInput(cm, true);}, true); + option("disableInput", false, function(cm, val) {if (!val) resetInput(cm);}, true); option("dragDrop", true); option("cursorBlinkRate", 530); @@ -3816,8 +4293,8 @@ option("flattenSpans", true, resetModeState, true); option("addModeClass", false, resetModeState, true); option("pollInterval", 100); - option("undoDepth", 40, function(cm, val){cm.doc.history.undoDepth = val;}); - option("historyEventDelay", 500); + option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); + option("historyEventDelay", 1250); option("viewportMargin", 10, function(cm){cm.refresh();}, true); option("maxHighlightLength", 10000, resetModeState, true); option("moveInputWithCursor", true, function(cm, val) { @@ -3834,6 +4311,9 @@ // Known modes, by name and by MIME var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) CodeMirror.defineMode = function(name, mode) { if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; if (arguments.length > 2) { @@ -3847,11 +4327,14 @@ mimeModes[mime] = spec; }; + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. CodeMirror.resolveMode = function(spec) { if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { spec = mimeModes[spec]; } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { var found = mimeModes[spec.name]; + if (typeof found == "string") found = {name: found}; spec = createObj(found, spec); spec.name = found.name; } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { @@ -3861,6 +4344,8 @@ else return spec || {name: "null"}; }; + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. CodeMirror.getMode = function(options, spec) { var spec = CodeMirror.resolveMode(spec); var mfactory = modes[spec.name]; @@ -3882,11 +4367,14 @@ return modeObj; }; + // Minimal default mode. CodeMirror.defineMode("null", function() { return {token: function(stream) {stream.skipToEnd();}}; }); CodeMirror.defineMIME("text/plain", "null"); + // This can be used to attach properties to mode objects from + // outside the actual mode definition. var modeExtensions = CodeMirror.modeExtensions = {}; CodeMirror.extendMode = function(mode, properties) { var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); @@ -3916,15 +4404,12 @@ helpers[type]._global.push({pred: predicate, val: value}); }; - // UTILITIES - - CodeMirror.isWordChar = isWordChar; - // MODE STATE HANDLING - // Utility functions for working with state. Exported because modes - // sometimes need to do this. - function copyState(mode, state) { + // Utility functions for working with state. Exported because nested + // modes need to do this for their inner modes. + + var copyState = CodeMirror.copyState = function(mode, state) { if (state === true) return state; if (mode.copyState) return mode.copyState(state); var nstate = {}; @@ -3934,14 +4419,14 @@ nstate[n] = val; } return nstate; - } - CodeMirror.copyState = copyState; + }; - function startState(mode, a1, a2) { + var startState = CodeMirror.startState = function(mode, a1, a2) { return mode.startState ? mode.startState(a1, a2) : true; - } - CodeMirror.startState = startState; + }; + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. CodeMirror.innerMode = function(mode, state) { while (mode.innerMode) { var info = mode.innerMode(state); @@ -3954,10 +4439,12 @@ // STANDARD COMMANDS + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), false);}, + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, singleSelection: function(cm) { - cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), false); + cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, killLine: function(cm) { deleteNearSelection(cm, function(range) { @@ -3985,10 +4472,12 @@ }, undo: function(cm) {cm.undo();}, redo: function(cm) {cm.redo();}, + undoSelection: function(cm) {cm.undoSelection();}, + redoSelection: function(cm) {cm.redoSelection();}, goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, goLineStart: function(cm) { - cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }); + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, sel_move); }, goLineStartSmart: function(cm) { cm.extendSelectionsBy(function(range) { @@ -4001,22 +4490,22 @@ return Pos(start.line, inWS ? 0 : firstNonWS); } return start; - }); + }, sel_move); }, goLineEnd: function(cm) { - cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }); + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, sel_move); }, goLineRight: function(cm) { cm.extendSelectionsBy(function(range) { var top = cm.charCoords(range.head, "div").top + 5; return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - }); + }, sel_move); }, goLineLeft: function(cm) { cm.extendSelectionsBy(function(range) { var top = cm.charCoords(range.head, "div").top + 5; return cm.coordsChar({left: 0, top: top}, "div"); - }); + }, sel_move); }, goLineUp: function(cm) {cm.moveV(-1, "line");}, goLineDown: function(cm) {cm.moveV(1, "line");}, @@ -4039,18 +4528,16 @@ indentAuto: function(cm) {cm.indentSelection("smart");}, indentMore: function(cm) {cm.indentSelection("add");}, indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) { - cm.replaceSelection("\t", null, "+input"); - }, + insertTab: function(cm) {cm.replaceSelection("\t");}, defaultTab: function(cm) { if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.replaceSelection("\t", null, "+input"); + else cm.execCommand("insertTab"); }, transposeChars: function(cm) { - cm.operation(function() { + runInOp(cm, function() { var ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { - var cur = ranges[i].head, line = getLine(cm.doc, cur.line); + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; if (cur.ch > 0 && cur.ch < line.length - 1) cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); @@ -4058,7 +4545,7 @@ }); }, newlineAndIndent: function(cm) { - operation(cm, function() { + runInOp(cm, function() { var len = cm.listSelections().length; for (var i = 0; i < len; i++) { var range = cm.listSelections()[i]; @@ -4066,7 +4553,7 @@ cm.indentLine(range.from().line + 1, null, true); ensureCursorVisible(cm); } - })(); + }); }, toggleOverwrite: function(cm) {cm.toggleOverwrite();} }; @@ -4083,14 +4570,16 @@ "Esc": "singleSelection" }; // Note that the save and find-related commands aren't defined by - // default. Unknown commands are simply ignored. + // default. User code or addons can define them. Unknown commands + // are simply ignored. keyMap.pcDefault = { "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", + "Ctrl-Home": "goDocStart", "Ctrl-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", fallthrough: "basic" }; keyMap.macDefault = { @@ -4100,15 +4589,17 @@ "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delLineLeft", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", fallthrough: ["basic", "emacsy"] }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + // Very basic readline/emacs-style bindings, which are standard on Mac. keyMap.emacsy = { "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; // KEYMAP DISPATCH @@ -4117,7 +4608,11 @@ else return val; } - function lookupKey(name, maps, handle) { + // Given an array of keymaps and a key name, call handle on any + // bindings found, until that returns a truthy value, at which point + // we consider the key handled. Implements things like binding a key + // to false stopping further handling and keymap fallthrough. + var lookupKey = CodeMirror.lookupKey = function(name, maps, handle) { function lookup(map) { map = getKeyMap(map); var found = map[name]; @@ -4129,7 +4624,7 @@ if (fallthrough == null) return false; if (Object.prototype.toString.call(fallthrough) != "[object Array]") return lookup(fallthrough); - for (var i = 0, e = fallthrough.length; i < e; ++i) { + for (var i = 0; i < fallthrough.length; ++i) { var done = lookup(fallthrough[i]); if (done) return done; } @@ -4140,12 +4635,17 @@ var done = lookup(maps[i]); if (done) return done != "stop"; } - } - function isModifierKey(event) { + }; + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + var isModifierKey = CodeMirror.isModifierKey = function(event) { var name = keyNames[event.keyCode]; return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - } - function keyName(event, noShift) { + }; + + // Look up the name of a key as indicated by an event object. + var keyName = CodeMirror.keyName = function(event, noShift) { if (presto && event.keyCode == 34 && event["char"]) return false; var name = keyNames[event.keyCode]; if (name == null || event.altGraphKey) return false; @@ -4154,10 +4654,7 @@ if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = "Cmd-" + name; if (!noShift && event.shiftKey) name = "Shift-" + name; return name; - } - CodeMirror.lookupKey = lookupKey; - CodeMirror.isModifierKey = isModifierKey; - CodeMirror.keyName = keyName; + }; // FROMTEXTAREA @@ -4171,9 +4668,7 @@ // Set autofocus to true if this textarea is focused, or if it has // autofocus and no other element is focused. if (options.autofocus == null) { - var hasFocus = document.body; - // doc.activeElement occasionally throws on IE - try { hasFocus = document.activeElement; } catch(e) {} + var hasFocus = activeElt(); options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; } @@ -4219,14 +4714,13 @@ // Fed to the mode parsers, provides helper functions to make // parsers more succinct. - // The character stream used by a mode's parser. - function StringStream(string, tabSize) { + var StringStream = CodeMirror.StringStream = function(string, tabSize) { this.pos = this.start = 0; this.string = string; this.tabSize = tabSize || 8; this.lastColumnPos = this.lastColumnValue = 0; this.lineStart = 0; - } + }; StringStream.prototype = { eol: function() {return this.pos >= this.string.length;}, @@ -4291,18 +4785,27 @@ finally { this.lineStart -= n; } } }; - CodeMirror.StringStream = StringStream; // TEXTMARKERS - function TextMarker(doc, type) { + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + var TextMarker = CodeMirror.TextMarker = function(doc, type) { this.lines = []; this.type = type; this.doc = doc; - } - CodeMirror.TextMarker = TextMarker; + }; eventMixin(TextMarker); + // Clear the marker. TextMarker.prototype.clear = function() { if (this.explicitlyCleared) return; var cm = this.doc.cm, withOp = cm && !cm.curOp; @@ -4333,17 +4836,22 @@ } } - if (min != null) regChange(cm, min, max + 1); + if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); this.lines.length = 0; this.explicitlyCleared = true; if (this.atomic && this.doc.cantEdit) { this.doc.cantEdit = false; if (cm) reCheckSelection(cm.doc); } + if (cm) signalLater(cm, "markerCleared", cm, this); if (withOp) endOperation(cm); }; - // Side can be 0 (both), -1 (left), 1 (right) + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). TextMarker.prototype.find = function(side, lineObj) { if (side == null && this.type == "bookmark") side = 1; var from, to; @@ -4362,20 +4870,27 @@ return from && {from: from, to: to}; }; + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. TextMarker.prototype.changed = function() { - var pos = this.find(-1, true), cm = this.doc.cm; + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; if (!pos || !cm) return; - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) clearLineMeasurementCacheFor(view); - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { - var lineView = cm.display.view[findViewIndex(cm, lineN)]; - if (!lineView.hidden && lineView.node && lineView.node.offsetHeight != line.height) - updateLineHeight(line, lineView.node.offsetHeight); - runInOp(cm, function() { - cm.curOp.selectionChanged = cm.curOp.forceUpdate = cm.curOp.updateMaxLine = true; - }); - } + runInOp(cm, function() { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + updateLineHeight(line, line.height + dHeight); + } + }); }; TextMarker.prototype.attachLine = function(line) { @@ -4394,21 +4909,31 @@ } }; + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). var nextMarkerId = 0; + // Create a marker, wire it up to the right lines, and function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). if (options && options.shared) return markTextShared(doc, from, to, options, type); + // Ensure we are in an operation. if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); var marker = new TextMarker(doc, type), diff = cmp(from, to); if (options) copyObj(options, marker); + // Don't connect empty markers unless clearWhenEmpty is false if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) return marker; if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) marker.collapsed = true; - marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) marker.replacedWith.ignoreEvents = true; - if (options.insertLeft) marker.replacedWith.insertLeft = true; + marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) marker.widgetNode.ignoreEvents = true; + if (options.insertLeft) marker.widgetNode.insertLeft = true; } if (marker.collapsed) { if (conflictingCollapsedRange(doc, from.line, from, to, marker) || @@ -4418,19 +4943,19 @@ } if (marker.addToHistory) - addToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); + addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); var curLine = from.line, cm = doc.cm, updateMaxLine; doc.iter(curLine, to.line + 1, function(line) { if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) updateMaxLine = true; - var span = {from: null, to: null, marker: marker}; - if (curLine == from.line) span.from = from.ch; - if (curLine == to.line) span.to = to.ch; if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); - addMarkedSpan(line, span); + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); ++curLine; }); + // lineIsHidden depends on the presence of the spans, so needs a second pass if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { if (lineIsHidden(doc, line)) updateLineHeight(line, 0); }); @@ -4447,27 +4972,31 @@ marker.atomic = true; } if (cm) { + // Sync editor state if (updateMaxLine) cm.curOp.updateMaxLine = true; if (marker.collapsed) regChange(cm, from.line, to.line + 1); else if (marker.className || marker.title || marker.startStyle || marker.endStyle) for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); if (marker.atomic) reCheckSelection(cm.doc); + signalLater(cm, "markerAdded", cm, marker); } return marker; } // SHARED TEXTMARKERS - function SharedTextMarker(markers, primary) { + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { this.markers = markers; this.primary = primary; for (var i = 0, me = this; i < markers.length; ++i) { markers[i].parent = this; on(markers[i], "clear", function(){me.clear();}); } - } - CodeMirror.SharedTextMarker = SharedTextMarker; + }; eventMixin(SharedTextMarker); SharedTextMarker.prototype.clear = function() { @@ -4485,9 +5014,9 @@ options = copyObj(options); options.shared = false; var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.replacedWith; + var widget = options.widgetNode; linkedDocs(doc, function(doc) { - if (widget) options.replacedWith = widget.cloneNode(true); + if (widget) options.widgetNode = widget.cloneNode(true); markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); for (var i = 0; i < doc.linked.length; ++i) if (doc.linked[i].isParent) return; @@ -4498,50 +5027,65 @@ // TEXTMARKER SPANS + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. function getMarkedSpanFor(spans, marker) { if (spans) for (var i = 0; i < spans.length; ++i) { var span = spans[i]; if (span.marker == marker) return span; } } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). function removeMarkedSpan(spans, span) { for (var r, i = 0; i < spans.length; ++i) if (spans[i] != span) (r || (r = [])).push(spans[i]); return r; } + // Add a span to a line. function addMarkedSpan(line, span) { line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; span.marker.attachLine(line); } + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). function markedSpansBefore(old, startCh, isInsert) { if (old) for (var i = 0, nw; i < old.length; ++i) { var span = old[i], marker = span.marker; var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push({from: span.from, - to: endsAfter ? null : span.to, - marker: marker}); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); } } return nw; } - function markedSpansAfter(old, endCh, isInsert) { if (old) for (var i = 0, nw; i < old.length; ++i) { var span = old[i], marker = span.marker; var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh, - to: span.to == null ? null : span.to - endCh, - marker: marker}); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); } } return nw; } + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. function stretchSpansOverChange(doc, change) { var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; @@ -4593,7 +5137,7 @@ if (gap > 0 && first) for (var i = 0; i < first.length; ++i) if (first[i].to == null) - (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker}); + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); for (var i = 0; i < gap; ++i) newMarkers.push(gapMarkers); newMarkers.push(last); @@ -4601,6 +5145,8 @@ return newMarkers; } + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. function clearEmptySpans(spans) { for (var i = 0; i < spans.length; ++i) { var span = spans[i]; @@ -4611,6 +5157,10 @@ return spans; } + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). function mergeOldSpans(doc, change) { var old = getOldSpans(doc, change); var stretched = stretchSpansOverChange(doc, change); @@ -4633,6 +5183,7 @@ return old; } + // Used to 'clip' out readOnly ranges when making a change. function removeReadOnlyRanges(doc, from, to) { var markers = null; doc.iter(from.line, to.line + 1, function(line) { @@ -4661,9 +5212,29 @@ return parts; } + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.detachLine(line); + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.attachLine(line); + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. function compareCollapsedMarkers(a, b) { var lenDiff = a.lines.length - b.lines.length; if (lenDiff != 0) return lenDiff; @@ -4675,6 +5246,8 @@ return b.id - a.id; } + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. function collapsedSpanAtSide(line, start) { var sps = sawCollapsedSpans && line.markedSpans, found; if (sps) for (var sp, i = 0; i < sps.length; ++i) { @@ -4688,6 +5261,9 @@ function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. function conflictingCollapsedRange(doc, lineNo, from, to, marker) { var line = getLine(doc, lineNo); var sps = sawCollapsedSpans && line.markedSpans; @@ -4704,6 +5280,10 @@ } } + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). function visualLine(line) { var merged; while (merged = collapsedSpanAtStart(line)) @@ -4711,6 +5291,8 @@ return line; } + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. function visualLineContinued(line) { var merged, lines; while (merged = collapsedSpanAtEnd(line)) { @@ -4720,11 +5302,15 @@ return lines; } + // Get the line number of the start of the visual line that the + // given line number is part of. function visualLineNo(doc, lineN) { var line = getLine(doc, lineN), vis = visualLine(line); if (line == vis) return lineN; return lineNo(vis); } + // Get the line number of the start of the next visual line after + // the given line. function visualLineEndNo(doc, lineN) { if (lineN > doc.lastLine()) return lineN; var line = getLine(doc, lineN), merged; @@ -4734,13 +5320,16 @@ return lineNo(line) + 1; } + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. function lineIsHidden(doc, line) { var sps = sawCollapsedSpans && line.markedSpans; if (sps) for (var sp, i = 0; i < sps.length; ++i) { sp = sps[i]; if (!sp.marker.collapsed) continue; if (sp.from == null) return true; - if (sp.marker.replacedWith) continue; + if (sp.marker.widgetNode) continue; if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) return true; } @@ -4754,30 +5343,17 @@ return true; for (var sp, i = 0; i < line.markedSpans.length; ++i) { sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.replacedWith && sp.from == span.to && + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && lineIsHiddenInner(doc, line, sp)) return true; } } - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.detachLine(line); - line.markedSpans = null; - } - - function attachMarkedSpans(line, spans) { - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.attachLine(line); - line.markedSpans = spans; - } - // LINE WIDGETS + // Line widgets are block elements displayed above or below a line. + var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { if (options) for (var opt in options) if (options.hasOwnProperty(opt)) this[opt] = options[opt]; @@ -4785,38 +5361,39 @@ this.node = node; }; eventMixin(LineWidget); - function widgetOperation(f) { - return function() { - var withOp = !this.cm.curOp; - if (withOp) startOperation(this.cm); - try {var result = f.apply(this, arguments);} - finally {if (withOp) endOperation(this.cm);} - return result; - }; + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + addToScrollPos(cm, null, diff); } - LineWidget.prototype.clear = widgetOperation(function() { - var ws = this.line.widgets, no = lineNo(this.line); + + LineWidget.prototype.clear = function() { + var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); if (no == null || !ws) return; for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); - if (!ws.length) this.line.widgets = null; - var aboveVisible = heightAtLine(this.line) < this.cm.doc.scrollTop; - updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this))); - if (aboveVisible) addToScrollPos(this.cm, 0, -this.height); - regLineChange(this.cm, no, "widget"); - }); - LineWidget.prototype.changed = widgetOperation(function() { - var oldH = this.height; + if (!ws.length) line.widgets = null; + var height = widgetHeight(this); + runInOp(cm, function() { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + updateLineHeight(line, Math.max(0, line.height - height)); + }); + }; + LineWidget.prototype.changed = function() { + var oldH = this.height, cm = this.cm, line = this.line; this.height = null; var diff = widgetHeight(this) - oldH; if (!diff) return; - updateLineHeight(this.line, this.line.height + diff); - var no = lineNo(this.line); - regLineChange(this.cm, no, "widget"); - }); + runInOp(cm, function() { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + updateLineHeight(line, line.height + diff); + }); + }; function widgetHeight(widget) { if (widget.height != null) return widget.height; - if (!widget.node.parentNode || widget.node.parentNode.nodeType != 1) + if (!contains(document.body, widget.node)) removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, "position: relative")); return widget.height = widget.node.offsetHeight; } @@ -4829,10 +5406,11 @@ if (widget.insertAt == null) widgets.push(widget); else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); widget.line = line; - if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) { + if (!lineIsHidden(cm.doc, line)) { var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) addToScrollPos(cm, 0, widget.height); + if (aboveVisible) addToScrollPos(cm, null, widget.height); + cm.curOp.forceUpdate = true; } return true; }); @@ -4851,6 +5429,9 @@ eventMixin(Line); Line.prototype.lineNo = function() { return lineNo(this); }; + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. function updateLine(line, text, markedSpans, estimateHeight) { line.text = text; if (line.stateAfter) line.stateAfter = null; @@ -4862,14 +5443,13 @@ if (estHeight != line.height) updateLineHeight(line, estHeight); } + // Detach a line from the document tree and its markers. function cleanUpLine(line) { line.parent = null; detachMarkedSpans(line); } - // Run the given mode's parser over a line, update the styles - // array, which contains alternating fragments of text and CSS - // classes. + // Run the given mode's parser over a line, calling f for each token. function runMode(cm, text, mode, state, f, forceToEnd) { var flattenSpans = mode.flattenSpans; if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; @@ -4903,6 +5483,10 @@ } } + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. function highlightLine(cm, line, state, forceToEnd) { // A styles array always starts with a number identifying the // mode/overlays that it is based on (for easy invalidation). @@ -4948,7 +5532,8 @@ } // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. + // update state, but don't save a style array. Used for lines that + // aren't currently visible. function processLine(cm, text, state, startAt) { var mode = cm.doc.mode; var stream = new StringStream(text, cm.options.tabSize); @@ -4960,6 +5545,9 @@ } } + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. var styleToClassCache = {}, styleToClassCacheWithMode = {}; function interpretTokenStyle(style, builder) { if (!style) return null; @@ -4979,6 +5567,11 @@ (cache[style] = style.replace(/\S+/g, "cm-$&")); } + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. function buildLineContent(cm, lineView) { // The padding-right forces the element to have a 'border', which // is needed on Webkit to be able to get line-level bounding @@ -4987,20 +5580,25 @@ var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; lineView.measure = {}; + // Iterate over the logical lines that make up this visual line. for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { var line = i ? lineView.rest[i - 1] : lineView.line, order; builder.pos = 0; builder.addToken = buildToken; - if ((old_ie || webkit) && cm.getOption("lineWrapping")) + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if ((ie || webkit) && cm.getOption("lineWrapping")) builder.addToken = buildTokenSplitSpaces(builder.addToken); if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) builder.addToken = buildTokenBadBidi(builder.addToken, order); builder.map = []; insertLineContent(line, builder, getLineStyles(cm, line)); + // Ensure at least a single node is present, for measuring. if (builder.map.length == 0) builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + // Store the map and a cache object for the current logical line if (i == 0) { lineView.measure.map = builder.map; lineView.measure.cache = {}; @@ -5010,12 +5608,6 @@ } } - if (!builder.content.firstChild) - builder.content.appendChild(document.createTextNode("\u00a0")); - - var textClass = builder.textClass ? builder.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - if (textClass) builder.pre.className = textClass; - signal(cm, "renderLine", cm, lineView.line, builder.pre); return builder; } @@ -5026,6 +5618,8 @@ return token; } + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. function buildToken(builder, text, style, startStyle, endStyle, title) { if (!text) return; var special = builder.cm.options.specialChars, mustWrap = false; @@ -5033,7 +5627,7 @@ builder.col += text.length; var content = document.createTextNode(text); builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie_lt9) mustWrap = true; + if (ie_upto8) mustWrap = true; builder.pos += text.length; } else { var content = document.createDocumentFragment(), pos = 0; @@ -5043,7 +5637,7 @@ var skipped = m ? m.index - pos : text.length - pos; if (skipped) { var txt = document.createTextNode(text.slice(pos, pos + skipped)); - if (ie_lt9) content.appendChild(elt("span", [txt])); + if (ie_upto8) content.appendChild(elt("span", [txt])); else content.appendChild(txt); builder.map.push(builder.pos, builder.pos + skipped, txt); builder.col += skipped; @@ -5057,7 +5651,7 @@ builder.col += tabWidth; } else { var txt = builder.cm.options.specialCharPlaceholder(m[0]); - if (ie_lt9) content.appendChild(elt("span", [txt])); + if (ie_upto8) content.appendChild(elt("span", [txt])); else content.appendChild(txt); builder.col += 1; } @@ -5088,6 +5682,8 @@ }; } + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. function buildTokenBadBidi(inner, order) { return function(builder, text, style, startStyle, endStyle, title) { style = style ? style + " cm-force-border" : "cm-force-border"; @@ -5108,7 +5704,7 @@ } function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.replacedWith; + var widget = !ignoreWidget && marker.widgetNode; if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); builder.content.appendChild(widget); @@ -5146,10 +5742,10 @@ } else if (sp.from > pos && nextChange > sp.from) { nextChange = sp.from; } - if (m.type == "bookmark" && sp.from == pos && m.replacedWith) foundBookmarks.push(m); + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); } if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos, + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); if (collapsed.to == null) return; } @@ -5179,12 +5775,16 @@ // DOCUMENT DATA STRUCTURE + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. function isWholeLineUpdate(doc, change) { return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); } - function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) { + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { function spansFor(n) {return markedSpans ? markedSpans[n] : null;} function update(line, text, spans) { updateLine(line, text, spans, estimateHeight); @@ -5195,11 +5795,11 @@ var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - // First adjust the line structure + // Adjust the line structure if (isWholeLineUpdate(doc, change)) { // This is a whole-line replace. Treated specially to make // sure line objects move the way they are supposed to. - for (var i = 0, e = text.length - 1, added = []; i < e; ++i) + for (var i = 0, added = []; i < text.length - 1; ++i) added.push(new Line(text[i], spansFor(i), estimateHeight)); update(lastLine, lastLine.text, lastSpans); if (nlines) doc.remove(from.line, nlines); @@ -5208,7 +5808,7 @@ if (text.length == 1) { update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); } else { - for (var added = [], i = 1, e = text.length - 1; i < e; ++i) + for (var added = [], i = 1; i < text.length - 1; ++i) added.push(new Line(text[i], spansFor(i), estimateHeight)); added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); @@ -5220,20 +5820,32 @@ } else { update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - for (var i = 1, e = text.length - 1, added = []; i < e; ++i) + for (var i = 1, added = []; i < text.length - 1; ++i) added.push(new Line(text[i], spansFor(i), estimateHeight)); if (nlines > 1) doc.remove(from.line + 1, nlines - 1); doc.insert(from.line + 1, added); } signalLater(doc, "change", doc, change); - setSelection(doc, selAfter, false); } + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + function LeafChunk(lines) { this.lines = lines; this.parent = null; - for (var i = 0, e = lines.length, height = 0; i < e; ++i) { + for (var i = 0, height = 0; i < lines.length; ++i) { lines[i].parent = this; height += lines[i].height; } @@ -5242,6 +5854,7 @@ LeafChunk.prototype = { chunkSize: function() { return this.lines.length; }, + // Remove the n lines at offset 'at'. removeInner: function(at, n) { for (var i = at, e = at + n; i < e; ++i) { var line = this.lines[i]; @@ -5251,14 +5864,18 @@ } this.lines.splice(at, n); }, + // Helper used to collapse a small branch into a single leaf. collapse: function(lines) { - lines.splice.apply(lines, [lines.length, 0].concat(this.lines)); + lines.push.apply(lines, this.lines); }, + // Insert the given array of lines at offset 'at', count them as + // having the given height. insertInner: function(at, lines, height) { this.height += height; this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this; + for (var i = 0; i < lines.length; ++i) lines[i].parent = this; }, + // Used to iterate over a part of the tree. iterN: function(at, n, op) { for (var e = at + n; at < e; ++at) if (op(this.lines[at])) return true; @@ -5268,7 +5885,7 @@ function BranchChunk(children) { this.children = children; var size = 0, height = 0; - for (var i = 0, e = children.length; i < e; ++i) { + for (var i = 0; i < children.length; ++i) { var ch = children[i]; size += ch.chunkSize(); height += ch.height; ch.parent = this; @@ -5293,7 +5910,10 @@ at = 0; } else at -= sz; } - if (this.size - n < 25) { + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { var lines = []; this.collapse(lines); this.children = [new LeafChunk(lines)]; @@ -5301,12 +5921,12 @@ } }, collapse: function(lines) { - for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines); + for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); }, insertInner: function(at, lines, height) { this.size += lines.length; this.height += height; - for (var i = 0, e = this.children.length; i < e; ++i) { + for (var i = 0; i < this.children.length; ++i) { var child = this.children[i], sz = child.chunkSize(); if (at <= sz) { child.insertInner(at, lines, height); @@ -5325,6 +5945,7 @@ at -= sz; } }, + // When a node has grown, check whether it should be split. maybeSpill: function() { if (this.children.length <= 10) return; var me = this; @@ -5347,7 +5968,7 @@ me.parent.maybeSpill(); }, iterN: function(at, n, op) { - for (var i = 0, e = this.children.length; i < e; ++i) { + for (var i = 0; i < this.children.length; ++i) { var child = this.children[i], sz = child.chunkSize(); if (at < sz) { var used = Math.min(n, sz - at); @@ -5368,42 +5989,51 @@ this.first = firstLine; this.scrollTop = this.scrollLeft = 0; this.cantEdit = false; - this.history = makeHistory(); this.cleanGeneration = 1; this.frontier = firstLine; var start = Pos(firstLine, 0); this.sel = simpleSelection(start); + this.history = new History(null); this.id = ++nextDocId; this.modeOption = mode; if (typeof text == "string") text = splitLines(text); - updateDoc(this, {from: start, to: start, text: text}, null, simpleSelection(start)); + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); }; Doc.prototype = createObj(BranchChunk.prototype, { constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). iter: function(from, to, op) { if (op) this.iterN(from - this.first, to - from, op); else this.iterN(this.first, this.first + this.size, from); }, + // Non-public interface for adding and removing lines. insert: function(at, lines) { var height = 0; - for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height; + for (var i = 0; i < lines.length; ++i) height += lines[i].height; this.insertInner(at - this.first, lines, height); }, remove: function(at, n) { this.removeInner(at - this.first, n); }, + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + getValue: function(lineSep) { var lines = getLines(this, this.first, this.first + this.size); if (lineSep === false) return lines; return lines.join(lineSep || "\n"); }, - setValue: docOperation(function(code) { + setValue: docMethodOp(function(code) { var top = Pos(this.first, 0), last = this.first + this.size - 1; makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), text: splitLines(code), origin: "setValue"}, true); - setSelectionAddToHistory(this, simpleSelection(top)); + setSelection(this, simpleSelection(top)); }), replaceRange: function(code, from, to, origin) { from = clipPos(this, from); @@ -5443,33 +6073,33 @@ listSelections: function() { return this.sel.ranges; }, somethingSelected: function() {return this.sel.somethingSelected();}, - setCursor: docOperation(function(line, ch, scroll) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, scroll); + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); }), - setSelection: docOperation(function(anchor, head, scroll) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), scroll); + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); }), - extendSelection: docOperation(function(head, other, scroll) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), scroll); + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); }), - extendSelections: docOperation(function(heads, scroll) { - extendSelections(this, clipPosArray(this, heads, scroll)); + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads, options)); }), - extendSelectionsBy: docOperation(function(f, scroll) { - extendSelections(this, map(this.sel.ranges, f), scroll); + extendSelectionsBy: docMethodOp(function(f, options) { + extendSelections(this, map(this.sel.ranges, f), options); }), - setSelections: docOperation(function(ranges, primary, scroll) { + setSelections: docMethodOp(function(ranges, primary, options) { if (!ranges.length) return; for (var i = 0, out = []; i < ranges.length; i++) out[i] = new Range(clipPos(this, ranges[i].anchor), clipPos(this, ranges[i].head)); - if (primary == null) primary = ranges.length - 1; - setSelection(this, normalizeSelection(out, primary), scroll); + if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); + setSelection(this, normalizeSelection(out, primary), options); }), - addSelection: docOperation(function(anchor, head) { + addSelection: docMethodOp(function(anchor, head, options) { var ranges = this.sel.ranges.slice(0); ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(ranges, ranges.length - 1), false); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); }), getSelection: function(lineSep) { @@ -5490,11 +6120,11 @@ } return parts; }, - replaceSelection: docOperation(function(code, collapse, origin) { + replaceSelection: docMethodOp(function(code, collapse, origin) { var dup = []; for (var i = 0; i < this.sel.ranges.length; i++) dup[i] = code; - this.replaceSelections(dup, collapse, origin); + this.replaceSelections(dup, collapse, origin || "+input"); }), replaceSelections: function(code, collapse, origin) { var changes = [], sel = this.sel; @@ -5505,19 +6135,24 @@ var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); for (var i = changes.length - 1; i >= 0; i--) makeChange(this, changes[i]); - if (newSel) setSelectionAddToHistory(this, newSel); + if (newSel) setSelectionReplaceHistory(this, newSel); else if (this.cm) ensureCursorVisible(this.cm); }, - undo: docOperation(function() {makeChangeFromHistory(this, "undo");}), - redo: docOperation(function() {makeChangeFromHistory(this, "redo");}), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend;}, historySize: function() { - var hist = this.history; - return {undo: hist.done.length, redo: hist.undone.length}; + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; + for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; + return {undo: done, redo: undone}; }, - clearHistory: function() {this.history = makeHistory(this.history.maxGeneration);}, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, markClean: function() { this.cleanGeneration = this.changeGeneration(true); @@ -5536,7 +6171,7 @@ undone: copyHistoryArray(this.history.undone)}; }, setHistory: function(histData) { - var hist = this.history = makeHistory(this.history.maxGeneration); + var hist = this.history = new History(this.history.maxGeneration); hist.done = copyHistoryArray(histData.done.slice(0), null, true); hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); }, @@ -5547,7 +6182,7 @@ setBookmark: function(pos, options) { var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), insertLeft: options && options.insertLeft, - clearWhenEmpty: false}; + clearWhenEmpty: false, shared: options && options.shared}; pos = clipPos(this, pos); return markText(this, pos, pos, realOpts, "bookmark"); }, @@ -5562,6 +6197,22 @@ } return markers; }, + findMarks: function(from, to) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo = from.line; + this.iter(from.line, to.line + 1, function(line) { + var spans = line.markedSpans; + if (spans) for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(lineNo == from.line && from.ch > span.to || + span.from == null && lineNo != from.line|| + lineNo == to.line && span.from > to.ch)) + found.push(span.marker.parent || span.marker); + } + ++lineNo; + }); + return found; + }, getAllMarks: function() { var markers = []; this.iter(function(line) { @@ -5628,7 +6279,7 @@ if (other.history == this.history) { var splitIds = [other.id]; linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); - other.history = makeHistory(); + other.history = new History(null); other.history.done = copyHistoryArray(this.history.done, splitIds); other.history.undone = copyHistoryArray(this.history.undone, splitIds); } @@ -5639,9 +6290,10 @@ getEditor: function() {return this.cm;} }); + // Public alias. Doc.prototype.eachLine = Doc.prototype.iter; - // The Doc methods that should be available on CodeMirror instances + // Set up methods on CodeMirror's prototype to redirect to the editor's document. var dontDelegate = "iter insert remove copy getEditor".split(" "); for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) CodeMirror.prototype[prop] = (function(method) { @@ -5650,6 +6302,7 @@ eventMixin(Doc); + // Call f for all linked documents. function linkedDocs(doc, f, sharedHistOnly) { function propagate(doc, skip, sharedHist) { if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { @@ -5664,22 +6317,25 @@ propagate(doc, null, true); } + // Attach a document to an editor. function attachDoc(cm, doc) { if (doc.cm) throw new Error("This document is already in use."); cm.doc = doc; doc.cm = cm; estimateLineHeights(cm); loadMode(cm); - if (!cm.options.lineWrapping) computeMaxLength(cm); + if (!cm.options.lineWrapping) findMaxLine(cm); cm.options.mode = doc.modeOption; regChange(cm); } // LINE UTILITIES - function getLine(chunk, n) { - n -= chunk.first; - while (!chunk.lines) { + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); + for (var chunk = doc; !chunk.lines;) { for (var i = 0;; ++i) { var child = chunk.children[i], sz = child.chunkSize(); if (n < sz) { chunk = child; break; } @@ -5689,6 +6345,8 @@ return chunk.lines[n]; } + // Get the part of a document between two positions, as an array of + // strings. function getBetween(doc, start, end) { var out = [], n = start.line; doc.iter(start.line, end.line + 1, function(line) { @@ -5700,17 +6358,22 @@ }); return out; } + // Get the lines between from and to, as array of strings. function getLines(doc, from, to) { var out = []; doc.iter(from, to, function(line) { out.push(line.text); }); return out; } + // Update the height of a line, propagating the height change + // upwards to parent nodes. function updateLineHeight(line, height) { var diff = height - line.height; if (diff) for (var n = line; n; n = n.parent) n.height += diff; } + // Given a line object, find its line number by walking up through + // its parent links. function lineNo(line) { if (line.parent == null) return null; var cur = line.parent, no = indexOf(cur.lines, line); @@ -5723,10 +6386,12 @@ return no + cur.first; } + // Find the line at the given vertical position, using the height + // information in the document tree. function lineAtHeight(chunk, h) { var n = chunk.first; outer: do { - for (var i = 0, e = chunk.children.length; i < e; ++i) { + for (var i = 0; i < chunk.children.length; ++i) { var child = chunk.children[i], ch = child.height; if (h < ch) { chunk = child; continue outer; } h -= ch; @@ -5734,7 +6399,7 @@ } return n; } while (!chunk.lines); - for (var i = 0, e = chunk.lines.length; i < e; ++i) { + for (var i = 0; i < chunk.lines.length; ++i) { var line = chunk.lines[i], lh = line.height; if (h < lh) break; h -= lh; @@ -5743,6 +6408,7 @@ } + // Find the height above the given line. function heightAtLine(lineObj) { lineObj = visualLine(lineObj); @@ -5762,6 +6428,9 @@ return h; } + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. function getOrder(line) { var order = line.order; if (order == null) order = line.order = bidiOrdering(line.text); @@ -5770,47 +6439,67 @@ // HISTORY - function makeHistory(startGen) { - return { - // Arrays of history events. Doing something adds an event to - // done and clears undo. Undoing moves events from done to - // undone, redoing moves them in the other direction. - done: [], undone: [], undoDepth: Infinity, - // Used to track when changes can be merged into a single undo - // event - lastTime: 0, lastOp: null, lastOrigin: null, - // Used by the isClean() method - generation: startGen || 1, maxGeneration: startGen || 1 - }; - } - - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { - if (line.markedSpans) - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - ++n; - }); - } - + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. function historyChangeFromChange(doc, change) { - var from = { line: change.from.line, ch: change.from.ch }; - var histChange = {from: from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); return histChange; } - function addToHistory(doc, change, selAfter, opId) { + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) array.pop(); + else break; + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, ore are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { var hist = doc.history; hist.undone.length = 0; - var time = +new Date, cur = lst(hist.done); + var time = +new Date, cur; - if (cur && - (hist.lastOp == opId || + if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastTime > time - doc.cm.options.historyEventDelay) || - change.origin.charAt(0) == "*"))) { + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { // Merge this change into the last event var last = lst(cur.changes); if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { @@ -5821,22 +6510,81 @@ // Add new sub-event cur.changes.push(historyChangeFromChange(doc, change)); } - cur.selAfter = selAfter; } else { // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + pushSelectionToHistory(doc.sel, hist.done); cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation, - selBefore: doc.sel, selAfter: selAfter}; + generation: hist.generation}; hist.done.push(cur); - while (hist.done.length > hist.undoDepth) + while (hist.done.length > hist.undoDepth) { hist.done.shift(); + if (!hist.done[0].ranges) hist.done.shift(); + } } + hist.done.push(selAfter); hist.generation = ++hist.maxGeneration; - hist.lastTime = time; + hist.lastModTime = hist.lastSelTime = time; hist.lastOp = opId; - hist.lastOrigin = change.origin; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) signal(doc, "historyAdded"); + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + hist.done[hist.done.length - 1] = sel; + else + pushSelectionToHistory(sel, hist.done); + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastOp = opId; + if (options && options.clearRedo !== false) + clearSelectionEvents(hist.undone); + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + dest.push(sel); + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { + if (line.markedSpans) + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + ++n; + }); } + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. function removeClearedSpans(spans) { if (!spans) return null; for (var i = 0, out; i < spans.length; ++i) { @@ -5846,6 +6594,7 @@ return !out ? spans : out.length ? out : null; } + // Retrieve and filter the old marked spans stored in a change event. function getOldSpans(doc, change) { var found = change["spans_" + doc.id]; if (!found) return null; @@ -5854,21 +6603,17 @@ return nw; } - function copyHistorySel(sel, instantiate) { - if (!instantiate) return sel; - for (var out = [], i = 0; i < sel.ranges.length; i++) - out[i] = new Range(sel.ranges[i].anchor, sel.ranges[i].head); - return new Selection(out, sel.primIndex); - } - // Used both to provide a JSON-safe object in .getHistory, and, when // detaching a document, to split the history in two function copyHistoryArray(events, newGroup, instantiateSel) { for (var i = 0, copy = []; i < events.length; ++i) { - var event = events[i], changes = event.changes, newChanges = []; - copy.push({changes: newChanges, - selBefore: copyHistorySel(event.selBefore, instantiateSel), - selAfter: copyHistorySel(event.selAfter, instantiateSel)}); + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); for (var j = 0; j < changes.length; ++j) { var change = changes[j], m; newChanges.push({from: change.from, to: change.to, text: change.text}); @@ -5885,12 +6630,6 @@ // Rebasing/resetting history to deal with externally-sourced changes - function rebaseHistSel(array, from, to, diff) { - for (var i = 0; i < array.length; i++) { - rebaseHistSelSingle(array[i].anchor, from, to, diff); - rebaseHistSelSingle(array[i].head, from, to, diff); - } - } function rebaseHistSelSingle(pos, from, to, diff) { if (to < pos.line) { pos.line += diff; @@ -5910,6 +6649,14 @@ function rebaseHistArray(array, from, to, diff) { for (var i = 0; i < array.length; ++i) { var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } for (var j = 0; j < sub.changes.length; ++j) { var cur = sub.changes[j]; if (to < cur.from.line) { @@ -5920,17 +6667,9 @@ break; } } - if (!sub.copied) { - sub.selBefore = sub.selBefore.deepCopy(); - sub.selAfter = sub.selAfter.deepCopy(); - sub.copied = true; - } if (!ok) { array.splice(0, i + 1); i = 0; - } else { - rebaseHistSel(sub.selBefore, from, to, diff); - rebaseHistSel(sub.selAfter, from, to, diff); } } } @@ -5941,23 +6680,23 @@ rebaseHistArray(hist.undone, from, to, diff); } - // EVENT OPERATORS + // EVENT UTILITIES + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. - function e_preventDefault(e) { + var e_preventDefault = CodeMirror.e_preventDefault = function(e) { if (e.preventDefault) e.preventDefault(); else e.returnValue = false; - } - function e_stopPropagation(e) { + }; + var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; - } + }; function e_defaultPrevented(e) { return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} - CodeMirror.e_stop = e_stop; - CodeMirror.e_preventDefault = e_preventDefault; - CodeMirror.e_stopPropagation = e_stopPropagation; + var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; function e_target(e) {return e.target || e.srcElement;} function e_button(e) { @@ -5973,7 +6712,10 @@ // EVENT HANDLING - function on(emitter, type, f) { + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var on = CodeMirror.on = function(emitter, type, f) { if (emitter.addEventListener) emitter.addEventListener(type, f, false); else if (emitter.attachEvent) @@ -5983,9 +6725,9 @@ var arr = map[type] || (map[type] = []); arr.push(f); } - } + }; - function off(emitter, type, f) { + var off = CodeMirror.off = function(emitter, type, f) { if (emitter.removeEventListener) emitter.removeEventListener(type, f, false); else if (emitter.detachEvent) @@ -5996,15 +6738,22 @@ for (var i = 0; i < arr.length; ++i) if (arr[i] == f) { arr.splice(i, 1); break; } } - } + }; - function signal(emitter, type /*, values...*/) { + var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { var arr = emitter._handlers && emitter._handlers[type]; if (!arr) return; var args = Array.prototype.slice.call(arguments, 2); for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); - } + }; + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. var delayedCallbacks, delayedCallbackDepth = 0; function signalLater(emitter, type /*, values...*/) { var arr = emitter._handlers && emitter._handlers[type]; @@ -6020,11 +6769,6 @@ delayedCallbacks.push(bnd(arr[i])); } - function signalDOMEvent(cm, e, override) { - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - function fireDelayed() { --delayedCallbackDepth; var delayed = delayedCallbacks; @@ -6032,13 +6776,21 @@ for (var i = 0; i < delayed.length; ++i) delayed[i](); } + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + function hasHandler(emitter, type) { var arr = emitter._handlers && emitter._handlers[type]; return arr && arr.length > 0; } - CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal; - + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. function eventMixin(ctor) { ctor.prototype.on = function(type, f) {on(this, type, f);}; ctor.prototype.off = function(type, f) {off(this, type, f);}; @@ -6053,23 +6805,47 @@ // handling this'. var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + function Delayed() {this.id = null;} - Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; + Delayed.prototype.set = function(ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; // Counts the column offset in a string, taking tabs into account. // Used mostly to find indentation. - function countColumn(string, end, tabSize, startIndex, startValue) { + var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { if (end == null) { end = string.search(/[^\s\u00a0]/); if (end == -1) end = string.length; } - for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) { - if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); - else ++n; + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + return n + (end - i); + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + }; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) nextTab = string.length; + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + return pos + Math.min(skipped, goal - col); + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) return pos; } - return n; } - CodeMirror.countColumn = countColumn; var spaceStrs = [""]; function spaceStr(n) { @@ -6080,36 +6856,37 @@ function lst(arr) { return arr[arr.length-1]; } - function selectInput(node) { - if (ios) { // Mobile Safari apparently has a bug where select() is broken. - node.selectionStart = 0; - node.selectionEnd = node.value.length; - } else { - // Suppress mysterious IE10 errors - try { node.select(); } - catch(_e) {} - } - } + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; + else if (ie) // Suppress mysterious IE10 errors + selectInput = function(node) { try { node.select(); } catch(_e) {} }; - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + if (array[i] == elt) return i; return -1; } + if ([].indexOf) indexOf = function(array, elt) { return array.indexOf(elt); }; function map(array, f) { var out = []; for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); return out; } + if ([].map) map = function(array, f) { return array.map(f); }; function createObj(base, props) { - function Obj() {} - Obj.prototype = base; - var inst = new Obj(); + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + var ctor = function() {}; + ctor.prototype = base; + inst = new ctor(); + } if (props) copyObj(props, inst); return inst; - } + }; function copyObj(obj, target) { if (!target) target = {}; @@ -6122,17 +6899,22 @@ return function(){return f.apply(null, args);}; } - var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - function isWordChar(ch) { + var nonASCIISingleCaseWordChar = /[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var isWordChar = CodeMirror.isWordChar = function(ch) { return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - } + }; function isEmpty(obj) { for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; return true; } + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } @@ -6173,13 +6955,28 @@ return removeChildren(parent).appendChild(e); } + function contains(parent, child) { + if (parent.contains) + return parent.contains(child); + while (child = child.parentNode) + if (child == parent) return true; + } + + function activeElt() { return document.activeElement; } + // Older versions of IE throws unspecified error when touching + // document.activeElement in some cases (during loading, in iframe) + if (ie_upto10) activeElt = function() { + try { return document.activeElement; } + catch(e) { return document.body; } + }; + // FEATURE DETECTION // Detect drag-and-drop var dragAndDrop = function() { // There is *some* kind of drag-and-drop support in IE6-8, but I // couldn't get it to work yet. - if (ie_lt9) return false; + if (ie_upto8) return false; var div = elt('div'); return "draggable" in div || "dragDrop" in div; }(); @@ -6200,7 +6997,7 @@ var test = elt("span", "\u200b"); removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8; + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_upto7; } if (zwspSupported) return elt("span", "\u200b"); else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); @@ -6219,7 +7016,7 @@ // See if "".split is the broken IE version, if so, provide an // alternative way to split lines. - var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { var pos = 0, result = [], l = string.length; while (pos <= l) { var nl = string.indexOf("\n", pos); @@ -6236,7 +7033,6 @@ } return result; } : function(string){return string.split(/\r\n?|\n/);}; - CodeMirror.splitLines = splitLines; var hasSelection = window.getSelection ? function(te) { try { return te.selectionStart != te.selectionEnd; } @@ -6252,10 +7048,10 @@ var e = elt("div"); if ("oncopy" in e) return true; e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == 'function'; + return typeof e.oncopy == "function"; })(); - // KEY NAMING + // KEY NAMES var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", @@ -6352,12 +7148,11 @@ return pos; } - // This is somewhat involved. It is needed in order to move - // 'visually' through bi-directional text -- i.e., pressing left - // should make the cursor go left, even when in RTL text. The - // tricky part is the 'jumps', where RTL and LTR text touch each - // other. This often requires the cursor offset to move more than - // one unit, in order to visually move one unit. + // This is needed in order to move 'visually' through bi-directional + // text -- i.e., pressing left should make the cursor go left, even + // when in RTL text. The tricky part is the 'jumps', where RTL and + // LTR text touch each other. This often requires the cursor offset + // to move more than one unit, in order to visually move one unit. function moveVisually(line, start, dir, byUnit) { var bidi = getOrder(line); if (!bidi) return moveLogically(line, start, dir, byUnit); @@ -6412,14 +7207,16 @@ // objects) in the order in which they occur visually. var bidiOrdering = (function() { // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL"; + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; // Character types for codepoints 0x600 to 0x6ff - var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr"; + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; function charType(code) { - if (code <= 0xff) return lowTypes.charAt(code); + if (code <= 0xf7) return lowTypes.charAt(code); else if (0x590 <= code && code <= 0x5f4) return "R"; - else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600); - else if (0x700 <= code && code <= 0x8ac) return "r"; + else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); + else if (0x6ee <= code && code <= 0x8ac) return "r"; + else if (0x2000 <= code && code <= 0x200b) return "w"; + else if (code == 0x200c) return "b"; else return "L"; } @@ -6428,6 +7225,11 @@ // Browsers seem to always treat the boundaries of block elements as being L. var outerType = "L"; + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + return function(str) { if (!bidiRE.test(str)) return false; var len = str.length, types = []; @@ -6517,32 +7319,32 @@ if (countsAsLeft.test(types[i])) { var start = i; for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} - order.push({from: start, to: i, level: 0}); + order.push(new BidiSpan(0, start, i)); } else { var pos = i, at = order.length; for (++i; i < len && types[i] != "L"; ++i) {} for (var j = pos; j < i;) { if (countsAsNum.test(types[j])) { - if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1}); + if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); var nstart = j; for (++j; j < i && countsAsNum.test(types[j]); ++j) {} - order.splice(at, 0, {from: nstart, to: j, level: 2}); + order.splice(at, 0, new BidiSpan(2, nstart, j)); pos = j; } else ++j; } - if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1}); + if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); } } if (order[0].level == 1 && (m = str.match(/^\s+/))) { order[0].from = m[0].length; - order.unshift({from: 0, to: m[0].length, level: 0}); + order.unshift(new BidiSpan(0, 0, m[0].length)); } if (lst(order).level == 1 && (m = str.match(/\s+$/))) { lst(order).to -= m[0].length; - order.push({from: len - m[0].length, to: len, level: 0}); + order.push(new BidiSpan(0, len - m[0].length, len)); } if (order[0].level != lst(order).level) - order.push({from: len, to: len, level: order[0].level}); + order.push(new BidiSpan(order[0].level, len, len)); return order; }; @@ -6550,7 +7352,7 @@ // THE END - CodeMirror.version = "4.0.0"; + CodeMirror.version = "4.0.4"; return CodeMirror; }); From 97e311d5def98acd7a2b19010d59b92ee16a2eb9 Mon Sep 17 00:00:00 2001 From: nickgieschen Date: Thu, 27 Mar 2014 22:24:57 -0400 Subject: [PATCH 111/656] URI encode sourceURL of js files --- src/lt/util/load.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 9f8d0c3bb..8ff5a39d1 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -32,7 +32,7 @@ (defn- prep [code file] (-> code (abs-source-mapping-url file) - (str "\n\n//# sourceURL=" file))) + (str "\n\n//# sourceURL=" (js/encodeURI file)))) (defn js ([file] (js file false)) From 4df1bc1c50bd8313c2fe9b235eaf6cf1bbd43e69 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Tue, 1 Apr 2014 20:30:50 +1100 Subject: [PATCH 112/656] Ignore case when sorting installed plugins --- src/lt/objs/plugins.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 9ad387926..d49db71fc 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -520,7 +520,7 @@ (object/merge! app/app {::plugins (available-plugins)}) (let [ul (dom/$ :.plugins (object/->content this))] (dom/empty ul) - (dom/append ul (dom/fragment (map installed-plugin-ui (->> @app/app ::plugins vals (sort-by :name)))))))) + (dom/append ul (dom/fragment (map installed-plugin-ui (->> @app/app ::plugins vals (sort-by #(.toUpperCase (:name %)))))))))) (behavior ::on-close :triggers #{:close} From 65f60b7ceed54e959cdf8587f3c760af0a23d0be Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 3 Apr 2014 14:57:07 -0700 Subject: [PATCH 113/656] reorganize tabs.cljs a bit, adjust close-tab button styling, add behavior. Signed-off-by: Chris Granger --- deploy/core/css/structure.css | 4 +- deploy/settings/default/default.behaviors | 3 +- src/lt/objs/tabs.cljs | 434 ++++++++++++---------- 3 files changed, 232 insertions(+), 209 deletions(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 47e27e2e0..befb9d251 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -73,8 +73,8 @@ body { -webkit-user-select: none; } #multi .list span { display:inline-block; vertical-align:middle; } -#multi .list .tab-close { width:0; overflow:hidden; box-sizing:border-box; margin-left:5px; border-radius:2px; } -#multi li:hover .tab-close { width:17px; padding:0 5px; } +#multi .list .tab-close { width:17px; padding:0 5px; visibility:hidden; margin-left:10px; overflow:hidden; box-sizing:border-box; border-radius:2px; } +#multi li:hover .tab-close { width:17px; padding:0 5px; visibility:visible; margin-left:10px; } #multi .content { left:0px; right:10px; position:absolute; top:36px; bottom:0; padding-left:10px; white-space:normal;} #multi .content > * { width:100%; height:100%; box-sizing:border-box; } diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d80367399..692419580 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -404,7 +404,8 @@ :lt.objs.tabs/no-anim-on-drag :lt.objs.tabs/active-tab-num :lt.objs.tabs/set-dragging] :tabset.tab [:lt.objs.tabs/on-destroy-remove - :lt.objs.tabs/tab-active] + :lt.objs.tabs/tab-active + :lt.objs.tabs/show-close-button] :tcp.client [:lt.objs.clients.tcp/send!] :theme-selector [:lt.objs.style/set-theme-on-select] :tree-item [:lt.objs.sidebar.workspace/rename-submit diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 52afddb50..111e2e2d3 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -33,54 +33,6 @@ (set! (.-scrollLeft gp) (+ (- right pwidth) 50))) )))) -(behavior ::on-destroy-remove - :triggers #{:destroy :closed} - :reaction (fn [this] - (rem! this) - )) - -(behavior ::active-tab-num - :triggers #{:tab} - :reaction (fn [this num] - (let [objs (@this :objs)] - (if (< num (count objs)) - (active! (get objs num)) - (active! (get objs (dec (count objs)))))) - )) - -(behavior ::prev-tab - :triggers #{:tab.prev} - :throttle 100 - :reaction (fn [this] - (let [objs (@this :objs) - idx (->index (:active-obj @this))] - (if (> idx 0) - (active! (get objs (dec idx))) - (active! (get objs (dec (count objs)))))) - )) - -(behavior ::next-tab - :triggers #{:tab.next} - :throttle 100 - :reaction (fn [this] - (let [objs (@this :objs) - idx (inc (->index (:active-obj @this)))] - (if (< idx (count objs)) - (active! (get objs idx)) - (active! (get objs 0)))) - )) - -(behavior ::tab-close - :triggers #{:tab.close} - :reaction (fn [this] - (try - (let [orig (:active-obj @this)] - (object/raise orig :close)) - (catch js/Error e - (js/lt.objs.console.error e)) - (catch js/global.Error e - (js/lt.objs.console.error e))))) - (defn ->index [obj] (when (and obj @obj (::tabset @obj)) (first (first (filter #(= obj (second %)) (map-indexed vector (:objs @(::tabset @obj)))))))) @@ -119,7 +71,8 @@ :pos pos} [:span.file-name (->name e)] - (close-tab e)] + (when (object/raise-reduce e :close-button+ false) + (close-tab e))] :click (fn [ev] (if (or (= 1 (.-button ev)) (.-metaKey ev)) (object/raise e :close) @@ -166,18 +119,6 @@ (dom/on item "sortupdate" (fn [e] (update-tab-order multi (.-opts e)))) item)) -(behavior ::on-destroy-objs - :triggers #{:destroy} - :reaction (fn [this] - (doseq [e (:objs @this)] - (object/destroy! e)) - )) - -(behavior ::repaint-tab-updated - :triggers #{:tab.updated} - :reaction (fn [this] - (object/update! this [:count] inc))) - (defui tabbed-item [active item] [:div.content {:style {:display (bound active #(if (= % @item) "" @@ -240,61 +181,6 @@ (doseq [ts tss] (object/merge! ts {:width width})))) -(behavior ::no-anim-on-drag - :triggers #{:start-drag} - :reaction (fn [this] - (anim/off))) - -(behavior ::reanim-on-drop - :triggers #{:end-drag} - :reaction (fn [this] - (anim/on))) - -(behavior ::set-dragging - :triggers #{:start-drag} - :reaction (fn [this] - (dom/add-class (dom/$ :body) :dragging) - )) - -(behavior ::unset-dragging - :triggers #{:end-drag} - :reaction (fn [this] - (dom/remove-class (dom/$ :body) :dragging) - )) - -(behavior ::set-width-final! - :triggers #{:end-drag} - :reaction (fn [this e] - (when-let [ts (next-tabset this)] - (let [width (dom/width (object/->content multi)) - left (:left @multi) - cx (.-clientX e) - new-loc (- (+ width left) cx) - new-perc (floored (int (- 100 (previous-tabset-width this) (to-perc width new-loc)))) - prev-width (:width @this) - new-perc (if (>= new-perc (+ (:width @ts) prev-width)) - (+ (:width @ts) prev-width) - new-perc) - next-width (floored - (if-not ts - 1 - (+ (:width @ts) (- prev-width new-perc))))] - (cond - (= new-perc 0) (rem-tabset this) - (= next-width 0) (rem-tabset ts :prev) - :else - (when-not (= cx 0) - (if (or (< new-perc 0) ) - (object/merge! this {:width 100}) - (when (and (not= cx 0) - ts - (>= new-perc 0) - (>= next-width 0)) - (object/merge! this {:width new-perc}) - (if ts - (object/merge! ts {:width next-width}) - (spawn-tabset) - ))))))))) (defn temp-width [ts w] (dom/css (object/->content ts) {:width (->perc w) @@ -302,38 +188,6 @@ 0 "")})) -(behavior ::width! - :triggers #{:width!} - :reaction (fn [this e] - (let [width (dom/width (object/->content multi)) - left (:left @multi) - cx (.-clientX e) - new-loc (- (+ width left) cx) - new-perc (floored (int (- 100 (previous-tabset-width this) (to-perc width new-loc)))) - prev-width (:width @this) - ts (next-tabset this) - new-perc (if (and ts - (>= new-perc (+ (:width @ts) prev-width))) - (+ (:width @ts) prev-width) - new-perc) - next-width (floored - (if-not ts - 1 - (+ (:width @ts) (- prev-width new-perc))))] - ;(println (.-clientX e) (.-clientY e) (.-screenX e) (.-screenY e) (js->clj (js/Object.keys e))) - (when-not (= cx 0) - (if (or (< new-perc 0) ) - (temp-width this 100) - (when (and (not= cx 0) - ts - (>= new-perc 0) - (>= next-width 0)) - (temp-width this new-perc) - (if ts - (temp-width ts next-width) - (spawn-tabset)))))) - (set! start (now)) - )) (defn activate-tabset [ts] (when-not (= (ctx/->obj :tabset) ts) @@ -343,28 +197,6 @@ (dom/add-class (object/->content ts) :active) true)) -(behavior ::tab-active - :triggers #{:active} - :reaction (fn [this] - (activate-tabset (::tabset @this)))) - -(behavior ::tabset-active - :triggers #{:active} - :reaction (fn [this] - (when (activate-tabset this) - (when-let [active (:active-obj @this)] - (object/raise active :focus!))))) - -(behavior ::tabset-menu - :triggers #{:menu!} - :reaction (fn [this ev] - (-> (menu/menu [{:label "New tabset" - :click (fn [] (cmd/exec! :tabset.new))} - {:label "Close tabset" - :click (fn [] (rem-tabset this))} - ]) - (menu/show-menu (.-clientX ev) (.-clientY ev))) - )) (defui tabset-ui [this] [:div.tabset {:style {:width (bound (subatom this :width) ->perc)}} @@ -390,29 +222,6 @@ (for [k tabs] (object/->content k))) -(behavior ::left! - :triggers #{:left!} - :reaction (fn [this v] - (object/update! this [:left] + v) - (object/raise this :resize))) - -(behavior ::right! - :triggers #{:right!} - :reaction (fn [this v] - (object/update! this [:right] + v) - (object/raise this :resize))) - -(behavior ::bottom! - :triggers #{:bottom!} - :reaction (fn [this v] - (object/update! this [:bottom] + v) - (object/raise this :resize))) - -(behavior ::tabset-bottom! - :triggers #{:tabset-bottom!} - :reaction (fn [this v] - (object/update! this [:tabset-bottom] + v) - (object/raise this :resize))) (def multi-def (object* ::multi-editor2 :tags #{:tabs} @@ -438,7 +247,6 @@ (defn add-tabset [ts] (object/update! multi [:tabsets] conj ts) (dom/append (:tabsets-elem @multi) (object/->content ts)) - ;(object/raise ts :active) ) (defn rem-tabset [ts prev?] @@ -521,13 +329,237 @@ (when-let [cur-tabset (ctx/->obj :tabset)] (:active-obj @cur-tabset))) -(append (object/->content canvas/canvas) (:content @multi)) (defn move-tab-to-tabset [obj ts] (rem! obj) (add! obj ts) (active! obj)) +;;********************************************************* +;; Behaviors +;;********************************************************* + +(behavior ::on-destroy-remove + :triggers #{:destroy :closed} + :reaction (fn [this] + (rem! this) + )) + +(behavior ::active-tab-num + :triggers #{:tab} + :reaction (fn [this num] + (let [objs (@this :objs)] + (if (< num (count objs)) + (active! (get objs num)) + (active! (get objs (dec (count objs)))))) + )) + +(behavior ::prev-tab + :triggers #{:tab.prev} + :throttle 100 + :reaction (fn [this] + (let [objs (@this :objs) + idx (->index (:active-obj @this))] + (if (> idx 0) + (active! (get objs (dec idx))) + (active! (get objs (dec (count objs)))))) + )) + +(behavior ::next-tab + :triggers #{:tab.next} + :throttle 100 + :reaction (fn [this] + (let [objs (@this :objs) + idx (inc (->index (:active-obj @this)))] + (if (< idx (count objs)) + (active! (get objs idx)) + (active! (get objs 0)))) + )) + +(behavior ::tab-close + :triggers #{:tab.close} + :reaction (fn [this] + (try + (let [orig (:active-obj @this)] + (object/raise orig :close)) + (catch js/Error e + (js/lt.objs.console.error e)) + (catch js/global.Error e + (js/lt.objs.console.error e))))) + +(behavior ::on-destroy-objs + :triggers #{:destroy} + :reaction (fn [this] + (doseq [e (:objs @this)] + (object/destroy! e)) + )) + +(behavior ::repaint-tab-updated + :triggers #{:tab.updated} + :reaction (fn [this] + (object/update! this [:count] inc))) + +(behavior ::no-anim-on-drag + :triggers #{:start-drag} + :reaction (fn [this] + (anim/off))) + +(behavior ::reanim-on-drop + :triggers #{:end-drag} + :reaction (fn [this] + (anim/on))) + +(behavior ::set-dragging + :triggers #{:start-drag} + :reaction (fn [this] + (dom/add-class (dom/$ :body) :dragging) + )) + +(behavior ::unset-dragging + :triggers #{:end-drag} + :reaction (fn [this] + (dom/remove-class (dom/$ :body) :dragging) + )) + +(behavior ::set-width-final! + :triggers #{:end-drag} + :reaction (fn [this e] + (when-let [ts (next-tabset this)] + (let [width (dom/width (object/->content multi)) + left (:left @multi) + cx (.-clientX e) + new-loc (- (+ width left) cx) + new-perc (floored (int (- 100 (previous-tabset-width this) (to-perc width new-loc)))) + prev-width (:width @this) + new-perc (if (>= new-perc (+ (:width @ts) prev-width)) + (+ (:width @ts) prev-width) + new-perc) + next-width (floored + (if-not ts + 1 + (+ (:width @ts) (- prev-width new-perc))))] + (cond + (= new-perc 0) (rem-tabset this) + (= next-width 0) (rem-tabset ts :prev) + :else + (when-not (= cx 0) + (if (or (< new-perc 0) ) + (object/merge! this {:width 100}) + (when (and (not= cx 0) + ts + (>= new-perc 0) + (>= next-width 0)) + (object/merge! this {:width new-perc}) + (if ts + (object/merge! ts {:width next-width}) + (spawn-tabset) + ))))))))) + +(behavior ::width! + :triggers #{:width!} + :reaction (fn [this e] + (let [width (dom/width (object/->content multi)) + left (:left @multi) + cx (.-clientX e) + new-loc (- (+ width left) cx) + new-perc (floored (int (- 100 (previous-tabset-width this) (to-perc width new-loc)))) + prev-width (:width @this) + ts (next-tabset this) + new-perc (if (and ts + (>= new-perc (+ (:width @ts) prev-width))) + (+ (:width @ts) prev-width) + new-perc) + next-width (floored + (if-not ts + 1 + (+ (:width @ts) (- prev-width new-perc))))] + ;(println (.-clientX e) (.-clientY e) (.-screenX e) (.-screenY e) (js->clj (js/Object.keys e))) + (when-not (= cx 0) + (if (or (< new-perc 0) ) + (temp-width this 100) + (when (and (not= cx 0) + ts + (>= new-perc 0) + (>= next-width 0)) + (temp-width this new-perc) + (if ts + (temp-width ts next-width) + (spawn-tabset)))))) + (set! start (now)) + )) + + +(behavior ::tab-active + :triggers #{:active} + :reaction (fn [this] + (activate-tabset (::tabset @this)))) + +(behavior ::tabset-active + :triggers #{:active} + :reaction (fn [this] + (when (activate-tabset this) + (when-let [active (:active-obj @this)] + (object/raise active :focus!))))) + +(behavior ::tabset-menu + :triggers #{:menu!} + :reaction (fn [this ev] + (-> (menu/menu [{:label "New tabset" + :click (fn [] (cmd/exec! :tabset.new))} + {:label "Close tabset" + :click (fn [] (rem-tabset this))} + ]) + (menu/show-menu (.-clientX ev) (.-clientY ev))))) + +(behavior ::left! + :triggers #{:left!} + :reaction (fn [this v] + (object/update! this [:left] + v) + (object/raise this :resize))) + +(behavior ::right! + :triggers #{:right!} + :reaction (fn [this v] + (object/update! this [:right] + v) + (object/raise this :resize))) + +(behavior ::bottom! + :triggers #{:bottom!} + :reaction (fn [this v] + (object/update! this [:bottom] + v) + (object/raise this :resize))) + +(behavior ::tabset-bottom! + :triggers #{:tabset-bottom!} + :reaction (fn [this v] + (object/update! this [:tabset-bottom] + v) + (object/raise this :resize))) + + +(behavior ::init-sortable + :triggers #{:init} + :reaction (fn [app] + (js/initSortable js/window))) + +(behavior ::init + :triggers #{:init} + :reaction (fn [this] + (add-tabset tabset) + (object/raise tabset :active) + )) + +(behavior ::show-close-button + :desc "Tab: Show close button on tabs" + :type :user + :triggers #{:close-button+} + :reaction (fn [this] + true)) + + +;;********************************************************* +;; Commands +;;********************************************************* + (cmd/command {:command :tabs.move-new-tabset :desc "Tab: Move tab to new tabset" :exec (fn [tab] @@ -636,14 +668,4 @@ (when-let [active (:active-obj @(ctx/->obj :tabset))] (object/raise active :focus!)))}) -(behavior ::init-sortable - :triggers #{:init} - :reaction (fn [app] - (js/initSortable js/window))) - -(behavior ::init - :triggers #{:init} - :reaction (fn [this] - (add-tabset tabset) - (object/raise tabset :active) - )) +(append (object/->content canvas/canvas) (:content @multi)) From 1eed321dd8cc2c166e1fb4a050a78d3508dad1cb Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Thu, 3 Apr 2014 23:15:24 -0500 Subject: [PATCH 114/656] Rename tabset menu items trigger --- src/lt/objs/tabs.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index e4fbf3583..b384b1c69 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -502,11 +502,11 @@ (behavior ::tabset-menu :triggers #{:menu!} :reaction (fn [this ev] - (-> (menu/menu (sort-by :order (object/raise-reduce this :tabset-menu-items []))) + (-> (menu/menu (sort-by :order (object/raise-reduce this :menu+ []))) (menu/show-menu (.-clientX ev) (.-clientY ev))))) (behavior ::tabset-menu-items - :triggers #{:tabset-menu-items} + :triggers #{:menu+} :reaction (fn [this items] (conj items {:label "New tabset" From 91d67711642c08e7ff6a530f8e23bf06344e1078 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Fri, 4 Apr 2014 01:49:41 -0500 Subject: [PATCH 115/656] Add object for tab label Adds an object for the tab label so that the right click menu can be extended with the :menu! and :menu+ triggers. Also allows use to reuse the :lt.objs.menu/menu! behavior and reduce code duplication. --- deploy/settings/default/default.behaviors | 10 ++-- src/lt/objs/tabs.cljs | 71 ++++++++++++----------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index a49c9848d..12c769647 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -391,6 +391,9 @@ :statusbar.console-toggle [:lt.objs.console/statusbar-console-toggle :lt.objs.console/statusbar-console-hide :lt.objs.console/statusbar-console-show] + :tab-label [:lt.objs.menu/menu! + :lt.objs.tabs/tab-label-menu+ + :lt.objs.tabs/on-close-tab-label] :tab-options [:lt.objs.editor.pool/focus-options] :tabs [:lt.objs.tabs/on-destroy-eds :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/tabset-bottom! @@ -400,12 +403,11 @@ :lt.objs.tabs/next-tab :lt.objs.tabs/unset-dragging :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/width! :lt.objs.tabs/tab-close :lt.objs.tabs/prev-tab - :lt.objs.tabs/reanim-on-drop :lt.objs.tabs/tabset-menu - :lt.objs.tabs/no-anim-on-drag :lt.objs.tabs/active-tab-num - :lt.objs.tabs/tabset-menu-items :lt.objs.tabs/set-dragging] + :lt.objs.tabs/reanim-on-drop :lt.objs.tabs/no-anim-on-drag + :lt.objs.tabs/active-tab-num :lt.objs.tabs/tabset-menu+ + :lt.objs.tabs/set-dragging :lt.objs.menu/menu!] :tabset.tab [:lt.objs.tabs/on-destroy-remove :lt.objs.tabs/tab-active - :lt.objs.tabs/tab-menu-items :lt.objs.tabs/show-close-button] :tcp.client [:lt.objs.clients.tcp/send!] :theme-selector [:lt.objs.style/set-theme-on-select] diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index b384b1c69..a6d97e183 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -40,14 +40,14 @@ (defn ->name [e] (or - (-> @e :info :name) - (@e :name) + (get-in @e [:info :name]) + (:name @e) "unknown")) (defn ->path [e] (or - (-> @e :info :path) - (@e :path) + (get-in @e [:info :path]) + (:path @e) "")) (defn active? [c e multi] @@ -62,7 +62,7 @@ [:span.tab-close "x"] :click (fn [] (object/raise obj :close))) -(defui item [multi e pos] +(defui item [label multi e pos] [:li {:class (-> " " (active? e multi) (dirty? e)) @@ -73,17 +73,20 @@ [:span.file-name (->name e)] (when (object/raise-reduce e :close-button+ false) - (close-tab e))] + (close-tab label))] :click (fn [ev] (if (or (= 1 (.-button ev)) (.-metaKey ev)) - (object/raise e :close) + (object/raise label :close) (active! e))) :contextmenu (fn [ev] - (-> (menu/menu (sort-by :order (object/raise-reduce e :tab-menu-items []))) - (menu/show-menu (.-clientX ev) (.-clientY ev))) - (dom/prevent ev) - (dom/stop-propagation ev)) - ) + (object/raise label :menu! ev))) + +(object/object* ::tab-label + :tags #{:tab-label} + :init (fn [this multi e pos] + (object/merge! this {::tab-object e}) + (item this multi e pos))) + (defn update-tab-order [multi children] (let [ser (if (vector? children) @@ -111,12 +114,10 @@ [:ul (for [[idx o] (map vector (range) objs) :when @o] - (item multi o idx))])] + (object/->content (object/create ::tab-label multi o idx)))])] (js/sortable item (js-obj "axis" "x" "distance" 10 "scroll" false "opacity" 0.9 "connectWith" ".list")) (dom/on item "contextmenu" (fn [e] - (object/raise multi :menu! e) - (dom/prevent e) - (dom/stop-propagation e))) + (object/raise multi :menu! e))) (dom/on item "moved" (fn [e] (move-tab multi (.-opts e)) )) (dom/on item "sortupdate" (fn [e] (update-tab-order multi (.-opts e)))) item)) @@ -492,6 +493,24 @@ :reaction (fn [this] (activate-tabset (::tabset @this)))) +(behavior ::tab-label-menu+ + :triggers #{:menu+} + :reaction (fn [this items] + (conj items + {:label "Move tab to new tabset" + :order 1 + :click (fn [] (cmd/exec! :tabs.move-new-tabset (::tab-object this)))} + {:label "Close tab" + :order 2 + :click (fn [] (object/raise this :close))}))) + +(behavior ::on-close-tab-label + :triggers #{:close} + :reaction (fn [this] + (when-let [e (::tab-object @this)] + (object/raise e :close)) + (object/destroy! this))) + (behavior ::tabset-active :triggers #{:active} :reaction (fn [this] @@ -499,13 +518,7 @@ (when-let [active (:active-obj @this)] (object/raise active :focus!))))) -(behavior ::tabset-menu - :triggers #{:menu!} - :reaction (fn [this ev] - (-> (menu/menu (sort-by :order (object/raise-reduce this :menu+ []))) - (menu/show-menu (.-clientX ev) (.-clientY ev))))) - -(behavior ::tabset-menu-items +(behavior ::tabset-menu+ :triggers #{:menu+} :reaction (fn [this items] (conj items @@ -516,18 +529,6 @@ :order 2 :click (fn [] (rem-tabset this))}))) - -(behavior ::tab-menu-items - :triggers #{:tab-menu-items} - :reaction (fn [this items] - (conj items - {:label "Move tab to new tabset" - :order 1 - :click (fn [] (cmd/exec! :tabs.move-new-tabset this))} - {:label "Close tab" - :order 2 - :click (fn [] (object/raise this :close))}))) - (behavior ::left! :triggers #{:left!} :reaction (fn [this v] From 86269c45b339035da811eabb27c9126eb80559f2 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Fri, 4 Apr 2014 01:53:39 -0500 Subject: [PATCH 116/656] Make $ and $$ multi arity Reduces the number of warnings generated by the cljs compiler. --- src/lt/util/dom.cljs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index dddfbbaac..c9e8937e6 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -37,15 +37,13 @@ (defn text-node [text] (js/document.createTextNode text)) -(defn $$ [query elem] - (let [elem (or elem js/document) - res (.querySelectorAll elem (name query))] - res)) - -(defn $ [query elem] - (let [elem (or elem js/document) - res (.querySelector elem (name query))] - res)) +(defn $$ + ([query] ($$ query js/document)) + ([query elem] (.querySelectorAll elem (name query)))) + +(defn $ + ([query] ($ query js/document)) + ([query elem] (.querySelector elem (name query)))) (defn append [parent child] (.appendChild parent child) From 4a69fcd36cec0a4e57a4407cfbdbbd5b0604e933 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Fri, 4 Apr 2014 21:41:20 +1100 Subject: [PATCH 117/656] Add add-gutter to editor --- src/lt/objs/editor.cljs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index c97f4718d..ce82d5726 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -371,6 +371,20 @@ (defn fold-code [e] (.foldCode (->cm-ed e) (cursor e))) +(defn add-gutter [e class-name width] + (let [gutter-classes (set (conj (js->clj (option e "gutters")) class-name)) + gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) + gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div) + current-widths (reduce (fn [res gutter] + (let [gutter-class (clojure.string/replace-first (dom/attr gutter "class") "CodeMirror-gutter " "")] + (assoc res gutter-class (dom/width gutter))) + ) {} gutter-divs) + new-gutter-widths (assoc current-widths class-name width)] + (operation e (fn[] + (set-options e {:gutters (clj->js gutter-classes)}) + (doseq [[k v] new-gutter-widths] + (dom/set-css (dom/$ (str "div." k) gutter-div) {"width" (str v "px")})))))) + ;;********************************************************* ;; Object ;;********************************************************* From 6f2ba74381adaa279097987e25df1bffe6f72b3d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 4 Apr 2014 11:08:53 -0400 Subject: [PATCH 118/656] reuse clipboard fns in editor --- src/lt/objs/editor.cljs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index c97f4718d..e7d9b50bf 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -8,14 +8,14 @@ [lt.objs.menu :as menu] [lt.util.events :as ev] [lt.util.dom :as dom] - [lt.util.load :as load]) + [lt.util.load :as load] + [lt.objs.platform :as platform]) (:use [lt.util.dom :only [remove-class add-class]] [lt.object :only [object* behavior*]] [lt.util.cljs :only [js->clj]]) (:require-macros [lt.macros :refer [behavior]])) (def gui (js/require "nw.gui")) -(def clipboard (.Clipboard.get gui)) ;;********************************************************* ;; commands @@ -240,14 +240,14 @@ (.redo (->cm-ed e))) (defn copy [e] - (.set clipboard (selection e) "text")) + (platform/copy (selection e))) (defn cut [e] (copy e) (replace-selection e "")) (defn paste [e] - (replace-selection e (.get clipboard "text"))) + (replace-selection e (platform/paste))) (defn select-all [e] (set-selection e @@ -617,7 +617,7 @@ (cut this))} {:label "Paste" :order 3 - :enabled (boolean (not (empty? (.get clipboard "text")))) + :enabled (boolean (not (empty? (platform/paste)))) :click (fn [] (paste this))} {:type "separator" From d5d97450d0dab2e95debbd46a470dd46be5a79a9 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 4 Apr 2014 12:37:27 -0400 Subject: [PATCH 119/656] searcher's search! behavior should use argument it's given --- src/lt/objs/search.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index 0c89ab116..de452ad90 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -116,9 +116,9 @@ (behavior ::search! :triggers #{:search!} - :reaction (fn [this] + :reaction (fn [this search-info] (object/raise this :clear!) - (let [info (->search-info this)] + (let [info (or search-info (->search-info this))] (when-not (empty? (:search info)) (object/merge! this info) (notifos/working "Searching workspace...") From 81d3afed564c6dc552bc83dbe3c18dae3e123c9c Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Sat, 5 Apr 2014 12:13:14 +1100 Subject: [PATCH 120/656] Add remove-gutter to editor --- src/lt/objs/editor.cljs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index ce82d5726..dd216ecd1 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -385,6 +385,20 @@ (doseq [[k v] new-gutter-widths] (dom/set-css (dom/$ (str "div." k) gutter-div) {"width" (str v "px")})))))) +(defn remove-gutter [e class-name] + (let [gutter-classes (remove #{class-name} (js->clj (option e "gutters"))) + gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) + gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div) + current-widths (reduce (fn [res gutter] + (let [gutter-class (clojure.string/replace-first (dom/attr gutter "class") "CodeMirror-gutter " "")] + (assoc res gutter-class (dom/width gutter))) + ) {} gutter-divs)] + (operation e (fn[] + (set-options e {:gutters (clj->js gutter-classes)}) + (doseq [[k v] new-gutter-widths] + (if-let [gutter (dom/$ (str "div." k) gutter-div)] + (dom/set-css gutter {"width" (str v "px")}))))))) + ;;********************************************************* ;; Object ;;********************************************************* From 0fece6da8be308854bdef94565e16bfc6e5fb191 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Sat, 5 Apr 2014 12:41:26 +1100 Subject: [PATCH 121/656] Remove duplication in gutter api --- src/lt/objs/editor.cljs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index dd216ecd1..fdf214a96 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -373,29 +373,29 @@ (defn add-gutter [e class-name width] (let [gutter-classes (set (conj (js->clj (option e "gutters")) class-name)) - gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) - gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div) - current-widths (reduce (fn [res gutter] - (let [gutter-class (clojure.string/replace-first (dom/attr gutter "class") "CodeMirror-gutter " "")] - (assoc res gutter-class (dom/width gutter))) - ) {} gutter-divs) + current-widths (gutter-widths e) new-gutter-widths (assoc current-widths class-name width)] - (operation e (fn[] - (set-options e {:gutters (clj->js gutter-classes)}) - (doseq [[k v] new-gutter-widths] - (dom/set-css (dom/$ (str "div." k) gutter-div) {"width" (str v "px")})))))) + (update-gutters e gutter-classes new-gutter-widths))) (defn remove-gutter [e class-name] (let [gutter-classes (remove #{class-name} (js->clj (option e "gutters"))) - gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) + current-widths (gutter-widths e)] + (update-gutters e gutter-classes current-widths))) + +(defn gutter-widths [e] + (let [gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div) current-widths (reduce (fn [res gutter] (let [gutter-class (clojure.string/replace-first (dom/attr gutter "class") "CodeMirror-gutter " "")] (assoc res gutter-class (dom/width gutter))) ) {} gutter-divs)] + current-widths)) + +(defn update-gutters [e class-names class-widths] + (let [gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e))] (operation e (fn[] - (set-options e {:gutters (clj->js gutter-classes)}) - (doseq [[k v] new-gutter-widths] + (set-options e {:gutters (clj->js class-names)}) + (doseq [[k v] class-widths] (if-let [gutter (dom/$ (str "div." k) gutter-div)] (dom/set-css gutter {"width" (str v "px")}))))))) From 04a345db2ee234dde68134b9097ccd5d8a19c38c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 5 Apr 2014 00:03:39 -0400 Subject: [PATCH 122/656] copy inline result from its menu --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/eval.cljs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 692419580..711f09c36 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -306,7 +306,8 @@ :lt.objs.eval/expand-on-click :lt.objs.eval/clear-mark :lt.objs.eval/move-mark :lt.objs.eval/changed :lt.objs.eval/update! - :lt.objs.eval/destroy-on-cleared] + :lt.objs.eval/destroy-on-cleared + :lt.objs.eval/copy-result] :inline.underline-result [:lt.objs.eval/result-menu! :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-clear] :inline.watch [:lt.plugins.watches/clear!] :inspector.object [:lt.objs.clients.devtools/clear-inspector-object] diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index a62386255..c9dc856cb 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -14,7 +14,8 @@ [crate.binding :refer [bound]] [lt.objs.console :as console] [lt.util.dom :as dom] - [clojure.string :as string]) + [clojure.string :as string] + [lt.objs.platform :as platform]) (:require-macros [lt.macros :refer [behavior defui]])) (defui button [label & [cb]] @@ -194,7 +195,9 @@ :triggers #{:menu!} :reaction (fn [this ev] (-> (menu/menu [{:label "Remove result" - :click (fn [] (object/raise this :clear!))}]) + :click (fn [] (object/raise this :clear!))} + {:label "Copy result" + :click (fn [] (object/raise this :copy))}]) (menu/show-menu (.-clientX ev) (.-clientY ev))) (dom/prevent ev) (dom/stop-propagation ev))) @@ -228,6 +231,11 @@ (object/raise this :clear) (object/raise this :cleared)))) +(behavior ::copy-result + :triggers #{:copy} + :reaction (fn [this] + (platform/copy (:result @this)))) + (behavior ::changed :triggers #{:changed} :reaction (fn [this] From 66b5ee2969ab165412761f5cc68793c85be3212c Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Thu, 10 Apr 2014 11:10:47 +0100 Subject: [PATCH 123/656] Remove windowsVerbatimArguments option (fixes #1413) --- src/lt/objs/proc.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lt/objs/proc.cljs b/src/lt/objs/proc.cljs index f39d25e3c..bc38ed0f4 100644 --- a/src/lt/objs/proc.cljs +++ b/src/lt/objs/proc.cljs @@ -48,8 +48,7 @@ (let [proc (spawn command (when (seq args) (clj->js args)) (js-obj "cwd" cwd? - "env" (merge-env env) - "windowsVerbatimArguments" (when (= js/process.platform "win32") true)))] + "env" (merge-env env)))] (add! proc) (.on proc "exit" (partial rem! proc)) (.on proc "error" #(when @obj From b036e267469c836a8b5907183c0950736df195eb Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Fri, 11 Apr 2014 16:59:43 +0200 Subject: [PATCH 124/656] git-ignore .nrepl-port --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e124552da..f0a5a1887 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ deploy/credits.html deploy/ltbin deploy/nw.pak deploy/light +.nrepl-port From 51b68306f025523505271d65af5a525a0ebd7d2c Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Thu, 10 Apr 2014 14:54:15 +0200 Subject: [PATCH 125/656] Don't Repeat Yourself --- src/lt/objs/menu.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 9d13a2ba0..f6176e758 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -43,8 +43,9 @@ (mi. (clj->js opts)))) (defn clear! [menu] - (dotimes [i (.-items.length (or menu menu-instance))] - (.removeAt (or menu menu-instance) 0))) + (let [m (or menu menu-instance)] + (dotimes [i (.-items.length m)] + (.removeAt m 0)))) (defn menu [items] (clear!) From 7cfeaeb9c95fa50053171cce693ced455e654c69 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Thu, 10 Apr 2014 16:22:50 +0200 Subject: [PATCH 126/656] Fix WARNING: Wrong number of args (0) passed to lt.objs.menu/clear! --- src/lt/objs/menu.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index f6176e758..1e2385d96 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -48,7 +48,7 @@ (.removeAt m 0)))) (defn menu [items] - (clear!) + (clear! menu-instance) (doseq [i items] (.append menu-instance (menu-item i))) menu-instance) From e143f22218fbb6840094a1164fce1e385fae058e Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Fri, 11 Apr 2014 16:53:40 +0200 Subject: [PATCH 127/656] search-box UI convenience: select the text automatically pasted to input line --- src/lt/objs/search.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index de452ad90..278a5de0a 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -71,7 +71,9 @@ (defui search-box [this] [:input.search {:type "text" :placeholder "Search"}] :focus (fn [] - (ctx/in! :searcher.search this)) + (ctx/in! :searcher.search this) + ; select the text automatically pasted to input line for some UI conveniece + (.select (dom/$ :input.search (object/->content this)))) :blur (fn [] (ctx/out! :searcher.search))) From 6b147e78b99b913e971892cf650549444e6b5e9c Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Sun, 13 Apr 2014 00:48:19 -0700 Subject: [PATCH 128/656] Fixes :editor.jump-to to push current position to stack --- src/lt/objs/jump_stack.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lt/objs/jump_stack.cljs b/src/lt/objs/jump_stack.cljs index 228d6450f..109407b15 100644 --- a/src/lt/objs/jump_stack.cljs +++ b/src/lt/objs/jump_stack.cljs @@ -59,4 +59,6 @@ :desc "Editor: Jump to file/pos" :hidden true :exec (fn [file pos] + (when-let [ed (lt.objs.editor.pool/last-active)] + (object/raise jump-stack :jump-stack.push! ed file pos)) (jump-to file pos))}) From ceb39c85a7fb91eade3413923547807a5fe37a08 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Sun, 13 Apr 2014 00:48:57 -0700 Subject: [PATCH 129/656] Fixes error internal to CM when line number is not specified --- src/lt/objs/editor.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index e7d9b50bf..ddb1f69bf 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -202,7 +202,7 @@ ed) (defn move-cursor [ed pos] - (.setCursor (->cm-ed ed) (clj->js pos))) + (.setCursor (->cm-ed ed) (clj->js (or pos 0)))) (defn scroll-to [ed x y] (.scrollTo (->cm-ed ed) x y)) From 0da7839813dc6645153015a6ef7d3571d4e609fb Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 19 Apr 2014 23:19:00 -0400 Subject: [PATCH 130/656] Add reasonable default keybindings for zooming These keybindings are a standard way of zooming in OSX browsers. --- deploy/settings/default/default.keymap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 7c911be79..2552a3187 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -5,7 +5,9 @@ "pmeta-shift-f" [:searcher.show] "ctrl-shift-d" [:docs.search.show] "pmeta-n" [:new-file] - "ctrl-space" [:show-commandbar-transient]} + "ctrl-space" [:show-commandbar-transient] + "pmeta-shift-=" [:window.zoom-in] + "pmeta--" [:window.zoom-out]} :editor {"pmeta-enter" [:eval-editor-form] "pmeta-shift-enter" [:eval-editor] "pmeta-s" [:save] From bf40ff10240f843482f9640cee46d080bc1d1f3c Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Mon, 21 Apr 2014 10:31:56 -0700 Subject: [PATCH 131/656] Fixes default position to be in the correct format --- src/lt/objs/editor.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index ddb1f69bf..179fd6111 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -202,7 +202,7 @@ ed) (defn move-cursor [ed pos] - (.setCursor (->cm-ed ed) (clj->js (or pos 0)))) + (.setCursor (->cm-ed ed) (clj->js (or pos {:line 0 :ch 0})))) (defn scroll-to [ed x y] (.scrollTo (->cm-ed ed) x y)) From c363aa1ce1e8c5716fb222deb1171a5b3a326df9 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 21 Apr 2014 10:59:50 -0700 Subject: [PATCH 132/656] prevent the inspector from exploding if you give a sourcemap url that doesn't lead to a file Signed-off-by: Chris Granger --- src/lt/util/load.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 8ff5a39d1..541a2d6ab 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -19,7 +19,7 @@ (js/require (str pwd "/core/node_modules/" path))) (defn- abs-source-mapping-url [code file] - (if-let [path-to-source-map (second (re-find #"\n//# sourceMappingURL=(.*)" code))] + (if-let [path-to-source-map (second (re-find #"\n//# sourceMappingURL=(.*\.map)" code))] (if-not (absolute? path-to-source-map) (let [abs-path-to-source-map (string/replace (.join fpath (.dirname fpath file) path-to-source-map) "\\" "/") abs-path-to-source-map (if (= separator "\\") From d79f7007ac66ceeca34d7342bca3a8ff461a8eb3 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Tue, 15 Apr 2014 01:10:22 +0200 Subject: [PATCH 133/656] eclipse theme: fix 'Invalid CSS property value: #red' warning --- deploy/core/css/themes/eclipse.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/css/themes/eclipse.css b/deploy/core/css/themes/eclipse.css index a8ef4c601..ce55b965a 100644 --- a/deploy/core/css/themes/eclipse.css +++ b/deploy/core/css/themes/eclipse.css @@ -1,6 +1,6 @@ #multi.theme-eclipse .content { background:#f6f6f6; } #multi.theme-eclipse .list .active, #multi.theme-eclipse .list li:hover { background:#f6f6f6; color:#333; } -#multi.theme-eclipse .list .dirty { color:#red; } +#multi.theme-eclipse .list .dirty { color:red; } .cm-s-eclipse { background: #f6f6f6; } From 3e558976fffa47b076b97b558cf9e370a5f1db3d Mon Sep 17 00:00:00 2001 From: Yoshito Komatsu Date: Tue, 22 Apr 2014 22:53:08 +0900 Subject: [PATCH 134/656] Add multiple fonts support --- src/lt/objs/style.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index 74ac1f9d0..bea498a4d 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -12,7 +12,8 @@ [lt.util.dom :as dom] [lt.util.load :as load] [crate.binding :refer [bound -value subatom]] - [crate.compiler :refer [dom-attr]]) + [crate.compiler :refer [dom-attr]] + [clojure.string :as string]) (:require-macros [lt.macros :refer [behavior defui]])) (defn css-expr [k v] @@ -21,12 +22,17 @@ (defn selector [sel & body] (str sel " { " (apply str body) " }")) +(defn str-font-family [x] + (if (vector? x) + (string/join ", " (map pr-str x)) + (pr-str x))) + (defn ->css [settings] (selector ".CodeMirror" (when (:line-height settings) (css-expr :line-height (str (:line-height settings) "em"))) (when (:font-family settings) - (css-expr :font-family (pr-str (:font-family settings)))) + (css-expr :font-family (str-font-family (:font-family settings)))) (when (:font-size settings) (css-expr :font-size (str (:font-size settings) "pt"))))) From 6f279bfa3b9b224751e72b8e39d3ed95e51dfcea Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Wed, 23 Apr 2014 23:23:40 +1000 Subject: [PATCH 135/656] Move add / remove methods after helpers --- src/lt/objs/editor.cljs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 965ce9b85..2d75371a7 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -371,17 +371,6 @@ (defn fold-code [e] (.foldCode (->cm-ed e) (cursor e))) -(defn add-gutter [e class-name width] - (let [gutter-classes (set (conj (js->clj (option e "gutters")) class-name)) - current-widths (gutter-widths e) - new-gutter-widths (assoc current-widths class-name width)] - (update-gutters e gutter-classes new-gutter-widths))) - -(defn remove-gutter [e class-name] - (let [gutter-classes (remove #{class-name} (js->clj (option e "gutters"))) - current-widths (gutter-widths e)] - (update-gutters e gutter-classes current-widths))) - (defn gutter-widths [e] (let [gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div) @@ -399,6 +388,17 @@ (if-let [gutter (dom/$ (str "div." k) gutter-div)] (dom/set-css gutter {"width" (str v "px")}))))))) +(defn add-gutter [e class-name width] + (let [gutter-classes (set (conj (js->clj (option e "gutters")) class-name)) + current-widths (gutter-widths e) + new-gutter-widths (assoc current-widths class-name width)] + (update-gutters e gutter-classes new-gutter-widths))) + +(defn remove-gutter [e class-name] + (let [gutter-classes (remove #{class-name} (js->clj (option e "gutters"))) + current-widths (gutter-widths e)] + (update-gutters e gutter-classes current-widths))) + ;;********************************************************* ;; Object ;;********************************************************* From 8217391c244553c0e91f5e2105da79463eba7382 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Tue, 29 Apr 2014 18:49:30 -0500 Subject: [PATCH 136/656] Workspace Behaviors on Startup Fix issue #1510 by supplying the correct data structures for the functions used and correctly pulling out the desired tags map. --- src/lt/objs/settings.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 5110c17aa..ea260cd0d 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -58,7 +58,8 @@ :- add}) (defn apply-diff [diff] - (reset! object/tags (behavior-diff diff @object/tags))) + (let [final (behavior-diff diff {:+ @object/tags })] + (reset! object/tags (:+ final)))) (defn parse-file [file final] (-> (files/open-sync file) From f1ca19c468fa5e6c25552091baabb8d7341eb4b0 Mon Sep 17 00:00:00 2001 From: Jakub Holy Date: Wed, 7 May 2014 14:08:56 +0200 Subject: [PATCH 137/656] Try a default port for socket.io first Try to use a hard-coded port, 5678, and only ask for a random free port when it is not available. Users that have only one connection thus get by most of the time without having to change the port in their HTML. I think it is also better to log errors than to swallow them. --- src/lt/objs/clients/ws.cljs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index 98bb5a29b..3ac3bc311 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -54,8 +54,14 @@ (def server (try - (let [ ws (.listen io 0)] + (let [ ws (.listen io 5678)] (.set ws "log level" 1) + (.on (.-server ws) "error" #(do + (if (= (.-code %) "EADDRINUSE") + (do + (.log js/console "Default socket.io port already used, retrying with a random one") + (.listen (.-server ws) 0)) + (throw e)))) (.on (.-server ws) "listening" #(do (set! port (.-port (.address (.-server ws)))) )) @@ -64,9 +70,9 @@ ws) ;;TODO: warn the user that they're not connected to anything (catch js/Error e - ) + (.log js/console "Error starting socket.io server" e)) (catch js/global.Error e - ))) + (.log js/console "Global Error starting socket.io server" e)))) (behavior ::kill-on-closed :triggers #{:closed} From 4570f8e410fea2dbda441f94695b98c7b60f42fd Mon Sep 17 00:00:00 2001 From: Jamie Brandon Date: Mon, 12 May 2014 09:00:25 -0700 Subject: [PATCH 138/656] Dont walk forward when editing find bar --- deploy/settings/default/default.behaviors | 2 +- src/lt/objs/find.cljs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 87fcafc27..c08511b0e 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -287,7 +287,7 @@ :lt.objs.sidebar.command/move-selection :lt.objs.sidebar.command/set-selection! :lt.objs.sidebar.command/filter-active] - :find-bar [:lt.objs.find/clear! :lt.objs.find/next! + :find-bar [:lt.objs.find/clear! :lt.objs.find/next! :lt.objs.find/show! :lt.objs.find/focus! :lt.objs.find/hide! :lt.objs.find/prev! :lt.objs.find/replace! :lt.objs.find/search!] diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index c27eee519..c2f408437 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -63,6 +63,12 @@ (defn set-val [this v] (dom/val (dom/$ :input.find (object/->content this)) v)) +(behavior ::show! + :triggers #{:show!} + :reaction (fn [this] + (object/merge! this {:pos (when-let [ed (pool/last-active)] + (editor/->cursor ed))}))) + (behavior ::hide! :triggers #{:hide!} :reaction (fn [this] @@ -120,6 +126,8 @@ (if (empty? v) (object/raise this :clear!) (when-let [e (pool/last-active)] + (when-let [pos (:pos @this)] + (editor/move-cursor e pos)) (object/merge! this {:searching? true}) (object/merge! e {:searching.for v}) (let [ed (editor/->cm-ed e)] @@ -132,6 +140,7 @@ :searching? false :reverse? false :shown false + :pos nil :init (fn [this] [:div#find-bar (input this) From 0324b1ba476da0b36feac10c8417bf8ef34b605c Mon Sep 17 00:00:00 2001 From: Jamie Brandon Date: Mon, 12 May 2014 11:07:23 -0700 Subject: [PATCH 139/656] Add docs and blog posts to readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c234aac30..2c6491104 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +See [docs.lighttable.com](http://docs.lighttable.com/) for user documentation and tutorials. + # Initial setup First install or update [leiningen](http://leiningen.org/). @@ -225,3 +227,9 @@ Commands can also be bound to key chords. Run the command `Settings: Default key # Plugins See [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier) for an example ClojureScript plugin. + +# Other documentation + +* [Clojurescript for Light Table users](https://github.com/swannodette/lt-cljs-tutorial) by David Nolen +* [Getting started programming Light Table](http://devblog.reverb.com/post/85325435561/getting-started-programming-light-table) by Joshua Emmons. +* [Light Table plugin tutorial](http://blog.jakubarnold.cz/2014/01/13/light-table-plugin-tutorial.html) by Jakub Arnold From 955794cf209b9eb402a122fc01be873e8cab0775 Mon Sep 17 00:00:00 2001 From: Jamie Brandon Date: Mon, 12 May 2014 11:09:38 -0700 Subject: [PATCH 140/656] One more post --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2c6491104..04cb8784b 100755 --- a/README.md +++ b/README.md @@ -233,3 +233,4 @@ See [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassif * [Clojurescript for Light Table users](https://github.com/swannodette/lt-cljs-tutorial) by David Nolen * [Getting started programming Light Table](http://devblog.reverb.com/post/85325435561/getting-started-programming-light-table) by Joshua Emmons. * [Light Table plugin tutorial](http://blog.jakubarnold.cz/2014/01/13/light-table-plugin-tutorial.html) by Jakub Arnold +* [How to programmatically manage a Light Table-aware nREPL server](http://manuelp.herokuapp.com/posts/14) by Manuel Paccagnella From 77d13fde4d58ff6c592e658abeeea4ee95301163 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Fri, 16 May 2014 14:48:58 -0700 Subject: [PATCH 141/656] move to the latest cm4 stuff Signed-off-by: Chris Granger --- .../node_modules/codemirror/active-line.js | 3 + .../node_modules/codemirror/codemirror.js | 571 +++++++++++++----- .../core/node_modules/codemirror/comment.js | 57 +- .../node_modules/codemirror/matchbracket.js | 128 ++-- .../core/node_modules/codemirror/overlay.js | 42 +- .../node_modules/codemirror/scrollpastend.js | 17 +- 6 files changed, 578 insertions(+), 240 deletions(-) diff --git a/deploy/core/node_modules/codemirror/active-line.js b/deploy/core/node_modules/codemirror/active-line.js index a818f109b..bafcb6b8c 100644 --- a/deploy/core/node_modules/codemirror/active-line.js +++ b/deploy/core/node_modules/codemirror/active-line.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Because sometimes you need to style the cursor's line. // // Adds an option 'styleActiveLine' which, when enabled, gives the diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/codemirror.js index 703ac2fb6..371c37651 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/codemirror.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // This is CodeMirror (http://codemirror.net), a code editor // implemented in JavaScript on top of the browser's DOM. // @@ -33,7 +36,6 @@ var presto = /Opera\//.test(navigator.userAgent); var safari = /Apple Computer/.test(navigator.vendor); var khtml = /KHTML\//.test(navigator.userAgent); - var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent); var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); var phantom = /PhantomJS/.test(navigator.userAgent); @@ -63,8 +65,7 @@ this.options = options = options || {}; // Determine effective options based on given values and defaults. - for (var opt in defaults) if (!options.hasOwnProperty(opt)) - options[opt] = defaults[opt]; + copyObj(defaults, options, false); setGuttersForLineNumbers(options); var doc = options.value; @@ -95,6 +96,7 @@ if (ie_upto10) setTimeout(bind(resetInput, this, true), 20); registerEventHandlers(this); + ensureGlobalHandlers(); var cm = this; runInOp(this, function() { @@ -232,6 +234,10 @@ // True when shift is held down. d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; } // STATE UPDATES @@ -256,10 +262,10 @@ function wrappingChanged(cm) { if (cm.options.lineWrapping) { - cm.display.wrapper.className += " CodeMirror-wrap"; + addClass(cm.display.wrapper, "CodeMirror-wrap"); cm.display.sizer.style.minWidth = ""; } else { - cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", ""); + rmClass(cm.display.wrapper, "CodeMirror-wrap"); findMaxLine(cm); } estimateLineHeights(cm); @@ -329,9 +335,13 @@ } } gutters.style.display = i ? "" : "none"; - var width = gutters.offsetWidth; + updateGutterSpace(cm); + } + + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; cm.display.sizer.style.marginLeft = width + "px"; - if (i) cm.display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; + cm.display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; } // Compute the character length of a line, taking into account @@ -434,14 +444,18 @@ d.gutterFiller.style.width = d.gutters.offsetWidth + "px"; } else d.gutterFiller.style.display = ""; - if (mac_geLion && scrollbarWidth(d.measure) === 0) { - d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px"; - var barMouseDown = function(e) { - if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH) - operation(cm, onMouseDown)(e); - }; - on(d.scrollbarV, "mousedown", barMouseDown); - on(d.scrollbarH, "mousedown", barMouseDown); + if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) { + if (scrollbarWidth(d.measure) === 0) { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w; + var barMouseDown = function(e) { + if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH) + operation(cm, onMouseDown)(e); + }; + on(d.scrollbarV, "mousedown", barMouseDown); + on(d.scrollbarH, "mousedown", barMouseDown); + } + cm.state.checkedOverlayScrollbar = true; } } @@ -449,7 +463,7 @@ // the the current scroll position). viewPort may contain top, // height, and ensure (see op.scrollToPos) properties. function visibleLines(display, doc, viewPort) { - var top = viewPort && viewPort.top != null ? viewPort.top : display.scroller.scrollTop; + var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop; top = Math.floor(top - paddingTop(display)); var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight; @@ -465,7 +479,7 @@ return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight), to: ensureTo}; } - return {from: from, to: to}; + return {from: from, to: Math.max(to, from + 1)}; } // LINE NUMBERS @@ -503,9 +517,7 @@ display.lineNumWidth = display.lineNumInnerWidth + padding; display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; display.lineGutter.style.width = display.lineNumWidth + "px"; - var width = display.gutters.offsetWidth; - display.scrollbarH.style.left = cm.options.fixedGutter ? width + "px" : 0; - display.sizer.style.marginLeft = width + "px"; + updateGutterSpace(cm); return true; } return false; @@ -546,6 +558,8 @@ updateSelection(cm); setDocumentHeight(cm, barMeasure); updateScrollbars(cm, barMeasure); + if (webkit && cm.options.lineWrapping) + checkForWebkitWidthBug(cm, barMeasure); // (Issue #2420) if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) { forced = true; continue; @@ -653,6 +667,15 @@ cm.display.gutters.style.height = Math.max(measure.docHeight, measure.clientHeight - scrollerCutOff) + "px"; } + function checkForWebkitWidthBug(cm, measure) { + // Work around Webkit bug where it sometimes reserves space for a + // non-existing phantom scrollbar in the scroller (Issue #2420) + if (cm.display.sizer.offsetWidth + cm.display.gutters.offsetWidth < cm.display.scroller.clientWidth - 1) { + cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = "0px"; + cm.display.gutters.style.height = measure.docHeight + "px"; + } + } + // Read the actual heights of the rendered lines, and update their // stored heights to match. function updateHeightsInViewport(cm) { @@ -1138,9 +1161,10 @@ doc.sel = sel; - if (doc.cm) - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = - doc.cm.curOp.cursorActivity = true; + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } signalLater(doc, "cursorActivity", doc); } @@ -1229,9 +1253,9 @@ var range = doc.sel.ranges[i]; var collapsed = range.empty(); if (collapsed || cm.options.showCursorWhenSelecting) - updateSelectionCursor(cm, range, curFragment); + drawSelectionCursor(cm, range, curFragment); if (!collapsed) - updateSelectionRange(cm, range, selFragment); + drawSelectionRange(cm, range, selFragment); } // Move the hidden textarea near the cursor to prevent scrolling artifacts @@ -1251,7 +1275,7 @@ } // Draws a cursor for the given range - function updateSelectionCursor(cm, range, output) { + function drawSelectionCursor(cm, range, output) { var pos = cursorCoords(cm, range.head, "div"); var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); @@ -1270,13 +1294,15 @@ } // Draws the given range as a highlighted selection - function updateSelectionRange(cm, range, output) { + function drawSelectionRange(cm, range, output) { var display = cm.display, doc = cm.doc; var fragment = document.createDocumentFragment(); var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right; function add(left, top, width, bottom) { if (top < 0) top = 0; + top = Math.round(top); + bottom = Math.round(bottom); fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px; height: " + (bottom - top) + "px")); @@ -1372,7 +1398,10 @@ doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { if (doc.frontier >= cm.display.viewFrom) { // Visible var oldStyles = line.styles; - line.styles = highlightLine(cm, line, state, true); + var highlighted = highlightLine(cm, line, state, true); + line.styles = highlighted.styles; + if (highlighted.classes) line.styleClasses = highlighted.classes; + else if (line.styleClasses) line.styleClasses = null; var ischange = !oldStyles || oldStyles.length != line.styles.length; for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; if (ischange) regLineChange(cm, doc.frontier, "text"); @@ -1435,8 +1464,9 @@ if (display.cachedPaddingH) return display.cachedPaddingH; var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - return display.cachedPaddingH = {left: parseInt(style.paddingLeft), - right: parseInt(style.paddingRight)}; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; + return data; } // Ensure the lineView.wrapping.heights array is populated. This is @@ -1598,7 +1628,7 @@ else rect = nullRect; } else { - rect = range(node, start, end).getBoundingClientRect(); + rect = range(node, start, end).getBoundingClientRect() || nullRect; } } else { // If it is a widget, simply get the box for the whole widget. if (start > 0) collapse = bias = "right"; @@ -1870,7 +1900,7 @@ updateInput: null, // Whether to reset the input textarea typing: false, // Whether this reset should be careful to leave existing text (for compositing) changeObjs: null, // Accumulated changes, for firing change events - cursorActivity: false, // Whether to fire a cursorActivity event + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on selectionChanged: false, // Whether the selection needs to be redrawn updateMaxLine: false, // Set when the widest line needs to be determined anew scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet @@ -1899,6 +1929,10 @@ if (!updated && op.selectionChanged) updateSelection(cm); if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm); + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + display.wheelStartX = display.wheelStartY = null; + // Propagate the scroll position to the actual DOM scroller if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) { var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); @@ -1935,13 +1969,12 @@ delayedCallbacks = null; } // Fire change events, and delayed event handlers - if (op.changeObjs) { - for (var i = 0; i < op.changeObjs.length; i++) - signal(cm, "change", cm, op.changeObjs[i]); + if (op.changeObjs) signal(cm, "changes", cm, op.changeObjs); - } - if (op.cursorActivity) signal(cm, "cursorActivity", cm); if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i](); + if (op.cursorActivityHandlers) + for (var i = 0; i < op.cursorActivityHandlers.length; i++) + op.cursorActivityHandlers[i](cm); } // Run the given function in an operation @@ -2113,7 +2146,8 @@ function viewCuttingPoint(cm, oldN, newN, dir) { var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans) return {index: index, lineN: newN}; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + return {index: index, lineN: newN}; for (var i = 0, n = cm.display.viewFrom; i < index; i++) n += view[i].size; if (n != oldN) { @@ -2204,7 +2238,13 @@ // possible when it is clear that nothing happened. hasSelection // will be the case when there is a lot of text in the textarea, // in which case reading its value would be expensive. - if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.options.disableInput) return false; + if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput) + return false; + // See paste handler for more on the fakedLastChar kludge + if (cm.state.pasteIncoming && cm.state.fakedLastChar) { + input.value = input.value.substring(0, input.value.length - 1); + cm.state.fakedLastChar = false; + } var text = input.value; // If nothing changed, bail. if (text == prevInput && !cm.somethingSelected()) return false; @@ -2218,6 +2258,8 @@ if (withOp) startOperation(cm); cm.display.shift = false; + if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput) + prevInput = "\u200b"; // Find the part of the input that is actually new var same = 0, l = Math.min(prevInput.length, text.length); while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; @@ -2245,12 +2287,18 @@ if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && cm.options.smartIndent && range.head.ch < 100 && (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) { - var electric = cm.getModeAt(range.head).electricChars; - if (electric) for (var j = 0; j < electric.length; j++) - if (inserted.indexOf(electric.charAt(j)) > -1) { + var mode = cm.getModeAt(range.head); + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indentLine(cm, range.head.line, "smart"); + break; + } + } else if (mode.electricInput) { + var end = changeEnd(changeEvent); + if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) indentLine(cm, range.head.line, "smart"); - break; - } + } } } ensureCursorVisible(cm); @@ -2311,7 +2359,7 @@ var pos = posFromMouse(cm, e); if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; e_preventDefault(e); - var word = findWordAt(cm.doc, pos); + var word = findWordAt(cm, pos); extendSelection(cm.doc, word.anchor, word.head); })); else @@ -2352,26 +2400,6 @@ // Prevent wrapper from ever scrolling on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - // When the window resizes, we need to refresh active editors. - var resizeTimer; - function onResize() { - if (resizeTimer == null) resizeTimer = setTimeout(function() { - resizeTimer = null; - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = knownScrollbarWidth = null; - cm.setSize(); - }, 100); - } - on(window, "resize", onResize); - // The above handler holds on to the editor and its data - // structures. Here we poll to unregister it when the editor is no - // longer in the document, so that it can be garbage-collected. - function unregister() { - if (contains(document.body, d.wrapper)) setTimeout(unregister, 5000); - else off(window, "resize", onResize); - } - setTimeout(unregister, 5000); - on(d.input, "keyup", operation(cm, onKeyUp)); on(d.input, "input", function() { if (ie && !ie_upto8 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; @@ -2398,21 +2426,48 @@ fastPoll(cm); }); on(d.input, "paste", function() { + // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206 + // Add a char to the end of textarea before paste occur so that + // selection doesn't span to the end of textarea. + if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) { + var start = d.input.selectionStart, end = d.input.selectionEnd; + d.input.value += "$"; + d.input.selectionStart = start; + d.input.selectionEnd = end; + cm.state.fakedLastChar = true; + } cm.state.pasteIncoming = true; fastPoll(cm); }); - function prepareCopy(e) { - if (d.inaccurateSelection) { - d.prevInput = ""; - d.inaccurateSelection = false; - d.input.value = cm.getSelection(); - selectInput(d.input); + function prepareCopyCut(e) { + if (cm.somethingSelected()) { + if (d.inaccurateSelection) { + d.prevInput = ""; + d.inaccurateSelection = false; + d.input.value = cm.getSelection(); + selectInput(d.input); + } + } else { + var text = "", ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text += cm.getRange(lineRange.anchor, lineRange.head); + } + if (e.type == "cut") { + cm.setSelections(ranges, null, sel_dontScroll); + } else { + d.prevInput = ""; + d.input.value = text; + selectInput(d.input); + } } if (e.type == "cut") cm.state.cutIncoming = true; } - on(d.input, "cut", prepareCopy); - on(d.input, "copy", prepareCopy); + on(d.input, "cut", prepareCopyCut); + on(d.input, "copy", prepareCopyCut); // Needed to handle Tab key in KHTML if (khtml) on(d.sizer, "mouseup", function() { @@ -2421,6 +2476,14 @@ }); } + // Called when the window resizes + function onResize(cm) { + // Might be a text scaling operation, clear size caches. + var d = cm.display; + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + cm.setSize(); + } + // MOUSE EVENTS // Return true when the given mouse event happened in a widget @@ -2449,7 +2512,7 @@ var coords = coordsChar(cm, x, y), line; if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff); + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); } return coords; } @@ -2511,17 +2574,17 @@ lastClick = {time: now, pos: start}; } - var sel = cm.doc.sel, addNew = mac ? e.metaKey : e.ctrlKey; - if (cm.options.dragDrop && dragAndDrop && !addNew && !isReadOnly(cm) && + var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && type == "single" && sel.contains(start) > -1 && sel.somethingSelected()) - leftButtonStartDrag(cm, e, start); + leftButtonStartDrag(cm, e, start, modifier); else - leftButtonSelect(cm, e, start, type, addNew); + leftButtonSelect(cm, e, start, type, modifier); } // Start a text drag. When it ends, see if any dragging actually // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start) { + function leftButtonStartDrag(cm, e, start, modifier) { var display = cm.display; var dragEnd = operation(cm, function(e2) { if (webkit) display.scroller.draggable = false; @@ -2530,7 +2593,8 @@ off(display.scroller, "drop", dragEnd); if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { e_preventDefault(e2); - extendSelection(cm.doc, start); + if (!modifier) + extendSelection(cm.doc, start); focusInput(cm); // Work around unexplainable focus problem in IE9 (#2127) if (ie_upto10 && !ie_upto8) @@ -2552,7 +2616,7 @@ e_preventDefault(e); var ourRange, ourIndex, startSel = doc.sel; - if (addNew) { + if (addNew && !e.shiftKey) { ourIndex = doc.sel.contains(start); if (ourIndex > -1) ourRange = doc.sel.ranges[ourIndex]; @@ -2568,7 +2632,7 @@ start = posFromMouse(cm, e, true, true); ourIndex = -1; } else if (type == "double") { - var word = findWordAt(doc, start); + var word = findWordAt(cm, start); if (cm.display.shift || doc.extend) ourRange = extendRange(doc, ourRange, word.anchor, word.head); else @@ -2586,6 +2650,7 @@ if (!addNew) { ourIndex = 0; setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; } else if (ourIndex > -1) { replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); } else { @@ -2613,13 +2678,15 @@ ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } if (!ranges.length) ranges.push(new Range(start, start)); - setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), sel_mouse); + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); } else { var oldRange = ourRange; var anchor = oldRange.anchor, head = pos; if (type != "single") { if (type == "double") - var range = findWordAt(doc, pos); + var range = findWordAt(cm, pos); else var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); if (cmp(range.anchor, anchor) > 0) { @@ -2719,7 +2786,7 @@ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; e_preventDefault(e); - if (ie_upto10) lastDrop = +new Date; + if (ie) lastDrop = +new Date; var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; if (!pos || isReadOnly(cm)) return; // Might be a file drop, in which case we simply extract the text @@ -2728,7 +2795,7 @@ var n = files.length, text = Array(n), read = 0; var loadFile = function(file, i) { var reader = new FileReader; - reader.onload = function() { + reader.onload = operation(cm, function() { text[i] = reader.result; if (++read == n) { pos = clipPos(cm.doc, pos); @@ -2736,7 +2803,7 @@ makeChange(cm.doc, change); setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); } - }; + }); reader.readAsText(file); }; for (var i = 0; i < n; ++i) loadFile(files[i], i); @@ -2751,7 +2818,8 @@ try { var text = e.dataTransfer.getData("Text"); if (text) { - var selected = cm.state.draggingText && cm.listSelections(); + if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) + var selected = cm.listSelections(); setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); if (selected) for (var i = 0; i < selected.length; ++i) replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); @@ -2764,7 +2832,7 @@ } function onDragStart(cm, e) { - if (ie_upto10 && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; e.dataTransfer.setData("Text", cm.getSelection()); @@ -3007,11 +3075,11 @@ function showCrossHair(cm) { var lineDiv = cm.display.lineDiv; - lineDiv.className += " CodeMirror-crosshair"; + addClass(lineDiv, "CodeMirror-crosshair"); function up(e) { if (e.keyCode == 18 || !e.altKey) { - lineDiv.className = lineDiv.className.replace(" CodeMirror-crosshair", ""); + rmClass(lineDiv, "CodeMirror-crosshair"); off(document, "keyup", up); off(document, "mouseover", up); } @@ -3044,9 +3112,11 @@ if (!cm.state.focused) { signal(cm, "focus", cm); cm.state.focused = true; - if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1) - cm.display.wrapper.className += " CodeMirror-focused"; - if (!cm.curOp) { + addClass(cm.display.wrapper, "CodeMirror-focused"); + // The prevInput test prevents this from firing when a context + // menu is closed (since the resetInput would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { resetInput(cm); if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730 } @@ -3058,7 +3128,7 @@ if (cm.state.focused) { signal(cm, "blur", cm); cm.state.focused = false; - cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-focused", ""); + rmClass(cm.display.wrapper, "CodeMirror-focused"); } clearInterval(cm.display.blinker); setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); @@ -3066,7 +3136,6 @@ // CONTEXT MENU HANDLING - var detectingSelectAll; // To make the context menu work, we need to briefly unhide the // textarea (making it as unobtrusive as possible) to let the // right-click take effect on it. @@ -3094,14 +3163,17 @@ resetInput(cm); // Adds "Select all" to context menu in FF if (!cm.somethingSelected()) display.input.value = display.prevInput = " "; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); // Select-all will be greyed out if there's nothing to select, so // this adds a zero-width space so that we can later check whether // it got selected. function prepareSelectAllHack() { if (display.input.selectionStart != null) { - var extval = display.input.value = "\u200b" + (cm.somethingSelected() ? display.input.value : ""); - display.prevInput = "\u200b"; + var selected = cm.somethingSelected(); + var extval = display.input.value = "\u200b" + (selected ? display.input.value : ""); + display.prevInput = selected ? "" : "\u200b"; display.input.selectionStart = 1; display.input.selectionEnd = extval.length; } } @@ -3114,14 +3186,13 @@ // Try to detect the user choosing select-all if (display.input.selectionStart != null) { if (!ie || ie_upto8) prepareSelectAllHack(); - clearTimeout(detectingSelectAll); - var i = 0, poll = function(){ - if (display.prevInput == "\u200b" && display.input.selectionStart == 0) + var i = 0, poll = function() { + if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) operation(cm, commands.selectAll)(cm); - else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); else resetInput(cm); }; - detectingSelectAll = setTimeout(poll, 200); + display.detectingSelectAll = setTimeout(poll, 200); } } @@ -3317,7 +3388,7 @@ var after = i ? computeSelAfterChange(doc, change, null) : lst(source); makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (doc.cm) ensureCursorVisible(doc.cm); + if (!i && doc.cm) doc.cm.scrollIntoView(change); var rebased = []; // Propagate to the linked documents @@ -3334,12 +3405,17 @@ // Sub-views need their line numbers shifted when text is added // above or below them in the parent document. function shiftDoc(doc, distance) { + if (distance == 0) return; doc.first += distance; doc.sel = new Selection(map(doc.sel.ranges, function(range) { return new Range(Pos(range.anchor.line + distance, range.anchor.ch), Pos(range.head.line + distance, range.head.ch)); }), doc.sel.primIndex); - if (doc.cm) regChange(doc.cm, doc.first, doc.first - distance, distance); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + regLineChange(doc.cm, l, "gutter"); + } } // More lower-level change function, handling only a single document @@ -3392,7 +3468,7 @@ } if (doc.sel.contains(change.from, change.to) > -1) - cm.curOp.cursorActivity = true; + signalCursorActivity(cm); updateDoc(doc, change, spans, estimateHeight(cm)); @@ -3420,13 +3496,18 @@ else regChange(cm, from.line, to.line + 1, lendiff); - if (hasHandler(cm, "change") || hasHandler(cm, "changes")) - (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push({ + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { from: from, to: to, text: change.text, removed: change.removed, origin: change.origin - }); + }; + if (changeHandler) signalLater(cm, "change", cm, obj); + if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + cm.display.selForContextMenu = null; } function replaceRange(doc, code, from, to, origin) { @@ -3632,7 +3713,6 @@ else no = lineNo(handle); if (no == null) return null; if (op(line, no)) regLineChange(cm, no, changeType); - else return null; return line; } @@ -3695,10 +3775,11 @@ else if (unit == "column") moveOnce(true); else if (unit == "word" || unit == "group") { var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); for (var first = true;; first = false) { if (dir < 0 && !moveOnce(!first)) break; var cur = lineObj.text.charAt(ch) || "\n"; - var type = isWordChar(cur) ? "w" + var type = isWordChar(cur, helper) ? "w" : group && cur == "\n" ? "n" : !group || /\s/.test(cur) ? null : "p"; @@ -3738,13 +3819,15 @@ } // Find the word at the given position (as returned by coordsChar). - function findWordAt(doc, pos) { - var line = getLine(doc, pos.line).text; + function findWordAt(cm, pos) { + var doc = cm.doc, line = getLine(doc, pos.line).text; var start = pos.ch, end = pos.ch; if (line) { + var helper = cm.getHelper(pos, "wordChars"); if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; var startChar = line.charAt(start); - var check = isWordChar(startChar) ? isWordChar + var check = isWordChar(startChar, helper) + ? function(ch) { return isWordChar(ch, helper); } : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; while (start > 0 && check(line.charAt(start - 1))) --start; @@ -3845,7 +3928,7 @@ var stream = new StringStream(line.text, this.options.tabSize); while (stream.pos < pos.ch && !stream.eol()) { stream.start = stream.pos; - var style = mode.token(stream, state); + var style = readToken(mode, stream, state); } return {start: stream.start, end: stream.pos, @@ -3858,13 +3941,16 @@ pos = clipPos(this.doc, pos); var styles = getLineStyles(this, getLine(this.doc, pos.line)); var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - if (ch == 0) return styles[2]; - for (;;) { + var type; + if (ch == 0) type = styles[2]; + else for (;;) { var mid = (before + after) >> 1; if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; else if (styles[mid * 2 + 1] < ch) before = mid + 1; - else return styles[mid * 2 + 2]; + else { type = styles[mid * 2 + 2]; break; } } + var cut = type ? type.indexOf("cm-overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); }, getModeAt: function(pos) { @@ -4117,9 +4203,9 @@ toggleOverwrite: function(value) { if (value != null && value == this.state.overwrite) return; if (this.state.overwrite = !this.state.overwrite) - this.display.cursorDiv.className += " CodeMirror-overwrite"; + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); else - this.display.cursorDiv.className = this.display.cursorDiv.className.replace(" CodeMirror-overwrite", ""); + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); signal(this, "overwriteToggle", this, this.state.overwrite); }, @@ -4177,8 +4263,10 @@ refresh: methodOp(function() { var oldHeight = this.display.cachedTextHeight; regChange(this); + this.curOp.forceUpdate = true; clearCaches(this); this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) estimateLineHeights(this); signal(this, "refresh", this); @@ -4529,19 +4617,40 @@ indentMore: function(cm) {cm.indentSelection("add");}, indentLess: function(cm) {cm.indentSelection("subtract");}, insertTab: function(cm) {cm.replaceSelection("\t");}, + insertSoftTab: function(cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); + } + cm.replaceSelections(spaces); + }, defaultTab: function(cm) { if (cm.somethingSelected()) cm.indentSelection("add"); else cm.execCommand("insertTab"); }, transposeChars: function(cm) { runInOp(cm, function() { - var ranges = cm.listSelections(); + var ranges = cm.listSelections(), newSel = []; for (var i = 0; i < ranges.length; i++) { var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (cur.ch > 0 && cur.ch < line.length - 1) - cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), - Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + if (line) { + if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) + cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); + } + } + newSel.push(new Range(cur, cur)); } + cm.setSelections(newSel); }); }, newlineAndIndent: function(cm) { @@ -4845,6 +4954,7 @@ } if (cm) signalLater(cm, "markerCleared", cm, this); if (withOp) endOperation(cm); + if (this.parent) this.parent.clear(); }; // Find the position of the marker in the document. Returns a {from, @@ -4924,7 +5034,7 @@ if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) copyObj(options, marker); + if (options) copyObj(options, marker, false); // Don't connect empty markers unless clearWhenEmpty is false if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) return marker; @@ -4992,10 +5102,8 @@ var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { this.markers = markers; this.primary = primary; - for (var i = 0, me = this; i < markers.length; ++i) { + for (var i = 0; i < markers.length; ++i) markers[i].parent = this; - on(markers[i], "clear", function(){me.clear();}); - } }; eventMixin(SharedTextMarker); @@ -5025,6 +5133,37 @@ return new SharedTextMarker(markers, primary); } + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), + function(m) { return m.parent; }); + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], linked = [marker.primary.doc];; + linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + } + } + // TEXTMARKER SPANS function MarkedSpan(marker, from, to) { @@ -5449,13 +5588,42 @@ detachMarkedSpans(line); } + function extractLineClasses(type, output) { + if (type) for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) break; + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + output[prop] = lineClass[2]; + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + output[prop] += " " + lineClass[2]; + } + return type; + } + + function callBlankLine(mode, state) { + if (mode.blankLine) return mode.blankLine(state); + if (!mode.innerMode) return; + var inner = CodeMirror.innerMode(mode, state); + if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); + } + + function readToken(mode, stream, state) { + for (var i = 0; i < 10; i++) { + var style = mode.token(stream, state); + if (stream.pos > stream.start) return style; + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, state, f, forceToEnd) { + function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { var flattenSpans = mode.flattenSpans; if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; var curStart = 0, curStyle = null; var stream = new StringStream(text, cm.options.tabSize), style; - if (text == "" && mode.blankLine) mode.blankLine(state); + if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); while (!stream.eol()) { if (stream.pos > cm.options.maxHighlightLength) { flattenSpans = false; @@ -5463,7 +5631,7 @@ stream.pos = text.length; style = null; } else { - style = mode.token(stream, state); + style = extractLineClasses(readToken(mode, stream, state), lineClasses); } if (cm.options.addModeClass) { var mName = CodeMirror.innerMode(mode, state).mode.name; @@ -5490,11 +5658,11 @@ function highlightLine(cm, line, state, forceToEnd) { // A styles array always starts with a number identifying the // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen]; + var st = [cm.state.modeGen], lineClasses = {}; // Compute the base array of styles runMode(cm, line.text, cm.doc.mode, state, function(end, style) { st.push(end, style); - }, forceToEnd); + }, lineClasses, forceToEnd); // Run overlays, adjust style array. for (var o = 0; o < cm.state.overlays.length; ++o) { @@ -5511,23 +5679,27 @@ } if (!style) return; if (overlay.opaque) { - st.splice(start, i - start, end, style); + st.splice(start, i - start, end, "cm-overlay " + style); i = start + 2; } else { for (; start < i; start += 2) { var cur = st[start+1]; - st[start+1] = cur ? cur + " " + style : style; + st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; } } - }); + }, lineClasses); } - return st; + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; } function getLineStyles(cm, line) { - if (!line.styles || line.styles[0] != cm.state.modeGen) - line.styles = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + line.styles = result.styles; + if (result.classes) line.styleClasses = result.classes; + else if (line.styleClasses) line.styleClasses = null; + } return line.styles; } @@ -5538,9 +5710,9 @@ var mode = cm.doc.mode; var stream = new StringStream(text, cm.options.tabSize); stream.start = stream.pos = startAt || 0; - if (text == "" && mode.blankLine) mode.blankLine(state); + if (text == "") callBlankLine(mode, state); while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { - mode.token(stream, state); + readToken(mode, stream, state); stream.start = stream.pos; } } @@ -5549,20 +5721,9 @@ // containing one or more styles) to a CSS style. This is cached, // and also looks for line-wide styles. var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, builder) { - if (!style) return null; - for (;;) { - var lineClass = style.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) break; - style = style.slice(0, lineClass.index) + style.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (builder[prop] == null) - builder[prop] = lineClass[2]; - else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(builder[prop])) - builder[prop] += " " + lineClass[2]; - } - if (/^\s*$/.test(style)) return null; - var cache = builder.cm.options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) return null; + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); } @@ -5593,6 +5754,12 @@ builder.addToken = buildTokenBadBidi(builder.addToken, order); builder.map = []; insertLineContent(line, builder, getLineStyles(cm, line)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + if (line.styleClasses.textClass) + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } // Ensure at least a single node is present, for measuring. if (builder.map.length == 0) @@ -5718,7 +5885,7 @@ var spans = line.markedSpans, allText = line.text, at = 0; if (!spans) { for (var i = 1; i < styles.length; i+=2) - builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder)); + builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); return; } @@ -5768,7 +5935,7 @@ spanStartStyle = ""; } text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder); + style = interpretTokenStyle(styles[i++], builder.cm.options); } } } @@ -6120,13 +6287,13 @@ } return parts; }, - replaceSelection: docMethodOp(function(code, collapse, origin) { + replaceSelection: function(code, collapse, origin) { var dup = []; for (var i = 0; i < this.sel.ranges.length; i++) dup[i] = code; this.replaceSelections(dup, collapse, origin || "+input"); - }), - replaceSelections: function(code, collapse, origin) { + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { var changes = [], sel = this.sel; for (var i = 0; i < sel.ranges.length; i++) { var range = sel.ranges[i]; @@ -6137,7 +6304,7 @@ makeChange(this, changes[i]); if (newSel) setSelectionReplaceHistory(this, newSel); else if (this.cm) ensureCursorVisible(this.cm); - }, + }), undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), @@ -6197,7 +6364,7 @@ } return markers; }, - findMarks: function(from, to) { + findMarks: function(from, to, filter) { from = clipPos(this, from); to = clipPos(this, to); var found = [], lineNo = from.line; this.iter(from.line, to.line + 1, function(line) { @@ -6206,7 +6373,8 @@ var span = spans[i]; if (!(lineNo == from.line && from.ch > span.to || span.from == null && lineNo != from.line|| - lineNo == to.line && span.from > to.ch)) + lineNo == to.line && span.from > to.ch) && + (!filter || filter(span.marker))) found.push(span.marker.parent || span.marker); } ++lineNo; @@ -6264,6 +6432,7 @@ if (options.sharedHist) copy.history = this.history; (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); return copy; }, unlinkDoc: function(other) { @@ -6273,6 +6442,7 @@ if (link.doc != other) continue; this.linked.splice(i, 1); other.unlinkDoc(this); + detachSharedMarkers(findSharedMarkers(this)); break; } // If the histories were shared, split them again @@ -6784,6 +6954,14 @@ return e_defaultPrevented(e) || e.codemirrorIgnore; } + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) return; + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) + set.push(arr[i]); + } + function hasHandler(emitter, type) { var arr = emitter._handlers && emitter._handlers[type]; return arr && arr.length > 0; @@ -6888,9 +7066,11 @@ return inst; }; - function copyObj(obj, target) { + function copyObj(obj, target, overwrite) { if (!target) target = {}; - for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop]; + for (var prop in obj) + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + target[prop] = obj[prop]; return target; } @@ -6900,10 +7080,15 @@ } var nonASCIISingleCaseWordChar = /[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var isWordChar = CodeMirror.isWordChar = function(ch) { + var isWordCharBasic = CodeMirror.isWordChar = function(ch) { return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); }; + function isWordChar(ch, helper) { + if (!helper) return isWordCharBasic(ch); + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; + return helper.test(ch); + } function isEmpty(obj) { for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; @@ -6970,6 +7155,58 @@ catch(e) { return document.body; } }; + function classTest(cls) { return new RegExp("\\b" + cls + "\\b\\s*"); } + function rmClass(node, cls) { + var test = classTest(cls); + if (test.test(node.className)) node.className = node.className.replace(test, ""); + } + function addClass(node, cls) { + if (!classTest(cls).test(node.className)) node.className += " " + cls; + } + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; + return b; + } + + // WINDOW-WIDE EVENTS + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.body.getElementsByClassName) return; + var byClass = document.body.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) f(cm); + } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) return; + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function() { + if (resizeTimer == null) resizeTimer = setTimeout(function() { + resizeTimer = null; + knownScrollbarWidth = null; + forEachCodeMirror(onResize); + }, 100); + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function() { + forEachCodeMirror(onBlur); + }); + } + // FEATURE DETECTION // Detect drag-and-drop @@ -7352,7 +7589,7 @@ // THE END - CodeMirror.version = "4.0.4"; + CodeMirror.version = "4.1.1"; return CodeMirror; }); diff --git a/deploy/core/node_modules/codemirror/comment.js b/deploy/core/node_modules/codemirror/comment.js index 7355276f0..f56721206 100644 --- a/deploy/core/node_modules/codemirror/comment.js +++ b/deploy/core/node_modules/codemirror/comment.js @@ -1,4 +1,14 @@ -(function() { +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { "use strict"; var noOptions = {}; @@ -11,13 +21,26 @@ } CodeMirror.commands.toggleComment = function(cm) { - var from = cm.getCursor("start"), to = cm.getCursor("end"); - cm.uncomment(from, to) || cm.lineComment(from, to); + var minLine = Infinity, ranges = cm.listSelections(), mode = null; + for (var i = ranges.length - 1; i >= 0; i--) { + var from = ranges[i].from(), to = ranges[i].to(); + if (from.line >= minLine) continue; + if (to.line >= minLine) to = Pos(minLine, 0); + minLine = from.line; + if (mode == null) { + if (cm.uncomment(from, to)) mode = "un"; + else { cm.lineComment(from, to); mode = "line"; } + } else if (mode == "un") { + cm.uncomment(from, to); + } else { + cm.lineComment(from, to); + } + } }; CodeMirror.defineExtension("lineComment", function(from, to, options) { if (!options) options = noOptions; - var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode; + var self = this, mode = self.getModeAt(from); var commentString = options.lineComment || mode.lineComment; if (!commentString) { if (options.blockCommentStart || mode.blockCommentStart) { @@ -30,8 +53,7 @@ if (firstLine == null) return; var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); var pad = options.padding == null ? " " : options.padding; - var blankLines = options.commentBlankLines; - + var blankLines = options.commentBlankLines || from.line == to.line; self.operation(function() { if (options.indent) { @@ -53,7 +75,7 @@ CodeMirror.defineExtension("blockComment", function(from, to, options) { if (!options) options = noOptions; - var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode; + var self = this, mode = self.getModeAt(from); var startString = options.blockCommentStart || mode.blockCommentStart; var endString = options.blockCommentEnd || mode.blockCommentEnd; if (!startString || !endString) { @@ -86,19 +108,20 @@ CodeMirror.defineExtension("uncomment", function(from, to, options) { if (!options) options = noOptions; - var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode; + var self = this, mode = self.getModeAt(from); var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end); // Try finding line comments var lineString = options.lineComment || mode.lineComment, lines = []; - var pad = options.padding == null ? " " : options.padding; - lineComment: for(;;) { - if (!lineString) break; + var pad = options.padding == null ? " " : options.padding, didSomething; + lineComment: { + if (!lineString) break lineComment; for (var i = start; i <= end; ++i) { var line = self.getLine(i); var found = line.indexOf(lineString); + if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment; - if (i != start && nonWS.test(line.slice(0, found))) break lineComment; + if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; lines.push(line); } self.operation(function() { @@ -107,10 +130,11 @@ var pos = line.indexOf(lineString), endPos = pos + lineString.length; if (pos < 0) continue; if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length; + didSomething = true; self.replaceRange("", Pos(i, pos), Pos(i, endPos)); } }); - return true; + if (didSomething) return true; } // Try block comments @@ -124,7 +148,10 @@ endLine = self.getLine(--end); close = endLine.lastIndexOf(endString); } - if (open == -1 || close == -1) return false; + if (open == -1 || close == -1 || + !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) || + !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1)))) + return false; self.operation(function() { self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)), @@ -142,4 +169,4 @@ }); return true; }); -})(); \ No newline at end of file +}); diff --git a/deploy/core/node_modules/codemirror/matchbracket.js b/deploy/core/node_modules/codemirror/matchbracket.js index 131fe831f..c1221ca4c 100644 --- a/deploy/core/node_modules/codemirror/matchbracket.js +++ b/deploy/core/node_modules/codemirror/matchbracket.js @@ -1,72 +1,103 @@ -(function() { +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && (document.documentMode == null || document.documentMode < 8); var Pos = CodeMirror.Pos; var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - function findMatchingBracket(cm, where, strict) { - var state = cm.state.matchBrackets; - var maxScanLen = (state && state.maxScanLineLength) || 10000; - var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1; + function findMatchingBracket(cm, where, strict, config) { + var line = cm.getLineHandle(where.line), pos = where.ch - 1; var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; if (!match) return null; - var forward = match.charAt(1) == ">", d = forward ? 1 : -1; - if (strict && forward != (pos == cur.ch)) return null; - var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1)); + var dir = match.charAt(1) == ">" ? 1 : -1; + if (strict && (dir > 0) != (pos == where.ch)) return null; + var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); + + var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); + if (found == null) return null; + return {from: Pos(where.line, pos), to: found && found.pos, + match: found && found.ch == match.charAt(0), forward: dir > 0}; + } - var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; - function scan(line, lineNo, start) { - if (!line.text) return; - var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1; - if (line.text.length > maxScanLen) return null; - if (start != null) pos = start + d; - for (; pos != end; pos += d) { - var ch = line.text.charAt(pos); - if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) { + // bracketRegex is used to specify which type of bracket to scan + // should be a regexp, e.g. /[[\]]/ + // + // Note: If "where" is on an open bracket, then this bracket is ignored. + // + // Returns false when no bracket was found, null when it reached + // maxScanLines and gave up + function scanForBracket(cm, where, dir, style, config) { + var maxScanLen = (config && config.maxScanLineLength) || 10000; + var maxScanLines = (config && config.maxScanLines) || 1000; + + var stack = []; + var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; + var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) + : Math.max(cm.firstLine() - 1, where.line - maxScanLines); + for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { + var line = cm.getLine(lineNo); + if (!line) continue; + var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1; + if (line.length > maxScanLen) continue; + if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); + for (; pos != end; pos += dir) { + var ch = line.charAt(pos); + if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { var match = matching[ch]; - if (match.charAt(1) == ">" == forward) stack.push(ch); - else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; - else if (!stack.length) return {pos: pos, match: true}; + if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); + else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; + else stack.pop(); } } } - for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) { - if (i == cur.line) found = scan(line, i, pos); - else found = scan(cm.getLineHandle(i), i); - if (found) break; - } - return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos), - match: found && found.match, forward: forward}; + return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; } - function matchBrackets(cm, autoclear) { + function matchBrackets(cm, autoclear, config) { // Disable brace matching in long lines, since it'll cause hugely slow updates var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; - var found = findMatchingBracket(cm); - if (!found || cm.getLine(found.from.line).length > maxHighlightLen || - found.to && cm.getLine(found.to.line).length > maxHighlightLen) - return; + var marks = [], ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config); + if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { + var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); + if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) + marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style})); + } + } + + if (marks.length) { + // Kludge to work around the IE bug from issue #1193, where text + // input stops going to the textare whever this fires. + if (ie_lt8 && cm.state.focused) cm.display.input.focus(); - var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style}); - var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style}); - // Kludge to work around the IE bug from issue #1193, where text - // input stops going to the textare whever this fires. - if (ie_lt8 && cm.state.focused) cm.display.input.focus(); - var clear = function() { - cm.operation(function() { one.clear(); two && two.clear(); }); - }; - if (autoclear) setTimeout(clear, 800); - else return clear; + var clear = function() { + cm.operation(function() { + for (var i = 0; i < marks.length; i++) marks[i].clear(); + }); + }; + if (autoclear) setTimeout(clear, 800); + else return clear; + } } var currentlyHighlighted = null; function doMatchBrackets(cm) { cm.operation(function() { if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} - if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false); + currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); }); } @@ -80,7 +111,10 @@ }); CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); - CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){ - return findMatchingBracket(this, pos, strict); + CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){ + return findMatchingBracket(this, pos, strict, config); + }); + CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ + return scanForBracket(this, pos, dir, style, config); }); -})(); +}); diff --git a/deploy/core/node_modules/codemirror/overlay.js b/deploy/core/node_modules/codemirror/overlay.js index 74f553936..82f754c46 100644 --- a/deploy/core/node_modules/codemirror/overlay.js +++ b/deploy/core/node_modules/codemirror/overlay.js @@ -1,20 +1,34 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Utility function that allows modes to be combined. The mode given // as the base argument takes care of most of the normal mode // functionality, but a second (typically simple) mode is used, which // can override the style of text. Both modes get to parse all of the // text, but when both assign a non-null style to a piece of code, the -// overlay wins, unless the combine argument was true, in which case -// the styles are combined. +// overlay wins, unless the combine argument was true and not overridden, +// or state.overlay.combineTokens was true, in which case the styles are +// combined. + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; -// overlayParser is the old, deprecated name -CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) { +CodeMirror.overlayMode = function(base, overlay, combine) { return { startState: function() { return { base: CodeMirror.startState(base), overlay: CodeMirror.startState(overlay), basePos: 0, baseCur: null, - overlayPos: 0, overlayCur: null + overlayPos: 0, overlayCur: null, + lineSeen: null }; }, copyState: function(state) { @@ -27,20 +41,30 @@ CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, comb }, token: function(stream, state) { + if (stream.sol() || stream.string != state.lineSeen || + Math.min(state.basePos, state.overlayPos) < stream.start) { + state.lineSeen = stream.string; + state.basePos = state.overlayPos = stream.start; + } + if (stream.start == state.basePos) { state.baseCur = base.token(stream, state.base); state.basePos = stream.pos; } if (stream.start == state.overlayPos) { stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay, {pos: state.basePos, style: state.baseCur}); + state.overlayCur = overlay.token(stream, state.overlay); state.overlayPos = stream.pos; } stream.pos = Math.min(state.basePos, state.overlayPos); - if (stream.eol()) state.basePos = state.overlayPos = 0; + // state.overlay.combineTokens always takes precedence over combine, + // unless set to null if (state.overlayCur == null) return state.baseCur; - if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; + else if (state.baseCur != null && + state.overlay.combineTokens || + combine && state.overlay.combineTokens == null) + return state.baseCur + " " + state.overlayCur; else return state.overlayCur; }, @@ -57,3 +81,5 @@ CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, comb } }; }; + +}); diff --git a/deploy/core/node_modules/codemirror/scrollpastend.js b/deploy/core/node_modules/codemirror/scrollpastend.js index 20472a4e6..e9f4ecb68 100644 --- a/deploy/core/node_modules/codemirror/scrollpastend.js +++ b/deploy/core/node_modules/codemirror/scrollpastend.js @@ -1,15 +1,26 @@ -(function() { +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { "use strict"; CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { if (old && old != CodeMirror.Init) { cm.off("change", onChange); + cm.off("refresh", updateBottomMargin); cm.display.lineSpace.parentNode.style.paddingBottom = ""; cm.state.scrollPastEndPadding = null; - cm.state.scrollPastEndLastLine = null; } if (val) { cm.on("change", onChange); + cm.on("refresh", updateBottomMargin); updateBottomMargin(cm); } }); @@ -32,4 +43,4 @@ cm.setSize(); } } -})(); +}); From 12aa9ee7cf9a91c1b4090438604a024b970daaca Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 17 May 2014 19:10:24 -0700 Subject: [PATCH 142/656] add my overlay changes back to the cm4 thing, fixes rainbow parens Signed-off-by: Chris Granger --- deploy/core/node_modules/codemirror/overlay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/node_modules/codemirror/overlay.js b/deploy/core/node_modules/codemirror/overlay.js index 82f754c46..8fbd86972 100644 --- a/deploy/core/node_modules/codemirror/overlay.js +++ b/deploy/core/node_modules/codemirror/overlay.js @@ -53,7 +53,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) { } if (stream.start == state.overlayPos) { stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay); + state.overlayCur = overlay.token(stream, state.overlay, {pos: state.basePos, style: state.baseCur}); state.overlayPos = stream.pos; } stream.pos = Math.min(state.basePos, state.overlayPos); From c6e90526614713d5fc68f77d11be369f0f5daaea Mon Sep 17 00:00:00 2001 From: Irakli Gozalishvili Date: Mon, 19 May 2014 14:48:56 -0700 Subject: [PATCH 143/656] Revert "Update solarized.css" This reverts commit 1dac7a81431058919e57e9748835e54953275a70. --- deploy/core/css/themes/solarized.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/css/themes/solarized.css b/deploy/core/css/themes/solarized.css index fda817fff..802e5657c 100644 --- a/deploy/core/css/themes/solarized.css +++ b/deploy/core/css/themes/solarized.css @@ -55,7 +55,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png .cm-s-solarized .cm-property { color: #2aa198; } .cm-s-solarized .cm-operator {color: #6c71c4;} -.cm-s-solarized .cm-comment { color: #00FF99; font-style:italic; } +.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } .cm-s-solarized .cm-string { color: #859900; } .cm-s-solarized .cm-string-2 { color: #b58900; } From af99a1887aab9cc728c1bafb013875430e4bec3a Mon Sep 17 00:00:00 2001 From: Irakli Gozalishvili Date: Mon, 19 May 2014 14:56:58 -0700 Subject: [PATCH 144/656] Make selection background color Base02. --- deploy/core/css/themes/solarized.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/core/css/themes/solarized.css b/deploy/core/css/themes/solarized.css index 802e5657c..19caed627 100644 --- a/deploy/core/css/themes/solarized.css +++ b/deploy/core/css/themes/solarized.css @@ -90,17 +90,17 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png .cm-s-solarized .cm-strong { color: #eee; } .cm-s-solarized .CodeMirror-focused .CodeMirror-selected { - background: #386774; + background: #073642; color: inherit; } .cm-s-solarized ::selection { - background: #386774; + background: #073642; color: inherit; } .cm-s-solarized .CodeMirror-selected { - background: #586e75; + background: #073642; } /* Editor styling */ @@ -154,7 +154,7 @@ view-port */ .cm-s-solarized .CodeMirror-activeline, .cm-s-solarized .activeline { - background: rgba(255, 255, 255, 0.05); + background: rgba(255, 255, 255, 0.02); } /* View-port and gutter both get little noise background to give it a real feel. From e9e961967665bbbeb79b59881c0c68780338e26f Mon Sep 17 00:00:00 2001 From: ndr Date: Tue, 20 May 2014 06:12:56 +0200 Subject: [PATCH 145/656] Update editor/set-line to CodeMirror 4 API `lt.objs.editor/set-line` used the CodeMirror method `.setLine`, which is deprecated as of v4. The updated `set-line` uses `.replaceRange` instead, as suggested in the CodeMirror v4 upgrade guide. http://codemirror.net/doc/upgrade_v4.html#upgrade. --- src/lt/objs/editor.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index c97f4718d..fad2b48b4 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -290,7 +290,11 @@ (.getLine (->cm-ed e) l)) (defn set-line [e l text] - (.setLine (->cm-ed e) l text)) + (let [length (line-length e l)] + (replace e + {:line l :ch 0} + {:line l :ch length} + text))) (defn first-line [e] (.firstLine (->cm-ed e))) From 00f8f1f7dc379e77212ffd917b11ce73bcb30a6f Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 21 May 2014 12:25:44 -0700 Subject: [PATCH 146/656] update to latest modes, add in multiple cursors commands Signed-off-by: Chris Granger --- deploy/core/css/codemirror.css | 76 ++- .../node_modules/codemirror/codemirror.js | 12 +- .../core/node_modules/codemirror/modes/css.js | 639 ------------------ .../codemirror/modes/htmlembedded.js | 73 ++ .../codemirror/modes/htmlmixed.js | 104 +++ .../core/node_modules/codemirror/sublime.js | 520 ++++++++++++++ src/lt/objs/editor.cljs | 1 + src/lt/objs/editor/pool.cljs | 95 ++- 8 files changed, 855 insertions(+), 665 deletions(-) delete mode 100644 deploy/core/node_modules/codemirror/modes/css.js create mode 100644 deploy/core/node_modules/codemirror/modes/htmlembedded.js create mode 100644 deploy/core/node_modules/codemirror/modes/htmlmixed.js create mode 100644 deploy/core/node_modules/codemirror/sublime.js diff --git a/deploy/core/css/codemirror.css b/deploy/core/css/codemirror.css index 2350b28d3..098a317a2 100644 --- a/deploy/core/css/codemirror.css +++ b/deploy/core/css/codemirror.css @@ -2,13 +2,9 @@ .CodeMirror { /* Set height, width, borders, and global font properties here */ - height:auto; + font-family: monospace; + height: 300px; } - -.CodeMirror * { - box-sizing:content-box !important; -} - .CodeMirror-scroll { /* Set scrolling behaviour here */ overflow: auto; @@ -40,6 +36,8 @@ min-width: 20px; text-align: right; color: #999; + -moz-box-sizing: content-box; + box-sizing: content-box; } /* CURSOR */ @@ -61,6 +59,52 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} .cm-tab { display: inline-block; } +.CodeMirror-ruler { + border-left: 1px solid #ccc; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + /* The rest of this file contains styles related to the mechanics of the editor. You probably shouldn't touch them. */ @@ -76,7 +120,7 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} /* 30px is the magic margin used to hide the element's real scrollbars */ /* See overflow: hidden in .CodeMirror */ margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; padding-right: 30px; + padding-bottom: 30px; height: 100%; outline: none; /* Prevent dragging from highlighting the element */ position: relative; @@ -85,6 +129,9 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} } .CodeMirror-sizer { position: relative; + border-right: 30px solid transparent; + -moz-box-sizing: content-box; + box-sizing: content-box; } /* The fake, visible scrollbars. Used to force redraw during scrolling @@ -159,16 +206,7 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} white-space: pre-wrap; word-break: normal; } -.CodeMirror-code pre { - border-right: 30px solid transparent; - width: -webkit-fit-content; - width: -moz-fit-content; - width: fit-content; -} -.CodeMirror-wrap .CodeMirror-code pre { - border-right: none; - width: auto; -} + .CodeMirror-linebackground { position: absolute; left: 0; right: 0; top: 0; bottom: 0; @@ -204,7 +242,8 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} div.CodeMirror-cursors { visibility: hidden; - z-index: 3; + position: relative; + z-index: 1; } .CodeMirror-focused div.CodeMirror-cursors { visibility: visible; @@ -212,6 +251,7 @@ div.CodeMirror-cursors { .CodeMirror-selected { background: #d9d9d9; } .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } .cm-searching { background: #ffa; diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/codemirror.js index 371c37651..95cc6b966 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/codemirror.js @@ -1,4 +1,4 @@ -// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE // This is CodeMirror (http://codemirror.net), a code editor @@ -1149,7 +1149,8 @@ if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) sel = filterSelectionChange(doc, sel); - var bias = cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1; + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); if (!(options && options.scroll === false) && doc.cm) @@ -3175,6 +3176,9 @@ var extval = display.input.value = "\u200b" + (selected ? display.input.value : ""); display.prevInput = selected ? "" : "\u200b"; display.input.selectionStart = 1; display.input.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; } } function rehide() { @@ -5776,6 +5780,8 @@ } signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); return builder; } @@ -7589,7 +7595,7 @@ // THE END - CodeMirror.version = "4.1.1"; + CodeMirror.version = "4.2.1"; return CodeMirror; }); diff --git a/deploy/core/node_modules/codemirror/modes/css.js b/deploy/core/node_modules/codemirror/modes/css.js deleted file mode 100644 index f47aba75a..000000000 --- a/deploy/core/node_modules/codemirror/modes/css.js +++ /dev/null @@ -1,639 +0,0 @@ -CodeMirror.defineMode("css", function(config, parserConfig) { - "use strict"; - - if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); - - var indentUnit = config.indentUnit || config.tabSize || 2, - hooks = parserConfig.hooks || {}, - atMediaTypes = parserConfig.atMediaTypes || {}, - atMediaFeatures = parserConfig.atMediaFeatures || {}, - propertyKeywords = parserConfig.propertyKeywords || {}, - colorKeywords = parserConfig.colorKeywords || {}, - valueKeywords = parserConfig.valueKeywords || {}, - allowNested = !!parserConfig.allowNested, - type = null; - - function ret(style, tp) { type = tp; return style; } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - // result[0] is style and result[1] is type - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());} - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (ch === "-") { - if (/\d/.test(stream.peek())) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (stream.match(/^[^-]+-/)) { - return ret("meta", "meta"); - } - } - else if (/[,+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { - return ret("qualifier", "qualifier"); - } - else if (ch == ":") { - return ret("operator", ch); - } - else if (/[;{}\[\]\(\)]/.test(ch)) { - return ret(null, ch); - } - else if (ch == "u" && stream.match("rl(")) { - stream.backUp(1); - state.tokenize = tokenParenthesized; - return ret("property", "variable"); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("property", "variable"); - } - } - - function tokenString(quote, nonInclusive) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) { - if (nonInclusive) stream.backUp(1); - state.tokenize = tokenBase; - } - return ret("string", "string"); - }; - } - - function tokenParenthesized(stream, state) { - stream.next(); // Must be '(' - if (!stream.match(/\s*[\"\']/, false)) - state.tokenize = tokenString(")", true); - else - state.tokenize = tokenBase; - return ret(null, "("); - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: [], - lastToken: null}; - }, - - token: function(stream, state) { - - // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50) - // - // rule** or **ruleset: - // A selector + braces combo, or an at-rule. - // - // declaration block: - // A sequence of declarations. - // - // declaration: - // A property + colon + value combo. - // - // property value: - // The entire value of a property. - // - // component value: - // A single piece of a property value. Like the 5px in - // text-shadow: 0 0 5px blue;. Can also refer to things that are - // multiple terms, like the 1-4 terms that make up the background-size - // portion of the background shorthand. - // - // term: - // The basic unit of author-facing CSS, like a single number (5), - // dimension (5px), string ("foo"), or function. Officially defined - // by the CSS 2.1 grammar (look for the 'term' production) - // - // - // simple selector: - // A single atomic selector, like a type selector, an attr selector, a - // class selector, etc. - // - // compound selector: - // One or more simple selectors without a combinator. div.example is - // compound, div > .example is not. - // - // complex selector: - // One or more compound selectors chained with combinators. - // - // combinator: - // The parts of selectors that express relationships. There are four - // currently - the space (descendant combinator), the greater-than - // bracket (child combinator), the plus sign (next sibling combinator), - // and the tilda (following sibling combinator). - // - // sequence of selectors: - // One or more of the named type of selector chained with commas. - - state.tokenize = state.tokenize || tokenBase; - if (state.tokenize == tokenBase && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style && typeof style != "string") style = ret(style[0], style[1]); - - // Changing style returned based on context - var context = state.stack[state.stack.length-1]; - if (style == "variable") { - if (type == "variable-definition") state.stack.push("propertyValue"); - return state.lastToken = "variable-2"; - } else if (style == "property") { - var word = stream.current().toLowerCase(); - if (context == "propertyValue") { - if (valueKeywords.hasOwnProperty(word)) { - style = "string-2"; - } else if (colorKeywords.hasOwnProperty(word)) { - style = "keyword"; - } else { - style = "variable-2"; - } - } else if (context == "rule") { - if (!propertyKeywords.hasOwnProperty(word)) { - style += " error"; - } - } else if (context == "block") { - // if a value is present in both property, value, or color, the order - // of preference is property -> color -> value - if (propertyKeywords.hasOwnProperty(word)) { - style = "property"; - } else if (colorKeywords.hasOwnProperty(word)) { - style = "keyword"; - } else if (valueKeywords.hasOwnProperty(word)) { - style = "string-2"; - } else { - style = "tag"; - } - } else if (!context || context == "@media{") { - style = "tag"; - } else if (context == "@media") { - if (atMediaTypes[stream.current()]) { - style = "attribute"; // Known attribute - } else if (/^(only|not)$/.test(word)) { - style = "keyword"; - } else if (word == "and") { - style = "error"; // "and" is only allowed in @mediaType - } else if (atMediaFeatures.hasOwnProperty(word)) { - style = "error"; // Known property, should be in @mediaType( - } else { - // Unknown, expecting keyword or attribute, assuming attribute - style = "attribute error"; - } - } else if (context == "@mediaType") { - if (atMediaTypes.hasOwnProperty(word)) { - style = "attribute"; - } else if (word == "and") { - style = "operator"; - } else if (/^(only|not)$/.test(word)) { - style = "error"; // Only allowed in @media - } else { - // Unknown attribute or property, but expecting property (preceded - // by "and"). Should be in parentheses - style = "error"; - } - } else if (context == "@mediaType(") { - if (propertyKeywords.hasOwnProperty(word)) { - // do nothing, remains "property" - } else if (atMediaTypes.hasOwnProperty(word)) { - style = "error"; // Known property, should be in parentheses - } else if (word == "and") { - style = "operator"; - } else if (/^(only|not)$/.test(word)) { - style = "error"; // Only allowed in @media - } else { - style += " error"; - } - } else if (context == "@import") { - style = "tag"; - } else { - style = "error"; - } - } else if (style == "atom") { - if(!context || context == "@media{" || context == "block") { - style = "builtin"; - } else if (context == "propertyValue") { - if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { - style += " error"; - } - } else { - style = "error"; - } - } else if (context == "@media" && type == "{") { - style = "error"; - } - - // Push/pop context stack - if (type == "{") { - if (context == "@media" || context == "@mediaType") { - state.stack[state.stack.length-1] = "@media{"; - } - else { - var newContext = allowNested ? "block" : "rule"; - state.stack.push(newContext); - } - } - else if (type == "}") { - if (context == "interpolation") style = "operator"; - // Pop off end of array until { is reached - while(state.stack.length){ - var removed = state.stack.pop(); - if(removed.indexOf("{") > -1){ - break; - } - } - } - else if (type == "interpolation") state.stack.push("interpolation"); - else if (type == "@media") state.stack.push("@media"); - else if (type == "@import") state.stack.push("@import"); - else if (context == "@media" && /\b(keyword|attribute)\b/.test(style)) - state.stack[state.stack.length-1] = "@mediaType"; - else if (context == "@mediaType" && stream.current() == ",") - state.stack[state.stack.length-1] = "@media"; - else if (type == "(") { - if (context == "@media" || context == "@mediaType") { - // Make sure @mediaType is used to avoid error on { - state.stack[state.stack.length-1] = "@mediaType"; - state.stack.push("@mediaType("); - } - else state.stack.push("("); - } - else if (type == ")") { - // Pop off end of array until ( is reached - while(state.stack.length){ - var removed = state.stack.pop(); - if(removed.indexOf("(") > -1){ - break; - } - } - } - else if (type == ":" && state.lastToken == "property") state.stack.push("propertyValue"); - else if (context == "propertyValue" && type == ";") state.stack.pop(); - else if (context == "@import" && type == ";") state.stack.pop(); - - return state.lastToken = style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[n-1] == "propertyValue" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - fold: "brace" - }; -}); - -(function() { - function keySet(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) { - keys[array[i]] = true; - } - return keys; - } - - var atMediaTypes = keySet([ - "all", "aural", "braille", "handheld", "print", "projection", "screen", - "tty", "tv", "embossed" - ]); - - var atMediaFeatures = keySet([ - "width", "min-width", "max-width", "height", "min-height", "max-height", - "device-width", "min-device-width", "max-device-width", "device-height", - "min-device-height", "max-device-height", "aspect-ratio", - "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", - "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", - "max-color", "color-index", "min-color-index", "max-color-index", - "monochrome", "min-monochrome", "max-monochrome", "resolution", - "min-resolution", "max-resolution", "scan", "grid" - ]); - - var propertyKeywords = keySet([ - "align-content", "align-items", "align-self", "alignment-adjust", - "alignment-baseline", "anchor-point", "animation", "animation-delay", - "animation-direction", "animation-duration", "animation-iteration-count", - "animation-name", "animation-play-state", "animation-timing-function", - "appearance", "azimuth", "backface-visibility", "background", - "background-attachment", "background-clip", "background-color", - "background-image", "background-origin", "background-position", - "background-repeat", "background-size", "baseline-shift", "binding", - "bleed", "bookmark-label", "bookmark-level", "bookmark-state", - "bookmark-target", "border", "border-bottom", "border-bottom-color", - "border-bottom-left-radius", "border-bottom-right-radius", - "border-bottom-style", "border-bottom-width", "border-collapse", - "border-color", "border-image", "border-image-outset", - "border-image-repeat", "border-image-slice", "border-image-source", - "border-image-width", "border-left", "border-left-color", - "border-left-style", "border-left-width", "border-radius", "border-right", - "border-right-color", "border-right-style", "border-right-width", - "border-spacing", "border-style", "border-top", "border-top-color", - "border-top-left-radius", "border-top-right-radius", "border-top-style", - "border-top-width", "border-width", "bottom", "box-decoration-break", - "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", - "caption-side", "clear", "clip", "color", "color-profile", "column-count", - "column-fill", "column-gap", "column-rule", "column-rule-color", - "column-rule-style", "column-rule-width", "column-span", "column-width", - "columns", "content", "counter-increment", "counter-reset", "crop", "cue", - "cue-after", "cue-before", "cursor", "direction", "display", - "dominant-baseline", "drop-initial-after-adjust", - "drop-initial-after-align", "drop-initial-before-adjust", - "drop-initial-before-align", "drop-initial-size", "drop-initial-value", - "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", - "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", - "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", - "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", - "font-stretch", "font-style", "font-synthesis", "font-variant", - "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", - "font-variant-ligatures", "font-variant-numeric", "font-variant-position", - "font-weight", "grid-cell", "grid-column", "grid-column-align", - "grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow", - "grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span", - "grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens", - "icon", "image-orientation", "image-rendering", "image-resolution", - "inline-box-align", "justify-content", "left", "letter-spacing", - "line-break", "line-height", "line-stacking", "line-stacking-ruby", - "line-stacking-shift", "line-stacking-strategy", "list-style", - "list-style-image", "list-style-position", "list-style-type", "margin", - "margin-bottom", "margin-left", "margin-right", "margin-top", - "marker-offset", "marks", "marquee-direction", "marquee-loop", - "marquee-play-count", "marquee-speed", "marquee-style", "max-height", - "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", - "nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline", - "outline-color", "outline-offset", "outline-style", "outline-width", - "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", - "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", - "page", "page-break-after", "page-break-before", "page-break-inside", - "page-policy", "pause", "pause-after", "pause-before", "perspective", - "perspective-origin", "pitch", "pitch-range", "play-during", "position", - "presentation-level", "punctuation-trim", "quotes", "region-break-after", - "region-break-before", "region-break-inside", "region-fragment", - "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", - "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", - "ruby-position", "ruby-span", "shape-inside", "shape-outside", "size", - "speak", "speak-as", "speak-header", - "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", - "tab-size", "table-layout", "target", "target-name", "target-new", - "target-position", "text-align", "text-align-last", "text-decoration", - "text-decoration-color", "text-decoration-line", "text-decoration-skip", - "text-decoration-style", "text-emphasis", "text-emphasis-color", - "text-emphasis-position", "text-emphasis-style", "text-height", - "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", - "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", - "text-wrap", "top", "transform", "transform-origin", "transform-style", - "transition", "transition-delay", "transition-duration", - "transition-property", "transition-timing-function", "unicode-bidi", - "vertical-align", "visibility", "voice-balance", "voice-duration", - "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", - "voice-volume", "volume", "white-space", "widows", "width", "word-break", - "word-spacing", "word-wrap", "z-index", "zoom", - // SVG-specific - "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", - "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", - "color-interpolation", "color-interpolation-filters", "color-profile", - "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", - "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", - "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", - "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", - "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", - "glyph-orientation-vertical", "kerning", "text-anchor", "writing-mode" - ]); - - var colorKeywords = keySet([ - "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", - "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", - "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", - "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", - "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", - "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", - "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", - "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", - "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", - "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", - "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", - "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", - "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", - "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", - "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", - "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", - "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", - "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", - "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", - "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", - "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", - "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", - "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", - "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", - "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", - "whitesmoke", "yellow", "yellowgreen" - ]); - - var valueKeywords = keySet([ - "above", "absolute", "activeborder", "activecaption", "afar", - "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", - "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", - "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page", - "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", - "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", - "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel", - "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", - "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", - "cell", "center", "checkbox", "circle", "cjk-earthly-branch", - "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", - "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", - "content-box", "context-menu", "continuous", "copy", "cover", "crop", - "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", - "decimal-leading-zero", "default", "default-button", "destination-atop", - "destination-in", "destination-out", "destination-over", "devanagari", - "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", - "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", - "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", - "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", - "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", - "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", - "ethiopic-halehame-gez", "ethiopic-halehame-om-et", - "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", - "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", - "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", - "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", - "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", - "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", - "help", "hidden", "hide", "higher", "highlight", "highlighttext", - "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", - "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", - "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", - "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", - "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", - "landscape", "lao", "large", "larger", "left", "level", "lighter", - "line-through", "linear", "lines", "list-item", "listbox", "listitem", - "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", - "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", - "lower-roman", "lowercase", "ltr", "malayalam", "match", - "media-controls-background", "media-current-time-display", - "media-fullscreen-button", "media-mute-button", "media-play-button", - "media-return-to-realtime-button", "media-rewind-button", - "media-seek-back-button", "media-seek-forward-button", "media-slider", - "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", - "media-volume-slider-container", "media-volume-sliderthumb", "medium", - "menu", "menulist", "menulist-button", "menulist-text", - "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", - "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", - "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", - "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", - "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", - "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", - "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", - "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer", - "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", - "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", - "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", - "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", - "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", - "searchfield-cancel-button", "searchfield-decoration", - "searchfield-results-button", "searchfield-results-decoration", - "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", - "single", "skip-white-space", "slide", "slider-horizontal", - "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", - "small", "small-caps", "small-caption", "smaller", "solid", "somali", - "source-atop", "source-in", "source-out", "source-over", "space", "square", - "square-button", "start", "static", "status-bar", "stretch", "stroke", - "sub", "subpixel-antialiased", "super", "sw-resize", "table", - "table-caption", "table-cell", "table-column", "table-column-group", - "table-footer-group", "table-header-group", "table-row", "table-row-group", - "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", - "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", - "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", - "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", - "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", - "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", - "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", - "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", - "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", - "window", "windowframe", "windowtext", "x-large", "x-small", "xor", - "xx-large", "xx-small" - ]); - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return ["comment", "comment"]; - } - - CodeMirror.defineMIME("text/css", { - atMediaTypes: atMediaTypes, - atMediaFeatures: atMediaFeatures, - propertyKeywords: propertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - hooks: { - "<": function(stream, state) { - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = null; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ["comment", "comment"]; - } - if (stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - }, - "/": function(stream, state) { - if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - return false; - } - }, - name: "css" - }); - - CodeMirror.defineMIME("text/x-scss", { - atMediaTypes: atMediaTypes, - atMediaFeatures: atMediaFeatures, - propertyKeywords: propertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - allowNested: true, - hooks: { - ":": function(stream) { - if (stream.match(/\s*{/)) { - return [null, "{"]; - } - return false; - }, - "$": function(stream) { - stream.match(/^[\w-]+/); - if (stream.peek() == ":") { - return ["variable", "variable-definition"]; - } - return ["variable", "variable"]; - }, - ",": function(_stream, state) { - if (state.stack[state.stack.length - 1] == "propertyValue") { - return ["operator", ";"]; - } - }, - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - "#": function(stream) { - if (stream.eat("{")) { - return ["operator", "interpolation"]; - } else { - stream.eatWhile(/[\w\\\-]/); - return ["atom", "hash"]; - } - } - }, - name: "css" - }); -})(); diff --git a/deploy/core/node_modules/codemirror/modes/htmlembedded.js b/deploy/core/node_modules/codemirror/modes/htmlembedded.js new file mode 100644 index 000000000..ff6dfd2f9 --- /dev/null +++ b/deploy/core/node_modules/codemirror/modes/htmlembedded.js @@ -0,0 +1,73 @@ +CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { + + //config settings + var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, + scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; + + //inner modes + var scriptingMode, htmlMixedMode; + + //tokenizer when in html mode + function htmlDispatch(stream, state) { + if (stream.match(scriptStartRegex, false)) { + state.token=scriptingDispatch; + return scriptingMode.token(stream, state.scriptState); + } + else + return htmlMixedMode.token(stream, state.htmlState); + } + + //tokenizer when in scripting mode + function scriptingDispatch(stream, state) { + if (stream.match(scriptEndRegex, false)) { + state.token=htmlDispatch; + return htmlMixedMode.token(stream, state.htmlState); + } + else + return scriptingMode.token(stream, state.scriptState); + } + + + return { + startState: function() { + scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); + htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); + return { + token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, + htmlState : CodeMirror.startState(htmlMixedMode), + scriptState : CodeMirror.startState(scriptingMode) + }; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (state.token == htmlDispatch) + return htmlMixedMode.indent(state.htmlState, textAfter); + else if (scriptingMode.indent) + return scriptingMode.indent(state.scriptState, textAfter); + }, + + copyState: function(state) { + return { + token : state.token, + htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), + scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) + }; + }, + + electricChars: "/{}:", + + innerMode: function(state) { + if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; + else return {state: state.htmlState, mode: htmlMixedMode}; + } + }; +}, "htmlmixed"); + +CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); +CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); +CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); +CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); diff --git a/deploy/core/node_modules/codemirror/modes/htmlmixed.js b/deploy/core/node_modules/codemirror/modes/htmlmixed.js new file mode 100644 index 000000000..ec0c21d24 --- /dev/null +++ b/deploy/core/node_modules/codemirror/modes/htmlmixed.js @@ -0,0 +1,104 @@ +CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); + var cssMode = CodeMirror.getMode(config, "css"); + + var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; + scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, + mode: CodeMirror.getMode(config, "javascript")}); + if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { + var conf = scriptTypesConf[i]; + scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); + } + scriptTypes.push({matches: /./, + mode: CodeMirror.getMode(config, "text/plain")}); + + function html(stream, state) { + var tagName = state.htmlState.tagName; + var style = htmlMode.token(stream, state.htmlState); + if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { + // Script block: mode to change to depends on type attribute + var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); + scriptType = scriptType ? scriptType[1] : ""; + if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); + for (var i = 0; i < scriptTypes.length; ++i) { + var tp = scriptTypes[i]; + if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { + if (tp.mode) { + state.token = script; + state.localMode = tp.mode; + state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); + } + break; + } + } + } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { + state.token = css; + state.localMode = cssMode; + state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); + } + return style; + } + function maybeBackup(stream, pat, style) { + var cur = stream.current(); + var close = cur.search(pat), m; + if (close > -1) stream.backUp(cur.length - close); + else if (m = cur.match(/<\/?$/)) { + stream.backUp(cur.length); + if (!stream.match(pat, false)) stream.match(cur[0]); + } + return style; + } + function script(stream, state) { + if (stream.match(/^<\/\s*script\s*>/i, false)) { + state.token = html; + state.localState = state.localMode = null; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*script\s*>/, + state.localMode.token(stream, state.localState)); + } + function css(stream, state) { + if (stream.match(/^<\/\s*style\s*>/i, false)) { + state.token = html; + state.localState = state.localMode = null; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*style\s*>/, + cssMode.token(stream, state.localState)); + } + + return { + startState: function() { + var state = htmlMode.startState(); + return {token: html, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function(state) { + if (state.localState) + var local = CodeMirror.copyState(state.localMode, state.localState); + return {token: state.token, localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter); + else + return CodeMirror.Pass; + }, + + electricChars: "/{}:", + + innerMode: function(state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; +}, "xml", "javascript", "css"); + +CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/deploy/core/node_modules/codemirror/sublime.js b/deploy/core/node_modules/codemirror/sublime.js new file mode 100644 index 000000000..e229f52d3 --- /dev/null +++ b/deploy/core/node_modules/codemirror/sublime.js @@ -0,0 +1,520 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// A rough approximation of Sublime Text's keybindings +// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/edit/matchbrackets")); + else if (typeof define == "function" && define.amd) // AMD + define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/edit/matchbrackets"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var map = CodeMirror.keyMap.sublime = {fallthrough: "default"}; + var cmds = CodeMirror.commands; + var Pos = CodeMirror.Pos; + var ctrl = CodeMirror.keyMap["default"] == CodeMirror.keyMap.pcDefault ? "Ctrl-" : "Cmd-"; + + // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that. + function findPosSubword(doc, start, dir) { + if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1)); + var line = doc.getLine(start.line); + if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0)); + var state = "start", type; + for (var pos = start.ch, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) { + var next = line.charAt(dir < 0 ? pos - 1 : pos); + var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o"; + if (cat == "w" && next.toUpperCase() == next) cat = "W"; + if (state == "start") { + if (cat != "o") { state = "in"; type = cat; } + } else if (state == "in") { + if (type != cat) { + if (type == "w" && cat == "W" && dir < 0) pos--; + if (type == "W" && cat == "w" && dir > 0) { type = "w"; continue; } + break; + } + } + } + return Pos(start.line, pos); + } + + function moveSubword(cm, dir) { + cm.extendSelectionsBy(function(range) { + if (cm.display.shift || cm.doc.extend || range.empty()) + return findPosSubword(cm.doc, range.head, dir); + else + return dir < 0 ? range.from() : range.to(); + }); + } + + cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); }; + cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); }; + + cmds[map[ctrl + "Up"] = "scrollLineUp"] = function(cm) { + var info = cm.getScrollInfo(); + if (!cm.somethingSelected()) { + var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); + if (cm.getCursor().line >= visibleBottomLine) + cm.execCommand("goLineUp"); + } + cm.scrollTo(null, info.top - cm.defaultTextHeight()); + }; + cmds[map[ctrl + "Down"] = "scrollLineDown"] = function(cm) { + var info = cm.getScrollInfo(); + if (!cm.somethingSelected()) { + var visibleTopLine = cm.lineAtHeight(info.top, "local")+1; + if (cm.getCursor().line <= visibleTopLine) + cm.execCommand("goLineDown"); + } + cm.scrollTo(null, info.top + cm.defaultTextHeight()); + }; + + cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) { + var ranges = cm.listSelections(), lineRanges = []; + for (var i = 0; i < ranges.length; i++) { + var from = ranges[i].from(), to = ranges[i].to(); + for (var line = from.line; line <= to.line; ++line) + if (!(to.line > from.line && line == to.line && to.ch == 0)) + lineRanges.push({anchor: line == from.line ? from : Pos(line, 0), + head: line == to.line ? to : Pos(line)}); + } + cm.setSelections(lineRanges, 0); + }; + + map["Shift-Tab"] = "indentLess"; + + cmds[map["Esc"] = "singleSelectionTop"] = function(cm) { + var range = cm.listSelections()[0]; + cm.setSelection(range.anchor, range.head, {scroll: false}); + }; + + cmds[map[ctrl + "L"] = "selectLine"] = function(cm) { + var ranges = cm.listSelections(), extended = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + extended.push({anchor: Pos(range.from().line, 0), + head: Pos(range.to().line + 1, 0)}); + } + cm.setSelections(extended); + }; + + map["Shift-" + ctrl + "K"] = "deleteLine"; + + function insertLine(cm, above) { + cm.operation(function() { + var len = cm.listSelections().length, newSelection = [], last = -1; + for (var i = 0; i < len; i++) { + var head = cm.listSelections()[i].head; + if (head.line <= last) continue; + var at = Pos(head.line + (above ? 0 : 1), 0); + cm.replaceRange("\n", at, null, "+insertLine"); + cm.indentLine(at.line, null, true); + newSelection.push({head: at, anchor: at}); + last = head.line + 1; + } + cm.setSelections(newSelection); + }); + } + + cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { insertLine(cm, false); }; + + cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { insertLine(cm, true); }; + + function wordAt(cm, pos) { + var start = pos.ch, end = start, line = cm.getLine(pos.line); + while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start; + while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end; + return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)}; + } + + cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) { + var from = cm.getCursor("from"), to = cm.getCursor("to"); + var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel; + if (CodeMirror.cmpPos(from, to) == 0) { + var word = wordAt(cm, from); + if (!word.word) return; + cm.setSelection(word.from, word.to); + fullWord = true; + } else { + var text = cm.getRange(from, to); + var query = fullWord ? new RegExp("\\b" + text + "\\b") : text; + var cur = cm.getSearchCursor(query, to); + if (cur.findNext()) { + cm.addSelection(cur.from(), cur.to()); + } else { + cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0)); + if (cur.findNext()) + cm.addSelection(cur.from(), cur.to()); + } + } + if (fullWord) + cm.state.sublimeFindFullWord = cm.doc.sel; + }; + + var mirror = "(){}[]"; + function selectBetweenBrackets(cm) { + var pos = cm.getCursor(), opening = cm.scanForBracket(pos, -1); + if (!opening) return; + for (;;) { + var closing = cm.scanForBracket(pos, 1); + if (!closing) return; + if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) { + cm.setSelection(Pos(opening.pos.line, opening.pos.ch + 1), closing.pos, false); + return true; + } + pos = Pos(closing.pos.line, closing.pos.ch + 1); + } + } + + cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) { + selectBetweenBrackets(cm) || cm.execCommand("selectAll"); + }; + cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) { + if (!selectBetweenBrackets(cm)) return CodeMirror.Pass; + }; + + cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) { + cm.extendSelectionsBy(function(range) { + var next = cm.scanForBracket(range.head, 1); + if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos; + var prev = cm.scanForBracket(range.head, -1); + return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head; + }); + }; + + cmds[map["Shift-" + ctrl + "Up"] = "swapLineUp"] = function(cm) { + var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], from = range.from().line - 1, to = range.to().line; + newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch), + head: Pos(range.head.line - 1, range.head.ch)}); + if (range.to().ch == 0 && !range.empty()) --to; + if (from > at) linesToMove.push(from, to); + else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; + at = to; + } + cm.operation(function() { + for (var i = 0; i < linesToMove.length; i += 2) { + var from = linesToMove[i], to = linesToMove[i + 1]; + var line = cm.getLine(from); + cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); + if (to > cm.lastLine()) + cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine"); + else + cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); + } + cm.setSelections(newSels); + cm.scrollIntoView(); + }); + }; + + cmds[map["Shift-" + ctrl + "Down"] = "swapLineDown"] = function(cm) { + var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1; + for (var i = ranges.length - 1; i >= 0; i--) { + var range = ranges[i], from = range.to().line + 1, to = range.from().line; + if (range.to().ch == 0 && !range.empty()) from--; + if (from < at) linesToMove.push(from, to); + else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; + at = to; + } + cm.operation(function() { + for (var i = linesToMove.length - 2; i >= 0; i -= 2) { + var from = linesToMove[i], to = linesToMove[i + 1]; + var line = cm.getLine(from); + if (from == cm.lastLine()) + cm.replaceRange("", Pos(from - 1), Pos(from), "+swapLine"); + else + cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); + cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); + } + cm.scrollIntoView(); + }); + }; + + map[ctrl + "/"] = "toggleComment"; + + cmds[map[ctrl + "J"] = "joinLines"] = function(cm) { + var ranges = cm.listSelections(), joined = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], from = range.from(); + var start = from.line, end = range.to().line; + while (i < ranges.length - 1 && ranges[i + 1].from().line == end) + end = ranges[++i].to().line; + joined.push({start: start, end: end, anchor: !range.empty() && from}); + } + cm.operation(function() { + var offset = 0, ranges = []; + for (var i = 0; i < joined.length; i++) { + var obj = joined[i]; + var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head; + for (var line = obj.start; line <= obj.end; line++) { + var actual = line - offset; + if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1); + if (actual < cm.lastLine()) { + cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length)); + ++offset; + } + } + ranges.push({anchor: anchor || head, head: head}); + } + cm.setSelections(ranges, 0); + }); + }; + + cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) { + cm.operation(function() { + var rangeCount = cm.listSelections().length; + for (var i = 0; i < rangeCount; i++) { + var range = cm.listSelections()[i]; + if (range.empty()) + cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0)); + else + cm.replaceRange(cm.getRange(range.from(), range.to()), range.from()); + } + cm.scrollIntoView(); + }); + }; + + map[ctrl + "T"] = "transposeChars"; + + function sortLines(cm, caseSensitive) { + var ranges = cm.listSelections(), toSort = [], selected; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.empty()) continue; + var from = range.from().line, to = range.to().line; + while (i < ranges.length - 1 && ranges[i + 1].from().line == to) + to = range[++i].to().line; + toSort.push(from, to); + } + if (toSort.length) selected = true; + else toSort.push(cm.firstLine(), cm.lastLine()); + + cm.operation(function() { + var ranges = []; + for (var i = 0; i < toSort.length; i += 2) { + var from = toSort[i], to = toSort[i + 1]; + var start = Pos(from, 0), end = Pos(to); + var lines = cm.getRange(start, end, false); + if (caseSensitive) + lines.sort(); + else + lines.sort(function(a, b) { + var au = a.toUpperCase(), bu = b.toUpperCase(); + if (au != bu) { a = au; b = bu; } + return a < b ? -1 : a == b ? 0 : 1; + }); + cm.replaceRange(lines, start, end); + if (selected) ranges.push({anchor: start, head: end}); + } + if (selected) cm.setSelections(ranges, 0); + }); + } + + cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); }; + cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); }; + + cmds[map["F2"] = "nextBookmark"] = function(cm) { + var marks = cm.state.sublimeBookmarks; + if (marks) while (marks.length) { + var current = marks.shift(); + var found = current.find(); + if (found) { + marks.push(current); + return cm.setSelection(found.from, found.to); + } + } + }; + + cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) { + var marks = cm.state.sublimeBookmarks; + if (marks) while (marks.length) { + marks.unshift(marks.pop()); + var found = marks[marks.length - 1].find(); + if (!found) + marks.pop(); + else + return cm.setSelection(found.from, found.to); + } + }; + + cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) { + var ranges = cm.listSelections(); + var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []); + for (var i = 0; i < ranges.length; i++) { + var from = ranges[i].from(), to = ranges[i].to(); + var found = cm.findMarks(from, to); + for (var j = 0; j < found.length; j++) { + if (found[j].sublimeBookmark) { + found[j].clear(); + for (var k = 0; k < marks.length; k++) + if (marks[k] == found[j]) + marks.splice(k--, 1); + break; + } + } + if (j == found.length) + marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false})); + } + }; + + cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) { + var marks = cm.state.sublimeBookmarks; + if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear(); + marks.length = 0; + }; + + cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) { + var marks = cm.state.sublimeBookmarks, ranges = []; + if (marks) for (var i = 0; i < marks.length; i++) { + var found = marks[i].find(); + if (!found) + marks.splice(i--, 0); + else + ranges.push({anchor: found.from, head: found.to}); + } + if (ranges.length) + cm.setSelections(ranges, 0); + }; + + map["Alt-Q"] = "wrapLines"; + + var mapK = CodeMirror.keyMap["sublime-Ctrl-K"] = {auto: "sublime", nofallthrough: true}; + + map[ctrl + "K"] = function(cm) {cm.setOption("keyMap", "sublime-Ctrl-K");}; + + function modifyWordOrSelection(cm, mod) { + cm.operation(function() { + var ranges = cm.listSelections(), indices = [], replacements = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.empty()) { indices.push(i); replacements.push(""); } + else replacements.push(mod(cm.getRange(range.from(), range.to()))); + } + cm.replaceSelections(replacements, "around", "case"); + for (var i = indices.length - 1, at; i >= 0; i--) { + var range = ranges[indices[i]]; + if (at && CodeMirror.cmpPos(range.head, at) > 0) continue; + var word = wordAt(cm, range.head); + at = word.from; + cm.replaceRange(mod(word.word), word.from, word.to); + } + }); + } + + mapK[ctrl + "Backspace"] = "delLineLeft"; + + cmds[mapK[ctrl + "K"] = "delLineRight"] = function(cm) { + cm.operation(function() { + var ranges = cm.listSelections(); + for (var i = ranges.length - 1; i >= 0; i--) + cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete"); + cm.scrollIntoView(); + }); + }; + + cmds[mapK[ctrl + "U"] = "upcaseAtCursor"] = function(cm) { + modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); }); + }; + cmds[mapK[ctrl + "L"] = "downcaseAtCursor"] = function(cm) { + modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); }); + }; + + cmds[mapK[ctrl + "Space"] = "setSublimeMark"] = function(cm) { + if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); + cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); + }; + cmds[mapK[ctrl + "A"] = "selectToSublimeMark"] = function(cm) { + var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); + if (found) cm.setSelection(cm.getCursor(), found); + }; + cmds[mapK[ctrl + "W"] = "deleteToSublimeMark"] = function(cm) { + var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); + if (found) { + var from = cm.getCursor(), to = found; + if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; } + cm.state.sublimeKilled = cm.getRange(from, to); + cm.replaceRange("", from, to); + } + }; + cmds[mapK[ctrl + "X"] = "swapWithSublimeMark"] = function(cm) { + var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); + if (found) { + cm.state.sublimeMark.clear(); + cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); + cm.setCursor(found); + } + }; + cmds[mapK[ctrl + "Y"] = "sublimeYank"] = function(cm) { + if (cm.state.sublimeKilled != null) + cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); + }; + + mapK[ctrl + "G"] = "clearBookmarks"; + cmds[mapK[ctrl + "C"] = "showInCenter"] = function(cm) { + var pos = cm.cursorCoords(null, "local"); + cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); + }; + + cmds[map["Shift-Alt-Up"] = "selectLinesUpward"] = function(cm) { + cm.operation(function() { + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.head.line > cm.firstLine()) + cm.addSelection(Pos(range.head.line - 1, range.head.ch)); + } + }); + }; + cmds[map["Shift-Alt-Down"] = "selectLinesDownward"] = function(cm) { + cm.operation(function() { + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.head.line < cm.lastLine()) + cm.addSelection(Pos(range.head.line + 1, range.head.ch)); + } + }); + }; + + function findAndGoTo(cm, forward) { + var from = cm.getCursor("from"), to = cm.getCursor("to"); + if (CodeMirror.cmpPos(from, to) == 0) { + var word = wordAt(cm, from); + if (!word.word) return; + from = word.from; + to = word.to; + } + + var query = cm.getRange(from, to); + var cur = cm.getSearchCursor(query, forward ? to : from); + + if (forward ? cur.findNext() : cur.findPrevious()) { + cm.setSelection(cur.from(), cur.to()); + } else { + cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0) + : cm.clipPos(Pos(cm.lastLine()))); + if (forward ? cur.findNext() : cur.findPrevious()) + cm.setSelection(cur.from(), cur.to()); + else if (word) + cm.setSelection(from, to); + } + }; + cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); }; + cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); }; + + map["Shift-" + ctrl + "["] = "fold"; + map["Shift-" + ctrl + "]"] = "unfold"; + mapK[ctrl + "0"] = mapK[ctrl + "j"] = "unfoldAll"; + + map[ctrl + "I"] = "findIncremental"; + map["Shift-" + ctrl + "I"] = "findIncrementalReverse"; + map[ctrl + "H"] = "replace"; + map["F3"] = "findNext"; + map["Shift-F3"] = "findPrev"; + +}); \ No newline at end of file diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 2d75371a7..f6258fad6 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -664,6 +664,7 @@ (load/js "core/node_modules/codemirror/overlay.js" :sync) (load/js "core/node_modules/codemirror/scrollpastend.js" :sync) (load/js "core/node_modules/codemirror/fold.js" :sync) + (load/js "core/node_modules/codemirror/sublime.js" :sync) (doseq [mode (files/ls "core/node_modules/codemirror/modes") :when (= (files/ext mode) "js")] (load/js (str "core/node_modules/codemirror/modes/" mode) :sync)) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index ec66459c3..e025436b9 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -573,11 +573,8 @@ (cmd/command {:command :editor.select-line :desc "Editor: Select line" :exec (fn [] - (when-let [ed (last-active)] - (let [line (-> (editor/->cursor ed) :line) - len (editor/line-length ed line)] - (editor/set-selection ed {:line line :ch 0} {:line line :ch len}) - (editor/set-extending ed false))))}) + (cmd/exec! :editor.codemirror.command "selectLine") + )}) (cmd/command {:command :editor.force.wrap :desc "Editor: Toggle line wrapping in current editor" @@ -617,3 +614,91 @@ (when-let [ed (last-active)] (editor/fold-code ed)))}) +;;;sublime commands + +(cmd/command {:command :editor.sublime.singleSelectionTop + :desc "Editor: Set selection to top most cursor" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "singleSelectionTop"))}) + +(cmd/command {:command :editor.sublime.singleSelectionTop + :desc "Editor: Clear multiple cursors" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "singleSelectionTop"))}) + +(cmd/command {:command :editor.sublime.insertLineAfter + :desc "Editor: Insert line after" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "insertLineAfter"))}) + +(cmd/command {:command :editor.sublime.insertLineBefore + :desc "Editor: Insert line before" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "insertLineBefore"))}) + +(cmd/command {:command :editor.sublime.selectNextOccurrence + :desc "Editor: Select next occurence of word" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "selectNextOccurrence"))}) + +(cmd/command {:command :editor.sublime.selectBetweenBrackets + :desc "Editor: Select between brackets" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "selectBetweenBrackets"))}) + +(cmd/command {:command :editor.sublime.selectScope + :desc "Editor: Select scope" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "selectScope"))}) + +(cmd/command {:command :editor.sublime.goToBracket + :desc "Editor: Go to bracket" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "goToBracket"))}) + +(cmd/command {:command :editor.sublime.swapLineUp + :desc "Editor: swap line up" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "swapLineUp"))}) + +(cmd/command {:command :editor.sublime.swapLineDown + :desc "Editor: Swap line down" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "swapLineDown"))}) + +(cmd/command {:command :editor.sublime.joinLines + :desc "Editor: Join lines" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "joinLines"))}) + +(cmd/command {:command :editor.sublime.duplicateLine + :desc "Editor: Duplicate line" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "duplicateLine"))}) + + +(cmd/command {:command :editor.sublime.sortLines + :desc "Editor: Sort lines" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "sortLines"))}) + +(cmd/command {:command :editor.sublime.sortLinesInsensitive + :desc "Editor: Sort lines insensitive" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "sortLinesInsensitive"))}) + +(cmd/command {:command :editor.sublime.selectLinesUpward + :desc "Editor: Select lines upward with multiple cursors" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "selectLinesUpward"))}) + +(cmd/command {:command :editor.sublime.selectLinesDownward + :desc "Editor: Select lines downward with multiple cursors" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "selectLinesDownward"))}) + +(cmd/command {:command :editor.sublime.splitSelectionByLine + :desc "Editor: Split selection into cursors per line" + :exec (fn [] + (cmd/exec! :editor.codemirror.command "splitSelectionByLine"))}) + From e42014e3de2bb84889152f7ded485eb1f2574e56 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 21 May 2014 12:27:38 -0700 Subject: [PATCH 147/656] typos in descriptions Signed-off-by: Chris Granger --- src/lt/objs/editor/pool.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index e025436b9..17da1fcf5 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -637,7 +637,7 @@ (cmd/exec! :editor.codemirror.command "insertLineBefore"))}) (cmd/command {:command :editor.sublime.selectNextOccurrence - :desc "Editor: Select next occurence of word" + :desc "Editor: Select next occurrence of word" :exec (fn [] (cmd/exec! :editor.codemirror.command "selectNextOccurrence"))}) @@ -657,7 +657,7 @@ (cmd/exec! :editor.codemirror.command "goToBracket"))}) (cmd/command {:command :editor.sublime.swapLineUp - :desc "Editor: swap line up" + :desc "Editor: Swap line up" :exec (fn [] (cmd/exec! :editor.codemirror.command "swapLineUp"))}) From 2bffad21c460e37b6e4eb1616aabe800f5adacbc Mon Sep 17 00:00:00 2001 From: ndr Date: Thu, 22 May 2014 03:08:06 +0200 Subject: [PATCH 148/656] editor/line-count takes a native editor Consistently with related functions, `lt.objs.editor/line-count` now takes a native Light Table editor, as opposed to a CodeMirror instance. --- src/lt/objs/editor.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 2d75371a7..8efb1d237 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -195,7 +195,7 @@ (.getRange (->cm-ed e) (clj->js from) (clj->js to))) (defn line-count [e] - (.lineCount e)) + (.lineCount (->cm-ed e))) (defn insert-at-cursor [ed s] (replace (->cm-ed ed) (->cursor ed) s) From b1e128cc836863c0c73f8b97a6a13c5a925edc52 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 22 May 2014 12:21:38 -0700 Subject: [PATCH 149/656] prevent font settings from being unnecessarily updated Signed-off-by: Chris Granger --- src/lt/objs/style.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index bea498a4d..d516b936b 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -40,7 +40,7 @@ :init (fn [this] [:div [:style {:type "text/css"} - (bound this ->css) + (bound (subatom this :font-settings) ->css) ]])) (def styles (object/create ::styles @@ -72,7 +72,7 @@ (> line-height 0)) (assoc final :line-height line-height) final)] - (object/merge! styles final)))) + (object/merge! styles {:font-settings final})))) ;;********************************************************** ;; Skins From 753e1531aba07a7f9eec5e670bd503fb50e50512 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 27 May 2014 09:32:39 -0700 Subject: [PATCH 150/656] pull in latest cm and fix the cursor height bug Signed-off-by: Chris Granger --- .../node_modules/codemirror/codemirror.js | 167 ++++++++++-------- src/lt/objs/editor.cljs | 1 + 2 files changed, 92 insertions(+), 76 deletions(-) diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/codemirror.js index 95cc6b966..aec908d10 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/codemirror.js @@ -25,11 +25,9 @@ var gecko = /gecko\/\d/i.test(navigator.userAgent); // ie_uptoN means Internet Explorer version N or lower var ie_upto10 = /MSIE \d/.test(navigator.userAgent); - var ie_upto7 = ie_upto10 && (document.documentMode == null || document.documentMode < 8); - var ie_upto8 = ie_upto10 && (document.documentMode == null || document.documentMode < 9); - var ie_upto9 = ie_upto10 && (document.documentMode == null || document.documentMode < 10); - var ie_11up = /Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); var ie = ie_upto10 || ie_11up; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); var webkit = /WebKit\//.test(navigator.userAgent); var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); var chrome = /Chrome\//.test(navigator.userAgent); @@ -50,7 +48,7 @@ if (presto_version && presto_version >= 15) { presto = false; webkit = true; } // Some browsers use the wrong event properties to signal cmd/ctrl on OS X var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && !ie_upto8); + var captureRightClick = gecko || (ie && ie_version >= 9); // Optimize some code when these features are not used. var sawReadOnlySpans = false, sawCollapsedSpans = false; @@ -93,7 +91,7 @@ // Override magic textarea content restore that IE sometimes does // on our hidden textarea on reload - if (ie_upto10) setTimeout(bind(resetInput, this, true), 20); + if (ie && ie_version < 11) setTimeout(bind(resetInput, this, true), 20); registerEventHandlers(this); ensureGlobalHandlers(); @@ -177,14 +175,14 @@ d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie_upto7) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } // Needed to hide big blue blinking cursor on Mobile Safari if (ios) input.style.width = "0px"; if (!webkit) d.scroller.draggable = true; // Needed to handle Tab key in KHTML if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie_upto7) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = "18px"; + if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = "18px"; if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper); @@ -394,6 +392,10 @@ // SCROLLBARS + function hScrollbarTakesSpace(cm) { + return cm.display.scroller.clientHeight - cm.display.wrapper.clientHeight < scrollerCutOff - 3; + } + // Prepare DOM reads needed to update the scrollbars. Done in one // shot to minimize update/measure roundtrips. function measureForScrollbars(cm) { @@ -402,6 +404,7 @@ clientHeight: scroll.clientHeight, barHeight: cm.display.scrollbarV.clientHeight, scrollWidth: scroll.scrollWidth, clientWidth: scroll.clientWidth, + hScrollbarTakesSpace: hScrollbarTakesSpace(cm), barWidth: cm.display.scrollbarH.clientWidth, docHeight: Math.round(cm.doc.height + paddingVert(cm.display)) }; @@ -411,13 +414,17 @@ // content. function updateScrollbars(cm, measure) { if (!measure) measure = measureForScrollbars(cm); - var d = cm.display; + var d = cm.display, sWidth = scrollbarWidth(d.measure); var scrollHeight = measure.docHeight + scrollerCutOff; var needsH = measure.scrollWidth > measure.clientWidth; + if (needsH && measure.scrollWidth <= measure.clientWidth + 1 && + sWidth > 0 && !measure.hScrollbarTakesSpace) + needsH = false; // (Issue #2562) var needsV = scrollHeight > measure.clientHeight; + if (needsV) { d.scrollbarV.style.display = "block"; - d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0"; + d.scrollbarV.style.bottom = needsH ? sWidth + "px" : "0"; // A bug in IE8 can cause this value to be negative, so guard it. d.scrollbarV.firstChild.style.height = Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + "px"; @@ -427,7 +434,7 @@ } if (needsH) { d.scrollbarH.style.display = "block"; - d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0"; + d.scrollbarH.style.right = needsV ? sWidth + "px" : "0"; d.scrollbarH.firstChild.style.width = (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + "px"; } else { @@ -436,16 +443,16 @@ } if (needsH && needsV) { d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px"; + d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + "px"; } else d.scrollbarFiller.style.display = ""; if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = scrollbarWidth(d.measure) + "px"; + d.gutterFiller.style.height = sWidth + "px"; d.gutterFiller.style.width = d.gutters.offsetWidth + "px"; } else d.gutterFiller.style.display = ""; if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) { - if (scrollbarWidth(d.measure) === 0) { + if (sWidth === 0) { var w = mac && !mac_geMountainLion ? "12px" : "18px"; d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w; var barMouseDown = function(e) { @@ -560,6 +567,10 @@ updateScrollbars(cm, barMeasure); if (webkit && cm.options.lineWrapping) checkForWebkitWidthBug(cm, barMeasure); // (Issue #2420) + if (webkit && barMeasure.scrollWidth > barMeasure.clientWidth && + barMeasure.scrollWidth < barMeasure.clientWidth + 1 && + !hScrollbarTakesSpace(cm)) + updateScrollbars(cm); // (Issue #2562) if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) { forced = true; continue; @@ -684,7 +695,7 @@ for (var i = 0; i < display.view.length; i++) { var cur = display.view[i], height; if (cur.hidden) continue; - if (ie_upto7) { + if (ie && ie_version < 8) { var bot = cur.node.offsetTop + cur.node.offsetHeight; height = bot - prevBottom; prevBottom = bot; @@ -793,7 +804,7 @@ if (lineView.text.parentNode) lineView.text.parentNode.replaceChild(lineView.node, lineView.text); lineView.node.appendChild(lineView.text); - if (ie_upto7) lineView.node.style.zIndex = 2; + if (ie && ie_version < 8) lineView.node.style.zIndex = 2; } return lineView.node; } @@ -1277,7 +1288,7 @@ // Draws a cursor for the given range function drawSelectionCursor(cm, range, output) { - var pos = cursorCoords(cm, range.head, "div"); + var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); cursor.style.left = pos.left + "px"; @@ -1559,7 +1570,7 @@ // Given a prepared measurement object, measures the position of an // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias) { + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { if (prepared.before) ch = -1; var key = ch + (bias || ""), found; if (prepared.cache.hasOwnProperty(key)) { @@ -1574,7 +1585,9 @@ found = measureCharInner(cm, prepared, ch, bias); if (!found.bogus) prepared.cache[key] = found; } - return {left: found.left, right: found.right, top: found.top, bottom: found.bottom}; + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom}; } var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; @@ -1620,7 +1633,7 @@ if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; - if (ie_upto8 && start == 0 && end == mEnd - mStart) { + if (ie && ie_version < 9 && start == 0 && end == mEnd - mStart) { rect = node.parentNode.getBoundingClientRect(); } else if (ie && cm.options.lineWrapping) { var rects = range(node, start, end).getClientRects(); @@ -1639,7 +1652,7 @@ else rect = node.getBoundingClientRect(); } - if (ie_upto8 && !start && (!rect || !rect.left && !rect.right)) { + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { var rSpan = node.parentNode.getClientRects()[0]; if (rSpan) rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; @@ -1647,15 +1660,17 @@ rect = nullRect; } - var top, bot = (rect.bottom + rect.top) / 2 - prepared.rect.top; + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; var heights = prepared.view.measure.heights; for (var i = 0; i < heights.length - 1; i++) - if (bot < heights[i]) break; - top = i ? heights[i - 1] : 0; bot = heights[i]; + if (mid < heights[i]) break; + var top = i ? heights[i - 1] : 0, bot = heights[i]; var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, top: top, bottom: bot}; if (!rect.left && !rect.right) result.bogus = true; + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } return result; } @@ -1735,11 +1750,11 @@ // Returns a box for a given cursor position, which may have an // 'other' property containing the position of the secondary cursor // on a bidi boundary. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure) { + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { lineObj = lineObj || getLine(cm.doc, pos.line); if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left"); + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); if (right) m.left = m.right; else m.right = m.left; return intoCoordSystem(cm, lineObj, m, context); } @@ -2250,7 +2265,7 @@ // If nothing changed, bail. if (text == prevInput && !cm.somethingSelected()) return false; // Work around nonsensical selection resetting in IE9/10 - if (ie && !ie_upto8 && cm.display.inputHasSelection === text) { + if (ie && ie_version >= 9 && cm.display.inputHasSelection === text) { resetInput(cm); return false; } @@ -2326,10 +2341,10 @@ var content = minimal ? "-" : selected || cm.getSelection(); cm.display.input.value = content; if (cm.state.focused) selectInput(cm.display.input); - if (ie && !ie_upto8) cm.display.inputHasSelection = content; + if (ie && ie_version >= 9) cm.display.inputHasSelection = content; } else if (!typing) { cm.display.prevInput = cm.display.input.value = ""; - if (ie && !ie_upto8) cm.display.inputHasSelection = null; + if (ie && ie_version >= 9) cm.display.inputHasSelection = null; } cm.display.inaccurateSelection = minimal; } @@ -2354,7 +2369,7 @@ var d = cm.display; on(d.scroller, "mousedown", operation(cm, onMouseDown)); // Older IE's will not fire a second mousedown for a double click - if (ie_upto10) + if (ie && ie_version < 11) on(d.scroller, "dblclick", operation(cm, function(e) { if (signalDOMEvent(cm, e)) return; var pos = posFromMouse(cm, e); @@ -2403,7 +2418,7 @@ on(d.input, "keyup", operation(cm, onKeyUp)); on(d.input, "input", function() { - if (ie && !ie_upto8 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; + if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; fastPoll(cm); }); on(d.input, "keydown", operation(cm, onKeyDown)); @@ -2598,7 +2613,7 @@ extendSelection(cm.doc, start); focusInput(cm); // Work around unexplainable focus problem in IE9 (#2127) - if (ie_upto10 && !ie_upto8) + if (ie && ie_version == 9) setTimeout(function() {document.body.focus(); focusInput(cm);}, 20); } }); @@ -2741,7 +2756,7 @@ } var move = operation(cm, function(e) { - if ((ie && !ie_upto9) ? !e.buttons : !e_button(e)) done(e); + if (!e_button(e)) done(e); else extend(e); }); var up = operation(cm, done); @@ -3058,7 +3073,7 @@ ensureFocus(cm); if (signalDOMEvent(cm, e)) return; // IE does strange things with escape. - if (ie_upto10 && e.keyCode == 27) e.returnValue = false; + if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; var code = e.keyCode; cm.display.shift = code == 16 || e.shiftKey; var handled = handleKeyBinding(cm, e); @@ -3102,7 +3117,7 @@ if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; var ch = String.fromCharCode(charCode == null ? keyCode : charCode); if (handleCharBinding(cm, e, ch)) return; - if (ie && !ie_upto8) cm.display.inputHasSelection = null; + if (ie && ie_version >= 9) cm.display.inputHasSelection = null; fastPoll(cm); } @@ -3184,12 +3199,12 @@ function rehide() { display.inputDiv.style.position = "relative"; display.input.style.cssText = oldCSS; - if (ie_upto8) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; + if (ie && ie_version < 9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; slowPoll(cm); // Try to detect the user choosing select-all if (display.input.selectionStart != null) { - if (!ie || ie_upto8) prepareSelectAllHack(); + if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); var i = 0, poll = function() { if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) operation(cm, commands.selectAll)(cm); @@ -3200,7 +3215,7 @@ } } - if (ie && !ie_upto8) prepareSelectAllHack(); + if (ie && ie_version >= 9) prepareSelectAllHack(); if (captureRightClick) { e_stop(e); var mouseup = function() { @@ -3711,12 +3726,12 @@ // Utility for applying a change to a line by handle or number, // returning the number and optionally registering the line as // changed. - function changeLine(cm, handle, changeType, op) { - var no = handle, line = handle, doc = cm.doc; + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); else no = lineNo(handle); if (no == null) return null; - if (op(line, no)) regLineChange(cm, no, changeType); + if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); return line; } @@ -4031,7 +4046,7 @@ defaultCharWidth: function() { return charWidth(this.display); }, setGutterMarker: methodOp(function(line, gutterID, value) { - return changeLine(this, line, "gutter", function(line) { + return changeLine(this.doc, line, "gutter", function(line) { var markers = line.gutterMarkers || (line.gutterMarkers = {}); markers[gutterID] = value; if (!value && isEmpty(markers)) line.gutterMarkers = null; @@ -4051,32 +4066,6 @@ }); }), - addLineClass: methodOp(function(handle, where, cls) { - return changeLine(this, handle, "class", function(line) { - var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; - if (!line[prop]) line[prop] = cls; - else if (new RegExp("(?:^|\\s)" + cls + "(?:$|\\s)").test(line[prop])) return false; - else line[prop] += " " + cls; - return true; - }); - }), - - removeLineClass: methodOp(function(handle, where, cls) { - return changeLine(this, handle, "class", function(line) { - var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) return false; - else if (cls == null) line[prop] = null; - else { - var found = cur.match(new RegExp("(?:^|\\s+)" + cls + "(?:$|\\s+)")); - if (!found) return false; - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - addLineWidget: methodOp(function(handle, node, options) { return addLineWidget(this, handle, node, options); }), @@ -4379,7 +4368,8 @@ option("cursorBlinkRate", 530); option("cursorScrollMargin", 0); - option("cursorHeight", 1); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); option("workTime", 100); option("workDelay", 100); option("flattenSpans", true, resetModeState, true); @@ -5544,7 +5534,7 @@ function addLineWidget(cm, handle, node, options) { var widget = new LineWidget(cm, node, options); if (widget.noHScroll) cm.display.alignWidgets = true; - changeLine(cm, handle, "widget", function(line) { + changeLine(cm.doc, handle, "widget", function(line) { var widgets = line.widgets || (line.widgets = []); if (widget.insertAt == null) widgets.push(widget); else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); @@ -5800,7 +5790,7 @@ builder.col += text.length; var content = document.createTextNode(text); builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie_upto8) mustWrap = true; + if (ie && ie_version < 9) mustWrap = true; builder.pos += text.length; } else { var content = document.createDocumentFragment(), pos = 0; @@ -5810,7 +5800,7 @@ var skipped = m ? m.index - pos : text.length - pos; if (skipped) { var txt = document.createTextNode(text.slice(pos, pos + skipped)); - if (ie_upto8) content.appendChild(elt("span", [txt])); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); else content.appendChild(txt); builder.map.push(builder.pos, builder.pos + skipped, txt); builder.col += skipped; @@ -5824,7 +5814,7 @@ builder.col += tabWidth; } else { var txt = builder.cm.options.specialCharPlaceholder(m[0]); - if (ie_upto8) content.appendChild(elt("span", [txt])); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); else content.appendChild(txt); builder.col += 1; } @@ -6349,6 +6339,31 @@ hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); }, + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, "class", function(line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (new RegExp("(?:^|\\s)" + cls + "(?:$|\\s)").test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, "class", function(line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var found = cur.match(new RegExp("(?:^|\\s+)" + cls + "(?:$|\\s+)")); + if (!found) return false; + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + markText: function(from, to, options) { return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); }, @@ -7156,7 +7171,7 @@ function activeElt() { return document.activeElement; } // Older versions of IE throws unspecified error when touching // document.activeElement in some cases (during loading, in iframe) - if (ie_upto10) activeElt = function() { + if (ie && ie_version < 11) activeElt = function() { try { return document.activeElement; } catch(e) { return document.body; } }; @@ -7219,7 +7234,7 @@ var dragAndDrop = function() { // There is *some* kind of drag-and-drop support in IE6-8, but I // couldn't get it to work yet. - if (ie_upto8) return false; + if (ie && ie_version < 9) return false; var div = elt('div'); return "draggable" in div || "dragDrop" in div; }(); @@ -7240,7 +7255,7 @@ var test = elt("span", "\u200b"); removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_upto7; + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && (ie && ie_version < 8); } if (zwspSupported) return elt("span", "\u200b"); else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index d2af256cd..0dbbb0df7 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -47,6 +47,7 @@ :onDragEvent (fn [] true) :undoDepth 10000 :matchBrackets true + :singleCursorHeightPerLine false :showCursorWhenSelecting true})] (when-let [c (:content context)] (set-val e c) From 2b2f27a6e25ccf3e0aa2e3c0afcbd35eba370217 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 29 May 2014 09:11:41 -0700 Subject: [PATCH 151/656] workaround for widgets overflowing to the next line Signed-off-by: Chris Granger --- deploy/core/css/structure.css | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index befb9d251..b5645cdab 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -33,6 +33,7 @@ body { -webkit-user-select: none; } #loader p { display:table-cell; vertical-align:middle; text-align:center; } .CodeMirror { font-size:11pt; font-family: "Inconsolata", "Ubuntu Mono", "Consolas", monospace; } +.Codemirror-widget::after { content: ""; } .result-mark {-webkit-user-select: text; margin-left:6px; max-width:700px; max-height:50%; overflow-y:auto; overflow-x:hidden; padding:0 5px; display:inline-block; border-radius:2px; width:-webkit-fit-content; vertical-align:top; } .result-mark .truncated { display:inline-block; white-space:nowrap; cursor:pointer; padding:0; box-sizing:border-box; vertical-align:top; overflow:hidden;} From 1688ff98cf8c62c59afa8749559654c1bdcdfad9 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 2 Jun 2014 11:00:54 -0700 Subject: [PATCH 152/656] change log, remove html modes since they're in the html plugin, 0.6.6 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 29 +++++ .../codemirror/modes/htmlembedded.js | 73 ------------ .../codemirror/modes/htmlmixed.js | 104 ------------------ deploy/core/version.json | 2 +- 4 files changed, 30 insertions(+), 178 deletions(-) delete mode 100644 deploy/core/node_modules/codemirror/modes/htmlembedded.js delete mode 100644 deploy/core/node_modules/codemirror/modes/htmlmixed.js diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 9c9787373..33eba5212 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,34 @@ #Changes +##0.6.6 + +* FIX: combine try-read catches now that :default is available in cljs (cldwalker) +* FIX: tweak show-docs command to open only one doc (snufkon) +* FIX: update solarized (ccspell and gozala) +* FIX: source map urls were not correctly encoded (nickgieschen) +* FIX: Ignore case when sorting plugins (seancaffery) +* FIX: Remove windowVerbatimArguments to fix pathing issues for processes on windows +* FIX: Push the initial position onto the stack when jumping (joshuafcole) +* FIX: remove warning from eclipse theme (Bost) +* FIX: don't move the search forward after every keypress (jamii) +* FIX: Prevent font settings from being unnecessarily updated (ibdknox) +* ADDED: Multiple cursor commands from CM4 +* ADDED: Multiple fonts support (ykomatsu) +* ADDED: reasonable default keybindings for zoom (cldwalker) +* ADDED: select the previous search text when bringing up the searcher (Bost) +* ADDED: Report bug button on welcome screen (Tyrieke Morton) +* ADDED: `Editor: Set options for line commenting` behavior (cldwalker) +* ADDED: you can right click to copy an inline result (cldwalker) +* API: make tab and tabset menus extensible (mortalapeman) +* API: log context changes (ndr-qef) +* API: checks for required keys in commands (cldwalker) +* API: add copy and paste platform functions (cldwalker) +* API: open-path function (cldwalker) +* API: Make $ and $$ multi-arity (mortalapeman) +* API: editor.add-gutter and remove-gutter functions (seancaffery) +* UPDATED: CodeMirror 4! +* UPDATED: CodeMirror modes + ##0.6.5 * FIX: Less syntax highlighting would cause errors diff --git a/deploy/core/node_modules/codemirror/modes/htmlembedded.js b/deploy/core/node_modules/codemirror/modes/htmlembedded.js deleted file mode 100644 index ff6dfd2f9..000000000 --- a/deploy/core/node_modules/codemirror/modes/htmlembedded.js +++ /dev/null @@ -1,73 +0,0 @@ -CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { - - //config settings - var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, - scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; - - //inner modes - var scriptingMode, htmlMixedMode; - - //tokenizer when in html mode - function htmlDispatch(stream, state) { - if (stream.match(scriptStartRegex, false)) { - state.token=scriptingDispatch; - return scriptingMode.token(stream, state.scriptState); - } - else - return htmlMixedMode.token(stream, state.htmlState); - } - - //tokenizer when in scripting mode - function scriptingDispatch(stream, state) { - if (stream.match(scriptEndRegex, false)) { - state.token=htmlDispatch; - return htmlMixedMode.token(stream, state.htmlState); - } - else - return scriptingMode.token(stream, state.scriptState); - } - - - return { - startState: function() { - scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); - htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); - return { - token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, - htmlState : CodeMirror.startState(htmlMixedMode), - scriptState : CodeMirror.startState(scriptingMode) - }; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == htmlDispatch) - return htmlMixedMode.indent(state.htmlState, textAfter); - else if (scriptingMode.indent) - return scriptingMode.indent(state.scriptState, textAfter); - }, - - copyState: function(state) { - return { - token : state.token, - htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), - scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) - }; - }, - - electricChars: "/{}:", - - innerMode: function(state) { - if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; - else return {state: state.htmlState, mode: htmlMixedMode}; - } - }; -}, "htmlmixed"); - -CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); -CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); -CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); -CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); diff --git a/deploy/core/node_modules/codemirror/modes/htmlmixed.js b/deploy/core/node_modules/codemirror/modes/htmlmixed.js deleted file mode 100644 index ec0c21d24..000000000 --- a/deploy/core/node_modules/codemirror/modes/htmlmixed.js +++ /dev/null @@ -1,104 +0,0 @@ -CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); - var cssMode = CodeMirror.getMode(config, "css"); - - var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; - scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, - mode: CodeMirror.getMode(config, "javascript")}); - if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { - var conf = scriptTypesConf[i]; - scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); - } - scriptTypes.push({matches: /./, - mode: CodeMirror.getMode(config, "text/plain")}); - - function html(stream, state) { - var tagName = state.htmlState.tagName; - var style = htmlMode.token(stream, state.htmlState); - if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { - // Script block: mode to change to depends on type attribute - var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); - scriptType = scriptType ? scriptType[1] : ""; - if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); - for (var i = 0; i < scriptTypes.length; ++i) { - var tp = scriptTypes[i]; - if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { - if (tp.mode) { - state.token = script; - state.localMode = tp.mode; - state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); - } - break; - } - } - } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { - state.token = css; - state.localMode = cssMode; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - } - return style; - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat), m; - if (close > -1) stream.backUp(cur.length - close); - else if (m = cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur[0]); - } - return style; - } - function script(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*script\s*>/, - state.localMode.token(stream, state.localState)); - } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); - } - - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.localMode, state.localState); - return {token: state.token, localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter); - else - return CodeMirror.Pass; - }, - - electricChars: "/{}:", - - innerMode: function(state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; - } - }; -}, "xml", "javascript", "css"); - -CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/deploy/core/version.json b/deploy/core/version.json index 91f9f9bcd..5f2f64bdb 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.6.5","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.6.6","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file From 2a7ef2f46a1e278c423a11c006d3baeb5b31e2a8 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 3 Jun 2014 10:25:33 -0700 Subject: [PATCH 153/656] remove the default CM theme which seems to be causing problems Signed-off-by: Chris Granger --- deploy/core/css/codemirror.css | 39 ---------------------------------- 1 file changed, 39 deletions(-) diff --git a/deploy/core/css/codemirror.css b/deploy/core/css/codemirror.css index 098a317a2..431fb6230 100644 --- a/deploy/core/css/codemirror.css +++ b/deploy/core/css/codemirror.css @@ -64,45 +64,6 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} position: absolute; } -/* DEFAULT THEME */ - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3 {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} -.CodeMirror-activeline-background {background: #e8f2ff;} - /* STOP */ /* The rest of this file contains styles related to the mechanics of From cb80cfff9a553e84dcccb33ab84ccd20e2e80aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Maliarik?= Date: Wed, 4 Jun 2014 11:24:47 +0200 Subject: [PATCH 154/656] Fixing CSS for default theme & CM4 --- deploy/core/css/themes/default.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/css/themes/default.css b/deploy/core/css/themes/default.css index 2190619d0..1fbd4f04c 100644 --- a/deploy/core/css/themes/default.css +++ b/deploy/core/css/themes/default.css @@ -43,7 +43,7 @@ .cm-s-default .CodeMirror-selected { background: #555; } .cm-s-default .CodeMirror-focused .CodeMirror-selected { background: #444; } -.cm-s-default .CodeMirror-activeline { background:#303030; } +.cm-s-default .CodeMirror-activeline-background { background:#303030; } .cm-s-default span.CodeMirror-matchingbracket {box-sizing:border-box; background:transparent; border-bottom:1px solid #3FF; font-weight:normal;} .cm-s-default span.CodeMirror-nonmatchingbracket {color: #F33; border-bottom:1px solid #F33; background:none;} From 17a0e0f5c2b7045d75208100ff16a9abe736e128 Mon Sep 17 00:00:00 2001 From: grun Date: Sat, 7 Jun 2014 06:14:46 -0700 Subject: [PATCH 155/656] Be consistent and portable (#!/usr/bin/env sh over #!/bin/sh) with shebangs. --- .../tar/node_modules/fstream/node_modules/rimraf/test/run.sh | 3 ++- .../tar/node_modules/fstream/node_modules/rimraf/test/setup.sh | 2 +- deploy/core/node_modules/walkdir/test.sh | 3 ++- .../node_modules/walkdir/test/comparison/install_test_deps.sh | 2 ++ linux_deps.sh | 1 + osx_deps.sh | 2 ++ platform/linux/LightTable | 2 +- platform/linux64/LightTable | 2 +- platform/mac/light | 2 +- windows_deps.sh | 2 ++ 10 files changed, 15 insertions(+), 6 deletions(-) diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh index 598f0163b..e5b370af0 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + set -e for i in test-*.js; do echo -n $i ... diff --git a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh index 2602e6316..eaf7a3ca0 100644 --- a/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh +++ b/deploy/core/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/deploy/core/node_modules/walkdir/test.sh b/deploy/core/node_modules/walkdir/test.sh index 14679f827..15d21849a 100755 --- a/deploy/core/node_modules/walkdir/test.sh +++ b/deploy/core/node_modules/walkdir/test.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/usr/bin/env sh + ./node_modules/jshint/bin/hint ./* hint=$? if [ $hint != 0 ]; then diff --git a/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh b/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh index 5fdd18ffd..0861c853a 100755 --- a/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh +++ b/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh @@ -1 +1,3 @@ +#!/usr/bin/env sh + npm install diff --git a/linux_deps.sh b/linux_deps.sh index b3a1c880a..01662feca 100755 --- a/linux_deps.sh +++ b/linux_deps.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash + # Check if lein is installed lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } if [ "$(echo `lein version` | grep 'Leiningen 1.\|2.0')" ]; then diff --git a/osx_deps.sh b/osx_deps.sh index 0f8f3bc26..94fa2f53d 100644 --- a/osx_deps.sh +++ b/osx_deps.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Check if lein is installed lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then diff --git a/platform/linux/LightTable b/platform/linux/LightTable index 11ff4b683..095b3978f 100644 --- a/platform/linux/LightTable +++ b/platform/linux/LightTable @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash BIN=ltbin HERE=`dirname $(readlink -f $0)` diff --git a/platform/linux64/LightTable b/platform/linux64/LightTable index 78c3f075f..e9884365d 100644 --- a/platform/linux64/LightTable +++ b/platform/linux64/LightTable @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash BIN=ltbin HERE=`dirname $(readlink -f $0)` diff --git a/platform/mac/light b/platform/mac/light index 2c99504b9..6460f51ad 100644 --- a/platform/mac/light +++ b/platform/mac/light @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ -z "$LT_HOME" ] then diff --git a/windows_deps.sh b/windows_deps.sh index ea83a0668..e596c6f5d 100755 --- a/windows_deps.sh +++ b/windows_deps.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Check if lein is installed lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } if [ "$(echo `lein version` | grep 'Leiningen 1.\|2.0')" ]; then From b2c1b63f21400c16994b425e8813eb3b0fe8ed89 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 12 Jun 2014 20:45:09 -0700 Subject: [PATCH 156/656] ignore drag events in codemirror. closes #1524, closes #1523 Signed-off-by: Chris Granger --- src/lt/objs/editor.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 0dbbb0df7..423758016 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -44,7 +44,6 @@ "plaintext") :autoClearEmptyLines true :dragDrop false - :onDragEvent (fn [] true) :undoDepth 10000 :matchBrackets true :singleCursorHeightPerLine false @@ -69,6 +68,10 @@ (defn wrap-object-events [ed obj] (dom/on (->elem ed) :contextmenu #(object/raise obj :menu! %)) + (on ed :dragstart #(.preventDefault %2)) + (on ed :dragstenter #(.preventDefault %2)) + (on ed :dragover #(.preventDefault %2)) + (on ed :drop #(.preventDefault %2)) (on ed :scroll #(object/raise obj :scroll %)) (on ed :update #(object/raise obj :update % %2)) (on ed :change #(object/raise obj :change % %2)) From c71e7430cc7c97d16f41b6a2733c2d0954481846 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 12 Jun 2014 20:49:10 -0700 Subject: [PATCH 157/656] fix typo Signed-off-by: Chris Granger --- src/lt/objs/editor.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 423758016..dc07d4873 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -69,7 +69,7 @@ (defn wrap-object-events [ed obj] (dom/on (->elem ed) :contextmenu #(object/raise obj :menu! %)) (on ed :dragstart #(.preventDefault %2)) - (on ed :dragstenter #(.preventDefault %2)) + (on ed :dragenter #(.preventDefault %2)) (on ed :dragover #(.preventDefault %2)) (on ed :drop #(.preventDefault %2)) (on ed :scroll #(object/raise obj :scroll %)) From af7375274cce4d5dabc6dc3d206ecc5e6255dca1 Mon Sep 17 00:00:00 2001 From: Willy Blandin Date: Fri, 27 Jun 2014 03:07:54 +0200 Subject: [PATCH 158/656] fix CodeMirror search failing with RegExp syntax Commit e6b16d80 broke this by trying to access the undefined isRE --- deploy/core/node_modules/codemirror/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/core/node_modules/codemirror/search.js b/deploy/core/node_modules/codemirror/search.js index 4d49ff6df..223e48a53 100644 --- a/deploy/core/node_modules/codemirror/search.js +++ b/deploy/core/node_modules/codemirror/search.js @@ -45,9 +45,10 @@ } function parseQuery(query) { var ignoreCase = query == query.toLowerCase(); + var isRE = isRegex(query); try { var rx = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); - if(isRegex(query) && !"".match(rx)) { + if(isRE && !"".match(rx)) { return rx; } else { return query; @@ -56,7 +57,6 @@ return query; } } - function doSearch(cm, query, rev) { var state = getSearchState(cm); cm.operation(function() { From 8a9cd45f04516816922050da9f22c7c5f2c1d27e Mon Sep 17 00:00:00 2001 From: gekkoe808 Date: Sun, 29 Jun 2014 23:43:12 -0700 Subject: [PATCH 159/656] Default hotkey on OSX for searcher is cmd-shift-f --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 04cb8784b..9081069b5 100755 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_st The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. -For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. +For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f or cmd-shift-f on Mac). If it isn't clear how to use a given function then using the searcher to find examples will also help. Finally, use the documentation searcher (ctrl-shift-d) for full-text search over the names and docstrings of all known vars. Most of Light Table doesn't have docstrings, but this is still useful for library code. From 5f02891fd3ab345d188d30cc1bb4bbf2da715706 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 10 Jul 2014 07:27:59 -0700 Subject: [PATCH 160/656] refix line ending preservation. Closes #359 Signed-off-by: Chris Granger --- src/lt/objs/editor/file.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor/file.cljs b/src/lt/objs/editor/file.cljs index 89990b992..242f4cb02 100644 --- a/src/lt/objs/editor/file.cljs +++ b/src/lt/objs/editor/file.cljs @@ -40,7 +40,7 @@ :triggers #{:save+} :reaction (fn [editor content] (if (= "\r\n" (or (-> @editor :info :line-ending) files/line-ending)) - (string/replace content "(\r\n|\n)" "\r\n") + (string/replace content (js/RegExp. "(\r?\n|\n)" "gm") "\r\n") content))) From 44f817088c6e206a56c6c318512b5433bcc7b72a Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 10 Jul 2014 09:23:41 -0700 Subject: [PATCH 161/656] proxy support for downloads via the http_proxy, https_proxy environment vars thanks to @sethyuan. Fixes #1451 Signed-off-by: Chris Granger --- src/lt/objs/deploy.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 94ee7cf6f..201c96571 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -75,6 +75,8 @@ (let [options (js-obj "url" from "headers" (js-obj "User-Agent" "Light Table")) out (.createWriteStream fs to)] + (when-let [proxy (or js/process.env.http_proxy js/process.env.https_proxy)] + (set! (.-proxy options) proxy)) (.pipe (request options cb) out))) (defn download-zip [ver cb] From 16ff77c376c998ad3d04b610f81178c4b445c55a Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 10 Jul 2014 10:27:34 -0700 Subject: [PATCH 162/656] fix weird focus issue. I think this fixes #1293, #1468. Signed-off-by: Chris Granger --- src/lt/objs/dialogs.cljs | 4 ++-- src/lt/plugins/auto_complete.cljs | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/dialogs.cljs b/src/lt/objs/dialogs.cljs index 64eccf99e..1de6bd460 100644 --- a/src/lt/objs/dialogs.cljs +++ b/src/lt/objs/dialogs.cljs @@ -10,7 +10,7 @@ :change (fn [] (this-as me (when-not (empty? (dom/val me)) - (object/raise obj event (dom/val me)))))) + (object/raise obj event (dom/val me)))))) (defn trigger [] (dom/trigger active-input :click)) @@ -25,4 +25,4 @@ (defn save-as [obj event] (set! active-input (input obj :nwsaveas event)) - (trigger)) \ No newline at end of file + (trigger)) diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 9923bcc6b..53facf0d8 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -168,8 +168,6 @@ (when (:line @this) (js/CodeMirror.off (:line @this) "change" on-line-change)) (ctx/out! [:editor.keys.hinting.active]) - (when (or force? (= 0 (count (:cur @this)))) - (keyboard/passthrough)) (object/merge! this {:active false :selected 0 :ed nil From 8b56f991433023773897be208f7ef8c60ee4878f Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 10 Jul 2014 11:09:06 -0700 Subject: [PATCH 163/656] 0.6.7 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 12 ++++++++++++ deploy/core/version.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 33eba5212..f18f76239 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,17 @@ #Changes +##0.6.7 + +* FIX: Workspace behaviors do not correctly take effect on startup (mortalapeman) +* FIX: Focus issues that cause weird save/eval behavior. (ibdknox) +* FIX: fix default theme issues (ibdknox & skrat) +* FIX: Ignore drag events so that "null" doesn't get input into the editor +* FIX: line ending preservation was broken #359 (ibdknox) +* FIX: Clojure client couldn't be created from the add connection menu ibdknox +* FIX: CSS save issue (ibdknox) +* ADDED: proxy support via http_proxy and https_proxy env vars (sethyuan) +* README FIX: default keybinding for the searcher on OSX (gekkie808) + ##0.6.6 * FIX: combine try-read catches now that :default is available in cljs (cldwalker) diff --git a/deploy/core/version.json b/deploy/core/version.json index 5f2f64bdb..ceb32dbf6 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.6.6","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.6.7","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file From ef746f27e17232de03b1143e5a6c011c094447ec Mon Sep 17 00:00:00 2001 From: ndr Date: Thu, 10 Jul 2014 20:09:58 +0200 Subject: [PATCH 164/656] Allow fold-code to fold at location Expands `lt.objs.editor/fold-code` to accept two arguments to fold code at a line `n` or location `{:line n :ch m}`. CodeMirror fold options are still not wrapped. --- src/lt/objs/editor.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index dc07d4873..c72ce9a4a 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -376,8 +376,11 @@ (object/merge! e {:doc doc}) (.swapDoc (->cm-ed e) (:doc @doc))) -(defn fold-code [e] - (.foldCode (->cm-ed e) (cursor e))) +(defn fold-code + ([e] + (fold-code e (->cursor e))) + ([e loc] + (.foldCode (->cm-ed e) (clj->js loc)))) (defn gutter-widths [e] (let [gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) From aa838695159d4103d6b185e348cfd5bdeb90cd95 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 15 Jul 2014 19:29:45 -0700 Subject: [PATCH 165/656] don't try to limit size in websocket connection prints, and return arrays as is Signed-off-by: Chris Granger --- deploy/core/node_modules/lighttable/ws.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/node_modules/lighttable/ws.js b/deploy/core/node_modules/lighttable/ws.js index 4056e719e..c0ca86b5c 100644 --- a/deploy/core/node_modules/lighttable/ws.js +++ b/deploy/core/node_modules/lighttable/ws.js @@ -15,15 +15,15 @@ var cache = []; function replacer(key, value) { - if(cache.length > 20) { - return; - } if(window.jQuery && value instanceof jQuery) { return "[jQuery $(" + value.selector + ")]"; } if(value instanceof Element) { return "[Element " + value.tagName.toLowerCase() + (value.id != "" ? "#" : "") + value.id + "]"; } + if(value instanceof Array) { + return value; + } if(typeof(value) == "object") { if(cache.indexOf(value) > -1) { return "circular"; From bc44a16e2fcec3af661f7a0da189364ec4d10678 Mon Sep 17 00:00:00 2001 From: Victor Cottin Date: Fri, 18 Jul 2014 13:00:40 +0200 Subject: [PATCH 166/656] changed bracket selectors so it beats the ones in rainbow/color.css --- deploy/core/css/themes/ibdknox.css | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/deploy/core/css/themes/ibdknox.css b/deploy/core/css/themes/ibdknox.css index 142b28963..a8fff5ad3 100644 --- a/deploy/core/css/themes/ibdknox.css +++ b/deploy/core/css/themes/ibdknox.css @@ -7,20 +7,20 @@ .cm-s-ibdknox { background: #202020; color:#ccc; } -.cm-s-ibdknox span.cm-bracket {color: #999;} -.cm-s-ibdknox span.cm-bracket1 {color: #999;} -.cm-s-ibdknox span.cm-bracket2 {color: #0f0;} -.cm-s-ibdknox span.cm-bracket3 {color: #00ffff;} -.cm-s-ibdknox span.cm-bracket4 {color: #00bfff;} -.cm-s-ibdknox span.cm-bracket5 {color: #836FFF;} -.cm-s-ibdknox span.cm-bracket6 {color: #FF00FF;} -.cm-s-ibdknox span.cm-bracket7 {color: #9B30FF;} -.cm-s-ibdknox span.cm-bracket8 {color: #00ff7f;} -.cm-s-ibdknox span.cm-bracket9 {color: #00ffff;} -.cm-s-ibdknox span.cm-bracket10 {color: #836FFF;} -.cm-s-ibdknox span.cm-bracket11 {color: #FF00FF;} -.cm-s-ibdknox span.cm-bracket12 {color: #9B30FF;} -.cm-s-ibdknox span.cm-bracket0, .cm-s-ibdknox span.cm-bracket-mismatched { color:#f88; background:#733; } +.cm-s-ibdknox span.cm-bracket.cm-bracket {color: #999;} +.cm-s-ibdknox span.cm-bracket.cm-bracket1 {color: #999;} +.cm-s-ibdknox span.cm-bracket.cm-bracket2 {color: #0f0;} +.cm-s-ibdknox span.cm-bracket.cm-bracket3 {color: #00ffff;} +.cm-s-ibdknox span.cm-bracket.cm-bracket4 {color: #00bfff;} +.cm-s-ibdknox span.cm-bracket.cm-bracket5 {color: #836FFF;} +.cm-s-ibdknox span.cm-bracket.cm-bracket6 {color: #FF00FF;} +.cm-s-ibdknox span.cm-bracket.cm-bracket7 {color: #9B30FF;} +.cm-s-ibdknox span.cm-bracket.cm-bracket8 {color: #00ff7f;} +.cm-s-ibdknox span.cm-bracket.cm-bracket9 {color: #00ffff;} +.cm-s-ibdknox span.cm-bracket.cm-bracket10 {color: #836FFF;} +.cm-s-ibdknox span.cm-bracket.cm-bracket11 {color: #FF00FF;} +.cm-s-ibdknox span.cm-bracket.cm-bracket12 {color: #9B30FF;} +.cm-s-ibdknox span.cm-bracket.cm-bracket0, .cm-s-ibdknox span.cm-bracket-mismatched { color:#f88; background:#733; } .cm-s-ibdknox span.cm-symbol {color: #bbb;} .cm-s-ibdknox span.cm-variable {color: #ccc;} From 8df8a94c0863de484062b9eefbcb15b5e8a1e445 Mon Sep 17 00:00:00 2001 From: Victor Cottin Date: Fri, 18 Jul 2014 13:01:45 +0200 Subject: [PATCH 167/656] changed bracket selectors so it beats the ones in rainbow/color.css --- deploy/core/css/themes/ibdknox.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/css/themes/ibdknox.css b/deploy/core/css/themes/ibdknox.css index a8fff5ad3..5fc2dead0 100644 --- a/deploy/core/css/themes/ibdknox.css +++ b/deploy/core/css/themes/ibdknox.css @@ -7,7 +7,7 @@ .cm-s-ibdknox { background: #202020; color:#ccc; } -.cm-s-ibdknox span.cm-bracket.cm-bracket {color: #999;} +.cm-s-ibdknox span.cm-bracket {color: #999;} .cm-s-ibdknox span.cm-bracket.cm-bracket1 {color: #999;} .cm-s-ibdknox span.cm-bracket.cm-bracket2 {color: #0f0;} .cm-s-ibdknox span.cm-bracket.cm-bracket3 {color: #00ffff;} From 3b5fab6b5ff0409fa3f35fbb0be5751b5186949f Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Mon, 28 Jul 2014 22:24:14 -0700 Subject: [PATCH 168/656] Renames #side -> #left-bar --- deploy/core/css/skins/new-dark.css | 20 ++++---- deploy/core/css/structure.css | 74 +++++++++++++++--------------- src/lt/objs/sidebar.cljs | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index c32c1d7b0..ae117137f 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -156,16 +156,16 @@ input { color: var(highlight-fg); background:var(highlight-bg); } .filter-list .selected, .filter-list li:hover { color:var(highlight-fg); background: var(highlight-bg);} .filter-list .selected em, .filter-list li:hover em { color:var(accent-foreground); } -#side .content { background:var(bg); box-shadow: 0 0 10px var(shadow); } -#side ::-webkit-scrollbar-thumb { background: var(scrollbar); border:1px solid var(scrollbar); } +#left-bar .content { background:var(bg); box-shadow: 0 0 10px var(shadow); } +#left-bar ::-webkit-scrollbar-thumb { background: var(scrollbar); border:1px solid var(scrollbar); } -#side .workspace ul.buttons li:hover:not(.sep) { color:var(highlight-fg); background:var(highlight-bg); } -#side .workspace li:hover > div > p { color: var(highlight-fg); } -#side .workspace li p:hover { background: var(highlight-bg); color:var(highlight-fg); } -#side .workspace .recent > div > ul > li + li { border-top:0px solid var(pane-border); } -#side .workspace .recent > div > ul > li:hover { border-color: var(pane-border); background:var(highlight-bg); color: var(highlight-fg); } -#side .workspace .recent > div > ul > li:hover + li { border-top-color: var(pane-border); } -#side .workspace .recent h2:hover { background: var(highlight-bg); color:var(highlight-fg); } +#left-bar .workspace ul.buttons li:hover:not(.sep) { color:var(highlight-fg); background:var(highlight-bg); } +#left-bar .workspace li:hover > div > p { color: var(highlight-fg); } +#left-bar .workspace li p:hover { background: var(highlight-bg); color:var(highlight-fg); } +#left-bar .workspace .recent > div > ul > li + li { border-top:0px solid var(pane-border); } +#left-bar .workspace .recent > div > ul > li:hover { border-color: var(pane-border); background:var(highlight-bg); color: var(highlight-fg); } +#left-bar .workspace .recent > div > ul > li:hover + li { border-top-color: var(pane-border); } +#left-bar .workspace .recent h2:hover { background: var(highlight-bg); color:var(highlight-fg); } #right-bar .content { background:var(bg); } #right-bar .command h2:hover { background:var(highlight-bg); color:var(highlight-fg); } @@ -313,7 +313,7 @@ input { color: var(highlight-fg); background:var(highlight-bg); } #multi .list li { height:29px; padding:6px 10px; font-size: 9pt; text-align:left; } #multi .content { background:var(multi); margin:0; top:29px; left:0; right:0; padding:5px; padding-bottom:5px; } -#side .workspace ul.root { top:0px; } +#left-bar .workspace ul.root { top:0px; } #right-bar .filter-list input { padding:6px 10px; font-size:10pt; margin-top:0; border-radius:0px; } #right-bar .filter-list ul { top:35px; bottom:10px; } #right-bar .content { padding:0 15px; padding-bottom:10px; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index b5645cdab..e94562b23 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -168,10 +168,10 @@ body { -webkit-user-select: none; } #right-bar .content > * { padding:0px 0px; box-sizing:border-box; height:100%; } #right-bar .vertical-grip { left:-4px; } -#side { position:fixed; top:var(top-offset); left:0; bottom:0; z-index:1000000; overflow:hidden; } -#side .content { height:100%; overflow:hidden; padding:4px 5px; padding-bottom:10px; box-sizing:border-box;} -#side .content > * { padding:0px 0px; box-sizing:border-box; } -#side .vertical-grip { right:-4px; pointer-events:auto; } +#left-bar { position:fixed; top:var(top-offset); left:0; bottom:0; z-index:1000000; overflow:hidden; } +#left-bar .content { height:100%; overflow:hidden; padding:4px 5px; padding-bottom:10px; box-sizing:border-box;} +#left-bar .content > * { padding:0px 0px; box-sizing:border-box; } +#left-bar .vertical-grip { right:-4px; pointer-events:auto; } #right-bar .command { padding:0px 0px; background:transparent; overflow:hidden; height:100%; } #right-bar .command h2 { font-size: 12pt; margin-bottom:10px; cursor:default; padding:10px; border-radius:2px; } @@ -183,33 +183,33 @@ body { -webkit-user-select: none; } #right-bar .command li { padding:5px 5px; line-height:1.2em; } #right-bar .command .binding { font-size:8pt; } -#side .workspace { position:relative; height:100%; overflow:hidden; padding-top:0px; } -#side .workspace > p { float:left; width:100%; } -#side .workspace ul.buttons { float:left; white-space:nowrap; width:100%; min-width:250px; padding:0px 10px;} -#side .workspace ul.buttons li { float:left; display:inline-block; padding:2px 5px; } -#side .workspace ul.buttons li.sep { margin:0; } -#side .workspace ul.root { position:absolute; height:auto; left:13px; right:7px; padding-right:10px; top:40px; bottom:10px; box-sizing:border-box; } -#side .workspace ul.root { overflow:auto; } -#side .workspace li { cursor:default; padding:0; border-radius:2px; white-space:nowrap; } -#side .workspace li p { padding:1px; padding-left:5px; border-radius:2px; box-sizing:border-box; } -#side .workspace ul.sub { margin-left:15px; display:none; } -#side .workspace ul.sub.opened { display:block; } -#side .workspace .folder, .folders { font-weight:bold; } -#side .workspace > ul > li > div > ul.sub { margin:0; } -#side .workspace ul.root > div > ul:empty:before { content:"Right click to add files or folders to the workspace or open a recent one to get started."; display:inline-block; text-align:center; width:100%; max-width:300px; margin-top:40px; } -#side .workspace input.rename { display:none; } -#side .workspace li.renaming > input.rename { display:block; width:100%; } -#side .workspace li.renaming > .tree-item > p { display:none; } -#side .workspace.recents .wstree { display:none; } -#side .workspace.recents .recent { display:block; width:100%; overflow:hidden; } -#side .workspace .recent { display:none; } -#side .workspace.recents { overflow-y:auto; padding:0 5px; } -#side .workspace .recent > div > ul { position:absolute; top:35px; bottom:0px; left:5px; right:0px; padding-right:10px; overflow-y:auto; margin-top:0;} -#side .workspace .recent > div > ul > li { padding:10px 10px; display:inline-block; width:100%; box-sizing:border-box; border-radius:2px; } -#side .workspace .recent > div > ul > li:first-child { border:none; border-top-right-radius:2px; border-top-left-radius:2px; } -#side .workspace .recent > div > ul > li:last-child { border-bottom:none; border-bottom-right-radius:2px; border-bottom-left-radius:2px; } -#side .workspace .recent h2 { width:100%; padding:2px 5px; font-size:10pt; border-radius:2px; box-sizing:border-box; } -#side .workspace .recent h2:after { float:right; content: "⇡"; } +#left-bar .workspace { position:relative; height:100%; overflow:hidden; padding-top:0px; } +#left-bar .workspace > p { float:left; width:100%; } +#left-bar .workspace ul.buttons { float:left; white-space:nowrap; width:100%; min-width:250px; padding:0px 10px;} +#left-bar .workspace ul.buttons li { float:left; display:inline-block; padding:2px 5px; } +#left-bar .workspace ul.buttons li.sep { margin:0; } +#left-bar .workspace ul.root { position:absolute; height:auto; left:13px; right:7px; padding-right:10px; top:40px; bottom:10px; box-sizing:border-box; } +#left-bar .workspace ul.root { overflow:auto; } +#left-bar .workspace li { cursor:default; padding:0; border-radius:2px; white-space:nowrap; } +#left-bar .workspace li p { padding:1px; padding-left:5px; border-radius:2px; box-sizing:border-box; } +#left-bar .workspace ul.sub { margin-left:15px; display:none; } +#left-bar .workspace ul.sub.opened { display:block; } +#left-bar .workspace .folder, .folders { font-weight:bold; } +#left-bar .workspace > ul > li > div > ul.sub { margin:0; } +#left-bar .workspace ul.root > div > ul:empty:before { content:"Right click to add files or folders to the workspace or open a recent one to get started."; display:inline-block; text-align:center; width:100%; max-width:300px; margin-top:40px; } +#left-bar .workspace input.rename { display:none; } +#left-bar .workspace li.renaming > input.rename { display:block; width:100%; } +#left-bar .workspace li.renaming > .tree-item > p { display:none; } +#left-bar .workspace.recents .wstree { display:none; } +#left-bar .workspace.recents .recent { display:block; width:100%; overflow:hidden; } +#left-bar .workspace .recent { display:none; } +#left-bar .workspace.recents { overflow-y:auto; padding:0 5px; } +#left-bar .workspace .recent > div > ul { position:absolute; top:35px; bottom:0px; left:5px; right:0px; padding-right:10px; overflow-y:auto; margin-top:0;} +#left-bar .workspace .recent > div > ul > li { padding:10px 10px; display:inline-block; width:100%; box-sizing:border-box; border-radius:2px; } +#left-bar .workspace .recent > div > ul > li:first-child { border:none; border-top-right-radius:2px; border-top-left-radius:2px; } +#left-bar .workspace .recent > div > ul > li:last-child { border-bottom:none; border-bottom-right-radius:2px; border-bottom-left-radius:2px; } +#left-bar .workspace .recent h2 { width:100%; padding:2px 5px; font-size:10pt; border-radius:2px; box-sizing:border-box; } +#left-bar .workspace .recent h2:after { float:right; content: "⇡"; } #right-bar .navigate { height:100%; overflow:auto; box-sizing:border-box; } #right-bar .navigate em { font-weight:normal; } @@ -217,7 +217,7 @@ body { -webkit-user-select: none; } #right-bar .navigate li:empty { display:none; } #right-bar .navigate p { font-size:8pt; } #right-bar .navigate h2 { font-size:11pt; } -#right-bar .navigate .selected, #side .navigate li:hover { border-radius:2px} +#right-bar .navigate .selected, #left-bar .navigate li:hover { border-radius:2px} #right-bar .navigate input { border:none; margin-bottom:20px; border-radius:2px; outline:none; box-sizing:border-box; width:100%; padding:10px; font-size:11pt;} #right-bar .navigate .filter-list.empty ul:before { content: "Add some files or folders to your workspace to fill the navigator."; padding:10px 0; text-align:center; display:inline-block;} @@ -307,10 +307,10 @@ body { -webkit-user-select: none; } #browser input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} #browser button { width:20px; height:26px; padding:4px 5px; box-sizing:border-box; border-radius:0px; vertical-align:middle; } -#side .tab-settings .filter-list { position:relative; } -#side .tab-settings .filter-list ul {height: 100px; overflow:auto; display:none; position:absolute; top:35px; width:100%; z-index:10; border-radius:2px; padding:5px 0px; box-sizing:border-box;} -#side .tab-settings .filter-list li { padding:0 10px; border-radius:2px; } -#side .tab-settings .filter-list input:focus + * { display:block; } +#left-bar .tab-settings .filter-list { position:relative; } +#left-bar .tab-settings .filter-list ul {height: 100px; overflow:auto; display:none; position:absolute; top:35px; width:100%; z-index:10; border-radius:2px; padding:5px 0px; box-sizing:border-box;} +#left-bar .tab-settings .filter-list li { padding:0 10px; border-radius:2px; } +#left-bar .tab-settings .filter-list input:focus + * { display:block; } .search-results { overflow:hidden; position:relative; box-sizing:border-box; } .search-results input { width:100%; } @@ -380,7 +380,7 @@ body { -webkit-user-select: none; } .animated #multi { -webkit-transition:bottom 0.1s ease-in-out, left 0.1s ease-in-out, right 0.10s ease-in-out; } .animated #multi .tabsets { -webkit-transition:bottom 0.1s ease-in-out; } .animated #bottombar { -webkit-transition:height 0.1s ease-in-out, left 0.1s ease-in-out, right 0.1s ease-in-out; } -.animated #side { -webkit-transition:width 0.1s ease-in-out; } +.animated #left-bar { -webkit-transition:width 0.1s ease-in-out; } .animated #right-bar { -webkit-transition:width 0.10s ease-in-out; } .animated #find-bar { -webkit-transition:height 0.1s ease-in-out;} .animated #multi .tab-close { -webkit-transition:width 0.2s ease-in-out, padding 0.2s ease-in-out; } diff --git a/src/lt/objs/sidebar.cljs b/src/lt/objs/sidebar.cljs index 6f8eb95d8..d73d8834f 100644 --- a/src/lt/objs/sidebar.cljs +++ b/src/lt/objs/sidebar.cljs @@ -103,7 +103,7 @@ :transients '() :max-width default-width :init (fn [this] - [:div#side {:style {:width (bound (subatom this :width) ->width)}} + [:div#left-bar {:style {:width (bound (subatom this :width) ->width)}} [:div.content (bound (subatom this :active) active-content)] (vertical-grip this)])) From 172154d40152f3eadda47b57dae1bfa720640044 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Mon, 28 Jul 2014 22:32:02 -0700 Subject: [PATCH 169/656] Renames #statusbar-container -> #status-bar --- deploy/core/css/structure.css | 2 +- src/lt/objs/statusbar.cljs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index e94562b23..9ef9b9959 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -279,7 +279,7 @@ body { -webkit-user-select: none; } #bottombar.closed { padding:0; } #bottombar.closed .horizontal-grip { display:none; } -#statusbar-container { position:absolute; bottom:0; left:0; right:0; } +#status-bar { position:absolute; bottom:0; left:0; right:0; } #statusbar { position:relative; box-sizing:border-box; padding:7px 10px; vertical-align:middle;} #statusbar li { float:right; display:inline; margin-left:15px;} diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index d7fd45c38..8bacf7c7a 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -18,7 +18,7 @@ :tags #{:statusbar-container} :items (sorted-set-by #(-> % deref :order)) :init (fn [this] - [:div#statusbar-container + [:div#status-bar ])) (def container (object/create ::statusbar-container)) @@ -68,7 +68,7 @@ :height 34 :order 0 :init (fn [this] - [:ul#statusbar + [:ul#statusbar ;; @NOTE: This naming becomes awkward, can these be merged? The other containers are themselves containers around a .content, right? (map-bound #(object/->content (deref %)) this {:path [:items]})] )) From 21e3dde22061de6abf20a7e15a8b2ebf682961ec Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Mon, 28 Jul 2014 22:37:12 -0700 Subject: [PATCH 170/656] Renames #bottombar -> #bottom-bar --- deploy/core/css/skins/new-dark.css | 2 +- deploy/core/css/structure.css | 12 ++++++------ src/lt/objs/bottombar.cljs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index ae117137f..9d9fa52fc 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -118,7 +118,7 @@ input { color: var(highlight-fg); background:var(highlight-bg); } #multi .tab-close:hover { background:var(error-bg); color:var(error-fg); } #multi .tabset + .tabset { border-left:2px solid var(bg); } -#bottombar .content { background:var(bg); border-top:0px solid var(border); } +#bottom-bar .content { background:var(bg); border-top:0px solid var(border); } .console > li, .console td { color:var(accent-foreground); } .console > li + li { border-top:2px solid var(bg); } .console > li.error + li { border-color:var(bg);} diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 9ef9b9959..1541c1e3f 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -273,11 +273,11 @@ body { -webkit-user-select: none; } #right-bar .docs-search button { pointer-events:auto; } #right-bar .docs-search pre { white-space:pre-wrap; margin:5px 0;} -#bottombar { z-index:100000; position:fixed; bottom:0; right:0; background:transparent; padding-top:0px; padding-bottom:0px; box-sizing:border-box; } -#bottombar .content { padding:10px 0px; padding-right:10px; box-sizing:border-box; height:100%; } -#bottombar .horizontal-grip {position:absolute; top:0px; width:100%; height:10px; z-index:10000; cursor:row-resize; } -#bottombar.closed { padding:0; } -#bottombar.closed .horizontal-grip { display:none; } +#bottom-bar { z-index:100000; position:fixed; bottom:0; right:0; background:transparent; padding-top:0px; padding-bottom:0px; box-sizing:border-box; } +#bottom-bar .content { padding:10px 0px; padding-right:10px; box-sizing:border-box; height:100%; } +#bottom-bar .horizontal-grip {position:absolute; top:0px; width:100%; height:10px; z-index:10000; cursor:row-resize; } +#bottom-bar.closed { padding:0; } +#bottom-bar.closed .horizontal-grip { display:none; } #status-bar { position:absolute; bottom:0; left:0; right:0; } @@ -379,7 +379,7 @@ body { -webkit-user-select: none; } .animated #multi { -webkit-transition:bottom 0.1s ease-in-out, left 0.1s ease-in-out, right 0.10s ease-in-out; } .animated #multi .tabsets { -webkit-transition:bottom 0.1s ease-in-out; } -.animated #bottombar { -webkit-transition:height 0.1s ease-in-out, left 0.1s ease-in-out, right 0.1s ease-in-out; } +.animated #bottom-bar { -webkit-transition:height 0.1s ease-in-out, left 0.1s ease-in-out, right 0.1s ease-in-out; } .animated #left-bar { -webkit-transition:width 0.1s ease-in-out; } .animated #right-bar { -webkit-transition:width 0.10s ease-in-out; } .animated #find-bar { -webkit-transition:height 0.1s ease-in-out;} diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index 88a9f5913..50034e8b0 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -47,7 +47,7 @@ :height 0 :max-height default-height :init (fn [this] - [:div#bottombar {:class (bound this ->active-class) + [:div#bottom-bar {:class (bound this ->active-class) :style {:left (bound (subatom tabs/multi :left) ->px) :right (bound (subatom tabs/multi :right) ->px) :height (bound (subatom this :height) ->px)}} From c908dc84373a4e02273b4e055814905ed1669995 Mon Sep 17 00:00:00 2001 From: David Kinzer Date: Sat, 2 Aug 2014 09:56:22 -0400 Subject: [PATCH 171/656] Download via https. It's safer to download via https; specially considering there is no checksum test on the tarball to check that it's been tampered with. See: http://blog.ontoillogical.com/blog/2014/07/28/how-to-take-over-any-java-developer/ --- linux_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux_deps.sh b/linux_deps.sh index 01662feca..b99c530fa 100755 --- a/linux_deps.sh +++ b/linux_deps.sh @@ -16,7 +16,7 @@ echo "### Fetching binaries ###" BITS="" if [ $(getconf LONG_BIT) == "64" ]; then BITS="64"; fi TARBALL=LightTableLinux$BITS.tar.gz -curl -O http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/$TARBALL +curl -O https://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/$TARBALL tar -xzf $TARBALL rm $TARBALL cp -ar deploy/* LightTable From 7a6771caebbe30a4d8ba9d595a9878eb726d2d5a Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sun, 3 Aug 2014 12:09:38 +0200 Subject: [PATCH 172/656] add editor conversion --- src/lt/objs/editor.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index dc07d4873..06c183408 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -316,10 +316,10 @@ (count (line e l))) (defn +line-class [e lh plane class] - (.addLineClass e lh (name plane) (name class))) + (.addLineClass (->cm-ed e) lh (name plane) (name class))) (defn -line-class [e lh plane class] - (.removeLineClass e lh (name plane) (name class))) + (.removeLineClass (->cm-ed e) lh (name plane) (name class))) (defn show-hints [e hint-fn options] (js/CodeMirror.showHint (->cm-ed e) hint-fn (clj->js options)) From 0fa7771785ecbf6c679cd292e7a93260b0a13255 Mon Sep 17 00:00:00 2001 From: gekkoe Date: Mon, 4 Aug 2014 23:32:52 -0700 Subject: [PATCH 173/656] Note on hotkeys for OS X Some hotkeys are mentioned that are not, by default, the same on OS X. (e.g. ctrl-enter, ctrl-shift-f, possibly more). Made a note of this to help new OS X users find the correct hotkey, rather than thread the document with alternative key mappings. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9081069b5..fec8e587a 100755 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ On Windows (manual): After the initial setup, you can compile the ClojureScript source at any time with `lein cljsbuild once`. +# Note on Hotkeys for OS X + +Many (though not all) of the OS X hotkeys mentioned in the Light Table documentation use the cmd key instead of ctrl. + +When in doubt, you can look up the key sequence by name by pressing ctrl-space (yes, it's really ctrl on this one) and then typing part of the name of the command you want to use. If a key is mapped to the command, it will be printed right below the command name in the command bar. + # Workflow I'll assume you already know how to eval code (ctrl-enter), how to open the command bar (ctrl-space) and how to open files with the navigator (ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). @@ -69,7 +75,7 @@ Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_st The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. -For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f or cmd-shift-f on Mac). If it isn't clear how to use a given function then using the searcher to find examples will also help. +For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. Finally, use the documentation searcher (ctrl-shift-d) for full-text search over the names and docstrings of all known vars. Most of Light Table doesn't have docstrings, but this is still useful for library code. From 3c408347df19e4315c82a3fcbe1b87a82cd35673 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 5 Aug 2014 01:35:22 -0400 Subject: [PATCH 174/656] jump-stack.push should use given editor --- src/lt/objs/jump_stack.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/jump_stack.cljs b/src/lt/objs/jump_stack.cljs index 109407b15..375ae6af1 100644 --- a/src/lt/objs/jump_stack.cljs +++ b/src/lt/objs/jump_stack.cljs @@ -18,7 +18,7 @@ :triggers #{:jump-stack.push!} :reaction (fn [jump-stack editor file pos] (let [old-file (:path (:info @editor)) - old-pos (editor/->cursor (lt.objs.editor.pool/last-active))] + old-pos (editor/->cursor editor)] (if-not (files/exists? file) (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) (do (jump-to file pos) From 88144405502b559f788e98d309d170689619482d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 5 Aug 2014 22:32:32 -0400 Subject: [PATCH 175/656] editor.jump-to should only call jump-to once --- src/lt/objs/jump_stack.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lt/objs/jump_stack.cljs b/src/lt/objs/jump_stack.cljs index 375ae6af1..dbfa4ca33 100644 --- a/src/lt/objs/jump_stack.cljs +++ b/src/lt/objs/jump_stack.cljs @@ -60,5 +60,4 @@ :hidden true :exec (fn [file pos] (when-let [ed (lt.objs.editor.pool/last-active)] - (object/raise jump-stack :jump-stack.push! ed file pos)) - (jump-to file pos))}) + (object/raise jump-stack :jump-stack.push! ed file pos)))}) From 7e8e211f3c99e3f7bbb0d7e86a4ffeea6d055a31 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 6 Aug 2014 01:25:10 -0400 Subject: [PATCH 176/656] Opening an already open path creates a linked doc Addresses #884 --- src/lt/objs/document.cljs | 10 ++++++++-- src/lt/objs/opener.cljs | 37 +++++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 8e8b9fd16..404844ba6 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -67,7 +67,7 @@ (defn create-sub ([doc] (create-sub doc nil)) ([doc info] - (let [neue (create (merge (select-keys @doc doc-keys) info {:doc (linked* (:doc doc) info) + (let [neue (create (merge (select-keys @doc doc-keys) info {:doc (linked* doc info) :root doc}))] (object/add-tags neue [:document.linked]) (object/update! doc [:sub-docs] conj neue)))) @@ -133,7 +133,6 @@ (object/update! manager [:files] assoc path doc)) (defn open [path cb] - ;;TODO: check if the file is already open? (files/open path (fn [data] (let [d (create {:content (:content data) :line-ending (:line-ending data) @@ -144,6 +143,13 @@ (cb d))))) ) +(defn linked-open [ed ldoc-options path cb] + (create-sub (:doc @ed) ldoc-options) + (files/open path (fn [data] + (let [d (-> @ed :doc deref :sub-docs last)] + (when cb + (cb d)))))) + (defn check-mtime [prev updated] (if prev (= (.getTime (.-mtime prev)) (.getTime (.-mtime updated))) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index a967f2d04..2adc5d721 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -113,19 +113,28 @@ (tabs/add! ed) (tabs/active! ed)))) -(defn open-path - "Always open a path given an ::opener object and path" - [obj path] - (doc/open path - (fn [doc] - (let [type (files/path->type path) - ed (pool/create (merge {:doc doc :line-ending (-> @doc :line-ending)} (lt.objs.opener/path->info path)))] - (metrics/capture! :editor.open {:type (or (:name type) (files/ext path)) - :lines (editor/last-line ed)}) - (object/add-tags ed [:editor.file-backed]) - (object/raise obj :open ed) - (lt.objs.tabs/add! ed) - (lt.objs.tabs/active! ed))))) +(defn open-path* + [doc-fn obj path] + (doc-fn path + (fn [doc] + (let [type (files/path->type path) + ed (pool/create (merge {:doc doc :line-ending (-> @doc :line-ending)} (path->info path)))] + (metrics/capture! :editor.open {:type (or (:name type) (files/ext path)) + :lines (editor/last-line ed)}) + (object/add-tags ed [:editor.file-backed]) + (object/raise obj :open ed) + (lt.objs.tabs/add! ed) + (lt.objs.tabs/active! ed))))) + +(def open-path + "Open a path given an ::opener object and path" + (partial open-path* doc/open)) + +(defn open-linked-path + "Open a path as a linked doc given the editor with the document to be linked to." + [ed obj path ldoc-options] + (open-path* (partial doc/linked-open ed ldoc-options) obj path)) + (behavior ::open-standard-editor :triggers #{:open!} @@ -135,7 +144,7 @@ (notifos/set-msg! (str "Cannot open a directory: " path)) (notifos/set-msg! (str "No such file: " path))) (if-let [ed (first (pool/by-path path))] - (tabs/active! ed) + (open-linked-path ed obj path {}) (open-path obj path))))) (behavior ::track-open-files From 6b80b12d910ea393a665c430d601281f682d60e9 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Thu, 14 Aug 2014 18:52:56 -0700 Subject: [PATCH 177/656] Renames #statusbar -> #status --- deploy/core/css/skins/new-dark.css | 14 +++--- deploy/core/css/structure.css | 14 +++--- deploy/settings/default/default.behaviors | 2 +- src/lt/objs/statusbar.cljs | 57 ++++++++++++----------- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 9d9fa52fc..f0a057669 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -212,13 +212,13 @@ input { color: var(highlight-fg); background:var(highlight-bg); } #right-bar .clients .connector li:hover h2 {color: var(highlight-fg); } #right-bar .clients .connector li:hover {background: var(highlight-bg); color: var(fg); border-color: var(pane-border); } -#statusbar { color: var(hidden-fg); } -#statusbar .console-toggle { cursor:default; background:var(hidden-bg); color:var(fg); min-width:12px; padding:0 4px; width:auto; display:none; text-align:center; margin-left:0px; border-radius:2px; } -#statusbar .console-toggle:hover { background:var(dark-highlight-bg); color:var(highlight-fg); } -#statusbar .console-toggle.dirty { background:var(accent-background); color:var(accent-foreground); display: inline-block; } -#statusbar .console-toggle.error { color:var(error-fg); background:var(error-bg); } -#statusbar .log .error { color:var(error-fg); background:var(error-bg); } -#statusbar .log .tip { color: var(accent-foreground); } +#status { color: var(hidden-fg); } +#status .console-toggle { cursor:default; background:var(hidden-bg); color:var(fg); min-width:12px; padding:0 4px; width:auto; display:none; text-align:center; margin-left:0px; border-radius:2px; } +#status .console-toggle:hover { background:var(dark-highlight-bg); color:var(highlight-fg); } +#status .console-toggle.dirty { background:var(accent-background); color:var(accent-foreground); display: inline-block; } +#status .console-toggle.error { color:var(error-fg); background:var(error-bg); } +#status .log .error { color:var(error-fg); background:var(error-bg); } +#status .log .tip { color: var(accent-foreground); } #find-bar input { border-top:2px solid var(bg); background:var(multi); } #find-bar input + input { border-left:2px solid var(bg); } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 1541c1e3f..387cf1eb2 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -281,13 +281,13 @@ body { -webkit-user-select: none; } #status-bar { position:absolute; bottom:0; left:0; right:0; } -#statusbar { position:relative; box-sizing:border-box; padding:7px 10px; vertical-align:middle;} -#statusbar li { float:right; display:inline; margin-left:15px;} -#statusbar li.left { float:left; margin-left:0;} -#statusbar li.left + li.left { float:left; margin-left:5px;} -#statusbar .log img { vertical-align:middle; } -#statusbar .log .message { max-width: 80vw; display:inline-block; overflow:hidden; vertical-align:middle; white-space:nowrap; margin-left:0px; padding:0px 5px; border-radius:2px; } -#statusbar .pos { display:inline-block; min-width:0px; text-align:right;} +#status { position:relative; box-sizing:border-box; padding:7px 10px; vertical-align:middle;} +#status li { float:right; display:inline; margin-left:15px;} +#status li.left { float:left; margin-left:0;} +#status li.left + li.left { float:left; margin-left:5px;} +#status .log img { vertical-align:middle; } +#status .log .message { max-width: 80vw; display:inline-block; overflow:hidden; vertical-align:middle; white-space:nowrap; margin-left:0px; padding:0px 5px; border-radius:2px; } +#status .pos { display:inline-block; min-width:0px; text-align:right;} .load-wrapper { display:inline-block; height:18px; width:20px; vertical-align:middle; margin-right:5px; } .load-wrapper .img { display:inline-block; width:17px; height:17px; vertical-align:middle; } diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c08511b0e..03d2aab51 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -390,7 +390,7 @@ :statusbar-container-item [:lt.objs.statusbar/on-show! :lt.objs.statusbar/on-hide! :lt.objs.statusbar/init-statusbar-container] - :statusbar.console-toggle [:lt.objs.console/statusbar-console-toggle + :status.console-toggle [:lt.objs.console/statusbar-console-toggle :lt.objs.console/statusbar-console-hide :lt.objs.console/statusbar-console-show] :tab-label [:lt.objs.menu/menu! diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index 8bacf7c7a..acee9aca0 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -60,31 +60,32 @@ ;; statusbar ;;********************************************************** -(defui statusbar-item [content class] +(defui status-item [content class] [:li {:class class} content]) -(object/object* ::statusbar +(object/object* ::status :items [] :height 34 :order 0 :init (fn [this] - [:ul#statusbar ;; @NOTE: This naming becomes awkward, can these be merged? The other containers are themselves containers around a .content, right? + [:ul#status (map-bound #(object/->content (deref %)) this {:path [:items]})] )) -(def statusbar (object/create ::statusbar)) +(def status (object/create ::status)) -(add-container statusbar) +(add-container status) +;; @FIXME: Should we rename to `::show-status` ? (behavior ::show-statusbar - :desc "App: Show statusbar at the bottom of the editor" + :desc "App: Show status at the bottom of the editor" :type :user :triggers #{:init} :reaction (fn [this] - (object/raise statusbar :show!))) + (object/raise status :show!))) -(defn add-statusbar-item [item] - (object/update! statusbar [:items] conj item)) +(defn add-status-item [item] + (object/update! status [:items] conj item)) ;;********************************************************** ;; cursor @@ -98,21 +99,21 @@ :reaction (fn [this pos] (object/merge! this {:pos pos}))) -(object/object* ::statusbar.cursor +(object/object* ::status.cursor :triggers #{} :behaviors #{::update-cursor-location} :pos {:line 0 :ch 0} :init (fn [this] - (statusbar-item (bound this ->cursor-str) "") + (status-item (bound this ->cursor-str) "") )) (behavior ::report-cursor-location :triggers #{:move :active} :reaction (fn [this] - (object/raise statusbar-cursor :update! (ed/->cursor this)))) + (object/raise status-cursor :update! (ed/->cursor this)))) -(def statusbar-cursor (object/create ::statusbar.cursor)) -(add-statusbar-item statusbar-cursor) +(def status-cursor (object/create ::status.cursor)) +(add-status-item status-cursor) ;;********************************************************** ;; loader @@ -147,26 +148,26 @@ [:span {:class (bound this #(-> % :class ->message-class))} (bound this :message)] ]) -(object/object* ::statusbar.loader - :tags #{:statusbar.console} +(object/object* ::status.loader + :tags #{:status.console} :loaders 0 :message "" :init (fn [this] - (statusbar-item (log this) "left") + (status-item (log this) "left") )) (defn loader-set [] - (object/merge! statusbar-loader {:loaders 0})) + (object/merge! status-loader {:loaders 0})) (defn loader-inc [] - (object/update! statusbar-loader [:loaders] inc)) + (object/update! status-loader [:loaders] inc)) (defn loader-dec [] - (if (> (:loaders @statusbar-loader) 0) - (object/update! statusbar-loader [:loaders] dec))) + (if (> (:loaders @status-loader) 0) + (object/update! status-loader [:loaders] dec))) -(def statusbar-loader (object/create ::statusbar.loader)) -(add-statusbar-item statusbar-loader) +(def status-loader (object/create ::status.loader)) +(add-status-item status-loader) ;;********************************************************** ;; console list @@ -191,11 +192,11 @@ (defn console-class [class] (object/merge! console-toggle {:class class})) -(object/object* ::statusbar.console-toggle +(object/object* ::status.console-toggle :dirty 0 - :tags [:statusbar.console-toggle] + :tags [:status.console-toggle] :init (fn [this] - (statusbar-item (toggle-span this)))) + (status-item (toggle-span this)))) -(def console-toggle (object/create ::statusbar.console-toggle)) -(add-statusbar-item console-toggle) +(def console-toggle (object/create ::status.console-toggle)) +(add-status-item console-toggle) From a6a96a18b19725d6ec30ef2cf51c062fc502ac9c Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Thu, 14 Aug 2014 21:19:07 -0700 Subject: [PATCH 178/656] gst --- deploy/settings/default/default.behaviors | 6 +++--- src/lt/objs/statusbar.cljs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 03d2aab51..ca52d8619 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -56,7 +56,7 @@ :lt.objs.plugins/plugin-behavior-diffs :lt.objs.plugins/plugin-keymap-diffs :lt.objs.plugins/behaviors.refreshed-load-keys - :lt.objs.statusbar/init-statusbar-container + :lt.objs.statusbar/init-statusbar :lt.objs.statusbar/show-statusbar :lt.objs.workspace/init-workspace-cache-dir :lt.objs.metrics/init-metrics @@ -387,9 +387,9 @@ :lt.objs.sidebar.workspace/recent.delete! :lt.objs.sidebar.workspace/recent.select!] :skin-selector [:lt.objs.style/set-skin-on-select] - :statusbar-container-item [:lt.objs.statusbar/on-show! + :statusbar-item [:lt.objs.statusbar/on-show! :lt.objs.statusbar/on-hide! - :lt.objs.statusbar/init-statusbar-container] + :lt.objs.statusbar/init-statusbar] :status.console-toggle [:lt.objs.console/statusbar-console-toggle :lt.objs.console/statusbar-console-hide :lt.objs.console/statusbar-console-show] diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index acee9aca0..326c307ec 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -14,21 +14,21 @@ ;; statusbar container ;;********************************************************** -(object/object* ::statusbar-container - :tags #{:statusbar-container} +(object/object* ::statusbar + :tags #{:statusbar} :items (sorted-set-by #(-> % deref :order)) :init (fn [this] [:div#status-bar ])) -(def container (object/create ::statusbar-container)) +(def container (object/create ::statusbar)) (defn add-container "Add an object to the statusbar container. When you wish the object to be displayed or hidden, raise :show! or :hide! respectively. Objects must have :order and :height keys in order to determine the space required for the object." [obj] - (object/add-tags obj [:statusbar-container-item]) + (object/add-tags obj [:statusbar-item]) (object/update! container [:items] conj obj) (let [i (cljs/index-of obj (:items @container))] (if (= i 0) @@ -51,7 +51,7 @@ (object/merge! this {::shown false}) (object/raise tabs/multi :tabset-bottom! (- (:height @this)))))) -(behavior ::init-statusbar-container +(behavior ::init-statusbar :triggers #{:init} :reaction (fn [app] (dom/append (object/->content tabs/multi) (object/->content container)))) From af2b058b2b39a452f4fa60cbddc90628eebf5a33 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Fri, 15 Aug 2014 09:01:15 -0700 Subject: [PATCH 179/656] Renames statusbar -> status-bar in files, ns, and symbols --- deploy/settings/default/default.behaviors | 12 ++++----- src/lt/objs/console.cljs | 27 ++++++++++--------- src/lt/objs/find.cljs | 4 +-- src/lt/objs/notifos.cljs | 14 +++++----- .../objs/{statusbar.cljs => status_bar.cljs} | 16 +++++------ 5 files changed, 38 insertions(+), 35 deletions(-) rename src/lt/objs/{statusbar.cljs => status_bar.cljs} (95%) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index ca52d8619..335579b1f 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -56,8 +56,8 @@ :lt.objs.plugins/plugin-behavior-diffs :lt.objs.plugins/plugin-keymap-diffs :lt.objs.plugins/behaviors.refreshed-load-keys - :lt.objs.statusbar/init-statusbar - :lt.objs.statusbar/show-statusbar + :lt.objs.status-bar/init-statusbar + :lt.objs.status-bar/show-statusbar :lt.objs.workspace/init-workspace-cache-dir :lt.objs.metrics/init-metrics (:lt.objs.keyboard/chord-timeout 1000) @@ -186,7 +186,7 @@ :lt.plugins.auto-complete/remove-on-scroll-inactive :lt.plugins.auto-complete/auto-show-on-input ] - :editor.active [:lt.objs.statusbar/report-cursor-location] + :editor.active [:lt.objs.status-bar/report-cursor-location] :editor.force.wrap [:lt.objs.editor/wrap] :editor.force.unwrap [:lt.objs.editor/no-wrap] :editor.behaviors [:lt.objs.settings/on-behaviors-editor-save @@ -387,9 +387,9 @@ :lt.objs.sidebar.workspace/recent.delete! :lt.objs.sidebar.workspace/recent.select!] :skin-selector [:lt.objs.style/set-skin-on-select] - :statusbar-item [:lt.objs.statusbar/on-show! - :lt.objs.statusbar/on-hide! - :lt.objs.statusbar/init-statusbar] + :status-bar-item [:lt.objs.status-bar/on-show! + :lt.objs.status-bar/on-hide! + :lt.objs.status-bar/init-statusbar] :status.console-toggle [:lt.objs.console/statusbar-console-toggle :lt.objs.console/statusbar-console-hide :lt.objs.console/statusbar-console-show] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 268762505..99815450f 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -4,7 +4,7 @@ [lt.objs.files :as files] [lt.objs.bottombar :as bottombar] [lt.objs.command :as cmd] - [lt.objs.statusbar :as statusbar] + [lt.objs.status-bar :as status-bar] [lt.objs.tabs :as tabs] [clojure.string :as string] [lt.util.dom :refer [$ append empty] :as dom]) @@ -75,7 +75,7 @@ (when (> (count (dom/children $console)) (dec console-limit)) (dom/remove (aget (dom/children $console) 0))) (when-not (bottombar/active? console) - (statusbar/dirty)) + (status-bar/dirty)) (append $console msg)) (defn verbatim [thing class str-content] @@ -83,7 +83,7 @@ (when str-content (write-to-log str-content)) (when class - (statusbar/console-class class)) + (status-bar/console-class class)) (write $console (->item thing class)) (dom/scroll-top $console 10000000000) nil)) @@ -124,7 +124,7 @@ nil)))) (defn error [e] - (statusbar/console-class "error") + (status-bar/console-class "error") (log (str (if (.-stack e) (.-stack e) (let [pr-e (pr-str e)] @@ -166,24 +166,27 @@ (cmd/exec! :toggle-console) (cmd/exec! :console-tab))})))) +;; @FIXME: rename to status-bar ? (behavior ::statusbar-console-toggle :triggers #{:toggle} :reaction (fn [this] (object/raise bottombar/bottombar :toggle console) (when (bottombar/active? console) (dom/scroll-top (object/->content console) 10000000000) - (statusbar/clean)) + (status-bar/clean)) )) +;; @FIXME: rename to status-bar ? (behavior ::statusbar-console-show :triggers #{:show!} :reaction (fn [this] (object/raise bottombar/bottombar :show! console) (when (bottombar/active? console) (dom/scroll-top (object/->content console) 10000000000) - (statusbar/clean)) + (status-bar/clean)) )) +;; @FIXME: rename to status-bar ? (behavior ::statusbar-console-hide :triggers #{:hide!} :reaction (fn [this] @@ -196,7 +199,7 @@ :desc "Console: Open the console in a tab" :exec (fn [] (when (not= :tab (:current-ui @console)) ; Running the command when tab is already opened in a tab was creating another new tab each time. - (object/raise statusbar/console-toggle :hide!) + (object/raise status-bar/console-toggle :hide!) (object/merge! console {:current-ui :tab}) (tabs/add! console) ))}) @@ -207,8 +210,8 @@ :hidden true :exec (fn [] (if (= (:current-ui @console) :tab) - (do (tabs/active! console) (statusbar/clean)) - (object/raise statusbar/console-toggle :show!)))}) + (do (tabs/active! console) (status-bar/clean)) + (object/raise status-bar/console-toggle :show!)))}) (cmd/command {:command :console.hide :desc "Console: Hide console" @@ -216,14 +219,14 @@ :exec (fn [] (if (= (:current-ui @console) :tab) (object/raise console :close) - (object/raise statusbar/console-toggle :hide!)))}) + (object/raise status-bar/console-toggle :hide!)))}) (cmd/command {:command :toggle-console :desc "Console: Toggle console" :exec (fn [] (if (= (:current-ui @console) :tab) - (do (tabs/active! console) (statusbar/clean)) - (object/raise statusbar/console-toggle :toggle)))}) + (do (tabs/active! console) (status-bar/clean)) + (object/raise status-bar/console-toggle :toggle)))}) (cmd/command {:command :clear-console :desc "Console: Clear console" diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index c2f408437..62f878780 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -1,7 +1,7 @@ (ns lt.objs.find (:require [lt.object :as object] [lt.objs.context :as ctx] - [lt.objs.statusbar :as statusbar] + [lt.objs.status-bar :as status-bar] [lt.util.load :as load] [lt.objs.canvas :as canvas] [lt.objs.sidebar.command :as cmd] @@ -156,7 +156,7 @@ )) (def bar (object/create ::find-bar)) -(statusbar/add-container bar) +(status-bar/add-container bar) (cmd/command {:command :find.show :desc "Find: In current editor" diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index c25575c45..d30bf1cdf 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -1,6 +1,6 @@ (ns lt.objs.notifos (:require [lt.object :as object] - [lt.objs.statusbar :as statusbar] + [lt.objs.status-bar :as status-bar] [lt.objs.command :as cmd] [lt.util.js :refer [wait]] [crate.binding :refer [map-bound bound deref?]]) @@ -11,20 +11,20 @@ (defn working [msg] (when msg (set-msg! msg)) - (statusbar/loader-inc)) + (status-bar/loader-inc)) (defn done-working ([] - (statusbar/loader-dec)) + (status-bar/loader-dec)) ([msg] (set-msg! msg) - (statusbar/loader-dec))) + (status-bar/loader-dec))) (defn msg* [m & [opts]] (let [m (if (string? m) m (pr-str m))] - (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts)))) + (object/merge! status-bar/status-bar-loader (merge {:message m :class ""} opts)))) (defn set-msg! ([msg] @@ -38,7 +38,7 @@ standard-timeout) #(msg* ""))))) (cmd/command {:command :reset-working - :desc "Statusbar: Reset working indicator" + :desc "Status Bar: Reset working indicator" :exec (fn [] - (statusbar/loader-set 0) + (status-bar/loader-set 0) )}) diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/status_bar.cljs similarity index 95% rename from src/lt/objs/statusbar.cljs rename to src/lt/objs/status_bar.cljs index 326c307ec..2882f947b 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/status_bar.cljs @@ -1,4 +1,4 @@ -(ns lt.objs.statusbar +(ns lt.objs.status-bar (:require [lt.object :as object] [lt.objs.tabs :as tabs] [lt.objs.canvas :as canvas] @@ -11,24 +11,24 @@ (:require-macros [lt.macros :refer [behavior defui]])) ;;********************************************************** -;; statusbar container +;; status-bar container ;;********************************************************** -(object/object* ::statusbar - :tags #{:statusbar} +(object/object* ::status-bar + :tags #{:status-bar} :items (sorted-set-by #(-> % deref :order)) :init (fn [this] [:div#status-bar ])) -(def container (object/create ::statusbar)) +(def container (object/create ::status-bar)) (defn add-container - "Add an object to the statusbar container. When you wish the object to be displayed or hidden, + "Add an object to the status-bar container. When you wish the object to be displayed or hidden, raise :show! or :hide! respectively. Objects must have :order and :height keys in order to determine the space required for the object." [obj] - (object/add-tags obj [:statusbar-item]) + (object/add-tags obj [:status-bar-item]) (object/update! container [:items] conj obj) (let [i (cljs/index-of obj (:items @container))] (if (= i 0) @@ -57,7 +57,7 @@ (dom/append (object/->content tabs/multi) (object/->content container)))) ;;********************************************************** -;; statusbar +;; status ;;********************************************************** (defui status-item [content class] From 4c6bd42fc9529a5a060f0a9a284016efc2ce760e Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Sat, 16 Aug 2014 12:24:15 -0700 Subject: [PATCH 180/656] Renames statusbar behaviors -> status-bar --- deploy/settings/default/default.behaviors | 12 ++++++------ src/lt/objs/console.cljs | 6 +++--- src/lt/objs/status_bar.cljs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 335579b1f..d0ff6e9ea 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -56,8 +56,8 @@ :lt.objs.plugins/plugin-behavior-diffs :lt.objs.plugins/plugin-keymap-diffs :lt.objs.plugins/behaviors.refreshed-load-keys - :lt.objs.status-bar/init-statusbar - :lt.objs.status-bar/show-statusbar + :lt.objs.status-bar/init-status-bar + :lt.objs.status-bar/show-status-bar :lt.objs.workspace/init-workspace-cache-dir :lt.objs.metrics/init-metrics (:lt.objs.keyboard/chord-timeout 1000) @@ -389,10 +389,10 @@ :skin-selector [:lt.objs.style/set-skin-on-select] :status-bar-item [:lt.objs.status-bar/on-show! :lt.objs.status-bar/on-hide! - :lt.objs.status-bar/init-statusbar] - :status.console-toggle [:lt.objs.console/statusbar-console-toggle - :lt.objs.console/statusbar-console-hide - :lt.objs.console/statusbar-console-show] + :lt.objs.status-bar/init-status-bar] + :status.console-toggle [:lt.objs.console/status-bar-console-toggle + :lt.objs.console/status-bar-console-hide + :lt.objs.console/status-bar-console-show] :tab-label [:lt.objs.menu/menu! :lt.objs.tabs/tab-label-menu+ :lt.objs.tabs/on-close-tab-label] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 99815450f..591d31afc 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -167,7 +167,7 @@ (cmd/exec! :console-tab))})))) ;; @FIXME: rename to status-bar ? -(behavior ::statusbar-console-toggle +(behavior ::status-bar-console-toggle :triggers #{:toggle} :reaction (fn [this] (object/raise bottombar/bottombar :toggle console) @@ -177,7 +177,7 @@ )) ;; @FIXME: rename to status-bar ? -(behavior ::statusbar-console-show +(behavior ::status-bar-console-show :triggers #{:show!} :reaction (fn [this] (object/raise bottombar/bottombar :show! console) @@ -187,7 +187,7 @@ )) ;; @FIXME: rename to status-bar ? -(behavior ::statusbar-console-hide +(behavior ::status-bar-console-hide :triggers #{:hide!} :reaction (fn [this] (object/raise bottombar/bottombar :hide! console))) diff --git a/src/lt/objs/status_bar.cljs b/src/lt/objs/status_bar.cljs index 2882f947b..bffd971f5 100644 --- a/src/lt/objs/status_bar.cljs +++ b/src/lt/objs/status_bar.cljs @@ -51,7 +51,7 @@ (object/merge! this {::shown false}) (object/raise tabs/multi :tabset-bottom! (- (:height @this)))))) -(behavior ::init-statusbar +(behavior ::init-status-bar :triggers #{:init} :reaction (fn [app] (dom/append (object/->content tabs/multi) (object/->content container)))) @@ -77,7 +77,7 @@ (add-container status) ;; @FIXME: Should we rename to `::show-status` ? -(behavior ::show-statusbar +(behavior ::show-status-bar :desc "App: Show status at the bottom of the editor" :type :user :triggers #{:init} From d2a96269bc16e42be5f87714331e818882d6a138 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 19 Aug 2014 13:42:04 -0700 Subject: [PATCH 181/656] fix final diff-ordering for plugins Signed-off-by: Chris Granger --- deploy/core/LightTable.html | 1 - src/lt/object.cljs | 4 ++-- src/lt/objs/settings.cljs | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/deploy/core/LightTable.html b/deploy/core/LightTable.html index 6a58376a8..2f76b1888 100644 --- a/deploy/core/LightTable.html +++ b/deploy/core/LightTable.html @@ -50,4 +50,3 @@ - diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 057234c93..37fe4889e 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -331,14 +331,14 @@ (defn tag-behaviors [tag behs] (swap! tags update-in [tag] #(reduce conj - (or % '()) + (or % []) behs)) (doseq [cur (by-tag tag)] (refresh! cur)) (@tags tag)) (defn remove-tag-behaviors [tag behs] - (swap! tags update-in [tag] #(remove (set behs) (or % '()))) + (swap! tags update-in [tag] #(remove (set behs) (or % []))) (doseq [cur (by-tag tag) b behs] (rem-behavior! cur b))) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ea260cd0d..2537ea37b 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -31,7 +31,7 @@ (defn +behaviors [cur m] (assoc cur :+ (reduce (fn [res [k v]] - (update-in res [k] #(apply conj (or % '()) v))) + (update-in res [k] #(apply conj (or % []) v))) (:+ cur) m))) @@ -42,7 +42,7 @@ (:+ cur) m) :- (reduce (fn [res [k v]] - (update-in res [k] #(apply conj (or % '()) v))) + (update-in res [k] #(apply conj (or % []) v))) (:- cur) m))) From d37e58eb1a2aaee085faa9e6f51d32377f8d64b1 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 19 Aug 2014 13:45:21 -0700 Subject: [PATCH 182/656] undo the ordering change. Signed-off-by: Chris Granger --- src/lt/object.cljs | 4 ++-- src/lt/objs/settings.cljs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 37fe4889e..057234c93 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -331,14 +331,14 @@ (defn tag-behaviors [tag behs] (swap! tags update-in [tag] #(reduce conj - (or % []) + (or % '()) behs)) (doseq [cur (by-tag tag)] (refresh! cur)) (@tags tag)) (defn remove-tag-behaviors [tag behs] - (swap! tags update-in [tag] #(remove (set behs) (or % []))) + (swap! tags update-in [tag] #(remove (set behs) (or % '()))) (doseq [cur (by-tag tag) b behs] (rem-behavior! cur b))) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 2537ea37b..ea260cd0d 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -31,7 +31,7 @@ (defn +behaviors [cur m] (assoc cur :+ (reduce (fn [res [k v]] - (update-in res [k] #(apply conj (or % []) v))) + (update-in res [k] #(apply conj (or % '()) v))) (:+ cur) m))) @@ -42,7 +42,7 @@ (:+ cur) m) :- (reduce (fn [res [k v]] - (update-in res [k] #(apply conj (or % []) v))) + (update-in res [k] #(apply conj (or % '()) v))) (:- cur) m))) From 4e3fc2642b5e46e1a3189c354a6c598d640d3114 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 19 Aug 2014 13:51:58 -0700 Subject: [PATCH 183/656] remove the reverse call in plugin diff ordering Signed-off-by: Chris Granger --- src/lt/objs/plugins.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index d49db71fc..50f008b09 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -601,7 +601,6 @@ dep-graph (plugin-dependency-graph plugins) dep-ordered (-> dep-graph (kahn/kahn-sort) - (reverse) (seq)) mapped (if dep-ordered (map plugins dep-ordered) From e601c7650df395a840b57dd1941b95483f5f8374 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 19 Aug 2014 13:52:22 -0700 Subject: [PATCH 184/656] fix bug with status-bar rename Signed-off-by: Chris Granger --- src/lt/objs/notifos.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index d30bf1cdf..e5f18ff0d 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -24,7 +24,7 @@ (let [m (if (string? m) m (pr-str m))] - (object/merge! status-bar/status-bar-loader (merge {:message m :class ""} opts)))) + (object/merge! status-bar/status-loader (merge {:message m :class ""} opts)))) (defn set-msg! ([msg] From 0ea6cf8c171e6e73a601a1875a431e684524d876 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 19 Aug 2014 14:24:04 -0700 Subject: [PATCH 185/656] prevent behaviors from getting reverse ordered when converted to triggers Signed-off-by: Chris Granger --- src/lt/object.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 057234c93..32096a340 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -35,7 +35,7 @@ (let [result (atom (transient {}))] (doseq [beh behs t (:triggers (->behavior beh))] - (swap! result assoc! t (conj (or (get @result t) []) beh))) + (swap! result assoc! t (conj (or (get @result t) '()) beh))) (persistent! @result))) (defn specificity-sort [xs dir] From 791b636a0f8a242cc62c10a2c9da61ac5222c4e8 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 20 Aug 2014 10:27:50 -0700 Subject: [PATCH 186/656] prevent errors without lines from throwing Signed-off-by: Chris Granger --- src/lt/objs/eval.cljs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 7d457d191..68c47cf48 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -433,13 +433,14 @@ :triggers #{:click :double-click :clear!} :tags #{:inline :inline.exception} :init (fn [this info] - (let [content (->inline-exception this info)] - (object/merge! this (assoc info - :widget (ed/line-widget (ed/->cm-ed (:ed info)) - (-> info :loc :line) - content - {:coverGutter false}))) - content))) + (when (-> info :loc :line) + (let [content (->inline-exception this info)] + (object/merge! this (assoc info + :widget (ed/line-widget (ed/->cm-ed (:ed info)) + (-> info :loc :line) + content + {:coverGutter false}))) + content)))) (behavior ::inline-exceptions :triggers #{:editor.exception} From 2dd5b251b436cfeac83e92857f4ac443629a9c58 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 20 Aug 2014 10:28:42 -0700 Subject: [PATCH 187/656] show a notification if you can't show the error Signed-off-by: Chris Granger --- src/lt/objs/eval.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 68c47cf48..c2b9d57e9 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -433,7 +433,8 @@ :triggers #{:click :double-click :clear!} :tags #{:inline :inline.exception} :init (fn [this info] - (when (-> info :loc :line) + (if-not (-> info :loc :line) + (notifos/set-msg! (str ex) {:class "error"}) (let [content (->inline-exception this info)] (object/merge! this (assoc info :widget (ed/line-widget (ed/->cm-ed (:ed info)) From 2aa7e62ab6af32ca38f66e454bc37cdb5e8bdfae Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Fri, 22 Aug 2014 09:30:38 +1000 Subject: [PATCH 188/656] Add duplicate file option to workspace files --- deploy/settings/default/default.behaviors | 1 + src/lt/objs/sidebar/workspace.cljs | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d0ff6e9ea..c80b18960 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -416,6 +416,7 @@ :tree-item [:lt.objs.sidebar.workspace/rename-submit :lt.objs.sidebar.workspace/rename-focus :lt.objs.sidebar.workspace/start-rename + :lt.objs.sidebar.workspace/duplicate :lt.objs.sidebar.workspace/rename-cancel :lt.objs.sidebar.workspace/rename-blur] :version [:lt.objs.version/destroy-on-close diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 914cbfdb2..b7c880826 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -201,11 +201,15 @@ (behavior ::subfile-menu :triggers #{:menu-items} :reaction (fn [this items] - (conj items {:label "Rename" - :order 1 - :click (fn [] (object/raise this :start-rename!))} - {:label "Delete" + (conj items + {:label "Duplicate" + :order 1 + :click (fn [] (object/raise this :duplicate!))} + {:label "Rename" :order 2 + :click (fn [] (object/raise this :start-rename!))} + {:label "Delete" + :order 3 :click (fn [] (object/raise this :delete!))}))) (behavior ::subfolder-menu @@ -369,6 +373,14 @@ (object/merge! this {:renaming? false}) )) +(behavior ::duplicate + :triggers #{:duplicate!} + :reaction (fn [this] + (let [base-name (files/without-ext (files/basename (:path @this))) + new-name (str base-name " copy." (files/ext (:path @this))) + new-path (files/join (files/parent (:path @this)) new-name)] + (files/copy (:path @this) new-path)))) + (behavior ::destroy-sub-tree :trigger #{:destroy} :reaction (fn [this] From 03b247056da9d149810c3adc6b08a241e64f640b Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 22 Aug 2014 14:23:32 +0100 Subject: [PATCH 189/656] add after option to replace-selection --- src/lt/objs/editor.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 06c183408..fb430f065 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -234,8 +234,8 @@ (defn set-extending [e ext?] (.setExtending (->cm-ed e) ext?)) -(defn replace-selection [e neue] - (.replaceSelection (->cm-ed e) neue "end" "+input")) +(defn replace-selection [e neue & [after]] + (.replaceSelection (->cm-ed e) neue (name (or after :end)) "+input")) (defn undo [e] (.undo (->cm-ed e))) From fc13b8ebdd9729bf8f82fdcc6be264ccc3bece26 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 22 Aug 2014 14:24:51 +0100 Subject: [PATCH 190/656] select result when wrapping with parentheses --- src/lt/plugins/auto_paren.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index fe8235318..72b4c12d1 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -35,7 +35,7 @@ (fn [] (let [current-selection (editor/selection this)] (if-not (= current-selection "") - (editor/replace-selection this (str ch current-selection (pairs ch))) + (editor/replace-selection this (str ch current-selection (pairs ch)) :around) (if (re-seq word-char (get-char this 1)) (editor/insert-at-cursor this ch) (do From 9a500b1393a8710d9fc1fb9ada604f002e70c5f8 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 22 Aug 2014 14:52:16 +0100 Subject: [PATCH 191/656] behave normally when there is a selection --- src/lt/plugins/auto_paren.cljs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 72b4c12d1..00678a649 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -69,12 +69,14 @@ (behavior ::try-remove-pair :triggers #{:backspace!} :reaction (fn [this] - (let [ch (get-char this -1)] - (if (and (pairs ch) - (= (get-char this 1) (pairs ch))) - (let [loc (editor/->cursor this)] - (editor/replace this (adjust-loc loc -1) (adjust-loc loc 1) "")) - (passthrough))))) + (if-not (editor/selection? this) + (let [ch (get-char this -1)] + (if (and (pairs ch) + (= (get-char this 1) (pairs ch))) + (let [loc (editor/->cursor this)] + (editor/replace this (adjust-loc loc -1) (adjust-loc loc 1) "")) + (passthrough))) + (passthrough)))) (cmd/command {:command :editor.close-pair From 287a9b28637bc26108b9d03411fa1598293509ec Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Fri, 22 Aug 2014 23:12:44 -0700 Subject: [PATCH 192/656] Adds copy-exception BEH and menu opt --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/eval.cljs | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c80b18960..df9742c37 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -302,7 +302,8 @@ :inline.doc [:lt.plugins.doc/clear] :inline.exception [:lt.objs.eval/ex-menu! :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-clear - :lt.objs.eval/ex-shrink-on-double-click] + :lt.objs.eval/ex-shrink-on-double-click + :lt.objs.eval/copy-exception] :inline.result [:lt.objs.eval/shrink-on-double-click :lt.objs.eval/result-menu! :lt.objs.eval/expand-on-click :lt.objs.eval/clear-mark :lt.objs.eval/move-mark :lt.objs.eval/changed diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index c2b9d57e9..d7a59b097 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -424,11 +424,18 @@ :triggers #{:menu!} :reaction (fn [this ev] (-> (menu/menu [{:label "Remove exception" - :click (fn [] (object/raise this :clear!))}]) + :click (fn [] (object/raise this :clear!))} + {:label "Copy exception" + :click (fn [] (object/raise this :copy))}]) (menu/show-menu (.-clientX ev) (.-clientY ev))) (dom/prevent ev) (dom/stop-propagation ev))) +(behavior ::copy-exception + :triggers #{:copy} + :reaction (fn [this] + (platform/copy (:ex @this)))) + (object/object* ::inline-exception :triggers #{:click :double-click :clear!} :tags #{:inline :inline.exception} From ea1dc855adc8ba2e7a135061b1f56e1766fdb4bf Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Sat, 23 Aug 2014 00:07:50 -0700 Subject: [PATCH 193/656] Adds crude copy support to console --- src/lt/objs/console.cljs | 19 +++++++++++++++---- src/lt/objs/menu.cljs | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 591d31afc..5b5d44e1a 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -7,7 +7,8 @@ [lt.objs.status-bar :as status-bar] [lt.objs.tabs :as tabs] [clojure.string :as string] - [lt.util.dom :refer [$ append empty] :as dom]) + [lt.util.dom :refer [$ append empty parents] :as dom] + [lt.objs.platform :as platform]) (:require-macros [crate.def-macros :refer [defpartial]] [lt.macros :refer [behavior defui]])) @@ -32,6 +33,7 @@ (defui console-ui [this] [:ul.console] :contextmenu (fn [e] + (object/assoc-in! this [:current-event] e) (object/raise this :menu! e))) (behavior ::on-close @@ -148,20 +150,29 @@ (behavior ::menu+ :triggers #{:menu+} - :reaction (fn [this] + :reaction (fn [this items event] + (conj items {:label "Clear" :order 1 :click (fn [] (cmd/exec! :clear-console))} + {:label "Copy" + :order 2 + :click (fn [] + (let [target (.-target event) + item (if (= (.toLowerCase (.-tagName target)) "li") + target + (dom/parents target "ul.console li"))] + (platform/copy (.-textContent target))))} (when (not= :tab (:current-ui @console)) {:label "Hide console" - :order 2 + :order 3 :click (fn [] (cmd/exec! :toggle-console))}) (when (not= :tab (:current-ui @console)) {:label "Open console tab" - :order 3 + :order 4 :click (fn [] (cmd/exec! :toggle-console) (cmd/exec! :console-tab))})))) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 1e2385d96..f8e644127 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -191,7 +191,7 @@ (behavior ::menu! :triggers #{:menu!} :reaction (fn [this e] - (let [items (sort-by :order (filter identity (object/raise-reduce this :menu+ [])))] + (let [items (sort-by :order (filter identity (object/raise-reduce this :menu+ [] e)))] (-> (menu items) (show-menu (.-clientX e) (.-clientY e)))) (dom/prevent e) From 43ce996a19ff6e23d07217fffc20cc522731a4f3 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Sun, 24 Aug 2014 21:42:30 +1000 Subject: [PATCH 194/656] Add element scrollWidth accessor --- src/lt/util/dom.cljs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index c9e8937e6..53029c96d 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -149,6 +149,9 @@ (defn width [elem] (.-clientWidth elem)) +(defn scroll-width [elem] + (.-scrollWidth elem)) + (defn offset-top [elem] (.-offsetTop elem)) From 1b685134f73030e37b549cdd5af134c4f0534b45 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Sun, 24 Aug 2014 21:42:52 +1000 Subject: [PATCH 195/656] Ensure rename input is at least as wide as file name --- src/lt/objs/sidebar/workspace.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index b7c880826..845520ee2 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -343,7 +343,9 @@ :reaction (fn [this] (object/merge! this {:renaming? true}) (let [input (dom/$ :input (object/->content this)) - len (count (files/without-ext (files/basename (:path @this))))] + len (count (files/without-ext (files/basename (:path @this)))) + width (dom/scroll-width (dom/parent input))] + (dom/css input {:width width}) (dom/focus input) (dom/selection input 0 len "forward")))) From b48222fcac6908aed77b110b4e342bd324fc87f0 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Mon, 25 Aug 2014 15:28:15 -0700 Subject: [PATCH 196/656] Removes cruft code --- src/lt/objs/console.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 5b5d44e1a..cd6edbaaa 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -33,7 +33,6 @@ (defui console-ui [this] [:ul.console] :contextmenu (fn [e] - (object/assoc-in! this [:current-event] e) (object/raise this :menu! e))) (behavior ::on-close From feb7f9720354c1537626acf14b9c52a6cb9eec3d Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Mon, 25 Aug 2014 15:28:50 -0700 Subject: [PATCH 197/656] Removes useless newline --- src/lt/objs/console.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index cd6edbaaa..61695c664 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -150,7 +150,6 @@ (behavior ::menu+ :triggers #{:menu+} :reaction (fn [this items event] - (conj items {:label "Clear" :order 1 From e751d9012a0b0b97b62a1b49a34bee4e36881bb1 Mon Sep 17 00:00:00 2001 From: Sean Caffery Date: Tue, 26 Aug 2014 22:29:17 +1000 Subject: [PATCH 198/656] Set width of sidebar items to the maximum width of their siblings --- src/lt/objs/sidebar/workspace.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 845520ee2..aab0b5e59 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -67,7 +67,11 @@ (object/merge! this {:open? true}) (when-not (:realized? @this) (object/merge! this {:realized? true}) - (object/merge! this (files-and-folders (:path @this)))))) + (object/merge! this (files-and-folders (:path @this))) + (let [folder (dom/$ :ul (object/->content this)) + width (dom/scroll-width folder)] + (doseq [child (dom/children folder)] + (dom/css child {:width width})))))) (behavior ::refresh :triggers #{:refresh!} From 74071d7d4076f35d366e22ef64263df0e0da35f4 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Wed, 27 Aug 2014 22:19:29 -0700 Subject: [PATCH 199/656] emacs-centric fix by moving cursor reversion into hide! --- src/lt/objs/find.cljs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 62f878780..79a11126e 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -71,8 +71,12 @@ (behavior ::hide! :triggers #{:hide!} - :reaction (fn [this] + :reaction (fn [this revert-pos] (when-let [ed (pool/last-active)] + (when revert-pos + (when-let [pos (:pos @this)] + (editor/move-cursor ed pos))) + (editor/focus ed)))) (behavior ::next! @@ -123,11 +127,12 @@ :triggers #{:search!} :debounce 50 :reaction (fn [this v] + (.log js/console "search!" v) (if (empty? v) (object/raise this :clear!) (when-let [e (pool/last-active)] - (when-let [pos (:pos @this)] - (editor/move-cursor e pos)) +;; (when-let [pos (:pos @this)] +;; (editor/move-cursor e pos)) (object/merge! this {:searching? true}) (object/merge! e {:searching.for v}) (let [ed (editor/->cm-ed e)] @@ -181,8 +186,8 @@ (cmd/command {:command :find.hide :desc "Find: Hide the find bar" - :exec (fn [] - (object/raise bar :hide!))}) + :exec (fn [revert-pos] + (object/raise bar :hide! revert-pos))}) (cmd/command {:command :find.next :desc "Find: Next find result" From dc75cc6926c402a36ab742d19b25d79eac85294a Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Wed, 27 Aug 2014 22:33:24 -0700 Subject: [PATCH 200/656] Fixes cursor trampoline with lower impact --- src/lt/objs/find.cljs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 79a11126e..da190e173 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -18,7 +18,7 @@ (defui input [this] [:input.find {:type "text" :placeholder "find"}] - :keyup (fn [] + :keydown (fn [] (this-as me (object/raise this :search! (dom/val me)))) :focus (fn [] @@ -127,12 +127,11 @@ :triggers #{:search!} :debounce 50 :reaction (fn [this v] - (.log js/console "search!" v) (if (empty? v) (object/raise this :clear!) (when-let [e (pool/last-active)] -;; (when-let [pos (:pos @this)] -;; (editor/move-cursor e pos)) + (when-let [pos (:pos @this)] + (editor/move-cursor e pos)) (object/merge! this {:searching? true}) (object/merge! e {:searching.for v}) (let [ed (editor/->cm-ed e)] From 87bbdcaa9d12472ee667b3e93685bfb84e809ac8 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Wed, 27 Aug 2014 22:37:47 -0700 Subject: [PATCH 201/656] Removes artifacts from the more invasive fix --- src/lt/objs/find.cljs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index da190e173..6e26e4727 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -71,12 +71,8 @@ (behavior ::hide! :triggers #{:hide!} - :reaction (fn [this revert-pos] + :reaction (fn [this] (when-let [ed (pool/last-active)] - (when revert-pos - (when-let [pos (:pos @this)] - (editor/move-cursor ed pos))) - (editor/focus ed)))) (behavior ::next! @@ -185,8 +181,8 @@ (cmd/command {:command :find.hide :desc "Find: Hide the find bar" - :exec (fn [revert-pos] - (object/raise bar :hide! revert-pos))}) + :exec (fn [] + (object/raise bar :hide!))}) (cmd/command {:command :find.next :desc "Find: Next find result" From 4f4427d98fb022a565770d340186b4a100df6ea2 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 29 Aug 2014 13:00:31 -0400 Subject: [PATCH 202/656] Closing a linked doc should correctly remove it from linked docs * Closing a linked-doc now removes it from root :sub-docs. This wasn't happening because a linked doc was calling close-root-document and destroying itself before it got to close-linked-document. Since it was destroyed there was no way to find its root and update its :sub-docs. * Closing a linked-doc also unlinks docs with CM. * Remove destroying root since closing a linked document should not destroy a root document which leaves it in an invalid state. --- src/lt/objs/document.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 404844ba6..31885a24e 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -42,9 +42,9 @@ :triggers #{:close.force} :reaction (fn [this] (when-let [root (:root @this)] - (object/update! root [:sub-docs] disj this) - (object/destroy! this) - (object/raise root :try-close)))) + (.unlinkDoc (:doc @this) (:doc @root)) + (object/update! root [:sub-docs] disj this)) + (object/destroy! this))) (behavior ::try-close-root-document :for #{:document} @@ -57,7 +57,8 @@ :for #{:document} :triggers #{:close.force} :reaction (fn [this] - (if (= #{::this} (:sub-docs @this)) + (if (and (= #{::this} (:sub-docs @this)) + (not (object/has-tag? this :document.linked))) (object/destroy! this) (object/update! this [:sub-docs] disj ::this)))) From 100dfb4c7f5e904b7e0f032866deca587059e3c7 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 29 Aug 2014 17:35:50 -0400 Subject: [PATCH 203/656] Add behavior to set default options for new linked docs --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/document.cljs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c08511b0e..9f3f0dc97 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -141,7 +141,8 @@ :lt.objs.menu/menu! :lt.objs.console/menu+] :context [:lt.objs.context/log] - :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document] + :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document + (:lt.objs.document/set-linked-doc-options {})] :document.linked [:lt.objs.document/close-linked-document] :docs [:lt.objs.docs/on-close-destroy] :docable [:lt.plugins.doc/editor.doc.show! diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 31885a24e..d0972198c 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -62,14 +62,26 @@ (object/destroy! this) (object/update! this [:sub-docs] disj ::this)))) +(def default-linked-doc-options {}) + +(behavior ::set-linked-doc-options + :triggers #{:object.instant} + :type :user + :exclusive true + :desc "Doc: Set default options for new linked docs" + :reaction (fn [this opts] + (set! default-linked-doc-options opts))) + (defn create [info] (object/create ::document info)) (defn create-sub ([doc] (create-sub doc nil)) ([doc info] - (let [neue (create (merge (select-keys @doc doc-keys) info {:doc (linked* doc info) - :root doc}))] + (let [info (merge default-linked-doc-options info) + neue (create (merge (select-keys @doc doc-keys) + info + {:doc (linked* doc info) :root doc}))] (object/add-tags neue [:document.linked]) (object/update! doc [:sub-docs] conj neue)))) From 58215eec478098494f4562978ebfd6f3c0a2a60a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 29 Aug 2014 19:35:15 -0400 Subject: [PATCH 204/656] Add behavior to optionally open linked doc from navigator --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/opener.cljs | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 9f3f0dc97..8a834791e 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -324,7 +324,8 @@ :lt.objs.opener/open-standard-editor :lt.objs.opener/track-open-files :lt.objs.opener/watch-on-open - :lt.objs.opener/check-read-only] + :lt.objs.opener/check-read-only + (:lt.objs.opener/existing-path-opens-linked-doc false)] :options-input [:lt.objs.sidebar.command/op-select! :lt.objs.sidebar.command/options-escape! :lt.objs.sidebar.command/op-clear! diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 2adc5d721..b507559e3 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -135,6 +135,13 @@ [ed obj path ldoc-options] (open-path* (partial doc/linked-open ed ldoc-options) obj path)) +(behavior ::existing-path-opens-linked-doc + :triggers #{:object.instant} + :type :user + :exclusive true + :desc "Doc: Open a linked document when the file is already opened" + :reaction (fn [this bool] + (object/merge! this {:open-linked-doc bool}))) (behavior ::open-standard-editor :triggers #{:open!} @@ -144,7 +151,9 @@ (notifos/set-msg! (str "Cannot open a directory: " path)) (notifos/set-msg! (str "No such file: " path))) (if-let [ed (first (pool/by-path path))] - (open-linked-path ed obj path {}) + (if (:open-linked-doc @obj) + (open-linked-path ed obj path {}) + (tabs/active! ed)) (open-path obj path))))) (behavior ::track-open-files From 6e020a68dcf234764fae5fc9453c1fae78fb8eec Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 29 Aug 2014 19:54:42 -0400 Subject: [PATCH 205/656] Use ->cm-doc where appropriate --- src/lt/objs/document.cljs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index d0972198c..393fc2410 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -14,10 +14,12 @@ (defn create* [info] (.Doc js/CodeMirror (:content info) (:mime info))) +(defn ->cm-doc [doc] + (-> @doc :doc)) + (defn linked* [doc info] - (let [{:keys [from to shared-history type]} info - cm-doc (-> @doc :doc)] - (.linkedDoc cm-doc (clj->js {:from from + (let [{:keys [from to shared-history type]} info] + (.linkedDoc (->cm-doc doc) (clj->js {:from from :to to :sharedHist shared-history :mode type})))) @@ -42,7 +44,7 @@ :triggers #{:close.force} :reaction (fn [this] (when-let [root (:root @this)] - (.unlinkDoc (:doc @this) (:doc @root)) + (.unlinkDoc (->cm-doc this) (->cm-doc root)) (object/update! root [:sub-docs] disj this)) (object/destroy! this))) @@ -85,9 +87,6 @@ (object/add-tags neue [:document.linked]) (object/update! doc [:sub-docs] conj neue)))) -(defn ->cm-doc [doc] - (-> @doc :doc)) - (defn ->snapshot [doc] (let [d (->cm-doc doc) lines (transient [])] From 2239e7b9822d3aec919f5a838c6435fdd4ccd8f4 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Sun, 31 Aug 2014 15:40:20 -0700 Subject: [PATCH 206/656] Inline result menu Update inline result behaviors to allow plugins to more easily extend the context menu. --- deploy/settings/default/default.behaviors | 3 ++- src/lt/objs/eval.cljs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c80b18960..e23fd4852 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -303,7 +303,8 @@ :inline.exception [:lt.objs.eval/ex-menu! :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-clear :lt.objs.eval/ex-shrink-on-double-click] - :inline.result [:lt.objs.eval/shrink-on-double-click :lt.objs.eval/result-menu! + :inline.result [:lt.objs.eval/shrink-on-double-click :lt.objs.menu/menu! + :lt.objs.eval/result-menu+ :lt.objs.eval/expand-on-click :lt.objs.eval/clear-mark :lt.objs.eval/move-mark :lt.objs.eval/changed :lt.objs.eval/update! diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index c2b9d57e9..262779c3b 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -189,16 +189,16 @@ (dom/prevent e) (object/raise this :double-click))) -(behavior ::result-menu! - :triggers #{:menu!} - :reaction (fn [this ev] - (-> (menu/menu [{:label "Remove result" - :click (fn [] (object/raise this :clear!))} - {:label "Copy result" - :click (fn [] (object/raise this :copy))}]) - (menu/show-menu (.-clientX ev) (.-clientY ev))) - (dom/prevent ev) - (dom/stop-propagation ev))) +(behavior ::result-menu+ + :triggers #{:menu+} + :reaction (fn [this items] + (conj items + {:label "Remove result" + :order 1 + :click (fn [] (object/raise this :clear!))} + {:label "Copy result" + :order 2 + :click (fn [] (object/raise this :copy))}))) (behavior ::expand-on-click :triggers #{:click :expand!} From 7eedc86ebc208aba493ec7a4098c8835ee4778e3 Mon Sep 17 00:00:00 2001 From: Eric Pritchett Date: Mon, 1 Sep 2014 15:30:25 -0700 Subject: [PATCH 207/656] Fix connector failing to connect When attempting to connect to a Light Table browser instance within a brand new mies (David Nolen's bare bones cljs project template) project, Light Table fails to connect. It appears that two behaviors with the same trigger :selected are executed out of order and the target object is destroyed before the second behavior has a change to execute. This commit moves the behaviors into one and formats the code. --- deploy/settings/default/default.behaviors | 2 ++ src/lt/objs/connector.cljs | 44 ++++++++++------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c80b18960..ebe797b62 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -122,6 +122,8 @@ :lt.objs.clients/try-send] :client.local [:lt.objs.clients.local/send!] :client.placeholder [:lt.objs.clients/remove-placeholder-on-swapped] + :client.selector [:lt.objs.connector/on-close! + :lt.objs.connector/on-selected] :clients [:lt.objs.clients/raise-on-object] :clients.devtools [:lt.objs.clients.devtools/clear-queue-on-connect :lt.objs.clients.devtools/console-log diff --git a/src/lt/objs/connector.cljs b/src/lt/objs/connector.cljs index b14e28c5d..919c4bdcd 100644 --- a/src/lt/objs/connector.cljs +++ b/src/lt/objs/connector.cljs @@ -5,34 +5,28 @@ [lt.objs.eval :as eval]) (:require-macros [lt.macros :refer [behavior defui]])) -(behavior ::on-selected-cb - :triggers #{:selected} - :reaction (fn [obj client] - (let [cb (@obj :cb)] - (cb client)))) - -(behavior ::on-selected-destroy - :triggers #{:selected} - :reaction (fn [this client] - (object/raise this :close!) - )) +(behavior ::on-selected + :triggers #{:selected} + :reaction (fn [this client] + (when-let [cb (:cb @this)] + (cb client)) + (object/raise this :close!))) (behavior ::on-close! - :triggers #{:close!} - :reaction (fn [this] - (object/raise (:popup @this) :close!) - (object/destroy! this) - )) + :triggers #{:close!} + :reaction (fn [this] + (object/raise (:popup @this) :close!) + (object/destroy! this) + )) (defui client-button [obj client] - [:li.button (:name @client)] - :click (fn [] - (object/raise obj :selected client) - )) + [:li.button (:name @client)] + :click (fn [] + (object/raise obj :selected client) + )) (object/object* ::client-selector - :triggers [] - :behaviors [::on-selected-cb ::on-selected-destroy ::on-close!] + :tags #{:client.selector} :init (fn [this clients cb] (object/merge! this {:cb cb :popup @@ -46,8 +40,8 @@ )) (behavior ::select-client - :triggers #{:select-client} - :reaction (fn [obj potentials cb] - (object/create ::client-selector potentials cb))) + :triggers #{:select-client} + :reaction (fn [obj potentials cb] + (object/create ::client-selector potentials cb))) (object/add-behavior! eval/evaler ::select-client) From 59e495041664e5c7ab5c9eee5c44b3a25209d0b7 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 2 Sep 2014 16:59:56 -0700 Subject: [PATCH 208/656] add keyboard/stop-commands! to prevent further commands from firing when a specific command has completely handled a keypress. This allows for explicitly shortcircuiting commands based on the order they are placed in in the keybindings definitions. Related to #1603. Signed-off-by: Chris Granger --- src/lt/objs/keyboard.cljs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 849af3af7..90623de1a 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -79,10 +79,16 @@ (or (@key-map ch) (@key-map ks) (when current [])))))) (def ^:dynamic *capture* true) +(def ^:dynamic *stop* false) (defn passthrough [] (set! *capture* false)) +(defn stop-commands! + "Called to prevent commands after the current one from firing" + [] + (set! *stop* true)) + (defn disable [] (set! capturing? false)) @@ -106,10 +112,12 @@ (defn capture [key char ev] (activity) - (binding [*capture* true] + (binding [*capture* true + *stop* false] (when-let [cs (chord|mapping key char ev)] (doseq [c cs] - (trigger c)) + (when-not *stop* + (trigger c))) *capture*))) (defn capture-up [key char ev] From ffdc40ba7e17151396cf95974d1fc8d25982dfac Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 3 Sep 2014 11:16:06 -0500 Subject: [PATCH 209/656] Add command to open current file as linked doc --- src/lt/objs/opener.cljs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index b507559e3..7ee036fa1 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -260,6 +260,12 @@ :exec (fn [info] (object/raise opener :open-info! info))}) +(cmd/command {:command :opener.open-linked-doc + :desc "Opener: Open linked document of current file" + :exec (fn [] + (let [ed (pool/last-active)] + (open-linked-path ed opener (get-in @ed [:info :path]) {})))}) + (set! js/window.ondragover (fn [e] (set! (.-dataTransfer.dropEffect e) "move") (dom/prevent e) From cda3f5098fa6034d2ba460b2f99fbcb92a64718c Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 3 Sep 2014 12:21:44 -0700 Subject: [PATCH 210/656] changed linked document command to Signed-off-by: Chris Granger --- src/lt/objs/opener.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 7ee036fa1..893601d2b 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -261,7 +261,7 @@ (object/raise opener :open-info! info))}) (cmd/command {:command :opener.open-linked-doc - :desc "Opener: Open linked document of current file" + :desc "File: Open another view of current file" :exec (fn [] (let [ed (pool/last-active)] (open-linked-path ed opener (get-in @ed [:info :path]) {})))}) From 97934efa1f8fb271eca80acef3f548edfdfafb9a Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 22 Aug 2014 17:24:41 +0100 Subject: [PATCH 211/656] initial implementation --- src/lt/plugins/auto_paren.cljs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 00678a649..7b730a0a7 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -78,6 +78,27 @@ (passthrough))) (passthrough)))) +(defn pre-cursor-indent [ed {:keys [line ch]}] + (let [tabs (editor/option ed :indentWithTabs) + unit (editor/option ed :indentUnit) + precursor (.substring (editor/line ed line) 0 ch) + whitespace (count (re-find (if tabs #"^\t*$" #"^ *$") precursor))] + [(quot whitespace unit) (mod whitespace unit)])) + +(behavior ::backspace-indent + :triggers #{:backspace!} + :reaction (fn [ed] + (if-not (or (editor/selection? ed) + (> (.-length (.getSelections (editor/->cm-ed ed))) 1)) + (let [cursor (editor/->cursor ed) + unit (editor/option ed :indentUnit) + [indent rem] (pre-cursor-indent ed cursor) + cursor (if (> rem 0) (adjust-loc (editor/->cursor ed) (- unit rem)) cursor) + [indent rem] (if (> rem 0) (pre-cursor-indent ed cursor) [indent rem])] + (if (and (> indent 0) (zero? rem)) + (editor/replace ed (adjust-loc cursor (- unit)) cursor "") + (passthrough))) + (passthrough)))) (cmd/command {:command :editor.close-pair :hidden true From d0687c9542adbe6c4bc8eb29535e650cb57647d8 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 22 Aug 2014 18:07:50 +0100 Subject: [PATCH 212/656] implement keyboard/raise --- src/lt/objs/keyboard.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 90623de1a..77fcd53c1 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -159,3 +159,10 @@ :type :user :reaction (fn [this timeout] (set! chord-timeout timeout))) + +(defn raise [obj k & args] + (loop [reactions (-> @obj :listeners k)] + (when (seq reactions) + (set! *capture* true) + (object/raise* obj [(first reactions)] args k) + (when-not *capture* (recur (rest reactions)))))) From 812196961dd7fc3b8ec46a213b89315e44d80f55 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Fri, 22 Aug 2014 18:08:27 +0100 Subject: [PATCH 213/656] use backspace-indent by default --- deploy/settings/default/default.behaviors | 1 + deploy/settings/default/default.keymap | 2 +- src/lt/plugins/auto_paren.cljs | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 71f9ef247..e95d13c38 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -170,6 +170,7 @@ :lt.plugins.auto-complete/async-hint-tokens :lt.objs.editor/copy-paste-menu+ :lt.plugins.auto-paren/try-remove-pair + :lt.plugins.auto-paren/backspace-indent :lt.plugins.auto-paren/open-pair :lt.plugins.auto-complete/show-hint :lt.objs.editor/not-read-only diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 2552a3187..7f4133653 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -29,7 +29,7 @@ "{" [(:editor.open-pair "{")] "]" [(:editor.close-pair "]")] "}" [(:editor.close-pair "}")] - "backspace" [:editor.backspace-pair]} + "backspace" [:editor.backspace]} :tabs {"pmeta-w" [:tabs.close] "pmeta-shift-[" [:tabs.prev] "pmeta-shift-]" [:tabs.next] diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 7b730a0a7..a41ef04ee 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -4,7 +4,7 @@ [lt.objs.editor :as editor] [lt.objs.editor.pool :as pool] [lt.objs.context :as ctx] - [lt.objs.keyboard :refer [passthrough]]) + [lt.objs.keyboard :as keyboard :refer [passthrough]]) (:require-macros [lt.macros :refer [behavior]])) (def pairs {\( \) @@ -118,8 +118,8 @@ :exec (fn [c] (object/raise (ctx/->obj :editor.keys.normal) :repeat-pair! c))}) -(cmd/command {:command :editor.backspace-pair +(cmd/command {:command :editor.backspace :hidden true - :desc "Editor: Pair aware backspace" + :desc "Editor: Pair and indent aware backspace" :exec (fn [c] - (object/raise (ctx/->obj :editor.keys.normal) :backspace! c))}) + (keyboard/raise (ctx/->obj :editor.keys.normal) :backspace! c))}) From ff71cdaddd370a68b92621081d88ab3209d6dfcd Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sun, 24 Aug 2014 20:38:42 +0100 Subject: [PATCH 214/656] refactor to use command + parameter --- deploy/settings/default/default.behaviors | 1 - deploy/settings/default/default.keymap | 3 +- src/lt/objs/keyboard.cljs | 7 --- src/lt/plugins/auto_paren.cljs | 58 +++++++++++++---------- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index e95d13c38..71f9ef247 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -170,7 +170,6 @@ :lt.plugins.auto-complete/async-hint-tokens :lt.objs.editor/copy-paste-menu+ :lt.plugins.auto-paren/try-remove-pair - :lt.plugins.auto-paren/backspace-indent :lt.plugins.auto-paren/open-pair :lt.plugins.auto-complete/show-hint :lt.objs.editor/not-read-only diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 7f4133653..0cf257ec1 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -29,7 +29,8 @@ "{" [(:editor.open-pair "{")] "]" [(:editor.close-pair "]")] "}" [(:editor.close-pair "}")] - "backspace" [:editor.backspace]} + "backspace" [:editor.backspace-parens + (:editor.backspace-indent true)]} :tabs {"pmeta-w" [:tabs.close] "pmeta-shift-[" [:tabs.prev] "pmeta-shift-]" [:tabs.next] diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 77fcd53c1..90623de1a 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -159,10 +159,3 @@ :type :user :reaction (fn [this timeout] (set! chord-timeout timeout))) - -(defn raise [obj k & args] - (loop [reactions (-> @obj :listeners k)] - (when (seq reactions) - (set! *capture* true) - (object/raise* obj [(first reactions)] args k) - (when-not *capture* (recur (rest reactions)))))) diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index a41ef04ee..9bbfb4e8f 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -78,28 +78,6 @@ (passthrough))) (passthrough)))) -(defn pre-cursor-indent [ed {:keys [line ch]}] - (let [tabs (editor/option ed :indentWithTabs) - unit (editor/option ed :indentUnit) - precursor (.substring (editor/line ed line) 0 ch) - whitespace (count (re-find (if tabs #"^\t*$" #"^ *$") precursor))] - [(quot whitespace unit) (mod whitespace unit)])) - -(behavior ::backspace-indent - :triggers #{:backspace!} - :reaction (fn [ed] - (if-not (or (editor/selection? ed) - (> (.-length (.getSelections (editor/->cm-ed ed))) 1)) - (let [cursor (editor/->cursor ed) - unit (editor/option ed :indentUnit) - [indent rem] (pre-cursor-indent ed cursor) - cursor (if (> rem 0) (adjust-loc (editor/->cursor ed) (- unit rem)) cursor) - [indent rem] (if (> rem 0) (pre-cursor-indent ed cursor) [indent rem])] - (if (and (> indent 0) (zero? rem)) - (editor/replace ed (adjust-loc cursor (- unit)) cursor "") - (passthrough))) - (passthrough)))) - (cmd/command {:command :editor.close-pair :hidden true :desc "Editor: Close pair character" @@ -118,8 +96,38 @@ :exec (fn [c] (object/raise (ctx/->obj :editor.keys.normal) :repeat-pair! c))}) -(cmd/command {:command :editor.backspace +(cmd/command {:command :editor.backspace-parens :hidden true - :desc "Editor: Pair and indent aware backspace" + :desc "Editor: Pair aware backspace" :exec (fn [c] - (keyboard/raise (ctx/->obj :editor.keys.normal) :backspace! c))}) + (object/raise (ctx/->obj :editor.keys.normal) :backspace! c))}) + +;; Treat spaces as tabs + +(defn pre-cursor-indent [ed {:keys [line ch]}] + (let [tabs (editor/option ed :indentWithTabs) + unit (editor/option ed :indentUnit) + precursor (.substring (editor/line ed line) 0 ch) + whitespace (count (re-find (if tabs #"^\t*$" #"^ *$") precursor))] + [(quot whitespace unit) (mod whitespace unit)])) + +(defn backspace-indent [ed] + (if-not (or (editor/selection? ed) + (> (.-length (.getSelections (editor/->cm-ed ed))) 1)) + (let [cursor (editor/->cursor ed) + unit (editor/option ed :indentUnit) + [indent rem] (pre-cursor-indent ed cursor) + cursor (if (> rem 0) (adjust-loc (editor/->cursor ed) (- unit rem)) cursor) + [indent rem] (if (> rem 0) (pre-cursor-indent ed cursor) [indent rem])] + (if (and (> indent 0) (zero? rem)) + (editor/replace ed (adjust-loc cursor (- unit)) cursor "") + (passthrough))) + (passthrough))) + +(cmd/command {:command :editor.backspace-indent + :hidden true + :desc "Editor: Indent aware backspace" + :exec (fn [second] + (when-not (and second keyboard/*capture*) + (set! keyboard/*capture* true) + (backspace-indent (ctx/->obj :editor.keys.normal))))}) From 136e3a4d507d8b9b961c81cc718b1ec9997ae451 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Wed, 3 Sep 2014 17:22:59 -0400 Subject: [PATCH 215/656] use keyboard/stop-commands! --- deploy/settings/default/default.keymap | 4 ++-- src/lt/plugins/auto_paren.cljs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 0cf257ec1..2048d6aaa 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -29,8 +29,8 @@ "{" [(:editor.open-pair "{")] "]" [(:editor.close-pair "]")] "}" [(:editor.close-pair "}")] - "backspace" [:editor.backspace-parens - (:editor.backspace-indent true)]} + "backspace" [:editor.backspace-pair + :editor.backspace-indent]} :tabs {"pmeta-w" [:tabs.close] "pmeta-shift-[" [:tabs.prev] "pmeta-shift-]" [:tabs.next] diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 9bbfb4e8f..3dd52a2bb 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -74,7 +74,8 @@ (if (and (pairs ch) (= (get-char this 1) (pairs ch))) (let [loc (editor/->cursor this)] - (editor/replace this (adjust-loc loc -1) (adjust-loc loc 1) "")) + (editor/replace this (adjust-loc loc -1) (adjust-loc loc 1) "") + (keyboard/stop-commands!)) (passthrough))) (passthrough)))) @@ -96,7 +97,7 @@ :exec (fn [c] (object/raise (ctx/->obj :editor.keys.normal) :repeat-pair! c))}) -(cmd/command {:command :editor.backspace-parens +(cmd/command {:command :editor.backspace-pair :hidden true :desc "Editor: Pair aware backspace" :exec (fn [c] @@ -120,14 +121,13 @@ cursor (if (> rem 0) (adjust-loc (editor/->cursor ed) (- unit rem)) cursor) [indent rem] (if (> rem 0) (pre-cursor-indent ed cursor) [indent rem])] (if (and (> indent 0) (zero? rem)) - (editor/replace ed (adjust-loc cursor (- unit)) cursor "") + (do + (editor/replace ed (adjust-loc cursor (- unit)) cursor "") + (keyboard/stop-commands!)) (passthrough))) (passthrough))) (cmd/command {:command :editor.backspace-indent :hidden true :desc "Editor: Indent aware backspace" - :exec (fn [second] - (when-not (and second keyboard/*capture*) - (set! keyboard/*capture* true) - (backspace-indent (ctx/->obj :editor.keys.normal))))}) + :exec #(backspace-indent (ctx/->obj :editor.keys.normal))}) From f1c0c276da68473d49a05d6e3917f1766b4d7692 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 10 Sep 2014 10:21:56 -0700 Subject: [PATCH 216/656] fix use of keydown/keyup for search Signed-off-by: Chris Granger --- src/lt/objs/find.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 6e26e4727..3ec89c7be 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -18,7 +18,7 @@ (defui input [this] [:input.find {:type "text" :placeholder "find"}] - :keydown (fn [] + :input (fn [] (this-as me (object/raise this :search! (dom/val me)))) :focus (fn [] @@ -31,7 +31,7 @@ (defui replace-input [this] [:input.replace {:type "text" :placeholder "replace"}] - :keyup (fn [] + :input (fn [] (this-as me (object/raise this :replace.changed (dom/val me)))) :focus (fn [] From 9255fd386260b8ceba9ccdc5d55d22babca3696f Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 10 Sep 2014 10:27:39 -0700 Subject: [PATCH 217/656] set capture to true between each command triggered by the keyboard Signed-off-by: Chris Granger --- src/lt/objs/keyboard.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 90623de1a..627ef0f26 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -117,6 +117,7 @@ (when-let [cs (chord|mapping key char ev)] (doseq [c cs] (when-not *stop* + (set! *capture* true) (trigger c))) *capture*))) From 12fa950c57d97c33ec0ba17ccf6fcd02a52a205e Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Thu, 11 Sep 2014 16:47:25 -0400 Subject: [PATCH 218/656] fix for untitled editors --- src/lt/objs/editor/pool.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 17da1fcf5..3a75e9386 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -51,7 +51,7 @@ (defn containing-path [path] (let [path (string/lower-case path)] - (filter #(> (.indexOf (-> @% :info :path string/lower-case) path) -1) (object/by-tag :editor)))) + (filter #(> (.indexOf (-> @% :info :path (or "") string/lower-case) path) -1) (object/by-tag :editor)))) (defui button [label & [cb]] [:div.button.right label] From ee9adfb35ed0ff3fc79e2144193d6f2972515308 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 15 Sep 2014 21:52:57 -0700 Subject: [PATCH 219/656] HACK: prevent tab switching from leaking label objects. Closes #1625 Signed-off-by: Chris Granger --- src/lt/objs/tabs.cljs | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index a6d97e183..de0638b22 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -94,7 +94,8 @@ (map #(dom/attr % :pos) children)) prev-active (:active-obj @multi)] (object/merge! multi {:objs (mapv (:objs @multi) ser) - :active-obj nil}) + :active-obj nil + :no-redraw false}) (active! prev-active) )) @@ -110,12 +111,19 @@ (active! obj))) (defn objs-list [multi objs] - (let [item (crate/html - [:ul - (for [[idx o] (map vector (range) objs) + (let [labels (for [[idx o] (map vector (range) objs) :when @o] - (object/->content (object/create ::tab-label multi o idx)))])] - (js/sortable item (js-obj "axis" "x" "distance" 10 "scroll" false "opacity" 0.9 "connectWith" ".list")) + (object/create ::tab-label multi o idx)) + item (crate/html + [:ul + (map object/->content labels) + ])] + (doseq [old (:labels @multi)] + (object/destroy! old)) + ;;TODO: this is an unbelievably awful hack to get around looping infinitely trying to draw the + ;;labels. + (object/merge! multi {:labels labels :no-redraw true}) + (js/sortable item (js-obj "axis" "x" "distance" 10 "scroll" false "opacity" 0.9 "connectwith" ".list")) (dom/on item "contextmenu" (fn [e] (object/raise multi :menu! e))) (dom/on item "moved" (fn [e] (move-tab multi (.-opts e)) )) @@ -205,7 +213,8 @@ (defui tabset-ui [this] [:div.tabset {:style {:width (bound (subatom this :width) ->perc)}} [:div.list - (bound this #(objs-list this (:objs %)))] + (bound this #(when-not (:no-redraw %) + (objs-list this (:objs %))))] [:div.items (map-bound (partial tabbed-item (subatom this :active-obj)) this {:path [:objs]})] (vertical-grip this)] @@ -277,7 +286,8 @@ aidx (->index active)] (remove-watch obj :tabs) (object/merge! obj {::tabset nil}) - (object/merge! cur-tabset {:objs (vec (remove #(= obj %) (@cur-tabset :objs)))}) + (object/merge! cur-tabset {:objs (vec (remove #(= obj %) (@cur-tabset :objs))) + :no-redraw false}) (if (= obj active) (object/raise cur-tabset :tab idx) (when (not= aidx (->index active)) @@ -291,6 +301,7 @@ (when-let [cur-tabset (or ts (ctx/->obj :tabset))] (object/add-tags obj [:tabset.tab]) (object/update! cur-tabset [:objs] conj obj) + (object/merge! {:no-redraw false}) (object/merge! obj {::tabset cur-tabset}) (add-watch (subatom obj [:dirty]) :tabs (fn [_ _ _ cur] (object/raise cur-tabset :tab.updated) @@ -314,7 +325,8 @@ (defn active! [obj] (when (and obj (::tabset @obj)) - (object/merge! (::tabset @obj) {:active-obj obj}) + (object/merge! (::tabset @obj) {:active-obj obj + :no-redraw false}) (object/raise obj :show) (ensure-visible (->index obj) (::tabset @obj)))) @@ -396,7 +408,8 @@ (behavior ::repaint-tab-updated :triggers #{:tab.updated} :reaction (fn [this] - (object/update! this [:count] inc))) + (object/update! this [:count] inc) + (object/merge! this {:no-redraw false}))) (behavior ::no-anim-on-drag :triggers #{:start-drag} From c3ca9a02975daad5755530a07dbe16ffa4c06542 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 20 Sep 2014 13:02:58 -0400 Subject: [PATCH 220/656] Show plugins directory in About tab --- src/lt/objs/version.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/version.cljs b/src/lt/objs/version.cljs index 2e174219d..0a94db497 100644 --- a/src/lt/objs/version.cljs +++ b/src/lt/objs/version.cljs @@ -38,6 +38,7 @@ [:dl [:dt "Light Table version"] [:dd (:version deploy/version)] [:dt "Binary version"] [:dd (deploy/binary-version)] + [:dt "Plugins directory" [:dd (files/lt-user-dir "plugins")]] ] (check-button) ] From 0b4086ab4bec42daad32c8c1083b5c9017cca9be Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 22 Sep 2014 13:51:19 -0700 Subject: [PATCH 221/656] ensure that when behaviors are reloaded the tabs get drawn again Signed-off-by: Chris Granger --- src/lt/objs/tabs.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index de0638b22..c6004a7c8 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -406,7 +406,7 @@ )) (behavior ::repaint-tab-updated - :triggers #{:tab.updated} + :triggers #{:tab.updated, :object.refresh} :reaction (fn [this] (object/update! this [:count] inc) (object/merge! this {:no-redraw false}))) From 0f9f6ffc548c588bd746f537daf1aa2bab2c75e1 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 24 Sep 2014 14:17:11 -0700 Subject: [PATCH 222/656] undo my hack, correctly remove old tab-labels Signed-off-by: Chris Granger --- src/lt/objs/tabs.cljs | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index c6004a7c8..d00973fcc 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -84,7 +84,8 @@ (object/object* ::tab-label :tags #{:tab-label} :init (fn [this multi e pos] - (object/merge! this {::tab-object e}) + (object/merge! this {::tab-object e + :tabset multi}) (item this multi e pos))) @@ -94,8 +95,7 @@ (map #(dom/attr % :pos) children)) prev-active (:active-obj @multi)] (object/merge! multi {:objs (mapv (:objs @multi) ser) - :active-obj nil - :no-redraw false}) + :active-obj nil}) (active! prev-active) )) @@ -111,19 +111,16 @@ (active! obj))) (defn objs-list [multi objs] - (let [labels (for [[idx o] (map vector (range) objs) - :when @o] - (object/create ::tab-label multi o idx)) + (let [prev-tabs (filter #(= (:tabset @%) multi) (object/by-tag :tab-label)) item (crate/html [:ul - (map object/->content labels) - ])] - (doseq [old (:labels @multi)] - (object/destroy! old)) - ;;TODO: this is an unbelievably awful hack to get around looping infinitely trying to draw the - ;;labels. - (object/merge! multi {:labels labels :no-redraw true}) - (js/sortable item (js-obj "axis" "x" "distance" 10 "scroll" false "opacity" 0.9 "connectwith" ".list")) + (for [[idx o] (map vector (range) objs) + :when @o] + (object/->content (object/create ::tab-label multi o idx)))])] + ;;Remove old tabs + (doseq [tab prev-tabs] + (object/destroy! tab)) + (js/sortable item (js-obj "axis" "x" "distance" 10 "scroll" false "opacity" 0.9 "connectWith" ".list")) (dom/on item "contextmenu" (fn [e] (object/raise multi :menu! e))) (dom/on item "moved" (fn [e] (move-tab multi (.-opts e)) )) @@ -213,8 +210,7 @@ (defui tabset-ui [this] [:div.tabset {:style {:width (bound (subatom this :width) ->perc)}} [:div.list - (bound this #(when-not (:no-redraw %) - (objs-list this (:objs %))))] + (bound this #(objs-list this (:objs %)))] [:div.items (map-bound (partial tabbed-item (subatom this :active-obj)) this {:path [:objs]})] (vertical-grip this)] @@ -286,8 +282,7 @@ aidx (->index active)] (remove-watch obj :tabs) (object/merge! obj {::tabset nil}) - (object/merge! cur-tabset {:objs (vec (remove #(= obj %) (@cur-tabset :objs))) - :no-redraw false}) + (object/merge! cur-tabset {:objs (vec (remove #(= obj %) (@cur-tabset :objs)))}) (if (= obj active) (object/raise cur-tabset :tab idx) (when (not= aidx (->index active)) @@ -301,7 +296,6 @@ (when-let [cur-tabset (or ts (ctx/->obj :tabset))] (object/add-tags obj [:tabset.tab]) (object/update! cur-tabset [:objs] conj obj) - (object/merge! {:no-redraw false}) (object/merge! obj {::tabset cur-tabset}) (add-watch (subatom obj [:dirty]) :tabs (fn [_ _ _ cur] (object/raise cur-tabset :tab.updated) @@ -325,8 +319,7 @@ (defn active! [obj] (when (and obj (::tabset @obj)) - (object/merge! (::tabset @obj) {:active-obj obj - :no-redraw false}) + (object/merge! (::tabset @obj) {:active-obj obj}) (object/raise obj :show) (ensure-visible (->index obj) (::tabset @obj)))) @@ -406,10 +399,9 @@ )) (behavior ::repaint-tab-updated - :triggers #{:tab.updated, :object.refresh} + :triggers #{:tab.updated} :reaction (fn [this] - (object/update! this [:count] inc) - (object/merge! this {:no-redraw false}))) + (object/update! this [:count] inc))) (behavior ::no-anim-on-drag :triggers #{:start-drag} From 61c6a040b26e328de3af33cf6d8cad1b13a98b9e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 3 Oct 2014 13:48:29 -0400 Subject: [PATCH 223/656] Remove nonexistent behaviors These were each git grepped to confirm they don't exist --- deploy/settings/default/default.behaviors | 24 +++-------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 71f9ef247..fbcf10c45 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -1,19 +1,14 @@ { :+ - {:app [:lt.objs.clients.local/startup-with-local-client - :lt.objs.cache/init + {:app [:lt.objs.cache/init :lt.objs.settings/load-behaviors :lt.objs.settings/create-user-settings :lt.objs.proc/set-path-OSX :lt.objs.workspace/reconstitute-last-workspace :lt.objs.sidebar.command/init-commands :lt.objs.clients.ws/kill-on-closed - :lt.objs.keyboard/load-keys-on-init :lt.objs.workspace/stop-watch-on-close - :lt.objs.workspace/store-last-workspace :lt.objs.clients.devtools/clean-inspectors-timer - :lt.objs.editor.pool/init-tab-settings - :lt.objs.app/pre-init-args :lt.objs.deploy/check-deploy :lt.objs.editor.pool/stop-close-dirty :lt.objs.clients/close-clients-on-closed :lt.objs.app/restore-position-on-init @@ -21,11 +16,9 @@ :lt.objs.editor.pool/init-syntax-selector :lt.objs.cli/open! :lt.objs.thread/shutdown-worker-on-close - :lt.objs.clients.tcp-client/kill-on-closed :lt.objs.animations/animate-on-init :lt.objs.app/store-position-on-close :lt.objs.canvas/append-canvas :lt.objs.tabs/init-sortable - :lt.objs.sidebar.navigate/set-exclude-on-init :lt.objs.deploy/check-version :lt.objs.style/style-on-init :lt.objs.app/initial-focus @@ -35,10 +28,8 @@ :lt.objs.app/close! :lt.objs.menu/remove-menu-close :lt.objs.app/refresh - :lt.objs.app/ready! :lt.objs.app/on-show-bind-navigate :lt.objs.editor.pool/stop-reload-dirty - :lt.objs.window/track-focus :lt.objs.menu/set-menu :lt.plugins.auto-complete/init :lt.objs.clients.devtools/connect-on-init @@ -134,7 +125,6 @@ :lt.objs.clients.devtools/reconnect :lt.objs.clients.devtools/disconnect :lt.objs.clients.devtools/print-messages] - :codex [:lt.objs.codex/close :lt.objs.codex/add! :lt.objs.codex/clear!] :command.options [:lt.objs.sidebar.command/options-escape!] :command.selector [:lt.objs.sidebar.command/escape! :lt.objs.sidebar.command/select-hidden @@ -223,12 +213,10 @@ :lt.objs.eval/inline-exceptions] :editor.markdown [:lt.objs.editor/wrap] :editor.plaintext [:lt.objs.editor/wrap] - :editor.pool [:lt.objs.editor.pool/add-tab-settings - :lt.objs.editor.pool/options-changed + :editor.pool [:lt.objs.editor.pool/options-changed :lt.objs.editor.pool/line-numbers-changed :lt.objs.editor.pool/theme-changed] :editor.read-only [:lt.objs.editor/read-only] - :editor.structural [:lt.plugins.struct/rem-on-close] :editor.transient [:lt.objs.editor.file/dirty-on-change :lt.objs.opener/transient-save :lt.objs.opener/save-as] @@ -348,9 +336,7 @@ :lt.objs.popup/on-click-destroy :lt.objs.popup/change-active-button :lt.objs.popup/exec-active] - :searcher [:lt.objs.search/on-error - :lt.objs.search/on-data :lt.objs.search/clear! - :lt.objs.search/on-end + :searcher [:lt.objs.search/clear! :lt.objs.search/search! :lt.objs.search/done-searching :lt.objs.search/next! @@ -394,7 +380,6 @@ :lt.objs.sidebar.workspace/recent-menu :lt.objs.sidebar.workspace/recent.delete! :lt.objs.sidebar.workspace/recent.select!] - :skin-selector [:lt.objs.style/set-skin-on-select] :status-bar-item [:lt.objs.status-bar/on-show! :lt.objs.status-bar/on-hide! :lt.objs.status-bar/init-status-bar] @@ -404,7 +389,6 @@ :tab-label [:lt.objs.menu/menu! :lt.objs.tabs/tab-label-menu+ :lt.objs.tabs/on-close-tab-label] - :tab-options [:lt.objs.editor.pool/focus-options] :tabs [:lt.objs.tabs/on-destroy-eds :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/tabset-bottom! :lt.objs.tabs/right! :lt.objs.tabs/left! :lt.objs.tabs/bottom! @@ -420,7 +404,6 @@ :lt.objs.tabs/tab-active :lt.objs.tabs/show-close-button] :tcp.client [:lt.objs.clients.tcp/send!] - :theme-selector [:lt.objs.style/set-theme-on-select] :tree-item [:lt.objs.sidebar.workspace/rename-submit :lt.objs.sidebar.workspace/rename-focus :lt.objs.sidebar.workspace/start-rename @@ -434,7 +417,6 @@ :lt.plugins.watches/eval-on-watch-or-unwatch] :window [:lt.objs.clients.tcp/kill-on-closed :lt.objs.workspace/stop-watch-on-blur - :lt.objs.window/track-focus :lt.objs.workspace/watch-workspace :lt.objs.menu/set-menu :lt.objs.menu/remove-menu-close From 1b307a667de2dac1a437d619a8daf87509cb364a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 3 Oct 2014 13:50:22 -0400 Subject: [PATCH 224/656] Point to correct tab destroy behavior :on-destroy-eds never existed in this git repo - seems this should be :on-destroy-objs since that is unused --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index fbcf10c45..7a4c46e6c 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -389,7 +389,7 @@ :tab-label [:lt.objs.menu/menu! :lt.objs.tabs/tab-label-menu+ :lt.objs.tabs/on-close-tab-label] - :tabs [:lt.objs.tabs/on-destroy-eds :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated + :tabs [:lt.objs.tabs/on-destroy-objs :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/tabset-bottom! :lt.objs.tabs/right! :lt.objs.tabs/left! :lt.objs.tabs/bottom! :lt.objs.find/adjust-find-on-resize] From 2f173e8e581c3fa8d65dadc985e501d0ed36fa0e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 3 Oct 2014 13:53:46 -0400 Subject: [PATCH 225/656] :lt.objs.eval/destroy-on-clear behavior should be destroy-on-cleared Was introduced erroneously on 2a8513542876af9902e47b6e21a4d41295df8a20 --- deploy/settings/default/default.behaviors | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 7a4c46e6c..3af3d5d85 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -293,7 +293,7 @@ :inline.doc [:lt.plugins.doc/clear] :inline.exception [:lt.objs.eval/ex-menu+ :lt.objs.eval/ex-clear :lt.objs.menu/menu! - :lt.objs.eval/destroy-on-clear + :lt.objs.eval/destroy-on-cleared :lt.objs.eval/ex-shrink-on-double-click :lt.objs.eval/copy-exception] :inline.result [:lt.objs.eval/shrink-on-double-click @@ -304,7 +304,7 @@ :lt.objs.eval/update! :lt.objs.eval/destroy-on-cleared :lt.objs.eval/copy-result] - :inline.underline-result [:lt.objs.eval/result-menu! :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-clear] + :inline.underline-result [:lt.objs.eval/result-menu! :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-cleared] :inline.watch [:lt.plugins.watches/clear!] :inspector.object [:lt.objs.clients.devtools/clear-inspector-object] :jump-stack [:lt.objs.jump-stack/jump-stack.push :lt.objs.jump-stack/jump-stack.pop] From 21a8df1ceb9fb2d9ceff5a9443f13ed824fc5497 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 3 Oct 2014 14:00:14 -0400 Subject: [PATCH 226/656] Remove unused top-level get-skins call Seems like a repl artificat of 0d980a12b4c5be069b0a75fd5771c3804420ef37 --- src/lt/objs/style.cljs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index d516b936b..c29df9f42 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -99,8 +99,6 @@ (for [[skin path] (object/raise-reduce app/app :skins+ {})] #js {:text (pr-str skin) :completion (pr-str skin)}))) -(get-skins) - (behavior ::set-skin :triggers #{:object.instant} :desc "Style: Set Light Table skin" From 42c6ade818bc64fc5bfc5763aa7fa0bb32cb0402 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 3 Oct 2014 14:07:56 -0400 Subject: [PATCH 227/656] Update result-menu! to point to result-menu+ Seems this was accidental when result-menu+ was introduced in 2239e7b9822d3aec919f5a838c6435fdd4ccd8f4 --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 3af3d5d85..5a476c0b1 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -304,7 +304,7 @@ :lt.objs.eval/update! :lt.objs.eval/destroy-on-cleared :lt.objs.eval/copy-result] - :inline.underline-result [:lt.objs.eval/result-menu! :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-cleared] + :inline.underline-result [:lt.objs.eval/result-menu+ :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-cleared] :inline.watch [:lt.plugins.watches/clear!] :inspector.object [:lt.objs.clients.devtools/clear-inspector-object] :jump-stack [:lt.objs.jump-stack/jump-stack.push :lt.objs.jump-stack/jump-stack.pop] From 1c421fae3eeb474b77714862330a98d7fa90d7a3 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 7 Oct 2014 17:22:20 -0400 Subject: [PATCH 228/656] Remove remaining unused behaviors --- deploy/settings/default/default.behaviors | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 5a476c0b1..d2dbb851f 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -391,8 +391,7 @@ :lt.objs.tabs/on-close-tab-label] :tabs [:lt.objs.tabs/on-destroy-objs :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/tabset-bottom! - :lt.objs.tabs/right! :lt.objs.tabs/left! :lt.objs.tabs/bottom! - :lt.objs.find/adjust-find-on-resize] + :lt.objs.tabs/right! :lt.objs.tabs/left! :lt.objs.tabs/bottom!] :tabset [:lt.objs.tabs/set-width-final! :lt.objs.tabs/tabset-active :lt.objs.tabs/next-tab :lt.objs.tabs/unset-dragging :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/width! @@ -416,8 +415,6 @@ :lt.plugins.watches/unwatch! :lt.plugins.watches/eval-on-watch-or-unwatch] :window [:lt.objs.clients.tcp/kill-on-closed - :lt.objs.workspace/stop-watch-on-blur - :lt.objs.workspace/watch-workspace :lt.objs.menu/set-menu :lt.objs.menu/remove-menu-close ] From e46c419c592fc5b475d08bdf37c74be1785422ac Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 7 Oct 2014 17:31:24 -0400 Subject: [PATCH 229/656] Remove references to nonexistent :resize behavior Behavior was removed in 1fd123d8355036389eccbc1e07e920b99202acc2 --- src/lt/objs/tabs.cljs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index d00973fcc..684da8192 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -537,26 +537,22 @@ (behavior ::left! :triggers #{:left!} :reaction (fn [this v] - (object/update! this [:left] + v) - (object/raise this :resize))) + (object/update! this [:left] + v))) (behavior ::right! :triggers #{:right!} :reaction (fn [this v] - (object/update! this [:right] + v) - (object/raise this :resize))) + (object/update! this [:right] + v))) (behavior ::bottom! :triggers #{:bottom!} :reaction (fn [this v] - (object/update! this [:bottom] + v) - (object/raise this :resize))) + (object/update! this [:bottom] + v))) (behavior ::tabset-bottom! :triggers #{:tabset-bottom!} :reaction (fn [this v] - (object/update! this [:tabset-bottom] + v) - (object/raise this :resize))) + (object/update! this [:tabset-bottom] + v))) (behavior ::init-sortable From 6cf6d31b37dfaf52c4f0a48f97c32114b60d729a Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Tue, 14 Oct 2014 00:07:08 +0300 Subject: [PATCH 230/656] Removed most of Wrong number of args warnings --- src/lt/object.cljs | 104 ++++++++++++++++-------------- src/lt/objs/app.cljs | 12 ++-- src/lt/objs/clients.cljs | 30 +++++---- src/lt/objs/console.cljs | 45 +++++++------ src/lt/objs/deploy.cljs | 2 +- src/lt/objs/editor.cljs | 22 ++++--- src/lt/objs/eval.cljs | 20 +++--- src/lt/objs/files.cljs | 42 ++++++------ src/lt/objs/langs/behaviors.cljs | 18 +++--- src/lt/objs/menu.cljs | 16 +++-- src/lt/objs/notifos.cljs | 12 ++-- src/lt/objs/search.cljs | 2 +- src/lt/objs/workspace.cljs | 6 +- src/lt/plugins/auto_complete.cljs | 46 ++++++------- 14 files changed, 208 insertions(+), 169 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 32096a340..07dd96f17 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -38,14 +38,16 @@ (swap! result assoc! t (conj (or (get @result t) '()) beh))) (persistent! @result))) -(defn specificity-sort [xs dir] - (let [arr #js []] - (doseq [x xs] - (.push arr #js [(.-length (.split (str x) ".")) (str x) x])) - (.sort arr) - (when-not dir (.reverse arr)) - (aloop [i arr] (aset arr i (aget arr i 2))) - arr)) +(defn specificity-sort + ([xs] (specificity-sort xs nil)) + ([xs dir] + (let [arr #js []] + (doseq [x xs] + (.push arr #js [(.-length (.split (str x) ".")) (str x) x])) + (.sort arr) + (when-not dir (.reverse arr)) + (aloop [i arr] (aset arr i (aget arr i 2))) + arr))) (defn ts->negations [ts] (let [seen (js-obj)] @@ -75,23 +77,25 @@ (defn trigger->behaviors [trig ts] (get (->triggers (tags->behaviors ts)) trig)) -(defn update-listeners [obj instants] - (let [cur @obj - behs (set (concat (:behaviors cur) (tags->behaviors (:tags cur)))) - trigs (->triggers behs) - ;;We need to load new JS files here because they may define the behaviors that we're meant to - ;;capture. If we have a load, then load and recalculate the triggers to pick up those newly - ;;defined behaviors - trigs (if (:object.instant-load trigs) - (do - (raise* obj (:object.instant-load trigs) nil :object.instant-load) - (->triggers behs)) - trigs) - trigs (if instants - trigs - (dissoc trigs :object.instant :object.instant-load))] - ;;deref again in case :object.instant-load made any updates - (assoc @obj :listeners trigs))) +(defn update-listeners + ([obj] (update-listeners obj nil)) + ([obj instants] + (let [cur @obj + behs (set (concat (:behaviors cur) (tags->behaviors (:tags cur)))) + trigs (->triggers behs) + ;;We need to load new JS files here because they may define the behaviors that we're meant to + ;;capture. If we have a load, then load and recalculate the triggers to pick up those newly + ;;defined behaviors + trigs (if (:object.instant-load trigs) + (do + (raise* obj (:object.instant-load trigs) nil :object.instant-load) + (->triggers behs)) + trigs) + trigs (if instants + trigs + (dissoc trigs :object.instant :object.instant-load))] + ;;deref again in case :object.instant-load made any updates + (assoc @obj :listeners trigs)))) (defn make-object* [name & r] (let [obj (merge {:behaviors #{} :tags #{} :triggers [] :listeners {} ::type name :children {}} @@ -164,30 +168,32 @@ e (.-stack e))))) -(defn raise* [obj reactions args trigger] - (doseq [r reactions - :let [func (:reaction (->behavior r)) - args (if (coll? r) - (concat (rest r) args) - args) - meta (if (coll? r) - (meta r) - {})] - :when func] - (try - (with-time - (binding [*behavior-meta* meta] - (apply func obj args)) - (when-not (= trigger :object.behavior.time) - (raise obj :object.behavior.time r time trigger))) - (catch js/Error e - (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) - (safe-report-error e) - ) - (catch js/global.Error e - (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) - (safe-report-error e) - )))) +(defn raise* + ([obj reactions args] (raise* obj reactions args nil)) + ([obj reactions args trigger] + (doseq [r reactions + :let [func (:reaction (->behavior r)) + args (if (coll? r) + (concat (rest r) args) + args) + meta (if (coll? r) + (meta r) + {})] + :when func] + (try + (with-time + (binding [*behavior-meta* meta] + (apply func obj args)) + (when-not (= trigger :object.behavior.time) + (raise obj :object.behavior.time r time trigger))) + (catch js/Error e + (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) + (safe-report-error e) + ) + (catch js/global.Error e + (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) + (safe-report-error e) + ))))) (defn raise [obj k & args] (let [reactions (-> @obj :listeners k)] diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 4e53dbdc8..e66696f25 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -23,11 +23,13 @@ (defn prevent-close [] (set! closing false)) -(defn close [force?] - (when force? - (object/raise app :closing) - (object/raise app :closed)) - (.close win force?)) +(defn close + ([] (close false)) + ([force?] + (when force? + (object/raise app :closing) + (object/raise app :closed)) + (.close win force?))) (defn refresh [] (js/window.location.reload true)) diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index 803c9cdb0..ba7bf061b 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -113,20 +113,22 @@ (= (.indexOf (string/lower-case sub) (string/lower-case root)) 0))) ;;return client based on path and type -(defn discover* [command {:keys [path]}] - (let [all (filter (fn [cur] - (let [{:keys [dir commands]} (if (satisfies? IDeref cur) - @cur - cur)] - (and (if (and path dir) - (subpath? dir path) - true) - (get commands command)))) - (vals @cs)) - with-dir (filter #(@% :dir) all)] - (if (and path (seq with-dir)) - with-dir - all))) +(defn discover* + ([command] (discover* command nil)) + ([command {:keys [path]}] + (let [all (filter (fn [cur] + (let [{:keys [dir commands]} (if (satisfies? IDeref cur) + @cur + cur)] + (and (if (and path dir) + (subpath? dir path) + true) + (get commands command)))) + (vals @cs)) + with-dir (filter #(@% :dir) all)] + (if (and path (seq with-dir)) + with-dir + all)))) (defn discover [command info] (let [[found & others :as all] (discover* command info)] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 61695c664..0f790efda 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -79,15 +79,18 @@ (status-bar/dirty)) (append $console msg)) -(defn verbatim [thing class str-content] - (let [$console (->ui console)] - (when str-content - (write-to-log str-content)) - (when class - (status-bar/console-class class)) - (write $console (->item thing class)) - (dom/scroll-top $console 10000000000) - nil)) +(defn verbatim + ([thing class] + (verbatim thing class nil)) + ([thing class str-content] + (let [$console (->ui console)] + (when str-content + (write-to-log str-content)) + (when class + (status-bar/console-class class)) + (write $console (->item thing class)) + (dom/scroll-top $console 10000000000) + nil))) (defn try-update [{:keys [content id]}] (when id @@ -112,17 +115,19 @@ content)]]]] class)))) -(defn log [l class str-content] - (when-not (= "" l) - (let [$console (->ui console)] - (when (or (string? l) str-content) (write-to-log (if (string? l) - l - str-content)) - (write $console (->item [:pre (if-not (dom-like? l) - (pr-str l) - l)] class)) - (dom/scroll-top $console 10000000000) - nil)))) +(defn log + ([l class] (log l class nil)) + ([l class str-content] + (when-not (= "" l) + (let [$console (->ui console)] + (when (or (string? l) str-content) (write-to-log (if (string? l) + l + str-content)) + (write $console (->item [:pre (if-not (dom-like? l) + (pr-str l) + l)] class)) + (dom/scroll-top $console 10000000000) + nil))))) (defn error [e] (status-bar/console-class "error") diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 201c96571..2ea2782c3 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -147,7 +147,7 @@ (when cb (cb)))) -(defn alert-binary-update [on-yes] +(defn alert-binary-update [] (popup/popup! {:header "There's been a binary update!" :body "There's a new version of the Light Table binary. Clicking below will open the Light Table website so you can download the updated version." diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index b3501b153..30f393d55 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -110,8 +110,9 @@ (remove-class (->elem e) (name klass)) e) -(defn cursor [e side] - (.getCursor (->cm-ed e) side)) +(defn cursor + ([e] (cursor e nil)) + ([e side] (.getCursor (->cm-ed e) side))) (defn ->cursor [e & [side]] (let [pos (cursor e side)] @@ -325,10 +326,12 @@ (js/CodeMirror.showHint (->cm-ed e) hint-fn (clj->js options)) e) -(defn inner-mode [e state] - (let [state (or state (->> (cursor e) (->token-js e) (.-state)))] - (-> (js/CodeMirror.innerMode (.getMode (->cm-ed e)) state) - (.-mode)))) +(defn inner-mode + ([e] (inner-mode e nil)) + ([e state] + (let [state (or state (->> (cursor e) (->token-js e) (.-state)))] + (-> (js/CodeMirror.innerMode (.getMode (->cm-ed e)) state) + (.-mode))))) (defn adjust-loc ([loc dir] @@ -360,8 +363,11 @@ (defn line-comment [e from to opts] (.lineComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) -(defn uncomment [e from to opts] - (.uncomment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) +(defn uncomment + ([e from to] + (uncomment e from to nil)) + ([e from to opts] + (.uncomment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts)))) (defn ->generation [e] (.changeGeneration (->cm-ed e))) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index c35e6ab05..060ddf370 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -160,15 +160,17 @@ " open" ))) -(defn truncate-result [r opts] - (when (string? r) - (let [nl (.indexOf r "\n") - len (if (> nl -1) - nl - (:trunc-length opts 50))] - (if (> (count r) len) - (str (subs r 0 len) " …") - r)))) +(defn truncate-result + ([r] (truncate-result r nil)) + ([r opts] + (when (string? r) + (let [nl (.indexOf r "\n") + len (if (> nl -1) + nl + (:trunc-length opts 50))] + (if (> (count r) len) + (str (subs r 0 len) " …") + r))))) (defui ->inline-res [this info] (let [r (:result info) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 17f1b6d77..00f196d1f 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -267,16 +267,18 @@ (str f separator) (str f))) -(defn ls [path cb] - (try - (let [fs (map (partial ->file|dir path) (.readdirSync fs path))] - (if cb - (cb fs) - fs)) - (catch js/global.Error e - (when cb - (cb nil)) - nil))) +(defn ls + ([path] (ls path nil)) + ([path cb] + (try + (let [fs (map (partial ->file|dir path) (.readdirSync fs path))] + (if cb + (cb fs) + fs)) + (catch js/global.Error e + (when cb + (cb nil)) + nil)))) (defn ls-sync [path opts] (try @@ -305,14 +307,18 @@ (defn join [& segs] (apply (.-join fpath) (filter string? (map str segs)))) -(defn home [path] - (let [h (if (= js/process.platform "win32") - js/process.env.USERPROFILE - js/process.env.HOME)] - (join h (or path separator)))) - -(defn lt-home [path] - (join pwd path)) +(defn home + ([] (home nil)) + ([path] + (let [h (if (= js/process.platform "win32") + js/process.env.USERPROFILE + js/process.env.HOME)] + (join h (or path separator))))) + +(defn lt-home + ([] pwd) + ([path] + (join pwd path))) (defn lt-user-dir [path] (if js/process.env.LT_USER_DIR diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 8b6271faa..48fae77cd 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -74,14 +74,16 @@ (aset cur "select" wrapped-replacement)) cur) -(defn user-behavior-completions [_ _ token] - (if (and token - (= (subs token 0 1) ":")) - (map #(->wrapped-behavior % #js {:text (str (:name %))}) (vals @object/behaviors)) - (map #(if-not (:desc %) - (->wrapped-behavior % #js {:text (str (:name %))}) - (->wrapped-behavior % #js {:text (:desc %)})) - (filter #(= (:type %) :user) (vals @object/behaviors))))) +(defn user-behavior-completions + ([] (user-behavior-completions nil nil nil)) + ([_ _ token] + (if (and token + (= (subs token 0 1) ":")) + (map #(->wrapped-behavior % #js {:text (str (:name %))}) (vals @object/behaviors)) + (map #(if-not (:desc %) + (->wrapped-behavior % #js {:text (str (:name %))}) + (->wrapped-behavior % #js {:text (:desc %)})) + (filter #(= (:type %) :user) (vals @object/behaviors)))))) (def completions {:root [#js {:completion ":+"} #js {:completion ":-"}] diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index f8e644127..2dcdf3695 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -10,16 +10,18 @@ (def gui (js/require "nw.gui")) -(defn create-menu [type] - (let [m (.-Menu gui)] - (if type - (m. (js-obj "type" type)) - (m.)))) +(defn create-menu + ([] (create-menu nil)) + ([type] + (let [m (.-Menu gui)] + (if type + (m. (js-obj "type" type)) + (m.))))) (def menu-instance (create-menu)) (defn submenu [items] - (let [menu (create-menu nil)] + (let [menu (create-menu)] (doseq [i items :when i] (.append menu (menu-item i))) @@ -100,7 +102,7 @@ {:label label :click (fn [] (cmd/exec! cmd))} opts - (command->menu-binding cmd opts)))) + (command->menu-binding cmd)))) (defn main-menu [] diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index e5f18ff0d..430dd11ee 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -8,10 +8,12 @@ (def standard-timeout 10000) -(defn working [msg] - (when msg - (set-msg! msg)) - (status-bar/loader-inc)) +(defn working + ([] (working nil)) + ([msg] + (when msg + (set-msg! msg)) + (status-bar/loader-inc))) (defn done-working ([] @@ -40,5 +42,5 @@ (cmd/command {:command :reset-working :desc "Status Bar: Reset working indicator" :exec (fn [] - (status-bar/loader-set 0) + (status-bar/loader-set) )}) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index 278a5de0a..fbef9588e 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -234,7 +234,7 @@ [:div.searcher [:p (bound this result-count)] (search-box this) - [:div (replace-box this) (replace-all-button)] + [:div (replace-box this) (replace-all-button this)] (location-box this) ] ] diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 983a6867e..c76322f19 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -99,8 +99,10 @@ (when-not (number? recursive?) (object/update! current-ws [:watches] merge (persistent! results))))) -(defn unwatch! [path recursive?] - (object/merge! current-ws {:watches (unwatch (:watches @current-ws) path recursive?)})) +(defn unwatch! + ([path] (unwatch! path false)) + ([path recursive?] + (object/merge! current-ws {:watches (unwatch (:watches @current-ws) path recursive?)}))) (defn stop-watching [ws] (unwatch! (keys (:watches @ws)))) diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 53facf0d8..1f9511e7b 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -233,28 +233,30 @@ (async-hints this)) )) -(defn start-hinting [this opts] - (let [pos (editor/->cursor this) - token (get-token this pos) - line (editor/line-handle this (:line pos)) - elem (object/->content hinter)] - (ctx/in! [:editor.keys.hinting.active] this) - (object/merge! hinter {:token token - :starting-token token - :ed this - :active true - :line line}) - (object/raise hinter :change! (:string token)) - (object/raise hinter :active) - (let [count (count (:cur @hinter))] - (cond - (= 0 count) (ctx/out! [:editor.keys.hinting.active :filter-list.input]) - (and (= 1 count) - (:select-single opts)) (object/raise hinter :select! 0) - :else (do - (js/CodeMirror.on line "change" on-line-change) - (dom/append (dom/$ :body) elem) - (js/CodeMirror.positionHint (editor/->cm-ed this) elem (:start token))))))) +(defn start-hinting + ([this] (start-hinting this nil)) + ([this opts] + (let [pos (editor/->cursor this) + token (get-token this pos) + line (editor/line-handle this (:line pos)) + elem (object/->content hinter)] + (ctx/in! [:editor.keys.hinting.active] this) + (object/merge! hinter {:token token + :starting-token token + :ed this + :active true + :line line}) + (object/raise hinter :change! (:string token)) + (object/raise hinter :active) + (let [count (count (:cur @hinter))] + (cond + (= 0 count) (ctx/out! [:editor.keys.hinting.active :filter-list.input]) + (and (= 1 count) + (:select-single opts)) (object/raise hinter :select! 0) + :else (do + (js/CodeMirror.on line "change" on-line-change) + (dom/append (dom/$ :body) elem) + (js/CodeMirror.positionHint (editor/->cm-ed this) elem (:start token)))))))) (behavior ::show-hint :triggers #{:hint} From 1bbd7e516df0c3fd6ebdd15aa65bc4a38707ecdd Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Tue, 14 Oct 2014 00:28:48 +0300 Subject: [PATCH 231/656] Reordered defs to remove undeclared Var warning --- src/lt/object.cljs | 104 ++++++++++++++-------------- src/lt/objs/app.cljs | 49 +++++++------- src/lt/objs/sidebar/command.cljs | 113 +++++++++++++++---------------- 3 files changed, 133 insertions(+), 133 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 07dd96f17..e21d64c78 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -23,6 +23,11 @@ (defn add-behavior [beh] (swap! behaviors assoc (:name beh) beh)) +(defn ->id [obj] + (if (deref? obj) + (::id @obj) + (::id obj))) + (defn ->behavior-name [beh] (if (coll? beh) (first beh) @@ -77,6 +82,46 @@ (defn trigger->behaviors [trig ts] (get (->triggers (tags->behaviors ts)) trig)) +(defn safe-report-error [e] + (if js/lt.objs.console + (js/lt.objs.console.error e) + (.error js/console (if (string? e) + e + (.-stack e))))) + +(declare raise) + +(defn raise* + ([obj reactions args] (raise* obj reactions args nil)) + ([obj reactions args trigger] + (doseq [r reactions + :let [func (:reaction (->behavior r)) + args (if (coll? r) + (concat (rest r) args) + args) + meta (if (coll? r) + (meta r) + {})] + :when func] + (try + (with-time + (binding [*behavior-meta* meta] + (apply func obj args)) + (when-not (= trigger :object.behavior.time) + (raise obj :object.behavior.time r time trigger))) + (catch js/Error e + (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) + (safe-report-error e) + ) + (catch js/global.Error e + (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) + (safe-report-error e) + ))))) + +(defn raise [obj k & args] + (let [reactions (-> @obj :listeners k)] + (raise* obj reactions args k))) + (defn update-listeners ([obj] (update-listeners obj nil)) ([obj instants] @@ -109,6 +154,11 @@ (defn instances-by-type [type] (filter #(= type (::type (deref %))) (vals @instances))) +(defn merge! [obj m] + (when (and m (not (map? m))) + (throw (js/Error. (str "Merge requires a map: " m)))) + (swap! obj merge m)) + (defn handle-redef [odef] (let [id (::type odef)] (doseq [o (instances-by-type id) @@ -161,44 +211,6 @@ (wrap-debounce) (store-behavior*))) -(defn safe-report-error [e] - (if js/lt.objs.console - (js/lt.objs.console.error e) - (.error js/console (if (string? e) - e - (.-stack e))))) - -(defn raise* - ([obj reactions args] (raise* obj reactions args nil)) - ([obj reactions args trigger] - (doseq [r reactions - :let [func (:reaction (->behavior r)) - args (if (coll? r) - (concat (rest r) args) - args) - meta (if (coll? r) - (meta r) - {})] - :when func] - (try - (with-time - (binding [*behavior-meta* meta] - (apply func obj args)) - (when-not (= trigger :object.behavior.time) - (raise obj :object.behavior.time r time trigger))) - (catch js/Error e - (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) - (safe-report-error e) - ) - (catch js/global.Error e - (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) - (safe-report-error e) - ))))) - -(defn raise [obj k & args] - (let [reactions (-> @obj :listeners k)] - (raise* obj reactions args k))) - (defn raise-reduce [obj k start & args] (let [reactions (-> @obj :listeners k)] (reduce (fn [res cur] @@ -218,11 +230,6 @@ (declare create) -(defn merge! [obj m] - (when (and m (not (map? m))) - (throw (js/Error. (str "Merge requires a map: " m)))) - (swap! obj merge m)) - (defn update! [obj & r] (swap! obj #(apply update-in % r))) @@ -231,17 +238,15 @@ (throw (js/Error. (str "Associate requires a sequence of keys: " k)))) (swap! obj #(assoc-in % k v))) -(defn ->id [obj] - (if (deref? obj) - (::id @obj) - (::id obj))) - (defn ->inst [o] (cond (map? o) (@instances (->id o)) (deref? o) o :else (@instances o))) +(defn ->content [obj] + (:content @obj)) + (defn destroy! [obj] (when-let [inst (->inst obj)] (raise inst :destroy) @@ -297,9 +302,6 @@ def|name (@object-defs def|name))) -(defn ->content [obj] - (:content @obj)) - (defn by-id [id] (when id (@instances id))) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index e66696f25..be66c89ff 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -11,6 +11,7 @@ (def win (.Window.get gui)) (def closing true) (def default-zoom 0) +(def app (object/create ::app)) (defn window-number [] (let [n (last (string/split js/window.location.search "="))] @@ -23,29 +24,6 @@ (defn prevent-close [] (set! closing false)) -(defn close - ([] (close false)) - ([force?] - (when force? - (object/raise app :closing) - (object/raise app :closed)) - (.close win force?))) - -(defn refresh [] - (js/window.location.reload true)) - -(defn open-window [] - (let [id (store-swap! :window-id inc) - w (.Window.open gui (str "LightTable.html?id=" id) (clj->js {:toolbar false - :icon "core/img/lticon.png" - :new-instance true - :min_height 400 - :min_width 400 - :frame true - :show false}))] - (set! (.-ltid w) id) - w)) - (defn args [] (when-not (= 0 (.-App.argv.length gui)) (seq (.-App.argv gui)))) @@ -88,6 +66,29 @@ (when (not= (.-zoomLevel win) 0) (.-zoomLevel win))) +(defn close + ([] (close false)) + ([force?] + (when force? + (object/raise app :closing) + (object/raise app :closed)) + (.close win force?))) + +(defn refresh [] + (js/window.location.reload true)) + +(defn open-window [] + (let [id (store-swap! :window-id inc) + w (.Window.open gui (str "LightTable.html?id=" id) (clj->js {:toolbar false + :icon "core/img/lticon.png" + :new-instance true + :min_height 400 + :min_width 400 + :frame true + :show false}))] + (set! (.-ltid w) id) + w)) + ;;********************************************************* ;; Behaviors ;;********************************************************* @@ -223,8 +224,6 @@ :init (fn [this] (ctx/in! :app this))) -(def app (object/create ::app)) - (when (= 0 (window-number)) (store! :window-id 0)) diff --git a/src/lt/objs/sidebar/command.cljs b/src/lt/objs/sidebar/command.cljs index 886416532..812246e61 100644 --- a/src/lt/objs/sidebar/command.cljs +++ b/src/lt/objs/sidebar/command.cljs @@ -69,11 +69,42 @@ (object/merge! this opts) (op-input this))) +(def by-id cmd/by-id) + +(def exec! cmd/exec!) + +(def sidebar-command (object/create ::sidebar.command)) + (defn options-input [opts] (let [lst (object/create ::options-input opts)] (object/raise lst :refresh!) lst)) +(defn ->items [items] + (cond + (satisfies? IDeref items) @items + (fn? items) (items) + :else items)) + +(defn score-sort [x y] + (- (aget y 3) (aget x 3))) + +(defn score-sort2 [x y] + (- (.-score (aget y 4)) (.-score (aget x 4)))) + +(defn indexed-results [{:keys [search size items key size]}] + (let [items (apply array (->items items)) + map-func3 #(array % (key %) (js/fastScore (key %) search) nil nil) + map-func #(do (aset % 3 (.score (aget % 1) search)) %) + map-func2 #(do (aset % 4 (js/score (aget % 1) search)) %) + has-score #(> (.-score (aget % 4)) 0)] + (if-not (empty? search) + (let [score0 (.. items (map map-func3) (filter #(aget % 2))) + score1 (.. score0 (map map-func) (sort score-sort)) + score2 (.. score1 (slice 0 50) (map map-func2) (filter has-score) (sort score-sort2))] + score2) + (.. items (map #(array % (key %) nil nil)))))) + ;;********************************************************** ;; filter list ;;********************************************************** @@ -108,6 +139,31 @@ (- (+ (.-offsetTop elem) (.-offsetHeight elem) 15) (.-clientHeight list))) :else nil))) +(defn fill-lis [{:keys [lis size search selected key transform] :as this} results] + (let [cnt (count results) + cur (mod selected (if (> cnt size) + size + cnt)) + transform (if transform + transform + #(do %3))] + (if (= cnt 0) + (dom/add-class (:content this) :empty) + (dom/remove-class (:content this) :empty)) + (doseq [[i li res] (map vector (range) lis results) + :when res] + (dom/html li (transform (aget res 1) (aget res 4) (if-not (empty? search) + + (js/wrapMatch (aget res 1) (aget res 4)) + (aget res 1)) + (aget res 0))) + (dom/css li {:display "block"}) + (if (= i cur) + (dom/add-class li :selected) + (dom/remove-class li :selected))) + (doseq [li (drop cnt lis)] + (dom/css li {:display "none"})))) + (behavior ::move-selection :triggers #{:move-selection} :reaction (fn [this dir] @@ -215,33 +271,6 @@ (object/raise this :change! (dom/val me))) )) -(defn ->items [items] - (cond - (satisfies? IDeref items) @items - (fn? items) (items) - :else items)) - -(defn score-sort [x y] - (- (aget y 3) (aget x 3))) - -(defn score-sort2 [x y] - (- (.-score (aget y 4)) (.-score (aget x 4)))) - -(defn indexed-results [{:keys [search size items key size]}] - (let [items (apply array (->items items)) - map-func3 #(array % (key %) (js/fastScore (key %) search) nil nil) - map-func #(do (aset % 3 (.score (aget % 1) search)) %) - map-func2 #(do (aset % 4 (js/score (aget % 1) search)) %) - has-score #(> (.-score (aget % 4)) 0)] - (if-not (empty? search) - (let [score0 (.. items (map map-func3) (filter #(aget % 2))) - score1 (.. score0 (map map-func) (sort score-sort)) - score2 (.. score1 (slice 0 50) (map map-func2) (filter has-score) (sort score-sort2))] - score2) - (.. items (map #(array % (key %) nil nil)))))) - - - (defui item [this x] [:li {:index x}] :mousedown (fn [e] @@ -250,31 +279,6 @@ (object/raise this :set-selection! x) (object/raise this :select! x))) -(defn fill-lis [{:keys [lis size search selected key transform] :as this} results] - (let [cnt (count results) - cur (mod selected (if (> cnt size) - size - cnt)) - transform (if transform - transform - #(do %3))] - (if (= cnt 0) - (dom/add-class (:content this) :empty) - (dom/remove-class (:content this) :empty)) - (doseq [[i li res] (map vector (range) lis results) - :when res] - (dom/html li (transform (aget res 1) (aget res 4) (if-not (empty? search) - - (js/wrapMatch (aget res 1) (aget res 4)) - (aget res 1)) - (aget res 0))) - (dom/css li {:display "block"}) - (if (= i cur) - (dom/add-class li :selected) - (dom/remove-class li :selected))) - (doseq [li (drop cnt lis)] - (dom/css li {:display "none"})))) - (object/object* ::filter-list :tags #{:filter-list} :selected 0 @@ -437,7 +441,6 @@ :reaction (fn [app] (object/raise sidebar-command :refresh!))) -(def sidebar-command (object/create ::sidebar.command)) (ctx/in! :commandbar sidebar-command) (sidebar/add-item sidebar/rightbar sidebar-command) @@ -455,10 +458,6 @@ (object/raise sidebar/rightbar :toggle sidebar-command (assoc opts :soft? true)) (object/raise sidebar-command :soft-focus!)) -(def by-id cmd/by-id) - -(def exec! cmd/exec!) - (defn exec-active! [& args] (object/raise sidebar-command :exec-active! args)) From 166797ec6b1185aced17a3ea15831642d668c664 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Tue, 14 Oct 2014 23:05:31 +0300 Subject: [PATCH 232/656] Reorder some definitions to reduce undeclared var warnings --- src/lt/objs/bottombar.cljs | 8 +-- src/lt/objs/browser.cljs | 62 ++++++++--------- src/lt/objs/canvas.cljs | 6 +- src/lt/objs/clients.cljs | 22 +++--- src/lt/objs/console.cljs | 51 +++++++------- src/lt/objs/context.cljs | 21 +++--- src/lt/objs/deploy.cljs | 10 +-- src/lt/objs/document.cljs | 6 +- src/lt/objs/editor.cljs | 87 ++++++++++++------------ src/lt/objs/editor/pool.cljs | 55 ++++++++------- src/lt/objs/eval.cljs | 16 ++--- src/lt/objs/files.cljs | 113 +++++++++++++++---------------- src/lt/objs/find.cljs | 4 +- src/lt/objs/langs/behaviors.cljs | 4 +- src/lt/objs/langs/keymap.cljs | 4 +- 15 files changed, 234 insertions(+), 235 deletions(-) diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index 50034e8b0..90d950610 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -22,6 +22,10 @@ (object/raise this :height! e) )) +(def bottombar (object/create ::bottombar)) + +(canvas/add! bottombar) + (defn active-content [active] (when active (object/->content active))) @@ -55,10 +59,6 @@ [:div.content (bound (subatom this :active) active-content)]])) -(def bottombar (object/create ::bottombar)) - -(canvas/add! bottombar) - ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 4c26acc53..21c0c84e2 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -35,37 +35,6 @@ (defn add-util [nme fn] (aset utils (name nme) fn)) -(defui url-bar [this] - [:input.url-bar {:type "text" :placeholder "url" :value (bound this :urlvalue)}] - :focus (fn [] - (ctx/in! :browser.url-bar this) - (object/raise this :active)) - :blur (fn [] - (object/raise this :inactive) - (ctx/out! :browser.url-bar))) - -(defui backward [this] - [:button {:value "<"} "<"] - :click (fn [] - (object/raise this :back!))) - -(defui forward [this] - [:button {:value ">"} ">"] - :click (fn [] - (object/raise this :forward!))) - -(defui refresh [this] - [:button {:value "re"} "↺"] - :click (fn [] - (object/raise this :refresh!))) - -(defui iframe [this] - [:iframe {:src (bound (subatom this :url)) :id (browser-id this) :nwfaketop "true" :nwdisable "true"}] - :focus (fn [] - (object/raise this :active)) - :blur (fn [] - (object/raise this :inactive))) - (defn browser-id [this] (str "browser" (object/->id this))) @@ -97,6 +66,37 @@ (tabs/active! browser) browser)) +(defui url-bar [this] + [:input.url-bar {:type "text" :placeholder "url" :value (bound this :urlvalue)}] + :focus (fn [] + (ctx/in! :browser.url-bar this) + (object/raise this :active)) + :blur (fn [] + (object/raise this :inactive) + (ctx/out! :browser.url-bar))) + +(defui backward [this] + [:button {:value "<"} "<"] + :click (fn [] + (object/raise this :back!))) + +(defui forward [this] + [:button {:value ">"} ">"] + :click (fn [] + (object/raise this :forward!))) + +(defui refresh [this] + [:button {:value "re"} "↺"] + :click (fn [] + (object/raise this :refresh!))) + +(defui iframe [this] + [:iframe {:src (bound (subatom this :url)) :id (browser-id this) :nwfaketop "true" :nwdisable "true"}] + :focus (fn [] + (object/raise this :active)) + :blur (fn [] + (object/raise this :inactive))) + ;;********************************************************* ;; Object ;;********************************************************* diff --git a/src/lt/objs/canvas.cljs b/src/lt/objs/canvas.cljs index c8e7b308d..c798a9e19 100644 --- a/src/lt/objs/canvas.cljs +++ b/src/lt/objs/canvas.cljs @@ -8,6 +8,9 @@ (defui canvas-elem [obj] [:div#canvas]) +(def canvas (object/create ::canvas)) +(append ($ "#wrapper") (object/->content canvas)) + (defn add! [obj & [position?]] (append (object/->content canvas) (object/->content obj)) (object/raise obj :show rep)) @@ -20,9 +23,6 @@ :init (fn [obj] (canvas-elem obj))) -(def canvas (object/create ::canvas)) -(append ($ "#wrapper") (object/->content canvas)) - ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index ba7bf061b..0751add96 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -8,13 +8,21 @@ (def cs (atom {})) +(defn ->id [obj] + (object/->id obj)) + +(def clients (object/create ::clients)) + +(defn client! [type] + (let [obj (object/create ::client)] + (object/add-tags obj [type]) + (swap! cs assoc (->id obj) obj) + obj)) + (defn by-id [n] (when n (@cs n))) -(defn ->id [obj] - (object/->id obj)) - (defn by-name [n] (first (filter #(= n (:name @%)) (vals @cs)))) @@ -159,8 +167,6 @@ :init (fn [] )) -(def clients (object/create ::clients)) - (behavior ::close-clients-on-closed :triggers #{:closing} :reaction (fn [app] @@ -194,12 +200,6 @@ ;; individual Clients ;;********************************************************** -(defn client! [type] - (let [obj (object/create ::client)] - (object/add-tags obj [type]) - (swap! cs assoc (->id obj) obj) - obj)) - (defn placeholder [] (-> (object/create ::client) (object/add-tags [:client.placeholder]))) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 0f790efda..94a97ab9c 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -12,6 +12,7 @@ (:require-macros [crate.def-macros :refer [defpartial]] [lt.macros :refer [behavior defui]])) +(def console (object/create ::console)) (def console-limit 50) (def util-inspect (.-inspect (js/require "util"))) (def logs-dir (files/lt-user-dir "logs")) @@ -30,6 +31,30 @@ (when core-log (.write core-log thing))) +(defn log + ([l class] (log l class nil)) + ([l class str-content] + (when-not (= "" l) + (let [$console (->ui console)] + (when (or (string? l) str-content) (write-to-log (if (string? l) + l + str-content)) + (write $console (->item [:pre (if-not (dom-like? l) + (pr-str l) + l)] class)) + (dom/scroll-top $console 10000000000) + nil))))) + +(defn error [e] + (status-bar/console-class "error") + (log (str (if (.-stack e) + (.-stack e) + (let [pr-e (pr-str e)] + (if (not= pr-e "[object Object]") + pr-e + (str e))))) + "error")) + (defui console-ui [this] [:ul.console] :contextmenu (fn [e] @@ -115,30 +140,6 @@ content)]]]] class)))) -(defn log - ([l class] (log l class nil)) - ([l class str-content] - (when-not (= "" l) - (let [$console (->ui console)] - (when (or (string? l) str-content) (write-to-log (if (string? l) - l - str-content)) - (write $console (->item [:pre (if-not (dom-like? l) - (pr-str l) - l)] class)) - (dom/scroll-top $console 10000000000) - nil))))) - -(defn error [e] - (status-bar/console-class "error") - (log (str (if (.-stack e) - (.-stack e) - (let [pr-e (pr-str e)] - (if (not= pr-e "[object Object]") - pr-e - (str e))))) - "error")) - (defn clear [] (dom/empty (->ui console))) @@ -150,8 +151,6 @@ (console-ui this) )) -(def console (object/create ::console)) - (behavior ::menu+ :triggers #{:menu+} :reaction (fn [this items event] diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index f22896701..f4151a7e9 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -2,6 +2,7 @@ (:require [lt.object :as object]) (:require-macros [lt.macros :refer [behavior]])) +(def ctx-obj (object/create ::context)) (def contexts (atom #{})) (def groups (atom {})) (def ctx->obj (atom {})) @@ -17,13 +18,16 @@ (defn in? [k] (@contexts k)) -(defn out! [ctxs] - (let [ctxs (if (coll? ctxs) - ctxs - [ctxs])] - (swap! contexts #(apply disj % ctxs)) - (swap! ctx->obj #(apply dissoc % ctxs)) - (object/raise ctx-obj :log!))) +(defn out! + ([] (out! nil)) + ([ctxs] + (let [ctxs (if (coll? ctxs) + ctxs + [ctxs])] + (swap! contexts #(apply disj % ctxs)) + (swap! ctx->obj #(apply dissoc % ctxs)) + (object/raise ctx-obj :log!)))) + (defn in! [ctxs & [obj]] (let [ctxs (if (coll? ctxs) @@ -73,6 +77,3 @@ :history cljs.core.PersistentQueue.EMPTY :buffer-size 8 :init (fn [this])) - - -(def ctx-obj (object/create ::context)) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 2ea2782c3..6c4f8f6e9 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -25,6 +25,11 @@ (def home-path (files/lt-home "")) (def get-proxy (.-App.getProxyForURL (js/require "nw.gui"))) +(defn tar-path [v] + (if (cache/fetch :edge) + (str "http://temp2.kodowa.com.s3.amazonaws.com/playground/releases/" v ".tar.gz") + (str "https://d35ac8ww5dfjyg.cloudfront.net/playground/releases/" v ".tar.gz"))) + (def version-regex #"^\d+\.\d+\.\d+(-.*)?$") (defn get-versions [] @@ -66,11 +71,6 @@ (defn mac-resources-path [p] (.resolve fs-path (exec-path) (files/join "../../../../../Resources" p))) -(defn tar-path [v] - (if (cache/fetch :edge) - (str "http://temp2.kodowa.com.s3.amazonaws.com/playground/releases/" v ".tar.gz") - (str "https://d35ac8ww5dfjyg.cloudfront.net/playground/releases/" v ".tar.gz"))) - (defn download-file [from to cb] (let [options (js-obj "url" from "headers" (js-obj "User-Agent" "Light Table")) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 393fc2410..4fb9a5889 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -187,15 +187,15 @@ (defn ->stats [path] (-> (path->doc path) deref :mtime)) +(defn update-stats [path] + (object/merge! (get-in @manager [:files path]) {:mtime (files/stats path)})) + (defn move-doc [old neue] (when-let [old-d (path->doc old)] (object/update! manager [:files] assoc neue old-d) (object/update! manager [:files] dissoc old) (update-stats neue))) -(defn update-stats [path] - (object/merge! (get-in @manager [:files path]) {:mtime (files/stats path)})) - (defn save* [path content cb] (files/save path content (fn [data] (update-stats path) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 30f393d55..484cad9bb 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -17,6 +17,35 @@ (def gui (js/require "nw.gui")) +(defn ->cm-ed [e] + (if (satisfies? IDeref e) + (:ed @e) + e)) + +(defn ->elem [e] + (.-parentElement (.getScrollerElement (->cm-ed e)))) + +(defn set-val [e v] + (. (->cm-ed e) (setValue (or v ""))) + e) + +(defn set-options [e m] + (doseq [[k v] m] + (.setOption (->cm-ed e) (name k) v)) + e) + +(defn clear-history [e] + (.clearHistory (->cm-ed e)) + e) + +(defn get-history [e] + (.getHistory (->cm-ed e))) + +(defn set-history [e v] + (.setHistory (->cm-ed e) v) + e) + + ;;********************************************************* ;; commands ;;********************************************************* @@ -55,11 +84,6 @@ (.swapDoc e (-> (:doc context) deref :doc))) e)) -(defn ->cm-ed [e] - (if (satisfies? IDeref e) - (:ed @e) - e)) - (defn on [ed ev func] (.on (->cm-ed ed) (name ev) func)) @@ -99,9 +123,6 @@ (defn ->coords [e] (js->clj (.cursorCoords (->cm-ed e)) :keywordize-keys true :force-obj true)) -(defn ->elem [e] - (.-parentElement (.getScrollerElement (->cm-ed e)))) - (defn +class [e klass] (add-class (->elem e) (name klass)) e) @@ -122,10 +143,6 @@ (defn pos->index [e pos] (.indexFromPos (->cm-ed e) (clj->js pos))) -(defn set-val [e v] - (. (->cm-ed e) (setValue (or v ""))) - e) - (defn mark [e from to opts] (.markText (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) @@ -138,11 +155,6 @@ (defn option [e o] (.getOption (->cm-ed e) (name o))) -(defn set-options [e m] - (doseq [[k v] m] - (.setOption (->cm-ed e) (name k) v)) - e) - (defn set-mode [e m] (.setOption (->cm-ed e) "mode" m) e) @@ -218,6 +230,9 @@ half-h (/ (.-offsetHeight (.getScrollerElement (->cm-ed ed))) 2)] (scroll-to ed nil (- y half-h -55)))) +(defn selection? [e] + (.somethingSelected (->cm-ed e))) + (defn selection-bounds [e] (when (selection? e) {:from (->cursor e"start") @@ -226,9 +241,6 @@ (defn selection [e] (.getSelection (->cm-ed e))) -(defn selection? [e] - (.somethingSelected (->cm-ed e))) - (defn set-selection [e start end] (.setSelection (->cm-ed e) (clj->js start) (clj->js end))) @@ -254,22 +266,6 @@ (defn paste [e] (replace-selection e (platform/paste))) -(defn select-all [e] - (set-selection e - {:line (first-line e) :ch 0} - {:line (last-line e)})) - -(defn clear-history [e] - (.clearHistory (->cm-ed e)) - e) - -(defn get-history [e] - (.getHistory (->cm-ed e))) - -(defn set-history [e v] - (.setHistory (->cm-ed e) v) - e) - (defn char-coords [e pos] (js->clj (.charCoords (->cm-ed e) (clj->js pos)) :keywordize-keys true :force-obj true)) @@ -294,13 +290,6 @@ (defn line [e l] (.getLine (->cm-ed e) l)) -(defn set-line [e l text] - (let [length (line-length e l)] - (replace e - {:line l :ch 0} - {:line l :ch length} - text))) - (defn first-line [e] (.firstLine (->cm-ed e))) @@ -316,6 +305,18 @@ (defn line-length [e l] (count (line e l))) +(defn select-all [e] + (set-selection e + {:line (first-line e) :ch 0} + {:line (last-line e)})) + +(defn set-line [e l text] + (let [length (line-length e l)] + (replace e + {:line l :ch 0} + {:line l :ch length} + text))) + (defn +line-class [e lh plane class] (.addLineClass (->cm-ed e) lh (name plane) (name class))) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 3a75e9386..5e42a2397 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -68,6 +68,17 @@ (def pool (object/create ::pool)) +(defn last-active [] + (let [l (:last @pool)] + (when (and l @l) + l))) + +(defn focus-last [] + (when-let [ed (last-active)] + (when-let [ed (:ed @ed)] + (dom/focus js/document.body) + (editor/focus ed)))) + (behavior ::track-active :triggers #{:active} :reaction (fn [this] @@ -146,6 +157,22 @@ (object/raise ed :save))} {:label "ok"}]})) +(def syntax-selector (cmd/filter-list {:items (fn [] + (sort-by :name (-> @files/files-obj :types vals))) + :key :name + :placeholder "Syntax"})) + +(defn set-syntax [ed new-syn] + (let [prev-info (-> @ed :info)] + (when prev-info + (object/remove-tags ed (:tags prev-info))) + (object/update! ed [:info] merge (dissoc new-syn :name)) + (editor/set-mode ed (:mime new-syn)) + (object/add-tags ed (:tags new-syn)))) + +(defn set-syntax-by-path [ed path] + (set-syntax ed (files/path->type path))) + (behavior ::watched.delete :triggers #{:watched.delete} :reaction (fn [ws del] @@ -181,17 +208,6 @@ (doc/move-doc old neue-path) ))))) -(defn last-active [] - (let [l (:last @pool)] - (when (and l @l) - l))) - -(defn focus-last [] - (when-let [ed (last-active)] - (when-let [ed (:ed @ed)] - (dom/focus js/document.body) - (editor/focus ed)))) - (defn create [info] (let [ed (object/create :lt.objs.editor/editor info)] (object/add-tags ed (:tags info [])) @@ -206,23 +222,6 @@ :exec (fn [] (focus-last))}) - -(def syntax-selector (cmd/filter-list {:items (fn [] - (sort-by :name (-> @files/files-obj :types vals))) - :key :name - :placeholder "Syntax"})) - -(defn set-syntax [ed new-syn] - (let [prev-info (-> @ed :info)] - (when prev-info - (object/remove-tags ed (:tags prev-info))) - (object/update! ed [:info] merge (dissoc new-syn :name)) - (editor/set-mode ed (:mime new-syn)) - (object/add-tags ed (:tags new-syn)))) - -(defn set-syntax-by-path [ed path] - (set-syntax ed (files/path->type path))) - (behavior ::set-syntax :triggers #{:select} :reaction (fn [this v] diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 060ddf370..fd7f261b5 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -18,6 +18,8 @@ [lt.objs.platform :as platform]) (:require-macros [lt.macros :refer [behavior defui]])) +(def evaler (object/create ::evaler)) + (defui button [label & [cb]] [:div.button.right label] :click (fn [] @@ -138,8 +140,6 @@ :tags #{:evaler} :init (fn [])) -(def evaler (object/create ::evaler)) - (object/add-behavior! clients/clients ::on-connect-check-queue) (defn try-read [r] @@ -330,6 +330,11 @@ ;; underline result ;;**************************************************** +(defn ->spacing [text] + (when text + (-> (re-seq #"^\s+" text) + (first)))) + (defui ->underline-result [this info] [:div {:class (str "underline-result " (when (-> info :class) (:class info)))} [:span.spacer (->spacing (ed/line (:ed info) (-> info :loc :line)))] @@ -386,11 +391,6 @@ ;; inline exception ;;**************************************************** -(defn ->spacing [text] - (when text - (-> (re-seq #"^\s+" text) - (first)))) - (defn ->exception-class [this] (str "inline-exception " (when (:open this) "open" @@ -418,7 +418,7 @@ :triggers #{:clear!} :reaction (fn [this] (when (ed/->cm-ed (:ed @this)) - (ed/remove-line-widget (ed/->cm-ed (:ed @this)) (:widget @this)))i + (ed/remove-line-widget (ed/->cm-ed (:ed @this)) (:widget @this))) (object/raise this :clear) (object/raise this :cleared))) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 00f196d1f..4ccf1ca11 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -16,6 +16,11 @@ (first path) path))) +(def files-obj (object/create (object/object* ::files + :tags [:files] + :exts {} + :types {}))) + (defn typelist->index [cur types] (let [full (map (juxt :name identity) types) ext (for [cur types @@ -24,6 +29,12 @@ {:types (into (:types cur {}) full) :exts (into (:exts cur {}) ext)})) +(def line-ending (.-EOL os)) +(def separator (.-sep fpath)) +(def available-drives #{}) +(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") +(def pwd (.resolve fpath ".")) + (behavior ::file-types :triggers #{:object.instant} :type :user @@ -43,18 +54,6 @@ :reaction (fn [this pattern] (set! ignore-pattern (js/RegExp. pattern)))) - -(def files-obj (object/create (object/object* ::files - :tags [:files] - :exts {} - :types {}))) - -(def line-ending (.-EOL os)) -(def separator (.-sep fpath)) -(def available-drives #{}) -(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") -(def pwd (.resolve fpath ".")) - (when (= separator "\\") (.exec (js/require "child_process") "wmic logicaldisk get name" (fn [_ out _] @@ -124,6 +123,45 @@ (not n) "\r\n" :else "\n"))) +(defn exists? [path] + (.existsSync fs path)) + +(defn stats [path] + (when (exists? path) + (.statSync fs path))) + +(defn dir? [path] + (when (exists? path) + (let [stat (.statSync fs path)] + (.isDirectory stat)))) + +(defn file? [path] + (when (exists? path) + (let [stat (.statSync fs path)] + (.isFile stat)))) + +(defn absolute? [path] + (boolean (re-seq #"^[\\\/]|([\w]+:[\\\/])" path))) + +(defn writable? [path] + (let [perm (-> (.statSync fs path) + (.mode.toString 8) + (js/parseInt 10) + (str)) + perm (subs perm (- (count perm) 3))] + (#{"7" "6" "3" "2"} (first perm)))) + +(defn resolve [base cur] + (.resolve fpath base cur)) + +(defn real-path [c] + (.realpathSync fs c)) + +(defn ->file|dir [path f] + (if (dir? (str path separator f)) + (str f separator) + (str f))) + (defn bomless-read [path] (let [content (.readFileSync fs path "utf-8")] (string/replace content "\uFEFF" ""))) @@ -216,6 +254,9 @@ (defn mkdir [path] (.mkdirSync fs path)) +(defn parent [path] + (.dirname fpath path)) + (defn next-available-name [path] (if-not (exists? path) path @@ -228,45 +269,6 @@ cur (recur (inc x) (join p (str name (inc x) (when ext (str "." ext)))))))))) -(defn exists? [path] - (.existsSync fs path)) - -(defn stats [path] - (when (exists? path) - (.statSync fs path))) - -(defn dir? [path] - (when (exists? path) - (let [stat (.statSync fs path)] - (.isDirectory stat)))) - -(defn file? [path] - (when (exists? path) - (let [stat (.statSync fs path)] - (.isFile stat)))) - -(defn absolute? [path] - (boolean (re-seq #"^[\\\/]|([\w]+:[\\\/])" path))) - -(defn writable? [path] - (let [perm (-> (.statSync fs path) - (.mode.toString 8) - (js/parseInt 10) - (str)) - perm (subs perm (- (count perm) 3))] - (#{"7" "6" "3" "2"} (first perm)))) - -(defn resolve [base cur] - (.resolve fpath base cur)) - -(defn real-path [c] - (.realpathSync fs c)) - -(defn ->file|dir [path f] - (if (dir? (str path separator f)) - (str f separator) - (str f))) - (defn ls ([path] (ls path nil)) ([path cb] @@ -298,15 +300,15 @@ (catch js/global.Error e (js/lt.objs.console.error e)))) +(defn join [& segs] + (apply (.-join fpath) (filter string? (map str segs)))) + (defn dirs [path] (try (filter dir? (map (partial join path) (.readdirSync fs path))) (catch js/Error e) (catch js/global.Error e))) -(defn join [& segs] - (apply (.-join fpath) (filter string? (map str segs)))) - (defn home ([] (home nil)) ([path] @@ -346,9 +348,6 @@ f)] [(.basename fpath f) path])) -(defn parent [path] - (.dirname fpath path)) - (defn path-segs [path] (let [segs (.split path separator) segs (if (or (.extname fpath (last segs)) diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 3ec89c7be..f8284e6eb 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -14,6 +14,8 @@ (:require-macros [lt.macros :refer [behavior defui]])) (def find-height 30) +(def bar (object/create ::find-bar)) +(status-bar/add-container bar) (defui input [this] [:input.find {:type "text" @@ -155,8 +157,6 @@ )) -(def bar (object/create ::find-bar)) -(status-bar/add-container bar) (cmd/command {:command :find.show :desc "Find: In current editor" diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 48fae77cd..98ae150e0 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -9,6 +9,8 @@ [lt.util.cljs :refer [js->clj]]) (:require-macros [lt.macros :refer [behavior background defui]])) +(def helper (object/create ::helper)) + (def parser (background (fn [obj-id contents] (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) (.-StringStream)) @@ -205,5 +207,3 @@ :line (:line loc) :ed ed})) (set-param this param-idx)))) - -(def helper (object/create ::helper)) diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index 3e9d0aaf0..e1948d792 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -8,6 +8,8 @@ [lt.util.cljs :refer [js->clj]]) (:require-macros [lt.macros :refer [behavior background defui]])) +(def helper (object/create ::helper)) + (def parser (background (fn [obj-id contents] (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) (.-StringStream)) @@ -152,5 +154,3 @@ :line (:line loc) :ed ed})) (set-param this param-idx)))) - -(def helper (object/create ::helper)) From 00937c0b4d502730b740dd96403e290218aa5694 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Wed, 15 Oct 2014 01:15:16 +0300 Subject: [PATCH 233/656] Reorder refs to reduce number of undeclared var warnings --- src/lt/objs/console.cljs | 38 ++++----- src/lt/objs/files.cljs | 6 +- src/lt/objs/menu.cljs | 14 ++-- src/lt/objs/notifos.cljs | 30 +++---- src/lt/objs/opener.cljs | 3 +- src/lt/objs/plugins.cljs | 90 ++++++++++---------- src/lt/objs/search.cljs | 4 +- src/lt/objs/settings.cljs | 125 ++++++++++++++-------------- src/lt/objs/sidebar/clients.cljs | 18 ++-- src/lt/objs/sidebar/navigate.cljs | 7 +- src/lt/objs/sidebar/workspace.cljs | 26 +++--- src/lt/objs/status_bar.cljs | 24 +++--- src/lt/objs/tabs.cljs | 129 ++++++++++++++--------------- src/lt/objs/thread.cljs | 3 +- src/lt/objs/workspace.cljs | 76 ++++++++--------- src/lt/plugins/auto_complete.cljs | 24 +++--- src/lt/plugins/doc.cljs | 6 +- 17 files changed, 312 insertions(+), 311 deletions(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 94a97ab9c..bf420689c 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -25,7 +25,23 @@ (catch js/Error e (.error js/console (str "Failed to initialize the log writer: " e))))) -(.on js/process "uncaughtException" #(error %)) +(defn ->ui [c] + (object/->content c)) + +(defpartial ->item [l & [class]] + [:li {:class class} l]) + +(defn dom-like? [thing] + (or (vector? thing) + (.-nodeType thing) + (string? thing))) + +(defn write [$console msg] + (when (> (count (dom/children $console)) (dec console-limit)) + (dom/remove (aget (dom/children $console) 0))) + (when-not (bottombar/active? console) + (status-bar/dirty)) + (append $console msg)) (defn write-to-log [thing] (when core-log @@ -55,6 +71,8 @@ (str e))))) "error")) +(.on js/process "uncaughtException" #(error %)) + (defui console-ui [this] [:ul.console] :contextmenu (fn [e] @@ -86,24 +104,6 @@ (defn inspect [thing] (util-inspect thing false 2)) -(defn dom-like? [thing] - (or (vector? thing) - (.-nodeType thing) - (string? thing))) - -(defpartial ->item [l & [class]] - [:li {:class class} l]) - -(defn ->ui [c] - (object/->content c)) - -(defn write [$console msg] - (when (> (count (dom/children $console)) (dec console-limit)) - (dom/remove (aget (dom/children $console) 0))) - (when-not (bottombar/active? console) - (status-bar/dirty)) - (append $console msg)) - (defn verbatim ([thing class] (verbatim thing class nil)) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 4ccf1ca11..bf7c9656b 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -35,6 +35,9 @@ (def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") (def pwd (.resolve fpath ".")) +(defn join [& segs] + (apply (.-join fpath) (filter string? (map str segs)))) + (behavior ::file-types :triggers #{:object.instant} :type :user @@ -300,9 +303,6 @@ (catch js/global.Error e (js/lt.objs.console.error e)))) -(defn join [& segs] - (apply (.-join fpath) (filter string? (map str segs)))) - (defn dirs [path] (try (filter dir? (map (partial join path) (.readdirSync fs path))) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 2dcdf3695..ddbc0e065 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -20,12 +20,7 @@ (def menu-instance (create-menu)) -(defn submenu [items] - (let [menu (create-menu)] - (doseq [i items - :when i] - (.append menu (menu-item i))) - menu)) +(declare submenu) (defn menu-item [opts] (let [mi (.-MenuItem gui) @@ -44,6 +39,13 @@ opts)] (mi. (clj->js opts)))) +(defn submenu [items] + (let [menu (create-menu)] + (doseq [i items + :when i] + (.append menu (menu-item i))) + menu)) + (defn clear! [menu] (let [m (or menu menu-instance)] (dotimes [i (.-items.length m)] diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 430dd11ee..6cb2170ef 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -8,26 +8,14 @@ (def standard-timeout 10000) -(defn working - ([] (working nil)) - ([msg] - (when msg - (set-msg! msg)) - (status-bar/loader-inc))) - -(defn done-working - ([] - (status-bar/loader-dec)) - ([msg] - (set-msg! msg) - (status-bar/loader-dec))) - (defn msg* [m & [opts]] (let [m (if (string? m) m (pr-str m))] (object/merge! status-bar/status-loader (merge {:message m :class ""} opts)))) +(declare cur-timeout) + (defn set-msg! ([msg] (msg* msg) @@ -39,6 +27,20 @@ (set! cur-timeout (wait (or (:timeout opts) standard-timeout) #(msg* ""))))) +(defn working + ([] (working nil)) + ([msg] + (when msg + (set-msg! msg)) + (status-bar/loader-inc))) + +(defn done-working + ([] + (status-bar/loader-dec)) + ([msg] + (set-msg! msg) + (status-bar/loader-dec))) + (cmd/command {:command :reset-working :desc "Status Bar: Reset working indicator" :exec (fn [] diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 893601d2b..830662e20 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -18,6 +18,8 @@ (:use-macros [crate.def-macros :only [defpartial]] [lt.macros :only [behavior defui]])) +(def opener (object/create ::opener)) + ;;********************************************************** ;; transient docs ;;********************************************************** @@ -216,7 +218,6 @@ :behaviors [::open-standard-editor] :init (fn [this])) -(def opener (object/create ::opener)) (cmd/command {:command :new-file :desc "File: New file" diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 50f008b09..1a6c695a7 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -128,51 +128,6 @@ (vals) (seq)))) -(defn install-missing [missing] - (let [counter (atom (count missing)) - count-down (fn [] - (swap! counter dec) - ;;then install the actual plugin - (when (<= @counter 0) - (cmd/exec! :behaviors.reload) - (object/raise manager :refresh!) - (notifos/set-msg! "All missing dependencies installed.") - ))] - ;;first get and install all the deps - ;;count them down and then install the real plugin and reload. - (doseq [dep missing] - (discover-deps dep count-down)))) - -(defn available-plugins [] - (let [ds (concat (files/dirs user-plugins-dir) - (files/dirs plugins-dir)) - plugins (->> ds - (map plugin-info) - (filterv identity)) - final (-> (reduce (fn [final p] - (if-let [cur (get final (:name p))] - ;;check if it's newer - (if (deploy/is-newer? (:version cur) (:version p)) - (assoc! final (:name p) p) - final) - (assoc! final (:name p) p))) - (transient {}) - plugins) - (persistent!)) - missing? (missing-deps final)] - (when missing? - (popup/popup! {:header "Some plugin dependencies are missing." - :body [:div - [:span "We found that the following plugin dependencies are missing: "] - (for [{:keys [name version]} missing?] - [:div name " " version " "]) - [:span "Would you like us to install them?"]] - :buttons [{:label "Cancel"} - {:label "Install all" - :action (fn [] - (install-missing missing?))}]})) - final)) - (defn outdated? [plugin] (let [cached (-> @manager :version-cache (get (:name plugin)))] (if cached @@ -302,6 +257,51 @@ (install-failed (or (-> plugin :name) (-> plugin :info :name))) (transitive-install plugin (EOF-read data) cb))))) +(defn install-missing [missing] + (let [counter (atom (count missing)) + count-down (fn [] + (swap! counter dec) + ;;then install the actual plugin + (when (<= @counter 0) + (cmd/exec! :behaviors.reload) + (object/raise manager :refresh!) + (notifos/set-msg! "All missing dependencies installed.") + ))] + ;;first get and install all the deps + ;;count them down and then install the real plugin and reload. + (doseq [dep missing] + (discover-deps dep count-down)))) + +(defn available-plugins [] + (let [ds (concat (files/dirs user-plugins-dir) + (files/dirs plugins-dir)) + plugins (->> ds + (map plugin-info) + (filterv identity)) + final (-> (reduce (fn [final p] + (if-let [cur (get final (:name p))] + ;;check if it's newer + (if (deploy/is-newer? (:version cur) (:version p)) + (assoc! final (:name p) p) + final) + (assoc! final (:name p) p))) + (transient {}) + plugins) + (persistent!)) + missing? (missing-deps final)] + (when missing? + (popup/popup! {:header "Some plugin dependencies are missing." + :body [:div + [:span "We found that the following plugin dependencies are missing: "] + (for [{:keys [name version]} missing?] + [:div name " " version " "]) + [:span "Would you like us to install them?"]] + :buttons [{:label "Cancel"} + {:label "Install all" + :action (fn [] + (install-missing missing?))}]})) + final)) + (defn uninstall [plugin] (files/delete! (:dir plugin)) (object/raise manager :refresh!)) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index fbef9588e..fc94cbfc0 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -19,6 +19,8 @@ [lt.objs.editor.pool :as pool]) (:require-macros [lt.macros :refer [behavior defui extract foreach background]])) +(def searcher (object/create ::workspace-search)) + (def search! (background (fn [obj-id opts] (let [replacer (js/require (str js/ltpath "/core/node_modules/replace")) search (if-let [pattern (re-seq #"^/(.+)/$" (:search opts))] @@ -272,5 +274,3 @@ :hidden true :exec (fn [] (object/raise searcher :replace!))}) - -(def searcher (object/create ::workspace-search)) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ea260cd0d..68de9394b 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -88,12 +88,6 @@ (reset! object/negated-tags (or (:- final) {})) (reset! object/tags (or (:+ final) {})))) -(defn refresh-diffed [diff] - (->> (concat (keys (:+ diff)) - (keys (:- diff))) - (mapcat object/by-tag) - (refresh-all))) - (defn refresh-all [objs] (if-not (seq objs) (do @@ -109,6 +103,68 @@ (js/process.nextTick (fn [] (refresh-all (next objs))))))) +(defn refresh-diffed [diff] + (->> (concat (keys (:+ diff)) + (keys (:- diff))) + (mapcat object/by-tag) + (refresh-all))) + + +(defn ->ordered-keystr [k] + (let [char (if (= (last k) "-") + "-" + (-> (string/split k "-") last))] + (str (when (str-contains? k "ctrl") + "ctrl-") + (when (str-contains? k "cmd") + "cmd-") + (when (str-contains? k "meta") + "meta-") + (when (str-contains? k "altgr") + "altgr-") + (when (str-contains? k "alt") + "alt-") + (when (str-contains? k "shift") + "shift-") + char))) + + +(defn fix-key [k] + (let [k (string/replace k "pmeta" kb/meta) + keys (string/split k " ")] + ;;ctrl cmd alt altgr shift + (reduce #(str % " " %2) (map ->ordered-keystr keys)))) + +(defn fix-key-entry [[k v]] + [(fix-key k) v]) + +(defn +keys [cur m] + (reduce (fn [res [k v]] + (update-in res [k] #(into (or % {}) (map fix-key-entry v)))) + cur + m)) + +(defn -keys [cur m] + (reduce (fn [res [k v]] + (update-in res [k] #(apply dissoc % (map fix-key (if (map? v) + (keys v) + v))))) + cur + m)) + +(defn key-diff [{add :+ rem :-} final] + (-> final + (-keys rem) + (+keys add))) + +(defn load-all-keys [] + (let [final (reduce (fn [fin cur] + (key-diff cur fin)) + {} + (concat (object/raise-reduce app/app :keymap.diffs.default+ []) + (object/raise-reduce app/app :keymap.diffs.plugin+ []) + (object/raise-reduce app/app :keymap.diffs.user+ [])))] + (reset! kb/keys final))) ;;********************************************************* ;; Behaviors @@ -245,54 +301,6 @@ :reaction (fn [this] (tabs/rem! this))) - -(defn ->ordered-keystr [k] - (let [char (if (= (last k) "-") - "-" - (-> (string/split k "-") last))] - (str (when (str-contains? k "ctrl") - "ctrl-") - (when (str-contains? k "cmd") - "cmd-") - (when (str-contains? k "meta") - "meta-") - (when (str-contains? k "altgr") - "altgr-") - (when (str-contains? k "alt") - "alt-") - (when (str-contains? k "shift") - "shift-") - char))) - - -(defn fix-key [k] - (let [k (string/replace k "pmeta" kb/meta) - keys (string/split k " ")] - ;;ctrl cmd alt altgr shift - (reduce #(str % " " %2) (map ->ordered-keystr keys)))) - -(defn fix-key-entry [[k v]] - [(fix-key k) v]) - -(defn +keys [cur m] - (reduce (fn [res [k v]] - (update-in res [k] #(into (or % {}) (map fix-key-entry v)))) - cur - m)) - -(defn -keys [cur m] - (reduce (fn [res [k v]] - (update-in res [k] #(apply dissoc % (map fix-key (if (map? v) - (keys v) - v))))) - cur - m)) - -(defn key-diff [{add :+ rem :-} final] - (-> final - (-keys rem) - (+keys add))) - (defn parse-key-file [file final] (-> (files/open-sync file) :content @@ -305,15 +313,6 @@ (files/full-path-ls path)) (map parse-key-file)))) -(defn load-all-keys [] - (let [final (reduce (fn [fin cur] - (key-diff cur fin)) - {} - (concat (object/raise-reduce app/app :keymap.diffs.default+ []) - (object/raise-reduce app/app :keymap.diffs.plugin+ []) - (object/raise-reduce app/app :keymap.diffs.user+ [])))] - (reset! kb/keys final))) - (behavior ::default-keymap-diffs :triggers #{:keymap.diffs.default+} :reaction (fn [this diffs] diff --git a/src/lt/objs/sidebar/clients.cljs b/src/lt/objs/sidebar/clients.cljs index 81640d266..61f991270 100644 --- a/src/lt/objs/sidebar/clients.cljs +++ b/src/lt/objs/sidebar/clients.cljs @@ -12,6 +12,10 @@ [crate.binding :refer [bound map-bound subatom]]) (:require-macros [lt.macros :refer [behavior defui]])) +(def clients (object/create ::sidebar.clients)) + +(sidebar/add-item sidebar/rightbar clients) + (defui close-button [i] [:span.button "disconnect"] :click (fn [] @@ -84,6 +88,11 @@ ((:connect i)) )) +(defn connectors [this connectors] + (for [[k c] connectors] + (connection-type this c) + )) + (defui connect-ui [this] [:div {:class (bound this connector?) :tabindex -1} @@ -138,11 +147,6 @@ :reaction (fn [this] (dom/focus (object/->content this)))) -(defn connectors [this connectors] - (for [[k c] connectors] - (connection-type this c) - )) - (object/object* ::sidebar.clients :tags #{:sidebar.clients} :label "connect" @@ -152,10 +156,6 @@ (connect-ui this) )) -(def clients (object/create ::sidebar.clients)) - -(sidebar/add-item sidebar/rightbar clients) - (defn add-connector [c] (object/update! clients [:connectors] assoc (:name c) c)) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index 5e8f3369d..5cc0a80a9 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -16,6 +16,9 @@ (:require-macros [lt.macros :refer [behavior defui background]])) +(def sidebar-navigate (object/create ::sidebar.navigate)) +(sidebar/add-item sidebar/rightbar sidebar-navigate) + (defn file-filters [f] (re-seq files/ignore-pattern f)) @@ -128,10 +131,6 @@ ] ))) -(def sidebar-navigate (object/create ::sidebar.navigate)) - -(sidebar/add-item sidebar/rightbar sidebar-navigate) - (cmd/command {:command :navigate-workspace :desc "Navigate: open navigate" :exec (fn [] diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index b7c880826..93dfd9378 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -16,6 +16,8 @@ (def active-dialog nil) (def gui (js/require "nw.gui")) +(def tree (object/create ::workspace.root)) + (defn menu-item [opts] (let [mi (.-MenuItem gui)] (mi. (clj->js opts)))) @@ -48,6 +50,9 @@ (object/update! p [:files] (fn [cur] (vec (remove #{child} cur)))) (object/update! p [:folders] (fn [cur] (vec (remove #{child} cur)))))) +(defn find-by-path [path] + (first (filter #(= (:path @%) path) (object/by-tag :tree-item)))) + (behavior ::add-ws-folder :triggers #{:workspace.add.folder!} :reaction (fn [this path] @@ -140,9 +145,6 @@ :reaction (fn [this cur] (concat cur (:open-dirs @tree)))) -(defn find-by-path [path] - (first (filter #(= (:path @%) path) (object/by-tag :tree-item)))) - (behavior ::watched.delete :triggers #{:watched.delete} :reaction (fn [ws path] @@ -471,8 +473,6 @@ [:div.tree-root (bound this sub-folders)])) -(def tree (object/create ::workspace.root)) - (defui input [type event] [:input {:type "file" type true :style "display:none;"}] :change (fn [] @@ -510,6 +510,11 @@ :click (fn [] (object/raise this :select!))) +(defui back-button [this] + [:h2 "Select a workspace"] + :click (fn [] + (object/raise this :tree!))) + (defui recents [this rs] [:div (back-button this) @@ -517,10 +522,9 @@ (for [r rs] (object/->content r))]]) -(defui back-button [this] - [:h2 "Select a workspace"] - :click (fn [] - (object/raise this :tree!))) +(def sidebar-workspace (object/create ::sidebar.workspace)) + +(sidebar/add-item sidebar/sidebar sidebar-workspace) (behavior ::recent! :triggers #{:recent!} @@ -631,10 +635,6 @@ :reaction (fn [this] (cmd/exec! :workspace.show))) -(def sidebar-workspace (object/create ::sidebar.workspace)) - -(sidebar/add-item sidebar/sidebar sidebar-workspace) - (cmd/command {:command :workspace.add-folder :desc "Workspace: add folder" :exec (fn [] diff --git a/src/lt/objs/status_bar.cljs b/src/lt/objs/status_bar.cljs index bffd971f5..07b6565b5 100644 --- a/src/lt/objs/status_bar.cljs +++ b/src/lt/objs/status_bar.cljs @@ -94,6 +94,9 @@ (defn ->cursor-str [{:keys [pos]}] [:span.pos (str "" (inc (:line pos)) " / " (inc (:ch pos)))]) +(def status-cursor (object/create ::status.cursor)) +(add-status-item status-cursor) + (behavior ::update-cursor-location :triggers #{:update!} :reaction (fn [this pos] @@ -112,9 +115,6 @@ :reaction (fn [this] (object/raise status-cursor :update! (ed/->cursor this)))) -(def status-cursor (object/create ::status.cursor)) -(add-status-item status-cursor) - ;;********************************************************** ;; loader ;;********************************************************** @@ -156,6 +156,9 @@ (status-item (log this) "left") )) +(def status-loader (object/create ::status.loader)) +(add-status-item status-loader) + (defn loader-set [] (object/merge! status-loader {:loaders 0})) @@ -166,21 +169,21 @@ (if (> (:loaders @status-loader) 0) (object/update! status-loader [:loaders] dec))) -(def status-loader (object/create ::status.loader)) -(add-status-item status-loader) - ;;********************************************************** ;; console list ;;********************************************************** +(defn toggle-class [{:keys [dirty class]}] + (str "console-toggle " (when class (str class " ")) (when (> dirty 0) "dirty"))) + (defui toggle-span [this] [:span {:class (bound this toggle-class)} (bound this :dirty)] :click (fn [] (cmd/exec! :toggle-console))) -(defn toggle-class [{:keys [dirty class]}] - (str "console-toggle " (when class (str class " ")) (when (> dirty 0) "dirty"))) +(def console-toggle (object/create ::status.console-toggle)) +(add-status-item console-toggle) (defn dirty [] (object/update! console-toggle [:dirty] inc)) @@ -196,7 +199,4 @@ :dirty 0 :tags [:status.console-toggle] :init (fn [this] - (status-item (toggle-span this)))) - -(def console-toggle (object/create ::status.console-toggle)) -(add-status-item console-toggle) + (status-item (toggle-span this) ""))) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index d00973fcc..9a8a43c6f 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -16,6 +16,25 @@ (load/js "core/node_modules/lighttable/ui/dragdrop.js" :sync) + +(def multi-def (object* ::multi-editor2 + :tags #{:tabs} + :tabsets [] + :left 0 + :right 0 + :bottom 0 + :init (fn [this] + (let [tabsets (crate/html [:div.tabsets {:style {:bottom (bound (subatom this :tabset-bottom) ->px)}}])] + (object/merge! this {:tabsets-elem tabsets}) + (ctx/in! :tabs this) + [:div#multi {:style {:left (bound (subatom this :left) ->px) + :right (bound (subatom this :right) ->px) + :bottom (bound (subatom this :bottom) ->px)}} + tabsets] + )))) + +(def multi (object/create multi-def)) + (defn ensure-visible [idx tabset] (when-let [cur (aget (dom/$$ ".list li" (object/->content tabset)) idx)] (let [left (.-offsetLeft cur) @@ -33,11 +52,27 @@ (set! (.-scrollLeft gp) (+ (- right pwidth) 50))) )))) - (defn ->index [obj] (when (and obj @obj (::tabset @obj)) (first (first (filter #(= obj (second %)) (map-indexed vector (:objs @(::tabset @obj)))))))) +(defn active! [obj] + (when (and obj + (::tabset @obj)) + (object/merge! (::tabset @obj) {:active-obj obj}) + (object/raise obj :show) + (ensure-visible (->index obj) (::tabset @obj)))) + +(defn update-tab-order [multi children] + (let [ser (if (vector? children) + children + (map #(dom/attr % :pos) children)) + prev-active (:active-obj @multi)] + (object/merge! multi {:objs (mapv (:objs @multi) ser) + :active-obj nil}) + (active! prev-active) + )) + (defn ->name [e] (or (get-in @e [:info :name]) @@ -88,28 +123,6 @@ :tabset multi}) (item this multi e pos))) - -(defn update-tab-order [multi children] - (let [ser (if (vector? children) - children - (map #(dom/attr % :pos) children)) - prev-active (:active-obj @multi)] - (object/merge! multi {:objs (mapv (:objs @multi) ser) - :active-obj nil}) - (active! prev-active) - )) - -(defn move-tab [multi elem] - (let [id (dom/attr elem :obj-id) - idx (dom/index elem) - obj (object/by-id (js/parseInt id)) - cnt (-> @multi :objs count)] - (rem! obj) - (add! obj multi) - (if (> cnt 0) - (update-tab-order multi (vec (concat (range idx) [cnt] (range idx cnt))))) - (active! obj))) - (defn objs-list [multi objs] (let [prev-tabs (filter #(= (:tabset @%) multi) (object/by-tag :tab-label)) item (crate/html @@ -176,6 +189,11 @@ (reduce + 0 (map (comp :width deref) (take-while #(not= cur %) ts))) )) +(defn add-tabset [ts] + (object/update! multi [:tabsets] conj ts) + (dom/append (:tabsets-elem @multi) (object/->content ts)) + ) + (defn spawn-tabset [] (let [ts (object/create ::tabset) width (- 100 (reduce + (map (comp :width deref) (@multi :tabsets))))] @@ -231,32 +249,19 @@ (for [k tabs] (object/->content k))) - -(def multi-def (object* ::multi-editor2 - :tags #{:tabs} - :tabsets [] - :left 0 - :right 0 - :bottom 0 - :init (fn [this] - (let [tabsets (crate/html [:div.tabsets {:style {:bottom (bound (subatom this :tabset-bottom) ->px)}}])] - (object/merge! this {:tabsets-elem tabsets}) - (ctx/in! :tabs this) - [:div#multi {:style {:left (bound (subatom this :left) ->px) - :right (bound (subatom this :right) ->px) - :bottom (bound (subatom this :bottom) ->px)}} - tabsets] - )))) - -(def multi (object/create multi-def)) - (def tabset (object/create ::tabset)) - -(defn add-tabset [ts] - (object/update! multi [:tabsets] conj ts) - (dom/append (:tabsets-elem @multi) (object/->content ts)) - ) +(defn add! + ([obj] (add! obj nil)) + ([obj ts] + (when-let [cur-tabset (or ts (ctx/->obj :tabset))] + (object/add-tags obj [:tabset.tab]) + (object/update! cur-tabset [:objs] conj obj) + (object/merge! obj {::tabset cur-tabset}) + (add-watch (subatom obj [:dirty]) :tabs (fn [_ _ _ cur] + (object/raise cur-tabset :tab.updated) + )) + obj))) (defn rem-tabset ([ts] (rem-tabset ts false)) @@ -290,18 +295,6 @@ (active! active)) )))) -(defn add! - ([obj] (add! obj nil)) - ([obj ts] - (when-let [cur-tabset (or ts (ctx/->obj :tabset))] - (object/add-tags obj [:tabset.tab]) - (object/update! cur-tabset [:objs] conj obj) - (object/merge! obj {::tabset cur-tabset}) - (add-watch (subatom obj [:dirty]) :tabs (fn [_ _ _ cur] - (object/raise cur-tabset :tab.updated) - )) - obj))) - (defn refresh! [obj] (when-let [ts (::tabset @obj)] (object/raise ts :tab.updated))) @@ -316,13 +309,6 @@ (add! obj) (active! obj)))) -(defn active! [obj] - (when (and obj - (::tabset @obj)) - (object/merge! (::tabset @obj) {:active-obj obj}) - (object/raise obj :show) - (ensure-visible (->index obj) (::tabset @obj)))) - (defn num-tabs [] (reduce (fn [res cur] (+ res (count (:objs @cur)))) @@ -339,6 +325,17 @@ (add! obj ts) (active! obj)) +(defn move-tab [multi elem] + (let [id (dom/attr elem :obj-id) + idx (dom/index elem) + obj (object/by-id (js/parseInt id)) + cnt (-> @multi :objs count)] + (rem! obj) + (add! obj multi) + (if (> cnt 0) + (update-tab-order multi (vec (concat (range idx) [cnt] (range idx cnt))))) + (active! obj))) + ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index 4974790a5..2b45702de 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -8,6 +8,8 @@ (def cp (js/require "child_process")) +(def worker (object/create ::worker-thread)) + (behavior ::try-send :triggers #{:try-send!} :reaction (fn [this msg] @@ -101,7 +103,6 @@ ;; the defined functions are sent correctly (object/tag-behaviors :worker-thread [::kill! ::connect ::send! ::queue! ::try-send ::message]) -(def worker (object/create ::worker-thread)) (comment diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index c76322f19..200dc7ccd 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -19,6 +19,8 @@ (def max-depth 10) (def watch-interval 1000) +(def current-ws (object/create ::workspace)) + (defn unwatch [watches path recursive?] (when watches (let [removes (cond @@ -30,6 +32,11 @@ ((:close r))) (apply dissoc watches removes)))) +(defn unwatch! + ([path] (unwatch! path false)) + ([path recursive?] + (object/merge! current-ws {:watches (unwatch (:watches @current-ws) path recursive?)}))) + (defn alert-file [path] (fn [cur prev] (if (.existsSync fs path) @@ -39,21 +46,6 @@ (unwatch! path) (object/raise current-ws :watched.delete path))))) -(defn alert-folder [path] - (fn [cur prev] - (if (.existsSync fs path) - (do - (let [watches (:watches @current-ws) - neue (first (filter #(and (not (get watches %)) - (not (re-seq files/ignore-pattern %))) - (files/full-path-ls path)))] - (when neue - (watch! neue) - (object/raise current-ws :watched.create neue (.statSync fs neue))))) - (do - (unwatch! path :recursive) - (object/raise current-ws :watched.delete path))))) - (defn file->watch [path] (let [alert (alert-file path)] {:path path @@ -61,12 +53,7 @@ :close (fn [] (.unwatchFile fs path alert))})) -(defn folder->watch [path] - (let [alert (alert-folder path)] - {:path path - :alert alert - :close (fn [] - (.unwatchFile fs path alert))})) +(declare folder->watch) (defn watch! ([path] (watch! (transient {}) path nil)) @@ -99,10 +86,27 @@ (when-not (number? recursive?) (object/update! current-ws [:watches] merge (persistent! results))))) -(defn unwatch! - ([path] (unwatch! path false)) - ([path recursive?] - (object/merge! current-ws {:watches (unwatch (:watches @current-ws) path recursive?)}))) +(defn alert-folder [path] + (fn [cur prev] + (if (.existsSync fs path) + (do + (let [watches (:watches @current-ws) + neue (first (filter #(and (not (get watches %)) + (not (re-seq files/ignore-pattern %))) + (files/full-path-ls path)))] + (when neue + (watch! neue) + (object/raise current-ws :watched.create neue (.statSync fs neue))))) + (do + (unwatch! path :recursive) + (object/raise current-ws :watched.delete path))))) + +(defn folder->watch [path] + (let [alert (alert-folder path)] + {:path path + :alert alert + :close (fn [] + (.unwatchFile fs path alert))})) (defn stop-watching [ws] (unwatch! (keys (:watches @ws)))) @@ -146,6 +150,16 @@ (defn new-cached-file [] (str (now) ".clj")) +(defn file->ws [file] + (-> (files/open-sync file) + (:content) + (reader/read-string) + (assoc :path file))) + +(defn save [ws file] + (files/save (files/join workspace-cache-path file) (pr-str (serialize @ws))) + (object/raise ws :save)) + (defn open [ws file] (let [loc (if-not (> (.indexOf file files/separator) -1) (files/join workspace-cache-path file) @@ -158,19 +172,9 @@ (catch js/Error e )))) -(defn save [ws file] - (files/save (files/join workspace-cache-path file) (pr-str (serialize @ws))) - (object/raise ws :save)) - (defn cached [] (filter #(> (.indexOf % ".clj") -1) (files/full-path-ls workspace-cache-path))) -(defn file->ws [file] - (-> (files/open-sync file) - (:content) - (reader/read-string) - (assoc :path file))) - (defn all [] (let [fs (sort > (cached))] ;;if there are more than 20, delete the extras @@ -288,8 +292,6 @@ :init (fn [this] nil)) -(def current-ws (object/create ::workspace)) - (cmd/command {:command :workspace.new :desc "Workspace: Create new workspace" :exec (fn [] diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 1f9511e7b..9d7f0531c 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -25,6 +25,9 @@ (defn current [s] (.current s)) +(defn peek* [s] + (.peek s)) + (defn skip-space [s] (when (and (peek* s) (re-seq #"\s" (peek* s))) (.eatSpace s) @@ -33,9 +36,6 @@ (defn eat-while [s r] (.eatWhile s r)) -(defn peek* [s] - (.peek s)) - (defn string->tokens [str pattern] (let [s (stream str) res (js-obj)] @@ -52,6 +52,12 @@ (skip-space s)) (into-array (map #(do #js {:completion %}) (js/Object.keys res))))) +(def default-pattern #"[\w_$]") + +(defn get-pattern [ed] + (let [mode (editor/inner-mode ed)] + (or (:hint-pattern @ed) (aget mode "hint-pattern") default-pattern))) + (defn get-token [ed pos] (let [line (editor/line ed (:line pos)) pattern (get-pattern ed) @@ -120,12 +126,6 @@ (into-array (map #(do #js {:completion %}) (js/Object.keys res)))))] (js/_send obj-id :hint-tokens (string->tokens (:string m) (:pattern m))))))) -(def default-pattern #"[\w_$]") - -(defn get-pattern [ed] - (let [mode (editor/inner-mode ed)] - (or (:hint-pattern @ed) (aget mode "hint-pattern") default-pattern))) - (defn async-hints [this] (when @this (w this {:string (editor/->val this) @@ -156,6 +156,9 @@ :key text|completion}) (object/add-tags [:hinter]))) +(defn on-line-change [line ch] + (object/raise hinter :line-change line ch)) + (behavior ::textual-hints :triggers #{:hints+} :reaction (fn [this hints] @@ -216,9 +219,6 @@ (ctx/in! [:editor.keys.hinting.active] (:ed @hinter)))) (object/merge! hinter {:token token}))))))) -(defn on-line-change [line ch] - (object/raise hinter :line-change line ch)) - (behavior ::async-hint-tokens :triggers #{:hint-tokens} :reaction (fn [this tokens] diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index 15ab2ef41..f048b7c91 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -215,6 +215,8 @@ ]] )) +(def doc-search nil) + (cmd/command {:command :docs.search.exec :desc "Docs: Execute sidebar search" :hidden true @@ -245,7 +247,3 @@ (set! doc-search (object/create ::sidebar.doc.search)) (sidebar/add-item sidebar/rightbar doc-search) )) - -(def doc-search nil) - - From 9b9873873c9a7bc8ea504586902e0980f107be67 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Wed, 15 Oct 2014 09:12:32 +0300 Subject: [PATCH 234/656] Revert 1bbd7e516df0c3fd6ebdd15aa65bc4a38707ecdd for some files --- src/lt/objs/app.cljs | 49 +++++++------- src/lt/objs/sidebar/command.cljs | 113 ++++++++++++++++--------------- 2 files changed, 82 insertions(+), 80 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index be66c89ff..e66696f25 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -11,7 +11,6 @@ (def win (.Window.get gui)) (def closing true) (def default-zoom 0) -(def app (object/create ::app)) (defn window-number [] (let [n (last (string/split js/window.location.search "="))] @@ -24,6 +23,29 @@ (defn prevent-close [] (set! closing false)) +(defn close + ([] (close false)) + ([force?] + (when force? + (object/raise app :closing) + (object/raise app :closed)) + (.close win force?))) + +(defn refresh [] + (js/window.location.reload true)) + +(defn open-window [] + (let [id (store-swap! :window-id inc) + w (.Window.open gui (str "LightTable.html?id=" id) (clj->js {:toolbar false + :icon "core/img/lticon.png" + :new-instance true + :min_height 400 + :min_width 400 + :frame true + :show false}))] + (set! (.-ltid w) id) + w)) + (defn args [] (when-not (= 0 (.-App.argv.length gui)) (seq (.-App.argv gui)))) @@ -66,29 +88,6 @@ (when (not= (.-zoomLevel win) 0) (.-zoomLevel win))) -(defn close - ([] (close false)) - ([force?] - (when force? - (object/raise app :closing) - (object/raise app :closed)) - (.close win force?))) - -(defn refresh [] - (js/window.location.reload true)) - -(defn open-window [] - (let [id (store-swap! :window-id inc) - w (.Window.open gui (str "LightTable.html?id=" id) (clj->js {:toolbar false - :icon "core/img/lticon.png" - :new-instance true - :min_height 400 - :min_width 400 - :frame true - :show false}))] - (set! (.-ltid w) id) - w)) - ;;********************************************************* ;; Behaviors ;;********************************************************* @@ -224,6 +223,8 @@ :init (fn [this] (ctx/in! :app this))) +(def app (object/create ::app)) + (when (= 0 (window-number)) (store! :window-id 0)) diff --git a/src/lt/objs/sidebar/command.cljs b/src/lt/objs/sidebar/command.cljs index 812246e61..886416532 100644 --- a/src/lt/objs/sidebar/command.cljs +++ b/src/lt/objs/sidebar/command.cljs @@ -69,42 +69,11 @@ (object/merge! this opts) (op-input this))) -(def by-id cmd/by-id) - -(def exec! cmd/exec!) - -(def sidebar-command (object/create ::sidebar.command)) - (defn options-input [opts] (let [lst (object/create ::options-input opts)] (object/raise lst :refresh!) lst)) -(defn ->items [items] - (cond - (satisfies? IDeref items) @items - (fn? items) (items) - :else items)) - -(defn score-sort [x y] - (- (aget y 3) (aget x 3))) - -(defn score-sort2 [x y] - (- (.-score (aget y 4)) (.-score (aget x 4)))) - -(defn indexed-results [{:keys [search size items key size]}] - (let [items (apply array (->items items)) - map-func3 #(array % (key %) (js/fastScore (key %) search) nil nil) - map-func #(do (aset % 3 (.score (aget % 1) search)) %) - map-func2 #(do (aset % 4 (js/score (aget % 1) search)) %) - has-score #(> (.-score (aget % 4)) 0)] - (if-not (empty? search) - (let [score0 (.. items (map map-func3) (filter #(aget % 2))) - score1 (.. score0 (map map-func) (sort score-sort)) - score2 (.. score1 (slice 0 50) (map map-func2) (filter has-score) (sort score-sort2))] - score2) - (.. items (map #(array % (key %) nil nil)))))) - ;;********************************************************** ;; filter list ;;********************************************************** @@ -139,31 +108,6 @@ (- (+ (.-offsetTop elem) (.-offsetHeight elem) 15) (.-clientHeight list))) :else nil))) -(defn fill-lis [{:keys [lis size search selected key transform] :as this} results] - (let [cnt (count results) - cur (mod selected (if (> cnt size) - size - cnt)) - transform (if transform - transform - #(do %3))] - (if (= cnt 0) - (dom/add-class (:content this) :empty) - (dom/remove-class (:content this) :empty)) - (doseq [[i li res] (map vector (range) lis results) - :when res] - (dom/html li (transform (aget res 1) (aget res 4) (if-not (empty? search) - - (js/wrapMatch (aget res 1) (aget res 4)) - (aget res 1)) - (aget res 0))) - (dom/css li {:display "block"}) - (if (= i cur) - (dom/add-class li :selected) - (dom/remove-class li :selected))) - (doseq [li (drop cnt lis)] - (dom/css li {:display "none"})))) - (behavior ::move-selection :triggers #{:move-selection} :reaction (fn [this dir] @@ -271,6 +215,33 @@ (object/raise this :change! (dom/val me))) )) +(defn ->items [items] + (cond + (satisfies? IDeref items) @items + (fn? items) (items) + :else items)) + +(defn score-sort [x y] + (- (aget y 3) (aget x 3))) + +(defn score-sort2 [x y] + (- (.-score (aget y 4)) (.-score (aget x 4)))) + +(defn indexed-results [{:keys [search size items key size]}] + (let [items (apply array (->items items)) + map-func3 #(array % (key %) (js/fastScore (key %) search) nil nil) + map-func #(do (aset % 3 (.score (aget % 1) search)) %) + map-func2 #(do (aset % 4 (js/score (aget % 1) search)) %) + has-score #(> (.-score (aget % 4)) 0)] + (if-not (empty? search) + (let [score0 (.. items (map map-func3) (filter #(aget % 2))) + score1 (.. score0 (map map-func) (sort score-sort)) + score2 (.. score1 (slice 0 50) (map map-func2) (filter has-score) (sort score-sort2))] + score2) + (.. items (map #(array % (key %) nil nil)))))) + + + (defui item [this x] [:li {:index x}] :mousedown (fn [e] @@ -279,6 +250,31 @@ (object/raise this :set-selection! x) (object/raise this :select! x))) +(defn fill-lis [{:keys [lis size search selected key transform] :as this} results] + (let [cnt (count results) + cur (mod selected (if (> cnt size) + size + cnt)) + transform (if transform + transform + #(do %3))] + (if (= cnt 0) + (dom/add-class (:content this) :empty) + (dom/remove-class (:content this) :empty)) + (doseq [[i li res] (map vector (range) lis results) + :when res] + (dom/html li (transform (aget res 1) (aget res 4) (if-not (empty? search) + + (js/wrapMatch (aget res 1) (aget res 4)) + (aget res 1)) + (aget res 0))) + (dom/css li {:display "block"}) + (if (= i cur) + (dom/add-class li :selected) + (dom/remove-class li :selected))) + (doseq [li (drop cnt lis)] + (dom/css li {:display "none"})))) + (object/object* ::filter-list :tags #{:filter-list} :selected 0 @@ -441,6 +437,7 @@ :reaction (fn [app] (object/raise sidebar-command :refresh!))) +(def sidebar-command (object/create ::sidebar.command)) (ctx/in! :commandbar sidebar-command) (sidebar/add-item sidebar/rightbar sidebar-command) @@ -458,6 +455,10 @@ (object/raise sidebar/rightbar :toggle sidebar-command (assoc opts :soft? true)) (object/raise sidebar-command :soft-focus!)) +(def by-id cmd/by-id) + +(def exec! cmd/exec!) + (defn exec-active! [& args] (object/raise sidebar-command :exec-active! args)) From d05f5016c40f83be9ab1efdb541cba4460c59b6e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 15 Oct 2014 08:36:26 -0400 Subject: [PATCH 235/656] Address user confusion around plugin.json vs plugin.edn #1677 #1141 Also addressed whitespace in validate --- src/lt/objs/plugins.cljs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 50f008b09..efe2f7b41 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -84,12 +84,12 @@ ;; Plugin reading ;;********************************************************* -(defn validate [plugin] +(defn validate [plugin filename] (let [valid? (every? plugin [:name :author :behaviors :desc])] (if-not valid? (do - (console/error (str "Invalid plugin.json file: " (:dir plugin) "/plugin.json \nPlugins - must include values for name, version, author, behaviors, and desc.")) + (console/error (str "Invalid " filename " file: " (:dir plugin) "/" filename "\nPlugins " + "must include values for name, version, author, behaviors, and desc.")) nil) plugin))) @@ -97,14 +97,14 @@ (when-let [content (files/open-sync (files/join dir "plugin.edn"))] (-> (EOF-read (:content content)) (assoc :dir dir) - (validate)))) + (validate "plugin.edn")))) (defn plugin-json [dir] (when-let [content (files/open-sync (files/join dir "plugin.json"))] (-> (js/JSON.parse (:content content)) (js->clj :keywordize-keys true) (assoc :dir dir) - (validate)))) + (validate "plugin.json")))) (defn plugin-info [dir] (or (plugin-json dir) (plugin-edn dir))) @@ -322,7 +322,7 @@ p (popup/popup! {:header "Submit a plugin to the central repository" :body [:div [:p "You can submit a github url to add a plugin to the central repository. - All plugin repos must have at least one tag in version format, e.g. 0.1.2 and must have a plugin.json + All plugin repos must have at least one tag in version format, e.g. 0.1.2 and must have a plugin.json or plugin.edn with name, version, desc, and behaviors keys. To refresh the available versions, just resubmit the plugin."] [:label "Github URL for plugin: "] input From 5451b083c936e184a5f7d94b333436b56cf2052e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 15 Oct 2014 08:41:27 -0400 Subject: [PATCH 236/656] Be explicit about version format to prevent #1677 --- src/lt/objs/plugins.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index efe2f7b41..1c596e3c5 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -322,7 +322,7 @@ p (popup/popup! {:header "Submit a plugin to the central repository" :body [:div [:p "You can submit a github url to add a plugin to the central repository. - All plugin repos must have at least one tag in version format, e.g. 0.1.2 and must have a plugin.json or plugin.edn + All plugin repos must have at least one tag in version format X.X.X , e.g. 0.1.2 and must have a plugin.json or plugin.edn with name, version, desc, and behaviors keys. To refresh the available versions, just resubmit the plugin."] [:label "Github URL for plugin: "] input From f12727ffecaa287791e94cd08340b8cbaa4ce05a Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Wed, 15 Oct 2014 23:32:09 +0300 Subject: [PATCH 237/656] Reorder defn only --- src/lt/objs/bottombar.cljs | 8 +++---- src/lt/objs/canvas.cljs | 6 ++--- src/lt/objs/clients.cljs | 4 ++-- src/lt/objs/console.cljs | 12 +++++----- src/lt/objs/context.cljs | 11 ++++----- src/lt/objs/editor/pool.cljs | 11 +++++---- src/lt/objs/eval.cljs | 4 ++-- src/lt/objs/files.cljs | 23 +++++++++--------- src/lt/objs/find.cljs | 4 ++-- src/lt/objs/langs/behaviors.cljs | 4 ++-- src/lt/objs/langs/keymap.cljs | 4 ++-- src/lt/objs/menu.cljs | 1 - src/lt/objs/opener.cljs | 3 +-- src/lt/objs/search.cljs | 4 ++-- src/lt/objs/sidebar/clients.cljs | 8 +++---- src/lt/objs/sidebar/navigate.cljs | 7 +++--- src/lt/objs/sidebar/workspace.cljs | 20 ++++++++-------- src/lt/objs/status_bar.cljs | 19 ++++++++------- src/lt/objs/tabs.cljs | 38 +++++++++++++++--------------- src/lt/objs/thread.cljs | 3 +-- src/lt/objs/workspace.cljs | 5 ++-- src/lt/plugins/auto_complete.cljs | 4 ++-- 22 files changed, 101 insertions(+), 102 deletions(-) diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index 90d950610..50034e8b0 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -22,10 +22,6 @@ (object/raise this :height! e) )) -(def bottombar (object/create ::bottombar)) - -(canvas/add! bottombar) - (defn active-content [active] (when active (object/->content active))) @@ -59,6 +55,10 @@ [:div.content (bound (subatom this :active) active-content)]])) +(def bottombar (object/create ::bottombar)) + +(canvas/add! bottombar) + ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/canvas.cljs b/src/lt/objs/canvas.cljs index c798a9e19..c8e7b308d 100644 --- a/src/lt/objs/canvas.cljs +++ b/src/lt/objs/canvas.cljs @@ -8,9 +8,6 @@ (defui canvas-elem [obj] [:div#canvas]) -(def canvas (object/create ::canvas)) -(append ($ "#wrapper") (object/->content canvas)) - (defn add! [obj & [position?]] (append (object/->content canvas) (object/->content obj)) (object/raise obj :show rep)) @@ -23,6 +20,9 @@ :init (fn [obj] (canvas-elem obj))) +(def canvas (object/create ::canvas)) +(append ($ "#wrapper") (object/->content canvas)) + ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index 0751add96..9a1570d28 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -11,8 +11,6 @@ (defn ->id [obj] (object/->id obj)) -(def clients (object/create ::clients)) - (defn client! [type] (let [obj (object/create ::client)] (object/add-tags obj [type]) @@ -167,6 +165,8 @@ :init (fn [] )) +(def clients (object/create ::clients)) + (behavior ::close-clients-on-closed :triggers #{:closing} :reaction (fn [app] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index bf420689c..e604c8bfb 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -12,7 +12,6 @@ (:require-macros [crate.def-macros :refer [defpartial]] [lt.macros :refer [behavior defui]])) -(def console (object/create ::console)) (def console-limit 50) (def util-inspect (.-inspect (js/require "util"))) (def logs-dir (files/lt-user-dir "logs")) @@ -25,12 +24,10 @@ (catch js/Error e (.error js/console (str "Failed to initialize the log writer: " e))))) +(.on js/process "uncaughtException" #(error %)) (defn ->ui [c] (object/->content c)) -(defpartial ->item [l & [class]] - [:li {:class class} l]) - (defn dom-like? [thing] (or (vector? thing) (.-nodeType thing) @@ -71,8 +68,6 @@ (str e))))) "error")) -(.on js/process "uncaughtException" #(error %)) - (defui console-ui [this] [:ul.console] :contextmenu (fn [e] @@ -104,6 +99,9 @@ (defn inspect [thing] (util-inspect thing false 2)) +(defpartial ->item [l & [class]] + [:li {:class class} l]) + (defn verbatim ([thing class] (verbatim thing class nil)) @@ -151,6 +149,8 @@ (console-ui this) )) +(def console (object/create ::console)) + (behavior ::menu+ :triggers #{:menu+} :reaction (fn [this items event] diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index f4151a7e9..ecfe3334b 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -2,7 +2,6 @@ (:require [lt.object :as object]) (:require-macros [lt.macros :refer [behavior]])) -(def ctx-obj (object/create ::context)) (def contexts (atom #{})) (def groups (atom {})) (def ctx->obj (atom {})) @@ -18,16 +17,13 @@ (defn in? [k] (@contexts k)) -(defn out! - ([] (out! nil)) - ([ctxs] +(defn out! [ctxs] (let [ctxs (if (coll? ctxs) ctxs [ctxs])] (swap! contexts #(apply disj % ctxs)) (swap! ctx->obj #(apply dissoc % ctxs)) - (object/raise ctx-obj :log!)))) - + (object/raise ctx-obj :log!))) (defn in! [ctxs & [obj]] (let [ctxs (if (coll? ctxs) @@ -77,3 +73,6 @@ :history cljs.core.PersistentQueue.EMPTY :buffer-size 8 :init (fn [this])) + + +(def ctx-obj (object/create ::context)) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 5e42a2397..d27383f70 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -157,11 +157,6 @@ (object/raise ed :save))} {:label "ok"}]})) -(def syntax-selector (cmd/filter-list {:items (fn [] - (sort-by :name (-> @files/files-obj :types vals))) - :key :name - :placeholder "Syntax"})) - (defn set-syntax [ed new-syn] (let [prev-info (-> @ed :info)] (when prev-info @@ -222,6 +217,12 @@ :exec (fn [] (focus-last))}) + +(def syntax-selector (cmd/filter-list {:items (fn [] + (sort-by :name (-> @files/files-obj :types vals))) + :key :name + :placeholder "Syntax"})) + (behavior ::set-syntax :triggers #{:select} :reaction (fn [this v] diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index fd7f261b5..0e5aac4d2 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -18,8 +18,6 @@ [lt.objs.platform :as platform]) (:require-macros [lt.macros :refer [behavior defui]])) -(def evaler (object/create ::evaler)) - (defui button [label & [cb]] [:div.button.right label] :click (fn [] @@ -140,6 +138,8 @@ :tags #{:evaler} :init (fn [])) +(def evaler (object/create ::evaler)) + (object/add-behavior! clients/clients ::on-connect-check-queue) (defn try-read [r] diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index bf7c9656b..a22a36705 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -16,11 +16,6 @@ (first path) path))) -(def files-obj (object/create (object/object* ::files - :tags [:files] - :exts {} - :types {}))) - (defn typelist->index [cur types] (let [full (map (juxt :name identity) types) ext (for [cur types @@ -29,12 +24,6 @@ {:types (into (:types cur {}) full) :exts (into (:exts cur {}) ext)})) -(def line-ending (.-EOL os)) -(def separator (.-sep fpath)) -(def available-drives #{}) -(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") -(def pwd (.resolve fpath ".")) - (defn join [& segs] (apply (.-join fpath) (filter string? (map str segs)))) @@ -57,6 +46,18 @@ :reaction (fn [this pattern] (set! ignore-pattern (js/RegExp. pattern)))) + +(def files-obj (object/create (object/object* ::files + :tags [:files] + :exts {} + :types {}))) + +(def line-ending (.-EOL os)) +(def separator (.-sep fpath)) +(def available-drives #{}) +(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") +(def pwd (.resolve fpath ".")) + (when (= separator "\\") (.exec (js/require "child_process") "wmic logicaldisk get name" (fn [_ out _] diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index f8284e6eb..3ec89c7be 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -14,8 +14,6 @@ (:require-macros [lt.macros :refer [behavior defui]])) (def find-height 30) -(def bar (object/create ::find-bar)) -(status-bar/add-container bar) (defui input [this] [:input.find {:type "text" @@ -157,6 +155,8 @@ )) +(def bar (object/create ::find-bar)) +(status-bar/add-container bar) (cmd/command {:command :find.show :desc "Find: In current editor" diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 98ae150e0..48fae77cd 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -9,8 +9,6 @@ [lt.util.cljs :refer [js->clj]]) (:require-macros [lt.macros :refer [behavior background defui]])) -(def helper (object/create ::helper)) - (def parser (background (fn [obj-id contents] (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) (.-StringStream)) @@ -207,3 +205,5 @@ :line (:line loc) :ed ed})) (set-param this param-idx)))) + +(def helper (object/create ::helper)) diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index e1948d792..3e9d0aaf0 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -8,8 +8,6 @@ [lt.util.cljs :refer [js->clj]]) (:require-macros [lt.macros :refer [behavior background defui]])) -(def helper (object/create ::helper)) - (def parser (background (fn [obj-id contents] (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) (.-StringStream)) @@ -154,3 +152,5 @@ :line (:line loc) :ed ed})) (set-param this param-idx)))) + +(def helper (object/create ::helper)) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index ddbc0e065..b155fcb26 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -20,7 +20,6 @@ (def menu-instance (create-menu)) -(declare submenu) (defn menu-item [opts] (let [mi (.-MenuItem gui) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 830662e20..893601d2b 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -18,8 +18,6 @@ (:use-macros [crate.def-macros :only [defpartial]] [lt.macros :only [behavior defui]])) -(def opener (object/create ::opener)) - ;;********************************************************** ;; transient docs ;;********************************************************** @@ -218,6 +216,7 @@ :behaviors [::open-standard-editor] :init (fn [this])) +(def opener (object/create ::opener)) (cmd/command {:command :new-file :desc "File: New file" diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index fc94cbfc0..fbef9588e 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -19,8 +19,6 @@ [lt.objs.editor.pool :as pool]) (:require-macros [lt.macros :refer [behavior defui extract foreach background]])) -(def searcher (object/create ::workspace-search)) - (def search! (background (fn [obj-id opts] (let [replacer (js/require (str js/ltpath "/core/node_modules/replace")) search (if-let [pattern (re-seq #"^/(.+)/$" (:search opts))] @@ -274,3 +272,5 @@ :hidden true :exec (fn [] (object/raise searcher :replace!))}) + +(def searcher (object/create ::workspace-search)) diff --git a/src/lt/objs/sidebar/clients.cljs b/src/lt/objs/sidebar/clients.cljs index 61f991270..8fc881ad4 100644 --- a/src/lt/objs/sidebar/clients.cljs +++ b/src/lt/objs/sidebar/clients.cljs @@ -12,10 +12,6 @@ [crate.binding :refer [bound map-bound subatom]]) (:require-macros [lt.macros :refer [behavior defui]])) -(def clients (object/create ::sidebar.clients)) - -(sidebar/add-item sidebar/rightbar clients) - (defui close-button [i] [:span.button "disconnect"] :click (fn [] @@ -156,6 +152,10 @@ (connect-ui this) )) +(def clients (object/create ::sidebar.clients)) + +(sidebar/add-item sidebar/rightbar clients) + (defn add-connector [c] (object/update! clients [:connectors] assoc (:name c) c)) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index 5cc0a80a9..5e8f3369d 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -16,9 +16,6 @@ (:require-macros [lt.macros :refer [behavior defui background]])) -(def sidebar-navigate (object/create ::sidebar.navigate)) -(sidebar/add-item sidebar/rightbar sidebar-navigate) - (defn file-filters [f] (re-seq files/ignore-pattern f)) @@ -131,6 +128,10 @@ ] ))) +(def sidebar-navigate (object/create ::sidebar.navigate)) + +(sidebar/add-item sidebar/rightbar sidebar-navigate) + (cmd/command {:command :navigate-workspace :desc "Navigate: open navigate" :exec (fn [] diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 93dfd9378..45be6a2af 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -16,8 +16,6 @@ (def active-dialog nil) (def gui (js/require "nw.gui")) -(def tree (object/create ::workspace.root)) - (defn menu-item [opts] (let [mi (.-MenuItem gui)] (mi. (clj->js opts)))) @@ -473,6 +471,8 @@ [:div.tree-root (bound this sub-folders)])) +(def tree (object/create ::workspace.root)) + (defui input [type event] [:input {:type "file" type true :style "display:none;"}] :change (fn [] @@ -510,11 +510,6 @@ :click (fn [] (object/raise this :select!))) -(defui back-button [this] - [:h2 "Select a workspace"] - :click (fn [] - (object/raise this :tree!))) - (defui recents [this rs] [:div (back-button this) @@ -522,9 +517,10 @@ (for [r rs] (object/->content r))]]) -(def sidebar-workspace (object/create ::sidebar.workspace)) - -(sidebar/add-item sidebar/sidebar sidebar-workspace) +(defui back-button [this] + [:h2 "Select a workspace"] + :click (fn [] + (object/raise this :tree!))) (behavior ::recent! :triggers #{:recent!} @@ -635,6 +631,10 @@ :reaction (fn [this] (cmd/exec! :workspace.show))) +(def sidebar-workspace (object/create ::sidebar.workspace)) + +(sidebar/add-item sidebar/sidebar sidebar-workspace) + (cmd/command {:command :workspace.add-folder :desc "Workspace: add folder" :exec (fn [] diff --git a/src/lt/objs/status_bar.cljs b/src/lt/objs/status_bar.cljs index 07b6565b5..95a22c9db 100644 --- a/src/lt/objs/status_bar.cljs +++ b/src/lt/objs/status_bar.cljs @@ -94,9 +94,6 @@ (defn ->cursor-str [{:keys [pos]}] [:span.pos (str "" (inc (:line pos)) " / " (inc (:ch pos)))]) -(def status-cursor (object/create ::status.cursor)) -(add-status-item status-cursor) - (behavior ::update-cursor-location :triggers #{:update!} :reaction (fn [this pos] @@ -115,6 +112,9 @@ :reaction (fn [this] (object/raise status-cursor :update! (ed/->cursor this)))) +(def status-cursor (object/create ::status.cursor)) +(add-status-item status-cursor) + ;;********************************************************** ;; loader ;;********************************************************** @@ -156,9 +156,6 @@ (status-item (log this) "left") )) -(def status-loader (object/create ::status.loader)) -(add-status-item status-loader) - (defn loader-set [] (object/merge! status-loader {:loaders 0})) @@ -169,6 +166,9 @@ (if (> (:loaders @status-loader) 0) (object/update! status-loader [:loaders] dec))) +(def status-loader (object/create ::status.loader)) +(add-status-item status-loader) + ;;********************************************************** ;; console list ;;********************************************************** @@ -182,8 +182,6 @@ :click (fn [] (cmd/exec! :toggle-console))) -(def console-toggle (object/create ::status.console-toggle)) -(add-status-item console-toggle) (defn dirty [] (object/update! console-toggle [:dirty] inc)) @@ -199,4 +197,7 @@ :dirty 0 :tags [:status.console-toggle] :init (fn [this] - (status-item (toggle-span this) ""))) + (status-item (toggle-span this)))) + +(def console-toggle (object/create ::status.console-toggle)) +(add-status-item console-toggle) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 9a8a43c6f..8c163d3d1 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -16,25 +16,6 @@ (load/js "core/node_modules/lighttable/ui/dragdrop.js" :sync) - -(def multi-def (object* ::multi-editor2 - :tags #{:tabs} - :tabsets [] - :left 0 - :right 0 - :bottom 0 - :init (fn [this] - (let [tabsets (crate/html [:div.tabsets {:style {:bottom (bound (subatom this :tabset-bottom) ->px)}}])] - (object/merge! this {:tabsets-elem tabsets}) - (ctx/in! :tabs this) - [:div#multi {:style {:left (bound (subatom this :left) ->px) - :right (bound (subatom this :right) ->px) - :bottom (bound (subatom this :bottom) ->px)}} - tabsets] - )))) - -(def multi (object/create multi-def)) - (defn ensure-visible [idx tabset] (when-let [cur (aget (dom/$$ ".list li" (object/->content tabset)) idx)] (let [left (.-offsetLeft cur) @@ -249,6 +230,25 @@ (for [k tabs] (object/->content k))) + +(def multi-def (object* ::multi-editor2 + :tags #{:tabs} + :tabsets [] + :left 0 + :right 0 + :bottom 0 + :init (fn [this] + (let [tabsets (crate/html [:div.tabsets {:style {:bottom (bound (subatom this :tabset-bottom) ->px)}}])] + (object/merge! this {:tabsets-elem tabsets}) + (ctx/in! :tabs this) + [:div#multi {:style {:left (bound (subatom this :left) ->px) + :right (bound (subatom this :right) ->px) + :bottom (bound (subatom this :bottom) ->px)}} + tabsets] + )))) + +(def multi (object/create multi-def)) + (def tabset (object/create ::tabset)) (defn add! diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index 2b45702de..4974790a5 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -8,8 +8,6 @@ (def cp (js/require "child_process")) -(def worker (object/create ::worker-thread)) - (behavior ::try-send :triggers #{:try-send!} :reaction (fn [this msg] @@ -103,6 +101,7 @@ ;; the defined functions are sent correctly (object/tag-behaviors :worker-thread [::kill! ::connect ::send! ::queue! ::try-send ::message]) +(def worker (object/create ::worker-thread)) (comment diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 200dc7ccd..a88f90d63 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -19,8 +19,6 @@ (def max-depth 10) (def watch-interval 1000) -(def current-ws (object/create ::workspace)) - (defn unwatch [watches path recursive?] (when watches (let [removes (cond @@ -53,7 +51,6 @@ :close (fn [] (.unwatchFile fs path alert))})) -(declare folder->watch) (defn watch! ([path] (watch! (transient {}) path nil)) @@ -292,6 +289,8 @@ :init (fn [this] nil)) +(def current-ws (object/create ::workspace)) + (cmd/command {:command :workspace.new :desc "Workspace: Create new workspace" :exec (fn [] diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 9d7f0531c..f1da87689 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -52,8 +52,6 @@ (skip-space s)) (into-array (map #(do #js {:completion %}) (js/Object.keys res))))) -(def default-pattern #"[\w_$]") - (defn get-pattern [ed] (let [mode (editor/inner-mode ed)] (or (:hint-pattern @ed) (aget mode "hint-pattern") default-pattern))) @@ -126,6 +124,8 @@ (into-array (map #(do #js {:completion %}) (js/Object.keys res)))))] (js/_send obj-id :hint-tokens (string->tokens (:string m) (:pattern m))))))) +(def default-pattern #"[\w_$]") + (defn async-hints [this] (when @this (w this {:string (editor/->val this) From abfc9c6c687e36f47bbfd8fc56b80717ab0b97d4 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Fri, 17 Oct 2014 01:16:28 +0300 Subject: [PATCH 238/656] tabs.cljs and workspace.cljs reordering --- src/lt/objs/tabs.cljs | 37 ++++++++++++++++++------------------- src/lt/objs/workspace.cljs | 23 ++++++++++++----------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 8c163d3d1..ef7c5ac58 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -16,6 +16,24 @@ (load/js "core/node_modules/lighttable/ui/dragdrop.js" :sync) +(def multi-def (object* ::multi-editor2 + :tags #{:tabs} + :tabsets [] + :left 0 + :right 0 + :bottom 0 + :init (fn [this] + (let [tabsets (crate/html [:div.tabsets {:style {:bottom (bound (subatom this :tabset-bottom) ->px)}}])] + (object/merge! this {:tabsets-elem tabsets}) + (ctx/in! :tabs this) + [:div#multi {:style {:left (bound (subatom this :left) ->px) + :right (bound (subatom this :right) ->px) + :bottom (bound (subatom this :bottom) ->px)}} + tabsets] + )))) + +(def multi (object/create multi-def)) + (defn ensure-visible [idx tabset] (when-let [cur (aget (dom/$$ ".list li" (object/->content tabset)) idx)] (let [left (.-offsetLeft cur) @@ -230,25 +248,6 @@ (for [k tabs] (object/->content k))) - -(def multi-def (object* ::multi-editor2 - :tags #{:tabs} - :tabsets [] - :left 0 - :right 0 - :bottom 0 - :init (fn [this] - (let [tabsets (crate/html [:div.tabsets {:style {:bottom (bound (subatom this :tabset-bottom) ->px)}}])] - (object/merge! this {:tabsets-elem tabsets}) - (ctx/in! :tabs this) - [:div#multi {:style {:left (bound (subatom this :left) ->px) - :right (bound (subatom this :right) ->px) - :bottom (bound (subatom this :bottom) ->px)}} - tabsets] - )))) - -(def multi (object/create multi-def)) - (def tabset (object/create ::tabset)) (defn add! diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index a88f90d63..4e4deee8b 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -19,6 +19,17 @@ (def max-depth 10) (def watch-interval 1000) +(object/object* ::workspace + :tags #{:workspace} + :files [] + :folders [] + :watches {} + :ws-behaviors "" + :init (fn [this] + nil)) + +(def current-ws (object/create ::workspace)) + (defn unwatch [watches path recursive?] (when watches (let [removes (cond @@ -51,6 +62,7 @@ :close (fn [] (.unwatchFile fs path alert))})) +(declare folder->watch) (defn watch! ([path] (watch! (transient {}) path nil)) @@ -280,17 +292,6 @@ (when-not (files/exists? workspace-cache-path) (files/mkdir workspace-cache-path)))) -(object/object* ::workspace - :tags #{:workspace} - :files [] - :folders [] - :watches {} - :ws-behaviors "" - :init (fn [this] - nil)) - -(def current-ws (object/create ::workspace)) - (cmd/command {:command :workspace.new :desc "Workspace: Create new workspace" :exec (fn [] From d215af710a73a9a335bbcd7996de2433c269baea Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Fri, 17 Oct 2014 23:44:37 +0300 Subject: [PATCH 239/656] Fixed sidebar/workspace.cljs warnings --- src/lt/objs/sidebar/workspace.cljs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 45be6a2af..23eb7d0c4 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -51,6 +51,8 @@ (defn find-by-path [path] (first (filter #(= (:path @%) path) (object/by-tag :tree-item)))) +(declare tree) + (behavior ::add-ws-folder :triggers #{:workspace.add.folder!} :reaction (fn [this path] @@ -510,6 +512,11 @@ :click (fn [] (object/raise this :select!))) +(defui back-button [this] + [:h2 "Select a workspace"] + :click (fn [] + (object/raise this :tree!))) + (defui recents [this rs] [:div (back-button this) @@ -517,10 +524,7 @@ (for [r rs] (object/->content r))]]) -(defui back-button [this] - [:h2 "Select a workspace"] - :click (fn [] - (object/raise this :tree!))) +(declare sidebar-workspace) (behavior ::recent! :triggers #{:recent!} From 57a8d89b150a0c1d63eebef65a77186348267d67 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Fri, 17 Oct 2014 23:52:20 +0300 Subject: [PATCH 240/656] Fixed status_bar.cljs warnings --- src/lt/objs/status_bar.cljs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/lt/objs/status_bar.cljs b/src/lt/objs/status_bar.cljs index 95a22c9db..96884f853 100644 --- a/src/lt/objs/status_bar.cljs +++ b/src/lt/objs/status_bar.cljs @@ -94,6 +94,8 @@ (defn ->cursor-str [{:keys [pos]}] [:span.pos (str "" (inc (:line pos)) " / " (inc (:ch pos)))]) +(declare status-cursor) + (behavior ::update-cursor-location :triggers #{:update!} :reaction (fn [this pos] @@ -156,6 +158,9 @@ (status-item (log this) "left") )) +(def status-loader (object/create ::status.loader)) +(add-status-item status-loader) + (defn loader-set [] (object/merge! status-loader {:loaders 0})) @@ -166,9 +171,6 @@ (if (> (:loaders @status-loader) 0) (object/update! status-loader [:loaders] dec))) -(def status-loader (object/create ::status.loader)) -(add-status-item status-loader) - ;;********************************************************** ;; console list ;;********************************************************** @@ -182,6 +184,14 @@ :click (fn [] (cmd/exec! :toggle-console))) +(object/object* ::status.console-toggle + :dirty 0 + :tags [:status.console-toggle] + :init (fn [this] + (status-item (toggle-span this) ""))) + +(def console-toggle (object/create ::status.console-toggle)) +(add-status-item console-toggle) (defn dirty [] (object/update! console-toggle [:dirty] inc)) @@ -192,12 +202,3 @@ (defn console-class [class] (object/merge! console-toggle {:class class})) - -(object/object* ::status.console-toggle - :dirty 0 - :tags [:status.console-toggle] - :init (fn [this] - (status-item (toggle-span this)))) - -(def console-toggle (object/create ::status.console-toggle)) -(add-status-item console-toggle) From c9174c2632d11bd6e0403e8e4b5246d817e1b1e7 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Fri, 17 Oct 2014 23:54:56 +0300 Subject: [PATCH 241/656] Fixed navigate.cljs warnings --- src/lt/objs/sidebar/navigate.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index 5e8f3369d..a881016bc 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -41,6 +41,8 @@ (js/_send obj-id :workspace-files final) )))) +(declare sidebar-navigate) + (behavior ::workspace-files :triggers #{:workspace-files} :reaction (fn [this files] From fdfb593cba7f9fc80b2e8f894007f87a23f2a0ba Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 00:05:02 +0300 Subject: [PATCH 242/656] Fixed sidebar/command.cljs warnings --- src/lt/objs/sidebar/command.cljs | 86 +++++++++++++++----------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/src/lt/objs/sidebar/command.cljs b/src/lt/objs/sidebar/command.cljs index 886416532..6daceb644 100644 --- a/src/lt/objs/sidebar/command.cljs +++ b/src/lt/objs/sidebar/command.cljs @@ -90,14 +90,6 @@ (set-val this v) (object/raise this :change! v)) -(defn current-selected [this] - (let [cur (indexed-results @this) - cnt (count cur) - idx (:selected @this) - i (mod idx (if (> cnt (:size @this)) (:size @this) cnt))] - (when (> cnt 0) - (aget (aget cur i) 0)))) - (defn ensure-visible [this] (let [list (dom/$ "ul" (object/->content this)) elem (dom/$ ".selected" list)] @@ -108,6 +100,33 @@ (- (+ (.-offsetTop elem) (.-offsetHeight elem) 15) (.-clientHeight list))) :else nil))) +(defn fill-lis [{:keys [lis size search selected key transform] :as this} results] + (let [cnt (count results) + cur (mod selected (if (> cnt size) + size + cnt)) + transform (if transform + transform + #(do %3))] + (if (= cnt 0) + (dom/add-class (:content this) :empty) + (dom/remove-class (:content this) :empty)) + (doseq [[i li res] (map vector (range) lis results) + :when res] + (dom/html li (transform (aget res 1) (aget res 4) (if-not (empty? search) + + (js/wrapMatch (aget res 1) (aget res 4)) + (aget res 1)) + (aget res 0))) + (dom/css li {:display "block"}) + (if (= i cur) + (dom/add-class li :selected) + (dom/remove-class li :selected))) + (doseq [li (drop cnt lis)] + (dom/css li {:display "none"})))) + +(declare sidebar-command indexed-results) + (behavior ::move-selection :triggers #{:move-selection} :reaction (fn [this dir] @@ -144,13 +163,13 @@ :triggers #{:escape!} :reaction (fn [this] (object/raise this :inactive) - (exec! :close-sidebar))) + (cmd/exec! :close-sidebar))) (behavior ::options-escape! :triggers #{:escape!} :reaction (fn [this] (object/raise sidebar-command :cancel!) - (exec! :close-sidebar))) + (cmd/exec! :close-sidebar))) (behavior ::set-on-select :triggers #{:select} @@ -240,7 +259,13 @@ score2) (.. items (map #(array % (key %) nil nil)))))) - +(defn current-selected [this] + (let [cur (indexed-results @this) + cnt (count cur) + idx (:selected @this) + i (mod idx (if (> cnt (:size @this)) (:size @this) cnt))] + (when (> cnt 0) + (aget (aget cur i) 0)))) (defui item [this x] [:li {:index x}] @@ -250,31 +275,6 @@ (object/raise this :set-selection! x) (object/raise this :select! x))) -(defn fill-lis [{:keys [lis size search selected key transform] :as this} results] - (let [cnt (count results) - cur (mod selected (if (> cnt size) - size - cnt)) - transform (if transform - transform - #(do %3))] - (if (= cnt 0) - (dom/add-class (:content this) :empty) - (dom/remove-class (:content this) :empty)) - (doseq [[i li res] (map vector (range) lis results) - :when res] - (dom/html li (transform (aget res 1) (aget res 4) (if-not (empty? search) - - (js/wrapMatch (aget res 1) (aget res 4)) - (aget res 1)) - (aget res 0))) - (dom/css li {:display "block"}) - (if (= i cur) - (dom/add-class li :selected) - (dom/remove-class li :selected))) - (doseq [li (drop cnt lis)] - (dom/css li {:display "none"})))) - (object/object* ::filter-list :tags #{:filter-list} :selected 0 @@ -305,7 +305,7 @@ (behavior ::select-command :triggers #{:select} :reaction (fn [this sel] - (when-let [cmd (by-id sel)] + (when-let [cmd (cmd/by-id sel)] (if (:options cmd) (do (object/merge! sidebar-command {:active cmd}) @@ -320,7 +320,7 @@ (behavior ::select-hidden :triggers #{:select-unknown} :reaction (fn [this v] - (when-let [cmd (by-id (keyword v))] + (when-let [cmd (cmd/by-id (keyword v))] (object/raise this :select cmd)))) (behavior ::post-select-pop @@ -334,11 +334,11 @@ (behavior ::exec-command :triggers #{:exec!} :reaction (fn [this sel & args] - (let [cmd (by-id sel)] + (let [cmd (cmd/by-id sel)] (cond - (not (:options cmd)) (apply exec! cmd args) + (not (:options cmd)) (apply cmd/exec! cmd args) (and (:options cmd) (seq args)) (apply (:exec cmd) args) - :else (do (exec! :show-commandbar-transient) + :else (do (cmd/exec! :show-commandbar-transient) (object/raise (:selector @this) :select cmd)))))) (behavior ::exec-active! @@ -455,10 +455,6 @@ (object/raise sidebar/rightbar :toggle sidebar-command (assoc opts :soft? true)) (object/raise sidebar-command :soft-focus!)) -(def by-id cmd/by-id) - -(def exec! cmd/exec!) - (defn exec-active! [& args] (object/raise sidebar-command :exec-active! args)) From 1fa203f6de882ce775a91bcb010f6faec554ba77 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 00:09:07 +0300 Subject: [PATCH 243/656] Fixed search.cljs warnings --- src/lt/objs/search.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index fbef9588e..ce75c99dd 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -240,6 +240,8 @@ ] )) +(def searcher (object/create ::workspace-search)) + (cmd/command {:command :searcher.search :desc "Searcher: Execute search" :hidden true @@ -272,5 +274,3 @@ :hidden true :exec (fn [] (object/raise searcher :replace!))}) - -(def searcher (object/create ::workspace-search)) From 5e5e8a0732e4b1767d90b9c090e8be639ef25547 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 00:14:20 +0300 Subject: [PATCH 244/656] Fixed langs/behaviors.cljs, langs/keymap.cljs, menu.cljs and opener.cljs warnings --- src/lt/objs/langs/behaviors.cljs | 2 ++ src/lt/objs/langs/keymap.cljs | 2 ++ src/lt/objs/menu.cljs | 1 + src/lt/objs/opener.cljs | 2 ++ 4 files changed, 7 insertions(+) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 48fae77cd..a2f8d3c54 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -105,6 +105,8 @@ :else nil) )}) +(declare helper) + (behavior ::behavior-hints :triggers #{:hints+} :reaction (fn [this hints token] diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index 3e9d0aaf0..42749fbf1 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -67,6 +67,8 @@ (map #(do #js {:completion (str %) :text (str %)}) (keys @object/tags))) :key cmd/completions}) +(declare helper) + (behavior ::keymap-hints :triggers #{:hints+} :exclusive [:lt.plugins.auto-complete/textual-hints] diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index b155fcb26..ddbc0e065 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -20,6 +20,7 @@ (def menu-instance (create-menu)) +(declare submenu) (defn menu-item [opts] (let [mi (.-MenuItem gui) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 893601d2b..dc5accf3e 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -135,6 +135,8 @@ [ed obj path ldoc-options] (open-path* (partial doc/linked-open ed ldoc-options) obj path)) +(declare opener) + (behavior ::existing-path-opens-linked-doc :triggers #{:object.instant} :type :user From b97f125a102ff925ba71b9de8ad9327ea9a37d5d Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 00:34:49 +0300 Subject: [PATCH 245/656] Fixed eval.cljs, files.cljs, find.cljs warnings --- src/lt/objs/eval.cljs | 56 +++++++++++++++++++++--------------------- src/lt/objs/files.cljs | 5 +++- src/lt/objs/find.cljs | 2 ++ 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 0e5aac4d2..8a5191278 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -31,34 +31,6 @@ (button "Cancel") )) -(defn find-client [{:keys [origin command info key create] :as opts}] - (let [[result client] (clients/discover command info) - key (or key :default)] - (condp = result - :none (if create - (create opts) - (do - (notifos/done-working) - (object/raise evaler :no-client opts) - (clients/placeholder))) - :found client - :select (do - (object/raise evaler :select-client client (fn [client] - (clients/swap-client! (-> @origin :client key) client) - (object/update! origin [:client] assoc key client))) - (clients/placeholder)) - :unsupported (unsupported)))) - -(defn get-client! [{:keys [origin command key create] :as opts}] - (let [key (or key :default) - cur (-> @origin :client key)] - (if (and cur (clients/available? cur)) - cur - (let [neue (find-client opts)] - (object/update! origin [:client] assoc key neue) - (object/raise origin :set-client neue) - neue)))) - (defn unescape-unicode [s] (string/replace s #"\\x(..)" @@ -148,6 +120,34 @@ (catch :default e r))) +(defn find-client [{:keys [origin command info key create] :as opts}] + (let [[result client] (clients/discover command info) + key (or key :default)] + (condp = result + :none (if create + (create opts) + (do + (notifos/done-working) + (object/raise evaler :no-client opts) + (clients/placeholder))) + :found client + :select (do + (object/raise evaler :select-client client (fn [client] + (clients/swap-client! (-> @origin :client key) client) + (object/update! origin [:client] assoc key client))) + (clients/placeholder)) + :unsupported (unsupported)))) + +(defn get-client! [{:keys [origin command key create] :as opts}] + (let [key (or key :default) + cur (-> @origin :client key)] + (if (and cur (clients/available? cur)) + cur + (let [neue (find-client opts)] + (object/update! origin [:client] assoc key neue) + (object/raise origin :set-client neue) + neue)))) + ;;**************************************************** ;; inline result ;;**************************************************** diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index a22a36705..52d8e31a1 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -27,6 +27,10 @@ (defn join [& segs] (apply (.-join fpath) (filter string? (map str segs)))) +(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") + +(declare files-obj) + (behavior ::file-types :triggers #{:object.instant} :type :user @@ -55,7 +59,6 @@ (def line-ending (.-EOL os)) (def separator (.-sep fpath)) (def available-drives #{}) -(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") (def pwd (.resolve fpath ".")) (when (= separator "\\") diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 3ec89c7be..783eec7fb 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -15,6 +15,8 @@ (def find-height 30) +(declare bar) + (defui input [this] [:input.find {:type "text" :placeholder "find"}] From 9f779367850447f827eb2e0f46a22642cbd0ae42 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 01:01:03 +0300 Subject: [PATCH 246/656] Reordered and declared vars for the rest of warnings --- src/lt/objs/app.cljs | 26 ++++++++++++++------------ src/lt/objs/bottombar.cljs | 2 ++ src/lt/objs/canvas.cljs | 8 ++++---- src/lt/objs/clients.cljs | 2 ++ src/lt/objs/console.cljs | 11 +++++++---- src/lt/objs/context.cljs | 8 ++++++-- 6 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index e66696f25..11cf5b60a 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -23,6 +23,8 @@ (defn prevent-close [] (set! closing false)) +(declare app) + (defn close ([] (close false)) ([force?] @@ -34,18 +36,6 @@ (defn refresh [] (js/window.location.reload true)) -(defn open-window [] - (let [id (store-swap! :window-id inc) - w (.Window.open gui (str "LightTable.html?id=" id) (clj->js {:toolbar false - :icon "core/img/lticon.png" - :new-instance true - :min_height 400 - :min_width 400 - :frame true - :show false}))] - (set! (.-ltid w) id) - w)) - (defn args [] (when-not (= 0 (.-App.argv.length gui)) (seq (.-App.argv gui)))) @@ -88,6 +78,18 @@ (when (not= (.-zoomLevel win) 0) (.-zoomLevel win))) +(defn open-window [] + (let [id (store-swap! :window-id inc) + w (.Window.open gui (str "LightTable.html?id=" id) (clj->js {:toolbar false + :icon "core/img/lticon.png" + :new-instance true + :min_height 400 + :min_width 400 + :frame true + :show false}))] + (set! (.-ltid w) id) + w)) + ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index 50034e8b0..3398b045c 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -26,6 +26,8 @@ (when active (object/->content active))) +(declare bottombar) + (defn active? [item] (= (:active @bottombar) item)) diff --git a/src/lt/objs/canvas.cljs b/src/lt/objs/canvas.cljs index c8e7b308d..fca953f52 100644 --- a/src/lt/objs/canvas.cljs +++ b/src/lt/objs/canvas.cljs @@ -8,10 +8,6 @@ (defui canvas-elem [obj] [:div#canvas]) -(defn add! [obj & [position?]] - (append (object/->content canvas) (object/->content obj)) - (object/raise obj :show rep)) - ;;********************************************************* ;; Object ;;********************************************************* @@ -23,6 +19,10 @@ (def canvas (object/create ::canvas)) (append ($ "#wrapper") (object/->content canvas)) +(defn add! [obj & [position?]] + (append (object/->content canvas) (object/->content obj)) + (object/raise obj :show rep)) + ;;********************************************************* ;; Behaviors ;;********************************************************* diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index 9a1570d28..6ba650340 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -36,6 +36,8 @@ (when tags (object/add-tags client tags)))) +(declare clients) + (defn handle-connection! [info] (if-let [client (by-id (:client-id info))] (do diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index e604c8bfb..d19f838d7 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -24,7 +24,6 @@ (catch js/Error e (.error js/console (str "Failed to initialize the log writer: " e))))) -(.on js/process "uncaughtException" #(error %)) (defn ->ui [c] (object/->content c)) @@ -33,6 +32,8 @@ (.-nodeType thing) (string? thing))) +(declare console) + (defn write [$console msg] (when (> (count (dom/children $console)) (dec console-limit)) (dom/remove (aget (dom/children $console) 0))) @@ -44,6 +45,9 @@ (when core-log (.write core-log thing))) +(defpartial ->item [l & [class]] + [:li {:class class} l]) + (defn log ([l class] (log l class nil)) ([l class str-content] @@ -68,6 +72,8 @@ (str e))))) "error")) +(.on js/process "uncaughtException" #(error %)) + (defui console-ui [this] [:ul.console] :contextmenu (fn [e] @@ -99,9 +105,6 @@ (defn inspect [thing] (util-inspect thing false 2)) -(defpartial ->item [l & [class]] - [:li {:class class} l]) - (defn verbatim ([thing class] (verbatim thing class nil)) diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index ecfe3334b..d10a3f82e 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -17,13 +17,17 @@ (defn in? [k] (@contexts k)) -(defn out! [ctxs] +(declare ctx-obj) + +(defn out! + ([] (out! nil)) + ([ctxs] (let [ctxs (if (coll? ctxs) ctxs [ctxs])] (swap! contexts #(apply disj % ctxs)) (swap! ctx->obj #(apply dissoc % ctxs)) - (object/raise ctx-obj :log!))) + (object/raise ctx-obj :log!)))) (defn in! [ctxs & [obj]] (let [ctxs (if (coll? ctxs) From 1893e93bf94cbdd2fede0ea47c22f260dba6a7dd Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 09:51:22 +0300 Subject: [PATCH 247/656] Reordered and declared vars for the rest of warnings --- src/lt/objs/tabs.cljs | 2 ++ src/lt/objs/thread.cljs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index ef7c5ac58..129b8cb9d 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -122,6 +122,8 @@ :tabset multi}) (item this multi e pos))) +(declare move-tab) + (defn objs-list [multi objs] (let [prev-tabs (filter #(= (:tabset @%) multi) (object/by-tag :tab-label)) item (crate/html diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index 4974790a5..3af38af29 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -81,6 +81,7 @@ (object/merge! this {:worker worker}) nil))) +(declare worker) (defn send [msg] (object/raise worker :try-send! msg)) From 18da65e89e7a9b816c282fbcf0c36d395a647a73 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 18 Oct 2014 09:57:26 +0300 Subject: [PATCH 248/656] Reordered and declared vars for warnings in tabs.cljs and thread.cljs --- src/lt/objs/thread.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index 3af38af29..c07a565e8 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -8,6 +8,8 @@ (def cp (js/require "child_process")) +(declare worker) + (behavior ::try-send :triggers #{:try-send!} :reaction (fn [this msg] @@ -81,8 +83,6 @@ (object/merge! this {:worker worker}) nil))) -(declare worker) - (defn send [msg] (object/raise worker :try-send! msg)) From 3c73a7691a6009af97a5d7f9d420d51a1332b002 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sun, 19 Oct 2014 00:48:53 +0300 Subject: [PATCH 249/656] Get back exec! redefinition in sidebar.command --- src/lt/objs/sidebar/command.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lt/objs/sidebar/command.cljs b/src/lt/objs/sidebar/command.cljs index 6daceb644..186dc1e8d 100644 --- a/src/lt/objs/sidebar/command.cljs +++ b/src/lt/objs/sidebar/command.cljs @@ -455,6 +455,8 @@ (object/raise sidebar/rightbar :toggle sidebar-command (assoc opts :soft? true)) (object/raise sidebar-command :soft-focus!)) +(def exec! cmd/exec!) + (defn exec-active! [& args] (object/raise sidebar-command :exec-active! args)) From 4bd8efa6c15c7b3957935faf2e0cebeb41708e8e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 18 Oct 2014 16:01:06 -0400 Subject: [PATCH 250/656] Introduce user.cljs, plugin.edn, project.clj for user plugins Rename deploy/core/misc -> deploy/core/settings since all files pertain to settings. Rename example.{behaviors,keymap} to user.{behaviors,keymap} so all source plugin file names match destination file names. --- deploy/core/settings/plugin.edn | 6 +++++ deploy/core/settings/project.clj | 2 ++ deploy/core/settings/src/lt/plugins/user.cljs | 26 +++++++++++++++++++ .../user.behaviors} | 5 +++- .../example.keymap => settings/user.keymap} | 0 src/lt/objs/settings.cljs | 11 +++++--- 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 deploy/core/settings/plugin.edn create mode 100644 deploy/core/settings/project.clj create mode 100644 deploy/core/settings/src/lt/plugins/user.cljs rename deploy/core/{misc/example.behaviors => settings/user.behaviors} (86%) rename deploy/core/{misc/example.keymap => settings/user.keymap} (100%) diff --git a/deploy/core/settings/plugin.edn b/deploy/core/settings/plugin.edn new file mode 100644 index 000000000..8ae950ee4 --- /dev/null +++ b/deploy/core/settings/plugin.edn @@ -0,0 +1,6 @@ +{:name "User" + :version "0.0.1" + :author "TODO" + :source "TODO" + :desc "TODO" + :behaviors "user.behaviors"} diff --git a/deploy/core/settings/project.clj b/deploy/core/settings/project.clj new file mode 100644 index 000000000..e16fc058c --- /dev/null +++ b/deploy/core/settings/project.clj @@ -0,0 +1,2 @@ +(defproject user "0.0.1" + :dependencies [[org.clojure/clojure "1.6.0"]]) diff --git a/deploy/core/settings/src/lt/plugins/user.cljs b/deploy/core/settings/src/lt/plugins/user.cljs new file mode 100644 index 000000000..3208097e5 --- /dev/null +++ b/deploy/core/settings/src/lt/plugins/user.cljs @@ -0,0 +1,26 @@ +(ns lt.plugins.user + (:require [lt.object :as object] + [lt.objs.tabs :as tabs] + [lt.objs.command :as cmd]) + (:require-macros [lt.macros :refer [defui behavior]])) + +(defui hello-panel [this] + [:h1 "Hello World!"]) + +(object/object* ::user.hello + :tags [:user.hello] + :behaviors [::on-close-destroy] + :init (fn [this] + (hello-panel this))) + +(behavior ::on-close-destroy + :triggers #{:close} + :reaction (fn [this] + (object/raise this :destroy))) + +(def hello (object/create ::user.hello)) + +(cmd/command {:command :user.say-hello + :desc "User: Say Hello" + :exec (fn [] + (tabs/add-or-focus! hello))}) diff --git a/deploy/core/misc/example.behaviors b/deploy/core/settings/user.behaviors similarity index 86% rename from deploy/core/misc/example.behaviors rename to deploy/core/settings/user.behaviors index 4f8f85ace..34c430142 100644 --- a/deploy/core/misc/example.behaviors +++ b/deploy/core/settings/user.behaviors @@ -19,7 +19,10 @@ (:lt.objs.style/set-theme "default")] ;; Here we can add behaviors to just clojure editors - :editor.clojure [(:lt.plugins.clojure/print-length 1000)]} + :editor.clojure [(:lt.plugins.clojure/print-length 1000)] + + ;; Add user-defined behaviors + :user.hello [:lt.plugins.user/on-close-destroy]} ;; You can use the subtract key to remove behavior that may get added by ;; another diff diff --git a/deploy/core/misc/example.keymap b/deploy/core/settings/user.keymap similarity index 100% rename from deploy/core/misc/example.keymap rename to deploy/core/settings/user.keymap diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ea260cd0d..78c648fc8 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -183,14 +183,17 @@ (def user-behaviors-path (files/lt-user-dir "settings/user.behaviors")) (def user-keymap-path (files/lt-user-dir "settings/user.keymap")) +(def user-plugin-paths ["user.behaviors" "user.keymap" "src" "project.clj" "plugin.edn"]) +(def user-plugin-dir (files/lt-user-dir "settings")) (behavior ::create-user-settings :triggers #{:init} :reaction (fn [app] - (when-not (files/exists? user-behaviors-path) - (files/copy (files/lt-home "/core/misc/example.behaviors") user-behaviors-path)) - (when-not (files/exists? user-keymap-path) - (files/copy (files/lt-home "/core/misc/example.keymap") user-keymap-path)))) + (doseq [path user-plugin-paths] + (let [full-path (files/join user-plugin-dir path)] + (when-not (files/exists? full-path) + (files/copy (files/lt-home (files/join "core" "settings" path)) + full-path)))))) ;;********************************************************* ;; Commands From 4244b22fe8914b48a0f24c46ae7bfc98079b59e7 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 19 Oct 2014 01:01:09 -0400 Subject: [PATCH 251/656] Load user.cljs and its commands user.cljs commands are loaded through its compiled js and by adding user plugin to available-plugins. The latter is needed in order for load-js to correctly find user_compiled.js. --- deploy/core/settings/user.behaviors | 5 +- deploy/core/settings/user_compiled.js | 69 +++++++++++++++++++++++++++ src/lt/objs/plugins.cljs | 3 +- src/lt/objs/settings.cljs | 2 +- 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 deploy/core/settings/user_compiled.js diff --git a/deploy/core/settings/user.behaviors b/deploy/core/settings/user.behaviors index 34c430142..94217214a 100644 --- a/deploy/core/settings/user.behaviors +++ b/deploy/core/settings/user.behaviors @@ -12,7 +12,8 @@ {:+ { ;; The app tag is kind of like global scope. You assign behaviors that affect ;; all of Light Table here - :app [(:lt.objs.style/set-skin "dark")] + :app [(:lt.objs.style/set-skin "dark") + (:lt.objs.plugins/load-js "user_compiled.js")] ;; The editor tag is applied to all editors :editor [:lt.objs.editor/no-wrap @@ -21,7 +22,7 @@ ;; Here we can add behaviors to just clojure editors :editor.clojure [(:lt.plugins.clojure/print-length 1000)] - ;; Add user-defined behaviors + ;; Behaviors specific to a user-defined object :user.hello [:lt.plugins.user/on-close-destroy]} ;; You can use the subtract key to remove behavior that may get added by diff --git a/deploy/core/settings/user_compiled.js b/deploy/core/settings/user_compiled.js new file mode 100644 index 000000000..971793b61 --- /dev/null +++ b/deploy/core/settings/user_compiled.js @@ -0,0 +1,69 @@ +if(!lt.util.load.provided_QMARK_('lt.plugins.user')) { +goog.provide('lt.plugins.user'); +goog.require('cljs.core'); +goog.require('lt.objs.command'); +goog.require('lt.objs.command'); +goog.require('lt.objs.tabs'); +goog.require('lt.objs.tabs'); +goog.require('lt.object'); +goog.require('lt.object'); +lt.plugins.user.hello_panel = (function hello_panel(this$){var e__7755__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h1","h1",1013907515),"Hello World!"], null));var seq__7845_7861 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__7846_7862 = null;var count__7847_7863 = 0;var i__7848_7864 = 0;while(true){ +if((i__7848_7864 < count__7847_7863)) +{var vec__7849_7865 = cljs.core._nth.call(null,chunk__7846_7862,i__7848_7864);var ev__7756__auto___7866 = cljs.core.nth.call(null,vec__7849_7865,0,null);var func__7757__auto___7867 = cljs.core.nth.call(null,vec__7849_7865,1,null);lt.util.dom.on.call(null,e__7755__auto__,ev__7756__auto___7866,func__7757__auto___7867); +{ +var G__7868 = seq__7845_7861; +var G__7869 = chunk__7846_7862; +var G__7870 = count__7847_7863; +var G__7871 = (i__7848_7864 + 1); +seq__7845_7861 = G__7868; +chunk__7846_7862 = G__7869; +count__7847_7863 = G__7870; +i__7848_7864 = G__7871; +continue; +} +} else +{var temp__4126__auto___7872 = cljs.core.seq.call(null,seq__7845_7861);if(temp__4126__auto___7872) +{var seq__7845_7873__$1 = temp__4126__auto___7872;if(cljs.core.chunked_seq_QMARK_.call(null,seq__7845_7873__$1)) +{var c__7112__auto___7874 = cljs.core.chunk_first.call(null,seq__7845_7873__$1);{ +var G__7875 = cljs.core.chunk_rest.call(null,seq__7845_7873__$1); +var G__7876 = c__7112__auto___7874; +var G__7877 = cljs.core.count.call(null,c__7112__auto___7874); +var G__7878 = 0; +seq__7845_7861 = G__7875; +chunk__7846_7862 = G__7876; +count__7847_7863 = G__7877; +i__7848_7864 = G__7878; +continue; +} +} else +{var vec__7850_7879 = cljs.core.first.call(null,seq__7845_7873__$1);var ev__7756__auto___7880 = cljs.core.nth.call(null,vec__7850_7879,0,null);var func__7757__auto___7881 = cljs.core.nth.call(null,vec__7850_7879,1,null);lt.util.dom.on.call(null,e__7755__auto__,ev__7756__auto___7880,func__7757__auto___7881); +{ +var G__7882 = cljs.core.next.call(null,seq__7845_7873__$1); +var G__7883 = null; +var G__7884 = 0; +var G__7885 = 0; +seq__7845_7861 = G__7882; +chunk__7846_7862 = G__7883; +count__7847_7863 = G__7884; +i__7848_7864 = G__7885; +continue; +} +} +} else +{} +} +break; +} +return e__7755__auto__; +}); +lt.object.object_STAR_.call(null,new cljs.core.Keyword("lt.plugins.user","user.hello","lt.plugins.user/user.hello",3780889681),new cljs.core.Keyword(null,"tags","tags",1017456523),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"user.hello","user.hello",1535287393)], null),new cljs.core.Keyword(null,"behaviors","behaviors",607554515),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword("lt.plugins.user","on-close-destroy","lt.plugins.user/on-close-destroy",4509098889)], null),new cljs.core.Keyword(null,"init","init",1017141378),(function (this$){return lt.plugins.user.hello_panel.call(null,this$); +})); +lt.plugins.user.__BEH__on_close_destroy = (function __BEH__on_close_destroy(this$){return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"destroy","destroy",2571277164)); +}); +lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.plugins.user","on-close-destroy","lt.plugins.user/on-close-destroy",4509098889),new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close","close",1108660586),null], null), null),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.plugins.user.__BEH__on_close_destroy); +lt.plugins.user.hello = lt.object.create.call(null,new cljs.core.Keyword("lt.plugins.user","user.hello","lt.plugins.user/user.hello",3780889681)); +lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword("lt.plugins.user","say-hello","lt.plugins.user/say-hello",853454032),new cljs.core.Keyword(null,"desc","desc",1016984067),"User: Say Hello",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.objs.tabs.add_or_focus_BANG_.call(null,lt.plugins.user.hello); +})], null)); +} + +//# sourceMappingURL=user_compiled.js.map \ No newline at end of file diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 50f008b09..6c05f097c 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -145,7 +145,8 @@ (defn available-plugins [] (let [ds (concat (files/dirs user-plugins-dir) - (files/dirs plugins-dir)) + (files/dirs plugins-dir) + [settings/user-plugin-dir]) plugins (->> ds (map plugin-info) (filterv identity)) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 78c648fc8..256b10809 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -183,7 +183,7 @@ (def user-behaviors-path (files/lt-user-dir "settings/user.behaviors")) (def user-keymap-path (files/lt-user-dir "settings/user.keymap")) -(def user-plugin-paths ["user.behaviors" "user.keymap" "src" "project.clj" "plugin.edn"]) +(def user-plugin-paths ["user.behaviors" "user.keymap" "src" "project.clj" "plugin.edn" "user_compiled.js"]) (def user-plugin-dir (files/lt-user-dir "settings")) (behavior ::create-user-settings From 0facb0eb80b11df5859a80c42864ff59f145eddf Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 19 Oct 2014 14:27:24 -0400 Subject: [PATCH 252/656] Update user.plugin :dependencies for plugin (un)install/update It's important to update :dependencies as this allows a user plugin to contain all information needed to recreate a user's configuration on another machine. --- deploy/settings/default/default.behaviors | 1 + src/lt/objs/plugins.cljs | 33 +++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d2dbb851f..bf23450a2 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -327,6 +327,7 @@ :plugin.file [(:lt.objs.editor.file/on-save :build)] :plugin-manager [:lt.objs.plugins/on-close :lt.objs.plugins/search-server-plugins + :lt.objs.plugins/save-user-plugin-dependencies :lt.objs.plugins/render-installed-plugins :lt.objs.plugins/render-server-plugins :lt.objs.plugins/submit-plugin diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 6c05f097c..70b74d5db 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -305,6 +305,7 @@ (defn uninstall [plugin] (files/delete! (:dir plugin)) + (object/raise manager :save-deps) (object/raise manager :refresh!)) ;;********************************************************* @@ -369,6 +370,7 @@ (dom/stop-propagation e) (discover-deps plugin (fn [] (cmd/exec! :behaviors.reload) + (object/raise manager :save-deps) (object/raise manager :refresh!))))) (defui install-button [plugin] @@ -378,8 +380,8 @@ (discover-deps plugin (fn [] (dom/remove (dom/parent me)) (cmd/exec! :behaviors.reload) - (object/raise manager :refresh!) - ))) + (object/raise manager :save-deps) + (object/raise manager :refresh!)))) (dom/prevent e) (dom/stop-propagation e))) @@ -514,6 +516,33 @@ (object/raise this :plugin-results (EOF-read data))) )))))) +(defn save-plugins [plugin-maps] + (let [plugin-edn-file (files/join settings/user-plugin-dir "plugin.edn") + plugin-edn (-> plugin-edn-file files/open-sync :content (settings/safe-read plugin-edn-file)) + plugin-name (doto (:name plugin-edn) (assert "User plugin doesn't have a :name")) + deps (->> plugin-maps + vals + (remove #(contains? #{plugin-name} (:name %))) + (map (juxt :name :version)) + (into (sorted-map))) + plugin-edn-body (pr-str (assoc plugin-edn :dependencies deps))] + + (files/save plugin-edn-file + (-> plugin-edn-body + ;; Until clojurescript gets pprint + ;; one key/val pair or parent key per line for diffing + (string/replace #"(\"\s*,|\{|\},)" #(str % "\n")) + (string/replace-first #"^\{\n" "{") + (string/replace-first #":dependencies" + ";; Do not edit - :dependencies are auto-generated\n:dependencies"))))) + +(behavior ::save-user-plugin-dependencies + :triggers #{:save-deps} + :desc "Saves dependencies to user's plugin.edn" + :reaction (fn [this] + ;; Use available-plugins b/c ::plugins aren't always up to date e.g. uninstall + (save-plugins (available-plugins)))) + (behavior ::render-installed-plugins :triggers #{:refresh!} :desc "Plugin Manager: refresh installed plugins" From 2a31268de6570e3cd87521571e4238c13a3e6b4b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 20 Oct 2014 01:27:02 -0400 Subject: [PATCH 253/656] Trigger off of :refresh! instead of new :save-deps behavior Relying on explicitly placed :save-deps doesn't handle the case of a user who git clones a plugin. By triggering off of :refresh!, a user would update their dependencies just by opening the plugin manager which is highly likely. :save-deps also needed to be in update-outdated. Triggering off :refresh! solves this. --- src/lt/objs/plugins.cljs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 70b74d5db..07310f3d8 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -305,7 +305,6 @@ (defn uninstall [plugin] (files/delete! (:dir plugin)) - (object/raise manager :save-deps) (object/raise manager :refresh!)) ;;********************************************************* @@ -370,7 +369,6 @@ (dom/stop-propagation e) (discover-deps plugin (fn [] (cmd/exec! :behaviors.reload) - (object/raise manager :save-deps) (object/raise manager :refresh!))))) (defui install-button [plugin] @@ -380,7 +378,6 @@ (discover-deps plugin (fn [] (dom/remove (dom/parent me)) (cmd/exec! :behaviors.reload) - (object/raise manager :save-deps) (object/raise manager :refresh!)))) (dom/prevent e) (dom/stop-propagation e))) @@ -537,7 +534,7 @@ ";; Do not edit - :dependencies are auto-generated\n:dependencies"))))) (behavior ::save-user-plugin-dependencies - :triggers #{:save-deps} + :triggers #{:refresh!} :desc "Saves dependencies to user's plugin.edn" :reaction (fn [this] ;; Use available-plugins b/c ::plugins aren't always up to date e.g. uninstall From 7b3ebf1a768d835b195c59b620d0cbd512de8349 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 20 Oct 2014 01:41:34 -0400 Subject: [PATCH 254/656] Fix uninstall causing extra missing popup Since the user plugin has all dependencies, uninstalling anything triggers the missing? popup before we've had a chance to remove the dependency from the plugin.edn. Added a flag to available-plugins to bypass the popup for just this case. --- src/lt/objs/plugins.cljs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 07310f3d8..29a91f8cc 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -143,7 +143,8 @@ (doseq [dep missing] (discover-deps dep count-down)))) -(defn available-plugins [] +(defn available-plugins + [& {:keys [ignore-missing]}] (let [ds (concat (files/dirs user-plugins-dir) (files/dirs plugins-dir) [settings/user-plugin-dir]) @@ -161,12 +162,12 @@ plugins) (persistent!)) missing? (missing-deps final)] - (when missing? + (when (and missing? (not ignore-missing)) (popup/popup! {:header "Some plugin dependencies are missing." :body [:div [:span "We found that the following plugin dependencies are missing: "] - (for [{:keys [name version]} missing?] - [:div name " " version " "]) + (for [{:keys [name version]} missing?] + [:div name " " version " "]) [:span "Would you like us to install them?"]] :buttons [{:label "Cancel"} {:label "Install all" @@ -538,7 +539,8 @@ :desc "Saves dependencies to user's plugin.edn" :reaction (fn [this] ;; Use available-plugins b/c ::plugins aren't always up to date e.g. uninstall - (save-plugins (available-plugins)))) + ;; :ignore-missing to avoid missing popup on uninstall + (save-plugins (available-plugins :ignore-missing true)))) (behavior ::render-installed-plugins :triggers #{:refresh!} From def6a70ee7cc4621ed176bd7a4666e277a09b496 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 20 Oct 2014 01:58:32 -0400 Subject: [PATCH 255/656] Add command to open user.cljs --- src/lt/objs/settings.cljs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 256b10809..5fbf7849a 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -183,6 +183,7 @@ (def user-behaviors-path (files/lt-user-dir "settings/user.behaviors")) (def user-keymap-path (files/lt-user-dir "settings/user.keymap")) +(def user-cljs-path (files/lt-user-dir "settings/src/lt/plugins/user.cljs")) (def user-plugin-paths ["user.behaviors" "user.keymap" "src" "project.clj" "plugin.edn" "user_compiled.js"]) (def user-plugin-dir (files/lt-user-dir "settings")) @@ -243,6 +244,11 @@ :exec (fn [] (cmd/exec! :open-path (files/lt-home "/settings/default/default.keymap")))}) +(cmd/command {:command :user.modify-user + :desc "Settings: User clojurescript" + :exec (fn [] + (cmd/exec! :open-path user-cljs-path))}) + (behavior ::on-close-remove :triggers #{:close} :reaction (fn [this] From df905a9447a69c43434d699c9577d1aa626ead6b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 20 Oct 2014 20:05:34 -0400 Subject: [PATCH 256/656] Add command to add user plugin to workspace Encourage users to explore and understand their settings and a plugin's makeup --- src/lt/objs/settings.cljs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 5fbf7849a..758976ac5 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -249,6 +249,12 @@ :exec (fn [] (cmd/exec! :open-path user-cljs-path))}) + +(cmd/command {:command :user.add-user-plugin-to-workspace + :desc "Settings: Add User plugin to workspace" + :exec (fn [] + (object/raise workspace/current-ws :add.folder! user-plugin-dir))}) + (behavior ::on-close-remove :triggers #{:close} :reaction (fn [this] From cf1133eaf22dee59d546ad4f1d41efba78a47a45 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 21 Oct 2014 02:03:12 -0400 Subject: [PATCH 257/656] Add some descriptions to user.cljs --- deploy/core/settings/src/lt/plugins/user.cljs | 6 ++ deploy/core/settings/user_compiled.js | 64 +++++++++---------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/deploy/core/settings/src/lt/plugins/user.cljs b/deploy/core/settings/src/lt/plugins/user.cljs index 3208097e5..1a9aaa4c6 100644 --- a/deploy/core/settings/src/lt/plugins/user.cljs +++ b/deploy/core/settings/src/lt/plugins/user.cljs @@ -4,15 +4,19 @@ [lt.objs.command :as cmd]) (:require-macros [lt.macros :refer [defui behavior]])) +;; UI to be associated with an object (defui hello-panel [this] [:h1 "Hello World!"]) +;; Define an object prototype (object/object* ::user.hello :tags [:user.hello] :behaviors [::on-close-destroy] :init (fn [this] (hello-panel this))) +;; Currently used by :user.hello but could be reused by any +;; object with a declaration in user.behaviors. (behavior ::on-close-destroy :triggers #{:close} :reaction (fn [this] @@ -20,6 +24,8 @@ (def hello (object/create ::user.hello)) +;; Create a user command. Commands can call any function +;; and be bound to any keystroke. (cmd/command {:command :user.say-hello :desc "User: Say Hello" :exec (fn [] diff --git a/deploy/core/settings/user_compiled.js b/deploy/core/settings/user_compiled.js index 971793b61..b9161a2d4 100644 --- a/deploy/core/settings/user_compiled.js +++ b/deploy/core/settings/user_compiled.js @@ -7,45 +7,45 @@ goog.require('lt.objs.tabs'); goog.require('lt.objs.tabs'); goog.require('lt.object'); goog.require('lt.object'); -lt.plugins.user.hello_panel = (function hello_panel(this$){var e__7755__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h1","h1",1013907515),"Hello World!"], null));var seq__7845_7861 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__7846_7862 = null;var count__7847_7863 = 0;var i__7848_7864 = 0;while(true){ -if((i__7848_7864 < count__7847_7863)) -{var vec__7849_7865 = cljs.core._nth.call(null,chunk__7846_7862,i__7848_7864);var ev__7756__auto___7866 = cljs.core.nth.call(null,vec__7849_7865,0,null);var func__7757__auto___7867 = cljs.core.nth.call(null,vec__7849_7865,1,null);lt.util.dom.on.call(null,e__7755__auto__,ev__7756__auto___7866,func__7757__auto___7867); +lt.plugins.user.hello_panel = (function hello_panel(this$){var e__7755__auto__ = crate.core.html.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"h1","h1",1013907515),"Hello World!"], null));var seq__8077_8083 = cljs.core.seq.call(null,cljs.core.partition.call(null,2,cljs.core.PersistentVector.EMPTY));var chunk__8078_8084 = null;var count__8079_8085 = 0;var i__8080_8086 = 0;while(true){ +if((i__8080_8086 < count__8079_8085)) +{var vec__8081_8087 = cljs.core._nth.call(null,chunk__8078_8084,i__8080_8086);var ev__7756__auto___8088 = cljs.core.nth.call(null,vec__8081_8087,0,null);var func__7757__auto___8089 = cljs.core.nth.call(null,vec__8081_8087,1,null);lt.util.dom.on.call(null,e__7755__auto__,ev__7756__auto___8088,func__7757__auto___8089); { -var G__7868 = seq__7845_7861; -var G__7869 = chunk__7846_7862; -var G__7870 = count__7847_7863; -var G__7871 = (i__7848_7864 + 1); -seq__7845_7861 = G__7868; -chunk__7846_7862 = G__7869; -count__7847_7863 = G__7870; -i__7848_7864 = G__7871; +var G__8090 = seq__8077_8083; +var G__8091 = chunk__8078_8084; +var G__8092 = count__8079_8085; +var G__8093 = (i__8080_8086 + 1); +seq__8077_8083 = G__8090; +chunk__8078_8084 = G__8091; +count__8079_8085 = G__8092; +i__8080_8086 = G__8093; continue; } } else -{var temp__4126__auto___7872 = cljs.core.seq.call(null,seq__7845_7861);if(temp__4126__auto___7872) -{var seq__7845_7873__$1 = temp__4126__auto___7872;if(cljs.core.chunked_seq_QMARK_.call(null,seq__7845_7873__$1)) -{var c__7112__auto___7874 = cljs.core.chunk_first.call(null,seq__7845_7873__$1);{ -var G__7875 = cljs.core.chunk_rest.call(null,seq__7845_7873__$1); -var G__7876 = c__7112__auto___7874; -var G__7877 = cljs.core.count.call(null,c__7112__auto___7874); -var G__7878 = 0; -seq__7845_7861 = G__7875; -chunk__7846_7862 = G__7876; -count__7847_7863 = G__7877; -i__7848_7864 = G__7878; +{var temp__4126__auto___8094 = cljs.core.seq.call(null,seq__8077_8083);if(temp__4126__auto___8094) +{var seq__8077_8095__$1 = temp__4126__auto___8094;if(cljs.core.chunked_seq_QMARK_.call(null,seq__8077_8095__$1)) +{var c__7112__auto___8096 = cljs.core.chunk_first.call(null,seq__8077_8095__$1);{ +var G__8097 = cljs.core.chunk_rest.call(null,seq__8077_8095__$1); +var G__8098 = c__7112__auto___8096; +var G__8099 = cljs.core.count.call(null,c__7112__auto___8096); +var G__8100 = 0; +seq__8077_8083 = G__8097; +chunk__8078_8084 = G__8098; +count__8079_8085 = G__8099; +i__8080_8086 = G__8100; continue; } } else -{var vec__7850_7879 = cljs.core.first.call(null,seq__7845_7873__$1);var ev__7756__auto___7880 = cljs.core.nth.call(null,vec__7850_7879,0,null);var func__7757__auto___7881 = cljs.core.nth.call(null,vec__7850_7879,1,null);lt.util.dom.on.call(null,e__7755__auto__,ev__7756__auto___7880,func__7757__auto___7881); +{var vec__8082_8101 = cljs.core.first.call(null,seq__8077_8095__$1);var ev__7756__auto___8102 = cljs.core.nth.call(null,vec__8082_8101,0,null);var func__7757__auto___8103 = cljs.core.nth.call(null,vec__8082_8101,1,null);lt.util.dom.on.call(null,e__7755__auto__,ev__7756__auto___8102,func__7757__auto___8103); { -var G__7882 = cljs.core.next.call(null,seq__7845_7873__$1); -var G__7883 = null; -var G__7884 = 0; -var G__7885 = 0; -seq__7845_7861 = G__7882; -chunk__7846_7862 = G__7883; -count__7847_7863 = G__7884; -i__7848_7864 = G__7885; +var G__8104 = cljs.core.next.call(null,seq__8077_8095__$1); +var G__8105 = null; +var G__8106 = 0; +var G__8107 = 0; +seq__8077_8083 = G__8104; +chunk__8078_8084 = G__8105; +count__8079_8085 = G__8106; +i__8080_8086 = G__8107; continue; } } @@ -62,7 +62,7 @@ lt.plugins.user.__BEH__on_close_destroy = (function __BEH__on_close_destroy(this }); lt.object.behavior_STAR_.call(null,new cljs.core.Keyword("lt.plugins.user","on-close-destroy","lt.plugins.user/on-close-destroy",4509098889),new cljs.core.Keyword(null,"triggers","triggers",2516997421),new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"close","close",1108660586),null], null), null),new cljs.core.Keyword(null,"reaction","reaction",4441361819),lt.plugins.user.__BEH__on_close_destroy); lt.plugins.user.hello = lt.object.create.call(null,new cljs.core.Keyword("lt.plugins.user","user.hello","lt.plugins.user/user.hello",3780889681)); -lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword("lt.plugins.user","say-hello","lt.plugins.user/say-hello",853454032),new cljs.core.Keyword(null,"desc","desc",1016984067),"User: Say Hello",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.objs.tabs.add_or_focus_BANG_.call(null,lt.plugins.user.hello); +lt.objs.command.command.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"command","command",1964298941),new cljs.core.Keyword(null,"user.say-hello","user.say-hello",576535935),new cljs.core.Keyword(null,"desc","desc",1016984067),"User: Say Hello",new cljs.core.Keyword(null,"exec","exec",1017031683),(function (){return lt.objs.tabs.add_or_focus_BANG_.call(null,lt.plugins.user.hello); })], null)); } From fa158d5f7037d80195eec077305aee6ff51ad63c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 23 Oct 2014 12:27:22 -0400 Subject: [PATCH 258/656] Fix Haxe extension per #1539 --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d2dbb851f..060bad324 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -235,7 +235,7 @@ {:name "Groovy" :exts [:groovy] :mime "text/x-groovy" :tags [:editor.groovy]} {:name "HAML" :exts [:haml] :mime "text/x-haml" :tags [:editor.haml]} {:name "Haskell" :exts [:hs] :mime "text/x-haskell" :tags [:editor.haskell]} - {:name "Haxe" :exts [:haxe] :mime "text/x-haxe" :tags [:editor.haxe]} + {:name "Haxe" :exts [:hx] :mime "text/x-haxe" :tags [:editor.haxe]} {:name "HTML" :exts [:html :htm] :mime "htmlmixed" :tags [:editor.html]} {:name "INI" :exts [:ini] :mime "text/x-ini" :tags [:editor.ini]} {:name "Java" :exts [:java] :mime "text/x-java" :tags [:editor.java]} From 1325f25267ccd3f5fa71abc3bb4a73d89adddc45 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Tue, 22 Apr 2014 11:40:14 +0200 Subject: [PATCH 259/656] Print /fullpath/file in the message if the file was modified or deleted. If two files with the same name were modified or deleted then we don't know which one is about to be reloaded or saved. --- src/lt/objs/editor/pool.cljs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 3a75e9386..6bf49c108 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -129,7 +129,7 @@ (when-let [ed (first (by-path f))] (when-not (doc/check-mtime (doc/->stats f) stat) (if (:dirty @ed) - (active-warn ed {:header "This file has been modified." + (active-warn ed {:header (str "File modified: " f) :body "This file seems to have been modified outside of Light Table. Do you want to load the latest and lose your changes?" :buttons [{:label "Reload from disk" :action (fn [] @@ -138,8 +138,8 @@ ]}) (reload ed))))))) -(defn warn-delete [ed] - (active-warn ed {:header "This file has been deleted." +(defn warn-delete [f ed] + (active-warn ed {:header (str "File deleted: " f) :body "This file seems to have been deleted and we've marked it as unsaved." :buttons [{:label "Save as.." :action (fn [] @@ -151,7 +151,7 @@ :reaction (fn [ws del] (if-let [ed (first (by-path del))] (do - (warn-delete ed) + (warn-delete del ed) (make-transient-dirty ed) (when-let [ts (:lt.objs.tabs/tabset @ed)] (object/raise ts :tab.updated))) @@ -160,7 +160,7 @@ false) (object/by-tag :editor))] (doseq [ed open] - (warn-delete ed) + (warn-delete del ed) (make-transient-dirty ed)))))) (behavior ::watched.rename From 181e8de539fd9c443b0e76f2fae1348ba363e7c6 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Tue, 15 Apr 2014 00:31:39 +0200 Subject: [PATCH 260/656] tabs: rounded top corners look better that sharp edges --- deploy/core/css/skins/new-dark.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index f0a057669..031c0c6ad 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -109,7 +109,7 @@ input { color: var(highlight-fg); background:var(highlight-bg); } #multi-container { background: var(bg); } #multi .list { background:transparent; } #multi .list li { box-sizing:border-box; height:29px; } -#multi .list .active, #multi .list li:hover { background:var(multi); color:var(highlight-fg); } +#multi .list .active, #multi .list li:hover { background:var(multi); color:var(highlight-fg); border-radius:5px 5px 0px 0px; } #multi .list .dirty { color:var(accent-foreground); } #multi .list .dirty .file-name:after { content: "*"; } #multi .list.dragging li { background:transparent !important; } From 0baab740f9ab209eed89cb3085656c7619113650 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 24 Oct 2014 07:58:46 -0400 Subject: [PATCH 261/656] Update warn-delete to convention of editor as first arg --- src/lt/objs/editor/pool.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 6bf49c108..84707f05c 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -138,7 +138,7 @@ ]}) (reload ed))))))) -(defn warn-delete [f ed] +(defn warn-delete [ed f] (active-warn ed {:header (str "File deleted: " f) :body "This file seems to have been deleted and we've marked it as unsaved." :buttons [{:label "Save as.." @@ -151,7 +151,7 @@ :reaction (fn [ws del] (if-let [ed (first (by-path del))] (do - (warn-delete del ed) + (warn-delete ed del) (make-transient-dirty ed) (when-let [ts (:lt.objs.tabs/tabset @ed)] (object/raise ts :tab.updated))) @@ -160,7 +160,7 @@ false) (object/by-tag :editor))] (doseq [ed open] - (warn-delete del ed) + (warn-delete ed del) (make-transient-dirty ed)))))) (behavior ::watched.rename From 25d98e99a346836f1e277f5cadaa74f0599bad63 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 25 Oct 2014 00:37:58 +0300 Subject: [PATCH 262/656] Prevent adding same folder and file to workspace #775 #1588 #1217 --- src/lt/objs/workspace.cljs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 983a6867e..f7e09ebf8 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -207,16 +207,18 @@ (behavior ::add-file! :triggers #{:add.file!} :reaction (fn [this f] - (add! this :files f) - (object/raise this :add f) - (object/raise this :updated))) + (when-not (some #{f} (:files (-> @this))) + (add! this :files f) + (object/raise this :add f) + (object/raise this :updated)))) (behavior ::add-folder! :triggers #{:add.folder!} :reaction (fn [this f] - (add! this :folders f) - (object/raise this :add f) - (object/raise this :updated))) + (when-not (some #{f} (:folders (-> @this))) + (add! this :folders f) + (object/raise this :add f) + (object/raise this :updated)))) (behavior ::remove-file! :triggers #{:remove.file!} From a301f05e6f6489eabbaef092c850c739e2fd7abd Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Fri, 24 Oct 2014 21:04:04 -0700 Subject: [PATCH 263/656] fix regexp replace Signed-off-by: Chris Granger --- deploy/core/node_modules/codemirror/search.js | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/node_modules/codemirror/search.js b/deploy/core/node_modules/codemirror/search.js index 223e48a53..6f61411f7 100644 --- a/deploy/core/node_modules/codemirror/search.js +++ b/deploy/core/node_modules/codemirror/search.js @@ -41,6 +41,7 @@ return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase()); } function isRegex(s) { + if(s instanceof RegExp) return true; return s.match(/^\/(.+)\/([a-z]*)$/); } function parseQuery(query) { From c80d761ba9539261991e3407993df63fb95c6b52 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 25 Oct 2014 11:21:51 +0300 Subject: [PATCH 264/656] Show message if file/folder is already in workspace --- src/lt/objs/workspace.cljs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index f7e09ebf8..b0df38072 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -4,6 +4,7 @@ [lt.objs.files :as files] [lt.objs.command :as cmd] [lt.objs.cache :as cache] + [lt.objs.notifos :as notifos] [cljs.reader :as reader] [lt.util.load :as load] [lt.util.js :refer [now]] @@ -207,18 +208,22 @@ (behavior ::add-file! :triggers #{:add.file!} :reaction (fn [this f] - (when-not (some #{f} (:files (-> @this))) - (add! this :files f) - (object/raise this :add f) - (object/raise this :updated)))) + (if-not (some #{f} (:files @this)) + (do + (add! this :files f) + (object/raise this :add f) + (object/raise this :updated)) + (notifos/set-msg! "This file is already in your workspace." {:class "error"})))) (behavior ::add-folder! :triggers #{:add.folder!} :reaction (fn [this f] - (when-not (some #{f} (:folders (-> @this))) - (add! this :folders f) - (object/raise this :add f) - (object/raise this :updated)))) + (if-not (some #{f} (:folders @this)) + (do + (add! this :folders f) + (object/raise this :add f) + (object/raise this :updated)) + (notifos/set-msg! "This folder is already in your workspace." {:class "error"})))) (behavior ::remove-file! :triggers #{:remove.file!} From 230ca2e67e88a90fe79ec6d19d46270b80c92755 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 25 Oct 2014 10:57:24 -0400 Subject: [PATCH 265/656] Use contains? for set membership for readability some or just set as a fn are equally valid but harder to parse on first glance --- src/lt/objs/workspace.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index b0df38072..baacd3338 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -208,7 +208,7 @@ (behavior ::add-file! :triggers #{:add.file!} :reaction (fn [this f] - (if-not (some #{f} (:files @this)) + (if-not (contains? (set (:files @this)) f) (do (add! this :files f) (object/raise this :add f) @@ -218,7 +218,7 @@ (behavior ::add-folder! :triggers #{:add.folder!} :reaction (fn [this f] - (if-not (some #{f} (:folders @this)) + (if-not (contains? (set (:folders @this)) f) (do (add! this :folders f) (object/raise this :add f) From c10f8001e2638d083933726278ccb3e1c9e176ff Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 25 Oct 2014 21:07:20 +0300 Subject: [PATCH 266/656] Fixed context/out! arity --- src/lt/objs/context.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index d10a3f82e..7969f9515 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -20,14 +20,14 @@ (declare ctx-obj) (defn out! - ([] (out! nil)) ([ctxs] (let [ctxs (if (coll? ctxs) ctxs [ctxs])] (swap! contexts #(apply disj % ctxs)) (swap! ctx->obj #(apply dissoc % ctxs)) - (object/raise ctx-obj :log!)))) + (object/raise ctx-obj :log!))) + ([ctxs _] (out! ctxs))) (defn in! [ctxs & [obj]] (let [ctxs (if (coll? ctxs) From 662ead399f82640812833387c441b802579fbddd Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 27 Oct 2014 10:26:02 -0700 Subject: [PATCH 267/656] update core codemirror Signed-off-by: Chris Granger --- deploy/core/css/codemirror.css | 81 +- .../node_modules/codemirror/codemirror.js | 750 +++++++++++------- 2 files changed, 562 insertions(+), 269 deletions(-) diff --git a/deploy/core/css/codemirror.css b/deploy/core/css/codemirror.css index 431fb6230..af9e0f26e 100644 --- a/deploy/core/css/codemirror.css +++ b/deploy/core/css/codemirror.css @@ -40,6 +40,9 @@ box-sizing: content-box; } +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + /* CURSOR */ .CodeMirror div.CodeMirror-cursor { @@ -54,16 +57,86 @@ border: 0; background: #7e7; } +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} + +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; +} +@-moz-keyframes blink { + 0% { background: #7e7; } + 50% { background: none; } + 100% { background: #7e7; } +} +@-webkit-keyframes blink { + 0% { background: #7e7; } + 50% { background: none; } + 100% { background: #7e7; } +} +@keyframes blink { + 0% { background: #7e7; } + 50% { background: none; } + 100% { background: #7e7; } +} + /* Can style cursor different in overwrite (non-insert) mode */ div.CodeMirror-overwrite div.CodeMirror-cursor {} -.cm-tab { display: inline-block; } +.cm-tab { display: inline-block; text-decoration: inherit; } .CodeMirror-ruler { border-left: 1px solid #ccc; position: absolute; } +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + /* STOP */ /* The rest of this file contains styles related to the mechanics of @@ -145,6 +218,7 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} .CodeMirror-lines { cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ } .CodeMirror pre { /* Reset some styles that the rest of the page might have set */ @@ -204,7 +278,7 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} div.CodeMirror-cursors { visibility: hidden; position: relative; - z-index: 1; + z-index: 3; } .CodeMirror-focused div.CodeMirror-cursors { visibility: visible; @@ -231,3 +305,6 @@ div.CodeMirror-cursors { visibility: hidden; } } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/codemirror.js index aec908d10..9d6902ba9 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/codemirror.js @@ -61,7 +61,7 @@ function CodeMirror(place, options) { if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - this.options = options = options || {}; + this.options = options = options ? copyObj(options) : {}; // Determine effective options based on given values and defaults. copyObj(defaults, options, false); setGuttersForLineNumbers(options); @@ -96,20 +96,20 @@ registerEventHandlers(this); ensureGlobalHandlers(); - var cm = this; - runInOp(this, function() { - cm.curOp.forceUpdate = true; - attachDoc(cm, doc); + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); - if ((options.autofocus && !mobile) || activeElt() == display.input) - setTimeout(bind(onFocus, cm), 20); - else - onBlur(cm); + if ((options.autofocus && !mobile) || activeElt() == display.input) + setTimeout(bind(onFocus, this), 20); + else + onBlur(this); - for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) - optionHandlers[opt](cm, options[opt], Init); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](cm); - }); + for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) + optionHandlers[opt](this, options[opt], Init); + maybeUpdateLineNumberWidth(this); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + endOperation(this); } // DISPLAY CONSTRUCTOR @@ -467,18 +467,18 @@ } // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewPort may contain top, + // the the current scroll position). viewport may contain top, // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewPort) { - var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop; + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; top = Math.floor(top - paddingTop(display)); - var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight; + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and // forces those lines into the viewport (if possible). - if (viewPort && viewPort.ensure) { - var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line; + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; if (ensureFrom < from) return {from: ensureFrom, to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)}; @@ -543,82 +543,46 @@ // DISPLAY DRAWING - // Updates the display, selection, and scrollbars, using the - // information in display.view to find out which nodes are no longer - // up-to-date. Tries to bail out early when no changes are needed, - // unless forced is true. - // Returns true if an actual update happened, false otherwise. - function updateDisplay(cm, viewPort, forced) { - var oldFrom = cm.display.viewFrom, oldTo = cm.display.viewTo, updated; - var visible = visibleLines(cm.display, cm.doc, viewPort); - for (var first = true;; first = false) { - var oldWidth = cm.display.scroller.clientWidth; - if (!updateDisplayInner(cm, visible, forced)) break; - updated = true; - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - if (cm.display.maxLineChanged && !cm.options.lineWrapping) - adjustContentWidth(cm); - - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - if (webkit && cm.options.lineWrapping) - checkForWebkitWidthBug(cm, barMeasure); // (Issue #2420) - if (webkit && barMeasure.scrollWidth > barMeasure.clientWidth && - barMeasure.scrollWidth < barMeasure.clientWidth + 1 && - !hScrollbarTakesSpace(cm)) - updateScrollbars(cm); // (Issue #2562) - if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) { - forced = true; - continue; - } - forced = false; - - // Clip forced viewport to actual scrollable area. - if (viewPort && viewPort.top != null) - viewPort = {top: Math.min(barMeasure.docHeight - scrollerCutOff - barMeasure.clientHeight, viewPort.top)}; - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - visible = visibleLines(cm.display, cm.doc, viewPort); - if (visible.from >= cm.display.viewFrom && visible.to <= cm.display.viewTo) - break; - } + function DisplayUpdate(cm, viewport, force) { + var display = cm.display; - cm.display.updateLineNumbers = null; - if (updated) { - signalLater(cm, "update", cm); - if (cm.display.viewFrom != oldFrom || cm.display.viewTo != oldTo) - signalLater(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - } - return updated; + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.oldViewFrom = display.viewFrom; this.oldViewTo = display.viewTo; + this.oldScrollerWidth = display.scroller.clientWidth; + this.force = force; + this.dims = getDimensions(cm); } // Does the actual updating of the line display. Bails out // (returning false) when there is nothing to be done and forced is // false. - function updateDisplayInner(cm, visible, forced) { + function updateDisplayIfNeeded(cm, update) { var display = cm.display, doc = cm.doc; - if (!display.wrapper.offsetWidth) { + if (update.editorIsHidden) { resetView(cm); - return; + return false; } // Bail out if the visible area is already rendered and nothing changed. - if (!forced && visible.from >= display.viewFrom && visible.to <= display.viewTo && + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && countDirtyView(cm) == 0) - return; + return false; - if (maybeUpdateLineNumberWidth(cm)) + if (maybeUpdateLineNumberWidth(cm)) { resetView(cm); - var dims = getDimensions(cm); + update.dims = getDimensions(cm); + } // Compute a suitable new viewport (from & to) var end = doc.first + doc.size; - var from = Math.max(visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, visible.to + cm.options.viewportMargin); + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); if (sawCollapsedSpans) { @@ -627,7 +591,7 @@ } var different = from != display.viewFrom || to != display.viewTo || - display.lastSizeC != display.wrapper.clientHeight; + display.lastSizeC != update.wrapperHeight; adjustView(cm, from, to); display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); @@ -635,13 +599,15 @@ cm.display.mover.style.top = display.viewOffset + "px"; var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !forced) return; + if (!different && toUpdate == 0 && !update.force && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + return false; // For big changes, we hide the enclosing element during the // update, since that speeds up the operations on most browsers. var focused = activeElt(); if (toUpdate > 4) display.lineDiv.style.display = "none"; - patchDisplay(cm, display.updateLineNumbers, dims); + patchDisplay(cm, display.updateLineNumbers, update.dims); if (toUpdate > 4) display.lineDiv.style.display = ""; // There might have been a widget with a focused element that got // hidden or updated, if so re-focus it. @@ -653,24 +619,55 @@ removeChildren(display.selectionDiv); if (different) { - display.lastSizeC = display.wrapper.clientHeight; + display.lastSizeC = update.wrapperHeight; startWorker(cm, 400); } - updateHeightsInViewport(cm); + display.updateLineNumbers = null; return true; } - function adjustContentWidth(cm) { - var display = cm.display; - var width = measureChar(cm, display.maxLine, display.maxLine.text.length).left; - display.maxLineChanged = false; - var minWidth = Math.max(0, width + 3); - var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + minWidth + scrollerCutOff - display.scroller.clientWidth); - display.sizer.style.minWidth = minWidth + "px"; - if (maxScrollLeft < cm.doc.scrollLeft) - setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true); + function postUpdateDisplay(cm, update) { + var force = update.force, viewport = update.viewport; + for (var first = true;; first = false) { + if (first && cm.options.lineWrapping && update.oldScrollerWidth != cm.display.scroller.clientWidth) { + force = true; + } else { + force = false; + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - scrollerCutOff - + cm.display.scroller.clientHeight, viewport.top)}; + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + break; + } + if (!updateDisplayIfNeeded(cm, update)) break; + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + } + + signalLater(cm, "update", cm); + if (cm.display.viewFrom != update.oldViewFrom || cm.display.viewTo != update.oldViewTo) + signalLater(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + } } function setDocumentHeight(cm, measure) { @@ -725,9 +722,10 @@ // view, so that we don't interleave reading and writing to the DOM. function getDimensions(cm) { var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft; - width[cm.options.gutters[i]] = n.offsetWidth; + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; } return {fixedPos: compensateForHScroll(d), gutterTotalWidth: d.gutters.offsetWidth, @@ -1256,10 +1254,10 @@ // SELECTION DRAWING // Redraw the selection and/or cursor - function updateSelection(cm) { - var display = cm.display, doc = cm.doc; - var curFragment = document.createDocumentFragment(); - var selFragment = document.createDocumentFragment(); + function drawSelection(cm) { + var display = cm.display, doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); for (var i = 0; i < doc.sel.ranges.length; i++) { var range = doc.sel.ranges[i]; @@ -1274,16 +1272,26 @@ if (cm.options.moveInputWithCursor) { var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - var top = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - var left = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - display.inputDiv.style.top = top + "px"; - display.inputDiv.style.left = left + "px"; + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); } - removeChildrenAndAdd(display.cursorDiv, curFragment); - removeChildrenAndAdd(display.selectionDiv, selFragment); + return result; + } + + function showSelection(cm, drawn) { + removeChildrenAndAdd(cm.display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(cm.display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + cm.display.inputDiv.style.top = drawn.teTop + "px"; + cm.display.inputDiv.style.left = drawn.teLeft + "px"; + } + } + + function updateSelection(cm) { + showSelection(cm, drawSelection(cm)); } // Draws a cursor for the given range @@ -1390,6 +1398,8 @@ display.blinker = setInterval(function() { display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, cm.options.cursorBlinkRate); + else if (cm.options.cursorBlinkRate < 0) + display.cursorDiv.style.visibility = "hidden"; } // HIGHLIGHT WORKER @@ -1405,18 +1415,20 @@ if (doc.frontier >= cm.display.viewTo) return; var end = +new Date + cm.options.workTime; var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); + var changedLines = []; - runInOp(cm, function() { doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { if (doc.frontier >= cm.display.viewFrom) { // Visible var oldStyles = line.styles; var highlighted = highlightLine(cm, line, state, true); line.styles = highlighted.styles; - if (highlighted.classes) line.styleClasses = highlighted.classes; - else if (line.styleClasses) line.styleClasses = null; - var ischange = !oldStyles || oldStyles.length != line.styles.length; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) line.styleClasses = newCls; + else if (oldCls) line.styleClasses = null; + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; - if (ischange) regLineChange(cm, doc.frontier, "text"); + if (ischange) changedLines.push(doc.frontier); line.stateAfter = copyState(doc.mode, state); } else { processLine(cm, line.text, state); @@ -1428,6 +1440,9 @@ return true; } }); + if (changedLines.length) runInOp(cm, function() { + for (var i = 0; i < changedLines.length; i++) + regLineChange(cm, changedLines[i], "text"); }); } @@ -1631,19 +1646,26 @@ var rect; if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; - while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; - if (ie && ie_version < 9 && start == 0 && end == mEnd - mStart) { - rect = node.parentNode.getBoundingClientRect(); - } else if (ie && cm.options.lineWrapping) { - var rects = range(node, start, end).getClientRects(); - if (rects.length) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = nullRect; - } else { - rect = range(node, start, end).getBoundingClientRect() || nullRect; + for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; + while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; + if (ie && ie_version < 9 && start == 0 && end == mEnd - mStart) { + rect = node.parentNode.getBoundingClientRect(); + } else if (ie && cm.options.lineWrapping) { + var rects = range(node, start, end).getClientRects(); + if (rects.length) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = nullRect; + } else { + rect = range(node, start, end).getBoundingClientRect() || nullRect; + } + if (rect.left || rect.right || start == 0) break; + end = start; + start = start - 1; + collapse = "right"; } + if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); } else { // If it is a widget, simply get the box for the whole widget. if (start > 0) collapse = bias = "right"; var rects; @@ -1671,9 +1693,22 @@ top: top, bottom: bot}; if (!rect.left && !rect.right) result.bogus = true; if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + return result; } + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + return rect; + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY}; + } + function clearLineMeasurementCacheFor(lineView) { if (lineView.measure) { lineView.measure.cache = {}; @@ -1906,10 +1941,13 @@ // error-prone). Instead, display updates are batched and then all // combined and executed at once. + var operationGroup = null; + var nextOpId = 0; // Start a new operation. function startOperation(cm) { cm.curOp = { + cm: cm, viewChanged: false, // Flag that indicates that lines might need to be redrawn startHeight: cm.doc.height, // Used to detect need to update scrollbar forceUpdate: false, // Used to force a redraw @@ -1917,60 +1955,156 @@ typing: false, // Whether this reset should be careful to leave existing text (for compositing) changeObjs: null, // Accumulated changes, for firing change events cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already selectionChanged: false, // Whether the selection needs to be redrawn updateMaxLine: false, // Set when the widest line needs to be determined anew scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet scrollToPos: null, // Used to scroll to a specific position id: ++nextOpId // Unique ID }; - if (!delayedCallbackDepth++) delayedCallbacks = []; + if (operationGroup) { + operationGroup.ops.push(cm.curOp); + } else { + cm.curOp.ownsGroup = operationGroup = { + ops: [cm.curOp], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + callbacks[i](); + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); + } + } while (i < callbacks.length); } // Finish an operation, updating the display and signalling delayed events function endOperation(cm) { - var op = cm.curOp, doc = cm.doc, display = cm.display; - cm.curOp = null; - + var op = cm.curOp, group = op.ownsGroup; + if (!group) return; + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + for (var i = 0; i < group.ops.length; i++) + group.ops[i].cm.curOp = null; + endOperations(group); + } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R1(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W1(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R2(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W2(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_finish(ops[i]); + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; if (op.updateMaxLine) findMaxLine(cm); - // If it looks like an update might be needed, call updateDisplay - if (op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping) { - var updated = updateDisplay(cm, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop; + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) updateHeightsInViewport(cm); + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo + + scrollerCutOff - display.scroller.clientWidth); + } + + if (op.updatedDisplay || op.selectionChanged) + op.newSelectionNodes = drawSelection(cm); + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + cm.display.maxLineChanged = false; } - // If no update was run, but the selection changed, redraw that. - if (!updated && op.selectionChanged) updateSelection(cm); - if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm); + + if (op.newSelectionNodes) + showSelection(cm, op.newSelectionNodes); + if (op.updatedDisplay) + setDocumentHeight(cm, op.barMeasure); + if (op.updatedDisplay || op.startHeight != cm.doc.height) + updateScrollbars(cm, op.barMeasure); + + if (op.selectionChanged) restartBlink(cm); + + if (cm.state.focused && op.updateInput) + resetInput(cm, op.typing); + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.adjustWidthTo != null && Math.abs(op.barMeasure.scrollWidth - cm.display.scroller.scrollWidth) > 1) + updateScrollbars(cm); + + if (op.updatedDisplay) postUpdateDisplay(cm, op.update); // Abort mouse wheel delta measurement, when scrolling explicitly if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) display.wheelStartX = display.wheelStartY = null; // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) { + if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top; } - if (op.scrollLeft != null && display.scroller.scrollLeft != op.scrollLeft) { + if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)); display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left; alignHorizontally(cm); } // If we need to scroll a specific position into view, do so. if (op.scrollToPos) { - var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from), - clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin); + var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); } - if (op.selectionChanged) restartBlink(cm); - - if (cm.state.focused && op.updateInput) - resetInput(cm, op.typing); - // Fire events for markers that are hidden/unidden by editing or // undoing var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; @@ -1979,18 +2113,22 @@ if (unhidden) for (var i = 0; i < unhidden.length; ++i) if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); - var delayed; - if (!--delayedCallbackDepth) { - delayed = delayedCallbacks; - delayedCallbacks = null; + if (display.wrapper.offsetHeight) + doc.scrollTop = cm.display.scroller.scrollTop; + + // Apply workaround for two webkit bugs + if (op.updatedDisplay && webkit) { + if (cm.options.lineWrapping) + checkForWebkitWidthBug(cm, op.barMeasure); // (Issue #2420) + if (op.barMeasure.scrollWidth > op.barMeasure.clientWidth && + op.barMeasure.scrollWidth < op.barMeasure.clientWidth + 1 && + !hScrollbarTakesSpace(cm)) + updateScrollbars(cm); // (Issue #2562) } + // Fire change events, and delayed event handlers if (op.changeObjs) signal(cm, "changes", cm, op.changeObjs); - if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i](); - if (op.cursorActivityHandlers) - for (var i = 0; i < op.cursorActivityHandlers.length; i++) - op.cursorActivityHandlers[i](cm); } // Run the given function in an operation @@ -2242,6 +2380,11 @@ cm.display.poll.set(20, p); } + // This will be set to an array of strings when copying, so that, + // when pasting, we know what kind of selections the copied text + // was made out of. + var lastCopied = null; + // Read input from the textarea, and update the document to match. // When something is selected, it is present in the textarea, and // selected (unless it is huge, in which case a placeholder is @@ -2264,8 +2407,11 @@ var text = input.value; // If nothing changed, bail. if (text == prevInput && !cm.somethingSelected()) return false; - // Work around nonsensical selection resetting in IE9/10 - if (ie && ie_version >= 9 && cm.display.inputHasSelection === text) { + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && cm.display.inputHasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { resetInput(cm); return false; } @@ -2282,7 +2428,13 @@ var inserted = text.slice(same), textLines = splitLines(inserted); // When pasing N lines into N selections, insert one line per selection - var multiPaste = cm.state.pasteIncoming && textLines.length > 1 && doc.sel.ranges.length == textLines.length; + var multiPaste = null; + if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) { + if (lastCopied && lastCopied.join("\n") == inserted) + multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines); + else if (textLines.length == doc.sel.ranges.length) + multiPaste = map(textLines, function(l) { return [l]; }); + } // Normal behavior is to insert the new text into every selection for (var i = doc.sel.ranges.length - 1; i >= 0; i--) { @@ -2295,7 +2447,7 @@ else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming) to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: multiPaste ? [textLines[i]] : textLines, + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; makeChange(cm.doc, changeEvent); signalLater(cm, "inputRead", cm, changeEvent); @@ -2304,16 +2456,16 @@ cm.options.smartIndent && range.head.ch < 100 && (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) { var mode = cm.getModeAt(range.head); + var end = changeEnd(changeEvent); if (mode.electricChars) { for (var j = 0; j < mode.electricChars.length; j++) if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indentLine(cm, range.head.line, "smart"); + indentLine(cm, end.line, "smart"); break; } } else if (mode.electricInput) { - var end = changeEnd(changeEvent); if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) - indentLine(cm, range.head.line, "smart"); + indentLine(cm, end.line, "smart"); } } } @@ -2375,7 +2527,7 @@ var pos = posFromMouse(cm, e); if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; e_preventDefault(e); - var word = findWordAt(cm, pos); + var word = cm.findWordAt(pos); extendSelection(cm.doc, word.anchor, word.head); })); else @@ -2416,7 +2568,7 @@ // Prevent wrapper from ever scrolling on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - on(d.input, "keyup", operation(cm, onKeyUp)); + on(d.input, "keyup", function(e) { onKeyUp.call(cm, e); }); on(d.input, "input", function() { if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; fastPoll(cm); @@ -2448,8 +2600,12 @@ if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) { var start = d.input.selectionStart, end = d.input.selectionEnd; d.input.value += "$"; - d.input.selectionStart = start; + // The selection end needs to be set before the start, otherwise there + // can be an intermediate non-empty selection between the two, which + // can override the middle-click paste buffer on linux and cause the + // wrong thing to get pasted. d.input.selectionEnd = end; + d.input.selectionStart = start; cm.state.fakedLastChar = true; } cm.state.pasteIncoming = true; @@ -2458,27 +2614,29 @@ function prepareCopyCut(e) { if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); if (d.inaccurateSelection) { d.prevInput = ""; d.inaccurateSelection = false; - d.input.value = cm.getSelection(); + d.input.value = lastCopied.join("\n"); selectInput(d.input); } } else { - var text = "", ranges = []; + var text = [], ranges = []; for (var i = 0; i < cm.doc.sel.ranges.length; i++) { var line = cm.doc.sel.ranges[i].head.line; var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; ranges.push(lineRange); - text += cm.getRange(lineRange.anchor, lineRange.head); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); } if (e.type == "cut") { cm.setSelections(ranges, null, sel_dontScroll); } else { d.prevInput = ""; - d.input.value = text; + d.input.value = text.join("\n"); selectInput(d.input); } + lastCopied = text; } if (e.type == "cut") cm.state.cutIncoming = true; } @@ -2648,7 +2806,7 @@ start = posFromMouse(cm, e, true, true); ourIndex = -1; } else if (type == "double") { - var word = findWordAt(cm, start); + var word = cm.findWordAt(start); if (cm.display.shift || doc.extend) ourRange = extendRange(doc, ourRange, word.anchor, word.head); else @@ -2702,7 +2860,7 @@ var anchor = oldRange.anchor, head = pos; if (type != "single") { if (type == "double") - var range = findWordAt(cm, pos); + var range = cm.findWordAt(pos); else var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); if (cmp(range.anchor, anchor) > 0) { @@ -2876,10 +3034,10 @@ function setScrollTop(cm, val) { if (Math.abs(cm.doc.scrollTop - val) < 2) return; cm.doc.scrollTop = val; - if (!gecko) updateDisplay(cm, {top: val}); + if (!gecko) updateDisplaySimple(cm, {top: val}); if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; - if (gecko) updateDisplay(cm); + if (gecko) updateDisplaySimple(cm); startWorker(cm, 100); } // Sync scroller and scrollbar, ensure the gutter elements are @@ -2962,7 +3120,7 @@ var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; if (pixels < 0) top = Math.max(0, top + pixels - 50); else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplay(cm, {top: top, bottom: bot}); + updateDisplaySimple(cm, {top: top, bottom: bot}); } if (wheelSamples < 20) { @@ -3105,13 +3263,13 @@ } function onKeyUp(e) { - if (signalDOMEvent(this, e)) return; if (e.keyCode == 16) this.doc.sel.shift = false; + signalDOMEvent(this, e); } function onKeyPress(e) { var cm = this; - if (signalDOMEvent(cm, e)) return; + if (signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; var keyCode = e.keyCode, charCode = e.charCode; if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; @@ -3175,7 +3333,9 @@ "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) focusInput(cm); + if (webkit) window.scrollTo(null, oldScrollY); resetInput(cm); // Adds "Select all" to context menu in FF if (!cm.somethingSelected()) display.input.value = display.prevInput = " "; @@ -3405,9 +3565,9 @@ antiChanges.push(historyChangeFromChange(doc, change)); - var after = i ? computeSelAfterChange(doc, change, null) : lst(source); + var after = i ? computeSelAfterChange(doc, change) : lst(source); makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) doc.cm.scrollIntoView(change); + if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); var rebased = []; // Propagate to the linked documents @@ -3464,7 +3624,7 @@ change.removed = getBetween(doc, change.from, change.to); - if (!selAfter) selAfter = computeSelAfterChange(doc, change, null); + if (!selAfter) selAfter = computeSelAfterChange(doc, change); if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); else updateDoc(doc, change, spans); setSelectionNoUndo(doc, selAfter, sel_dontScroll); @@ -3560,7 +3720,7 @@ // measured, the position of something may 'drift' during drawing). function scrollPosIntoView(cm, pos, end, margin) { if (margin == null) margin = 0; - for (;;) { + for (var limit = 0; limit < 5; limit++) { var changed = false, coords = cursorCoords(cm, pos); var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), @@ -3596,6 +3756,7 @@ if (y1 < 0) y1 = 0; var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; var screen = display.scroller.clientHeight - scrollerCutOff, result = {}; + if (y2 - y1 > screen) y2 = y1 + screen; var docBottom = cm.doc.height + paddingVert(display); var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; if (y1 < screentop) { @@ -3606,16 +3767,16 @@ } var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; - var screenw = display.scroller.clientWidth - scrollerCutOff; - x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth; - var gutterw = display.gutters.offsetWidth; - var atLeft = x1 < gutterw + 10; - if (x1 < screenleft + gutterw || atLeft) { - if (atLeft) x1 = 0; - result.scrollLeft = Math.max(0, x1 - 10 - gutterw); - } else if (x2 > screenw + screenleft - 3) { - result.scrollLeft = x2 + 10 - screenw; - } + var screenw = display.scroller.clientWidth - scrollerCutOff - display.gutters.offsetWidth; + var tooWide = x2 - x1 > screenw; + if (tooWide) x2 = x1 + screenw; + if (x1 < 10) + result.scrollLeft = 0; + else if (x1 < screenleft) + result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); + else if (x2 > screenw + screenleft - 3) + result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; + return result; } @@ -3671,7 +3832,7 @@ if (how == "smart") { // Fall back to "prev" when the mode doesn't have an indentation // method. - if (!cm.doc.mode.indent) how = "prev"; + if (!doc.mode.indent) how = "prev"; else state = getStateBefore(cm, n); } @@ -3683,8 +3844,8 @@ indentation = 0; how = "not"; } else if (how == "smart") { - indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass) { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { if (!aggressive) return; how = "prev"; } @@ -3707,7 +3868,7 @@ if (pos < indentation) indentString += spaceStr(indentation - pos); if (indentString != curSpaceString) { - replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); } else { // Ensure that, if the cursor was in the whitespace at the start // of the line, it is moved to the end of that space. @@ -3837,24 +3998,6 @@ return target; } - // Find the word at the given position (as returned by coordsChar). - function findWordAt(cm, pos) { - var doc = cm.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = cm.getHelper(pos, "wordChars"); - if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function(ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} - : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; - while (start > 0 && check(line.charAt(start - 1))) --start; - while (end < line.length && check(line.charAt(end))) ++end; - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - } - // EDITOR METHODS // The publicly visible API. Note that methodOp(f) means @@ -3924,11 +4067,14 @@ for (var i = 0; i < ranges.length; i++) { var range = ranges[i]; if (!range.empty()) { - var start = Math.max(end, range.from().line); - var to = range.to(); + var from = range.from(), to = range.to(); + var start = Math.max(end, from.line); end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; for (var j = start; j < end; ++j) indentLine(this, j, how); + var newRanges = this.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } else if (range.head.line > end) { indentLine(this, range.head.line, how, true); end = range.head.line; @@ -4124,7 +4270,7 @@ triggerOnKeyDown: methodOp(onKeyDown), triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: methodOp(onKeyUp), + triggerOnKeyUp: onKeyUp, execCommand: function(cmd) { if (commands.hasOwnProperty(cmd)) @@ -4193,6 +4339,24 @@ doc.sel.ranges[i].goalColumn = goals[i]; }), + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function(ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} + : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + toggleOverwrite: function(value) { if (value != null && value == this.state.overwrite) return; if (this.state.overwrite = !this.state.overwrite) @@ -4241,14 +4405,21 @@ }), setSize: methodOp(function(width, height) { + var cm = this; function interpret(val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; } - if (width != null) this.display.wrapper.style.width = interpret(width); - if (height != null) this.display.wrapper.style.height = interpret(height); - if (this.options.lineWrapping) clearLineMeasurementCache(this); - this.curOp.forceUpdate = true; - signal(this, "refresh", this); + if (width != null) cm.display.wrapper.style.width = interpret(width); + if (height != null) cm.display.wrapper.style.height = interpret(height); + if (cm.options.lineWrapping) clearLineMeasurementCache(this); + var lineNo = cm.display.viewFrom; + cm.doc.iter(lineNo, cm.display.viewTo, function(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) + if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } + ++lineNo; + }); + cm.curOp.forceUpdate = true; + signal(cm, "refresh", this); }), operation: function(f){return runInOp(this, f);}, @@ -4272,6 +4443,7 @@ clearCaches(this); resetInput(this); this.scrollTo(doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; signalLater(this, "swapDoc", this, old); return old; }), @@ -4317,7 +4489,7 @@ clearCaches(cm); regChange(cm); }, true); - option("specialChars", /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g, function(cm, val) { + option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val) { cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); cm.refresh(); }, true); @@ -4398,10 +4570,8 @@ // load a mode. (Preferred mechanism is the require/define calls.) CodeMirror.defineMode = function(name, mode) { if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - if (arguments.length > 2) { - mode.dependencies = []; - for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]); - } + if (arguments.length > 2) + mode.dependencies = Array.prototype.slice.call(arguments, 2); modes[name] = mode; }; @@ -4552,6 +4722,20 @@ return {from: Pos(range.from().line, 0), to: range.from()}; }); }, + delWrappedLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()}; + }); + }, + delWrappedLineRight: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos }; + }); + }, undo: function(cm) {cm.undo();}, redo: function(cm) {cm.redo();}, undoSelection: function(cm) {cm.undoSelection();}, @@ -4559,23 +4743,17 @@ goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, goLineStart: function(cm) { - cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, sel_move); + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1}); }, goLineStartSmart: function(cm) { cm.extendSelectionsBy(function(range) { - var start = lineStart(cm, range.head.line); - var line = cm.getLineHandle(start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = range.head.line == start.line && range.head.ch <= firstNonWS && range.head.ch; - return Pos(start.line, inWS ? 0 : firstNonWS); - } - return start; - }, sel_move); + return lineStartSmart(cm, range.head); + }, {origin: "+move", bias: 1}); }, goLineEnd: function(cm) { - cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, sel_move); + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1}); }, goLineRight: function(cm) { cm.extendSelectionsBy(function(range) { @@ -4589,6 +4767,14 @@ return cm.coordsChar({left: 0, top: top}, "div"); }, sel_move); }, + goLineLeftSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); + return pos; + }, sel_move); + }, goLineUp: function(cm) {cm.moveV(-1, "line");}, goLineDown: function(cm) {cm.moveV(1, "line");}, goPageUp: function(cm) {cm.moveV(-1, "page");}, @@ -4677,7 +4863,7 @@ // are simply ignored. keyMap.pcDefault = { "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", @@ -4687,12 +4873,12 @@ }; keyMap.macDefault = { "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delGroupBefore", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delLineLeft", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", fallthrough: ["basic", "emacsy"] }; // Very basic readline/emacs-style bindings, which are standard on Mac. @@ -4800,6 +4986,7 @@ cm.save = save; cm.getTextArea = function() { return textarea; }; cm.toTextArea = function() { + cm.toTextArea = isNaN; // Prevent this from being ran twice save(); textarea.parentNode.removeChild(cm.getWrapperElement()); textarea.style.display = ""; @@ -5407,8 +5594,8 @@ var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; - if (fromCmp <= 0 && (cmp(found.to, from) || extraRight(sp.marker) - extraLeft(marker)) > 0 || - fromCmp >= 0 && (cmp(found.from, to) || extraLeft(sp.marker) - extraRight(marker)) < 0) + if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || + fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) return true; } } @@ -5526,8 +5713,12 @@ function widgetHeight(widget) { if (widget.height != null) return widget.height; - if (!contains(document.body, widget.node)) - removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, "position: relative")); + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + parentStyle += "margin-left: -" + widget.cm.getGutterElement().offsetWidth + "px;"; + removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } return widget.height = widget.node.offsetHeight; } @@ -5687,12 +5878,13 @@ return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; } - function getLineStyles(cm, line) { + function getLineStyles(cm, line, updateFrontier) { if (!line.styles || line.styles[0] != cm.state.modeGen) { var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); line.styles = result.styles; if (result.classes) line.styleClasses = result.classes; else if (line.styleClasses) line.styleClasses = null; + if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; } return line.styles; } @@ -5747,7 +5939,8 @@ if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) builder.addToken = buildTokenBadBidi(builder.addToken, order); builder.map = []; - insertLineContent(line, builder, getLineStyles(cm, line)); + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); if (line.styleClasses) { if (line.styleClasses.bgClass) builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); @@ -6322,7 +6515,7 @@ }, changeGeneration: function(forceSplit) { if (forceSplit) - this.history.lastOp = this.history.lastOrigin = null; + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; return this.history.generation; }, isClean: function (gen) { @@ -6639,7 +6832,7 @@ // Used to track when changes can be merged into a single undo // event this.lastModTime = this.lastSelTime = 0; - this.lastOp = null; + this.lastOp = this.lastSelOp = null; this.lastOrigin = this.lastSelOrigin = null; // Used by the isClean() method this.generation = this.maxGeneration = startGen || 1; @@ -6717,7 +6910,7 @@ hist.done.push(selAfter); hist.generation = ++hist.maxGeneration; hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = opId; + hist.lastOp = hist.lastSelOp = opId; hist.lastOrigin = hist.lastSelOrigin = change.origin; if (!last) signal(doc, "historyAdded"); @@ -6743,7 +6936,7 @@ // the current, or the origins don't allow matching. Origins // starting with * are always merged, those starting with + are // merged when similar and close together in time. - if (opId == hist.lastOp || + if (opId == hist.lastSelOp || (origin && hist.lastSelOrigin == origin && (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) @@ -6753,7 +6946,7 @@ hist.lastSelTime = +new Date; hist.lastSelOrigin = origin; - hist.lastOp = opId; + hist.lastSelOp = opId; if (options && options.clearRedo !== false) clearSelectionEvents(hist.undone); } @@ -6938,6 +7131,8 @@ for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); }; + var orphanDelayedCallbacks = null; + // Often, we want to signal events at a point where we are in the // middle of some work, but don't want the handler to start calling // other methods on the editor, which might be in an inconsistent @@ -6945,25 +7140,26 @@ // signalLater looks whether there are any handlers, and schedules // them to be executed when the last operation ends, or, if no // operation is active, when a timeout fires. - var delayedCallbacks, delayedCallbackDepth = 0; function signalLater(emitter, type /*, values...*/) { var arr = emitter._handlers && emitter._handlers[type]; if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2); - if (!delayedCallbacks) { - ++delayedCallbackDepth; - delayedCallbacks = []; - setTimeout(fireDelayed, 0); + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); } function bnd(f) {return function(){f.apply(null, args);};}; for (var i = 0; i < arr.length; ++i) - delayedCallbacks.push(bnd(arr[i])); + list.push(bnd(arr[i])); } - function fireDelayed() { - --delayedCallbackDepth; - var delayed = delayedCallbacks; - delayedCallbacks = null; + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; for (var i = 0; i < delayed.length; ++i) delayed[i](); } @@ -7100,7 +7296,7 @@ return function(){return f.apply(null, args);}; } - var nonASCIISingleCaseWordChar = /[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var nonASCIISingleCaseWordChar = /[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; var isWordCharBasic = CodeMirror.isWordChar = function(ch) { return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); @@ -7255,7 +7451,7 @@ var test = elt("span", "\u200b"); removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && (ie && ie_version < 8); + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } if (zwspSupported) return elt("span", "\u200b"); else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); @@ -7267,7 +7463,7 @@ if (badBidiRects != null) return badBidiRects; var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); var r0 = range(txt, 0, 1).getBoundingClientRect(); - if (r0.left == r0.right) return false; + if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) var r1 = range(txt, 1, 2).getBoundingClientRect(); return badBidiRects = (r1.right - r0.right < 3); } @@ -7309,6 +7505,15 @@ return typeof e.oncopy == "function"; })(); + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) return badZoomedRects; + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + // KEY NAMES var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", @@ -7371,6 +7576,17 @@ var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); return Pos(lineN == null ? lineNo(line) : lineN, ch); } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS); + } + return start; + } function compareBidiLevel(order, a, b) { var linedir = order[0].level; @@ -7610,7 +7826,7 @@ // THE END - CodeMirror.version = "4.2.1"; + CodeMirror.version = "4.7.1"; return CodeMirror; }); From c1b598c1aa1607e8ac66d005f739b68255d33f75 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 27 Oct 2014 10:37:39 -0700 Subject: [PATCH 268/656] fix menu for the latest nw Signed-off-by: Chris Granger --- src/lt/objs/menu.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index ddbc0e065..1d2fa26ff 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -170,6 +170,8 @@ (behavior ::create-menu :triggers #{:init} :reaction (fn [this] + (when (platform/mac?) + (set! (.-menu app/win) nil)) (main-menu))) (behavior ::recreate-menu @@ -189,8 +191,9 @@ (behavior ::remove-menu-close :triggers #{:closed :blur} :reaction (fn [this] - (when (platform/mac?) - (set! (.-menu app/win) nil)))) + (when (platform/mac?) + (set! (.-menu app/win) nil)) + )) (behavior ::menu! :triggers #{:menu!} From 462f177ddd4aee7e88521f1703d5512c1004b2e9 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 27 Oct 2014 10:37:39 -0700 Subject: [PATCH 269/656] fix menu for the latest nw Signed-off-by: Chris Granger --- deploy/package.json | 29 +++++++++++++++-------------- src/lt/objs/menu.cljs | 7 +++++-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/deploy/package.json b/deploy/package.json index 24abebd4a..c2f6fd28a 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -1,21 +1,22 @@ { "name": "LightTable", - "main": "core/LightTable.html", + "main": "core/LightTable.html", "js-flags": "--harmony", "single-instance": true, + "no-edit-menu": true, "webkit": { "plugin": true - }, - "chromium-args" : "--disable-threaded-compositing --enable-smooth-scrolling --disable-accelerated-video --enable-webgl --enable-webaudio --ignore-gpu-blacklist --force-compositing-mode --remote-debugging-port=10138 --harmony --enable-devtools-experiments --enable-experimental-web-platform-features --enable-experimental-webkit-features", - "window": { - "icon": "core/img/lticon.png", - "width": 1024, - "height": 700, - "min_height": 400, - "min_width": 400, - "position": "center", - "show":false, - "toolbar": false, - "frame": true + }, + "chromium-args" : "--disable-threaded-compositing --enable-smooth-scrolling --disable-accelerated-video --enable-webgl --enable-webaudio --ignore-gpu-blacklist --force-compositing-mode --remote-debugging-port=10138 --harmony --enable-devtools-experiments --enable-experimental-web-platform-features --enable-experimental-webkit-features", + "window": { + "icon": "core/img/lticon.png", + "width": 1024, + "height": 700, + "min_height": 400, + "min_width": 400, + "position": "center", + "show":false, + "toolbar": false, + "frame": true + } } -} diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index ddbc0e065..1d2fa26ff 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -170,6 +170,8 @@ (behavior ::create-menu :triggers #{:init} :reaction (fn [this] + (when (platform/mac?) + (set! (.-menu app/win) nil)) (main-menu))) (behavior ::recreate-menu @@ -189,8 +191,9 @@ (behavior ::remove-menu-close :triggers #{:closed :blur} :reaction (fn [this] - (when (platform/mac?) - (set! (.-menu app/win) nil)))) + (when (platform/mac?) + (set! (.-menu app/win) nil)) + )) (behavior ::menu! :triggers #{:menu!} From 4e6eeff64758eef363da37dc3197e693b7577046 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 27 Oct 2014 10:38:46 -0700 Subject: [PATCH 270/656] fix the skins and themes to no longer use css variables as they've been removed in the latest versions of chromium. You can now use node-webkit 10+ Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 1247 ++++++++++++++++++------- deploy/core/css/skins/new-dark.stylus | 338 +++++++ deploy/core/css/structure.css | 16 +- deploy/core/css/themes/ambiance.css | 9 +- deploy/core/css/themes/default.css | 18 +- deploy/core/css/themes/ibdknox.css | 21 +- 6 files changed, 1291 insertions(+), 358 deletions(-) create mode 100644 deploy/core/css/skins/new-dark.stylus diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 031c0c6ad..d75e86bbd 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -1,338 +1,929 @@ /********************************************************** * Vars ***********************************************************/ - -:root .skin-dark, :root .skin-light { - var-bg: #3b3f41; - var-fg: #ccc; - var-multi: #202020; - var-border: #444; - var-shadow: black; - - var-scrollbar: #606970; - var-placeholder-fg: #aaa; - var-dim-fg: #bbb; - var-bright-fg: #aaa; - var-blinding-fg: #fff; - var-hidden-fg: #bbb; - - var-hidden-bg: #404040; - var-inactive-bg: #2C2F30; - - var-highlight-bg: #616161; - var-highlight-fg: #f4f4f4; - - var-dark-highlight-bg: #666; - var-medium-highlight-bg: #999; - - var-button-bg: #616161; - var-button-fg: #f4f4f4; - var-button-active-bg: #ccc; - var-button-active-fg: #555; - - var-pane-bg: #3b3f41; - var-pane-scrollbar: #7c7c7c; - var-dark-pane-bg: #1c1f26; - var-dark-pane-border: #606060; - var-pane-border: #888; - - var-error-bg: #73404C; - var-error-fg: #FFA6A6; - var-error-highlight-fg: #FFCDCD; - var-error-border: #aF5D5D; - - var-usage-bg: #3E6B6B; - var-usage-fg: #7FFFFD; - - var-result-bg: #505D6B; - var-result-fg: #C7E6FF; - - var-overlay-dimmer: rgba(0,0,0,0.5); - - var-accent-foreground: #C7E6FF; - var-accent-background: #505D6B; - var-light-accent-background: #18B1CC; - var-light-accent-foreground: #CCFCFF; - var-dark-accent-background: #505D6B; - - var-secondary-accent-fg: #7FFFFD; - var-secondary-accent-bg: #3E6B6B; - var-secondary-accent-dim-fg: #C7E6FF; - var-secondary-accent-desat-fg: var(fg); - - var-tertiary-accent-fg: #DFC7FF; - var-tertiary-accent-bg: #5E3870; -} - /********************************************************** * Shared ***********************************************************/ - -html { background: var(bg); } -body { background: var(bg); color: var(fg); } -a {text-decoration:none; color: var(fg); } -.button, button { background:var(button-bg); color:var(button-fg); } -.button:hover, .button:focus, button:hover, button:focus, button.active { background:var(button-active-bg) !important; color: var(button-active-fg); } -input { color: var(highlight-fg); background:var(highlight-bg); } - -::-webkit-scrollbar { width: 7px; height: 7px; } -::-webkit-scrollbar-track { border-radius: 2px; } -::-webkit-scrollbar-thumb { border-radius: 2px; } -::-webkit-scrollbar-corner { background:transparent; } - -::-webkit-input-placeholder { color: var(placeholder-fg); } -::-webkit-scrollbar {background: transparent;} -::-webkit-scrollbar-track { background: transparent; } -::-webkit-scrollbar-thumb { background: var(scrollbar); border:1px solid var(scrollbar); } -::-webkit-scrollbar-thumb:hover { background: var(medium-highlight-bg); border:1px solid var(medium-highlight-bg); } -::-webkit-scrollbar-corner { background:transparent; } -::selection { background: var(placeholder-fg); } - -.inline-result { background: var(dark-accent-background); color:var(accent-foreground); } - -.inline-exception pre { background: var(error-bg); color: var(error-fg); } - -.underline-result pre { background: transparent; color: var(accent-foreground)} - -.inline-doc { background:var(dark-accent-background); } -.inline-doc h1 {color:var(light-accent-foreground);} -.inline-doc h3, .inline-doc h2 { color:var(accent-foreground); } -.underline-result .inline-doc pre { color:var(accent-foreground); } - -.inspector-object h2:before { color:var(hidden-fg); } -.inspector-object em { color:var(accent-foreground); } -.inspector-object { color: var(fg); } - -.inline-result .inspector-object { color: var(light-accent-foreground); } -.inline-result .inspector-object h2:before { color: var(light-accent-foreground); } - -#multi-container { background: var(bg); } -#multi .list { background:transparent; } -#multi .list li { box-sizing:border-box; height:29px; } -#multi .list .active, #multi .list li:hover { background:var(multi); color:var(highlight-fg); border-radius:5px 5px 0px 0px; } -#multi .list .dirty { color:var(accent-foreground); } -#multi .list .dirty .file-name:after { content: "*"; } -#multi .list.dragging li { background:transparent !important; } -#multi .dirty.ui-sortable-placeholder:after { content:"" !important; } -#multi .list .tab-close { background:rgba(125,125,125, 0.7); color:var(fg); } -#multi .tab-close:hover { background:var(error-bg); color:var(error-fg); } -#multi .tabset + .tabset { border-left:2px solid var(bg); } - -#bottom-bar .content { background:var(bg); border-top:0px solid var(border); } -.console > li, .console td { color:var(accent-foreground); } -.console > li + li { border-top:2px solid var(bg); } -.console > li.error + li { border-color:var(bg);} -.console li.error { color:var(error-fg); background:var(error-bg); border-color:var(bg);} -.console li.error table td { color:var(error-fg); } -.console li.error tr:hover td { color:var(error-highlight-fg); } -.console li .file { color: var(dim-fg); } -.console li .line { color: var(hidden-fg); padding-left:5px; } - -#instarepl .error { color:var(error-fg); background:var(error-bg); } -#instarepl .livetoggler { background:var(accent-background); color:var(accent-foreground); } -#instarepl .livetoggler.off {color:var(bright-fg); background:var(bg);} -#instarepl .livetoggler.off:hover {color:var(button-active-fg); background:var(button-active-bg);} -#instarepl .use-result { background:var(usage-bg); color:var(usage-fg); } -#instarepl .result-result { background:var(result-bg); color:var(result-fg); } -#instarepl .exception-result { background:var(error-bg); color:var(error-fg); } - -.popup { background:var(overlay-dimmer); } -.popup > div > div { background:var(accent-background); color:var(accent-foreground); } -.popup .button { background: transparent; border:2px solid var(accent-foreground); color:var(accent-foreground); } -.popup label { margin-right:10px; display:block; } -.popup input { background: transparent; padding:8px 10px; border:2px solid var(accent-foreground); color:var(accent-foreground); width:60%; } -.popup input::-webkit-input-placeholder { color:var(accent-foreground); } -.popup .button:hover, .popup .button.active { background:var(accent-foreground) !important; color:var(accent-background); } -.popup ::-webkit-scrollbar-thumb { background: var(accent-foreground); border:1px solid var(accent-foreground); } - -#version-info {background:var(multi);} -#version-info .info { border-right:1px solid var(bg); } -#version-info .info dt { color:var(hidden-fg); } -#version-info .button { background:var(button-bg); color:var(button-fg); border:none; } -#version-info .button:hover { background: var(button-active-bg); color:var(button-active-fg); } - -.filter-list { color: var(fg); } -.filter-list em { color:#C7E6FF; } -.filter-list .selected, .filter-list li:hover { color:var(highlight-fg); background: var(highlight-bg);} -.filter-list .selected em, .filter-list li:hover em { color:var(accent-foreground); } - -#left-bar .content { background:var(bg); box-shadow: 0 0 10px var(shadow); } -#left-bar ::-webkit-scrollbar-thumb { background: var(scrollbar); border:1px solid var(scrollbar); } - -#left-bar .workspace ul.buttons li:hover:not(.sep) { color:var(highlight-fg); background:var(highlight-bg); } -#left-bar .workspace li:hover > div > p { color: var(highlight-fg); } -#left-bar .workspace li p:hover { background: var(highlight-bg); color:var(highlight-fg); } -#left-bar .workspace .recent > div > ul > li + li { border-top:0px solid var(pane-border); } -#left-bar .workspace .recent > div > ul > li:hover { border-color: var(pane-border); background:var(highlight-bg); color: var(highlight-fg); } -#left-bar .workspace .recent > div > ul > li:hover + li { border-top-color: var(pane-border); } -#left-bar .workspace .recent h2:hover { background: var(highlight-bg); color:var(highlight-fg); } - -#right-bar .content { background:var(bg); } -#right-bar .command h2:hover { background:var(highlight-bg); color:var(highlight-fg); } -#right-bar .command input { background:var(highlight-bg); color:var(highlight-fg); } -#right-bar .command li + li { border-top:1px solid var(dark-pane-border); } - -#right-bar .command .filter-list p { color:var(bright-fg); } -#right-bar .command .filter-list .selected p { color:var(highlight-fg); } -#right-bar .command .filter-list p.binding { color:var(fg); } -#right-bar .command .filter-list .selected p.binding { color: var(fg); } - -#right-bar .filter-list h2 { color:var(bright-fg); } -#right-bar .filter-list .selected, #right-bar .filter-list .selected h2, #right-bar .filter-list li:hover { color:var(highlight-fg); background: var(highlight-bg); } -#right-bar .filter-list input { border:0px solid var(pane-border); background:var(highlight-bg); } - -#right-bar .navigate .filter-list .selected p { color:var(fg); } - -#right-bar .filter-list li + li { border-top:0px solid var(dark-pane-border); } - -#right-bar .docs-search h2 { color:var(accent-foreground); } -#right-bar .docs-search h3 { color:var(placeholder-fg); } -#right-bar .docs-search .types > span { background: var(pane-border); color:var(blinding-fg); } -#right-bar .docs-search .types ul { background: var(bg); } -#right-bar .docs-search .types li { background: var(highlight-bg); color:var(highlight-fg); } -#right-bar .docs-search .types li:hover { background: var(medium-highlight-bg); color:var(blinding-fg); } - -#right-bar .clients td { color:var(dim-fg); } -#right-bar .clients .button { background:var(button-bg); color:var(button-fg); } -#right-bar .clients .button:hover { background:var(button-active-bg); color:var(button-active-fg); } -#right-bar .clients .list li h2 { color:var(accent-foreground); font-size:12pt; } -#right-bar .clients .list > ul > li:first-child { border-top:0px solid var(pane-border); } -#right-bar .clients .list > ul > li:last-child { border-bottom:0px solid var(pane-border); } -#right-bar .clients .list > ul > li + li { background:transparent; border-top:0px solid var(pane-border); } -#right-bar .clients .list .active {background:var(highlight-bg); color: inherit; border-color: var(pane-border); } -#right-bar .clients .list .active * {color: inherit; } -#right-bar .clients .list .active h2 {color: var(highlight-fg); } -#right-bar .clients .list .active .button { background:var(button-active-bg); color:var(button-active-fg); } -#right-bar .clients .list .active .button:hover { background:var(accent-foreground) !important; color:var(accent-background); } -#right-bar .clients .connector li { border-top:0px solid var(pane-border); border-bottom:1px solid var(pane-border); } -#right-bar .clients .connector li:first-child {border:none;} -#right-bar .clients .connector li:last-child {border-bottom:none;} -#right-bar .clients .connector li + li {border-bottom:none;} -#right-bar .clients .connector li h2 {color: var(highlight-fg); } -#right-bar .clients .connector li:hover h2 {color: var(highlight-fg); } -#right-bar .clients .connector li:hover {background: var(highlight-bg); color: var(fg); border-color: var(pane-border); } - -#status { color: var(hidden-fg); } -#status .console-toggle { cursor:default; background:var(hidden-bg); color:var(fg); min-width:12px; padding:0 4px; width:auto; display:none; text-align:center; margin-left:0px; border-radius:2px; } -#status .console-toggle:hover { background:var(dark-highlight-bg); color:var(highlight-fg); } -#status .console-toggle.dirty { background:var(accent-background); color:var(accent-foreground); display: inline-block; } -#status .console-toggle.error { color:var(error-fg); background:var(error-bg); } -#status .log .error { color:var(error-fg); background:var(error-bg); } -#status .log .tip { color: var(accent-foreground); } - -#find-bar input { border-top:2px solid var(bg); background:var(multi); } -#find-bar input + input { border-left:2px solid var(bg); } -#find-bar ::-webkit-input-placeholder { color:var(hidden-fg); } -#find-bar button { background:var(bg); } -#find-bar button:hover, #find-bar button:focus, #find-bar button:active, #find-bar button.active { background:var(button-active-bg); } - -#browser input { background:var(hidden-bg); color:var(fg); } -#browser button { } -#browser iframe { background:white; } -#browser ::-webkit-scrollbar { background: var(bg) !important; } -#browser ::-webkit-scrollbar-track { background: var(bg) !important; } -#browser ::-webkit-scrollbar-corner { background: var(bg) !important; } -#browser ::-webkit-scrollbar-thumb { background: var(scrollbar); border:1px solid var(scrollbar); } - -.docs ::-webkit-scrollbar { background: var(bg) !important; } -.docs ::-webkit-scrollbar-track { background: var(bg) !important; } -.docs ::-webkit-scrollbar-corner { background: var(bg) !important; } -.docs ::-webkit-scrollbar-thumb { background: var(scrollbar); border:1px solid var(scrollbar); } - -.search-results .path, .search-results .line { color:var(hidden-fg); } -.search-results .line { color:var(secondary-accent-desat-fg); } -.search-results .entry { color: var(placeholder-fg); } -.search-results .entry em { color:var(blinding-fg); } -.search-results .entry:hover { background:var(hidden-bg); } -.search-results .entry:hover .line { background:var(medium-highlight-bg); color:var(bg); } -.search-results .path { color:var(secondary-accent-dim-fg); } -.search-results .file { color:var(secondary-accent-fg); } -.search-results input { background:var(highlight-bg); } -.search-results button { background:var(bg); } - -.watch-result { display:inline-block; padding-left:2px; vertical-align:top; background:var(usage-bg); color:var(usage-fg); border-radius:0px; } -.CodeMirror .watched { border-bottom:1px solid var(usage-fg); } - -.hintwrapper { padding:2px 0; padding-bottom:5px; padding-left:12px; box-sizing:border-box; } -.jshinterrors { display:inline-block; box-sizing:border-box; padding:2px 10px; border-radius:0px; background:var(error-bg); color:var(error-fg); } -.hintwrapper .spacer { display:inline-block; white-space:pre; } - -.behavior-helper-result {white-space:nowrap; display:inline-block; padding-top:0px; padding-bottom:0px; overflow:hidden; margin-left:0px; padding-left:20px; box-sizing:border-box; background:none; color:var(usage-fg); } -.behavior-helper-result div { white-space:nowrap; width:-webkit-fit-content; background:var(usage-bg); padding:0px 5px; border-radius:0px; margin-top:0px; } -.behavior-helper-result div > * { border-radius:0px; padding:0px !important; } -.behavior-helper-result h2 { display:block; width:-webkit-fit-content; white-space:nowrap; } -.behavior-helper-result div > span.param { display:inline-block; margin-right:8px; margin-bottom:3px; padding:2px 5px !important; margin-top:5px; border:1px solid var(usage-fg); } -.behavior-helper-result div > span.spacer { display:inline-block; margin:0 5px; } -.behavior-helper-result .active { background: var(usage-fg); color:var(usage-bg); border-radius:0px; display:inline-block; } -.behavior-helper-result .example { display:inline-block; width:auto; vertical-align:top; padding:0; margin:0; margin-left:5px; border:none; } - -.plugin-manager .version { margin-left:10px; color:var(hidden-fg); } -.plugin-manager h3 { color: var(hidden-fg); } -.plugin-manager h3:before { content:"by "; } -.plugin-manager li { border:none; position:relative; } -.plugin-manager li h1 { color:var(accent-foreground); } -.plugin-manager li.has-update .version { color:var(error-fg); } -.plugin-manager li.has-update .version { color:var(error-fg); } -.plugin-manager li.has-update h1 { color:var(error-fg); } -.plugin-manager li + li { border-top:1px solid var(border); } -.plugin-manager > ul > li:hover { background:var(hidden-bg); } -.plugin-manager .tabs { margin-bottom:15px; display:flex; -webkit-flex-direction:row; -webkit-align-items:stretch; height:30px; width:100%; } -.plugin-manager input {background: var(highlight-bg); -webkit-flex:1; } -.plugin-manager button {background: var(highlight-bg); } -.plugin-manager .install { box-sizing:border-box; color:var(secondary-accent-bg); background:var(secondary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} -.plugin-manager .uninstall { box-sizing:border-box; color:var(tertiary-accent-bg); background:var(tertiary-accent-fg); display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} -.plugin-manager .update { box-sizing:border-box; background:var(error-fg); display:inline-block; height:25px; position:absolute; right:0; top:50px; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} -.plugin-manager li:hover .update { width:70px; overflow:hidden; } -.plugin-manager li:hover .update:before { color:var(error-bg); padding:4px 8px; display:inline-block; content: "update"; } -.plugin-manager li:hover .uninstall { width:70px; overflow:hidden; } -.plugin-manager li:hover .uninstall:before { padding:4px 8px; display:inline-block; content: "uninstall"; } -.plugin-manager li:hover .install { width:70px; overflow:hidden; } -.plugin-manager li:hover .install:before { padding:4px 8px; display:inline-block; content: "install"; } -.plugin-manager .source { color:transparent; position:absolute; height:25px; width:5px; top:25px; right:0; background:var(accent-foreground); overflow:hidden; -webkit-transition:width 0.1s ease-in-out, right 0.1s ease-in-out; } -.plugin-manager .source a { color:transparent; padding:4px 8px; display:inline-block; width:100%;} -.plugin-manager li:hover .source { width:70px; } -.plugin-manager li:hover .source a { color:var(accent-background); } - +html { + background: #3b3f41; +} +body { + background: #3b3f41; + color: #ccc; +} +a { + text-decoration: none; + color: #ccc; +} +.button, +button { + background: #616161; + color: #f4f4f4; +} +.button:hover, +.button:focus, +button:hover, +button:focus, +button.active { + background: #ccc !important; + color: #555; +} +input { + color: #f4f4f4; + background: #616161; +} +::-webkit-scrollbar { + width: 7px; + height: 7px; +} +::-webkit-scrollbar-track { + border-radius: 2px; +} +::-webkit-scrollbar-thumb { + border-radius: 2px; +} +::-webkit-scrollbar-corner { + background: transparent; +} +::-webkit-input-placeholder { + color: #aaa; +} +::-webkit-scrollbar { + background: transparent; +} +::-webkit-scrollbar-track { + background: transparent; +} +::-webkit-scrollbar-thumb { + background: #606970; + border: 1px solid #606970; +} +::-webkit-scrollbar-thumb:hover { + background: #999; + border: 1px solid #999; +} +::-webkit-scrollbar-corner { + background: transparent; +} +::selection { + background: #aaa; +} +.inline-result { + background: #505d6b; + color: #c7e6ff; +} +.inline-exception pre { + background: #73404c; + color: #ffa6a6; +} +.underline-result pre { + background: transparent; + color: #c7e6ff; +} +.inline-doc { + background: #505d6b; +} +.inline-doc h1 { + color: #ccfcff; +} +.inline-doc h3, +.inline-doc h2 { + color: #c7e6ff; +} +.underline-result .inline-doc pre { + color: #c7e6ff; +} +.inspector-object h2:before { + color: #bbb; +} +.inspector-object em { + color: #c7e6ff; +} +.inspector-object { + color: #ccc; +} +.inline-result .inspector-object { + color: #ccfcff; +} +.inline-result .inspector-object h2:before { + color: #ccfcff; +} +#multi-container { + background: #3b3f41; +} +#multi .list { + background: transparent; +} +#multi .list li { + box-sizing: border-box; + height: 29px; +} +#multi .list .active, +#multi .list li:hover { + background: #202020; + color: #f4f4f4; + border-radius: 5px 5px 0px 0px; +} +#multi .list .dirty { + color: #c7e6ff; +} +#multi .list .dirty .file-name:after { + content: "*"; +} +#multi .list.dragging li { + background: transparent !important; +} +#multi .dirty.ui-sortable-placeholder:after { + content: "" !important; +} +#multi .list .tab-close { + background: rgba(125,125,125,0.7); + color: #ccc; +} +#multi .tab-close:hover { + background: #73404c; + color: #ffa6a6; +} +#multi .tabset + .tabset { + border-left: 2px solid #3b3f41; +} +.sortable-placeholder { + background: #202020; + border: 2px solid #3b3f41; +} +#bottom-bar .content { + background: #3b3f41; + border-top: 0px solid #444; +} +.console > li, +.console td { + color: #c7e6ff; +} +.console > li + li { + border-top: 2px solid #3b3f41; +} +.console > li.error + li { + border-color: #3b3f41; +} +.console li.error { + color: #ffa6a6; + background: #73404c; + border-color: #3b3f41; +} +.console li.error table td { + color: #ffa6a6; +} +.console li.error tr:hover td { + color: #ffcdcd; +} +.console li .file { + color: #bbb; +} +.console li .line { + color: #bbb; + padding-left: 5px; +} +#instarepl .error { + color: #ffa6a6; + background: #73404c; +} +#instarepl .livetoggler { + background: #505d6b; + color: #c7e6ff; +} +#instarepl .livetoggler.off { + color: #aaa; + background: #3b3f41; +} +#instarepl .livetoggler.off:hover { + color: #555; + background: #ccc; +} +#instarepl .use-result { + background: #3e6b6b; + color: #7ffffd; +} +#instarepl .result-result { + background: #505d6b; + color: #c7e6ff; +} +#instarepl .exception-result { + background: #73404c; + color: #ffa6a6; +} +.popup { + background: rgba(0,0,0,0.5); +} +.popup > div > div { + background: #505d6b; + color: #c7e6ff; +} +.popup .button { + background: transparent; + border: 2px solid #c7e6ff; + color: #c7e6ff; +} +.popup label { + margin-right: 10px; + display: block; +} +.popup input { + background: transparent; + padding: 8px 10px; + border: 2px solid #c7e6ff; + color: #c7e6ff; + width: 60%; +} +.popup input::-webkit-input-placeholder { + color: #c7e6ff; +} +.popup .button:hover, +.popup .button.active { + background: #c7e6ff !important; + color: #505d6b; +} +.popup ::-webkit-scrollbar-thumb { + background: #c7e6ff; + border: 1px solid #c7e6ff; +} +#version-info { + background: #202020; +} +#version-info .info { + border-right: 1px solid #3b3f41; +} +#version-info .info dt { + color: #bbb; +} +#version-info .button { + background: #616161; + color: #f4f4f4; + border: none; +} +#version-info .button:hover { + background: #ccc; + color: #555; +} +.filter-list { + color: #ccc; +} +.filter-list em { + color: #c7e6ff; +} +.filter-list .selected, +.filter-list li:hover { + color: #f4f4f4; + background: #616161; +} +.filter-list .selected em, +.filter-list li:hover em { + color: #c7e6ff; +} +#left-bar .content { + background: #3b3f41; + box-shadow: 0 0 10px #000; +} +#left-bar ::-webkit-scrollbar-thumb { + background: #606970; + border: 1px solid #606970; +} +#left-bar .workspace ul.buttons li:hover:not(.sep) { + color: #f4f4f4; + background: #616161; +} +#left-bar .workspace li:hover > div > p { + color: #f4f4f4; +} +#left-bar .workspace li p:hover { + background: #616161; + color: #f4f4f4; +} +#left-bar .workspace .recent > div > ul > li + li { + border-top: 0px solid #888; +} +#left-bar .workspace .recent > div > ul > li:hover { + border-color: #888; + background: #616161; + color: #f4f4f4; +} +#left-bar .workspace .recent > div > ul > li:hover + li { + border-top-color: #888; +} +#left-bar .workspace .recent h2:hover { + background: #616161; + color: #f4f4f4; +} +#right-bar .content { + background: #3b3f41; +} +#right-bar .command h2:hover { + background: #616161; + color: #f4f4f4; +} +#right-bar .command input { + background: #616161; + color: #f4f4f4; +} +#right-bar .command li + li { + border-top: 1px solid #606060; +} +#right-bar .command .filter-list p { + color: #aaa; +} +#right-bar .command .filter-list .selected p { + color: #f4f4f4; +} +#right-bar .command .filter-list p.binding { + color: #ccc; +} +#right-bar .command .filter-list .selected p.binding { + color: #ccc; +} +#right-bar .filter-list h2 { + color: #aaa; +} +#right-bar .filter-list .selected, +#right-bar .filter-list .selected h2, +#right-bar .filter-list li:hover { + color: #f4f4f4; + background: #616161; +} +#right-bar .filter-list input { + border: 0px solid #888; + background: #616161; +} +#right-bar .navigate .filter-list .selected p { + color: #ccc; +} +#right-bar .filter-list li + li { + border-top: 0px solid #606060; +} +#right-bar .docs-search h2 { + color: #c7e6ff; +} +#right-bar .docs-search h3 { + color: #aaa; +} +#right-bar .docs-search .types > span { + background: #888; + color: #fff; +} +#right-bar .docs-search .types ul { + background: #3b3f41; +} +#right-bar .docs-search .types li { + background: #616161; + color: #f4f4f4; +} +#right-bar .docs-search .types li:hover { + background: #999; + color: #fff; +} +#right-bar .clients td { + color: #bbb; +} +#right-bar .clients .button { + background: #616161; + color: #f4f4f4; +} +#right-bar .clients .button:hover { + background: #ccc; + color: #555; +} +#right-bar .clients .list li h2 { + color: #c7e6ff; + font-size: 12pt; +} +#right-bar .clients .list > ul > li:first-child { + border-top: 0px solid #888; +} +#right-bar .clients .list > ul > li:last-child { + border-bottom: 0px solid #888; +} +#right-bar .clients .list > ul > li + li { + background: transparent; + border-top: 0px solid #888; +} +#right-bar .clients .list .active { + background: #616161; + color: inherit; + border-color: #888; +} +#right-bar .clients .list .active * { + color: inherit; +} +#right-bar .clients .list .active h2 { + color: #f4f4f4; +} +#right-bar .clients .list .active .button { + background: #ccc; + color: #555; +} +#right-bar .clients .list .active .button:hover { + background: #c7e6ff !important; + color: #505d6b; +} +#right-bar .clients .connector li { + border-top: 0px solid #888; + border-bottom: 1px solid #888; +} +#right-bar .clients .connector li:first-child { + border: none; +} +#right-bar .clients .connector li:last-child { + border-bottom: none; +} +#right-bar .clients .connector li + li { + border-bottom: none; +} +#right-bar .clients .connector li h2 { + color: #f4f4f4; +} +#right-bar .clients .connector li:hover h2 { + color: #f4f4f4; +} +#right-bar .clients .connector li:hover { + background: #616161; + color: #ccc; + border-color: #888; +} +#status { + color: #bbb; +} +#status .console-toggle { + cursor: default; + background: #404040; + color: #ccc; + min-width: 12px; + padding: 0 4px; + width: auto; + display: none; + text-align: center; + margin-left: 0px; + border-radius: 2px; +} +#status .console-toggle:hover { + background: #666; + color: #f4f4f4; +} +#status .console-toggle.dirty { + background: #505d6b; + color: #c7e6ff; + display: inline-block; +} +#status .console-toggle.error { + color: #ffa6a6; + background: #73404c; +} +#status .log .error { + color: #ffa6a6; + background: #73404c; +} +#status .log .tip { + color: #c7e6ff; +} +#find-bar input { + border-top: 2px solid #3b3f41; + background: #202020; +} +#find-bar input + input { + border-left: 2px solid #3b3f41; +} +#find-bar ::-webkit-input-placeholder { + color: #bbb; +} +#find-bar button { + background: #3b3f41; +} +#find-bar button:hover, +#find-bar button:focus, +#find-bar button:active, +#find-bar button.active { + background: #ccc; +} +#browser input { + background: #404040; + color: #ccc; +} +#browser iframe { + background: #fff; +} +#browser ::-webkit-scrollbar { + background: #3b3f41 !important; +} +#browser ::-webkit-scrollbar-track { + background: #3b3f41 !important; +} +#browser ::-webkit-scrollbar-corner { + background: #3b3f41 !important; +} +#browser ::-webkit-scrollbar-thumb { + background: #606970; + border: 1px solid #606970; +} +.docs ::-webkit-scrollbar { + background: #3b3f41 !important; +} +.docs ::-webkit-scrollbar-track { + background: #3b3f41 !important; +} +.docs ::-webkit-scrollbar-corner { + background: #3b3f41 !important; +} +.docs ::-webkit-scrollbar-thumb { + background: #606970; + border: 1px solid #606970; +} +.search-results .path, +.search-results .line { + color: #bbb; +} +.search-results .line { + color: #ccc; +} +.search-results .entry { + color: #aaa; +} +.search-results .entry em { + color: #fff; +} +.search-results .entry:hover { + background: #404040; +} +.search-results .entry:hover .line { + background: #999; + color: #3b3f41; +} +.search-results .path { + color: #c7e6ff; +} +.search-results .file { + color: #7ffffd; +} +.search-results input { + background: #616161; +} +.search-results button { + background: #3b3f41; +} +.watch-result { + display: inline-block; + padding-left: 2px; + vertical-align: top; + background: #3e6b6b; + color: #7ffffd; + border-radius: 0px; +} +.CodeMirror .watched { + border-bottom: 1px solid #7ffffd; +} +.hintwrapper { + padding: 2px 0; + padding-bottom: 5px; + padding-left: 12px; + box-sizing: border-box; +} +.jshinterrors { + display: inline-block; + box-sizing: border-box; + padding: 2px 10px; + border-radius: 0px; + background: #73404c; + color: #ffa6a6; +} +.hintwrapper .spacer { + display: inline-block; + white-space: pre; +} +.behavior-helper-result { + white-space: nowrap; + display: inline-block; + padding-top: 0px; + padding-bottom: 0px; + overflow: hidden; + margin-left: 0px; + padding-left: 20px; + box-sizing: border-box; + background: none; + color: #7ffffd; +} +.behavior-helper-result div { + white-space: nowrap; + width: -webkit-fit-content; + background: #3e6b6b; + padding: 0px 5px; + border-radius: 0px; + margin-top: 0px; +} +.behavior-helper-result div > * { + border-radius: 0px; + padding: 0px !important; +} +.behavior-helper-result h2 { + display: block; + width: -webkit-fit-content; + white-space: nowrap; +} +.behavior-helper-result div > span.param { + display: inline-block; + margin-right: 8px; + margin-bottom: 3px; + padding: 2px 5px !important; + margin-top: 5px; + border: 1px solid #7ffffd; +} +.behavior-helper-result div > span.spacer { + display: inline-block; + margin: 0 5px; +} +.behavior-helper-result .active { + background: #7ffffd; + color: #3e6b6b; + border-radius: 0px; + display: inline-block; +} +.behavior-helper-result .example { + display: inline-block; + width: auto; + vertical-align: top; + padding: 0; + margin: 0; + margin-left: 5px; + border: none; +} +.plugin-manager .version { + margin-left: 10px; + color: #bbb; +} +.plugin-manager h3 { + color: #bbb; +} +.plugin-manager h3:before { + content: "by "; +} +.plugin-manager li { + border: none; + position: relative; +} +.plugin-manager li h1 { + color: #c7e6ff; +} +.plugin-manager li.has-update .version { + color: #ffa6a6; +} +.plugin-manager li.has-update .version { + color: #ffa6a6; +} +.plugin-manager li.has-update h1 { + color: #ffa6a6; +} +.plugin-manager li + li { + border-top: 1px solid #444; +} +.plugin-manager > ul > li:hover { + background: #404040; +} +.plugin-manager .tabs { + margin-bottom: 15px; + display: flex; + -webkit-flex-direction: row; + -webkit-align-items: stretch; + height: 30px; + width: 100%; +} +.plugin-manager input { + background: #616161; + -webkit-flex: 1; +} +.plugin-manager button { + background: #616161; +} +.plugin-manager .install { + box-sizing: border-box; + color: #3e6b6b; + background: #7ffffd; + display: inline-block; + height: 25px; + position: absolute; + right: 0; + top: 0; + width: 5px; + -webkit-transition: width 0.1s ease-in-out; + cursor: pointer; +} +.plugin-manager .uninstall { + box-sizing: border-box; + color: #5e3870; + background: #dfc7ff; + display: inline-block; + height: 25px; + position: absolute; + right: 0; + top: 0; + width: 5px; + -webkit-transition: width 0.1s ease-in-out; + cursor: pointer; +} +.plugin-manager .update { + box-sizing: border-box; + background: #ffa6a6; + display: inline-block; + height: 25px; + position: absolute; + right: 0; + top: 50px; + width: 5px; + -webkit-transition: width 0.1s ease-in-out; + cursor: pointer; +} +.plugin-manager li:hover .update { + width: 70px; + overflow: hidden; +} +.plugin-manager li:hover .update:before { + color: #73404c; + padding: 4px 8px; + display: inline-block; + content: "update"; +} +.plugin-manager li:hover .uninstall { + width: 70px; + overflow: hidden; +} +.plugin-manager li:hover .uninstall:before { + padding: 4px 8px; + display: inline-block; + content: "uninstall"; +} +.plugin-manager li:hover .install { + width: 70px; + overflow: hidden; +} +.plugin-manager li:hover .install:before { + padding: 4px 8px; + display: inline-block; + content: "install"; +} +.plugin-manager .source { + color: transparent; + position: absolute; + height: 25px; + width: 5px; + top: 25px; + right: 0; + background: #c7e6ff; + overflow: hidden; + -webkit-transition: width 0.1s ease-in-out, right 0.1s ease-in-out; +} +.plugin-manager .source a { + color: transparent; + padding: 4px 8px; + display: inline-block; + width: 100%; +} +.plugin-manager li:hover .source { + width: 70px; +} +.plugin-manager li:hover .source a { + color: #505d6b; +} /********************************************************** * Theme specific ***********************************************************/ - -.cm-visible-space { background:url("../../img/visible-space11.png"); background-size:100%; background-position:center; background-repeat: no-repeat;} -.cm-visible-tab { background:url("../../img/visible-tab7.png"); background-size:100% 1em; background-position:center; background-repeat: no-repeat;} - -#right-bar .clients .load-wrapper .img { width:20px; height:20px; background:url("../../img/connectingloader.gif") } - -#titlebar .button { color:var(fg); } - -.load-wrapper .img { background:url("../../img/loaderdark.gif"); } - -.timed { border-bottom:1px solid #fa5; } -.timed-result { background: #741; color:#fb0; } -.workspace .buttons { display:none; } -#multi .list { margin:0; } -#multi .list li { height:29px; padding:6px 10px; font-size: 9pt; text-align:left; } -#multi .content { background:var(multi); margin:0; top:29px; left:0; right:0; padding:5px; padding-bottom:5px; } - -#left-bar .workspace ul.root { top:0px; } -#right-bar .filter-list input { padding:6px 10px; font-size:10pt; margin-top:0; border-radius:0px; } -#right-bar .filter-list ul { top:35px; bottom:10px; } -#right-bar .content { padding:0 15px; padding-bottom:10px; } - -button { border-radius:0; } -* { border-radius:0; } - -.CodeMirror pre { padding: 0 0 0 5px; /* Horizontal padding of content */ } - -.CodeMirror div.CodeMirror-cursor { border-left: 1px solid white; } +.cm-visible-space { + background: url("../../img/visible-space11.png"); + background-size: 100%; + background-position: center; + background-repeat: no-repeat; +} +.cm-visible-tab { + background: url("../../img/visible-tab7.png"); + background-size: 100% 1em; + background-position: center; + background-repeat: no-repeat; +} +#right-bar .clients .load-wrapper .img { + width: 20px; + height: 20px; + background: url("../../img/connectingloader.gif"); +} +#titlebar .button { + color: #ccc; +} +.load-wrapper .img { + background: url("../../img/loaderdark.gif"); +} +.timed { + border-bottom: 1px solid #fa5; +} +.timed-result { + background: #741; + color: #fb0; +} +.workspace .buttons { + display: none; +} +#multi .list { + margin: 0; +} +#multi .list li { + height: 29px; + padding: 6px 10px; + font-size: 9pt; + text-align: left; +} +#multi .content { + background: #202020; + margin: 0; + top: 29px; + left: 0; + right: 0; + padding: 5px; + padding-bottom: 5px; +} +#left-bar .workspace ul.root { + top: 0px; +} +#right-bar .filter-list input { + padding: 6px 10px; + font-size: 10pt; + margin-top: 0; + border-radius: 0px; +} +#right-bar .filter-list ul { + top: 35px; + bottom: 10px; +} +#right-bar .content { + padding: 0 15px; + padding-bottom: 10px; +} +button { + border-radius: 0; +} +* { + border-radius: 0; +} +.CodeMirror pre { + padding: 0 0 0 5px; +/* Horizontal padding of content */ +} +.CodeMirror div.CodeMirror-cursor { + border-left: 1px solid #fff; +} /* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { border-left: 1px solid silver; } -.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { width: auto; border: none !important; background: rgba(0, 200, 200, .4); } - -.CodeMirror-gutters { background: var(multi); border-color:var(dark-highlight-bg); border:none; } -.CodeMirror-hints.empty { display:none; } -.CodeMirror-hints { position: absolute; z-index: 1000000000000000; overflow: hidden; list-style: none; margin: 0; padding: 2px; border-radius: 2px; border: 1px solid var(pane-bg); background: var(pane-bg); font-size: 90%; font-family: inherit; max-height: 20em; } -.CodeMirror-hints ul { overflow-y:auto; max-height:20em; } -.CodeMirror-hints ul li { margin: 0; padding: 0 4px; border-radius: 2px; max-width: 60em; overflow: hidden; white-space: pre; color: #ccc; cursor: pointer; } -.CodeMirror-hints input { display:none; } -.CodeMirror-hints .selected { background: var(highlight-bg); color: var(highlight-fg); } -.CodeMirror-hints ul::-webkit-scrollbar-thumb { background: var(scrollbar); border-color: var(scrollbar); } +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid #c0c0c0; +} +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { + width: auto; + border: none !important; + background: rgba(0,200,200,0.4); +} +.CodeMirror-gutters { + background: #202020; + border-color: #666; + border: none; +} +.CodeMirror-hints.empty { + display: none; +} +.CodeMirror-hints { + position: absolute; + z-index: 1000000000000000; + overflow: hidden; + list-style: none; + margin: 0; + padding: 2px; + border-radius: 2px; + border: 1px solid #3b3f41; + background: #3b3f41; + font-size: 90%; + font-family: inherit; + max-height: 20em; +} +.CodeMirror-hints ul { + overflow-y: auto; + max-height: 20em; +} +.CodeMirror-hints ul li { + margin: 0; + padding: 0 4px; + border-radius: 2px; + max-width: 60em; + overflow: hidden; + white-space: pre; + color: #ccc; + cursor: pointer; +} +.CodeMirror-hints input { + display: none; +} +.CodeMirror-hints .selected { + background: #616161; + color: #f4f4f4; +} +.CodeMirror-hints ul::-webkit-scrollbar-thumb { + background: #606970; + border-color: #606970; +} diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus new file mode 100644 index 000000000..b0c6deea3 --- /dev/null +++ b/deploy/core/css/skins/new-dark.stylus @@ -0,0 +1,338 @@ +/********************************************************** +* Vars +***********************************************************/ + + $bg = #3b3f41; + $fg = #ccc; + $multi = #202020; + $border = #444; + $shadow = black; + + $scrollbar = #606970; + $placeholder-fg = #aaa; + $dim-fg = #bbb; + $bright-fg = #aaa; + $blinding-fg = #fff; + $hidden-fg = #bbb; + + $hidden-bg = #404040; + $inactive-bg = #2C2F30; + + $highlight-bg = #616161; + $highlight-fg = #f4f4f4; + + $dark-highlight-bg = #666; + $medium-highlight-bg = #999; + + $button-bg = #616161; + $button-fg = #f4f4f4; + $button-active-bg = #ccc; + $button-active-fg = #555; + + $pane-bg = #3b3f41; + $pane-scrollbar = #7c7c7c; + $dark-pane-bg = #1c1f26; + $dark-pane-border = #606060; + $pane-border = #888; + + $error-bg = #73404C; + $error-fg = #FFA6A6; + $error-highlight-fg = #FFCDCD; + $error-border = #aF5D5D; + + $usage-bg = #3E6B6B; + $usage-fg = #7FFFFD; + + $result-bg = #505D6B; + $result-fg = #C7E6FF; + + $overlay-dimmer = rgba(0,0,0,0.5); + + $accent-foreground = #C7E6FF; + $accent-background = #505D6B; + $light-accent-background = #18B1CC; + $light-accent-foreground = #CCFCFF; + $dark-accent-background = #505D6B; + + $secondary-accent-fg = #7FFFFD; + $secondary-accent-bg = #3E6B6B; + $secondary-accent-dim-fg = #C7E6FF; + $secondary-accent-desat-fg = $fg; + + $tertiary-accent-fg = #DFC7FF; + $tertiary-accent-bg = #5E3870; + +/********************************************************** +* Shared +***********************************************************/ + +html { background: $bg; } +body { background: $bg; color: $fg; } +a {text-decoration:none; color: $fg; } +.button, button { background:$button-bg; color:$button-fg; } +.button:hover, .button:focus, button:hover, button:focus, button.active { background:$button-active-bg !important; color: $button-active-fg; } +input { color: $highlight-fg; background:$highlight-bg; } + +::-webkit-scrollbar { width: 7px; height: 7px; } +::-webkit-scrollbar-track { border-radius: 2px; } +::-webkit-scrollbar-thumb { border-radius: 2px; } +::-webkit-scrollbar-corner { background:transparent; } + +::-webkit-input-placeholder { color: $placeholder-fg; } +::-webkit-scrollbar {background: transparent;} +::-webkit-scrollbar-track { background: transparent; } +::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } +::-webkit-scrollbar-thumb:hover { background: $medium-highlight-bg; border:1px solid $medium-highlight-bg; } +::-webkit-scrollbar-corner { background:transparent; } +::selection { background: $placeholder-fg; } + +.inline-result { background: $dark-accent-background; color:$accent-foreground; } + +.inline-exception pre { background: $error-bg; color: $error-fg; } + +.underline-result pre { background: transparent; color: $accent-foreground} + +.inline-doc { background:$dark-accent-background; } +.inline-doc h1 {color:$light-accent-foreground;} +.inline-doc h3, .inline-doc h2 { color:$accent-foreground; } +.underline-result .inline-doc pre { color:$accent-foreground; } + +.inspector-object h2:before { color:$hidden-fg; } +.inspector-object em { color:$accent-foreground; } +.inspector-object { color: $fg; } + +.inline-result .inspector-object { color: $light-accent-foreground; } +.inline-result .inspector-object h2:before { color: $light-accent-foreground; } + +#multi-container { background: $bg; } +#multi .list { background:transparent; } +#multi .list li { box-sizing:border-box; height:29px; } +#multi .list .active, #multi .list li:hover { background:$multi; color:$highlight-fg; border-radius:5px 5px 0px 0px; } +#multi .list .dirty { color:$accent-foreground; } +#multi .list .dirty .file-name:after { content: "*"; } +#multi .list.dragging li { background:transparent !important; } +#multi .dirty.ui-sortable-placeholder:after { content:"" !important; } +#multi .list .tab-close { background:rgba(125,125,125, 0.7); color:$fg; } +#multi .tab-close:hover { background:$error-bg; color:$error-fg; } +#multi .tabset + .tabset { border-left:2px solid $bg; } + +.sortable-placeholder { background:$multi; border:2px solid $bg; } + +#bottom-bar .content { background:$bg; border-top:0px solid $border; } +.console > li, .console td { color:$accent-foreground; } +.console > li + li { border-top:2px solid $bg; } +.console > li.error + li { border-color:$bg;} +.console li.error { color:$error-fg; background:$error-bg; border-color:$bg;} +.console li.error table td { color:$error-fg; } +.console li.error tr:hover td { color:$error-highlight-fg; } +.console li .file { color: $dim-fg; } +.console li .line { color: $hidden-fg; padding-left:5px; } + +#instarepl .error { color:$error-fg; background:$error-bg; } +#instarepl .livetoggler { background:$accent-background; color:$accent-foreground; } +#instarepl .livetoggler.off {color:$bright-fg; background:$bg;} +#instarepl .livetoggler.off:hover {color:$button-active-fg; background:$button-active-bg;} +#instarepl .use-result { background:$usage-bg; color:$usage-fg; } +#instarepl .result-result { background:$result-bg; color:$result-fg; } +#instarepl .exception-result { background:$error-bg; color:$error-fg; } + +.popup { background:$overlay-dimmer; } +.popup > div > div { background:$accent-background; color:$accent-foreground; } +.popup .button { background: transparent; border:2px solid $accent-foreground; color:$accent-foreground; } +.popup label { margin-right:10px; display:block; } +.popup input { background: transparent; padding:8px 10px; border:2px solid $accent-foreground; color:$accent-foreground; width:60%; } +.popup input::-webkit-input-placeholder { color:$accent-foreground; } +.popup .button:hover, .popup .button.active { background:$accent-foreground !important; color:$accent-background; } +.popup ::-webkit-scrollbar-thumb { background: $accent-foreground; border:1px solid $accent-foreground; } + +#version-info {background:$multi;} +#version-info .info { border-right:1px solid $bg; } +#version-info .info dt { color:$hidden-fg; } +#version-info .button { background:$button-bg; color:$button-fg; border:none; } +#version-info .button:hover { background: $button-active-bg; color:$button-active-fg; } + +.filter-list { color: $fg; } +.filter-list em { color:#C7E6FF; } +.filter-list .selected, .filter-list li:hover { color:$highlight-fg; background: $highlight-bg;} +.filter-list .selected em, .filter-list li:hover em { color:$accent-foreground; } + +#left-bar .content { background:$bg; box-shadow: 0 0 10px $shadow; } +#left-bar ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } + +#left-bar .workspace ul.buttons li:hover:not(.sep) { color:$highlight-fg; background:$highlight-bg; } +#left-bar .workspace li:hover > div > p { color: $highlight-fg; } +#left-bar .workspace li p:hover { background: $highlight-bg; color:$highlight-fg; } +#left-bar .workspace .recent > div > ul > li + li { border-top:0px solid $pane-border; } +#left-bar .workspace .recent > div > ul > li:hover { border-color: $pane-border; background:$highlight-bg; color: $highlight-fg; } +#left-bar .workspace .recent > div > ul > li:hover + li { border-top-color: $pane-border; } +#left-bar .workspace .recent h2:hover { background: $highlight-bg; color:$highlight-fg; } + +#right-bar .content { background:$bg; } +#right-bar .command h2:hover { background:$highlight-bg; color:$highlight-fg; } +#right-bar .command input { background:$highlight-bg; color:$highlight-fg; } +#right-bar .command li + li { border-top:1px solid $dark-pane-border; } + +#right-bar .command .filter-list p { color:$bright-fg; } +#right-bar .command .filter-list .selected p { color:$highlight-fg; } +#right-bar .command .filter-list p.binding { color:$fg; } +#right-bar .command .filter-list .selected p.binding { color: $fg; } + +#right-bar .filter-list h2 { color:$bright-fg; } +#right-bar .filter-list .selected, #right-bar .filter-list .selected h2, #right-bar .filter-list li:hover { color:$highlight-fg; background: $highlight-bg; } +#right-bar .filter-list input { border:0px solid $pane-border; background:$highlight-bg; } + +#right-bar .navigate .filter-list .selected p { color:$fg; } + +#right-bar .filter-list li + li { border-top:0px solid $dark-pane-border; } + +#right-bar .docs-search h2 { color:$accent-foreground; } +#right-bar .docs-search h3 { color:$placeholder-fg; } +#right-bar .docs-search .types > span { background: $pane-border; color:$blinding-fg; } +#right-bar .docs-search .types ul { background: $bg; } +#right-bar .docs-search .types li { background: $highlight-bg; color:$highlight-fg; } +#right-bar .docs-search .types li:hover { background: $medium-highlight-bg; color:$blinding-fg; } + +#right-bar .clients td { color:$dim-fg; } +#right-bar .clients .button { background:$button-bg; color:$button-fg; } +#right-bar .clients .button:hover { background:$button-active-bg; color:$button-active-fg; } +#right-bar .clients .list li h2 { color:$accent-foreground; font-size:12pt; } +#right-bar .clients .list > ul > li:first-child { border-top:0px solid $pane-border; } +#right-bar .clients .list > ul > li:last-child { border-bottom:0px solid $pane-border; } +#right-bar .clients .list > ul > li + li { background:transparent; border-top:0px solid $pane-border; } +#right-bar .clients .list .active {background:$highlight-bg; color: inherit; border-color: $pane-border; } +#right-bar .clients .list .active * {color: inherit; } +#right-bar .clients .list .active h2 {color: $highlight-fg; } +#right-bar .clients .list .active .button { background:$button-active-bg; color:$button-active-fg; } +#right-bar .clients .list .active .button:hover { background:$accent-foreground !important; color:$accent-background; } +#right-bar .clients .connector li { border-top:0px solid $pane-border; border-bottom:1px solid $pane-border; } +#right-bar .clients .connector li:first-child {border:none;} +#right-bar .clients .connector li:last-child {border-bottom:none;} +#right-bar .clients .connector li + li {border-bottom:none;} +#right-bar .clients .connector li h2 {color: $highlight-fg; } +#right-bar .clients .connector li:hover h2 {color: $highlight-fg; } +#right-bar .clients .connector li:hover {background: $highlight-bg; color: $fg; border-color: $pane-border; } + +#status { color: $hidden-fg; } +#status .console-toggle { cursor:default; background:$hidden-bg; color:$fg; min-width:12px; padding:0 4px; width:auto; display:none; text-align:center; margin-left:0px; border-radius:2px; } +#status .console-toggle:hover { background:$dark-highlight-bg; color:$highlight-fg; } +#status .console-toggle.dirty { background:$accent-background; color:$accent-foreground; display: inline-block; } +#status .console-toggle.error { color:$error-fg; background:$error-bg; } +#status .log .error { color:$error-fg; background:$error-bg; } +#status .log .tip { color: $accent-foreground; } + +#find-bar input { border-top:2px solid $bg; background:$multi; } +#find-bar input + input { border-left:2px solid $bg; } +#find-bar ::-webkit-input-placeholder { color:$hidden-fg; } +#find-bar button { background:$bg; } +#find-bar button:hover, #find-bar button:focus, #find-bar button:active, #find-bar button.active { background:$button-active-bg; } + +#browser input { background:$hidden-bg; color:$fg; } +#browser button { } +#browser iframe { background:white; } +#browser ::-webkit-scrollbar { background: $bg !important; } +#browser ::-webkit-scrollbar-track { background: $bg !important; } +#browser ::-webkit-scrollbar-corner { background: $bg !important; } +#browser ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } + +.docs ::-webkit-scrollbar { background: $bg !important; } +.docs ::-webkit-scrollbar-track { background: $bg !important; } +.docs ::-webkit-scrollbar-corner { background: $bg !important; } +.docs ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } + +.search-results .path, .search-results .line { color:$hidden-fg; } +.search-results .line { color:$secondary-accent-desat-fg; } +.search-results .entry { color: $placeholder-fg; } +.search-results .entry em { color:$blinding-fg; } +.search-results .entry:hover { background:$hidden-bg; } +.search-results .entry:hover .line { background:$medium-highlight-bg; color:$bg; } +.search-results .path { color:$secondary-accent-dim-fg; } +.search-results .file { color:$secondary-accent-fg; } +.search-results input { background:$highlight-bg; } +.search-results button { background:$bg; } + +.watch-result { display:inline-block; padding-left:2px; vertical-align:top; background:$usage-bg; color:$usage-fg; border-radius:0px; } +.CodeMirror .watched { border-bottom:1px solid $usage-fg; } + +.hintwrapper { padding:2px 0; padding-bottom:5px; padding-left:12px; box-sizing:border-box; } +.jshinterrors { display:inline-block; box-sizing:border-box; padding:2px 10px; border-radius:0px; background:$error-bg; color:$error-fg; } +.hintwrapper .spacer { display:inline-block; white-space:pre; } + +.behavior-helper-result {white-space:nowrap; display:inline-block; padding-top:0px; padding-bottom:0px; overflow:hidden; margin-left:0px; padding-left:20px; box-sizing:border-box; background:none; color:$usage-fg; } +.behavior-helper-result div { white-space:nowrap; width:-webkit-fit-content; background:$usage-bg; padding:0px 5px; border-radius:0px; margin-top:0px; } +.behavior-helper-result div > * { border-radius:0px; padding:0px !important; } +.behavior-helper-result h2 { display:block; width:-webkit-fit-content; white-space:nowrap; } +.behavior-helper-result div > span.param { display:inline-block; margin-right:8px; margin-bottom:3px; padding:2px 5px !important; margin-top:5px; border:1px solid $usage-fg; } +.behavior-helper-result div > span.spacer { display:inline-block; margin:0 5px; } +.behavior-helper-result .active { background: $usage-fg; color:$usage-bg; border-radius:0px; display:inline-block; } +.behavior-helper-result .example { display:inline-block; width:auto; vertical-align:top; padding:0; margin:0; margin-left:5px; border:none; } + +.plugin-manager .version { margin-left:10px; color:$hidden-fg; } +.plugin-manager h3 { color: $hidden-fg; } +.plugin-manager h3:before { content:"by "; } +.plugin-manager li { border:none; position:relative; } +.plugin-manager li h1 { color:$accent-foreground; } +.plugin-manager li.has-update .version { color:$error-fg; } +.plugin-manager li.has-update .version { color:$error-fg; } +.plugin-manager li.has-update h1 { color:$error-fg; } +.plugin-manager li + li { border-top:1px solid $border; } +.plugin-manager > ul > li:hover { background:$hidden-bg; } +.plugin-manager .tabs { margin-bottom:15px; display:flex; -webkit-flex-direction:row; -webkit-align-items:stretch; height:30px; width:100%; } +.plugin-manager input {background: $highlight-bg; -webkit-flex:1; } +.plugin-manager button {background: $highlight-bg; } +.plugin-manager .install { box-sizing:border-box; color:$secondary-accent-bg; background:$secondary-accent-fg; display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} +.plugin-manager .uninstall { box-sizing:border-box; color:$tertiary-accent-bg; background:$tertiary-accent-fg; display:inline-block; height:25px; position:absolute; right:0; top:0; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} +.plugin-manager .update { box-sizing:border-box; background:$error-fg; display:inline-block; height:25px; position:absolute; right:0; top:50px; width:5px; -webkit-transition:width 0.1s ease-in-out; cursor:pointer;} +.plugin-manager li:hover .update { width:70px; overflow:hidden; } +.plugin-manager li:hover .update:before { color:$error-bg; padding:4px 8px; display:inline-block; content: "update"; } +.plugin-manager li:hover .uninstall { width:70px; overflow:hidden; } +.plugin-manager li:hover .uninstall:before { padding:4px 8px; display:inline-block; content: "uninstall"; } +.plugin-manager li:hover .install { width:70px; overflow:hidden; } +.plugin-manager li:hover .install:before { padding:4px 8px; display:inline-block; content: "install"; } +.plugin-manager .source { color:transparent; position:absolute; height:25px; width:5px; top:25px; right:0; background:$accent-foreground; overflow:hidden; -webkit-transition:width 0.1s ease-in-out, right 0.1s ease-in-out; } +.plugin-manager .source a { color:transparent; padding:4px 8px; display:inline-block; width:100%;} +.plugin-manager li:hover .source { width:70px; } +.plugin-manager li:hover .source a { color:$accent-background; } + +/********************************************************** +* Theme specific +***********************************************************/ + +.cm-visible-space { background:url("../../img/visible-space11.png"); background-size:100%; background-position:center; background-repeat: no-repeat;} +.cm-visible-tab { background:url("../../img/visible-tab7.png"); background-size:100% 1em; background-position:center; background-repeat: no-repeat;} + +#right-bar .clients .load-wrapper .img { width:20px; height:20px; background:url("../../img/connectingloader.gif") } + +#titlebar .button { color:$fg; } + +.load-wrapper .img { background:url("../../img/loaderdark.gif"); } + +.timed { border-bottom:1px solid #fa5; } +.timed-result { background: #741; color:#fb0; } +.workspace .buttons { display:none; } +#multi .list { margin:0; } +#multi .list li { height:29px; padding:6px 10px; font-size: 9pt; text-align:left; } +#multi .content { background:$multi; margin:0; top:29px; left:0; right:0; padding:5px; padding-bottom:5px; } + +#left-bar .workspace ul.root { top:0px; } +#right-bar .filter-list input { padding:6px 10px; font-size:10pt; margin-top:0; border-radius:0px; } +#right-bar .filter-list ul { top:35px; bottom:10px; } +#right-bar .content { padding:0 15px; padding-bottom:10px; } + +button { border-radius:0; } +* { border-radius:0; } + +.CodeMirror pre { padding: 0 0 0 5px; /* Horizontal padding of content */ } + +.CodeMirror div.CodeMirror-cursor { border-left: 1px solid white; } +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { border-left: 1px solid silver; } +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { width: auto; border: none !important; background: rgba(0, 200, 200, .4); } + +.CodeMirror-gutters { background: $multi; border-color:$dark-highlight-bg; border:none; } +.CodeMirror-hints.empty { display:none; } +.CodeMirror-hints { position: absolute; z-index: 1000000000000000; overflow: hidden; list-style: none; margin: 0; padding: 2px; border-radius: 2px; border: 1px solid $pane-bg; background: $pane-bg; font-size: 90%; font-family: inherit; max-height: 20em; } +.CodeMirror-hints ul { overflow-y:auto; max-height:20em; } +.CodeMirror-hints ul li { margin: 0; padding: 0 4px; border-radius: 2px; max-width: 60em; overflow: hidden; white-space: pre; color: #ccc; cursor: pointer; } +.CodeMirror-hints input { display:none; } +.CodeMirror-hints .selected { background: $highlight-bg; color: $highlight-fg; } +.CodeMirror-hints ul::-webkit-scrollbar-thumb { background: $scrollbar; border-color: $scrollbar; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 387cf1eb2..0c8d48d93 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -1,9 +1,5 @@ /* structure */ -:root { - var-top-offset: 10px; -} - html { overflow:hidden; height:100vh; } body { position:fixed; top:0; bottom:0; left:0; right:0; font-family: "Verdana", "Courier New", "Inconsolata", monospace; font-size:10pt; overflow:hidden;} input { border:none; padding:5px; outline:none; border-radius:0px; font-size:10pt; } @@ -50,7 +46,7 @@ body { -webkit-user-select: none; } .underline-result .spacer { display:inline-block; white-space:pre; vertical-align:top; } .dragimage { display:block; height:0; width:0; cursor:default; } -.sortable-placeholder { box-sizing:border-box; background:var(multi); border:2px solid var(bg); border-top:none; } +.sortable-placeholder { box-sizing:border-box; } .inspector-object h2 { cursor:default; } .inspector-object > h2:before { content:"▶"; margin-right:10px; font-size:8px; width:6px; display:inline-block; vertical-align:middle; box-sizing:border-box; } @@ -61,10 +57,10 @@ body { -webkit-user-select: none; } .inspector-object.open > div > ul { display:inline-block; margin-left:16px; } .inspector-object.open .inspector-object > div > ul {margin:0;} -#wrapper { position:fixed; top:var(top-offset); bottom:0px; left:0; right:0; overflow:hidden; -webkit-transition:opacity 0.2s ease-in-out 0.2s; } -#canvas { position:fixed; top:var(top-offset); bottom:0; left:0; right:0; overflow:hidden; } +#wrapper { position:fixed; top:10px; bottom:0px; left:0; right:0; overflow:hidden; -webkit-transition:opacity 0.2s ease-in-out 0.2s; } +#canvas { position:fixed; top:10px; bottom:0; left:0; right:0; overflow:hidden; } -#multi { z-index:20; position:fixed; left:0px; right:0px; top:var(top-offset); bottom:0px; overflow:hidden; } +#multi { z-index:20; position:fixed; left:0px; right:0px; top:10px; bottom:0px; overflow:hidden; } #multi .tabsets { left:0; right:0; position:absolute; top:0; bottom:34px; max-width:100%; width:100%; overflow:hidden; white-space:nowrap; } #multi .tabset { box-sizing:border-box; position:relative; overflow:hidden; width:100%; height:100%; float:none; vertical-align:top; display:inline-block; white-space:normal; } #multi .list { display:block; background:transparent; overflow-y:hidden; overflow-x:hidden; margin:0 8px; z-index:10000000; } @@ -163,12 +159,12 @@ body { -webkit-user-select: none; } #version-info .button { padding:8px 10px; cursor:pointer; border-radius:3px; position:absolute; bottom:10px; box-sizing:border-box; right:30px; left:20px; } #version-info .CodeMirror { width:73%; height:100%; float:left; display:inline; padding-left:10px; } -#right-bar { background:transparent; position:fixed; top:var(top-offset); right:0; z-index:10000; height:100%; box-sizing:border-box; } +#right-bar { background:transparent; position:fixed; top:10px; right:0; z-index:10000; height:100%; box-sizing:border-box; } #right-bar .content { height:100%; overflow:hidden; padding:10px; box-sizing:border-box;} #right-bar .content > * { padding:0px 0px; box-sizing:border-box; height:100%; } #right-bar .vertical-grip { left:-4px; } -#left-bar { position:fixed; top:var(top-offset); left:0; bottom:0; z-index:1000000; overflow:hidden; } +#left-bar { position:fixed; top:10px; left:0; bottom:0; z-index:1000000; overflow:hidden; } #left-bar .content { height:100%; overflow:hidden; padding:4px 5px; padding-bottom:10px; box-sizing:border-box;} #left-bar .content > * { padding:0px 0px; box-sizing:border-box; } #left-bar .vertical-grip { right:-4px; pointer-events:auto; } diff --git a/deploy/core/css/themes/ambiance.css b/deploy/core/css/themes/ambiance.css index 85af70d2d..cd33d2589 100644 --- a/deploy/core/css/themes/ambiance.css +++ b/deploy/core/css/themes/ambiance.css @@ -1,12 +1,9 @@ /* ambiance theme for codemirror */ /* Color scheme */ -:root { - var-background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); -} -#multi.theme-ambiance .content { background-image: var(background); } -#multi.theme-ambiance .list .active, #multi.theme-ambiance .list li:hover { background-image:var(background); color:#ccc; } +#multi.theme-ambiance .content { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); } +#multi.theme-ambiance .list .active, #multi.theme-ambiance .list li:hover { background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); color:#ccc; } #multi.theme-ambiance .list .dirty { color:#cda869; } .cm-s-ambiance .cm-keyword { color: #cda869; } @@ -71,5 +68,5 @@ .cm-s-ambiance.CodeMirror, .cm-s-ambiance .CodeMirror-gutters { - background-image: var(background); + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); } diff --git a/deploy/core/css/themes/default.css b/deploy/core/css/themes/default.css index 1fbd4f04c..ad5eb1ace 100644 --- a/deploy/core/css/themes/default.css +++ b/deploy/core/css/themes/default.css @@ -1,8 +1,8 @@ -#multi.theme-default .tabset .list .active { color:var(placeholder-fg); } -#multi.theme-default .tabset.active .list .active { color:var(highlight-fg); } -#multi.theme-default .tabset.active .list .dirty { color:var(accent-foreground); } +#multi.theme-default .tabset .list .active { color:#aaa; } +#multi.theme-default .tabset.active .list .active { color:#f4f4f4; } +#multi.theme-default .tabset.active .list .dirty { color:#C7E6FF; } -.cm-s-default { background: var(multi); color:var(fg); } +.cm-s-default { background: #202020; color:#ccc; } .cm-s-default span.cm-bracket {color: #aaa;} .cm-s-default span.cm-bracket1 {color: #aaa; } @@ -55,12 +55,12 @@ .CodeMirror div.CodeMirror-secondarycursor { border-left: 1px solid silver; } .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { width: auto; border: none !important; background: rgba(0, 200, 200, .4); } -.CodeMirror-gutters { background: var(multi); border-color:var(dark-highlight-bg); border:none; } -.cm-s-default .CodeMirror-activeline .CodeMirror-linenumber { color:var(blinding-fg); } +.CodeMirror-gutters { background: #202020; border-color:#666; border:none; } +.cm-s-default .CodeMirror-activeline .CodeMirror-linenumber { color:#fff; } -.CodeMirror-hints { position: absolute; z-index: 1000000000000000; overflow: hidden; list-style: none; margin: 0; padding: 2px; border-radius: 2px; border: 1px solid var(pane-bg); background: var(pane-bg); font-size: 90%; font-family: inherit; max-height: 20em; } +.CodeMirror-hints { position: absolute; z-index: 1000000000000000; overflow: hidden; list-style: none; margin: 0; padding: 2px; border-radius: 2px; border: 1px solid #3b3f41; background: #3b3f41; font-size: 90%; font-family: inherit; max-height: 20em; } .CodeMirror-hints ul { overflow-y:auto; max-height:20em; } .CodeMirror-hints ul li { margin: 0; padding: 0 4px; border-radius: 2px; max-width: 60em; overflow: hidden; white-space: pre; color: #ccc; cursor: pointer; } .CodeMirror-hints input { display:none; } -.CodeMirror-hints .selected { background: var(highlight-bg); color: var(highlight-fg); } -.CodeMirror-hints ul::-webkit-scrollbar-thumb { background: var(scrollbar); border-color: var(scrollbar); } +.CodeMirror-hints .selected { background: #616161; color: #f4f4f4; } +.CodeMirror-hints ul::-webkit-scrollbar-thumb { background: #606970; border-color: #606970; } diff --git a/deploy/core/css/themes/ibdknox.css b/deploy/core/css/themes/ibdknox.css index 5fc2dead0..4ddecbd9e 100644 --- a/deploy/core/css/themes/ibdknox.css +++ b/deploy/core/css/themes/ibdknox.css @@ -1,9 +1,9 @@ #multi.theme-ibdknox .content { background: #202020; } #multi.theme-ibdknox .list .active, #multi.theme-ibdknox .list li:hover { background:#202020; color:#dfe1e8; } #multi.theme-ibdknox .list .dirty { color:#C7E6FF; } -#multi.theme-ibdknox .tabset .list .active { color:var(placeholder-fg); } -#multi.theme-ibdknox .tabset.active .list .active { color:var(highlight-fg); } -#multi.theme-ibdknox .tabset.active .list .dirty { color:var(accent-foreground); } +#multi.theme-ibdknox .tabset .list .active { color:#aaa; } +#multi.theme-ibdknox .tabset.active .list .active { color:#f4f4f4; } +#multi.theme-ibdknox .tabset.active .list .dirty { color:#C7E6FF; } .cm-s-ibdknox { background: #202020; color:#ccc; } @@ -41,13 +41,24 @@ .cm-s-ibdknox span.CodeMirror-searching { background: #aaa; color:black; } .cm-s-ibdknox span.CodeMirror-searching-active { background: #afa; color:black; } +.cm-s-ibdknox span.cm-symbol-ruleName, span.cm-operator-rule { color: #9cc; } +.cm-s-ibdknox span.cm-field { color: #FF8AB0; } +.cm-s-ibdknox span.cm-aliased-field { color: #79a; } +.cm-s-ibdknox span.cm-assigned-field { color: #79a; } +.cm-s-ibdknox span.cm-symbol-variable { color: #FF8AB0; } +.cm-s-ibdknox span.cm-symbol-alias { color: #FF8AB0; } +.cm-s-ibdknox span.cm-symbol-table { color: #add; } +.cm-s-ibdknox span.cm-function { color: #79a; } +.cm-s-ibdknox span.cm-number { color: #79a; } + + .cm-s-ibdknox .CodeMirror-selected { background: #555; } .cm-s-ibdknox .CodeMirror-focused .CodeMirror-selected { background: #444; } .cm-s-ibdknox span.cm-SUBST { color:#FF1F69; } .cm-s-ibdknox .CodeMirror-activeline { background:#343d46; } -.cm-s-ibdknox .CodeMirror-activeline .CodeMirror-linenumber { background:#444d56; color:var(blinding-fg); } +.cm-s-ibdknox .CodeMirror-activeline .CodeMirror-linenumber { background:#444d56; color:#fff; } .cm-s-ibdknox span.CodeMirror-matchingbracket {box-sizing:border-box; background:transparent; border-bottom:1px solid #3FF; font-weight:normal;} .cm-s-ibdknox span.CodeMirror-nonmatchingbracket {color: #F33; border-bottom:1px solid #F33; background:none;} @@ -59,4 +70,4 @@ .cm-s-ibdknox.CodeMirror div.CodeMirror-secondarycursor { border-left: 1px solid silver; } .cm-s-ibdknox.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { width: auto; border: none !important; background: #80838a; z-index:0;} -.cm-s-ibdknox .CodeMirror-gutters { background: var(multi); border-right:0px solid #444; } +.cm-s-ibdknox .CodeMirror-gutters { background: #202020; border-right:0px solid #444; } From 49f98f8ed8fc723be16a7f36111d8047d1c09e06 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 1 Nov 2014 14:37:47 -0400 Subject: [PATCH 271/656] Allow users to press enter in autocomplete by default. Close #1296 Not being able to press enter in all contexts by default (including autocompletion) is surprising. Users can still select a completion with tab. --- deploy/settings/default/default.keymap | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 2048d6aaa..ad9f2d382 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -31,6 +31,7 @@ "}" [(:editor.close-pair "}")] "backspace" [:editor.backspace-pair :editor.backspace-indent]} + :editor.keys.hinting.active {"enter" [:passthrough]} :tabs {"pmeta-w" [:tabs.close] "pmeta-shift-[" [:tabs.prev] "pmeta-shift-]" [:tabs.next] From 29df511a1f157942140d61e5238f68b75bf1d9bb Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 3 Nov 2014 23:38:42 -0500 Subject: [PATCH 272/656] Mention license in readme, close #973 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fec8e587a..3473095e4 100755 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ After the initial setup, you can compile the ClojureScript source at any time wi # Note on Hotkeys for OS X -Many (though not all) of the OS X hotkeys mentioned in the Light Table documentation use the cmd key instead of ctrl. +Many (though not all) of the OS X hotkeys mentioned in the Light Table documentation use the cmd key instead of ctrl. When in doubt, you can look up the key sequence by name by pressing ctrl-space (yes, it's really ctrl on this one) and then typing part of the name of the command you want to use. If a key is mapped to the command, it will be printed right below the command name in the command bar. @@ -234,6 +234,10 @@ Commands can also be bound to key chords. Run the command `Settings: Default key See [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier) for an example ClojureScript plugin. +# License + +All files in this project are under the [LICENSE.md](LICENSE.md) license unless otherwise stated in the file or by a dependency's license file. + # Other documentation * [Clojurescript for Light Table users](https://github.com/swannodette/lt-cljs-tutorial) by David Nolen From 6d3d8232851b238e485af4dfb140beb984d8abd2 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 4 Nov 2014 00:15:48 -0500 Subject: [PATCH 273/656] Adjust contributing wording to avoid any misleading wording, close #1614 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46c1adac8..bb38385bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ #Contributing -Like with Clojure and most other big OSS projects, we have a [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform) that you have to agree to before we can merge. It's a simple adaptation of Twitter's own Contributor's Agreement and just says that by signing this you can't take the code back from us or sue us into oblivion for using it later. +We'd love to have your contribution. Like with Clojure and other big OSS projects, we do require you to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. Also, if your pull request is going to require some effort, please discuss it with us first. We want your hard work to count. #Plugins From 11def7dbe4e7d57dfd5492984a6b84904e9eff32 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Tue, 28 Oct 2014 22:40:23 +0200 Subject: [PATCH 274/656] Fixed couple of compile-time warnings #1658 --- src/lt/objs/clients.cljs | 7 +------ src/lt/objs/eval.cljs | 9 +-------- src/lt/objs/keyboard.cljs | 2 +- src/lt/objs/langs/behaviors.cljs | 3 +-- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index 6ba650340..22a5b0daf 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -24,11 +24,6 @@ (defn by-name [n] (first (filter #(= n (:name @%)) (vals @cs)))) -(defn ->name [client] - (if (map? client) - (:name client) - client)) - (defn merge-info [client info] (let [{:keys [commands type tags]} info info (dissoc info :tags)] @@ -49,7 +44,7 @@ (handle-connection! (assoc info :client-id (->id c)))))) (defn rem! [client] - (let [id (by-id (->id client))] + (let [cname (:name @client)] (swap! cs dissoc (->id client)) (object/raise client :disconnect) (object/destroy! client) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 8a5191278..9cc2c758d 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -24,13 +24,6 @@ (when cb (cb)))) -(defn unsupported [] - (popup/show! [:h2 "We can't eval that yet."] - [:p "We can't eval this type of file yet. The extensions that we know how to execute are:" - (str " [ " (apply str (map #(str "." % " ") supported-types)) "]")] - (button "Cancel") - )) - (defn unescape-unicode [s] (string/replace s #"\\x(..)" @@ -136,7 +129,7 @@ (clients/swap-client! (-> @origin :client key) client) (object/update! origin [:client] assoc key client))) (clients/placeholder)) - :unsupported (unsupported)))) + ))) (defn get-client! [{:keys [origin command key create] :as opts}] (let [key (or key :default) diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 627ef0f26..a44b637bb 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -58,7 +58,7 @@ "cmd-" "meta-")) (when (.-altKey ev) "alt-") - (when (or (.-altGraphKey ev) altgr) "altgr-") + (when (.-altGraphKey ev) "altgr-") (when (.-shiftKey ev) "shift-") (. (or key "") toLowerCase))) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index a2f8d3c54..ebb8910cc 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -20,7 +20,6 @@ (defn pos->state [ed] (let [token (editor/->token ed (editor/->cursor ed)) - _ (set! tok token) level (-> (get-in token [:state :overlay :rainbowstack]) (last) (:level))] @@ -65,7 +64,7 @@ (index-of res params))))) (defn wrapped-replacement [replace cur] - (replace (+ "(" (.-completion cur) " )")) + (replace (str "(" (.-completion cur) " )")) (cmd/exec! :editor.char-left)) (defn ->wrapped-behavior [beh cur] From e1a829004416228483ff9c775601fa603997fa06 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Tue, 4 Nov 2014 22:14:36 +0200 Subject: [PATCH 275/656] Fixed couple of compile warnings --- src/lt/objs/canvas.cljs | 2 +- src/lt/objs/context.cljs | 6 +----- src/lt/objs/document.cljs | 6 ------ src/lt/objs/eval.cljs | 3 +-- src/lt/objs/sidebar/clients.cljs | 2 ++ src/lt/plugins/auto_complete.cljs | 6 ++++-- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/lt/objs/canvas.cljs b/src/lt/objs/canvas.cljs index fca953f52..1760af21c 100644 --- a/src/lt/objs/canvas.cljs +++ b/src/lt/objs/canvas.cljs @@ -21,7 +21,7 @@ (defn add! [obj & [position?]] (append (object/->content canvas) (object/->content obj)) - (object/raise obj :show rep)) + (object/raise obj :show)) ;;********************************************************* ;; Behaviors diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index 7969f9515..65cc45933 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -26,7 +26,7 @@ [ctxs])] (swap! contexts #(apply disj % ctxs)) (swap! ctx->obj #(apply dissoc % ctxs)) - (object/raise ctx-obj :log!))) + (object/raise ctx-obj :log!))) ([ctxs _] (out! ctxs))) (defn in! [ctxs & [obj]] @@ -49,10 +49,6 @@ (defn current [] @contexts) -(defn group! [ctx group] - (swap! ctx->group assoc ctx group) - (swap! group->ctx update-in [group] conj ctx)) - (defn ->obj [ctx] (@ctx->obj ctx)) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 4fb9a5889..6326ecc5b 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -128,12 +128,6 @@ (defn set-val [doc v] (.setValue (->cm-doc doc) v)) -(defn replace - ([d from v] - (.replaceRange (->cm-doc d) v (clj->js from))) - ([d from to v] - (.replaceRange (->cm-doc d) v (clj->js from) (clj->js to)))) - ;;*************************************************** ;; Manager diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 9cc2c758d..8add95f75 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -433,8 +433,7 @@ :triggers #{:click :double-click :clear!} :tags #{:inline :inline.exception} :init (fn [this info] - (if-not (-> info :loc :line) - (notifos/set-msg! (str ex) {:class "error"}) + (if (-> info :loc :line) (let [content (->inline-exception this info)] (object/merge! this (assoc info :widget (ed/line-widget (ed/->cm-ed (:ed info)) diff --git a/src/lt/objs/sidebar/clients.cljs b/src/lt/objs/sidebar/clients.cljs index 8fc881ad4..06c1b4254 100644 --- a/src/lt/objs/sidebar/clients.cljs +++ b/src/lt/objs/sidebar/clients.cljs @@ -17,6 +17,8 @@ :click (fn [] (clients/close! i))) +(declare clients) + (defui unset-button [i] [:span.button.unset "unset"] :click (fn [] diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index f1da87689..13af1b3ae 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -52,6 +52,8 @@ (skip-space s)) (into-array (map #(do #js {:completion %}) (js/Object.keys res))))) +(def default-pattern #"[\w_$]") + (defn get-pattern [ed] (let [mode (editor/inner-mode ed)] (or (:hint-pattern @ed) (aget mode "hint-pattern") default-pattern))) @@ -124,8 +126,6 @@ (into-array (map #(do #js {:completion %}) (js/Object.keys res)))))] (js/_send obj-id :hint-tokens (string->tokens (:string m) (:pattern m))))))) -(def default-pattern #"[\w_$]") - (defn async-hints [this] (when @this (w this {:string (editor/->val this) @@ -145,6 +145,8 @@ (aset seen (.-completion hint) true))) hints))) +(declare hinter) + (def hinter (-> (scmd/filter-list {:items (fn [] (when-let [cur (pool/last-active)] (let [token (-> @hinter :starting-token :string)] From 4078d79ea602111bb2bc4ddc4b43f55fbfe23de0 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Tue, 4 Nov 2014 23:24:11 +0200 Subject: [PATCH 276/656] Fixed couple of compile-time warnings #1658 --- src/lt/objs/console.cljs | 2 +- src/lt/objs/keyboard.cljs | 2 +- src/lt/objs/plugins.cljs | 4 ++-- src/lt/objs/popup.cljs | 2 +- src/lt/objs/search.cljs | 4 ++-- src/lt/objs/settings.cljs | 2 +- src/lt/objs/sidebar/navigate.cljs | 5 ----- src/lt/objs/tabs.cljs | 2 -- src/lt/plugins/doc.cljs | 2 +- src/lt/plugins/watches.cljs | 1 - src/lt/util/cljs.cljs | 18 ------------------ src/lt/util/dom.cljs | 2 +- 12 files changed, 10 insertions(+), 36 deletions(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index d19f838d7..5c9c886b6 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -142,7 +142,7 @@ class)))) (defn clear [] - (dom/empty (->ui console))) + (dom/empty! (->ui console))) (object/object* ::sidebar.console :tags #{:console} diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index a44b637bb..248e573b8 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -124,7 +124,7 @@ (defn capture-up [key char ev] (or (@key-map char) (@key-map (->keystr key ev)))) -(def meta (if (platform/mac?) +(def meta-key (if (platform/mac?) "cmd" "ctrl")) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 45d4d17fd..9e4615ecd 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -473,7 +473,7 @@ :desc "Plugin Manager: render plugin results" :reaction (fn [this plugins] (let [ul (dom/$ :.server-plugins (object/->content this))] - (dom/empty ul) + (dom/empty! ul) (->> (remove #(installed? (-> % :info :name)) plugins) (map server-plugin-ui) (dom/fragment) @@ -519,7 +519,7 @@ :reaction (fn [this plugins] (object/merge! app/app {::plugins (available-plugins)}) (let [ul (dom/$ :.plugins (object/->content this))] - (dom/empty ul) + (dom/empty! ul) (dom/append ul (dom/fragment (map installed-plugin-ui (->> @app/app ::plugins vals (sort-by #(.toUpperCase (:name %)))))))))) (behavior ::on-close diff --git a/src/lt/objs/popup.cljs b/src/lt/objs/popup.cljs index 21862a81a..83a859c70 100644 --- a/src/lt/objs/popup.cljs +++ b/src/lt/objs/popup.cljs @@ -7,7 +7,7 @@ [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior defui]])) -(def *no-close* nil) +(def ^{:dynamic true} *no-close* nil) (behavior ::on-click-destroy :triggers #{:click} diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index ce75c99dd..e01fc7336 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -114,7 +114,7 @@ :triggers #{:clear!} :reaction (fn [this] (object/merge! this {:timeout nil :results (array) :result-count 0 ::time nil ::filesSearched nil :position [0 -1]}) - (dom/empty (->res this)))) + (dom/empty! (->res this)))) (behavior ::search! :triggers #{:search!} @@ -149,7 +149,7 @@ (if (:replace? info) (do (notifos/done-working (str "Replaced " (:result-count @this) " results in " (/ (:time info) 1000) "s." )) - (dom/empty (->res this))) + (dom/empty! (->res this))) (notifos/done-working (str "Found " (:result-count @this) " results searching " (:total info) " files in " (/ (:time info) 1000) "s." ))))) (behavior ::next! diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 68de9394b..a190148b2 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -130,7 +130,7 @@ (defn fix-key [k] - (let [k (string/replace k "pmeta" kb/meta) + (let [k (string/replace k "pmeta" kb/meta-key) keys (string/split k " ")] ;;ctrl cmd alt altgr shift (reduce #(str % " " %2) (map ->ordered-keystr keys)))) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index a881016bc..f16a73d39 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -19,11 +19,6 @@ (defn file-filters [f] (re-seq files/ignore-pattern f)) -(defn populate [ws] - (let [files (reduce grab-files [] (:folders ws)) - fs (map #(do {:full % :rel (files/basename %)}) (:files ws))] - (vec (filter #(files/file? (:full %)) (remove #(-> % :rel file-filters) (concat files fs)))))) - (def populate-bg (background (fn [obj-id {:keys [lim pattern ws]}] (let [fs (js/require "fs") fpath (js/require "path") diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index a47a3b96c..ad3687e4b 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -475,7 +475,6 @@ (if-not ts 1 (+ (:width @ts) (- prev-width new-perc))))] - ;(println (.-clientX e) (.-clientY e) (.-screenX e) (.-screenY e) (js->clj (js/Object.keys e))) (when-not (= cx 0) (if (or (< new-perc 0) ) (temp-width this 100) @@ -487,7 +486,6 @@ (if ts (temp-width ts next-width) (spawn-tabset)))))) - (set! start (now)) )) diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index f048b7c91..73136dc74 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -156,7 +156,7 @@ (behavior ::clear! :triggers #{:clear!} :reaction (fn [this] - (dom/empty (dom/$ :.results (object/->content this))) + (dom/empty! (dom/$ :.results (object/->content this))) (object/merge! this {:results #{}}))) (behavior ::no-client diff --git a/src/lt/plugins/watches.cljs b/src/lt/plugins/watches.cljs index f5f07ec81..79d41bbab 100644 --- a/src/lt/plugins/watches.cljs +++ b/src/lt/plugins/watches.cljs @@ -12,7 +12,6 @@ res-obj (object/create :lt.objs.eval/inline-result {:ed this :class (or (:class opts) (name type)) :opts opts - :result res :loc loc :line line})] (object/add-tags res-obj [:inline.watch]) diff --git a/src/lt/util/cljs.cljs b/src/lt/util/cljs.cljs index 366e572ec..a42a8fdc6 100644 --- a/src/lt/util/cljs.cljs +++ b/src/lt/util/cljs.cljs @@ -89,24 +89,6 @@ :else x))] (f x))))) -(defn clj->js - "Recursively transforms ClojureScript values to JavaScript. -sets/vectors/lists become Arrays, Keywords and Symbol become Strings, -Maps become Objects. Arbitrary keys are encoded to by key->js." - [x] - (when-not (nil? x) - (if (satisfies? IEncodeJS x) - (-clj->js x) - (cond - (keyword? x) (name x) - (symbol? x) (str x) - (map? x) (let [m (js-obj)] - (doseq [[k v] x] - (aset m (key->js k) (clj->js v))) - m) - (coll? x) (apply array (map clj->js x)) - :else x)))) - (defn str-contains? [str x] (> (.indexOf str x) -1)) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index c9e8937e6..5f603a73d 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -102,7 +102,7 @@ (when-let [p (parent elem)] (.removeChild p elem))) -(defn empty [elem] +(defn empty! [elem] (set! (.-innerHTML elem) "")) (defn val [elem & [v]] From ce367e1b7236516ed6c134619b943c98584e5ecc Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Wed, 5 Nov 2014 21:18:57 +0200 Subject: [PATCH 277/656] Bring back some functions, that might broke inner API --- src/lt/objs/clients.cljs | 5 +++++ src/lt/objs/console.cljs | 2 +- src/lt/objs/context.cljs | 4 ++++ src/lt/objs/document.cljs | 6 ++++++ src/lt/objs/keyboard.cljs | 2 +- src/lt/objs/plugins.cljs | 4 ++-- src/lt/objs/search.cljs | 4 ++-- src/lt/objs/settings.cljs | 2 +- src/lt/objs/sidebar/navigate.cljs | 5 +++++ src/lt/plugins/doc.cljs | 2 +- src/lt/util/cljs.cljs | 18 ++++++++++++++++++ src/lt/util/dom.cljs | 2 +- 12 files changed, 47 insertions(+), 9 deletions(-) diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index 22a5b0daf..7b40a12dc 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -24,6 +24,11 @@ (defn by-name [n] (first (filter #(= n (:name @%)) (vals @cs)))) +(defn ->name [client] + (if (map? client) + (:name client) + client)) + (defn merge-info [client info] (let [{:keys [commands type tags]} info info (dissoc info :tags)] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 5c9c886b6..d19f838d7 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -142,7 +142,7 @@ class)))) (defn clear [] - (dom/empty! (->ui console))) + (dom/empty (->ui console))) (object/object* ::sidebar.console :tags #{:console} diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index 65cc45933..ab70da321 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -49,6 +49,10 @@ (defn current [] @contexts) +(defn group! [ctx group] + (swap! ctx->group assoc ctx group) + (swap! group->ctx update-in [group] conj ctx)) + (defn ->obj [ctx] (@ctx->obj ctx)) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 6326ecc5b..4fb9a5889 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -128,6 +128,12 @@ (defn set-val [doc v] (.setValue (->cm-doc doc) v)) +(defn replace + ([d from v] + (.replaceRange (->cm-doc d) v (clj->js from))) + ([d from to v] + (.replaceRange (->cm-doc d) v (clj->js from) (clj->js to)))) + ;;*************************************************** ;; Manager diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 248e573b8..a44b637bb 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -124,7 +124,7 @@ (defn capture-up [key char ev] (or (@key-map char) (@key-map (->keystr key ev)))) -(def meta-key (if (platform/mac?) +(def meta (if (platform/mac?) "cmd" "ctrl")) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 9e4615ecd..45d4d17fd 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -473,7 +473,7 @@ :desc "Plugin Manager: render plugin results" :reaction (fn [this plugins] (let [ul (dom/$ :.server-plugins (object/->content this))] - (dom/empty! ul) + (dom/empty ul) (->> (remove #(installed? (-> % :info :name)) plugins) (map server-plugin-ui) (dom/fragment) @@ -519,7 +519,7 @@ :reaction (fn [this plugins] (object/merge! app/app {::plugins (available-plugins)}) (let [ul (dom/$ :.plugins (object/->content this))] - (dom/empty! ul) + (dom/empty ul) (dom/append ul (dom/fragment (map installed-plugin-ui (->> @app/app ::plugins vals (sort-by #(.toUpperCase (:name %)))))))))) (behavior ::on-close diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index e01fc7336..ce75c99dd 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -114,7 +114,7 @@ :triggers #{:clear!} :reaction (fn [this] (object/merge! this {:timeout nil :results (array) :result-count 0 ::time nil ::filesSearched nil :position [0 -1]}) - (dom/empty! (->res this)))) + (dom/empty (->res this)))) (behavior ::search! :triggers #{:search!} @@ -149,7 +149,7 @@ (if (:replace? info) (do (notifos/done-working (str "Replaced " (:result-count @this) " results in " (/ (:time info) 1000) "s." )) - (dom/empty! (->res this))) + (dom/empty (->res this))) (notifos/done-working (str "Found " (:result-count @this) " results searching " (:total info) " files in " (/ (:time info) 1000) "s." ))))) (behavior ::next! diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index a190148b2..68de9394b 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -130,7 +130,7 @@ (defn fix-key [k] - (let [k (string/replace k "pmeta" kb/meta-key) + (let [k (string/replace k "pmeta" kb/meta) keys (string/split k " ")] ;;ctrl cmd alt altgr shift (reduce #(str % " " %2) (map ->ordered-keystr keys)))) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index f16a73d39..a881016bc 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -19,6 +19,11 @@ (defn file-filters [f] (re-seq files/ignore-pattern f)) +(defn populate [ws] + (let [files (reduce grab-files [] (:folders ws)) + fs (map #(do {:full % :rel (files/basename %)}) (:files ws))] + (vec (filter #(files/file? (:full %)) (remove #(-> % :rel file-filters) (concat files fs)))))) + (def populate-bg (background (fn [obj-id {:keys [lim pattern ws]}] (let [fs (js/require "fs") fpath (js/require "path") diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index 73136dc74..f048b7c91 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -156,7 +156,7 @@ (behavior ::clear! :triggers #{:clear!} :reaction (fn [this] - (dom/empty! (dom/$ :.results (object/->content this))) + (dom/empty (dom/$ :.results (object/->content this))) (object/merge! this {:results #{}}))) (behavior ::no-client diff --git a/src/lt/util/cljs.cljs b/src/lt/util/cljs.cljs index a42a8fdc6..366e572ec 100644 --- a/src/lt/util/cljs.cljs +++ b/src/lt/util/cljs.cljs @@ -89,6 +89,24 @@ :else x))] (f x))))) +(defn clj->js + "Recursively transforms ClojureScript values to JavaScript. +sets/vectors/lists become Arrays, Keywords and Symbol become Strings, +Maps become Objects. Arbitrary keys are encoded to by key->js." + [x] + (when-not (nil? x) + (if (satisfies? IEncodeJS x) + (-clj->js x) + (cond + (keyword? x) (name x) + (symbol? x) (str x) + (map? x) (let [m (js-obj)] + (doseq [[k v] x] + (aset m (key->js k) (clj->js v))) + m) + (coll? x) (apply array (map clj->js x)) + :else x)))) + (defn str-contains? [str x] (> (.indexOf str x) -1)) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index 5f603a73d..c9e8937e6 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -102,7 +102,7 @@ (when-let [p (parent elem)] (.removeChild p elem))) -(defn empty! [elem] +(defn empty [elem] (set! (.-innerHTML elem) "")) (defn val [elem & [v]] From 77298873dc4bdcbfb7348b4499299bce4db39c55 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Thu, 6 Nov 2014 18:06:14 +0000 Subject: [PATCH 278/656] move to MIT license --- LICENSE.md | 618 ++--------------------------------------------------- 1 file changed, 22 insertions(+), 596 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 78f62ade3..8403ffd45 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,596 +1,22 @@ -GNU GENERAL PUBLIC LICENSE -========================== - -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. <> - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -## Preamble - -The GNU General Public License is a free, copyleft license for software and other -kinds of works. - -The licenses for most software and other practical works are designed to take away -your freedom to share and change the works. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change all versions of a -program--to make sure it remains free software for all its users. We, the Free -Software Foundation, use the GNU General Public License for most of our software; it -applies also to any other work released this way by its authors. You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General -Public Licenses are designed to make sure that you have the freedom to distribute -copies of free software (and charge for them if you wish), that you receive source -code or can get it if you want it, that you can change the software or use pieces of -it in new free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you these rights or -asking you to surrender the rights. Therefore, you have certain responsibilities if -you distribute copies of the software, or if you modify it: responsibilities to -respect the freedom of others. - -For example, if you distribute copies of such a program, whether gratis or for a fee, -you must pass on to the recipients the same freedoms that you received. You must make -sure that they, too, receive or can get the source code. And you must show them these -terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: (1) assert -copyright on the software, and (2) offer you this License giving you legal permission -to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains that there is -no warranty for this free software. For both users' and authors' sake, the GPL -requires that modified versions be marked as changed, so that their problems will not -be attributed erroneously to authors of previous versions. - -Some devices are designed to deny users access to install or run modified versions of -the software inside them, although the manufacturer can do so. This is fundamentally -incompatible with the aim of protecting users' freedom to change the software. The -systematic pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we have designed -this version of the GPL to prohibit the practice for those products. If such problems -arise substantially in other domains, we stand ready to extend this provision to -those domains in future versions of the GPL, as needed to protect the freedom of -users. - -Finally, every program is threatened constantly by software patents. States should -not allow patents to restrict development and use of software on general-purpose -computers, but in those that do, we wish to avoid the special danger that patents -applied to a free program could make it effectively proprietary. To prevent this, the -GPL assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and modification follow. - -## TERMS AND CONDITIONS - -### 0. Definitions. - -“This License” refers to version 3 of the GNU General Public License. - -“Copyright” also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - -“The Program” refers to any copyrightable work licensed under this -License. Each licensee is addressed as “you”. “Licensees” and -“recipients” may be individuals or organizations. - -To “modify” a work means to copy from or adapt all or part of the work in -a fashion requiring copyright permission, other than the making of an exact copy. The -resulting work is called a “modified version” of the earlier work or a -work “based on” the earlier work. - -A “covered work” means either the unmodified Program or a work based on -the Program. - -To “propagate” a work means to do anything with it that, without -permission, would make you directly or secondarily liable for infringement under -applicable copyright law, except executing it on a computer or modifying a private -copy. Propagation includes copying, distribution (with or without modification), -making available to the public, and in some countries other activities as well. - -To “convey” a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through a computer -network, with no transfer of a copy, is not conveying. - -An interactive user interface displays “Appropriate Legal Notices” to the -extent that it includes a convenient and prominently visible feature that (1) -displays an appropriate copyright notice, and (2) tells the user that there is no -warranty for the work (except to the extent that warranties are provided), that -licensees may convey the work under this License, and how to view a copy of this -License. If the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -### 1. Source Code. - -The “source code” for a work means the preferred form of the work for -making modifications to it. “Object code” means any non-source form of a -work. - -A “Standard Interface” means an interface that either is an official -standard defined by a recognized standards body, or, in the case of interfaces -specified for a particular programming language, one that is widely used among -developers working in that language. - -The “System Libraries” of an executable work include anything, other than -the work as a whole, that (a) is included in the normal form of packaging a Major -Component, but which is not part of that Major Component, and (b) serves only to -enable use of the work with that Major Component, or to implement a Standard -Interface for which an implementation is available to the public in source code form. -A “Major Component”, in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system (if any) on which -the executable work runs, or a compiler used to produce the work, or an object code -interpreter used to run it. - -The “Corresponding Source” for a work in object code form means all the -source code needed to generate, install, and (for an executable work) run the object -code and to modify the work, including scripts to control those activities. However, -it does not include the work's System Libraries, or general-purpose tools or -generally available free programs which are used unmodified in performing those -activities but which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for the work, and -the source code for shared libraries and dynamically linked subprograms that the work -is specifically designed to require, such as by intimate data communication or -control flow between those subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate -automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -### 2. Basic Permissions. - -All rights granted under this License are granted for the term of copyright on the -Program, and are irrevocable provided the stated conditions are met. This License -explicitly affirms your unlimited permission to run the unmodified Program. The -output from running a covered work is covered by this License only if the output, -given its content, constitutes a covered work. This License acknowledges your rights -of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without -conditions so long as your license otherwise remains in force. You may convey covered -works to others for the sole purpose of having them make modifications exclusively -for you, or provide you with facilities for running those works, provided that you -comply with the terms of this License in conveying all material for which you do not -control copyright. Those thus making or running the covered works for you must do so -exclusively on your behalf, under your direction and control, on terms that prohibit -them from making any copies of your copyrighted material outside their relationship -with you. - -Conveying under any other circumstances is permitted solely under the conditions -stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - -No covered work shall be deemed part of an effective technological measure under any -applicable law fulfilling obligations under article 11 of the WIPO copyright treaty -adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention -of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of -technological measures to the extent such circumvention is effected by exercising -rights under this License with respect to the covered work, and you disclaim any -intention to limit operation or modification of the work as a means of enforcing, -against the work's users, your or third parties' legal rights to forbid circumvention -of technological measures. - -### 4. Conveying Verbatim Copies. - -You may convey verbatim copies of the Program's source code as you receive it, in any -medium, provided that you conspicuously and appropriately publish on each copy an -appropriate copyright notice; keep intact all notices stating that this License and -any non-permissive terms added in accord with section 7 apply to the code; keep -intact all notices of the absence of any warranty; and give all recipients a copy of -this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer -support or warranty protection for a fee. - -### 5. Conveying Modified Source Versions. - -You may convey a work based on the Program, or the modifications to produce it from -the Program, in the form of source code under the terms of section 4, provided that -you also meet all of these conditions: - -* **a)** The work must carry prominent notices stating that you modified it, and giving a -relevant date. -* **b)** The work must carry prominent notices stating that it is released under this -License and any conditions added under section 7. This requirement modifies the -requirement in section 4 to “keep intact all notices”. -* **c)** You must license the entire work, as a whole, under this License to anyone who -comes into possession of a copy. This License will therefore apply, along with any -applicable section 7 additional terms, to the whole of the work, and all its parts, -regardless of how they are packaged. This License gives no permission to license the -work in any other way, but it does not invalidate such permission if you have -separately received it. -* **d)** If the work has interactive user interfaces, each must display Appropriate Legal -Notices; however, if the Program has interactive interfaces that do not display -Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are -not by their nature extensions of the covered work, and which are not combined with -it such as to form a larger program, in or on a volume of a storage or distribution -medium, is called an “aggregate” if the compilation and its resulting -copyright are not used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work in an aggregate -does not cause this License to apply to the other parts of the aggregate. - -### 6. Conveying Non-Source Forms. - -You may convey a covered work in object code form under the terms of sections 4 and -5, provided that you also convey the machine-readable Corresponding Source under the -terms of this License, in one of these ways: - -* **a)** Convey the object code in, or embodied in, a physical product (including a -physical distribution medium), accompanied by the Corresponding Source fixed on a -durable physical medium customarily used for software interchange. -* **b)** Convey the object code in, or embodied in, a physical product (including a -physical distribution medium), accompanied by a written offer, valid for at least -three years and valid for as long as you offer spare parts or customer support for -that product model, to give anyone who possesses the object code either (1) a copy of -the Corresponding Source for all the software in the product that is covered by this -License, on a durable physical medium customarily used for software interchange, for -a price no more than your reasonable cost of physically performing this conveying of -source, or (2) access to copy the Corresponding Source from a network server at no -charge. -* **c)** Convey individual copies of the object code with a copy of the written offer to -provide the Corresponding Source. This alternative is allowed only occasionally and -noncommercially, and only if you received the object code with such an offer, in -accord with subsection 6b. -* **d)** Convey the object code by offering access from a designated place (gratis or for -a charge), and offer equivalent access to the Corresponding Source in the same way -through the same place at no further charge. You need not require recipients to copy -the Corresponding Source along with the object code. If the place to copy the object -code is a network server, the Corresponding Source may be on a different server -(operated by you or a third party) that supports equivalent copying facilities, -provided you maintain clear directions next to the object code saying where to find -the Corresponding Source. Regardless of what server hosts the Corresponding Source, -you remain obligated to ensure that it is available for as long as needed to satisfy -these requirements. -* **e)** Convey the object code using peer-to-peer transmission, provided you inform -other peers where the object code and Corresponding Source of the work are being -offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the -Corresponding Source as a System Library, need not be included in conveying the -object code work. - -A “User Product” is either (1) a “consumer product”, which -means any tangible personal property which is normally used for personal, family, or -household purposes, or (2) anything designed or sold for incorporation into a -dwelling. In determining whether a product is a consumer product, doubtful cases -shall be resolved in favor of coverage. For a particular product received by a -particular user, “normally used” refers to a typical or common use of -that class of product, regardless of the status of the particular user or of the way -in which the particular user actually uses, or expects or is expected to use, the -product. A product is a consumer product regardless of whether the product has -substantial commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - -“Installation Information” for a User Product means any methods, -procedures, authorization keys, or other information required to install and execute -modified versions of a covered work in that User Product from a modified version of -its Corresponding Source. The information must suffice to ensure that the continued -functioning of the modified object code is in no case prevented or interfered with -solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for -use in, a User Product, and the conveying occurs as part of a transaction in which -the right of possession and use of the User Product is transferred to the recipient -in perpetuity or for a fixed term (regardless of how the transaction is -characterized), the Corresponding Source conveyed under this section must be -accompanied by the Installation Information. But this requirement does not apply if -neither you nor any third party retains the ability to install modified object code -on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to -continue to provide support service, warranty, or updates for a work that has been -modified or installed by the recipient, or for the User Product in which it has been -modified or installed. Access to a network may be denied when the modification itself -materially and adversely affects the operation of the network or violates the rules -and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with -this section must be in a format that is publicly documented (and with an -implementation available to the public in source code form), and must require no -special password or key for unpacking, reading or copying. - -### 7. Additional Terms. - -“Additional permissions” are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. Additional -permissions that are applicable to the entire Program shall be treated as though they -were included in this License, to the extent that they are valid under applicable -law. If additional permissions apply only to part of the Program, that part may be -used separately under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any -additional permissions from that copy, or from any part of it. (Additional -permissions may be written to require their own removal in certain cases when you -modify the work.) You may place additional permissions on material, added by you to a -covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a -covered work, you may (if authorized by the copyright holders of that material) -supplement the terms of this License with terms: - -* **a)** Disclaiming warranty or limiting liability differently from the terms of -sections 15 and 16 of this License; or -* **b)** Requiring preservation of specified reasonable legal notices or author -attributions in that material or in the Appropriate Legal Notices displayed by works -containing it; or -* **c)** Prohibiting misrepresentation of the origin of that material, or requiring that -modified versions of such material be marked in reasonable ways as different from the -original version; or -* **d)** Limiting the use for publicity purposes of names of licensors or authors of the -material; or -* **e)** Declining to grant rights under trademark law for use of some trade names, -trademarks, or service marks; or -* **f)** Requiring indemnification of licensors and authors of that material by anyone -who conveys the material (or modified versions of it) with contractual assumptions of -liability to the recipient, for any liability that these contractual assumptions -directly impose on those licensors and authors. - -All other non-permissive additional terms are considered “further -restrictions” within the meaning of section 10. If the Program as you received -it, or any part of it, contains a notice stating that it is governed by this License -along with a term that is a further restriction, you may remove that term. If a -license document contains a further restriction but permits relicensing or conveying -under this License, you may add to a covered work material governed by the terms of -that license document, provided that the further restriction does not survive such -relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in -the relevant source files, a statement of the additional terms that apply to those -files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a -separately written license, or stated as exceptions; the above requirements apply -either way. - -### 8. Termination. - -You may not propagate or modify a covered work except as expressly provided under -this License. Any attempt otherwise to propagate or modify it is void, and will -automatically terminate your rights under this License (including any patent licenses -granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a -particular copyright holder is reinstated (a) provisionally, unless and until the -copyright holder explicitly and finally terminates your license, and (b) permanently, -if the copyright holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently -if the copyright holder notifies you of the violation by some reasonable means, this -is the first time you have received notice of violation of this License (for any -work) from that copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of -parties who have received copies or rights from you under this License. If your -rights have been terminated and not permanently reinstated, you do not qualify to -receive new licenses for the same material under section 10. - -### 9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run a copy of the -Program. Ancillary propagation of a covered work occurring solely as a consequence of -using peer-to-peer transmission to receive a copy likewise does not require -acceptance. However, nothing other than this License grants you permission to -propagate or modify any covered work. These actions infringe copyright if you do not -accept this License. Therefore, by modifying or propagating a covered work, you -indicate your acceptance of this License to do so. - -### 10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically receives a license -from the original licensors, to run, modify and propagate that work, subject to this -License. You are not responsible for enforcing compliance by third parties with this -License. - -An “entity transaction” is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an organization, or -merging organizations. If propagation of a covered work results from an entity -transaction, each party to that transaction who receives a copy of the work also -receives whatever licenses to the work the party's predecessor in interest had or -could give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if the predecessor -has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or -affirmed under this License. For example, you may not impose a license fee, royalty, -or other charge for exercise of rights granted under this License, and you may not -initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging -that any patent claim is infringed by making, using, selling, offering for sale, or -importing the Program or any portion of it. - -### 11. Patents. - -A “contributor” is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The work thus -licensed is called the contributor's “contributor version”. - -A contributor's “essential patent claims” are all patent claims owned or -controlled by the contributor, whether already acquired or hereafter acquired, that -would be infringed by some manner, permitted by this License, of making, using, or -selling its contributor version, but do not include claims that would be infringed -only as a consequence of further modification of the contributor version. For -purposes of this definition, “control” includes the right to grant patent -sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license -under the contributor's essential patent claims, to make, use, sell, offer for sale, -import and otherwise run, modify and propagate the contents of its contributor -version. - -In the following three paragraphs, a “patent license” is any express -agreement or commitment, however denominated, not to enforce a patent (such as an -express permission to practice a patent or covenant not to sue for patent -infringement). To “grant” such a patent license to a party means to make -such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the -Corresponding Source of the work is not available for anyone to copy, free of charge -and under the terms of this License, through a publicly available network server or -other readily accessible means, then you must either (1) cause the Corresponding -Source to be so available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner consistent with -the requirements of this License, to extend the patent license to downstream -recipients. “Knowingly relying” means you have actual knowledge that, but -for the patent license, your conveying the covered work in a country, or your -recipient's use of the covered work in a country, would infringe one or more -identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you -convey, or propagate by procuring conveyance of, a covered work, and grant a patent -license to some of the parties receiving the covered work authorizing them to use, -propagate, modify or convey a specific copy of the covered work, then the patent -license you grant is automatically extended to all recipients of the covered work and -works based on it. - -A patent license is “discriminatory” if it does not include within the -scope of its coverage, prohibits the exercise of, or is conditioned on the -non-exercise of one or more of the rights that are specifically granted under this -License. You may not convey a covered work if you are a party to an arrangement with -a third party that is in the business of distributing software, under which you make -payment to the third party based on the extent of your activity of conveying the -work, and under which the third party grants, to any of the parties who would receive -the covered work from you, a discriminatory patent license (a) in connection with -copies of the covered work conveyed by you (or copies made from those copies), or (b) -primarily for and in connection with specific products or compilations that contain -the covered work, unless you entered into that arrangement, or that patent license -was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied -license or other defenses to infringement that may otherwise be available to you -under applicable patent law. - -### 12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or otherwise) -that contradict the conditions of this License, they do not excuse you from the -conditions of this License. If you cannot convey a covered work so as to satisfy -simultaneously your obligations under this License and any other pertinent -obligations, then as a consequence you may not convey it at all. For example, if you -agree to terms that obligate you to collect a royalty for further conveying from -those to whom you convey the Program, the only way you could satisfy both those terms -and this License would be to refrain entirely from conveying the Program. - -### 13. Use with the GNU Affero General Public License. - -Notwithstanding any other provision of this License, you have permission to link or -combine any covered work with a work licensed under version 3 of the GNU Affero -General Public License into a single combined work, and to convey the resulting work. -The terms of this License will continue to apply to the part which is the covered -work, but the special requirements of the GNU Affero General Public License, section -13, concerning interaction through a network will apply to the combination as such. - -### 14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions of the GNU -General Public License from time to time. Such new versions will be similar in spirit -to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that -a certain numbered version of the GNU General Public License “or any later -version” applies to it, you have the option of following the terms and -conditions either of that numbered version or of any later version published by the -Free Software Foundation. If the Program does not specify a version number of the GNU -General Public License, you may choose any version ever published by the Free -Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU -General Public License can be used, that proxy's public statement of acceptance of a -version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no -additional obligations are imposed on any author or copyright holder as a result of -your choosing to follow a later version. - -### 15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -### 16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY -COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS -PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, -INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE -OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE -WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - -### 17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided above cannot be -given local legal effect according to their terms, reviewing courts shall apply local -law that most closely approximates an absolute waiver of all civil liability in -connection with the Program, unless a warranty or assumption of liability accompanies -a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS - -## How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to -the public, the best way to achieve this is to make it free software which everyone -can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them -to the start of each source file to most effectively state the exclusion of warranty; -and each file should have at least the “copyright” line and a pointer to -where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short notice like this -when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate parts of -the General Public License. Of course, your program's commands might be different; -for a GUI interface, you would use an “about box”. - -You should also get your employer (if you work as a programmer) or school, if any, to -sign a “copyright disclaimer” for the program, if necessary. For more -information on this, and how to apply and follow the GNU GPL, see -<>. - -The GNU General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may consider it -more useful to permit linking proprietary applications with the library. If this is -what you want to do, use the GNU Lesser General Public License instead of this -License. But first, please read -<>. +The MIT License (MIT) +===================== + +Copyright (c) 2014 Kodowa, Inc. & Light Table contributors + +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 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. From c55f44ee35d50622cc1cfe1adb566a01c672c671 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 7 Nov 2014 10:41:45 -0500 Subject: [PATCH 279/656] Encourage users to go the mailing list for questions A number of issues I've addressed in the past weeks were questions that had a better chance being answered in the mailing list than being a github issue. Most recently #1704. Also added a section on what to include on bug reports. --- CONTRIBUTING.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb38385bd..ec21824b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,21 @@ -#Contributing +# Help + +For questions and community discussion, please drop them in the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). + +# Bugs + +When filing a bug on GitHub, please help us help by including the following: + +* *Steps to reproduce the bug.* +* Your operating system, LT and relevant plugin versions. +* Relevant configuration in your user.keymap and user.behaviors. + +Note: The issue tracker is mainly for bugs. Questions should be asked on the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). + +# Contributing We'd love to have your contribution. Like with Clojure and other big OSS projects, we do require you to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. Also, if your pull request is going to require some effort, please discuss it with us first. We want your hard work to count. -#Plugins +# Plugins Many things are better off implemented as plugins to Light Table since plugins have the same degree of power that any code in the core does. This allows us to keep the base of Light Table small and manageable and foster a large ecosystem on a solid foundation. Instead of tracking feature/plugin requests in the core, we'll track them in the [wishlist](https://github.com/LightTable/LightTable/wiki/Feature-wishlist) part of the wiki. From 27355977e843d234394ea60ea4987375f00b751a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 7 Nov 2014 14:51:08 -0500 Subject: [PATCH 280/656] Fix remaining warnings that can be fixed Outstanding warning is caused by fetch. Did end up removing populate as it referred to a nonexistant function and couldn't have worked since it was imported --- src/lt/objs/context.cljs | 2 +- src/lt/objs/document.cljs | 3 ++- src/lt/objs/keyboard.cljs | 2 +- src/lt/objs/sidebar/navigate.cljs | 5 ----- src/lt/util/cljs.cljs | 2 +- src/lt/util/dom.cljs | 2 +- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index ab70da321..13e6f2d4f 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -51,7 +51,7 @@ (defn group! [ctx group] (swap! ctx->group assoc ctx group) - (swap! group->ctx update-in [group] conj ctx)) + (swap! group->ctxs update-in [group] conj ctx)) (defn ->obj [ctx] (@ctx->obj ctx)) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 4fb9a5889..89f57ddb5 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -2,7 +2,8 @@ (:require [lt.object :as object] [lt.objs.files :as files] [lt.objs.popup :as popup]) - (:require-macros [lt.macros :refer [behavior defui]])) + (:require-macros [lt.macros :refer [behavior defui]]) + (:refer-clojure :exclude [replace])) ;;*************************************************** diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index a44b637bb..4bea711c6 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -1,5 +1,5 @@ (ns lt.objs.keyboard - (:refer-clojure :exclude [keys]) + (:refer-clojure :exclude [keys meta]) (:require [clojure.string :as string] [lt.object :as object] [lt.objs.app :as app] diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index a881016bc..f16a73d39 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -19,11 +19,6 @@ (defn file-filters [f] (re-seq files/ignore-pattern f)) -(defn populate [ws] - (let [files (reduce grab-files [] (:folders ws)) - fs (map #(do {:full % :rel (files/basename %)}) (:files ws))] - (vec (filter #(files/file? (:full %)) (remove #(-> % :rel file-filters) (concat files fs)))))) - (def populate-bg (background (fn [obj-id {:keys [lim pattern ws]}] (let [fs (js/require "fs") fpath (js/require "path") diff --git a/src/lt/util/cljs.cljs b/src/lt/util/cljs.cljs index 366e572ec..266145011 100644 --- a/src/lt/util/cljs.cljs +++ b/src/lt/util/cljs.cljs @@ -1,5 +1,5 @@ (ns lt.util.cljs - (:refer-clojure :exclude [js->clj]) + (:refer-clojure :exclude [js->clj clj->js]) (:require [clojure.string :as string])) (set! *print-fn* (fn [x] diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index c9e8937e6..e9c0ba8b6 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -1,5 +1,5 @@ (ns lt.util.dom - (:refer-clojure :exclude [parents remove next val])) + (:refer-clojure :exclude [parents remove next val empty])) (defn lazy-nl-via-item ([nl] (lazy-nl-via-item nl 0)) From c9b71a1bde84e24f618b7dfa972e16f9046af49c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 7 Nov 2014 15:16:09 -0500 Subject: [PATCH 281/656] Fix inline-exception warning properly --- src/lt/objs/eval.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 8add95f75..5896d80f5 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -433,7 +433,8 @@ :triggers #{:click :double-click :clear!} :tags #{:inline :inline.exception} :init (fn [this info] - (if (-> info :loc :line) + (if-not (-> info :loc :line) + (notifos/set-msg! (str (:ex info)) {:class "error"}) (let [content (->inline-exception this info)] (object/merge! this (assoc info :widget (ed/line-widget (ed/->cm-ed (:ed info)) From 8b5d1a8d1b9b93fd48d252b20317e5ac53275eca Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 25 Oct 2014 16:42:30 +0200 Subject: [PATCH 282/656] DRY: comment/uncomment/toggle-comment --- src/lt/objs/editor.cljs | 11 ++++++----- src/lt/objs/editor/pool.cljs | 33 +++++++++++++-------------------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 484cad9bb..8e3e28f74 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -364,11 +364,12 @@ (defn line-comment [e from to opts] (.lineComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) -(defn uncomment - ([e from to] - (uncomment e from to nil)) - ([e from to opts] - (.uncomment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts)))) +(defn uncomment [e from to opts] + (.uncomment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) + +(defn toggle-comment [e from to opts] + (when-not (uncomment e from to opts) + (line-comment e from to opts))) (defn ->generation [e] (.changeGeneration (->cm-ed e))) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index f0d1726af..2820fe4ff 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -258,34 +258,27 @@ :reaction (fn [this options] (object/merge! this {::comment-options options}))) +(defn do-commenting [commenting-fn] + (fn [] + (when-let [cur (last-active)] + (let [from (editor/->cursor cur "start") + to (if (editor/selection? cur) + (editor/->cursor cur "end") + from) + options (::comment-options @cur)] + (commenting-fn cur from to options))))) + (cmd/command {:command :comment-selection :desc "Editor: Comment line(s)" - :exec (fn [] - (when-let [cur (last-active)] - (let [cursor (editor/->cursor cur "start")] - (if (editor/selection? cur) - (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)) - (editor/line-comment cur cursor cursor (::comment-options @cur))))))}) + :exec (do-commenting editor/line-comment)}) (cmd/command {:command :uncomment-selection :desc "Editor: Uncomment line(s)" - :exec (fn [] - (when-let [cur (last-active)] - (let [cursor (editor/->cursor cur "start")] - (if (editor/selection? cur) - (editor/uncomment cur cursor (editor/->cursor cur "end")) - (editor/uncomment cur cursor cursor)))))}) + :exec (do-commenting editor/uncomment)}) (cmd/command {:command :toggle-comment-selection :desc "Editor: Toggle comment line(s)" - :exec (fn [] - (when-let [cur (last-active)] - (let [cursor (editor/->cursor cur "start") - [start end] (if (editor/selection? cur) - [cursor (editor/->cursor cur "end")] - [cursor cursor])] - (when-not (editor/uncomment cur start end) - (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur))))))}) + :exec (do-commenting editor/toggle-comment)}) (cmd/command {:command :indent-selection :desc "Editor: Indent line(s)" From 251a1a02b3a469c0fe8a36d13c61b27d153e5a49 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 8 Nov 2014 13:29:43 -0500 Subject: [PATCH 283/656] Update contributing to pull in contributing intro Also expanded Plugins section into a more actionable Feature Requests section. --- CONTRIBUTING.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec21824b0..c33854e30 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ For questions and community discussion, please drop them in the [Light Table Goo # Bugs -When filing a bug on GitHub, please help us help by including the following: +When filing a bug on GitHub, please help us help you by including the following: * *Steps to reproduce the bug.* * Your operating system, LT and relevant plugin versions. @@ -12,10 +12,27 @@ When filing a bug on GitHub, please help us help by including the following: Note: The issue tracker is mainly for bugs. Questions should be asked on the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). +# Feature Requests + +If a feature is specific to a library, language or is something that is normally a plugin in other editors, please add it to [the wishlist](https://github.com/LightTable/LightTable/wiki/Feature-wishlist). +For other features, feel free to discuss in an issue. Be aware that Light Table has a plugin system that has the same degree of power that any core code does. This means that as a user, you usually have the ability to add any feature you desire without waiting on Light Table to implement it! Having such a powerful plugin system allows us to keep a small, well maintained LightTable core while encouraging a large ecosystem of plugins. + # Contributing -We'd love to have your contribution. Like with Clojure and other big OSS projects, we do require you to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. Also, if your pull request is going to require some effort, please discuss it with us first. We want your hard work to count. +Hello! Thanks for your interest in LightTable. Things you can do to make LightTable even more awesome :sunrise: :koala: :exclamation:: + +* `Answering issues`: See the [answering issues guide](https://github.com/LightTable/LightTable/wiki/For-Contributors#answering-issues). +* `Code contributions`: See [section below](#code-contributions). +* `Improving docs`: Check out [these documentation issues](https://github.com/LightTable/docs.lighttable.com/issues). Reading the [official docs](http://docs.lighttable.com/) and checking for errors, typos, etc. would also be great. + +## Code Contributions + +If it's your first time contributing, we'd love to have you :). We require contributors to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. + +When contributing: -# Plugins +* [Check out issues](https://github.com/LightTable/LightTable/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner) that are ready to be worked on. Feel free to ping a contributor if you need help along the way. +* For any other contributions, please discuss with us as early as possible. We want your hard work to count. +* Please add docstrings to non-trivial functions that are added. Most existing code doesn't have this but we'd like to improve this. +* We are not currently seeking refactoring contributions or code convention tweaks e.g. whitespace. This may change at a later point when we have automated tests and an explicit code convention. -Many things are better off implemented as plugins to Light Table since plugins have the same degree of power that any code in the core does. This allows us to keep the base of Light Table small and manageable and foster a large ecosystem on a solid foundation. Instead of tracking feature/plugin requests in the core, we'll track them in the [wishlist](https://github.com/LightTable/LightTable/wiki/Feature-wishlist) part of the wiki. From 82fe8cbfc8001c550182b8ae900c022d003e46c5 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 8 Nov 2014 23:48:30 -0500 Subject: [PATCH 284/656] Add quote pair, close #1556 --- deploy/settings/default/default.keymap | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index ad9f2d382..80b083b4f 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -18,6 +18,7 @@ "ctrl-d" [:editor.doc.toggle] "ctrl-=" [:editor.fold-code]} :editor.keys.normal {"\"" [(:editor.repeat-pair "\"")] + "'" [(:editor.repeat-pair "'")] "(" [(:editor.open-pair "(")] ")" [(:editor.close-pair ")")] "pmeta-f" [:find.fill-selection From aaf5e346246a8a40e19dfce82e4ec5125bd0bd74 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 9 Nov 2014 01:59:19 -0500 Subject: [PATCH 285/656] Fixed first-time copy of user.cljs First-time copy of a user.cljs was currently misplaced causing issues when behaviors were loaded. Moving it to pre-load resolved this. Also tweaked command description per feedback --- deploy/settings/default/default.behaviors | 1 - src/lt/objs/settings.cljs | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index ec48950cb..ff06011e5 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -2,7 +2,6 @@ :+ {:app [:lt.objs.cache/init :lt.objs.settings/load-behaviors - :lt.objs.settings/create-user-settings :lt.objs.proc/set-path-OSX :lt.objs.workspace/reconstitute-last-workspace :lt.objs.sidebar.command/init-commands diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ac6d107f8..1dc14e7f4 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -244,7 +244,7 @@ (def user-plugin-dir (files/lt-user-dir "settings")) (behavior ::create-user-settings - :triggers #{:init} + :triggers #{:pre-load} :reaction (fn [app] (doseq [path user-plugin-paths] (let [full-path (files/join user-plugin-dir path)] @@ -301,7 +301,7 @@ (cmd/exec! :open-path (files/lt-home "/settings/default/default.keymap")))}) (cmd/command {:command :user.modify-user - :desc "Settings: User clojurescript" + :desc "Settings: User script" :exec (fn [] (cmd/exec! :open-path user-cljs-path))}) @@ -354,4 +354,4 @@ ;;This call to tag-behaviors is necessary as there are no behaviors loaded when the ;;app is first run. -(object/tag-behaviors :app [::initial-behaviors ::load-behaviors ::default-behavior-diffs ::user-behavior-diffs ::default-keymap-diffs ::user-keymap-diffs]) +(object/tag-behaviors :app [::initial-behaviors ::create-user-settings ::load-behaviors ::default-behavior-diffs ::user-behavior-diffs ::default-keymap-diffs ::user-keymap-diffs]) From 0542c1cb2cccb323faaed3e3ad63dbeec4c0a09f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 9 Nov 2014 15:04:32 -0500 Subject: [PATCH 286/656] Rename settings/ to User/ and truly fix copying user plugin Although the previous commit worked, it was by chance since create-user-plugin and init-plugins were triggering off the same trigger. --- deploy/core/{settings => User}/plugin.edn | 0 deploy/core/{settings => User}/project.clj | 0 .../src/lt/plugins/user.cljs | 0 deploy/core/{settings => User}/user.behaviors | 0 deploy/core/{settings => User}/user.keymap | 0 .../core/{settings => User}/user_compiled.js | 0 src/lt/objs/plugins.cljs | 1 + src/lt/objs/settings.cljs | 31 +++++++++++-------- 8 files changed, 19 insertions(+), 13 deletions(-) rename deploy/core/{settings => User}/plugin.edn (100%) rename deploy/core/{settings => User}/project.clj (100%) rename deploy/core/{settings => User}/src/lt/plugins/user.cljs (100%) rename deploy/core/{settings => User}/user.behaviors (100%) rename deploy/core/{settings => User}/user.keymap (100%) rename deploy/core/{settings => User}/user_compiled.js (100%) diff --git a/deploy/core/settings/plugin.edn b/deploy/core/User/plugin.edn similarity index 100% rename from deploy/core/settings/plugin.edn rename to deploy/core/User/plugin.edn diff --git a/deploy/core/settings/project.clj b/deploy/core/User/project.clj similarity index 100% rename from deploy/core/settings/project.clj rename to deploy/core/User/project.clj diff --git a/deploy/core/settings/src/lt/plugins/user.cljs b/deploy/core/User/src/lt/plugins/user.cljs similarity index 100% rename from deploy/core/settings/src/lt/plugins/user.cljs rename to deploy/core/User/src/lt/plugins/user.cljs diff --git a/deploy/core/settings/user.behaviors b/deploy/core/User/user.behaviors similarity index 100% rename from deploy/core/settings/user.behaviors rename to deploy/core/User/user.behaviors diff --git a/deploy/core/settings/user.keymap b/deploy/core/User/user.keymap similarity index 100% rename from deploy/core/settings/user.keymap rename to deploy/core/User/user.keymap diff --git a/deploy/core/settings/user_compiled.js b/deploy/core/User/user_compiled.js similarity index 100% rename from deploy/core/settings/user_compiled.js rename to deploy/core/User/user_compiled.js diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 4c689d7bd..2d9a48c81 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -615,6 +615,7 @@ :reaction (fn [app] (when-not (files/exists? user-plugins-dir) (files/mkdir user-plugins-dir)) + (object/raise app/app :create-user-plugin) ;;load enabled plugins (object/merge! app/app {::plugins (available-plugins)}))) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 1dc14e7f4..2b5a36118 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -179,14 +179,14 @@ (behavior ::user-behavior-diffs :triggers #{:behaviors.diffs.user+} :reaction (fn [this diffs] - (concat diffs (behavior-diffs-in (files/lt-user-dir "settings/"))) + (concat diffs (behavior-diffs-in (files/lt-user-dir "User/"))) )) (behavior ::initial-behaviors :triggers #{:pre-init} :reaction (fn [this] - (when-not (files/exists? (files/lt-user-dir "settings")) - (files/mkdir (files/lt-user-dir "settings"))) + (when-not (files/exists? (files/lt-user-dir "User")) + (files/mkdir (files/lt-user-dir "User"))) (object/raise this :pre-load) ;;Load all the behaviors (load-all) @@ -237,20 +237,25 @@ (object/raise editor :clean) (object/raise workspace/current-ws :serialize!)))) -(def user-behaviors-path (files/lt-user-dir "settings/user.behaviors")) -(def user-keymap-path (files/lt-user-dir "settings/user.keymap")) -(def user-cljs-path (files/lt-user-dir "settings/src/lt/plugins/user.cljs")) +(def user-behaviors-path (files/lt-user-dir "User/user.behaviors")) +(def user-keymap-path (files/lt-user-dir "User/user.keymap")) +(def user-cljs-path (files/lt-user-dir "User/src/lt/plugins/user.cljs")) (def user-plugin-paths ["user.behaviors" "user.keymap" "src" "project.clj" "plugin.edn" "user_compiled.js"]) -(def user-plugin-dir (files/lt-user-dir "settings")) +(def user-plugin-dir (files/lt-user-dir "User")) -(behavior ::create-user-settings - :triggers #{:pre-load} +(behavior ::create-user-plugin + :triggers #{:create-user-plugin} :reaction (fn [app] (doseq [path user-plugin-paths] (let [full-path (files/join user-plugin-dir path)] (when-not (files/exists? full-path) - (files/copy (files/lt-home (files/join "core" "settings" path)) - full-path)))))) + (if (and (contains? #{"user.behaviors" "user.keymap"} path) + (files/exists? (files/lt-user-dir (str "/settings/" path)))) + ;; Copy over files from previous user dir + (files/copy (files/lt-user-dir (str "/settings/" path)) + full-path) + (files/copy (files/lt-home (files/join "core" "User" path)) + full-path))))))) ;;********************************************************* ;; Commands @@ -337,7 +342,7 @@ (behavior ::user-keymap-diffs :triggers #{:keymap.diffs.user+} :reaction (fn [this diffs] - (concat diffs (keymap-diffs-in (files/lt-user-dir "/settings/"))) + (concat diffs (keymap-diffs-in (files/lt-user-dir "/User/"))) )) (behavior ::on-behaviors-editor-save @@ -354,4 +359,4 @@ ;;This call to tag-behaviors is necessary as there are no behaviors loaded when the ;;app is first run. -(object/tag-behaviors :app [::initial-behaviors ::create-user-settings ::load-behaviors ::default-behavior-diffs ::user-behavior-diffs ::default-keymap-diffs ::user-keymap-diffs]) +(object/tag-behaviors :app [::initial-behaviors ::create-user-plugin ::load-behaviors ::default-behavior-diffs ::user-behavior-diffs ::default-keymap-diffs ::user-keymap-diffs]) From 8f1a43588434c0840af69af28c4e785bef3a8021 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 9 Nov 2014 15:25:58 -0500 Subject: [PATCH 287/656] Dry up references to user plugin dir --- src/lt/objs/settings.cljs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 2b5a36118..9d77ae196 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -176,17 +176,19 @@ (concat diffs (behavior-diffs-in (files/lt-home "settings/default/"))) )) + +(def user-plugin-dir (files/lt-user-dir "User")) + (behavior ::user-behavior-diffs :triggers #{:behaviors.diffs.user+} :reaction (fn [this diffs] - (concat diffs (behavior-diffs-in (files/lt-user-dir "User/"))) - )) + (concat diffs (behavior-diffs-in user-plugin-dir)))) (behavior ::initial-behaviors :triggers #{:pre-init} :reaction (fn [this] - (when-not (files/exists? (files/lt-user-dir "User")) - (files/mkdir (files/lt-user-dir "User"))) + (when-not (files/exists? user-plugin-dir) + (files/mkdir user-plugin-dir)) (object/raise this :pre-load) ;;Load all the behaviors (load-all) @@ -237,11 +239,10 @@ (object/raise editor :clean) (object/raise workspace/current-ws :serialize!)))) -(def user-behaviors-path (files/lt-user-dir "User/user.behaviors")) -(def user-keymap-path (files/lt-user-dir "User/user.keymap")) -(def user-cljs-path (files/lt-user-dir "User/src/lt/plugins/user.cljs")) +(def user-behaviors-path (files/join user-plugin-dir "user.behaviors")) +(def user-keymap-path (files/join user-plugin-dir "user.keymap")) +(def user-cljs-path (files/join user-plugin-dir "src" "lt" "plugins" "user.cljs")) (def user-plugin-paths ["user.behaviors" "user.keymap" "src" "project.clj" "plugin.edn" "user_compiled.js"]) -(def user-plugin-dir (files/lt-user-dir "User")) (behavior ::create-user-plugin :triggers #{:create-user-plugin} @@ -342,8 +343,7 @@ (behavior ::user-keymap-diffs :triggers #{:keymap.diffs.user+} :reaction (fn [this diffs] - (concat diffs (keymap-diffs-in (files/lt-user-dir "/User/"))) - )) + (concat diffs (keymap-diffs-in user-plugin-dir)))) (behavior ::on-behaviors-editor-save :triggers #{:saved} From 55e5ad64ac8543266ff46eb278f79076328d0b44 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 11 Nov 2014 14:22:19 -0800 Subject: [PATCH 288/656] track down the nw11 white screen bug Signed-off-by: Chris Granger --- deploy/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/package.json b/deploy/package.json index c2f6fd28a..4ba77ef67 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -7,7 +7,7 @@ "webkit": { "plugin": true }, - "chromium-args" : "--disable-threaded-compositing --enable-smooth-scrolling --disable-accelerated-video --enable-webgl --enable-webaudio --ignore-gpu-blacklist --force-compositing-mode --remote-debugging-port=10138 --harmony --enable-devtools-experiments --enable-experimental-web-platform-features --enable-experimental-webkit-features", + "chromium-args" : "--enable-smooth-scrolling --disable-accelerated-video --enable-webgl --enable-webaudio --ignore-gpu-blacklist --force-compositing-mode --remote-debugging-port=10138 --harmony", "window": { "icon": "core/img/lticon.png", "width": 1024, @@ -15,7 +15,7 @@ "min_height": 400, "min_width": 400, "position": "center", - "show":false, + "show": false, "toolbar": false, "frame": true } From 3f900b4266809ae142f4b34d62b86170b97674b8 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 13 Nov 2014 00:42:44 -0800 Subject: [PATCH 289/656] remove the need for the plugin server Signed-off-by: Chris Granger --- deploy/settings/default/default.behaviors | 5 +- src/lt/objs/plugins.cljs | 256 +++++++++++++++------- 2 files changed, 176 insertions(+), 85 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index ff06011e5..3b01f47ba 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -330,7 +330,10 @@ :lt.objs.plugins/render-installed-plugins :lt.objs.plugins/render-server-plugins :lt.objs.plugins/submit-plugin - :lt.objs.plugins/update-server-plugins] + :lt.objs.plugins/draw-plugins-on-updated + :lt.objs.plugins/get-latest-metadata-sha + :lt.objs.plugins/check-metadata-sha + :lt.objs.plugins/check-local-metadata-cache] :popup [:lt.objs.popup/refocus-on-close :lt.objs.popup/close! :lt.objs.popup/on-click-destroy diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 2d9a48c81..0dcfab762 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -129,7 +129,7 @@ (seq)))) (defn outdated? [plugin] - (let [cached (-> @manager :version-cache (get (:name plugin)))] + (let [cached (-> @manager :server-plugins (get (:name plugin)) :latest-version)] (if cached (deploy/is-newer? (:version plugin) cached)))) @@ -175,6 +175,127 @@ [:div (reduce str (interpose " => " cycle))])) +;;********************************************************* +;; Metadata +;;********************************************************* + +(declare install-failed) + +(def metadata-commits "https://api.github.com/repos/LightTable/plugin-metadata/commits") +(def metadata-download "https://api.github.com/repos/LightTable/plugin-metadata/tarball/master") +(def metadata-dir (files/lt-user-dir "metadata")) +(def metadata-cache (files/join metadata-dir "cache.json")) + +(defn version-sort [a b] + (cond + (= a b) 0 + (deploy/is-newer? a b) 1 + :else -1)) + +(defn build-cache [sha] + (let [items (filter files/dir? (files/full-path-ls metadata-dir)) + cache (into {:__sha sha} + (for [plugin items + :let [versions (->> (files/full-path-ls plugin) + (filter files/dir?) + (map plugin-info) + (sort-by #(version-sort % %2)) + (vec)) + latest (last versions)]] + [(:name latest) {:versions (into {} (map (juxt :version identity) versions)) + :latest-version (:version latest)}] + ))] + cache)) + +(defn save-cache [cache] + (files/save metadata-cache (JSON/stringify (clj->js cache)))) + +(defn latest-metadata-sha [] + (fetch/xhr [:get metadata-commits] {} + (fn [data] + (let [parsed (js/JSON.parse data) + sha (-> (aget parsed 0) + (aget "sha"))] + (object/raise manager :metadata.sha sha))))) + +(defn download-metadata [sha] + (let [tmp-gz (files/lt-user-dir "metadata-temp.tar.gz") + tmp-dir (files/lt-user-dir "metadata-temp")] + (notifos/working "Updating plugin metadata") + (deploy/download-file metadata-download tmp-gz (fn [] + (deploy/untar tmp-gz tmp-dir + (fn [] + (notifos/done-working) + (let [munged-dir (first (files/full-path-ls tmp-dir))] + (when munged-dir + (when (files/exists? metadata-dir) + (files/delete! metadata-dir)) + (files/move! munged-dir metadata-dir)) + (files/delete! tmp-dir) + (files/delete! tmp-gz) + (if munged-dir + (do + (save-cache (build-cache sha)) + (notifos/done-working (str "Plugin metadata updated. ")) + (object/raise manager :metadata.updated)) + (install-failed "metadata"))))))))) + +(defn read-cache [] + (if (files/exists? metadata-cache) + (-> (files/open-sync metadata-cache) + (:content) + (JSON/parse) + (js->clj :keywordize-keys true)))) + +(defn search-plugins [plugins search] + (let [search (.toLowerCase search)] + (filter (fn [plugin] + (or (> (.indexOf (.toLowerCase (:name plugin "")) search) -1) + (> (.indexOf (.toLowerCase (:author plugin "")) search) -1) + (> (.indexOf (.toLowerCase (:desc plugin "")) search) -1))) + plugins))) + + +(defn latest-version-merge [neue old] + (let [neue (seq neue)] + (reduce + (fn [final [name ver]] + (if-let [cur-ver (-> name final :version)] + (if (deploy/is-newer? ver cur-ver) + (assoc final name ver) + final) + (assoc final name ver))) + old + neue))) + +(defn transitive-deps [plugins [name ver] seen] + (let [name (keyword name)] + (if-let [cur (get-in plugins [name :versions (keyword ver)])] + (let [deps (-> cur :dependencies) + unique (remove seen (keys deps)) + seen (latest-version-merge {name cur} seen)] + (reduce + (fn [seen cur] + (transitive-deps plugins cur seen)) + seen + (select-keys deps unique))) + seen))) + +(defn all-latest [plugins] + (->> (dissoc plugins :__sha) + (vals) + (map #(get (:versions %) (keyword (:latest-version %)))))) + +;; (plugin->tar (:Rainbow (transitive-deps (:server-plugins @manager) ["Rainbow" "0.0.8"] {}))) +;; (save-cache (build-cache)) +;; (object/raise manager :plugin-results (vals (read-cache))) +;; (object/merge! manager {:server-plugins (read-cache)}) + + +;; (build-cache) + +;; (download-metadata "foo") + ;;********************************************************* ;; Plugin install/uninstall ;;********************************************************* @@ -185,6 +306,13 @@ (object/update! app/app [::plugins] dissoc name)) (notifos/done-working (str "Plugin install failed for: " name))) +(defn plugin->tar [plugin] + (let [[repo username] (->> (string/split (:source plugin) "/") + (reverse) + (filter #(not= % "")) + (take 2))] + (str "https://api.github.com/repos/" username "/" repo "/tarball/" (:version plugin)))) + (defn fetch-and-install [url name cb] (let [munged-name (munge-plugin-name name) tmp-gz (str user-plugins-dir "/" munged-name "-tmp.tar.gz") @@ -212,7 +340,7 @@ (install-failed name))))))))) (defn install-version [plugin cb] - (let [name (-> plugin :info :name) + (let [name (-> plugin :name) ver (-> plugin :version) installed? (-> @app/app ::plugins (get name))] (if (or (not installed?) @@ -220,7 +348,7 @@ (deploy/is-newer? (:version installed?) ver))) (do (object/update! app/app [::plugins] assoc name {}) - (fetch-and-install (-> plugin :tar) name + (fetch-and-install (plugin->tar plugin) name (fn [] (when cb (cb true)) @@ -231,7 +359,7 @@ (cb false)))))) (defn transitive-install [plugin deps cb] - (let [cur (or (-> plugin :name) (-> plugin :info :name)) + (let [cur (-> plugin :name keyword) others (dissoc deps cur) counter (atom (count others)) count-down (fn [] @@ -249,13 +377,10 @@ (count-down)))) (defn discover-deps [plugin cb] - (fetch/xhr [:post (str plugins-url "/install")] {:name (or (-> plugin :name) (-> plugin :info :name)) - :version (or (-> plugin :version) - (-> plugin :info :version))} - (fn [data] - (if-not (and data (seq data)) - (install-failed (or (-> plugin :name) (-> plugin :info :name))) - (transitive-install plugin (EOF-read data) cb))))) + (let [deps (transitive-deps (:server-plugins @manager) [(:name plugin) (:version plugin)] {})] + (if-not (seq deps) + (install-failed (:name plugin)) + (transitive-install plugin deps cb)))) (defn install-missing [missing] (let [counter (atom (count missing)) @@ -305,8 +430,9 @@ final)) (defn uninstall [plugin] - (files/delete! (:dir plugin)) - (object/raise manager :refresh!)) + (when (:dir plugin) + (files/delete! (:dir plugin)) + (object/raise manager :refresh!))) ;;********************************************************* ;; Manager ui @@ -319,23 +445,6 @@ :blur (fn [] (ctx/out! :popup.input))) -(defn submit-url [] - (let [input (url-input) - p (popup/popup! {:header "Submit a plugin to the central repository" - :body [:div - [:p "You can submit a github url to add a plugin to the central repository. - All plugin repos must have at least one tag in version format X.X.X , e.g. 0.1.2 and must have a plugin.json or plugin.edn - with name, version, desc, and behaviors keys. To refresh the available versions, just resubmit the plugin."] - [:label "Github URL for plugin: "] - input - ] - :buttons [{:label "cancel"} - {:label "submit" - :action (fn [] - (object/raise manager :submit-plugin! (dom/val input)))}]})] - (dom/focus input) - (.setSelectionRange input 1000 1000))) - (defui tab [this tab-name label] [:button {:class (bound this #(when (= tab-name (:tab %)) "active"))} @@ -384,7 +493,7 @@ (dom/stop-propagation e))) (defui server-plugin-ui [plugin] - (let [info (:info plugin) + (let [info plugin ver (:version info) installed (-> @app/app ::plugins (get (:name info))) update? (and (:version installed) @@ -414,7 +523,7 @@ {:label "Cancel"}]}))) (defui installed-plugin-ui [plugin] - (let [cached (-> @manager :version-cache (get (:name plugin))) + (let [cached (-> @manager :server-plugins (get (:name plugin)) :latest-version) update? (when cached (deploy/is-newer? (:version plugin) cached))] [:li {:class (if update? @@ -437,6 +546,7 @@ :name "Plugins" :tab :installed :init (fn [this] + (object/merge! this {:server-plugins (read-cache)}) [:div {:class (bound this #(str "plugin-manager" (if (= (:tab %) :server) " server")))} @@ -447,27 +557,33 @@ (def manager (object/create ::plugin-manager)) + + ;;********************************************************* ;; Manager behaviors ;;********************************************************* -(behavior ::update-server-plugins +(behavior ::check-local-metadata-cache + :triggers #{:metadata.sha} + :desc "Plugin Manager: check local metadata cache for update" + :reaction (fn [this sha] + (if-not (= (-> @this :server-plugins :__sha) sha) + (download-metadata sha) + (object/raise this :metadata.updated)))) + +(behavior ::draw-plugins-on-updated + :triggers #{:metadata.updated} + :desc "Plugin Manager: draw plugins on metadata update" + :reaction (fn [this sha] + (object/merge! this {:server-plugins (read-cache)}) + (object/raise this :plugin-results (all-latest (:server-plugins @this))))) + +(behavior ::get-latest-metadata-sha :triggers #{:fetch-plugins} - :desc "Plugin Manager: fetch plugins" - :reaction (fn [this] - (notifos/working "Fetching available plugins...") - (fetch/xhr [:post (str plugins-url "/versions")] {:names (pr-str (-> @app/app ::plugins keys vec))} - (fn [data] - (let [cache (EOF-read data)] - (when-not (= cache (:version-cache @this)) - (object/merge! this {:version-cache cache}) - (object/raise this :refresh!))))) - (fetch/xhr [:get plugins-url] {} - (fn [data] - (notifos/done-working "") - (when data - (object/raise this :plugin-results (EOF-read data))) - )))) + :desc "Plugin Manager: get the latest metadata sha" + :reaction (fn [this sha] + (latest-metadata-sha))) + (behavior ::render-server-plugins :triggers #{:plugin-results} @@ -475,44 +591,21 @@ :reaction (fn [this plugins] (let [ul (dom/$ :.server-plugins (object/->content this))] (dom/empty ul) - (->> (remove #(installed? (-> % :info :name)) plugins) + (->> (remove #(installed? (-> % :fname)) plugins) (map server-plugin-ui) (dom/fragment) (dom/append ul))))) -(behavior ::submit-plugin - :triggers #{:submit-plugin!} - :desc "Plugin Manager: submit a new plugin" - :reaction (fn [this url] - (notifos/working (str "Submitting plugin: " url)) - (fetch/xhr [:post (str plugins-url "/add" )] {:url url} - (fn [data] - (notifos/done-working "") - (let [data (EOF-read data)] - (popup/popup! {:header (condp = (:status data) - :success "Plugin added!" - :error "There's a problem with the plugin." - :refresh "Plugin refreshed!") - :body [:div - (if (= (:status data) :error) - [:div "Url submitted: " url]) - [:p (:description data)]] - :buttons [{:label "ok"}]})))))) - (behavior ::search-server-plugins :triggers #{:search-plugins!} :desc "Plugin Manager: search plugins" :reaction (fn [this search] - (if (empty? search) - (object/raise this :fetch-plugins) - (do - (notifos/working (str "Searching plugins for: " search)) - (fetch/xhr [:post (str plugins-url "/search")] {:term search} - (fn [data] - (notifos/done-working "") - (when data - (object/raise this :plugin-results (EOF-read data))) - )))))) + (let [plugins (all-latest (:server-plugins @manager))] + (object/raise this + :plugin-results + (if (empty? search) + plugins + (search-plugins plugins search)))))) (defn save-plugins [plugin-maps] (let [plugin-edn-file (files/join settings/user-plugin-dir "plugin.edn") @@ -560,11 +653,6 @@ ;; Manager commands ;;********************************************************* -(cmd/command {:command :plugin-manager.submit - :desc "Plugins: Submit a plugin" - :exec (fn [] - (submit-url))}) - (cmd/command {:command :plugin-manager.search :hidden true :desc "Plugins: Search" @@ -594,7 +682,7 @@ countdown (atom (count outdated))] (doseq [plugin outdated :when (seq outdated) - :let [cached (-> @manager :version-cache (get (:name plugin)))]] + :let [cached (-> @manager :server-plugins (get (:name plugin)) :latest-version)]] (discover-deps (assoc plugin :version cached) (fn [] (swap! names conj (:name plugin)) From c1940a2b5ff1e4d4eb539a1e13bc81fac1962def Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 13 Nov 2014 00:46:48 -0800 Subject: [PATCH 290/656] remove hack to allow installed plugins to show in available Signed-off-by: Chris Granger --- src/lt/objs/plugins.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 0dcfab762..41735f1da 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -591,7 +591,7 @@ :reaction (fn [this plugins] (let [ul (dom/$ :.server-plugins (object/->content this))] (dom/empty ul) - (->> (remove #(installed? (-> % :fname)) plugins) + (->> (remove #(installed? (-> % :name)) plugins) (map server-plugin-ui) (dom/fragment) (dom/append ul))))) From 8e435a28954b897c7c0aa1ac0e81a0fa462e247e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 13 Nov 2014 17:56:58 -0500 Subject: [PATCH 291/656] Contributing tweaks - link to tutorial, mention irc and wording tweaks --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c33854e30..0e87fc039 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Help -For questions and community discussion, please drop them in the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). +For questions and community discussion, please drop them in the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). Also check out #lighttable in Freenode IRC. # Bugs @@ -15,11 +15,11 @@ Note: The issue tracker is mainly for bugs. Questions should be asked on the [Li # Feature Requests If a feature is specific to a library, language or is something that is normally a plugin in other editors, please add it to [the wishlist](https://github.com/LightTable/LightTable/wiki/Feature-wishlist). -For other features, feel free to discuss in an issue. Be aware that Light Table has a plugin system that has the same degree of power that any core code does. This means that as a user, you usually have the ability to add any feature you desire without waiting on Light Table to implement it! Having such a powerful plugin system allows us to keep a small, well maintained LightTable core while encouraging a large ecosystem of plugins. +For other features, feel free to discuss in an issue. Be aware that Light Table has a plugin system that has the same degree of power that any core code does. This means that as a user, you usually have the ability to add any feature you desire without waiting on Light Table to implement it! Having such a powerful plugin system allows us to keep a small, well maintained Light Table core while encouraging a large ecosystem of plugins. # Contributing -Hello! Thanks for your interest in LightTable. Things you can do to make LightTable even more awesome :sunrise: :koala: :exclamation:: +Hello! Thanks for your interest in Light Table. Things you can do to make Light Table even more awesome :sunrise: :koala: :exclamation: * `Answering issues`: See the [answering issues guide](https://github.com/LightTable/LightTable/wiki/For-Contributors#answering-issues). * `Code contributions`: See [section below](#code-contributions). @@ -27,7 +27,7 @@ Hello! Thanks for your interest in LightTable. Things you can do to make LightTa ## Code Contributions -If it's your first time contributing, we'd love to have you :). We require contributors to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. +If it's your first time contributing, we'd love to have you :). Be sure to check out our [contributing tutorial](https://github.com/LightTable/LightTable/wiki/First-Contribution). We require contributors to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. When contributing: From 087f3663b923ad94578cf42fe6094594fe8df718 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 13 Nov 2014 23:06:55 -0800 Subject: [PATCH 292/656] handle failure better Signed-off-by: Chris Granger --- src/lt/objs/plugins.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 41735f1da..a6bfcc725 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -95,9 +95,13 @@ (defn plugin-edn [dir] (when-let [content (files/open-sync (files/join dir "plugin.edn"))] - (-> (EOF-read (:content content)) - (assoc :dir dir) - (validate "plugin.edn")))) + (try + (-> (EOF-read (:content content)) + (assoc :dir dir) + (validate "plugin.edn")) + (catch :default e + (console/error "FAILED to load plugin.edn: " dir))) + )) (defn plugin-json [dir] (when-let [content (files/open-sync (files/join dir "plugin.json"))] From e8994abc3ba9f464b5f5a9fa55025c957798d7f4 Mon Sep 17 00:00:00 2001 From: Boryslav Larin Date: Sat, 15 Nov 2014 00:37:22 +0200 Subject: [PATCH 293/656] Open file at location with cli #1549 --- src/lt/objs/cli.cljs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index d8d7970af..42291f8ab 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -3,6 +3,7 @@ [lt.objs.app :as app] [lt.objs.files :as files] [lt.objs.workspace :as workspace] + [lt.objs.command :as cmd] [lt.util.load :refer [node-module]] [lt.util.cljs :refer [js->clj]] [clojure.string :as string] @@ -26,13 +27,15 @@ (js->clj :keywordize-keys true))) (defn open-paths [paths add?] - (doseq [path paths + (doseq [[path line] paths :when (not= path (.-execPath js/process))] (if (files/exists? path) (if (files/dir? path) (object/raise workspace/current-ws :add.folder! path) (do (object/raise opener/opener :open! path) + (when line + (cmd/exec! :goto-line line)) (when add? (object/raise workspace/current-ws :add.file! path)))) (object/raise opener/opener :new! path)))) @@ -57,28 +60,32 @@ ;;********************************************************* (behavior ::open-on-args - :triggers #{:post-init} + :triggers #{:show} :reaction (fn [this] (when (args) (let [args-str (or (app/extract! (args-key (app/window-number))) (first (app/args))) args (parse-args (rebuild-argv args-str)) - paths (map #(files/resolve (:dir args) %) (filter valid-path? (:_ args))) + paths-line-no (map #(string/split (files/resolve (:dir args) %) #":") + (filter valid-path? (:_ args))) + paths (map first paths-line-no) open-dir? (some files/dir? paths)] (when open-dir? (object/merge! workspace/current-ws {:initialized? true})) - (open-paths paths (:add args)))))) + (open-paths paths-line-no (:add args)))))) (behavior ::open! :triggers #{:open!} :reaction (fn [this path] (when (= (app/fetch :focusedWindow) (app/window-number)) (let [args (parse-args (rebuild-argv path)) - paths (map #(files/resolve (:dir args) %) (filter valid-path? (:_ args))) + paths-line-no (map #(string/split (files/resolve (:dir args) %) #":") + (filter valid-path? (:_ args))) + paths (map first paths-line-no) open-dir? (some files/dir? paths)] (if (or (:new args) (and open-dir? (not (:add args)))) (let [winid (inc (app/fetch :window-id))] (app/store! (args-key winid) path) (app/open-window)) - (open-paths paths (:add args))))))) + (open-paths paths-line-no (:add args))))))) From c30748d37208d893e56f25acd38549cc1ebe9542 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 15 Nov 2014 13:48:41 -0800 Subject: [PATCH 294/656] fix display of error reporting of strings Signed-off-by: Chris Granger --- src/lt/objs/console.cljs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index d19f838d7..0842a5ce4 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -64,12 +64,11 @@ (defn error [e] (status-bar/console-class "error") - (log (str (if (.-stack e) - (.-stack e) - (let [pr-e (pr-str e)] - (if (not= pr-e "[object Object]") - pr-e - (str e))))) + (log (str (cond + (.-stack e) (.-stack e) + (string? e) e + (not= (pr-str e) "[object Object]") (pr-str e) + :else (str e))) "error")) (.on js/process "uncaughtException" #(error %)) From ecc0fd49d744ad29369cf531a5f622405511507d Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 15 Nov 2014 14:01:50 -0800 Subject: [PATCH 295/656] switch keymaps and behaviors to the new flat syntax Signed-off-by: Chris Granger --- deploy/core/User/user.behaviors | 28 +- deploy/core/User/user.keymap | 8 +- deploy/settings/default/default.behaviors | 1031 +++++++++++---------- deploy/settings/default/default.keymap | 190 ++-- src/lt/objs/plugins.cljs | 36 +- src/lt/objs/settings.cljs | 119 ++- 6 files changed, 812 insertions(+), 600 deletions(-) diff --git a/deploy/core/User/user.behaviors b/deploy/core/User/user.behaviors index 94217214a..7b3f56478 100644 --- a/deploy/core/User/user.behaviors +++ b/deploy/core/User/user.behaviors @@ -9,22 +9,20 @@ ;; start typing a word related to the functionality you want in between the square ;; brackets (e.g. "theme"). -{:+ { - ;; The app tag is kind of like global scope. You assign behaviors that affect - ;; all of Light Table here - :app [(:lt.objs.style/set-skin "dark") - (:lt.objs.plugins/load-js "user_compiled.js")] +[ + ;; The app tag is kind of like global scope. You assign behaviors that affect + ;; all of Light Table to it. + [:app :lt.objs.style/set-skin "dark"] + [:app :lt.objs.plugins/load-js "user_compiled.js"] - ;; The editor tag is applied to all editors - :editor [:lt.objs.editor/no-wrap - (:lt.objs.style/set-theme "default")] + ;; The editor tag is applied to all editors + [:editor :lt.objs.editor/no-wrap] + [:editor :lt.objs.style/set-theme "default"] - ;; Here we can add behaviors to just clojure editors - :editor.clojure [(:lt.plugins.clojure/print-length 1000)] + ;; Here we can add behaviors to just clojure editors + [:editor.clojure :lt.plugins.clojure/print-length 1000] - ;; Behaviors specific to a user-defined object - :user.hello [:lt.plugins.user/on-close-destroy]} + ;; Behaviors specific to a user-defined object + [:user.hello :lt.plugins.user/on-close-destroy] +] - ;; You can use the subtract key to remove behavior that may get added by - ;; another diff - :- {:app []}} diff --git a/deploy/core/User/user.keymap b/deploy/core/User/user.keymap index 34941c45d..7b37d360b 100644 --- a/deploy/core/User/user.keymap +++ b/deploy/core/User/user.keymap @@ -10,7 +10,7 @@ ;; of all the commands you can execute, start typing a word related to the thing you ;; want to do in between the square brackets (e.g. type "editor"). -{:+ {:app {} - - :editor {"alt-w" [:editor.watch.watch-selection] - "alt-shift-w" [:editor.watch.unwatch]}}} +[ + [:editor "alt-w" :editor.watch.watch-selection] + [:editor "alt-shift-w" :editor.watch.unwatch] +] diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 3b01f47ba..914c075bb 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -1,474 +1,559 @@ -{ - :+ - {:app [:lt.objs.cache/init - :lt.objs.settings/load-behaviors - :lt.objs.proc/set-path-OSX - :lt.objs.workspace/reconstitute-last-workspace - :lt.objs.sidebar.command/init-commands - :lt.objs.clients.ws/kill-on-closed - :lt.objs.workspace/stop-watch-on-close - :lt.objs.clients.devtools/clean-inspectors-timer - :lt.objs.deploy/check-deploy :lt.objs.editor.pool/stop-close-dirty - :lt.objs.clients/close-clients-on-closed - :lt.objs.app/restore-position-on-init - :lt.objs.cli/open-on-args - :lt.objs.editor.pool/init-syntax-selector - :lt.objs.cli/open! - :lt.objs.thread/shutdown-worker-on-close - :lt.objs.animations/animate-on-init - :lt.objs.app/store-position-on-close :lt.objs.canvas/append-canvas - :lt.objs.tabs/init-sortable - :lt.objs.deploy/check-version - :lt.objs.style/style-on-init - :lt.objs.app/initial-focus - :lt.objs.app/track-focus - :lt.objs.app/blur-class - :lt.objs.app/focus-class - :lt.objs.app/close! - :lt.objs.menu/remove-menu-close - :lt.objs.app/refresh - :lt.objs.app/on-show-bind-navigate - :lt.objs.editor.pool/stop-reload-dirty - :lt.objs.menu/set-menu - :lt.plugins.auto-complete/init - :lt.objs.clients.devtools/connect-on-init - :lt.objs.tabs/init - :lt.objs.find/init - :lt.plugins.doc/init-doc-search - :lt.objs.intro/show-intro - :lt.objs.menu/recreate-menu - :lt.objs.menu/create-menu - :lt.objs.settings/default-keymap-diffs - :lt.objs.settings/user-keymap-diffs - :lt.objs.settings/default-behavior-diffs - :lt.objs.settings/user-behavior-diffs - :lt.objs.plugins/init-plugins - :lt.objs.plugins/plugin-behavior-diffs - :lt.objs.plugins/plugin-keymap-diffs - :lt.objs.plugins/behaviors.refreshed-load-keys - :lt.objs.status-bar/init-status-bar - :lt.objs.status-bar/show-status-bar - :lt.objs.workspace/init-workspace-cache-dir - :lt.objs.metrics/init-metrics - (:lt.objs.keyboard/chord-timeout 1000) - (:lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|\\.nrepl-port") - (:lt.objs.style/provide-skin "dark" "core/css/skins/new-dark.css") - (:lt.objs.style/provide-skin "light" "core/css/skins/new-dark.css") - (:lt.objs.style/provide-skin "new-dark" "core/css/skins/new-dark.css") - (:lt.objs.style/provide-theme "3024-day" "core/css/themes/3024-day.css") - (:lt.objs.style/provide-theme "3024-night" "core/css/themes/3024-night.css") - (:lt.objs.style/provide-theme "ambiance" "core/css/themes/ambiance.css") - (:lt.objs.style/provide-theme "base16-dark" "core/css/themes/base16-dark.css") - (:lt.objs.style/provide-theme "base16-light" "core/css/themes/base16-light.css") - (:lt.objs.style/provide-theme "blackboard" "core/css/themes/blackboard.css") - (:lt.objs.style/provide-theme "cobalt" "core/css/themes/cobalt.css") - (:lt.objs.style/provide-theme "codemirror" "core/css/themes/codemirror.css") - (:lt.objs.style/provide-theme "default" "core/css/themes/default.css") - (:lt.objs.style/provide-theme "eclipse" "core/css/themes/eclipse.css") - (:lt.objs.style/provide-theme "elegant" "core/css/themes/elegant.css") - (:lt.objs.style/provide-theme "erlang-dark" "core/css/themes/erlang-dark.css") - (:lt.objs.style/provide-theme "ibdknox" "core/css/themes/ibdknox.css") - (:lt.objs.style/provide-theme "lesser-dark" "core/css/themes/lesser-dark.css") - (:lt.objs.style/provide-theme "midnight" "core/css/themes/midnight.css") - (:lt.objs.style/provide-theme "monokai" "core/css/themes/monokai.css") - (:lt.objs.style/provide-theme "neat" "core/css/themes/neat.css") - (:lt.objs.style/provide-theme "night" "core/css/themes/night.css") - (:lt.objs.style/provide-theme "paraiso-dark" "core/css/themes/paraiso-dark.css") - (:lt.objs.style/provide-theme "paraiso-light" "core/css/themes/paraiso-light.css") - (:lt.objs.style/provide-theme "rubyblue" "core/css/themes/rubyblue.css") - (:lt.objs.style/provide-theme "solarized-light" "core/css/themes/solarized-light.css") - (:lt.objs.style/provide-theme "solarized" "core/css/themes/solarized.css") - (:lt.objs.style/provide-theme "the-matrix" "core/css/themes/the-matrix.css") - (:lt.objs.style/provide-theme "tomorrow-night-eighties" "core/css/themes/tomorrow-night-eighties.css") - (:lt.objs.style/provide-theme "tomorrow-night" "core/css/themes/tomorrow-night.css") - (:lt.objs.style/provide-theme "twilight" "core/css/themes/twilight.css") - (:lt.objs.style/provide-theme "vibrant-ink" "core/css/themes/vibrant-ink.css") - (:lt.objs.style/provide-theme "xq-dark" "core/css/themes/xq-dark.css") - (:lt.objs.style/provide-theme "xq-light" "core/css/themes/xq-light.css") - (:lt.objs.style/set-skin "dark") - :lt.objs.editor/init-codemirror] - :bottombar [:lt.objs.bottombar/item-toggled - :lt.objs.bottombar/height! - :lt.objs.bottombar/no-anim-on-drag - :lt.objs.bottombar/reanim-on-drop - :lt.objs.bottombar/show-item - :lt.objs.bottombar/hide-item] - :browser [:lt.objs.browser/forward! :lt.objs.browser/init! - :lt.objs.browser/destroy-on-close :lt.objs.browser/focus! - :lt.objs.browser/url-focus! - :lt.objs.browser/focus-on-show - :lt.objs.browser/set-client-name :lt.objs.browser/rem-client - :lt.objs.browser/store-history :lt.objs.browser/refresh! - :lt.objs.browser/set-active :lt.objs.browser/navigate! - :lt.objs.browser/active-context - :lt.objs.browser/inactive-context - :lt.objs.browser/window-load-click-handler - :lt.objs.browser/window-load-key-handler - :lt.objs.browser/window-load-lttools - :lt.objs.browser/menu! - :lt.objs.browser/menu+ - :lt.objs.browser/back!] - :client [:lt.objs.clients/on-connect-drain :lt.objs.clients/queue! - :lt.objs.clients/try-send] - :client.local [:lt.objs.clients.local/send!] - :client.placeholder [:lt.objs.clients/remove-placeholder-on-swapped] - :client.selector [:lt.objs.connector/on-close! - :lt.objs.connector/on-selected] - :clients [:lt.objs.clients/raise-on-object] - :clients.devtools [:lt.objs.clients.devtools/clear-queue-on-connect - :lt.objs.clients.devtools/console-log - :lt.objs.clients.devtools/handle-message - :lt.objs.clients.devtools/clear-console - :lt.objs.clients.devtools/connect! - :lt.objs.clients.devtools/script-parsed - :lt.objs.clients.devtools/reconnect - :lt.objs.clients.devtools/disconnect - :lt.objs.clients.devtools/print-messages] - :command.options [:lt.objs.sidebar.command/options-escape!] - :command.selector [:lt.objs.sidebar.command/escape! - :lt.objs.sidebar.command/select-hidden - :lt.objs.sidebar.command/select-command] - :console [:lt.objs.console/on-close - :lt.objs.menu/menu! - :lt.objs.console/menu+] - :context [:lt.objs.context/log] - :document [:lt.objs.document/try-close-root-document :lt.objs.document/close-root-document - (:lt.objs.document/set-linked-doc-options {})] - :document.linked [:lt.objs.document/close-linked-document] - :docs [:lt.objs.docs/on-close-destroy] - :docable [:lt.plugins.doc/editor.doc.show! - :lt.plugins.doc/doc-menu+] - :editor [:lt.objs.document/close-document-on-editor-close - :lt.objs.editor/active-on-focus - :lt.objs.editor/on-tags-added - :lt.objs.editor/on-tags-removed - :lt.objs.editor/inactive-on-blur - :lt.objs.editor/context-on-active - :lt.objs.editor/focus - :lt.objs.editor/context-on-inactive - :lt.objs.editor/refresh-on-show - :lt.objs.editor/destroy-on-close - :lt.objs.sidebar.clients/track-active-client - :lt.plugins.auto-complete/intra-buffer-string-hints - :lt.plugins.auto-complete/textual-hints - :lt.plugins.auto-paren/close-pair :lt.objs.editor.pool/track-active - :lt.objs.editor.pool/ed-close :lt.objs.editor/menu! - :lt.objs.editor.pool/warn-on-active :lt.objs.editor/refresh! - (:lt.objs.editor.pool/line-comment-options {}) - :lt.plugins.auto-paren/repeat-pair - :lt.plugins.auto-complete/async-hint-tokens - :lt.objs.editor/copy-paste-menu+ - :lt.plugins.auto-paren/try-remove-pair - :lt.plugins.auto-paren/open-pair - :lt.plugins.auto-complete/show-hint - :lt.objs.editor/not-read-only - :lt.objs.opener/untrack-closed - :lt.objs.opener/unwatch-closed - :lt.objs.editor/hide-line-numbers - :lt.objs.editor/hide-fold-gutter - :lt.objs.editor/no-wrap - :lt.objs.settings/default-keymap-diffs - :lt.objs.settings/user-keymap-diffs - :lt.objs.settings/default-behavior-diffs - :lt.objs.settings/user-behavior-diffs - :lt.objs.style/remove-theme - (:lt.objs.style/set-theme "default") - (:lt.objs.editor/tab-settings false 2 2) - :lt.plugins.auto-complete/remove-on-move-line - :lt.plugins.auto-complete/remove-on-scroll-inactive - :lt.plugins.auto-complete/auto-show-on-input - ] - :editor.active [:lt.objs.status-bar/report-cursor-location] - :editor.force.wrap [:lt.objs.editor/wrap] - :editor.force.unwrap [:lt.objs.editor/no-wrap] - :editor.behaviors [:lt.objs.settings/on-behaviors-editor-save - :lt.objs.settings/eval-settings - :lt.objs.langs.behaviors/behavior-hints - :lt.objs.langs.behaviors/show-info-on-move - :lt.objs.langs.behaviors/on-changed - :lt.objs.langs.behaviors/parsed - :lt.objs.langs.behaviors/behavior-hint-pattern - :lt.plugins.auto-complete/auto-show-on-input - ] - :editor.behaviors.helper [:lt.objs.langs.behaviors/helper.show! - :lt.objs.langs.behaviors/helper.clear!] - :editor.behaviors.workspace [:lt.objs.settings/workspace-save - :lt.objs.editor.file/dirty-on-change] - :editor.keymap [:lt.objs.settings/on-keymap-editor-save - :lt.objs.settings/eval-settings - :lt.objs.langs.keymap/keymap-hints - :lt.objs.langs.keymap/show-info-on-move - :lt.objs.langs.keymap/on-changed - :lt.objs.langs.keymap/parsed - :lt.objs.langs.keymap/keymap-hint-pattern - :lt.plugins.auto-complete/auto-show-on-input] - :editor.keymap.helper [:lt.objs.langs.keymap/helper.show!] - :editor.file-backed [:lt.objs.opener/save-as-rename! - :lt.objs.editor.file/remove-trailing-whitespace - :lt.objs.editor.file/dirty-on-change :lt.objs.editor.file/file-save - :lt.objs.opener/save-as :lt.objs.editor.file/preserve-line-endings - :lt.objs.editor.file/last-char-newline] - :editor.inline-result [:lt.objs.eval/underline-results :lt.objs.eval/inline-results - :lt.objs.eval/inline-exceptions] - :editor.markdown [:lt.objs.editor/wrap] - :editor.plaintext [:lt.objs.editor/wrap] - :editor.pool [:lt.objs.editor.pool/options-changed - :lt.objs.editor.pool/line-numbers-changed - :lt.objs.editor.pool/theme-changed] - :editor.read-only [:lt.objs.editor/read-only] - :editor.transient [:lt.objs.editor.file/dirty-on-change - :lt.objs.opener/transient-save - :lt.objs.opener/save-as] - :evaler [:lt.objs.eval/alert-on-no-client] - :files [:lt.objs.opener/save-failed - (:lt.objs.files/file-types [{:name "C" :exts [:c] :mime "text/x-c" :tags [:editor.c]} - {:name "C++" :exts [:cpp :mm :cc] :mime "text/x-c++src" :tags [:editor.cpp]} - {:name "C++ Header" :exts [:h] :mime "text/x-c++hdr" :tags [:editor.cpph]} - {:name "C#" :exts [:cs] :mime "text/x-csharpr" :tags [:editor.csharp]} - {:name "CoffeeScript" :exts [:coffee] :mime "text/x-coffeescript" :tags [:editor.coffee]} - {:name "Common Lisp" :exts [:cl :lisp] :mime "text/x-common-lisp" :tags [:editor.common-lisp]} - {:name "Diff" :exts [:diff :patch] :mime "text/x-diff" :tags [:editor.diff]} - {:name "EDN" :exts [:edn] :mime "text/x-clojure" :tags [:editor.clj :editor.edn]} - {:name "Erlang" :exts [:erl] :mime "text/x-erlang" :tags [:editor.erlang]} - {:name "Go" :exts [:go] :mime "text/x-go" :tags [:editor.go]} - {:name "Groovy" :exts [:groovy] :mime "text/x-groovy" :tags [:editor.groovy]} - {:name "HAML" :exts [:haml] :mime "text/x-haml" :tags [:editor.haml]} - {:name "Haskell" :exts [:hs] :mime "text/x-haskell" :tags [:editor.haskell]} - {:name "Haxe" :exts [:hx] :mime "text/x-haxe" :tags [:editor.haxe]} - {:name "HTML" :exts [:html :htm] :mime "htmlmixed" :tags [:editor.html]} - {:name "INI" :exts [:ini] :mime "text/x-ini" :tags [:editor.ini]} - {:name "Java" :exts [:java] :mime "text/x-java" :tags [:editor.java]} - {:name "Julia" :exts [:jl] :mime "text/x-julia" :tags [:editor.julia]} - {:name "LaTeX" :exts [:latex :tex] :mime "text/x-stex" :tags [:editor.latex]} - {:name "LESS" :exts [:less] :mime "text/x-less" :tags [:editor.less]} - {:name "Light Table Behaviors" :exts [:behaviors] :mime "text/x-clojurescript" :tags [:editor.behaviors]} - {:name "Light Table Keymap" :exts [:keymap] :mime "text/x-clojurescript" :tags [:editor.keymap]} - {:name "LiveScript" :exts [:ls] :mime "text/x-livescript" :tags [:editor.livescript]} - {:name "Lua" :exts [:lua] :mime "text/x-lua" :tags [:editor.lua]} - {:name "Markdown" :exts [:md :markdown] :mime "text/x-markdown" :tags [:editor.markdown]} - {:name "MySQL" :exts [] :mime "text/x-mysql" :tags [:editor.sql :editor.mysql]} - {:name "OCaml" :exts [:ocaml :ml] :mime "text/x-ocaml" :tags [:editor.ocaml]} - {:name "Pascal" :exts [:pas] :mime "text/x-pascal" :tags [:editor.pascal]} - {:name "Perl" :exts [:pl] :mime "text/x-perl" :tags [:editor.perl]} - {:name "PHP" :exts [:php] :mime "text/x-php" :tags [:editor.php]} - {:name "Plain Text" :exts [:txt] :mime "plaintext" :tags [:editor.plaintext]} - {:name "Python" :exts [:py :pyw] :mime "text/x-python" :tags [:editor.python]} - {:name "R" :exts [:r] :mime "text/x-rsrc" :tags [:editor.r]} - {:name "Ruby" :exts [:rb] :mime "text/x-ruby" :tags [:editor.ruby]} - {:name "Rust" :exts [:rs] :mime "text/x-rustsrc" :tags [:editor.rust]} - {:name "Sass" :exts [:sass] :mime "text/x-sass" :tags [:editor.sass]} - {:name "Scala" :exts [:scala] :mime "text/x-scala" :tags [:editor.scala]} - {:name "Scheme" :exts [:ss :scm :sch] :mime "text/x-scheme" :tags [:editor.scheme]} - {:name "Shell" :exts [:sh :bash :profile :bash_profile :bashrc :zsh :zshrc] :mime "text/x-sh" :tags [:editor.shell]} - {:name "Smarty" :exts [:smarty] :mime "text/x-smarty" :tags [:editor.smarty]} - {:name "SPARQL" :exts [:sparql] :mime "text/x-sparql-query" :tags [:editor.sparql]} - {:name "SQL" :exts [:sql] :mime "text/x-sql" :tags [:editor.sql]} - - {:name "TypeScript" :exts [:ts] :mime "text/x-typescript" :tags [:editor.typescript]} - {:name "VB" :exts [:vb] :mime "text/x-vb" :tags [:editor.visualbasic]} - {:name "XML" :exts [:xml] :mime "application/xml" :tags [:editor.xml]} - {:name "YAML" :exts [:yml :yaml] :mime "text/x-yaml" :tags [:editor.yaml]} - ])] - :filter-list [:lt.objs.sidebar.command/select! - :lt.objs.sidebar.command/filter-inactive - :lt.objs.sidebar.command/filter-list.focus! :lt.objs.sidebar.command/change! - :lt.objs.sidebar.command/clear! :lt.objs.sidebar.command/update-lis - :lt.objs.sidebar.command/set-on-select - :lt.objs.sidebar.command/move-selection - :lt.objs.sidebar.command/set-selection! - :lt.objs.sidebar.command/filter-active] - :find-bar [:lt.objs.find/clear! :lt.objs.find/next! :lt.objs.find/show! - :lt.objs.find/focus! :lt.objs.find/hide! :lt.objs.find/prev! - :lt.objs.find/replace! - :lt.objs.find/search!] - :frame.client [:lt.objs.browser/html-eval :lt.objs.browser/cljs-exec - :lt.objs.browser/handle-refresh! :lt.objs.browser/handle-send! - :lt.objs.browser/css-eval :lt.objs.browser/js-eval - :lt.objs.browser/js-eval-file :lt.objs.browser/handle-close! - :lt.objs.browser/change-live] - :hinter [:lt.plugins.auto-complete/select :lt.plugins.auto-complete/escape! - :lt.plugins.auto-complete/select-unknown - :lt.plugins.auto-complete/line-change] - :inline.doc [:lt.plugins.doc/clear] - :inline.exception [:lt.objs.eval/ex-menu+ :lt.objs.eval/ex-clear - :lt.objs.menu/menu! - :lt.objs.eval/destroy-on-cleared - :lt.objs.eval/ex-shrink-on-double-click - :lt.objs.eval/copy-exception] - :inline.result [:lt.objs.eval/shrink-on-double-click - :lt.objs.menu/menu! - :lt.objs.eval/result-menu+ - :lt.objs.eval/expand-on-click :lt.objs.eval/clear-mark - :lt.objs.eval/move-mark :lt.objs.eval/changed - :lt.objs.eval/update! - :lt.objs.eval/destroy-on-cleared - :lt.objs.eval/copy-result] - :inline.underline-result [:lt.objs.eval/result-menu+ :lt.objs.eval/ex-clear :lt.objs.eval/destroy-on-cleared] - :inline.watch [:lt.plugins.watches/clear!] - :inspector.object [:lt.objs.clients.devtools/clear-inspector-object] - :jump-stack [:lt.objs.jump-stack/jump-stack.push :lt.objs.jump-stack/jump-stack.pop] - :navigate.selector [:lt.objs.sidebar.navigate/escape! - :lt.objs.sidebar.navigate/pop-transient-on-select - :lt.objs.sidebar.navigate/open-on-select] - :navigator [:lt.objs.sidebar.navigate/focus! :lt.objs.sidebar.navigate/focus-on-show :lt.objs.sidebar.navigate/workspace-files - (:lt.objs.sidebar.navigate/set-file-limit 8000)] - :object [:lt.objs.clients/on-destroy-remove-cb] - :opener [:lt.objs.opener/open-from-info :lt.objs.opener/open-transient-editor - :lt.objs.opener/open-standard-editor - :lt.objs.opener/track-open-files - :lt.objs.opener/watch-on-open - :lt.objs.opener/check-read-only - (:lt.objs.opener/existing-path-opens-linked-doc false)] - :options-input [:lt.objs.sidebar.command/op-select! - :lt.objs.sidebar.command/options-escape! - :lt.objs.sidebar.command/op-clear! - :lt.objs.sidebar.command/op-focus!] - :plugin.file [(:lt.objs.editor.file/on-save :build)] - :plugin-manager [:lt.objs.plugins/on-close - :lt.objs.plugins/search-server-plugins - :lt.objs.plugins/save-user-plugin-dependencies - :lt.objs.plugins/render-installed-plugins - :lt.objs.plugins/render-server-plugins - :lt.objs.plugins/submit-plugin - :lt.objs.plugins/draw-plugins-on-updated - :lt.objs.plugins/get-latest-metadata-sha - :lt.objs.plugins/check-metadata-sha - :lt.objs.plugins/check-local-metadata-cache] - :popup [:lt.objs.popup/refocus-on-close - :lt.objs.popup/close! - :lt.objs.popup/on-click-destroy - :lt.objs.popup/change-active-button - :lt.objs.popup/exec-active] - :searcher [:lt.objs.search/clear! - :lt.objs.search/search! - :lt.objs.search/done-searching - :lt.objs.search/next! - :lt.objs.search/prev! - :lt.objs.search/replace! - :lt.objs.search/on-result - :lt.objs.search/focus - :lt.objs.search/on-close] - :sidebar [:lt.objs.sidebar/item-toggled - :lt.objs.sidebar/width! - :lt.objs.sidebar/open! - :lt.objs.sidebar/close! - :lt.objs.sidebar/no-anim-on-drag - :lt.objs.sidebar/reanim-on-drop - :lt.objs.sidebar/pop-transient] - :sidebar.clients [:lt.objs.sidebar.clients/unset-client - :lt.objs.sidebar.clients/selecting! - :lt.objs.sidebar.clients/focus! - :lt.objs.sidebar.clients/hide-on-select - :lt.objs.sidebar.clients/done-selecting] - :sidebar.command [:lt.objs.sidebar.command/refresh! :lt.objs.sidebar.command/focus! - :lt.objs.sidebar.command/exec-active! - :lt.objs.sidebar.command/post-select-pop - :lt.objs.sidebar.command/soft-focus! - :lt.objs.sidebar.command/cancel! - :lt.objs.sidebar.command/focus-on-show - :lt.objs.sidebar.command/exec-command] - :sidebar.docs.search [:lt.plugins.doc/sidebar.doc.search.exec - :lt.plugins.doc/doc.search.results - :lt.plugins.doc/focus! - :lt.plugins.doc/set-item - :lt.plugins.doc/clear! - :lt.plugins.doc/no-client - :lt.plugins.doc/cur-from-last-editor - ] - :sidebar.workspace [:lt.objs.sidebar.workspace/sidebar-menu - :lt.objs.sidebar.workspace/on-menu - :lt.objs.sidebar.workspace/on-drop - :lt.objs.sidebar.workspace/recent! :lt.objs.sidebar.workspace/tree!] - :recent-workspace [:lt.objs.sidebar.workspace/on-menu - :lt.objs.sidebar.workspace/recent-menu - :lt.objs.sidebar.workspace/recent.delete! - :lt.objs.sidebar.workspace/recent.select!] - :status-bar-item [:lt.objs.status-bar/on-show! - :lt.objs.status-bar/on-hide! - :lt.objs.status-bar/init-status-bar] - :status.console-toggle [:lt.objs.console/status-bar-console-toggle - :lt.objs.console/status-bar-console-hide - :lt.objs.console/status-bar-console-show] - :tab-label [:lt.objs.menu/menu! - :lt.objs.tabs/tab-label-menu+ - :lt.objs.tabs/on-close-tab-label] - :tabs [:lt.objs.tabs/on-destroy-objs :lt.objs.tabs/active-tab-num :lt.objs.tabs/prev-tab :lt.objs.tabs/next-tab :lt.objs.tabs/tab-close :lt.objs.tabs/repaint-tab-updated - :lt.objs.tabs/tabset-bottom! - :lt.objs.tabs/right! :lt.objs.tabs/left! :lt.objs.tabs/bottom!] - :tabset [:lt.objs.tabs/set-width-final! :lt.objs.tabs/tabset-active - :lt.objs.tabs/next-tab :lt.objs.tabs/unset-dragging - :lt.objs.tabs/repaint-tab-updated :lt.objs.tabs/width! - :lt.objs.tabs/tab-close :lt.objs.tabs/prev-tab - :lt.objs.tabs/reanim-on-drop :lt.objs.tabs/no-anim-on-drag - :lt.objs.tabs/active-tab-num :lt.objs.tabs/tabset-menu+ - :lt.objs.tabs/set-dragging :lt.objs.menu/menu!] - :tabset.tab [:lt.objs.tabs/on-destroy-remove - :lt.objs.tabs/tab-active - :lt.objs.tabs/show-close-button] - :tcp.client [:lt.objs.clients.tcp/send!] - :tree-item [:lt.objs.sidebar.workspace/rename-submit - :lt.objs.sidebar.workspace/rename-focus - :lt.objs.sidebar.workspace/start-rename - :lt.objs.sidebar.workspace/duplicate - :lt.objs.sidebar.workspace/rename-cancel - :lt.objs.sidebar.workspace/rename-blur] - :version [:lt.objs.version/destroy-on-close - :lt.objs.version/on-show-refresh-eds] - :watchable [:lt.plugins.watches/watch! - :lt.plugins.watches/unwatch! - :lt.plugins.watches/eval-on-watch-or-unwatch] - :window [:lt.objs.clients.tcp/kill-on-closed - :lt.objs.menu/set-menu - :lt.objs.menu/remove-menu-close - ] - :worker-thread [:lt.objs.thread/kill! - :lt.objs.thread/send! - :lt.objs.thread/queue! - :lt.objs.thread/connect - :lt.objs.thread/try-send - :lt.objs.thread/message] - :workspace [:lt.objs.sidebar.workspace/on-ws-set - :lt.objs.sidebar.navigate/watched.delete :lt.objs.workspace/rename! - :lt.objs.workspace/clear! :lt.objs.sidebar.navigate/watched.create - :lt.objs.sidebar.navigate/populate-on-ws-update - :lt.objs.editor.pool/watched.delete :lt.objs.workspace/add-folder! - :lt.objs.workspace/serialize-workspace - :lt.objs.workspace/remove-file! :lt.objs.editor.pool/watched.rename - :lt.objs.workspace/add-file! :lt.objs.sidebar.workspace/on-ws-add - :lt.objs.workspace/watch-on-set - :lt.objs.sidebar.workspace/on-ws-remove :lt.objs.workspace/set! - :lt.objs.sidebar.workspace/watched.delete :lt.objs.workspace/new! - :lt.objs.sidebar.workspace/watched.create - :lt.objs.editor.pool/watched.update - :lt.objs.settings/grab-workspace-behaviors - :lt.objs.opener/watch-open-files - :lt.objs.sidebar.workspace/watch-open-dirs-paths - :lt.objs.workspace/remove-folder!] - :workspace.file [:lt.objs.sidebar.workspace/on-open-file - :lt.objs.sidebar.workspace/rename-file - :lt.objs.sidebar.workspace/subfile-menu - :lt.objs.sidebar.workspace/delete-file - :lt.objs.sidebar.workspace/force-delete-file - :lt.objs.sidebar.workspace/on-menu] - :workspace.file.root [:lt.objs.sidebar.workspace/on-root-menu] - :workspace.folder [:lt.objs.sidebar.workspace/new-folder! - :lt.objs.sidebar.workspace/subfolder-menu - :lt.objs.sidebar.workspace/destroy-sub-tree - :lt.objs.sidebar.workspace/on-open-ls - :lt.objs.sidebar.workspace/delete-folder - :lt.objs.sidebar.workspace/on-close - :lt.objs.sidebar.workspace/rename-folder - :lt.objs.sidebar.workspace/refresh - :lt.objs.sidebar.workspace/on-menu - :lt.objs.sidebar.workspace/force-delete-folder - :lt.objs.sidebar.workspace/track-and-watch-open-dirs - :lt.objs.sidebar.workspace/untrack-closed-dirs - :lt.objs.sidebar.workspace/new-file!] - :workspace.folder.root [:lt.objs.sidebar.workspace/on-root-menu - :lt.objs.sidebar.workspace/on-menu] - :workspace.root [:lt.objs.sidebar.workspace/on-remove - :lt.objs.sidebar.workspace/add-ws-folder - :lt.objs.sidebar.workspace/on-clear - :lt.objs.sidebar.workspace/add-ws-file] - :ws.client [:lt.objs.clients.ws/send!]}} +[ + [:app :lt.objs.cache/init] + [:app :lt.objs.settings/load-behaviors] + [:app :lt.objs.proc/set-path-OSX] + [:app :lt.objs.workspace/reconstitute-last-workspace] + [:app :lt.objs.sidebar.command/init-commands] + [:app :lt.objs.clients.ws/kill-on-closed] + [:app :lt.objs.workspace/stop-watch-on-close] + [:app :lt.objs.clients.devtools/clean-inspectors-timer] + [:app :lt.objs.deploy/check-deploy] + [:app :lt.objs.editor.pool/stop-close-dirty] + [:app :lt.objs.clients/close-clients-on-closed] + [:app :lt.objs.app/restore-position-on-init] + [:app :lt.objs.cli/open-on-args] + [:app :lt.objs.editor.pool/init-syntax-selector] + [:app :lt.objs.cli/open!] + [:app :lt.objs.thread/shutdown-worker-on-close] + [:app :lt.objs.animations/animate-on-init] + [:app :lt.objs.app/store-position-on-close] + [:app :lt.objs.canvas/append-canvas] + [:app :lt.objs.tabs/init-sortable] + [:app :lt.objs.deploy/check-version] + [:app :lt.objs.style/style-on-init] + [:app :lt.objs.app/initial-focus] + [:app :lt.objs.app/track-focus] + [:app :lt.objs.app/blur-class] + [:app :lt.objs.app/focus-class] + [:app :lt.objs.app/close!] + [:app :lt.objs.menu/remove-menu-close] + [:app :lt.objs.app/refresh] + [:app :lt.objs.app/on-show-bind-navigate] + [:app :lt.objs.editor.pool/stop-reload-dirty] + [:app :lt.objs.menu/set-menu] + [:app :lt.plugins.auto-complete/init] + [:app :lt.objs.clients.devtools/connect-on-init] + [:app :lt.objs.tabs/init] + [:app :lt.objs.find/init] + [:app :lt.plugins.doc/init-doc-search] + [:app :lt.objs.intro/show-intro] + [:app :lt.objs.menu/recreate-menu] + [:app :lt.objs.menu/create-menu] + [:app :lt.objs.settings/default-keymap-diffs] + [:app :lt.objs.settings/user-keymap-diffs] + [:app :lt.objs.settings/default-behavior-diffs] + [:app :lt.objs.settings/user-behavior-diffs] + [:app :lt.objs.plugins/init-plugins] + [:app :lt.objs.plugins/plugin-behavior-diffs] + [:app :lt.objs.plugins/plugin-keymap-diffs] + [:app :lt.objs.plugins/behaviors.refreshed-load-keys] + [:app :lt.objs.status-bar/init-status-bar] + [:app :lt.objs.status-bar/show-status-bar] + [:app :lt.objs.workspace/init-workspace-cache-dir] + [:app :lt.objs.metrics/init-metrics] + [:app :lt.objs.keyboard/chord-timeout 1000] + [:app :lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|\\.nrepl-port"] + [:app :lt.objs.style/provide-skin "dark" "core/css/skins/new-dark.css"] + [:app :lt.objs.style/provide-skin "light" "core/css/skins/new-dark.css"] + [:app :lt.objs.style/provide-skin "new-dark" "core/css/skins/new-dark.css"] + [:app :lt.objs.style/provide-theme "3024-day" "core/css/themes/3024-day.css"] + [:app :lt.objs.style/provide-theme "3024-night" "core/css/themes/3024-night.css"] + [:app :lt.objs.style/provide-theme "ambiance" "core/css/themes/ambiance.css"] + [:app :lt.objs.style/provide-theme "base16-dark" "core/css/themes/base16-dark.css"] + [:app :lt.objs.style/provide-theme "base16-light" "core/css/themes/base16-light.css"] + [:app :lt.objs.style/provide-theme "blackboard" "core/css/themes/blackboard.css"] + [:app :lt.objs.style/provide-theme "cobalt" "core/css/themes/cobalt.css"] + [:app :lt.objs.style/provide-theme "codemirror" "core/css/themes/codemirror.css"] + [:app :lt.objs.style/provide-theme "default" "core/css/themes/default.css"] + [:app :lt.objs.style/provide-theme "eclipse" "core/css/themes/eclipse.css"] + [:app :lt.objs.style/provide-theme "elegant" "core/css/themes/elegant.css"] + [:app :lt.objs.style/provide-theme "erlang-dark" "core/css/themes/erlang-dark.css"] + [:app :lt.objs.style/provide-theme "ibdknox" "core/css/themes/ibdknox.css"] + [:app :lt.objs.style/provide-theme "lesser-dark" "core/css/themes/lesser-dark.css"] + [:app :lt.objs.style/provide-theme "midnight" "core/css/themes/midnight.css"] + [:app :lt.objs.style/provide-theme "monokai" "core/css/themes/monokai.css"] + [:app :lt.objs.style/provide-theme "neat" "core/css/themes/neat.css"] + [:app :lt.objs.style/provide-theme "night" "core/css/themes/night.css"] + [:app :lt.objs.style/provide-theme "paraiso-dark" "core/css/themes/paraiso-dark.css"] + [:app :lt.objs.style/provide-theme "paraiso-light" "core/css/themes/paraiso-light.css"] + [:app :lt.objs.style/provide-theme "rubyblue" "core/css/themes/rubyblue.css"] + [:app :lt.objs.style/provide-theme "solarized-light" "core/css/themes/solarized-light.css"] + [:app :lt.objs.style/provide-theme "solarized" "core/css/themes/solarized.css"] + [:app :lt.objs.style/provide-theme "the-matrix" "core/css/themes/the-matrix.css"] + [:app :lt.objs.style/provide-theme "tomorrow-night-eighties" "core/css/themes/tomorrow-night-eighties.css"] + [:app :lt.objs.style/provide-theme "tomorrow-night" "core/css/themes/tomorrow-night.css"] + [:app :lt.objs.style/provide-theme "twilight" "core/css/themes/twilight.css"] + [:app :lt.objs.style/provide-theme "vibrant-ink" "core/css/themes/vibrant-ink.css"] + [:app :lt.objs.style/provide-theme "xq-dark" "core/css/themes/xq-dark.css"] + [:app :lt.objs.style/provide-theme "xq-light" "core/css/themes/xq-light.css"] + [:app :lt.objs.style/set-skin "dark"] + [:app :lt.objs.editor/init-codemirror] + [:bottombar :lt.objs.bottombar/item-toggled] + [:bottombar :lt.objs.bottombar/height!] + [:bottombar :lt.objs.bottombar/no-anim-on-drag] + [:bottombar :lt.objs.bottombar/reanim-on-drop] + [:bottombar :lt.objs.bottombar/show-item] + [:bottombar :lt.objs.bottombar/hide-item] + + [:browser :lt.objs.browser/forward!] + [:browser :lt.objs.browser/init!] + [:browser :lt.objs.browser/destroy-on-close] + [:browser :lt.objs.browser/focus!] + [:browser :lt.objs.browser/url-focus!] + [:browser :lt.objs.browser/focus-on-show] + [:browser :lt.objs.browser/set-client-name] + [:browser :lt.objs.browser/rem-client] + [:browser :lt.objs.browser/store-history] + [:browser :lt.objs.browser/refresh!] + [:browser :lt.objs.browser/set-active] + [:browser :lt.objs.browser/navigate!] + [:browser :lt.objs.browser/active-context] + [:browser :lt.objs.browser/inactive-context] + [:browser :lt.objs.browser/window-load-click-handler] + [:browser :lt.objs.browser/window-load-key-handler] + [:browser :lt.objs.browser/window-load-lttools] + [:browser :lt.objs.browser/menu!] + [:browser :lt.objs.browser/menu+] + [:browser :lt.objs.browser/back!] + + [:client :lt.objs.clients/on-connect-drain] + [:client :lt.objs.clients/queue!] + [:client :lt.objs.clients/try-send] + + [:client.local :lt.objs.clients.local/send!] + + [:client.placeholder :lt.objs.clients/remove-placeholder-on-swapped] + + [:client.selector :lt.objs.connector/on-close!] + [:client.selector :lt.objs.connector/on-selected] + + [:clients :lt.objs.clients/raise-on-object] + + [:clients.devtools :lt.objs.clients.devtools/clear-queue-on-connect] + [:clients.devtools :lt.objs.clients.devtools/console-log] + [:clients.devtools :lt.objs.clients.devtools/handle-message] + [:clients.devtools :lt.objs.clients.devtools/clear-console] + [:clients.devtools :lt.objs.clients.devtools/connect!] + [:clients.devtools :lt.objs.clients.devtools/script-parsed] + [:clients.devtools :lt.objs.clients.devtools/reconnect] + [:clients.devtools :lt.objs.clients.devtools/disconnect] + [:clients.devtools :lt.objs.clients.devtools/print-messages] + + [:command.options :lt.objs.sidebar.command/options-escape!] + + [:command.selector :lt.objs.sidebar.command/escape!] + [:command.selector :lt.objs.sidebar.command/select-hidden] + [:command.selector :lt.objs.sidebar.command/select-command] + + [:console :lt.objs.console/on-close] + [:console :lt.objs.menu/menu!] + [:console :lt.objs.console/menu+] + + [:context :lt.objs.context/log] + + [:docable :lt.plugins.doc/editor.doc.show!] + [:docable :lt.plugins.doc/doc-menu+] + + [:docs :lt.objs.docs/on-close-destroy] + + [:document :lt.objs.document/try-close-root-document] + [:document :lt.objs.document/close-root-document] + [:document :lt.objs.document/set-linked-doc-options {}] + + [:document.linked :lt.objs.document/close-linked-document] + + [:editor :lt.objs.document/close-document-on-editor-close] + [:editor :lt.objs.editor/active-on-focus] + [:editor :lt.objs.editor/on-tags-added] + [:editor :lt.objs.editor/on-tags-removed] + [:editor :lt.objs.editor/inactive-on-blur] + [:editor :lt.objs.editor/context-on-active] + [:editor :lt.objs.editor/focus] + [:editor :lt.objs.editor/context-on-inactive] + [:editor :lt.objs.editor/refresh-on-show] + [:editor :lt.objs.editor/destroy-on-close] + [:editor :lt.objs.sidebar.clients/track-active-client] + [:editor :lt.plugins.auto-complete/intra-buffer-string-hints] + [:editor :lt.plugins.auto-complete/textual-hints] + [:editor :lt.plugins.auto-paren/close-pair] + [:editor :lt.objs.editor.pool/track-active] + [:editor :lt.objs.editor.pool/ed-close] + [:editor :lt.objs.editor/menu!] + [:editor :lt.objs.editor.pool/warn-on-active] + [:editor :lt.objs.editor/refresh!] + [:editor :lt.objs.editor.pool/line-comment-options {}] + [:editor :lt.plugins.auto-paren/repeat-pair] + [:editor :lt.plugins.auto-complete/async-hint-tokens] + [:editor :lt.objs.editor/copy-paste-menu+] + [:editor :lt.plugins.auto-paren/try-remove-pair] + [:editor :lt.plugins.auto-paren/open-pair] + [:editor :lt.plugins.auto-complete/show-hint] + [:editor :lt.objs.editor/not-read-only] + [:editor :lt.objs.opener/untrack-closed] + [:editor :lt.objs.opener/unwatch-closed] + [:editor :lt.objs.editor/hide-line-numbers] + [:editor :lt.objs.editor/hide-fold-gutter] + [:editor :lt.objs.editor/no-wrap] + [:editor :lt.objs.settings/default-keymap-diffs] + [:editor :lt.objs.settings/user-keymap-diffs] + [:editor :lt.objs.settings/default-behavior-diffs] + [:editor :lt.objs.settings/user-behavior-diffs] + [:editor :lt.objs.style/remove-theme] + [:editor :lt.objs.style/set-theme "default"] + [:editor :lt.objs.editor/tab-settings false 2 2] + [:editor :lt.plugins.auto-complete/remove-on-move-line] + [:editor :lt.plugins.auto-complete/remove-on-scroll-inactive] + [:editor :lt.plugins.auto-complete/auto-show-on-input] + + [:editor.active :lt.objs.status-bar/report-cursor-location] + + [:editor.behaviors :lt.objs.settings/on-behaviors-editor-save] + [:editor.behaviors :lt.objs.settings/eval-settings] + [:editor.behaviors :lt.objs.langs.behaviors/behavior-hints] + [:editor.behaviors :lt.objs.langs.behaviors/show-info-on-move] + [:editor.behaviors :lt.objs.langs.behaviors/on-changed] + [:editor.behaviors :lt.objs.langs.behaviors/parsed] + [:editor.behaviors :lt.objs.langs.behaviors/behavior-hint-pattern] + [:editor.behaviors :lt.plugins.auto-complete/auto-show-on-input] + + [:editor.behaviors.helper :lt.objs.langs.behaviors/helper.show!] + [:editor.behaviors.helper :lt.objs.langs.behaviors/helper.clear!] + + [:editor.behaviors.workspace :lt.objs.settings/workspace-save] + [:editor.behaviors.workspace :lt.objs.editor.file/dirty-on-change] + + [:editor.file-backed :lt.objs.opener/save-as-rename!] + [:editor.file-backed :lt.objs.editor.file/remove-trailing-whitespace] + [:editor.file-backed :lt.objs.editor.file/dirty-on-change] + [:editor.file-backed :lt.objs.editor.file/file-save] + [:editor.file-backed :lt.objs.opener/save-as] + [:editor.file-backed :lt.objs.editor.file/preserve-line-endings] + [:editor.file-backed :lt.objs.editor.file/last-char-newline] + + [:editor.force.unwrap :lt.objs.editor/no-wrap] + + [:editor.force.wrap :lt.objs.editor/wrap] + + [:editor.inline-result :lt.objs.eval/underline-results] + [:editor.inline-result :lt.objs.eval/inline-results] + [:editor.inline-result :lt.objs.eval/inline-exceptions] + + [:editor.keymap :lt.objs.settings/on-keymap-editor-save] + [:editor.keymap :lt.objs.settings/eval-settings] + [:editor.keymap :lt.objs.langs.keymap/keymap-hints] + [:editor.keymap :lt.objs.langs.keymap/show-info-on-move] + [:editor.keymap :lt.objs.langs.keymap/on-changed] + [:editor.keymap :lt.objs.langs.keymap/parsed] + [:editor.keymap :lt.objs.langs.keymap/keymap-hint-pattern] + [:editor.keymap :lt.plugins.auto-complete/auto-show-on-input] + + [:editor.keymap.helper :lt.objs.langs.keymap/helper.show!] + + [:editor.markdown :lt.objs.editor/wrap] + + [:editor.plaintext :lt.objs.editor/wrap] + + [:editor.pool :lt.objs.editor.pool/options-changed] + [:editor.pool :lt.objs.editor.pool/line-numbers-changed] + [:editor.pool :lt.objs.editor.pool/theme-changed] + + [:editor.read-only :lt.objs.editor/read-only] + + [:editor.transient :lt.objs.editor.file/dirty-on-change] + [:editor.transient :lt.objs.opener/transient-save] + [:editor.transient :lt.objs.opener/save-as] + + [:evaler :lt.objs.eval/alert-on-no-client] + + [:files :lt.objs.opener/save-failed] + [:files :lt.objs.files/file-types [{:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} {:exts [:cpp :mm :cc], :mime "text/x-c++src", :tags [:editor.cpp], :name "C++"} {:exts [:h], :mime "text/x-c++hdr", :tags [:editor.cpph], :name "C++ Header"} {:exts [:cs], :mime "text/x-csharpr", :tags [:editor.csharp], :name "C#"} {:exts [:coffee], :mime "text/x-coffeescript", :tags [:editor.coffee], :name "CoffeeScript"} {:exts [:cl :lisp], :mime "text/x-common-lisp", :tags [:editor.common-lisp], :name "Common Lisp"} {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} {:exts [:haml], :mime "text/x-haml", :tags [:editor.haml], :name "HAML"} {:exts [:hs], :mime "text/x-haskell", :tags [:editor.haskell], :name "Haskell"} {:exts [:hx], :mime "text/x-haxe", :tags [:editor.haxe], :name "Haxe"} {:exts [:html :htm], :mime "htmlmixed", :tags [:editor.html], :name "HTML"} {:exts [:ini], :mime "text/x-ini", :tags [:editor.ini], :name "INI"} {:exts [:java], :mime "text/x-java", :tags [:editor.java], :name "Java"} {:exts [:jl], :mime "text/x-julia", :tags [:editor.julia], :name "Julia"} {:exts [:latex :tex], :mime "text/x-stex", :tags [:editor.latex], :name "LaTeX"} {:exts [:less], :mime "text/x-less", :tags [:editor.less], :name "LESS"} {:exts [:behaviors], :mime "text/x-clojurescript", :tags [:editor.behaviors], :name "Light Table Behaviors"} {:exts [:keymap], :mime "text/x-clojurescript", :tags [:editor.keymap], :name "Light Table Keymap"} {:exts [:ls], :mime "text/x-livescript", :tags [:editor.livescript], :name "LiveScript"} {:exts [:lua], :mime "text/x-lua", :tags [:editor.lua], :name "Lua"} {:exts [:md :markdown], :mime "text/x-markdown", :tags [:editor.markdown], :name "Markdown"} {:exts [], :mime "text/x-mysql", :tags [:editor.sql :editor.mysql], :name "MySQL"} {:exts [:ocaml :ml], :mime "text/x-ocaml", :tags [:editor.ocaml], :name "OCaml"} {:exts [:pas], :mime "text/x-pascal", :tags [:editor.pascal], :name "Pascal"} {:exts [:pl], :mime "text/x-perl", :tags [:editor.perl], :name "Perl"} {:exts [:php], :mime "text/x-php", :tags [:editor.php], :name "PHP"} {:exts [:txt], :mime "plaintext", :tags [:editor.plaintext], :name "Plain Text"} {:exts [:py :pyw], :mime "text/x-python", :tags [:editor.python], :name "Python"} {:exts [:r], :mime "text/x-rsrc", :tags [:editor.r], :name "R"} {:exts [:rb], :mime "text/x-ruby", :tags [:editor.ruby], :name "Ruby"} {:exts [:rs], :mime "text/x-rustsrc", :tags [:editor.rust], :name "Rust"} {:exts [:sass], :mime "text/x-sass", :tags [:editor.sass], :name "Sass"} {:exts [:scala], :mime "text/x-scala", :tags [:editor.scala], :name "Scala"} {:exts [:ss :scm :sch], :mime "text/x-scheme", :tags [:editor.scheme], :name "Scheme"} {:exts [:sh :bash :profile :bash_profile :bashrc :zsh :zshrc], :mime "text/x-sh", :tags [:editor.shell], :name "Shell"} {:exts [:smarty], :mime "text/x-smarty", :tags [:editor.smarty], :name "Smarty"} {:exts [:sparql], :mime "text/x-sparql-query", :tags [:editor.sparql], :name "SPARQL"} {:exts [:sql], :mime "text/x-sql", :tags [:editor.sql], :name "SQL"} {:exts [:ts], :mime "text/x-typescript", :tags [:editor.typescript], :name "TypeScript"} {:exts [:vb], :mime "text/x-vb", :tags [:editor.visualbasic], :name "VB"} {:exts [:xml], :mime "application/xml", :tags [:editor.xml], :name "XML"} {:exts [:yml :yaml], :mime "text/x-yaml", :tags [:editor.yaml], :name "YAML"}]] + + [:filter-list :lt.objs.sidebar.command/select!] + [:filter-list :lt.objs.sidebar.command/filter-inactive] + [:filter-list :lt.objs.sidebar.command/filter-list.focus!] + [:filter-list :lt.objs.sidebar.command/change!] + [:filter-list :lt.objs.sidebar.command/clear!] + [:filter-list :lt.objs.sidebar.command/update-lis] + [:filter-list :lt.objs.sidebar.command/set-on-select] + [:filter-list :lt.objs.sidebar.command/move-selection] + [:filter-list :lt.objs.sidebar.command/set-selection!] + [:filter-list :lt.objs.sidebar.command/filter-active] + + [:find-bar :lt.objs.find/clear!] + [:find-bar :lt.objs.find/next!] + [:find-bar :lt.objs.find/show!] + [:find-bar :lt.objs.find/focus!] + [:find-bar :lt.objs.find/hide!] + [:find-bar :lt.objs.find/prev!] + [:find-bar :lt.objs.find/replace!] + [:find-bar :lt.objs.find/search!] + + [:frame.client :lt.objs.browser/html-eval] + [:frame.client :lt.objs.browser/cljs-exec] + [:frame.client :lt.objs.browser/handle-refresh!] + [:frame.client :lt.objs.browser/handle-send!] + [:frame.client :lt.objs.browser/css-eval] + [:frame.client :lt.objs.browser/js-eval] + [:frame.client :lt.objs.browser/js-eval-file] + [:frame.client :lt.objs.browser/handle-close!] + [:frame.client :lt.objs.browser/change-live] + + [:hinter :lt.plugins.auto-complete/select] + [:hinter :lt.plugins.auto-complete/escape!] + [:hinter :lt.plugins.auto-complete/select-unknown] + [:hinter :lt.plugins.auto-complete/line-change] + + [:inline.doc :lt.plugins.doc/clear] + + [:inline.exception :lt.objs.eval/ex-menu+] + [:inline.exception :lt.objs.eval/ex-clear] + [:inline.exception :lt.objs.menu/menu!] + [:inline.exception :lt.objs.eval/destroy-on-cleared] + [:inline.exception :lt.objs.eval/ex-shrink-on-double-click] + [:inline.exception :lt.objs.eval/copy-exception] + + [:inline.result :lt.objs.eval/shrink-on-double-click] + [:inline.result :lt.objs.menu/menu!] + [:inline.result :lt.objs.eval/result-menu+] + [:inline.result :lt.objs.eval/expand-on-click] + [:inline.result :lt.objs.eval/clear-mark] + [:inline.result :lt.objs.eval/move-mark] + [:inline.result :lt.objs.eval/changed] + [:inline.result :lt.objs.eval/update!] + [:inline.result :lt.objs.eval/destroy-on-cleared] + [:inline.result :lt.objs.eval/copy-result] + + [:inline.underline-result :lt.objs.eval/result-menu+] + [:inline.underline-result :lt.objs.eval/ex-clear] + [:inline.underline-result :lt.objs.eval/destroy-on-cleared] + + [:inline.watch :lt.plugins.watches/clear!] + + [:inspector.object :lt.objs.clients.devtools/clear-inspector-object] + + [:jump-stack :lt.objs.jump-stack/jump-stack.push] + [:jump-stack :lt.objs.jump-stack/jump-stack.pop] + + [:navigate.selector :lt.objs.sidebar.navigate/escape!] + [:navigate.selector :lt.objs.sidebar.navigate/pop-transient-on-select] + [:navigate.selector :lt.objs.sidebar.navigate/open-on-select] + + [:navigator :lt.objs.sidebar.navigate/focus!] + [:navigator :lt.objs.sidebar.navigate/focus-on-show] + [:navigator :lt.objs.sidebar.navigate/workspace-files] + [:navigator :lt.objs.sidebar.navigate/set-file-limit 8000] + + [:object :lt.objs.clients/on-destroy-remove-cb] + + [:opener :lt.objs.opener/open-from-info] + [:opener :lt.objs.opener/open-transient-editor] + [:opener :lt.objs.opener/open-standard-editor] + [:opener :lt.objs.opener/track-open-files] + [:opener :lt.objs.opener/watch-on-open] + [:opener :lt.objs.opener/check-read-only] + [:opener :lt.objs.opener/existing-path-opens-linked-doc false] + + [:options-input :lt.objs.sidebar.command/op-select!] + [:options-input :lt.objs.sidebar.command/options-escape!] + [:options-input :lt.objs.sidebar.command/op-clear!] + [:options-input :lt.objs.sidebar.command/op-focus!] + + [:plugin-manager :lt.objs.plugins/on-close] + [:plugin-manager :lt.objs.plugins/search-server-plugins] + [:plugin-manager :lt.objs.plugins/save-user-plugin-dependencies] + [:plugin-manager :lt.objs.plugins/render-installed-plugins] + [:plugin-manager :lt.objs.plugins/render-server-plugins] + [:plugin-manager :lt.objs.plugins/submit-plugin] + [:plugin-manager :lt.objs.plugins/draw-plugins-on-updated] + [:plugin-manager :lt.objs.plugins/get-latest-metadata-sha] + [:plugin-manager :lt.objs.plugins/check-metadata-sha] + [:plugin-manager :lt.objs.plugins/check-local-metadata-cache] + + [:plugin.file :lt.objs.editor.file/on-save :build] + + [:popup :lt.objs.popup/refocus-on-close] + [:popup :lt.objs.popup/close!] + [:popup :lt.objs.popup/on-click-destroy] + [:popup :lt.objs.popup/change-active-button] + [:popup :lt.objs.popup/exec-active] + + [:recent-workspace :lt.objs.sidebar.workspace/on-menu] + [:recent-workspace :lt.objs.sidebar.workspace/recent-menu] + [:recent-workspace :lt.objs.sidebar.workspace/recent.delete!] + [:recent-workspace :lt.objs.sidebar.workspace/recent.select!] + + [:searcher :lt.objs.search/clear!] + [:searcher :lt.objs.search/search!] + [:searcher :lt.objs.search/done-searching] + [:searcher :lt.objs.search/next!] + [:searcher :lt.objs.search/prev!] + [:searcher :lt.objs.search/replace!] + [:searcher :lt.objs.search/on-result] + [:searcher :lt.objs.search/focus] + [:searcher :lt.objs.search/on-close] + + [:sidebar :lt.objs.sidebar/item-toggled] + [:sidebar :lt.objs.sidebar/width!] + [:sidebar :lt.objs.sidebar/open!] + [:sidebar :lt.objs.sidebar/close!] + [:sidebar :lt.objs.sidebar/no-anim-on-drag] + [:sidebar :lt.objs.sidebar/reanim-on-drop] + [:sidebar :lt.objs.sidebar/pop-transient] + + [:sidebar.clients :lt.objs.sidebar.clients/unset-client] + [:sidebar.clients :lt.objs.sidebar.clients/selecting!] + [:sidebar.clients :lt.objs.sidebar.clients/focus!] + [:sidebar.clients :lt.objs.sidebar.clients/hide-on-select] + [:sidebar.clients :lt.objs.sidebar.clients/done-selecting] + + [:sidebar.command :lt.objs.sidebar.command/refresh!] + [:sidebar.command :lt.objs.sidebar.command/focus!] + [:sidebar.command :lt.objs.sidebar.command/exec-active!] + [:sidebar.command :lt.objs.sidebar.command/post-select-pop] + [:sidebar.command :lt.objs.sidebar.command/soft-focus!] + [:sidebar.command :lt.objs.sidebar.command/cancel!] + [:sidebar.command :lt.objs.sidebar.command/focus-on-show] + [:sidebar.command :lt.objs.sidebar.command/exec-command] + + [:sidebar.docs.search :lt.plugins.doc/sidebar.doc.search.exec] + [:sidebar.docs.search :lt.plugins.doc/doc.search.results] + [:sidebar.docs.search :lt.plugins.doc/focus!] + [:sidebar.docs.search :lt.plugins.doc/set-item] + [:sidebar.docs.search :lt.plugins.doc/clear!] + [:sidebar.docs.search :lt.plugins.doc/no-client] + [:sidebar.docs.search :lt.plugins.doc/cur-from-last-editor] + + [:sidebar.workspace :lt.objs.sidebar.workspace/sidebar-menu] + [:sidebar.workspace :lt.objs.sidebar.workspace/on-menu] + [:sidebar.workspace :lt.objs.sidebar.workspace/on-drop] + [:sidebar.workspace :lt.objs.sidebar.workspace/recent!] + [:sidebar.workspace :lt.objs.sidebar.workspace/tree!] + + [:status-bar-item :lt.objs.status-bar/on-show!] + [:status-bar-item :lt.objs.status-bar/on-hide!] + [:status-bar-item :lt.objs.status-bar/init-status-bar] + + [:status.console-toggle :lt.objs.console/status-bar-console-toggle] + [:status.console-toggle :lt.objs.console/status-bar-console-hide] + [:status.console-toggle :lt.objs.console/status-bar-console-show] + + [:tab-label :lt.objs.menu/menu!] + [:tab-label :lt.objs.tabs/tab-label-menu+] + [:tab-label :lt.objs.tabs/on-close-tab-label] + + [:tabs :lt.objs.tabs/on-destroy-objs] + [:tabs :lt.objs.tabs/active-tab-num] + [:tabs :lt.objs.tabs/prev-tab] + [:tabs :lt.objs.tabs/next-tab] + [:tabs :lt.objs.tabs/tab-close] + [:tabs :lt.objs.tabs/repaint-tab-updated] + [:tabs :lt.objs.tabs/tabset-bottom!] + [:tabs :lt.objs.tabs/right!] + [:tabs :lt.objs.tabs/left!] + [:tabs :lt.objs.tabs/bottom!] + + [:tabset :lt.objs.tabs/set-width-final!] + [:tabset :lt.objs.tabs/tabset-active] + [:tabset :lt.objs.tabs/next-tab] + [:tabset :lt.objs.tabs/unset-dragging] + [:tabset :lt.objs.tabs/repaint-tab-updated] + [:tabset :lt.objs.tabs/width!] + [:tabset :lt.objs.tabs/tab-close] + [:tabset :lt.objs.tabs/prev-tab] + [:tabset :lt.objs.tabs/reanim-on-drop] + [:tabset :lt.objs.tabs/no-anim-on-drag] + [:tabset :lt.objs.tabs/active-tab-num] + [:tabset :lt.objs.tabs/tabset-menu+] + [:tabset :lt.objs.tabs/set-dragging] + [:tabset :lt.objs.menu/menu!] + + [:tabset.tab :lt.objs.tabs/on-destroy-remove] + [:tabset.tab :lt.objs.tabs/tab-active] + [:tabset.tab :lt.objs.tabs/show-close-button] + + [:tcp.client :lt.objs.clients.tcp/send!] + + [:tree-item :lt.objs.sidebar.workspace/rename-submit] + [:tree-item :lt.objs.sidebar.workspace/rename-focus] + [:tree-item :lt.objs.sidebar.workspace/start-rename] + [:tree-item :lt.objs.sidebar.workspace/duplicate] + [:tree-item :lt.objs.sidebar.workspace/rename-cancel] + [:tree-item :lt.objs.sidebar.workspace/rename-blur] + + [:version :lt.objs.version/destroy-on-close] + [:version :lt.objs.version/on-show-refresh-eds] + + [:watchable :lt.plugins.watches/watch!] + [:watchable :lt.plugins.watches/unwatch!] + [:watchable :lt.plugins.watches/eval-on-watch-or-unwatch] + + [:window :lt.objs.clients.tcp/kill-on-closed] + [:window :lt.objs.menu/set-menu] + [:window :lt.objs.menu/remove-menu-close] + + [:worker-thread :lt.objs.thread/kill!] + [:worker-thread :lt.objs.thread/send!] + [:worker-thread :lt.objs.thread/queue!] + [:worker-thread :lt.objs.thread/connect] + [:worker-thread :lt.objs.thread/try-send] + [:worker-thread :lt.objs.thread/message] + + [:workspace :lt.objs.sidebar.workspace/on-ws-set] + [:workspace :lt.objs.sidebar.navigate/watched.delete] + [:workspace :lt.objs.workspace/rename!] + [:workspace :lt.objs.workspace/clear!] + [:workspace :lt.objs.sidebar.navigate/watched.create] + [:workspace :lt.objs.sidebar.navigate/populate-on-ws-update] + [:workspace :lt.objs.editor.pool/watched.delete] + [:workspace :lt.objs.workspace/add-folder!] + [:workspace :lt.objs.workspace/serialize-workspace] + [:workspace :lt.objs.workspace/remove-file!] + [:workspace :lt.objs.editor.pool/watched.rename] + [:workspace :lt.objs.workspace/add-file!] + [:workspace :lt.objs.sidebar.workspace/on-ws-add] + [:workspace :lt.objs.workspace/watch-on-set] + [:workspace :lt.objs.sidebar.workspace/on-ws-remove] + [:workspace :lt.objs.workspace/set!] + [:workspace :lt.objs.sidebar.workspace/watched.delete] + [:workspace :lt.objs.workspace/new!] + [:workspace :lt.objs.sidebar.workspace/watched.create] + [:workspace :lt.objs.editor.pool/watched.update] + [:workspace :lt.objs.settings/grab-workspace-behaviors] + [:workspace :lt.objs.opener/watch-open-files] + [:workspace :lt.objs.sidebar.workspace/watch-open-dirs-paths] + [:workspace :lt.objs.workspace/remove-folder!] + + [:workspace.file :lt.objs.sidebar.workspace/on-open-file] + [:workspace.file :lt.objs.sidebar.workspace/rename-file] + [:workspace.file :lt.objs.sidebar.workspace/subfile-menu] + [:workspace.file :lt.objs.sidebar.workspace/delete-file] + [:workspace.file :lt.objs.sidebar.workspace/force-delete-file] + [:workspace.file :lt.objs.sidebar.workspace/on-menu] + + [:workspace.file.root :lt.objs.sidebar.workspace/on-root-menu] + + [:workspace.folder :lt.objs.sidebar.workspace/new-folder!] + [:workspace.folder :lt.objs.sidebar.workspace/subfolder-menu] + [:workspace.folder :lt.objs.sidebar.workspace/destroy-sub-tree] + [:workspace.folder :lt.objs.sidebar.workspace/on-open-ls] + [:workspace.folder :lt.objs.sidebar.workspace/delete-folder] + [:workspace.folder :lt.objs.sidebar.workspace/on-close] + [:workspace.folder :lt.objs.sidebar.workspace/rename-folder] + [:workspace.folder :lt.objs.sidebar.workspace/refresh] + [:workspace.folder :lt.objs.sidebar.workspace/on-menu] + [:workspace.folder :lt.objs.sidebar.workspace/force-delete-folder] + [:workspace.folder :lt.objs.sidebar.workspace/track-and-watch-open-dirs] + [:workspace.folder :lt.objs.sidebar.workspace/untrack-closed-dirs] + [:workspace.folder :lt.objs.sidebar.workspace/new-file!] + + [:workspace.folder.root :lt.objs.sidebar.workspace/on-root-menu] + [:workspace.folder.root :lt.objs.sidebar.workspace/on-menu] + + [:workspace.root :lt.objs.sidebar.workspace/on-remove] + [:workspace.root :lt.objs.sidebar.workspace/add-ws-folder] + [:workspace.root :lt.objs.sidebar.workspace/on-clear] + [:workspace.root :lt.objs.sidebar.workspace/add-ws-file] + + [:ws.client :lt.objs.clients.ws/send!] +] \ No newline at end of file diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 80b083b4f..ce05f9bae 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -1,86 +1,104 @@ -{:+ {:app {"pmeta-r" [:refresh-connected-browser] - "pmeta-shift-n" [:window.new] - "pmeta-o" [:navigate-workspace-transient] - "pmeta-shift-o" [:open-file] - "pmeta-shift-f" [:searcher.show] - "ctrl-shift-d" [:docs.search.show] - "pmeta-n" [:new-file] - "ctrl-space" [:show-commandbar-transient] - "pmeta-shift-=" [:window.zoom-in] - "pmeta--" [:window.zoom-out]} - :editor {"pmeta-enter" [:eval-editor-form] - "pmeta-shift-enter" [:eval-editor] - "pmeta-s" [:save] - "pmeta-shift-s" [:save-as] - "pmeta-l" [:goto-line] - "ctrl-." [:editor.jump-to-definition-at-cursor] - "ctrl-," [:editor.unjump] - "ctrl-d" [:editor.doc.toggle] - "ctrl-=" [:editor.fold-code]} - :editor.keys.normal {"\"" [(:editor.repeat-pair "\"")] - "'" [(:editor.repeat-pair "'")] - "(" [(:editor.open-pair "(")] - ")" [(:editor.close-pair ")")] - "pmeta-f" [:find.fill-selection - :find.show] - "tab" [:auto-complete] - "pmeta-g" [:find.next] - "pmeta-shift-g" [:find.prev] - "[" [(:editor.open-pair "[")] - "{" [(:editor.open-pair "{")] - "]" [(:editor.close-pair "]")] - "}" [(:editor.close-pair "}")] - "backspace" [:editor.backspace-pair - :editor.backspace-indent]} - :editor.keys.hinting.active {"enter" [:passthrough]} - :tabs {"pmeta-w" [:tabs.close] - "pmeta-shift-[" [:tabs.prev] - "pmeta-shift-]" [:tabs.next] - "ctrl-tab" [:tabs.next] - "ctrl-shift-tab" [:tabs.prev] - "pmeta-1" [(:tabs.goto 0)] - "pmeta-2" [(:tabs.goto 1)] - "pmeta-3" [(:tabs.goto 2)] - "pmeta-4" [(:tabs.goto 3)] - "pmeta-5" [(:tabs.goto 4)] - "pmeta-6" [(:tabs.goto 5)] - "pmeta-7" [(:tabs.goto 6)] - "pmeta-8" [(:tabs.goto 7)] - "pmeta-9" [(:tabs.goto :last)] - } - :popup {"left" [(:popup.move-active 1)], - "shift-tab" [(:popup.move-active -1)], - "esc" [(:popup.escape)], - "tab" [(:popup.move-active 1)], - "enter" [(:popup.exec-active)], - "right" [(:popup.move-active -1)]} - :popup.input {"left" [:passthrough], - "right" [:passthrough]} - :plugin-manager.search {"enter" [:plugin-manager.search]} - :sidebar.clients {"esc" [:hide-connect]} - :sidebar.doc.search.input {"enter" [:docs.search.exec] - "esc" [:docs.search.hide]} - :searcher.search {"enter" [:searcher.search]} - :searcher.replace {"pmeta-enter" [:searcher.replace-all]} - :searcher.location {"enter" [:searcher.search]} - :find-bar {"shift-enter" [:find.prev], - "esc" [:find.clear :find.hide], - "pmeta-g" [:find.next] - "pmeta-shift-g" [:find.prev] - "enter" [:find.next]} - :find-bar.replace {"pmeta-enter" [:find.replace-all], - "pmeta-g" [:find.next] - "pmeta-shift-g" [:find.prev] - "esc" [:find.clear :find.hide], - "enter" [:find.replace]} - :browser { "pmeta-l" [:browser.url-bar.focus] } - :browser.url-bar {"enter" [:browser.url-bar.navigate!] - "esc" [:browser.focus-content]}, - :filter-list.input {"down" [(:filter-list.input.move-selection 1)], - "esc" [(:filter-list.input.escape! :force)], - "enter" [:filter-list.input.select!], - "up" [(:filter-list.input.move-selection -1)]} - :options-input {"esc" [:options-input.escape!], - "enter" [:options-input.select!]} - :tree.rename {"esc" [:workspace.rename.cancel!] - "enter" [:workspace.rename.submit!]}}} +[ + [:app "pmeta-shift-f" :searcher.show] + [:app "ctrl-space" :show-commandbar-transient] + [:app "pmeta-shift-n" :window.new] + [:app "pmeta-shift-o" :open-file] + [:app "pmeta--" :window.zoom-out] + [:app "pmeta-n" :new-file] + [:app "ctrl-shift-d" :docs.search.show] + [:app "pmeta-o" :navigate-workspace-transient] + [:app "pmeta-shift-=" :window.zoom-in] + [:app "pmeta-r" :refresh-connected-browser] + + [:browser "pmeta-l" :browser.url-bar.focus] + + [:browser.url-bar "esc" :browser.focus-content] + [:browser.url-bar "enter" :browser.url-bar.navigate!] + + [:editor "pmeta-enter" :eval-editor-form] + [:editor "ctrl-d" :editor.doc.toggle] + [:editor "ctrl-," :editor.unjump] + [:editor "ctrl-." :editor.jump-to-definition-at-cursor] + [:editor "pmeta-shift-s" :save-as] + [:editor "pmeta-l" :goto-line] + [:editor "pmeta-shift-enter" :eval-editor] + [:editor "ctrl-=" :editor.fold-code] + [:editor "pmeta-s" :save] + + [:editor.keys.hinting.active "enter" :passthrough] + + [:editor.keys.normal "\"" (:editor.repeat-pair "\"")] + [:editor.keys.normal "pmeta-shift-g" :find.prev] + [:editor.keys.normal "'" (:editor.repeat-pair "'")] + [:editor.keys.normal "(" (:editor.open-pair "(")] + [:editor.keys.normal ")" (:editor.close-pair ")")] + [:editor.keys.normal "pmeta-f" :find.fill-selection :find.show] + [:editor.keys.normal "pmeta-g" :find.next] + [:editor.keys.normal "tab" :auto-complete] + [:editor.keys.normal "[" (:editor.open-pair "[")] + [:editor.keys.normal "{" (:editor.open-pair "{")] + [:editor.keys.normal "]" (:editor.close-pair "]")] + [:editor.keys.normal "}" (:editor.close-pair "}")] + [:editor.keys.normal "backspace" :editor.backspace-pair :editor.backspace-indent] + + [:filter-list.input "down" (:filter-list.input.move-selection 1)] + [:filter-list.input "esc" (:filter-list.input.escape! :force)] + [:filter-list.input "enter" :filter-list.input.select!] + [:filter-list.input "up" (:filter-list.input.move-selection -1)] + + [:find-bar "pmeta-shift-g" :find.prev] + [:find-bar "shift-enter" :find.prev] + [:find-bar "pmeta-g" :find.next] + [:find-bar "esc" :find.clear :find.hide] + [:find-bar "enter" :find.next] + + [:find-bar.replace "pmeta-enter" :find.replace-all] + [:find-bar.replace "pmeta-shift-g" :find.prev] + [:find-bar.replace "pmeta-g" :find.next] + [:find-bar.replace "esc" :find.clear :find.hide] + [:find-bar.replace "enter" :find.replace] + + [:options-input "esc" :options-input.escape!] + [:options-input "enter" :options-input.select!] + + [:plugin-manager.search "enter" :plugin-manager.search] + + [:popup "left" (:popup.move-active 1)] + [:popup "shift-tab" (:popup.move-active -1)] + [:popup "esc" (:popup.escape)] + [:popup "tab" (:popup.move-active 1)] + [:popup "enter" (:popup.exec-active)] + [:popup "right" (:popup.move-active -1)] + + [:popup.input "left" :passthrough] + [:popup.input "right" :passthrough] + + [:searcher.location "enter" :searcher.search] + + [:searcher.replace "pmeta-enter" :searcher.replace-all] + + [:searcher.search "enter" :searcher.search] + + [:sidebar.clients "esc" :hide-connect] + + [:sidebar.doc.search.input "esc" :docs.search.hide] + [:sidebar.doc.search.input "enter" :docs.search.exec] + + [:tabs "pmeta-8" (:tabs.goto 7)] + [:tabs "pmeta-9" (:tabs.goto :last)] + [:tabs "ctrl-shift-tab" :tabs.prev] + [:tabs "ctrl-tab" :tabs.next] + [:tabs "pmeta-shift-[" :tabs.prev] + [:tabs "pmeta-1" (:tabs.goto 0)] + [:tabs "pmeta-shift-]" :tabs.next] + [:tabs "pmeta-2" (:tabs.goto 1)] + [:tabs "pmeta-3" (:tabs.goto 2)] + [:tabs "pmeta-4" (:tabs.goto 3)] + [:tabs "pmeta-5" (:tabs.goto 4)] + [:tabs "pmeta-6" (:tabs.goto 5)] + [:tabs "pmeta-7" (:tabs.goto 6)] + [:tabs "pmeta-w" :tabs.close] + + [:tree.rename "esc" :workspace.rename.cancel!] + [:tree.rename "enter" :workspace.rename.submit!] +] \ No newline at end of file diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index a6bfcc725..791accdc4 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -138,22 +138,26 @@ (deploy/is-newer? (:version plugin) cached)))) (defn plugin-behaviors [plug] - (let [{:keys [behaviors dir]} plug - file (files/join dir behaviors) - file (files/real-path file) - behs (-> (files/open-sync file) - (:content) - (settings/safe-read file)) - force? (get (::force-reload @manager) file)] - (when force? - (swap! manager update-in [::force-reload] disj file)) - (when behs - (walk/prewalk (fn [x] - (when (list? x) - (alter-meta! x assoc ::dir dir ::force-reload force?)) - x) - behs) - behs))) + (try + (let [{:keys [behaviors dir]} plug + file (files/join dir behaviors) + file (files/real-path file) + behs (-> (files/open-sync file) + (:content) + (settings/safe-read file)) + force? (get (::force-reload @manager) file)] + (when force? + (swap! manager update-in [::force-reload] disj file)) + (when behs + (walk/prewalk (fn [x] + (when (list? x) + (alter-meta! x assoc ::dir dir ::force-reload force?)) + x) + behs) + behs)) + (catch :default e + (console/error (str "Could not load behaviors for plugin: " (:name plug))) + {}))) (defn plugin-dependency-graph [plugins] (into {} diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 9d77ae196..ef317e92c 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -61,10 +61,71 @@ (let [final (behavior-diff diff {:+ @object/tags })] (reset! object/tags (:+ final)))) +(defn keyword->str [kw] + (if (keyword? kw) + (subs (str kw) 1) + kw)) + +(defn flat-behaviors->map [flat] + (let [adds (js-obj) + removes (js-obj)] + (doseq [[tag behavior :as all] flat + :let [[coll behavior] (if (= (aget (keyword->str behavior) 0) "-") + [removes (subs (keyword->str behavior) 1)] + [adds (keyword->str behavior)]) + tag (keyword->str tag)]] + (when-not (aget coll tag) + (aset coll tag (array))) + (.push (aget coll tag) (if (> (count all) 2) + (conj (seq (subvec all 2)) (keyword behavior)) + (keyword behavior)))) + {:+ (js->clj adds :keywordize-keys true) + :- (js->clj removes :keywordize-keys true)})) + + +(defn map->flat-behaviors [behaviors-map] + (let [flat (array)] + ;;Handle the adds + (doseq [[tag behs] (:+ behaviors-map) + :let [tag-vec [tag]] + beh behs + :let [beh (if (coll? beh) + beh + [beh])]] + (.push flat (into tag-vec beh))) + ;;Handle the subtracts + (doseq [[tag behs] (:- behaviors-map) + beh behs + :let [beh (if (coll? beh) + beh + [beh]) + tag-vec [tag (keyword (str "-" (keyword->str (first beh))))]]] + (.push flat (into tag-vec (rest beh)))) + (->> (js->clj flat) + (sort-by first) + (vec)))) + (defn parse-file [file final] - (-> (files/open-sync file) - :content - (safe-read file))) + (let [behs (-> (files/open-sync file) + :content + (safe-read file))] + (cond + (map? behs) behs + (vector? behs) (flat-behaviors->map behs) + :else (console/error (str "Invalid behaviors file: " file ". Behaviors must be either a vector or a map."))))) + +(defn pprint-flat-behaviors [flat] + (-> (reduce (fn [result cur] + (let [new-tag (first cur)] + {:str (str (:str result) + (if-not (= new-tag (:tag result)) + "\n") + "\n " (pr-str cur)) + :tag new-tag})) + {:tag (-> flat first first) :str "["} + flat) + (:str) + (str "\n]"))) (defn behavior-diffs-in [path] (when (files/exists? path) @@ -322,10 +383,56 @@ :reaction (fn [this] (tabs/rem! this))) + +(defn flat-keymap->map [flat] + (let [adds (js-obj) + removes (js-obj)] + (doseq [[tag key :as all] flat + :let [[coll key] (if (and (= (aget (keyword->str key) 0) "-") + (> (count (keyword->str key)) 1)) + [removes (subs (keyword->str key) 1)] + [adds (keyword->str key)]) + remove? (identical? coll removes) + tag (keyword->str tag)]] + (when-not (aget coll tag) + (aset coll tag (if remove? + (array) + (js-obj)))) + (if remove? + (.push (aget coll tag) key) + (aset (aget coll tag) key (subvec all 2)))) + {:+ (into {} (for [[tag keys] (js->clj adds)] + [(keyword tag) keys])) + :- (into {} (for [[tag keys] (js->clj removes)] + [(keyword tag) keys]))})) + +(defn map->flat-keymap [keymap] + (let [flat (array)] + ;;Handle the adds + (doseq [[tag keys] (:+ keymap) + [key commands] keys + :let [tag-vec [tag key]]] + (.push flat (into tag-vec commands))) + ;;Handle the subtracts + (doseq [[tag keys] (:- keymap) + key keys + :let [[key command] (if (map? keys) + key + [key []]) + tag-vec [tag (str "-" key)]]] + (.push flat (into tag-vec commands))) + (->> (js->clj flat) + (sort-by first) + (vec)))) + (defn parse-key-file [file final] - (-> (files/open-sync file) - :content - (safe-read file))) + (let [keys (-> (files/open-sync file) + :content + (safe-read file))] + (cond + (map? keys) keys + (vector? keys) (flat-keymap->map keys) + :else (console/error (str "Invalid keymap file: " file ". Keymaps must be either a vector or a map."))))) (defn keymap-diffs-in [path] (when (files/exists? path) From ca2048457d737357f5d7d9764477838bd14c6437 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 15 Nov 2014 14:26:55 -0800 Subject: [PATCH 296/656] fix out of date check Signed-off-by: Chris Granger --- src/lt/objs/plugins.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 791accdc4..ff862e4e4 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -289,10 +289,14 @@ (select-keys deps unique))) seen))) + +(defn latest-version [plugin] + (get (:versions plugin) (keyword (:latest-version plugin)))) + (defn all-latest [plugins] (->> (dissoc plugins :__sha) (vals) - (map #(get (:versions %) (keyword (:latest-version %)))))) + (map latest-version))) ;; (plugin->tar (:Rainbow (transitive-deps (:server-plugins @manager) ["Rainbow" "0.0.8"] {}))) ;; (save-cache (build-cache)) @@ -531,7 +535,7 @@ {:label "Cancel"}]}))) (defui installed-plugin-ui [plugin] - (let [cached (-> @manager :server-plugins (get (:name plugin)) :latest-version) + (let [cached (-> @manager :server-plugins (get (keyword (:name plugin))) :latest-version) update? (when cached (deploy/is-newer? (:version plugin) cached))] [:li {:class (if update? From cbdbb7a0682df0e6cfde080d67d3e6154f7643a2 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 15 Nov 2014 17:39:06 -0500 Subject: [PATCH 297/656] Bump fetch to get rid of cljs warning Also exclude noir since we don't depend on it --- project.clj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/project.clj b/project.clj index b398ae722..5e1150def 100644 --- a/project.clj +++ b/project.clj @@ -3,8 +3,7 @@ :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] [crate "0.2.5"] - [fetch "0.1.1" :exclusions [org.clojure/clojure]] - ;[core.async "0.1.0-SNAPSHOT"] + [fetch "0.2.0" :exclusions [org.clojure/clojure noir]] [org.clojure/clojurescript "0.0-2138" :exclusions [org.apache.ant/ant]] ] From 143c61d0a7d04a2282df6ca6d3dffe5866484055 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 15 Nov 2014 17:43:11 -0500 Subject: [PATCH 298/656] Fix console/error getting cut off Picked up from warnings --- src/lt/objs/plugins.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index ff862e4e4..91b8698bd 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -100,7 +100,7 @@ (assoc :dir dir) (validate "plugin.edn")) (catch :default e - (console/error "FAILED to load plugin.edn: " dir))) + (console/error (str "FAILED to load plugin.edn: " dir)))) )) (defn plugin-json [dir] From 6f4e4338fc6365ee89a2388d0a3b9d8bdfc20b95 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 15 Nov 2014 14:51:09 -0800 Subject: [PATCH 299/656] fix typo Signed-off-by: Chris Granger --- src/lt/objs/settings.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ef317e92c..ad7845ba9 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -420,7 +420,7 @@ key [key []]) tag-vec [tag (str "-" key)]]] - (.push flat (into tag-vec commands))) + (.push flat (into tag-vec command))) (->> (js->clj flat) (sort-by first) (vec)))) From 6b0c934af1b1f2a746de1c961eb8865595820d80 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 15 Nov 2014 19:20:28 -0500 Subject: [PATCH 300/656] Add a travis config to alert when cljsbuild warnings are checked in --- .travis.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf2b37b39..0221b2eb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,13 @@ language: clojure - +lein: lein +script: "! lein cljsbuild once 2>&1 | grep WARNING:" +jdk: +- oraclejdk8 notifications: - - email: false + irc: "chat.freenode.net#lighttable" + email: + - gabriel.horner@gmail.com + - ibdknox@gmail.com + - mike.j.innes@gmail.com + - joshuafcole@gmail.com + - jamie@scattered-thoughts.net From e215ed806d73ee8e623f7bde86263ba1cc41508d Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 15 Nov 2014 18:08:50 -0800 Subject: [PATCH 301/656] auto completion for the new behaviors syntax, better behavior helper Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 36 +++- deploy/core/css/skins/new-dark.stylus | 15 +- .../lighttable/background/behaviorsParser.js | 88 ++++++++- src/lt/objs/langs/behaviors.cljs | 182 ++++++++---------- 4 files changed, 207 insertions(+), 114 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index d75e86bbd..40731f4ac 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -595,42 +595,56 @@ input { display: inline-block; white-space: pre; } +.behavior-helper-line { + z-index: 10 !important; +} .behavior-helper-result { + padding-left: 10px; + margin: 0; + z-index: 10; + display: inline-block; + width: 0; + height: 10px; + overflow: visible; +} +.behavior-helper-result div { + z-index: 10; white-space: nowrap; display: inline-block; padding-top: 0px; padding-bottom: 0px; - overflow: hidden; margin-left: 0px; - padding-left: 20px; + padding-left: 0px; box-sizing: border-box; background: none; color: #7ffffd; } .behavior-helper-result div { + display: inline-block; white-space: nowrap; width: -webkit-fit-content; background: #3e6b6b; - padding: 0px 5px; + padding: 2px 5px; border-radius: 0px; margin-top: 0px; + border-radius: 3px; } .behavior-helper-result div > * { border-radius: 0px; padding: 0px !important; + vertical-align: middle; } .behavior-helper-result h2 { - display: block; + display: inline-block; width: -webkit-fit-content; white-space: nowrap; } .behavior-helper-result div > span.param { display: inline-block; - margin-right: 8px; - margin-bottom: 3px; + margin-left: 8px; padding: 2px 5px !important; - margin-top: 5px; border: 1px solid #7ffffd; + border-radius: 3px; } .behavior-helper-result div > span.spacer { display: inline-block; @@ -645,11 +659,15 @@ input { .behavior-helper-result .example { display: inline-block; width: auto; - vertical-align: top; - padding: 0; + vertical-align: middle; + padding: 0 !important; margin: 0; margin-left: 5px; border: none; + color: #7ffffd; +} +.behavior-helper-result .active .example { + color: #3e6b6b; } .plugin-manager .version { margin-left: 10px; diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index b0c6deea3..d3ff16ff8 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -257,14 +257,17 @@ input { color: $highlight-fg; background:$highlight-bg; } .jshinterrors { display:inline-block; box-sizing:border-box; padding:2px 10px; border-radius:0px; background:$error-bg; color:$error-fg; } .hintwrapper .spacer { display:inline-block; white-space:pre; } -.behavior-helper-result {white-space:nowrap; display:inline-block; padding-top:0px; padding-bottom:0px; overflow:hidden; margin-left:0px; padding-left:20px; box-sizing:border-box; background:none; color:$usage-fg; } -.behavior-helper-result div { white-space:nowrap; width:-webkit-fit-content; background:$usage-bg; padding:0px 5px; border-radius:0px; margin-top:0px; } -.behavior-helper-result div > * { border-radius:0px; padding:0px !important; } -.behavior-helper-result h2 { display:block; width:-webkit-fit-content; white-space:nowrap; } -.behavior-helper-result div > span.param { display:inline-block; margin-right:8px; margin-bottom:3px; padding:2px 5px !important; margin-top:5px; border:1px solid $usage-fg; } +.behavior-helper-line { z-index:10 !important; } +.behavior-helper-result { padding-left:10px; margin:0; z-index:10; display:inline-block; width:0; height:10px; overflow:visible; } +.behavior-helper-result div { z-index:10; white-space:nowrap; display:inline-block; padding-top:0px; padding-bottom:0px; margin-left:0px; padding-left:0px; box-sizing:border-box; background:none; color:$usage-fg; } +.behavior-helper-result div { display:inline-block; white-space:nowrap; width:-webkit-fit-content; background:$usage-bg; padding:2px 5px; border-radius:0px; margin-top:0px; border-radius:3px; } +.behavior-helper-result div > * { border-radius:0px; padding:0px !important; vertical-align:middle; } +.behavior-helper-result h2 { display:inline-block; width:-webkit-fit-content; white-space:nowrap; } +.behavior-helper-result div > span.param { display:inline-block; margin-left:8px; padding:2px 5px !important; border:1px solid $usage-fg; border-radius:3px; } .behavior-helper-result div > span.spacer { display:inline-block; margin:0 5px; } .behavior-helper-result .active { background: $usage-fg; color:$usage-bg; border-radius:0px; display:inline-block; } -.behavior-helper-result .example { display:inline-block; width:auto; vertical-align:top; padding:0; margin:0; margin-left:5px; border:none; } +.behavior-helper-result .example { display:inline-block; width:auto; vertical-align:middle; padding:0 !important; margin:0; margin-left:5px; border:none; color:$usage-fg; } +.behavior-helper-result .active .example { color: $usage-bg; } .plugin-manager .version { margin-left:10px; color:$hidden-fg; } .plugin-manager h3 { color: $hidden-fg; } diff --git a/deploy/core/node_modules/lighttable/background/behaviorsParser.js b/deploy/core/node_modules/lighttable/background/behaviorsParser.js index 3362529fa..76892f545 100644 --- a/deploy/core/node_modules/lighttable/background/behaviorsParser.js +++ b/deploy/core/node_modules/lighttable/background/behaviorsParser.js @@ -15,7 +15,92 @@ var chars = /[^\s\)\]\}]/; //{:+ {:app {"a" [:foo]}}} -//parseKeymap(new CodeMirror.StringStream("{:+ {:app {\"a\" [:foo (:do-something \"hey\" :woo)]}}}")); +// parseFlat(new CodeMirror.StringStream("[[:app :foo :bar] [:zomg :baz 234 \"hi how are you?\"]]")); +function parseFlat(stream) { + + var state = { level: 0, stack: []}; + var errors = []; + var entries = []; + var curEntry; + + stream.eatSpace(); + while(stream.peek()) { + var ch = stream.next(); + + if (ch == "\"") { + stream.start = stream.pos - 1; + state.mode = "string"; + var pos = stream.pos; + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + + if(state.level === 2) { + curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "string"}); + } + + } else if (ch == ";") { // comment + stream.skipTo("\n"); // rest of the line is a comment + + } else if (ch == "(" || ch == "[" || ch == "{") { + state.stack.push({type: ch, pos: stream.pos}); + state.level++; + if(state.level === 2) { + curEntry = {start: stream.pos - 1, + tokens: []}; + entries.push(curEntry); + } else if(state.level === 3) { + curEntry.tokens.push({start: stream.pos - 1, + type: "collection"}); + } + + } else if (ch == ")" || ch == "]" || ch == "}") { + if(state.stack.length && state.stack[state.stack.length - 1].type == opposites[ch]) { + state.stack.pop(); + state.level--; + + if(state.level === 1) { + curEntry.end = stream.pos; + } else if(state.level === 2) { + curEntry.tokens[curEntry.tokens.length - 1].end = stream.pos; + stream.start = stream.pos; + } + + } else { + var expected = "the end of the file"; + if(state.stack[state.stack.length - 1]) { + var expected = opposites[state.stack[state.stack.length - 1].type]; + } + errors.push({error: "Unmatched delimiter " + ch + " expected to see " + expected + "", from: stream.start, to: stream.pos}); + } + + + } else if ( ch == ":" ) { + stream.start = stream.pos - 1; + stream.eatWhile(chars); + if(state.level === 2) { + curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "keyword"}); + } + stream.start = stream.pos; + } else if(ch.match(chars)) { + stream.start = stream.pos - 1; + var pos = stream.pos; + stream.eatWhile(chars); + if(state.level === 2) { + curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "atom"}); + } + stream.start = stream.pos; + } + } + + return {errors: errors, entries: entries}; +} function parseBehaviors(stream) { @@ -235,3 +320,4 @@ function parseKeymap(stream) { exports.parseBehaviors = parseBehaviors; exports.parseKeymap = parseKeymap; +exports.parseFlat = parseFlat; diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index ebb8910cc..4a434a9fa 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -9,33 +9,15 @@ [lt.util.cljs :refer [js->clj]]) (:require-macros [lt.macros :refer [behavior background defui]])) -(def parser (background (fn [obj-id contents] - (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) - (.-StringStream)) - parser (-> (js/require (str js/ltpath "/core/node_modules/lighttable/background/behaviorsParser.js")) - (.-parseBehaviors)) - parsed (-> (StringStream. contents) - (parser))] - (js/_send obj-id :parsed parsed))))) - -(defn pos->state [ed] - (let [token (editor/->token ed (editor/->cursor ed)) - level (-> (get-in token [:state :overlay :rainbowstack]) - (last) - (:level))] - (cond - (not level) :none - (= level 1) :root - (= level 2) :tag - (= level 3) :behavior - (= level 4) :behavior-param - :else :param))) - -(defn locate [idx positions] - (first (filter #(> (inc (:to %)) idx (dec (:from %))) positions))) +(def flat-parser (background (fn [obj-id contents] + (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) + (.-StringStream)) + parser (-> (js/require (str js/ltpath "/core/node_modules/lighttable/background/behaviorsParser.js")) + (.-parseFlat)) + parsed (-> (StringStream. contents) + (parser))] + (js/_send obj-id :parsed parsed))))) -(defn ->index [this] - (editor/pos->index this (editor/cursor this))) (defn str->ns-keyword [s] (when s @@ -46,87 +28,88 @@ (when (seq parts) (apply keyword parts))))) -(defn pos->behavior [this idx] - (let [res (locate idx (:positions @this))] - (when (and res (:behavior res)) - (assoc res :behavior (@object/behaviors (-> (:behavior res) - (str->ns-keyword) - )))))) - - -(defn index-of [needle haystack] - (first (keep-indexed #(when (= %2 needle) %1) haystack))) - -(defn param-index [idx params] - (when (seq params) - (let [res (locate idx params)] - (when res - (index-of res params))))) - -(defn wrapped-replacement [replace cur] - (replace (str "(" (.-completion cur) " )")) - (cmd/exec! :editor.char-left)) - -(defn ->wrapped-behavior [beh cur] - (aset cur "completion" (str (:name beh))) - (when (:params beh) - (aset cur "select" wrapped-replacement)) - cur) - -(defn user-behavior-completions - ([] (user-behavior-completions nil nil nil)) - ([_ _ token] - (if (and token - (= (subs token 0 1) ":")) - (map #(->wrapped-behavior % #js {:text (str (:name %))}) (vals @object/behaviors)) +(defn ->index [this] + (editor/pos->index this (editor/cursor this))) + +(defn idx->item [idx items] + (first (filter #(> (inc (:end (second %))) idx (dec (:start (second %)))) (map-indexed vector items)))) + +(defn idx->entry-info [idx entries] + (let [[ix entry] (idx->item idx entries) + [tokenIx token] (idx->item idx (:tokens entry)) + [tag behavior & args] (:tokens entry) + tag (if tag (str->ns-keyword (:value tag))) + behavior (if behavior (str->ns-keyword (:value behavior))) + past-last-token (> idx (-> (:tokens entry) + (last) + (:end) + (inc))) + pos (cond + (and (not tokenIx) past-last-token) (count (:tokens entry)) + (not tokenIx) (dec (count (:tokens entry))) + :else tokenIx) + param-pos (if (> pos 1) (- pos 2))] + {:tag tag + :behavior behavior + :param-pos param-pos + :pos pos})) + +(defn user-behavior-completions [token _ _] + (println "token: " (pr-str token)) + (if (and token (= (subs token 0 1) ":")) + (map #(do #js {:text (str (:name %)) :completion (str (:name %))}) (vals @object/behaviors)) (map #(if-not (:desc %) - (->wrapped-behavior % #js {:text (str (:name %))}) - (->wrapped-behavior % #js {:text (:desc %)})) - (filter #(= (:type %) :user) (vals @object/behaviors)))))) - -(def completions {:root [#js {:completion ":+"} - #js {:completion ":-"}] - :tag (fn [] - (map #(do #js {:completion (str %) :text (str %)}) (keys @object/tags))) + #js {:text (str (:name %)) :completion (str (:name %))} + #js {:text (:desc %) :completion (str (:name %))}) + (filter #(= (:type %) :user) (vals @object/behaviors))))) + +(def completions {:tag (fn [] + (map #(do #js {:text (str %) :completion (str %)}) (keys @object/tags))) :behavior user-behavior-completions - :behavior-param (fn [beh idx] - (cond - (not beh) (user-behavior-completions) - (-> beh :behavior :params) (let [params (-> beh :behavior :params ) - cur (or (param-index idx (:args beh)) (if (> (count (:args beh)) 0) - (dec (count (:args beh))) - 0)) - param (get params cur)] - (when (= (:type param) :list) - (if (fn? (:items param)) - ((:items param)) - (:items param)))) - :else nil) - )}) + :behavior-param (fn [token beh param-pos] + (let [params (-> beh :params ) + param (get params param-pos)] + (when (= (:type param) :list) + (if (fn? (:items param)) + ((:items param)) + (:items param)))))}) + +(defn pos->token-type [pos] + (condp = pos + 0 :tag + 1 :behavior + :behavior-param)) (declare helper) (behavior ::behavior-hints - :triggers #{:hints+} - :reaction (fn [this hints token] - (let [comps (completions (pos->state this))] - (if-not comps - hints - (if (fn? comps) - (let [idx (->index this)] - (comps (pos->behavior this (- idx 2)) (dec idx) token)) - comps))))) + :triggers #{:hints+} + :exclusive [:lt.plugins.auto-complete/textual-hints] + :reaction (fn [this hints token] + (let [idx (->index this) + {:keys [tag behavior param-pos pos] :as info} (idx->entry-info idx (:entries @this)) + behavior-info (@object/behaviors behavior) + token-type (pos->token-type pos) + completions-set (completions token-type)] + (println (count hints)) + (println "token type" pos token-type) + ;; (if-not completions-set + ;; hints + (completions-set token behavior-info param-pos token) + ;; ) + ))) (behavior ::show-info-on-move :triggers #{:move} :debounce 200 :reaction (fn [this] - (let [idx (->index this)] - (if-let [beh (or (pos->behavior this idx) (pos->behavior this (dec idx)))] - (when (-> beh :behavior :desc) - (object/raise helper :show! this beh (param-index idx (-> beh :args)))) - (object/raise helper :clear!) - )))) + (let [idx (->index this) + {:keys [tag behavior param-pos] :as info} (idx->entry-info idx (:entries @this)) + behavior-info (@object/behaviors behavior)] + (if (:desc behavior-info) + (object/raise helper :show! this behavior-info param-pos) + (object/raise helper :clear!)) + ))) (behavior ::behavior-hint-pattern :triggers #{:object.instant} @@ -137,7 +120,7 @@ :triggers #{:change :create} :debounce 100 :reaction (fn [this] - (parser this (editor/->val this)))) + (flat-parser this (editor/->val this)))) (behavior ::parsed :triggers #{:parsed} @@ -183,6 +166,7 @@ :triggers #{:clear!} :reaction (fn [this] (when (:mark @this) + (editor/-line-class (:ed @this) (:line @this) :text "behavior-helper-line") (object/raise (:mark @this) :clear!)) (object/merge! this {:content nil}) (object/merge! this {:mark nil @@ -199,8 +183,10 @@ (not= ed (:ed @this))) ;;clear old (when (:mark @this) + (editor/-line-class ed (:line @this) :text "behavior-helper-line") (object/raise (:mark @this) :clear!)) - (object/merge! this {:content (->helper (:behavior beh))}) + (editor/+line-class ed (:line loc) :text "behavior-helper-line") + (object/merge! this {:content (->helper beh)}) (object/merge! this {:mark (inline this ed (assoc loc :prev-line (:line @this))) :behavior beh :line (:line loc) From 86323e5d847670cbea7aca5869d148d0dc5a0fce Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 15 Nov 2014 20:35:15 -0800 Subject: [PATCH 302/656] get autocomplete and the helper working for keymaps as well Signed-off-by: Chris Granger --- .../lighttable/background/behaviorsParser.js | 234 ++---------------- src/lt/objs/langs/keymap.cljs | 135 +++++----- 2 files changed, 83 insertions(+), 286 deletions(-) diff --git a/deploy/core/node_modules/lighttable/background/behaviorsParser.js b/deploy/core/node_modules/lighttable/background/behaviorsParser.js index 76892f545..5215e7951 100644 --- a/deploy/core/node_modules/lighttable/background/behaviorsParser.js +++ b/deploy/core/node_modules/lighttable/background/behaviorsParser.js @@ -57,7 +57,13 @@ function parseFlat(stream) { entries.push(curEntry); } else if(state.level === 3) { curEntry.tokens.push({start: stream.pos - 1, - type: "collection"}); + type: "collection", + tokens: []}); + } else if(state.level === 4) { + var lastToken = curEntry.tokens[curEntry.tokens.length - 1]; + lastToken.tokens.push({start: stream.pos - 1, + type: "collection", + tokens: []}); } } else if (ch == ")" || ch == "]" || ch == "}") { @@ -70,6 +76,10 @@ function parseFlat(stream) { } else if(state.level === 2) { curEntry.tokens[curEntry.tokens.length - 1].end = stream.pos; stream.start = stream.pos; + } else if(state.level === 3) { + var lastToken = curEntry.tokens[curEntry.tokens.length - 1]; + lastToken.tokens[lastToken.tokens.length - 1].end = stream.pos; + stream.start = stream.pos; } } else { @@ -86,6 +96,9 @@ function parseFlat(stream) { stream.eatWhile(chars); if(state.level === 2) { curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "keyword"}); + } else if(state.level === 3) { + var lastToken = curEntry.tokens[curEntry.tokens.length - 1]; + lastToken.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "keyword"}); } stream.start = stream.pos; } else if(ch.match(chars)) { @@ -94,6 +107,9 @@ function parseFlat(stream) { stream.eatWhile(chars); if(state.level === 2) { curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "atom"}); + } else if(state.level === 3) { + var lastToken = curEntry.tokens[curEntry.tokens.length - 1]; + lastToken.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "keyword"}); } stream.start = stream.pos; } @@ -102,222 +118,6 @@ function parseFlat(stream) { return {errors: errors, entries: entries}; } -function parseBehaviors(stream) { - - var state = { addSub: null, tag: null, behavior: null, level: 0, stack: [], args: [] }; - var errors = []; - var positions = []; - - stream.eatSpace(); - while(stream.peek()) { - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - var pos = stream.pos; - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - - if(state.level == 4) { - state.args.push({from: pos - 1, to: stream.pos}); - } - } else if (ch == ";") { // comment - stream.skipTo("\n"); // rest of the line is a comment - - } else if (ch == "(" || ch == "[" || ch == "{") { - state.stack.push({type: ch, pos: stream.pos}); - state.level++; - - if(state.level == 5) { - state.argpos = stream.pos; - } - - } else if (ch == ")" || ch == "]" || ch == "}") { - if(state.stack.length && state.stack[state.stack.length - 1].type == opposites[ch]) { - state.stack.pop(); - state.level--; - - stream.backUp(1); - - if(state.level == 4) { - state.args.push({from: state.argpos - 1, to: stream.pos}); - } else if(state.level == 3) { - positions.push({from: stream.start, to: stream.pos, addSub: state.addSub, tag: state.tag, behavior: state.behavior, args: state.args}); - state.behavior = null; - state.args = []; - } else if(state.level == 2) { - state.behavior = null; - state.tag = null; - state.args = []; - } else if(state.level == 1) { - state.tag = null; - state.addSub = null; - } else if(state.level === 0) { - state.addSub = null; - } - - stream.next(); - - } else { - var expected = "the end of the file"; - if(state.stack[state.stack.length - 1]) { - var expected = opposites[state.stack[state.stack.length - 1].type]; - } - errors.push({error: "Unmatched delimiter " + ch + " expected to see " + expected + "", from: stream.start, to: stream.pos}); - } - - - } else if ( ch == ":" ) { - if(state.level <= 4) { - stream.start = stream.pos - 1; - stream.eatWhile(chars); - } - if(!state.addSub && state.level == 1) { - state.addSub = stream.current(); - if(state.addSub != ":+" && state.addSub != ":-") { - errors.push({error: "Unknown diff key: " + state.addSub + ". Only :+ and :- are allowed.", from: stream.start, to: stream.pos}); - } - } else if(!state.tag && state.level == 2) { - state.tag = stream.current(); - } else if(!state.behavior && state.level == 3) { - positions.push({from: stream.start, to: stream.pos, addSub: state.addSub, tag: state.tag, behavior: stream.current()}); - - } else if(!state.behavior && state.level == 4) { - state.behavior = stream.current(); - - } else if(state.level == 4) { - var pos = stream.pos; - stream.eatWhile(chars); - state.args.push({from: pos, to: stream.pos}); - } - } else if(state.level == 4 && ch.match(chars)) { - var pos = stream.pos; - stream.eatWhile(chars); - state.args.push({from: pos - 1, to: stream.pos}); - } - } - - return {errors: errors, positions: positions}; -} - -function parseKeymap(stream) { - - var state = { addSub: null, tag: null, key: null, command: null, level: 0, stack: [], args: [] }; - var errors = []; - var positions = []; - - stream.eatSpace(); - while(stream.peek()) { - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - var pos = stream.pos - 1; - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - - if(state.level == 3) { - stream.start = pos + 1; - stream.backUp(1); - state.key = stream.current(); - stream.next(); - positions.push({from: pos, to: stream.pos, addSub: state.addSub, tag: state.tag, key: state.key}); - } - - if(state.level == 5) { - state.args.push({from: pos - 1, to: stream.pos}); - } - } else if (ch == ";") { // comment - stream.skipTo("\n"); // rest of the line is a comment - - } else if (ch == "(" || ch == "[" || ch == "{") { - state.stack.push({type: ch, pos: stream.pos}); - state.level++; - - if(state.level == 6) { - state.argpos = stream.pos; - } - - } else if (ch == ")" || ch == "]" || ch == "}") { - if(state.stack.length && state.stack[state.stack.length - 1].type == opposites[ch]) { - state.stack.pop(); - state.level--; - - stream.backUp(1); - - if(state.level == 5) { - state.args.push({from: state.argpos - 1, to: stream.pos}); - } else if(state.level == 4) { - positions.push({from: stream.start, to: stream.pos, addSub: state.addSub, tag: state.tag, key: state.key, command:state.command, args: state.args}); - state.command = null; - state.args = []; - } else if(state.level == 3) { - state.command = null; - state.key = null; - state.args = []; - } else if(state.level == 2) { - state.tag = null; - } else if(state.level == 1) { - state.tag = null; - state.addSub = null; - } else if(state.level === 0) { - state.addSub = null; - } - - stream.next(); - - } else { - errors.push({error: "Unmatched delimiter " + ch + " expected to see " + opposites[state.stack[state.stack.length - 1].type] + "", from: stream.start, to: stream.pos}); - } - - - } else if ( ch == ":" ) { - if(state.level <= 5) { - stream.start = stream.pos - 1; - stream.eatWhile(chars); - } - if(!state.addSub && state.level == 1) { - state.addSub = stream.current(); - if(state.addSub != ":+" && state.addSub != ":-") { - errors.push({error: "Unknown diff key: " + state.addSub + ". Only :+ and :- are allowed.", from: stream.start, to: stream.pos}); - } - } else if(!state.tag && state.level == 2) { - state.tag = stream.current(); - } else if(!state.command && state.level == 4) { - positions.push({from: stream.start, to: stream.pos, addSub: state.addSub, tag: state.tag, key:state.key, command: stream.current()}); - - } else if(!state.command && state.level == 5) { - state.command = stream.current(); - - } else if(state.level == 6) { - var pos = stream.pos; - stream.eatWhile(chars); - state.args.push({from: pos, to: stream.pos}); - } - } else if(state.level == 6 && ch.match(chars)) { - var pos = stream.pos; - stream.eatWhile(chars); - state.args.push({from: pos - 1, to: stream.pos}); - } - } - - return {errors: errors, positions: positions}; -} - exports.parseBehaviors = parseBehaviors; exports.parseKeymap = parseKeymap; exports.parseFlat = parseFlat; diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index 42749fbf1..9c4d28ab5 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -3,69 +3,60 @@ [lt.objs.context :as ctx] [lt.objs.command :as cmd] [lt.util.dom :as dom] + [lt.objs.langs.behaviors :as beh] [lt.objs.editor :as editor] [clojure.string :as string] [lt.util.cljs :refer [js->clj]]) (:require-macros [lt.macros :refer [behavior background defui]])) -(def parser (background (fn [obj-id contents] - (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) - (.-StringStream)) - parser (-> (js/require (str js/ltpath "/core/node_modules/lighttable/background/behaviorsParser.js")) - (.-parseKeymap)) - parsed (-> (StringStream. contents) - (parser))] - (js/_send obj-id :parsed parsed))))) - -(defn pos->state [ed] - (let [token (editor/->token ed (editor/->cursor ed)) - level (-> (get-in token [:state :overlay :rainbowstack]) - (last) - (:level))] - (cond - (not level) :none - (= level 1) :root - (= level 2) :tag - (= level 4) :key - (= level 5) :key-and-params - :else :param))) - -(defn locate [idx positions] - (first (filter #(> (inc (:to %)) idx (dec (:from %))) positions))) - -(defn ->index [this] - (editor/pos->index this (editor/cursor this))) - -(defn str->ns-keyword [s] - (when s - (let [s (if (= ":" (first s)) - (subs s 1) - s) - parts (string/split s "/")] - (when (seq parts) - (apply keyword parts))))) - -(defn pos->key [this idx] - (let [res (locate idx (:positions @this))] - (when (and res (:command res)) - (assoc res :command ((:commands @cmd/manager) (-> (:command res) - (str->ns-keyword) - )))))) - -(defn index-of [needle haystack] - (first (keep-indexed #(when (= %2 needle) %1) haystack))) - -(defn param-index [idx params] - (when (seq params) - (let [res (locate idx params)] - (when res - (index-of res params))))) - -(def completions {:root [#js {:completion ":+"} - #js {:completion ":-"}] - :tag (fn [] - (map #(do #js {:completion (str %) :text (str %)}) (keys @object/tags))) - :key cmd/completions}) + +(def completions {:tag (:tag beh/completions) + :command cmd/completions}) + +(defn idx->entry-info [idx entries] + (let [[ix entry] (beh/idx->item idx entries) + [tokenIx token] (beh/idx->item idx (:tokens entry)) + [argIx arg] (when (:tokens token) + (beh/idx->item idx (:tokens token))) + [tag key first-command] (:tokens entry) + tag (if tag (beh/str->ns-keyword (:value tag))) + past-last-token (> idx (-> (:tokens entry) + (last) + (:end) + (inc))) + pos (cond + (and (not tokenIx) past-last-token) (count (:tokens entry)) + (not tokenIx) (dec (count (:tokens entry))) + :else tokenIx) + past-last-arg (> idx (-> (:tokens token) + (last) + (:end) + (inc))) + arg-pos (when (:tokens token) + (cond + (and (not argIx) past-last-arg) (count (:tokens token)) + (not argIx) (dec (count (:tokens token))) + :else argIx)) + command (if (and tokenIx (> tokenIx 1)) + (cond + arg-pos (beh/str->ns-keyword (-> (:tokens token) first :value)) + :else (beh/str->ns-keyword (:value token)))) + first-command (if first-command + (cond + (:tokens first-command) (beh/str->ns-keyword (-> (:tokens first-command) first :value)) + :else (beh/str->ns-keyword (:value first-command))))] + {:tag tag + :key key + :first-command first-command + :command-at-pos command + :arg-pos arg-pos + :pos pos})) + +(defn pos->token-type [pos] + (condp = pos + 0 :tag + 1 :key + :command)) (declare helper) @@ -73,21 +64,25 @@ :triggers #{:hints+} :exclusive [:lt.plugins.auto-complete/textual-hints] :reaction (fn [this hints token] - (let [comps (completions (pos->state this))] + (let [idx (beh/->index this) + {:keys [tag key pos command-at-pos arg-pos]} (idx->entry-info idx (:entries @this)) + comps (when (or (not arg-pos) + (< arg-pos 1)) + (completions (pos->token-type pos)))] (if-not comps hints - (if (fn? comps) - (comps token) - comps))))) + (comps token))))) (behavior ::show-info-on-move :triggers #{:move} :debounce 200 :reaction (fn [this] - (let [idx (->index this)] - (when-let [beh (pos->key this idx)] - (object/raise helper :show! this beh (param-index idx (-> beh :args))) - )))) + (let [idx (beh/->index this) + {:keys [command-at-pos arg-pos first-command]} (idx->entry-info idx (:entries @this)) + command (get (:commands @cmd/manager) (or command-at-pos first-command))] + (if command + (object/raise helper :show! this command arg-pos) + (object/raise helper :clear! this))))) (behavior ::keymap-hint-pattern :triggers #{:object.instant} @@ -98,7 +93,7 @@ :triggers #{:change :create} :debounce 50 :reaction (fn [this] - (parser this (editor/->val this)))) + (beh/flat-parser this (editor/->val this)))) (behavior ::parsed :triggers #{:parsed} @@ -111,7 +106,7 @@ :class "behavior-helper" :opts opts :result (object/->content this) - :above (boolean (< (:prev-line opts) (:line opts))) + :above (boolean (< (:prev-line opts) (:line opts))) :loc opts :line (editor/line-handle ed (:line opts))})) @@ -147,8 +142,10 @@ (not= ed (:ed @this))) ;;clear old (when (:mark @this) + (editor/-line-class ed (:line @this) :text "behavior-helper-line") (object/raise (:mark @this) :clear!)) - (object/merge! this {:content (->helper (:command keym))}) + (editor/+line-class ed (:line loc) :text "behavior-helper-line") + (object/merge! this {:content (->helper keym)}) (object/merge! this {:mark (inline this ed (assoc loc :prev-line (:line @this))) :key keym :line (:line loc) From 5439ed86227912180fbfb9b5eb3e3f00b4cdb112 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 16 Nov 2014 10:56:59 -0500 Subject: [PATCH 303/656] Revert quote pair from 82fe8cbfc8001c550182b8ae900c022d003e46c5 This isn't desired for lisps and there isn't currently a clean way to disable this just for them --- deploy/settings/default/default.keymap | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index ce05f9bae..7ffa2d383 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -29,7 +29,6 @@ [:editor.keys.normal "\"" (:editor.repeat-pair "\"")] [:editor.keys.normal "pmeta-shift-g" :find.prev] - [:editor.keys.normal "'" (:editor.repeat-pair "'")] [:editor.keys.normal "(" (:editor.open-pair "(")] [:editor.keys.normal ")" (:editor.close-pair ")")] [:editor.keys.normal "pmeta-f" :find.fill-selection :find.show] @@ -101,4 +100,4 @@ [:tree.rename "esc" :workspace.rename.cancel!] [:tree.rename "enter" :workspace.rename.submit!] -] \ No newline at end of file +] From 72408f6182638ddeb2f31be29affaccef46255a1 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 16 Nov 2014 11:28:42 -0500 Subject: [PATCH 304/656] Move pair keybindings out of default to a behavior close #1713 Pair keys are overriding keys that are not pair keys for many international keyboards. See #620, #734, #1358, #1538, #1599, #1632. Until we can handle this properly, provide pair keys as a behavior so they can be easily used by keyboards that do work with them. --- deploy/settings/default/default.keymap | 7 ------- src/lt/objs/settings.cljs | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 7ffa2d383..7e7b33c96 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -27,17 +27,10 @@ [:editor.keys.hinting.active "enter" :passthrough] - [:editor.keys.normal "\"" (:editor.repeat-pair "\"")] [:editor.keys.normal "pmeta-shift-g" :find.prev] - [:editor.keys.normal "(" (:editor.open-pair "(")] - [:editor.keys.normal ")" (:editor.close-pair ")")] [:editor.keys.normal "pmeta-f" :find.fill-selection :find.show] [:editor.keys.normal "pmeta-g" :find.next] [:editor.keys.normal "tab" :auto-complete] - [:editor.keys.normal "[" (:editor.open-pair "[")] - [:editor.keys.normal "{" (:editor.open-pair "{")] - [:editor.keys.normal "]" (:editor.close-pair "]")] - [:editor.keys.normal "}" (:editor.close-pair "}")] [:editor.keys.normal "backspace" :editor.backspace-pair :editor.backspace-indent] [:filter-list.input "down" (:filter-list.input.move-selection 1)] diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ad7845ba9..59b2242ad 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -452,6 +452,20 @@ :reaction (fn [this diffs] (concat diffs (keymap-diffs-in user-plugin-dir)))) +(def pair-keybindings + {:editor.keys.normal {"\"" ['(:editor.repeat-pair "\"")] + "(" ['(:editor.open-pair "(")] + ")" ['(:editor.close-pair ")")] + "[" ['(:editor.open-pair "[")] + "{" ['(:editor.open-pair "{")] + "]" ['(:editor.close-pair "]")] + "}" ['(:editor.close-pair "}")]}}) + +(behavior ::pair-keymap-diffs + :triggers #{:keymap.diffs.user+} + :reaction (fn [this diffs] + (concat diffs (list {:+ pair-keybindings})))) + (behavior ::on-behaviors-editor-save :triggers #{:saved} :reaction (fn [editor] From f005cc7565fcf0b557340fe7c10e7b377f3825d9 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 18 Nov 2014 00:48:36 -0500 Subject: [PATCH 305/656] Remove exports of removed fns These were causing multiple console errors: ReferenceError: parseKeymap is not defined --- .../core/node_modules/lighttable/background/behaviorsParser.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/deploy/core/node_modules/lighttable/background/behaviorsParser.js b/deploy/core/node_modules/lighttable/background/behaviorsParser.js index 5215e7951..643cdac4b 100644 --- a/deploy/core/node_modules/lighttable/background/behaviorsParser.js +++ b/deploy/core/node_modules/lighttable/background/behaviorsParser.js @@ -118,6 +118,4 @@ function parseFlat(stream) { return {errors: errors, entries: entries}; } -exports.parseBehaviors = parseBehaviors; -exports.parseKeymap = parseKeymap; exports.parseFlat = parseFlat; From 82a8c5ad4a6c685c6c7b6590ff58f4075f2e3e4f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 18 Nov 2014 01:38:22 -0500 Subject: [PATCH 306/656] Remove debugging statements when autocompleting behaviors --- src/lt/objs/langs/behaviors.cljs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 4a434a9fa..499977653 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -55,7 +55,6 @@ :pos pos})) (defn user-behavior-completions [token _ _] - (println "token: " (pr-str token)) (if (and token (= (subs token 0 1) ":")) (map #(do #js {:text (str (:name %)) :completion (str (:name %))}) (vals @object/behaviors)) (map #(if-not (:desc %) @@ -91,13 +90,7 @@ behavior-info (@object/behaviors behavior) token-type (pos->token-type pos) completions-set (completions token-type)] - (println (count hints)) - (println "token type" pos token-type) - ;; (if-not completions-set - ;; hints - (completions-set token behavior-info param-pos token) - ;; ) - ))) + (completions-set token behavior-info param-pos token)))) (behavior ::show-info-on-move :triggers #{:move} From 0515e5f48df0881bc4df456f35273483b8383808 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 18 Nov 2014 01:58:06 -0500 Subject: [PATCH 307/656] Add newlines to file-types behavior args to be diff friendly --- deploy/settings/default/default.behaviors | 49 ++++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 914c075bb..ff5711a16 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -267,7 +267,52 @@ [:evaler :lt.objs.eval/alert-on-no-client] [:files :lt.objs.opener/save-failed] - [:files :lt.objs.files/file-types [{:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} {:exts [:cpp :mm :cc], :mime "text/x-c++src", :tags [:editor.cpp], :name "C++"} {:exts [:h], :mime "text/x-c++hdr", :tags [:editor.cpph], :name "C++ Header"} {:exts [:cs], :mime "text/x-csharpr", :tags [:editor.csharp], :name "C#"} {:exts [:coffee], :mime "text/x-coffeescript", :tags [:editor.coffee], :name "CoffeeScript"} {:exts [:cl :lisp], :mime "text/x-common-lisp", :tags [:editor.common-lisp], :name "Common Lisp"} {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} {:exts [:haml], :mime "text/x-haml", :tags [:editor.haml], :name "HAML"} {:exts [:hs], :mime "text/x-haskell", :tags [:editor.haskell], :name "Haskell"} {:exts [:hx], :mime "text/x-haxe", :tags [:editor.haxe], :name "Haxe"} {:exts [:html :htm], :mime "htmlmixed", :tags [:editor.html], :name "HTML"} {:exts [:ini], :mime "text/x-ini", :tags [:editor.ini], :name "INI"} {:exts [:java], :mime "text/x-java", :tags [:editor.java], :name "Java"} {:exts [:jl], :mime "text/x-julia", :tags [:editor.julia], :name "Julia"} {:exts [:latex :tex], :mime "text/x-stex", :tags [:editor.latex], :name "LaTeX"} {:exts [:less], :mime "text/x-less", :tags [:editor.less], :name "LESS"} {:exts [:behaviors], :mime "text/x-clojurescript", :tags [:editor.behaviors], :name "Light Table Behaviors"} {:exts [:keymap], :mime "text/x-clojurescript", :tags [:editor.keymap], :name "Light Table Keymap"} {:exts [:ls], :mime "text/x-livescript", :tags [:editor.livescript], :name "LiveScript"} {:exts [:lua], :mime "text/x-lua", :tags [:editor.lua], :name "Lua"} {:exts [:md :markdown], :mime "text/x-markdown", :tags [:editor.markdown], :name "Markdown"} {:exts [], :mime "text/x-mysql", :tags [:editor.sql :editor.mysql], :name "MySQL"} {:exts [:ocaml :ml], :mime "text/x-ocaml", :tags [:editor.ocaml], :name "OCaml"} {:exts [:pas], :mime "text/x-pascal", :tags [:editor.pascal], :name "Pascal"} {:exts [:pl], :mime "text/x-perl", :tags [:editor.perl], :name "Perl"} {:exts [:php], :mime "text/x-php", :tags [:editor.php], :name "PHP"} {:exts [:txt], :mime "plaintext", :tags [:editor.plaintext], :name "Plain Text"} {:exts [:py :pyw], :mime "text/x-python", :tags [:editor.python], :name "Python"} {:exts [:r], :mime "text/x-rsrc", :tags [:editor.r], :name "R"} {:exts [:rb], :mime "text/x-ruby", :tags [:editor.ruby], :name "Ruby"} {:exts [:rs], :mime "text/x-rustsrc", :tags [:editor.rust], :name "Rust"} {:exts [:sass], :mime "text/x-sass", :tags [:editor.sass], :name "Sass"} {:exts [:scala], :mime "text/x-scala", :tags [:editor.scala], :name "Scala"} {:exts [:ss :scm :sch], :mime "text/x-scheme", :tags [:editor.scheme], :name "Scheme"} {:exts [:sh :bash :profile :bash_profile :bashrc :zsh :zshrc], :mime "text/x-sh", :tags [:editor.shell], :name "Shell"} {:exts [:smarty], :mime "text/x-smarty", :tags [:editor.smarty], :name "Smarty"} {:exts [:sparql], :mime "text/x-sparql-query", :tags [:editor.sparql], :name "SPARQL"} {:exts [:sql], :mime "text/x-sql", :tags [:editor.sql], :name "SQL"} {:exts [:ts], :mime "text/x-typescript", :tags [:editor.typescript], :name "TypeScript"} {:exts [:vb], :mime "text/x-vb", :tags [:editor.visualbasic], :name "VB"} {:exts [:xml], :mime "application/xml", :tags [:editor.xml], :name "XML"} {:exts [:yml :yaml], :mime "text/x-yaml", :tags [:editor.yaml], :name "YAML"}]] + [:files :lt.objs.files/file-types [{:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} + {:exts [:cpp :mm :cc], :mime "text/x-c++src", :tags [:editor.cpp], :name "C++"} + {:exts [:h], :mime "text/x-c++hdr", :tags [:editor.cpph], :name "C++ Header"} + {:exts [:cs], :mime "text/x-csharpr", :tags [:editor.csharp], :name "C#"} + {:exts [:coffee], :mime "text/x-coffeescript", :tags [:editor.coffee], :name "CoffeeScript"} + {:exts [:cl :lisp], :mime "text/x-common-lisp", :tags [:editor.common-lisp], :name "Common Lisp"} + {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} + {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} + {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} + {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} + {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} + {:exts [:haml], :mime "text/x-haml", :tags [:editor.haml], :name "HAML"} + {:exts [:hs], :mime "text/x-haskell", :tags [:editor.haskell], :name "Haskell"} + {:exts [:hx], :mime "text/x-haxe", :tags [:editor.haxe], :name "Haxe"} + {:exts [:html :htm], :mime "htmlmixed", :tags [:editor.html], :name "HTML"} + {:exts [:ini], :mime "text/x-ini", :tags [:editor.ini], :name "INI"} + {:exts [:java], :mime "text/x-java", :tags [:editor.java], :name "Java"} + {:exts [:jl], :mime "text/x-julia", :tags [:editor.julia], :name "Julia"} + {:exts [:latex :tex], :mime "text/x-stex", :tags [:editor.latex], :name "LaTeX"} + {:exts [:less], :mime "text/x-less", :tags [:editor.less], :name "LESS"} + {:exts [:behaviors], :mime "text/x-clojurescript", :tags [:editor.behaviors], :name "Light Table Behaviors"} + {:exts [:keymap], :mime "text/x-clojurescript", :tags [:editor.keymap], :name "Light Table Keymap"} + {:exts [:ls], :mime "text/x-livescript", :tags [:editor.livescript], :name "LiveScript"} + {:exts [:lua], :mime "text/x-lua", :tags [:editor.lua], :name "Lua"} + {:exts [:md :markdown], :mime "text/x-markdown", :tags [:editor.markdown], :name "Markdown"} + {:exts [], :mime "text/x-mysql", :tags [:editor.sql :editor.mysql], :name "MySQL"} + {:exts [:ocaml :ml], :mime "text/x-ocaml", :tags [:editor.ocaml], :name "OCaml"} + {:exts [:pas], :mime "text/x-pascal", :tags [:editor.pascal], :name "Pascal"} + {:exts [:pl], :mime "text/x-perl", :tags [:editor.perl], :name "Perl"} + {:exts [:php], :mime "text/x-php", :tags [:editor.php], :name "PHP"} + {:exts [:txt], :mime "plaintext", :tags [:editor.plaintext], :name "Plain Text"} + {:exts [:py :pyw], :mime "text/x-python", :tags [:editor.python], :name "Python"} + {:exts [:r], :mime "text/x-rsrc", :tags [:editor.r], :name "R"} + {:exts [:rb], :mime "text/x-ruby", :tags [:editor.ruby], :name "Ruby"} + {:exts [:rs], :mime "text/x-rustsrc", :tags [:editor.rust], :name "Rust"} + {:exts [:sass], :mime "text/x-sass", :tags [:editor.sass], :name "Sass"} + {:exts [:scala], :mime "text/x-scala", :tags [:editor.scala], :name "Scala"} + {:exts [:ss :scm :sch], :mime "text/x-scheme", :tags [:editor.scheme], :name "Scheme"} + {:exts [:sh :bash :profile :bash_profile :bashrc :zsh :zshrc], :mime "text/x-sh", :tags [:editor.shell], :name "Shell"} + {:exts [:smarty], :mime "text/x-smarty", :tags [:editor.smarty], :name "Smarty"} + {:exts [:sparql], :mime "text/x-sparql-query", :tags [:editor.sparql], :name "SPARQL"} + {:exts [:sql], :mime "text/x-sql", :tags [:editor.sql], :name "SQL"} + {:exts [:ts], :mime "text/x-typescript", :tags [:editor.typescript], :name "TypeScript"} + {:exts [:vb], :mime "text/x-vb", :tags [:editor.visualbasic], :name "VB"} + {:exts [:xml], :mime "application/xml", :tags [:editor.xml], :name "XML"} + {:exts [:yml :yaml], :mime "text/x-yaml", :tags [:editor.yaml], :name "YAML"}]] [:filter-list :lt.objs.sidebar.command/select!] [:filter-list :lt.objs.sidebar.command/filter-inactive] @@ -556,4 +601,4 @@ [:workspace.root :lt.objs.sidebar.workspace/add-ws-file] [:ws.client :lt.objs.clients.ws/send!] -] \ No newline at end of file +] From 2f66a82786e98ff3972b6728cf28034ea5705665 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:23:45 -0800 Subject: [PATCH 308/656] fix clear for behaviors helper Signed-off-by: Chris Granger --- src/lt/objs/langs/behaviors.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 499977653..2455d541c 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -159,7 +159,8 @@ :triggers #{:clear!} :reaction (fn [this] (when (:mark @this) - (editor/-line-class (:ed @this) (:line @this) :text "behavior-helper-line") + (when (and (:ed @this) @(:ed @this)) + (editor/-line-class (:ed @this) (:line @this) :text "behavior-helper-line")) (object/raise (:mark @this) :clear!)) (object/merge! this {:content nil}) (object/merge! this {:mark nil From 90fe1b3bd5738d0d2c9376a3d72f8c5fc60e0c82 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:33:36 -0800 Subject: [PATCH 309/656] revert 4c6bbd42 Signed-off-by: Chris Granger --- deploy/settings/default/default.behaviors | 18 +++++++++--------- src/lt/objs/console.cljs | 6 +++--- src/lt/objs/status_bar.cljs | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index ff5711a16..908d2de6b 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -47,8 +47,8 @@ [:app :lt.objs.plugins/plugin-behavior-diffs] [:app :lt.objs.plugins/plugin-keymap-diffs] [:app :lt.objs.plugins/behaviors.refreshed-load-keys] - [:app :lt.objs.status-bar/init-status-bar] - [:app :lt.objs.status-bar/show-status-bar] + [:app :lt.objs.statusbar/init-statusbar] + [:app :lt.objs.statusbar/show-statusbar] [:app :lt.objs.workspace/init-workspace-cache-dir] [:app :lt.objs.metrics/init-metrics] [:app :lt.objs.keyboard/chord-timeout 1000] @@ -206,7 +206,7 @@ [:editor :lt.plugins.auto-complete/remove-on-scroll-inactive] [:editor :lt.plugins.auto-complete/auto-show-on-input] - [:editor.active :lt.objs.status-bar/report-cursor-location] + [:editor.active :lt.objs.statusbar/report-cursor-location] [:editor.behaviors :lt.objs.settings/on-behaviors-editor-save] [:editor.behaviors :lt.objs.settings/eval-settings] @@ -475,13 +475,13 @@ [:sidebar.workspace :lt.objs.sidebar.workspace/recent!] [:sidebar.workspace :lt.objs.sidebar.workspace/tree!] - [:status-bar-item :lt.objs.status-bar/on-show!] - [:status-bar-item :lt.objs.status-bar/on-hide!] - [:status-bar-item :lt.objs.status-bar/init-status-bar] + [:statusbar-item :lt.objs.statusbar/on-show!] + [:statusbar-item :lt.objs.statusbar/on-hide!] + [:statusbar-item :lt.objs.statusbar/init-statusbar] - [:status.console-toggle :lt.objs.console/status-bar-console-toggle] - [:status.console-toggle :lt.objs.console/status-bar-console-hide] - [:status.console-toggle :lt.objs.console/status-bar-console-show] + [:status.console-toggle :lt.objs.console/statusbar-console-toggle] + [:status.console-toggle :lt.objs.console/statusbar-console-hide] + [:status.console-toggle :lt.objs.console/statusbar-console-show] [:tab-label :lt.objs.menu/menu!] [:tab-label :lt.objs.tabs/tab-label-menu+] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 0842a5ce4..1e377e829 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -182,7 +182,7 @@ (cmd/exec! :console-tab))})))) ;; @FIXME: rename to status-bar ? -(behavior ::status-bar-console-toggle +(behavior ::statusbar-console-toggle :triggers #{:toggle} :reaction (fn [this] (object/raise bottombar/bottombar :toggle console) @@ -192,7 +192,7 @@ )) ;; @FIXME: rename to status-bar ? -(behavior ::status-bar-console-show +(behavior ::statusbar-console-show :triggers #{:show!} :reaction (fn [this] (object/raise bottombar/bottombar :show! console) @@ -202,7 +202,7 @@ )) ;; @FIXME: rename to status-bar ? -(behavior ::status-bar-console-hide +(behavior ::statusbar-console-hide :triggers #{:hide!} :reaction (fn [this] (object/raise bottombar/bottombar :hide! console))) diff --git a/src/lt/objs/status_bar.cljs b/src/lt/objs/status_bar.cljs index 96884f853..4760b996a 100644 --- a/src/lt/objs/status_bar.cljs +++ b/src/lt/objs/status_bar.cljs @@ -51,7 +51,7 @@ (object/merge! this {::shown false}) (object/raise tabs/multi :tabset-bottom! (- (:height @this)))))) -(behavior ::init-status-bar +(behavior ::init-statusbar :triggers #{:init} :reaction (fn [app] (dom/append (object/->content tabs/multi) (object/->content container)))) @@ -77,7 +77,7 @@ (add-container status) ;; @FIXME: Should we rename to `::show-status` ? -(behavior ::show-status-bar +(behavior ::show-statusbar :desc "App: Show status at the bottom of the editor" :type :user :triggers #{:init} From 3bb20e76275103473946b7c08354e1d36efa32f4 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:39:49 -0800 Subject: [PATCH 310/656] revert af2b058b2b39a452f4fa60cbddc90628eebf5a33 Signed-off-by: Chris Granger --- src/lt/objs/console.cljs | 30 +++++++++---------- src/lt/objs/find.cljs | 4 +-- src/lt/objs/notifos.cljs | 12 ++++---- .../objs/{status_bar.cljs => statusbar.cljs} | 16 +++++----- 4 files changed, 31 insertions(+), 31 deletions(-) rename src/lt/objs/{status_bar.cljs => statusbar.cljs} (95%) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 1e377e829..ee21c38f2 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -4,7 +4,7 @@ [lt.objs.files :as files] [lt.objs.bottombar :as bottombar] [lt.objs.command :as cmd] - [lt.objs.status-bar :as status-bar] + [lt.objs.statusbar :as statusbar] [lt.objs.tabs :as tabs] [clojure.string :as string] [lt.util.dom :refer [$ append empty parents] :as dom] @@ -38,7 +38,7 @@ (when (> (count (dom/children $console)) (dec console-limit)) (dom/remove (aget (dom/children $console) 0))) (when-not (bottombar/active? console) - (status-bar/dirty)) + (statusbar/dirty)) (append $console msg)) (defn write-to-log [thing] @@ -63,7 +63,7 @@ nil))))) (defn error [e] - (status-bar/console-class "error") + (statusbar/console-class "error") (log (str (cond (.-stack e) (.-stack e) (string? e) e @@ -112,7 +112,7 @@ (when str-content (write-to-log str-content)) (when class - (status-bar/console-class class)) + (statusbar/console-class class)) (write $console (->item thing class)) (dom/scroll-top $console 10000000000) nil))) @@ -181,27 +181,27 @@ (cmd/exec! :toggle-console) (cmd/exec! :console-tab))})))) -;; @FIXME: rename to status-bar ? +;; @FIXME: rename to statusbar ? (behavior ::statusbar-console-toggle :triggers #{:toggle} :reaction (fn [this] (object/raise bottombar/bottombar :toggle console) (when (bottombar/active? console) (dom/scroll-top (object/->content console) 10000000000) - (status-bar/clean)) + (statusbar/clean)) )) -;; @FIXME: rename to status-bar ? +;; @FIXME: rename to statusbar ? (behavior ::statusbar-console-show :triggers #{:show!} :reaction (fn [this] (object/raise bottombar/bottombar :show! console) (when (bottombar/active? console) (dom/scroll-top (object/->content console) 10000000000) - (status-bar/clean)) + (statusbar/clean)) )) -;; @FIXME: rename to status-bar ? +;; @FIXME: rename to statusbar ? (behavior ::statusbar-console-hide :triggers #{:hide!} :reaction (fn [this] @@ -214,7 +214,7 @@ :desc "Console: Open the console in a tab" :exec (fn [] (when (not= :tab (:current-ui @console)) ; Running the command when tab is already opened in a tab was creating another new tab each time. - (object/raise status-bar/console-toggle :hide!) + (object/raise statusbar/console-toggle :hide!) (object/merge! console {:current-ui :tab}) (tabs/add! console) ))}) @@ -225,8 +225,8 @@ :hidden true :exec (fn [] (if (= (:current-ui @console) :tab) - (do (tabs/active! console) (status-bar/clean)) - (object/raise status-bar/console-toggle :show!)))}) + (do (tabs/active! console) (statusbar/clean)) + (object/raise statusbar/console-toggle :show!)))}) (cmd/command {:command :console.hide :desc "Console: Hide console" @@ -234,14 +234,14 @@ :exec (fn [] (if (= (:current-ui @console) :tab) (object/raise console :close) - (object/raise status-bar/console-toggle :hide!)))}) + (object/raise statusbar/console-toggle :hide!)))}) (cmd/command {:command :toggle-console :desc "Console: Toggle console" :exec (fn [] (if (= (:current-ui @console) :tab) - (do (tabs/active! console) (status-bar/clean)) - (object/raise status-bar/console-toggle :toggle)))}) + (do (tabs/active! console) (statusbar/clean)) + (object/raise statusbar/console-toggle :toggle)))}) (cmd/command {:command :clear-console :desc "Console: Clear console" diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 783eec7fb..08c96b103 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -1,7 +1,7 @@ (ns lt.objs.find (:require [lt.object :as object] [lt.objs.context :as ctx] - [lt.objs.status-bar :as status-bar] + [lt.objs.statusbar :as statusbar] [lt.util.load :as load] [lt.objs.canvas :as canvas] [lt.objs.sidebar.command :as cmd] @@ -158,7 +158,7 @@ )) (def bar (object/create ::find-bar)) -(status-bar/add-container bar) +(statusbar/add-container bar) (cmd/command {:command :find.show :desc "Find: In current editor" diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 6cb2170ef..6eef2cf55 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -1,6 +1,6 @@ (ns lt.objs.notifos (:require [lt.object :as object] - [lt.objs.status-bar :as status-bar] + [lt.objs.statusbar :as statusbar] [lt.objs.command :as cmd] [lt.util.js :refer [wait]] [crate.binding :refer [map-bound bound deref?]]) @@ -12,7 +12,7 @@ (let [m (if (string? m) m (pr-str m))] - (object/merge! status-bar/status-loader (merge {:message m :class ""} opts)))) + (object/merge! statusbar/status-loader (merge {:message m :class ""} opts)))) (declare cur-timeout) @@ -32,17 +32,17 @@ ([msg] (when msg (set-msg! msg)) - (status-bar/loader-inc))) + (statusbar/loader-inc))) (defn done-working ([] - (status-bar/loader-dec)) + (statusbar/loader-dec)) ([msg] (set-msg! msg) - (status-bar/loader-dec))) + (statusbar/loader-dec))) (cmd/command {:command :reset-working :desc "Status Bar: Reset working indicator" :exec (fn [] - (status-bar/loader-set) + (statusbar/loader-set) )}) diff --git a/src/lt/objs/status_bar.cljs b/src/lt/objs/statusbar.cljs similarity index 95% rename from src/lt/objs/status_bar.cljs rename to src/lt/objs/statusbar.cljs index 4760b996a..c73ebbd70 100644 --- a/src/lt/objs/status_bar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -1,4 +1,4 @@ -(ns lt.objs.status-bar +(ns lt.objs.statusbar (:require [lt.object :as object] [lt.objs.tabs :as tabs] [lt.objs.canvas :as canvas] @@ -11,24 +11,24 @@ (:require-macros [lt.macros :refer [behavior defui]])) ;;********************************************************** -;; status-bar container +;; statusbar container ;;********************************************************** -(object/object* ::status-bar - :tags #{:status-bar} +(object/object* ::statusbar + :tags #{:statusbar} :items (sorted-set-by #(-> % deref :order)) :init (fn [this] [:div#status-bar ])) -(def container (object/create ::status-bar)) +(def container (object/create ::statusbar)) (defn add-container - "Add an object to the status-bar container. When you wish the object to be displayed or hidden, + "Add an object to the statusbar container. When you wish the object to be displayed or hidden, raise :show! or :hide! respectively. Objects must have :order and :height keys in order to determine the space required for the object." [obj] - (object/add-tags obj [:status-bar-item]) + (object/add-tags obj [:statusbar-item]) (object/update! container [:items] conj obj) (let [i (cljs/index-of obj (:items @container))] (if (= i 0) @@ -57,7 +57,7 @@ (dom/append (object/->content tabs/multi) (object/->content container)))) ;;********************************************************** -;; status +;; statusbar ;;********************************************************** (defui status-item [content class] From 1154bdf3a476e1e80817e8ca03ebd4be72110be3 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:48:40 -0800 Subject: [PATCH 311/656] revert 6b80b12 Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 14 +++---- deploy/core/css/skins/new-dark.stylus | 14 +++---- deploy/core/css/structure.css | 14 +++---- deploy/settings/default/default.behaviors | 6 +-- src/lt/objs/statusbar.cljs | 51 +++++++++++------------ 5 files changed, 49 insertions(+), 50 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 40731f4ac..0fecbcdf4 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -447,10 +447,10 @@ input { color: #ccc; border-color: #888; } -#status { +#statusbar { color: #bbb; } -#status .console-toggle { +#statusbar .console-toggle { cursor: default; background: #404040; color: #ccc; @@ -462,24 +462,24 @@ input { margin-left: 0px; border-radius: 2px; } -#status .console-toggle:hover { +#statusbar .console-toggle:hover { background: #666; color: #f4f4f4; } -#status .console-toggle.dirty { +#statusbar .console-toggle.dirty { background: #505d6b; color: #c7e6ff; display: inline-block; } -#status .console-toggle.error { +#statusbar .console-toggle.error { color: #ffa6a6; background: #73404c; } -#status .log .error { +#statusbar .log .error { color: #ffa6a6; background: #73404c; } -#status .log .tip { +#statusbar .log .tip { color: #c7e6ff; } #find-bar input { diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index d3ff16ff8..cb284035a 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -212,13 +212,13 @@ input { color: $highlight-fg; background:$highlight-bg; } #right-bar .clients .connector li:hover h2 {color: $highlight-fg; } #right-bar .clients .connector li:hover {background: $highlight-bg; color: $fg; border-color: $pane-border; } -#status { color: $hidden-fg; } -#status .console-toggle { cursor:default; background:$hidden-bg; color:$fg; min-width:12px; padding:0 4px; width:auto; display:none; text-align:center; margin-left:0px; border-radius:2px; } -#status .console-toggle:hover { background:$dark-highlight-bg; color:$highlight-fg; } -#status .console-toggle.dirty { background:$accent-background; color:$accent-foreground; display: inline-block; } -#status .console-toggle.error { color:$error-fg; background:$error-bg; } -#status .log .error { color:$error-fg; background:$error-bg; } -#status .log .tip { color: $accent-foreground; } +#statusbar { color: $hidden-fg; } +#statusbar .console-toggle { cursor:default; background:$hidden-bg; color:$fg; min-width:12px; padding:0 4px; width:auto; display:none; text-align:center; margin-left:0px; border-radius:2px; } +#statusbar .console-toggle:hover { background:$dark-highlight-bg; color:$highlight-fg; } +#statusbar .console-toggle.dirty { background:$accent-background; color:$accent-foreground; display: inline-block; } +#statusbar .console-toggle.error { color:$error-fg; background:$error-bg; } +#statusbar .log .error { color:$error-fg; background:$error-bg; } +#statusbar .log .tip { color: $accent-foreground; } #find-bar input { border-top:2px solid $bg; background:$multi; } #find-bar input + input { border-left:2px solid $bg; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 0c8d48d93..86a108f2e 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -277,13 +277,13 @@ body { -webkit-user-select: none; } #status-bar { position:absolute; bottom:0; left:0; right:0; } -#status { position:relative; box-sizing:border-box; padding:7px 10px; vertical-align:middle;} -#status li { float:right; display:inline; margin-left:15px;} -#status li.left { float:left; margin-left:0;} -#status li.left + li.left { float:left; margin-left:5px;} -#status .log img { vertical-align:middle; } -#status .log .message { max-width: 80vw; display:inline-block; overflow:hidden; vertical-align:middle; white-space:nowrap; margin-left:0px; padding:0px 5px; border-radius:2px; } -#status .pos { display:inline-block; min-width:0px; text-align:right;} +#statusbar { position:relative; box-sizing:border-box; padding:7px 10px; vertical-align:middle;} +#statusbar li { float:right; display:inline; margin-left:15px;} +#statusbar li.left { float:left; margin-left:0;} +#statusbar li.left + li.left { float:left; margin-left:5px;} +#statusbar .log img { vertical-align:middle; } +#statusbar .log .message { max-width: 80vw; display:inline-block; overflow:hidden; vertical-align:middle; white-space:nowrap; margin-left:0px; padding:0px 5px; border-radius:2px; } +#statusbar .pos { display:inline-block; min-width:0px; text-align:right;} .load-wrapper { display:inline-block; height:18px; width:20px; vertical-align:middle; margin-right:5px; } .load-wrapper .img { display:inline-block; width:17px; height:17px; vertical-align:middle; } diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 908d2de6b..724307000 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -479,9 +479,9 @@ [:statusbar-item :lt.objs.statusbar/on-hide!] [:statusbar-item :lt.objs.statusbar/init-statusbar] - [:status.console-toggle :lt.objs.console/statusbar-console-toggle] - [:status.console-toggle :lt.objs.console/statusbar-console-hide] - [:status.console-toggle :lt.objs.console/statusbar-console-show] + [:statusbar.console-toggle :lt.objs.console/statusbar-console-toggle] + [:statusbar.console-toggle :lt.objs.console/statusbar-console-hide] + [:statusbar.console-toggle :lt.objs.console/statusbar-console-show] [:tab-label :lt.objs.menu/menu!] [:tab-label :lt.objs.tabs/tab-label-menu+] diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index c73ebbd70..ea89cbf2a 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -60,32 +60,31 @@ ;; statusbar ;;********************************************************** -(defui status-item [content class] +(defui statusbar-item [content class] [:li {:class class} content]) -(object/object* ::status +(object/object* ::statusbar :items [] :height 34 :order 0 :init (fn [this] - [:ul#status + [:ul#statusbar ;; @NOTE: This naming becomes awkward, can these be merged? The other containers are themselves containers around a .content, right? (map-bound #(object/->content (deref %)) this {:path [:items]})] )) -(def status (object/create ::status)) +(def statusbar (object/create ::statusbar)) -(add-container status) +(add-container statusbar) -;; @FIXME: Should we rename to `::show-status` ? (behavior ::show-statusbar - :desc "App: Show status at the bottom of the editor" + :desc "App: Show statusbar at the bottom of the editor" :type :user :triggers #{:init} :reaction (fn [this] - (object/raise status :show!))) + (object/raise statusbar :show!))) -(defn add-status-item [item] - (object/update! status [:items] conj item)) +(defn add-statusbar-item [item] + (object/update! statusbar [:items] conj item)) ;;********************************************************** ;; cursor @@ -101,21 +100,21 @@ :reaction (fn [this pos] (object/merge! this {:pos pos}))) -(object/object* ::status.cursor +(object/object* ::statusbar.cursor :triggers #{} :behaviors #{::update-cursor-location} :pos {:line 0 :ch 0} :init (fn [this] - (status-item (bound this ->cursor-str) "") + (statusbar-item (bound this ->cursor-str) "") )) (behavior ::report-cursor-location :triggers #{:move :active} :reaction (fn [this] - (object/raise status-cursor :update! (ed/->cursor this)))) + (object/raise statusbar-cursor :update! (ed/->cursor this)))) -(def status-cursor (object/create ::status.cursor)) -(add-status-item status-cursor) +(def statusbar-cursor (object/create ::statusbar.cursor)) +(add-statusbar-item statusbar-cursor) ;;********************************************************** ;; loader @@ -150,26 +149,26 @@ [:span {:class (bound this #(-> % :class ->message-class))} (bound this :message)] ]) -(object/object* ::status.loader - :tags #{:status.console} +(object/object* ::statusbar.loader + :tags #{:statusbar.console} :loaders 0 :message "" :init (fn [this] - (status-item (log this) "left") + (statusbar-item (log this) "left") )) -(def status-loader (object/create ::status.loader)) +(def status-loader (object/create ::statusbar.loader)) (add-status-item status-loader) (defn loader-set [] - (object/merge! status-loader {:loaders 0})) + (object/merge! statusbar-loader {:loaders 0})) (defn loader-inc [] - (object/update! status-loader [:loaders] inc)) + (object/update! statusbar-loader [:loaders] inc)) (defn loader-dec [] - (if (> (:loaders @status-loader) 0) - (object/update! status-loader [:loaders] dec))) + (if (> (:loaders @statusbar-loader) 0) + (object/update! statusbar-loader [:loaders] dec))) ;;********************************************************** ;; console list @@ -184,13 +183,13 @@ :click (fn [] (cmd/exec! :toggle-console))) -(object/object* ::status.console-toggle +(object/object* ::statusbar.console-toggle :dirty 0 - :tags [:status.console-toggle] + :tags [:statusbar.console-toggle] :init (fn [this] (status-item (toggle-span this) ""))) -(def console-toggle (object/create ::status.console-toggle)) +(def console-toggle (object/create ::statusbar.console-toggle)) (add-status-item console-toggle) (defn dirty [] From 2642b13a4472f87addcc127f1dac5822b7f2afdc Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:50:23 -0800 Subject: [PATCH 312/656] revert 21e3dde Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 2 +- deploy/core/css/skins/new-dark.stylus | 2 +- deploy/core/css/structure.css | 12 ++++++------ src/lt/objs/bottombar.cljs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 0fecbcdf4..ef593cec9 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -151,7 +151,7 @@ input { background: #202020; border: 2px solid #3b3f41; } -#bottom-bar .content { +#bottombar .content { background: #3b3f41; border-top: 0px solid #444; } diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index cb284035a..07c619f77 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -118,7 +118,7 @@ input { color: $highlight-fg; background:$highlight-bg; } .sortable-placeholder { background:$multi; border:2px solid $bg; } -#bottom-bar .content { background:$bg; border-top:0px solid $border; } +#bottombar .content { background:$bg; border-top:0px solid $border; } .console > li, .console td { color:$accent-foreground; } .console > li + li { border-top:2px solid $bg; } .console > li.error + li { border-color:$bg;} diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 86a108f2e..647bdd2f0 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -269,11 +269,11 @@ body { -webkit-user-select: none; } #right-bar .docs-search button { pointer-events:auto; } #right-bar .docs-search pre { white-space:pre-wrap; margin:5px 0;} -#bottom-bar { z-index:100000; position:fixed; bottom:0; right:0; background:transparent; padding-top:0px; padding-bottom:0px; box-sizing:border-box; } -#bottom-bar .content { padding:10px 0px; padding-right:10px; box-sizing:border-box; height:100%; } -#bottom-bar .horizontal-grip {position:absolute; top:0px; width:100%; height:10px; z-index:10000; cursor:row-resize; } -#bottom-bar.closed { padding:0; } -#bottom-bar.closed .horizontal-grip { display:none; } +#bottombar { z-index:100000; position:fixed; bottom:0; right:0; background:transparent; padding-top:0px; padding-bottom:0px; box-sizing:border-box; } +#bottombar .content { padding:10px 0px; padding-right:10px; box-sizing:border-box; height:100%; } +#bottombar .horizontal-grip {position:absolute; top:0px; width:100%; height:10px; z-index:10000; cursor:row-resize; } +#bottombar.closed { padding:0; } +#bottombar.closed .horizontal-grip { display:none; } #status-bar { position:absolute; bottom:0; left:0; right:0; } @@ -375,7 +375,7 @@ body { -webkit-user-select: none; } .animated #multi { -webkit-transition:bottom 0.1s ease-in-out, left 0.1s ease-in-out, right 0.10s ease-in-out; } .animated #multi .tabsets { -webkit-transition:bottom 0.1s ease-in-out; } -.animated #bottom-bar { -webkit-transition:height 0.1s ease-in-out, left 0.1s ease-in-out, right 0.1s ease-in-out; } +.animated #bottombar { -webkit-transition:height 0.1s ease-in-out, left 0.1s ease-in-out, right 0.1s ease-in-out; } .animated #left-bar { -webkit-transition:width 0.1s ease-in-out; } .animated #right-bar { -webkit-transition:width 0.10s ease-in-out; } .animated #find-bar { -webkit-transition:height 0.1s ease-in-out;} diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index 3398b045c..9b61553ec 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -49,7 +49,7 @@ :height 0 :max-height default-height :init (fn [this] - [:div#bottom-bar {:class (bound this ->active-class) + [:div#bottombar {:class (bound this ->active-class) :style {:left (bound (subatom tabs/multi :left) ->px) :right (bound (subatom tabs/multi :right) ->px) :height (bound (subatom this :height) ->px)}} From f6d994e853c080460ed74ecaad7b3fb6a9fdccad Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:51:04 -0800 Subject: [PATCH 313/656] revert 172154d40152f3eadda47b57dae1bfa720640044 Signed-off-by: Chris Granger --- deploy/core/css/structure.css | 2 +- src/lt/objs/statusbar.cljs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 647bdd2f0..da20e8d19 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -275,7 +275,7 @@ body { -webkit-user-select: none; } #bottombar.closed { padding:0; } #bottombar.closed .horizontal-grip { display:none; } -#status-bar { position:absolute; bottom:0; left:0; right:0; } +#statusbar-container { position:absolute; bottom:0; left:0; right:0; } #statusbar { position:relative; box-sizing:border-box; padding:7px 10px; vertical-align:middle;} #statusbar li { float:right; display:inline; margin-left:15px;} diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index ea89cbf2a..a78657ec6 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -18,7 +18,7 @@ :tags #{:statusbar} :items (sorted-set-by #(-> % deref :order)) :init (fn [this] - [:div#status-bar + [:div#statusbar-container ])) (def container (object/create ::statusbar)) @@ -68,7 +68,7 @@ :height 34 :order 0 :init (fn [this] - [:ul#statusbar ;; @NOTE: This naming becomes awkward, can these be merged? The other containers are themselves containers around a .content, right? + [:ul#statusbar (map-bound #(object/->content (deref %)) this {:path [:items]})] )) From 98eb8e03f65ebb61b77ba2240a9de02c3824e325 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:53:09 -0800 Subject: [PATCH 314/656] rever 3b5fab6 Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 20 ++++---- deploy/core/css/skins/new-dark.stylus | 20 ++++---- deploy/core/css/structure.css | 74 +++++++++++++-------------- src/lt/objs/sidebar.cljs | 2 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index ef593cec9..c7e5ce996 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -279,37 +279,37 @@ input { .filter-list li:hover em { color: #c7e6ff; } -#left-bar .content { +#side .content { background: #3b3f41; box-shadow: 0 0 10px #000; } -#left-bar ::-webkit-scrollbar-thumb { +#side ::-webkit-scrollbar-thumb { background: #606970; border: 1px solid #606970; } -#left-bar .workspace ul.buttons li:hover:not(.sep) { +#side .workspace ul.buttons li:hover:not(.sep) { color: #f4f4f4; background: #616161; } -#left-bar .workspace li:hover > div > p { +#side .workspace li:hover > div > p { color: #f4f4f4; } -#left-bar .workspace li p:hover { +#side .workspace li p:hover { background: #616161; color: #f4f4f4; } -#left-bar .workspace .recent > div > ul > li + li { +#side .workspace .recent > div > ul > li + li { border-top: 0px solid #888; } -#left-bar .workspace .recent > div > ul > li:hover { +#side .workspace .recent > div > ul > li:hover { border-color: #888; background: #616161; color: #f4f4f4; } -#left-bar .workspace .recent > div > ul > li:hover + li { +#side .workspace .recent > div > ul > li:hover + li { border-top-color: #888; } -#left-bar .workspace .recent h2:hover { +#side .workspace .recent h2:hover { background: #616161; color: #f4f4f4; } @@ -859,7 +859,7 @@ input { padding: 5px; padding-bottom: 5px; } -#left-bar .workspace ul.root { +#side .workspace ul.root { top: 0px; } #right-bar .filter-list input { diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index 07c619f77..883deb8cd 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -156,16 +156,16 @@ input { color: $highlight-fg; background:$highlight-bg; } .filter-list .selected, .filter-list li:hover { color:$highlight-fg; background: $highlight-bg;} .filter-list .selected em, .filter-list li:hover em { color:$accent-foreground; } -#left-bar .content { background:$bg; box-shadow: 0 0 10px $shadow; } -#left-bar ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } +#side .content { background:$bg; box-shadow: 0 0 10px $shadow; } +#side ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } -#left-bar .workspace ul.buttons li:hover:not(.sep) { color:$highlight-fg; background:$highlight-bg; } -#left-bar .workspace li:hover > div > p { color: $highlight-fg; } -#left-bar .workspace li p:hover { background: $highlight-bg; color:$highlight-fg; } -#left-bar .workspace .recent > div > ul > li + li { border-top:0px solid $pane-border; } -#left-bar .workspace .recent > div > ul > li:hover { border-color: $pane-border; background:$highlight-bg; color: $highlight-fg; } -#left-bar .workspace .recent > div > ul > li:hover + li { border-top-color: $pane-border; } -#left-bar .workspace .recent h2:hover { background: $highlight-bg; color:$highlight-fg; } +#side .workspace ul.buttons li:hover:not(.sep) { color:$highlight-fg; background:$highlight-bg; } +#side .workspace li:hover > div > p { color: $highlight-fg; } +#side .workspace li p:hover { background: $highlight-bg; color:$highlight-fg; } +#side .workspace .recent > div > ul > li + li { border-top:0px solid $pane-border; } +#side .workspace .recent > div > ul > li:hover { border-color: $pane-border; background:$highlight-bg; color: $highlight-fg; } +#side .workspace .recent > div > ul > li:hover + li { border-top-color: $pane-border; } +#side .workspace .recent h2:hover { background: $highlight-bg; color:$highlight-fg; } #right-bar .content { background:$bg; } #right-bar .command h2:hover { background:$highlight-bg; color:$highlight-fg; } @@ -316,7 +316,7 @@ input { color: $highlight-fg; background:$highlight-bg; } #multi .list li { height:29px; padding:6px 10px; font-size: 9pt; text-align:left; } #multi .content { background:$multi; margin:0; top:29px; left:0; right:0; padding:5px; padding-bottom:5px; } -#left-bar .workspace ul.root { top:0px; } +#side .workspace ul.root { top:0px; } #right-bar .filter-list input { padding:6px 10px; font-size:10pt; margin-top:0; border-radius:0px; } #right-bar .filter-list ul { top:35px; bottom:10px; } #right-bar .content { padding:0 15px; padding-bottom:10px; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index da20e8d19..c66a22860 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -164,10 +164,10 @@ body { -webkit-user-select: none; } #right-bar .content > * { padding:0px 0px; box-sizing:border-box; height:100%; } #right-bar .vertical-grip { left:-4px; } -#left-bar { position:fixed; top:10px; left:0; bottom:0; z-index:1000000; overflow:hidden; } -#left-bar .content { height:100%; overflow:hidden; padding:4px 5px; padding-bottom:10px; box-sizing:border-box;} -#left-bar .content > * { padding:0px 0px; box-sizing:border-box; } -#left-bar .vertical-grip { right:-4px; pointer-events:auto; } +#side { position:fixed; top:10px; left:0; bottom:0; z-index:1000000; overflow:hidden; } +#side .content { height:100%; overflow:hidden; padding:4px 5px; padding-bottom:10px; box-sizing:border-box;} +#side .content > * { padding:0px 0px; box-sizing:border-box; } +#side .vertical-grip { right:-4px; pointer-events:auto; } #right-bar .command { padding:0px 0px; background:transparent; overflow:hidden; height:100%; } #right-bar .command h2 { font-size: 12pt; margin-bottom:10px; cursor:default; padding:10px; border-radius:2px; } @@ -179,33 +179,33 @@ body { -webkit-user-select: none; } #right-bar .command li { padding:5px 5px; line-height:1.2em; } #right-bar .command .binding { font-size:8pt; } -#left-bar .workspace { position:relative; height:100%; overflow:hidden; padding-top:0px; } -#left-bar .workspace > p { float:left; width:100%; } -#left-bar .workspace ul.buttons { float:left; white-space:nowrap; width:100%; min-width:250px; padding:0px 10px;} -#left-bar .workspace ul.buttons li { float:left; display:inline-block; padding:2px 5px; } -#left-bar .workspace ul.buttons li.sep { margin:0; } -#left-bar .workspace ul.root { position:absolute; height:auto; left:13px; right:7px; padding-right:10px; top:40px; bottom:10px; box-sizing:border-box; } -#left-bar .workspace ul.root { overflow:auto; } -#left-bar .workspace li { cursor:default; padding:0; border-radius:2px; white-space:nowrap; } -#left-bar .workspace li p { padding:1px; padding-left:5px; border-radius:2px; box-sizing:border-box; } -#left-bar .workspace ul.sub { margin-left:15px; display:none; } -#left-bar .workspace ul.sub.opened { display:block; } -#left-bar .workspace .folder, .folders { font-weight:bold; } -#left-bar .workspace > ul > li > div > ul.sub { margin:0; } -#left-bar .workspace ul.root > div > ul:empty:before { content:"Right click to add files or folders to the workspace or open a recent one to get started."; display:inline-block; text-align:center; width:100%; max-width:300px; margin-top:40px; } -#left-bar .workspace input.rename { display:none; } -#left-bar .workspace li.renaming > input.rename { display:block; width:100%; } -#left-bar .workspace li.renaming > .tree-item > p { display:none; } -#left-bar .workspace.recents .wstree { display:none; } -#left-bar .workspace.recents .recent { display:block; width:100%; overflow:hidden; } -#left-bar .workspace .recent { display:none; } -#left-bar .workspace.recents { overflow-y:auto; padding:0 5px; } -#left-bar .workspace .recent > div > ul { position:absolute; top:35px; bottom:0px; left:5px; right:0px; padding-right:10px; overflow-y:auto; margin-top:0;} -#left-bar .workspace .recent > div > ul > li { padding:10px 10px; display:inline-block; width:100%; box-sizing:border-box; border-radius:2px; } -#left-bar .workspace .recent > div > ul > li:first-child { border:none; border-top-right-radius:2px; border-top-left-radius:2px; } -#left-bar .workspace .recent > div > ul > li:last-child { border-bottom:none; border-bottom-right-radius:2px; border-bottom-left-radius:2px; } -#left-bar .workspace .recent h2 { width:100%; padding:2px 5px; font-size:10pt; border-radius:2px; box-sizing:border-box; } -#left-bar .workspace .recent h2:after { float:right; content: "⇡"; } +#side .workspace { position:relative; height:100%; overflow:hidden; padding-top:0px; } +#side .workspace > p { float:left; width:100%; } +#side .workspace ul.buttons { float:left; white-space:nowrap; width:100%; min-width:250px; padding:0px 10px;} +#side .workspace ul.buttons li { float:left; display:inline-block; padding:2px 5px; } +#side .workspace ul.buttons li.sep { margin:0; } +#side .workspace ul.root { position:absolute; height:auto; left:13px; right:7px; padding-right:10px; top:40px; bottom:10px; box-sizing:border-box; } +#side .workspace ul.root { overflow:auto; } +#side .workspace li { cursor:default; padding:0; border-radius:2px; white-space:nowrap; } +#side .workspace li p { padding:1px; padding-left:5px; border-radius:2px; box-sizing:border-box; } +#side .workspace ul.sub { margin-left:15px; display:none; } +#side .workspace ul.sub.opened { display:block; } +#side .workspace .folder, .folders { font-weight:bold; } +#side .workspace > ul > li > div > ul.sub { margin:0; } +#side .workspace ul.root > div > ul:empty:before { content:"Right click to add files or folders to the workspace or open a recent one to get started."; display:inline-block; text-align:center; width:100%; max-width:300px; margin-top:40px; } +#side .workspace input.rename { display:none; } +#side .workspace li.renaming > input.rename { display:block; width:100%; } +#side .workspace li.renaming > .tree-item > p { display:none; } +#side .workspace.recents .wstree { display:none; } +#side .workspace.recents .recent { display:block; width:100%; overflow:hidden; } +#side .workspace .recent { display:none; } +#side .workspace.recents { overflow-y:auto; padding:0 5px; } +#side .workspace .recent > div > ul { position:absolute; top:35px; bottom:0px; left:5px; right:0px; padding-right:10px; overflow-y:auto; margin-top:0;} +#side .workspace .recent > div > ul > li { padding:10px 10px; display:inline-block; width:100%; box-sizing:border-box; border-radius:2px; } +#side .workspace .recent > div > ul > li:first-child { border:none; border-top-right-radius:2px; border-top-left-radius:2px; } +#side .workspace .recent > div > ul > li:last-child { border-bottom:none; border-bottom-right-radius:2px; border-bottom-left-radius:2px; } +#side .workspace .recent h2 { width:100%; padding:2px 5px; font-size:10pt; border-radius:2px; box-sizing:border-box; } +#side .workspace .recent h2:after { float:right; content: "⇡"; } #right-bar .navigate { height:100%; overflow:auto; box-sizing:border-box; } #right-bar .navigate em { font-weight:normal; } @@ -213,7 +213,7 @@ body { -webkit-user-select: none; } #right-bar .navigate li:empty { display:none; } #right-bar .navigate p { font-size:8pt; } #right-bar .navigate h2 { font-size:11pt; } -#right-bar .navigate .selected, #left-bar .navigate li:hover { border-radius:2px} +#right-bar .navigate .selected, #side .navigate li:hover { border-radius:2px} #right-bar .navigate input { border:none; margin-bottom:20px; border-radius:2px; outline:none; box-sizing:border-box; width:100%; padding:10px; font-size:11pt;} #right-bar .navigate .filter-list.empty ul:before { content: "Add some files or folders to your workspace to fill the navigator."; padding:10px 0; text-align:center; display:inline-block;} @@ -303,10 +303,10 @@ body { -webkit-user-select: none; } #browser input { font-size:10pt; padding-left:10px; background:#444; width:-webkit-calc(100% - 60px); padding:5px 12px; vertical-align:middle;} #browser button { width:20px; height:26px; padding:4px 5px; box-sizing:border-box; border-radius:0px; vertical-align:middle; } -#left-bar .tab-settings .filter-list { position:relative; } -#left-bar .tab-settings .filter-list ul {height: 100px; overflow:auto; display:none; position:absolute; top:35px; width:100%; z-index:10; border-radius:2px; padding:5px 0px; box-sizing:border-box;} -#left-bar .tab-settings .filter-list li { padding:0 10px; border-radius:2px; } -#left-bar .tab-settings .filter-list input:focus + * { display:block; } +#side .tab-settings .filter-list { position:relative; } +#side .tab-settings .filter-list ul {height: 100px; overflow:auto; display:none; position:absolute; top:35px; width:100%; z-index:10; border-radius:2px; padding:5px 0px; box-sizing:border-box;} +#side .tab-settings .filter-list li { padding:0 10px; border-radius:2px; } +#side .tab-settings .filter-list input:focus + * { display:block; } .search-results { overflow:hidden; position:relative; box-sizing:border-box; } .search-results input { width:100%; } @@ -376,7 +376,7 @@ body { -webkit-user-select: none; } .animated #multi { -webkit-transition:bottom 0.1s ease-in-out, left 0.1s ease-in-out, right 0.10s ease-in-out; } .animated #multi .tabsets { -webkit-transition:bottom 0.1s ease-in-out; } .animated #bottombar { -webkit-transition:height 0.1s ease-in-out, left 0.1s ease-in-out, right 0.1s ease-in-out; } -.animated #left-bar { -webkit-transition:width 0.1s ease-in-out; } +.animated #side { -webkit-transition:width 0.1s ease-in-out; } .animated #right-bar { -webkit-transition:width 0.10s ease-in-out; } .animated #find-bar { -webkit-transition:height 0.1s ease-in-out;} .animated #multi .tab-close { -webkit-transition:width 0.2s ease-in-out, padding 0.2s ease-in-out; } diff --git a/src/lt/objs/sidebar.cljs b/src/lt/objs/sidebar.cljs index d73d8834f..6f8eb95d8 100644 --- a/src/lt/objs/sidebar.cljs +++ b/src/lt/objs/sidebar.cljs @@ -103,7 +103,7 @@ :transients '() :max-width default-width :init (fn [this] - [:div#left-bar {:style {:width (bound (subatom this :width) ->width)}} + [:div#side {:style {:width (bound (subatom this :width) ->width)}} [:div.content (bound (subatom this :active) active-content)] (vertical-grip this)])) From 4a6b1a7f14da6618acabd2707d3bf43e35bbbbe4 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 11:57:03 -0800 Subject: [PATCH 315/656] fix compiler warning after revert Signed-off-by: Chris Granger --- src/lt/objs/statusbar.cljs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index a78657ec6..f54fbd218 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -93,8 +93,6 @@ (defn ->cursor-str [{:keys [pos]}] [:span.pos (str "" (inc (:line pos)) " / " (inc (:ch pos)))]) -(declare status-cursor) - (behavior ::update-cursor-location :triggers #{:update!} :reaction (fn [this pos] @@ -108,13 +106,14 @@ (statusbar-item (bound this ->cursor-str) "") )) +(def statusbar-cursor (object/create ::statusbar.cursor)) +(add-statusbar-item statusbar-cursor) + (behavior ::report-cursor-location :triggers #{:move :active} :reaction (fn [this] (object/raise statusbar-cursor :update! (ed/->cursor this)))) -(def statusbar-cursor (object/create ::statusbar.cursor)) -(add-statusbar-item statusbar-cursor) ;;********************************************************** ;; loader @@ -157,8 +156,8 @@ (statusbar-item (log this) "left") )) -(def status-loader (object/create ::statusbar.loader)) -(add-status-item status-loader) +(def statusbar-loader (object/create ::statusbar.loader)) +(add-statusbar-item statusbar-loader) (defn loader-set [] (object/merge! statusbar-loader {:loaders 0})) @@ -187,10 +186,10 @@ :dirty 0 :tags [:statusbar.console-toggle] :init (fn [this] - (status-item (toggle-span this) ""))) + (statusbar-item (toggle-span this) ""))) (def console-toggle (object/create ::statusbar.console-toggle)) -(add-status-item console-toggle) +(add-statusbar-item console-toggle) (defn dirty [] (object/update! console-toggle [:dirty] inc)) From 95dc19e0750b5754863b296eeaeeec572f414de2 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Tue, 18 Nov 2014 12:12:55 -0800 Subject: [PATCH 316/656] fix things broken in the revert Signed-off-by: Chris Granger --- src/lt/objs/notifos.cljs | 2 +- src/lt/objs/statusbar.cljs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 6eef2cf55..182141f80 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -12,7 +12,7 @@ (let [m (if (string? m) m (pr-str m))] - (object/merge! statusbar/status-loader (merge {:message m :class ""} opts)))) + (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts)))) (declare cur-timeout) diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index f54fbd218..0c06454fe 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -14,14 +14,14 @@ ;; statusbar container ;;********************************************************** -(object/object* ::statusbar +(object/object* ::statusbar-container :tags #{:statusbar} :items (sorted-set-by #(-> % deref :order)) :init (fn [this] [:div#statusbar-container ])) -(def container (object/create ::statusbar)) +(def container (object/create ::statusbar-container)) (defn add-container "Add an object to the statusbar container. When you wish the object to be displayed or hidden, From caa114a4dc79b476e791cabdbbc4b2b97701437f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 19 Nov 2014 02:30:26 -0500 Subject: [PATCH 317/656] Remove unused behavior, var and args Behavior and var are recently unused. Last arg to parse-* fns haven't been used for awhile --- deploy/settings/default/default.behaviors | 1 - src/lt/objs/plugins.cljs | 1 - src/lt/objs/settings.cljs | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 724307000..b17bc41f0 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -409,7 +409,6 @@ [:plugin-manager :lt.objs.plugins/save-user-plugin-dependencies] [:plugin-manager :lt.objs.plugins/render-installed-plugins] [:plugin-manager :lt.objs.plugins/render-server-plugins] - [:plugin-manager :lt.objs.plugins/submit-plugin] [:plugin-manager :lt.objs.plugins/draw-plugins-on-updated] [:plugin-manager :lt.objs.plugins/get-latest-metadata-sha] [:plugin-manager :lt.objs.plugins/check-metadata-sha] diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 91b8698bd..8af5793f7 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -26,7 +26,6 @@ (def plugins-dir (files/lt-home "plugins")) (def user-plugins-dir (files/lt-user-dir "plugins")) -(def plugins-url "http://plugins.lighttable.com") (def ^:dynamic *plugin-dir* nil) (declare manager) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 59b2242ad..1cae4a34c 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -105,7 +105,7 @@ (sort-by first) (vec)))) -(defn parse-file [file final] +(defn parse-file [file] (let [behs (-> (files/open-sync file) :content (safe-read file))] @@ -425,7 +425,7 @@ (sort-by first) (vec)))) -(defn parse-key-file [file final] +(defn parse-key-file [file] (let [keys (-> (files/open-sync file) :content (safe-read file))] From 90b3bc5c5ac2a07030950ec51d1b607ee8374da3 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 19 Nov 2014 03:04:03 -0500 Subject: [PATCH 318/656] Backup and convert map format to flat vec format Also provide a command - mostly for plugin authors to use --- src/lt/objs/plugins.cljs | 1 + src/lt/objs/settings.cljs | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 8af5793f7..d632bdda4 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -715,6 +715,7 @@ (when-not (files/exists? user-plugins-dir) (files/mkdir user-plugins-dir)) (object/raise app/app :create-user-plugin) + (object/raise app/app :flatten-map-settings) ;;load enabled plugins (object/merge! app/app {::plugins (available-plugins)}))) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 1cae4a34c..4aa39cf41 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -8,7 +8,7 @@ [lt.objs.console :as console] [lt.objs.notifos :as notifos] [lt.objs.editor :as editor] - [lt.objs.editor.pool :as pool2] + [lt.objs.editor.pool :as pool] [lt.objs.workspace :as workspace] [clojure.string :as string] [lt.objs.sidebar.command :as scmd] @@ -319,6 +319,36 @@ (files/copy (files/lt-home (files/join "core" "User" path)) full-path))))))) +(declare map->flat-keymap) + +(defn convert-file + "If the given keymap or behaviors file is in the old map format, + backs it up and converts it to the flattened vec format." + [file] + (let [config (-> (files/open-sync file) + :content + (safe-read file))] + + (when (map? config) + (let [backup-file (str file ".bak") + _ (files/copy file backup-file) + convert-fn (case (files/ext file) + "keymap" map->flat-keymap + "behaviors" map->flat-behaviors + identity) + body (str ";; Your file has been converted to the new flat format.\n" + ";; Conversion does not preserve comments or indentation.\n" + ";; File is backed up at " backup-file "\n" + (pprint-flat-behaviors (convert-fn config)))] + (files/save file body))))) + +(behavior ::flatten-map-settings + :triggers #{:flatten-map-settings} + :reaction (fn [app] + (doseq [file (filter #(contains? #{"keymap" "behaviors"} (files/ext %)) + (files/full-path-ls user-plugin-dir))] + (convert-file file)))) + ;;********************************************************* ;; Commands ;;********************************************************* @@ -378,6 +408,11 @@ :exec (fn [] (object/raise workspace/current-ws :add.folder! user-plugin-dir))}) +(cmd/command {:command :convert-to-flat-format + :desc "Settings: Convert current file to flat format" + :exec (fn [] + (convert-file (get-in @(pool/last-active) [:info :path])))}) + (behavior ::on-close-remove :triggers #{:close} :reaction (fn [this] @@ -480,4 +515,4 @@ ;;This call to tag-behaviors is necessary as there are no behaviors loaded when the ;;app is first run. -(object/tag-behaviors :app [::initial-behaviors ::create-user-plugin ::load-behaviors ::default-behavior-diffs ::user-behavior-diffs ::default-keymap-diffs ::user-keymap-diffs]) +(object/tag-behaviors :app [::initial-behaviors ::create-user-plugin ::flatten-map-settings ::load-behaviors ::default-behavior-diffs ::user-behavior-diffs ::default-keymap-diffs ::user-keymap-diffs]) From a2fe7fc18ed03d23c4b1f71ada218d9bdad3d46f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 19 Nov 2014 03:19:00 -0500 Subject: [PATCH 319/656] Give examples of subtracting behaviors and keymaps in user defaults --- deploy/core/User/user.behaviors | 3 +++ deploy/core/User/user.keymap | 3 +++ 2 files changed, 6 insertions(+) diff --git a/deploy/core/User/user.behaviors b/deploy/core/User/user.behaviors index 7b3f56478..1d7c835a5 100644 --- a/deploy/core/User/user.behaviors +++ b/deploy/core/User/user.behaviors @@ -24,5 +24,8 @@ ;; Behaviors specific to a user-defined object [:user.hello :lt.plugins.user/on-close-destroy] + + ;; To subtract a behavior, prefix the name with '-' e.g. + ;; [:app :-lt.objs.intro/show-intro] ] diff --git a/deploy/core/User/user.keymap b/deploy/core/User/user.keymap index 7b37d360b..0dc1198d5 100644 --- a/deploy/core/User/user.keymap +++ b/deploy/core/User/user.keymap @@ -13,4 +13,7 @@ [ [:editor "alt-w" :editor.watch.watch-selection] [:editor "alt-shift-w" :editor.watch.unwatch] + + ;; To subtract a binding, prefix the key with '-' e.g. + ;; [:app "-ctrl-shift-d" :docs.search.show] ] From 77a5d6eca23e2a3bc6b32394951f0aaa05d61bb5 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 10:26:46 -0800 Subject: [PATCH 320/656] fix behavior metadata not getting correctly applied and cache creation ordering Signed-off-by: Chris Granger --- src/lt/objs/cache.cljs | 4 +++- src/lt/objs/plugins.cljs | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/cache.cljs b/src/lt/objs/cache.cljs index 0551be95a..4b183d3e4 100644 --- a/src/lt/objs/cache.cljs +++ b/src/lt/objs/cache.cljs @@ -36,8 +36,10 @@ (swap! settings merge setts)))) (behavior ::init - :triggers #{:init} + :triggers #{:deploy} :reaction (fn [this] (when-not (files/exists? cache-path) (files/mkdir cache-path)) (init))) + +(object/tag-behaviors :app [::init]) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 8af5793f7..4bfeda17c 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -141,15 +141,13 @@ (let [{:keys [behaviors dir]} plug file (files/join dir behaviors) file (files/real-path file) - behs (-> (files/open-sync file) - (:content) - (settings/safe-read file)) + behs (settings/parse-file file) force? (get (::force-reload @manager) file)] (when force? (swap! manager update-in [::force-reload] disj file)) (when behs (walk/prewalk (fn [x] - (when (list? x) + (when (coll? x) (alter-meta! x assoc ::dir dir ::force-reload force?)) x) behs) From 770d4a614564a60366a851c086749b66295f9012 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 12:18:19 -0800 Subject: [PATCH 321/656] add changelog for 0.7.0 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index f18f76239..9f4978f1c 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,52 @@ #Changes +##0.7.0 + +* CHANGED: Move to the MIT License (one-more-minute) +* CHANGED: Remove plugin server and use Github as the plugin-metadata repository (ibdknox) +* CHANGED: New flat syntax for behaviors and keymaps that allows much better copying and pasting +* CHANGED: Move all Light Table websites to Github pages +* FIX: Linux run script portability (gruns) +* FIX: Fix CodeMirror search failing with RegExp (blandinw) +* FIX: Better websocket-based eval (ibdknox) +* FIX: Allow custom colors for rainbow parens (Victor Cottin) +* FIX: download via https (dkinzer) +* FIX: editor conversion in the editor API (one-more-minute) +* FIX: Note hotkeys for OSX (gekkoe) +* FIX: Jump stack fixes (cldwalker) +* FIX: diff ordering was slightly wrong (ibdknox) +* FIX: prevent errors without lines from throwing (ibdknox) +* FIX: show notifications for errors without editor locations (ibdknox) +* FIX: emacs find fixes (joshuafcole) +* FIX: fix connector failing to connect (mortalapeman) +* FIX: use menu behaviors for all menus (ibdknox) +* FIX: search no longer randomly searches on keyup/keydown (ibdknox) +* FIX: prevent tab labels from leaking (ibdknox) +* FIX: remove unused/non-existent behaviors (cldwalker) +* FIX: remove all CLJS compiler warnings (brabadu cldwalker joshuafcole) +* FIX: fix Haxe extension (cldwalker) +* FIX: prevent the same folder/file from being added to the workspace twice (brabadu) +* FIX: fix regexp replace (ibdknox) +* FIX: lots of error reporting fixes (ibdknox cldwalker) +* FIX: much better completion/helper interaction for behaviors and commands +* README FIX: tons of readme updates (cldwalker) +* ADDED: You can now open multiple copies of a single file (cldwalker) +* ADDED: duplicate file action to workspace menu (seancaffery) +* ADDED: when wrapping with parens, select the result (one-more-minute) +* ADDED: copy exception menu item for inline exceptions (joshuafcole) +* ADDED: copy support for the console (joshuafcole) +* ADDED: menu for inline results (mortalapeman) +* ADDED: show plugins directory in about tab (cldwalker) +* ADDED: allow command shortcutting (ibdknox) +* ADDED: `File: Open another view of current file` command +* ADDED: indent-level aware backspace (one-more-minute) +* ADDED: user plugin (cldwalker) +* ADDED: `Settings: User script` command (cldwalker) +* ADDED: Allow folding at a location (ndr-qef) +* ADDED: auto convert old behaviors/keymaps to the flat syntax (cldwalker) +* UPDATED: CodeMirror +* UPDATED: Latest node-webkit + ##0.6.7 * FIX: Workspace behaviors do not correctly take effect on startup (mortalapeman) From 226836e6536a91f3be7d5df8d9f3068159f19522 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 12:48:59 -0800 Subject: [PATCH 322/656] remove CA add MIT release agreement --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e87fc039..7c17f9059 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,8 +26,9 @@ Hello! Thanks for your interest in Light Table. Things you can do to make Light * `Improving docs`: Check out [these documentation issues](https://github.com/LightTable/docs.lighttable.com/issues). Reading the [official docs](http://docs.lighttable.com/) and checking for errors, typos, etc. would also be great. ## Code Contributions +_By contributing code to Light Table, you are agreeing to release it under the MIT License._ -If it's your first time contributing, we'd love to have you :). Be sure to check out our [contributing tutorial](https://github.com/LightTable/LightTable/wiki/First-Contribution). We require contributors to agree to the [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform). It's as easy as a CLA can be; it's just a form that instantly enables you to contribute. +If it's your first time contributing, we'd love to have you :). Be sure to check out our [contributing tutorial](https://github.com/LightTable/LightTable/wiki/First-Contribution). When contributing: From d9181ca68a7600d2c345585ac7b7ca38376ac76a Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 13:39:54 -0800 Subject: [PATCH 323/656] 0.7.0 Signed-off-by: Chris Granger --- deploy/core/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/version.json b/deploy/core/version.json index ceb32dbf6..9b3dfaf59 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.6.7","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.7.0","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file From ec037aa5e9ea1dbc881774cad44c55363cef54f6 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 14:55:42 -0800 Subject: [PATCH 324/656] fix defaults for latest chromium Signed-off-by: Chris Granger --- deploy/core/css/skins/new-dark.css | 2 +- deploy/core/css/skins/new-dark.stylus | 3 ++- deploy/core/css/structure.css | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index c7e5ce996..cb357b69c 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -66,7 +66,7 @@ input { background: transparent; } ::selection { - background: #aaa; + background: #9cf; } .inline-result { background: #505d6b; diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index 883deb8cd..77b4ea29e 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -73,6 +73,7 @@ a {text-decoration:none; color: $fg; } .button:hover, .button:focus, button:hover, button:focus, button.active { background:$button-active-bg !important; color: $button-active-fg; } input { color: $highlight-fg; background:$highlight-bg; } + ::-webkit-scrollbar { width: 7px; height: 7px; } ::-webkit-scrollbar-track { border-radius: 2px; } ::-webkit-scrollbar-thumb { border-radius: 2px; } @@ -84,7 +85,7 @@ input { color: $highlight-fg; background:$highlight-bg; } ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } ::-webkit-scrollbar-thumb:hover { background: $medium-highlight-bg; border:1px solid $medium-highlight-bg; } ::-webkit-scrollbar-corner { background:transparent; } -::selection { background: $placeholder-fg; } +::selection { background: #99ccff; } .inline-result { background: $dark-accent-background; color:$accent-foreground; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index c66a22860..ea8df5b90 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -309,7 +309,7 @@ body { -webkit-user-select: none; } #side .tab-settings .filter-list input:focus + * { display:block; } .search-results { overflow:hidden; position:relative; box-sizing:border-box; } -.search-results input { width:100%; } +.search-results input { width:100%; margin:2px 0; } .search-results .res { position:absolute; overflow:auto; left:10px; right:10px; top:10px; bottom:130px; } .search-results .searcher { margin-bottom:10px; margin-top:10px; position:absolute; left:10px; right:10px; bottom:0px; } .search-results .res li { background:transparent; padding:7px 0; margin-bottom:5px; border-bottom:0px solid #444; } @@ -320,7 +320,7 @@ body { -webkit-user-select: none; } .search-results p { white-space:nowrap; cursor:default;} .search-results .line { display:inline-block; margin-right:5px; padding:0 5px; } .search-results div div { position:relative; } -.search-results button { position:absolute; right:-3px; padding:5px 10px; border-radius:0px; } +.search-results button { position:absolute; right:0px; margin:2px 0; padding:5px 10px; border-radius:0px; } .struct-tree { overflow:auto; height:100%; } .struct-tree span { margin:0 2px; } From 0f39f32fd6054d993adab830ab14c9e3fe25c4db Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 15:26:55 -0800 Subject: [PATCH 325/656] add description to keymap diffs behavior Signed-off-by: Chris Granger --- src/lt/objs/settings.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 4aa39cf41..16b9efeda 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -497,6 +497,8 @@ "}" ['(:editor.close-pair "}")]}}) (behavior ::pair-keymap-diffs + :desc "Editor: auto-close parens/brackets/quotes/pairs" + :type :user :triggers #{:keymap.diffs.user+} :reaction (fn [this diffs] (concat diffs (list {:+ pair-keybindings})))) From 5e3b8ce80139294d9ac28e0c747bd84fc9b0c8c3 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Wed, 19 Nov 2014 15:31:51 -0800 Subject: [PATCH 326/656] 0.7.1 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 7 +++++++ deploy/core/version.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 9f4978f1c..744687ded 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,7 +1,14 @@ #Changes +##0.7.1 + +* FIX: styling issues in the searcher +* FIX: roll back to an older version of node-webkit as a result of freezing issues when compiling certain plugins +* FIX: Give the auto-close keymap behavior a description: `Editor: auto-close parens/brackets/quotes/pairs` + ##0.7.0 +* CHANGED: parens are not auto-closed by default anymore, add `[:app :lt.objs.settings/pair-keymap-diffs]` to your behaviors to get it back. * CHANGED: Move to the MIT License (one-more-minute) * CHANGED: Remove plugin server and use Github as the plugin-metadata repository (ibdknox) * CHANGED: New flat syntax for behaviors and keymaps that allows much better copying and pasting diff --git a/deploy/core/version.json b/deploy/core/version.json index 9b3dfaf59..6c414e954 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.7.0","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.7.1","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file From db2d804e5de1d763d481f9fbd5d6c7f4c13ef874 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Wed, 19 Nov 2014 23:40:22 +0000 Subject: [PATCH 327/656] single-arity log fn --- src/lt/objs/console.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index ee21c38f2..94ff8a7a1 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -49,6 +49,7 @@ [:li {:class class} l]) (defn log + ([l] (log l nil)) ([l class] (log l class nil)) ([l class str-content] (when-not (= "" l) From f4c7e93083610feb9b0c6085e62e6a6b50cd1594 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 20 Nov 2014 10:00:39 -0800 Subject: [PATCH 328/656] fix reversing of behaviors when they're translated to triggers Signed-off-by: Chris Granger --- src/lt/object.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index e21d64c78..b6348dbdd 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -40,7 +40,7 @@ (let [result (atom (transient {}))] (doseq [beh behs t (:triggers (->behavior beh))] - (swap! result assoc! t (conj (or (get @result t) '()) beh))) + (swap! result assoc! t (conj (or (get @result t) '[]) beh))) (persistent! @result))) (defn specificity-sort From d801c677bdc7fbe656b49c60dba00ab1e2802dbe Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 20 Nov 2014 18:01:58 -0500 Subject: [PATCH 329/656] Mention autocompletion change in #1296 --- deploy/core/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 744687ded..229669f99 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -8,6 +8,7 @@ ##0.7.0 +* CHANGED: Enter doesn't select a completion by default anymore, just tab. Add `[:editor.keys.hinting.active "-enter" [:passthrough]]` to your keymap get it back. * CHANGED: parens are not auto-closed by default anymore, add `[:app :lt.objs.settings/pair-keymap-diffs]` to your behaviors to get it back. * CHANGED: Move to the MIT License (one-more-minute) * CHANGED: Remove plugin server and use Github as the plugin-metadata repository (ibdknox) From b3013adbb1c8728a13842a5eb90fb2113dc53985 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 20 Nov 2014 18:02:53 -0500 Subject: [PATCH 330/656] Top level link to changelog to make it more discoverable --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) create mode 120000 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 120000 index 000000000..0da5cf6e3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +deploy/core/changelog.md \ No newline at end of file From b684027222804dea63f08e436c236034a684e8c5 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 20 Nov 2014 21:41:32 -0800 Subject: [PATCH 331/656] 0.7.2 Signed-off-by: Chris Granger --- deploy/core/changelog.md | 6 ++++++ deploy/core/version.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 229669f99..80b99ced3 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,11 @@ #Changes +##0.7.2 + +* FIX: Behavior ordering issue that caused plugin weirdness and menus disappearing (ibdknox) +* FIX: allow single arity logs (one-more-minute) +* FIX: changelog additions (cldwalker) + ##0.7.1 * FIX: styling issues in the searcher diff --git a/deploy/core/version.json b/deploy/core/version.json index 6c414e954..024b5705f 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.7.1","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.7.2","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file From d7b974e60fff8fbf2cf4ad06ddb7d3ed4c7caa91 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 21 Nov 2014 16:39:56 -0500 Subject: [PATCH 332/656] Only set new version after install, close #1735 --- src/lt/objs/deploy.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 6c4f8f6e9..cec7a97fe 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -104,9 +104,10 @@ (fn [] (move-tmp) (notifos/done-working) + (set! version (assoc version :version ver)) (popup/popup! {:header "Light Table has been updated!" :body (str "Light Table has been updated to " ver "! Just - restart to get the latest and greatest.") + restart to get the latest and greatest.") :buttons [{:label "ok"}]})))))) (defn version-url [] @@ -133,7 +134,6 @@ (not= js/localStorage.fetchedVersion data))) (do (set! js/localStorage.fetchedVersion data) - (set! version (assoc version :version data)) (should-update-popup data)) (when notify? (notifos/set-msg! (str "At latest version: " (:version version))))))))) From 4e5a19cee7e7d1c03c947fe9f53031ed24c62b5b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 27 Nov 2014 14:34:26 -0500 Subject: [PATCH 333/656] Organize readme by splitting out to separate docs Moved Other documentation section to wiki. Also made installation clearer --- README.md | 247 +++------------------------------------ doc/BOT.md | 99 ++++++++++++++++ doc/commands.md | 50 ++++++++ doc/developer-install.md | 60 ++++++++++ doc/workflow.md | 12 ++ 5 files changed, 235 insertions(+), 233 deletions(-) create mode 100644 doc/BOT.md create mode 100644 doc/commands.md create mode 100644 doc/developer-install.md create mode 100644 doc/workflow.md diff --git a/README.md b/README.md index 3473095e4..fb4ea9bfc 100755 --- a/README.md +++ b/README.md @@ -1,246 +1,27 @@ -See [docs.lighttable.com](http://docs.lighttable.com/) for user documentation and tutorials. +# Light Table [![Build Status](https://travis-ci.org/LightTable/LightTable.svg?branch=master)](https://travis-ci.org/LightTable/LightTable) -# Initial setup +Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything that a browser can. -First install or update [leiningen](http://leiningen.org/). +## Downloads -1. Download the lein script. For Windows, download lein.bat. -2. Place it on your $PATH where your shell can find it (eg. ~/bin). -3. Set it to be an executable (chmod a+x ~/bin/lein). -4. Run the Lein script (eg. "./lein" or "sh lein") without quotes. +Prebuilt binaries are available through [lighttable.com](http://lighttable.com). To build and use a developer version of Light Table [see these instructions](doc/developer-install.md). -You can check your package manager. However, be sure you get version 2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). +## Documentation -Then we have to do some juggling (unless you fancy building node-webkit from source). +* See [docs.lighttable.com](http://docs.lighttable.com/) for official user documentation and tutorials. +* See the [community wiki](https://github.com/LightTable/LightTable/wiki) which includes a [User FAQ](https://github.com/LightTable/LightTable/wiki/FAQ) and a [For Users page](https://github.com/LightTable/LightTable/wiki/For-Users) which links to additional resources. +* For a typical workflow in Light Table, read [this doc](doc/workflow.md). +* To understand how Light Table works, read about its [BOT architecture](doc/BOT.md). -On OS X: +## Plugins -``` bash -git clone https://github.com/LightTable/LightTable.git -cd LightTable -sh osx_deps.sh -export LT_HOME=$(pwd)/deploy -./deploy/light -``` +Light Table has a powerful plugin system that allows almost any aspect of the editor to be extended and customized. With over [100+ plugins](https://github.com/LightTable/plugin-metadata), the community is able to offer eval support for new languages, create domain-specific IDEs and much more. If you're interested in writing your own plugin, see the [Write a Plugin](http://docs.lighttable.com/#write-a-plugin) and [Submit a Plugin](http://docs.lighttable.com/#submit-a-plugin) docs. For an example ClojureScript plugin, see [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier). -On Linux: +## For Developers -``` bash -git clone https://github.com/LightTable/LightTable.git -cd LightTable -bash linux_deps.sh -./deploy/LightTable -``` +If you're interested in developing Light Table, [install a developer version of Light Table](doc/developer-install.md). For more, read [CONTRIBUTING.md](CONTRIBUTING.md) and [For Developers](https://github.com/LightTable/LightTable/wiki/For-Developers). -On Windows (using Cygwin) (note: this may trigger [issue 1025](https://github.com/LightTable/LightTable/issues/1025)): -``` bash -git clone https://github.com/LightTable/LightTable.git -cd LightTable -bash windows_deps.sh -chmod -R u+rwx deploy/ -./deploy/LightTable -``` - -On Windows (manual): - -1. Clone the repo https://github.com/LightTable/LightTable.git -2. Download http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/LightTableWin.zip -3. Unzip LightTableWin.zip -4. Copy the following files from the zip into the cloned repo at LightTable/deploy/ - - ffmpegsumo.dll - - icudt.dll - - libEGL.dll - - libGLESv2.dll - - LightTable.exe - - nw.pak -5. You can also either copy the plugins/ folder over too or git clone the ones you want to modify down from github. You'll want at least the Clojure plugin and the Rainbow plugin. -6. Double click LightTable.exe - -# Building - -After the initial setup, you can compile the ClojureScript source at any time with `lein cljsbuild once`. - -# Note on Hotkeys for OS X - -Many (though not all) of the OS X hotkeys mentioned in the Light Table documentation use the cmd key instead of ctrl. - -When in doubt, you can look up the key sequence by name by pressing ctrl-space (yes, it's really ctrl on this one) and then typing part of the name of the command you want to use. If a key is mapped to the command, it will be printed right below the command name in the command bar. - -# Workflow - -I'll assume you already know how to eval code (ctrl-enter), how to open the command bar (ctrl-space) and how to open files with the navigator (ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). - -Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. - -The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. - -For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. - -Finally, use the documentation searcher (ctrl-shift-d) for full-text search over the names and docstrings of all known vars. Most of Light Table doesn't have docstrings, but this is still useful for library code. - -# Behaviors, Objects and Tags - -Light Table is organised around behaviors, objects and tags. - -Objects are just plain data-structures stored in an atom with a globally unique id. Whenever possible, state in Light Table is stored in objects. Use `lt.object/object*` to create an object template and `lt.object/create` to instantiate a new object from a template. - -The jump-stack object here stores a stack of file/pos pairs. Every time you use jump-to-definition, your old file/pos is added to the stack. When you jump back the file/pos is popped from the stack. - -``` clj -(def jump-stack (object/create (object/object* ::jump-stack - :tags [:jump-stack] - :stack []))) -``` - -Behaviors are defined with `lt.macros/behavior`. The required fields are `:triggers`, which gives the set of triggers that this behavior will react to, and `:reaction`, which defines the callback function. The macro also assigns a name to the reaction so that the stack-traces are readable. - -``` clj -(behavior ::jump-stack.push - :triggers #{:jump-stack.push!} - :reaction (fn [jump-stack editor file pos] - (let [old-file (:path (:info @editor)) - old-pos (editor/->cursor (lt.objs.editor.pool/last-active))] - (if-not (files/exists? file) - (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) - (do (jump-to file pos) - (object/update! jump-stack [:stack] conj [old-file old-pos])))))) -``` - -You can add documentation to behaviors. E.g., - -``` clj -(behavior ::run-on-init - :triggers #{:init} - :desc "App: Run commands on start" - :params [{:label "commands" - :type :list - :items cmd/completions}] - :type :user - :reaction (fn [this & commands] ...)) -``` - -You can also debounce (or similarly throttle) the reaction function. E.g., - -``` clj -(behavior ::show-info-on-move - :triggers #{:move} - :debounce 200 - :reaction (fn [this] ...)) -``` - -If you highlight `jump-stack` and hit eval you will see the current state of the object, which is probably something like: - -``` clj -{:lt.object/id 42, - :lt.object/type :lt.objs.jump-stack/jump-stack, - :tags #{:jump-stack :object}, - :content nil, - :triggers [], - :args nil, - :children {}, - :listeners {:jump-stack.push! [:lt.objs.jump-stack/jump-stack.push], - :jump-stack.pop! [:lt.objs.jump-stack/jump-stack.pop], - :destroy [:lt.objs.clients/on-destroy-remove-cb]}, - :stack [["/home/jamie/LightTable/src/lt/objs/jump_stack.cljs" {:line 48, :ch 48}]]} -``` - -The most interesting keys here are `:stack`, which was added in the template and is used to store the file/pos stack, and `:listeners`, which maps triggers to behaviors. If we were to eval something like `(lt.object/raise jump-stack :jump-stack.push! editor file pos)` then the behavior `lt.objs.jump-stack/jump-stack.push` would be called with arguments `[editor file pos]`. - -This is much like traditional event systems, the main difference being the object/behavior relationship is expressed as simple data-structures which can be easily introspected and modified at runtime. You can see the defaults for that data-structure by running the command `Settings: Default behaviors`. In that file, there is a line that adds the `::jump-stack.push` and `::jump-stack.pop` behaviors to any object with the `:jump-stack` tag. - -``` clj -:jump-stack [:lt.objs.jump-stack/jump-stack.push :lt.objs.jump-stack/jump-stack.pop] -``` - -The `lt.object/add-tag` behavior adds a tag to any object it is attached to. This is useful for defining groups of behaviors that are often applied together. - -``` clj -:watchable #{:lt.plugins.watches/watch! - :lt.plugins.watches/unwatch! - :lt.plugins.watches/eval-on-watch-or-unwatch} -:editor.javascript #{(:lt.object/add-tag :watchable) - ...}, -:editor.python #{(:lt.object/add-tag :watchable) - ...}, -:editor.clj #{(:lt.object/add-tag :watchable) - ...}, -``` - -You can add and remove mappings by running the command `Settings: User behaviors`. In addition, any plugins that you install may also provide `.behaviors` files. On startup and whenever you eval/save a `.behaviors` file, all of these files are merged together to produce the final mapping and then the listeners for every object are updated. Since almost everything in Light Table is built out of objects and behaviors this means that you can modify almost everything without restarting. For example, in part of my `user.behaviors` I disable line-wrapping in all files except markdown and plaintext and I also remove the top menubar. - -``` clj -{:+ {:editor [:lt.objs.editor/no-wrap], - :editor.markdown [:lt.objs.editor/wrap], - :editor.plaintext [:lt.objs.editor/wrap]}, - - :- {:app [:lt.objs.menu/create-menu - :lt.objs.menu/set-menu] - :window [:lt.objs.menu/set-menu]}} -``` - -# Commands - -Commands are a simple way of exposing functions to the user. - -``` clj -(cmd/command - {:command :editor.jump-to-definition-at-cursor - :desc "Editor: Jump to definition at cursor" - :exec (fn [] - (when-let [ed (lt.objs.editor.pool/last-active)] - (object/raise ed :editor.jump-to-definition-at-cursor!)))}) - -(cmd/command - {:command :editor.jump-to - :desc "Editor: Jump to file/pos" - :hidden true - :exec (fn [file pos] - (jump-to file pos))}) - -(cmd/command - {:command :editor.unjump - :desc "Editor: Jump back to where you jumped from" - :exec (fn [] - (object/raise jump-stack :jump-stack.pop!))}) -``` - -Commands can be executed from ClojureScript and may take arguments. - -``` clj -(cmd/exec! :editor.unjump) -(cmd/exec! :editor.jump-to file pos) -``` - -Commands can also be bound to key chords. Run the command `Settings: Default keymap` to see the default mappings. Key-bindings are grouped by tag and are only active when the focused object has a matching tag. Like behaviors, keymaps are reloaded on eval and the default, user and plugin keymaps are all merged together to determine the final bindings. - -``` clj -;; a simple custom keymap -{:+ {:app {"ctrl-pagedown" [:tabs.next] - "ctrl-pageup" [:tabs.prev] - "ctrl-home" [:workspace.show] - "ctrl-end" [:show-connect]}} - :editor {"ctrl-shift-0" [:paredit.grow.right] - "ctrl-shift-9" [:paredit.grow.left] - "ctrl-]" [:paredit.shrink.right] - "ctrl-[" [:paredit.shrink.left] - "ctrl-'" [:paredit.select.parent] - "ctrl-a" [:editor.line-start] - "ctrl-e" [:editor.line-end] - "ctrl-/" [:editor.select-line]}} -``` - -# Plugins - -See [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier) for an example ClojureScript plugin. - -# License +## License All files in this project are under the [LICENSE.md](LICENSE.md) license unless otherwise stated in the file or by a dependency's license file. - -# Other documentation - -* [Clojurescript for Light Table users](https://github.com/swannodette/lt-cljs-tutorial) by David Nolen -* [Getting started programming Light Table](http://devblog.reverb.com/post/85325435561/getting-started-programming-light-table) by Joshua Emmons. -* [Light Table plugin tutorial](http://blog.jakubarnold.cz/2014/01/13/light-table-plugin-tutorial.html) by Jakub Arnold -* [How to programmatically manage a Light Table-aware nREPL server](http://manuelp.herokuapp.com/posts/14) by Manuel Paccagnella diff --git a/doc/BOT.md b/doc/BOT.md new file mode 100644 index 000000000..d52534254 --- /dev/null +++ b/doc/BOT.md @@ -0,0 +1,99 @@ +# Behaviors, Objects and Tags + +Light Table is organised around behaviors, objects and tags. + +Objects are just plain data-structures stored in an atom with a globally unique id. Whenever possible, state in Light Table is stored in objects. Use `lt.object/object*` to create an object template and `lt.object/create` to instantiate a new object from a template. + +The jump-stack object here stores a stack of file/pos pairs. Every time you use jump-to-definition, your old file/pos is added to the stack. When you jump back the file/pos is popped from the stack. + +``` clj +(def jump-stack (object/create (object/object* ::jump-stack + :tags [:jump-stack] + :stack []))) +``` + +Behaviors are defined with `lt.macros/behavior`. The required fields are `:triggers`, which gives the set of triggers that this behavior will react to, and `:reaction`, which defines the callback function. The macro also assigns a name to the reaction so that the stack-traces are readable. + +``` clj +(behavior ::jump-stack.push + :triggers #{:jump-stack.push!} + :reaction (fn [jump-stack editor file pos] + (let [old-file (:path (:info @editor)) + old-pos (editor/->cursor (lt.objs.editor.pool/last-active))] + (if-not (files/exists? file) + (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) + (do (jump-to file pos) + (object/update! jump-stack [:stack] conj [old-file old-pos])))))) +``` + +You can add documentation to behaviors. E.g., + +``` clj +(behavior ::run-on-init + :triggers #{:init} + :desc "App: Run commands on start" + :params [{:label "commands" + :type :list + :items cmd/completions}] + :type :user + :reaction (fn [this & commands] ...)) +``` + +You can also debounce (or similarly throttle) the reaction function. E.g., + +``` clj +(behavior ::show-info-on-move + :triggers #{:move} + :debounce 200 + :reaction (fn [this] ...)) +``` + +If you highlight `jump-stack` and hit eval you will see the current state of the object, which is probably something like: + +``` clj +{:lt.object/id 42, + :lt.object/type :lt.objs.jump-stack/jump-stack, + :tags #{:jump-stack :object}, + :content nil, + :triggers [], + :args nil, + :children {}, + :listeners {:jump-stack.push! [:lt.objs.jump-stack/jump-stack.push], + :jump-stack.pop! [:lt.objs.jump-stack/jump-stack.pop], + :destroy [:lt.objs.clients/on-destroy-remove-cb]}, + :stack [["/home/jamie/LightTable/src/lt/objs/jump_stack.cljs" {:line 48, :ch 48}]]} +``` + +The most interesting keys here are `:stack`, which was added in the template and is used to store the file/pos stack, and `:listeners`, which maps triggers to behaviors. If we were to eval something like `(lt.object/raise jump-stack :jump-stack.push! editor file pos)` then the behavior `lt.objs.jump-stack/jump-stack.push` would be called with arguments `[editor file pos]`. + +This is much like traditional event systems, the main difference being the object/behavior relationship is expressed as simple data-structures which can be easily introspected and modified at runtime. You can see the defaults for that data-structure by running the command `Settings: Default behaviors`. In that file, there is a line that adds the `::jump-stack.push` and `::jump-stack.pop` behaviors to any object with the `:jump-stack` tag. + +``` clj +:jump-stack [:lt.objs.jump-stack/jump-stack.push :lt.objs.jump-stack/jump-stack.pop] +``` + +The `lt.object/add-tag` behavior adds a tag to any object it is attached to. This is useful for defining groups of behaviors that are often applied together. + +``` clj +:watchable #{:lt.plugins.watches/watch! + :lt.plugins.watches/unwatch! + :lt.plugins.watches/eval-on-watch-or-unwatch} +:editor.javascript #{(:lt.object/add-tag :watchable) + ...}, +:editor.python #{(:lt.object/add-tag :watchable) + ...}, +:editor.clj #{(:lt.object/add-tag :watchable) + ...}, +``` + +You can add and remove mappings by running the command `Settings: User behaviors`. In addition, any plugins that you install may also provide `.behaviors` files. On startup and whenever you eval/save a `.behaviors` file, all of these files are merged together to produce the final mapping and then the listeners for every object are updated. Since almost everything in Light Table is built out of objects and behaviors this means that you can modify almost everything without restarting. For example, in part of my `user.behaviors` I disable line-wrapping in all files except markdown and plaintext and I also remove the top menubar. + +``` clj +{:+ {:editor [:lt.objs.editor/no-wrap], + :editor.markdown [:lt.objs.editor/wrap], + :editor.plaintext [:lt.objs.editor/wrap]}, + + :- {:app [:lt.objs.menu/create-menu + :lt.objs.menu/set-menu] + :window [:lt.objs.menu/set-menu]}} +``` diff --git a/doc/commands.md b/doc/commands.md new file mode 100644 index 000000000..8e755897e --- /dev/null +++ b/doc/commands.md @@ -0,0 +1,50 @@ +# Commands + +Commands are a simple way of exposing functions to the user. + +``` clj +(cmd/command + {:command :editor.jump-to-definition-at-cursor + :desc "Editor: Jump to definition at cursor" + :exec (fn [] + (when-let [ed (lt.objs.editor.pool/last-active)] + (object/raise ed :editor.jump-to-definition-at-cursor!)))}) + +(cmd/command + {:command :editor.jump-to + :desc "Editor: Jump to file/pos" + :hidden true + :exec (fn [file pos] + (jump-to file pos))}) + +(cmd/command + {:command :editor.unjump + :desc "Editor: Jump back to where you jumped from" + :exec (fn [] + (object/raise jump-stack :jump-stack.pop!))}) +``` + +Commands can be executed from ClojureScript and may take arguments. + +``` clj +(cmd/exec! :editor.unjump) +(cmd/exec! :editor.jump-to file pos) +``` + +Commands can also be bound to key chords. Run the command `Settings: Default keymap` to see the default mappings. Key-bindings are grouped by tag and are only active when the focused object has a matching tag. Like behaviors, keymaps are reloaded on eval and the default, user and plugin keymaps are all merged together to determine the final bindings. + +``` clj +;; a simple custom keymap +{:+ {:app {"ctrl-pagedown" [:tabs.next] + "ctrl-pageup" [:tabs.prev] + "ctrl-home" [:workspace.show] + "ctrl-end" [:show-connect]}} + :editor {"ctrl-shift-0" [:paredit.grow.right] + "ctrl-shift-9" [:paredit.grow.left] + "ctrl-]" [:paredit.shrink.right] + "ctrl-[" [:paredit.shrink.left] + "ctrl-'" [:paredit.select.parent] + "ctrl-a" [:editor.line-start] + "ctrl-e" [:editor.line-end] + "ctrl-/" [:editor.select-line]}} +``` diff --git a/doc/developer-install.md b/doc/developer-install.md new file mode 100644 index 000000000..f4f766e8b --- /dev/null +++ b/doc/developer-install.md @@ -0,0 +1,60 @@ +# Initial setup + +First install or update [leiningen](http://leiningen.org/). + +1. Download the lein script. For Windows, download lein.bat. +2. Place it on your $PATH where your shell can find it (eg. ~/bin). +3. Set it to be an executable (chmod a+x ~/bin/lein). +4. Run the Lein script (eg. "./lein" or "sh lein") without quotes. + +You can check your package manager. However, be sure you get version 2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). + +Then we have to do some juggling (unless you fancy building node-webkit from source). + +On OS X: + +``` bash +git clone https://github.com/LightTable/LightTable.git +cd LightTable +sh osx_deps.sh +export LT_HOME=$(pwd)/deploy +./deploy/light +``` + +On Linux: + +``` bash +git clone https://github.com/LightTable/LightTable.git +cd LightTable +bash linux_deps.sh +./deploy/LightTable +``` + +On Windows (using Cygwin) (note: this may trigger [issue 1025](https://github.com/LightTable/LightTable/issues/1025)): + +``` bash +git clone https://github.com/LightTable/LightTable.git +cd LightTable +bash windows_deps.sh +chmod -R u+rwx deploy/ +./deploy/LightTable +``` + +On Windows (manual): + +1. Clone the repo https://github.com/LightTable/LightTable.git +2. Download http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/LightTableWin.zip +3. Unzip LightTableWin.zip +4. Copy the following files from the zip into the cloned repo at LightTable/deploy/ + - ffmpegsumo.dll + - icudt.dll + - libEGL.dll + - libGLESv2.dll + - LightTable.exe + - nw.pak +5. You can also either copy the plugins/ folder over too or git clone the ones you want to modify down from github. You'll want at least the Clojure plugin and the Rainbow plugin. +6. Double click LightTable.exe + +# Building + +After the initial setup, you can compile the ClojureScript source at any time with `lein cljsbuild once`. diff --git a/doc/workflow.md b/doc/workflow.md new file mode 100644 index 000000000..cd09f12b5 --- /dev/null +++ b/doc/workflow.md @@ -0,0 +1,12 @@ +# Workflow + +I'll assume you already know how to eval code (ctrl-enter), how to open the command bar (ctrl-space) and how to open files with the navigator (ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). + +Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. + +The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. + +For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. + +Finally, use the documentation searcher (ctrl-shift-d) for full-text search over the names and docstrings of all known vars. Most of Light Table doesn't have docstrings, but this is still useful for library code. + From f3958bc13ec082de46cd0ed9bce8e1a77685f2c6 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 27 Nov 2014 14:54:56 -0500 Subject: [PATCH 334/656] Add a community section --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fb4ea9bfc..3cfffd11e 100755 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ Prebuilt binaries are available through [lighttable.com](http://lighttable.com). Light Table has a powerful plugin system that allows almost any aspect of the editor to be extended and customized. With over [100+ plugins](https://github.com/LightTable/plugin-metadata), the community is able to offer eval support for new languages, create domain-specific IDEs and much more. If you're interested in writing your own plugin, see the [Write a Plugin](http://docs.lighttable.com/#write-a-plugin) and [Submit a Plugin](http://docs.lighttable.com/#submit-a-plugin) docs. For an example ClojureScript plugin, see [LightTable-Declassifier](https://github.com/LightTable/LightTable-Declassifier). +## Community + +Want to ask a question or just say hi? Please do :). Our mailing list is the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). We also hang out in `#lighttable` on Freenode IRC. + ## For Developers If you're interested in developing Light Table, [install a developer version of Light Table](doc/developer-install.md). For more, read [CONTRIBUTING.md](CONTRIBUTING.md) and [For Developers](https://github.com/LightTable/LightTable/wiki/For-Developers). From 5cf7d9a5cfec5d5e603af6a26331a6e6f5150eb7 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 27 Nov 2014 18:06:05 -0500 Subject: [PATCH 335/656] Update Doc and For Developers sections with wiki info --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3cfffd11e..64db04272 100755 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@ Prebuilt binaries are available through [lighttable.com](http://lighttable.com). ## Documentation * See [docs.lighttable.com](http://docs.lighttable.com/) for official user documentation and tutorials. -* See the [community wiki](https://github.com/LightTable/LightTable/wiki) which includes a [User FAQ](https://github.com/LightTable/LightTable/wiki/FAQ) and a [For Users page](https://github.com/LightTable/LightTable/wiki/For-Users) which links to additional resources. -* For a typical workflow in Light Table, read [this doc](doc/workflow.md). +* See the [community wiki](https://github.com/LightTable/LightTable/wiki) which includes a [User FAQ](https://github.com/LightTable/LightTable/wiki/FAQ) and a [For Users page](https://github.com/LightTable/LightTable/wiki/For-Users) for additional links. +* For a typical Light Table workflow, [read this](doc/workflow.md). * To understand how Light Table works, read about its [BOT architecture](doc/BOT.md). +* If you're a user coming from vim or emacs see the [For Vim Users](https://github.com/LightTable/LightTable/wiki/For-Vim-Users) and [For Emacs Users](https://github.com/LightTable/LightTable/wiki/For-Emacs-Users) guides. ## Plugins @@ -23,7 +24,9 @@ Want to ask a question or just say hi? Please do :). Our mailing list is the [Li ## For Developers -If you're interested in developing Light Table, [install a developer version of Light Table](doc/developer-install.md). For more, read [CONTRIBUTING.md](CONTRIBUTING.md) and [For Developers](https://github.com/LightTable/LightTable/wiki/For-Developers). +LightTable is primarily written in [ClojureScript](http://clojure.org/clojurescript). If you aren't familiar with it, check out [David Nolen's tutorial](https://github.com/swannodette/lt-cljs-tutorial). + +In order to develop for Light Table, you will need to [install a developer version of Light Table](doc/developer-install.md). For more information, read [CONTRIBUTING.md](https://github.com/LightTable/LightTable/blob/master/CONTRIBUTING.md#code-contributions) and [For Developers](https://github.com/LightTable/LightTable/wiki/For-Developers). ## License From e9e2c7b85dd0fb3c68c0b16dd490728557e51b5c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 27 Nov 2014 18:12:06 -0500 Subject: [PATCH 336/656] Mention which browser in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64db04272..5f9999aea 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Light Table [![Build Status](https://travis-ci.org/LightTable/LightTable.svg?branch=master)](https://travis-ci.org/LightTable/LightTable) -Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything that a browser can. +Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything a [Chromium browser](http://www.chromium.org/) can. ## Downloads From b514a9afe0f785ca43e930571c697e2c3a19dd72 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 30 Nov 2014 08:40:17 -0500 Subject: [PATCH 337/656] Tweaks to #1716 * Handle a file that has a ':' * Remove line handling from open! - not needed since a user can't specify a line number from a file manager * Revert back to :post-init trigger - works fine with latest * Add :desc to behaviors --- src/lt/objs/cli.cljs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 42291f8ab..de5327a4d 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -26,8 +26,8 @@ (parse argv)) (js->clj :keywordize-keys true))) -(defn open-paths [paths add?] - (doseq [[path line] paths +(defn open-paths [path-line-pairs add?] + (doseq [[path line] path-line-pairs :when (not= path (.-execPath js/process))] (if (files/exists? path) (if (files/dir? path) @@ -60,32 +60,33 @@ ;;********************************************************* (behavior ::open-on-args - :triggers #{:show} + :triggers #{:post-init} + :desc "App: Process commandline arguments" :reaction (fn [this] (when (args) (let [args-str (or (app/extract! (args-key (app/window-number))) (first (app/args))) args (parse-args (rebuild-argv args-str)) - paths-line-no (map #(string/split (files/resolve (:dir args) %) #":") - (filter valid-path? (:_ args))) - paths (map first paths-line-no) + path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] + [(files/resolve (:dir args) path) line]) + (filter valid-path? (:_ args))) + paths (map first path-line-pairs) open-dir? (some files/dir? paths)] (when open-dir? (object/merge! workspace/current-ws {:initialized? true})) - (open-paths paths-line-no (:add args)))))) + (open-paths path-line-pairs (:add args)))))) (behavior ::open! :triggers #{:open!} + :desc "App: Open a path from a file manager e.g. Finder" :reaction (fn [this path] (when (= (app/fetch :focusedWindow) (app/window-number)) (let [args (parse-args (rebuild-argv path)) - paths-line-no (map #(string/split (files/resolve (:dir args) %) #":") - (filter valid-path? (:_ args))) - paths (map first paths-line-no) + paths (map #(files/resolve (:dir args) %) (filter valid-path? (:_ args))) open-dir? (some files/dir? paths)] (if (or (:new args) (and open-dir? (not (:add args)))) (let [winid (inc (app/fetch :window-id))] (app/store! (args-key winid) path) (app/open-window)) - (open-paths paths-line-no (:add args))))))) + (open-paths (map vector paths) (:add args))))))) From 1b50fe3f90bcf2a2d68569a13e4bb52d85a6f31c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 30 Nov 2014 08:53:35 -0500 Subject: [PATCH 338/656] Fix funky spacing for cli behaviors --- src/lt/objs/cli.cljs | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index de5327a4d..f754407da 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -60,33 +60,33 @@ ;;********************************************************* (behavior ::open-on-args - :triggers #{:post-init} - :desc "App: Process commandline arguments" - :reaction (fn [this] - (when (args) - (let [args-str (or (app/extract! (args-key (app/window-number))) - (first (app/args))) - args (parse-args (rebuild-argv args-str)) - path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] - [(files/resolve (:dir args) path) line]) - (filter valid-path? (:_ args))) - paths (map first path-line-pairs) - open-dir? (some files/dir? paths)] - (when open-dir? - (object/merge! workspace/current-ws {:initialized? true})) - (open-paths path-line-pairs (:add args)))))) + :triggers #{:post-init} + :desc "App: Process commandline arguments" + :reaction (fn [this] + (when (args) + (let [args-str (or (app/extract! (args-key (app/window-number))) + (first (app/args))) + args (parse-args (rebuild-argv args-str)) + path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] + [(files/resolve (:dir args) path) line]) + (filter valid-path? (:_ args))) + paths (map first path-line-pairs) + open-dir? (some files/dir? paths)] + (when open-dir? + (object/merge! workspace/current-ws {:initialized? true})) + (open-paths path-line-pairs (:add args)))))) (behavior ::open! - :triggers #{:open!} - :desc "App: Open a path from a file manager e.g. Finder" - :reaction (fn [this path] - (when (= (app/fetch :focusedWindow) (app/window-number)) - (let [args (parse-args (rebuild-argv path)) - paths (map #(files/resolve (:dir args) %) (filter valid-path? (:_ args))) - open-dir? (some files/dir? paths)] - (if (or (:new args) - (and open-dir? (not (:add args)))) - (let [winid (inc (app/fetch :window-id))] - (app/store! (args-key winid) path) - (app/open-window)) - (open-paths (map vector paths) (:add args))))))) + :triggers #{:open!} + :desc "App: Open a path from a file manager e.g. Finder" + :reaction (fn [this path] + (when (= (app/fetch :focusedWindow) (app/window-number)) + (let [args (parse-args (rebuild-argv path)) + paths (map #(files/resolve (:dir args) %) (filter valid-path? (:_ args))) + open-dir? (some files/dir? paths)] + (if (or (:new args) + (and open-dir? (not (:add args)))) + (let [winid (inc (app/fetch :window-id))] + (app/store! (args-key winid) path) + (app/open-window)) + (open-paths (map vector paths) (:add args))))))) From ce8ab48b7ecd8a7110538da1b66c5431f3c95765 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 1 Dec 2014 17:17:51 -0500 Subject: [PATCH 339/656] Rename Show to Toggle to be correct regardless of doc state Close #1757 --- src/lt/plugins/doc.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index f048b7c91..81fe8f584 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -43,7 +43,7 @@ :triggers #{:menu+} :reaction (fn [this items] (conj items - {:label "Show docs" + {:label "Toggle docs" :order 0.1 :enabled (not (editor/selection? this)) :click (fn [] From 9a7e760c6d28ab9d2aad4666653b0f9a4595ae4a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 11:19:10 -0500 Subject: [PATCH 340/656] Use codemirror 4.7.0 node package instead of custom install - #1655 * Installed package with `npm install codemirror@4.7.0`. * This update loads updated and new modes * No new addons are being loaded * gitignored unused dirs of package but kept demo/ since it will be useful to debug issues for LT's cm version * Left alone any cm addons that had been modified * Removed unused emacs.js and gitignored css mode (which wasn't before but should be b/c of CSS plugin) * Added mode/meta.js which are helpful CM fns for modes --- deploy/core/.gitignore | 12 + deploy/core/LightTable.html | 2 +- .../node_modules/codemirror/.gitattributes | 8 + .../core/node_modules/codemirror/.npmignore | 8 + .../core/node_modules/codemirror/.travis.yml | 3 + deploy/core/node_modules/codemirror/AUTHORS | 395 ++++++ .../node_modules/codemirror/CONTRIBUTING.md | 76 + deploy/core/node_modules/codemirror/LICENSE | 19 + deploy/core/node_modules/codemirror/README.md | 11 + .../codemirror/{ => addon/comment}/comment.js | 15 +- .../addon/comment/continuecomment.js | 85 ++ .../codemirror/addon/dialog/dialog.css | 32 + .../codemirror/addon/dialog/dialog.js | 155 ++ .../codemirror/addon/display/fullscreen.css | 6 + .../codemirror/addon/display/fullscreen.js | 41 + .../codemirror/addon/display/placeholder.js | 58 + .../codemirror/addon/display/rulers.js | 64 + .../codemirror/addon/edit/closebrackets.js | 159 +++ .../codemirror/addon/edit/closetag.js | 159 +++ .../codemirror/addon/edit/continuelist.js | 51 + .../edit/matchbrackets.js} | 2 +- .../codemirror/addon/edit/matchtags.js | 66 + .../codemirror/addon/edit/trailingspace.js | 27 + .../codemirror/addon/fold/brace-fold.js | 105 ++ .../codemirror/addon/fold/comment-fold.js | 57 + .../codemirror/addon/fold/foldcode.js | 145 ++ .../codemirror/addon/fold/foldgutter.css | 20 + .../codemirror/addon/fold/foldgutter.js | 134 ++ .../codemirror/addon/fold/indent-fold.js | 44 + .../codemirror/addon/fold/markdown-fold.js | 49 + .../codemirror/addon/fold/xml-fold.js | 182 +++ .../codemirror/addon/hint/anyword-hint.js | 42 + .../codemirror/addon/hint/css-hint.js | 56 + .../codemirror/addon/hint/html-hint.js | 348 +++++ .../codemirror/addon/hint/javascript-hint.js | 141 ++ .../codemirror/addon/hint/python-hint.js | 102 ++ .../codemirror/addon/hint/show-hint.css | 38 + .../codemirror/addon/hint/show-hint.js | 389 ++++++ .../codemirror/addon/hint/sql-hint.js | 194 +++ .../codemirror/addon/hint/xml-hint.js | 103 ++ .../addon/lint/coffeescript-lint.js | 41 + .../codemirror/addon/lint/css-lint.js | 35 + .../codemirror/addon/lint/javascript-lint.js | 136 ++ .../codemirror/addon/lint/json-lint.js | 31 + .../codemirror/addon/lint/lint.css | 73 + .../codemirror/addon/lint/lint.js | 204 +++ .../codemirror/addon/lint/yaml-lint.js | 28 + .../codemirror/addon/merge/merge.css | 98 ++ .../codemirror/addon/merge/merge.js | 536 +++++++ .../codemirror/addon/mode/loadmode.js | 61 + .../codemirror/addon/mode/multiplex.js | 118 ++ .../codemirror/addon/mode/multiplex_test.js | 33 + .../codemirror/addon/mode/overlay.js | 85 ++ .../codemirror/addon/mode/simple.js | 210 +++ .../codemirror/addon/runmode/colorize.js | 40 + .../addon/runmode/runmode-standalone.js | 157 +++ .../codemirror/addon/runmode/runmode.js | 72 + .../codemirror/addon/runmode/runmode.node.js | 120 ++ .../{ => addon/scroll}/scrollpastend.js | 2 +- .../addon/search/match-highlighter.js | 128 ++ .../codemirror/addon/search/search.js | 159 +++ .../{ => addon/search}/searchcursor.js | 98 +- .../{ => addon/selection}/active-line.js | 6 +- .../addon/selection/mark-selection.js | 118 ++ .../codemirror/addon/tern/tern.css | 86 ++ .../codemirror/addon/tern/tern.js | 668 +++++++++ .../codemirror/addon/tern/worker.js | 44 + .../codemirror/addon/wrap/hardwrap.js | 139 ++ .../core/node_modules/codemirror/bower.json | 16 + .../codemirror/demo/activeline.html | 78 ++ .../codemirror/demo/anywordhint.html | 79 ++ .../node_modules/codemirror/demo/bidi.html | 74 + .../node_modules/codemirror/demo/btree.html | 85 ++ .../node_modules/codemirror/demo/buffers.html | 109 ++ .../codemirror/demo/changemode.html | 58 + .../codemirror/demo/closebrackets.html | 52 + .../codemirror/demo/closetag.html | 41 + .../codemirror/demo/complete.html | 79 ++ .../node_modules/codemirror/demo/emacs.html | 75 + .../node_modules/codemirror/demo/folding.html | 95 ++ .../codemirror/demo/fullscreen.html | 83 ++ .../codemirror/demo/hardwrap.html | 72 + .../codemirror/demo/html5complete.html | 56 + .../codemirror/demo/indentwrap.html | 59 + .../node_modules/codemirror/demo/lint.html | 171 +++ .../codemirror/demo/loadmode.html | 72 + .../node_modules/codemirror/demo/marker.html | 52 + .../codemirror/demo/markselection.html | 52 + .../codemirror/demo/matchhighlighter.html | 47 + .../codemirror/demo/matchtags.html | 48 + .../node_modules/codemirror/demo/merge.html | 107 ++ .../codemirror/demo/multiplex.html | 75 + .../codemirror/demo/mustache.html | 68 + .../codemirror/demo/placeholder.html | 45 + .../node_modules/codemirror/demo/preview.html | 87 ++ .../codemirror/demo/requirejs.html | 52 + .../node_modules/codemirror/demo/resize.html | 58 + .../node_modules/codemirror/demo/rulers.html | 49 + .../node_modules/codemirror/demo/runmode.html | 62 + .../node_modules/codemirror/demo/search.html | 87 ++ .../codemirror/demo/simplemode.html | 181 +++ .../demo/spanaffectswrapping_shim.html | 85 ++ .../node_modules/codemirror/demo/sublime.html | 79 ++ .../node_modules/codemirror/demo/tern.html | 131 ++ .../node_modules/codemirror/demo/theme.html | 126 ++ .../codemirror/demo/trailingspace.html | 48 + .../codemirror/demo/variableheight.html | 67 + .../node_modules/codemirror/demo/vim.html | 99 ++ .../codemirror/demo/visibletabs.html | 62 + .../node_modules/codemirror/demo/widget.html | 85 ++ .../codemirror/demo/xmlcomplete.html | 119 ++ deploy/core/node_modules/codemirror/emacs.js | 387 ----- deploy/core/node_modules/codemirror/fold.js | 551 -------- .../core/node_modules/codemirror/index.html | 199 +++ .../codemirror/{ => keymap}/sublime.js | 39 +- .../codemirror/lib}/codemirror.css | 1 - .../codemirror/{ => lib}/codemirror.js | 8 +- .../codemirror/{modes => mode/apl}/apl.js | 15 + .../codemirror/mode/apl/index.html | 72 + .../{modes => mode/asterisk}/asterisk.js | 15 + .../codemirror/mode/asterisk/index.html | 154 ++ .../codemirror/{modes => mode/clike}/clike.js | 152 +- .../codemirror/mode/clike/index.html | 225 +++ .../codemirror/mode/clike/scala.html | 767 ++++++++++ .../codemirror/{modes => mode/cobol}/cobol.js | 15 + .../codemirror/mode/cobol/index.html | 210 +++ .../coffeescript}/coffeescript.js | 58 +- .../codemirror/mode/coffeescript/index.html | 740 ++++++++++ .../{modes => mode/commonlisp}/commonlisp.js | 15 + .../codemirror/mode/commonlisp/index.html | 177 +++ .../codemirror/mode/cypher/cypher.js | 146 ++ .../codemirror/mode/cypher/index.html | 63 + .../codemirror/{modes => mode/d}/d.js | 19 +- .../node_modules/codemirror/mode/d/index.html | 273 ++++ .../codemirror/{modes => mode/diff}/diff.js | 15 + .../codemirror/mode/diff/index.html | 117 ++ .../codemirror/mode/django/django.js | 67 + .../codemirror/mode/django/index.html | 63 + .../codemirror/{modes => mode/dtd}/dtd.js | 17 +- .../codemirror/mode/dtd/index.html | 89 ++ .../codemirror/mode/dylan/dylan.js | 299 ++++ .../codemirror/mode/dylan/index.html | 407 ++++++ .../codemirror/{modes => mode/ecl}/ecl.js | 15 + .../codemirror/mode/ecl/index.html | 52 + .../{modes => mode/eiffel}/eiffel.js | 15 + .../codemirror/mode/eiffel/index.html | 429 ++++++ .../codemirror/mode/erlang/erlang.js | 622 +++++++++ .../codemirror/mode/erlang/index.html | 76 + .../{modes => mode/fortran}/fortran.js | 15 + .../codemirror/mode/fortran/index.html | 81 ++ .../codemirror/{modes => mode/gas}/gas.js | 17 +- .../codemirror/mode/gas/index.html | 68 + .../codemirror/{modes => mode/gfm}/gfm.js | 35 +- .../codemirror/mode/gfm/index.html | 82 ++ .../node_modules/codemirror/mode/gfm/test.js | 164 +++ .../codemirror/mode/gherkin/gherkin.js | 178 +++ .../codemirror/mode/gherkin/index.html | 48 + .../codemirror/{modes => mode/go}/go.js | 20 +- .../codemirror/mode/go/index.html | 85 ++ .../{modes => mode/groovy}/groovy.js | 15 + .../codemirror/mode/groovy/index.html | 84 ++ .../codemirror/{modes => mode/haml}/haml.js | 26 +- .../codemirror/mode/haml/index.html | 79 ++ .../node_modules/codemirror/mode/haml/test.js | 97 ++ .../{modes => mode/haskell}/haskell.js | 27 +- .../codemirror/mode/haskell/index.html | 73 + .../codemirror/{modes => mode/haxe}/haxe.js | 99 +- .../codemirror/mode/haxe/index.html | 124 ++ .../codemirror/{modes => mode/http}/http.js | 15 + .../codemirror/mode/http/index.html | 45 + .../node_modules/codemirror/mode/index.html | 125 ++ .../codemirror/mode/jade/index.html | 70 + .../node_modules/codemirror/mode/jade/jade.js | 590 ++++++++ .../codemirror/mode/jinja2/index.html | 54 + .../codemirror/mode/jinja2/jinja2.js | 142 ++ .../codemirror/mode/julia/index.html | 195 +++ .../codemirror/{modes => mode/julia}/julia.js | 91 +- .../codemirror/mode/kotlin/index.html | 89 ++ .../codemirror/mode/kotlin/kotlin.js | 280 ++++ .../codemirror/mode/livescript/index.html | 459 ++++++ .../{modes => mode/livescript}/livescript.js | 53 +- .../codemirror/mode/lua/index.html | 85 ++ .../codemirror/{modes => mode/lua}/lua.js | 15 + .../codemirror/mode/markdown/index.html | 359 +++++ .../{modes => mode/markdown}/markdown.js | 317 ++++- .../codemirror/mode/markdown/test.js | 754 ++++++++++ .../core/node_modules/codemirror/mode/meta.js | 144 ++ .../codemirror/mode/mirc/index.html | 160 +++ .../codemirror/{modes => mode/mirc}/mirc.js | 16 + .../codemirror/mode/mllike/index.html | 179 +++ .../{modes/ocaml.js => mode/mllike/mllike.js} | 115 +- .../codemirror/mode/modelica/index.html | 67 + .../codemirror/mode/modelica/modelica.js | 245 ++++ .../codemirror/mode/nginx/index.html | 181 +++ .../codemirror/{modes => mode/nginx}/nginx.js | 15 + .../codemirror/mode/ntriples/index.html | 45 + .../{modes => mode/ntriples}/ntriples.js | 16 + .../codemirror/mode/octave/index.html | 83 ++ .../{modes => mode/octave}/octave.js | 27 +- .../codemirror/mode/pascal/index.html | 61 + .../{modes => mode/pascal}/pascal.js | 15 + .../codemirror/mode/pegjs/index.html | 66 + .../codemirror/mode/pegjs/pegjs.js | 114 ++ .../codemirror/mode/perl/index.html | 75 + .../codemirror/{modes => mode/perl}/perl.js | 166 ++- .../codemirror/mode/php/index.html | 64 + .../node_modules/codemirror/mode/php/php.js | 226 +++ .../node_modules/codemirror/mode/php/test.js | 154 ++ .../codemirror/mode/pig/index.html | 55 + .../codemirror/{modes => mode/pig}/pig.js | 19 +- .../codemirror/mode/properties/index.html | 53 + .../{modes => mode/properties}/properties.js | 15 + .../codemirror/mode/puppet/index.html | 121 ++ .../codemirror/mode/puppet/puppet.js | 220 +++ .../node_modules/codemirror/mode/q/index.html | 144 ++ .../codemirror/{modes => mode/q}/q.js | 15 + .../node_modules/codemirror/mode/r/index.html | 85 ++ .../codemirror/{modes => mode/r}/r.js | 25 +- .../codemirror/mode/rpm/changes/index.html | 66 + .../codemirror/mode/rpm/index.html | 149 ++ .../node_modules/codemirror/mode/rpm/rpm.js | 101 ++ .../codemirror/mode/rst/index.html | 535 +++++++ .../node_modules/codemirror/mode/rst/rst.js | 557 ++++++++ .../codemirror/mode/ruby/index.html | 184 +++ .../codemirror/{modes => mode/ruby}/ruby.js | 82 +- .../node_modules/codemirror/mode/ruby/test.js | 14 + .../codemirror/mode/rust/index.html | 60 + .../codemirror/{modes => mode/rust}/rust.js | 19 +- .../codemirror/mode/sass/index.html | 66 + .../codemirror/{modes => mode/sass}/sass.js | 217 ++- .../codemirror/mode/scheme/index.html | 77 + .../{modes => mode/scheme}/scheme.js | 16 + .../codemirror/mode/shell/index.html | 66 + .../codemirror/{modes => mode/shell}/shell.js | 26 +- .../codemirror/mode/shell/test.js | 58 + .../codemirror/mode/sieve/index.html | 93 ++ .../codemirror/{modes => mode/sieve}/sieve.js | 18 +- .../codemirror/mode/slim/index.html | 96 ++ .../node_modules/codemirror/mode/slim/slim.js | 575 ++++++++ .../node_modules/codemirror/mode/slim/test.js | 96 ++ .../codemirror/mode/smalltalk/index.html | 68 + .../{modes => mode/smalltalk}/smalltalk.js | 23 +- .../codemirror/mode/smarty/index.html | 136 ++ .../{modes => mode/smarty}/smarty.js | 16 + .../codemirror/mode/smartymixed/index.html | 114 ++ .../smartymixed}/smartymixed.js | 56 +- .../codemirror/mode/solr/index.html | 57 + .../node_modules/codemirror/mode/solr/solr.js | 104 ++ .../codemirror/mode/sparql/index.html | 53 + .../{modes => mode/sparql}/sparql.js | 15 + .../codemirror/mode/sql/index.html | 84 ++ .../codemirror/{modes => mode/sql}/sql.js | 40 +- .../codemirror/mode/stex/index.html | 110 ++ .../codemirror/{modes => mode/stex}/stex.js | 18 +- .../node_modules/codemirror/mode/stex/test.js | 123 ++ .../codemirror/mode/tcl/index.html | 142 ++ .../codemirror/{modes => mode/tcl}/tcl.js | 18 +- .../codemirror/mode/textile/index.html | 191 +++ .../codemirror/mode/textile/test.js | 406 ++++++ .../codemirror/mode/textile/textile.js | 553 ++++++++ .../codemirror/mode/tiddlywiki/index.html | 154 ++ .../codemirror/mode/tiddlywiki/tiddlywiki.css | 14 + .../{modes => mode/tiddlywiki}/tiddlywiki.js | 16 + .../codemirror/mode/tiki/index.html | 95 ++ .../codemirror/mode/tiki/tiki.css | 26 + .../codemirror/{modes => mode/tiki}/tiki.js | 15 + .../codemirror/mode/toml/index.html | 73 + .../codemirror/{modes => mode/toml}/toml.js | 17 + .../codemirror/mode/tornado/index.html | 63 + .../codemirror/mode/tornado/tornado.js | 68 + .../codemirror/mode/turtle/index.html | 50 + .../{modes => mode/turtle}/turtle.js | 15 + .../codemirror/mode/vb/index.html | 102 ++ .../codemirror/{modes => mode/vb}/vb.js | 15 + .../codemirror/mode/vbscript/index.html | 55 + .../{modes => mode/vbscript}/vbscript.js | 18 +- .../codemirror/mode/velocity/index.html | 118 ++ .../{modes => mode/velocity}/velocity.js | 15 + .../codemirror/mode/verilog/index.html | 120 ++ .../codemirror/mode/verilog/test.js | 273 ++++ .../codemirror/mode/verilog/verilog.js | 364 +++++ .../codemirror/mode/xml/index.html | 57 + .../node_modules/codemirror/mode/xml/test.js | 51 + .../codemirror/{modes => mode/xml}/xml.js | 283 ++-- .../codemirror/mode/xquery/index.html | 210 +++ .../codemirror/mode/xquery/test.js | 67 + .../{modes => mode/xquery}/xquery.js | 15 + .../codemirror/mode/yaml/index.html | 80 ++ .../codemirror/{modes => mode/yaml}/yaml.js | 17 +- .../codemirror/mode/z80/index.html | 52 + .../codemirror/{modes => mode/z80}/z80.js | 15 + .../node_modules/codemirror/modes/erlang.js | 484 ------- .../node_modules/codemirror/modes/gherkin.js | 168 --- .../node_modules/codemirror/modes/jade.js | 90 -- .../node_modules/codemirror/modes/jinja2.js | 42 - .../node_modules/codemirror/modes/mysql.js | 203 --- .../core/node_modules/codemirror/modes/php.js | 132 -- .../node_modules/codemirror/modes/plsql.js | 216 --- .../core/node_modules/codemirror/modes/rst.js | 560 -------- .../node_modules/codemirror/modes/verilog.js | 182 --- .../core/node_modules/codemirror/package.json | 1241 +++++++++++++++++ src/lt/objs/editor.cljs | 23 +- src/lt/objs/find.cljs | 5 +- src/lt/objs/langs/behaviors.cljs | 1 + 304 files changed, 32920 insertions(+), 3637 deletions(-) create mode 100644 deploy/core/.gitignore create mode 100644 deploy/core/node_modules/codemirror/.gitattributes create mode 100644 deploy/core/node_modules/codemirror/.npmignore create mode 100644 deploy/core/node_modules/codemirror/.travis.yml create mode 100644 deploy/core/node_modules/codemirror/AUTHORS create mode 100644 deploy/core/node_modules/codemirror/CONTRIBUTING.md create mode 100644 deploy/core/node_modules/codemirror/LICENSE create mode 100644 deploy/core/node_modules/codemirror/README.md rename deploy/core/node_modules/codemirror/{ => addon/comment}/comment.js (86%) create mode 100644 deploy/core/node_modules/codemirror/addon/comment/continuecomment.js create mode 100644 deploy/core/node_modules/codemirror/addon/dialog/dialog.css create mode 100644 deploy/core/node_modules/codemirror/addon/dialog/dialog.js create mode 100644 deploy/core/node_modules/codemirror/addon/display/fullscreen.css create mode 100644 deploy/core/node_modules/codemirror/addon/display/fullscreen.js create mode 100644 deploy/core/node_modules/codemirror/addon/display/placeholder.js create mode 100644 deploy/core/node_modules/codemirror/addon/display/rulers.js create mode 100644 deploy/core/node_modules/codemirror/addon/edit/closebrackets.js create mode 100644 deploy/core/node_modules/codemirror/addon/edit/closetag.js create mode 100644 deploy/core/node_modules/codemirror/addon/edit/continuelist.js rename deploy/core/node_modules/codemirror/{matchbracket.js => addon/edit/matchbrackets.js} (98%) create mode 100644 deploy/core/node_modules/codemirror/addon/edit/matchtags.js create mode 100644 deploy/core/node_modules/codemirror/addon/edit/trailingspace.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/brace-fold.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/comment-fold.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/foldcode.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/foldgutter.css create mode 100644 deploy/core/node_modules/codemirror/addon/fold/foldgutter.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/indent-fold.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/markdown-fold.js create mode 100644 deploy/core/node_modules/codemirror/addon/fold/xml-fold.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/anyword-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/css-hint.js create mode 100755 deploy/core/node_modules/codemirror/addon/hint/html-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/javascript-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/python-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/show-hint.css create mode 100644 deploy/core/node_modules/codemirror/addon/hint/show-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/sql-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/hint/xml-hint.js create mode 100644 deploy/core/node_modules/codemirror/addon/lint/coffeescript-lint.js create mode 100644 deploy/core/node_modules/codemirror/addon/lint/css-lint.js create mode 100644 deploy/core/node_modules/codemirror/addon/lint/javascript-lint.js create mode 100644 deploy/core/node_modules/codemirror/addon/lint/json-lint.js create mode 100644 deploy/core/node_modules/codemirror/addon/lint/lint.css create mode 100644 deploy/core/node_modules/codemirror/addon/lint/lint.js create mode 100644 deploy/core/node_modules/codemirror/addon/lint/yaml-lint.js create mode 100644 deploy/core/node_modules/codemirror/addon/merge/merge.css create mode 100644 deploy/core/node_modules/codemirror/addon/merge/merge.js create mode 100644 deploy/core/node_modules/codemirror/addon/mode/loadmode.js create mode 100644 deploy/core/node_modules/codemirror/addon/mode/multiplex.js create mode 100644 deploy/core/node_modules/codemirror/addon/mode/multiplex_test.js create mode 100644 deploy/core/node_modules/codemirror/addon/mode/overlay.js create mode 100644 deploy/core/node_modules/codemirror/addon/mode/simple.js create mode 100644 deploy/core/node_modules/codemirror/addon/runmode/colorize.js create mode 100644 deploy/core/node_modules/codemirror/addon/runmode/runmode-standalone.js create mode 100644 deploy/core/node_modules/codemirror/addon/runmode/runmode.js create mode 100644 deploy/core/node_modules/codemirror/addon/runmode/runmode.node.js rename deploy/core/node_modules/codemirror/{ => addon/scroll}/scrollpastend.js (95%) create mode 100644 deploy/core/node_modules/codemirror/addon/search/match-highlighter.js create mode 100644 deploy/core/node_modules/codemirror/addon/search/search.js rename deploy/core/node_modules/codemirror/{ => addon/search}/searchcursor.js (56%) rename deploy/core/node_modules/codemirror/{ => addon/selection}/active-line.js (92%) create mode 100644 deploy/core/node_modules/codemirror/addon/selection/mark-selection.js create mode 100644 deploy/core/node_modules/codemirror/addon/tern/tern.css create mode 100644 deploy/core/node_modules/codemirror/addon/tern/tern.js create mode 100644 deploy/core/node_modules/codemirror/addon/tern/worker.js create mode 100644 deploy/core/node_modules/codemirror/addon/wrap/hardwrap.js create mode 100644 deploy/core/node_modules/codemirror/bower.json create mode 100644 deploy/core/node_modules/codemirror/demo/activeline.html create mode 100644 deploy/core/node_modules/codemirror/demo/anywordhint.html create mode 100644 deploy/core/node_modules/codemirror/demo/bidi.html create mode 100644 deploy/core/node_modules/codemirror/demo/btree.html create mode 100644 deploy/core/node_modules/codemirror/demo/buffers.html create mode 100644 deploy/core/node_modules/codemirror/demo/changemode.html create mode 100644 deploy/core/node_modules/codemirror/demo/closebrackets.html create mode 100644 deploy/core/node_modules/codemirror/demo/closetag.html create mode 100644 deploy/core/node_modules/codemirror/demo/complete.html create mode 100644 deploy/core/node_modules/codemirror/demo/emacs.html create mode 100644 deploy/core/node_modules/codemirror/demo/folding.html create mode 100644 deploy/core/node_modules/codemirror/demo/fullscreen.html create mode 100644 deploy/core/node_modules/codemirror/demo/hardwrap.html create mode 100644 deploy/core/node_modules/codemirror/demo/html5complete.html create mode 100644 deploy/core/node_modules/codemirror/demo/indentwrap.html create mode 100644 deploy/core/node_modules/codemirror/demo/lint.html create mode 100644 deploy/core/node_modules/codemirror/demo/loadmode.html create mode 100644 deploy/core/node_modules/codemirror/demo/marker.html create mode 100644 deploy/core/node_modules/codemirror/demo/markselection.html create mode 100644 deploy/core/node_modules/codemirror/demo/matchhighlighter.html create mode 100644 deploy/core/node_modules/codemirror/demo/matchtags.html create mode 100644 deploy/core/node_modules/codemirror/demo/merge.html create mode 100644 deploy/core/node_modules/codemirror/demo/multiplex.html create mode 100644 deploy/core/node_modules/codemirror/demo/mustache.html create mode 100644 deploy/core/node_modules/codemirror/demo/placeholder.html create mode 100644 deploy/core/node_modules/codemirror/demo/preview.html create mode 100644 deploy/core/node_modules/codemirror/demo/requirejs.html create mode 100644 deploy/core/node_modules/codemirror/demo/resize.html create mode 100644 deploy/core/node_modules/codemirror/demo/rulers.html create mode 100644 deploy/core/node_modules/codemirror/demo/runmode.html create mode 100644 deploy/core/node_modules/codemirror/demo/search.html create mode 100644 deploy/core/node_modules/codemirror/demo/simplemode.html create mode 100644 deploy/core/node_modules/codemirror/demo/spanaffectswrapping_shim.html create mode 100644 deploy/core/node_modules/codemirror/demo/sublime.html create mode 100644 deploy/core/node_modules/codemirror/demo/tern.html create mode 100644 deploy/core/node_modules/codemirror/demo/theme.html create mode 100644 deploy/core/node_modules/codemirror/demo/trailingspace.html create mode 100644 deploy/core/node_modules/codemirror/demo/variableheight.html create mode 100644 deploy/core/node_modules/codemirror/demo/vim.html create mode 100644 deploy/core/node_modules/codemirror/demo/visibletabs.html create mode 100644 deploy/core/node_modules/codemirror/demo/widget.html create mode 100644 deploy/core/node_modules/codemirror/demo/xmlcomplete.html delete mode 100644 deploy/core/node_modules/codemirror/emacs.js delete mode 100644 deploy/core/node_modules/codemirror/fold.js create mode 100644 deploy/core/node_modules/codemirror/index.html rename deploy/core/node_modules/codemirror/{ => keymap}/sublime.js (94%) rename deploy/core/{css => node_modules/codemirror/lib}/codemirror.css (99%) rename deploy/core/node_modules/codemirror/{ => lib}/codemirror.js (99%) rename deploy/core/node_modules/codemirror/{modes => mode/apl}/apl.js (90%) create mode 100644 deploy/core/node_modules/codemirror/mode/apl/index.html rename deploy/core/node_modules/codemirror/{modes => mode/asterisk}/asterisk.js (93%) create mode 100644 deploy/core/node_modules/codemirror/mode/asterisk/index.html rename deploy/core/node_modules/codemirror/{modes => mode/clike}/clike.js (77%) create mode 100644 deploy/core/node_modules/codemirror/mode/clike/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/clike/scala.html rename deploy/core/node_modules/codemirror/{modes => mode/cobol}/cobol.js (95%) create mode 100644 deploy/core/node_modules/codemirror/mode/cobol/index.html rename deploy/core/node_modules/codemirror/{modes => mode/coffeescript}/coffeescript.js (83%) create mode 100644 deploy/core/node_modules/codemirror/mode/coffeescript/index.html rename deploy/core/node_modules/codemirror/{modes => mode/commonlisp}/commonlisp.js (88%) create mode 100644 deploy/core/node_modules/codemirror/mode/commonlisp/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/cypher/cypher.js create mode 100644 deploy/core/node_modules/codemirror/mode/cypher/index.html rename deploy/core/node_modules/codemirror/{modes => mode/d}/d.js (93%) mode change 100755 => 100644 create mode 100644 deploy/core/node_modules/codemirror/mode/d/index.html rename deploy/core/node_modules/codemirror/{modes => mode/diff}/diff.js (59%) create mode 100644 deploy/core/node_modules/codemirror/mode/diff/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/django/django.js create mode 100644 deploy/core/node_modules/codemirror/mode/django/index.html rename deploy/core/node_modules/codemirror/{modes => mode/dtd}/dtd.js (88%) create mode 100644 deploy/core/node_modules/codemirror/mode/dtd/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/dylan/dylan.js create mode 100644 deploy/core/node_modules/codemirror/mode/dylan/index.html rename deploy/core/node_modules/codemirror/{modes => mode/ecl}/ecl.js (94%) create mode 100644 deploy/core/node_modules/codemirror/mode/ecl/index.html rename deploy/core/node_modules/codemirror/{modes => mode/eiffel}/eiffel.js (87%) create mode 100644 deploy/core/node_modules/codemirror/mode/eiffel/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/erlang/erlang.js create mode 100644 deploy/core/node_modules/codemirror/mode/erlang/index.html rename deploy/core/node_modules/codemirror/{modes => mode/fortran}/fortran.js (94%) create mode 100644 deploy/core/node_modules/codemirror/mode/fortran/index.html rename deploy/core/node_modules/codemirror/{modes => mode/gas}/gas.js (94%) create mode 100644 deploy/core/node_modules/codemirror/mode/gas/index.html rename deploy/core/node_modules/codemirror/{modes => mode/gfm}/gfm.js (70%) create mode 100644 deploy/core/node_modules/codemirror/mode/gfm/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/gfm/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/gherkin/gherkin.js create mode 100644 deploy/core/node_modules/codemirror/mode/gherkin/index.html rename deploy/core/node_modules/codemirror/{modes => mode/go}/go.js (90%) create mode 100644 deploy/core/node_modules/codemirror/mode/go/index.html rename deploy/core/node_modules/codemirror/{modes => mode/groovy}/groovy.js (93%) create mode 100644 deploy/core/node_modules/codemirror/mode/groovy/index.html rename deploy/core/node_modules/codemirror/{modes => mode/haml}/haml.js (86%) create mode 100644 deploy/core/node_modules/codemirror/mode/haml/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/haml/test.js rename deploy/core/node_modules/codemirror/{modes => mode/haskell}/haskell.js (91%) create mode 100644 deploy/core/node_modules/codemirror/mode/haskell/index.html rename deploy/core/node_modules/codemirror/{modes => mode/haxe}/haxe.js (87%) create mode 100644 deploy/core/node_modules/codemirror/mode/haxe/index.html rename deploy/core/node_modules/codemirror/{modes => mode/http}/http.js (83%) create mode 100644 deploy/core/node_modules/codemirror/mode/http/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/jade/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/jade/jade.js create mode 100644 deploy/core/node_modules/codemirror/mode/jinja2/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/jinja2/jinja2.js create mode 100644 deploy/core/node_modules/codemirror/mode/julia/index.html rename deploy/core/node_modules/codemirror/{modes => mode/julia}/julia.js (71%) create mode 100644 deploy/core/node_modules/codemirror/mode/kotlin/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/kotlin/kotlin.js create mode 100644 deploy/core/node_modules/codemirror/mode/livescript/index.html rename deploy/core/node_modules/codemirror/{modes => mode/livescript}/livescript.js (85%) create mode 100644 deploy/core/node_modules/codemirror/mode/lua/index.html rename deploy/core/node_modules/codemirror/{modes => mode/lua}/lua.js (92%) create mode 100644 deploy/core/node_modules/codemirror/mode/markdown/index.html rename deploy/core/node_modules/codemirror/{modes => mode/markdown}/markdown.js (61%) create mode 100644 deploy/core/node_modules/codemirror/mode/markdown/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/meta.js create mode 100644 deploy/core/node_modules/codemirror/mode/mirc/index.html rename deploy/core/node_modules/codemirror/{modes => mode/mirc}/mirc.js (95%) create mode 100644 deploy/core/node_modules/codemirror/mode/mllike/index.html rename deploy/core/node_modules/codemirror/{modes/ocaml.js => mode/mllike/mllike.js} (51%) create mode 100644 deploy/core/node_modules/codemirror/mode/modelica/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/modelica/modelica.js create mode 100644 deploy/core/node_modules/codemirror/mode/nginx/index.html rename deploy/core/node_modules/codemirror/{modes => mode/nginx}/nginx.js (95%) create mode 100644 deploy/core/node_modules/codemirror/mode/ntriples/index.html rename deploy/core/node_modules/codemirror/{modes => mode/ntriples}/ntriples.js (93%) create mode 100644 deploy/core/node_modules/codemirror/mode/octave/index.html rename deploy/core/node_modules/codemirror/{modes => mode/octave}/octave.js (80%) create mode 100644 deploy/core/node_modules/codemirror/mode/pascal/index.html rename deploy/core/node_modules/codemirror/{modes => mode/pascal}/pascal.js (84%) create mode 100644 deploy/core/node_modules/codemirror/mode/pegjs/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/pegjs/pegjs.js create mode 100644 deploy/core/node_modules/codemirror/mode/perl/index.html rename deploy/core/node_modules/codemirror/{modes => mode/perl}/perl.js (92%) create mode 100644 deploy/core/node_modules/codemirror/mode/php/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/php/php.js create mode 100644 deploy/core/node_modules/codemirror/mode/php/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/pig/index.html rename deploy/core/node_modules/codemirror/{modes => mode/pig}/pig.js (90%) create mode 100644 deploy/core/node_modules/codemirror/mode/properties/index.html rename deploy/core/node_modules/codemirror/{modes => mode/properties}/properties.js (78%) create mode 100644 deploy/core/node_modules/codemirror/mode/puppet/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/puppet/puppet.js create mode 100644 deploy/core/node_modules/codemirror/mode/q/index.html rename deploy/core/node_modules/codemirror/{modes => mode/q}/q.js (93%) create mode 100644 deploy/core/node_modules/codemirror/mode/r/index.html rename deploy/core/node_modules/codemirror/{modes => mode/r}/r.js (86%) create mode 100644 deploy/core/node_modules/codemirror/mode/rpm/changes/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/rpm/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/rpm/rpm.js create mode 100644 deploy/core/node_modules/codemirror/mode/rst/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/rst/rst.js create mode 100644 deploy/core/node_modules/codemirror/mode/ruby/index.html rename deploy/core/node_modules/codemirror/{modes => mode/ruby}/ruby.js (75%) create mode 100644 deploy/core/node_modules/codemirror/mode/ruby/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/rust/index.html rename deploy/core/node_modules/codemirror/{modes => mode/rust}/rust.js (96%) create mode 100644 deploy/core/node_modules/codemirror/mode/sass/index.html rename deploy/core/node_modules/codemirror/{modes => mode/sass}/sass.js (58%) create mode 100644 deploy/core/node_modules/codemirror/mode/scheme/index.html rename deploy/core/node_modules/codemirror/{modes => mode/scheme}/scheme.js (96%) create mode 100644 deploy/core/node_modules/codemirror/mode/shell/index.html rename deploy/core/node_modules/codemirror/{modes => mode/shell}/shell.js (82%) create mode 100644 deploy/core/node_modules/codemirror/mode/shell/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/sieve/index.html rename deploy/core/node_modules/codemirror/{modes => mode/sieve}/sieve.js (89%) create mode 100644 deploy/core/node_modules/codemirror/mode/slim/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/slim/slim.js create mode 100644 deploy/core/node_modules/codemirror/mode/slim/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/smalltalk/index.html rename deploy/core/node_modules/codemirror/{modes => mode/smalltalk}/smalltalk.js (86%) create mode 100644 deploy/core/node_modules/codemirror/mode/smarty/index.html rename deploy/core/node_modules/codemirror/{modes => mode/smarty}/smarty.js (92%) create mode 100644 deploy/core/node_modules/codemirror/mode/smartymixed/index.html rename deploy/core/node_modules/codemirror/{modes => mode/smartymixed}/smartymixed.js (76%) create mode 100644 deploy/core/node_modules/codemirror/mode/solr/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/solr/solr.js create mode 100644 deploy/core/node_modules/codemirror/mode/sparql/index.html rename deploy/core/node_modules/codemirror/{modes => mode/sparql}/sparql.js (91%) create mode 100644 deploy/core/node_modules/codemirror/mode/sql/index.html rename deploy/core/node_modules/codemirror/{modes => mode/sql}/sql.js (81%) create mode 100644 deploy/core/node_modules/codemirror/mode/stex/index.html rename deploy/core/node_modules/codemirror/{modes => mode/stex}/stex.js (93%) create mode 100644 deploy/core/node_modules/codemirror/mode/stex/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/tcl/index.html rename deploy/core/node_modules/codemirror/{modes => mode/tcl}/tcl.js (89%) create mode 100644 deploy/core/node_modules/codemirror/mode/textile/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/textile/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/textile/textile.js create mode 100644 deploy/core/node_modules/codemirror/mode/tiddlywiki/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.css rename deploy/core/node_modules/codemirror/{modes => mode/tiddlywiki}/tiddlywiki.js (95%) create mode 100644 deploy/core/node_modules/codemirror/mode/tiki/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/tiki/tiki.css rename deploy/core/node_modules/codemirror/{modes => mode/tiki}/tiki.js (94%) create mode 100644 deploy/core/node_modules/codemirror/mode/toml/index.html rename deploy/core/node_modules/codemirror/{modes => mode/toml}/toml.js (80%) create mode 100644 deploy/core/node_modules/codemirror/mode/tornado/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/tornado/tornado.js create mode 100644 deploy/core/node_modules/codemirror/mode/turtle/index.html rename deploy/core/node_modules/codemirror/{modes => mode/turtle}/turtle.js (90%) create mode 100644 deploy/core/node_modules/codemirror/mode/vb/index.html rename deploy/core/node_modules/codemirror/{modes => mode/vb}/vb.js (94%) create mode 100644 deploy/core/node_modules/codemirror/mode/vbscript/index.html rename deploy/core/node_modules/codemirror/{modes => mode/vbscript}/vbscript.js (95%) create mode 100644 deploy/core/node_modules/codemirror/mode/velocity/index.html rename deploy/core/node_modules/codemirror/{modes => mode/velocity}/velocity.js (93%) create mode 100644 deploy/core/node_modules/codemirror/mode/verilog/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/verilog/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/verilog/verilog.js create mode 100644 deploy/core/node_modules/codemirror/mode/xml/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/xml/test.js rename deploy/core/node_modules/codemirror/{modes => mode/xml}/xml.js (57%) create mode 100644 deploy/core/node_modules/codemirror/mode/xquery/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/xquery/test.js rename deploy/core/node_modules/codemirror/{modes => mode/xquery}/xquery.js (96%) create mode 100644 deploy/core/node_modules/codemirror/mode/yaml/index.html rename deploy/core/node_modules/codemirror/{modes => mode/yaml}/yaml.js (83%) create mode 100644 deploy/core/node_modules/codemirror/mode/z80/index.html rename deploy/core/node_modules/codemirror/{modes => mode/z80}/z80.js (83%) delete mode 100644 deploy/core/node_modules/codemirror/modes/erlang.js delete mode 100644 deploy/core/node_modules/codemirror/modes/gherkin.js delete mode 100644 deploy/core/node_modules/codemirror/modes/jade.js delete mode 100644 deploy/core/node_modules/codemirror/modes/jinja2.js delete mode 100644 deploy/core/node_modules/codemirror/modes/mysql.js delete mode 100644 deploy/core/node_modules/codemirror/modes/php.js delete mode 100644 deploy/core/node_modules/codemirror/modes/plsql.js delete mode 100644 deploy/core/node_modules/codemirror/modes/rst.js delete mode 100644 deploy/core/node_modules/codemirror/modes/verilog.js create mode 100644 deploy/core/node_modules/codemirror/package.json diff --git a/deploy/core/.gitignore b/deploy/core/.gitignore new file mode 100644 index 000000000..c8233bbc0 --- /dev/null +++ b/deploy/core/.gitignore @@ -0,0 +1,12 @@ +node_modules/codemirror/doc/ +node_modules/codemirror/keymap/emacs.js +node_modules/codemirror/keymap/vim.js +node_modules/codemirror/theme/ +node_modules/codemirror/test/ +node_modules/codemirror/bin/ +node_modules/codemirror/mode/htmlembedded/ +node_modules/codemirror/mode/htmlmixed/ +node_modules/codemirror/mode/clojure/ +node_modules/codemirror/mode/javascript/ +node_modules/codemirror/mode/python/ +node_modules/codemirror/mode/css/ diff --git a/deploy/core/LightTable.html b/deploy/core/LightTable.html index 2f76b1888..b238d6db9 100644 --- a/deploy/core/LightTable.html +++ b/deploy/core/LightTable.html @@ -5,7 +5,7 @@ Light Table - + + + +
+

Active Line Demo

+
+ + + +

Styling the current cursor line.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/anywordhint.html b/deploy/core/node_modules/codemirror/demo/anywordhint.html new file mode 100644 index 000000000..0a7caece2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/anywordhint.html @@ -0,0 +1,79 @@ + + +CodeMirror: Any Word Completion Demo + + + + + + + + + + + +
+

Any Word Completion Demo

+
+ +

Press ctrl-space to activate autocompletion. The +completion uses +the anyword-hint.js +module, which simply looks at nearby words in the buffer and completes +to those.

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/bidi.html b/deploy/core/node_modules/codemirror/demo/bidi.html new file mode 100644 index 000000000..6dd73bec3 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/bidi.html @@ -0,0 +1,74 @@ + + +CodeMirror: Bi-directional Text Demo + + + + + + + + + +
+

Bi-directional Text Demo

+
+ + + +

Demonstration of bi-directional text support. See + the related + blog post for more background.

+ +

Note: There is + a known + bug with cursor motion and mouse clicks in bi-directional lines + that are line wrapped.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/btree.html b/deploy/core/node_modules/codemirror/demo/btree.html new file mode 100644 index 000000000..fc4997f4f --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/btree.html @@ -0,0 +1,85 @@ + + +CodeMirror: B-Tree visualization + + + + + + + + +
+

B-Tree visualization

+
+
+
+
+ + + +

+ + diff --git a/deploy/core/node_modules/codemirror/demo/buffers.html b/deploy/core/node_modules/codemirror/demo/buffers.html new file mode 100644 index 000000000..16ffc7dfe --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/buffers.html @@ -0,0 +1,109 @@ + + +CodeMirror: Multiple Buffer & Split View Demo + + + + + + + + + + +
+

Multiple Buffer & Split View Demo

+ + +
+
+ Select buffer: +     +
+
+
+ Select buffer: +     +
+ + + +

Demonstration of + using linked documents + to provide a split view on a document, and + using swapDoc + to use a single editor to display multiple documents.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/changemode.html b/deploy/core/node_modules/codemirror/demo/changemode.html new file mode 100644 index 000000000..9405932ab --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/changemode.html @@ -0,0 +1,58 @@ + + +CodeMirror: Mode-Changing Demo + + + + + + + + + + +
+

Mode-Changing Demo

+
+ +

On changes to the content of the above editor, a (crude) script +tries to auto-detect the language used, and switches the editor to +either JavaScript or Scheme mode based on that.

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/closebrackets.html b/deploy/core/node_modules/codemirror/demo/closebrackets.html new file mode 100644 index 000000000..45da4ebf8 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/closebrackets.html @@ -0,0 +1,52 @@ + + +CodeMirror: Closebrackets Demo + + + + + + + + + + +
+

Closebrackets Demo

+
+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/closetag.html b/deploy/core/node_modules/codemirror/demo/closetag.html new file mode 100644 index 000000000..79959d2c4 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/closetag.html @@ -0,0 +1,41 @@ + + +CodeMirror: Close-Tag Demo + + + + + + + + + + + + + + +
+

Close-Tag Demo

+
+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/complete.html b/deploy/core/node_modules/codemirror/demo/complete.html new file mode 100644 index 000000000..cdf49dbeb --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/complete.html @@ -0,0 +1,79 @@ + + +CodeMirror: Autocomplete Demo + + + + + + + + + + + + +
+

Autocomplete Demo

+
+ +

Press ctrl-space to activate autocompletion. Built +on top of the show-hint +and javascript-hint +addons.

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/emacs.html b/deploy/core/node_modules/codemirror/demo/emacs.html new file mode 100644 index 000000000..c626b8d40 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/emacs.html @@ -0,0 +1,75 @@ + + +CodeMirror: Emacs bindings demo + + + + + + + + + + + + + + + + +
+

Emacs bindings demo

+
+ +

The emacs keybindings are enabled by +including keymap/emacs.js and setting +the keyMap option to "emacs". Because +CodeMirror's internal API is quite different from Emacs, they are only +a loose approximation of actual emacs bindings, though.

+ +

Also note that a lot of browsers disallow certain keys from being +captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the +result that idiomatic use of Emacs keys will constantly close your tab +or open a new window.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/folding.html b/deploy/core/node_modules/codemirror/demo/folding.html new file mode 100644 index 000000000..81cbf9894 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/folding.html @@ -0,0 +1,95 @@ + + + + CodeMirror: Code Folding Demo + + + + + + + + + + + + + + + + + + + + + +
+

Code Folding Demo

+
+
JavaScript:
+
+
HTML:
+
+
Markdown:
+
+
+ +
+ diff --git a/deploy/core/node_modules/codemirror/demo/fullscreen.html b/deploy/core/node_modules/codemirror/demo/fullscreen.html new file mode 100644 index 000000000..1fbdc488e --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/fullscreen.html @@ -0,0 +1,83 @@ + + +CodeMirror: Full Screen Editing + + + + + + + + + + + + +
+

Full Screen Editing

+
+ + +

Demonstration of + the fullscreen + addon. Press F11 when cursor is in the editor to + toggle full screen editing. Esc can also be used + to exit full screen editing.

+
diff --git a/deploy/core/node_modules/codemirror/demo/hardwrap.html b/deploy/core/node_modules/codemirror/demo/hardwrap.html new file mode 100644 index 000000000..f1a870b41 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/hardwrap.html @@ -0,0 +1,72 @@ + + +CodeMirror: Hard-wrapping Demo + + + + + + + + + + +
+

Hard-wrapping Demo

+
+ +

Demonstration of +the hardwrap addon. +The above editor has its change event hooked up to +the wrapParagraphsInRange method, so that the paragraphs +are reflown as you are typing.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/html5complete.html b/deploy/core/node_modules/codemirror/demo/html5complete.html new file mode 100644 index 000000000..411baae3e --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/html5complete.html @@ -0,0 +1,56 @@ + + + + CodeMirror: HTML completion demo + + + + + + + + + + + + + + + + + + + +
+

HTML completion demo

+ +

Shows the XML completer + parameterized with information about the tags in HTML. + Press ctrl-space to activate completion.

+ +
+ + +
+ diff --git a/deploy/core/node_modules/codemirror/demo/indentwrap.html b/deploy/core/node_modules/codemirror/demo/indentwrap.html new file mode 100644 index 000000000..3d3d0af6a --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/indentwrap.html @@ -0,0 +1,59 @@ + + +CodeMirror: Indented wrapped line demo + + + + + + + + + +
+

Indented wrapped line demo

+
+ +

This page uses a hack on top of the "renderLine" + event to make wrapped text line up with the base indentation of + the line.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/lint.html b/deploy/core/node_modules/codemirror/demo/lint.html new file mode 100644 index 000000000..29936a8d9 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/lint.html @@ -0,0 +1,171 @@ + + +CodeMirror: Linter Demo + + + + + + + + + + + + + + + + + + +
+

Linter Demo

+ + +

+ +

+ +

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/loadmode.html b/deploy/core/node_modules/codemirror/demo/loadmode.html new file mode 100644 index 000000000..809cd9022 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/loadmode.html @@ -0,0 +1,72 @@ + + +CodeMirror: Lazy Mode Loading Demo + + + + + + + + + + +
+

Lazy Mode Loading Demo

+

Current mode: text/plain

+
+

Filename, mime, or mode name:

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/marker.html b/deploy/core/node_modules/codemirror/demo/marker.html new file mode 100644 index 000000000..3a8b85000 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/marker.html @@ -0,0 +1,52 @@ + + +CodeMirror: Breakpoint Demo + + + + + + + + + +
+

Breakpoint Demo

+
+ +

Click the line-number gutter to add or remove 'breakpoints'.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/markselection.html b/deploy/core/node_modules/codemirror/demo/markselection.html new file mode 100644 index 000000000..d4c8a7a0d --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/markselection.html @@ -0,0 +1,52 @@ + + +CodeMirror: Selection Marking Demo + + + + + + + + + + +
+

Selection Marking Demo

+
+ + + +

Simple addon to easily mark (and style) selected text. Docs.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/matchhighlighter.html b/deploy/core/node_modules/codemirror/demo/matchhighlighter.html new file mode 100644 index 000000000..c60109009 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/matchhighlighter.html @@ -0,0 +1,47 @@ + + +CodeMirror: Match Highlighter Demo + + + + + + + + + + +
+

Match Highlighter Demo

+
+ + + +

Search and highlight occurences of the selected text.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/matchtags.html b/deploy/core/node_modules/codemirror/demo/matchtags.html new file mode 100644 index 000000000..175639a39 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/matchtags.html @@ -0,0 +1,48 @@ + + +CodeMirror: Tag Matcher Demo + + + + + + + + + + + +
+

Tag Matcher Demo

+ + +
+ + + +

Put the cursor on or inside a pair of tags to highlight them. + Press Ctrl-J to jump to the tag that matches the one under the + cursor.

+
diff --git a/deploy/core/node_modules/codemirror/demo/merge.html b/deploy/core/node_modules/codemirror/demo/merge.html new file mode 100644 index 000000000..4517c548e --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/merge.html @@ -0,0 +1,107 @@ + + +CodeMirror: merge view demo + + + + + + + + + + + + +
+

merge view demo

+ + +
+ +

The merge +addon provides an interface for displaying and merging diffs, +either two-way +or three-way. The left +(or center) pane is editable, and the differences with the other +pane(s) are optionally shown live as you edit it.

+ +

This addon depends on +the google-diff-match-patch +library to compute the diffs.

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/multiplex.html b/deploy/core/node_modules/codemirror/demo/multiplex.html new file mode 100644 index 000000000..ca8c80aed --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/multiplex.html @@ -0,0 +1,75 @@ + + +CodeMirror: Multiplexing Parser Demo + + + + + + + + + + +
+

Multiplexing Parser Demo

+
+ + + +

Demonstration of a multiplexing mode, which, at certain + boundary strings, switches to one or more inner modes. The out + (HTML) mode does not get fed the content of the << + >> blocks. See + the manual and + the source for more + information.

+ +

+ Parsing/Highlighting Tests: + normal, + verbose. +

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/mustache.html b/deploy/core/node_modules/codemirror/demo/mustache.html new file mode 100644 index 000000000..ecc68555e --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/mustache.html @@ -0,0 +1,68 @@ + + +CodeMirror: Overlay Parser Demo + + + + + + + + + + +
+

Overlay Parser Demo

+
+ + + +

Demonstration of a mode that parses HTML, highlighting + the Mustache templating + directives inside of it by using the code + in overlay.js. View + source to see the 15 lines of code needed to accomplish this.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/placeholder.html b/deploy/core/node_modules/codemirror/demo/placeholder.html new file mode 100644 index 000000000..432331a48 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/placeholder.html @@ -0,0 +1,45 @@ + + +CodeMirror: Placeholder demo + + + + + + + + + +
+

Placeholder demo

+
+ +

The placeholder + plug-in adds an option placeholder that can be set to + make text appear in the editor when it is empty and not focused. + If the source textarea has a placeholder attribute, + it will automatically be inherited.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/preview.html b/deploy/core/node_modules/codemirror/demo/preview.html new file mode 100644 index 000000000..19e1530b8 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/preview.html @@ -0,0 +1,87 @@ + + +CodeMirror: HTML5 preview + + + + + + + + + + + + +
+

HTML5 preview

+ + + + +
diff --git a/deploy/core/node_modules/codemirror/demo/requirejs.html b/deploy/core/node_modules/codemirror/demo/requirejs.html new file mode 100644 index 000000000..f99b77945 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/requirejs.html @@ -0,0 +1,52 @@ + + + + CodeMirror: HTML completion demo + + + + + + + + + + + + +
+

RequireJS module loading demo

+ +

This demo does the same thing as + the HTML5 completion demo, but + loads its dependencies + with Require.js, rather than + explicitly. Press ctrl-space to activate + completion.

+ +
+ + +
+ diff --git a/deploy/core/node_modules/codemirror/demo/resize.html b/deploy/core/node_modules/codemirror/demo/resize.html new file mode 100644 index 000000000..69eae2c39 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/resize.html @@ -0,0 +1,58 @@ + + +CodeMirror: Autoresize Demo + + + + + + + + + +
+

Autoresize Demo

+
+ +

By setting a few CSS properties, and giving +the viewportMargin +a value of Infinity, CodeMirror can be made to +automatically resize to fit its content.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/rulers.html b/deploy/core/node_modules/codemirror/demo/rulers.html new file mode 100644 index 000000000..2ac411158 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/rulers.html @@ -0,0 +1,49 @@ + + +CodeMirror: Ruler Demo + + + + + + + + + +
+

Ruler Demo

+ + + +

Demonstration of +the rulers addon, which +displays vertical lines at given column offsets.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/runmode.html b/deploy/core/node_modules/codemirror/demo/runmode.html new file mode 100644 index 000000000..257f03d6b --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/runmode.html @@ -0,0 +1,62 @@ + + +CodeMirror: Mode Runner Demo + + + + + + + + + +
+

Mode Runner Demo

+ + +
+ +

+
+    
+
+    

Running a CodeMirror mode outside of the editor. + The CodeMirror.runMode function, defined + in lib/runmode.js takes the following arguments:

+ +
+
text (string)
+
The document to run through the highlighter.
+
mode (mode spec)
+
The mode to use (must be loaded as normal).
+
output (function or DOM node)
+
If this is a function, it will be called for each token with + two arguments, the token's text and the token's style class (may + be null for unstyled tokens). If it is a DOM node, + the tokens will be converted to span elements as in + an editor, and inserted into the node + (through innerHTML).
+
+ +
diff --git a/deploy/core/node_modules/codemirror/demo/search.html b/deploy/core/node_modules/codemirror/demo/search.html new file mode 100644 index 000000000..b1a51d94f --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/search.html @@ -0,0 +1,87 @@ + + +CodeMirror: Search/Replace Demo + + + + + + + + + + + + + +
+

Search/Replace Demo

+
+ + + +

Demonstration of primitive search/replace functionality. The + keybindings (which can be overridden by custom keymaps) are:

+
+
Ctrl-F / Cmd-F
Start searching
+
Ctrl-G / Cmd-G
Find next
+
Shift-Ctrl-G / Shift-Cmd-G
Find previous
+
Shift-Ctrl-F / Cmd-Option-F
Replace
+
Shift-Ctrl-R / Shift-Cmd-Option-F
Replace all
+
+

Searching is enabled by + including addon/search/search.js + and addon/search/searchcursor.js. + For good-looking input dialogs, you also want to include + addon/dialog/dialog.js + and addon/dialog/dialog.css.

+
diff --git a/deploy/core/node_modules/codemirror/demo/simplemode.html b/deploy/core/node_modules/codemirror/demo/simplemode.html new file mode 100644 index 000000000..ad8baf0b5 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/simplemode.html @@ -0,0 +1,181 @@ + + +CodeMirror: Simple Mode Demo + + + + + + + + + + + +
+

Simple Mode Demo

+ +

The mode/simple +addon allows CodeMirror modes to be specified using a relatively simple +declarative format. This format is not as powerful as writing code +directly against the mode +interface, but is a lot easier to get started with, and +sufficiently expressive for many simple language modes.

+ +

This interface is still in flux. It is unlikely to be scrapped or +overhauled completely, so do start writing code against it, but +details might change as it stabilizes, and you might have to tweak +your code when upgrading.

+ +

Simple modes (loosely based on +the Common +JavaScript Syntax Highlighting Specification, which never took +off), are state machines, where each state has a number of rules that +match tokens. A rule describes a type of token that may occur in the +current state, and possibly a transition to another state caused by +that token.

+ +

The CodeMirror.defineSimpleMode(name, states) method +takes a mode name and an object that describes the mode's states. The +editor below shows an example of such a mode (and is itself +highlighted by the mode shown in it).

+ +
+ +

Each state is an array of rules. A rule may have the following properties:

+ +
+
regex: string | RegExp
+
The regular expression that matches the token. May be a string + or a regex object. When a regex, the ignoreCase flag + will be taken into account when matching the token. This regex + should only capture groups when the token property is + an array.
+
token: string | null
+
An optional token style. Multiple styles can be specified by + separating them with dots or spaces. When the regex for + this rule captures groups, it must capture all of the + string (since JS provides no way to find out where a group matched), + and this property must hold an array of token styles that has one + style for each matched group.
+
next: string
+
When a next property is present, the mode will + transfer to the state named by the property when the token is + encountered.
+
push: string
+
Like next, but instead replacing the current state + by the new state, the current state is kept on a stack, and can be + returned to with the pop directive.
+
pop: bool
+
When true, and there is another state on the state stack, will + cause the mode to pop that state off the stack and transition to + it.
+
mode: {spec, end, persistent}
+
Can be used to embed another mode inside a mode. When present, + must hold an object with a spec property that describes + the embedded mode, and an optional end end property + that specifies the regexp that will end the extent of the mode. When + a persistent property is set (and true), the nested + mode's state will be preserved between occurrences of the mode.
+
indent: bool
+
When true, this token changes the indentation to be one unit + more than the current line's indentation.
+
dedent: bool
+
When true, this token will pop one scope off the indentation + stack.
+
dedentIfLineStart: bool
+
If a token has its dedent property set, it will, by + default, cause lines where it appears at the start to be dedented. + Set this property to false to prevent that behavior.
+
+ +

The meta property of the states object is special, and +will not be interpreted as a state. Instead, properties set on it will +be set on the mode, which is useful for properties +like lineComment, +which sets the comment style for a mode. The simple mode addon also +recognizes a few such properties:

+ +
+
dontIndentStates: array<string>
+
An array of states in which the mode's auto-indentation should + not take effect. Usually used for multi-line comment and string + states.
+
+ + + + + +
diff --git a/deploy/core/node_modules/codemirror/demo/spanaffectswrapping_shim.html b/deploy/core/node_modules/codemirror/demo/spanaffectswrapping_shim.html new file mode 100644 index 000000000..879d99b60 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/spanaffectswrapping_shim.html @@ -0,0 +1,85 @@ + + +CodeMirror: Automatically derive odd wrapping behavior for your browser + + + + + +
+

Automatically derive odd wrapping behavior for your browser

+ + +

This is a hack to automatically derive + a spanAffectsWrapping regexp for a browser. See the + comments above that variable + in lib/codemirror.js + for some more details.

+ +
+

+
+    
+  
diff --git a/deploy/core/node_modules/codemirror/demo/sublime.html b/deploy/core/node_modules/codemirror/demo/sublime.html new file mode 100644 index 000000000..4cedbcd62 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/sublime.html @@ -0,0 +1,79 @@ + + +CodeMirror: Sublime Text bindings demo + + + + + + + + + + + + + + + + + + + + + + +
+

Sublime Text bindings demo

+ +

The sublime keymap defines many Sublime Text-specific +bindings for CodeMirror. See the code below for an overview.

+ +

Enable the keymap by +loading keymap/sublime.js +and setting +the keyMap +option to "sublime".

+ +

(A lot of the search functionality is still missing.) + + + +

diff --git a/deploy/core/node_modules/codemirror/demo/tern.html b/deploy/core/node_modules/codemirror/demo/tern.html new file mode 100644 index 000000000..0dfb5179e --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/tern.html @@ -0,0 +1,131 @@ + + +CodeMirror: Tern Demo + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Tern Demo

+

+ +

Demonstrates integration of Tern +and CodeMirror. The following keys are bound:

+ +
+
Ctrl-Space
Autocomplete
+
Ctrl-I
Find type at cursor
+
Alt-.
Jump to definition (Alt-, to jump back)
+
Ctrl-Q
Rename variable
+
Ctrl-.
Select all occurrences of a variable
+
+ +

Documentation is sparse for now. See the top of +the script for a rough API +overview.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/theme.html b/deploy/core/node_modules/codemirror/demo/theme.html new file mode 100644 index 000000000..cdb211381 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/theme.html @@ -0,0 +1,126 @@ + + +CodeMirror: Theme Demo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Theme Demo

+ + +

Select a theme: +

+ + +
diff --git a/deploy/core/node_modules/codemirror/demo/trailingspace.html b/deploy/core/node_modules/codemirror/demo/trailingspace.html new file mode 100644 index 000000000..1992ba3ff --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/trailingspace.html @@ -0,0 +1,48 @@ + + +CodeMirror: Trailing Whitespace Demo + + + + + + + + + +
+

Trailing Whitespace Demo

+
+ + + +

Uses +the trailingspace +addon to highlight trailing whitespace.

+ +
diff --git a/deploy/core/node_modules/codemirror/demo/variableheight.html b/deploy/core/node_modules/codemirror/demo/variableheight.html new file mode 100644 index 000000000..d49942864 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/variableheight.html @@ -0,0 +1,67 @@ + + +CodeMirror: Variable Height Demo + + + + + + + + + + +
+

Variable Height Demo

+
+ +
diff --git a/deploy/core/node_modules/codemirror/demo/vim.html b/deploy/core/node_modules/codemirror/demo/vim.html new file mode 100644 index 000000000..d637c5c86 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/vim.html @@ -0,0 +1,99 @@ + + +CodeMirror: Vim bindings demo + + + + + + + + + + + + + + +
+

Vim bindings demo

+
+
Key buffer:
+ +

The vim keybindings are enabled by +including keymap/vim.js and setting +the vimMode option to true. This will also +automatically change the keyMap option to "vim".

+ +

Features

+ +
    +
  • All common motions and operators, including text objects
  • +
  • Operator motion orthogonality
  • +
  • Visual mode - characterwise, linewise, partial support for blockwise
  • +
  • Full macro support (q, @)
  • +
  • Incremental highlighted search (/, ?, #, *, g#, g*)
  • +
  • Search/replace with confirm (:substitute, :%s)
  • +
  • Search history
  • +
  • Jump lists (Ctrl-o, Ctrl-i)
  • +
  • Key/command mapping with API (:map, :nmap, :vmap)
  • +
  • Sort (:sort)
  • +
  • Marks (`, ')
  • +
  • :global
  • +
  • Insert mode behaves identical to base CodeMirror
  • +
  • Cross-buffer yank/paste
  • +
+ +

Note that while the vim mode tries to emulate the most useful features of +vim as faithfully as possible, it does not strive to become a complete vim +implementation

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/visibletabs.html b/deploy/core/node_modules/codemirror/demo/visibletabs.html new file mode 100644 index 000000000..2eec337ed --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/visibletabs.html @@ -0,0 +1,62 @@ + + +CodeMirror: Visible tabs demo + + + + + + + + + +
+

Visible tabs demo

+
+ +

Tabs inside the editor are spans with the +class cm-tab, and can be styled.

+ + + +
diff --git a/deploy/core/node_modules/codemirror/demo/widget.html b/deploy/core/node_modules/codemirror/demo/widget.html new file mode 100644 index 000000000..da39a9297 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/widget.html @@ -0,0 +1,85 @@ + + +CodeMirror: Inline Widget Demo + + + + + + + + + + +
+

Inline Widget Demo

+ + +
+ +

This demo runs JSHint over the code +in the editor (which is the script used on this page), and +inserts line widgets to +display the warnings that JSHint comes up with.

+
diff --git a/deploy/core/node_modules/codemirror/demo/xmlcomplete.html b/deploy/core/node_modules/codemirror/demo/xmlcomplete.html new file mode 100644 index 000000000..bd452e6f6 --- /dev/null +++ b/deploy/core/node_modules/codemirror/demo/xmlcomplete.html @@ -0,0 +1,119 @@ + + +CodeMirror: XML Autocomplete Demo + + + + + + + + + + + + +
+

XML Autocomplete Demo

+
+ +

Press ctrl-space, or type a '<' character to + activate autocompletion. This demo defines a simple schema that + guides completion. The schema can be customized—see + the manual.

+ +

Development of the xml-hint addon was kindly + sponsored + by www.xperiment.mobi.

+ + +
diff --git a/deploy/core/node_modules/codemirror/emacs.js b/deploy/core/node_modules/codemirror/emacs.js deleted file mode 100644 index 8727121ce..000000000 --- a/deploy/core/node_modules/codemirror/emacs.js +++ /dev/null @@ -1,387 +0,0 @@ -(function() { - "use strict"; - - var Pos = CodeMirror.Pos; - function posEq(a, b) { return a.line == b.line && a.ch == b.ch; } - - // Kill 'ring' - - var killRing = []; - function addToRing(str) { - killRing.push(str); - if (killRing.length > 50) killRing.shift(); - } - function growRingTop(str) { - if (!killRing.length) return addToRing(str); - killRing[killRing.length - 1] += str; - } - function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; } - function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); } - - var lastKill = null; - - function kill(cm, from, to, mayGrow, text) { - if (text == null) text = cm.getRange(from, to); - - if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen)) - growRingTop(text); - else - addToRing(text); - cm.replaceRange("", from, to, "+delete"); - - if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()}; - else lastKill = null; - } - - // Boundaries of various units - - function byChar(cm, pos, dir) { - return cm.findPosH(pos, dir, "char", true); - } - - function byWord(cm, pos, dir) { - return cm.findPosH(pos, dir, "word", true); - } - - function byLine(cm, pos, dir) { - return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn); - } - - function byPage(cm, pos, dir) { - return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn); - } - - function byParagraph(cm, pos, dir) { - var no = pos.line, line = cm.getLine(no); - var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch)); - var fst = cm.firstLine(), lst = cm.lastLine(); - for (;;) { - no += dir; - if (no < fst || no > lst) - return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null)); - line = cm.getLine(no); - var hasText = /\S/.test(line); - if (hasText) sawText = true; - else if (sawText) return Pos(no, 0); - } - } - - function bySentence(cm, pos, dir) { - var line = pos.line, ch = pos.ch; - var text = cm.getLine(pos.line), sawWord = false; - for (;;) { - var next = text.charAt(ch + (dir < 0 ? -1 : 0)); - if (!next) { // End/beginning of line reached - if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch); - text = cm.getLine(line + dir); - if (!/\S/.test(text)) return Pos(line, ch); - line += dir; - ch = dir < 0 ? text.length : 0; - continue; - } - if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0)); - if (!sawWord) sawWord = /\w/.test(next); - ch += dir; - } - } - - function byExpr(cm, pos, dir) { - var wrap; - if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true)) - && wrap.match && (wrap.forward ? 1 : -1) == dir) - return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to; - - for (var first = true;; first = false) { - var token = cm.getTokenAt(pos); - var after = Pos(pos.line, dir < 0 ? token.start : token.end); - if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) { - var newPos = cm.findPosH(after, dir, "char"); - if (posEq(after, newPos)) return pos; - else pos = newPos; - } else { - return after; - } - } - } - - // Prefixes (only crudely supported) - - function getPrefix(cm, precise) { - var digits = cm.state.emacsPrefix; - if (!digits) return precise ? null : 1; - clearPrefix(cm); - return digits == "-" ? -1 : Number(digits); - } - - function repeated(cmd) { - var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd; - return function(cm) { - var prefix = getPrefix(cm); - f(cm); - for (var i = 1; i < prefix; ++i) f(cm); - }; - } - - function findEnd(cm, by, dir) { - var pos = cm.getCursor(), prefix = getPrefix(cm); - if (prefix < 0) { dir = -dir; prefix = -prefix; } - for (var i = 0; i < prefix; ++i) { - var newPos = by(cm, pos, dir); - if (posEq(newPos, pos)) break; - pos = newPos; - } - return pos; - } - - function move(by, dir) { - var f = function(cm) { - cm.extendSelection(findEnd(cm, by, dir)); - }; - f.motion = true; - return f; - } - - function killTo(cm, by, dir) { - kill(cm, cm.getCursor(), findEnd(cm, by, dir), true); - } - - function addPrefix(cm, digit) { - if (cm.state.emacsPrefix) { - if (digit != "-") cm.state.emacsPrefix += digit; - return; - } - // Not active yet - cm.state.emacsPrefix = digit; - cm.on("keyHandled", maybeClearPrefix); - cm.on("inputRead", maybeDuplicateInput); - } - - var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true}; - - function maybeClearPrefix(cm, arg) { - if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg)) - clearPrefix(cm); - } - - function clearPrefix(cm) { - cm.state.emacsPrefix = null; - cm.off("keyHandled", maybeClearPrefix); - cm.off("inputRead", maybeDuplicateInput); - } - - function maybeDuplicateInput(cm, event) { - var dup = getPrefix(cm); - if (dup > 1 && event.origin == "+input") { - var one = event.text.join("\n"), txt = ""; - for (var i = 1; i < dup; ++i) txt += one; - cm.replaceSelection(txt, "end", "+input"); - } - } - - function addPrefixMap(cm) { - cm.state.emacsPrefixMap = true; - cm.addKeyMap(prefixMap); - cm.on("keyHandled", maybeRemovePrefixMap); - cm.on("inputRead", maybeRemovePrefixMap); - } - - function maybeRemovePrefixMap(cm, arg) { - if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return; - cm.removeKeyMap(prefixMap); - cm.state.emacsPrefixMap = false; - cm.off("keyHandled", maybeRemovePrefixMap); - cm.off("inputRead", maybeRemovePrefixMap); - } - - // Utilities - - function setMark(cm) { - cm.setCursor(cm.getCursor()); - cm.setExtending(true); - cm.on("change", function() { cm.setExtending(false); }); - } - - function getInput(cm, msg, f) { - if (cm.openDialog) - cm.openDialog(msg + ": ", f, {bottom: true}); - else - f(prompt(msg, "")); - } - - function operateOnWord(cm, op) { - var start = cm.getCursor(), end = cm.findPosH(start, 1, "word"); - cm.replaceRange(op(cm.getRange(start, end)), start, end); - cm.setCursor(end); - } - - function toEnclosingExpr(cm) { - var pos = cm.getCursor(), line = pos.line, ch = pos.ch; - var stack = []; - while (line >= cm.firstLine()) { - var text = cm.getLine(line); - for (var i = ch == null ? text.length : ch; i > 0;) { - var ch = text.charAt(--i); - if (ch == ")") - stack.push("("); - else if (ch == "]") - stack.push("["); - else if (ch == "}") - stack.push("{"); - else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch)) - return cm.extendSelection(Pos(line, i)); - } - --line; ch = null; - } - } - - // Actual keymap - - var keyMap = CodeMirror.keyMap.emacs = { - "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));}, - "Ctrl-K": repeated(function(cm) { - var start = cm.getCursor(), end = cm.clipPos(Pos(start.line)); - var text = cm.getRange(start, end); - if (!/\S/.test(text)) { - text += "\n"; - end = Pos(start.line + 1, 0); - } - kill(cm, start, end, true, text); - }), - "Alt-W": function(cm) { - addToRing(cm.getSelection()); - }, - "Ctrl-Y": function(cm) { - var start = cm.getCursor(); - cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste"); - cm.setSelection(start, cm.getCursor()); - }, - "Alt-Y": function(cm) {cm.replaceSelection(popFromRing());}, - - "Ctrl-Space": setMark, "Ctrl-Shift-2": setMark, - - "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1), - "Right": move(byChar, 1), "Left": move(byChar, -1), - "Ctrl-D": function(cm) { killTo(cm, byChar, 1); }, - "Delete": function(cm) { killTo(cm, byChar, 1); }, - "Ctrl-H": function(cm) { killTo(cm, byChar, -1); }, - "Backspace": function(cm) { killTo(cm, byChar, -1); }, - - "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1), - "Alt-D": function(cm) { killTo(cm, byWord, 1); }, - "Alt-Backspace": function(cm) { killTo(cm, byWord, -1); }, - - "Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1), - "Down": move(byLine, 1), "Up": move(byLine, -1), - "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "End": "goLineEnd", "Home": "goLineStart", - - "Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1), - "PageUp": move(byPage, -1), "PageDown": move(byPage, 1), - - "Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1), - - "Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1), - "Alt-K": function(cm) { killTo(cm, bySentence, 1); }, - - "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); }, - "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); }, - "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1), - - "Shift-Ctrl-Alt-2": function(cm) { - cm.setSelection(findEnd(cm, byExpr, 1), cm.getCursor()); - }, - "Ctrl-Alt-T": function(cm) { - var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1); - var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1); - cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) + - cm.getRange(leftStart, leftEnd), leftStart, rightEnd); - }, - "Ctrl-Alt-U": repeated(toEnclosingExpr), - - "Alt-Space": function(cm) { - var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line); - while (from && /\s/.test(text.charAt(from - 1))) --from; - while (to < text.length && /\s/.test(text.charAt(to))) ++to; - cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to)); - }, - "Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }), - "Ctrl-T": repeated(function(cm) { - var pos = cm.getCursor(); - if (pos.ch < cm.getLine(pos.line).length) pos = Pos(pos.line, pos.ch + 1); - var from = cm.findPosH(pos, -2, "char"); - var range = cm.getRange(from, pos); - if (range.length != 2) return; - cm.setSelection(from, pos); - cm.replaceSelection(range.charAt(1) + range.charAt(0), "end"); - }), - - "Alt-C": repeated(function(cm) { - operateOnWord(cm, function(w) { - var letter = w.search(/\w/); - if (letter == -1) return w; - return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase(); - }); - }), - "Alt-U": repeated(function(cm) { - operateOnWord(cm, function(w) { return w.toUpperCase(); }); - }), - "Alt-L": repeated(function(cm) { - operateOnWord(cm, function(w) { return w.toLowerCase(); }); - }), - - "Alt-;": "toggleComment", - - "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"), - "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"), - "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", - "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace", - "Alt-/": "autocomplete", - "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto", - - "Alt-G": function(cm) {cm.setOption("keyMap", "emacs-Alt-G");}, - "Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");}, - "Ctrl-Q": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-Q");}, - "Ctrl-U": addPrefixMap - }; - - CodeMirror.keyMap["emacs-Ctrl-X"] = { - "Tab": function(cm) { - cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit")); - }, - "Ctrl-X": function(cm) { - cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor")); - }, - - "Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": repeated("undo"), "K": "close", - "Delete": function(cm) { kill(cm, cm.getCursor(), sentenceEnd(cm, 1), true); }, - auto: "emacs", nofallthrough: true, disableInput: true - }; - - CodeMirror.keyMap["emacs-Alt-G"] = { - "G": function(cm) { - var prefix = getPrefix(cm, true); - if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1); - - getInput(cm, "Goto line", function(str) { - var num; - if (str && !isNaN(num = Number(str)) && num == num|0 && num > 0) - cm.setCursor(num - 1); - }); - }, - auto: "emacs", nofallthrough: true, disableInput: true - }; - - CodeMirror.keyMap["emacs-Ctrl-Q"] = { - "Tab": repeated("insertTab"), - auto: "emacs", nofallthrough: true - }; - - var prefixMap = {"Ctrl-G": clearPrefix}; - function regPrefix(d) { - prefixMap[d] = function(cm) { addPrefix(cm, d); }; - keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); }; - prefixPreservingKeys["Ctrl-" + d] = true; - } - for (var i = 0; i < 10; ++i) regPrefix(String(i)); - regPrefix("-"); -})(); diff --git a/deploy/core/node_modules/codemirror/fold.js b/deploy/core/node_modules/codemirror/fold.js deleted file mode 100644 index 0f46ff885..000000000 --- a/deploy/core/node_modules/codemirror/fold.js +++ /dev/null @@ -1,551 +0,0 @@ -(function() { - "use strict"; - - /* foldcode.js */ - function doFold(cm, pos, options, force) { - var finder = options && (options.call ? options : options.rangeFinder); - if (!finder) finder = CodeMirror.fold.auto; - if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); - var minSize = options && options.minFoldSize || 0; - - function getRange(allowFolded) { - var range = finder(cm, pos); - if (!range || range.to.line - range.from.line < minSize) return null; - var marks = cm.findMarksAt(range.from); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold && force !== "fold") { - if (!allowFolded) return null; - range.cleared = true; - marks[i].clear(); - } - } - return range; - } - - var range = getRange(true); - if (options && options.scanUp) while (!range && pos.line > cm.firstLine()) { - pos = CodeMirror.Pos(pos.line - 1, 0); - range = getRange(false); - } - if (!range || range.cleared || force === "unfold") return; - - var myWidget = makeWidget(options); - CodeMirror.on(myWidget, "mousedown", function() { myRange.clear(); }); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: true, - __isFold: true - }); - myRange.on("clear", function(from, to) { - CodeMirror.signal(cm, "unfold", cm, from, to); - }); - CodeMirror.signal(cm, "fold", cm, range.from, range.to); - } - - function makeWidget(options) { - var widget = (options && options.widget) || "\u2194"; - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } - return widget; - } - - // Clumsy backwards-compatible interface - CodeMirror.newFoldFunction = function(rangeFinder, widget) { - return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; - }; - - // New-style interface - CodeMirror.defineExtension("foldCode", function(pos, options, force) { - doFold(this, pos, options, force); - }); - - CodeMirror.commands.fold = function(cm) { - cm.foldCode(cm.getCursor()); - }; - - CodeMirror.registerHelper("fold", "combine", function() { - var funcs = Array.prototype.slice.call(arguments, 0); - return function(cm, start) { - for (var i = 0; i < funcs.length; ++i) { - var found = funcs[i](cm, start); - if (found) return found; - } - }; - }); - - CodeMirror.registerHelper("fold", "auto", function(cm, start) { - var helpers = cm.getHelpers(start, "fold"); - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, start); - if (cur) return cur; - } - }); - - /* foldgutter.js */ - CodeMirror.defineOption("foldGutter", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.clearGutter(cm.state.foldGutter.options.gutter); - cm.state.foldGutter = null; - cm.off("gutterClick", onGutterClick); - cm.off("change", onChange); - cm.off("viewportChange", onViewportChange); - cm.off("fold", onFold); - cm.off("unfold", onFold); - cm.off("swapDoc", updateInViewport); - } - if (val) { - cm.state.foldGutter = new State(parseOptions(val)); - updateInViewport(cm); - cm.on("gutterClick", onGutterClick); - cm.on("change", onChange); - cm.on("viewportChange", onViewportChange); - cm.on("fold", onFold); - cm.on("unfold", onFold); - cm.on("swapDoc", updateInViewport); - } - }); - - var Pos = CodeMirror.Pos; - - function State(options) { - this.options = options; - this.from = this.to = 0; - } - - function parseOptions(opts) { - if (opts === true) opts = {}; - if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; - if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; - if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; - return opts; - } - - function isFolded(cm, line) { - var marks = cm.findMarksAt(Pos(line)); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold && marks[i].find().from.line == line) return true; - } - - function marker(spec) { - if (typeof spec == "string") { - var elt = document.createElement("div"); - elt.className = spec; - return elt; - } else { - return spec.cloneNode(true); - } - } - - function updateFoldInfo(cm, from, to) { - var opts = cm.state.foldGutter.options, cur = from; - cm.eachLine(from, to, function(line) { - var mark = null; - if (isFolded(cm, cur)) { - mark = marker(opts.indicatorFolded); - } else { - var pos = Pos(cur, 0), func = opts.rangeFinder || CodeMirror.fold.auto; - var range = func && func(cm, pos); - if (range && range.from.line + 1 < range.to.line) - mark = marker(opts.indicatorOpen); - } - cm.setGutterMarker(line, opts.gutter, mark); - ++cur; - }); - } - - function updateInViewport(cm) { - var vp = cm.getViewport(), state = cm.state.foldGutter; - if (!state) return; - cm.operation(function() { - updateFoldInfo(cm, vp.from, vp.to); - }); - state.from = vp.from; state.to = vp.to; - } - - function onGutterClick(cm, line, gutter) { - var opts = cm.state.foldGutter.options; - if (gutter != opts.gutter) return; - cm.foldCode(Pos(line, 0), opts.rangeFinder); - } - - function onChange(cm) { - var state = cm.state.foldGutter, opts = cm.state.foldGutter.options; - state.from = state.to = 0; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600); - } - - function onViewportChange(cm) { - var state = cm.state.foldGutter, opts = cm.state.foldGutter.options; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { - var vp = cm.getViewport(); - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - updateInViewport(cm); - } else { - cm.operation(function() { - if (vp.from < state.from) { - updateFoldInfo(cm, vp.from, state.from); - state.from = vp.from; - } - if (vp.to > state.to) { - updateFoldInfo(cm, state.to, vp.to); - state.to = vp.to; - } - }); - } - }, opts.updateViewportTimeSpan || 400); - } - - function onFold(cm, from) { - var state = cm.state.foldGutter, line = from.line; - if (line >= state.from && line < state.to) - updateFoldInfo(cm, line, line + 1); - } - - /* brace-fold.js */ - CodeMirror.registerHelper("fold", "brace", function(cm, start) { - var line = start.line, lineText = cm.getLine(line); - var startCh, tokenType; - - function findOpening(openCh) { - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1); - if (found == -1) { - if (pass == 1) break; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) break; - tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); - if (!/^(comment|string)/.test(tokenType)) return found + 1; - at = found - 1; - } - } - - var startToken = "{", endToken = "}", startCh = findOpening("{"); - if (startCh == null) { - startToken = "[", endToken = "]"; - startCh = findOpening("["); - } - - if (startCh == null) return; - var count = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) { - if (pos == nextOpen) ++count; - else if (!--count) { end = i; endCh = pos; break outer; } - } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; - }); - CodeMirror.braceRangeFinder = CodeMirror.fold.brace; // deprecated - - CodeMirror.registerHelper("fold", "import", function(cm, start) { - function hasImport(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type != "keyword" || start.string != "import") return null; - // Now find closing semicolon, return its position - for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { - var text = cm.getLine(i), semi = text.indexOf(";"); - if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; - } - } - - var start = start.line, has = hasImport(start), prev; - if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) - return null; - for (var end = has.end;;) { - var next = hasImport(end.line + 1); - if (next == null) break; - end = next.end; - } - return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; - }); - CodeMirror.importRangeFinder = CodeMirror.fold["import"]; // deprecated - - CodeMirror.registerHelper("fold", "include", function(cm, start) { - function hasInclude(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; - } - - var start = start.line, has = hasInclude(start); - if (has == null || hasInclude(start - 1) != null) return null; - for (var end = start;;) { - var next = hasInclude(end + 1); - if (next == null) break; - ++end; - } - return {from: CodeMirror.Pos(start, has + 1), - to: cm.clipPos(CodeMirror.Pos(end))}; - }); - CodeMirror.includeRangeFinder = CodeMirror.fold.include; // deprecated - - /* comment-fold.js */ - CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { - return mode.blockCommentStart && mode.blockCommentEnd; - }, function(cm, start) { - var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd; - if (!startToken || !endToken) return; - var line = start.line, lineText = cm.getLine(line); - - var startCh; - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1); - if (found == -1) { - if (pass == 1) return; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) return; - if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) { - startCh = found + startToken.length; - break; - } - at = found - 1; - } - - var depth = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (pos == nextOpen) ++depth; - else if (!--depth) { end = i; endCh = pos; break outer; } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; - }); - - /* indent-fold.js */ - CodeMirror.registerHelper("fold", "indent", function(cm, start) { - var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); - if (!/\S/.test(firstLine)) return; - var getIndent = function(line) { - return CodeMirror.countColumn(line, null, tabSize); - }; - var myIndent = getIndent(firstLine); - var lastLineInFold = null; - // Go through lines until we find a line that definitely doesn't belong in - // the block we're folding, or to the end. - for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { - var curLine = cm.getLine(i); - var curIndent = getIndent(curLine); - if (curIndent > myIndent) { - // Lines with a greater indent are considered part of the block. - lastLineInFold = i; - } else if (!/\S/.test(curLine)) { - // Empty lines might be breaks within the block we're trying to fold. - } else { - // A non-empty line at an indent equal to or less than ours marks the - // start of another block. - break; - } - } - if (lastLineInFold) return { - from: CodeMirror.Pos(start.line, firstLine.length), - to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) - }; - }); - CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated - - /* xml-fold.js */ - var Pos = CodeMirror.Pos; - function cmp(a, b) { return a.line - b.line || a.ch - b.ch; } - - var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g"); - - function Iter(cm, line, ch, range) { - this.line = line; this.ch = ch; - this.cm = cm; this.text = cm.getLine(line); - this.min = range ? range.from : cm.firstLine(); - this.max = range ? range.to - 1 : cm.lastLine(); - } - - function tagAt(iter, ch) { - var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch)); - return type && /\btag\b/.test(type); - } - - function nextLine(iter) { - if (iter.line >= iter.max) return; - iter.ch = 0; - iter.text = iter.cm.getLine(++iter.line); - return true; - } - function prevLine(iter) { - if (iter.line <= iter.min) return; - iter.text = iter.cm.getLine(--iter.line); - iter.ch = iter.text.length; - return true; - } - - function toTagEnd(iter) { - for (;;) { - var gt = iter.text.indexOf(">", iter.ch); - if (gt == -1) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - function toTagStart(iter) { - for (;;) { - var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1; - if (lt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; } - xmlTagStart.lastIndex = lt; - iter.ch = lt; - var match = xmlTagStart.exec(iter.text); - if (match && match.index == lt) return match; - } - } - - function toNextTag(iter) { - for (;;) { - xmlTagStart.lastIndex = iter.ch; - var found = xmlTagStart.exec(iter.text); - if (!found) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; } - iter.ch = found.index + found[0].length; - return found; - } - } - function toPrevTag(iter) { - for (;;) { - var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1; - if (gt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - - function findMatchingClose(iter, tag) { - var stack = []; - for (;;) { - var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0); - if (!next || !(end = toTagEnd(iter))) return; - if (end == "selfClose") continue; - if (next[1]) { // closing tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == next[2])) return { - tag: next[2], - from: Pos(startLine, startCh), - to: Pos(iter.line, iter.ch) - }; - } else { // opening tag - stack.push(next[2]); - } - } - } - function findMatchingOpen(iter, tag) { - var stack = []; - for (;;) { - var prev = toPrevTag(iter); - if (!prev) return; - if (prev == "selfClose") { toTagStart(iter); continue; } - var endLine = iter.line, endCh = iter.ch; - var start = toTagStart(iter); - if (!start) return; - if (start[1]) { // closing tag - stack.push(start[2]); - } else { // opening tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == start[2])) return { - tag: start[2], - from: Pos(iter.line, iter.ch), - to: Pos(endLine, endCh) - }; - } - } - } - - CodeMirror.registerHelper("fold", "xml", function(cm, start) { - var iter = new Iter(cm, start.line, 0); - for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; - if (!openTag[1] && end != "selfClose") { - var start = Pos(iter.line, iter.ch); - var close = findMatchingClose(iter, openTag[2]); - return close && {from: start, to: close.from}; - } - } - }); - CodeMirror.tagRangeFinder = CodeMirror.fold.xml; // deprecated - - CodeMirror.findMatchingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return; - var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch); - var start = end && toTagStart(iter); - if (!end || end == "selfClose" || !start || cmp(iter, pos) > 0) return; - var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]}; - - if (start[1]) { // closing tag - return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"}; - } else { // opening tag - iter = new Iter(cm, to.line, to.ch, range); - return {open: here, close: findMatchingClose(iter, start[2]), at: "open"}; - } - }; - - CodeMirror.findEnclosingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - for (;;) { - var open = findMatchingOpen(iter); - if (!open) break; - var forward = new Iter(cm, pos.line, pos.ch, range); - var close = findMatchingClose(forward, open.tag); - if (close) return {open: open, close: close}; - } - }; - - // Used by addon/edit/closetag.js - CodeMirror.scanForClosingTag = function(cm, pos, name, end) { - var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); - return !!findMatchingClose(iter, name); - }; -})(); diff --git a/deploy/core/node_modules/codemirror/index.html b/deploy/core/node_modules/codemirror/index.html new file mode 100644 index 000000000..0a9f1338f --- /dev/null +++ b/deploy/core/node_modules/codemirror/index.html @@ -0,0 +1,199 @@ + + +CodeMirror + + + + + + + + + + + + + + + + + +
+ +
+

CodeMirror is a versatile text editor + implemented in JavaScript for the browser. It is specialized for + editing code, and comes with a number of language modes and addons + that implement more advanced editing functionality.

+ +

A rich programming API and a + CSS theming system are + available for customizing CodeMirror to fit your application, and + extending it with new functionality.

+
+ +
+

This is CodeMirror

+
+
+ +
+ DOWNLOAD LATEST RELEASE +
version 4.7 (Release notes)
+ +
+ DONATE WITH PAYPAL +
+ or Bank, + Bitcoin, + Gittip, + Flattr
+
+ × + Bank: Rabobank
+ Country: Netherlands
+ SWIFT: RABONL2U
+ Account: 147850770
+ Name: Marijn Haverbeke
+ IBAN: NL26 RABO 0147 8507 70 +
+
+ × + Bitcoin address: 1HVnnU8E9yLPeFyNgNtUPB5deXBvUmZ6Nx +
+
+ + +
+
+
+ Purchase commercial support +
+
+
+
+ +
+

Features

+ +
+ +
+

Community

+ +

CodeMirror is an open-source project shared under + an MIT license. It is the editor used in the + dev tools for + both Firefox + and Chrome, Light + Table, Adobe + Brackets, Bitbucket, + and many other projects.

+ +

Development and bug tracking happens + on github + (alternate git + repository). + Please read these + pointers before submitting a bug. Use pull requests to submit + patches. All contributions must be released under the same MIT + license that CodeMirror uses.

+ +

Discussion around the project is done on + a mailing list. + There is also + the codemirror-announce + list, which is only used for major announcements (such as new + versions). If needed, you can + contact the maintainer + directly.

+ +

A list of CodeMirror-related software that is not part of the + main distribution is maintained + on our + wiki. Feel free to add your project.

+
+ +
+

Browser support

+

The desktop versions of the following browsers, + in standards mode (HTML5 <!doctype html> + recommended) are supported:

+ + + + + + +
Firefoxversion 4 and up
Chromeany version
Safariversion 5.2 and up
Internet Explorerversion 8 and up
Operaversion 9 and up
+

Modern mobile browsers tend to partly work. Bug reports and + patches for mobile support are welcome, but the maintainer does not + have the time or budget to actually work on it himself.

+
+ +
diff --git a/deploy/core/node_modules/codemirror/sublime.js b/deploy/core/node_modules/codemirror/keymap/sublime.js similarity index 94% rename from deploy/core/node_modules/codemirror/sublime.js rename to deploy/core/node_modules/codemirror/keymap/sublime.js index e229f52d3..f70a1f98f 100644 --- a/deploy/core/node_modules/codemirror/sublime.js +++ b/deploy/core/node_modules/codemirror/keymap/sublime.js @@ -17,7 +17,8 @@ var map = CodeMirror.keyMap.sublime = {fallthrough: "default"}; var cmds = CodeMirror.commands; var Pos = CodeMirror.Pos; - var ctrl = CodeMirror.keyMap["default"] == CodeMirror.keyMap.pcDefault ? "Ctrl-" : "Cmd-"; + var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault; + var ctrl = mac ? "Cmd-" : "Ctrl-"; // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that. function findPosSubword(doc, start, dir) { @@ -186,7 +187,9 @@ }); }; - cmds[map["Shift-" + ctrl + "Up"] = "swapLineUp"] = function(cm) { + var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-"; + + cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) { var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = []; for (var i = 0; i < ranges.length; i++) { var range = ranges[i], from = range.from().line - 1, to = range.to().line; @@ -212,7 +215,7 @@ }); }; - cmds[map["Shift-" + ctrl + "Down"] = "swapLineDown"] = function(cm) { + cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) { var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1; for (var i = ranges.length - 1; i >= 0; i--) { var range = ranges[i], from = range.to().line + 1, to = range.from().line; @@ -481,7 +484,7 @@ }); }; - function findAndGoTo(cm, forward) { + function getTarget(cm) { var from = cm.getCursor("from"), to = cm.getCursor("to"); if (CodeMirror.cmpPos(from, to) == 0) { var word = wordAt(cm, from); @@ -489,9 +492,14 @@ from = word.from; to = word.to; } + return {from: from, to: to, query: cm.getRange(from, to), word: word}; + } - var query = cm.getRange(from, to); - var cur = cm.getSearchCursor(query, forward ? to : from); + function findAndGoTo(cm, forward) { + var target = getTarget(cm); + if (!target) return; + var query = target.query; + var cur = cm.getSearchCursor(query, forward ? target.to : target.from); if (forward ? cur.findNext() : cur.findPrevious()) { cm.setSelection(cur.from(), cur.to()); @@ -500,12 +508,25 @@ : cm.clipPos(Pos(cm.lastLine()))); if (forward ? cur.findNext() : cur.findPrevious()) cm.setSelection(cur.from(), cur.to()); - else if (word) - cm.setSelection(from, to); + else if (target.word) + cm.setSelection(target.from, target.to); } }; cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); }; cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); }; + cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) { + var target = getTarget(cm); + if (!target) return; + var cur = cm.getSearchCursor(target.query); + var matches = []; + var primaryIndex = -1; + while (cur.findNext()) { + matches.push({anchor: cur.from(), head: cur.to()}); + if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch) + primaryIndex++; + } + cm.setSelections(matches, primaryIndex); + }; map["Shift-" + ctrl + "["] = "fold"; map["Shift-" + ctrl + "]"] = "unfold"; @@ -517,4 +538,4 @@ map["F3"] = "findNext"; map["Shift-F3"] = "findPrev"; -}); \ No newline at end of file +}); diff --git a/deploy/core/css/codemirror.css b/deploy/core/node_modules/codemirror/lib/codemirror.css similarity index 99% rename from deploy/core/css/codemirror.css rename to deploy/core/node_modules/codemirror/lib/codemirror.css index af9e0f26e..68c67b170 100644 --- a/deploy/core/css/codemirror.css +++ b/deploy/core/node_modules/codemirror/lib/codemirror.css @@ -125,7 +125,6 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} .cm-header, .cm-strong {font-weight: bold;} .cm-em {font-style: italic;} .cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} .cm-s-default .cm-error {color: #f00;} .cm-invalidchar {color: #f00;} diff --git a/deploy/core/node_modules/codemirror/codemirror.js b/deploy/core/node_modules/codemirror/lib/codemirror.js similarity index 99% rename from deploy/core/node_modules/codemirror/codemirror.js rename to deploy/core/node_modules/codemirror/lib/codemirror.js index 9d6902ba9..4f8a23bde 100644 --- a/deploy/core/node_modules/codemirror/codemirror.js +++ b/deploy/core/node_modules/codemirror/lib/codemirror.js @@ -5878,13 +5878,12 @@ return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; } - function getLineStyles(cm, line, updateFrontier) { + function getLineStyles(cm, line) { if (!line.styles || line.styles[0] != cm.state.modeGen) { var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); line.styles = result.styles; if (result.classes) line.styleClasses = result.classes; else if (line.styleClasses) line.styleClasses = null; - if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; } return line.styles; } @@ -5939,8 +5938,7 @@ if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) builder.addToken = buildTokenBadBidi(builder.addToken, order); builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + insertLineContent(line, builder, getLineStyles(cm, line)); if (line.styleClasses) { if (line.styleClasses.bgClass) builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); @@ -7826,7 +7824,7 @@ // THE END - CodeMirror.version = "4.7.1"; + CodeMirror.version = "4.7.0"; return CodeMirror; }); diff --git a/deploy/core/node_modules/codemirror/modes/apl.js b/deploy/core/node_modules/codemirror/mode/apl/apl.js similarity index 90% rename from deploy/core/node_modules/codemirror/modes/apl.js rename to deploy/core/node_modules/codemirror/mode/apl/apl.js index 5c23af85d..4357bed47 100644 --- a/deploy/core/node_modules/codemirror/modes/apl.js +++ b/deploy/core/node_modules/codemirror/mode/apl/apl.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("apl", function() { var builtInOps = { ".": "innerProduct", @@ -158,3 +171,5 @@ CodeMirror.defineMode("apl", function() { }); CodeMirror.defineMIME("text/apl", "apl"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/apl/index.html b/deploy/core/node_modules/codemirror/mode/apl/index.html new file mode 100644 index 000000000..53dda6b58 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/apl/index.html @@ -0,0 +1,72 @@ + + +CodeMirror: APL mode + + + + + + + + + + +
+

APL mode

+
+ + + +

Simple mode that tries to handle APL as well as it can.

+

It attempts to label functions/operators based upon + monadic/dyadic usage (but this is far from fully fleshed out). + This means there are meaningful classnames so hover states can + have popups etc.

+ +

MIME types defined: text/apl (APL code)

+
diff --git a/deploy/core/node_modules/codemirror/modes/asterisk.js b/deploy/core/node_modules/codemirror/mode/asterisk/asterisk.js similarity index 93% rename from deploy/core/node_modules/codemirror/modes/asterisk.js rename to deploy/core/node_modules/codemirror/mode/asterisk/asterisk.js index 60b689d1d..a1ead1157 100644 --- a/deploy/core/node_modules/codemirror/modes/asterisk.js +++ b/deploy/core/node_modules/codemirror/mode/asterisk/asterisk.js @@ -1,3 +1,6 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* * ===================================================================================== * @@ -14,6 +17,16 @@ * ===================================================================================== */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("asterisk", function() { var atoms = ["exten", "same", "include","ignorepat","switch"], dpcmd = ["#include","#exec"], @@ -181,3 +194,5 @@ CodeMirror.defineMode("asterisk", function() { }); CodeMirror.defineMIME("text/x-asterisk", "asterisk"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/asterisk/index.html b/deploy/core/node_modules/codemirror/mode/asterisk/index.html new file mode 100644 index 000000000..257bd3987 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/asterisk/index.html @@ -0,0 +1,154 @@ + + +CodeMirror: Asterisk dialplan mode + + + + + + + + + +
+

Asterisk dialplan mode

+
+ + +

MIME types defined: text/x-asterisk.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/clike.js b/deploy/core/node_modules/codemirror/mode/clike/clike.js similarity index 77% rename from deploy/core/node_modules/codemirror/modes/clike.js rename to deploy/core/node_modules/codemirror/mode/clike/clike.js index f6626cd0e..0f24bb849 100644 --- a/deploy/core/node_modules/codemirror/modes/clike.js +++ b/deploy/core/node_modules/codemirror/mode/clike/clike.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("clike", function(config, parserConfig) { var indentUnit = config.indentUnit, statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, @@ -7,7 +20,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { blockKeywords = parserConfig.blockKeywords || {}, atoms = parserConfig.atoms || {}, hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false; var isOperatorChar = /[+\-*&%=<>!?|\/]/; var curPunc; @@ -44,7 +58,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { stream.eatWhile(isOperatorChar); return "operator"; } - stream.eatWhile(/[\w\$_]/); + stream.eatWhile(/[\w\$_\xa1-\uffff]/); var cur = stream.current(); if (keywords.propertyIsEnumerable(cur)) { if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; @@ -138,7 +152,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { while (ctx.type == "statement") ctx = popContext(state); } else if (curPunc == ctx.type) popContext(state); - else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) + else if (indentStatements && + (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || + (ctx.type == "statement" && curPunc == "newstatement"))) pushContext(state, stream.column(), "statement"); state.startOfLine = false; return style; @@ -163,7 +179,6 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { }; }); -(function() { function words(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; @@ -191,6 +206,30 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { return "meta"; } + function cpp11StringHook(stream, state) { + stream.backUp(1); + // Raw strings. + if (stream.match(/(R|u8R|uR|UR|LR)/)) { + var match = stream.match(/"([^\s\\()]{0,16})\(/); + if (!match) { + return false; + } + state.cpp11RawStringDelim = match[1]; + state.tokenize = tokenRawString; + return tokenRawString(stream, state); + } + // Unicode strings/chars. + if (stream.match(/(u8|u|U|L)/)) { + if (stream.match(/["']/, /* eat */ false)) { + return "string"; + } + return false; + } + // Ignore this hook. + stream.next(); + return false; + } + // C#-style strings where "" escapes a quote. function tokenAtString(stream, state) { var next; @@ -203,28 +242,67 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { return "string"; } - function mimes(ms, mode) { - for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode); + // C++11 raw string literal is "( anything )", where + // can be a string up to 16 characters long. + function tokenRawString(stream, state) { + // Escape characters that have special regex meanings. + var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&'); + var match = stream.match(new RegExp(".*?\\)" + delim + '"')); + if (match) + state.tokenize = null; + else + stream.skipToEnd(); + return "string"; + } + + function def(mimes, mode) { + if (typeof mimes == "string") mimes = [mimes]; + var words = []; + function add(obj) { + if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) + words.push(prop); + } + add(mode.keywords); + add(mode.builtin); + add(mode.atoms); + if (words.length) { + mode.helperType = mimes[0]; + CodeMirror.registerHelper("hintWords", mimes[0], words); + } + + for (var i = 0; i < mimes.length; ++i) + CodeMirror.defineMIME(mimes[i], mode); } - mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], { + def(["text/x-csrc", "text/x-c", "text/x-chdr"], { name: "clike", keywords: words(cKeywords), blockKeywords: words("case do else for if switch while struct"), atoms: words("null"), - hooks: {"#": cppHook} + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} }); - mimes(["text/x-c++src", "text/x-c++hdr"], { + + def(["text/x-c++src", "text/x-c++hdr"], { name: "clike", keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + "static_cast typeid catch operator template typename class friend private " + "this using const_cast inline public throw virtual delete mutable protected " + - "wchar_t"), + "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " + + "static_assert override"), blockKeywords: words("catch class do else finally for if struct switch try while"), atoms: words("true false null"), - hooks: {"#": cppHook} + hooks: { + "#": cppHook, + "u": cpp11StringHook, + "U": cpp11StringHook, + "L": cpp11StringHook, + "R": cpp11StringHook + }, + modeProps: {fold: ["brace", "include"]} }); - CodeMirror.defineMIME("text/x-java", { + + def("text/x-java", { name: "clike", keywords: words("abstract assert boolean break byte case catch char class const continue default " + "do double else enum extends final finally float for goto if implements import " + @@ -238,9 +316,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { stream.eatWhile(/[\w\$_]/); return "meta"; } - } + }, + modeProps: {fold: ["brace", "import"]} }); - CodeMirror.defineMIME("text/x-csharp", { + + def("text/x-csharp", { name: "clike", keywords: words("abstract as base break case catch checked class const continue" + " default delegate do else enum event explicit extern finally fixed for" + @@ -266,7 +346,20 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { } } }); - CodeMirror.defineMIME("text/x-scala", { + + function tokenTripleString(stream, state) { + var escaped = false; + while (!stream.eol()) { + if (!escaped && stream.match('"""')) { + state.tokenize = null; + break; + } + escaped = stream.next() != "\\" && !escaped; + } + return "string"; + } + + def("text/x-scala", { name: "clike", keywords: words( @@ -291,19 +384,25 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" - - ), + multiLineStrings: true, blockKeywords: words("catch class do else finally for forSome if match switch try while"), atoms: words("true false null"), + indentStatements: false, hooks: { "@": function(stream) { stream.eatWhile(/[\w\$_]/); return "meta"; + }, + '"': function(stream, state) { + if (!stream.match('""')) return false; + state.tokenize = tokenTripleString; + return state.tokenize(stream, state); } } }); - mimes(["x-shader/x-vertex", "x-shader/x-fragment"], { + + def(["x-shader/x-vertex", "x-shader/x-fragment"], { name: "clike", keywords: words("float int bool void " + "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + @@ -357,6 +456,19 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + "gl_MaxDrawBuffers"), - hooks: {"#": cppHook} + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} }); -}()); + + def("text/x-nesc", { + name: "clike", + keywords: words(cKeywords + "as atomic async call command component components configuration event generic " + + "implementation includes interface module new norace nx_struct nx_union post provides " + + "signal task uses abstract extends"), + blockKeywords: words("case do else for if switch while struct"), + atoms: words("null"), + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} + }); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/clike/index.html b/deploy/core/node_modules/codemirror/mode/clike/index.html new file mode 100644 index 000000000..639ac3986 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/clike/index.html @@ -0,0 +1,225 @@ + + +CodeMirror: C-like mode + + + + + + + + + + + + +
+

C-like mode

+ +
+ +

C++ example

+ +
+ +

Java example

+ +
+ +

Scala example

+ +
+ + + +

Simple mode that tries to handle C-like languages as well as it + can. Takes two configuration parameters: keywords, an + object whose property names are the keywords in the language, + and useCPP, which determines whether C preprocessor + directives are recognized.

+ +

MIME types defined: text/x-csrc + (C), text/x-c++src (C++), text/x-java + (Java), text/x-csharp (C#), + text/x-scala (Scala), text/x-vertex + and x-shader/x-fragment (shader programs).

+
diff --git a/deploy/core/node_modules/codemirror/mode/clike/scala.html b/deploy/core/node_modules/codemirror/mode/clike/scala.html new file mode 100644 index 000000000..aa04cf0f0 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/clike/scala.html @@ -0,0 +1,767 @@ + + +CodeMirror: Scala mode + + + + + + + + + + +
+

Scala mode

+
+ +
+ + +
diff --git a/deploy/core/node_modules/codemirror/modes/cobol.js b/deploy/core/node_modules/codemirror/mode/cobol/cobol.js similarity index 95% rename from deploy/core/node_modules/codemirror/modes/cobol.js rename to deploy/core/node_modules/codemirror/mode/cobol/cobol.js index d92491dde..897022b18 100644 --- a/deploy/core/node_modules/codemirror/modes/cobol.js +++ b/deploy/core/node_modules/codemirror/mode/cobol/cobol.js @@ -1,7 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Author: Gautam Mehta * Branched from CodeMirror's Scheme mode */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("cobol", function () { var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header", @@ -238,3 +251,5 @@ CodeMirror.defineMode("cobol", function () { }); CodeMirror.defineMIME("text/x-cobol", "cobol"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/cobol/index.html b/deploy/core/node_modules/codemirror/mode/cobol/index.html new file mode 100644 index 000000000..4352419a0 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/cobol/index.html @@ -0,0 +1,210 @@ + + +CodeMirror: COBOL mode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

COBOL mode

+ +

Select Theme Select Font Size + + + + +

+ + +
diff --git a/deploy/core/node_modules/codemirror/modes/coffeescript.js b/deploy/core/node_modules/codemirror/mode/coffeescript/coffeescript.js similarity index 83% rename from deploy/core/node_modules/codemirror/modes/coffeescript.js rename to deploy/core/node_modules/codemirror/mode/coffeescript/coffeescript.js index d29ad2b73..ae460e02a 100644 --- a/deploy/core/node_modules/codemirror/modes/coffeescript.js +++ b/deploy/core/node_modules/codemirror/mode/coffeescript/coffeescript.js @@ -1,7 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Link to the project's GitHub page: * https://github.com/pickhardt/coffeescript-codemirror-mode */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("coffeescript", function(conf) { var ERRORCLASS = "error"; @@ -9,7 +22,7 @@ CodeMirror.defineMode("coffeescript", function(conf) { return new RegExp("^((" + words.join(")|(") + "))\\b"); } - var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?)/; + var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/; var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/; var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/; var properties = /^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/; @@ -21,7 +34,7 @@ CodeMirror.defineMode("coffeescript", function(conf) { "switch", "try", "catch", "finally", "class"]; var commonKeywords = ["break", "by", "continue", "debugger", "delete", "do", "in", "of", "new", "return", "then", - "this", "throw", "when", "until"]; + "this", "@", "throw", "when", "until", "extends"]; var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); @@ -119,13 +132,13 @@ CodeMirror.defineMode("coffeescript", function(conf) { // Handle strings if (stream.match(stringPrefixes)) { - state.tokenize = tokenFactory(stream.current(), "string"); + state.tokenize = tokenFactory(stream.current(), false, "string"); return state.tokenize(stream, state); } // Handle regex literals if (stream.match(regexPrefixes)) { if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division - state.tokenize = tokenFactory(stream.current(), "string-2"); + state.tokenize = tokenFactory(stream.current(), true, "string-2"); return state.tokenize(stream, state); } else { stream.backUp(1); @@ -161,8 +174,7 @@ CodeMirror.defineMode("coffeescript", function(conf) { return ERRORCLASS; } - function tokenFactory(delimiter, outclass) { - var singleline = delimiter.length == 1; + function tokenFactory(delimiter, singleline, outclass) { return function(stream, state) { while (!stream.eol()) { stream.eatWhile(/[^'"\/\\]/); @@ -205,7 +217,7 @@ CodeMirror.defineMode("coffeescript", function(conf) { type = type || "coffee"; var offset = 0, align = false, alignOffset = null; for (var scope = state.scope; scope; scope = scope.prev) { - if (scope.type === "coffee") { + if (scope.type === "coffee" || scope.type == "}") { offset = scope.offset + conf.indentUnit; break; } @@ -213,6 +225,8 @@ CodeMirror.defineMode("coffeescript", function(conf) { if (type !== "coffee") { align = null; alignOffset = stream.column() + stream.current().length; + } else if (state.scope.align) { + state.scope.align = false; } state.scope = { offset: offset, @@ -264,11 +278,10 @@ CodeMirror.defineMode("coffeescript", function(conf) { // Handle scope changes. if (current === "return") { - state.dedent += 1; + state.dedent = true; } if (((current === "->" || current === "=>") && !state.lambda && - state.scope.type == "coffee" && !stream.peek()) || style === "indent") { indent(stream, state); @@ -292,13 +305,15 @@ CodeMirror.defineMode("coffeescript", function(conf) { } delimiter_index = "])}".indexOf(current); if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } + while (state.scope.type == "coffee" && state.scope.prev) + state.scope = state.scope.prev; + if (state.scope.type == current) + state.scope = state.scope.prev; } - if (state.dedent > 0 && stream.eol() && state.scope.type == "coffee") { - if (state.scope.prev) state.scope = state.scope.prev; - state.dedent -= 1; + if (state.dedent && stream.eol()) { + if (state.scope.type == "coffee" && state.scope.prev) + state.scope = state.scope.prev; + state.dedent = false; } return style; @@ -333,11 +348,14 @@ CodeMirror.defineMode("coffeescript", function(conf) { indent: function(state, text) { if (state.tokenize != tokenBase) return 0; - var closes = state.scope.type === (text && text.charAt(0)); - if (state.scope.align) - return state.scope.alignOffset - (closes ? 1 : 0); + var scope = state.scope; + var closer = text && "])}".indexOf(text.charAt(0)) > -1; + if (closer) while (scope.type == "coffee" && scope.prev) scope = scope.prev; + var closes = closer && scope.type === text.charAt(0); + if (scope.align) + return scope.alignOffset - (closes ? 1 : 0); else - return (closes ? state.scope.prev : state.scope).offset; + return (closes ? scope.prev : scope).offset; }, lineComment: "#", @@ -347,3 +365,5 @@ CodeMirror.defineMode("coffeescript", function(conf) { }); CodeMirror.defineMIME("text/x-coffeescript", "coffeescript"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/coffeescript/index.html b/deploy/core/node_modules/codemirror/mode/coffeescript/index.html new file mode 100644 index 000000000..93a5f4f30 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/coffeescript/index.html @@ -0,0 +1,740 @@ + + +CodeMirror: CoffeeScript mode + + + + + + + + + +
+

CoffeeScript mode

+
+ + +

MIME types defined: text/x-coffeescript.

+ +

The CoffeeScript mode was written by Jeff Pickhardt.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/commonlisp.js b/deploy/core/node_modules/codemirror/mode/commonlisp/commonlisp.js similarity index 88% rename from deploy/core/node_modules/codemirror/modes/commonlisp.js rename to deploy/core/node_modules/codemirror/mode/commonlisp/commonlisp.js index 8fa08c8ac..8878e26f4 100644 --- a/deploy/core/node_modules/codemirror/modes/commonlisp.js +++ b/deploy/core/node_modules/codemirror/mode/commonlisp/commonlisp.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("commonlisp", function (config) { var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; @@ -103,3 +116,5 @@ CodeMirror.defineMode("commonlisp", function (config) { }); CodeMirror.defineMIME("text/x-common-lisp", "commonlisp"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/commonlisp/index.html b/deploy/core/node_modules/codemirror/mode/commonlisp/index.html new file mode 100644 index 000000000..f2bf4522d --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/commonlisp/index.html @@ -0,0 +1,177 @@ + + +CodeMirror: Common Lisp mode + + + + + + + + + +
+

Common Lisp mode

+
+ + +

MIME types defined: text/x-common-lisp.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/cypher/cypher.js b/deploy/core/node_modules/codemirror/mode/cypher/cypher.js new file mode 100644 index 000000000..a39c227d9 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/cypher/cypher.js @@ -0,0 +1,146 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// By the Neo4j Team and contributors. +// https://github.com/neo4j-contrib/CodeMirror + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + var wordRegexp = function(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + }; + + CodeMirror.defineMode("cypher", function(config) { + var tokenBase = function(stream/*, state*/) { + var ch = stream.next(), curPunc = null; + if (ch === "\"" || ch === "'") { + stream.match(/.+?["']/); + return "string"; + } + if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return "node"; + } else if (ch === "/" && stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } else { + stream.eatWhile(/[_\w\d]/); + if (stream.eat(":")) { + stream.eatWhile(/[\w\d_\-]/); + return "atom"; + } + var word = stream.current(); + if (funcs.test(word)) return "builtin"; + if (preds.test(word)) return "def"; + if (keywords.test(word)) return "keyword"; + return "variable"; + } + }; + var pushContext = function(state, type, col) { + return state.context = { + prev: state.context, + indent: state.indent, + col: col, + type: type + }; + }; + var popContext = function(state) { + state.indent = state.context.indent; + return state.context = state.context.prev; + }; + var indentUnit = config.indentUnit; + var curPunc; + var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]); + var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]); + var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); + var operatorChars = /[*+\-<>=&|~%^]/; + + return { + startState: function(/*base*/) { + return { + tokenize: tokenBase, + context: null, + indent: 0, + col: 0 + }; + }, + token: function(stream, state) { + if (stream.sol()) { + if (state.context && (state.context.align == null)) { + state.context.align = false; + } + state.indent = stream.indentation(); + } + if (stream.eatSpace()) { + return null; + } + var style = state.tokenize(stream, state); + if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") { + state.context.align = true; + } + if (curPunc === "(") { + pushContext(state, ")", stream.column()); + } else if (curPunc === "[") { + pushContext(state, "]", stream.column()); + } else if (curPunc === "{") { + pushContext(state, "}", stream.column()); + } else if (/[\]\}\)]/.test(curPunc)) { + while (state.context && state.context.type === "pattern") { + popContext(state); + } + if (state.context && curPunc === state.context.type) { + popContext(state); + } + } else if (curPunc === "." && state.context && state.context.type === "pattern") { + popContext(state); + } else if (/atom|string|variable/.test(style) && state.context) { + if (/[\}\]]/.test(state.context.type)) { + pushContext(state, "pattern", stream.column()); + } else if (state.context.type === "pattern" && !state.context.align) { + state.context.align = true; + state.context.col = stream.column(); + } + } + return style; + }, + indent: function(state, textAfter) { + var firstChar = textAfter && textAfter.charAt(0); + var context = state.context; + if (/[\]\}]/.test(firstChar)) { + while (context && context.type === "pattern") { + context = context.prev; + } + } + var closing = context && firstChar === context.type; + if (!context) return 0; + if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent; + if (context.align) return context.col + (closing ? 0 : 1); + return context.indent + (closing ? 0 : indentUnit); + } + }; + }); + + CodeMirror.modeExtensions["cypher"] = { + autoFormatLineBreaks: function(text) { + var i, lines, reProcessedPortion; + var lines = text.split("\n"); + var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g; + for (var i = 0; i < lines.length; i++) + lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim(); + return lines.join("\n"); + } + }; + + CodeMirror.defineMIME("application/x-cypher-query", "cypher"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/cypher/index.html b/deploy/core/node_modules/codemirror/mode/cypher/index.html new file mode 100644 index 000000000..b8bd75c8b --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/cypher/index.html @@ -0,0 +1,63 @@ + + +CodeMirror: Cypher Mode for CodeMirror + + + + + + + + + + +
+

Cypher Mode for CodeMirror

+
+ +
+

MIME types defined: + application/x-cypher-query +

+ + +
diff --git a/deploy/core/node_modules/codemirror/modes/d.js b/deploy/core/node_modules/codemirror/mode/d/d.js old mode 100755 new mode 100644 similarity index 93% rename from deploy/core/node_modules/codemirror/modes/d.js rename to deploy/core/node_modules/codemirror/mode/d/d.js index ab345f1a0..c927a7e35 --- a/deploy/core/node_modules/codemirror/modes/d.js +++ b/deploy/core/node_modules/codemirror/mode/d/d.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("d", function(config, parserConfig) { var indentUnit = config.indentUnit, statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, @@ -47,7 +60,7 @@ CodeMirror.defineMode("d", function(config, parserConfig) { stream.eatWhile(isOperatorChar); return "operator"; } - stream.eatWhile(/[\w\$_]/); + stream.eatWhile(/[\w\$_\xa1-\uffff]/); var cur = stream.current(); if (keywords.propertyIsEnumerable(cur)) { if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; @@ -173,7 +186,6 @@ CodeMirror.defineMode("d", function(config, parserConfig) { }; }); -(function() { function words(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; @@ -202,4 +214,5 @@ CodeMirror.defineMode("d", function(config, parserConfig) { } } }); -}()); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/d/index.html b/deploy/core/node_modules/codemirror/mode/d/index.html new file mode 100644 index 000000000..08cabd8a2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/d/index.html @@ -0,0 +1,273 @@ + + +CodeMirror: D mode + + + + + + + + + + +
+

D mode

+
+ + + +

Simple mode that handle D-Syntax (DLang Homepage).

+ +

MIME types defined: text/x-d + .

+
diff --git a/deploy/core/node_modules/codemirror/modes/diff.js b/deploy/core/node_modules/codemirror/mode/diff/diff.js similarity index 59% rename from deploy/core/node_modules/codemirror/modes/diff.js rename to deploy/core/node_modules/codemirror/mode/diff/diff.js index 9a0d90ea5..fe0305e7b 100644 --- a/deploy/core/node_modules/codemirror/modes/diff.js +++ b/deploy/core/node_modules/codemirror/mode/diff/diff.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("diff", function() { var TOKEN_NAMES = { @@ -30,3 +43,5 @@ CodeMirror.defineMode("diff", function() { }); CodeMirror.defineMIME("text/x-diff", "diff"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/diff/index.html b/deploy/core/node_modules/codemirror/mode/diff/index.html new file mode 100644 index 000000000..0af611fa4 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/diff/index.html @@ -0,0 +1,117 @@ + + +CodeMirror: Diff mode + + + + + + + + + +
+

Diff mode

+
+ + +

MIME types defined: text/x-diff.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/django/django.js b/deploy/core/node_modules/codemirror/mode/django/django.js new file mode 100644 index 000000000..d70b2fe94 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/django/django.js @@ -0,0 +1,67 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), + require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", + "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("django:inner", function() { + var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", + "loop", "none", "self", "super", "if", "endif", "as", "not", "and", + "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal", + "ifnotequal", "endifnotequal", "extends", "include", "load", "length", "comment", + "endcomment", "empty"]; + keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + stream.eatWhile(/[^\{]/); + var ch = stream.next(); + if (ch == "{") { + if (ch = stream.eat(/\{|%|#/)) { + state.tokenize = inTag(ch); + return "tag"; + } + } + } + function inTag (close) { + if (close == "{") { + close = "}"; + } + return function (stream, state) { + var ch = stream.next(); + if ((ch == close) && stream.eat("}")) { + state.tokenize = tokenBase; + return "tag"; + } + if (stream.match(keywords)) { + return "keyword"; + } + return close == "#" ? "comment" : "string"; + }; + } + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; + }); + + CodeMirror.defineMode("django", function(config) { + var htmlBase = CodeMirror.getMode(config, "text/html"); + var djangoInner = CodeMirror.getMode(config, "django:inner"); + return CodeMirror.overlayMode(htmlBase, djangoInner); + }); + + CodeMirror.defineMIME("text/x-django", "django"); +}); diff --git a/deploy/core/node_modules/codemirror/mode/django/index.html b/deploy/core/node_modules/codemirror/mode/django/index.html new file mode 100644 index 000000000..79d9a6a04 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/django/index.html @@ -0,0 +1,63 @@ + + +CodeMirror: Django template mode + + + + + + + + + + + + +
+

Django template mode

+
+ + + +

Mode for HTML with embedded Django template markup.

+ +

MIME types defined: text/x-django

+
diff --git a/deploy/core/node_modules/codemirror/modes/dtd.js b/deploy/core/node_modules/codemirror/mode/dtd/dtd.js similarity index 88% rename from deploy/core/node_modules/codemirror/modes/dtd.js rename to deploy/core/node_modules/codemirror/mode/dtd/dtd.js index 7033bf0f8..f37029a77 100644 --- a/deploy/core/node_modules/codemirror/modes/dtd.js +++ b/deploy/core/node_modules/codemirror/mode/dtd/dtd.js @@ -1,10 +1,23 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* DTD mode Ported to CodeMirror by Peter Kroon - Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues + Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues GitHub: @peterkroon */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("dtd", function(config) { var indentUnit = config.indentUnit, type; function ret(style, tp) {type = tp; return style;} @@ -125,3 +138,5 @@ CodeMirror.defineMode("dtd", function(config) { }); CodeMirror.defineMIME("application/xml-dtd", "dtd"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/dtd/index.html b/deploy/core/node_modules/codemirror/mode/dtd/index.html new file mode 100644 index 000000000..e6798a748 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/dtd/index.html @@ -0,0 +1,89 @@ + + +CodeMirror: DTD mode + + + + + + + + + +
+

DTD mode

+
+ + +

MIME types defined: application/xml-dtd.

+
diff --git a/deploy/core/node_modules/codemirror/mode/dylan/dylan.js b/deploy/core/node_modules/codemirror/mode/dylan/dylan.js new file mode 100644 index 000000000..be2986adb --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/dylan/dylan.js @@ -0,0 +1,299 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("dylan", function(_config) { + // Words + var words = { + // Words that introduce unnamed definitions like "define interface" + unnamedDefinition: ["interface"], + + // Words that introduce simple named definitions like "define library" + namedDefinition: ["module", "library", "macro", + "C-struct", "C-union", + "C-function", "C-callable-wrapper" + ], + + // Words that introduce type definitions like "define class". + // These are also parameterized like "define method" and are + // appended to otherParameterizedDefinitionWords + typeParameterizedDefinition: ["class", "C-subtype", "C-mapped-subtype"], + + // Words that introduce trickier definitions like "define method". + // These require special definitions to be added to startExpressions + otherParameterizedDefinition: ["method", "function", + "C-variable", "C-address" + ], + + // Words that introduce module constant definitions. + // These must also be simple definitions and are + // appended to otherSimpleDefinitionWords + constantSimpleDefinition: ["constant"], + + // Words that introduce module variable definitions. + // These must also be simple definitions and are + // appended to otherSimpleDefinitionWords + variableSimpleDefinition: ["variable"], + + // Other words that introduce simple definitions + // (without implicit bodies). + otherSimpleDefinition: ["generic", "domain", + "C-pointer-type", + "table" + ], + + // Words that begin statements with implicit bodies. + statement: ["if", "block", "begin", "method", "case", + "for", "select", "when", "unless", "until", + "while", "iterate", "profiling", "dynamic-bind" + ], + + // Patterns that act as separators in compound statements. + // This may include any general pattern that must be indented + // specially. + separator: ["finally", "exception", "cleanup", "else", + "elseif", "afterwards" + ], + + // Keywords that do not require special indentation handling, + // but which should be highlighted + other: ["above", "below", "by", "from", "handler", "in", + "instance", "let", "local", "otherwise", "slot", + "subclass", "then", "to", "keyed-by", "virtual" + ], + + // Condition signaling function calls + signalingCalls: ["signal", "error", "cerror", + "break", "check-type", "abort" + ] + }; + + words["otherDefinition"] = + words["unnamedDefinition"] + .concat(words["namedDefinition"]) + .concat(words["otherParameterizedDefinition"]); + + words["definition"] = + words["typeParameterizedDefinition"] + .concat(words["otherDefinition"]); + + words["parameterizedDefinition"] = + words["typeParameterizedDefinition"] + .concat(words["otherParameterizedDefinition"]); + + words["simpleDefinition"] = + words["constantSimpleDefinition"] + .concat(words["variableSimpleDefinition"]) + .concat(words["otherSimpleDefinition"]); + + words["keyword"] = + words["statement"] + .concat(words["separator"]) + .concat(words["other"]); + + // Patterns + var symbolPattern = "[-_a-zA-Z?!*@<>$%]+"; + var symbol = new RegExp("^" + symbolPattern); + var patterns = { + // Symbols with special syntax + symbolKeyword: symbolPattern + ":", + symbolClass: "<" + symbolPattern + ">", + symbolGlobal: "\\*" + symbolPattern + "\\*", + symbolConstant: "\\$" + symbolPattern + }; + var patternStyles = { + symbolKeyword: "atom", + symbolClass: "tag", + symbolGlobal: "variable-2", + symbolConstant: "variable-3" + }; + + // Compile all patterns to regular expressions + for (var patternName in patterns) + if (patterns.hasOwnProperty(patternName)) + patterns[patternName] = new RegExp("^" + patterns[patternName]); + + // Names beginning "with-" and "without-" are commonly + // used as statement macro + patterns["keyword"] = [/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/]; + + var styles = {}; + styles["keyword"] = "keyword"; + styles["definition"] = "def"; + styles["simpleDefinition"] = "def"; + styles["signalingCalls"] = "builtin"; + + // protected words lookup table + var wordLookup = {}; + var styleLookup = {}; + + [ + "keyword", + "definition", + "simpleDefinition", + "signalingCalls" + ].forEach(function(type) { + words[type].forEach(function(word) { + wordLookup[word] = type; + styleLookup[word] = styles[type]; + }); + }); + + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + var type, content; + + function ret(_type, style, _content) { + type = _type; + content = _content; + return style; + } + + function tokenBase(stream, state) { + // String + var ch = stream.peek(); + if (ch == "'" || ch == '"') { + stream.next(); + return chain(stream, state, tokenString(ch, "string", "string")); + } + // Comment + else if (ch == "/") { + stream.next(); + if (stream.eat("*")) { + return chain(stream, state, tokenComment); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else { + stream.skipTo(" "); + return ret("operator", "operator"); + } + } + // Decimal + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/); + return ret("number", "number"); + } + // Hash + else if (ch == "#") { + stream.next(); + // Symbol with string syntax + ch = stream.peek(); + if (ch == '"') { + stream.next(); + return chain(stream, state, tokenString('"', "symbol", "string-2")); + } + // Binary number + else if (ch == "b") { + stream.next(); + stream.eatWhile(/[01]/); + return ret("number", "number"); + } + // Hex number + else if (ch == "x") { + stream.next(); + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } + // Octal number + else if (ch == "o") { + stream.next(); + stream.eatWhile(/[0-7]/); + return ret("number", "number"); + } + // Hash symbol + else { + stream.eatWhile(/[-a-zA-Z]/); + return ret("hash", "keyword"); + } + } else if (stream.match("end")) { + return ret("end", "keyword"); + } + for (var name in patterns) { + if (patterns.hasOwnProperty(name)) { + var pattern = patterns[name]; + if ((pattern instanceof Array && pattern.some(function(p) { + return stream.match(p); + })) || stream.match(pattern)) + return ret(name, patternStyles[name], stream.current()); + } + } + if (stream.match("define")) { + return ret("definition", "def"); + } else { + stream.eatWhile(/[\w\-]/); + // Keyword + if (wordLookup[stream.current()]) { + return ret(wordLookup[stream.current()], styleLookup[stream.current()], stream.current()); + } else if (stream.current().match(symbol)) { + return ret("variable", "variable"); + } else { + stream.next(); + return ret("other", "variable-2"); + } + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, + ch; + while ((ch = stream.next())) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenString(quote, type, style) { + return function(stream, state) { + var next, end = false; + while ((next = stream.next()) != null) { + if (next == quote) { + end = true; + break; + } + } + if (end) + state.tokenize = tokenBase; + return ret(type, style); + }; + } + + // Interface + return { + startState: function() { + return { + tokenize: tokenBase, + currentIndent: 0 + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) + return null; + var style = state.tokenize(stream, state); + return style; + }, + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +CodeMirror.defineMIME("text/x-dylan", "dylan"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/dylan/index.html b/deploy/core/node_modules/codemirror/mode/dylan/index.html new file mode 100644 index 000000000..ddf5ad067 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/dylan/index.html @@ -0,0 +1,407 @@ + + +CodeMirror: Dylan mode + + + + + + + + + + + + +
+

Dylan mode

+ + +
+ + + +

MIME types defined: text/x-dylan.

+
diff --git a/deploy/core/node_modules/codemirror/modes/ecl.js b/deploy/core/node_modules/codemirror/mode/ecl/ecl.js similarity index 94% rename from deploy/core/node_modules/codemirror/modes/ecl.js rename to deploy/core/node_modules/codemirror/mode/ecl/ecl.js index 7601b189a..18778f169 100644 --- a/deploy/core/node_modules/codemirror/modes/ecl.js +++ b/deploy/core/node_modules/codemirror/mode/ecl/ecl.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("ecl", function(config) { function words(str) { @@ -190,3 +203,5 @@ CodeMirror.defineMode("ecl", function(config) { }); CodeMirror.defineMIME("text/x-ecl", "ecl"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/ecl/index.html b/deploy/core/node_modules/codemirror/mode/ecl/index.html new file mode 100644 index 000000000..2306860dc --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/ecl/index.html @@ -0,0 +1,52 @@ + + +CodeMirror: ECL mode + + + + + + + + + +
+

ECL mode

+
+ + +

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

+

MIME types defined: text/x-ecl.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/eiffel.js b/deploy/core/node_modules/codemirror/mode/eiffel/eiffel.js similarity index 87% rename from deploy/core/node_modules/codemirror/modes/eiffel.js rename to deploy/core/node_modules/codemirror/mode/eiffel/eiffel.js index 15f34a932..fcdf295cb 100644 --- a/deploy/core/node_modules/codemirror/modes/eiffel.js +++ b/deploy/core/node_modules/codemirror/mode/eiffel/eiffel.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("eiffel", function() { function wordObj(words) { var o = {}; @@ -145,3 +158,5 @@ CodeMirror.defineMode("eiffel", function() { }); CodeMirror.defineMIME("text/x-eiffel", "eiffel"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/eiffel/index.html b/deploy/core/node_modules/codemirror/mode/eiffel/index.html new file mode 100644 index 000000000..108a71bec --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/eiffel/index.html @@ -0,0 +1,429 @@ + + +CodeMirror: Eiffel mode + + + + + + + + + + +
+

Eiffel mode

+
+ + +

MIME types defined: text/x-eiffel.

+ +

Created by YNH.

+
diff --git a/deploy/core/node_modules/codemirror/mode/erlang/erlang.js b/deploy/core/node_modules/codemirror/mode/erlang/erlang.js new file mode 100644 index 000000000..fbca292f0 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/erlang/erlang.js @@ -0,0 +1,622 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/*jshint unused:true, eqnull:true, curly:true, bitwise:true */ +/*jshint undef:true, latedef:true, trailing:true */ +/*global CodeMirror:true */ + +// erlang mode. +// tokenizer -> token types -> CodeMirror styles +// tokenizer maintains a parse stack +// indenter uses the parse stack + +// TODO indenter: +// bit syntax +// old guard/bif/conversion clashes (e.g. "float/1") +// type/spec/opaque + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMIME("text/x-erlang", "erlang"); + +CodeMirror.defineMode("erlang", function(cmCfg) { + "use strict"; + +///////////////////////////////////////////////////////////////////////////// +// constants + + var typeWords = [ + "-type", "-spec", "-export_type", "-opaque"]; + + var keywordWords = [ + "after","begin","catch","case","cond","end","fun","if", + "let","of","query","receive","try","when"]; + + var separatorRE = /[\->,;]/; + var separatorWords = [ + "->",";",","]; + + var operatorAtomWords = [ + "and","andalso","band","bnot","bor","bsl","bsr","bxor", + "div","not","or","orelse","rem","xor"]; + + var operatorSymbolRE = /[\+\-\*\/<>=\|:!]/; + var operatorSymbolWords = [ + "=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"]; + + var openParenRE = /[<\(\[\{]/; + var openParenWords = [ + "<<","(","[","{"]; + + var closeParenRE = /[>\)\]\}]/; + var closeParenWords = [ + "}","]",")",">>"]; + + var guardWords = [ + "is_atom","is_binary","is_bitstring","is_boolean","is_float", + "is_function","is_integer","is_list","is_number","is_pid", + "is_port","is_record","is_reference","is_tuple", + "atom","binary","bitstring","boolean","function","integer","list", + "number","pid","port","record","reference","tuple"]; + + var bifWords = [ + "abs","adler32","adler32_combine","alive","apply","atom_to_binary", + "atom_to_list","binary_to_atom","binary_to_existing_atom", + "binary_to_list","binary_to_term","bit_size","bitstring_to_list", + "byte_size","check_process_code","contact_binary","crc32", + "crc32_combine","date","decode_packet","delete_module", + "disconnect_node","element","erase","exit","float","float_to_list", + "garbage_collect","get","get_keys","group_leader","halt","hd", + "integer_to_list","internal_bif","iolist_size","iolist_to_binary", + "is_alive","is_atom","is_binary","is_bitstring","is_boolean", + "is_float","is_function","is_integer","is_list","is_number","is_pid", + "is_port","is_process_alive","is_record","is_reference","is_tuple", + "length","link","list_to_atom","list_to_binary","list_to_bitstring", + "list_to_existing_atom","list_to_float","list_to_integer", + "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded", + "monitor_node","node","node_link","node_unlink","nodes","notalive", + "now","open_port","pid_to_list","port_close","port_command", + "port_connect","port_control","pre_loaded","process_flag", + "process_info","processes","purge_module","put","register", + "registered","round","self","setelement","size","spawn","spawn_link", + "spawn_monitor","spawn_opt","split_binary","statistics", + "term_to_binary","time","throw","tl","trunc","tuple_size", + "tuple_to_list","unlink","unregister","whereis"]; + +// upper case: [A-Z] [Ø-Þ] [À-Ö] +// lower case: [a-z] [ß-ö] [ø-ÿ] + var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/; + var escapesRE = + /[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/; + +///////////////////////////////////////////////////////////////////////////// +// tokenizer + + function tokenizer(stream,state) { + // in multi-line string + if (state.in_string) { + state.in_string = (!doubleQuote(stream)); + return rval(state,stream,"string"); + } + + // in multi-line atom + if (state.in_atom) { + state.in_atom = (!singleQuote(stream)); + return rval(state,stream,"atom"); + } + + // whitespace + if (stream.eatSpace()) { + return rval(state,stream,"whitespace"); + } + + // attributes and type specs + if (!peekToken(state) && + stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) { + if (is_member(stream.current(),typeWords)) { + return rval(state,stream,"type"); + }else{ + return rval(state,stream,"attribute"); + } + } + + var ch = stream.next(); + + // comment + if (ch == '%') { + stream.skipToEnd(); + return rval(state,stream,"comment"); + } + + // colon + if (ch == ":") { + return rval(state,stream,"colon"); + } + + // macro + if (ch == '?') { + stream.eatSpace(); + stream.eatWhile(anumRE); + return rval(state,stream,"macro"); + } + + // record + if (ch == "#") { + stream.eatSpace(); + stream.eatWhile(anumRE); + return rval(state,stream,"record"); + } + + // dollar escape + if (ch == "$") { + if (stream.next() == "\\" && !stream.match(escapesRE)) { + return rval(state,stream,"error"); + } + return rval(state,stream,"number"); + } + + // dot + if (ch == ".") { + return rval(state,stream,"dot"); + } + + // quoted atom + if (ch == '\'') { + if (!(state.in_atom = (!singleQuote(stream)))) { + if (stream.match(/\s*\/\s*[0-9]/,false)) { + stream.match(/\s*\/\s*[0-9]/,true); + return rval(state,stream,"fun"); // 'f'/0 style fun + } + if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) { + return rval(state,stream,"function"); + } + } + return rval(state,stream,"atom"); + } + + // string + if (ch == '"') { + state.in_string = (!doubleQuote(stream)); + return rval(state,stream,"string"); + } + + // variable + if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) { + stream.eatWhile(anumRE); + return rval(state,stream,"variable"); + } + + // atom/keyword/BIF/function + if (/[a-z_ß-öø-ÿ]/.test(ch)) { + stream.eatWhile(anumRE); + + if (stream.match(/\s*\/\s*[0-9]/,false)) { + stream.match(/\s*\/\s*[0-9]/,true); + return rval(state,stream,"fun"); // f/0 style fun + } + + var w = stream.current(); + + if (is_member(w,keywordWords)) { + return rval(state,stream,"keyword"); + }else if (is_member(w,operatorAtomWords)) { + return rval(state,stream,"operator"); + }else if (stream.match(/\s*\(/,false)) { + // 'put' and 'erlang:put' are bifs, 'foo:put' is not + if (is_member(w,bifWords) && + ((peekToken(state).token != ":") || + (peekToken(state,2).token == "erlang"))) { + return rval(state,stream,"builtin"); + }else if (is_member(w,guardWords)) { + return rval(state,stream,"guard"); + }else{ + return rval(state,stream,"function"); + } + }else if (is_member(w,operatorAtomWords)) { + return rval(state,stream,"operator"); + }else if (lookahead(stream) == ":") { + if (w == "erlang") { + return rval(state,stream,"builtin"); + } else { + return rval(state,stream,"function"); + } + }else if (is_member(w,["true","false"])) { + return rval(state,stream,"boolean"); + }else if (is_member(w,["true","false"])) { + return rval(state,stream,"boolean"); + }else{ + return rval(state,stream,"atom"); + } + } + + // number + var digitRE = /[0-9]/; + var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int + if (digitRE.test(ch)) { + stream.eatWhile(digitRE); + if (stream.eat('#')) { // 36#aZ style integer + if (!stream.eatWhile(radixRE)) { + stream.backUp(1); //"36#" - syntax error + } + } else if (stream.eat('.')) { // float + if (!stream.eatWhile(digitRE)) { + stream.backUp(1); // "3." - probably end of function + } else { + if (stream.eat(/[eE]/)) { // float with exponent + if (stream.eat(/[-+]/)) { + if (!stream.eatWhile(digitRE)) { + stream.backUp(2); // "2e-" - syntax error + } + } else { + if (!stream.eatWhile(digitRE)) { + stream.backUp(1); // "2e" - syntax error + } + } + } + } + } + return rval(state,stream,"number"); // normal integer + } + + // open parens + if (nongreedy(stream,openParenRE,openParenWords)) { + return rval(state,stream,"open_paren"); + } + + // close parens + if (nongreedy(stream,closeParenRE,closeParenWords)) { + return rval(state,stream,"close_paren"); + } + + // separators + if (greedy(stream,separatorRE,separatorWords)) { + return rval(state,stream,"separator"); + } + + // operators + if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) { + return rval(state,stream,"operator"); + } + + return rval(state,stream,null); + } + +///////////////////////////////////////////////////////////////////////////// +// utilities + function nongreedy(stream,re,words) { + if (stream.current().length == 1 && re.test(stream.current())) { + stream.backUp(1); + while (re.test(stream.peek())) { + stream.next(); + if (is_member(stream.current(),words)) { + return true; + } + } + stream.backUp(stream.current().length-1); + } + return false; + } + + function greedy(stream,re,words) { + if (stream.current().length == 1 && re.test(stream.current())) { + while (re.test(stream.peek())) { + stream.next(); + } + while (0 < stream.current().length) { + if (is_member(stream.current(),words)) { + return true; + }else{ + stream.backUp(1); + } + } + stream.next(); + } + return false; + } + + function doubleQuote(stream) { + return quote(stream, '"', '\\'); + } + + function singleQuote(stream) { + return quote(stream,'\'','\\'); + } + + function quote(stream,quoteChar,escapeChar) { + while (!stream.eol()) { + var ch = stream.next(); + if (ch == quoteChar) { + return true; + }else if (ch == escapeChar) { + stream.next(); + } + } + return false; + } + + function lookahead(stream) { + var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false); + return m ? m.pop() : ""; + } + + function is_member(element,list) { + return (-1 < list.indexOf(element)); + } + + function rval(state,stream,type) { + + // parse stack + pushToken(state,realToken(type,stream)); + + // map erlang token type to CodeMirror style class + // erlang -> CodeMirror tag + switch (type) { + case "atom": return "atom"; + case "attribute": return "attribute"; + case "boolean": return "atom"; + case "builtin": return "builtin"; + case "close_paren": return null; + case "colon": return null; + case "comment": return "comment"; + case "dot": return null; + case "error": return "error"; + case "fun": return "meta"; + case "function": return "tag"; + case "guard": return "property"; + case "keyword": return "keyword"; + case "macro": return "variable-2"; + case "number": return "number"; + case "open_paren": return null; + case "operator": return "operator"; + case "record": return "bracket"; + case "separator": return null; + case "string": return "string"; + case "type": return "def"; + case "variable": return "variable"; + default: return null; + } + } + + function aToken(tok,col,ind,typ) { + return {token: tok, + column: col, + indent: ind, + type: typ}; + } + + function realToken(type,stream) { + return aToken(stream.current(), + stream.column(), + stream.indentation(), + type); + } + + function fakeToken(type) { + return aToken(type,0,0,type); + } + + function peekToken(state,depth) { + var len = state.tokenStack.length; + var dep = (depth ? depth : 1); + + if (len < dep) { + return false; + }else{ + return state.tokenStack[len-dep]; + } + } + + function pushToken(state,token) { + + if (!(token.type == "comment" || token.type == "whitespace")) { + state.tokenStack = maybe_drop_pre(state.tokenStack,token); + state.tokenStack = maybe_drop_post(state.tokenStack); + } + } + + function maybe_drop_pre(s,token) { + var last = s.length-1; + + if (0 < last && s[last].type === "record" && token.type === "dot") { + s.pop(); + }else if (0 < last && s[last].type === "group") { + s.pop(); + s.push(token); + }else{ + s.push(token); + } + return s; + } + + function maybe_drop_post(s) { + var last = s.length-1; + + if (s[last].type === "dot") { + return []; + } + if (s[last].type === "fun" && s[last-1].token === "fun") { + return s.slice(0,last-1); + } + switch (s[s.length-1].token) { + case "}": return d(s,{g:["{"]}); + case "]": return d(s,{i:["["]}); + case ")": return d(s,{i:["("]}); + case ">>": return d(s,{i:["<<"]}); + case "end": return d(s,{i:["begin","case","fun","if","receive","try"]}); + case ",": return d(s,{e:["begin","try","when","->", + ",","(","[","{","<<"]}); + case "->": return d(s,{r:["when"], + m:["try","if","case","receive"]}); + case ";": return d(s,{E:["case","fun","if","receive","try","when"]}); + case "catch":return d(s,{e:["try"]}); + case "of": return d(s,{e:["case"]}); + case "after":return d(s,{e:["receive","try"]}); + default: return s; + } + } + + function d(stack,tt) { + // stack is a stack of Token objects. + // tt is an object; {type:tokens} + // type is a char, tokens is a list of token strings. + // The function returns (possibly truncated) stack. + // It will descend the stack, looking for a Token such that Token.token + // is a member of tokens. If it does not find that, it will normally (but + // see "E" below) return stack. If it does find a match, it will remove + // all the Tokens between the top and the matched Token. + // If type is "m", that is all it does. + // If type is "i", it will also remove the matched Token and the top Token. + // If type is "g", like "i", but add a fake "group" token at the top. + // If type is "r", it will remove the matched Token, but not the top Token. + // If type is "e", it will keep the matched Token but not the top Token. + // If type is "E", it behaves as for type "e", except if there is no match, + // in which case it will return an empty stack. + + for (var type in tt) { + var len = stack.length-1; + var tokens = tt[type]; + for (var i = len-1; -1 < i ; i--) { + if (is_member(stack[i].token,tokens)) { + var ss = stack.slice(0,i); + switch (type) { + case "m": return ss.concat(stack[i]).concat(stack[len]); + case "r": return ss.concat(stack[len]); + case "i": return ss; + case "g": return ss.concat(fakeToken("group")); + case "E": return ss.concat(stack[i]); + case "e": return ss.concat(stack[i]); + } + } + } + } + return (type == "E" ? [] : stack); + } + +///////////////////////////////////////////////////////////////////////////// +// indenter + + function indenter(state,textAfter) { + var t; + var unit = cmCfg.indentUnit; + var wordAfter = wordafter(textAfter); + var currT = peekToken(state,1); + var prevT = peekToken(state,2); + + if (state.in_string || state.in_atom) { + return CodeMirror.Pass; + }else if (!prevT) { + return 0; + }else if (currT.token == "when") { + return currT.column+unit; + }else if (wordAfter === "when" && prevT.type === "function") { + return prevT.indent+unit; + }else if (wordAfter === "(" && currT.token === "fun") { + return currT.column+3; + }else if (wordAfter === "catch" && (t = getToken(state,["try"]))) { + return t.column; + }else if (is_member(wordAfter,["end","after","of"])) { + t = getToken(state,["begin","case","fun","if","receive","try"]); + return t ? t.column : CodeMirror.Pass; + }else if (is_member(wordAfter,closeParenWords)) { + t = getToken(state,openParenWords); + return t ? t.column : CodeMirror.Pass; + }else if (is_member(currT.token,[",","|","||"]) || + is_member(wordAfter,[",","|","||"])) { + t = postcommaToken(state); + return t ? t.column+t.token.length : unit; + }else if (currT.token == "->") { + if (is_member(prevT.token, ["receive","case","if","try"])) { + return prevT.column+unit+unit; + }else{ + return prevT.column+unit; + } + }else if (is_member(currT.token,openParenWords)) { + return currT.column+currT.token.length; + }else{ + t = defaultToken(state); + return truthy(t) ? t.column+unit : 0; + } + } + + function wordafter(str) { + var m = str.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/); + + return truthy(m) && (m.index === 0) ? m[0] : ""; + } + + function postcommaToken(state) { + var objs = state.tokenStack.slice(0,-1); + var i = getTokenIndex(objs,"type",["open_paren"]); + + return truthy(objs[i]) ? objs[i] : false; + } + + function defaultToken(state) { + var objs = state.tokenStack; + var stop = getTokenIndex(objs,"type",["open_paren","separator","keyword"]); + var oper = getTokenIndex(objs,"type",["operator"]); + + if (truthy(stop) && truthy(oper) && stop < oper) { + return objs[stop+1]; + } else if (truthy(stop)) { + return objs[stop]; + } else { + return false; + } + } + + function getToken(state,tokens) { + var objs = state.tokenStack; + var i = getTokenIndex(objs,"token",tokens); + + return truthy(objs[i]) ? objs[i] : false; + } + + function getTokenIndex(objs,propname,propvals) { + + for (var i = objs.length-1; -1 < i ; i--) { + if (is_member(objs[i][propname],propvals)) { + return i; + } + } + return false; + } + + function truthy(x) { + return (x !== false) && (x != null); + } + +///////////////////////////////////////////////////////////////////////////// +// this object defines the mode + + return { + startState: + function() { + return {tokenStack: [], + in_string: false, + in_atom: false}; + }, + + token: + function(stream, state) { + return tokenizer(stream, state); + }, + + indent: + function(state, textAfter) { + return indenter(state,textAfter); + }, + + lineComment: "%" + }; +}); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/erlang/index.html b/deploy/core/node_modules/codemirror/mode/erlang/index.html new file mode 100644 index 000000000..6d06a890a --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/erlang/index.html @@ -0,0 +1,76 @@ + + +CodeMirror: Erlang mode + + + + + + + + + + + +
+

Erlang mode

+
+ + + +

MIME types defined: text/x-erlang.

+
diff --git a/deploy/core/node_modules/codemirror/modes/fortran.js b/deploy/core/node_modules/codemirror/mode/fortran/fortran.js similarity index 94% rename from deploy/core/node_modules/codemirror/modes/fortran.js rename to deploy/core/node_modules/codemirror/mode/fortran/fortran.js index 83fd8fde8..4d88f006a 100644 --- a/deploy/core/node_modules/codemirror/modes/fortran.js +++ b/deploy/core/node_modules/codemirror/mode/fortran/fortran.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("fortran", function() { function words(array) { var keys = {}; @@ -171,3 +184,5 @@ CodeMirror.defineMode("fortran", function() { }); CodeMirror.defineMIME("text/x-fortran", "fortran"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/fortran/index.html b/deploy/core/node_modules/codemirror/mode/fortran/index.html new file mode 100644 index 000000000..102e8f826 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/fortran/index.html @@ -0,0 +1,81 @@ + + +CodeMirror: Fortran mode + + + + + + + + + +
+

Fortran mode

+ + +
+ + + +

MIME types defined: text/x-Fortran.

+
diff --git a/deploy/core/node_modules/codemirror/modes/gas.js b/deploy/core/node_modules/codemirror/mode/gas/gas.js similarity index 94% rename from deploy/core/node_modules/codemirror/modes/gas.js rename to deploy/core/node_modules/codemirror/mode/gas/gas.js index a6e689290..0c74bedc5 100644 --- a/deploy/core/node_modules/codemirror/modes/gas.js +++ b/deploy/core/node_modules/codemirror/mode/gas/gas.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("gas", function(_config, parserConfig) { 'use strict'; @@ -211,7 +224,7 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) { }); } - var arch = parserConfig.architecture.toLowerCase(); + var arch = (parserConfig.architecture || "x86").toLowerCase(); if (arch === "x86") { x86(parserConfig); } else if (arch === "arm" || arch === "armv6") { @@ -328,3 +341,5 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) { blockCommentEnd: "*/" }; }); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/gas/index.html b/deploy/core/node_modules/codemirror/mode/gas/index.html new file mode 100644 index 000000000..df75ca2db --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/gas/index.html @@ -0,0 +1,68 @@ + + +CodeMirror: Gas mode + + + + + + + + + +
+

Gas mode

+
+ +
+ + + +

Handles AT&T assembler syntax (more specifically this handles + the GNU Assembler (gas) syntax.) + It takes a single optional configuration parameter: + architecture, which can be one of "ARM", + "ARMv6" or "x86". + Including the parameter adds syntax for the registers and special + directives for the supplied architecture. + +

MIME types defined: text/x-gas

+
diff --git a/deploy/core/node_modules/codemirror/modes/gfm.js b/deploy/core/node_modules/codemirror/mode/gfm/gfm.js similarity index 70% rename from deploy/core/node_modules/codemirror/modes/gfm.js rename to deploy/core/node_modules/codemirror/mode/gfm/gfm.js index 1411a9382..eb0b7c193 100644 --- a/deploy/core/node_modules/codemirror/modes/gfm.js +++ b/deploy/core/node_modules/codemirror/mode/gfm/gfm.js @@ -1,4 +1,17 @@ -CodeMirror.defineMode("gfm", function(config) { +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("gfm", function(config, modeConfig) { var codeDepth = 0; function blankLine(state) { state.code = false; @@ -20,6 +33,8 @@ CodeMirror.defineMode("gfm", function(config) { }; }, token: function(stream, state) { + state.combineTokens = null; + // Hack to prevent formatting override inside code blocks (block and inline) if (state.codeBlock) { if (stream.match(/^```/)) { @@ -67,19 +82,22 @@ CodeMirror.defineMode("gfm", function(config) { // User/Project@SHA // User@SHA // SHA + state.combineTokens = true; return "link"; } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { // User/Project#Num // User#Num // #Num + state.combineTokens = true; return "link"; } } - if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i) && + if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) && stream.string.slice(stream.start - 2, stream.start) != "](") { // URLs // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine + state.combineTokens = true; return "link"; } stream.next(); @@ -87,11 +105,18 @@ CodeMirror.defineMode("gfm", function(config) { }, blankLine: blankLine }; - CodeMirror.defineMIME("gfmBase", { - name: "markdown", + + var markdownConfig = { underscoresBreakWords: false, taskLists: true, fencedCodeBlocks: true - }); + }; + for (var attr in modeConfig) { + markdownConfig[attr] = modeConfig[attr]; + } + markdownConfig.name = "markdown"; + CodeMirror.defineMIME("gfmBase", markdownConfig); return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay); }, "markdown"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/gfm/index.html b/deploy/core/node_modules/codemirror/mode/gfm/index.html new file mode 100644 index 000000000..a35e56866 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/gfm/index.html @@ -0,0 +1,82 @@ + + +CodeMirror: GFM mode + + + + + + + + + + + + + + + + +
+

GFM mode

+
+ + + +

Optionally depends on other modes for properly highlighted code blocks.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/gfm/test.js b/deploy/core/node_modules/codemirror/mode/gfm/test.js new file mode 100644 index 000000000..b9af5e894 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/gfm/test.js @@ -0,0 +1,164 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true}); + function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } + + FT("codeBackticks", + "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); + + FT("doubleBackticks", + "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); + + FT("codeBlock", + "[comment&formatting&formatting-code-block ```css]", + "[tag foo]", + "[comment&formatting&formatting-code-block ```]"); + + FT("taskList", + "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]", + "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"); + + MT("emInWordAsterisk", + "foo[em *bar*]hello"); + + MT("emInWordUnderscore", + "foo_bar_hello"); + + MT("emStrongUnderscore", + "[strong __][em&strong _foo__][em _] bar"); + + MT("fencedCodeBlocks", + "[comment ```]", + "[comment foo]", + "", + "[comment ```]", + "bar"); + + MT("fencedCodeBlockModeSwitching", + "[comment ```javascript]", + "[variable foo]", + "", + "[comment ```]", + "bar"); + + MT("taskListAsterisk", + "[variable-2 * []] foo]", // Invalid; must have space or x between [] + "[variable-2 * [ ]]bar]", // Invalid; must have space after ] + "[variable-2 * [x]]hello]", // Invalid; must have space after ] + "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("taskListPlus", + "[variable-2 + []] foo]", // Invalid; must have space or x between [] + "[variable-2 + [ ]]bar]", // Invalid; must have space after ] + "[variable-2 + [x]]hello]", // Invalid; must have space after ] + "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("taskListDash", + "[variable-2 - []] foo]", // Invalid; must have space or x between [] + "[variable-2 - [ ]]bar]", // Invalid; must have space after ] + "[variable-2 - [x]]hello]", // Invalid; must have space after ] + "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("taskListNumber", + "[variable-2 1. []] foo]", // Invalid; must have space or x between [] + "[variable-2 2. [ ]]bar]", // Invalid; must have space after ] + "[variable-2 3. [x]]hello]", // Invalid; must have space after ] + "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links + " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested + + MT("SHA", + "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"); + + MT("SHAEmphasis", + "[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); + + MT("shortSHA", + "foo [link be6a8cc] bar"); + + MT("tooShortSHA", + "foo be6a8c bar"); + + MT("longSHA", + "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"); + + MT("badSHA", + "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"); + + MT("userSHA", + "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"); + + MT("userSHAEmphasis", + "[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); + + MT("userProjectSHA", + "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"); + + MT("userProjectSHAEmphasis", + "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); + + MT("num", + "foo [link #1] bar"); + + MT("numEmphasis", + "[em *foo ][em&link #1][em *]"); + + MT("badNum", + "foo #1bar hello"); + + MT("userNum", + "foo [link bar#1] hello"); + + MT("userNumEmphasis", + "[em *foo ][em&link bar#1][em *]"); + + MT("userProjectNum", + "foo [link bar/hello#1] world"); + + MT("userProjectNumEmphasis", + "[em *foo ][em&link bar/hello#1][em *]"); + + MT("vanillaLink", + "foo [link http://www.example.com/] bar"); + + MT("vanillaLinkPunctuation", + "foo [link http://www.example.com/]. bar"); + + MT("vanillaLinkExtension", + "foo [link http://www.example.com/index.html] bar"); + + MT("vanillaLinkEmphasis", + "foo [em *][em&link http://www.example.com/index.html][em *] bar"); + + MT("notALink", + "[comment ```css]", + "[tag foo] {[property color]:[keyword black];}", + "[comment ```][link http://www.example.com/]"); + + MT("notALink", + "[comment ``foo `bar` http://www.example.com/``] hello"); + + MT("notALink", + "[comment `foo]", + "[link http://www.example.com/]", + "[comment `foo]", + "", + "[link http://www.example.com/]"); + + MT("headerCodeBlockGithub", + "[header&header-1 # heading]", + "", + "[comment ```]", + "[comment code]", + "[comment ```]", + "", + "Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]", + "Issue: [link #1]", + "Link: [link http://www.example.com/]"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/gherkin/gherkin.js b/deploy/core/node_modules/codemirror/mode/gherkin/gherkin.js new file mode 100644 index 000000000..fc2ebee16 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/gherkin/gherkin.js @@ -0,0 +1,178 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* +Gherkin mode - http://www.cukes.info/ +Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues +*/ + +// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js +//var Quotes = { +// SINGLE: 1, +// DOUBLE: 2 +//}; + +//var regex = { +// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/ +//}; + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("gherkin", function () { + return { + startState: function () { + return { + lineNumber: 0, + tableHeaderLine: false, + allowFeature: true, + allowBackground: false, + allowScenario: false, + allowSteps: false, + allowPlaceholders: false, + allowMultilineArgument: false, + inMultilineString: false, + inMultilineTable: false, + inKeywordLine: false + }; + }, + token: function (stream, state) { + if (stream.sol()) { + state.lineNumber++; + state.inKeywordLine = false; + if (state.inMultilineTable) { + state.tableHeaderLine = false; + if (!stream.match(/\s*\|/, false)) { + state.allowMultilineArgument = false; + state.inMultilineTable = false; + } + } + } + + stream.eatSpace(); + + if (state.allowMultilineArgument) { + + // STRING + if (state.inMultilineString) { + if (stream.match('"""')) { + state.inMultilineString = false; + state.allowMultilineArgument = false; + } else { + stream.match(/.*/); + } + return "string"; + } + + // TABLE + if (state.inMultilineTable) { + if (stream.match(/\|\s*/)) { + return "bracket"; + } else { + stream.match(/[^\|]*/); + return state.tableHeaderLine ? "header" : "string"; + } + } + + // DETECT START + if (stream.match('"""')) { + // String + state.inMultilineString = true; + return "string"; + } else if (stream.match("|")) { + // Table + state.inMultilineTable = true; + state.tableHeaderLine = true; + return "bracket"; + } + + } + + // LINE COMMENT + if (stream.match(/#.*/)) { + return "comment"; + + // TAG + } else if (!state.inKeywordLine && stream.match(/@\S+/)) { + return "tag"; + + // FEATURE + } else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) { + state.allowScenario = true; + state.allowBackground = true; + state.allowPlaceholders = false; + state.allowSteps = false; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // BACKGROUND + } else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // SCENARIO OUTLINE + } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) { + state.allowPlaceholders = true; + state.allowSteps = true; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // EXAMPLES + } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = true; + return "keyword"; + + // SCENARIO + } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // STEPS + } else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) { + state.inStep = true; + state.allowPlaceholders = true; + state.allowMultilineArgument = true; + state.inKeywordLine = true; + return "keyword"; + + // INLINE STRING + } else if (stream.match(/"[^"]*"?/)) { + return "string"; + + // PLACEHOLDER + } else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) { + return "variable"; + + // Fall through + } else { + stream.next(); + stream.eatWhile(/[^@"<#]/); + return null; + } + } + }; +}); + +CodeMirror.defineMIME("text/x-feature", "gherkin"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/gherkin/index.html b/deploy/core/node_modules/codemirror/mode/gherkin/index.html new file mode 100644 index 000000000..af8184c98 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/gherkin/index.html @@ -0,0 +1,48 @@ + + +CodeMirror: Gherkin mode + + + + + + + + + +
+

Gherkin mode

+
+ + +

MIME types defined: text/x-feature.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/go.js b/deploy/core/node_modules/codemirror/mode/go/go.js similarity index 90% rename from deploy/core/node_modules/codemirror/modes/go.js rename to deploy/core/node_modules/codemirror/mode/go/go.js index 6a458a6fe..173e034d0 100644 --- a/deploy/core/node_modules/codemirror/modes/go.js +++ b/deploy/core/node_modules/codemirror/mode/go/go.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("go", function(config) { var indentUnit = config.indentUnit; @@ -58,7 +71,7 @@ CodeMirror.defineMode("go", function(config) { stream.eatWhile(isOperatorChar); return "operator"; } - stream.eatWhile(/[\w\$_]/); + stream.eatWhile(/[\w\$_\xa1-\uffff]/); var cur = stream.current(); if (keywords.propertyIsEnumerable(cur)) { if (cur == "case" || cur == "default") curPunc = "case"; @@ -158,7 +171,8 @@ CodeMirror.defineMode("go", function(config) { else return ctx.indented + (closing ? 0 : indentUnit); }, - electricChars: "{}:", + electricChars: "{}):", + fold: "brace", blockCommentStart: "/*", blockCommentEnd: "*/", lineComment: "//" @@ -166,3 +180,5 @@ CodeMirror.defineMode("go", function(config) { }); CodeMirror.defineMIME("text/x-go", "go"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/go/index.html b/deploy/core/node_modules/codemirror/mode/go/index.html new file mode 100644 index 000000000..72e3b364c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/go/index.html @@ -0,0 +1,85 @@ + + +CodeMirror: Go mode + + + + + + + + + + + +
+

Go mode

+
+ + + +

MIME type: text/x-go

+
diff --git a/deploy/core/node_modules/codemirror/modes/groovy.js b/deploy/core/node_modules/codemirror/mode/groovy/groovy.js similarity index 93% rename from deploy/core/node_modules/codemirror/modes/groovy.js rename to deploy/core/node_modules/codemirror/mode/groovy/groovy.js index 6800e0aaf..89b8224cf 100644 --- a/deploy/core/node_modules/codemirror/modes/groovy.js +++ b/deploy/core/node_modules/codemirror/mode/groovy/groovy.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("groovy", function(config) { function words(str) { var obj = {}, words = str.split(" "); @@ -209,3 +222,5 @@ CodeMirror.defineMode("groovy", function(config) { }); CodeMirror.defineMIME("text/x-groovy", "groovy"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/groovy/index.html b/deploy/core/node_modules/codemirror/mode/groovy/index.html new file mode 100644 index 000000000..bb0df078c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/groovy/index.html @@ -0,0 +1,84 @@ + + +CodeMirror: Groovy mode + + + + + + + + + + +
+

Groovy mode

+
+ + + +

MIME types defined: text/x-groovy

+
diff --git a/deploy/core/node_modules/codemirror/modes/haml.js b/deploy/core/node_modules/codemirror/mode/haml/haml.js similarity index 86% rename from deploy/core/node_modules/codemirror/modes/haml.js rename to deploy/core/node_modules/codemirror/mode/haml/haml.js index 793308f6f..8fe63b020 100644 --- a/deploy/core/node_modules/codemirror/modes/haml.js +++ b/deploy/core/node_modules/codemirror/mode/haml/haml.js @@ -1,5 +1,15 @@ -(function() { - "use strict"; +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; // full haml mode. This handled embeded ruby and html fragments too CodeMirror.defineMode("haml", function(config) { @@ -65,7 +75,7 @@ // donot handle --> as valid ruby, make it HTML close comment instead if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { state.tokenize = ruby; - return null; + return state.tokenize(stream, state); } if (state.previousToken.style == "hamlTag" || @@ -73,10 +83,10 @@ state.previousToken.style == "hamlAttribute") { if (ch == "(") { state.tokenize = rubyInQuote(")"); - return null; + return state.tokenize(stream, state); } else if (ch == "{") { state.tokenize = rubyInQuote("}"); - return null; + return state.tokenize(stream, state); } } @@ -141,13 +151,9 @@ style = null; } return style; - }, - - indent: function(state) { - return state.indented; } }; }, "htmlmixed", "ruby"); CodeMirror.defineMIME("text/x-haml", "haml"); -})(); +}); diff --git a/deploy/core/node_modules/codemirror/mode/haml/index.html b/deploy/core/node_modules/codemirror/mode/haml/index.html new file mode 100644 index 000000000..2894a938e --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/haml/index.html @@ -0,0 +1,79 @@ + + +CodeMirror: HAML mode + + + + + + + + + + + + + +
+

HAML mode

+
+ + +

MIME types defined: text/x-haml.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/haml/test.js b/deploy/core/node_modules/codemirror/mode/haml/test.js new file mode 100644 index 000000000..508458a43 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/haml/test.js @@ -0,0 +1,97 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + // Requires at least one media query + MT("elementName", + "[tag %h1] Hey There"); + + MT("oneElementPerLine", + "[tag %h1] Hey There %h2"); + + MT("idSelector", + "[tag %h1][attribute #test] Hey There"); + + MT("classSelector", + "[tag %h1][attribute .hello] Hey There"); + + MT("docType", + "[tag !!! XML]"); + + MT("comment", + "[comment / Hello WORLD]"); + + MT("notComment", + "[tag %h1] This is not a / comment "); + + MT("attributes", + "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}"); + + MT("htmlCode", + "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); + + MT("rubyBlock", + "[operator =][variable-2 @item]"); + + MT("selectorRubyBlock", + "[tag %a.selector=] [variable-2 @item]"); + + MT("nestedRubyBlock", + "[tag %a]", + " [operator =][variable puts] [string \"test\"]"); + + MT("multilinePlaintext", + "[tag %p]", + " Hello,", + " World"); + + MT("multilineRuby", + "[tag %p]", + " [comment -# this is a comment]", + " [comment and this is a comment too]", + " Date/Time", + " [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]", + " [tag %strong=] [variable now]", + " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", + " [operator =][string \"Happy\"]", + " [operator =][string \"Belated\"]", + " [operator =][string \"Birthday\"]"); + + MT("multilineComment", + "[comment /]", + " [comment Multiline]", + " [comment Comment]"); + + MT("hamlComment", + "[comment -# this is a comment]"); + + MT("multilineHamlComment", + "[comment -# this is a comment]", + " [comment and this is a comment too]"); + + MT("multilineHTMLComment", + "[comment ]"); + + MT("hamlAfterRubyTag", + "[attribute .block]", + " [tag %strong=] [variable now]", + " [attribute .test]", + " [operator =][variable now]", + " [attribute .right]"); + + MT("stretchedRuby", + "[operator =] [variable puts] [string \"Hello\"],", + " [string \"World\"]"); + + MT("interpolationInHashAttribute", + //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); + "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); + + MT("interpolationInHTMLAttribute", + "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test"); +})(); diff --git a/deploy/core/node_modules/codemirror/modes/haskell.js b/deploy/core/node_modules/codemirror/mode/haskell/haskell.js similarity index 91% rename from deploy/core/node_modules/codemirror/modes/haskell.js rename to deploy/core/node_modules/codemirror/mode/haskell/haskell.js index 59ca7f0ba..fe0bab67e 100644 --- a/deploy/core/node_modules/codemirror/modes/haskell.js +++ b/deploy/core/node_modules/codemirror/mode/haskell/haskell.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("haskell", function(_config, modeConfig) { function switchState(source, setState, f) { @@ -8,10 +21,10 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) { // These should all be Unicode extended, as per the Haskell 2010 report var smallRE = /[a-z_]/; var largeRE = /[A-Z]/; - var digitRE = /[0-9]/; + var digitRE = /\d/; var hexitRE = /[0-9A-Fa-f]/; var octitRE = /[0-7]/; - var idRE = /[a-z_A-Z0-9']/; + var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/; var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; var specialRE = /[(),;[\]`{}]/; var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer @@ -76,9 +89,8 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) { } source.eatWhile(digitRE); var t = "number"; - if (source.eat('.')) { + if (source.match(/^\.\d+/)) { t = "number"; - source.eatWhile(digitRE); // should require at least 1 } if (source.eat(/[eE]/)) { t = "number"; @@ -88,6 +100,9 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) { return t; } + if (ch == "." && source.eat(".")) + return "keyword"; + if (symbolRE.test(ch)) { if (ch == '-' && source.eat(/-/)) { source.eatWhile(/-/); @@ -237,7 +252,7 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) { token: function(stream, state) { var t = state.f(stream, function(s) { state.f = s; }); var w = stream.current(); - return (w in wellKnownWords) ? wellKnownWords[w] : t; + return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t; }, blockCommentStart: "{-", @@ -248,3 +263,5 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) { }); CodeMirror.defineMIME("text/x-haskell", "haskell"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/haskell/index.html b/deploy/core/node_modules/codemirror/mode/haskell/index.html new file mode 100644 index 000000000..42240b0f2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/haskell/index.html @@ -0,0 +1,73 @@ + + +CodeMirror: Haskell mode + + + + + + + + + + + +
+

Haskell mode

+
+ + + +

MIME types defined: text/x-haskell.

+
diff --git a/deploy/core/node_modules/codemirror/modes/haxe.js b/deploy/core/node_modules/codemirror/mode/haxe/haxe.js similarity index 87% rename from deploy/core/node_modules/codemirror/modes/haxe.js rename to deploy/core/node_modules/codemirror/mode/haxe/haxe.js index cb761ad1c..d49ad70f9 100644 --- a/deploy/core/node_modules/codemirror/modes/haxe.js +++ b/deploy/core/node_modules/codemirror/mode/haxe/haxe.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("haxe", function(config, parserConfig) { var indentUnit = config.indentUnit; @@ -16,7 +29,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), "in": operator, "never": kw("property_access"), "trace":kw("trace"), - "class": type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, + "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, "true": atom, "false": atom, "null": atom }; }(); @@ -235,11 +248,12 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { poplex.lex = true; function expect(wanted) { - return function(type) { + function f(type) { if (type == wanted) return cont(); else if (wanted == ";") return pass(); - else return cont(arguments.callee); + else return cont(f); }; + return f; } function statement(type) { @@ -305,12 +319,13 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { function importdef (type, value) { if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } - else if(type == "variable" || type == "property" || type == ".") return cont(importdef); + else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef); } function typedef (type, value) { if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } + else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); } } function maybelabel(type) { @@ -422,8 +437,82 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { else return lexical.indented + (closing ? 0 : indentUnit); }, - electricChars: "{}" + electricChars: "{}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" }; }); CodeMirror.defineMIME("text/x-haxe", "haxe"); + +CodeMirror.defineMode("hxml", function () { + + return { + startState: function () { + return { + define: false, + inString: false + }; + }, + token: function (stream, state) { + var ch = stream.peek(); + var sol = stream.sol(); + + ///* comments */ + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + if (sol && ch == "-") { + var style = "variable-2"; + + stream.eat(/-/); + + if (stream.peek() == "-") { + stream.eat(/-/); + style = "keyword a"; + } + + if (stream.peek() == "D") { + stream.eat(/[D]/); + style = "keyword c"; + state.define = true; + } + + stream.eatWhile(/[A-Z]/i); + return style; + } + + var ch = stream.peek(); + + if (state.inString == false && ch == "'") { + state.inString = true; + ch = stream.next(); + } + + if (state.inString == true) { + if (stream.skipTo("'")) { + + } else { + stream.skipToEnd(); + } + + if (stream.peek() == "'") { + stream.next(); + state.inString = false; + } + + return "string"; + } + + stream.next(); + return null; + }, + lineComment: "#" + }; +}); + +CodeMirror.defineMIME("text/x-hxml", "hxml"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/haxe/index.html b/deploy/core/node_modules/codemirror/mode/haxe/index.html new file mode 100644 index 000000000..d415b5e10 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/haxe/index.html @@ -0,0 +1,124 @@ + + +CodeMirror: Haxe mode + + + + + + + + + +
+

Haxe mode

+ + +

+ +

Hxml mode:

+ +

+
+ + + +

MIME types defined: text/x-haxe, text/x-hxml.

+
diff --git a/deploy/core/node_modules/codemirror/modes/http.js b/deploy/core/node_modules/codemirror/mode/http/http.js similarity index 83% rename from deploy/core/node_modules/codemirror/modes/http.js rename to deploy/core/node_modules/codemirror/mode/http/http.js index 5a5163602..9a3c5f9fd 100644 --- a/deploy/core/node_modules/codemirror/modes/http.js +++ b/deploy/core/node_modules/codemirror/mode/http/http.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("http", function() { function failFirstLine(stream, state) { stream.skipToEnd(); @@ -96,3 +109,5 @@ CodeMirror.defineMode("http", function() { }); CodeMirror.defineMIME("message/http", "http"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/http/index.html b/deploy/core/node_modules/codemirror/mode/http/index.html new file mode 100644 index 000000000..0b8d5315d --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/http/index.html @@ -0,0 +1,45 @@ + + +CodeMirror: HTTP mode + + + + + + + + + +
+

HTTP mode

+ + +
+ + + +

MIME types defined: message/http.

+
diff --git a/deploy/core/node_modules/codemirror/mode/index.html b/deploy/core/node_modules/codemirror/mode/index.html new file mode 100644 index 000000000..bb656d2a7 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/index.html @@ -0,0 +1,125 @@ + + +CodeMirror: Language Modes + + + + + +
+ +

Language modes

+ +

This is a list of every mode in the distribution. Each mode lives +in a subdirectory of the mode/ directory, and typically +defines a single JavaScript file that implements the mode. Loading +such file will make the language available to CodeMirror, through +the mode +option.

+ +
+ +
+ +
diff --git a/deploy/core/node_modules/codemirror/mode/jade/index.html b/deploy/core/node_modules/codemirror/mode/jade/index.html new file mode 100644 index 000000000..e534981b2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/jade/index.html @@ -0,0 +1,70 @@ + + +CodeMirror: Jade Templating Mode + + + + + + + + + + + + + +
+

Jade Templating Mode

+
+ +

The Jade Templating Mode

+

Created by Forbes Lindesay. Managed as part of a Brackets extension at https://github.com/ForbesLindesay/jade-brackets.

+

MIME type defined: text/x-jade.

+
diff --git a/deploy/core/node_modules/codemirror/mode/jade/jade.js b/deploy/core/node_modules/codemirror/mode/jade/jade.js new file mode 100644 index 000000000..96fadb19e --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/jade/jade.js @@ -0,0 +1,590 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('jade', function (config) { + // token types + var KEYWORD = 'keyword'; + var DOCTYPE = 'meta'; + var ID = 'builtin'; + var CLASS = 'qualifier'; + + var ATTRS_NEST = { + '{': '}', + '(': ')', + '[': ']' + }; + + var jsMode = CodeMirror.getMode(config, 'javascript'); + + function State() { + this.javaScriptLine = false; + this.javaScriptLineExcludesColon = false; + + this.javaScriptArguments = false; + this.javaScriptArgumentsDepth = 0; + + this.isInterpolating = false; + this.interpolationNesting = 0; + + this.jsState = jsMode.startState(); + + this.restOfLine = ''; + + this.isIncludeFiltered = false; + this.isEach = false; + + this.lastTag = ''; + this.scriptType = ''; + + // Attributes Mode + this.isAttrs = false; + this.attrsNest = []; + this.inAttributeName = true; + this.attributeIsType = false; + this.attrValue = ''; + + // Indented Mode + this.indentOf = Infinity; + this.indentToken = ''; + + this.innerMode = null; + this.innerState = null; + + this.innerModeForLine = false; + } + /** + * Safely copy a state + * + * @return {State} + */ + State.prototype.copy = function () { + var res = new State(); + res.javaScriptLine = this.javaScriptLine; + res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon; + res.javaScriptArguments = this.javaScriptArguments; + res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; + res.isInterpolating = this.isInterpolating; + res.interpolationNesting = this.intpolationNesting; + + res.jsState = CodeMirror.copyState(jsMode, this.jsState); + + res.innerMode = this.innerMode; + if (this.innerMode && this.innerState) { + res.innerState = CodeMirror.copyState(this.innerMode, this.innerState); + } + + res.restOfLine = this.restOfLine; + + res.isIncludeFiltered = this.isIncludeFiltered; + res.isEach = this.isEach; + res.lastTag = this.lastTag; + res.scriptType = this.scriptType; + res.isAttrs = this.isAttrs; + res.attrsNest = this.attrsNest.slice(); + res.inAttributeName = this.inAttributeName; + res.attributeIsType = this.attributeIsType; + res.attrValue = this.attrValue; + res.indentOf = this.indentOf; + res.indentToken = this.indentToken; + + res.innerModeForLine = this.innerModeForLine; + + return res; + }; + + function javaScript(stream, state) { + if (stream.sol()) { + // if javaScriptLine was set at end of line, ignore it + state.javaScriptLine = false; + state.javaScriptLineExcludesColon = false; + } + if (state.javaScriptLine) { + if (state.javaScriptLineExcludesColon && stream.peek() === ':') { + state.javaScriptLine = false; + state.javaScriptLineExcludesColon = false; + return; + } + var tok = jsMode.token(stream, state.jsState); + if (stream.eol()) state.javaScriptLine = false; + return tok || true; + } + } + function javaScriptArguments(stream, state) { + if (state.javaScriptArguments) { + if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') { + state.javaScriptArguments = false; + return; + } + if (stream.peek() === '(') { + state.javaScriptArgumentsDepth++; + } else if (stream.peek() === ')') { + state.javaScriptArgumentsDepth--; + } + if (state.javaScriptArgumentsDepth === 0) { + state.javaScriptArguments = false; + return; + } + + var tok = jsMode.token(stream, state.jsState); + return tok || true; + } + } + + function yieldStatement(stream) { + if (stream.match(/^yield\b/)) { + return 'keyword'; + } + } + + function doctype(stream) { + if (stream.match(/^(?:doctype) *([^\n]+)?/)) { + return DOCTYPE; + } + } + + function interpolation(stream, state) { + if (stream.match('#{')) { + state.isInterpolating = true; + state.interpolationNesting = 0; + return 'punctuation'; + } + } + + function interpolationContinued(stream, state) { + if (state.isInterpolating) { + if (stream.peek() === '}') { + state.interpolationNesting--; + if (state.interpolationNesting < 0) { + stream.next(); + state.isInterpolating = false; + return 'puncutation'; + } + } else if (stream.peek() === '{') { + state.interpolationNesting++; + } + return jsMode.token(stream, state.jsState) || true; + } + } + + function caseStatement(stream, state) { + if (stream.match(/^case\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function when(stream, state) { + if (stream.match(/^when\b/)) { + state.javaScriptLine = true; + state.javaScriptLineExcludesColon = true; + return KEYWORD; + } + } + + function defaultStatement(stream) { + if (stream.match(/^default\b/)) { + return KEYWORD; + } + } + + function extendsStatement(stream, state) { + if (stream.match(/^extends?\b/)) { + state.restOfLine = 'string'; + return KEYWORD; + } + } + + function append(stream, state) { + if (stream.match(/^append\b/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + function prepend(stream, state) { + if (stream.match(/^prepend\b/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + function block(stream, state) { + if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + + function include(stream, state) { + if (stream.match(/^include\b/)) { + state.restOfLine = 'string'; + return KEYWORD; + } + } + + function includeFiltered(stream, state) { + if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) { + state.isIncludeFiltered = true; + return KEYWORD; + } + } + + function includeFilteredContinued(stream, state) { + if (state.isIncludeFiltered) { + var tok = filter(stream, state); + state.isIncludeFiltered = false; + state.restOfLine = 'string'; + return tok; + } + } + + function mixin(stream, state) { + if (stream.match(/^mixin\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function call(stream, state) { + if (stream.match(/^\+([-\w]+)/)) { + if (!stream.match(/^\( *[-\w]+ *=/, false)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + } + return 'variable'; + } + if (stream.match(/^\+#{/, false)) { + stream.next(); + state.mixinCallAfter = true; + return interpolation(stream, state); + } + } + function callArguments(stream, state) { + if (state.mixinCallAfter) { + state.mixinCallAfter = false; + if (!stream.match(/^\( *[-\w]+ *=/, false)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + } + return true; + } + } + + function conditional(stream, state) { + if (stream.match(/^(if|unless|else if|else)\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function each(stream, state) { + if (stream.match(/^(- *)?(each|for)\b/)) { + state.isEach = true; + return KEYWORD; + } + } + function eachContinued(stream, state) { + if (state.isEach) { + if (stream.match(/^ in\b/)) { + state.javaScriptLine = true; + state.isEach = false; + return KEYWORD; + } else if (stream.sol() || stream.eol()) { + state.isEach = false; + } else if (stream.next()) { + while (!stream.match(/^ in\b/, false) && stream.next()); + return 'variable'; + } + } + } + + function whileStatement(stream, state) { + if (stream.match(/^while\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function tag(stream, state) { + var captures; + if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) { + state.lastTag = captures[1].toLowerCase(); + if (state.lastTag === 'script') { + state.scriptType = 'application/javascript'; + } + return 'tag'; + } + } + + function filter(stream, state) { + if (stream.match(/^:([\w\-]+)/)) { + var innerMode; + if (config && config.innerModes) { + innerMode = config.innerModes(stream.current().substring(1)); + } + if (!innerMode) { + innerMode = stream.current().substring(1); + } + if (typeof innerMode === 'string') { + innerMode = CodeMirror.getMode(config, innerMode); + } + setInnerMode(stream, state, innerMode); + return 'atom'; + } + } + + function code(stream, state) { + if (stream.match(/^(!?=|-)/)) { + state.javaScriptLine = true; + return 'punctuation'; + } + } + + function id(stream) { + if (stream.match(/^#([\w-]+)/)) { + return ID; + } + } + + function className(stream) { + if (stream.match(/^\.([\w-]+)/)) { + return CLASS; + } + } + + function attrs(stream, state) { + if (stream.peek() == '(') { + stream.next(); + state.isAttrs = true; + state.attrsNest = []; + state.inAttributeName = true; + state.attrValue = ''; + state.attributeIsType = false; + return 'punctuation'; + } + } + + function attrsContinued(stream, state) { + if (state.isAttrs) { + if (ATTRS_NEST[stream.peek()]) { + state.attrsNest.push(ATTRS_NEST[stream.peek()]); + } + if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) { + state.attrsNest.pop(); + } else if (stream.eat(')')) { + state.isAttrs = false; + return 'punctuation'; + } + if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { + if (stream.peek() === '=' || stream.peek() === '!') { + state.inAttributeName = false; + state.jsState = jsMode.startState(); + if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { + state.attributeIsType = true; + } else { + state.attributeIsType = false; + } + } + return 'attribute'; + } + + var tok = jsMode.token(stream, state.jsState); + if (state.attributeIsType && tok === 'string') { + state.scriptType = stream.current().toString(); + } + if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) { + try { + Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, '')); + state.inAttributeName = true; + state.attrValue = ''; + stream.backUp(stream.current().length); + return attrsContinued(stream, state); + } catch (ex) { + //not the end of an attribute + } + } + state.attrValue += stream.current(); + return tok || true; + } + } + + function attributesBlock(stream, state) { + if (stream.match(/^&attributes\b/)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + return 'keyword'; + } + } + + function indent(stream) { + if (stream.sol() && stream.eatSpace()) { + return 'indent'; + } + } + + function comment(stream, state) { + if (stream.match(/^ *\/\/(-)?([^\n]*)/)) { + state.indentOf = stream.indentation(); + state.indentToken = 'comment'; + return 'comment'; + } + } + + function colon(stream) { + if (stream.match(/^: */)) { + return 'colon'; + } + } + + function text(stream, state) { + if (stream.match(/^(?:\| ?| )([^\n]+)/)) { + return 'string'; + } + if (stream.match(/^(<[^\n]*)/, false)) { + // html string + setInnerMode(stream, state, 'htmlmixed'); + state.innerModeForLine = true; + return innerMode(stream, state, true); + } + } + + function dot(stream, state) { + if (stream.eat('.')) { + var innerMode = null; + if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) { + innerMode = state.scriptType.toLowerCase().replace(/"|'/g, ''); + } else if (state.lastTag === 'style') { + innerMode = 'css'; + } + setInnerMode(stream, state, innerMode); + return 'dot'; + } + } + + function fail(stream) { + stream.next(); + return null; + } + + + function setInnerMode(stream, state, mode) { + mode = CodeMirror.mimeModes[mode] || mode; + mode = config.innerModes ? config.innerModes(mode) || mode : mode; + mode = CodeMirror.mimeModes[mode] || mode; + mode = CodeMirror.getMode(config, mode); + state.indentOf = stream.indentation(); + + if (mode && mode.name !== 'null') { + state.innerMode = mode; + } else { + state.indentToken = 'string'; + } + } + function innerMode(stream, state, force) { + if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { + if (state.innerMode) { + if (!state.innerState) { + state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {}; + } + return stream.hideFirstChars(state.indentOf + 2, function () { + return state.innerMode.token(stream, state.innerState) || true; + }); + } else { + stream.skipToEnd(); + return state.indentToken; + } + } else if (stream.sol()) { + state.indentOf = Infinity; + state.indentToken = null; + state.innerMode = null; + state.innerState = null; + } + } + function restOfLine(stream, state) { + if (stream.sol()) { + // if restOfLine was set at end of line, ignore it + state.restOfLine = ''; + } + if (state.restOfLine) { + stream.skipToEnd(); + var tok = state.restOfLine; + state.restOfLine = ''; + return tok; + } + } + + + function startState() { + return new State(); + } + function copyState(state) { + return state.copy(); + } + /** + * Get the next token in the stream + * + * @param {Stream} stream + * @param {State} state + */ + function nextToken(stream, state) { + var tok = innerMode(stream, state) + || restOfLine(stream, state) + || interpolationContinued(stream, state) + || includeFilteredContinued(stream, state) + || eachContinued(stream, state) + || attrsContinued(stream, state) + || javaScript(stream, state) + || javaScriptArguments(stream, state) + || callArguments(stream, state) + + || yieldStatement(stream, state) + || doctype(stream, state) + || interpolation(stream, state) + || caseStatement(stream, state) + || when(stream, state) + || defaultStatement(stream, state) + || extendsStatement(stream, state) + || append(stream, state) + || prepend(stream, state) + || block(stream, state) + || include(stream, state) + || includeFiltered(stream, state) + || mixin(stream, state) + || call(stream, state) + || conditional(stream, state) + || each(stream, state) + || whileStatement(stream, state) + || tag(stream, state) + || filter(stream, state) + || code(stream, state) + || id(stream, state) + || className(stream, state) + || attrs(stream, state) + || attributesBlock(stream, state) + || indent(stream, state) + || text(stream, state) + || comment(stream, state) + || colon(stream, state) + || dot(stream, state) + || fail(stream, state); + + return tok === true ? null : tok; + } + return { + startState: startState, + copyState: copyState, + token: nextToken + }; +}); + +CodeMirror.defineMIME('text/x-jade', 'jade'); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/jinja2/index.html b/deploy/core/node_modules/codemirror/mode/jinja2/index.html new file mode 100644 index 000000000..5a70e9153 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/jinja2/index.html @@ -0,0 +1,54 @@ + + +CodeMirror: Jinja2 mode + + + + + + + + + +
+

Jinja2 mode

+
+ +
diff --git a/deploy/core/node_modules/codemirror/mode/jinja2/jinja2.js b/deploy/core/node_modules/codemirror/mode/jinja2/jinja2.js new file mode 100644 index 000000000..ed195581c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/jinja2/jinja2.js @@ -0,0 +1,142 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("jinja2", function() { + var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif", + "extends", "filter", "endfilter", "firstof", "for", + "endfor", "if", "endif", "ifchanged", "endifchanged", + "ifequal", "endifequal", "ifnotequal", + "endifnotequal", "in", "include", "load", "not", "now", "or", + "parsed", "regroup", "reversed", "spaceless", + "endspaceless", "ssi", "templatetag", "openblock", + "closeblock", "openvariable", "closevariable", + "openbrace", "closebrace", "opencomment", + "closecomment", "widthratio", "url", "with", "endwith", + "get_current_language", "trans", "endtrans", "noop", "blocktrans", + "endblocktrans", "get_available_languages", + "get_current_language_bidi", "plural"], + operator = /^[+\-*&%=<>!?|~^]/, + sign = /^[:\[\(\{]/, + atom = ["true", "false"], + number = /^(\d[+\-\*\/])?\d+(\.\d+)?/; + + keywords = new RegExp("((" + keywords.join(")|(") + "))\\b"); + atom = new RegExp("((" + atom.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + var ch = stream.peek(); + + //Comment + if (state.incomment) { + if(!stream.skipTo("#}")) { + stream.skipToEnd(); + } else { + stream.eatWhile(/\#|}/); + state.incomment = false; + } + return "comment"; + //Tag + } else if (state.intag) { + //After operator + if(state.operator) { + state.operator = false; + if(stream.match(atom)) { + return "atom"; + } + if(stream.match(number)) { + return "number"; + } + } + //After sign + if(state.sign) { + state.sign = false; + if(stream.match(atom)) { + return "atom"; + } + if(stream.match(number)) { + return "number"; + } + } + + if(state.instring) { + if(ch == state.instring) { + state.instring = false; + } + stream.next(); + return "string"; + } else if(ch == "'" || ch == '"') { + state.instring = ch; + stream.next(); + return "string"; + } else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) { + state.intag = false; + return "tag"; + } else if(stream.match(operator)) { + state.operator = true; + return "operator"; + } else if(stream.match(sign)) { + state.sign = true; + } else { + if(stream.eat(" ") || stream.sol()) { + if(stream.match(keywords)) { + return "keyword"; + } + if(stream.match(atom)) { + return "atom"; + } + if(stream.match(number)) { + return "number"; + } + if(stream.sol()) { + stream.next(); + } + } else { + stream.next(); + } + + } + return "variable"; + } else if (stream.eat("{")) { + if (ch = stream.eat("#")) { + state.incomment = true; + if(!stream.skipTo("#}")) { + stream.skipToEnd(); + } else { + stream.eatWhile(/\#|}/); + state.incomment = false; + } + return "comment"; + //Open tag + } else if (ch = stream.eat(/\{|%/)) { + //Cache close tag + state.intag = ch; + if(ch == "{") { + state.intag = "}"; + } + stream.eat("-"); + return "tag"; + } + } + stream.next(); + }; + + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; + }); +}); diff --git a/deploy/core/node_modules/codemirror/mode/julia/index.html b/deploy/core/node_modules/codemirror/mode/julia/index.html new file mode 100644 index 000000000..e1492c210 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/julia/index.html @@ -0,0 +1,195 @@ + + +CodeMirror: Julia mode + + + + + + + + + +
+

Julia mode

+ +
+ + +

MIME types defined: text/x-julia.

+
diff --git a/deploy/core/node_modules/codemirror/modes/julia.js b/deploy/core/node_modules/codemirror/mode/julia/julia.js similarity index 71% rename from deploy/core/node_modules/codemirror/modes/julia.js rename to deploy/core/node_modules/codemirror/mode/julia/julia.js index c0e5902f3..e854988aa 100644 --- a/deploy/core/node_modules/codemirror/modes/julia.js +++ b/deploy/core/node_modules/codemirror/mode/julia/julia.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("julia", function(_conf, parserConf) { var ERRORCLASS = 'error'; @@ -5,20 +18,22 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return new RegExp("^((" + words.join(")|(") + "))\\b"); } - var operators = parserConf.operators || /^(?:[|&^\\%*+\-<>!=\/]=?|\?|~|:|$|<:|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|in|\.{3})/; + var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/; var delimiters = parserConf.delimiters || /^[;,()[\]{}]/; - var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*!*/; - var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch"]; + var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/; + var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"]; var blockClosers = ["end", "else", "elseif", "catch", "finally"]; - var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'in', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias']; - var builtinList = ['all', 'true', 'false', 'any', 'enumerate', 'open', 'close', 'linspace', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'error', 'warn', 'info']; + var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall']; + var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf']; //var stringPrefixes = new RegExp("^[br]?('|\")") - var stringPrefixes = /^[br]?('|"{3}|")/; + var stringPrefixes = /^(`|'|"{3}|([br]?"))/; var keywords = wordRegexp(keywordList); var builtins = wordRegexp(builtinList); var openers = wordRegexp(blockOpeners); var closers = wordRegexp(blockClosers); + var macro = /^@[_A-Za-z][_A-Za-z0-9]*/; + var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/; var indentInfo = null; function in_array(state) { @@ -42,14 +57,19 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { function tokenBase(stream, state) { // Handle scope changes var leaving_expr = state.leaving_expr; + if(stream.sol()) { + leaving_expr = false; + } state.leaving_expr = false; if(leaving_expr) { if(stream.match(/^'+/)) { return 'operator'; } - if(stream.match("...")) { - return 'operator'; - } + + } + + if(stream.match(/^\.{2,3}/)) { + return 'operator'; } if (stream.eatSpace()) { @@ -82,8 +102,12 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { state.leaving_expr=true; } + if(ch===')') { + state.leaving_expr = true; + } + var match; - if(match=stream.match(openers, false)) { + if(!in_array(state) && (match=stream.match(openers, false))) { state.scopes.push(match); } @@ -92,25 +116,29 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { } if(in_array(state)) { - if(stream.match("end")) { + if(stream.match(/^end/)) { return 'number'; } } - if(stream.match("=>")) { + + if(stream.match(/^=>/)) { return 'operator'; } + + // Handle Number Literals if (stream.match(/^[0-9\.]/, false)) { var imMatcher = RegExp(/^im\b/); var floatLiteral = false; // Floats - if (stream.match(/^\d*\.\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } + if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; } + if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; } if (stream.match(/^\.\d+/)) { floatLiteral = true; } if (floatLiteral) { // Float literals may be "imaginary" stream.match(imMatcher); + state.leaving_expr = true; return 'number'; } // Integers @@ -123,9 +151,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } // Decimal if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? intLiteral = true; } // Zero by itself with no other piece of number. @@ -133,20 +158,37 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { if (intLiteral) { // Integer literals may be "long" stream.match(imMatcher); + state.leaving_expr = true; return 'number'; } } + if(stream.match(/^(::)|(<:)/)) { + return 'operator'; + } + + // Handle symbols + if(!leaving_expr && stream.match(symbol)) { + return 'string'; + } + + // Handle operators and Delimiters + if (stream.match(operators)) { + return 'operator'; + } + + // Handle Strings if (stream.match(stringPrefixes)) { state.tokenize = tokenStringFactory(stream.current()); return state.tokenize(stream, state); } - // Handle operators and Delimiters - if (stream.match(operators)) { - return 'operator'; + if (stream.match(macro)) { + return 'meta'; } + + if (stream.match(delimiters)) { return null; } @@ -220,11 +262,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return style; } - // Handle macro calls - if (current === '@') { - return stream.match(identifiers, false) ? 'meta' : ERRORCLASS; - } - return style; } @@ -248,7 +285,7 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") { delta = -1; } - return (state.scopes.length + delta) * 2; + return (state.scopes.length + delta) * 4; }, lineComment: "#", @@ -260,3 +297,5 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { CodeMirror.defineMIME("text/x-julia", "julia"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/kotlin/index.html b/deploy/core/node_modules/codemirror/mode/kotlin/index.html new file mode 100644 index 000000000..859e109fb --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/kotlin/index.html @@ -0,0 +1,89 @@ + + +CodeMirror: Kotlin mode + + + + + + + + + +
+

Kotlin mode

+ + +
+ + +

Mode for Kotlin (http://kotlin.jetbrains.org/)

+

Developed by Hadi Hariri (https://github.com/hhariri).

+

MIME type defined: text/x-kotlin.

+
diff --git a/deploy/core/node_modules/codemirror/mode/kotlin/kotlin.js b/deploy/core/node_modules/codemirror/mode/kotlin/kotlin.js new file mode 100644 index 000000000..73c84f6c4 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/kotlin/kotlin.js @@ -0,0 +1,280 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("kotlin", function (config, parserConfig) { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var multiLineStrings = parserConfig.multiLineStrings; + + var keywords = words( + "package continue return object while break class data trait throw super" + + " when type this else This try val var fun for is in if do as true false null get set"); + var softKeywords = words("import" + + " where by get set abstract enum open annotation override private public internal" + + " protected catch out vararg inline finally final ref"); + var blockKeywords = words("catch class do else finally for if where try while enum"); + var atoms = words("null true false this"); + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + return startString(ch, stream, state); + } + // Wildcard import w/o trailing semicolon (import smth.*) + if (ch == "." && stream.eat("*")) { + return "word"; + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/\d/.test(ch)) { + if (stream.eat(/eE/)) { + stream.eat(/\+\-/); + stream.eatWhile(/\d/); + } + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize.push(tokenComment); + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + if (expectExpression(state.lastToken)) { + return startString(ch, stream, state); + } + } + // Commented + if (ch == "-" && stream.eat(">")) { + curPunc = "->"; + return null; + } + if (/[\-+*&%=<>!?|\/~]/.test(ch)) { + stream.eatWhile(/[\-+*&%=<>|~]/); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + + var cur = stream.current(); + if (atoms.propertyIsEnumerable(cur)) { + return "atom"; + } + if (softKeywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "softKeyword"; + } + + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + return "word"; + } + + tokenBase.isBase = true; + + function startString(quote, stream, state) { + var tripleQuoted = false; + if (quote != "/" && stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; + } + function t(stream, state) { + var escaped = false, next, end = !tripleQuoted; + + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + if (!tripleQuoted) { + break; + } + if (stream.match(quote + quote)) { + end = true; + break; + } + } + + if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { + state.tokenize.push(tokenBaseUntilBrace()); + return "string"; + } + + if (next == "$" && !escaped && !stream.eat(" ")) { + state.tokenize.push(tokenBaseUntilSpace()); + return "string"; + } + escaped = !escaped && next == "\\"; + } + if (multiLineStrings) + state.tokenize.push(t); + if (end) state.tokenize.pop(); + return "string"; + } + + state.tokenize.push(t); + return t(stream, state); + } + + function tokenBaseUntilBrace() { + var depth = 1; + + function t(stream, state) { + if (stream.peek() == "}") { + depth--; + if (depth == 0) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length - 1](stream, state); + } + } else if (stream.peek() == "{") { + depth++; + } + return tokenBase(stream, state); + } + + t.isBase = true; + return t; + } + + function tokenBaseUntilSpace() { + function t(stream, state) { + if (stream.eat(/[\w]/)) { + var isWord = stream.eatWhile(/[\w]/); + if (isWord) { + state.tokenize.pop(); + return "word"; + } + } + state.tokenize.pop(); + return "string"; + } + + t.isBase = true; + return t; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize.pop(); + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function expectExpression(last) { + return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || + last == "newstatement" || last == "keyword" || last == "proplabel"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function (basecolumn) { + return { + tokenize: [tokenBase], + context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), + indented: 0, + startOfLine: true, + lastToken: null + }; + }, + + token: function (stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + // Automatic semicolon insertion + if (ctx.type == "statement" && !expectExpression(state.lastToken)) { + popContext(state); + ctx = state.context; + } + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = state.tokenize[state.tokenize.length - 1](stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + // Handle indentation for {x -> \n ... } + else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { + popContext(state); + state.context.align = false; + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + state.lastToken = curPunc || style; + return style; + }, + + indent: function (state, textAfter) { + if (!state.tokenize[state.tokenize.length - 1].isBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; + if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") { + return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); + } + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : config.indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-kotlin", "kotlin"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/livescript/index.html b/deploy/core/node_modules/codemirror/mode/livescript/index.html new file mode 100644 index 000000000..f41547987 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/livescript/index.html @@ -0,0 +1,459 @@ + + +CodeMirror: LiveScript mode + + + + + + + + + + +
+

LiveScript mode

+
+ + +

MIME types defined: text/x-livescript.

+ +

The LiveScript mode was written by Kenneth Bentley.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/livescript.js b/deploy/core/node_modules/codemirror/mode/livescript/livescript.js similarity index 85% rename from deploy/core/node_modules/codemirror/modes/livescript.js rename to deploy/core/node_modules/codemirror/mode/livescript/livescript.js index c000324b8..55882efc3 100644 --- a/deploy/core/node_modules/codemirror/modes/livescript.js +++ b/deploy/core/node_modules/codemirror/mode/livescript/livescript.js @@ -1,19 +1,32 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Link to the project's GitHub page: * https://github.com/duralog/CodeMirror */ -(function() { + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + CodeMirror.defineMode('livescript', function(){ - var tokenBase, external; - tokenBase = function(stream, state){ - var next_rule, nr, i$, len$, r, m; - if (next_rule = state.next || 'start') { + var tokenBase = function(stream, state) { + var next_rule = state.next || "start"; + if (next_rule) { state.next = state.next; - if (Array.isArray(nr = Rules[next_rule])) { - for (i$ = 0, len$ = nr.length; i$ < len$; ++i$) { - r = nr[i$]; + var nr = Rules[next_rule]; + if (nr.splice) { + for (var i$ = 0; i$ < nr.length; ++i$) { + var r = nr[i$], m; if (r.regex && (m = stream.match(r.regex))) { - state.next = r.next; + state.next = r.next || state.next; return r.token; } } @@ -33,7 +46,7 @@ stream.next(); return 'error'; }; - external = { + var external = { startState: function(){ return { next: 'start', @@ -41,8 +54,8 @@ }; }, token: function(stream, state){ - var style; - style = tokenBase(stream, state); + while (stream.pos == stream.start) + var style = tokenBase(stream, state); state.lastToken = { style: style, indent: stream.indentation(), @@ -51,8 +64,7 @@ return style.replace(/\./g, ' '); }, indent: function(state){ - var indentation; - indentation = state.lastToken.indent; + var indentation = state.lastToken.indent; if (state.lastToken.content.match(indenter)) { indentation += 2; } @@ -192,7 +204,7 @@ next: 'start' }, { token: 'text', - regex: '.', + regex: '', next: 'start' } ], @@ -251,17 +263,18 @@ }; for (var idx in Rules) { var r = Rules[idx]; - if (Array.isArray(r)) { + if (r.splice) { for (var i = 0, len = r.length; i < len; ++i) { var rr = r[i]; - if (rr.regex) { + if (typeof rr.regex === 'string') { Rules[idx][i].regex = new RegExp('^' + rr.regex); } } - } else if (r.regex) { + } else if (typeof rr.regex === 'string') { Rules[idx].regex = new RegExp('^' + r.regex); } } -})(); -CodeMirror.defineMIME('text/x-livescript', 'livescript'); + CodeMirror.defineMIME('text/x-livescript', 'livescript'); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/lua/index.html b/deploy/core/node_modules/codemirror/mode/lua/index.html new file mode 100644 index 000000000..fc98b9446 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/lua/index.html @@ -0,0 +1,85 @@ + + +CodeMirror: Lua mode + + + + + + + + + + + +
+

Lua mode

+
+ + +

Loosely based on Franciszek + Wawrzak's CodeMirror + 1 mode. One configuration parameter is + supported, specials, to which you can provide an + array of strings to have those identifiers highlighted with + the lua-special style.

+

MIME types defined: text/x-lua.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/lua.js b/deploy/core/node_modules/codemirror/mode/lua/lua.js similarity index 92% rename from deploy/core/node_modules/codemirror/modes/lua.js rename to deploy/core/node_modules/codemirror/mode/lua/lua.js index b8deaa257..0b19abd30 100644 --- a/deploy/core/node_modules/codemirror/modes/lua.js +++ b/deploy/core/node_modules/codemirror/mode/lua/lua.js @@ -1,7 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's // CodeMirror 1 mode. // highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("lua", function(config, parserConfig) { var indentUnit = config.indentUnit; @@ -142,3 +155,5 @@ CodeMirror.defineMode("lua", function(config, parserConfig) { }); CodeMirror.defineMIME("text/x-lua", "lua"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/markdown/index.html b/deploy/core/node_modules/codemirror/mode/markdown/index.html new file mode 100644 index 000000000..c3bb8df9a --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/markdown/index.html @@ -0,0 +1,359 @@ + + +CodeMirror: Markdown mode + + + + + + + + + + + +
+

Markdown mode

+
+ + + +

Optionally depends on the XML mode for properly highlighted inline XML blocks.

+ +

MIME types defined: text/x-markdown.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/markdown.js b/deploy/core/node_modules/codemirror/mode/markdown/markdown.js similarity index 61% rename from deploy/core/node_modules/codemirror/modes/markdown.js rename to deploy/core/node_modules/codemirror/mode/markdown/markdown.js index bf1750d5b..3eb7747e6 100644 --- a/deploy/core/node_modules/codemirror/modes/markdown.js +++ b/deploy/core/node_modules/codemirror/mode/markdown/markdown.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror", require("../xml/xml"))); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { var htmlFound = CodeMirror.modes.hasOwnProperty("xml"); @@ -42,6 +55,16 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { }; }()); + // Should characters that affect highlighting be highlighted separate? + // Does not include characters that will be output (such as `1.` and `-` for lists) + if (modeCfg.highlightFormatting === undefined) + modeCfg.highlightFormatting = false; + + // Maximum number of nested blockquotes. Set to 0 for infinite nesting. + // Excess `>` will emit `error` token. + if (modeCfg.maxBlockquoteDepth === undefined) + modeCfg.maxBlockquoteDepth = 0; + // Should underscores in words open/close em/strong? if (modeCfg.underscoresBreakWords === undefined) modeCfg.underscoresBreakWords = true; @@ -56,13 +79,13 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { var header = 'header' , code = 'comment' - , quote1 = 'atom' - , quote2 = 'number' + , quote = 'quote' , list1 = 'variable-2' , list2 = 'variable-3' , list3 = 'keyword' , hr = 'hr' , image = 'tag' + , formatting = 'formatting' , linkinline = 'link' , linkemail = 'link' , linktext = 'link' @@ -74,8 +97,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { , ulRE = /^[*\-+]\s+/ , olRE = /^[0-9]+\.\s+/ , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE - , headerRE = /^(?:\={1,}|-{1,})$/ - , textRE = /^[^!\[\]*_\\<>` "'(]+/; + , atxHeaderRE = /^#+/ + , setextHeaderRE = /^(?:\={1,}|-{1,})$/ + , textRE = /^[^#!\[\]*_\\<>` "'(]+/; function switchInline(stream, state, f) { state.f = state.inline = f; @@ -113,6 +137,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { function blockNormal(stream, state) { + var sol = stream.sol(); + var prevLineIsList = (state.list !== false); if (state.list !== false && state.indentationDiff >= 0) { // Continued list if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block @@ -127,39 +153,58 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.listDepth = 0; } + var match = null; if (state.indentationDiff >= 4) { state.indentation -= 4; stream.skipToEnd(); return code; } else if (stream.eatSpace()) { return null; - } else if (stream.peek() === '#' || (state.prevLineHasContent && stream.match(headerRE)) ) { - state.header = true; + } else if (match = stream.match(atxHeaderRE)) { + state.header = match[0].length <= 6 ? match[0].length : 6; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); + } else if (state.prevLineHasContent && (match = stream.match(setextHeaderRE))) { + state.header = match[0].charAt(0) == '=' ? 1 : 2; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); } else if (stream.eat('>')) { state.indentation++; - state.quote = 1; + state.quote = sol ? 1 : state.quote + 1; + if (modeCfg.highlightFormatting) state.formatting = "quote"; stream.eatSpace(); - while (stream.eat('>')) { - stream.eatSpace(); - state.quote++; - } + return getType(state); } else if (stream.peek() === '[') { return switchInline(stream, state, footnoteLink); } else if (stream.match(hrRE, true)) { return hr; - } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, true) || stream.match(olRE, true))) { + } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { + var listType = null; + if (stream.match(ulRE, true)) { + listType = 'ul'; + } else { + stream.match(olRE, true); + listType = 'ol'; + } state.indentation += 4; state.list = true; state.listDepth++; if (modeCfg.taskLists && stream.match(taskListRE, false)) { state.taskList = true; } + state.f = state.inline; + if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; + return getType(state); } else if (modeCfg.fencedCodeBlocks && stream.match(/^```([\w+#]*)/, true)) { // try switching mode state.localMode = getMode(RegExp.$1); if (state.localMode) state.localState = state.localMode.startState(); switchBlock(stream, state, local); - return code; + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = true; + return getType(state); } return switchInline(stream, state, state.inline); @@ -167,14 +212,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { function htmlBlock(stream, state) { var style = htmlMode.token(stream, state.htmlState); - if (htmlFound && style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) { - state.f = inlineNormal; - state.block = blockNormal; - } - if (state.md_inside && stream.current().indexOf(">")!=-1) { + if ((htmlFound && state.htmlState.tagStart === null && !state.htmlState.context) || + (state.md_inside && stream.current().indexOf(">") > -1)) { state.f = inlineNormal; state.block = blockNormal; - state.htmlState.context = undefined; + state.htmlState = null; } return style; } @@ -184,7 +226,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.localMode = state.localState = null; state.f = inlineNormal; state.block = blockNormal; - return code; + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = true; + var returnType = getType(state); + state.code = false; + return returnType; } else if (state.localMode) { return state.localMode.token(stream, state.localState); } else { @@ -197,8 +243,43 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { function getType(state) { var styles = []; - if (state.taskOpen) { return "meta"; } - if (state.taskClosed) { return "property"; } + if (state.formatting) { + styles.push(formatting); + + if (typeof state.formatting === "string") state.formatting = [state.formatting]; + + for (var i = 0; i < state.formatting.length; i++) { + styles.push(formatting + "-" + state.formatting[i]); + + if (state.formatting[i] === "header") { + styles.push(formatting + "-" + state.formatting[i] + "-" + state.header); + } + + // Add `formatting-quote` and `formatting-quote-#` for blockquotes + // Add `error` instead if the maximum blockquote nesting depth is passed + if (state.formatting[i] === "quote") { + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote); + } else { + styles.push("error"); + } + } + } + } + + if (state.taskOpen) { + styles.push("meta"); + return styles.length ? styles.join(' ') : null; + } + if (state.taskClosed) { + styles.push("property"); + return styles.length ? styles.join(' ') : null; + } + + if (state.linkHref) { + styles.push(linkhref); + return styles.length ? styles.join(' ') : null; + } if (state.strong) { styles.push(strong); } if (state.em) { styles.push(em); } @@ -207,8 +288,19 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (state.code) { styles.push(code); } - if (state.header) { styles.push(header); } - if (state.quote) { styles.push(state.quote % 2 ? quote1 : quote2); } + if (state.header) { styles.push(header); styles.push(header + "-" + state.header); } + + if (state.quote) { + styles.push(quote); + + // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(quote + "-" + state.quote); + } else { + styles.push(quote + "-" + modeCfg.maxBlockquoteDepth); + } + } + if (state.list !== false) { var listMod = (state.listDepth - 1) % 3; if (!listMod) { @@ -250,6 +342,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { var taskOpen = stream.match(taskListRE, true)[1] !== "x"; if (taskOpen) state.taskOpen = true; else state.taskClosed = true; + if (modeCfg.highlightFormatting) state.formatting = "task"; state.taskList = false; return getType(state); } @@ -257,11 +350,22 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.taskOpen = false; state.taskClosed = false; + if (state.header && stream.match(/^#+$/, true)) { + if (modeCfg.highlightFormatting) state.formatting = "header"; + return getType(state); + } + + // Get sol() value now, before character is consumed + var sol = stream.sol(); + var ch = stream.next(); if (ch === '\\') { stream.next(); - return getType(state); + if (modeCfg.highlightFormatting) { + var type = getType(state); + return type ? type + " formatting-escape" : "formatting-escape"; + } } // Matches link titles present on next line @@ -280,6 +384,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { // If this block is changed, it may need to be updated in GFM mode if (ch === '`') { + var previousFormatting = state.formatting; + if (modeCfg.highlightFormatting) state.formatting = "code"; var t = getType(state); var before = stream.pos; stream.eatWhile('`'); @@ -293,6 +399,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.code = false; return t; } + state.formatting = previousFormatting; return getType(state); } } else if (state.code) { @@ -307,10 +414,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (ch === '[' && stream.match(/.*\](\(| ?\[)/, false)) { state.linkText = true; + if (modeCfg.highlightFormatting) state.formatting = "link"; return getType(state); } if (ch === ']' && state.linkText) { + if (modeCfg.highlightFormatting) state.formatting = "link"; var type = getType(state); state.linkText = false; state.inline = state.f = linkHref; @@ -318,21 +427,38 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { - return switchInline(stream, state, inlineElement(linkinline, '>')); + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + linkinline; } if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { - return switchInline(stream, state, inlineElement(linkemail, '>')); + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + linkemail; } if (ch === '<' && stream.match(/^\w/, false)) { - if (stream.string.indexOf(">")!=-1) { + if (stream.string.indexOf(">") != -1) { var atts = stream.string.substring(1,stream.string.indexOf(">")); if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) { state.md_inside = true; } } stream.backUp(1); + state.htmlState = CodeMirror.startState(htmlMode); return switchBlock(stream, state, htmlBlock); } @@ -353,19 +479,26 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } } } - var t = getType(state); if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { - if (state.strong === ch && stream.eat(ch)) { // Remove STRONG + if (sol && stream.peek() === ' ') { + // Do nothing, surrounded by newline and space + } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG + if (modeCfg.highlightFormatting) state.formatting = "strong"; + var t = getType(state); state.strong = false; return t; } else if (!state.strong && stream.eat(ch)) { // Add STRONG state.strong = ch; + if (modeCfg.highlightFormatting) state.formatting = "strong"; return getType(state); } else if (state.em === ch) { // Remove EM + if (modeCfg.highlightFormatting) state.formatting = "em"; + var t = getType(state); state.em = false; return t; } else if (!state.em) { // Add EM state.em = ch; + if (modeCfg.highlightFormatting) state.formatting = "em"; return getType(state); } } else if (ch === ' ') { @@ -389,6 +522,26 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return getType(state); } + function linkInline(stream, state) { + var ch = stream.next(); + + if (ch === ">") { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + linkinline; + } + + stream.match(/^[^>]+/, true); + + return linkinline; + } + function linkHref(stream, state) { // Check if space, and return NULL if so (to avoid marking the space) if(stream.eatSpace()){ @@ -396,19 +549,60 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } var ch = stream.next(); if (ch === '(' || ch === '[') { - return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']')); + state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]"); + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + state.linkHref = true; + return getType(state); } return 'error'; } + function getLinkHrefInside(endChar) { + return function(stream, state) { + var ch = stream.next(); + + if (ch === endChar) { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + var returnState = getType(state); + state.linkHref = false; + return returnState; + } + + if (stream.match(inlineRE(endChar), true)) { + stream.backUp(1); + } + + state.linkHref = true; + return getType(state); + }; + } + function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, true)) { - state.f = footnoteUrl; - return linktext; + if (stream.match(/^[^\]]*\]:/, false)) { + state.f = footnoteLinkInside; + stream.next(); // Consume [ + if (modeCfg.highlightFormatting) state.formatting = "link"; + state.linkText = true; + return getType(state); } return switchInline(stream, state, inlineNormal); } + function footnoteLinkInside(stream, state) { + if (stream.match(/^\]:/, true)) { + state.f = state.inline = footnoteUrl; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var returnType = getType(state); + state.linkText = false; + return returnType; + } + + stream.match(/^[^\]]+/, true); + + return linktext; + } + function footnoteUrl(stream, state) { // Check if space, and return NULL if so (to avoid marking the space) if(stream.eatSpace()){ @@ -438,16 +632,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return savedInlineRE[endChar]; } - function inlineElement(type, endChar, next) { - next = next || inlineNormal; - return function(stream, state) { - stream.match(inlineRE(endChar)); - state.inline = state.f = next; - return type; - }; - } - - return { + var mode = { startState: function() { return { f: blockNormal, @@ -456,17 +641,19 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { thisLineHasContent: false, block: blockNormal, - htmlState: CodeMirror.startState(htmlMode), + htmlState: null, indentation: 0, inline: inlineNormal, text: handleText, + formatting: false, linkText: false, + linkHref: false, linkTitle: false, em: false, strong: false, - header: false, + header: 0, taskList: false, list: false, listDepth: 0, @@ -484,7 +671,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { thisLineHasContent: s.thisLineHasContent, block: s.block, - htmlState: CodeMirror.copyState(htmlMode, s.htmlState), + htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), indentation: s.indentation, localMode: s.localMode, @@ -492,6 +679,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { inline: s.inline, text: s.text, + formatting: false, linkTitle: s.linkTitle, em: s.em, strong: s.strong, @@ -507,18 +695,25 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { }, token: function(stream, state) { + + // Reset state.formatting + state.formatting = false; + if (stream.sol()) { - if (stream.match(/^\s*$/, true)) { + var forceBlankLine = !!state.header; + + // Reset state.header + state.header = 0; + + if (stream.match(/^\s*$/, true) || forceBlankLine) { state.prevLineHasContent = false; - return blankLine(state); + blankLine(state); + return forceBlankLine ? this.token(stream, state) : null; } else { state.prevLineHasContent = state.thisLineHasContent; state.thisLineHasContent = true; } - // Reset state.header - state.header = false; - // Reset state.taskList state.taskList = false; @@ -538,14 +733,26 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.indentation = adjustedIndentation; if (indentation > 0) return null; } - return state.f(stream, state); + var result = state.f(stream, state); + if (stream.start == stream.pos) return this.token(stream, state); + else return result; + }, + + innerMode: function(state) { + if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; + if (state.localState) return {state: state.localState, mode: state.localMode}; + return {state: state, mode: mode}; }, blankLine: blankLine, - getType: getType - }; + getType: getType, + fold: "markdown" + }; + return mode; }, "xml"); CodeMirror.defineMIME("text/x-markdown", "markdown"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/markdown/test.js b/deploy/core/node_modules/codemirror/mode/markdown/test.js new file mode 100644 index 000000000..96ca1aefc --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/markdown/test.js @@ -0,0 +1,754 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); + function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } + + FT("formatting_emAsterisk", + "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); + + FT("formatting_emUnderscore", + "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"); + + FT("formatting_strongAsterisk", + "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"); + + FT("formatting_strongUnderscore", + "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"); + + FT("formatting_codeBackticks", + "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); + + FT("formatting_doubleBackticks", + "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); + + FT("formatting_atxHeader", + "[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"); + + FT("formatting_setextHeader", + "foo", + "[header&header-1&formatting&formatting-header&formatting-header-1 =]"); + + FT("formatting_blockquote", + "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"); + + FT("formatting_list", + "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"); + FT("formatting_list", + "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"); + + FT("formatting_link", + "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"); + + FT("formatting_linkReference", + "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]", + "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"); + + FT("formatting_linkWeb", + "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"); + + FT("formatting_linkEmail", + "[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"); + + FT("formatting_escape", + "[formatting-escape \\*]"); + + MT("plainText", + "foo"); + + // Don't style single trailing space + MT("trailingSpace1", + "foo "); + + // Two or more trailing spaces should be styled with line break character + MT("trailingSpace2", + "foo[trailing-space-a ][trailing-space-new-line ]"); + + MT("trailingSpace3", + "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"); + + MT("trailingSpace4", + "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"); + + // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) + MT("codeBlocksUsing4Spaces", + " [comment foo]"); + + // Code blocks using 4 spaces with internal indentation + MT("codeBlocksUsing4SpacesIndentation", + " [comment bar]", + " [comment hello]", + " [comment world]", + " [comment foo]", + "bar"); + + // Code blocks using 4 spaces with internal indentation + MT("codeBlocksUsing4SpacesIndentation", + " foo", + " [comment bar]", + " [comment hello]", + " [comment world]"); + + // Code blocks should end even after extra indented lines + MT("codeBlocksWithTrailingIndentedLine", + " [comment foo]", + " [comment bar]", + " [comment baz]", + " ", + "hello"); + + // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) + MT("codeBlocksUsing1Tab", + "\t[comment foo]"); + + // Inline code using backticks + MT("inlineCodeUsingBackticks", + "foo [comment `bar`]"); + + // Block code using single backtick (shouldn't work) + MT("blockCodeSingleBacktick", + "[comment `]", + "foo", + "[comment `]"); + + // Unclosed backticks + // Instead of simply marking as CODE, it would be nice to have an + // incomplete flag for CODE, that is styled slightly different. + MT("unclosedBackticks", + "foo [comment `bar]"); + + // Per documentation: "To include a literal backtick character within a + // code span, you can use multiple backticks as the opening and closing + // delimiters" + MT("doubleBackticks", + "[comment ``foo ` bar``]"); + + // Tests based on Dingus + // http://daringfireball.net/projects/markdown/dingus + // + // Multiple backticks within an inline code block + MT("consecutiveBackticks", + "[comment `foo```bar`]"); + + // Multiple backticks within an inline code block with a second code block + MT("consecutiveBackticks", + "[comment `foo```bar`] hello [comment `world`]"); + + // Unclosed with several different groups of backticks + MT("unclosedBackticks", + "[comment ``foo ``` bar` hello]"); + + // Closed with several different groups of backticks + MT("closedBackticks", + "[comment ``foo ``` bar` hello``] world"); + + // atx headers + // http://daringfireball.net/projects/markdown/syntax#header + + MT("atxH1", + "[header&header-1 # foo]"); + + MT("atxH2", + "[header&header-2 ## foo]"); + + MT("atxH3", + "[header&header-3 ### foo]"); + + MT("atxH4", + "[header&header-4 #### foo]"); + + MT("atxH5", + "[header&header-5 ##### foo]"); + + MT("atxH6", + "[header&header-6 ###### foo]"); + + // H6 - 7x '#' should still be H6, per Dingus + // http://daringfireball.net/projects/markdown/dingus + MT("atxH6NotH7", + "[header&header-6 ####### foo]"); + + // Inline styles should be parsed inside headers + MT("atxH1inline", + "[header&header-1 # foo ][header&header-1&em *bar*]"); + + // Setext headers - H1, H2 + // Per documentation, "Any number of underlining =’s or -’s will work." + // http://daringfireball.net/projects/markdown/syntax#header + // Ideally, the text would be marked as `header` as well, but this is + // not really feasible at the moment. So, instead, we're testing against + // what works today, to avoid any regressions. + // + // Check if single underlining = works + MT("setextH1", + "foo", + "[header&header-1 =]"); + + // Check if 3+ ='s work + MT("setextH1", + "foo", + "[header&header-1 ===]"); + + // Check if single underlining - works + MT("setextH2", + "foo", + "[header&header-2 -]"); + + // Check if 3+ -'s work + MT("setextH2", + "foo", + "[header&header-2 ---]"); + + // Single-line blockquote with trailing space + MT("blockquoteSpace", + "[quote"e-1 > foo]"); + + // Single-line blockquote + MT("blockquoteNoSpace", + "[quote"e-1 >foo]"); + + // No blank line before blockquote + MT("blockquoteNoBlankLine", + "foo", + "[quote"e-1 > bar]"); + + // Nested blockquote + MT("blockquoteSpace", + "[quote"e-1 > foo]", + "[quote"e-1 >][quote"e-2 > foo]", + "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"); + + // Single-line blockquote followed by normal paragraph + MT("blockquoteThenParagraph", + "[quote"e-1 >foo]", + "", + "bar"); + + // Multi-line blockquote (lazy mode) + MT("multiBlockquoteLazy", + "[quote"e-1 >foo]", + "[quote"e-1 bar]"); + + // Multi-line blockquote followed by normal paragraph (lazy mode) + MT("multiBlockquoteLazyThenParagraph", + "[quote"e-1 >foo]", + "[quote"e-1 bar]", + "", + "hello"); + + // Multi-line blockquote (non-lazy mode) + MT("multiBlockquote", + "[quote"e-1 >foo]", + "[quote"e-1 >bar]"); + + // Multi-line blockquote followed by normal paragraph (non-lazy mode) + MT("multiBlockquoteThenParagraph", + "[quote"e-1 >foo]", + "[quote"e-1 >bar]", + "", + "hello"); + + // Check list types + + MT("listAsterisk", + "foo", + "bar", + "", + "[variable-2 * foo]", + "[variable-2 * bar]"); + + MT("listPlus", + "foo", + "bar", + "", + "[variable-2 + foo]", + "[variable-2 + bar]"); + + MT("listDash", + "foo", + "bar", + "", + "[variable-2 - foo]", + "[variable-2 - bar]"); + + MT("listNumber", + "foo", + "bar", + "", + "[variable-2 1. foo]", + "[variable-2 2. bar]"); + + // Lists require a preceding blank line (per Dingus) + MT("listBogus", + "foo", + "1. bar", + "2. hello"); + + // List after header + MT("listAfterHeader", + "[header&header-1 # foo]", + "[variable-2 - bar]"); + + // Formatting in lists (*) + MT("listAsteriskFormatting", + "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); + + // Formatting in lists (+) + MT("listPlusFormatting", + "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); + + // Formatting in lists (-) + MT("listDashFormatting", + "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); + + // Formatting in lists (1.) + MT("listNumberFormatting", + "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", + "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", + "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", + "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); + + // Paragraph lists + MT("listParagraph", + "[variable-2 * foo]", + "", + "[variable-2 * bar]"); + + // Multi-paragraph lists + // + // 4 spaces + MT("listMultiParagraph", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [variable-2 hello]"); + + // 4 spaces, extra blank lines (should still be list, per Dingus) + MT("listMultiParagraphExtra", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + "", + " [variable-2 hello]"); + + // 4 spaces, plus 1 space (should still be list, per Dingus) + MT("listMultiParagraphExtraSpace", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [variable-2 hello]", + "", + " [variable-2 world]"); + + // 1 tab + MT("listTab", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + "\t[variable-2 hello]"); + + // No indent + MT("listNoIndent", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + "hello"); + + // Blockquote + MT("blockquote", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [variable-2"e"e-1 > hello]"); + + // Code block + MT("blockquoteCode", + "[variable-2 * foo]", + "", + "[variable-2 * bar]", + "", + " [comment > hello]", + "", + " [variable-2 world]"); + + // Code block followed by text + MT("blockquoteCodeText", + "[variable-2 * foo]", + "", + " [variable-2 bar]", + "", + " [comment hello]", + "", + " [variable-2 world]"); + + // Nested list + + MT("listAsteriskNested", + "[variable-2 * foo]", + "", + " [variable-3 * bar]"); + + MT("listPlusNested", + "[variable-2 + foo]", + "", + " [variable-3 + bar]"); + + MT("listDashNested", + "[variable-2 - foo]", + "", + " [variable-3 - bar]"); + + MT("listNumberNested", + "[variable-2 1. foo]", + "", + " [variable-3 2. bar]"); + + MT("listMixed", + "[variable-2 * foo]", + "", + " [variable-3 + bar]", + "", + " [keyword - hello]", + "", + " [variable-2 1. world]"); + + MT("listBlockquote", + "[variable-2 * foo]", + "", + " [variable-3 + bar]", + "", + " [quote"e-1&variable-3 > hello]"); + + MT("listCode", + "[variable-2 * foo]", + "", + " [variable-3 + bar]", + "", + " [comment hello]"); + + // Code with internal indentation + MT("listCodeIndentation", + "[variable-2 * foo]", + "", + " [comment bar]", + " [comment hello]", + " [comment world]", + " [comment foo]", + " [variable-2 bar]"); + + // List nesting edge cases + MT("listNested", + "[variable-2 * foo]", + "", + " [variable-3 * bar]", + "", + " [variable-2 hello]" + ); + MT("listNested", + "[variable-2 * foo]", + "", + " [variable-3 * bar]", + "", + " [variable-3 * foo]" + ); + + // Code followed by text + MT("listCodeText", + "[variable-2 * foo]", + "", + " [comment bar]", + "", + "hello"); + + // Following tests directly from official Markdown documentation + // http://daringfireball.net/projects/markdown/syntax#hr + + MT("hrSpace", + "[hr * * *]"); + + MT("hr", + "[hr ***]"); + + MT("hrLong", + "[hr *****]"); + + MT("hrSpaceDash", + "[hr - - -]"); + + MT("hrDashLong", + "[hr ---------------------------------------]"); + + // Inline link with title + MT("linkTitle", + "[link [[foo]]][string (http://example.com/ \"bar\")] hello"); + + // Inline link without title + MT("linkNoTitle", + "[link [[foo]]][string (http://example.com/)] bar"); + + // Inline link with image + MT("linkImage", + "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"); + + // Inline link with Em + MT("linkEm", + "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"); + + // Inline link with Strong + MT("linkStrong", + "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"); + + // Inline link with EmStrong + MT("linkEmStrong", + "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"); + + // Image with title + MT("imageTitle", + "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello"); + + // Image without title + MT("imageNoTitle", + "[tag ![[foo]]][string (http://example.com/)] bar"); + + // Image with asterisks + MT("imageAsterisks", + "[tag ![[*foo*]]][string (http://example.com/)] bar"); + + // Not a link. Should be normal text due to square brackets being used + // regularly in text, especially in quoted material, and no space is allowed + // between square brackets and parentheses (per Dingus). + MT("notALink", + "[[foo]] (bar)"); + + // Reference-style links + MT("linkReference", + "[link [[foo]]][string [[bar]]] hello"); + + // Reference-style links with Em + MT("linkReferenceEm", + "[link [[][link&em *foo*][link ]]][string [[bar]]] hello"); + + // Reference-style links with Strong + MT("linkReferenceStrong", + "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"); + + // Reference-style links with EmStrong + MT("linkReferenceEmStrong", + "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"); + + // Reference-style links with optional space separator (per docuentation) + // "You can optionally use a space to separate the sets of brackets" + MT("linkReferenceSpace", + "[link [[foo]]] [string [[bar]]] hello"); + + // Should only allow a single space ("...use *a* space...") + MT("linkReferenceDoubleSpace", + "[[foo]] [[bar]] hello"); + + // Reference-style links with implicit link name + MT("linkImplicit", + "[link [[foo]]][string [[]]] hello"); + + // @todo It would be nice if, at some point, the document was actually + // checked to see if the referenced link exists + + // Link label, for reference-style links (taken from documentation) + + MT("labelNoTitle", + "[link [[foo]]:] [string http://example.com/]"); + + MT("labelIndented", + " [link [[foo]]:] [string http://example.com/]"); + + MT("labelSpaceTitle", + "[link [[foo bar]]:] [string http://example.com/ \"hello\"]"); + + MT("labelDoubleTitle", + "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\""); + + MT("labelTitleDoubleQuotes", + "[link [[foo]]:] [string http://example.com/ \"bar\"]"); + + MT("labelTitleSingleQuotes", + "[link [[foo]]:] [string http://example.com/ 'bar']"); + + MT("labelTitleParenthese", + "[link [[foo]]:] [string http://example.com/ (bar)]"); + + MT("labelTitleInvalid", + "[link [[foo]]:] [string http://example.com/] bar"); + + MT("labelLinkAngleBrackets", + "[link [[foo]]:] [string \"bar\"]"); + + MT("labelTitleNextDoubleQuotes", + "[link [[foo]]:] [string http://example.com/]", + "[string \"bar\"] hello"); + + MT("labelTitleNextSingleQuotes", + "[link [[foo]]:] [string http://example.com/]", + "[string 'bar'] hello"); + + MT("labelTitleNextParenthese", + "[link [[foo]]:] [string http://example.com/]", + "[string (bar)] hello"); + + MT("labelTitleNextMixed", + "[link [[foo]]:] [string http://example.com/]", + "(bar\" hello"); + + MT("linkWeb", + "[link ] foo"); + + MT("linkWebDouble", + "[link ] foo [link ]"); + + MT("linkEmail", + "[link ] foo"); + + MT("linkEmailDouble", + "[link ] foo [link ]"); + + MT("emAsterisk", + "[em *foo*] bar"); + + MT("emUnderscore", + "[em _foo_] bar"); + + MT("emInWordAsterisk", + "foo[em *bar*]hello"); + + MT("emInWordUnderscore", + "foo[em _bar_]hello"); + + // Per documentation: "...surround an * or _ with spaces, it’ll be + // treated as a literal asterisk or underscore." + + MT("emEscapedBySpaceIn", + "foo [em _bar _ hello_] world"); + + MT("emEscapedBySpaceOut", + "foo _ bar[em _hello_]world"); + + MT("emEscapedByNewline", + "foo", + "_ bar[em _hello_]world"); + + // Unclosed emphasis characters + // Instead of simply marking as EM / STRONG, it would be nice to have an + // incomplete flag for EM and STRONG, that is styled slightly different. + MT("emIncompleteAsterisk", + "foo [em *bar]"); + + MT("emIncompleteUnderscore", + "foo [em _bar]"); + + MT("strongAsterisk", + "[strong **foo**] bar"); + + MT("strongUnderscore", + "[strong __foo__] bar"); + + MT("emStrongAsterisk", + "[em *foo][em&strong **bar*][strong hello**] world"); + + MT("emStrongUnderscore", + "[em _foo][em&strong __bar_][strong hello__] world"); + + // "...same character must be used to open and close an emphasis span."" + MT("emStrongMixed", + "[em _foo][em&strong **bar*hello__ world]"); + + MT("emStrongMixed", + "[em *foo][em&strong __bar_hello** world]"); + + // These characters should be escaped: + // \ backslash + // ` backtick + // * asterisk + // _ underscore + // {} curly braces + // [] square brackets + // () parentheses + // # hash mark + // + plus sign + // - minus sign (hyphen) + // . dot + // ! exclamation mark + + MT("escapeBacktick", + "foo \\`bar\\`"); + + MT("doubleEscapeBacktick", + "foo \\\\[comment `bar\\\\`]"); + + MT("escapeAsterisk", + "foo \\*bar\\*"); + + MT("doubleEscapeAsterisk", + "foo \\\\[em *bar\\\\*]"); + + MT("escapeUnderscore", + "foo \\_bar\\_"); + + MT("doubleEscapeUnderscore", + "foo \\\\[em _bar\\\\_]"); + + MT("escapeHash", + "\\# foo"); + + MT("doubleEscapeHash", + "\\\\# foo"); + + MT("escapeNewline", + "\\", + "[em *foo*]"); + + + // Tests to make sure GFM-specific things aren't getting through + + MT("taskList", + "[variable-2 * [ ]] bar]"); + + MT("fencedCodeBlocks", + "[comment ```]", + "foo", + "[comment ```]"); + + // Tests that require XML mode + + MT("xmlMode", + "[tag&bracket <][tag div][tag&bracket >]", + "*foo*", + "[tag&bracket <][tag http://github.com][tag&bracket />]", + "[tag&bracket ]", + "[link ]"); + + MT("xmlModeWithMarkdownInside", + "[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]", + "[em *foo*]", + "[link ]", + "[tag ]", + "[link ]", + "[tag&bracket <][tag div][tag&bracket >]", + "[tag&bracket ]"); + +})(); diff --git a/deploy/core/node_modules/codemirror/mode/meta.js b/deploy/core/node_modules/codemirror/mode/meta.js new file mode 100644 index 000000000..cee33e542 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/meta.js @@ -0,0 +1,144 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.modeInfo = [ + {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, + {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk"}, + {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, + {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "hpp", "h++"]}, + {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, + {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"]}, + {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]}, + {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"]}, + {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"]}, + {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher"}, + {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, + {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, + {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, + {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, + {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]}, + {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]}, + {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]}, + {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]}, + {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, + {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, + {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, + {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, + {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"]}, + {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, + {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, + {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm"}, + {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, + {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]}, + {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, + {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, + {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, + {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, + {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"]}, + {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"]}, + {name: "HTTP", mime: "message/http", mode: "http"}, + {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, + {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, + {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"]}, + {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], + mode: "javascript", ext: ["js"]}, + {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"]}, + {name: "JSON-LD", mime: "application/ld+json", mode: "javascript"}, + {name: "Jinja2", mime: "null", mode: "jinja2"}, + {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, + {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]}, + {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, + {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"]}, + {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, + {name: "Markdown (GitHub-flavour)", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, + {name: "mIRC", mime: "text/mirc", mode: "mirc"}, + {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, + {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, + {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, + {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, + {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx"}, + {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]}, + {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, + {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, + {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, + {name: "PEG.js", mime: "null", mode: "pegjs"}, + {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, + {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]}, + {name: "Pig", mime: "text/x-pig", mode: "pig"}, + {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]}, + {name: "PLSQL", mime: "text/x-plsql", mode: "sql"}, + {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"]}, + {name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]}, + {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]}, + {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]}, + {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"]}, + {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"]}, + {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"]}, + {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]}, + {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]}, + {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, + {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, + {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, + {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"]}, + {name: "Sieve", mime: "application/sieve", mode: "sieve"}, + {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim"}, + {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, + {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, + {name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"}, + {name: "Solr", mime: "text/x-solr", mode: "solr"}, + {name: "SPARQL", mime: "application/x-sparql-query", mode: "sparql", ext: ["sparql"]}, + {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, + {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"}, + {name: "sTeX", mime: "text/x-stex", mode: "stex"}, + {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"]}, + {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]}, + {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]}, + {name: "Textile", mime: "text/x-textile", mode: "textile"}, + {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, + {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, + {name: "TOML", mime: "text/x-toml", mode: "toml"}, + {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, + {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, + {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"]}, + {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, + {name: "VBScript", mime: "text/vbscript", mode: "vbscript"}, + {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, + {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, + {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"]}, + {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, + {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml"]}, + {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]} + ]; + // Ensure all modes have a mime property for backwards compatibility + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.mimes) info.mime = info.mimes[0]; + } + + CodeMirror.findModeByMIME = function(mime) { + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.mime == mime) return info; + if (info.mimes) for (var j = 0; j < info.mimes.length; j++) + if (info.mimes[j] == mime) return info; + } + }; + + CodeMirror.findModeByExtension = function(ext) { + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.ext) for (var j = 0; j < info.ext.length; j++) + if (info.ext[j] == ext) return info; + } + }; +}); diff --git a/deploy/core/node_modules/codemirror/mode/mirc/index.html b/deploy/core/node_modules/codemirror/mode/mirc/index.html new file mode 100644 index 000000000..fd2f34e4b --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/mirc/index.html @@ -0,0 +1,160 @@ + + +CodeMirror: mIRC mode + + + + + + + + + + +
+

mIRC mode

+
+ + +

MIME types defined: text/mirc.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/mirc.js b/deploy/core/node_modules/codemirror/mode/mirc/mirc.js similarity index 95% rename from deploy/core/node_modules/codemirror/modes/mirc.js rename to deploy/core/node_modules/codemirror/mode/mirc/mirc.js index fc88bc56f..f0d5c6ad5 100644 --- a/deploy/core/node_modules/codemirror/modes/mirc.js +++ b/deploy/core/node_modules/codemirror/mode/mirc/mirc.js @@ -1,4 +1,18 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + //mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMIME("text/mirc", "mirc"); CodeMirror.defineMode("mirc", function() { function parseWords(str) { @@ -175,3 +189,5 @@ CodeMirror.defineMode("mirc", function() { } }; }); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/mllike/index.html b/deploy/core/node_modules/codemirror/mode/mllike/index.html new file mode 100644 index 000000000..5923af8f8 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/mllike/index.html @@ -0,0 +1,179 @@ + + +CodeMirror: ML-like mode + + + + + + + + + + +
+

OCaml mode

+ + + + +

F# mode

+ + + + + +

MIME types defined: text/x-ocaml (OCaml) and text/x-fsharp (F#).

+
diff --git a/deploy/core/node_modules/codemirror/modes/ocaml.js b/deploy/core/node_modules/codemirror/mode/mllike/mllike.js similarity index 51% rename from deploy/core/node_modules/codemirror/modes/ocaml.js rename to deploy/core/node_modules/codemirror/mode/mllike/mllike.js index 32cbc0b7b..04ab1c98e 100644 --- a/deploy/core/node_modules/codemirror/modes/ocaml.js +++ b/deploy/core/node_modules/codemirror/mode/mllike/mllike.js @@ -1,14 +1,23 @@ -CodeMirror.defineMode('ocaml', function() { +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('mllike', function(_config, parserConfig) { var words = { - 'true': 'atom', - 'false': 'atom', 'let': 'keyword', 'rec': 'keyword', 'in': 'keyword', 'of': 'keyword', 'and': 'keyword', - 'succ': 'keyword', 'if': 'keyword', 'then': 'keyword', 'else': 'keyword', @@ -25,17 +34,19 @@ CodeMirror.defineMode('ocaml', function() { 'match': 'keyword', 'with': 'keyword', 'try': 'keyword', - 'raise': 'keyword', - 'begin': 'keyword', - 'end': 'keyword', 'open': 'builtin', - 'trace': 'builtin', 'ignore': 'builtin', - 'exit': 'builtin', - 'print_string': 'builtin', - 'print_endline': 'builtin' + 'begin': 'keyword', + 'end': 'keyword' }; + var extraWords = parserConfig.extraWords || {}; + for (var prop in extraWords) { + if (extraWords.hasOwnProperty(prop)) { + words[prop] = parserConfig.extraWords[prop]; + } + } + function tokenBase(stream, state) { var ch = stream.next(); @@ -58,6 +69,10 @@ CodeMirror.defineMode('ocaml', function() { stream.eatWhile(/\w/); return 'quote'; } + if (ch === '/' && parserConfig.slashComments && stream.eat('/')) { + stream.skipToEnd(); + return 'comment'; + } if (/\d/.test(ch)) { stream.eatWhile(/[\d]/); if (stream.eat('.')) { @@ -109,8 +124,82 @@ CodeMirror.defineMode('ocaml', function() { }, blockCommentStart: "(*", - blockCommentEnd: "*)" + blockCommentEnd: "*)", + lineComment: parserConfig.slashComments ? "//" : null }; }); -CodeMirror.defineMIME('text/x-ocaml', 'ocaml'); +CodeMirror.defineMIME('text/x-ocaml', { + name: 'mllike', + extraWords: { + 'succ': 'keyword', + 'trace': 'builtin', + 'exit': 'builtin', + 'print_string': 'builtin', + 'print_endline': 'builtin', + 'true': 'atom', + 'false': 'atom', + 'raise': 'keyword' + } +}); + +CodeMirror.defineMIME('text/x-fsharp', { + name: 'mllike', + extraWords: { + 'abstract': 'keyword', + 'as': 'keyword', + 'assert': 'keyword', + 'base': 'keyword', + 'class': 'keyword', + 'default': 'keyword', + 'delegate': 'keyword', + 'downcast': 'keyword', + 'downto': 'keyword', + 'elif': 'keyword', + 'exception': 'keyword', + 'extern': 'keyword', + 'finally': 'keyword', + 'global': 'keyword', + 'inherit': 'keyword', + 'inline': 'keyword', + 'interface': 'keyword', + 'internal': 'keyword', + 'lazy': 'keyword', + 'let!': 'keyword', + 'member' : 'keyword', + 'module': 'keyword', + 'namespace': 'keyword', + 'new': 'keyword', + 'null': 'keyword', + 'override': 'keyword', + 'private': 'keyword', + 'public': 'keyword', + 'return': 'keyword', + 'return!': 'keyword', + 'select': 'keyword', + 'static': 'keyword', + 'struct': 'keyword', + 'upcast': 'keyword', + 'use': 'keyword', + 'use!': 'keyword', + 'val': 'keyword', + 'when': 'keyword', + 'yield': 'keyword', + 'yield!': 'keyword', + + 'List': 'builtin', + 'Seq': 'builtin', + 'Map': 'builtin', + 'Set': 'builtin', + 'int': 'builtin', + 'string': 'builtin', + 'raise': 'builtin', + 'failwith': 'builtin', + 'not': 'builtin', + 'true': 'builtin', + 'false': 'builtin' + }, + slashComments: true +}); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/modelica/index.html b/deploy/core/node_modules/codemirror/mode/modelica/index.html new file mode 100644 index 000000000..408c3b17e --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/modelica/index.html @@ -0,0 +1,67 @@ + + +CodeMirror: Modelica mode + + + + + + + + + + + + +
+

Modelica mode

+ +
+ + + +

Simple mode that tries to handle Modelica as well as it can.

+ +

MIME types defined: text/x-modelica + (Modlica code).

+
diff --git a/deploy/core/node_modules/codemirror/mode/modelica/modelica.js b/deploy/core/node_modules/codemirror/mode/modelica/modelica.js new file mode 100644 index 000000000..77ec7a3c1 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/modelica/modelica.js @@ -0,0 +1,245 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Modelica support for CodeMirror, copyright (c) by Lennart Ochel + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +}) + +(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("modelica", function(config, parserConfig) { + + var indentUnit = config.indentUnit; + var keywords = parserConfig.keywords || {}; + var builtin = parserConfig.builtin || {}; + var atoms = parserConfig.atoms || {}; + + var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/; + var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/; + var isDigit = /[0-9]/; + var isNonDigit = /[_a-zA-Z]/; + + function tokenLineComment(stream, state) { + stream.skipToEnd(); + state.tokenize = null; + return "comment"; + } + + function tokenBlockComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == '"' && !escaped) { + state.tokenize = null; + state.sol = false; + break; + } + escaped = !escaped && ch == "\\"; + } + + return "string"; + } + + function tokenIdent(stream, state) { + stream.eatWhile(isDigit); + while (stream.eat(isDigit) || stream.eat(isNonDigit)) { } + + + var cur = stream.current(); + + if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++; + else if(state.sol && cur == "end" && state.level > 0) state.level--; + + state.tokenize = null; + state.sol = false; + + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + else if (builtin.propertyIsEnumerable(cur)) return "builtin"; + else if (atoms.propertyIsEnumerable(cur)) return "atom"; + else return "variable"; + } + + function tokenQIdent(stream, state) { + while (stream.eat(/[^']/)) { } + + state.tokenize = null; + state.sol = false; + + if(stream.eat("'")) + return "variable"; + else + return "error"; + } + + function tokenUnsignedNuber(stream, state) { + stream.eatWhile(isDigit); + if (stream.eat('.')) { + stream.eatWhile(isDigit); + } + if (stream.eat('e') || stream.eat('E')) { + if (!stream.eat('-')) + stream.eat('+'); + stream.eatWhile(isDigit); + } + + state.tokenize = null; + state.sol = false; + return "number"; + } + + // Interface + return { + startState: function() { + return { + tokenize: null, + level: 0, + sol: true + }; + }, + + token: function(stream, state) { + if(state.tokenize != null) { + return state.tokenize(stream, state); + } + + if(stream.sol()) { + state.sol = true; + } + + // WHITESPACE + if(stream.eatSpace()) { + state.tokenize = null; + return null; + } + + var ch = stream.next(); + + // LINECOMMENT + if(ch == '/' && stream.eat('/')) { + state.tokenize = tokenLineComment; + } + // BLOCKCOMMENT + else if(ch == '/' && stream.eat('*')) { + state.tokenize = tokenBlockComment; + } + // TWO SYMBOL TOKENS + else if(isDoubleOperatorChar.test(ch+stream.peek())) { + stream.next(); + state.tokenize = null; + return "operator"; + } + // SINGLE SYMBOL TOKENS + else if(isSingleOperatorChar.test(ch)) { + state.tokenize = null; + return "operator"; + } + // IDENT + else if(isNonDigit.test(ch)) { + state.tokenize = tokenIdent; + } + // Q-IDENT + else if(ch == "'" && stream.peek() && stream.peek() != "'") { + state.tokenize = tokenQIdent; + } + // STRING + else if(ch == '"') { + state.tokenize = tokenString; + } + // UNSIGNED_NUBER + else if(isDigit.test(ch)) { + state.tokenize = tokenUnsignedNuber; + } + // ERROR + else { + state.tokenize = null; + return "error"; + } + + return state.tokenize(stream, state); + }, + + indent: function(state, textAfter) { + if (state.tokenize != null) return CodeMirror.Pass; + + var level = state.level; + if(/(algorithm)/.test(textAfter)) level--; + if(/(equation)/.test(textAfter)) level--; + if(/(initial algorithm)/.test(textAfter)) level--; + if(/(initial equation)/.test(textAfter)) level--; + if(/(end)/.test(textAfter)) level--; + + if(level > 0) + return indentUnit*level; + else + return 0; + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i=0; i + +CodeMirror: NGINX mode + + + + + + + + + + + + + +
+

NGINX mode

+
+ + +

MIME types defined: text/nginx.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/nginx.js b/deploy/core/node_modules/codemirror/mode/nginx/nginx.js similarity index 95% rename from deploy/core/node_modules/codemirror/modes/nginx.js rename to deploy/core/node_modules/codemirror/mode/nginx/nginx.js index c98c8a1dd..135b9cc7f 100644 --- a/deploy/core/node_modules/codemirror/modes/nginx.js +++ b/deploy/core/node_modules/codemirror/mode/nginx/nginx.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("nginx", function(config) { function words(str) { @@ -161,3 +174,5 @@ CodeMirror.defineMode("nginx", function(config) { }); CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/ntriples/index.html b/deploy/core/node_modules/codemirror/mode/ntriples/index.html new file mode 100644 index 000000000..1355e7189 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/ntriples/index.html @@ -0,0 +1,45 @@ + + +CodeMirror: NTriples mode + + + + + + + + + +
+

NTriples mode

+
+ +
+ + +

MIME types defined: text/n-triples.

+
diff --git a/deploy/core/node_modules/codemirror/modes/ntriples.js b/deploy/core/node_modules/codemirror/mode/ntriples/ntriples.js similarity index 93% rename from deploy/core/node_modules/codemirror/modes/ntriples.js rename to deploy/core/node_modules/codemirror/mode/ntriples/ntriples.js index ed0cee34b..0524b1e8a 100644 --- a/deploy/core/node_modules/codemirror/modes/ntriples.js +++ b/deploy/core/node_modules/codemirror/mode/ntriples/ntriples.js @@ -1,3 +1,6 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /********************************************************** * This script provides syntax highlighting support for * the Ntriples format. @@ -25,6 +28,17 @@ -> ERROR } */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("ntriples", function() { var Location = { @@ -168,3 +182,5 @@ CodeMirror.defineMode("ntriples", function() { }); CodeMirror.defineMIME("text/n-triples", "ntriples"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/octave/index.html b/deploy/core/node_modules/codemirror/mode/octave/index.html new file mode 100644 index 000000000..79df58119 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/octave/index.html @@ -0,0 +1,83 @@ + + +CodeMirror: Octave mode + + + + + + + + + +
+

Octave mode

+ +
+ + +

MIME types defined: text/x-octave.

+
diff --git a/deploy/core/node_modules/codemirror/modes/octave.js b/deploy/core/node_modules/codemirror/mode/octave/octave.js similarity index 80% rename from deploy/core/node_modules/codemirror/modes/octave.js rename to deploy/core/node_modules/codemirror/mode/octave/octave.js index 23cd2fe22..a7bec030c 100644 --- a/deploy/core/node_modules/codemirror/modes/octave.js +++ b/deploy/core/node_modules/codemirror/mode/octave/octave.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("octave", function() { function wordRegexp(words) { return new RegExp("^((" + words.join(")|(") + "))\\b"); @@ -9,21 +22,23 @@ CodeMirror.defineMode("octave", function() { var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"); var tripleDelimiters = new RegExp("^((>>=)|(<<=))"); var expressionEnd = new RegExp("^[\\]\\)]"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); var builtins = wordRegexp([ 'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos', - 'cosh', 'exp', 'log', 'prod', 'log10', 'max', 'min', 'sign', 'sin', 'sinh', + 'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones', 'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov', 'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot', - 'title', 'xlabel', 'ylabel', 'legend', 'text', 'meshgrid', 'mesh', 'num2str' + 'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str', + 'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember' ]); var keywords = wordRegexp([ 'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction', 'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events', - 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'disp', 'until', 'continue' + 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until', + 'continue', 'pkg' ]); @@ -59,7 +74,7 @@ CodeMirror.defineMode("octave", function() { return 'comment'; } - if (stream.match(/^(%)|(\.\.\.)/)){ + if (stream.match(/^[%#]/)){ stream.skipToEnd(); return 'comment'; } @@ -116,3 +131,5 @@ CodeMirror.defineMode("octave", function() { }); CodeMirror.defineMIME("text/x-octave", "octave"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/pascal/index.html b/deploy/core/node_modules/codemirror/mode/pascal/index.html new file mode 100644 index 000000000..f8a99ad01 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/pascal/index.html @@ -0,0 +1,61 @@ + + +CodeMirror: Pascal mode + + + + + + + + + +
+

Pascal mode

+ + +
+ + + +

MIME types defined: text/x-pascal.

+
diff --git a/deploy/core/node_modules/codemirror/modes/pascal.js b/deploy/core/node_modules/codemirror/mode/pascal/pascal.js similarity index 84% rename from deploy/core/node_modules/codemirror/modes/pascal.js rename to deploy/core/node_modules/codemirror/mode/pascal/pascal.js index 09d9b0617..2d0c3d424 100644 --- a/deploy/core/node_modules/codemirror/modes/pascal.js +++ b/deploy/core/node_modules/codemirror/mode/pascal/pascal.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("pascal", function() { function words(str) { var obj = {}, words = str.split(" "); @@ -92,3 +105,5 @@ CodeMirror.defineMode("pascal", function() { }); CodeMirror.defineMIME("text/x-pascal", "pascal"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/pegjs/index.html b/deploy/core/node_modules/codemirror/mode/pegjs/index.html new file mode 100644 index 000000000..0c7460488 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/pegjs/index.html @@ -0,0 +1,66 @@ + + + + CodeMirror: PEG.js Mode + + + + + + + + + + + + +
+

PEG.js Mode

+
+ +

The PEG.js Mode

+

Created by Forbes Lindesay.

+
+ + diff --git a/deploy/core/node_modules/codemirror/mode/pegjs/pegjs.js b/deploy/core/node_modules/codemirror/mode/pegjs/pegjs.js new file mode 100644 index 000000000..306e3768c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/pegjs/pegjs.js @@ -0,0 +1,114 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../javascript/javascript")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../javascript/javascript"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("pegjs", function (config) { + var jsMode = CodeMirror.getMode(config, "javascript"); + + function identifier(stream) { + return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/); + } + + return { + startState: function () { + return { + inString: false, + stringType: null, + inComment: false, + inChracterClass: false, + braced: 0, + lhs: true, + localState: null + }; + }, + token: function (stream, state) { + if (stream) + + //check for state changes + if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) { + state.stringType = stream.peek(); + stream.next(); // Skip quote + state.inString = true; // Update state + } + if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { + state.inComment = true; + } + + //return state + if (state.inString) { + while (state.inString && !stream.eol()) { + if (stream.peek() === state.stringType) { + stream.next(); // Skip quote + state.inString = false; // Clear flag + } else if (stream.peek() === '\\') { + stream.next(); + stream.next(); + } else { + stream.match(/^.[^\\\"\']*/); + } + } + return state.lhs ? "property string" : "string"; // Token style + } else if (state.inComment) { + while (state.inComment && !stream.eol()) { + if (stream.match(/\*\//)) { + state.inComment = false; // Clear flag + } else { + stream.match(/^.[^\*]*/); + } + } + return "comment"; + } else if (state.inChracterClass) { + while (state.inChracterClass && !stream.eol()) { + if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { + state.inChracterClass = false; + } + } + } else if (stream.peek() === '[') { + stream.next(); + state.inChracterClass = true; + return 'bracket'; + } else if (stream.match(/^\/\//)) { + stream.skipToEnd(); + return "comment"; + } else if (state.braced || stream.peek() === '{') { + if (state.localState === null) { + state.localState = jsMode.startState(); + } + var token = jsMode.token(stream, state.localState); + var text = stream.current(); + if (!token) { + for (var i = 0; i < text.length; i++) { + if (text[i] === '{') { + state.braced++; + } else if (text[i] === '}') { + state.braced--; + } + }; + } + return token; + } else if (identifier(stream)) { + if (stream.peek() === ':') { + return 'variable'; + } + return 'variable-2'; + } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) { + stream.next(); + return 'bracket'; + } else if (!stream.eatSpace()) { + stream.next(); + } + return null; + } + }; +}, "javascript"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/perl/index.html b/deploy/core/node_modules/codemirror/mode/perl/index.html new file mode 100644 index 000000000..8c1021c42 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/perl/index.html @@ -0,0 +1,75 @@ + + +CodeMirror: Perl mode + + + + + + + + + +
+

Perl mode

+ + +
+ + + +

MIME types defined: text/x-perl.

+
diff --git a/deploy/core/node_modules/codemirror/modes/perl.js b/deploy/core/node_modules/codemirror/mode/perl/perl.js similarity index 92% rename from deploy/core/node_modules/codemirror/modes/perl.js rename to deploy/core/node_modules/codemirror/mode/perl/perl.js index 5954b1a61..311574e74 100644 --- a/deploy/core/node_modules/codemirror/modes/perl.js +++ b/deploy/core/node_modules/codemirror/mode/perl/perl.js @@ -1,5 +1,19 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) // This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("perl",function(){ // http://perldoc.perl.org var PERL={ // null - magic touch @@ -509,7 +523,7 @@ CodeMirror.defineMode("perl",function(){ return tokenSOMETHING(stream,state,'=cut');} var ch=stream.next(); if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n - if(stream.prefix(3)=="<<"+ch){ + if(prefix(stream, 3)=="<<"+ch){ var p=stream.pos; stream.eatWhile(/\w/); var n=stream.current().substr(1); @@ -518,94 +532,94 @@ CodeMirror.defineMode("perl",function(){ stream.pos=p;} return tokenChain(stream,state,[ch],"string");} if(ch=="q"){ - var c=stream.look(-2); + var c=look(stream, -2); if(!(c&&/\w/.test(c))){ - c=stream.look(0); + c=look(stream, 0); if(c=="x"){ - c=stream.look(1); + c=look(stream, 1); if(c=="("){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} if(c=="["){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} if(c=="{"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} if(c=="<"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} else if(c=="q"){ - c=stream.look(1); + c=look(stream, 1); if(c=="("){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[")"],"string");} if(c=="["){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["]"],"string");} if(c=="{"){ -stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["}"],"string");} if(c=="<"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[">"],"string");} if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],"string");}} else if(c=="w"){ - c=stream.look(1); + c=look(stream, 1); if(c=="("){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[")"],"bracket");} if(c=="["){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["]"],"bracket");} if(c=="{"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["}"],"bracket");} if(c=="<"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[">"],"bracket");} if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],"bracket");}} else if(c=="r"){ - c=stream.look(1); + c=look(stream, 1); if(c=="("){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} if(c=="["){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} if(c=="{"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} if(c=="<"){ - stream.eatSuffix(2); + eatSuffix(stream, 2); return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} else if(/[\^'"!~\/(\[{<]/.test(c)){ if(c=="("){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,[")"],"string");} if(c=="["){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,["]"],"string");} if(c=="{"){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,["}"],"string");} if(c=="<"){ - stream.eatSuffix(1); + eatSuffix(stream, 1); return tokenChain(stream,state,[">"],"string");} if(/[\^'"!~\/]/.test(c)){ return tokenChain(stream,state,[stream.eat(c)],"string");}}}} if(ch=="m"){ - var c=stream.look(-2); + var c=look(stream, -2); if(!(c&&/\w/.test(c))){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ @@ -620,7 +634,7 @@ stream.eatSuffix(2); if(c=="<"){ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} if(ch=="s"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); + var c=/[\/>\]})\w]/.test(look(stream, -2)); if(!c){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ @@ -634,7 +648,7 @@ stream.eatSuffix(2); return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} if(ch=="y"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); + var c=/[\/>\]})\w]/.test(look(stream, -2)); if(!c){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ @@ -648,7 +662,7 @@ stream.eatSuffix(2); return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} if(ch=="t"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); + var c=/[\/>\]})\w]/.test(look(stream, -2)); if(!c){ c=stream.eat("r");if(c){ c=stream.eat(/[(\[{<\^'"!~\/]/); @@ -665,7 +679,7 @@ stream.eatSuffix(2); if(ch=="`"){ return tokenChain(stream,state,[ch],"variable-2");} if(ch=="/"){ - if(!/~\s*$/.test(stream.prefix())) + if(!/~\s*$/.test(prefix(stream))) return "operator"; else return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} @@ -677,7 +691,7 @@ stream.eatSuffix(2); stream.pos=p;} if(/[$@%]/.test(ch)){ var p=stream.pos; - if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(stream.look(-2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ + if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ var c=stream.current(); if(PERL[c]) return "variable-2";} @@ -690,7 +704,7 @@ stream.eatSuffix(2); else return "variable";}} if(ch=="#"){ - if(stream.look(-2)!="$"){ + if(look(stream, -2)!="$"){ stream.skipToEnd(); return "comment";}} if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ @@ -702,23 +716,23 @@ stream.eatSuffix(2); stream.pos=p;} if(ch=="_"){ if(stream.pos==1){ - if(stream.suffix(6)=="_END__"){ + if(suffix(stream, 6)=="_END__"){ return tokenChain(stream,state,['\0'],"comment");} - else if(stream.suffix(7)=="_DATA__"){ + else if(suffix(stream, 7)=="_DATA__"){ return tokenChain(stream,state,['\0'],"variable-2");} - else if(stream.suffix(7)=="_C__"){ + else if(suffix(stream, 7)=="_C__"){ return tokenChain(stream,state,['\0'],"string");}}} if(/\w/.test(ch)){ var p=stream.pos; - if(stream.look(-2)=="{"&&(stream.look(0)=="}"||stream.eatWhile(/\w/)&&stream.look(0)=="}")) + if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}")) return "string"; else stream.pos=p;} if(/[A-Z]/.test(ch)){ - var l=stream.look(-2); + var l=look(stream, -2); var p=stream.pos; stream.eatWhile(/[A-Z_]/); - if(/[\da-z]/.test(stream.look(0))){ + if(/[\da-z]/.test(look(stream, 0))){ stream.pos=p;} else{ var c=PERL[stream.current()]; @@ -742,7 +756,7 @@ stream.eatSuffix(2); else return "meta";}} if(/[a-zA-Z_]/.test(ch)){ - var l=stream.look(-2); + var l=look(stream, -2); stream.eatWhile(/\w/); var c=PERL[stream.current()]; if(!c) @@ -774,43 +788,45 @@ stream.eatSuffix(2); style:null, tail:null};}, token:function(stream,state){ - return (state.tokenize||tokenPerl)(stream,state);}, - electricChars:"{}"};}); + return (state.tokenize||tokenPerl)(stream,state);} + };}); + +CodeMirror.registerHelper("wordChars", "perl", /[\w$]/); CodeMirror.defineMIME("text/x-perl", "perl"); // it's like "peek", but need for look-ahead or look-behind if index < 0 -CodeMirror.StringStream.prototype.look=function(c){ - return this.string.charAt(this.pos+(c||0));}; +function look(stream, c){ + return stream.string.charAt(stream.pos+(c||0)); +} // return a part of prefix of current stream from current position -CodeMirror.StringStream.prototype.prefix=function(c){ - if(c){ - var x=this.pos-c; - return this.string.substr((x>=0?x:0),c);} - else{ - return this.string.substr(0,this.pos-1);}}; +function prefix(stream, c){ + if(c){ + var x=stream.pos-c; + return stream.string.substr((x>=0?x:0),c);} + else{ + return stream.string.substr(0,stream.pos-1); + } +} // return a part of suffix of current stream from current position -CodeMirror.StringStream.prototype.suffix=function(c){ - var y=this.string.length; - var x=y-this.pos+1; - return this.string.substr(this.pos,(c&&c=(y=this.string.length-1)) - this.pos=y; - else - this.pos=x;}; +function eatSuffix(stream, c){ + var x=stream.pos+c; + var y; + if(x<=0) + stream.pos=0; + else if(x>=(y=stream.string.length-1)) + stream.pos=y; + else + stream.pos=x; +} + +}); diff --git a/deploy/core/node_modules/codemirror/mode/php/index.html b/deploy/core/node_modules/codemirror/mode/php/index.html new file mode 100644 index 000000000..adf6b1be2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/php/index.html @@ -0,0 +1,64 @@ + + +CodeMirror: PHP mode + + + + + + + + + + + + + + + +
+

PHP mode

+
+ + + +

Simple HTML/PHP mode based on + the C-like mode. Depends on XML, + JavaScript, CSS, HTMLMixed, and C-like modes.

+ +

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

+
diff --git a/deploy/core/node_modules/codemirror/mode/php/php.js b/deploy/core/node_modules/codemirror/mode/php/php.js new file mode 100644 index 000000000..e112d9112 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/php/php.js @@ -0,0 +1,226 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + // Helper for stringWithEscapes + function matchSequence(list, end) { + if (list.length == 0) return stringWithEscapes(end); + return function (stream, state) { + var patterns = list[0]; + for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) { + state.tokenize = matchSequence(list.slice(1), end); + return patterns[i][1]; + } + state.tokenize = stringWithEscapes(end); + return "string"; + }; + } + function stringWithEscapes(closing) { + return function(stream, state) { return stringWithEscapes_(stream, state, closing); }; + } + function stringWithEscapes_(stream, state, closing) { + // "Complex" syntax + if (stream.match("${", false) || stream.match("{$", false)) { + state.tokenize = null; + return "string"; + } + + // Simple syntax + if (stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) { + // After the variable name there may appear array or object operator. + if (stream.match("[", false)) { + // Match array operator + state.tokenize = matchSequence([ + [["[", null]], + [[/\d[\w\.]*/, "number"], + [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"], + [/[\w\$]+/, "variable"]], + [["]", null]] + ], closing); + } + if (stream.match(/\-\>\w/, false)) { + // Match object operator + state.tokenize = matchSequence([ + [["->", null]], + [[/[\w]+/, "variable"]] + ], closing); + } + return "variable-2"; + } + + var escaped = false; + // Normal string + while (!stream.eol() && + (escaped || (!stream.match("{$", false) && + !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) { + if (!escaped && stream.match(closing)) { + state.tokenize = null; + state.tokStack.pop(); state.tokStack.pop(); + break; + } + escaped = stream.next() == "\\" && !escaped; + } + return "string"; + } + + var phpKeywords = "abstract and array as break case catch class clone const continue declare default " + + "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + + "for foreach function global goto if implements interface instanceof namespace " + + "new or private protected public static switch throw trait try use var while xor " + + "die echo empty exit eval include include_once isset list require require_once return " + + "print unset __halt_compiler self static parent yield insteadof finally"; + var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; + var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; + CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); + CodeMirror.registerHelper("wordChars", "php", /[\w$]/); + + var phpConfig = { + name: "clike", + helperType: "php", + keywords: keywords(phpKeywords), + blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), + atoms: keywords(phpAtoms), + builtin: keywords(phpBuiltin), + multiLineStrings: true, + hooks: { + "$": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "variable-2"; + }, + "<": function(stream, state) { + if (stream.match(/<", false)) stream.next(); + return "comment"; + }, + "/": function(stream) { + if (stream.eat("/")) { + while (!stream.eol() && !stream.match("?>", false)) stream.next(); + return "comment"; + } + return false; + }, + '"': function(_stream, state) { + (state.tokStack || (state.tokStack = [])).push('"', 0); + state.tokenize = stringWithEscapes('"'); + return "string"; + }, + "{": function(_stream, state) { + if (state.tokStack && state.tokStack.length) + state.tokStack[state.tokStack.length - 1]++; + return false; + }, + "}": function(_stream, state) { + if (state.tokStack && state.tokStack.length > 0 && + !--state.tokStack[state.tokStack.length - 1]) { + state.tokenize = stringWithEscapes(state.tokStack[state.tokStack.length - 2]); + } + return false; + } + } + }; + + CodeMirror.defineMode("php", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, "text/html"); + var phpMode = CodeMirror.getMode(config, phpConfig); + + function dispatch(stream, state) { + var isPHP = state.curMode == phpMode; + if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null; + if (!isPHP) { + if (stream.match(/^<\?\w*/)) { + state.curMode = phpMode; + state.curState = state.php; + return "meta"; + } + if (state.pending == '"' || state.pending == "'") { + while (!stream.eol() && stream.next() != state.pending) {} + var style = "string"; + } else if (state.pending && stream.pos < state.pending.end) { + stream.pos = state.pending.end; + var style = state.pending.style; + } else { + var style = htmlMode.token(stream, state.curState); + } + if (state.pending) state.pending = null; + var cur = stream.current(), openPHP = cur.search(/<\?/), m; + if (openPHP != -1) { + if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0]; + else state.pending = {end: stream.pos, style: style}; + stream.backUp(cur.length - openPHP); + } + return style; + } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { + state.curMode = htmlMode; + state.curState = state.html; + return "meta"; + } else { + return phpMode.token(stream, state.curState); + } + } + + return { + startState: function() { + var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); + return {html: html, + php: php, + curMode: parserConfig.startOpen ? phpMode : htmlMode, + curState: parserConfig.startOpen ? php : html, + pending: null}; + }, + + copyState: function(state) { + var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), + php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; + if (state.curMode == htmlMode) cur = htmlNew; + else cur = phpNew; + return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, + pending: state.pending}; + }, + + token: dispatch, + + indent: function(state, textAfter) { + if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || + (state.curMode == phpMode && /^\?>/.test(textAfter))) + return htmlMode.indent(state.html, textAfter); + return state.curMode.indent(state.curState, textAfter); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//", + + innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } + }; + }, "htmlmixed", "clike"); + + CodeMirror.defineMIME("application/x-httpd-php", "php"); + CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); + CodeMirror.defineMIME("text/x-php", phpConfig); +}); diff --git a/deploy/core/node_modules/codemirror/mode/php/test.js b/deploy/core/node_modules/codemirror/mode/php/test.js new file mode 100644 index 000000000..e2ecefc18 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/php/test.js @@ -0,0 +1,154 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "php"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT('simple_test', + '[meta ]'); + + MT('variable_interpolation_non_alphanumeric', + '[meta $/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]', + '[meta ?>]'); + + MT('variable_interpolation_digits', + '[meta ]'); + + MT('variable_interpolation_simple_syntax_1', + '[meta ]'); + + MT('variable_interpolation_simple_syntax_2', + '[meta ]'); + + MT('variable_interpolation_simple_syntax_3', + '[meta [variable aaaaa][string .aaaaaa"];', + '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];', + '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];', + '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];', + '[meta ?>]'); + + MT('variable_interpolation_escaping', + '[meta aaa.aaa"];', + '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];', + '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];', + '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];', + '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];', + '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];', + '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];', + '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];', + '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];', + '[meta ?>]'); + + MT('variable_interpolation_complex_syntax_1', + '[meta aaa.aaa"];', + '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];', + '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];', + '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'); + + MT('variable_interpolation_complex_syntax_2', + '[meta } $aaaaaa.aaa"];', + '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];', + '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];'); + + + function build_recursive_monsters(nt, t, n){ + var monsters = [t]; + for (var i = 1; i <= n; ++i) + monsters[i] = nt.join(monsters[i - 1]); + return monsters; + } + + var m1 = build_recursive_monsters( + ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'], + '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]', + 10 + ); + + MT('variable_interpolation_complex_syntax_3_1', + '[meta ]'); + + var m2 = build_recursive_monsters( + ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'], + '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', + 5 + ); + + MT('variable_interpolation_complex_syntax_3_2', + '[meta ]'); + + function build_recursive_monsters_2(mf1, mf2, nt, t, n){ + var monsters = [t]; + for (var i = 1; i <= n; ++i) + monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3]; + return monsters; + } + + var m3 = build_recursive_monsters_2( + m1, + m2, + ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'], + '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', + 4 + ); + + MT('variable_interpolation_complex_syntax_3_3', + '[meta ]'); + + MT("variable_interpolation_heredoc", + "[meta + +CodeMirror: Pig Latin mode + + + + + + + + + +
+

Pig Latin mode

+
+ + + +

+ Simple mode that handles Pig Latin language. +

+ +

MIME type defined: text/x-pig + (PIG code) + +

diff --git a/deploy/core/node_modules/codemirror/modes/pig.js b/deploy/core/node_modules/codemirror/mode/pig/pig.js similarity index 90% rename from deploy/core/node_modules/codemirror/modes/pig.js rename to deploy/core/node_modules/codemirror/mode/pig/pig.js index c2f611a1a..c74b2cc86 100644 --- a/deploy/core/node_modules/codemirror/modes/pig.js +++ b/deploy/core/node_modules/codemirror/mode/pig/pig.js @@ -1,9 +1,22 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* * Pig Latin Mode for CodeMirror 2 * @author Prasanth Jayachandran * @link https://github.com/prasanthj/pig-codemirror-2 * This implementation is adapted from PL/SQL mode in CodeMirror 2. */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("pig", function(_config, parserConfig) { var keywords = parserConfig.keywords, builtins = parserConfig.builtins, @@ -157,7 +170,7 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) { + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " - + "NEQ MATCHES TRUE FALSE "; + + "NEQ MATCHES TRUE FALSE DUMP"; // data types var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP "; @@ -168,4 +181,8 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) { keywords: keywords(pKeywords), types: keywords(pTypes) }); + + CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" ")); }()); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/properties/index.html b/deploy/core/node_modules/codemirror/mode/properties/index.html new file mode 100644 index 000000000..f885302de --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/properties/index.html @@ -0,0 +1,53 @@ + + +CodeMirror: Properties files mode + + + + + + + + + +
+

Properties files mode

+
+ + +

MIME types defined: text/x-properties, + text/x-ini.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/properties.js b/deploy/core/node_modules/codemirror/mode/properties/properties.js similarity index 78% rename from deploy/core/node_modules/codemirror/modes/properties.js rename to deploy/core/node_modules/codemirror/mode/properties/properties.js index d3a13c765..074008420 100644 --- a/deploy/core/node_modules/codemirror/modes/properties.js +++ b/deploy/core/node_modules/codemirror/mode/properties/properties.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("properties", function() { return { token: function(stream, state) { @@ -61,3 +74,5 @@ CodeMirror.defineMode("properties", function() { CodeMirror.defineMIME("text/x-properties", "properties"); CodeMirror.defineMIME("text/x-ini", "properties"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/puppet/index.html b/deploy/core/node_modules/codemirror/mode/puppet/index.html new file mode 100644 index 000000000..5614c3695 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/puppet/index.html @@ -0,0 +1,121 @@ + + +CodeMirror: Puppet mode + + + + + + + + + + +
+

Puppet mode

+
+ + +

MIME types defined: text/x-puppet.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/puppet/puppet.js b/deploy/core/node_modules/codemirror/mode/puppet/puppet.js new file mode 100644 index 000000000..b407ded88 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/puppet/puppet.js @@ -0,0 +1,220 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("puppet", function () { + // Stores the words from the define method + var words = {}; + // Taken, mostly, from the Puppet official variable standards regex + var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/; + + // Takes a string of words separated by spaces and adds them as + // keys with the value of the first argument 'style' + function define(style, string) { + var split = string.split(' '); + for (var i = 0; i < split.length; i++) { + words[split[i]] = style; + } + } + + // Takes commonly known puppet types/words and classifies them to a style + define('keyword', 'class define site node include import inherits'); + define('keyword', 'case if else in and elsif default or'); + define('atom', 'false true running present absent file directory undef'); + define('builtin', 'action augeas burst chain computer cron destination dport exec ' + + 'file filebucket group host icmp iniface interface jump k5login limit log_level ' + + 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' + + 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' + + 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' + + 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' + + 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' + + 'resources router schedule scheduled_task selboolean selmodule service source ' + + 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' + + 'user vlan yumrepo zfs zone zpool'); + + // After finding a start of a string ('|") this function attempts to find the end; + // If a variable is encountered along the way, we display it differently when it + // is encapsulated in a double-quoted string. + function tokenString(stream, state) { + var current, prev, found_var = false; + while (!stream.eol() && (current = stream.next()) != state.pending) { + if (current === '$' && prev != '\\' && state.pending == '"') { + found_var = true; + break; + } + prev = current; + } + if (found_var) { + stream.backUp(1); + } + if (current == state.pending) { + state.continueString = false; + } else { + state.continueString = true; + } + return "string"; + } + + // Main function + function tokenize(stream, state) { + // Matches one whole word + var word = stream.match(/[\w]+/, false); + // Matches attributes (i.e. ensure => present ; 'ensure' would be matched) + var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false); + // Matches non-builtin resource declarations + // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched) + var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false); + // Matches virtual and exported resources (i.e. @@user { ; and the like) + var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false); + + // Finally advance the stream + var ch = stream.next(); + + // Have we found a variable? + if (ch === '$') { + if (stream.match(variable_regex)) { + // If so, and its in a string, assign it a different color + return state.continueString ? 'variable-2' : 'variable'; + } + // Otherwise return an invalid variable + return "error"; + } + // Should we still be looking for the end of a string? + if (state.continueString) { + // If so, go through the loop again + stream.backUp(1); + return tokenString(stream, state); + } + // Are we in a definition (class, node, define)? + if (state.inDefinition) { + // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched) + if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) { + return 'def'; + } + // Match the rest it the next time around + stream.match(/\s+{/); + state.inDefinition = false; + } + // Are we in an 'include' statement? + if (state.inInclude) { + // Match and return the included class + stream.match(/(\s+)?\S+(\s+)?/); + state.inInclude = false; + return 'def'; + } + // Do we just have a function on our hands? + // In 'ensure_resource("myclass")', 'ensure_resource' is matched + if (stream.match(/(\s+)?\w+\(/)) { + stream.backUp(1); + return 'def'; + } + // Have we matched the prior attribute regex? + if (attribute) { + stream.match(/(\s+)?\w+/); + return 'tag'; + } + // Do we have Puppet specific words? + if (word && words.hasOwnProperty(word)) { + // Negates the initial next() + stream.backUp(1); + // Acutally move the stream + stream.match(/[\w]+/); + // We want to process these words differently + // do to the importance they have in Puppet + if (stream.match(/\s+\S+\s+{/, false)) { + state.inDefinition = true; + } + if (word == 'include') { + state.inInclude = true; + } + // Returns their value as state in the prior define methods + return words[word]; + } + // Is there a match on a reference? + if (/(\s+)?[A-Z]/.test(word)) { + // Negate the next() + stream.backUp(1); + // Match the full reference + stream.match(/(\s+)?[A-Z][\w:_]+/); + return 'def'; + } + // Have we matched the prior resource regex? + if (resource) { + stream.match(/(\s+)?[\w:_]+/); + return 'def'; + } + // Have we matched the prior special_resource regex? + if (special_resource) { + stream.match(/(\s+)?[@]{1,2}/); + return 'special'; + } + // Match all the comments. All of them. + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + // Have we found a string? + if (ch == "'" || ch == '"') { + // Store the type (single or double) + state.pending = ch; + // Perform the looping function to find the end + return tokenString(stream, state); + } + // Match all the brackets + if (ch == '{' || ch == '}') { + return 'bracket'; + } + // Match characters that we are going to assume + // are trying to be regex + if (ch == '/') { + stream.match(/.*?\//); + return 'variable-3'; + } + // Match all the numbers + if (ch.match(/[0-9]/)) { + stream.eatWhile(/[0-9]+/); + return 'number'; + } + // Match the '=' and '=>' operators + if (ch == '=') { + if (stream.peek() == '>') { + stream.next(); + } + return "operator"; + } + // Keep advancing through all the rest + stream.eatWhile(/[\w-]/); + // Return a blank line for everything else + return null; + } + // Start it all + return { + startState: function () { + var state = {}; + state.inDefinition = false; + state.inInclude = false; + state.continueString = false; + state.pending = false; + return state; + }, + token: function (stream, state) { + // Strip the spaces, but regex will account for them eitherway + if (stream.eatSpace()) return null; + // Go through the main process + return tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/x-puppet", "puppet"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/q/index.html b/deploy/core/node_modules/codemirror/mode/q/index.html new file mode 100644 index 000000000..72785ba3b --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/q/index.html @@ -0,0 +1,144 @@ + + +CodeMirror: Q mode + + + + + + + + + + +
+

Q mode

+ + +
+ + + +

MIME type defined: text/x-q.

+
diff --git a/deploy/core/node_modules/codemirror/modes/q.js b/deploy/core/node_modules/codemirror/mode/q/q.js similarity index 93% rename from deploy/core/node_modules/codemirror/modes/q.js rename to deploy/core/node_modules/codemirror/mode/q/q.js index 56017e30a..a4af9383e 100644 --- a/deploy/core/node_modules/codemirror/modes/q.js +++ b/deploy/core/node_modules/codemirror/mode/q/q.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("q",function(config){ var indentUnit=config.indentUnit, curPunc, @@ -122,3 +135,5 @@ CodeMirror.defineMode("q",function(config){ }; }); CodeMirror.defineMIME("text/x-q","q"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/r/index.html b/deploy/core/node_modules/codemirror/mode/r/index.html new file mode 100644 index 000000000..6dd963465 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/r/index.html @@ -0,0 +1,85 @@ + + +CodeMirror: R mode + + + + + + + + + +
+

R mode

+
+ + +

MIME types defined: text/x-rsrc.

+ +

Development of the CodeMirror R mode was kindly sponsored + by Ubalo.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/r.js b/deploy/core/node_modules/codemirror/mode/r/r.js similarity index 86% rename from deploy/core/node_modules/codemirror/modes/r.js rename to deploy/core/node_modules/codemirror/mode/r/r.js index 6410efbb2..1ab4a9565 100644 --- a/deploy/core/node_modules/codemirror/modes/r.js +++ b/deploy/core/node_modules/codemirror/mode/r/r.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("r", function(config) { function wordObj(str) { var words = str.split(" "), res = {}; @@ -36,7 +49,11 @@ CodeMirror.defineMode("r", function(config) { var word = stream.current(); if (atoms.propertyIsEnumerable(word)) return "atom"; if (keywords.propertyIsEnumerable(word)) { - if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block"; + // Block keywords start new blocks, except 'else if', which only starts + // one new block for the 'if', no block for the 'else'. + if (blockkeywords.propertyIsEnumerable(word) && + !stream.match(/\s*if(\s+|$)/, false)) + curPunc = "block"; return "keyword"; } if (builtins.propertyIsEnumerable(word)) return "builtin"; @@ -134,8 +151,12 @@ CodeMirror.defineMode("r", function(config) { if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); else if (ctx.align) return ctx.column + (closing ? 0 : 1); else return ctx.indent + (closing ? 0 : config.indentUnit); - } + }, + + lineComment: "#" }; }); CodeMirror.defineMIME("text/x-rsrc", "r"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/rpm/changes/index.html b/deploy/core/node_modules/codemirror/mode/rpm/changes/index.html new file mode 100644 index 000000000..6e5031bd1 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/rpm/changes/index.html @@ -0,0 +1,66 @@ + + +CodeMirror: RPM changes mode + + + + + + + + + + + +
+

RPM changes mode

+ +
+ + +

MIME types defined: text/x-rpm-changes.

+
diff --git a/deploy/core/node_modules/codemirror/mode/rpm/index.html b/deploy/core/node_modules/codemirror/mode/rpm/index.html new file mode 100644 index 000000000..9a34e6dfb --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/rpm/index.html @@ -0,0 +1,149 @@ + + +CodeMirror: RPM changes mode + + + + + + + + + + + +
+

RPM changes mode

+ +
+ + +

RPM spec mode

+ +
+ + +

MIME types defined: text/x-rpm-spec, text/x-rpm-changes.

+
diff --git a/deploy/core/node_modules/codemirror/mode/rpm/rpm.js b/deploy/core/node_modules/codemirror/mode/rpm/rpm.js new file mode 100644 index 000000000..3bb7cd2f6 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/rpm/rpm.js @@ -0,0 +1,101 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("rpm-changes", function() { + var headerSeperator = /^-+$/; + var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; + var simpleEmail = /^[\w+.-]+@[\w.-]+/; + + return { + token: function(stream) { + if (stream.sol()) { + if (stream.match(headerSeperator)) { return 'tag'; } + if (stream.match(headerLine)) { return 'tag'; } + } + if (stream.match(simpleEmail)) { return 'string'; } + stream.next(); + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); + +// Quick and dirty spec file highlighting + +CodeMirror.defineMode("rpm-spec", function() { + var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; + + var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; + var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; + var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros + var control_flow_simple = /^%(else|endif)/; // rpm control flow macros + var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros + + return { + startState: function () { + return { + controlFlow: false, + macroParameters: false, + section: false + }; + }, + token: function (stream, state) { + var ch = stream.peek(); + if (ch == "#") { stream.skipToEnd(); return "comment"; } + + if (stream.sol()) { + if (stream.match(preamble)) { return "preamble"; } + if (stream.match(section)) { return "section"; } + } + + if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' + if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' + + if (stream.match(control_flow_simple)) { return "keyword"; } + if (stream.match(control_flow_complex)) { + state.controlFlow = true; + return "keyword"; + } + if (state.controlFlow) { + if (stream.match(operators)) { return "operator"; } + if (stream.match(/^(\d+)/)) { return "number"; } + if (stream.eol()) { state.controlFlow = false; } + } + + if (stream.match(arch)) { return "number"; } + + // Macros like '%make_install' or '%attr(0775,root,root)' + if (stream.match(/^%[\w]+/)) { + if (stream.match(/^\(/)) { state.macroParameters = true; } + return "macro"; + } + if (state.macroParameters) { + if (stream.match(/^\d+/)) { return "number";} + if (stream.match(/^\)/)) { + state.macroParameters = false; + return "macro"; + } + } + if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' + + //TODO: Include bash script sub-parser (CodeMirror supports that) + stream.next(); + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/rst/index.html b/deploy/core/node_modules/codemirror/mode/rst/index.html new file mode 100644 index 000000000..2902dea23 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/rst/index.html @@ -0,0 +1,535 @@ + + +CodeMirror: reStructuredText mode + + + + + + + + + + +
+

reStructuredText mode

+
+ + +

+ The python mode will be used for highlighting blocks + containing Python/IPython terminal sessions: blocks starting with + >>> (for Python) or In [num]: (for + IPython). + + Further, the stex mode will be used for highlighting + blocks containing LaTex code. +

+ +

MIME types defined: text/x-rst.

+
diff --git a/deploy/core/node_modules/codemirror/mode/rst/rst.js b/deploy/core/node_modules/codemirror/mode/rst/rst.js new file mode 100644 index 000000000..bcf110c1a --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/rst/rst.js @@ -0,0 +1,557 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('rst', function (config, options) { + + var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/; + var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/; + var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/; + + var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/; + var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/; + var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/; + + var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://"; + var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})"; + var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*"; + var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path); + + var overlay = { + token: function (stream) { + + if (stream.match(rx_strong) && stream.match (/\W+|$/, false)) + return 'strong'; + if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false)) + return 'em'; + if (stream.match(rx_literal) && stream.match (/\W+|$/, false)) + return 'string-2'; + if (stream.match(rx_number)) + return 'number'; + if (stream.match(rx_positive)) + return 'positive'; + if (stream.match(rx_negative)) + return 'negative'; + if (stream.match(rx_uri)) + return 'link'; + + while (stream.next() != null) { + if (stream.match(rx_strong, false)) break; + if (stream.match(rx_emphasis, false)) break; + if (stream.match(rx_literal, false)) break; + if (stream.match(rx_number, false)) break; + if (stream.match(rx_positive, false)) break; + if (stream.match(rx_negative, false)) break; + if (stream.match(rx_uri, false)) break; + } + + return null; + } + }; + + var mode = CodeMirror.getMode( + config, options.backdrop || 'rst-base' + ); + + return CodeMirror.overlayMode(mode, overlay, true); // combine +}, 'python', 'stex'); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +CodeMirror.defineMode('rst-base', function (config) { + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function format(string) { + var args = Array.prototype.slice.call(arguments, 1); + return string.replace(/{(\d+)}/g, function (match, n) { + return typeof args[n] != 'undefined' ? args[n] : match; + }); + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + var mode_python = CodeMirror.getMode(config, 'python'); + var mode_stex = CodeMirror.getMode(config, 'stex'); + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + var SEPA = "\\s+"; + var TAIL = "(?:\\s*|\\W|$)", + rx_TAIL = new RegExp(format('^{0}', TAIL)); + + var NAME = + "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)", + rx_NAME = new RegExp(format('^{0}', NAME)); + var NAME_WWS = + "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)"; + var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS); + + var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)"; + var TEXT2 = "(?:[^\\`]+)", + rx_TEXT2 = new RegExp(format('^{0}', TEXT2)); + + var rx_section = new RegExp( + "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"); + var rx_explicit = new RegExp( + format('^\\.\\.{0}', SEPA)); + var rx_link = new RegExp( + format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL)); + var rx_directive = new RegExp( + format('^{0}::{1}', REF_NAME, TAIL)); + var rx_substitution = new RegExp( + format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL)); + var rx_footnote = new RegExp( + format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL)); + var rx_citation = new RegExp( + format('^\\[{0}\\]{1}', REF_NAME, TAIL)); + + var rx_substitution_ref = new RegExp( + format('^\\|{0}\\|', TEXT1)); + var rx_footnote_ref = new RegExp( + format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME)); + var rx_citation_ref = new RegExp( + format('^\\[{0}\\]_', REF_NAME)); + var rx_link_ref1 = new RegExp( + format('^{0}__?', REF_NAME)); + var rx_link_ref2 = new RegExp( + format('^`{0}`_', TEXT2)); + + var rx_role_pre = new RegExp( + format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL)); + var rx_role_suf = new RegExp( + format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL)); + var rx_role = new RegExp( + format('^:{0}:{1}', NAME, TAIL)); + + var rx_directive_name = new RegExp(format('^{0}', REF_NAME)); + var rx_directive_tail = new RegExp(format('^::{0}', TAIL)); + var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1)); + var rx_substitution_sepa = new RegExp(format('^{0}', SEPA)); + var rx_substitution_name = new RegExp(format('^{0}', REF_NAME)); + var rx_substitution_tail = new RegExp(format('^::{0}', TAIL)); + var rx_link_head = new RegExp("^_"); + var rx_link_name = new RegExp(format('^{0}|_', REF_NAME)); + var rx_link_tail = new RegExp(format('^:{0}', TAIL)); + + var rx_verbatim = new RegExp('^::\\s*$'); + var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s'); + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_normal(stream, state) { + var token = null; + + if (stream.sol() && stream.match(rx_examples, false)) { + change(state, to_mode, { + mode: mode_python, local: CodeMirror.startState(mode_python) + }); + } else if (stream.sol() && stream.match(rx_explicit)) { + change(state, to_explicit); + token = 'meta'; + } else if (stream.sol() && stream.match(rx_section)) { + change(state, to_normal); + token = 'header'; + } else if (phase(state) == rx_role_pre || + stream.match(rx_role_pre, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_role_pre, 1)); + stream.match(/^:/); + token = 'meta'; + break; + case 1: + change(state, to_normal, context(rx_role_pre, 2)); + stream.match(rx_NAME); + token = 'keyword'; + + if (stream.current().match(/^(?:math|latex)/)) { + state.tmp_stex = true; + } + break; + case 2: + change(state, to_normal, context(rx_role_pre, 3)); + stream.match(/^:`/); + token = 'meta'; + break; + case 3: + if (state.tmp_stex) { + state.tmp_stex = undefined; state.tmp = { + mode: mode_stex, local: CodeMirror.startState(mode_stex) + }; + } + + if (state.tmp) { + if (stream.peek() == '`') { + change(state, to_normal, context(rx_role_pre, 4)); + state.tmp = undefined; + break; + } + + token = state.tmp.mode.token(stream, state.tmp.local); + break; + } + + change(state, to_normal, context(rx_role_pre, 4)); + stream.match(rx_TEXT2); + token = 'string'; + break; + case 4: + change(state, to_normal, context(rx_role_pre, 5)); + stream.match(/^`/); + token = 'meta'; + break; + case 5: + change(state, to_normal, context(rx_role_pre, 6)); + stream.match(rx_TAIL); + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_role_suf || + stream.match(rx_role_suf, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_role_suf, 1)); + stream.match(/^`/); + token = 'meta'; + break; + case 1: + change(state, to_normal, context(rx_role_suf, 2)); + stream.match(rx_TEXT2); + token = 'string'; + break; + case 2: + change(state, to_normal, context(rx_role_suf, 3)); + stream.match(/^`:/); + token = 'meta'; + break; + case 3: + change(state, to_normal, context(rx_role_suf, 4)); + stream.match(rx_NAME); + token = 'keyword'; + break; + case 4: + change(state, to_normal, context(rx_role_suf, 5)); + stream.match(/^:/); + token = 'meta'; + break; + case 5: + change(state, to_normal, context(rx_role_suf, 6)); + stream.match(rx_TAIL); + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_role || stream.match(rx_role, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_role, 1)); + stream.match(/^:/); + token = 'meta'; + break; + case 1: + change(state, to_normal, context(rx_role, 2)); + stream.match(rx_NAME); + token = 'keyword'; + break; + case 2: + change(state, to_normal, context(rx_role, 3)); + stream.match(/^:/); + token = 'meta'; + break; + case 3: + change(state, to_normal, context(rx_role, 4)); + stream.match(rx_TAIL); + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_substitution_ref || + stream.match(rx_substitution_ref, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_substitution_ref, 1)); + stream.match(rx_substitution_text); + token = 'variable-2'; + break; + case 1: + change(state, to_normal, context(rx_substitution_ref, 2)); + if (stream.match(/^_?_?/)) token = 'link'; + break; + default: + change(state, to_normal); + } + } else if (stream.match(rx_footnote_ref)) { + change(state, to_normal); + token = 'quote'; + } else if (stream.match(rx_citation_ref)) { + change(state, to_normal); + token = 'quote'; + } else if (stream.match(rx_link_ref1)) { + change(state, to_normal); + if (!stream.peek() || stream.peek().match(/^\W$/)) { + token = 'link'; + } + } else if (phase(state) == rx_link_ref2 || + stream.match(rx_link_ref2, false)) { + + switch (stage(state)) { + case 0: + if (!stream.peek() || stream.peek().match(/^\W$/)) { + change(state, to_normal, context(rx_link_ref2, 1)); + } else { + stream.match(rx_link_ref2); + } + break; + case 1: + change(state, to_normal, context(rx_link_ref2, 2)); + stream.match(/^`/); + token = 'link'; + break; + case 2: + change(state, to_normal, context(rx_link_ref2, 3)); + stream.match(rx_TEXT2); + break; + case 3: + change(state, to_normal, context(rx_link_ref2, 4)); + stream.match(/^`_/); + token = 'link'; + break; + default: + change(state, to_normal); + } + } else if (stream.match(rx_verbatim)) { + change(state, to_verbatim); + } + + else { + if (stream.next()) change(state, to_normal); + } + + return token; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_explicit(stream, state) { + var token = null; + + if (phase(state) == rx_substitution || + stream.match(rx_substitution, false)) { + + switch (stage(state)) { + case 0: + change(state, to_explicit, context(rx_substitution, 1)); + stream.match(rx_substitution_text); + token = 'variable-2'; + break; + case 1: + change(state, to_explicit, context(rx_substitution, 2)); + stream.match(rx_substitution_sepa); + break; + case 2: + change(state, to_explicit, context(rx_substitution, 3)); + stream.match(rx_substitution_name); + token = 'keyword'; + break; + case 3: + change(state, to_explicit, context(rx_substitution, 4)); + stream.match(rx_substitution_tail); + token = 'meta'; + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_directive || + stream.match(rx_directive, false)) { + + switch (stage(state)) { + case 0: + change(state, to_explicit, context(rx_directive, 1)); + stream.match(rx_directive_name); + token = 'keyword'; + + if (stream.current().match(/^(?:math|latex)/)) + state.tmp_stex = true; + else if (stream.current().match(/^python/)) + state.tmp_py = true; + break; + case 1: + change(state, to_explicit, context(rx_directive, 2)); + stream.match(rx_directive_tail); + token = 'meta'; + + if (stream.match(/^latex\s*$/) || state.tmp_stex) { + state.tmp_stex = undefined; change(state, to_mode, { + mode: mode_stex, local: CodeMirror.startState(mode_stex) + }); + } + break; + case 2: + change(state, to_explicit, context(rx_directive, 3)); + if (stream.match(/^python\s*$/) || state.tmp_py) { + state.tmp_py = undefined; change(state, to_mode, { + mode: mode_python, local: CodeMirror.startState(mode_python) + }); + } + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_link || stream.match(rx_link, false)) { + + switch (stage(state)) { + case 0: + change(state, to_explicit, context(rx_link, 1)); + stream.match(rx_link_head); + stream.match(rx_link_name); + token = 'link'; + break; + case 1: + change(state, to_explicit, context(rx_link, 2)); + stream.match(rx_link_tail); + token = 'meta'; + break; + default: + change(state, to_normal); + } + } else if (stream.match(rx_footnote)) { + change(state, to_normal); + token = 'quote'; + } else if (stream.match(rx_citation)) { + change(state, to_normal); + token = 'quote'; + } + + else { + stream.eatSpace(); + if (stream.eol()) { + change(state, to_normal); + } else { + stream.skipToEnd(); + change(state, to_comment); + token = 'comment'; + } + } + + return token; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_comment(stream, state) { + return as_block(stream, state, 'comment'); + } + + function to_verbatim(stream, state) { + return as_block(stream, state, 'meta'); + } + + function as_block(stream, state, token) { + if (stream.eol() || stream.eatSpace()) { + stream.skipToEnd(); + return token; + } else { + change(state, to_normal); + return null; + } + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_mode(stream, state) { + + if (state.ctx.mode && state.ctx.local) { + + if (stream.sol()) { + if (!stream.eatSpace()) change(state, to_normal); + return null; + } + + return state.ctx.mode.token(stream, state.ctx.local); + } + + change(state, to_normal); + return null; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function context(phase, stage, mode, local) { + return {phase: phase, stage: stage, mode: mode, local: local}; + } + + function change(state, tok, ctx) { + state.tok = tok; + state.ctx = ctx || {}; + } + + function stage(state) { + return state.ctx.stage || 0; + } + + function phase(state) { + return state.ctx.phase; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + return { + startState: function () { + return {tok: to_normal, ctx: context(undefined, 0)}; + }, + + copyState: function (state) { + var ctx = state.ctx, tmp = state.tmp; + if (ctx.local) + ctx = {mode: ctx.mode, local: CodeMirror.copyState(ctx.mode, ctx.local)}; + if (tmp) + tmp = {mode: tmp.mode, local: CodeMirror.copyState(tmp.mode, tmp.local)}; + return {tok: state.tok, ctx: ctx, tmp: tmp}; + }, + + innerMode: function (state) { + return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode} + : state.ctx.mode ? {state: state.ctx.local, mode: state.ctx.mode} + : null; + }, + + token: function (stream, state) { + return state.tok(stream, state); + } + }; +}, 'python', 'stex'); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +CodeMirror.defineMIME('text/x-rst', 'rst'); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +}); diff --git a/deploy/core/node_modules/codemirror/mode/ruby/index.html b/deploy/core/node_modules/codemirror/mode/ruby/index.html new file mode 100644 index 000000000..1197ab023 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/ruby/index.html @@ -0,0 +1,184 @@ + + +CodeMirror: Ruby mode + + + + + + + + + + +
+

Ruby mode

+
+ + +

MIME types defined: text/x-ruby.

+ +

Development of the CodeMirror Ruby mode was kindly sponsored + by Ubalo, who hold + the license.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/ruby.js b/deploy/core/node_modules/codemirror/mode/ruby/ruby.js similarity index 75% rename from deploy/core/node_modules/codemirror/modes/ruby.js rename to deploy/core/node_modules/codemirror/mode/ruby/ruby.js index 96cdd5f9d..eab9d9da7 100644 --- a/deploy/core/node_modules/codemirror/modes/ruby.js +++ b/deploy/core/node_modules/codemirror/mode/ruby/ruby.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("ruby", function(config) { function wordObj(words) { var o = {}; @@ -12,7 +25,7 @@ CodeMirror.defineMode("ruby", function(config) { "caller", "lambda", "proc", "public", "protected", "private", "require", "load", "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then", + var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then", "catch", "loop", "proc", "begin"]); var dedentWords = wordObj(["end", "until"]); var matching = {"[": "]", "{": "}", "(": ")"}; @@ -33,15 +46,30 @@ CodeMirror.defineMode("ruby", function(config) { var ch = stream.next(), m; if (ch == "`" || ch == "'" || ch == '"') { return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); - } else if (ch == "/" && !stream.eol() && stream.peek() != " ") { - return chain(readQuoted(ch, "string-2", true), stream, state); + } else if (ch == "/") { + var currentIndex = stream.current().length; + if (stream.skipTo("/")) { + var search_till = stream.current().length; + stream.backUp(stream.current().length - currentIndex); + var balance = 0; // balance brackets + while (stream.current().length < search_till) { + var chchr = stream.next(); + if (chchr == "(") balance += 1; + else if (chchr == ")") balance -= 1; + if (balance < 0) break; + } + stream.backUp(stream.current().length - currentIndex); + if (balance == 0) + return chain(readQuoted(ch, "string-2", true), stream, state); + } + return "operator"; } else if (ch == "%") { var style = "string", embed = true; if (stream.eat("s")) style = "atom"; else if (stream.eat(/[WQ]/)) style = "string"; else if (stream.eat(/[r]/)) style = "string-2"; else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; } - var delim = stream.eat(/[^\w\s]/); + var delim = stream.eat(/[^\w\s=]/); if (!delim) return "operator"; if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; return chain(readQuoted(delim, style, embed, true), stream, state); @@ -79,16 +107,16 @@ CodeMirror.defineMode("ruby", function(config) { } // Symbols can't start by a digit - if (stream.eat(/[a-zA-Z$@_]/)) { - stream.eatWhile(/[\w]/); + if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) { + stream.eatWhile(/[\w$\xa1-\uffff]/); // Only one ? ! = is allowed and only as the last character stream.eat(/[\?\!\=]/); return "atom"; } return "operator"; - } else if (ch == "@" && stream.match(/^@?[a-zA-Z_]/)) { + } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) { stream.eat("@"); - stream.eatWhile(/[\w]/); + stream.eatWhile(/[\w\xa1-\uffff]/); return "variable-2"; } else if (ch == "$") { if (stream.eat(/[a-zA-Z_]/)) { @@ -99,8 +127,8 @@ CodeMirror.defineMode("ruby", function(config) { stream.next(); // Must be a special global like $: or $! } return "variable-3"; - } else if (/[a-zA-Z_]/.test(ch)) { - stream.eatWhile(/[\w]/); + } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) { + stream.eatWhile(/[\w\xa1-\uffff]/); stream.eat(/[\?\!]/); if (stream.eat(":")) return "atom"; return "ident"; @@ -113,24 +141,26 @@ CodeMirror.defineMode("ruby", function(config) { } else if (ch == "-" && stream.eat(">")) { return "arrow"; } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); + var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); + if (ch == "." && !more) curPunc = "."; return "operator"; } else { return null; } } - function tokenBaseUntilBrace() { - var depth = 1; + function tokenBaseUntilBrace(depth) { + if (!depth) depth = 1; return function(stream, state) { if (stream.peek() == "}") { - depth--; - if (depth == 0) { + if (depth == 1) { state.tokenize.pop(); return state.tokenize[state.tokenize.length-1](stream, state); + } else { + state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1); } } else if (stream.peek() == "{") { - depth++; + state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1); } return tokenBase(stream, state); }; @@ -204,18 +234,25 @@ CodeMirror.defineMode("ruby", function(config) { token: function(stream, state) { if (stream.sol()) state.indented = stream.indentation(); var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; + var thisTok = curPunc; if (style == "ident") { var word = stream.current(); - style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" + style = state.lastTok == "." ? "property" + : keywords.propertyIsEnumerable(stream.current()) ? "keyword" : /^[A-Z]/.test(word) ? "tag" : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" : "variable"; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) - kwtype = "indent"; + if (style == "keyword") { + thisTok = word; + if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; + else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; + else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) + kwtype = "indent"; + else if (word == "do" && state.context.indented < state.indented) + kwtype = "indent"; + } } - if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style; + if (curPunc || (style && style != "comment")) state.lastTok = thisTok; if (curPunc == "|") state.varList = !state.varList; if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) @@ -245,3 +282,4 @@ CodeMirror.defineMode("ruby", function(config) { CodeMirror.defineMIME("text/x-ruby", "ruby"); +}); diff --git a/deploy/core/node_modules/codemirror/mode/ruby/test.js b/deploy/core/node_modules/codemirror/mode/ruby/test.js new file mode 100644 index 000000000..cade864ff --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/ruby/test.js @@ -0,0 +1,14 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("divide_equal_operator", + "[variable bar] [operator /=] [variable foo]"); + + MT("divide_equal_operator_no_spacing", + "[variable foo][operator /=][number 42]"); + +})(); diff --git a/deploy/core/node_modules/codemirror/mode/rust/index.html b/deploy/core/node_modules/codemirror/mode/rust/index.html new file mode 100644 index 000000000..407e84f2c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/rust/index.html @@ -0,0 +1,60 @@ + + +CodeMirror: Rust mode + + + + + + + + + +
+

Rust mode

+ + +
+ + + +

MIME types defined: text/x-rustsrc.

+
diff --git a/deploy/core/node_modules/codemirror/modes/rust.js b/deploy/core/node_modules/codemirror/mode/rust/rust.js similarity index 96% rename from deploy/core/node_modules/codemirror/modes/rust.js rename to deploy/core/node_modules/codemirror/mode/rust/rust.js index c7530b6cc..2bffa9a6a 100644 --- a/deploy/core/node_modules/codemirror/modes/rust.js +++ b/deploy/core/node_modules/codemirror/mode/rust/rust.js @@ -1,7 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("rust", function() { var indentUnit = 4, altIndentUnit = 2; var valKeywords = { - "if": "if-style", "while": "if-style", "else": "else-style", + "if": "if-style", "while": "if-style", "loop": "else-style", "else": "else-style", "do": "else-style", "ret": "else-style", "fail": "else-style", "break": "atom", "cont": "atom", "const": "let", "resource": "fn", "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", @@ -9,7 +22,7 @@ CodeMirror.defineMode("rust", function() { "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", "export": "else-style", "copy": "op", "log": "op", "log_err": "op", - "use": "op", "bind": "op", "self": "atom" + "use": "op", "bind": "op", "self": "atom", "struct": "enum" }; var typeKeywords = function() { var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; @@ -434,3 +447,5 @@ CodeMirror.defineMode("rust", function() { }); CodeMirror.defineMIME("text/x-rustsrc", "rust"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/sass/index.html b/deploy/core/node_modules/codemirror/mode/sass/index.html new file mode 100644 index 000000000..9f4a79022 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/sass/index.html @@ -0,0 +1,66 @@ + + +CodeMirror: Sass mode + + + + + + + + + + +
+

Sass mode

+
+ + +

MIME types defined: text/x-sass.

+
diff --git a/deploy/core/node_modules/codemirror/modes/sass.js b/deploy/core/node_modules/codemirror/mode/sass/sass.js similarity index 58% rename from deploy/core/node_modules/codemirror/modes/sass.js rename to deploy/core/node_modules/codemirror/mode/sass/sass.js index 9c9a0dae0..b792a02aa 100644 --- a/deploy/core/node_modules/codemirror/modes/sass.js +++ b/deploy/core/node_modules/codemirror/mode/sass/sass.js @@ -1,7 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("sass", function(config) { - var tokenRegexp = function(words){ + function tokenRegexp(words) { return new RegExp("^" + words.join("|")); - }; + } var keywords = ["true", "false", "null", "auto"]; var keywordsRegexp = new RegExp("^" + keywords.join("|")); @@ -11,246 +24,233 @@ CodeMirror.defineMode("sass", function(config) { var pseudoElementsRegexp = /^::?[\w\-]+/; - var urlTokens = function(stream, state){ + function urlTokens(stream, state) { var ch = stream.peek(); - if (ch === ")"){ + if (ch === ")") { stream.next(); state.tokenizer = tokenBase; return "operator"; - }else if (ch === "("){ + } else if (ch === "(") { stream.next(); stream.eatSpace(); return "operator"; - }else if (ch === "'" || ch === '"'){ + } else if (ch === "'" || ch === '"') { state.tokenizer = buildStringTokenizer(stream.next()); return "string"; - }else{ + } else { state.tokenizer = buildStringTokenizer(")", false); return "string"; } - }; - var multilineComment = function(stream, state) { - if (stream.skipTo("*/")){ - stream.next(); - stream.next(); - state.tokenizer = tokenBase; - }else { - stream.next(); - } + } + function comment(indentation, multiLine) { + return function(stream, state) { + if (stream.sol() && stream.indentation() <= indentation) { + state.tokenizer = tokenBase; + return tokenBase(stream, state); + } - return "comment"; - }; + if (multiLine && stream.skipTo("*/")) { + stream.next(); + stream.next(); + state.tokenizer = tokenBase; + } else { + stream.next(); + } + + return "comment"; + }; + } - var buildStringTokenizer = function(quote, greedy){ - if(greedy == null){ greedy = true; } + function buildStringTokenizer(quote, greedy) { + if(greedy == null) { greedy = true; } - function stringTokenizer(stream, state){ + function stringTokenizer(stream, state) { var nextChar = stream.next(); var peekChar = stream.peek(); var previousChar = stream.string.charAt(stream.pos-2); var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); - /* - console.log("previousChar: " + previousChar); - console.log("nextChar: " + nextChar); - console.log("peekChar: " + peekChar); - console.log("ending: " + endingString); - */ - - if (endingString){ + if (endingString) { if (nextChar !== quote && greedy) { stream.next(); } state.tokenizer = tokenBase; return "string"; - }else if (nextChar === "#" && peekChar === "{"){ + } else if (nextChar === "#" && peekChar === "{") { state.tokenizer = buildInterpolationTokenizer(stringTokenizer); stream.next(); return "operator"; - }else { + } else { return "string"; } } return stringTokenizer; - }; + } - var buildInterpolationTokenizer = function(currentTokenizer){ - return function(stream, state){ - if (stream.peek() === "}"){ + function buildInterpolationTokenizer(currentTokenizer) { + return function(stream, state) { + if (stream.peek() === "}") { stream.next(); state.tokenizer = currentTokenizer; return "operator"; - }else{ + } else { return tokenBase(stream, state); } }; - }; + } - var indent = function(state){ - if (state.indentCount == 0){ + function indent(state) { + if (state.indentCount == 0) { state.indentCount++; var lastScopeOffset = state.scopes[0].offset; var currentOffset = lastScopeOffset + config.indentUnit; state.scopes.unshift({ offset:currentOffset }); } - }; + } - var dedent = function(state){ - if (state.scopes.length == 1) { return; } + function dedent(state) { + if (state.scopes.length == 1) return; state.scopes.shift(); - }; + } - var tokenBase = function(stream, state) { + function tokenBase(stream, state) { var ch = stream.peek(); - // Single line Comment - if (stream.match('//')) { - stream.skipToEnd(); - return "comment"; + // Comment + if (stream.match("/*")) { + state.tokenizer = comment(stream.indentation(), true); + return state.tokenizer(stream, state); } - - // Multiline Comment - if (stream.match('/*')){ - state.tokenizer = multilineComment; + if (stream.match("//")) { + state.tokenizer = comment(stream.indentation(), false); return state.tokenizer(stream, state); } // Interpolation - if (stream.match('#{')){ - state.tokenizer = buildInterpolationTokenizer(tokenBase); + if (stream.match("#{")) { + state.tokenizer = buildInterpolationTokenizer(tokenBase); return "operator"; } - if (ch === "."){ + if (ch === ".") { stream.next(); // Match class selectors - if (stream.match(/^[\w-]+/)){ + if (stream.match(/^[\w-]+/)) { indent(state); return "atom"; - }else if (stream.peek() === "#"){ + } else if (stream.peek() === "#") { indent(state); return "atom"; - }else{ + } else { return "operator"; } } - if (ch === "#"){ + if (ch === "#") { stream.next(); // Hex numbers - if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ + if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)) return "number"; - } // ID selectors - if (stream.match(/^[\w-]+/)){ + if (stream.match(/^[\w-]+/)) { indent(state); return "atom"; } - if (stream.peek() === "#"){ + if (stream.peek() === "#") { indent(state); return "atom"; } } // Numbers - if (stream.match(/^-?[0-9\.]+/)){ + if (stream.match(/^-?[0-9\.]+/)) return "number"; - } // Units - if (stream.match(/^(px|em|in)\b/)){ + if (stream.match(/^(px|em|in)\b/)) return "unit"; - } - if (stream.match(keywordsRegexp)){ + if (stream.match(keywordsRegexp)) return "keyword"; - } - if (stream.match(/^url/) && stream.peek() === "("){ + if (stream.match(/^url/) && stream.peek() === "(") { state.tokenizer = urlTokens; return "atom"; } // Variables - if (ch === "$"){ + if (ch === "$") { stream.next(); stream.eatWhile(/[\w-]/); - if (stream.peek() === ":"){ + if (stream.peek() === ":") { stream.next(); return "variable-2"; - }else{ + } else { return "variable-3"; } } - if (ch === "!"){ + if (ch === "!") { stream.next(); - - if (stream.match(/^[\w]+/)){ - return "keyword"; - } - - return "operator"; + return stream.match(/^[\w]+/) ? "keyword": "operator"; } - if (ch === "="){ + if (ch === "=") { stream.next(); // Match shortcut mixin definition - if (stream.match(/^[\w-]+/)){ + if (stream.match(/^[\w-]+/)) { indent(state); return "meta"; - }else { + } else { return "operator"; } } - if (ch === "+"){ + if (ch === "+") { stream.next(); // Match shortcut mixin definition - if (stream.match(/^[\w-]+/)){ + if (stream.match(/^[\w-]+/)) return "variable-3"; - }else { + else return "operator"; - } } // Indent Directives - if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){ + if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { indent(state); return "meta"; } // Other Directives - if (ch === "@"){ + if (ch === "@") { stream.next(); stream.eatWhile(/[\w-]/); return "meta"; } // Strings - if (ch === '"' || ch === "'"){ + if (ch === '"' || ch === "'") { stream.next(); state.tokenizer = buildStringTokenizer(ch); return "string"; } // Pseudo element selectors - if (ch == ':' && stream.match(pseudoElementsRegexp)){ + if (ch == ":" && stream.match(pseudoElementsRegexp)) return "keyword"; - } // atoms - if (stream.eatWhile(/[\w-&]/)){ + if (stream.eatWhile(/[\w-&]/)) { // matches a property definition if (stream.peek() === ":" && !stream.match(pseudoElementsRegexp, false)) return "property"; @@ -258,43 +258,37 @@ CodeMirror.defineMode("sass", function(config) { return "atom"; } - if (stream.match(opRegexp)){ + if (stream.match(opRegexp)) return "operator"; - } // If we haven't returned by now, we move 1 character // and return an error stream.next(); return null; - }; + } - var tokenLexer = function(stream, state) { - if (stream.sol()){ - state.indentCount = 0; - } + function tokenLexer(stream, state) { + if (stream.sol()) state.indentCount = 0; var style = state.tokenizer(stream, state); var current = stream.current(); - if (current === "@return"){ + if (current === "@return") dedent(state); - } - if (style === "atom"){ + if (style === "atom") indent(state); - } - if (style !== null){ + if (style !== null) { var startOfToken = stream.pos - current.length; var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); var newScopes = []; - for (var i = 0; i < state.scopes.length; i++){ + for (var i = 0; i < state.scopes.length; i++) { var scope = state.scopes[i]; - if (scope.offset <= withCurrentIndent){ + if (scope.offset <= withCurrentIndent) newScopes.push(scope); - } } state.scopes = newScopes; @@ -302,13 +296,14 @@ CodeMirror.defineMode("sass", function(config) { return style; - }; + } return { startState: function() { return { tokenizer: tokenBase, - scopes: [{offset: 0, type: 'sass'}], + scopes: [{offset: 0, type: "sass"}], + indentCount: 0, definedVars: [], definedMixins: [] }; @@ -328,3 +323,5 @@ CodeMirror.defineMode("sass", function(config) { }); CodeMirror.defineMIME("text/x-sass", "sass"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/scheme/index.html b/deploy/core/node_modules/codemirror/mode/scheme/index.html new file mode 100644 index 000000000..04d5c6a2a --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/scheme/index.html @@ -0,0 +1,77 @@ + + +CodeMirror: Scheme mode + + + + + + + + + +
+

Scheme mode

+
+ + +

MIME types defined: text/x-scheme.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/scheme.js b/deploy/core/node_modules/codemirror/mode/scheme/scheme.js similarity index 96% rename from deploy/core/node_modules/codemirror/modes/scheme.js rename to deploy/core/node_modules/codemirror/mode/scheme/scheme.js index c5990ae92..979edc096 100644 --- a/deploy/core/node_modules/codemirror/modes/scheme.js +++ b/deploy/core/node_modules/codemirror/mode/scheme/scheme.js @@ -1,6 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Author: Koh Zi Han, based on implementation by Koh Zi Chun */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("scheme", function () { var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; @@ -230,3 +244,5 @@ CodeMirror.defineMode("scheme", function () { }); CodeMirror.defineMIME("text/x-scheme", "scheme"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/shell/index.html b/deploy/core/node_modules/codemirror/mode/shell/index.html new file mode 100644 index 000000000..0b56300b1 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/shell/index.html @@ -0,0 +1,66 @@ + + +CodeMirror: Shell mode + + + + + + + + + + +
+

Shell mode

+ + + + + + +

MIME types defined: text/x-sh.

+
diff --git a/deploy/core/node_modules/codemirror/modes/shell.js b/deploy/core/node_modules/codemirror/mode/shell/shell.js similarity index 82% rename from deploy/core/node_modules/codemirror/modes/shell.js rename to deploy/core/node_modules/codemirror/mode/shell/shell.js index abfd21445..8e31f6f30 100644 --- a/deploy/core/node_modules/codemirror/modes/shell.js +++ b/deploy/core/node_modules/codemirror/mode/shell/shell.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode('shell', function() { var words = {}; @@ -23,10 +36,15 @@ CodeMirror.defineMode('shell', function() { 'touch vi vim wall wc wget who write yes zsh'); function tokenBase(stream, state) { + if (stream.eatSpace()) return null; var sol = stream.sol(); var ch = stream.next(); + if (ch === '\\') { + stream.next(); + return null; + } if (ch === '\'' || ch === '"' || ch === '`') { state.tokens.unshift(tokenString(ch)); return tokenize(stream, state); @@ -53,7 +71,7 @@ CodeMirror.defineMode('shell', function() { } if (/\d/.test(ch)) { stream.eatWhile(/\d/); - if(!/\w/.test(stream.peek())) { + if(stream.eol() || !/\w/.test(stream.peek())) { return 'number'; } } @@ -109,10 +127,12 @@ CodeMirror.defineMode('shell', function() { return { startState: function() {return {tokens:[]};}, token: function(stream, state) { - if (stream.eatSpace()) return null; return tokenize(stream, state); - } + }, + lineComment: '#' }; }); CodeMirror.defineMIME('text/x-sh', 'shell'); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/shell/test.js b/deploy/core/node_modules/codemirror/mode/shell/test.js new file mode 100644 index 000000000..a413b5a40 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/shell/test.js @@ -0,0 +1,58 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({}, "shell"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("var", + "text [def $var] text"); + MT("varBraces", + "text[def ${var}]text"); + MT("varVar", + "text [def $a$b] text"); + MT("varBracesVarBraces", + "text[def ${a}${b}]text"); + + MT("singleQuotedVar", + "[string 'text $var text']"); + MT("singleQuotedVarBraces", + "[string 'text ${var} text']"); + + MT("doubleQuotedVar", + '[string "text ][def $var][string text"]'); + MT("doubleQuotedVarBraces", + '[string "text][def ${var}][string text"]'); + MT("doubleQuotedVarPunct", + '[string "text ][def $@][string text"]'); + MT("doubleQuotedVarVar", + '[string "][def $a$b][string "]'); + MT("doubleQuotedVarBracesVarBraces", + '[string "][def ${a}${b}][string "]'); + + MT("notAString", + "text\\'text"); + MT("escapes", + "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); + + MT("subshell", + "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); + MT("doubleQuotedSubshell", + "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); + + MT("hashbang", + "[meta #!/bin/bash]"); + MT("comment", + "text [comment # Blurb]"); + + MT("numbers", + "[number 0] [number 1] [number 2]"); + MT("keywords", + "[keyword while] [atom true]; [keyword do]", + " [builtin sleep] [number 3]", + "[keyword done]"); + MT("options", + "[builtin ls] [attribute -l] [attribute --human-readable]"); + MT("operator", + "[def var][operator =]value"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/sieve/index.html b/deploy/core/node_modules/codemirror/mode/sieve/index.html new file mode 100644 index 000000000..6f029b623 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/sieve/index.html @@ -0,0 +1,93 @@ + + +CodeMirror: Sieve (RFC5228) mode + + + + + + + + + +
+

Sieve (RFC5228) mode

+
+ + +

MIME types defined: application/sieve.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/sieve.js b/deploy/core/node_modules/codemirror/mode/sieve/sieve.js similarity index 89% rename from deploy/core/node_modules/codemirror/modes/sieve.js rename to deploy/core/node_modules/codemirror/mode/sieve/sieve.js index 8ca2a4cb8..f67db2f55 100644 --- a/deploy/core/node_modules/codemirror/modes/sieve.js +++ b/deploy/core/node_modules/codemirror/mode/sieve/sieve.js @@ -1,7 +1,15 @@ -/* - * See LICENSE in this directory for the license under which this code - * is released. - */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; CodeMirror.defineMode("sieve", function(config) { function words(str) { @@ -181,3 +189,5 @@ CodeMirror.defineMode("sieve", function(config) { }); CodeMirror.defineMIME("application/sieve", "sieve"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/slim/index.html b/deploy/core/node_modules/codemirror/mode/slim/index.html new file mode 100644 index 000000000..7fa4e50df --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/slim/index.html @@ -0,0 +1,96 @@ + + +CodeMirror: SLIM mode + + + + + + + + + + + + + + + + + + + + +
+

SLIM mode

+
+ + +

MIME types defined: application/x-slim.

+ +

+ Parsing/Highlighting Tests: + normal, + verbose. +

+
diff --git a/deploy/core/node_modules/codemirror/mode/slim/slim.js b/deploy/core/node_modules/codemirror/mode/slim/slim.js new file mode 100644 index 000000000..164464d06 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/slim/slim.js @@ -0,0 +1,575 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + + CodeMirror.defineMode("slim", function(config) { + var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); + var rubyMode = CodeMirror.getMode(config, "ruby"); + var modes = { html: htmlMode, ruby: rubyMode }; + var embedded = { + ruby: "ruby", + javascript: "javascript", + css: "text/css", + sass: "text/x-sass", + scss: "text/x-scss", + less: "text/x-less", + styl: "text/x-styl", // no highlighting so far + coffee: "coffeescript", + asciidoc: "text/x-asciidoc", + markdown: "text/x-markdown", + textile: "text/x-textile", // no highlighting so far + creole: "text/x-creole", // no highlighting so far + wiki: "text/x-wiki", // no highlighting so far + mediawiki: "text/x-mediawiki", // no highlighting so far + rdoc: "text/x-rdoc", // no highlighting so far + builder: "text/x-builder", // no highlighting so far + nokogiri: "text/x-nokogiri", // no highlighting so far + erb: "application/x-erb" + }; + var embeddedRegexp = function(map){ + var arr = []; + for(var key in map) arr.push(key); + return new RegExp("^("+arr.join('|')+"):"); + }(embedded); + + var styleMap = { + "commentLine": "comment", + "slimSwitch": "operator special", + "slimTag": "tag", + "slimId": "attribute def", + "slimClass": "attribute qualifier", + "slimAttribute": "attribute", + "slimSubmode": "keyword special", + "closeAttributeTag": null, + "slimDoctype": null, + "lineContinuation": null + }; + var closing = { + "{": "}", + "[": "]", + "(": ")" + }; + + var nameStartChar = "_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; + var nameChar = nameStartChar + "\\-0-9\xB7\u0300-\u036F\u203F-\u2040"; + var nameRegexp = new RegExp("^[:"+nameStartChar+"](?::["+nameChar+"]|["+nameChar+"]*)"); + var attributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*(?=\\s*=)"); + var wrappedAttributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*"); + var classNameRegexp = /^\.-?[_a-zA-Z]+[\w\-]*/; + var classIdRegexp = /^#[_a-zA-Z]+[\w\-]*/; + + function backup(pos, tokenize, style) { + var restore = function(stream, state) { + state.tokenize = tokenize; + if (stream.pos < pos) { + stream.pos = pos; + return style; + } + return state.tokenize(stream, state); + }; + return function(stream, state) { + state.tokenize = restore; + return tokenize(stream, state); + }; + } + + function maybeBackup(stream, state, pat, offset, style) { + var cur = stream.current(); + var idx = cur.search(pat); + if (idx > -1) { + state.tokenize = backup(stream.pos, state.tokenize, style); + stream.backUp(cur.length - idx - offset); + } + return style; + } + + function continueLine(state, column) { + state.stack = { + parent: state.stack, + style: "continuation", + indented: column, + tokenize: state.line + }; + state.line = state.tokenize; + } + function finishContinue(state) { + if (state.line == state.tokenize) { + state.line = state.stack.tokenize; + state.stack = state.stack.parent; + } + } + + function lineContinuable(column, tokenize) { + return function(stream, state) { + finishContinue(state); + if (stream.match(/^\\$/)) { + continueLine(state, column); + return "lineContinuation"; + } + var style = tokenize(stream, state); + if (stream.eol() && stream.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)) { + stream.backUp(1); + } + return style; + }; + } + function commaContinuable(column, tokenize) { + return function(stream, state) { + finishContinue(state); + var style = tokenize(stream, state); + if (stream.eol() && stream.current().match(/,$/)) { + continueLine(state, column); + } + return style; + }; + } + + function rubyInQuote(endQuote, tokenize) { + // TODO: add multi line support + return function(stream, state) { + var ch = stream.peek(); + if (ch == endQuote && state.rubyState.tokenize.length == 1) { + // step out of ruby context as it seems to complete processing all the braces + stream.next(); + state.tokenize = tokenize; + return "closeAttributeTag"; + } else { + return ruby(stream, state); + } + }; + } + function startRubySplat(tokenize) { + var rubyState; + var runSplat = function(stream, state) { + if (state.rubyState.tokenize.length == 1 && !state.rubyState.context.prev) { + stream.backUp(1); + if (stream.eatSpace()) { + state.rubyState = rubyState; + state.tokenize = tokenize; + return tokenize(stream, state); + } + stream.next(); + } + return ruby(stream, state); + }; + return function(stream, state) { + rubyState = state.rubyState; + state.rubyState = rubyMode.startState(); + state.tokenize = runSplat; + return ruby(stream, state); + }; + } + + function ruby(stream, state) { + return rubyMode.token(stream, state.rubyState); + } + + function htmlLine(stream, state) { + if (stream.match(/^\\$/)) { + return "lineContinuation"; + } + return html(stream, state); + } + function html(stream, state) { + if (stream.match(/^#\{/)) { + state.tokenize = rubyInQuote("}", state.tokenize); + return null; + } + return maybeBackup(stream, state, /[^\\]#\{/, 1, htmlMode.token(stream, state.htmlState)); + } + + function startHtmlLine(lastTokenize) { + return function(stream, state) { + var style = htmlLine(stream, state); + if (stream.eol()) state.tokenize = lastTokenize; + return style; + }; + } + + function startHtmlMode(stream, state, offset) { + state.stack = { + parent: state.stack, + style: "html", + indented: stream.column() + offset, // pipe + space + tokenize: state.line + }; + state.line = state.tokenize = html; + return null; + } + + function comment(stream, state) { + stream.skipToEnd(); + return state.stack.style; + } + + function commentMode(stream, state) { + state.stack = { + parent: state.stack, + style: "comment", + indented: state.indented + 1, + tokenize: state.line + }; + state.line = comment; + return comment(stream, state); + } + + function attributeWrapper(stream, state) { + if (stream.eat(state.stack.endQuote)) { + state.line = state.stack.line; + state.tokenize = state.stack.tokenize; + state.stack = state.stack.parent; + return null; + } + if (stream.match(wrappedAttributeNameRegexp)) { + state.tokenize = attributeWrapperAssign; + return "slimAttribute"; + } + stream.next(); + return null; + } + function attributeWrapperAssign(stream, state) { + if (stream.match(/^==?/)) { + state.tokenize = attributeWrapperValue; + return null; + } + return attributeWrapper(stream, state); + } + function attributeWrapperValue(stream, state) { + var ch = stream.peek(); + if (ch == '"' || ch == "\'") { + state.tokenize = readQuoted(ch, "string", true, false, attributeWrapper); + stream.next(); + return state.tokenize(stream, state); + } + if (ch == '[') { + return startRubySplat(attributeWrapper)(stream, state); + } + if (stream.match(/^(true|false|nil)\b/)) { + state.tokenize = attributeWrapper; + return "keyword"; + } + return startRubySplat(attributeWrapper)(stream, state); + } + + function startAttributeWrapperMode(state, endQuote, tokenize) { + state.stack = { + parent: state.stack, + style: "wrapper", + indented: state.indented + 1, + tokenize: tokenize, + line: state.line, + endQuote: endQuote + }; + state.line = state.tokenize = attributeWrapper; + return null; + } + + function sub(stream, state) { + if (stream.match(/^#\{/)) { + state.tokenize = rubyInQuote("}", state.tokenize); + return null; + } + var subStream = new CodeMirror.StringStream(stream.string.slice(state.stack.indented), stream.tabSize); + subStream.pos = stream.pos - state.stack.indented; + subStream.start = stream.start - state.stack.indented; + subStream.lastColumnPos = stream.lastColumnPos - state.stack.indented; + subStream.lastColumnValue = stream.lastColumnValue - state.stack.indented; + var style = state.subMode.token(subStream, state.subState); + stream.pos = subStream.pos + state.stack.indented; + return style; + } + function firstSub(stream, state) { + state.stack.indented = stream.column(); + state.line = state.tokenize = sub; + return state.tokenize(stream, state); + } + + function createMode(mode) { + var query = embedded[mode]; + var spec = CodeMirror.mimeModes[query]; + if (spec) { + return CodeMirror.getMode(config, spec); + } + var factory = CodeMirror.modes[query]; + if (factory) { + return factory(config, {name: query}); + } + return CodeMirror.getMode(config, "null"); + } + + function getMode(mode) { + if (!modes.hasOwnProperty(mode)) { + return modes[mode] = createMode(mode); + } + return modes[mode]; + } + + function startSubMode(mode, state) { + var subMode = getMode(mode); + var subState = subMode.startState && subMode.startState(); + + state.subMode = subMode; + state.subState = subState; + + state.stack = { + parent: state.stack, + style: "sub", + indented: state.indented + 1, + tokenize: state.line + }; + state.line = state.tokenize = firstSub; + return "slimSubmode"; + } + + function doctypeLine(stream, _state) { + stream.skipToEnd(); + return "slimDoctype"; + } + + function startLine(stream, state) { + var ch = stream.peek(); + if (ch == '<') { + return (state.tokenize = startHtmlLine(state.tokenize))(stream, state); + } + if (stream.match(/^[|']/)) { + return startHtmlMode(stream, state, 1); + } + if (stream.match(/^\/(!|\[\w+])?/)) { + return commentMode(stream, state); + } + if (stream.match(/^(-|==?[<>]?)/)) { + state.tokenize = lineContinuable(stream.column(), commaContinuable(stream.column(), ruby)); + return "slimSwitch"; + } + if (stream.match(/^doctype\b/)) { + state.tokenize = doctypeLine; + return "keyword"; + } + + var m = stream.match(embeddedRegexp); + if (m) { + return startSubMode(m[1], state); + } + + return slimTag(stream, state); + } + + function slim(stream, state) { + if (state.startOfLine) { + return startLine(stream, state); + } + return slimTag(stream, state); + } + + function slimTag(stream, state) { + if (stream.eat('*')) { + state.tokenize = startRubySplat(slimTagExtras); + return null; + } + if (stream.match(nameRegexp)) { + state.tokenize = slimTagExtras; + return "slimTag"; + } + return slimClass(stream, state); + } + function slimTagExtras(stream, state) { + if (stream.match(/^(<>?|> state.indented && state.last != "slimSubmode") { + state.line = state.tokenize = state.stack.tokenize; + state.stack = state.stack.parent; + state.subMode = null; + state.subState = null; + } + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + state.startOfLine = false; + if (style) state.last = style; + return styleMap.hasOwnProperty(style) ? styleMap[style] : style; + }, + + blankLine: function(state) { + if (state.subMode && state.subMode.blankLine) { + return state.subMode.blankLine(state.subState); + } + }, + + innerMode: function(state) { + if (state.subMode) return {state: state.subState, mode: state.subMode}; + return {state: state, mode: mode}; + } + + //indent: function(state) { + // return state.indented; + //} + }; + return mode; + }, "htmlmixed", "ruby"); + + CodeMirror.defineMIME("text/x-slim", "slim"); + CodeMirror.defineMIME("application/x-slim", "slim"); +}); diff --git a/deploy/core/node_modules/codemirror/mode/slim/test.js b/deploy/core/node_modules/codemirror/mode/slim/test.js new file mode 100644 index 000000000..be4ddacb6 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/slim/test.js @@ -0,0 +1,96 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh + +(function() { + var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "slim"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + // Requires at least one media query + MT("elementName", + "[tag h1] Hey There"); + + MT("oneElementPerLine", + "[tag h1] Hey There .h2"); + + MT("idShortcut", + "[attribute&def #test] Hey There"); + + MT("tagWithIdShortcuts", + "[tag h1][attribute&def #test] Hey There"); + + MT("classShortcut", + "[attribute&qualifier .hello] Hey There"); + + MT("tagWithIdAndClassShortcuts", + "[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"); + + MT("docType", + "[keyword doctype] xml"); + + MT("comment", + "[comment / Hello WORLD]"); + + MT("notComment", + "[tag h1] This is not a / comment "); + + MT("attributes", + "[tag a]([attribute title]=[string \"test\"]) [attribute href]=[string \"link\"]}"); + + MT("multiLineAttributes", + "[tag a]([attribute title]=[string \"test\"]", + " ) [attribute href]=[string \"link\"]}"); + + MT("htmlCode", + "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); + + MT("rubyBlock", + "[operator&special =][variable-2 @item]"); + + MT("selectorRubyBlock", + "[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"); + + MT("nestedRubyBlock", + "[tag a]", + " [operator&special =][variable puts] [string \"test\"]"); + + MT("multilinePlaintext", + "[tag p]", + " | Hello,", + " World"); + + MT("multilineRuby", + "[tag p]", + " [comment /# this is a comment]", + " [comment and this is a comment too]", + " | Date/Time", + " [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]", + " [tag strong][operator&special =] [variable now]", + " [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", + " [operator&special =][string \"Happy\"]", + " [operator&special =][string \"Belated\"]", + " [operator&special =][string \"Birthday\"]"); + + MT("multilineComment", + "[comment /]", + " [comment Multiline]", + " [comment Comment]"); + + MT("hamlAfterRubyTag", + "[attribute&qualifier .block]", + " [tag strong][operator&special =] [variable now]", + " [attribute&qualifier .test]", + " [operator&special =][variable now]", + " [attribute&qualifier .right]"); + + MT("stretchedRuby", + "[operator&special =] [variable puts] [string \"Hello\"],", + " [string \"World\"]"); + + MT("interpolationInHashAttribute", + "[tag div]{[attribute id] = [string \"]#{[variable test]}[string _]#{[variable ting]}[string \"]} test"); + + MT("interpolationInHTMLAttribute", + "[tag div]([attribute title]=[string \"]#{[variable test]}[string _]#{[variable ting]()}[string \"]) Test"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/smalltalk/index.html b/deploy/core/node_modules/codemirror/mode/smalltalk/index.html new file mode 100644 index 000000000..2155ebc2a --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/smalltalk/index.html @@ -0,0 +1,68 @@ + + +CodeMirror: Smalltalk mode + + + + + + + + + + +
+

Smalltalk mode

+
+ + + +

Simple Smalltalk mode.

+ +

MIME types defined: text/x-stsrc.

+
diff --git a/deploy/core/node_modules/codemirror/modes/smalltalk.js b/deploy/core/node_modules/codemirror/mode/smalltalk/smalltalk.js similarity index 86% rename from deploy/core/node_modules/codemirror/modes/smalltalk.js rename to deploy/core/node_modules/codemirror/mode/smalltalk/smalltalk.js index f2d4cb318..bb510ba2e 100644 --- a/deploy/core/node_modules/codemirror/modes/smalltalk.js +++ b/deploy/core/node_modules/codemirror/mode/smalltalk/smalltalk.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode('smalltalk', function(config) { var specialChars = /[+\-\/\\*~<>=@%|&?!.,:;^]/; @@ -40,13 +53,15 @@ CodeMirror.defineMode('smalltalk', function(config) { stream.next(); token = nextSymbol(stream, new Context(nextSymbol, context)); } else { - stream.eatWhile(/[^ .\[\]()]/); - token.name = 'string-2'; + if (stream.eatWhile(/[^\s.{}\[\]()]/)) + token.name = 'string-2'; + else + token.name = 'meta'; } } else if (aChar === '$') { if (stream.next() === '<') { - stream.eatWhile(/[^ >]/); + stream.eatWhile(/[^\s>]/); stream.next(); } token.name = 'string-2'; @@ -149,3 +164,5 @@ CodeMirror.defineMode('smalltalk', function(config) { }); CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/smarty/index.html b/deploy/core/node_modules/codemirror/mode/smarty/index.html new file mode 100644 index 000000000..8d88c9a30 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/smarty/index.html @@ -0,0 +1,136 @@ + + +CodeMirror: Smarty mode + + + + + + + + + +
+

Smarty mode

+
+ + + +
+ +

Smarty 2, custom delimiters

+
+ + + +
+ +

Smarty 3

+ + + + + + +

A plain text/Smarty version 2 or 3 mode, which allows for custom delimiter tags.

+ +

MIME types defined: text/x-smarty

+
diff --git a/deploy/core/node_modules/codemirror/modes/smarty.js b/deploy/core/node_modules/codemirror/mode/smarty/smarty.js similarity index 92% rename from deploy/core/node_modules/codemirror/modes/smarty.js rename to deploy/core/node_modules/codemirror/mode/smarty/smarty.js index 826c2b966..bb053245d 100644 --- a/deploy/core/node_modules/codemirror/modes/smarty.js +++ b/deploy/core/node_modules/codemirror/mode/smarty/smarty.js @@ -1,6 +1,20 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Smarty 2 and 3 mode. */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("smarty", function(config) { "use strict"; @@ -203,3 +217,5 @@ CodeMirror.defineMode("smarty", function(config) { }); CodeMirror.defineMIME("text/x-smarty", "smarty"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/smartymixed/index.html b/deploy/core/node_modules/codemirror/mode/smartymixed/index.html new file mode 100644 index 000000000..3a216abb4 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/smartymixed/index.html @@ -0,0 +1,114 @@ + + +CodeMirror: Smarty mixed mode + + + + + + + + + + + + + +
+

Smarty mixed mode

+
+ + + +

The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML + mixed mode itself depends on XML, JavaScript, and CSS modes.

+ +

It takes the same options, as Smarty and HTML mixed modes.

+ +

MIME types defined: text/x-smarty.

+
diff --git a/deploy/core/node_modules/codemirror/modes/smartymixed.js b/deploy/core/node_modules/codemirror/mode/smartymixed/smartymixed.js similarity index 76% rename from deploy/core/node_modules/codemirror/modes/smartymixed.js rename to deploy/core/node_modules/codemirror/mode/smartymixed/smartymixed.js index a033ab04f..4fc7ca4b6 100644 --- a/deploy/core/node_modules/codemirror/modes/smartymixed.js +++ b/deploy/core/node_modules/codemirror/mode/smartymixed/smartymixed.js @@ -1,3 +1,6 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * @file smartymixed.js * @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML) @@ -5,12 +8,25 @@ * @version 3.0 * @date 05.07.2013 */ + +// Warning: Don't base other modes on this one. This here is a +// terrible way to write a mixed mode. + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../smarty/smarty")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../smarty/smarty"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("smartymixed", function(config) { - var settings, regs, helpers, parsers, - htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"), - smartyMode = CodeMirror.getMode(config, "smarty"), + var htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"); + var smartyMode = CodeMirror.getMode(config, "smarty"); - settings = { + var settings = { rightDelimiter: '}', leftDelimiter: '{' }; @@ -22,15 +38,18 @@ CodeMirror.defineMode("smartymixed", function(config) { settings.rightDelimiter = config.rightDelimiter; } - regs = { - smartyComment: new RegExp("^" + settings.leftDelimiter + "\\*"), - literalOpen: new RegExp(settings.leftDelimiter + "literal" + settings.rightDelimiter), - literalClose: new RegExp(settings.leftDelimiter + "\/literal" + settings.rightDelimiter), - hasLeftDelimeter: new RegExp(".*" + settings.leftDelimiter), - htmlHasLeftDelimeter: new RegExp("[^<>]*" + settings.leftDelimiter) + function reEsc(str) { return str.replace(/[^\s\w]/g, "\\$&"); } + + var reLeft = reEsc(settings.leftDelimiter), reRight = reEsc(settings.rightDelimiter); + var regs = { + smartyComment: new RegExp("^" + reRight + "\\*"), + literalOpen: new RegExp(reLeft + "literal" + reRight), + literalClose: new RegExp(reLeft + "\/literal" + reRight), + hasLeftDelimeter: new RegExp(".*" + reLeft), + htmlHasLeftDelimeter: new RegExp("[^<>]*" + reLeft) }; - helpers = { + var helpers = { chain: function(stream, state, parser) { state.tokenize = parser; return parser(stream, state); @@ -56,9 +75,13 @@ CodeMirror.defineMode("smartymixed", function(config) { } }; - parsers = { + var parsers = { html: function(stream, state) { - if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && state.htmlMixedState.htmlState.tagName === null) { + var htmlTagName = state.htmlMixedState.htmlState.context && state.htmlMixedState.htmlState.context.tagName + ? state.htmlMixedState.htmlState.context.tagName + : null; + + if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && htmlTagName === null) { state.tokenize = parsers.smarty; state.localMode = smartyMode; state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); @@ -159,8 +182,6 @@ CodeMirror.defineMode("smartymixed", function(config) { return htmlMixedMode.indent(state.htmlMixedState, textAfter); }, - electricChars: "/{}:", - innerMode: function(state) { return { state: state.localState || state.htmlMixedState, @@ -168,8 +189,9 @@ CodeMirror.defineMode("smartymixed", function(config) { }; } }; -}, -"htmlmixed"); +}, "htmlmixed", "smarty"); CodeMirror.defineMIME("text/x-smarty", "smartymixed"); // vim: et ts=2 sts=2 sw=2 + +}); diff --git a/deploy/core/node_modules/codemirror/mode/solr/index.html b/deploy/core/node_modules/codemirror/mode/solr/index.html new file mode 100644 index 000000000..4b18c25b7 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/solr/index.html @@ -0,0 +1,57 @@ + + +CodeMirror: Solr mode + + + + + + + + + +
+

Solr mode

+ +
+ +
+ + + +

MIME types defined: text/x-solr.

+
diff --git a/deploy/core/node_modules/codemirror/mode/solr/solr.js b/deploy/core/node_modules/codemirror/mode/solr/solr.js new file mode 100644 index 000000000..f7f708789 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/solr/solr.js @@ -0,0 +1,104 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("solr", function() { + "use strict"; + + var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/; + var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/; + var isOperatorString = /^(OR|AND|NOT|TO)$/i; + + function isNumber(word) { + return parseFloat(word, 10).toString() === word; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + + if (!escaped) state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenOperator(operator) { + return function(stream, state) { + var style = "operator"; + if (operator == "+") + style += " positive"; + else if (operator == "-") + style += " negative"; + else if (operator == "|") + stream.eat(/\|/); + else if (operator == "&") + stream.eat(/\&/); + else if (operator == "^") + style += " boost"; + + state.tokenize = tokenBase; + return style; + }; + } + + function tokenWord(ch) { + return function(stream, state) { + var word = ch; + while ((ch = stream.peek()) && ch.match(isStringChar) != null) { + word += stream.next(); + } + + state.tokenize = tokenBase; + if (isOperatorString.test(word)) + return "operator"; + else if (isNumber(word)) + return "number"; + else if (stream.peek() == ":") + return "field"; + else + return "string"; + }; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"') + state.tokenize = tokenString(ch); + else if (isOperatorChar.test(ch)) + state.tokenize = tokenOperator(ch); + else if (isStringChar.test(ch)) + state.tokenize = tokenWord(ch); + + return (state.tokenize != tokenBase) ? state.tokenize(stream, state) : null; + } + + return { + startState: function() { + return { + tokenize: tokenBase + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/x-solr", "solr"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/sparql/index.html b/deploy/core/node_modules/codemirror/mode/sparql/index.html new file mode 100644 index 000000000..6f24206b1 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/sparql/index.html @@ -0,0 +1,53 @@ + + +CodeMirror: SPARQL mode + + + + + + + + + + +
+

SPARQL mode

+
+ + +

MIME types defined: application/x-sparql-query.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/sparql.js b/deploy/core/node_modules/codemirror/mode/sparql/sparql.js similarity index 91% rename from deploy/core/node_modules/codemirror/modes/sparql.js rename to deploy/core/node_modules/codemirror/mode/sparql/sparql.js index 0329057f6..64dbb612c 100644 --- a/deploy/core/node_modules/codemirror/modes/sparql.js +++ b/deploy/core/node_modules/codemirror/mode/sparql/sparql.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("sparql", function(config) { var indentUnit = config.indentUnit; var curPunc; @@ -143,3 +156,5 @@ CodeMirror.defineMode("sparql", function(config) { }); CodeMirror.defineMIME("application/x-sparql-query", "sparql"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/sql/index.html b/deploy/core/node_modules/codemirror/mode/sql/index.html new file mode 100644 index 000000000..a0d8d9e1b --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/sql/index.html @@ -0,0 +1,84 @@ + + +CodeMirror: SQL Mode for CodeMirror + + + + + + + + + + + + +
+

SQL Mode for CodeMirror

+
+ +
+

MIME types defined: + text/x-sql, + text/x-mysql, + text/x-mariadb, + text/x-cassandra, + text/x-plsql, + text/x-mssql, + text/x-hive. +

+ + +
diff --git a/deploy/core/node_modules/codemirror/modes/sql.js b/deploy/core/node_modules/codemirror/mode/sql/sql.js similarity index 81% rename from deploy/core/node_modules/codemirror/modes/sql.js rename to deploy/core/node_modules/codemirror/mode/sql/sql.js index 3be68caa1..799492f51 100644 --- a/deploy/core/node_modules/codemirror/modes/sql.js +++ b/deploy/core/node_modules/codemirror/mode/sql/sql.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("sql", function(config, parserConfig) { "use strict"; @@ -177,9 +190,10 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { indent: function(state, textAfter) { var cx = state.context; - if (!cx) return CodeMirror.Pass; - if (cx.align) return cx.col + (textAfter.charAt(0) == cx.type ? 0 : 1); - else return cx.indent + config.indentUnit; + if (!cx) return 0; + var closing = textAfter.charAt(0) == cx.type; + if (cx.align) return cx.col + (closing ? 0 : 1); + else return cx.indent + (closing ? 0 : config.indentUnit); }, blockCommentStart: "/*", @@ -199,7 +213,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { while ((ch = stream.next()) != null) { if (ch == "`" && !stream.eat("`")) return "variable-2"; } - return null; + stream.backUp(stream.current().length - 1); + return stream.eatWhile(/\w/) ? "variable-2" : null; } // variable token @@ -325,14 +340,27 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { CodeMirror.defineMIME("text/x-plsql", { name: "sql", client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), - keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), - builtin: set("bfile blob character clob dec float int integer mlslabel natural naturaln nchar nclob number numeric nvarchar2 real rowtype signtype smallint string varchar varchar2 abs acos add_months ascii asin atan atan2 average bfilename ceil chartorowid chr concat convert cos cosh count decode deref dual dump dup_val_on_index empty error exp false floor found glb greatest hextoraw initcap instr instrb isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mod months_between new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null nvl others power rawtohex reftohex round rowcount rowidtochar rpad rtrim sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid upper user userenv variance vsize"), + keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), + builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), operatorChars: /^[*+\-%<>!=~]/, dateSQL: set("date time timestamp"), support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") }); + + // Created to support specific hive keywords + CodeMirror.defineMIME("text/x-hive", { + name: "sql", + keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), + builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, + dateSQL: set("date timestamp"), + support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") + }); }()); +}); + /* How Properties of Mime Types are used by SQL Mode ================================================= diff --git a/deploy/core/node_modules/codemirror/mode/stex/index.html b/deploy/core/node_modules/codemirror/mode/stex/index.html new file mode 100644 index 000000000..14679da4f --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/stex/index.html @@ -0,0 +1,110 @@ + + +CodeMirror: sTeX mode + + + + + + + + + +
+

sTeX mode

+
+ + +

MIME types defined: text/x-stex.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/stex.js b/deploy/core/node_modules/codemirror/mode/stex/stex.js similarity index 93% rename from deploy/core/node_modules/codemirror/modes/stex.js rename to deploy/core/node_modules/codemirror/mode/stex/stex.js index ca04c24f2..14f6fcc3c 100644 --- a/deploy/core/node_modules/codemirror/modes/stex.js +++ b/deploy/core/node_modules/codemirror/mode/stex/stex.js @@ -1,8 +1,21 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) * Licence: MIT */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("stex", function() { "use strict"; @@ -238,9 +251,12 @@ CodeMirror.defineMode("stex", function() { }, token: function(stream, state) { return state.f(stream, state); - } + }, + lineComment: "%" }; }); CodeMirror.defineMIME("text/x-stex", "stex"); CodeMirror.defineMIME("text/x-latex", "stex"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/stex/test.js b/deploy/core/node_modules/codemirror/mode/stex/test.js new file mode 100644 index 000000000..22f027ec7 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/stex/test.js @@ -0,0 +1,123 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "stex"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("word", + "foo"); + + MT("twoWords", + "foo bar"); + + MT("beginEndDocument", + "[tag \\begin][bracket {][atom document][bracket }]", + "[tag \\end][bracket {][atom document][bracket }]"); + + MT("beginEndEquation", + "[tag \\begin][bracket {][atom equation][bracket }]", + " E=mc^2", + "[tag \\end][bracket {][atom equation][bracket }]"); + + MT("beginModule", + "[tag \\begin][bracket {][atom module][bracket }[[]]]"); + + MT("beginModuleId", + "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); + + MT("importModule", + "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); + + MT("importModulePath", + "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); + + MT("psForPDF", + "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); + + MT("comment", + "[comment % foo]"); + + MT("tagComment", + "[tag \\item][comment % bar]"); + + MT("commentTag", + " [comment % \\item]"); + + MT("commentLineBreak", + "[comment %]", + "foo"); + + MT("tagErrorCurly", + "[tag \\begin][error }][bracket {]"); + + MT("tagErrorSquare", + "[tag \\item][error ]]][bracket {]"); + + MT("commentCurly", + "[comment % }]"); + + MT("tagHash", + "the [tag \\#] key"); + + MT("tagNumber", + "a [tag \\$][atom 5] stetson"); + + MT("tagPercent", + "[atom 100][tag \\%] beef"); + + MT("tagAmpersand", + "L [tag \\&] N"); + + MT("tagUnderscore", + "foo[tag \\_]bar"); + + MT("tagBracketOpen", + "[tag \\emph][bracket {][tag \\{][bracket }]"); + + MT("tagBracketClose", + "[tag \\emph][bracket {][tag \\}][bracket }]"); + + MT("tagLetterNumber", + "section [tag \\S][atom 1]"); + + MT("textTagNumber", + "para [tag \\P][atom 2]"); + + MT("thinspace", + "x[tag \\,]y"); + + MT("thickspace", + "x[tag \\;]y"); + + MT("negativeThinspace", + "x[tag \\!]y"); + + MT("periodNotSentence", + "J.\\ L.\\ is"); + + MT("periodSentence", + "X[tag \\@]. The"); + + MT("italicCorrection", + "[bracket {][tag \\em] If[tag \\/][bracket }] I"); + + MT("tagBracket", + "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); + + MT("inlineMathTagFollowedByNumber", + "[keyword $][tag \\pi][number 2][keyword $]"); + + MT("inlineMath", + "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); + + MT("displayMath", + "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); + + MT("mathWithComment", + "[keyword $][variable-2 x] [comment % $]", + "[variable-2 y][keyword $] other text"); + + MT("lineBreakArgument", + "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/tcl/index.html b/deploy/core/node_modules/codemirror/mode/tcl/index.html new file mode 100644 index 000000000..ce4ad3423 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tcl/index.html @@ -0,0 +1,142 @@ + + +CodeMirror: Tcl mode + + + + + + + + + + +
+

Tcl mode

+
+ + +

MIME types defined: text/x-tcl.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/tcl.js b/deploy/core/node_modules/codemirror/mode/tcl/tcl.js similarity index 89% rename from deploy/core/node_modules/codemirror/modes/tcl.js rename to deploy/core/node_modules/codemirror/mode/tcl/tcl.js index ed2c69721..056accb2d 100644 --- a/deploy/core/node_modules/codemirror/modes/tcl.js +++ b/deploy/core/node_modules/codemirror/mode/tcl/tcl.js @@ -1,4 +1,18 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + //tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("tcl", function() { function parseWords(str) { var obj = {}, words = str.split(" "); @@ -64,7 +78,7 @@ CodeMirror.defineMode("tcl", function() { return "comment"; } else { - stream.eatWhile(/[\w\$_{}]/); + stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); var word = stream.current().toLowerCase(); if (keywords && keywords.propertyIsEnumerable(word)) return "keyword"; @@ -129,3 +143,5 @@ CodeMirror.defineMode("tcl", function() { }; }); CodeMirror.defineMIME("text/x-tcl", "tcl"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/textile/index.html b/deploy/core/node_modules/codemirror/mode/textile/index.html new file mode 100644 index 000000000..42b156b1e --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/textile/index.html @@ -0,0 +1,191 @@ + + +CodeMirror: Textile mode + + + + + + + + + +
+

Textile mode

+
+ + +

MIME types defined: text/x-textile.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/textile/test.js b/deploy/core/node_modules/codemirror/mode/textile/test.js new file mode 100644 index 000000000..206ff57e4 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/textile/test.js @@ -0,0 +1,406 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, 'textile'); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT('simpleParagraphs', + 'Some text.', + '', + 'Some more text.'); + + /* + * Phrase Modifiers + */ + + MT('em', + 'foo [em _bar_]'); + + MT('emBoogus', + 'code_mirror'); + + MT('strong', + 'foo [strong *bar*]'); + + MT('strongBogus', + '3 * 3 = 9'); + + MT('italic', + 'foo [em __bar__]'); + + MT('italicBogus', + 'code__mirror'); + + MT('bold', + 'foo [strong **bar**]'); + + MT('boldBogus', + '3 ** 3 = 27'); + + MT('simpleLink', + '[link "CodeMirror":http://codemirror.net]'); + + MT('referenceLink', + '[link "CodeMirror":code_mirror]', + 'Normal Text.', + '[link [[code_mirror]]http://codemirror.net]'); + + MT('footCite', + 'foo bar[qualifier [[1]]]'); + + MT('footCiteBogus', + 'foo bar[[1a2]]'); + + MT('special-characters', + 'Registered [tag (r)], ' + + 'Trademark [tag (tm)], and ' + + 'Copyright [tag (c)] 2008'); + + MT('cite', + "A book is [keyword ??The Count of Monte Cristo??] by Dumas."); + + MT('additionAndDeletion', + 'The news networks declared [negative -Al Gore-] ' + + '[positive +George W. Bush+] the winner in Florida.'); + + MT('subAndSup', + 'f(x, n) = log [builtin ~4~] x [builtin ^n^]'); + + MT('spanAndCode', + 'A [quote %span element%] and [atom @code element@]'); + + MT('spanBogus', + 'Percentage 25% is not a span.'); + + MT('citeBogus', + 'Question? is not a citation.'); + + MT('codeBogus', + 'user@example.com'); + + MT('subBogus', + '~username'); + + MT('supBogus', + 'foo ^ bar'); + + MT('deletionBogus', + '3 - 3 = 0'); + + MT('additionBogus', + '3 + 3 = 6'); + + MT('image', + 'An image: [string !http://www.example.com/image.png!]'); + + MT('imageWithAltText', + 'An image: [string !http://www.example.com/image.png (Alt Text)!]'); + + MT('imageWithUrl', + 'An image: [string !http://www.example.com/image.png!:http://www.example.com/]'); + + /* + * Headers + */ + + MT('h1', + '[header&header-1 h1. foo]'); + + MT('h2', + '[header&header-2 h2. foo]'); + + MT('h3', + '[header&header-3 h3. foo]'); + + MT('h4', + '[header&header-4 h4. foo]'); + + MT('h5', + '[header&header-5 h5. foo]'); + + MT('h6', + '[header&header-6 h6. foo]'); + + MT('h7Bogus', + 'h7. foo'); + + MT('multipleHeaders', + '[header&header-1 h1. Heading 1]', + '', + 'Some text.', + '', + '[header&header-2 h2. Heading 2]', + '', + 'More text.'); + + MT('h1inline', + '[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]'); + + /* + * Lists + */ + + MT('ul', + 'foo', + 'bar', + '', + '[variable-2 * foo]', + '[variable-2 * bar]'); + + MT('ulNoBlank', + 'foo', + 'bar', + '[variable-2 * foo]', + '[variable-2 * bar]'); + + MT('ol', + 'foo', + 'bar', + '', + '[variable-2 # foo]', + '[variable-2 # bar]'); + + MT('olNoBlank', + 'foo', + 'bar', + '[variable-2 # foo]', + '[variable-2 # bar]'); + + MT('ulFormatting', + '[variable-2 * ][variable-2&em _foo_][variable-2 bar]', + '[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' + + '[variable-2&strong *][variable-2 bar]', + '[variable-2 * ][variable-2&strong *foo*][variable-2 bar]'); + + MT('olFormatting', + '[variable-2 # ][variable-2&em _foo_][variable-2 bar]', + '[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' + + '[variable-2&strong *][variable-2 bar]', + '[variable-2 # ][variable-2&strong *foo*][variable-2 bar]'); + + MT('ulNested', + '[variable-2 * foo]', + '[variable-3 ** bar]', + '[keyword *** bar]', + '[variable-2 **** bar]', + '[variable-3 ** bar]'); + + MT('olNested', + '[variable-2 # foo]', + '[variable-3 ## bar]', + '[keyword ### bar]', + '[variable-2 #### bar]', + '[variable-3 ## bar]'); + + MT('ulNestedWithOl', + '[variable-2 * foo]', + '[variable-3 ## bar]', + '[keyword *** bar]', + '[variable-2 #### bar]', + '[variable-3 ** bar]'); + + MT('olNestedWithUl', + '[variable-2 # foo]', + '[variable-3 ** bar]', + '[keyword ### bar]', + '[variable-2 **** bar]', + '[variable-3 ## bar]'); + + MT('definitionList', + '[number - coffee := Hot ][number&em _and_][number black]', + '', + 'Normal text.'); + + MT('definitionListSpan', + '[number - coffee :=]', + '', + '[number Hot ][number&em _and_][number black =:]', + '', + 'Normal text.'); + + MT('boo', + '[number - dog := woof woof]', + '[number - cat := meow meow]', + '[number - whale :=]', + '[number Whale noises.]', + '', + '[number Also, ][number&em _splashing_][number . =:]'); + + /* + * Attributes + */ + + MT('divWithAttribute', + '[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]'); + + MT('divWithAttributeAnd2emRightPadding', + '[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]'); + + MT('divWithClassAndId', + '[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]'); + + MT('paragraphWithCss', + 'p[attribute {color:red;}]. foo bar'); + + MT('paragraphNestedStyles', + 'p. [strong *foo ][strong&em _bar_][strong *]'); + + MT('paragraphWithLanguage', + 'p[attribute [[fr]]]. Parlez-vous français?'); + + MT('paragraphLeftAlign', + 'p[attribute <]. Left'); + + MT('paragraphRightAlign', + 'p[attribute >]. Right'); + + MT('paragraphRightAlign', + 'p[attribute =]. Center'); + + MT('paragraphJustified', + 'p[attribute <>]. Justified'); + + MT('paragraphWithLeftIndent1em', + 'p[attribute (]. Left'); + + MT('paragraphWithRightIndent1em', + 'p[attribute )]. Right'); + + MT('paragraphWithLeftIndent2em', + 'p[attribute ((]. Left'); + + MT('paragraphWithRightIndent2em', + 'p[attribute ))]. Right'); + + MT('paragraphWithLeftIndent3emRightIndent2em', + 'p[attribute ((())]. Right'); + + MT('divFormatting', + '[punctuation div. ][punctuation&strong *foo ]' + + '[punctuation&strong&em _bar_][punctuation&strong *]'); + + MT('phraseModifierAttributes', + 'p[attribute (my-class)]. This is a paragraph that has a class and' + + ' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' + + ' has an id.'); + + MT('linkWithClass', + '[link "(my-class). This is a link with class":http://redcloth.org]'); + + /* + * Layouts + */ + + MT('paragraphLayouts', + 'p. This is one paragraph.', + '', + 'p. This is another.'); + + MT('div', + '[punctuation div. foo bar]'); + + MT('pre', + '[operator pre. Text]'); + + MT('bq.', + '[bracket bq. foo bar]', + '', + 'Normal text.'); + + MT('footnote', + '[variable fn123. foo ][variable&strong *bar*]'); + + /* + * Spanning Layouts + */ + + MT('bq..ThenParagraph', + '[bracket bq.. foo bar]', + '', + '[bracket More quote.]', + 'p. Normal Text'); + + MT('bq..ThenH1', + '[bracket bq.. foo bar]', + '', + '[bracket More quote.]', + '[header&header-1 h1. Header Text]'); + + MT('bc..ThenParagraph', + '[atom bc.. # Some ruby code]', + '[atom obj = {foo: :bar}]', + '[atom puts obj]', + '', + '[atom obj[[:love]] = "*love*"]', + '[atom puts obj.love.upcase]', + '', + 'p. Normal text.'); + + MT('fn1..ThenParagraph', + '[variable fn1.. foo bar]', + '', + '[variable More.]', + 'p. Normal Text'); + + MT('pre..ThenParagraph', + '[operator pre.. foo bar]', + '', + '[operator More.]', + 'p. Normal Text'); + + /* + * Tables + */ + + MT('table', + '[variable-3&operator |_. name |_. age|]', + '[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]', + '[variable-3 |Florence| 6 |]', + '', + 'p. Normal text.'); + + MT('tableWithAttributes', + '[variable-3&operator |_. name |_. age|]', + '[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]', + '[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]'); + + /* + * HTML + */ + + MT('html', + '[comment
]', + '[comment
]', + '', + '[header&header-1 h1. Welcome]', + '', + '[variable-2 * Item one]', + '[variable-2 * Item two]', + '', + '[comment Example]', + '', + '[comment
]', + '[comment
]'); + + MT('inlineHtml', + 'I can use HTML directly in my [comment Textile].'); + + /* + * No-Textile + */ + + MT('notextile', + '[string-2 notextile. *No* formatting]'); + + MT('notextileInline', + 'Use [string-2 ==*asterisks*==] for [strong *strong*] text.'); + + MT('notextileWithPre', + '[operator pre. *No* formatting]'); + + MT('notextileWithSpanningPre', + '[operator pre.. *No* formatting]', + '', + '[operator *No* formatting]'); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/textile/textile.js b/deploy/core/node_modules/codemirror/mode/textile/textile.js new file mode 100644 index 000000000..b1511a566 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/textile/textile.js @@ -0,0 +1,553 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == 'object' && typeof module == 'object') { // CommonJS + mod(require('../../lib/codemirror')); + } else if (typeof define == 'function' && define.amd) { // AMD + define(['../../lib/codemirror'], mod); + } else { // Plain browser env + mod(CodeMirror); + } +})(function(CodeMirror) { +'use strict'; + +var TOKEN_STYLES = { + addition: 'positive', + attributes: 'attribute', + bold: 'strong', + cite: 'keyword', + code: 'atom', + definitionList: 'number', + deletion: 'negative', + div: 'punctuation', + em: 'em', + footnote: 'variable', + footCite: 'qualifier', + header: 'header', + html: 'comment', + image: 'string', + italic: 'em', + link: 'link', + linkDefinition: 'link', + list1: 'variable-2', + list2: 'variable-3', + list3: 'keyword', + notextile: 'string-2', + pre: 'operator', + p: 'property', + quote: 'bracket', + span: 'quote', + specialChar: 'tag', + strong: 'strong', + sub: 'builtin', + sup: 'builtin', + table: 'variable-3', + tableHeading: 'operator' +}; + +function Parser(regExpFactory, state, stream) { + this.regExpFactory = regExpFactory; + this.state = state; + this.stream = stream; + this.styles = TOKEN_STYLES; + + this.state.specialChar = null; +} + +Parser.prototype.eat = function(name) { + return this.stream.match(this.regExpFactory.pattern(name), true); +}; + +Parser.prototype.check = function(name) { + return this.stream.match(this.regExpFactory.pattern(name), false); +}; + +Parser.prototype.setModeForNextToken = function(mode) { + return this.state.mode = mode; +}; + +Parser.prototype.execMode = function(newMode) { + return this.setModeForNextToken(newMode).call(this); +}; + +Parser.prototype.startNewLine = function() { + this.setModeForNextToken(Modes.newLayout); + this.state.tableHeading = false; + + if (this.state.layoutType === 'definitionList' && this.state.spanningLayout) { + if (this.check('definitionListEnd')) { + this.state.spanningLayout = false; + } + } +}; + +Parser.prototype.nextToken = function() { + return this.state.mode.call(this); +}; + +Parser.prototype.styleFor = function(token) { + if (this.styles.hasOwnProperty(token)) { + return this.styles[token]; + } + throw 'unknown token'; +}; + +Parser.prototype.handlePhraseModifier = function(ch) { + if (ch === '_') { + if (this.stream.eat('_')) { + return this.togglePhraseModifier('italic', /^.*__/); + } + return this.togglePhraseModifier('em', /^.*_/); + } + + if (ch === '*') { + if (this.stream.eat('*')) { + return this.togglePhraseModifier('bold', /^.*\*\*/); + } + return this.togglePhraseModifier('strong', /^.*\*/); + } + + if (ch === '[') { + if (this.stream.match(/\d+\]/)) { + this.state.footCite = true; + } + return this.tokenStyles(); + } + + if (ch === '(') { + if (this.stream.match('r)')) { + this.state.specialChar = 'r'; + } else if (this.stream.match('tm)')) { + this.state.specialChar = 'tm'; + } else if (this.stream.match('c)')) { + this.state.specialChar = 'c'; + } + return this.tokenStyles(); + } + + if (ch === '<') { + if (this.stream.match(/(\w+)[^>]+>[^<]+<\/\1>/)) { + return this.tokenStylesWith(this.styleFor('html')); + } + } + + if (ch === '?' && this.stream.eat('?')) { + return this.togglePhraseModifier('cite', /^.*\?\?/); + } + if (ch === '=' && this.stream.eat('=')) { + return this.togglePhraseModifier('notextile', /^.*==/); + } + if (ch === '-') { + return this.togglePhraseModifier('deletion', /^.*-/); + } + if (ch === '+') { + return this.togglePhraseModifier('addition', /^.*\+/); + } + if (ch === '~') { + return this.togglePhraseModifier('sub', /^.*~/); + } + if (ch === '^') { + return this.togglePhraseModifier('sup', /^.*\^/); + } + if (ch === '%') { + return this.togglePhraseModifier('span', /^.*%/); + } + if (ch === '@') { + return this.togglePhraseModifier('code', /^.*@/); + } + if (ch === '!') { + var type = this.togglePhraseModifier('image', /^.*(?:\([^\)]+\))?!/); + this.stream.match(/^:\S+/); // optional Url portion + return type; + } + return this.tokenStyles(); +}; + +Parser.prototype.togglePhraseModifier = function(phraseModifier, closeRE) { + if (this.state[phraseModifier]) { // remove phrase modifier + var type = this.tokenStyles(); + this.state[phraseModifier] = false; + return type; + } + if (this.stream.match(closeRE, false)) { // add phrase modifier + this.state[phraseModifier] = true; + this.setModeForNextToken(Modes.attributes); + } + return this.tokenStyles(); +}; + +Parser.prototype.tokenStyles = function() { + var disabled = this.textileDisabled(), + styles = []; + + if (disabled) return disabled; + + if (this.state.layoutType) { + styles.push(this.styleFor(this.state.layoutType)); + } + + styles = styles.concat(this.activeStyles('addition', 'bold', 'cite', 'code', + 'deletion', 'em', 'footCite', 'image', 'italic', 'link', 'span', 'specialChar', 'strong', + 'sub', 'sup', 'table', 'tableHeading')); + + if (this.state.layoutType === 'header') { + styles.push(this.styleFor('header') + '-' + this.state.header); + } + return styles.length ? styles.join(' ') : null; +}; + +Parser.prototype.textileDisabled = function() { + var type = this.state.layoutType; + + switch(type) { + case 'notextile': + case 'code': + case 'pre': + return this.styleFor(type); + default: + if (this.state.notextile) { + return this.styleFor('notextile') + (type ? (' ' + this.styleFor(type)) : ''); + } + + return null; + } +}; + +Parser.prototype.tokenStylesWith = function(extraStyles) { + var disabled = this.textileDisabled(), + type; + + if (disabled) return disabled; + + type = this.tokenStyles(); + if(extraStyles) { + return type ? (type + ' ' + extraStyles) : extraStyles; + } + return type; +}; + +Parser.prototype.activeStyles = function() { + var styles = [], + i; + for (i = 0; i < arguments.length; ++i) { + if (this.state[arguments[i]]) { + styles.push(this.styleFor(arguments[i])); + } + } + return styles; +}; + +Parser.prototype.blankLine = function() { + var spanningLayout = this.state.spanningLayout, + type = this.state.layoutType, + key; + + for (key in this.state) { + if (this.state.hasOwnProperty(key)) { + delete this.state[key]; + } + } + + this.setModeForNextToken(Modes.newLayout); + if (spanningLayout) { + this.state.layoutType = type; + this.state.spanningLayout = true; + } +}; + + +function RegExpFactory() { + this.cache = {}; + this.single = { + bc: 'bc', + bq: 'bq', + definitionList: /- [^(?::=)]+:=+/, + definitionListEnd: /.*=:\s*$/, + div: 'div', + drawTable: /\|.*\|/, + foot: /fn\d+/, + header: /h[1-6]/, + html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/, + link: /[^"]+":\S/, + linkDefinition: /\[[^\s\]]+\]\S+/, + list: /(?:#+|\*+)/, + notextile: 'notextile', + para: 'p', + pre: 'pre', + table: 'table', + tableCellAttributes: /[/\\]\d+/, + tableHeading: /\|_\./, + tableText: /[^"_\*\[\(\?\+~\^%@|-]+/, + text: /[^!"_=\*\[\(<\?\+~\^%@-]+/ + }; + this.attributes = { + align: /(?:<>|<|>|=)/, + selector: /\([^\(][^\)]+\)/, + lang: /\[[^\[\]]+\]/, + pad: /(?:\(+|\)+){1,2}/, + css: /\{[^\}]+\}/ + }; +} + +RegExpFactory.prototype.pattern = function(name) { + return (this.cache[name] || this.createRe(name)); +}; + +RegExpFactory.prototype.createRe = function(name) { + switch (name) { + case 'drawTable': + return this.makeRe('^', this.single.drawTable, '$'); + case 'html': + return this.makeRe('^', this.single.html, '(?:', this.single.html, ')*', '$'); + case 'linkDefinition': + return this.makeRe('^', this.single.linkDefinition, '$'); + case 'listLayout': + return this.makeRe('^', this.single.list, this.pattern('allAttributes'), '*\\s+'); + case 'tableCellAttributes': + return this.makeRe('^', this.choiceRe(this.single.tableCellAttributes, + this.pattern('allAttributes')), '+\\.'); + case 'type': + return this.makeRe('^', this.pattern('allTypes')); + case 'typeLayout': + return this.makeRe('^', this.pattern('allTypes'), this.pattern('allAttributes'), + '*\\.\\.?', '(\\s+|$)'); + case 'attributes': + return this.makeRe('^', this.pattern('allAttributes'), '+'); + + case 'allTypes': + return this.choiceRe(this.single.div, this.single.foot, + this.single.header, this.single.bc, this.single.bq, + this.single.notextile, this.single.pre, this.single.table, + this.single.para); + + case 'allAttributes': + return this.choiceRe(this.attributes.selector, this.attributes.css, + this.attributes.lang, this.attributes.align, this.attributes.pad); + + default: + return this.makeRe('^', this.single[name]); + } +}; + + +RegExpFactory.prototype.makeRe = function() { + var pattern = '', + i, + arg; + + for (i = 0; i < arguments.length; ++i) { + arg = arguments[i]; + pattern += (typeof arg === 'string') ? arg : arg.source; + } + return new RegExp(pattern); +}; + +RegExpFactory.prototype.choiceRe = function() { + var parts = [arguments[0]], + i; + + for (i = 1; i < arguments.length; ++i) { + parts[i * 2 - 1] = '|'; + parts[i * 2] = arguments[i]; + } + + parts.unshift('(?:'); + parts.push(')'); + return this.makeRe.apply(this, parts); +}; + + +var Modes = { + newLayout: function() { + if (this.check('typeLayout')) { + this.state.spanningLayout = false; + return this.execMode(Modes.blockType); + } + if (!this.textileDisabled()) { + if (this.check('listLayout')) { + return this.execMode(Modes.list); + } else if (this.check('drawTable')) { + return this.execMode(Modes.table); + } else if (this.check('linkDefinition')) { + return this.execMode(Modes.linkDefinition); + } else if (this.check('definitionList')) { + return this.execMode(Modes.definitionList); + } else if (this.check('html')) { + return this.execMode(Modes.html); + } + } + return this.execMode(Modes.text); + }, + + blockType: function() { + var match, + type; + this.state.layoutType = null; + + if (match = this.eat('type')) { + type = match[0]; + } else { + return this.execMode(Modes.text); + } + + if(match = type.match(this.regExpFactory.pattern('header'))) { + this.state.layoutType = 'header'; + this.state.header = parseInt(match[0][1]); + } else if (type.match(this.regExpFactory.pattern('bq'))) { + this.state.layoutType = 'quote'; + } else if (type.match(this.regExpFactory.pattern('bc'))) { + this.state.layoutType = 'code'; + } else if (type.match(this.regExpFactory.pattern('foot'))) { + this.state.layoutType = 'footnote'; + } else if (type.match(this.regExpFactory.pattern('notextile'))) { + this.state.layoutType = 'notextile'; + } else if (type.match(this.regExpFactory.pattern('pre'))) { + this.state.layoutType = 'pre'; + } else if (type.match(this.regExpFactory.pattern('div'))) { + this.state.layoutType = 'div'; + } else if (type.match(this.regExpFactory.pattern('table'))) { + this.state.layoutType = 'table'; + } + + this.setModeForNextToken(Modes.attributes); + return this.tokenStyles(); + }, + + text: function() { + if (this.eat('text')) { + return this.tokenStyles(); + } + + var ch = this.stream.next(); + + if (ch === '"') { + return this.execMode(Modes.link); + } + return this.handlePhraseModifier(ch); + }, + + attributes: function() { + this.setModeForNextToken(Modes.layoutLength); + + if (this.eat('attributes')) { + return this.tokenStylesWith(this.styleFor('attributes')); + } + return this.tokenStyles(); + }, + + layoutLength: function() { + if (this.stream.eat('.') && this.stream.eat('.')) { + this.state.spanningLayout = true; + } + + this.setModeForNextToken(Modes.text); + return this.tokenStyles(); + }, + + list: function() { + var match = this.eat('list'), + listMod; + this.state.listDepth = match[0].length; + listMod = (this.state.listDepth - 1) % 3; + if (!listMod) { + this.state.layoutType = 'list1'; + } else if (listMod === 1) { + this.state.layoutType = 'list2'; + } else { + this.state.layoutType = 'list3'; + } + this.setModeForNextToken(Modes.attributes); + return this.tokenStyles(); + }, + + link: function() { + this.setModeForNextToken(Modes.text); + if (this.eat('link')) { + this.stream.match(/\S+/); + return this.tokenStylesWith(this.styleFor('link')); + } + return this.tokenStyles(); + }, + + linkDefinition: function() { + this.stream.skipToEnd(); + return this.tokenStylesWith(this.styleFor('linkDefinition')); + }, + + definitionList: function() { + this.eat('definitionList'); + + this.state.layoutType = 'definitionList'; + + if (this.stream.match(/\s*$/)) { + this.state.spanningLayout = true; + } else { + this.setModeForNextToken(Modes.attributes); + } + return this.tokenStyles(); + }, + + html: function() { + this.stream.skipToEnd(); + return this.tokenStylesWith(this.styleFor('html')); + }, + + table: function() { + this.state.layoutType = 'table'; + return this.execMode(Modes.tableCell); + }, + + tableCell: function() { + if (this.eat('tableHeading')) { + this.state.tableHeading = true; + } else { + this.stream.eat('|'); + } + this.setModeForNextToken(Modes.tableCellAttributes); + return this.tokenStyles(); + }, + + tableCellAttributes: function() { + this.setModeForNextToken(Modes.tableText); + + if (this.eat('tableCellAttributes')) { + return this.tokenStylesWith(this.styleFor('attributes')); + } + return this.tokenStyles(); + }, + + tableText: function() { + if (this.eat('tableText')) { + return this.tokenStyles(); + } + + if (this.stream.peek() === '|') { // end of cell + this.setModeForNextToken(Modes.tableCell); + return this.tokenStyles(); + } + return this.handlePhraseModifier(this.stream.next()); + } +}; + + +CodeMirror.defineMode('textile', function() { + var regExpFactory = new RegExpFactory(); + + return { + startState: function() { + return { mode: Modes.newLayout }; + }, + token: function(stream, state) { + var parser = new Parser(regExpFactory, state, stream); + if (stream.sol()) { parser.startNewLine(); } + return parser.nextToken(); + }, + blankLine: function(state) { + new Parser(regExpFactory, state).blankLine(); + } + }; +}); + +CodeMirror.defineMIME('text/x-textile', 'textile'); +}); diff --git a/deploy/core/node_modules/codemirror/mode/tiddlywiki/index.html b/deploy/core/node_modules/codemirror/mode/tiddlywiki/index.html new file mode 100644 index 000000000..77dd0457c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tiddlywiki/index.html @@ -0,0 +1,154 @@ + + +CodeMirror: TiddlyWiki mode + + + + + + + + + + + +
+

TiddlyWiki mode

+ + +
+ + + +

TiddlyWiki mode supports a single configuration.

+ +

MIME types defined: text/x-tiddlywiki.

+
diff --git a/deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.css b/deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.css new file mode 100644 index 000000000..9a69b639f --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.css @@ -0,0 +1,14 @@ +span.cm-underlined { + text-decoration: underline; +} +span.cm-strikethrough { + text-decoration: line-through; +} +span.cm-brace { + color: #170; + font-weight: bold; +} +span.cm-table { + color: blue; + font-weight: bold; +} diff --git a/deploy/core/node_modules/codemirror/modes/tiddlywiki.js b/deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.js similarity index 95% rename from deploy/core/node_modules/codemirror/modes/tiddlywiki.js rename to deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.js index 24a24786b..88c9768a7 100644 --- a/deploy/core/node_modules/codemirror/modes/tiddlywiki.js +++ b/deploy/core/node_modules/codemirror/mode/tiddlywiki/tiddlywiki.js @@ -1,3 +1,6 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /*** |''Name''|tiddlywiki.js| |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| @@ -14,6 +17,17 @@ CoreVersion parameter is needed for TiddlyWiki only! ***/ //{{{ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("tiddlywiki", function () { // Tokenizer var textwords = {}; @@ -350,4 +364,6 @@ CodeMirror.defineMode("tiddlywiki", function () { }); CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); +}); + //}}} diff --git a/deploy/core/node_modules/codemirror/mode/tiki/index.html b/deploy/core/node_modules/codemirror/mode/tiki/index.html new file mode 100644 index 000000000..091c5fb2a --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tiki/index.html @@ -0,0 +1,95 @@ + + +CodeMirror: Tiki wiki mode + + + + + + + + + + +
+

Tiki wiki mode

+ + +
+ + + +
diff --git a/deploy/core/node_modules/codemirror/mode/tiki/tiki.css b/deploy/core/node_modules/codemirror/mode/tiki/tiki.css new file mode 100644 index 000000000..0dbc3ea0e --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tiki/tiki.css @@ -0,0 +1,26 @@ +.cm-tw-syntaxerror { + color: #FFF; + background-color: #900; +} + +.cm-tw-deleted { + text-decoration: line-through; +} + +.cm-tw-header5 { + font-weight: bold; +} +.cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ + padding-left: 10px; +} + +.cm-tw-box { + border-top-width: 0px ! important; + border-style: solid; + border-width: 1px; + border-color: inherit; +} + +.cm-tw-underline { + text-decoration: underline; +} \ No newline at end of file diff --git a/deploy/core/node_modules/codemirror/modes/tiki.js b/deploy/core/node_modules/codemirror/mode/tiki/tiki.js similarity index 94% rename from deploy/core/node_modules/codemirror/modes/tiki.js rename to deploy/core/node_modules/codemirror/mode/tiki/tiki.js index e789163dc..c90aac9ec 100644 --- a/deploy/core/node_modules/codemirror/modes/tiki.js +++ b/deploy/core/node_modules/codemirror/mode/tiki/tiki.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode('tiki', function(config) { function inBlock(style, terminator, returnTokenizer) { return function(stream, state) { @@ -306,3 +319,5 @@ return { }); CodeMirror.defineMIME("text/tiki", "tiki"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/toml/index.html b/deploy/core/node_modules/codemirror/mode/toml/index.html new file mode 100644 index 000000000..90a2a0215 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/toml/index.html @@ -0,0 +1,73 @@ + + +CodeMirror: TOML Mode + + + + + + + + + +
+

TOML Mode

+
+ +

The TOML Mode

+

Created by Forbes Lindesay.

+

MIME type defined: text/x-toml.

+
diff --git a/deploy/core/node_modules/codemirror/modes/toml.js b/deploy/core/node_modules/codemirror/mode/toml/toml.js similarity index 80% rename from deploy/core/node_modules/codemirror/modes/toml.js rename to deploy/core/node_modules/codemirror/mode/toml/toml.js index 1d163f13b..baeca1556 100644 --- a/deploy/core/node_modules/codemirror/modes/toml.js +++ b/deploy/core/node_modules/codemirror/mode/toml/toml.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("toml", function () { return { startState: function () { @@ -38,6 +51,8 @@ CodeMirror.defineMode("toml", function () { return 'bracket'; } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) { stream.next();//skip closing ] + // array of objects has an extra open & close [] + if (stream.peek() === ']') stream.next(); return "atom"; } else if (stream.peek() === "#") { stream.skipToEnd(); @@ -69,3 +84,5 @@ CodeMirror.defineMode("toml", function () { }); CodeMirror.defineMIME('text/x-toml', 'toml'); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/tornado/index.html b/deploy/core/node_modules/codemirror/mode/tornado/index.html new file mode 100644 index 000000000..8ee7ef56c --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tornado/index.html @@ -0,0 +1,63 @@ + + +CodeMirror: Tornado template mode + + + + + + + + + + + + +
+

Tornado template mode

+
+ + + +

Mode for HTML with embedded Tornado template markup.

+ +

MIME types defined: text/x-tornado

+
diff --git a/deploy/core/node_modules/codemirror/mode/tornado/tornado.js b/deploy/core/node_modules/codemirror/mode/tornado/tornado.js new file mode 100644 index 000000000..dbfbc3489 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/tornado/tornado.js @@ -0,0 +1,68 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), + require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", + "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("tornado:inner", function() { + var keywords = ["and","as","assert","autoescape","block","break","class","comment","context", + "continue","datetime","def","del","elif","else","end","escape","except", + "exec","extends","false","finally","for","from","global","if","import","in", + "include","is","json_encode","lambda","length","linkify","load","module", + "none","not","or","pass","print","put","raise","raw","return","self","set", + "squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"]; + keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + stream.eatWhile(/[^\{]/); + var ch = stream.next(); + if (ch == "{") { + if (ch = stream.eat(/\{|%|#/)) { + state.tokenize = inTag(ch); + return "tag"; + } + } + } + function inTag (close) { + if (close == "{") { + close = "}"; + } + return function (stream, state) { + var ch = stream.next(); + if ((ch == close) && stream.eat("}")) { + state.tokenize = tokenBase; + return "tag"; + } + if (stream.match(keywords)) { + return "keyword"; + } + return close == "#" ? "comment" : "string"; + }; + } + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; + }); + + CodeMirror.defineMode("tornado", function(config) { + var htmlBase = CodeMirror.getMode(config, "text/html"); + var tornadoInner = CodeMirror.getMode(config, "tornado:inner"); + return CodeMirror.overlayMode(htmlBase, tornadoInner); + }); + + CodeMirror.defineMIME("text/x-tornado", "tornado"); +}); diff --git a/deploy/core/node_modules/codemirror/mode/turtle/index.html b/deploy/core/node_modules/codemirror/mode/turtle/index.html new file mode 100644 index 000000000..a4962b617 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/turtle/index.html @@ -0,0 +1,50 @@ + + +CodeMirror: Turtle mode + + + + + + + + + +
+

Turtle mode

+
+ + +

MIME types defined: text/turtle.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/turtle.js b/deploy/core/node_modules/codemirror/mode/turtle/turtle.js similarity index 90% rename from deploy/core/node_modules/codemirror/modes/turtle.js rename to deploy/core/node_modules/codemirror/mode/turtle/turtle.js index e118bfbce..a4727ed57 100644 --- a/deploy/core/node_modules/codemirror/modes/turtle.js +++ b/deploy/core/node_modules/codemirror/mode/turtle/turtle.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("turtle", function(config) { var indentUnit = config.indentUnit; var curPunc; @@ -143,3 +156,5 @@ CodeMirror.defineMode("turtle", function(config) { }); CodeMirror.defineMIME("text/turtle", "turtle"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/vb/index.html b/deploy/core/node_modules/codemirror/mode/vb/index.html new file mode 100644 index 000000000..adcc44fd3 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/vb/index.html @@ -0,0 +1,102 @@ + + +CodeMirror: VB.NET mode + + + + + + + + + + + +
+

VB.NET mode

+ + + +
+ +
+

+  

MIME type defined: text/x-vb.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/vb.js b/deploy/core/node_modules/codemirror/mode/vb/vb.js similarity index 94% rename from deploy/core/node_modules/codemirror/modes/vb.js rename to deploy/core/node_modules/codemirror/mode/vb/vb.js index 27b227195..902203e0c 100644 --- a/deploy/core/node_modules/codemirror/modes/vb.js +++ b/deploy/core/node_modules/codemirror/mode/vb/vb.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("vb", function(conf, parserConf) { var ERRORCLASS = 'error'; @@ -257,3 +270,5 @@ CodeMirror.defineMode("vb", function(conf, parserConf) { }); CodeMirror.defineMIME("text/x-vb", "vb"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/vbscript/index.html b/deploy/core/node_modules/codemirror/mode/vbscript/index.html new file mode 100644 index 000000000..ad7532d7d --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/vbscript/index.html @@ -0,0 +1,55 @@ + + +CodeMirror: VBScript mode + + + + + + + + + +
+

VBScript mode

+ + +
+ + + +

MIME types defined: text/vbscript.

+
diff --git a/deploy/core/node_modules/codemirror/modes/vbscript.js b/deploy/core/node_modules/codemirror/mode/vbscript/vbscript.js similarity index 95% rename from deploy/core/node_modules/codemirror/modes/vbscript.js rename to deploy/core/node_modules/codemirror/mode/vbscript/vbscript.js index 0a97fb640..b66df2239 100644 --- a/deploy/core/node_modules/codemirror/modes/vbscript.js +++ b/deploy/core/node_modules/codemirror/mode/vbscript/vbscript.js @@ -1,3 +1,6 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* For extra ASP classic objects, initialize CodeMirror instance with this option: isASP: true @@ -8,6 +11,17 @@ E.G.: isASP: true }); */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("vbscript", function(conf, parserConf) { var ERRORCLASS = 'error'; @@ -277,7 +291,7 @@ CodeMirror.defineMode("vbscript", function(conf, parserConf) { style = state.tokenize(stream, state); current = stream.current(); - if (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword'){//|| knownWords.indexOf(current.substring(1)) > -1) { + if (style && (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword')){//|| knownWords.indexOf(current.substring(1)) > -1) { if (style === 'builtin' || style === 'keyword') style='variable'; if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2'; @@ -332,3 +346,5 @@ CodeMirror.defineMode("vbscript", function(conf, parserConf) { }); CodeMirror.defineMIME("text/vbscript", "vbscript"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/velocity/index.html b/deploy/core/node_modules/codemirror/mode/velocity/index.html new file mode 100644 index 000000000..274787866 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/velocity/index.html @@ -0,0 +1,118 @@ + + +CodeMirror: Velocity mode + + + + + + + + + + +
+

Velocity mode

+
+ + +

MIME types defined: text/velocity.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/velocity.js b/deploy/core/node_modules/codemirror/mode/velocity/velocity.js similarity index 93% rename from deploy/core/node_modules/codemirror/modes/velocity.js rename to deploy/core/node_modules/codemirror/mode/velocity/velocity.js index 968d8799e..8fc4f95d0 100644 --- a/deploy/core/node_modules/codemirror/modes/velocity.js +++ b/deploy/core/node_modules/codemirror/mode/velocity/velocity.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("velocity", function() { function parseWords(str) { var obj = {}, words = str.split(" "); @@ -184,3 +197,5 @@ CodeMirror.defineMode("velocity", function() { }); CodeMirror.defineMIME("text/velocity", "velocity"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/verilog/index.html b/deploy/core/node_modules/codemirror/mode/verilog/index.html new file mode 100644 index 000000000..96b3d6476 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/verilog/index.html @@ -0,0 +1,120 @@ + + +CodeMirror: Verilog/SystemVerilog mode + + + + + + + + + + +
+

SystemVerilog mode

+ +
+ + + +

+Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800). +

Configuration options:

+
    +
  • noIndentKeywords - List of keywords which should not cause identation to increase. E.g. ["package", "module"]. Default: None
  • +
+

+ +

MIME types defined: text/x-verilog and text/x-systemverilog.

+
diff --git a/deploy/core/node_modules/codemirror/mode/verilog/test.js b/deploy/core/node_modules/codemirror/mode/verilog/test.js new file mode 100644 index 000000000..9c8c09494 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/verilog/test.js @@ -0,0 +1,273 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 4}, "verilog"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("binary_literals", + "[number 1'b0]", + "[number 1'b1]", + "[number 1'bx]", + "[number 1'bz]", + "[number 1'bX]", + "[number 1'bZ]", + "[number 1'B0]", + "[number 1'B1]", + "[number 1'Bx]", + "[number 1'Bz]", + "[number 1'BX]", + "[number 1'BZ]", + "[number 1'b0]", + "[number 1'b1]", + "[number 2'b01]", + "[number 2'bxz]", + "[number 2'b11]", + "[number 2'b10]", + "[number 2'b1Z]", + "[number 12'b0101_0101_0101]", + "[number 1'b 0]", + "[number 'b0101]" + ); + + MT("octal_literals", + "[number 3'o7]", + "[number 3'O7]", + "[number 3'so7]", + "[number 3'SO7]" + ); + + MT("decimal_literals", + "[number 0]", + "[number 1]", + "[number 7]", + "[number 123_456]", + "[number 'd33]", + "[number 8'd255]", + "[number 8'D255]", + "[number 8'sd255]", + "[number 8'SD255]", + "[number 32'd123]", + "[number 32 'd123]", + "[number 32 'd 123]" + ); + + MT("hex_literals", + "[number 4'h0]", + "[number 4'ha]", + "[number 4'hF]", + "[number 4'hx]", + "[number 4'hz]", + "[number 4'hX]", + "[number 4'hZ]", + "[number 32'hdc78]", + "[number 32'hDC78]", + "[number 32 'hDC78]", + "[number 32'h DC78]", + "[number 32 'h DC78]", + "[number 32'h44x7]", + "[number 32'hFFF?]" + ); + + MT("real_number_literals", + "[number 1.2]", + "[number 0.1]", + "[number 2394.26331]", + "[number 1.2E12]", + "[number 1.2e12]", + "[number 1.30e-2]", + "[number 0.1e-0]", + "[number 23E10]", + "[number 29E-2]", + "[number 236.123_763_e-12]" + ); + + MT("operators", + "[meta ^]" + ); + + MT("keywords", + "[keyword logic]", + "[keyword logic] [variable foo]", + "[keyword reg] [variable abc]" + ); + + MT("variables", + "[variable _leading_underscore]", + "[variable _if]", + "[number 12] [variable foo]", + "[variable foo] [number 14]" + ); + + MT("tick_defines", + "[def `FOO]", + "[def `foo]", + "[def `FOO_bar]" + ); + + MT("system_calls", + "[meta $display]", + "[meta $vpi_printf]" + ); + + MT("line_comment", "[comment // Hello world]"); + + // Alignment tests + MT("align_port_map_style1", + /** + * mod mod(.a(a), + * .b(b) + * ); + */ + "[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],", + " .[variable b][bracket (][variable b][bracket )]", + " [bracket )];", + "" + ); + + MT("align_port_map_style2", + /** + * mod mod( + * .a(a), + * .b(b) + * ); + */ + "[variable mod] [variable mod][bracket (]", + " .[variable a][bracket (][variable a][bracket )],", + " .[variable b][bracket (][variable b][bracket )]", + "[bracket )];", + "" + ); + + // Indentation tests + MT("indent_single_statement_if", + "[keyword if] [bracket (][variable foo][bracket )]", + " [keyword break];", + "" + ); + + MT("no_indent_after_single_line_if", + "[keyword if] [bracket (][variable foo][bracket )] [keyword break];", + "" + ); + + MT("indent_after_if_begin_same_line", + "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", + " [keyword break];", + " [keyword break];", + "[keyword end]", + "" + ); + + MT("indent_after_if_begin_next_line", + "[keyword if] [bracket (][variable foo][bracket )]", + " [keyword begin]", + " [keyword break];", + " [keyword break];", + " [keyword end]", + "" + ); + + MT("indent_single_statement_if_else", + "[keyword if] [bracket (][variable foo][bracket )]", + " [keyword break];", + "[keyword else]", + " [keyword break];", + "" + ); + + MT("indent_if_else_begin_same_line", + "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", + " [keyword break];", + " [keyword break];", + "[keyword end] [keyword else] [keyword begin]", + " [keyword break];", + " [keyword break];", + "[keyword end]", + "" + ); + + MT("indent_if_else_begin_next_line", + "[keyword if] [bracket (][variable foo][bracket )]", + " [keyword begin]", + " [keyword break];", + " [keyword break];", + " [keyword end]", + "[keyword else]", + " [keyword begin]", + " [keyword break];", + " [keyword break];", + " [keyword end]", + "" + ); + + MT("indent_if_nested_without_begin", + "[keyword if] [bracket (][variable foo][bracket )]", + " [keyword if] [bracket (][variable foo][bracket )]", + " [keyword if] [bracket (][variable foo][bracket )]", + " [keyword break];", + "" + ); + + MT("indent_case", + "[keyword case] [bracket (][variable state][bracket )]", + " [variable FOO]:", + " [keyword break];", + " [variable BAR]:", + " [keyword break];", + "[keyword endcase]", + "" + ); + + MT("unindent_after_end_with_preceding_text", + "[keyword begin]", + " [keyword break]; [keyword end]", + "" + ); + + MT("export_function_one_line_does_not_indent", + "[keyword export] [string \"DPI-C\"] [keyword function] [variable helloFromSV];", + "" + ); + + MT("export_task_one_line_does_not_indent", + "[keyword export] [string \"DPI-C\"] [keyword task] [variable helloFromSV];", + "" + ); + + MT("export_function_two_lines_indents_properly", + "[keyword export]", + " [string \"DPI-C\"] [keyword function] [variable helloFromSV];", + "" + ); + + MT("export_task_two_lines_indents_properly", + "[keyword export]", + " [string \"DPI-C\"] [keyword task] [variable helloFromSV];", + "" + ); + + MT("import_function_one_line_does_not_indent", + "[keyword import] [string \"DPI-C\"] [keyword function] [variable helloFromC];", + "" + ); + + MT("import_task_one_line_does_not_indent", + "[keyword import] [string \"DPI-C\"] [keyword task] [variable helloFromC];", + "" + ); + + MT("import_package_single_line_does_not_indent", + "[keyword import] [variable p]::[variable x];", + "[keyword import] [variable p]::[variable y];", + "" + ); + + MT("covergoup_with_function_indents_properly", + "[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];", + " [variable c] : [keyword coverpoint] [variable c];", + "[keyword endgroup]: [variable cg]", + "" + ); + +})(); diff --git a/deploy/core/node_modules/codemirror/mode/verilog/verilog.js b/deploy/core/node_modules/codemirror/mode/verilog/verilog.js new file mode 100644 index 000000000..8fc9ea4f8 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/verilog/verilog.js @@ -0,0 +1,364 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("verilog", function(config, parserConfig) { + + var indentUnit = config.indentUnit, + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + dontAlignCalls = parserConfig.dontAlignCalls, + noIndentKeywords = parserConfig.noIndentKeywords || [], + multiLineStrings = parserConfig.multiLineStrings; + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + /** + * Keywords from IEEE 1800-2012 + */ + var keywords = words( + "accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind " + + "bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config " + + "const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable " + + "dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup " + + "endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask " + + "enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin " + + "function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import " + + "incdir include initial inout input inside instance int integer interconnect interface intersect join join_any " + + "join_none large let liblist library local localparam logic longint macromodule matches medium modport module " + + "nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed " + + "parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup " + + "pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg " + + "reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime " + + "s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify " + + "specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on " + + "table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior " + + "trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void " + + "wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"); + + /** Operators from IEEE 1800-2012 + unary_operator ::= + + | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ + binary_operator ::= + + | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | ** + | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<< + | -> | <-> + inc_or_dec_operator ::= ++ | -- + unary_module_path_operator ::= + ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ + binary_module_path_operator ::= + == | != | && | || | & | | | ^ | ^~ | ~^ + */ + var isOperatorChar = /[\+\-\*\/!~&|^%=?:]/; + var isBracketChar = /[\[\]{}()]/; + + var unsignedNumber = /\d[0-9_]*/; + var decimalLiteral = /\d*\s*'s?d\s*\d[0-9_]*/i; + var binaryLiteral = /\d*\s*'s?b\s*[xz01][xz01_]*/i; + var octLiteral = /\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i; + var hexLiteral = /\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i; + var realLiteral = /(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i; + + var closingBracketOrWord = /^((\w+)|[)}\]])/; + var closingBracket = /[)}\]]/; + + var curPunc; + var curKeyword; + + // Block openings which are closed by a matching keyword in the form of ("end" + keyword) + // E.g. "task" => "endtask" + var blockKeywords = words( + "case checker class clocking config function generate interface module package" + + "primitive program property specify sequence table task" + ); + + // Opening/closing pairs + var openClose = {}; + for (var keyword in blockKeywords) { + openClose[keyword] = "end" + keyword; + } + openClose["begin"] = "end"; + openClose["casex"] = "endcase"; + openClose["casez"] = "endcase"; + openClose["do" ] = "while"; + openClose["fork" ] = "join;join_any;join_none"; + openClose["covergroup"] = "endgroup"; + + for (var i in noIndentKeywords) { + var keyword = noIndentKeywords[i]; + if (openClose[keyword]) { + openClose[keyword] = undefined; + } + } + + // Keywords which open statements that are ended with a semi-colon + var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while"); + + function tokenBase(stream, state) { + var ch = stream.peek(); + if (/[,;:\.]/.test(ch)) { + curPunc = stream.next(); + return null; + } + if (isBracketChar.test(ch)) { + curPunc = stream.next(); + return "bracket"; + } + // Macros (tick-defines) + if (ch == '`') { + stream.next(); + if (stream.eatWhile(/[\w\$_]/)) { + return "def"; + } else { + return null; + } + } + // System calls + if (ch == '$') { + stream.next(); + if (stream.eatWhile(/[\w\$_]/)) { + return "meta"; + } else { + return null; + } + } + // Time literals + if (ch == '#') { + stream.next(); + stream.eatWhile(/[\d_.]/); + return "def"; + } + // Strings + if (ch == '"') { + stream.next(); + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + // Comments + if (ch == "/") { + stream.next(); + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + stream.backUp(1); + } + + // Numeric literals + if (stream.match(realLiteral) || + stream.match(decimalLiteral) || + stream.match(binaryLiteral) || + stream.match(octLiteral) || + stream.match(hexLiteral) || + stream.match(unsignedNumber) || + stream.match(realLiteral)) { + return "number"; + } + + // Operators + if (stream.eatWhile(isOperatorChar)) { + return "meta"; + } + + // Keywords / plain variables + if (stream.eatWhile(/[\w\$_]/)) { + var cur = stream.current(); + if (keywords[cur]) { + if (openClose[cur]) { + curPunc = "newblock"; + } + if (statementKeywords[cur]) { + curPunc = "newstatement"; + } + curKeyword = cur; + return "keyword"; + } + return "variable"; + } + + stream.next(); + return null; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + var c = new Context(indent, col, type, null, state.context); + return state.context = c; + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") { + state.indented = state.context.indented; + } + return state.context = state.context.prev; + } + + function isClosing(text, contextClosing) { + if (text == contextClosing) { + return true; + } else { + // contextClosing may be mulitple keywords separated by ; + var closingKeywords = contextClosing.split(";"); + for (var i in closingKeywords) { + if (text == closingKeywords[i]) { + return true; + } + } + return false; + } + } + + function buildElectricInputRegEx() { + // Reindentation should occur on any bracket char: {}()[] + // or on a match of any of the block closing keywords, at + // the end of a line + var allClosings = []; + for (var i in openClose) { + if (openClose[i]) { + var closings = openClose[i].split(";"); + for (var j in closings) { + allClosings.push(closings[j]); + } + } + } + var re = new RegExp("[{}()\\[\\]]|(" + allClosings.join("|") + ")$"); + return re; + } + + // Interface + return { + + // Regex to force current line to reindent + electricInput: buildElectricInputRegEx(), + + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + curKeyword = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta" || style == "variable") return style; + if (ctx.align == null) ctx.align = true; + + if (curPunc == ctx.type) { + popContext(state); + } + else if ((curPunc == ";" && ctx.type == "statement") || + (ctx.type && isClosing(curKeyword, ctx.type))) { + ctx = popContext(state); + while (ctx && ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == "{") { pushContext(state, stream.column(), "}"); } + else if (curPunc == "[") { pushContext(state, stream.column(), "]"); } + else if (curPunc == "(") { pushContext(state, stream.column(), ")"); } + else if (ctx && ctx.type == "endcase" && curPunc == ":") { pushContext(state, stream.column(), "statement"); } + else if (curPunc == "newstatement") { + pushContext(state, stream.column(), "statement"); + } else if (curPunc == "newblock") { + if (curKeyword == "function" && ctx && (ctx.type == "statement" || ctx.type == "endgroup")) { + // The 'function' keyword can appear in some other contexts where it actually does not + // indicate a function (import/export DPI and covergroup definitions). + // Do nothing in this case + } else if (curKeyword == "task" && ctx && ctx.type == "statement") { + // Same thing for task + } else { + var close = openClose[curKeyword]; + pushContext(state, stream.column(), close); + } + } + + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = false; + var possibleClosing = textAfter.match(closingBracketOrWord); + if (possibleClosing) { + closing = isClosing(possibleClosing[0], ctx.type); + } + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); + else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1); + else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-verilog", { + name: "verilog" +}); +CodeMirror.defineMIME("text/x-systemverilog", { + name: "systemverilog" +}); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/xml/index.html b/deploy/core/node_modules/codemirror/mode/xml/index.html new file mode 100644 index 000000000..7149f06b2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/xml/index.html @@ -0,0 +1,57 @@ + + +CodeMirror: XML mode + + + + + + + + + +
+

XML mode

+
+ +

The XML mode supports two configuration parameters:

+
+
htmlMode (boolean)
+
This switches the mode to parse HTML instead of XML. This + means attributes do not have to be quoted, and some elements + (such as br) do not require a closing tag.
+
alignCDATA (boolean)
+
Setting this to true will force the opening tag of CDATA + blocks to not be indented.
+
+ +

MIME types defined: application/xml, text/html.

+
diff --git a/deploy/core/node_modules/codemirror/mode/xml/test.js b/deploy/core/node_modules/codemirror/mode/xml/test.js new file mode 100644 index 000000000..f48156b51 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/xml/test.js @@ -0,0 +1,51 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } + + MT("matching", + "[tag&bracket <][tag top][tag&bracket >]", + " text", + " [tag&bracket <][tag inner][tag&bracket />]", + "[tag&bracket ]"); + + MT("nonmatching", + "[tag&bracket <][tag top][tag&bracket >]", + " [tag&bracket <][tag inner][tag&bracket />]", + " [tag&bracket ]"); + + MT("doctype", + "[meta ]", + "[tag&bracket <][tag top][tag&bracket />]"); + + MT("cdata", + "[tag&bracket <][tag top][tag&bracket >]", + " [atom ]", + "[tag&bracket ]"); + + // HTML tests + mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); + + MT("selfclose", + "[tag&bracket <][tag html][tag&bracket >]", + " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", + "[tag&bracket ]"); + + MT("list", + "[tag&bracket <][tag ol][tag&bracket >]", + " [tag&bracket <][tag li][tag&bracket >]one", + " [tag&bracket <][tag li][tag&bracket >]two", + "[tag&bracket ]"); + + MT("valueless", + "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); + + MT("pThenArticle", + "[tag&bracket <][tag p][tag&bracket >]", + " foo", + "[tag&bracket <][tag article][tag&bracket >]bar"); + +})(); diff --git a/deploy/core/node_modules/codemirror/modes/xml.js b/deploy/core/node_modules/codemirror/mode/xml/xml.js similarity index 57% rename from deploy/core/node_modules/codemirror/modes/xml.js rename to deploy/core/node_modules/codemirror/mode/xml/xml.js index 4f49e07fa..2f3b8f87a 100644 --- a/deploy/core/node_modules/codemirror/modes/xml.js +++ b/deploy/core/node_modules/codemirror/mode/xml/xml.js @@ -1,13 +1,27 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("xml", function(config, parserConfig) { var indentUnit = config.indentUnit; var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; - var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag || true; + var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag; + if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true; var Kludges = parserConfig.htmlMode ? { autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true}, + 'track': true, 'wbr': true, 'menuitem': true}, implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, 'th': true, 'tr': true}, @@ -33,19 +47,21 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { }, doNotIndent: {"pre": true}, allowUnquoted: true, - allowMissing: true + allowMissing: true, + caseFold: true } : { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: false, - allowMissing: false + allowMissing: false, + caseFold: false }; var alignCDATA = parserConfig.alignCDATA; // Return variables for tokenizers - var tagName, type; + var type, setStyle; function inText(stream, state) { function chain(parser) { @@ -72,14 +88,9 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { state.tokenize = inBlock("meta", "?>"); return "meta"; } else { - var isClose = stream.eat("/"); - tagName = ""; - var c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - if (!tagName) return "tag error"; - type = isClose ? "closeTag" : "openTag"; + type = stream.eat("/") ? "closeTag" : "openTag"; state.tokenize = inTag; - return "tag"; + return "tag bracket"; } } else if (ch == "&") { var ok; @@ -104,20 +115,22 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { if (ch == ">" || (ch == "/" && stream.eat(">"))) { state.tokenize = inText; type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag"; + return "tag bracket"; } else if (ch == "=") { type = "equals"; return null; } else if (ch == "<") { state.tokenize = inText; + state.state = baseState; + state.tagName = state.tagStart = null; var next = state.tokenize(stream, state); - return next ? next + " error" : "error"; + return next ? next + " tag error" : "tag error"; } else if (/[\'\"]/.test(ch)) { state.tokenize = inAttribute(ch); state.stringStartCol = stream.column(); return state.tokenize(stream, state); } else { - stream.eatWhile(/[^\s\u00a0=<>\"\']/); + stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); return "word"; } } @@ -169,139 +182,141 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { }; } - var curState, curStream, setStyle; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); + function Context(state, tagName, startOfLine) { + this.prev = state.context; + this.tagName = tagName; + this.indent = state.indented; + this.startOfLine = startOfLine; + if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) + this.noIndent = true; } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushContext(tagName, startOfLine) { - var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); - curState.context = { - prev: curState.context, - tagName: tagName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; + function popContext(state) { + if (state.context) state.context = state.context.prev; } - function popContext() { - if (curState.context) curState.context = curState.context.prev; + function maybePopContext(state, nextTagName) { + var parentTagName; + while (true) { + if (!state.context) { + return; + } + parentTagName = state.context.tagName; + if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || + !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { + return; + } + popContext(state); + } } - function element(type) { + function baseState(type, stream, state) { if (type == "openTag") { - curState.tagName = tagName; - curState.tagStart = curStream.column(); - return cont(attributes, endtag(curState.startOfLine)); + state.tagStart = stream.column(); + return tagNameState; } else if (type == "closeTag") { - var err = false; - if (curState.context) { - if (curState.context.tagName != tagName) { - if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) { - popContext(); - } - err = !curState.context || curState.context.tagName != tagName; - } - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endclosetag(err)); + return closeTagNameState; + } else { + return baseState; } - return cont(); - } - function endtag(startOfLine) { - return function(type) { - var tagName = curState.tagName; - curState.tagName = curState.tagStart = null; - if (type == "selfcloseTag" || - (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) { - maybePopContext(tagName.toLowerCase()); - return cont(); - } - if (type == "endTag") { - maybePopContext(tagName.toLowerCase()); - pushContext(tagName, startOfLine); - return cont(); - } - return cont(); - }; } - function endclosetag(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endTag") { popContext(); return cont(); } + function tagNameState(type, stream, state) { + if (type == "word") { + state.tagName = stream.current(); + setStyle = "tag"; + return attrState; + } else { setStyle = "error"; - return cont(arguments.callee); - }; + return tagNameState; + } } - function maybePopContext(nextTagName) { - var parentTagName; - while (true) { - if (!curState.context) { - return; - } - parentTagName = curState.context.tagName.toLowerCase(); - if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || - !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { - return; + function closeTagNameState(type, stream, state) { + if (type == "word") { + var tagName = stream.current(); + if (state.context && state.context.tagName != tagName && + Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName)) + popContext(state); + if (state.context && state.context.tagName == tagName) { + setStyle = "tag"; + return closeState; + } else { + setStyle = "tag error"; + return closeStateErr; } - popContext(); + } else { + setStyle = "error"; + return closeStateErr; + } + } + + function closeState(type, _stream, state) { + if (type != "endTag") { + setStyle = "error"; + return closeState; } + popContext(state); + return baseState; + } + function closeStateErr(type, stream, state) { + setStyle = "error"; + return closeState(type, stream, state); } - function attributes(type) { - if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);} - if (type == "endTag" || type == "selfcloseTag") return pass(); + function attrState(type, _stream, state) { + if (type == "word") { + setStyle = "attribute"; + return attrEqState; + } else if (type == "endTag" || type == "selfcloseTag") { + var tagName = state.tagName, tagStart = state.tagStart; + state.tagName = state.tagStart = null; + if (type == "selfcloseTag" || + Kludges.autoSelfClosers.hasOwnProperty(tagName)) { + maybePopContext(state, tagName); + } else { + maybePopContext(state, tagName); + state.context = new Context(state, tagName, tagStart == state.indented); + } + return baseState; + } setStyle = "error"; - return cont(attributes); + return attrState; } - function attribute(type) { - if (type == "equals") return cont(attvalue, attributes); + function attrEqState(type, stream, state) { + if (type == "equals") return attrValueState; if (!Kludges.allowMissing) setStyle = "error"; - else if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);} - return (type == "endTag" || type == "selfcloseTag") ? pass() : cont(); + return attrState(type, stream, state); } - function attvalue(type) { - if (type == "string") return cont(attvaluemaybe); - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();} + function attrValueState(type, stream, state) { + if (type == "string") return attrContinuedState; + if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;} setStyle = "error"; - return (type == "endTag" || type == "selfCloseTag") ? pass() : cont(); + return attrState(type, stream, state); } - function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); + function attrContinuedState(type, stream, state) { + if (type == "string") return attrContinuedState; + return attrState(type, stream, state); } return { startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, tagStart: null, context: null}; + return {tokenize: inText, + state: baseState, + indented: 0, + tagName: null, tagStart: null, + context: null}; }, token: function(stream, state) { - if (!state.tagName && stream.sol()) { - state.startOfLine = true; + if (!state.tagName && stream.sol()) state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - setStyle = type = tagName = null; + if (stream.eatSpace()) return null; + type = null; var style = state.tokenize(stream, state); - state.type = type; if ((style || type) && style != "comment") { - curState = state; curStream = stream; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } + setStyle = null; + state.state = state.state(type || style, stream, state); + if (setStyle) + style = setStyle == "error" ? style + " error" : setStyle; } - state.startOfLine = false; - if (setStyle) - style = setStyle == "error" ? style + " error" : setStyle; return style; }, @@ -309,10 +324,13 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { var context = state.context; // Indent multi-line strings (e.g. css). if (state.tokenize.isInAttribute) { - return state.stringStartCol + 1; + if (state.tagStart == state.indented) + return state.stringStartCol + 1; + else + return state.indented + indentUnit; } - if ((state.tokenize != inTag && state.tokenize != inText) || - context && context.noIndent) + if (context && context.noIndent) return CodeMirror.Pass; + if (state.tokenize != inTag && state.tokenize != inText) return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; // Indent the starts of attribute names. if (state.tagName) { @@ -322,15 +340,34 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { return state.tagStart + indentUnit * multilineTagIndentFactor; } if (alignCDATA && /$/, blockCommentStart: "", @@ -343,3 +380,5 @@ CodeMirror.defineMIME("text/xml", "xml"); CodeMirror.defineMIME("application/xml", "xml"); if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/xquery/index.html b/deploy/core/node_modules/codemirror/mode/xquery/index.html new file mode 100644 index 000000000..7ac5aaeff --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/xquery/index.html @@ -0,0 +1,210 @@ + + +CodeMirror: XQuery mode + + + + + + + + + + +
+

XQuery mode

+ + +
+ +
+ + + +

MIME types defined: application/xquery.

+ +

Development of the CodeMirror XQuery mode was sponsored by + MarkLogic and developed by + Mike Brevoort. +

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/xquery/test.js b/deploy/core/node_modules/codemirror/mode/xquery/test.js new file mode 100644 index 000000000..1f148cdbb --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/xquery/test.js @@ -0,0 +1,67 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Don't take these too seriously -- the expected results appear to be +// based on the results of actual runs without any serious manual +// verification. If a change you made causes them to fail, the test is +// as likely to wrong as the code. + +(function() { + var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("eviltest", + "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", + " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", + " [keyword let] [variable $joe][keyword :=][atom 1]", + " [keyword return] [keyword element] [variable element] {", + " [keyword attribute] [variable attribute] { [atom 1] },", + " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", + " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", + " [keyword //][variable x] } [comment (: a more 'evil' test :)]", + " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", + " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", + " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", + " [keyword return] [keyword element] [variable element] {", + " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", + " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", + " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", + " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", + " [keyword //][variable fn:doc]", + " }"); + + MT("testEmptySequenceKeyword", + "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); + + MT("testMultiAttr", + "[tag

][variable hello] [variable world][tag

]"); + + MT("test namespaced variable", + "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); + + MT("test EQName variable", + "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", + "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); + + MT("test EQName function", + "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", + " [variable $a] [keyword +] [atom 2]", + "}[variable ;]", + "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); + + MT("test EQName function with single quotes", + "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", + " [variable $a] [keyword +] [atom 2]", + "}[variable ;]", + "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); + + MT("testProcessingInstructions", + "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); + + MT("testQuoteEscapeDouble", + "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", + "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); +})(); diff --git a/deploy/core/node_modules/codemirror/modes/xquery.js b/deploy/core/node_modules/codemirror/mode/xquery/xquery.js similarity index 96% rename from deploy/core/node_modules/codemirror/modes/xquery.js rename to deploy/core/node_modules/codemirror/mode/xquery/xquery.js index be1798463..c8f3d90a9 100644 --- a/deploy/core/node_modules/codemirror/modes/xquery.js +++ b/deploy/core/node_modules/codemirror/mode/xquery/xquery.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("xquery", function() { // The keywords object is set to the result of this self executing @@ -430,3 +443,5 @@ CodeMirror.defineMode("xquery", function() { }); CodeMirror.defineMIME("application/xquery", "xquery"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/yaml/index.html b/deploy/core/node_modules/codemirror/mode/yaml/index.html new file mode 100644 index 000000000..be9b63236 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/yaml/index.html @@ -0,0 +1,80 @@ + + +CodeMirror: YAML mode + + + + + + + + + +
+

YAML mode

+
+ + +

MIME types defined: text/x-yaml.

+ +
diff --git a/deploy/core/node_modules/codemirror/modes/yaml.js b/deploy/core/node_modules/codemirror/mode/yaml/yaml.js similarity index 83% rename from deploy/core/node_modules/codemirror/modes/yaml.js rename to deploy/core/node_modules/codemirror/mode/yaml/yaml.js index efacd7d56..332aef6a2 100644 --- a/deploy/core/node_modules/codemirror/modes/yaml.js +++ b/deploy/core/node_modules/codemirror/mode/yaml/yaml.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("yaml", function() { var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; @@ -67,7 +80,7 @@ CodeMirror.defineMode("yaml", function() { } /* pairs (associative arrays) -> key */ - if (!state.pair && stream.match(/^\s*\S+(?=\s*:($|\s))/i)) { + if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) { state.pair = true; state.keyCol = stream.indentation(); return "atom"; @@ -95,3 +108,5 @@ CodeMirror.defineMode("yaml", function() { }); CodeMirror.defineMIME("text/x-yaml", "yaml"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/z80/index.html b/deploy/core/node_modules/codemirror/mode/z80/index.html new file mode 100644 index 000000000..1ad3ace04 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/z80/index.html @@ -0,0 +1,52 @@ + + +CodeMirror: Z80 assembly mode + + + + + + + + + +
+

Z80 assembly mode

+ + +
+ + + +

MIME type defined: text/x-z80.

+
diff --git a/deploy/core/node_modules/codemirror/modes/z80.js b/deploy/core/node_modules/codemirror/mode/z80/z80.js similarity index 83% rename from deploy/core/node_modules/codemirror/modes/z80.js rename to deploy/core/node_modules/codemirror/mode/z80/z80.js index ff43d32b5..ec41d050a 100644 --- a/deploy/core/node_modules/codemirror/modes/z80.js +++ b/deploy/core/node_modules/codemirror/mode/z80/z80.js @@ -1,3 +1,16 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode('z80', function() { var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; @@ -83,3 +96,5 @@ CodeMirror.defineMode('z80', function() { }); CodeMirror.defineMIME("text/x-z80", "z80"); + +}); diff --git a/deploy/core/node_modules/codemirror/modes/erlang.js b/deploy/core/node_modules/codemirror/modes/erlang.js deleted file mode 100644 index af8953c33..000000000 --- a/deploy/core/node_modules/codemirror/modes/erlang.js +++ /dev/null @@ -1,484 +0,0 @@ -// block; "begin", "case", "fun", "if", "receive", "try": closed by "end" -// block internal; "after", "catch", "of" -// guard; "when", closed by "->" -// "->" opens a clause, closed by ";" or "." -// "<<" opens a binary, closed by ">>" -// "," appears in arglists, lists, tuples and terminates lines of code -// "." resets indentation to 0 -// obsolete; "cond", "let", "query" - -CodeMirror.defineMIME("text/x-erlang", "erlang"); - -CodeMirror.defineMode("erlang", function(cmCfg) { - - function rval(state,_stream,type) { - // distinguish between "." as terminator and record field operator - state.in_record = (type == "record"); - - // erlang -> CodeMirror tag - switch (type) { - case "atom": return "atom"; - case "attribute": return "attribute"; - case "boolean": return "special"; - case "builtin": return "builtin"; - case "comment": return "comment"; - case "fun": return "meta"; - case "function": return "tag"; - case "guard": return "property"; - case "keyword": return "keyword"; - case "macro": return "variable-2"; - case "number": return "number"; - case "operator": return "operator"; - case "record": return "bracket"; - case "string": return "string"; - case "type": return "def"; - case "variable": return "variable"; - case "error": return "error"; - case "separator": return null; - case "open_paren": return null; - case "close_paren": return null; - default: return null; - } - } - - var typeWords = [ - "-type", "-spec", "-export_type", "-opaque"]; - - var keywordWords = [ - "after","begin","catch","case","cond","end","fun","if", - "let","of","query","receive","try","when"]; - - var separatorRE = /[\->\.,:;]/; - var separatorWords = [ - "->",";",":",".",","]; - - var operatorWords = [ - "and","andalso","band","bnot","bor","bsl","bsr","bxor", - "div","not","or","orelse","rem","xor"]; - - var symbolRE = /[\+\-\*\/<>=\|:!]/; - var symbolWords = [ - "+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"]; - - var openParenRE = /[<\(\[\{]/; - var openParenWords = [ - "<<","(","[","{"]; - - var closeParenRE = /[>\)\]\}]/; - var closeParenWords = [ - "}","]",")",">>"]; - - var guardWords = [ - "is_atom","is_binary","is_bitstring","is_boolean","is_float", - "is_function","is_integer","is_list","is_number","is_pid", - "is_port","is_record","is_reference","is_tuple", - "atom","binary","bitstring","boolean","function","integer","list", - "number","pid","port","record","reference","tuple"]; - - var bifWords = [ - "abs","adler32","adler32_combine","alive","apply","atom_to_binary", - "atom_to_list","binary_to_atom","binary_to_existing_atom", - "binary_to_list","binary_to_term","bit_size","bitstring_to_list", - "byte_size","check_process_code","contact_binary","crc32", - "crc32_combine","date","decode_packet","delete_module", - "disconnect_node","element","erase","exit","float","float_to_list", - "garbage_collect","get","get_keys","group_leader","halt","hd", - "integer_to_list","internal_bif","iolist_size","iolist_to_binary", - "is_alive","is_atom","is_binary","is_bitstring","is_boolean", - "is_float","is_function","is_integer","is_list","is_number","is_pid", - "is_port","is_process_alive","is_record","is_reference","is_tuple", - "length","link","list_to_atom","list_to_binary","list_to_bitstring", - "list_to_existing_atom","list_to_float","list_to_integer", - "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded", - "monitor_node","node","node_link","node_unlink","nodes","notalive", - "now","open_port","pid_to_list","port_close","port_command", - "port_connect","port_control","pre_loaded","process_flag", - "process_info","processes","purge_module","put","register", - "registered","round","self","setelement","size","spawn","spawn_link", - "spawn_monitor","spawn_opt","split_binary","statistics", - "term_to_binary","time","throw","tl","trunc","tuple_size", - "tuple_to_list","unlink","unregister","whereis"]; - -// [Ø-Þ] [À-Ö] -// [ß-ö] [ø-ÿ] - var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/; - var escapesRE = - /[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/; - - function tokenize(stream, state) { - - // in multi-line string - if (state.in_string) { - state.in_string = (!doubleQuote(stream)); - return rval(state,stream,"string"); - } - - // in multi-line atom - if (state.in_atom) { - state.in_atom = (!singleQuote(stream)); - return rval(state,stream,"atom"); - } - - // whitespace - if (stream.eatSpace()) { - return rval(state,stream,"whitespace"); - } - - // attributes and type specs - if ((peekToken(state).token == "") && - stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) { - if (isMember(stream.current(),typeWords)) { - return rval(state,stream,"type"); - }else{ - return rval(state,stream,"attribute"); - } - } - - var ch = stream.next(); - - // comment - if (ch == '%') { - stream.skipToEnd(); - return rval(state,stream,"comment"); - } - - // macro - if (ch == '?') { - stream.eatWhile(anumRE); - return rval(state,stream,"macro"); - } - - // record - if (ch == "#") { - stream.eatWhile(anumRE); - return rval(state,stream,"record"); - } - - // dollar escape - if ( ch == "$" ) { - if (stream.next() == "\\" && !stream.match(escapesRE)) { - return rval(state,stream,"error"); - } - return rval(state,stream,"number"); - } - - // quoted atom - if (ch == '\'') { - if (!(state.in_atom = (!singleQuote(stream)))) { - if (stream.match(/\s*\/\s*[0-9]/,false)) { - stream.match(/\s*\/\s*[0-9]/,true); - popToken(state); - return rval(state,stream,"fun"); // 'f'/0 style fun - } - if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) { - return rval(state,stream,"function"); - } - } - return rval(state,stream,"atom"); - } - - // string - if (ch == '"') { - state.in_string = (!doubleQuote(stream)); - return rval(state,stream,"string"); - } - - // variable - if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) { - stream.eatWhile(anumRE); - return rval(state,stream,"variable"); - } - - // atom/keyword/BIF/function - if (/[a-z_ß-öø-ÿ]/.test(ch)) { - stream.eatWhile(anumRE); - - if (stream.match(/\s*\/\s*[0-9]/,false)) { - stream.match(/\s*\/\s*[0-9]/,true); - popToken(state); - return rval(state,stream,"fun"); // f/0 style fun - } - - var w = stream.current(); - - if (isMember(w,keywordWords)) { - pushToken(state,stream); - return rval(state,stream,"keyword"); - }else if (stream.match(/\s*\(/,false)) { - // 'put' and 'erlang:put' are bifs, 'foo:put' is not - if (isMember(w,bifWords) && - (!isPrev(stream,":") || isPrev(stream,"erlang:"))) { - return rval(state,stream,"builtin"); - }else if (isMember(w,guardWords)) { - return rval(state,stream,"guard"); - }else{ - return rval(state,stream,"function"); - } - }else if (isMember(w,operatorWords)) { - return rval(state,stream,"operator"); - }else if (stream.match(/\s*:/,false)) { - if (w == "erlang") { - return rval(state,stream,"builtin"); - } else { - return rval(state,stream,"function"); - } - }else if (isMember(w,["true","false"])) { - return rval(state,stream,"boolean"); - }else{ - return rval(state,stream,"atom"); - } - } - - // number - var digitRE = /[0-9]/; - var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int - if (digitRE.test(ch)) { - stream.eatWhile(digitRE); - if (stream.eat('#')) { - stream.eatWhile(radixRE); // 36#aZ style integer - } else { - if (stream.eat('.')) { // float - stream.eatWhile(digitRE); - } - if (stream.eat(/[eE]/)) { - stream.eat(/[-+]/); // float with exponent - stream.eatWhile(digitRE); - } - } - return rval(state,stream,"number"); // normal integer - } - - // open parens - if (nongreedy(stream,openParenRE,openParenWords)) { - pushToken(state,stream); - return rval(state,stream,"open_paren"); - } - - // close parens - if (nongreedy(stream,closeParenRE,closeParenWords)) { - pushToken(state,stream); - return rval(state,stream,"close_paren"); - } - - // separators - if (greedy(stream,separatorRE,separatorWords)) { - // distinguish between "." as terminator and record field operator - if (!state.in_record) { - pushToken(state,stream); - } - return rval(state,stream,"separator"); - } - - // operators - if (greedy(stream,symbolRE,symbolWords)) { - return rval(state,stream,"operator"); - } - - return rval(state,stream,null); - } - - function isPrev(stream,string) { - var start = stream.start; - var len = string.length; - if (len <= start) { - var word = stream.string.slice(start-len,start); - return word == string; - }else{ - return false; - } - } - - function nongreedy(stream,re,words) { - if (stream.current().length == 1 && re.test(stream.current())) { - stream.backUp(1); - while (re.test(stream.peek())) { - stream.next(); - if (isMember(stream.current(),words)) { - return true; - } - } - stream.backUp(stream.current().length-1); - } - return false; - } - - function greedy(stream,re,words) { - if (stream.current().length == 1 && re.test(stream.current())) { - while (re.test(stream.peek())) { - stream.next(); - } - while (0 < stream.current().length) { - if (isMember(stream.current(),words)) { - return true; - }else{ - stream.backUp(1); - } - } - stream.next(); - } - return false; - } - - function doubleQuote(stream) { - return quote(stream, '"', '\\'); - } - - function singleQuote(stream) { - return quote(stream,'\'','\\'); - } - - function quote(stream,quoteChar,escapeChar) { - while (!stream.eol()) { - var ch = stream.next(); - if (ch == quoteChar) { - return true; - }else if (ch == escapeChar) { - stream.next(); - } - } - return false; - } - - function isMember(element,list) { - return (-1 < list.indexOf(element)); - } - -///////////////////////////////////////////////////////////////////////////// - function myIndent(state,textAfter) { - var indent = cmCfg.indentUnit; - var token = (peekToken(state)).token; - var wordAfter = takewhile(textAfter,/[^a-z]/); - - if (state.in_string || state.in_atom) { - return CodeMirror.Pass; - }else if (token == "") { - return 0; - }else if (isMember(token,openParenWords)) { - return (peekToken(state)).column+token.length; - }else if (token == "when") { - return (peekToken(state)).column+token.length+1; - }else if (token == "fun" && wordAfter == "") { - return (peekToken(state)).column+token.length; - }else if (token == "->") { - if (isMember(wordAfter,["end","after","catch"])) { - return peekToken(state,2).column; - }else if (peekToken(state,2).token == "fun") { - return peekToken(state,2).column+indent; - }else if (peekToken(state,2).token == "") { - return indent; - }else{ - return (peekToken(state)).indent+indent; - } - }else if (isMember(wordAfter,["after","catch","of"])) { - return (peekToken(state)).indent; - }else{ - return (peekToken(state)).column+indent; - } - } - - function takewhile(str,re) { - var m = str.match(re); - return m ? str.slice(0,m.index) : str; - } - - function Token(stream) { - this.token = stream ? stream.current() : ""; - this.column = stream ? stream.column() : 0; - this.indent = stream ? stream.indentation() : 0; - } - - function popToken(state) { - return state.tokenStack.pop(); - } - - function peekToken(state,depth) { - var len = state.tokenStack.length; - var dep = (depth ? depth : 1); - if (len < dep) { - return new Token; - }else{ - return state.tokenStack[len-dep]; - } - } - - function pushToken(state,stream) { - var token = stream.current(); - var prev_token = peekToken(state).token; - - if (token == ".") { - state.tokenStack = []; - return false; - }else if(isMember(token,[",", ":", "of", "cond", "let", "query"])) { - return false; - }else if (drop_last(prev_token,token)) { - return false; - }else if (drop_both(prev_token,token)) { - popToken(state); - return false; - }else if (drop_first(prev_token,token)) { - popToken(state); - return pushToken(state,stream); - }else if (isMember(token,["after","catch"])) { - return false; - }else{ - state.tokenStack.push(new Token(stream)); - return true; - } - } - - function drop_last(open, close) { - switch(open+" "+close) { - case "when ;": return true; - default: return false; - } - } - - function drop_first(open, close) { - switch (open+" "+close) { - case "when ->": return true; - case "-> end": return true; - default: return false; - } - } - - function drop_both(open, close) { - switch (open+" "+close) { - case "( )": return true; - case "[ ]": return true; - case "{ }": return true; - case "<< >>": return true; - case "begin end": return true; - case "case end": return true; - case "fun end": return true; - case "if end": return true; - case "receive end": return true; - case "try end": return true; - case "-> catch": return true; - case "-> after": return true; - case "-> ;": return true; - default: return false; - } - } - - return { - startState: - function() { - return {tokenStack: [], - in_record: false, - in_string: false, - in_atom: false}; - }, - - token: - function(stream, state) { - return tokenize(stream, state); - }, - - indent: - function(state, textAfter) { - return myIndent(state,textAfter); - }, - - lineComment: "%" - }; -}); diff --git a/deploy/core/node_modules/codemirror/modes/gherkin.js b/deploy/core/node_modules/codemirror/modes/gherkin.js deleted file mode 100644 index dadb58362..000000000 --- a/deploy/core/node_modules/codemirror/modes/gherkin.js +++ /dev/null @@ -1,168 +0,0 @@ -/* -Gherkin mode - http://www.cukes.info/ -Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues -*/ - -// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js -//var Quotes = { -// SINGLE: 1, -// DOUBLE: 2 -//}; - -//var regex = { -// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/ -//}; - -CodeMirror.defineMode("gherkin", function () { - return { - startState: function () { - return { - lineNumber: 0, - tableHeaderLine: null, - allowFeature: true, - allowBackground: false, - allowScenario: false, - allowSteps: false, - allowPlaceholders: false, - inMultilineArgument: false, - inMultilineString: false, - inMultilineTable: false - }; - }, - token: function (stream, state) { - if (stream.sol()) { - state.lineNumber++; - } - stream.eatSpace(); - - // INSIDE OF MULTILINE ARGUMENTS - if (state.inMultilineArgument) { - - // STRING - if (state.inMultilineString) { - if (stream.match('"""')) { - state.inMultilineString = false; - state.inMultilineArgument = false; - } else { - stream.match(/.*/); - } - return "string"; - } - - // TABLE - if (state.inMultilineTable) { - // New table, assume first row is headers - if (state.tableHeaderLine === null) { - state.tableHeaderLine = state.lineNumber; - } - - if (stream.match(/\|\s*/)) { - if (stream.eol()) { - state.inMultilineTable = false; - } - return "bracket"; - } else { - stream.match(/[^\|]*/); - return state.tableHeaderLine === state.lineNumber ? "property" : "string"; - } - } - - // DETECT START - if (stream.match('"""')) { - // String - state.inMultilineString = true; - return "string"; - } else if (stream.match("|")) { - // Table - state.inMultilineTable = true; - return "bracket"; - } else { - // Or abort - state.inMultilineArgument = false; - state.tableHeaderLine = null; - } - - - return null; - } - - // LINE COMMENT - if (stream.match(/#.*/)) { - return "comment"; - - // TAG - } else if (stream.match(/@\S+/)) { - return "def"; - - // FEATURE - } else if (state.allowFeature && stream.match(/Feature:/)) { - state.allowScenario = true; - state.allowBackground = true; - state.allowPlaceholders = false; - state.allowSteps = false; - return "keyword"; - - // BACKGROUND - } else if (state.allowBackground && stream.match("Background:")) { - state.allowPlaceholders = false; - state.allowSteps = true; - state.allowBackground = false; - return "keyword"; - - // SCENARIO OUTLINE - } else if (state.allowScenario && stream.match("Scenario Outline:")) { - state.allowPlaceholders = true; - state.allowSteps = true; - return "keyword"; - - // EXAMPLES - } else if (state.allowScenario && stream.match("Examples:")) { - state.allowPlaceholders = false; - state.allowSteps = true; - state.allowBackground = false; - state.inMultilineArgument = true; - return "keyword"; - - // SCENARIO - } else if (state.allowScenario && stream.match(/Scenario:/)) { - state.allowPlaceholders = false; - state.allowSteps = true; - state.allowBackground = false; - return "keyword"; - - // STEPS - } else if (state.allowSteps && stream.match(/(Given|When|Then|And|But)/)) { - return "keyword"; - - // INLINE STRING - } else if (!state.inMultilineArgument && stream.match(/"/)) { - stream.match(/.*?"/); - return "string"; - - // MULTILINE ARGUMENTS - } else if (state.allowSteps && stream.eat(":")) { - if (stream.match(/\s*$/)) { - state.inMultilineArgument = true; - return "keyword"; - } else { - return null; - } - - } else if (state.allowSteps && stream.match("<")) { - if (stream.match(/.*?>/)) { - return "property"; - } else { - return null; - } - - // Fall through - } else { - stream.eatWhile(/[^":<]/); - } - - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-feature", "gherkin"); diff --git a/deploy/core/node_modules/codemirror/modes/jade.js b/deploy/core/node_modules/codemirror/modes/jade.js deleted file mode 100644 index 61abb27ab..000000000 --- a/deploy/core/node_modules/codemirror/modes/jade.js +++ /dev/null @@ -1,90 +0,0 @@ -CodeMirror.defineMode("jade", function () { - var symbol_regex1 = /^(?:~|!|%|\^|\*|\+|=|\\|:|;|,|\/|\?|&|<|>|\|)/; - var open_paren_regex = /^(\(|\[)/; - var close_paren_regex = /^(\)|\])/; - var keyword_regex1 = /^(if|else|return|var|function|include|doctype|each)/; - var keyword_regex2 = /^(#|{|}|\.)/; - var keyword_regex3 = /^(in)/; - var html_regex1 = /^(html|head|title|meta|link|script|body|br|div|input|span|a|img)/; - var html_regex2 = /^(h1|h2|h3|h4|h5|p|strong|em)/; - return { - startState: function () { - return { - inString: false, - stringType: "", - beforeTag: true, - justMatchedKeyword: false, - afterParen: false - }; - }, - token: function (stream, state) { - //check for state changes - if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { - state.stringType = stream.peek(); - stream.next(); // Skip quote - state.inString = true; // Update state - } - - //return state - if (state.inString) { - if (stream.skipTo(state.stringType)) { // Quote found on this line - stream.next(); // Skip quote - state.inString = false; // Clear flag - } else { - stream.skipToEnd(); // Rest of line is string - } - state.justMatchedKeyword = false; - return "string"; // Token style - } else if (stream.sol() && stream.eatSpace()) { - if (stream.match(keyword_regex1)) { - state.justMatchedKeyword = true; - stream.eatSpace(); - return "keyword"; - } - if (stream.match(html_regex1) || stream.match(html_regex2)) { - state.justMatchedKeyword = true; - return "variable"; - } - } else if (stream.sol() && stream.match(keyword_regex1)) { - state.justMatchedKeyword = true; - stream.eatSpace(); - return "keyword"; - } else if (stream.sol() && (stream.match(html_regex1) || stream.match(html_regex2))) { - state.justMatchedKeyword = true; - return "variable"; - } else if (stream.eatSpace()) { - state.justMatchedKeyword = false; - if (stream.match(keyword_regex3) && stream.eatSpace()) { - state.justMatchedKeyword = true; - return "keyword"; - } - } else if (stream.match(symbol_regex1)) { - state.justMatchedKeyword = false; - return "atom"; - } else if (stream.match(open_paren_regex)) { - state.afterParen = true; - state.justMatchedKeyword = true; - return "def"; - } else if (stream.match(close_paren_regex)) { - state.afterParen = false; - state.justMatchedKeyword = true; - return "def"; - } else if (stream.match(keyword_regex2)) { - state.justMatchedKeyword = true; - return "keyword"; - } else if (stream.eatSpace()) { - state.justMatchedKeyword = false; - } else { - stream.next(); - if (state.justMatchedKeyword) { - return "property"; - } else if (state.afterParen) { - return "property"; - } - } - return null; - } - }; -}); - -CodeMirror.defineMIME('text/x-jade', 'jade'); diff --git a/deploy/core/node_modules/codemirror/modes/jinja2.js b/deploy/core/node_modules/codemirror/modes/jinja2.js deleted file mode 100644 index 16b06c48e..000000000 --- a/deploy/core/node_modules/codemirror/modes/jinja2.js +++ /dev/null @@ -1,42 +0,0 @@ -CodeMirror.defineMode("jinja2", function() { - var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", - "loop", "none", "self", "super", "if", "as", "not", "and", - "else", "import", "with", "without", "context"]; - keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - var ch = stream.next(); - if (ch == "{") { - if (ch = stream.eat(/\{|%|#/)) { - stream.eat("-"); - state.tokenize = inTag(ch); - return "tag"; - } - } - } - function inTag (close) { - if (close == "{") { - close = "}"; - } - return function (stream, state) { - var ch = stream.next(); - if ((ch == close || (ch == "-" && stream.eat(close))) - && stream.eat("}")) { - state.tokenize = tokenBase; - return "tag"; - } - if (stream.match(keywords)) { - return "keyword"; - } - return close == "#" ? "comment" : "string"; - }; - } - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; -}); diff --git a/deploy/core/node_modules/codemirror/modes/mysql.js b/deploy/core/node_modules/codemirror/modes/mysql.js deleted file mode 100644 index 69d3f9952..000000000 --- a/deploy/core/node_modules/codemirror/modes/mysql.js +++ /dev/null @@ -1,203 +0,0 @@ -/* - * MySQL Mode for CodeMirror 2 by MySQL-Tools - * @author James Thorne (partydroid) - * @link http://github.com/partydroid/MySQL-Tools - * @link http://mysqltools.org - * @version 02/Jan/2012 -*/ -CodeMirror.defineMode("mysql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "isblank", "isliteral", "union", "a"]); - var keywords = wordRegexp([ - ('ACCESSIBLE'),('ALTER'),('AS'),('BEFORE'),('BINARY'),('BY'),('CASE'),('CHARACTER'),('COLUMN'),('CONTINUE'),('CROSS'),('CURRENT_TIMESTAMP'),('DATABASE'),('DAY_MICROSECOND'),('DEC'),('DEFAULT'), - ('DESC'),('DISTINCT'),('DOUBLE'),('EACH'),('ENCLOSED'),('EXIT'),('FETCH'),('FLOAT8'),('FOREIGN'),('GRANT'),('HIGH_PRIORITY'),('HOUR_SECOND'),('IN'),('INNER'),('INSERT'),('INT2'),('INT8'), - ('INTO'),('JOIN'),('KILL'),('LEFT'),('LINEAR'),('LOCALTIME'),('LONG'),('LOOP'),('MATCH'),('MEDIUMTEXT'),('MINUTE_SECOND'),('NATURAL'),('NULL'),('OPTIMIZE'),('OR'),('OUTER'),('PRIMARY'), - ('RANGE'),('READ_WRITE'),('REGEXP'),('REPEAT'),('RESTRICT'),('RIGHT'),('SCHEMAS'),('SENSITIVE'),('SHOW'),('SPECIFIC'),('SQLSTATE'),('SQL_CALC_FOUND_ROWS'),('STARTING'),('TERMINATED'), - ('TINYINT'),('TRAILING'),('UNDO'),('UNLOCK'),('USAGE'),('UTC_DATE'),('VALUES'),('VARCHARACTER'),('WHERE'),('WRITE'),('ZEROFILL'),('ALL'),('AND'),('ASENSITIVE'),('BIGINT'),('BOTH'),('CASCADE'), - ('CHAR'),('COLLATE'),('CONSTRAINT'),('CREATE'),('CURRENT_TIME'),('CURSOR'),('DAY_HOUR'),('DAY_SECOND'),('DECLARE'),('DELETE'),('DETERMINISTIC'),('DIV'),('DUAL'),('ELSEIF'),('EXISTS'),('FALSE'), - ('FLOAT4'),('FORCE'),('FULLTEXT'),('HAVING'),('HOUR_MINUTE'),('IGNORE'),('INFILE'),('INSENSITIVE'),('INT1'),('INT4'),('INTERVAL'),('ITERATE'),('KEYS'),('LEAVE'),('LIMIT'),('LOAD'),('LOCK'), - ('LONGTEXT'),('MASTER_SSL_VERIFY_SERVER_CERT'),('MEDIUMINT'),('MINUTE_MICROSECOND'),('MODIFIES'),('NO_WRITE_TO_BINLOG'),('ON'),('OPTIONALLY'),('OUT'),('PRECISION'),('PURGE'),('READS'), - ('REFERENCES'),('RENAME'),('REQUIRE'),('REVOKE'),('SCHEMA'),('SELECT'),('SET'),('SPATIAL'),('SQLEXCEPTION'),('SQL_BIG_RESULT'),('SSL'),('TABLE'),('TINYBLOB'),('TO'),('TRUE'),('UNIQUE'), - ('UPDATE'),('USING'),('UTC_TIMESTAMP'),('VARCHAR'),('WHEN'),('WITH'),('YEAR_MONTH'),('ADD'),('ANALYZE'),('ASC'),('BETWEEN'),('BLOB'),('CALL'),('CHANGE'),('CHECK'),('CONDITION'),('CONVERT'), - ('CURRENT_DATE'),('CURRENT_USER'),('DATABASES'),('DAY_MINUTE'),('DECIMAL'),('DELAYED'),('DESCRIBE'),('DISTINCTROW'),('DROP'),('ELSE'),('ESCAPED'),('EXPLAIN'),('FLOAT'),('FOR'),('FROM'), - ('GROUP'),('HOUR_MICROSECOND'),('IF'),('INDEX'),('INOUT'),('INT'),('INT3'),('INTEGER'),('IS'),('KEY'),('LEADING'),('LIKE'),('LINES'),('LOCALTIMESTAMP'),('LONGBLOB'),('LOW_PRIORITY'), - ('MEDIUMBLOB'),('MIDDLEINT'),('MOD'),('NOT'),('NUMERIC'),('OPTION'),('ORDER'),('OUTFILE'),('PROCEDURE'),('READ'),('REAL'),('RELEASE'),('REPLACE'),('RETURN'),('RLIKE'),('SECOND_MICROSECOND'), - ('SEPARATOR'),('SMALLINT'),('SQL'),('SQLWARNING'),('SQL_SMALL_RESULT'),('STRAIGHT_JOIN'),('THEN'),('TINYTEXT'),('TRIGGER'),('UNION'),('UNSIGNED'),('USE'),('UTC_TIME'),('VARBINARY'),('VARYING'), - ('WHILE'),('XOR'),('FULL'),('COLUMNS'),('MIN'),('MAX'),('STDEV'),('COUNT') - ]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (ch == "`") { - state.tokenize = tokenOpLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "-" && stream.eat("-")) { - stream.skipToEnd(); - return "comment"; - } - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function tokenOpLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "variable-2"; - }; - } - - function tokenComment(stream, state) { - for (;;) { - if (stream.skipTo("*")) { - stream.next(); - if (stream.eat("/")) { - state.tokenize = tokenBase; - break; - } - } else { - stream.skipToEnd(); - break; - } - } - return "comment"; - } - - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/x-mysql", "mysql"); diff --git a/deploy/core/node_modules/codemirror/modes/php.js b/deploy/core/node_modules/codemirror/modes/php.js deleted file mode 100644 index 3555b8b14..000000000 --- a/deploy/core/node_modules/codemirror/modes/php.js +++ /dev/null @@ -1,132 +0,0 @@ -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - function heredoc(delim) { - return function(stream, state) { - if (stream.match(delim)) state.tokenize = null; - else stream.skipToEnd(); - return "string"; - }; - } - var phpConfig = { - name: "clike", - keywords: keywords("abstract and array as break case catch class clone const continue declare default " + - "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + - "for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw trait try use var while xor " + - "die echo empty exit eval include include_once isset list require require_once return " + - "print unset __halt_compiler self static parent yield insteadof finally"), - blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), - atoms: keywords("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"), - builtin: keywords("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once"), - multiLineStrings: true, - hooks: { - "$": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/<", false)) stream.next(); - return "comment"; - }, - "/": function(stream) { - if (stream.eat("/")) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - } - return false; - } - } - }; - - CodeMirror.defineMode("php", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, "text/html"); - var phpMode = CodeMirror.getMode(config, phpConfig); - - function dispatch(stream, state) { - var isPHP = state.curMode == phpMode; - if (stream.sol() && state.pending != '"') state.pending = null; - if (!isPHP) { - if (stream.match(/^<\?\w*/)) { - state.curMode = phpMode; - state.curState = state.php; - return "meta"; - } - if (state.pending == '"') { - while (!stream.eol() && stream.next() != '"') {} - var style = "string"; - } else if (state.pending && stream.pos < state.pending.end) { - stream.pos = state.pending.end; - var style = state.pending.style; - } else { - var style = htmlMode.token(stream, state.curState); - } - state.pending = null; - var cur = stream.current(), openPHP = cur.search(/<\?/); - if (openPHP != -1) { - if (style == "string" && /\"$/.test(cur) && !/\?>/.test(cur)) state.pending = '"'; - else state.pending = {end: stream.pos, style: style}; - stream.backUp(cur.length - openPHP); - } - return style; - } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { - state.curMode = htmlMode; - state.curState = state.html; - return "meta"; - } else { - return phpMode.token(stream, state.curState); - } - } - - return { - startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); - return {html: html, - php: php, - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? php : html, - pending: null}; - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curMode == htmlMode) cur = htmlNew; - else cur = phpNew; - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - pending: state.pending}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - electricChars: "/{}:", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - - innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } - }; - }, "htmlmixed", "clike"); - - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -})(); diff --git a/deploy/core/node_modules/codemirror/modes/plsql.js b/deploy/core/node_modules/codemirror/modes/plsql.js deleted file mode 100644 index df119baee..000000000 --- a/deploy/core/node_modules/codemirror/modes/plsql.js +++ /dev/null @@ -1,216 +0,0 @@ -CodeMirror.defineMode("plsql", function(_config, parserConfig) { - var keywords = parserConfig.keywords, - functions = parserConfig.functions, - types = parserConfig.types, - sqlplus = parserConfig.sqlplus, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - // start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) - return ret(ch); - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return ret("number", "number"); - } - // multi line comment or simple operator? - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // single line comment or simple operator? - else if (ch == "-") { - if (stream.eat("-")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // pl/sql variable? - else if (ch == "@" || ch == "$") { - stream.eatWhile(/[\w\d\$_]/); - return ret("word", "variable"); - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - else { - // get the whole word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "keyword"); - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "builtin"); - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-2"); - // is it one of the listed sqlplus keywords? - if (sqlplus && sqlplus.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-3"); - // default: just a "variable" - return ret("word", "variable"); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return ret("string", "plsql-string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "plsql-comment"); - } - - // Interface - - return { - startState: function() { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "abort accept access add all alter and any array arraylen as asc assert assign at attributes audit " + - "authorization avg " + - "base_table begin between binary_integer body boolean by " + - "case cast char char_base check close cluster clusters colauth column comment commit compress connect " + - "connected constant constraint crash create current currval cursor " + - "data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete " + - "desc digits dispose distinct do drop " + - "else elsif enable end entry escape exception exception_init exchange exclusive exists exit external " + - "fast fetch file for force form from function " + - "generic goto grant group " + - "having " + - "identified if immediate in increment index indexes indicator initial initrans insert interface intersect " + - "into is " + - "key " + - "level library like limited local lock log logging long loop " + - "master maxextents maxtrans member minextents minus mislabel mode modify multiset " + - "new next no noaudit nocompress nologging noparallel not nowait number_base " + - "object of off offline on online only open option or order out " + - "package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior " + - "private privileges procedure public " + - "raise range raw read rebuild record ref references refresh release rename replace resource restrict return " + - "returning reverse revoke rollback row rowid rowlabel rownum rows run " + - "savepoint schema segment select separate session set share snapshot some space split sql start statement " + - "storage subtype successful synonym " + - "tabauth table tables tablespace task terminate then to trigger truncate type " + - "union unique unlimited unrecoverable unusable update use using " + - "validate value values variable view views " + - "when whenever where while with work"; - - var cFunctions = "abs acos add_months ascii asin atan atan2 average " + - "bfilename " + - "ceil chartorowid chr concat convert cos cosh count " + - "decode deref dual dump dup_val_on_index " + - "empty error exp " + - "false floor found " + - "glb greatest " + - "hextoraw " + - "initcap instr instrb isopen " + - "last_day least lenght lenghtb ln lower lpad ltrim lub " + - "make_ref max min mod months_between " + - "new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower " + - "nls_sort nls_upper nlssort no_data_found notfound null nvl " + - "others " + - "power " + - "rawtohex reftohex round rowcount rowidtochar rpad rtrim " + - "sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate " + - "tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc " + - "uid upper user userenv " + - "variance vsize"; - - var cTypes = "bfile blob " + - "character clob " + - "dec " + - "float " + - "int integer " + - "mlslabel " + - "natural naturaln nchar nclob number numeric nvarchar2 " + - "real rowtype " + - "signtype smallint string " + - "varchar varchar2"; - - var cSqlplus = "appinfo arraysize autocommit autoprint autorecovery autotrace " + - "blockterminator break btitle " + - "cmdsep colsep compatibility compute concat copycommit copytypecheck " + - "define describe " + - "echo editfile embedded escape exec execute " + - "feedback flagger flush " + - "heading headsep " + - "instance " + - "linesize lno loboffset logsource long longchunksize " + - "markup " + - "native newpage numformat numwidth " + - "pagesize pause pno " + - "recsep recsepchar release repfooter repheader " + - "serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber " + - "sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix " + - "tab term termout time timing trimout trimspool ttitle " + - "underline " + - "verify version " + - "wrap"; - - CodeMirror.defineMIME("text/x-plsql", { - name: "plsql", - keywords: keywords(cKeywords), - functions: keywords(cFunctions), - types: keywords(cTypes), - sqlplus: keywords(cSqlplus) - }); -}()); diff --git a/deploy/core/node_modules/codemirror/modes/rst.js b/deploy/core/node_modules/codemirror/modes/rst.js deleted file mode 100644 index 75563ba98..000000000 --- a/deploy/core/node_modules/codemirror/modes/rst.js +++ /dev/null @@ -1,560 +0,0 @@ -CodeMirror.defineMode('rst-base', function (config) { - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function format(string) { - var args = Array.prototype.slice.call(arguments, 1); - return string.replace(/{(\d+)}/g, function (match, n) { - return typeof args[n] != 'undefined' ? args[n] : match; - }); - } - - function AssertException(message) { - this.message = message; - } - - AssertException.prototype.toString = function () { - return 'AssertException: ' + this.message; - }; - - function assert(expression, message) { - if (!expression) throw new AssertException(message); - return expression; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - var mode_python = CodeMirror.getMode(config, 'python'); - var mode_stex = CodeMirror.getMode(config, 'stex'); - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - var SEPA = "\\s+"; - var TAIL = "(?:\\s*|\\W|$)", - rx_TAIL = new RegExp(format('^{0}', TAIL)); - - var NAME = - "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)", - rx_NAME = new RegExp(format('^{0}', NAME)); - var NAME_WWS = - "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)"; - var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS); - - var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)"; - var TEXT2 = "(?:[^\\`]+)", - rx_TEXT2 = new RegExp(format('^{0}', TEXT2)); - - var rx_section = new RegExp( - "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"); - var rx_explicit = new RegExp( - format('^\\.\\.{0}', SEPA)); - var rx_link = new RegExp( - format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL)); - var rx_directive = new RegExp( - format('^{0}::{1}', REF_NAME, TAIL)); - var rx_substitution = new RegExp( - format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL)); - var rx_footnote = new RegExp( - format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL)); - var rx_citation = new RegExp( - format('^\\[{0}\\]{1}', REF_NAME, TAIL)); - - var rx_substitution_ref = new RegExp( - format('^\\|{0}\\|', TEXT1)); - var rx_footnote_ref = new RegExp( - format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME)); - var rx_citation_ref = new RegExp( - format('^\\[{0}\\]_', REF_NAME)); - var rx_link_ref1 = new RegExp( - format('^{0}__?', REF_NAME)); - var rx_link_ref2 = new RegExp( - format('^`{0}`_', TEXT2)); - - var rx_role_pre = new RegExp( - format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL)); - var rx_role_suf = new RegExp( - format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL)); - var rx_role = new RegExp( - format('^:{0}:{1}', NAME, TAIL)); - - var rx_directive_name = new RegExp(format('^{0}', REF_NAME)); - var rx_directive_tail = new RegExp(format('^::{0}', TAIL)); - var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1)); - var rx_substitution_sepa = new RegExp(format('^{0}', SEPA)); - var rx_substitution_name = new RegExp(format('^{0}', REF_NAME)); - var rx_substitution_tail = new RegExp(format('^::{0}', TAIL)); - var rx_link_head = new RegExp("^_"); - var rx_link_name = new RegExp(format('^{0}|_', REF_NAME)); - var rx_link_tail = new RegExp(format('^:{0}', TAIL)); - - var rx_verbatim = new RegExp('^::\\s*$'); - var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s'); - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_normal(stream, state) { - var token = null; - - if (stream.sol() && stream.match(rx_examples, false)) { - change(state, to_mode, { - mode: mode_python, local: mode_python.startState() - }); - } else if (stream.sol() && stream.match(rx_explicit)) { - change(state, to_explicit); - token = 'meta'; - } else if (stream.sol() && stream.match(rx_section)) { - change(state, to_normal); - token = 'header'; - } else if (phase(state) == rx_role_pre || - stream.match(rx_role_pre, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role_pre, 1)); - assert(stream.match(/^:/)); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role_pre, 2)); - assert(stream.match(rx_NAME)); - token = 'keyword'; - - if (stream.current().match(/^(?:math|latex)/)) { - state.tmp_stex = true; - } - break; - case 2: - change(state, to_normal, context(rx_role_pre, 3)); - assert(stream.match(/^:`/)); - token = 'meta'; - break; - case 3: - if (state.tmp_stex) { - state.tmp_stex = undefined; state.tmp = { - mode: mode_stex, local: mode_stex.startState() - }; - } - - if (state.tmp) { - if (stream.peek() == '`') { - change(state, to_normal, context(rx_role_pre, 4)); - state.tmp = undefined; - break; - } - - token = state.tmp.mode.token(stream, state.tmp.local); - break; - } - - change(state, to_normal, context(rx_role_pre, 4)); - assert(stream.match(rx_TEXT2)); - token = 'string'; - break; - case 4: - change(state, to_normal, context(rx_role_pre, 5)); - assert(stream.match(/^`/)); - token = 'meta'; - break; - case 5: - change(state, to_normal, context(rx_role_pre, 6)); - assert(stream.match(rx_TAIL)); - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (phase(state) == rx_role_suf || - stream.match(rx_role_suf, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role_suf, 1)); - assert(stream.match(/^`/)); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role_suf, 2)); - assert(stream.match(rx_TEXT2)); - token = 'string'; - break; - case 2: - change(state, to_normal, context(rx_role_suf, 3)); - assert(stream.match(/^`:/)); - token = 'meta'; - break; - case 3: - change(state, to_normal, context(rx_role_suf, 4)); - assert(stream.match(rx_NAME)); - token = 'keyword'; - break; - case 4: - change(state, to_normal, context(rx_role_suf, 5)); - assert(stream.match(/^:/)); - token = 'meta'; - break; - case 5: - change(state, to_normal, context(rx_role_suf, 6)); - assert(stream.match(rx_TAIL)); - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (phase(state) == rx_role || stream.match(rx_role, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_role, 1)); - assert(stream.match(/^:/)); - token = 'meta'; - break; - case 1: - change(state, to_normal, context(rx_role, 2)); - assert(stream.match(rx_NAME)); - token = 'keyword'; - break; - case 2: - change(state, to_normal, context(rx_role, 3)); - assert(stream.match(/^:/)); - token = 'meta'; - break; - case 3: - change(state, to_normal, context(rx_role, 4)); - assert(stream.match(rx_TAIL)); - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (phase(state) == rx_substitution_ref || - stream.match(rx_substitution_ref, false)) { - - switch (stage(state)) { - case 0: - change(state, to_normal, context(rx_substitution_ref, 1)); - assert(stream.match(rx_substitution_text)); - token = 'variable-2'; - break; - case 1: - change(state, to_normal, context(rx_substitution_ref, 2)); - if (stream.match(/^_?_?/)) token = 'link'; - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (stream.match(rx_footnote_ref)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_citation_ref)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_link_ref1)) { - change(state, to_normal); - if (!stream.peek() || stream.peek().match(/^\W$/)) { - token = 'link'; - } - } else if (phase(state) == rx_link_ref2 || - stream.match(rx_link_ref2, false)) { - - switch (stage(state)) { - case 0: - if (!stream.peek() || stream.peek().match(/^\W$/)) { - change(state, to_normal, context(rx_link_ref2, 1)); - } else { - stream.match(rx_link_ref2); - } - break; - case 1: - change(state, to_normal, context(rx_link_ref2, 2)); - assert(stream.match(/^`/)); - token = 'link'; - break; - case 2: - change(state, to_normal, context(rx_link_ref2, 3)); - assert(stream.match(rx_TEXT2)); - break; - case 3: - change(state, to_normal, context(rx_link_ref2, 4)); - assert(stream.match(/^`_/)); - token = 'link'; - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (stream.match(rx_verbatim)) { - change(state, to_verbatim); - } - - else { - if (stream.next()) change(state, to_normal); - } - - return token; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_explicit(stream, state) { - var token = null; - - if (phase(state) == rx_substitution || - stream.match(rx_substitution, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_substitution, 1)); - assert(stream.match(rx_substitution_text)); - token = 'variable-2'; - break; - case 1: - change(state, to_explicit, context(rx_substitution, 2)); - assert(stream.match(rx_substitution_sepa)); - break; - case 2: - change(state, to_explicit, context(rx_substitution, 3)); - assert(stream.match(rx_substitution_name)); - token = 'keyword'; - break; - case 3: - change(state, to_explicit, context(rx_substitution, 4)); - assert(stream.match(rx_substitution_tail)); - token = 'meta'; - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (phase(state) == rx_directive || - stream.match(rx_directive, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_directive, 1)); - assert(stream.match(rx_directive_name)); - token = 'keyword'; - - if (stream.current().match(/^(?:math|latex)/)) - state.tmp_stex = true; - else if (stream.current().match(/^python/)) - state.tmp_py = true; - break; - case 1: - change(state, to_explicit, context(rx_directive, 2)); - assert(stream.match(rx_directive_tail)); - token = 'meta'; - - if (stream.match(/^latex\s*$/) || state.tmp_stex) { - state.tmp_stex = undefined; change(state, to_mode, { - mode: mode_stex, local: mode_stex.startState() - }); - } - break; - case 2: - change(state, to_explicit, context(rx_directive, 3)); - if (stream.match(/^python\s*$/) || state.tmp_py) { - state.tmp_py = undefined; change(state, to_mode, { - mode: mode_python, local: mode_python.startState() - }); - } - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (phase(state) == rx_link || stream.match(rx_link, false)) { - - switch (stage(state)) { - case 0: - change(state, to_explicit, context(rx_link, 1)); - assert(stream.match(rx_link_head)); - assert(stream.match(rx_link_name)); - token = 'link'; - break; - case 1: - change(state, to_explicit, context(rx_link, 2)); - assert(stream.match(rx_link_tail)); - token = 'meta'; - break; - default: - change(state, to_normal); - assert(stream.current() == ''); - } - } else if (stream.match(rx_footnote)) { - change(state, to_normal); - token = 'quote'; - } else if (stream.match(rx_citation)) { - change(state, to_normal); - token = 'quote'; - } - - else { - stream.eatSpace(); - if (stream.eol()) { - change(state, to_normal); - } else { - stream.skipToEnd(); - change(state, to_comment); - token = 'comment'; - } - } - - return token; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_comment(stream, state) { - return as_block(stream, state, 'comment'); - } - - function to_verbatim(stream, state) { - return as_block(stream, state, 'meta'); - } - - function as_block(stream, state, token) { - if (stream.eol() || stream.eatSpace()) { - stream.skipToEnd(); - return token; - } else { - change(state, to_normal); - return null; - } - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function to_mode(stream, state) { - - if (state.ctx.mode && state.ctx.local) { - - if (stream.sol()) { - if (!stream.eatSpace()) change(state, to_normal); - return null; - } - - return state.ctx.mode.token(stream, state.ctx.local); - } - - change(state, to_normal); - return null; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - function context(phase, stage, mode, local) { - return {phase: phase, stage: stage, mode: mode, local: local}; - } - - function change(state, tok, ctx) { - state.tok = tok; - state.ctx = ctx || {}; - } - - function stage(state) { - return state.ctx.stage || 0; - } - - function phase(state) { - return state.ctx.phase; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - return { - startState: function () { - return {tok: to_normal, ctx: context(undefined, 0)}; - }, - - copyState: function (state) { - return {tok: state.tok, ctx: state.ctx}; - }, - - innerMode: function (state) { - return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode} - : state.ctx ? {state: state.ctx.local, mode: state.ctx.mode} - : null; - }, - - token: function (stream, state) { - return state.tok(stream, state); - } - }; -}, 'python', 'stex'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -CodeMirror.defineMode('rst', function (config, options) { - - var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/; - var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/; - var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/; - - var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/; - var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/; - var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/; - - var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://"; - var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})"; - var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*"; - var rx_uri = new RegExp("^" + - rx_uri_protocol + rx_uri_domain + rx_uri_path - ); - - var overlay = { - token: function (stream) { - - if (stream.match(rx_strong) && stream.match (/\W+|$/, false)) - return 'strong'; - if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false)) - return 'em'; - if (stream.match(rx_literal) && stream.match (/\W+|$/, false)) - return 'string-2'; - if (stream.match(rx_number)) - return 'number'; - if (stream.match(rx_positive)) - return 'positive'; - if (stream.match(rx_negative)) - return 'negative'; - if (stream.match(rx_uri)) - return 'link'; - - while (stream.next() != null) { - if (stream.match(rx_strong, false)) break; - if (stream.match(rx_emphasis, false)) break; - if (stream.match(rx_literal, false)) break; - if (stream.match(rx_number, false)) break; - if (stream.match(rx_positive, false)) break; - if (stream.match(rx_negative, false)) break; - if (stream.match(rx_uri, false)) break; - } - - return null; - } - }; - - var mode = CodeMirror.getMode( - config, options.backdrop || 'rst-base' - ); - - return CodeMirror.overlayMode(mode, overlay, true); // combine -}, 'python', 'stex'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -CodeMirror.defineMIME('text/x-rst', 'rst'); - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// diff --git a/deploy/core/node_modules/codemirror/modes/verilog.js b/deploy/core/node_modules/codemirror/modes/verilog.js deleted file mode 100644 index 708de23f4..000000000 --- a/deploy/core/node_modules/codemirror/modes/verilog.js +++ /dev/null @@ -1,182 +0,0 @@ -CodeMirror.defineMode("verilog", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[&|~> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) (.-StringStream)) parser (-> (js/require (str js/ltpath "/core/node_modules/lighttable/background/behaviorsParser.js")) From d5953975cc7434e0e55a4b41265e5fab60ee5bf4 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 12:20:54 -0500 Subject: [PATCH 341/656] Remove gitignore that is too general lib is a fairly common directory for node_modules and was silently causing issues when installing codemirror package. Removed and not replaced since no lib directory showed up after removal --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index f0a5a1887..2b9ce4185 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ deploy/core/node_modules/lighttable/bootstrap.js* .lein-env .lein-plugins/ *.so -lib deploy/LightTable deploy/LightTable.app deploy/credits.html From f1d33890bda7fbdde7fab6b43b95a0cdd0e05706 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 13:48:58 -0500 Subject: [PATCH 342/656] Move custom codemirror addons to their own dir codemirror package is now free of any custom files --- deploy/core/node_modules/codemirror_addons/README.md | 2 ++ .../node_modules/{codemirror => codemirror_addons}/overlay.js | 0 .../node_modules/{codemirror => codemirror_addons}/search.js | 0 .../{codemirror => codemirror_addons}/show-hint.js | 0 .../{codemirror => codemirror_addons}/stringstream.js | 0 src/lt/objs/editor.cljs | 2 +- src/lt/objs/find.cljs | 2 +- src/lt/objs/langs/behaviors.cljs | 2 +- src/lt/plugins/auto_complete.cljs | 4 ++-- 9 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 deploy/core/node_modules/codemirror_addons/README.md rename deploy/core/node_modules/{codemirror => codemirror_addons}/overlay.js (100%) rename deploy/core/node_modules/{codemirror => codemirror_addons}/search.js (100%) rename deploy/core/node_modules/{codemirror => codemirror_addons}/show-hint.js (100%) rename deploy/core/node_modules/{codemirror => codemirror_addons}/stringstream.js (100%) diff --git a/deploy/core/node_modules/codemirror_addons/README.md b/deploy/core/node_modules/codemirror_addons/README.md new file mode 100644 index 000000000..1879e0665 --- /dev/null +++ b/deploy/core/node_modules/codemirror_addons/README.md @@ -0,0 +1,2 @@ +These are custom CodeMirror addons. Some are forks of original addons and may eventually be merged +upstream. diff --git a/deploy/core/node_modules/codemirror/overlay.js b/deploy/core/node_modules/codemirror_addons/overlay.js similarity index 100% rename from deploy/core/node_modules/codemirror/overlay.js rename to deploy/core/node_modules/codemirror_addons/overlay.js diff --git a/deploy/core/node_modules/codemirror/search.js b/deploy/core/node_modules/codemirror_addons/search.js similarity index 100% rename from deploy/core/node_modules/codemirror/search.js rename to deploy/core/node_modules/codemirror_addons/search.js diff --git a/deploy/core/node_modules/codemirror/show-hint.js b/deploy/core/node_modules/codemirror_addons/show-hint.js similarity index 100% rename from deploy/core/node_modules/codemirror/show-hint.js rename to deploy/core/node_modules/codemirror_addons/show-hint.js diff --git a/deploy/core/node_modules/codemirror/stringstream.js b/deploy/core/node_modules/codemirror_addons/stringstream.js similarity index 100% rename from deploy/core/node_modules/codemirror/stringstream.js rename to deploy/core/node_modules/codemirror_addons/stringstream.js diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index d96fb9e22..81f3ca4f5 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -680,7 +680,7 @@ (load/js "core/node_modules/codemirror/addon/comment/comment.js" :sync) (load/js "core/node_modules/codemirror/addon/selection/active-line.js" :sync) ;; TODO: use addon/mode/overlay.js - (load/js "core/node_modules/codemirror/overlay.js" :sync) + (load/js "core/node_modules/codemirror_addons/overlay.js" :sync) (load/js "core/node_modules/codemirror/addon/scroll/scrollpastend.js" :sync) (doseq [file (files/ls "core/node_modules/codemirror/addon/fold") :when (= (files/ext file) "js")] diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 61ca52175..6757990e1 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -153,7 +153,7 @@ :triggers #{:init} :reaction (fn [this] ;; TODO: use addon/search/search.js - (load/js "core/node_modules/codemirror/search.js" :sync) + (load/js "core/node_modules/codemirror_addons/search.js" :sync) (load/js "core/node_modules/codemirror/addon/search/searchcursor.js" :sync))) (def bar (object/create ::find-bar)) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 6057e9b41..149a11943 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -11,7 +11,7 @@ (def flat-parser (background (fn [obj-id contents] ;; TODO: Use addon/runmode - (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) + (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror_addons/stringstream.js")) (.-StringStream)) parser (-> (js/require (str js/ltpath "/core/node_modules/lighttable/background/behaviorsParser.js")) (.-parseFlat)) diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 13af1b3ae..da21bd057 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -90,7 +90,7 @@ false))) (def w (background (fn [obj-id m] - (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/stringstream.js")) + (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror_addons/stringstream.js")) (.-StringStream)) stream (fn [s] (StringStream. s)) @@ -337,7 +337,7 @@ (behavior ::init :triggers #{:init} :reaction (fn [this] - (load/js "core/node_modules/codemirror/show-hint.js" :sync) + (load/js "core/node_modules/codemirror_addons/show-hint.js" :sync) (js/CodeMirror.extendMode "clojure" (clj->js {:hint-pattern #"[\w\-\>\:\*\$\?\<\!\+\.\/foo]"})) (js/CodeMirror.extendMode "text/x-clojurescript" (clj->js {:hint-pattern #"[\w\-\>\:\*\$\?\<\!\+\.\/foo]"})) (js/CodeMirror.extendMode "css" (clj->js {:hint-pattern #"[\w\.\-\#]"})) From 33ebe410c1db0dd130c3f97f6731c29233f59f9c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 14:28:14 -0500 Subject: [PATCH 343/656] Blacklist modes to prevent loading instead of gitignoring them While gitignoring prevented unused modes from being added to git, these modes were still on disk after an npm install and were getting loaded. This only effects developers but worth solving correctly rather than causing subtle heartache for someone else. --- deploy/core/.gitignore | 6 - .../codemirror/mode/clojure/clojure.js | 243 ++++++ .../codemirror/mode/clojure/index.html | 88 +++ .../node_modules/codemirror/mode/css/css.js | 717 ++++++++++++++++++ .../codemirror/mode/css/index.html | 70 ++ .../codemirror/mode/css/less.html | 152 ++++ .../codemirror/mode/css/less_test.js | 51 ++ .../codemirror/mode/css/scss.html | 157 ++++ .../codemirror/mode/css/scss_test.js | 110 +++ .../node_modules/codemirror/mode/css/test.js | 135 ++++ .../mode/htmlembedded/htmlembedded.js | 86 +++ .../codemirror/mode/htmlembedded/index.html | 58 ++ .../codemirror/mode/htmlmixed/htmlmixed.js | 121 +++ .../codemirror/mode/htmlmixed/index.html | 85 +++ .../codemirror/mode/javascript/index.html | 114 +++ .../codemirror/mode/javascript/javascript.js | 684 +++++++++++++++++ .../codemirror/mode/javascript/json-ld.html | 72 ++ .../codemirror/mode/javascript/test.js | 194 +++++ .../mode/javascript/typescript.html | 61 ++ .../codemirror/mode/python/index.html | 198 +++++ .../codemirror/mode/python/python.js | 359 +++++++++ src/lt/objs/editor.cljs | 9 +- 22 files changed, 3763 insertions(+), 7 deletions(-) create mode 100644 deploy/core/node_modules/codemirror/mode/clojure/clojure.js create mode 100644 deploy/core/node_modules/codemirror/mode/clojure/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/css/css.js create mode 100644 deploy/core/node_modules/codemirror/mode/css/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/css/less.html create mode 100644 deploy/core/node_modules/codemirror/mode/css/less_test.js create mode 100644 deploy/core/node_modules/codemirror/mode/css/scss.html create mode 100644 deploy/core/node_modules/codemirror/mode/css/scss_test.js create mode 100644 deploy/core/node_modules/codemirror/mode/css/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/htmlembedded/htmlembedded.js create mode 100644 deploy/core/node_modules/codemirror/mode/htmlembedded/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/htmlmixed/htmlmixed.js create mode 100644 deploy/core/node_modules/codemirror/mode/htmlmixed/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/javascript/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/javascript/javascript.js create mode 100644 deploy/core/node_modules/codemirror/mode/javascript/json-ld.html create mode 100644 deploy/core/node_modules/codemirror/mode/javascript/test.js create mode 100644 deploy/core/node_modules/codemirror/mode/javascript/typescript.html create mode 100644 deploy/core/node_modules/codemirror/mode/python/index.html create mode 100644 deploy/core/node_modules/codemirror/mode/python/python.js diff --git a/deploy/core/.gitignore b/deploy/core/.gitignore index c8233bbc0..ffed9615a 100644 --- a/deploy/core/.gitignore +++ b/deploy/core/.gitignore @@ -4,9 +4,3 @@ node_modules/codemirror/keymap/vim.js node_modules/codemirror/theme/ node_modules/codemirror/test/ node_modules/codemirror/bin/ -node_modules/codemirror/mode/htmlembedded/ -node_modules/codemirror/mode/htmlmixed/ -node_modules/codemirror/mode/clojure/ -node_modules/codemirror/mode/javascript/ -node_modules/codemirror/mode/python/ -node_modules/codemirror/mode/css/ diff --git a/deploy/core/node_modules/codemirror/mode/clojure/clojure.js b/deploy/core/node_modules/codemirror/mode/clojure/clojure.js new file mode 100644 index 000000000..c334de730 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/clojure/clojure.js @@ -0,0 +1,243 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Author: Hans Engel + * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("clojure", function (options) { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword", VAR = "variable"; + var INDENT_WORD_SKIP = options.indentUnit || 2; + var NORMAL_INDENT_UNIT = options.indentUnit || 2; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var atoms = makeKeywords("true false nil"); + + var keywords = makeKeywords( + "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); + + var builtins = makeKeywords( + "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"); + + var indentKeys = makeKeywords( + // Built-ins + "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " + + + // Binding forms + "let letfn binding loop for doseq dotimes when-let if-let " + + + // Data structures + "defstruct struct-map assoc " + + + // clojure.test + "testing deftest " + + + // contrib + "handler-case handle dotrace deftrace"); + + var tests = { + digit: /\d/, + digit_or_colon: /[\d:]/, + hex: /[0-9a-f]/i, + sign: /[+-]/, + exponent: /e/i, + keyword_char: /[^\s\(\[\;\)\]]/, + symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/ + }; + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + function isNumber(ch, stream){ + // hex + if ( ch === '0' && stream.eat(/x/i) ) { + stream.eatWhile(tests.hex); + return true; + } + + // leading sign + if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { + stream.eat(tests.sign); + ch = stream.next(); + } + + if ( tests.digit.test(ch) ) { + stream.eat(ch); + stream.eatWhile(tests.digit); + + if ( '.' == stream.peek() ) { + stream.eat('.'); + stream.eatWhile(tests.digit); + } + + if ( stream.eat(tests.exponent) ) { + stream.eat(tests.sign); + stream.eatWhile(tests.digit); + } + + return true; + } + + return false; + } + + // Eat character that starts after backslash \ + function eatCharacter(stream) { + var first = stream.next(); + // Read special literals: backspace, newline, space, return. + // Just read all lowercase letters. + if (first && first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) { + return; + } + // Read unicode character: \u1000 \uA0a1 + if (first === "u") { + stream.match(/[0-9a-z]{4}/i, true); + } + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in string mode + break; + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + } else if (ch == "\\") { + eatCharacter(stream); + returnType = CHARACTER; + } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { + returnType = ATOM; + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else if (ch == "(" || ch == "[" || ch == "{" ) { + var keyWord = '', indentTemp = stream.column(), letter; + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || + /^(?:def|with)/.test(keyWord))) { // indent-word + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation the user defined spaces after + pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + returnType = BRACKET; + } else if (ch == ")" || ch == "]" || ch == "}") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) { + popStack(state); + } + } else if ( ch == ":" ) { + stream.eatWhile(tests.symbol); + return ATOM; + } else { + stream.eatWhile(tests.symbol); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = KEYWORD; + } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { + returnType = ATOM; + } else { + returnType = VAR; + } + } + } + + return returnType; + }, + + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + }, + + lineComment: ";;" + }; +}); + +CodeMirror.defineMIME("text/x-clojure", "clojure"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/clojure/index.html b/deploy/core/node_modules/codemirror/mode/clojure/index.html new file mode 100644 index 000000000..3ecf4c486 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/clojure/index.html @@ -0,0 +1,88 @@ + + +CodeMirror: Clojure mode + + + + + + + + + +
+

Clojure mode

+
+ + +

MIME types defined: text/x-clojure.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/css/css.js b/deploy/core/node_modules/codemirror/mode/css/css.js new file mode 100644 index 000000000..2695d0815 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/css.js @@ -0,0 +1,717 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("css", function(config, parserConfig) { + if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); + + var indentUnit = config.indentUnit, + tokenHooks = parserConfig.tokenHooks, + mediaTypes = parserConfig.mediaTypes || {}, + mediaFeatures = parserConfig.mediaFeatures || {}, + propertyKeywords = parserConfig.propertyKeywords || {}, + nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, + colorKeywords = parserConfig.colorKeywords || {}, + valueKeywords = parserConfig.valueKeywords || {}, + fontProperties = parserConfig.fontProperties || {}, + allowNested = parserConfig.allowNested; + + var type, override; + function ret(style, tp) { type = tp; return style; } + + // Tokenizers + + function tokenBase(stream, state) { + var ch = stream.next(); + if (tokenHooks[ch]) { + var result = tokenHooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == "@") { + stream.eatWhile(/[\w\\\-]/); + return ret("def", stream.current()); + } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { + return ret(null, "compare"); + } else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "#") { + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "hash"); + } else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (ch === "-") { + if (/[\d.]/.test(stream.peek())) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (stream.match(/^\w+-/)) { + return ret("meta", "meta"); + } + } else if (/[,+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { + return ret("qualifier", "qualifier"); + } else if (/[:;{}\[\]\(\)]/.test(ch)) { + return ret(null, ch); + } else if (ch == "u" && stream.match("rl(")) { + stream.backUp(1); + state.tokenize = tokenParenthesized; + return ret("property", "word"); + } else if (/[\w\\\-]/.test(ch)) { + stream.eatWhile(/[\w\\\-]/); + return ret("property", "word"); + } else { + return ret(null, null); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + if (quote == ")") stream.backUp(1); + break; + } + escaped = !escaped && ch == "\\"; + } + if (ch == quote || !escaped && quote != ")") state.tokenize = null; + return ret("string", "string"); + }; + } + + function tokenParenthesized(stream, state) { + stream.next(); // Must be '(' + if (!stream.match(/\s*[\"\')]/, false)) + state.tokenize = tokenString(")"); + else + state.tokenize = null; + return ret(null, "("); + } + + // Context management + + function Context(type, indent, prev) { + this.type = type; + this.indent = indent; + this.prev = prev; + } + + function pushContext(state, stream, type) { + state.context = new Context(type, stream.indentation() + indentUnit, state.context); + return type; + } + + function popContext(state) { + state.context = state.context.prev; + return state.context.type; + } + + function pass(type, stream, state) { + return states[state.context.type](type, stream, state); + } + function popAndPass(type, stream, state, n) { + for (var i = n || 1; i > 0; i--) + state.context = state.context.prev; + return pass(type, stream, state); + } + + // Parser + + function wordAsValue(stream) { + var word = stream.current().toLowerCase(); + if (valueKeywords.hasOwnProperty(word)) + override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; + else + override = "variable"; + } + + var states = {}; + + states.top = function(type, stream, state) { + if (type == "{") { + return pushContext(state, stream, "block"); + } else if (type == "}" && state.context.prev) { + return popContext(state); + } else if (type == "@media") { + return pushContext(state, stream, "media"); + } else if (type == "@font-face") { + return "font_face_before"; + } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { + return "keyframes"; + } else if (type && type.charAt(0) == "@") { + return pushContext(state, stream, "at"); + } else if (type == "hash") { + override = "builtin"; + } else if (type == "word") { + override = "tag"; + } else if (type == "variable-definition") { + return "maybeprop"; + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } else if (type == ":") { + return "pseudo"; + } else if (allowNested && type == "(") { + return pushContext(state, stream, "parens"); + } + return state.context.type; + }; + + states.block = function(type, stream, state) { + if (type == "word") { + var word = stream.current().toLowerCase(); + if (propertyKeywords.hasOwnProperty(word)) { + override = "property"; + return "maybeprop"; + } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { + override = "string-2"; + return "maybeprop"; + } else if (allowNested) { + override = stream.match(/^\s*:/, false) ? "property" : "tag"; + return "block"; + } else { + override += " error"; + return "maybeprop"; + } + } else if (type == "meta") { + return "block"; + } else if (!allowNested && (type == "hash" || type == "qualifier")) { + override = "error"; + return "block"; + } else { + return states.top(type, stream, state); + } + }; + + states.maybeprop = function(type, stream, state) { + if (type == ":") return pushContext(state, stream, "prop"); + return pass(type, stream, state); + }; + + states.prop = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); + if (type == "}" || type == "{") return popAndPass(type, stream, state); + if (type == "(") return pushContext(state, stream, "parens"); + + if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { + override += " error"; + } else if (type == "word") { + wordAsValue(stream); + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } + return "prop"; + }; + + states.propBlock = function(type, _stream, state) { + if (type == "}") return popContext(state); + if (type == "word") { override = "property"; return "maybeprop"; } + return state.context.type; + }; + + states.parens = function(type, stream, state) { + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == ")") return popContext(state); + if (type == "(") return pushContext(state, stream, "parens"); + if (type == "word") wordAsValue(stream); + return "parens"; + }; + + states.pseudo = function(type, stream, state) { + if (type == "word") { + override = "variable-3"; + return state.context.type; + } + return pass(type, stream, state); + }; + + states.media = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "media_parens"); + if (type == "}") return popAndPass(type, stream, state); + if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); + + if (type == "word") { + var word = stream.current().toLowerCase(); + if (word == "only" || word == "not" || word == "and") + override = "keyword"; + else if (mediaTypes.hasOwnProperty(word)) + override = "attribute"; + else if (mediaFeatures.hasOwnProperty(word)) + override = "property"; + else + override = "error"; + } + return state.context.type; + }; + + states.media_parens = function(type, stream, state) { + if (type == ")") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); + return states.media(type, stream, state); + }; + + states.font_face_before = function(type, stream, state) { + if (type == "{") + return pushContext(state, stream, "font_face"); + return pass(type, stream, state); + }; + + states.font_face = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "word") { + if (!fontProperties.hasOwnProperty(stream.current().toLowerCase())) + override = "error"; + else + override = "property"; + return "maybeprop"; + } + return "font_face"; + }; + + states.keyframes = function(type, stream, state) { + if (type == "word") { override = "variable"; return "keyframes"; } + if (type == "{") return pushContext(state, stream, "top"); + return pass(type, stream, state); + }; + + states.at = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == "word") override = "tag"; + else if (type == "hash") override = "builtin"; + return "at"; + }; + + states.interpolation = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "{" || type == ";") return popAndPass(type, stream, state); + if (type != "variable") override = "error"; + return "interpolation"; + }; + + return { + startState: function(base) { + return {tokenize: null, + state: "top", + context: new Context("top", base || 0, null)}; + }, + + token: function(stream, state) { + if (!state.tokenize && stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style && typeof style == "object") { + type = style[1]; + style = style[0]; + } + override = style; + state.state = states[state.state](type, stream, state); + return override; + }, + + indent: function(state, textAfter) { + var cx = state.context, ch = textAfter && textAfter.charAt(0); + var indent = cx.indent; + if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; + if (cx.prev && + (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") || + ch == ")" && (cx.type == "parens" || cx.type == "media_parens") || + ch == "{" && (cx.type == "at" || cx.type == "media"))) { + indent = cx.indent - indentUnit; + cx = cx.prev; + } + return indent; + }, + + electricChars: "}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + fold: "brace" + }; +}); + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i]] = true; + } + return keys; + } + + var mediaTypes_ = [ + "all", "aural", "braille", "handheld", "print", "projection", "screen", + "tty", "tv", "embossed" + ], mediaTypes = keySet(mediaTypes_); + + var mediaFeatures_ = [ + "width", "min-width", "max-width", "height", "min-height", "max-height", + "device-width", "min-device-width", "max-device-width", "device-height", + "min-device-height", "max-device-height", "aspect-ratio", + "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", + "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", + "max-color", "color-index", "min-color-index", "max-color-index", + "monochrome", "min-monochrome", "max-monochrome", "resolution", + "min-resolution", "max-resolution", "scan", "grid" + ], mediaFeatures = keySet(mediaFeatures_); + + var propertyKeywords_ = [ + "align-content", "align-items", "align-self", "alignment-adjust", + "alignment-baseline", "anchor-point", "animation", "animation-delay", + "animation-direction", "animation-duration", "animation-fill-mode", + "animation-iteration-count", "animation-name", "animation-play-state", + "animation-timing-function", "appearance", "azimuth", "backface-visibility", + "background", "background-attachment", "background-clip", "background-color", + "background-image", "background-origin", "background-position", + "background-repeat", "background-size", "baseline-shift", "binding", + "bleed", "bookmark-label", "bookmark-level", "bookmark-state", + "bookmark-target", "border", "border-bottom", "border-bottom-color", + "border-bottom-left-radius", "border-bottom-right-radius", + "border-bottom-style", "border-bottom-width", "border-collapse", + "border-color", "border-image", "border-image-outset", + "border-image-repeat", "border-image-slice", "border-image-source", + "border-image-width", "border-left", "border-left-color", + "border-left-style", "border-left-width", "border-radius", "border-right", + "border-right-color", "border-right-style", "border-right-width", + "border-spacing", "border-style", "border-top", "border-top-color", + "border-top-left-radius", "border-top-right-radius", "border-top-style", + "border-top-width", "border-width", "bottom", "box-decoration-break", + "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", + "caption-side", "clear", "clip", "color", "color-profile", "column-count", + "column-fill", "column-gap", "column-rule", "column-rule-color", + "column-rule-style", "column-rule-width", "column-span", "column-width", + "columns", "content", "counter-increment", "counter-reset", "crop", "cue", + "cue-after", "cue-before", "cursor", "direction", "display", + "dominant-baseline", "drop-initial-after-adjust", + "drop-initial-after-align", "drop-initial-before-adjust", + "drop-initial-before-align", "drop-initial-size", "drop-initial-value", + "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", + "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", + "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", + "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", + "font-stretch", "font-style", "font-synthesis", "font-variant", + "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", + "font-variant-ligatures", "font-variant-numeric", "font-variant-position", + "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", + "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end", + "grid-column-start", "grid-row", "grid-row-end", "grid-row-start", + "grid-template", "grid-template-areas", "grid-template-columns", + "grid-template-rows", "hanging-punctuation", "height", "hyphens", + "icon", "image-orientation", "image-rendering", "image-resolution", + "inline-box-align", "justify-content", "left", "letter-spacing", + "line-break", "line-height", "line-stacking", "line-stacking-ruby", + "line-stacking-shift", "line-stacking-strategy", "list-style", + "list-style-image", "list-style-position", "list-style-type", "margin", + "margin-bottom", "margin-left", "margin-right", "margin-top", + "marker-offset", "marks", "marquee-direction", "marquee-loop", + "marquee-play-count", "marquee-speed", "marquee-style", "max-height", + "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", + "nav-left", "nav-right", "nav-up", "object-fit", "object-position", + "opacity", "order", "orphans", "outline", + "outline-color", "outline-offset", "outline-style", "outline-width", + "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", + "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", + "page", "page-break-after", "page-break-before", "page-break-inside", + "page-policy", "pause", "pause-after", "pause-before", "perspective", + "perspective-origin", "pitch", "pitch-range", "play-during", "position", + "presentation-level", "punctuation-trim", "quotes", "region-break-after", + "region-break-before", "region-break-inside", "region-fragment", + "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", + "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", + "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", + "shape-outside", "size", "speak", "speak-as", "speak-header", + "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", + "tab-size", "table-layout", "target", "target-name", "target-new", + "target-position", "text-align", "text-align-last", "text-decoration", + "text-decoration-color", "text-decoration-line", "text-decoration-skip", + "text-decoration-style", "text-emphasis", "text-emphasis-color", + "text-emphasis-position", "text-emphasis-style", "text-height", + "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", + "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", + "text-wrap", "top", "transform", "transform-origin", "transform-style", + "transition", "transition-delay", "transition-duration", + "transition-property", "transition-timing-function", "unicode-bidi", + "vertical-align", "visibility", "voice-balance", "voice-duration", + "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", + "voice-volume", "volume", "white-space", "widows", "width", "word-break", + "word-spacing", "word-wrap", "z-index", + // SVG-specific + "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", + "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", + "color-interpolation", "color-interpolation-filters", + "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", + "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", + "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", + "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", + "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", + "glyph-orientation-vertical", "text-anchor", "writing-mode" + ], propertyKeywords = keySet(propertyKeywords_); + + var nonStandardPropertyKeywords_ = [ + "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", + "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", + "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", + "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", + "searchfield-results-decoration", "zoom" + ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); + + var colorKeywords_ = [ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", + "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", + "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", + "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", + "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", + "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", + "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", + "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", + "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", + "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", + "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", + "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", + "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", + "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", + "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", + "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", + "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", + "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", + "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", + "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", + "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", + "whitesmoke", "yellow", "yellowgreen" + ], colorKeywords = keySet(colorKeywords_); + + var valueKeywords_ = [ + "above", "absolute", "activeborder", "activecaption", "afar", + "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", + "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", + "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page", + "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", + "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", + "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", + "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", + "cell", "center", "checkbox", "circle", "cjk-earthly-branch", + "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", + "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", + "content-box", "context-menu", "continuous", "copy", "cover", "crop", + "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", + "decimal-leading-zero", "default", "default-button", "destination-atop", + "destination-in", "destination-out", "destination-over", "devanagari", + "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", + "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", + "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", + "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", + "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", + "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", + "ethiopic-halehame-gez", "ethiopic-halehame-om-et", + "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", + "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", + "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", + "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", + "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", + "help", "hidden", "hide", "higher", "highlight", "highlighttext", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", + "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", + "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", + "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", + "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", + "landscape", "lao", "large", "larger", "left", "level", "lighter", + "line-through", "linear", "lines", "list-item", "listbox", "listitem", + "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", + "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", + "lower-roman", "lowercase", "ltr", "malayalam", "match", + "media-controls-background", "media-current-time-display", + "media-fullscreen-button", "media-mute-button", "media-play-button", + "media-return-to-realtime-button", "media-rewind-button", + "media-seek-back-button", "media-seek-forward-button", "media-slider", + "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", + "media-volume-slider-container", "media-volume-sliderthumb", "medium", + "menu", "menulist", "menulist-button", "menulist-text", + "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", + "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", + "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", + "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", + "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", + "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", + "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", + "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer", + "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", + "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", + "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", + "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", + "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", + "searchfield-cancel-button", "searchfield-decoration", + "searchfield-results-button", "searchfield-results-decoration", + "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", + "single", "skip-white-space", "slide", "slider-horizontal", + "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", + "small", "small-caps", "small-caption", "smaller", "solid", "somali", + "source-atop", "source-in", "source-out", "source-over", "space", "square", + "square-button", "start", "static", "status-bar", "stretch", "stroke", + "sub", "subpixel-antialiased", "super", "sw-resize", "table", + "table-caption", "table-cell", "table-column", "table-column-group", + "table-footer-group", "table-header-group", "table-row", "table-row-group", + "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", + "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", + "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", + "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", + "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", + "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", + "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", + "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", + "window", "windowframe", "windowtext", "x-large", "x-small", "xor", + "xx-large", "xx-small" + ], valueKeywords = keySet(valueKeywords_); + + var fontProperties_ = [ + "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", + "font-stretch", "font-weight", "font-style" + ], fontProperties = keySet(fontProperties_); + + var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_) + .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); + CodeMirror.registerHelper("hintWords", "css", allWords); + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + function tokenSGMLComment(stream, state) { + if (stream.skipTo("-->")) { + stream.match("-->"); + state.tokenize = null; + } else { + stream.skipToEnd(); + } + return ["comment", "comment"]; + } + + CodeMirror.defineMIME("text/css", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + tokenHooks: { + "<": function(stream, state) { + if (!stream.match("!--")) return false; + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + }, + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css" + }); + + CodeMirror.defineMIME("text/x-scss", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + ":": function(stream) { + if (stream.match(/\s*\{/)) + return [null, "{"]; + return false; + }, + "$": function(stream) { + stream.match(/^[\w-]+/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "#": function(stream) { + if (!stream.eat("{")) return false; + return [null, "interpolation"]; + } + }, + name: "css", + helperType: "scss" + }); + + CodeMirror.defineMIME("text/x-less", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + "@": function(stream) { + if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "&": function() { + return ["atom", "atom"]; + } + }, + name: "css", + helperType: "less" + }); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/css/index.html b/deploy/core/node_modules/codemirror/mode/css/index.html new file mode 100644 index 000000000..3d2c127d2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/index.html @@ -0,0 +1,70 @@ + + +CodeMirror: CSS mode + + + + + + + + + +
+

CSS mode

+
+ + +

MIME types defined: text/css, text/x-scss (demo), text/x-less (demo).

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/css/less.html b/deploy/core/node_modules/codemirror/mode/css/less.html new file mode 100644 index 000000000..6ccb721e6 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/less.html @@ -0,0 +1,152 @@ + + +CodeMirror: LESS mode + + + + + + + + + + +
+

LESS mode

+
+ + +

The LESS mode is a sub-mode of the CSS mode (defined in css.js.

+ +

Parsing/Highlighting Tests: normal, verbose.

+
diff --git a/deploy/core/node_modules/codemirror/mode/css/less_test.js b/deploy/core/node_modules/codemirror/mode/css/less_test.js new file mode 100644 index 000000000..2ba69984f --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/less_test.js @@ -0,0 +1,51 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + "use strict"; + + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } + + MT("variable", + "[variable-2 @base]: [atom #f04615];", + "[qualifier .class] {", + " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", + " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", + "}"); + + MT("amp", + "[qualifier .child], [qualifier .sibling] {", + " [qualifier .parent] [atom &] {", + " [property color]: [keyword black];", + " }", + " [atom &] + [atom &] {", + " [property color]: [keyword red];", + " }", + "}"); + + MT("mixin", + "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", + " [property color]: [variable darken]([variable-2 @color], [number 10%]);", + "}", + "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", + " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", + "}", + "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", + " [property display]: [atom block];", + "}", + "[variable-2 @switch]: [variable light];", + "[qualifier .class] {", + " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", + "}"); + + MT("nest", + "[qualifier .one] {", + " [def @media] ([property width]: [number 400px]) {", + " [property font-size]: [number 1.2em];", + " [def @media] [attribute print] [keyword and] [property color] {", + " [property color]: [keyword blue];", + " }", + " }", + "}"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/css/scss.html b/deploy/core/node_modules/codemirror/mode/css/scss.html new file mode 100644 index 000000000..21f20e0d1 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/scss.html @@ -0,0 +1,157 @@ + + +CodeMirror: SCSS mode + + + + + + + + + +
+

SCSS mode

+
+ + +

The SCSS mode is a sub-mode of the CSS mode (defined in css.js.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/css/scss_test.js b/deploy/core/node_modules/codemirror/mode/css/scss_test.js new file mode 100644 index 000000000..8dcea9e86 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/scss_test.js @@ -0,0 +1,110 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } + + MT('url_with_quotation', + "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); + + MT('url_with_double_quotes', + "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); + + MT('url_with_single_quotes', + "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); + + MT('string', + "[def @import] [string \"compass/css3\"]"); + + MT('important_keyword', + "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); + + MT('variable', + "[variable-2 $blue]:[atom #333]"); + + MT('variable_as_attribute', + "[tag foo] { [property color]:[variable-2 $blue] }"); + + MT('numbers', + "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); + + MT('number_percentage', + "[tag foo] { [property width]:[number 80%] }"); + + MT('selector', + "[builtin #hello][qualifier .world]{}"); + + MT('singleline_comment', + "[comment // this is a comment]"); + + MT('multiline_comment', + "[comment /*foobar*/]"); + + MT('attribute_with_hyphen', + "[tag foo] { [property font-size]:[number 10px] }"); + + MT('string_after_attribute', + "[tag foo] { [property content]:[string \"::\"] }"); + + MT('directives', + "[def @include] [qualifier .mixin]"); + + MT('basic_structure', + "[tag p] { [property background]:[keyword red]; }"); + + MT('nested_structure', + "[tag p] { [tag a] { [property color]:[keyword red]; } }"); + + MT('mixin', + "[def @mixin] [tag table-base] {}"); + + MT('number_without_semicolon', + "[tag p] {[property width]:[number 12]}", + "[tag a] {[property color]:[keyword red];}"); + + MT('atom_in_nested_block', + "[tag p] { [tag a] { [property color]:[atom #000]; } }"); + + MT('interpolation_in_property', + "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); + + MT('interpolation_in_selector', + "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); + + MT('interpolation_error', + "[tag foo]#{[error foo]} { [property color]:[atom #000]; }"); + + MT("divide_operator", + "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); + + MT('nested_structure_with_id_selector', + "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); + + MT('indent_mixin', + "[def @mixin] [tag container] (", + " [variable-2 $a]: [number 10],", + " [variable-2 $b]: [number 10])", + "{}"); + + MT('indent_nested', + "[tag foo] {", + " [tag bar] {", + " }", + "}"); + + MT('indent_parentheses', + "[tag foo] {", + " [property color]: [variable darken]([variable-2 $blue],", + " [number 9%]);", + "}"); + + MT('indent_vardef', + "[variable-2 $name]:", + " [string 'val'];", + "[tag tag] {", + " [tag inner] {", + " [property margin]: [number 3px];", + " }", + "}"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/css/test.js b/deploy/core/node_modules/codemirror/mode/css/test.js new file mode 100644 index 000000000..d236e2a73 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/css/test.js @@ -0,0 +1,135 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "css"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + // Error, because "foobarhello" is neither a known type or property, but + // property was expected (after "and"), and it should be in parenthese. + MT("atMediaUnknownType", + "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); + + // Soft error, because "foobarhello" is not a known property or type. + MT("atMediaUnknownProperty", + "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); + + // Make sure nesting works with media queries + MT("atMediaMaxWidthNested", + "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); + + MT("tagSelector", + "[tag foo] { }"); + + MT("classSelector", + "[qualifier .foo-bar_hello] { }"); + + MT("idSelector", + "[builtin #foo] { [error #foo] }"); + + MT("tagSelectorUnclosed", + "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); + + MT("tagStringNoQuotes", + "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); + + MT("tagStringDouble", + "[tag foo] { [property font-family]: [string \"hello world\"]; }"); + + MT("tagStringSingle", + "[tag foo] { [property font-family]: [string 'hello world']; }"); + + MT("tagColorKeyword", + "[tag foo] {", + " [property color]: [keyword black];", + " [property color]: [keyword navy];", + " [property color]: [keyword yellow];", + "}"); + + MT("tagColorHex3", + "[tag foo] { [property background]: [atom #fff]; }"); + + MT("tagColorHex6", + "[tag foo] { [property background]: [atom #ffffff]; }"); + + MT("tagColorHex4", + "[tag foo] { [property background]: [atom&error #ffff]; }"); + + MT("tagColorHexInvalid", + "[tag foo] { [property background]: [atom&error #ffg]; }"); + + MT("tagNegativeNumber", + "[tag foo] { [property margin]: [number -5px]; }"); + + MT("tagPositiveNumber", + "[tag foo] { [property padding]: [number 5px]; }"); + + MT("tagVendor", + "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); + + MT("tagBogusProperty", + "[tag foo] { [property&error barhelloworld]: [number 0]; }"); + + MT("tagTwoProperties", + "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); + + MT("tagTwoPropertiesURL", + "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); + + MT("commentSGML", + "[comment ]"); + + MT("commentSGML2", + "[comment ] [tag div] {}"); + + MT("indent_tagSelector", + "[tag strong], [tag em] {", + " [property background]: [atom rgba](", + " [number 255], [number 255], [number 0], [number .2]", + " );", + "}"); + + MT("indent_atMedia", + "[def @media] {", + " [tag foo] {", + " [property color]:", + " [keyword yellow];", + " }", + "}"); + + MT("indent_comma", + "[tag foo] {", + " [property font-family]: [variable verdana],", + " [atom sans-serif];", + "}"); + + MT("indent_parentheses", + "[tag foo]:[variable-3 before] {", + " [property background]: [atom url](", + "[string blahblah]", + "[string etc]", + "[string ]) [keyword !important];", + "}"); + + MT("font_face", + "[def @font-face] {", + " [property font-family]: [string 'myfont'];", + " [error nonsense]: [string 'abc'];", + " [property src]: [atom url]([string http://blah]),", + " [atom url]([string http://foo]);", + "}"); + + MT("empty_url", + "[def @import] [tag url]() [tag screen];"); + + MT("parens", + "[qualifier .foo] {", + " [property background-image]: [variable fade]([atom #000], [number 20%]);", + " [property border-image]: [variable linear-gradient](", + " [atom to] [atom bottom],", + " [variable fade]([atom #000], [number 20%]) [number 0%],", + " [variable fade]([atom #000], [number 20%]) [number 100%]", + " );", + "}"); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/htmlembedded/htmlembedded.js b/deploy/core/node_modules/codemirror/mode/htmlembedded/htmlembedded.js new file mode 100644 index 000000000..e8f7ba803 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/htmlembedded/htmlembedded.js @@ -0,0 +1,86 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { + + //config settings + var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, + scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; + + //inner modes + var scriptingMode, htmlMixedMode; + + //tokenizer when in html mode + function htmlDispatch(stream, state) { + if (stream.match(scriptStartRegex, false)) { + state.token=scriptingDispatch; + return scriptingMode.token(stream, state.scriptState); + } + else + return htmlMixedMode.token(stream, state.htmlState); + } + + //tokenizer when in scripting mode + function scriptingDispatch(stream, state) { + if (stream.match(scriptEndRegex, false)) { + state.token=htmlDispatch; + return htmlMixedMode.token(stream, state.htmlState); + } + else + return scriptingMode.token(stream, state.scriptState); + } + + + return { + startState: function() { + scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); + htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); + return { + token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, + htmlState : CodeMirror.startState(htmlMixedMode), + scriptState : CodeMirror.startState(scriptingMode) + }; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (state.token == htmlDispatch) + return htmlMixedMode.indent(state.htmlState, textAfter); + else if (scriptingMode.indent) + return scriptingMode.indent(state.scriptState, textAfter); + }, + + copyState: function(state) { + return { + token : state.token, + htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), + scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) + }; + }, + + innerMode: function(state) { + if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; + else return {state: state.htmlState, mode: htmlMixedMode}; + } + }; +}, "htmlmixed"); + +CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); +CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); +CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); +CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/htmlembedded/index.html b/deploy/core/node_modules/codemirror/mode/htmlembedded/index.html new file mode 100644 index 000000000..93d01c451 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/htmlembedded/index.html @@ -0,0 +1,58 @@ + + +CodeMirror: Html Embedded Scripts mode + + + + + + + + + + + + + +
+

Html Embedded Scripts mode

+
+ + + +

Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on + JavaScript, CSS and XML.
Other dependancies include those of the scriping language chosen.

+ +

MIME types defined: application/x-aspx (ASP.NET), + application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

+
diff --git a/deploy/core/node_modules/codemirror/mode/htmlmixed/htmlmixed.js b/deploy/core/node_modules/codemirror/mode/htmlmixed/htmlmixed.js new file mode 100644 index 000000000..250ef8cd2 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/htmlmixed/htmlmixed.js @@ -0,0 +1,121 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, {name: "xml", + htmlMode: true, + multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, + multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag}); + var cssMode = CodeMirror.getMode(config, "css"); + + var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; + scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, + mode: CodeMirror.getMode(config, "javascript")}); + if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { + var conf = scriptTypesConf[i]; + scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); + } + scriptTypes.push({matches: /./, + mode: CodeMirror.getMode(config, "text/plain")}); + + function html(stream, state) { + var tagName = state.htmlState.tagName; + if (tagName) tagName = tagName.toLowerCase(); + var style = htmlMode.token(stream, state.htmlState); + if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { + // Script block: mode to change to depends on type attribute + var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); + scriptType = scriptType ? scriptType[1] : ""; + if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); + for (var i = 0; i < scriptTypes.length; ++i) { + var tp = scriptTypes[i]; + if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { + if (tp.mode) { + state.token = script; + state.localMode = tp.mode; + state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); + } + break; + } + } + } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { + state.token = css; + state.localMode = cssMode; + state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); + } + return style; + } + function maybeBackup(stream, pat, style) { + var cur = stream.current(); + var close = cur.search(pat), m; + if (close > -1) stream.backUp(cur.length - close); + else if (m = cur.match(/<\/?$/)) { + stream.backUp(cur.length); + if (!stream.match(pat, false)) stream.match(cur); + } + return style; + } + function script(stream, state) { + if (stream.match(/^<\/\s*script\s*>/i, false)) { + state.token = html; + state.localState = state.localMode = null; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*script\s*>/, + state.localMode.token(stream, state.localState)); + } + function css(stream, state) { + if (stream.match(/^<\/\s*style\s*>/i, false)) { + state.token = html; + state.localState = state.localMode = null; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*style\s*>/, + cssMode.token(stream, state.localState)); + } + + return { + startState: function() { + var state = htmlMode.startState(); + return {token: html, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function(state) { + if (state.localState) + var local = CodeMirror.copyState(state.localMode, state.localState); + return {token: state.token, localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter); + else + return CodeMirror.Pass; + }, + + innerMode: function(state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; +}, "xml", "javascript", "css"); + +CodeMirror.defineMIME("text/html", "htmlmixed"); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/htmlmixed/index.html b/deploy/core/node_modules/codemirror/mode/htmlmixed/index.html new file mode 100644 index 000000000..61630293f --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/htmlmixed/index.html @@ -0,0 +1,85 @@ + + +CodeMirror: HTML mixed mode + + + + + + + + + + + + + +
+

HTML mixed mode

+
+ + +

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

+ +

It takes an optional mode configuration + option, scriptTypes, which can be used to add custom + behavior for specific <script type="..."> tags. If + given, it should hold an array of {matches, mode} + objects, where matches is a string or regexp that + matches the script type, and mode is + either null, for script types that should stay in + HTML mode, or a mode + spec corresponding to the mode that should be used for the + script.

+ +

MIME types defined: text/html + (redefined, only takes effect if you load this parser after the + XML parser).

+ +
diff --git a/deploy/core/node_modules/codemirror/mode/javascript/index.html b/deploy/core/node_modules/codemirror/mode/javascript/index.html new file mode 100644 index 000000000..592a133d8 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/javascript/index.html @@ -0,0 +1,114 @@ + + +CodeMirror: JavaScript mode + + + + + + + + + + + + +
+

JavaScript mode

+ + +
+ + + +

+ JavaScript mode supports several configuration options: +

    +
  • json which will set the mode to expect JSON + data rather than a JavaScript program.
  • +
  • jsonld which will set the mode to expect + JSON-LD linked data rather + than a JavaScript program (demo).
  • +
  • typescript which will activate additional + syntax highlighting and some other things for TypeScript code + (demo).
  • +
  • statementIndent which (given a number) will + determine the amount of indentation to use for statements + continued on a new line.
  • +
  • wordCharacters, a regexp that indicates which + characters should be considered part of an identifier. + Defaults to /[\w$]/, which does not handle + non-ASCII identifiers. Can be set to something more elaborate + to improve Unicode support.
  • +
+

+ +

MIME types defined: text/javascript, application/json, application/ld+json, text/typescript, application/typescript.

+
diff --git a/deploy/core/node_modules/codemirror/mode/javascript/javascript.js b/deploy/core/node_modules/codemirror/mode/javascript/javascript.js new file mode 100644 index 000000000..b0ba8d017 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/javascript/javascript.js @@ -0,0 +1,684 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// TODO actually recognize syntax of TypeScript constructs + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonldMode = parserConfig.jsonld; + var jsonMode = parserConfig.json || jsonldMode; + var isTS = parserConfig.typescript; + var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + var jsKeywords = { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C, + "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"), + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C + }; + + // Extend the 'normal' keywords with the TypeScript language extensions + if (isTS) { + var type = {type: "variable", style: "variable-3"}; + var tsKeywords = { + // object-like things + "interface": kw("interface"), + "extends": kw("extends"), + "constructor": kw("constructor"), + + // scope modifiers + "public": kw("public"), + "private": kw("private"), + "protected": kw("protected"), + "static": kw("static"), + + // types + "string": type, "number": type, "bool": type, "any": type + }; + + for (var attr in tsKeywords) { + jsKeywords[attr] = tsKeywords[attr]; + } + } + + return jsKeywords; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^]/; + var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; + + function readRegexp(stream) { + var escaped = false, next, inSet = false; + while ((next = stream.next()) != null) { + if (!escaped) { + if (next == "/" && !inSet) return; + if (next == "[") inSet = true; + else if (inSet && next == "]") inSet = false; + } + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { + return ret("number", "number"); + } else if (ch == "." && stream.match("..")) { + return ret("spread", "meta"); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "=" && stream.eat(">")) { + return ret("=>", "operator"); + } else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else if (state.lastType == "operator" || state.lastType == "keyword c" || + state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { + readRegexp(stream); + stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla + return ret("regexp", "string-2"); + } else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator", stream.current()); + } + } else if (ch == "`") { + state.tokenize = tokenQuasi; + return tokenQuasi(stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator", stream.current()); + } else if (wordRE.test(ch)) { + stream.eatWhile(wordRE); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.lastType != ".") ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ + state.tokenize = tokenBase; + return ret("jsonld-keyword", "meta"); + } + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenQuasi(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && next == "\\"; + } + return ret("quasi", "string-2", stream.current()); + } + + var brackets = "([{}])"; + // This is a crude lookahead trick to try and notice that we're + // parsing the argument patterns for a fat-arrow function before we + // actually hit the arrow token. It only works if the arrow is on + // the same line as the arguments and there's no strange noise + // (comments) in between. Fallback is to only notice when we hit the + // arrow, and not declare the arguments as locals for the arrow + // body. + function findFatArrow(stream, state) { + if (state.fatArrowAt) state.fatArrowAt = null; + var arrow = stream.string.indexOf("=>", stream.start); + if (arrow < 0) return; + + var depth = 0, sawSomething = false; + for (var pos = arrow - 1; pos >= 0; --pos) { + var ch = stream.string.charAt(pos); + var bracket = brackets.indexOf(ch); + if (bracket >= 0 && bracket < 3) { + if (!depth) { ++pos; break; } + if (--depth == 0) break; + } else if (bracket >= 3 && bracket < 6) { + ++depth; + } else if (wordRE.test(ch)) { + sawSomething = true; + } else if (sawSomething && !depth) { + ++pos; + break; + } + } + if (sawSomething && !depth) state.fatArrowAt = pos; + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + for (var cx = state.context; cx; cx = cx.prev) { + for (var v = cx.vars; v; v = v.next) + if (v.name == varname) return true; + } + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + function inList(list) { + for (var v = list; v; v = v.next) + if (v.name == varname) return true; + return false; + } + var state = cx.state; + if (state.context) { + cx.marked = "def"; + if (inList(state.localVars)) return; + state.localVars = {name: varname, next: state.localVars}; + } else { + if (inList(state.globalVars)) return; + if (parserConfig.globalVars) + state.globalVars = {name: varname, next: state.globalVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + cx.state.localVars = defaultVars; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) + indent = outer.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function exp(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(exp); + }; + return exp; + } + + function statement(type, value) { + if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "if") { + if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) + cx.state.cc.pop()(); + return cont(pushlex("form"), expression, statement, poplex, maybeelse); + } + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex); + if (type == "class") return cont(pushlex("form"), className, poplex); + if (type == "export") return cont(pushlex("form"), afterExport, poplex); + if (type == "import") return cont(pushlex("form"), afterImport, poplex); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + return expressionInner(type, false); + } + function expressionNoComma(type) { + return expressionInner(type, true); + } + function expressionInner(type, noComma) { + if (cx.state.fatArrowAt == cx.stream.start) { + var body = noComma ? arrowBodyNoComma : arrowBody; + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); + else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); + } + + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef, maybeop); + if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); + if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); + if (type == "{") return contCommasep(objprop, "}", null, maybeop); + if (type == "quasi") { return pass(quasi, maybeop); } + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + function maybeexpressionNoComma(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expressionNoComma); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, false); + } + function maybeoperatorNoComma(type, value, noComma) { + var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; + var expr = noComma == false ? expression : expressionNoComma; + if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); + if (type == "operator") { + if (/\+\+|--/.test(value)) return cont(me); + if (value == "?") return cont(expression, expect(":"), expr); + return cont(expr); + } + if (type == "quasi") { return pass(quasi, me); } + if (type == ";") return; + if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + } + function quasi(type, value) { + if (type != "quasi") return pass(); + if (value.slice(value.length - 2) != "${") return cont(quasi); + return cont(expression, continueQuasi); + } + function continueQuasi(type) { + if (type == "}") { + cx.marked = "string-2"; + cx.state.tokenize = tokenQuasi; + return cont(quasi); + } + } + function arrowBody(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expression); + } + function arrowBodyNoComma(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expressionNoComma); + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + return cont(afterprop); + } else if (type == "number" || type == "string") { + cx.marked = jsonldMode ? "property" : (cx.style + " property"); + return cont(afterprop); + } else if (type == "jsonld-keyword") { + return cont(afterprop); + } else if (type == "[") { + return cont(expression, expect("]"), afterprop); + } + } + function getterSetter(type) { + if (type != "variable") return pass(afterprop); + cx.marked = "property"; + return cont(functiondef); + } + function afterprop(type) { + if (type == ":") return cont(expressionNoComma); + if (type == "(") return pass(functiondef); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(what, proceed); + } + if (type == end) return cont(); + return cont(expect(end)); + } + return function(type) { + if (type == end) return cont(); + return pass(what, proceed); + }; + } + function contCommasep(what, end, info) { + for (var i = 3; i < arguments.length; i++) + cx.cc.push(arguments[i]); + return cont(pushlex(end, info), commasep(what, end), poplex); + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type) { + if (isTS && type == ":") return cont(typedef); + } + function typedef(type) { + if (type == "variable"){cx.marked = "variable-3"; return cont();} + } + function vardef() { + return pass(pattern, maybetype, maybeAssign, vardefCont); + } + function pattern(type, value) { + if (type == "variable") { register(value); return cont(); } + if (type == "[") return contCommasep(pattern, "]"); + if (type == "{") return contCommasep(proppattern, "}"); + } + function proppattern(type, value) { + if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { + register(value); + return cont(maybeAssign); + } + if (type == "variable") cx.marked = "property"; + return cont(expect(":"), pattern, maybeAssign); + } + function maybeAssign(_type, value) { + if (value == "=") return cont(expressionNoComma); + } + function vardefCont(type) { + if (type == ",") return cont(vardef); + } + function maybeelse(type, value) { + if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); + } + function forspec(type) { + if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); + } + function forspec1(type) { + if (type == "var") return cont(vardef, expect(";"), forspec2); + if (type == ";") return cont(forspec2); + if (type == "variable") return cont(formaybeinof); + return pass(expression, expect(";"), forspec2); + } + function formaybeinof(_type, value) { + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return cont(maybeoperatorComma, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return pass(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext); + } + function funarg(type) { + if (type == "spread") return cont(funarg); + return pass(pattern, maybetype); + } + function className(type, value) { + if (type == "variable") {register(value); return cont(classNameAfter);} + } + function classNameAfter(type, value) { + if (value == "extends") return cont(expression, classNameAfter); + if (type == "{") return cont(pushlex("}"), classBody, poplex); + } + function classBody(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); + return cont(functiondef, classBody); + } + if (value == "*") { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == ";") return cont(classBody); + if (type == "}") return cont(); + } + function classGetterSetter(type) { + if (type != "variable") return pass(); + cx.marked = "property"; + return cont(); + } + function afterModule(type, value) { + if (type == "string") return cont(statement); + if (type == "variable") { register(value); return cont(maybeFrom); } + } + function afterExport(_type, value) { + if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } + if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } + return pass(statement); + } + function afterImport(type) { + if (type == "string") return cont(); + return pass(importSpec, maybeFrom); + } + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); + return cont(); + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } + } + function arrayLiteral(type) { + if (type == "]") return cont(); + return pass(expressionNoComma, maybeArrayComprehension); + } + function maybeArrayComprehension(type) { + if (type == "for") return pass(comprehension, expect("]")); + if (type == ",") return cont(commasep(maybeexpressionNoComma, "]")); + return pass(commasep(expressionNoComma, "]")); + } + function comprehension(type) { + if (type == "for") return cont(forspec, comprehension); + if (type == "if") return cont(expression, comprehension); + } + + // Interface + + return { + startState: function(basecolumn) { + var state = { + tokenize: tokenBase, + lastType: "sof", + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + findFatArrow(stream, state); + } + if (state.tokenize != tokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == tokenComment) return CodeMirror.Pass; + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + // Kludge to prevent 'maybelse' from blocking lexical scope pops + if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { + var c = state.cc[i]; + if (c == poplex) lexical = lexical.prev; + else if (c != maybeelse) break; + } + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + lineComment: jsonMode ? null : "//", + fold: "brace", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, + jsonMode: jsonMode + }; +}); + +CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/x-javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); + +}); diff --git a/deploy/core/node_modules/codemirror/mode/javascript/json-ld.html b/deploy/core/node_modules/codemirror/mode/javascript/json-ld.html new file mode 100644 index 000000000..3a37f0bce --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/javascript/json-ld.html @@ -0,0 +1,72 @@ + + +CodeMirror: JSON-LD mode + + + + + + + + + + + + +
+

JSON-LD mode

+ + +
+ + + +

This is a specialization of the JavaScript mode.

+
diff --git a/deploy/core/node_modules/codemirror/mode/javascript/test.js b/deploy/core/node_modules/codemirror/mode/javascript/test.js new file mode 100644 index 000000000..aaeb8e0c0 --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/javascript/test.js @@ -0,0 +1,194 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("locals", + "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); + + MT("comma-and-binop", + "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); + + MT("destructuring", + "([keyword function]([def a], [[[def b], [def c] ]]) {", + " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", + " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", + "})();"); + + MT("class_body", + "[keyword class] [variable Foo] {", + " [property constructor]() {}", + " [property sayName]() {", + " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", + " }", + "}"); + + MT("class", + "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", + " [property get] [property prop]() { [keyword return] [number 24]; }", + " [property constructor]([def x], [def y]) {", + " [keyword super]([string 'something']);", + " [keyword this].[property x] [operator =] [variable-2 x];", + " }", + "}"); + + MT("module", + "[keyword module] [string 'foo'] {", + " [keyword export] [keyword let] [def x] [operator =] [number 42];", + " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", + "}"); + + MT("import", + "[keyword function] [variable foo]() {", + " [keyword import] [def $] [keyword from] [string 'jquery'];", + " [keyword module] [def crypto] [keyword from] [string 'crypto'];", + " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", + "}"); + + MT("const", + "[keyword function] [variable f]() {", + " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", + "}"); + + MT("for/of", + "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); + + MT("generator", + "[keyword function*] [variable repeat]([def n]) {", + " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", + " [keyword yield] [variable-2 i];", + "}"); + + MT("fatArrow", + "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", + "[variable a];", // No longer in scope + "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", + "[variable c];"); + + MT("spread", + "[keyword function] [variable f]([def a], [meta ...][def b]) {", + " [variable something]([variable-2 a], [meta ...][variable-2 b]);", + "}"); + + MT("comprehension", + "[keyword function] [variable f]() {", + " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", + " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", + "}"); + + MT("quasi", + "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); + + MT("quasi_no_function", + "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); + + MT("indent_statement", + "[keyword var] [variable x] [operator =] [number 10]", + "[variable x] [operator +=] [variable y] [operator +]", + " [atom Infinity]", + "[keyword debugger];"); + + MT("indent_if", + "[keyword if] ([number 1])", + " [keyword break];", + "[keyword else] [keyword if] ([number 2])", + " [keyword continue];", + "[keyword else]", + " [number 10];", + "[keyword if] ([number 1]) {", + " [keyword break];", + "} [keyword else] [keyword if] ([number 2]) {", + " [keyword continue];", + "} [keyword else] {", + " [number 10];", + "}"); + + MT("indent_for", + "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", + " [variable i] [operator <] [number 100];", + " [variable i][operator ++])", + " [variable doSomething]([variable i]);", + "[keyword debugger];"); + + MT("indent_c_style", + "[keyword function] [variable foo]()", + "{", + " [keyword debugger];", + "}"); + + MT("indent_else", + "[keyword for] (;;)", + " [keyword if] ([variable foo])", + " [keyword if] ([variable bar])", + " [number 1];", + " [keyword else]", + " [number 2];", + " [keyword else]", + " [number 3];"); + + MT("indent_funarg", + "[variable foo]([number 10000],", + " [keyword function]([def a]) {", + " [keyword debugger];", + "};"); + + MT("indent_below_if", + "[keyword for] (;;)", + " [keyword if] ([variable foo])", + " [number 1];", + "[number 2];"); + + MT("multilinestring", + "[keyword var] [variable x] [operator =] [string 'foo\\]", + "[string bar'];"); + + MT("scary_regexp", + "[string-2 /foo[[/]]bar/];"); + + MT("indent_strange_array", + "[keyword var] [variable x] [operator =] [[", + " [number 1],,", + " [number 2],", + "]];", + "[number 10];"); + + var jsonld_mode = CodeMirror.getMode( + {indentUnit: 2}, + {name: "javascript", jsonld: true} + ); + function LD(name) { + test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); + } + + LD("json_ld_keywords", + '{', + ' [meta "@context"]: {', + ' [meta "@base"]: [string "http://example.com"],', + ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', + ' [property "likesFlavor"]: {', + ' [meta "@container"]: [meta "@list"]', + ' [meta "@reverse"]: [string "@beFavoriteOf"]', + ' },', + ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', + ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', + ' },', + ' [meta "@graph"]: [[ {', + ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', + ' [property "name"]: [string "John Lennon"],', + ' [property "modified"]: {', + ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', + ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', + ' }', + ' } ]]', + '}'); + + LD("json_ld_fake", + '{', + ' [property "@fake"]: [string "@fake"],', + ' [property "@contextual"]: [string "@identifier"],', + ' [property "user@domain.com"]: [string "@graphical"],', + ' [property "@ID"]: [string "@@ID"]', + '}'); +})(); diff --git a/deploy/core/node_modules/codemirror/mode/javascript/typescript.html b/deploy/core/node_modules/codemirror/mode/javascript/typescript.html new file mode 100644 index 000000000..2cfc5381f --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/javascript/typescript.html @@ -0,0 +1,61 @@ + + +CodeMirror: TypeScript mode + + + + + + + + + +
+

TypeScript mode

+ + +
+ + + +

This is a specialization of the JavaScript mode.

+
diff --git a/deploy/core/node_modules/codemirror/mode/python/index.html b/deploy/core/node_modules/codemirror/mode/python/index.html new file mode 100644 index 000000000..86eb3d52f --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/python/index.html @@ -0,0 +1,198 @@ + + +CodeMirror: Python mode + + + + + + + + + + +
+

Python mode

+ +
+ + +

Cython mode

+ +
+ + +

Configuration Options for Python mode:

+
    +
  • version - 2/3 - The version of Python to recognize. Default is 2.
  • +
  • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
  • +
  • hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
  • +
+

Advanced Configuration Options:

+

Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help

+
    +
  • singleOperators - RegEx - Regular Expression for single operator matching, default :
    ^[\\+\\-\\*/%&|\\^~<>!]
    including
    @
    on Python 3
  • +
  • singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :
    ^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]
  • +
  • doubleOperators - RegEx - Regular Expression for double operators matching, default :
    ^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))
  • +
  • doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default :
    ^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))
  • +
  • tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default :
    ^((//=)|(>>=)|(<<=)|(\\*\\*=))
  • +
  • identifiers - RegEx - Regular Expression for identifier, default :
    ^[_A-Za-z][_A-Za-z0-9]*
    on Python 2 and
    ^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*
    on Python 3.
  • +
  • extra_keywords - list of string - List of extra words ton consider as keywords
  • +
  • extra_builtins - list of string - List of extra words ton consider as builtins
  • +
+ + +

MIME types defined: text/x-python and text/x-cython.

+
diff --git a/deploy/core/node_modules/codemirror/mode/python/python.js b/deploy/core/node_modules/codemirror/mode/python/python.js new file mode 100644 index 000000000..98c0409ae --- /dev/null +++ b/deploy/core/node_modules/codemirror/mode/python/python.js @@ -0,0 +1,359 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var wordOperators = wordRegexp(["and", "or", "not", "is"]); + var commonKeywords = ["as", "assert", "break", "class", "continue", + "def", "del", "elif", "else", "except", "finally", + "for", "from", "global", "if", "import", + "lambda", "pass", "raise", "return", + "try", "while", "with", "yield", "in"]; + var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr", + "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod", + "enumerate", "eval", "filter", "float", "format", "frozenset", + "getattr", "globals", "hasattr", "hash", "help", "hex", "id", + "input", "int", "isinstance", "issubclass", "iter", "len", + "list", "locals", "map", "max", "memoryview", "min", "next", + "object", "oct", "open", "ord", "pow", "property", "range", + "repr", "reversed", "round", "set", "setattr", "slice", + "sorted", "staticmethod", "str", "sum", "super", "tuple", + "type", "vars", "zip", "__import__", "NotImplemented", + "Ellipsis", "__debug__"]; + var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile", + "file", "intern", "long", "raw_input", "reduce", "reload", + "unichr", "unicode", "xrange", "False", "True", "None"], + keywords: ["exec", "print"]}; + var py3 = {builtins: ["ascii", "bytes", "exec", "print"], + keywords: ["nonlocal", "False", "True", "None"]}; + + CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins)); + + function top(state) { + return state.scopes[state.scopes.length - 1]; + } + + CodeMirror.defineMode("python", function(conf, parserConf) { + var ERRORCLASS = "error"; + + var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"); + var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); + var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); + + if (parserConf.version && parseInt(parserConf.version, 10) == 3){ + // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator + var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"); + var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); + } else { + var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); + var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + } + + var hangingIndent = parserConf.hangingIndent || conf.indentUnit; + + var myKeywords = commonKeywords, myBuiltins = commonBuiltins; + if(parserConf.extra_keywords != undefined){ + myKeywords = myKeywords.concat(parserConf.extra_keywords); + } + if(parserConf.extra_builtins != undefined){ + myBuiltins = myBuiltins.concat(parserConf.extra_builtins); + } + if (parserConf.version && parseInt(parserConf.version, 10) == 3) { + myKeywords = myKeywords.concat(py3.keywords); + myBuiltins = myBuiltins.concat(py3.builtins); + var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); + } else { + myKeywords = myKeywords.concat(py2.keywords); + myBuiltins = myBuiltins.concat(py2.builtins); + var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); + } + var keywords = wordRegexp(myKeywords); + var builtins = wordRegexp(myBuiltins); + + // tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol() && top(state).type == "py") { + var scopeOffset = top(state).offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset) + pushScope(stream, state, "py"); + else if (lineOffset < scopeOffset && dedent(stream, state)) + state.errorToken = true; + return null; + } else { + var style = tokenBaseInner(stream, state); + if (scopeOffset > 0 && dedent(stream, state)) + style += " " + ERRORCLASS; + return style; + } + } + return tokenBaseInner(stream, state); + } + + function tokenBaseInner(stream, state) { + if (stream.eatSpace()) return null; + + var ch = stream.peek(); + + // Handle Comments + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } + if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } + if (stream.match(/^\.\d+/)) { floatLiteral = true; } + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return "number"; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true; + // Binary + if (stream.match(/^0b[01]+/i)) intLiteral = true; + // Octal + if (stream.match(/^0o[0-7]+/i)) intLiteral = true; + // Decimal + if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^0(?![\dx])/i)) intLiteral = true; + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return "number"; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + // Handle operators and Delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) + return null; + + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) + return "operator"; + + if (stream.match(singleDelimiters)) + return null; + + if (stream.match(keywords)) + return "keyword"; + + if (stream.match(builtins)) + return "builtin"; + + if (stream.match(/^(self|cls)\b/)) + return "variable-2"; + + if (stream.match(identifiers)) { + if (state.lastToken == "def" || state.lastToken == "class") + return "def"; + return "variable"; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) + delimiter = delimiter.substr(1); + + var singleline = delimiter.length == 1; + var OUTCLASS = "string"; + + function tokenString(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\\]/); + if (stream.eat("\\")) { + stream.next(); + if (singleline && stream.eol()) + return OUTCLASS; + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) + return ERRORCLASS; + else + state.tokenize = tokenBase; + } + return OUTCLASS; + } + tokenString.isString = true; + return tokenString; + } + + function pushScope(stream, state, type) { + var offset = 0, align = null; + if (type == "py") { + while (top(state).type != "py") + state.scopes.pop(); + } + offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent); + if (type != "py" && !stream.match(/^(\s|#.*)*$/, false)) + align = stream.column() + 1; + state.scopes.push({offset: offset, type: type, align: align}); + } + + function dedent(stream, state) { + var indented = stream.indentation(); + while (top(state).offset > indented) { + if (top(state).type != "py") return true; + state.scopes.pop(); + } + return top(state).offset != indented; + } + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current == ".") { + style = stream.match(identifiers, false) ? null : ERRORCLASS; + if (style == null && state.lastStyle == "meta") { + // Apply 'meta' style to '.' connected identifiers when + // appropriate. + style = "meta"; + } + return style; + } + + // Handle decorators + if (current == "@"){ + if(parserConf.version && parseInt(parserConf.version, 10) == 3){ + return stream.match(identifiers, false) ? "meta" : "operator"; + } else { + return stream.match(identifiers, false) ? "meta" : ERRORCLASS; + } + } + + if ((style == "variable" || style == "builtin") + && state.lastStyle == "meta") + style = "meta"; + + // Handle scope changes. + if (current == "pass" || current == "return") + state.dedent += 1; + + if (current == "lambda") state.lambda = true; + if (current == ":" && !state.lambda && top(state).type == "py") + pushScope(stream, state, "py"); + + var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; + if (delimiter_index != -1) + pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); + + delimiter_index = "])}".indexOf(current); + if (delimiter_index != -1) { + if (top(state).type == current) state.scopes.pop(); + else return ERRORCLASS; + } + if (state.dedent > 0 && stream.eol() && top(state).type == "py") { + if (state.scopes.length > 1) state.scopes.pop(); + state.dedent -= 1; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scopes: [{offset: basecolumn || 0, type: "py", align: null}], + lastStyle: null, + lastToken: null, + lambda: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var addErr = state.errorToken; + if (addErr) state.errorToken = false; + var style = tokenLexer(stream, state); + + state.lastStyle = style; + + var current = stream.current(); + if (current && style) + state.lastToken = current; + + if (stream.eol() && state.lambda) + state.lambda = false; + return addErr ? style + " " + ERRORCLASS : style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) + return state.tokenize.isString ? CodeMirror.Pass : 0; + + var scope = top(state); + var closing = textAfter && textAfter.charAt(0) == scope.type; + if (scope.align != null) + return scope.align - (closing ? 1 : 0); + else if (closing && state.scopes.length > 1) + return state.scopes[state.scopes.length - 2].offset; + else + return scope.offset; + }, + + lineComment: "#", + fold: "indent" + }; + return external; + }); + + CodeMirror.defineMIME("text/x-python", "python"); + + var words = function(str) { return str.split(" "); }; + + CodeMirror.defineMIME("text/x-cython", { + name: "python", + extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+ + "extern gil include nogil property public"+ + "readonly struct union DEF IF ELIF ELSE") + }); + +}); diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 81f3ca4f5..0e79e3982 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -673,6 +673,9 @@ :click (fn [] (select-all this))}))) +(def mode-blacklist "Modes to not load on startup" + #{"clojure" "css" "htmlembedded" "htmlmixed" "javascript" "python"}) + (behavior ::init-codemirror :triggers #{:init} :reaction (fn [this] @@ -686,7 +689,11 @@ :when (= (files/ext file) "js")] (load/js (str "core/node_modules/codemirror/addon/fold/" file) :sync)) (load/js "core/node_modules/codemirror/keymap/sublime.js" :sync) - (doseq [path (files/filter-walk #(and (= (files/ext %) "js") (not (.endsWith % "test.js"))) + (doseq [path (files/filter-walk #(and (= (files/ext %) "js") + (not (some (fn [m] (.startsWith % (str "core/node_modules/codemirror/mode/" m "/"))) + mode-blacklist)) + ;; Remove test files + (not (.endsWith % "test.js"))) "core/node_modules/codemirror/mode")] (load/js path :sync)) (aset js/CodeMirror.keyMap.basic "Tab" expand-tab))) From 88919c089b25f7a90df89f1077a4ad4208ddc452 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 15:21:03 -0500 Subject: [PATCH 344/656] Add back foldgutter css which had been missing a while Was accidently removed with cm4 upgrade - 4fa79196667bb3bbd9273009cadd9014593a07ed --- src/lt/objs/editor.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 0e79e3982..b4a04d26f 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -688,6 +688,7 @@ (doseq [file (files/ls "core/node_modules/codemirror/addon/fold") :when (= (files/ext file) "js")] (load/js (str "core/node_modules/codemirror/addon/fold/" file) :sync)) + (load/css "node_modules/codemirror/addon/fold/foldgutter.css") (load/js "core/node_modules/codemirror/keymap/sublime.js" :sync) (doseq [path (files/filter-walk #(and (= (files/ext %) "js") (not (some (fn [m] (.startsWith % (str "core/node_modules/codemirror/mode/" m "/"))) From 333330cf3fa3605eaf88624394e31591ce4bf38f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 16:22:55 -0500 Subject: [PATCH 345/656] Use StringStream provided by runmode addon --- .../codemirror_addons/stringstream.js | 70 ------------------- src/lt/objs/langs/behaviors.cljs | 3 +- src/lt/plugins/auto_complete.cljs | 2 +- 3 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 deploy/core/node_modules/codemirror_addons/stringstream.js diff --git a/deploy/core/node_modules/codemirror_addons/stringstream.js b/deploy/core/node_modules/codemirror_addons/stringstream.js deleted file mode 100644 index 248ddc511..000000000 --- a/deploy/core/node_modules/codemirror_addons/stringstream.js +++ /dev/null @@ -1,70 +0,0 @@ - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - // The character stream used by a mode's parser. - function StringStream(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - } - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue; - }, - indentation: function() {return countColumn(this.string, null, this.tabSize);}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);} - }; - -exports.StringStream = StringStream; diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 149a11943..4c184507b 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -10,8 +10,7 @@ (:require-macros [lt.macros :refer [behavior background defui]])) (def flat-parser (background (fn [obj-id contents] - ;; TODO: Use addon/runmode - (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror_addons/stringstream.js")) + (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/addon/runmode/runmode.node.js")) (.-StringStream)) parser (-> (js/require (str js/ltpath "/core/node_modules/lighttable/background/behaviorsParser.js")) (.-parseFlat)) diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index da21bd057..9e54c6155 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -90,7 +90,7 @@ false))) (def w (background (fn [obj-id m] - (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror_addons/stringstream.js")) + (let [StringStream (-> (js/require (str js/ltpath "/core/node_modules/codemirror/addon/runmode/runmode.node.js")) (.-StringStream)) stream (fn [s] (StringStream. s)) From 2cf3b49c53b819bdae9ad1ec287113a972ef7f88 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 6 Dec 2014 18:06:52 -0500 Subject: [PATCH 346/656] Start doc for committers - explain known state of node deps --- doc/for-committers.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/for-committers.md diff --git a/doc/for-committers.md b/doc/for-committers.md new file mode 100644 index 000000000..c9d224b90 --- /dev/null +++ b/doc/for-committers.md @@ -0,0 +1,15 @@ +## Dependencies + +### Node packages + +Node dependencies live in deploy/core/node_modules/. To update an individual dependency: `cd deploy/core && npm +install NAME@VERSION` e.g. `npm install codemirror@4.8.0`. Following packages are known to be +vendored: + +* codemirror - Provides all codemirror files except for themes + +Following packages are specific to Light Table i.e. _not_ vendored: + +* clojurescript - Provides cljsDeps.js +* codemirror_addons - Provides codemirror addons +* lighttable - Main lighttable js libs From 5f8009cb3494dedd1e9ad171ee7b507ac4708d65 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 8 Dec 2014 12:06:58 -0500 Subject: [PATCH 347/656] Fix extension parsing for paths with a dot in the directory - close #1755 --- src/lt/objs/files.cljs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 52d8e31a1..e8be312fb 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -88,9 +88,7 @@ (recur (rest parts) (conj acc (string/join "." parts))))))) (defn ext [path] - (let [i (.lastIndexOf path ".")] - (when (> i 0) - (subs path (inc i) (count path))))) + (.extname fpath path)) (defn without-ext [path] (let [i (.lastIndexOf path ".")] From 2368f9ee5355171631519dc41cb727b59d79c90e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 9 Dec 2014 09:10:41 -0500 Subject: [PATCH 348/656] Revert "Fix extension parsing for paths with a dot in the directory - close #1755" Reverted because it's causing a blank startup. More investigation required. This reverts commit 5f8009cb3494dedd1e9ad171ee7b507ac4708d65. --- src/lt/objs/files.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index e8be312fb..52d8e31a1 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -88,7 +88,9 @@ (recur (rest parts) (conj acc (string/join "." parts))))))) (defn ext [path] - (.extname fpath path)) + (let [i (.lastIndexOf path ".")] + (when (> i 0) + (subs path (inc i) (count path))))) (defn without-ext [path] (let [i (.lastIndexOf path ".")] From f3cb0f07ae83e0472813e5b29e839865a4401452 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 9 Dec 2014 18:17:13 -0500 Subject: [PATCH 349/656] Correct fix for paths with a dot in the directory #1755 --- src/lt/objs/files.cljs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 52d8e31a1..76aef4789 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -88,9 +88,7 @@ (recur (rest parts) (conj acc (string/join "." parts))))))) (defn ext [path] - (let [i (.lastIndexOf path ".")] - (when (> i 0) - (subs path (inc i) (count path))))) + (subs (.extname fpath path) 1)) (defn without-ext [path] (let [i (.lastIndexOf path ".")] From 2f469e9cf23bc2f9bc4d342f8e4f0b68617dc86b Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 20 Nov 2014 09:57:56 -0800 Subject: [PATCH 350/656] start getting LT on the atom-shell Signed-off-by: Chris Granger --- deploy/core/LightTable.html | 12 ++-- src/lt/objs/app.cljs | 103 +++++++++++++++-------------- src/lt/objs/cli.cljs | 67 ++++++++++--------- src/lt/objs/deploy.cljs | 11 +-- src/lt/objs/dev.cljs | 2 +- src/lt/objs/dialogs.cljs | 27 +++----- src/lt/objs/editor.cljs | 2 +- src/lt/objs/files.cljs | 11 +-- src/lt/objs/intro.cljs | 2 +- src/lt/objs/menu.cljs | 85 ++++++++++++------------ src/lt/objs/opener.cljs | 4 +- src/lt/objs/sidebar/workspace.cljs | 9 ++- src/lt/objs/titlebar.cljs | 18 ++--- 13 files changed, 175 insertions(+), 178 deletions(-) diff --git a/deploy/core/LightTable.html b/deploy/core/LightTable.html index 2f76b1888..70b3f25d3 100644 --- a/deploy/core/LightTable.html +++ b/deploy/core/LightTable.html @@ -24,12 +24,12 @@ - + diff --git a/deploy/core/main.js b/deploy/core/main.js new file mode 100644 index 000000000..084574121 --- /dev/null +++ b/deploy/core/main.js @@ -0,0 +1,63 @@ +var app = require('app'); // Module to control application life. +var BrowserWindow = require('browser-window'); // Module to create native browser window. +var dialog = require("dialog"); +var ipc = require("ipc"); + +// Report crashes to our server. +// require('crash-reporter').tart(); + +// Keep a global reference of the window object, if you don't, the window will +// be closed automatically when the javascript object is GCed. +var windows = {}; + +app.commandLine.appendSwitch('remote-debugging-port', '8315'); + +// Quit when all windows are closed. +app.on('window-all-closed', function() { + if (process.platform != 'darwin') + app.quit(); +}); + +function createWindow() { + var window = new BrowserWindow({width: 800, height: 600}); + windows[window.id] = window; + window.on("focus", function() { + window.webContents.send("focus", "focus"); + }); + window.on("blur", function() { + window.webContents.send("blur", "blur"); + }); + window.on("devtools-opened", function() { + window.webContents.send("devtools-opened", "opened"); + }); + window.on("devtools-closed", function() { + window.webContents.send("devtools-closed", "closed"); + }); + + // and load the index.html of the app. + window.loadUrl('file://' + __dirname + '/LightTable.html?id=' + window.id); + + // Emitted when the window is closed. + window.on('closed', function() { + windows[window.id] = null; + }); + return window; +} + +// This method will be called when atom-shell has done everything +// initialization and ready for creating browser windows. +app.on('ready', function() { + ipc.on("createWindow", function(event, info) { + createWindow(); + }); + + ipc.on("toggleDevTools", function(event, windowId) { + console.log("here"); + if(windowId && windows[windowId]) { + windows[windowId].toggleDevTools(); + } + }); + + + createWindow(); +}); diff --git a/deploy/core/package.json b/deploy/core/package.json new file mode 100644 index 000000000..dade30949 --- /dev/null +++ b/deploy/core/package.json @@ -0,0 +1,5 @@ +{ + "name": "hello-app", + "version": "0.1.0", + "main": "main.js" +} diff --git a/deploy/package.json b/deploy/package.json index 4ba77ef67..05b4e5ac0 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -1,22 +1,5 @@ { - "name": "LightTable", - "main": "core/LightTable.html", - "js-flags": "--harmony", - "single-instance": true, - "no-edit-menu": true, - "webkit": { - "plugin": true - }, - "chromium-args" : "--enable-smooth-scrolling --disable-accelerated-video --enable-webgl --enable-webaudio --ignore-gpu-blacklist --force-compositing-mode --remote-debugging-port=10138 --harmony", - "window": { - "icon": "core/img/lticon.png", - "width": 1024, - "height": 700, - "min_height": 400, - "min_width": 400, - "position": "center", - "show": false, - "toolbar": false, - "frame": true - } - } + "name": "LightTable", + "version": "0.8.0", + "main": "core/main.js" +} diff --git a/deploy/run.sh b/deploy/run.sh new file mode 100644 index 000000000..ebd40cb55 --- /dev/null +++ b/deploy/run.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +pushd "${DIR}/../shell" + npm install -g grunt-cli + npm install + grunt download-atom-shell +popd + +"${DIR}/../shell/atom-shell/Atom.app/Contents/MacOS/Atom" . diff --git a/shell/.gitignore b/shell/.gitignore new file mode 100644 index 000000000..9444c6ce9 --- /dev/null +++ b/shell/.gitignore @@ -0,0 +1,2 @@ +atom-shell +node_modules \ No newline at end of file diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js new file mode 100644 index 000000000..4020d57c4 --- /dev/null +++ b/shell/Gruntfile.js @@ -0,0 +1,15 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + "download-atom-shell": { + version: "0.19.3", + outputDir: "./atom-shell", + rebuild: true + } + }); + + grunt.loadNpmTasks('grunt-download-atom-shell'); + +}; diff --git a/shell/package.json b/shell/package.json new file mode 100644 index 000000000..c5828ca23 --- /dev/null +++ b/shell/package.json @@ -0,0 +1,8 @@ +{ + "name": "hello-atom-build", + "version": "0.1.0", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-download-atom-shell": "^0.10.0" + } +} diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 6e6a96d9e..0e40efb98 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -43,7 +43,6 @@ (object/raise app :pre-init) (object/raise app :init) (object/raise app :post-init) - (js/console.log "about to show") (object/raise app :show)) (defn fetch [k] diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 5f5336e0a..d2758639a 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -13,8 +13,8 @@ (def os (js/require "os")) (def remote (js/require "remote")) (def app (.require remote "app")) -;; (def data-path (.getDataPath app)) -(def data-path (.resolve fpath "Userness/")) +(def data-path (.getDataPath app)) +;; (def data-path (.resolve fpath "Userness/")) (defn typelist->index [cur types] (let [full (map (juxt :name identity) types) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 38ca9a2e6..0aea3c280 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -77,7 +77,10 @@ :let [ks (for [key (string/split part "-")] (or (key-mappings key) key))]] (string/join "+" ks))] - (when (seq parts) + ;;OSX can only take single key accelerators + (when (and (seq parts) + (or (not (platform/mac?)) + (= (count parts) 1))) {:accelerator (string/join " " parts)}))) (defn cmd-item @@ -95,10 +98,10 @@ (when (platform/mac?) {:label "" :submenu [(cmd-item "About Light Table" :version) {:type "separator"} - {:label "Hide Light Table" :accelerator "Command-H" :selector "hide:"} - {:label "Hide Others" :accelerator "Command-Alt-H" :selector "hideOtherApplications:"} + {:label "Hide Light Table" :accelerator "Command+H" :selector "hide:"} + {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"} {:type "separator"} - (cmd-item "Quit Light Table" :quit {:accelerator "Command-Q"})]}) + (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:selector "undo:" :accelerator "CommandOrControl+Z"}) (cmd-item "Redo" :editor.redo {:selector "redo:" :accelerator "Command+Shift+Z"}) {:type "separator"} @@ -120,7 +123,7 @@ {:label "Hide Light Table" :key "h" :selector "hide:"} {:label "Hide Others" :key "h" :modifiers "cmd-alt" :selector "hideOtherApplications:"} {:type "separator"} - (cmd-item "Quit Light Table" :quit {:key "q"})]}) + (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) {:label "File" :submenu [(cmd-item "New file" :new-file {:key "n"}) (cmd-item "Open file" :open-file {:key "o" :modifiers "cmd-shift"}) {:label "Open folder" :click #(do From af9470e9046767589d60486e6e296f602e3d4605 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sun, 30 Nov 2014 17:11:06 +0000 Subject: [PATCH 353/656] small compatibility check for plugins --- src/lt/objs/platform.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index 401e0319e..3ee276e4b 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -4,6 +4,8 @@ [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior]])) +(def atom-shell true) + (def clipboard (js/require "clipboard")) (def shell (js/require "shell")) From b3535a11deeb2f5ac774a2afdf7d5cd40660d3a5 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sun, 30 Nov 2014 17:27:52 +0000 Subject: [PATCH 354/656] ignore node_modules --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f0a5a1887..3f3657af2 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ deploy/ltbin deploy/nw.pak deploy/light .nrepl-port + +node_modules/ From 21fda514b67a0c5b744477e2505f0616a66373b7 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sun, 30 Nov 2014 17:28:09 +0000 Subject: [PATCH 355/656] this conflicted with the app object --- src/lt/objs/app.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 0e40efb98..f072537af 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -8,7 +8,7 @@ (:require-macros [lt.macros :refer [behavior]])) (def remote (js/require "remote")) -(def app (.require remote "app")) +(def atom-app (.require remote "app")) (def ipc (js/require "ipc")) (def win (.getCurrentWindow remote)) (def frame (js/require "web-frame")) From ec6328f4e47e1f5342559dd77859036f48c05c37 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 2 Dec 2014 08:32:20 -0500 Subject: [PATCH 356/656] Port most nw package.json options to atom-shell --- deploy/core/main.js | 5 ++++- deploy/package.json | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 084574121..24ba549f5 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -2,6 +2,7 @@ var app = require('app'); // Module to control application life. var BrowserWindow = require('browser-window'); // Module to create native browser window. var dialog = require("dialog"); var ipc = require("ipc"); +var fs = require('fs'); // Report crashes to our server. // require('crash-reporter').tart(); @@ -18,8 +19,10 @@ app.on('window-all-closed', function() { app.quit(); }); +var browserWindowOptions = require(__dirname + '/../package.json').browserWindowOptions; + function createWindow() { - var window = new BrowserWindow({width: 800, height: 600}); + var window = new BrowserWindow(browserWindowOptions); windows[window.id] = window; window.on("focus", function() { window.webContents.send("focus", "focus"); diff --git a/deploy/package.json b/deploy/package.json index 05b4e5ac0..6de425a65 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -1,5 +1,17 @@ { "name": "LightTable", "version": "0.8.0", - "main": "core/main.js" + "main": "core/main.js", + "browserWindowOptions": { + "icon": "core/img/lticon.png", + "width": 1024, + "height": 700, + "min-width": 400, + "min-height": 400, + "web-preferences": { + "webgl": true, + "webaudio": true, + "plugins": true + } + } } From dffbc93328488f4539506768bc26e595825a5d50 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sun, 7 Dec 2014 22:51:33 +0000 Subject: [PATCH 357/656] get some sane closing behaviour back --- deploy/core/main.js | 22 +++++++++++++++++++--- src/lt/objs/app.cljs | 8 +++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 24ba549f5..257f184a1 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -15,8 +15,7 @@ app.commandLine.appendSwitch('remote-debugging-port', '8315'); // Quit when all windows are closed. app.on('window-all-closed', function() { - if (process.platform != 'darwin') - app.quit(); + app.quit(); }); var browserWindowOptions = require(__dirname + '/../package.json').browserWindowOptions; @@ -37,6 +36,14 @@ function createWindow() { window.webContents.send("devtools-closed", "closed"); }); + windowClosing = false; + window.on("close", function(e) { + if (!windowClosing) { + e.preventDefault(); + window.webContents.send("app", "close!"); + } + }); + // and load the index.html of the app. window.loadUrl('file://' + __dirname + '/LightTable.html?id=' + window.id); @@ -44,6 +51,7 @@ function createWindow() { window.on('closed', function() { windows[window.id] = null; }); + return window; } @@ -54,6 +62,15 @@ app.on('ready', function() { createWindow(); }); + ipc.on("closeWindow", function(event, id) { + // This feels like a bad hack + windowClosing = true; + if(id && windows[id]) { + windows[id].close(); + } + windowClosing = false; + }); + ipc.on("toggleDevTools", function(event, windowId) { console.log("here"); if(windowId && windows[windowId]) { @@ -61,6 +78,5 @@ app.on('ready', function() { } }); - createWindow(); }); diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index f072537af..089e33520 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -29,7 +29,11 @@ (when force? (object/raise app :closing) (object/raise app :closed)) - (.close win force?))) + (if force? + (.send ipc "closeWindow" (window-number)) + (.close win)))) + +(.on ipc "app" #(object/raise app (keyword %))) (defn refresh [] (js/window.location.reload true)) @@ -252,5 +256,3 @@ :exec (fn [] (.setZoomFactor frame default-zoom) )}) - - From c3283c585d56df542bbfa33a901e7c9f12543c7e Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 00:10:27 +0000 Subject: [PATCH 358/656] fix workspace reconstitution --- src/lt/objs/workspace.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 0df2d1089..3fe5b92ad 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -208,7 +208,7 @@ (behavior ::reconstitute-last-workspace :triggers #{:post-init} :reaction (fn [app] - (when (and (= (app/window-number) 0) + (when (and (= (app/window-number) 1) (not (:initialized @current-ws))) (when-let [ws (first (all))] (open current-ws (-> ws :path (files/basename))))) ;;for backwards compat From 3f0326405d44e76f534e68f8ded5bef5af316fa9 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 01:29:44 +0000 Subject: [PATCH 359/656] menu fix --- src/lt/objs/menu.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 0aea3c280..7d4223aeb 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -120,8 +120,8 @@ (when (platform/mac?) {:label "" :submenu [(cmd-item "About Light Table" :version) {:type "separator"} - {:label "Hide Light Table" :key "h" :selector "hide:"} - {:label "Hide Others" :key "h" :modifiers "cmd-alt" :selector "hideOtherApplications:"} + {:label "Hide Light Table" :accelerator "Command+H" :selector "hide:"} + {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"} {:type "separator"} (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) {:label "File" :submenu [(cmd-item "New file" :new-file {:key "n"}) From 23f4d813eb0c53e66c877e5c63608a0bf69e4d5f Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 04:40:23 +0000 Subject: [PATCH 360/656] fix relative paths --- src/lt/objs/files.cljs | 5 ++--- src/lt/util/load.cljs | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index d2758639a..5654a890a 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -323,9 +323,9 @@ (join h (or path separator))))) (defn lt-home - ([] pwd) + ([] load/dir) ([path] - (join pwd path))) + (join (lt-home) path))) (defn lt-user-dir [path] (if js/process.env.LT_USER_DIR @@ -369,4 +369,3 @@ (let [cur (first to-walk) neue (filterv func (full-path-ls cur))] (recur (concat (rest to-walk) (dirs cur)) (concat found neue)))))) - diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 541a2d6ab..3a71514af 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -6,6 +6,8 @@ (def pwd (.resolve fpath ".")) +(def dir (str js/__dirname "/..")) + (def ^:dynamic *force-reload* false) (def fpath (js/require "path")) @@ -16,7 +18,7 @@ (boolean (re-seq #"^\s*[\\\/]|([\w]+:[\\\/])" path))) (defn node-module [path] - (js/require (str pwd "/core/node_modules/" path))) + (js/require (str dir "/core/node_modules/" path))) (defn- abs-source-mapping-url [code file] (if-let [path-to-source-map (second (re-find #"\n//# sourceMappingURL=(.*\.map)" code))] @@ -38,13 +40,13 @@ ([file] (js file false)) ([file sync] (let [file (if-not (absolute? file) - (.join fpath pwd file) + (.join fpath dir file) file)] (if sync (js/window.eval (-> (.readFileSync fs file) (.toString) (prep file))) - (.readFile fs (.join fpath pwd file) (fn [content] + (.readFile fs (.join fpath dir file) (fn [content] (js/window.eval (-> (.toString content) (prep file))))))))) From ad07a617c102a8c11b8ef0a8fd7968cea330873a Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 05:15:36 +0000 Subject: [PATCH 361/656] more flexible run script --- deploy/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 deploy/run.sh diff --git a/deploy/run.sh b/deploy/run.sh old mode 100644 new mode 100755 index ebd40cb55..8513dc34a --- a/deploy/run.sh +++ b/deploy/run.sh @@ -9,4 +9,4 @@ pushd "${DIR}/../shell" grunt download-atom-shell popd -"${DIR}/../shell/atom-shell/Atom.app/Contents/MacOS/Atom" . +"${DIR}/../shell/atom-shell/Atom.app/Contents/MacOS/Atom" $DIR From 5be47aea047099bab9fd172038360f3f6be5be7d Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 06:41:08 +0000 Subject: [PATCH 362/656] wow, that was an obscure bug --- project.clj | 6 ------ src/lt/objs/document.cljs | 1 - src/lt/objs/editor.cljs | 2 +- src/lt/objs/editor/pool.cljs | 1 - 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/project.clj b/project.clj index 5e1150def..bc255351c 100644 --- a/project.clj +++ b/project.clj @@ -18,9 +18,3 @@ :plugins [[lein-cljsbuild "1.0.1"]] :source-paths ["src/"] ) - - - - - - diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 89f57ddb5..56361f923 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -219,4 +219,3 @@ )) (def manager (object/create ::doc-manager)) - diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 6c988b495..c33bf54e2 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -681,7 +681,7 @@ (load/js "core/node_modules/codemirror/scrollpastend.js" :sync) (load/js "core/node_modules/codemirror/fold.js" :sync) (load/js "core/node_modules/codemirror/sublime.js" :sync) - (doseq [mode (files/ls "core/node_modules/codemirror/modes") + (doseq [mode (files/ls (files/lt-home "core/node_modules/codemirror/modes")) :when (= (files/ext mode) "js")] (load/js (str "core/node_modules/codemirror/modes/" mode) :sync)) (aset js/CodeMirror.keyMap.basic "Tab" expand-tab))) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index f0d1726af..87d46335e 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -701,4 +701,3 @@ :desc "Editor: Split selection into cursors per line" :exec (fn [] (cmd/exec! :editor.codemirror.command "splitSelectionByLine"))}) - From 45b76709b33502576394210481ee4f57ed143ce6 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 08:55:01 +0000 Subject: [PATCH 363/656] fix a windows issue --- deploy/core/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 257f184a1..a464576b5 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -27,7 +27,8 @@ function createWindow() { window.webContents.send("focus", "focus"); }); window.on("blur", function() { - window.webContents.send("blur", "blur"); + if (window.webContents) + window.webContents.send("blur", "blur"); }); window.on("devtools-opened", function() { window.webContents.send("devtools-opened", "opened"); From 3cae4421372637aaf4994f47f59c2f9e6a13ac43 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Mon, 8 Dec 2014 13:58:37 +0000 Subject: [PATCH 364/656] fix windows issue --- src/lt/objs/files.cljs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 5654a890a..9c0eb940e 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -369,3 +369,6 @@ (let [cur (first to-walk) neue (filterv func (full-path-ls cur))] (recur (concat (rest to-walk) (dirs cur)) (concat found neue)))))) + +(when-not (exists? (lt-user-dir)) + (mkdir (lt-user-dir))) From bb1e52542a8f787eddf6d58aac778c5722249fa1 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Tue, 9 Dec 2014 20:08:41 +0000 Subject: [PATCH 365/656] remove redundant log --- deploy/core/main.js | 1 - 1 file changed, 1 deletion(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index a464576b5..f8d6c9c33 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -73,7 +73,6 @@ app.on('ready', function() { }); ipc.on("toggleDevTools", function(event, windowId) { - console.log("here"); if(windowId && windows[windowId]) { windows[windowId].toggleDevTools(); } From 03fd0b4262c9f5ce6f633341f25327952acfdf06 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Tue, 9 Dec 2014 20:09:05 +0000 Subject: [PATCH 366/656] implement some IPC utils --- deploy/core/main.js | 54 ++++++++++++++++++++++++++++++++++++++++++++ src/lt/util/ipc.cljs | 30 ++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/lt/util/ipc.cljs diff --git a/deploy/core/main.js b/deploy/core/main.js index f8d6c9c33..19496e4bc 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -78,5 +78,59 @@ app.on('ready', function() { } }); + // Generic IPC callback utilities + + function win(wid) { + return wid && windows[wid]; + } + + function catargs(a, args) { + for (var i = 0; i < args.length; i++) { + a[a.length] = args[i]; + } + return a; + } + + function argify1(arg, data) { + if (arg == ":lt.util.ipc/win") { + return data.win; + } + return arg; + } + + function modulify(arg, data) { + arg = argify1(arg, data); + if (typeof arg == 'string') + arg = require(arg); + return arg; + } + + function argify(args, data) { + for (var i = 0; i < args.length; i++) { + args[i] = argify1(args[i], data); + } + return args; + } + + ipc.on(":lt.util.ipc/callback", function(e, wid, + mod, func, args, + target, method) { + if (win(wid)) { + data = {win: win(wid)}; + mod = modulify(mod, data); + args = argify(args, data); + + args[args.length] = function() { + if (win(wid)) { + var argList = [":lt.util.ipc/callback", target, method]; + catargs(argList, arguments); + var wc = win(wid).webContents; + wc.send.apply(wc, argList); + } + }; + mod[func].apply(mod, args); + } + }); + createWindow(); }); diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs new file mode 100644 index 000000000..fa7140699 --- /dev/null +++ b/src/lt/util/ipc.cljs @@ -0,0 +1,30 @@ +(ns lt.util.ipc + (:require [lt.object :as object])) + +(def remote (js/require "remote")) +(def ipc (js/require "ipc")) +(def wid (-> remote .getCurrentWindow .-id)) + +(def win (str ::win)) + +(defn send [channel & args] + (.apply (.-send ipc) ipc (-> args (conj (str channel)) clj->js))) + +(defn on* [channel cb] + (.on ipc (str channel) cb)) + +(defn on [channel cb] + (js-delete (.-_events ipc) (str channel)) + (on* channel cb)) + +(on ::callback + (fn [id method & args] + (apply object/raise (object/by-id id) (keyword method) args))) + +(defn call [target method func & args] + (let [[mod func] (if (coll? func) + (map name func) + (clojure.string/split (name func) "."))] + (send ::callback wid + mod func (clj->js (or args [])) + (object/->id target) (name method)))) From 0c9d9fa9649770f61f0a31b907b42778c2d73478 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Tue, 9 Dec 2014 20:10:47 +0000 Subject: [PATCH 367/656] reimplement save dialog --- src/lt/objs/opener.cljs | 57 +++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index e85e7427f..722b1868d 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -14,6 +14,7 @@ [lt.objs.notifos :as notifos] [lt.objs.files :as files] [lt.util.dom :as dom] + [lt.util.ipc :as ipc] [lt.util.cljs :refer [->dottedkw]]) (:use [crate.binding :only [bound map-bound]]) (:use-macros [crate.def-macros :only [defpartial]] @@ -23,8 +24,6 @@ ;; transient docs ;;********************************************************** -(def active-dialog nil) - (defui open-input [this] [:input {:type "file"}] :change (fn [] @@ -32,12 +31,9 @@ (when-not (empty? (dom/val me)) (object/raise this :open! (dom/val me)))))) -(defui save-input [this path] - [:input {:type "file" :nwsaveas (or path true)}] - :change (fn [] - (this-as me - (when-not (empty? (dom/val me)) - (object/raise this :save-as! (dom/val me)))))) +(defn save-input [this path] + (ipc/call this :save-as! + :dialog.showSaveDialog ipc/win {:defaultPath path})) (defn path->info [path] (when path @@ -65,37 +61,36 @@ info (:info @this) fname (:name info) ext (when-let [e (:exts info)] - (str "." (name (first e)))) - s (save-input this (files/join path (str fname ext)))] - (set! active-dialog s) - (dom/trigger s :click)))) + (str "." (name (first e))))] + (save-input this (files/join path (str fname ext)))))) (behavior ::save-as-rename! :triggers #{:save-as-rename!} :reaction (fn [this] - (dom/trigger (save-input this (-> @this :info :path)) :click))) + (save-input this (-> @this :info :path)))) (behavior ::save-as :triggers #{:save-as!} :reaction (fn [this path] - (let [type (files/path->type path) - prev-tags (-> @this :info :tags) - mode (files/path->mode path) - neue-doc (doc/create {:doc (editor/get-doc this) - :line-ending files/line-ending - :mtime (files/stats path) - :mime mode})] - (when (:doc @this) - (object/raise (:doc @this) :close.force)) - (doc/register-doc neue-doc path) - (object/update! this [:info] merge (path->info path)) - (object/merge! this {:dirty true - :doc neue-doc}) - (editor/set-mode this mode) - (object/remove-tags this (conj prev-tags :editor.transient)) - (object/add-tags this (conj (:tags type) :editor.file-backed)) - (object/raise this :save-as) - (object/raise this :save)))) + (when (not (empty? path)) + (let [type (files/path->type path) + prev-tags (-> @this :info :tags) + mode (files/path->mode path) + neue-doc (doc/create {:doc (editor/get-doc this) + :line-ending files/line-ending + :mtime (files/stats path) + :mime mode})] + (when (:doc @this) + (object/raise (:doc @this) :close.force)) + (doc/register-doc neue-doc path) + (object/update! this [:info] merge (path->info path)) + (object/merge! this {:dirty true + :doc neue-doc}) + (editor/set-mode this mode) + (object/remove-tags this (conj prev-tags :editor.transient)) + (object/add-tags this (conj (:tags type) :editor.file-backed)) + (object/raise this :save-as) + (object/raise this :save))))) (behavior ::check-read-only :desc "Opener: check if file is read only" From 5d31c4ee1cbe7e259da76a03a59b7a2d2dfa4a14 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Tue, 9 Dec 2014 20:51:19 +0000 Subject: [PATCH 368/656] reimplement open dialog --- src/lt/objs/opener.cljs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 722b1868d..6a5c8cd75 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -24,12 +24,10 @@ ;; transient docs ;;********************************************************** -(defui open-input [this] - [:input {:type "file"}] - :change (fn [] - (this-as me - (when-not (empty? (dom/val me)) - (object/raise this :open! (dom/val me)))))) +(defn open-input [this & [ev dir?]] + (ipc/call this (or ev :open!) + :dialog.showOpenDialog ipc/win {:properties [(if dir? :openDirectory :openFile) + :multiSelections]})) (defn save-input [this path] (ipc/call this :save-as! @@ -141,6 +139,12 @@ :reaction (fn [this bool] (object/merge! this {:open-linked-doc bool}))) +(behavior ::open-dialog + :triggers #{:open-dialog!} + :reaction (fn [opener paths] + (doseq [path paths :when path] + (object/raise opener :open! path)))) + (behavior ::open-standard-editor :triggers #{:open!} :reaction (fn [obj path] @@ -211,7 +215,7 @@ :tags #{:opener} :triggers #{} :open-files #{} - :behaviors [::open-standard-editor] + :behaviors [::open-standard-editor ::open-dialog] :init (fn [this])) (def opener (object/create ::opener)) @@ -224,7 +228,7 @@ (cmd/command {:command :open-file :desc "File: Open file" :exec (fn [] - (dialogs/file opener :open!))}) + (open-input opener :open-dialog!))}) (cmd/command {:command :open-path :desc "File: Open path" From bf4f4004eb1b79ba9f4176b54b70d5358d2b4b29 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Wed, 10 Dec 2014 01:21:34 +0000 Subject: [PATCH 369/656] clearer name --- src/lt/objs/opener.cljs | 10 +++++----- src/lt/util/ipc.cljs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 6a5c8cd75..212ca71c0 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -25,13 +25,13 @@ ;;********************************************************** (defn open-input [this & [ev dir?]] - (ipc/call this (or ev :open!) - :dialog.showOpenDialog ipc/win {:properties [(if dir? :openDirectory :openFile) - :multiSelections]})) + (ipc/callback this (or ev :open!) + :dialog.showOpenDialog ipc/win {:properties [(if dir? :openDirectory :openFile) + :multiSelections]})) (defn save-input [this path] - (ipc/call this :save-as! - :dialog.showSaveDialog ipc/win {:defaultPath path})) + (ipc/callback this :save-as! + :dialog.showSaveDialog ipc/win {:defaultPath path})) (defn path->info [path] (when path diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs index fa7140699..f2e2b0407 100644 --- a/src/lt/util/ipc.cljs +++ b/src/lt/util/ipc.cljs @@ -21,7 +21,7 @@ (fn [id method & args] (apply object/raise (object/by-id id) (keyword method) args))) -(defn call [target method func & args] +(defn callback [target method func & args] (let [[mod func] (if (coll? func) (map name func) (clojure.string/split (name func) "."))] From cf4a12e4a8c956beee29a82fb4489d32bf387134 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Wed, 10 Dec 2014 01:35:05 +0000 Subject: [PATCH 370/656] prove the concept --- deploy/core/main.js | 13 ------------- src/lt/objs/app.cljs | 12 ++++++------ src/lt/objs/clients/devtools.cljs | 11 +++++------ 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 19496e4bc..ae1e4d261 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -23,19 +23,6 @@ var browserWindowOptions = require(__dirname + '/../package.json').browserWindow function createWindow() { var window = new BrowserWindow(browserWindowOptions); windows[window.id] = window; - window.on("focus", function() { - window.webContents.send("focus", "focus"); - }); - window.on("blur", function() { - if (window.webContents) - window.webContents.send("blur", "blur"); - }); - window.on("devtools-opened", function() { - window.webContents.send("devtools-opened", "opened"); - }); - window.on("devtools-closed", function() { - window.webContents.send("devtools-closed", "closed"); - }); windowClosing = false; window.on("close", function(e) { diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 089e33520..8956c7c40 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -4,7 +4,8 @@ [lt.objs.context :as ctx] [clojure.string :as string] [lt.util.js :refer [now]] - [lt.util.dom :refer [$] :as dom]) + [lt.util.dom :refer [$] :as dom] + [lt.util.ipc :as ipc]) (:require-macros [lt.macros :refer [behavior]])) (def remote (js/require "remote")) @@ -213,12 +214,11 @@ (def app (object/create ::app)) -(.on ipc "blur" (fn [] - (object/raise app :blur))) - -(.on ipc "focus" (fn [] - (object/raise app :focus))) +(ipc/callback app :blur + [ipc/win :on] :blur) +(ipc/callback app :focus + [ipc/win :on] :focus) (set! (.-onbeforeunload js/window) (fn [] "This will navigate the main LT window and all work will be lost, are you sure you want to do this?")) diff --git a/src/lt/objs/clients/devtools.cljs b/src/lt/objs/clients/devtools.cljs index a3d569f6c..85e76daf7 100644 --- a/src/lt/objs/clients/devtools.cljs +++ b/src/lt/objs/clients/devtools.cljs @@ -11,6 +11,7 @@ [lt.util.dom :as dom] [lt.util.js :refer [every wait ->clj]] [lt.util.cljs :refer [js->clj]] + [lt.util.ipc :as ipc] [crate.binding :refer [bound subatom]] [clojure.string :as string]) (:require-macros [lt.macros :refer [behavior defui]])) @@ -198,13 +199,11 @@ (def local (object/create ::devtools-client)) -(.on app/ipc "devtools-opened" (fn [] - (object/raise local :disconnect) - )) +(ipc/callback local :disconnect + [ipc/win :on] :devtools-opened) -(.on app/ipc "devtools-closed" (fn [] - (object/raise local :reconnect!) - )) +(ipc/callback local :reconnect! + [ipc/win :on] :devtools-closed) ;;********************************************************* ;; Behaviors From a950c188f2cee0fa397ea7ad0bfbc4ccdad473d0 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 10 Dec 2014 12:44:16 -0500 Subject: [PATCH 371/656] Change text in replace button to make it stand out as an action Close #1753 --- src/lt/objs/search.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index ce75c99dd..9da05e861 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -85,7 +85,7 @@ (ctx/out! :searcher.replace))) (defui replace-all-button [this] - [:button.replace "all"] + [:button.replace "Replace All"] :click (fn [e] (cmd/exec! :searcher.replace-all))) From 59b093425b67d294da5c707548dcfd5bfd0bec4d Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Wed, 10 Dec 2014 18:41:49 +0000 Subject: [PATCH 372/656] fix windows issue christ, get it together, windows --- deploy/core/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index ae1e4d261..cef7eb040 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -112,7 +112,9 @@ app.on('ready', function() { var argList = [":lt.util.ipc/callback", target, method]; catargs(argList, arguments); var wc = win(wid).webContents; - wc.send.apply(wc, argList); + if (wc) { + wc.send.apply(wc, argList); + } } }; mod[func].apply(mod, args); From 348511b04cf83c33795665e2c7709f9fff122525 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Wed, 10 Dec 2014 19:15:46 +0000 Subject: [PATCH 373/656] fix icon --- deploy/core/main.js | 1 + deploy/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index cef7eb040..febb901ff 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -19,6 +19,7 @@ app.on('window-all-closed', function() { }); var browserWindowOptions = require(__dirname + '/../package.json').browserWindowOptions; +browserWindowOptions.icon = __dirname + '/' + browserWindowOptions.icon; function createWindow() { var window = new BrowserWindow(browserWindowOptions); diff --git a/deploy/package.json b/deploy/package.json index 6de425a65..192ca0587 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -3,7 +3,7 @@ "version": "0.8.0", "main": "core/main.js", "browserWindowOptions": { - "icon": "core/img/lticon.png", + "icon": "img/lticon.png", "width": 1024, "height": 700, "min-width": 400, From a42d7cde792485a322251ec36bc12c471ea2cdec Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 10 Dec 2014 20:07:41 -0500 Subject: [PATCH 374/656] Fix ibdknox theme active line background - close #1740 --- deploy/core/css/themes/ibdknox.css | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/css/themes/ibdknox.css b/deploy/core/css/themes/ibdknox.css index 4ddecbd9e..0997a6e54 100644 --- a/deploy/core/css/themes/ibdknox.css +++ b/deploy/core/css/themes/ibdknox.css @@ -58,6 +58,7 @@ .cm-s-ibdknox span.cm-SUBST { color:#FF1F69; } .cm-s-ibdknox .CodeMirror-activeline { background:#343d46; } +.cm-s-ibdknox .CodeMirror-activeline-background { background:#303030; } .cm-s-ibdknox .CodeMirror-activeline .CodeMirror-linenumber { background:#444d56; color:#fff; } .cm-s-ibdknox span.CodeMirror-matchingbracket {box-sizing:border-box; background:transparent; border-bottom:1px solid #3FF; font-weight:normal;} .cm-s-ibdknox span.CodeMirror-nonmatchingbracket {color: #F33; border-bottom:1px solid #F33; background:none;} From b62c57dc03293cda86d5cd8ce51523b4cfa81d84 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Thu, 11 Dec 2014 16:44:42 +0000 Subject: [PATCH 375/656] reverse app/platform dependency --- deploy/settings/default/default.behaviors | 1 + src/lt/objs/app.cljs | 7 +++++++ src/lt/objs/platform.cljs | 9 --------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index b17bc41f0..caa50b3a3 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -29,6 +29,7 @@ [:app :lt.objs.menu/remove-menu-close] [:app :lt.objs.app/refresh] [:app :lt.objs.app/on-show-bind-navigate] + [:app :lt.objs.app/add-platform-class] [:app :lt.objs.editor.pool/stop-reload-dirty] [:app :lt.objs.menu/set-menu] [:app :lt.plugins.auto-complete/init] diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 8956c7c40..f535b82ad 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -1,5 +1,6 @@ (ns lt.objs.app (:require [lt.object :as object] + [lt.objs.platform :as platform] [lt.objs.command :as cmd] [lt.objs.context :as ctx] [clojure.string :as string] @@ -202,6 +203,12 @@ (set! default-zoom default) (cmd/exec! :window.zoom-reset))) +(behavior ::add-platform-class + :triggers #{:init} + :reaction (fn [this] + (dom/add-class (dom/$ :body) (name platform/platform)) + )) + ;;********************************************************* ;; Object ;;********************************************************* diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index 3ee276e4b..1b46707ac 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -1,6 +1,5 @@ (ns lt.objs.platform (:require [lt.object :as object] - [lt.objs.app :as app] [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior]])) @@ -47,11 +46,3 @@ (defn linux? [] (= platform :linux)) - -(behavior ::add-platform-class - :triggers #{:init} - :reaction (fn [this] - (dom/add-class (dom/$ :body) (name platform)) - )) - -(object/add-behavior! app/app ::add-platform-class) From a68dab84b66308e22a86187eb8d966b0f97b92c4 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Thu, 11 Dec 2014 17:28:05 +0000 Subject: [PATCH 376/656] fixes --- src/lt/objs/app.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index f535b82ad..ed08944bc 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -132,11 +132,11 @@ :triggers #{:show} :reaction (fn [this] (dom/on ($ :#canvas) :click (fn [e] - ;;TODO: when prevent default has been called don't do this. - (when (= (.-target.nodeName e) "A") + (when (and (= (.-target.nodeName e) "A") + (not (.-defaultPrevented e))) (dom/prevent e) (when-let [href (.-target.href e)] - (.Shell.openExternal gui href) + (platform/open-url href) (.focus win))))))) (behavior ::track-focus From c2064576804ae37d991c83d2b0110d545153e18f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 12 Dec 2014 16:08:02 -0500 Subject: [PATCH 377/656] Add styling for quote and link for default theme - close #1731 --- deploy/core/css/themes/default.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/core/css/themes/default.css b/deploy/core/css/themes/default.css index ad5eb1ace..7c1cddb69 100644 --- a/deploy/core/css/themes/default.css +++ b/deploy/core/css/themes/default.css @@ -28,6 +28,8 @@ .cm-s-default span.cm-def {color:#acf;} .cm-s-default span.cm-builtin {color: #aec;} .cm-s-default span.cm-header {color: #aec;} +.cm-s-default span.cm-quote {color: #add;} +.cm-s-default span.cm-link {color: #aec;} .cm-s-default span.cm-property {color: #aaa; } .cm-s-default span.cm-operator {color: #aaa; } .cm-s-default span.cm-keyword {color: #aec; } From dec83e195cab89e59433b7c093a8095efa58bb9f Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sat, 13 Dec 2014 14:58:39 +0000 Subject: [PATCH 378/656] fix another arity change --- src/lt/objs/console.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 94ff8a7a1..4141bc431 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -106,6 +106,7 @@ (util-inspect thing false 2)) (defn verbatim + ([thing] (verbatim thing nil)) ([thing class] (verbatim thing class nil)) ([thing class str-content] From 2ab9e103b99c53554d1f1464d4057cb9d245dcfe Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Sat, 13 Dec 2014 15:17:42 +0000 Subject: [PATCH 379/656] add untitled file count --- src/lt/objs/opener.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 212ca71c0..dc4f00144 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -38,11 +38,14 @@ (let [type (files/path->type path)] {:name (files/basename path) :type-name (:name type) :path path :mime (:mime type) :tags (:tags type)}))) +(def untitled-count (atom 0)) + (behavior ::open-transient-editor :triggers #{:new!} :reaction (fn [this path dirty?] (let [last (pool/last-active) - info (merge {:mime "plaintext" :tags [:editor.plaintext] :name "untitled"} + info (merge {:mime "plaintext" :tags [:editor.plaintext] :name (str "untitled-" + (swap! untitled-count inc))} (path->info path)) ed (pool/create info)] (object/add-tags ed [:editor.transient]) From ff67aa51322cd57f99c93da0a66f64702aca3914 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 13 Dec 2014 11:12:51 -0500 Subject: [PATCH 380/656] Add behavior to allow users to use CM addons that come with LT Opted to not use triggers for load-js and load-css since that will require adding them as configurable app behaviors which no one is asking for. Also extended load-css to optionally take multiple paths like load-js does and updated load-js and load-css docs to reflect multiple optional paths. --- src/lt/object.cljs | 7 +++++++ src/lt/objs/editor.cljs | 17 +++++++++++++++++ src/lt/objs/plugins.cljs | 19 ++++++++++--------- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index b6348dbdd..a668df66e 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -122,6 +122,13 @@ (let [reactions (-> @obj :listeners k)] (raise* obj reactions args k))) +(defn call-behavior-reaction + "For a given behavior keyword id, call its :reaction fn with given args" + [id & args] + (let [behavior-fn (:reaction (->behavior id))] + (assert behavior-fn) + (apply behavior-fn args))) + (defn update-listeners ([obj] (update-listeners obj nil)) ([obj instants] diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index b4a04d26f..aa6d86972 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -698,3 +698,20 @@ "core/node_modules/codemirror/mode")] (load/js path :sync)) (aset js/CodeMirror.keyMap.basic "Tab" expand-tab))) + +(behavior ::load-addon + :triggers #{:object.instant-load} + :desc "App: Load CodeMirror addon path(s)" + :params [{:label "path(s)" + :example "edit/matchtags.js"}] + :type :user + :reaction (fn [this path] + (let [paths (map #(files/join (files/lt-home) + "core/node_modules/codemirror/addon" %) + (if (coll? path) path [path]))] + (object/call-behavior-reaction :lt.objs.plugins/load-js + this + (filter #(= (files/ext %) "js") paths)) + (object/call-behavior-reaction :lt.objs.plugins/load-css + this + (filter #(= (files/ext %) "css") paths))))) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 446e0d088..5c801c393 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -754,8 +754,8 @@ (behavior ::load-js :triggers #{:object.instant-load} - :desc "App: Load a javascript file" - :params [{:label "path"}] + :desc "App: Load javascript file(s)" + :params [{:label "path(s)"}] :type :user :reaction (fn [this path] (binding [*plugin-dir* (::dir object/*behavior-meta*) @@ -779,15 +779,16 @@ (behavior ::load-css :triggers #{:object.instant} - :desc "App: Load a css file" - :params [{:label "path"}] + :desc "App: Load css file(s)" + :params [{:label "path(s)"}] :type :user :reaction (fn [this path] - (let [path (adjust-path path)] - (when (or load/*force-reload* - (not (get (::loaded-files @this) path))) - (object/update! this [::loaded-files] #(conj (or % #{}) path)) - (load/css path))))) + (let [paths (map adjust-path (if (coll? path) path [path]))] + (doseq [path paths] + (when (or load/*force-reload* + (not (get (::loaded-files @this) path))) + (object/update! this [::loaded-files] #(conj (or % #{}) path)) + (load/css path)))))) (behavior ::load-keymap :triggers #{:object.instant} From cead17fbc82086f688a920477ba8ee4b0cb569db Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 13 Dec 2014 15:26:55 -0500 Subject: [PATCH 381/656] Fix fat-cursor not showing up when searching in default theme Close LightTable/Vim#44 --- deploy/core/css/themes/default.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/core/css/themes/default.css b/deploy/core/css/themes/default.css index 7c1cddb69..ada07f8b6 100644 --- a/deploy/core/css/themes/default.css +++ b/deploy/core/css/themes/default.css @@ -66,3 +66,7 @@ .CodeMirror-hints input { display:none; } .CodeMirror-hints .selected { background: #616161; color: #f4f4f4; } .CodeMirror-hints ul::-webkit-scrollbar-thumb { background: #606970; border-color: #606970; } + +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursors { + z-index: 3; +} From 2a6ec6694f111a7426baf9c8f766b8e2e1bdc95d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 16 Dec 2014 08:39:15 -0500 Subject: [PATCH 382/656] Open files from the commandline Opening a file required a callback to know when window is loaded. Also removed unused app/extract! and added docstrings for ipc. --- deploy/core/main.js | 4 +++ deploy/run.sh | 2 +- deploy/settings/default/default.behaviors | 1 + src/lt/objs/app.cljs | 10 +++--- src/lt/objs/cli.cljs | 44 +++++++++-------------- src/lt/util/ipc.cljs | 38 ++++++++++++-------- 6 files changed, 52 insertions(+), 47 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index febb901ff..523502f82 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -51,6 +51,10 @@ app.on('ready', function() { createWindow(); }); + ipc.on("loadedWindow", function(event, id) { + windows[id].webContents.send('argv', process.argv); + }); + ipc.on("closeWindow", function(event, id) { // This feels like a bad hack windowClosing = true; diff --git a/deploy/run.sh b/deploy/run.sh index 8513dc34a..e2b3392eb 100755 --- a/deploy/run.sh +++ b/deploy/run.sh @@ -9,4 +9,4 @@ pushd "${DIR}/../shell" grunt download-atom-shell popd -"${DIR}/../shell/atom-shell/Atom.app/Contents/MacOS/Atom" $DIR +"${DIR}/../shell/atom-shell/Atom.app/Contents/MacOS/Atom" $DIR --dir=`pwd` "$@" diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index caa50b3a3..603c96145 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -11,6 +11,7 @@ [:app :lt.objs.editor.pool/stop-close-dirty] [:app :lt.objs.clients/close-clients-on-closed] [:app :lt.objs.app/restore-position-on-init] + [:app :lt.objs.app/notify-loaded-window] [:app :lt.objs.cli/open-on-args] [:app :lt.objs.editor.pool/init-syntax-selector] [:app :lt.objs.cli/open!] diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index ed08944bc..d5f8eea9d 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -61,11 +61,6 @@ (pr-str v) v))) -(defn extract! [k] - (let [v (fetch k)] - (store! k nil) - v)) - (defn store-swap! [k f] (let [neue (f (fetch k))] (store! k neue) @@ -105,6 +100,11 @@ (when closing (close true)))) +(behavior ::notify-loaded-window + :triggers #{:show} + :reaction (fn [this] + (ipc/send "loadedWindow" (window-number)))) + ;; (behavior ::store-position-on-close ;; :triggers #{:closed :refresh} ;; :reaction (fn [this] diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 8b240214c..468dd5004 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -7,16 +7,10 @@ [lt.util.load :refer [node-module]] [lt.util.cljs :refer [js->clj]] [clojure.string :as string] + [lt.util.ipc :as ipc] [lt.objs.opener :as opener]) (:require-macros [lt.macros :refer [behavior]])) -(defn rebuild-argv [argstr] - (-> (subs argstr (.indexOf argstr "dir")) - (string/replace "" "-") - (string/replace "" " ") - (string/split " ") - (to-array))) - (defn parse-args [argv] (-> (.. (node-module "optimist") (options (js-obj "n" (js-obj "boolean" true "alias" "new") @@ -40,8 +34,8 @@ (object/raise workspace/current-ws :add.file! path)))) (object/raise opener/opener :new! path)))) -(defn args-key [winid] - (str "window" winid "args")) +;; (defn args-key [winid] +;; (str "window" winid "args")) (defn args [] ;; (or (app/fetch (args-key (app/window-number))) @@ -49,7 +43,7 @@ ) (defn is-lt-binary? [path] - (#{"ltbin" "node-webkit" "LightTable.exe" "LightTable"} (string/trim (files/basename path)))) + (#{"ltbin" "Atom" "deploy" "LightTable.exe" "LightTable"} (string/trim (files/basename path)))) (defn valid-path? [path] (and (string? path) @@ -60,23 +54,19 @@ ;; Behaviors ;;********************************************************* -; (behavior ::open-on-args -; :triggers #{:post-init} -; :desc "App: Process commandline arguments" -; :reaction (fn [this] -; (when (args) -; (let [args-str (or (app/extract! (args-key (app/window-number))) -; (first (app/args))) -; args (parse-args (rebuild-argv args-str)) -; path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] -; [(files/resolve (:dir args) path) line]) -; (filter valid-path? (:_ args))) -; paths (map first path-line-pairs) -; open-dir? (some files/dir? paths)] -; (when open-dir? -; (object/merge! workspace/current-ws {:initialized? true})) -; (open-paths path-line-pairs (:add args)))))) -; +(defn process-argv [argv] + (let [args (parse-args argv) + path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] + [(files/resolve (:dir args) path) line]) + (filter valid-path? (:_ args))) + paths (map first path-line-pairs) + open-dir? (some files/dir? paths)] + (when open-dir? + (object/merge! workspace/current-ws {:initialized? true})) + (open-paths path-line-pairs (:add args)))) + +(ipc/on "argv" process-argv) + ; (behavior ::open! ; :triggers #{:open!} ; :desc "App: Open a path from a file manager e.g. Finder" diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs index f2e2b0407..4230e088e 100644 --- a/src/lt/util/ipc.cljs +++ b/src/lt/util/ipc.cljs @@ -1,5 +1,7 @@ (ns lt.util.ipc - (:require [lt.object :as object])) + "Util functions for the ipc renderer - https://github.com/atom/atom-shell/blob/master/docs/api/ipc-renderer.md" + (:require [lt.object :as object] + [clojure.string :as string])) (def remote (js/require "remote")) (def ipc (js/require "ipc")) @@ -7,24 +9,32 @@ (def win (str ::win)) -(defn send [channel & args] - (.apply (.-send ipc) ipc (-> args (conj (str channel)) clj->js))) +(defn send + "Delegates to ipc.send which asynchronously sends args to the browser process's channel." + [channel & args] + (.apply (.-send ipc) ipc (-> args (conj channel) clj->js))) -(defn on* [channel cb] - (.on ipc (str channel) cb)) +(defn on + "Delegates to ipc.on which defines a callback to fire for the given channel." + [channel cb] + (.on ipc channel cb)) -(defn on [channel cb] - (js-delete (.-_events ipc) (str channel)) - (on* channel cb)) +(defn on-with-delete [channel cb] + (js-delete (.-_events ipc) channel) + (on channel cb)) -(on ::callback - (fn [id method & args] - (apply object/raise (object/by-id id) (keyword method) args))) +(on-with-delete (str ::callback) + (fn [id method & args] + (apply object/raise (object/by-id id) (keyword method) args))) -(defn callback [target method func & args] +(defn callback + "Similar to a remote module call. Sends a ::callback message which kicks off + a return ::callback message when the browser process is done. Sent message args + include the object id and behavior to trigger on the return message." + [target method func & args] (let [[mod func] (if (coll? func) (map name func) - (clojure.string/split (name func) "."))] - (send ::callback wid + (string/split (name func) "."))] + (send (str ::callback) wid mod func (clj->js (or args [])) (object/->id target) (name method)))) From 8ada586c371c80e47cd3e66daaa778799df84e7f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 16 Dec 2014 08:44:22 -0500 Subject: [PATCH 383/656] Revert "ignore node_modules" which clobbers files in deploy/core/node_modules. @one-more-minute If this is still used, a more specific gitignore is needed. This reverts commit b3535a11deeb2f5ac774a2afdf7d5cd40660d3a5. --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3f3657af2..f0a5a1887 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,3 @@ deploy/ltbin deploy/nw.pak deploy/light .nrepl-port - -node_modules/ From a02b5869ace858f16221b1f67dc5b851fa7911f4 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 16 Dec 2014 08:56:11 -0500 Subject: [PATCH 384/656] Fix some of the warnings - args no longer needed --- src/lt/objs/app.cljs | 4 ---- src/lt/objs/deploy.cljs | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index d5f8eea9d..9a022b771 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -40,10 +40,6 @@ (defn refresh [] (js/window.location.reload true)) -(defn args [] - (when-not (= 0 (.-App.argv.length gui)) - (seq (.-App.argv gui)))) - (defn init [] (object/raise app :deploy) (object/raise app :pre-init) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 4f33ecc1e..981c0422e 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -23,7 +23,9 @@ (def request (load/node-module "request")) (def tar (load/node-module "tar")) (def home-path (files/lt-home "")) +;; TODO: get-proxy ;; (def get-proxy (.-App.getProxyForURL (js/require "nw.gui"))) +(def get-proxy) (defn tar-path [v] (if (cache/fetch :edge) From f6cf57a28c7f64734015a2a8eea85d32ed898d3e Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Tue, 16 Dec 2014 22:50:42 +0000 Subject: [PATCH 385/656] that should do it --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f0a5a1887..cf01ef5ba 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ deploy/ltbin deploy/nw.pak deploy/light .nrepl-port +/node_modules/ From 773bbb970e38310e29fcd9b7591e28b16ee6f033 Mon Sep 17 00:00:00 2001 From: Mike Innes Date: Tue, 16 Dec 2014 22:50:50 +0000 Subject: [PATCH 386/656] focus windows on open --- deploy/core/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/main.js b/deploy/core/main.js index 523502f82..362aa395c 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -24,6 +24,7 @@ browserWindowOptions.icon = __dirname + '/' + browserWindowOptions.icon; function createWindow() { var window = new BrowserWindow(browserWindowOptions); windows[window.id] = window; + window.focus(); windowClosing = false; window.on("close", function(e) { From c859dc8895cee485efa7d46d5d4b1c171cf979d5 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 16 Dec 2014 18:24:10 -0500 Subject: [PATCH 387/656] Fix warnings from lt-user-dir and move windows mkdir fix to where it's needed Windows mkdir fix was in 3cae442 --- src/lt/objs/console.cljs | 2 ++ src/lt/objs/files.cljs | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 4141bc431..409153d0c 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -17,6 +17,8 @@ (def logs-dir (files/lt-user-dir "logs")) (def core-log (try (when-not (files/exists? logs-dir) + (when-not (files/exists? (files/lt-user-dir)) + (files/mkdir (files/lt-user-dir))) (files/mkdir logs-dir)) (.. (js/require "fs") (createWriteStream (files/join logs-dir (str "window" (app/window-number) ".log")))) (catch js/global.Error e diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 9c0eb940e..3593a7cdd 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -327,10 +327,12 @@ ([path] (join (lt-home) path))) -(defn lt-user-dir [path] - (if js/process.env.LT_USER_DIR - (join js/process.env.LT_USER_DIR (or path "")) - (join data-path path))) +(defn lt-user-dir + ([] (lt-user-dir "")) + ([path] + (if js/process.env.LT_USER_DIR + (join js/process.env.LT_USER_DIR path) + (join data-path path)))) (defn walk-up-find [start find] (let [roots (get-roots)] @@ -369,6 +371,3 @@ (let [cur (first to-walk) neue (filterv func (full-path-ls cur))] (recur (concat (rest to-walk) (dirs cur)) (concat found neue)))))) - -(when-not (exists? (lt-user-dir)) - (mkdir (lt-user-dir))) From fa4a02d96136569f80585a76b6132197d55d2da1 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 16 Dec 2014 18:39:29 -0500 Subject: [PATCH 388/656] Fix get-data-path and use it Back to no warnings --- src/lt/objs/files.cljs | 6 ++---- src/lt/objs/platform.cljs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 3593a7cdd..45d7b3e95 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -3,6 +3,7 @@ (:require [lt.object :as object] [lt.util.load :as load] [clojure.string :as string] + [lt.objs.platform :as platform] [lt.util.js :refer [now]]) (:require-macros [lt.macros :refer [behavior]])) @@ -11,10 +12,7 @@ (def wrench (load/node-module "wrench")) (def shell (js/require "shell")) (def os (js/require "os")) -(def remote (js/require "remote")) -(def app (.require remote "app")) -(def data-path (.getDataPath app)) -;; (def data-path (.resolve fpath "Userness/")) +(def data-path (platform/get-data-path)) (defn typelist->index [cur types] (let [full (map (juxt :name identity) types) diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index 1b46707ac..3c4a49883 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -9,7 +9,7 @@ (def shell (js/require "shell")) (defn get-data-path [] - (.getDataPath app)) + (.getDataPath (.require (js/require "remote") "app"))) (defn normalize [plat] (condp = plat From b4af0dcbf1b184c2dc49684359c97a97c33b7f7b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 17 Dec 2014 01:12:35 -0500 Subject: [PATCH 389/656] Save and restore position, size and fullscreen --- src/lt/objs/app.cljs | 46 +++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 9a022b771..1e0afd2ac 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -101,28 +101,30 @@ :reaction (fn [this] (ipc/send "loadedWindow" (window-number)))) -;; (behavior ::store-position-on-close -;; :triggers #{:closed :refresh} -;; :reaction (fn [this] -;; (when-not (.-isFullscreen win) -;; (set! js/localStorage.x (.-x win)) -;; (set! js/localStorage.y (.-y win)) -;; (set! js/localStorage.width (.-width win)) -;; (set! js/localStorage.height (.-height win)) -;; (set! js/localStorage.fullscreen (.isFullScreen win))))) - -;; (behavior ::restore-fullscreen -;; :triggers #{:show} -;; :reaction (fn [this] -;; (when (= js/localStorage.fullscreen "true") -;; (.enterFullscreen win)))) - -;; (behavior ::restore-position-on-init -;; :triggers #{:show} -;; :reaction (fn [this] -;; (when-not (empty? (.-width js/localStorage)) -;; (.resizeTo win (ensure-greater js/localStorage.width 400) (ensure-greater js/localStorage.height 400)) -;; (.moveTo win (ensure-greater js/localStorage.x 0) (ensure-greater js/localStorage.y 0))))) +(behavior ::store-position-on-close + :triggers #{:closed :refresh} + :reaction (fn [this] + (when-not (.isFullScreen win) + (let [[width height] (.getSize win)] + (set! js/localStorage.width width) + (set! js/localStorage.height height)) + (let [[x y] (.getPosition win)] + (set! js/localStorage.x x) + (set! js/localStorage.y y))) + (set! js/localStorage.fullscreen (.isFullScreen win)))) + +(behavior ::restore-fullscreen + :triggers #{:show} + :reaction (fn [this] + (when (= js/localStorage.fullscreen "true") + (.setFullScreen win true)))) + +(behavior ::restore-position-on-init + :triggers #{:show} + :reaction (fn [this] + (when js/localStorage.width + (.setSize win (ensure-greater js/localStorage.width 400) (ensure-greater js/localStorage.height 400)) + (.setPosition win (ensure-greater js/localStorage.x 0) (ensure-greater js/localStorage.y 0))))) (behavior ::on-show-bind-navigate :triggers #{:show} From 6ff04a86c11df6c8180085c2fa3c2a0ddf68a06a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 17 Dec 2014 01:28:53 -0500 Subject: [PATCH 390/656] Use store! to set localStorage and doc its usage --- src/lt/objs/app.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 1e0afd2ac..269bc29a9 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -52,7 +52,10 @@ (when (not= "null" v) (js/JSON.parse v)))) -(defn store! [k v] +(defn store! + "Store key and value in localStorage. If value is a string, fetch must be used + to get back the original value from localStorage." + [k v] (aset js/localStorage (name k) (if (string? v) (pr-str v) v))) @@ -106,11 +109,11 @@ :reaction (fn [this] (when-not (.isFullScreen win) (let [[width height] (.getSize win)] - (set! js/localStorage.width width) - (set! js/localStorage.height height)) + (store! :width width) + (store! :height height)) (let [[x y] (.getPosition win)] - (set! js/localStorage.x x) - (set! js/localStorage.y y))) + (store! :x x) + (store! :y y))) (set! js/localStorage.fullscreen (.isFullScreen win)))) (behavior ::restore-fullscreen From c1de64b179958952995129879c3d5cd9b0e5b7fd Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 17 Dec 2014 02:07:49 -0500 Subject: [PATCH 391/656] Use ipc ns for remaining interop ipc calls --- src/lt/objs/app.cljs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 269bc29a9..0c3bb7a1c 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -11,7 +11,6 @@ (def remote (js/require "remote")) (def atom-app (.require remote "app")) -(def ipc (js/require "ipc")) (def win (.getCurrentWindow remote)) (def frame (js/require "web-frame")) (def closing true) @@ -32,10 +31,10 @@ (object/raise app :closing) (object/raise app :closed)) (if force? - (.send ipc "closeWindow" (window-number)) + (ipc/send "closeWindow" (window-number)) (.close win)))) -(.on ipc "app" #(object/raise app (keyword %))) +(ipc/on "app" #(object/raise app (keyword %))) (defn refresh [] (js/window.location.reload true)) @@ -77,7 +76,7 @@ (.getZoomFactor frame))) (defn open-window [] - (.send ipc "createWindow")) + (ipc/send "createWindow")) ;;********************************************************* ;; Behaviors From 654c0fe7bc9a8ae9fd88360bdfe960815ed34057 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 18 Dec 2014 20:05:11 -0500 Subject: [PATCH 392/656] Implement part of cli/args and verify it works with intro This required saving the commandline args and moving the behavior to :init since intro is processed in the :post-init stage. Brought back opening paths in a :post-init behavior (window needs to be visible) since ipc channel moved to :init. --- deploy/core/main.js | 2 +- deploy/settings/default/default.behaviors | 2 +- src/lt/objs/app.cljs | 6 ++-- src/lt/objs/cli.cljs | 41 ++++++++++++----------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 362aa395c..bdfa0c775 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -52,7 +52,7 @@ app.on('ready', function() { createWindow(); }); - ipc.on("loadedWindow", function(event, id) { + ipc.on("initWindow", function(event, id) { windows[id].webContents.send('argv', process.argv); }); diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 603c96145..8bb7fce1d 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -11,7 +11,7 @@ [:app :lt.objs.editor.pool/stop-close-dirty] [:app :lt.objs.clients/close-clients-on-closed] [:app :lt.objs.app/restore-position-on-init] - [:app :lt.objs.app/notify-loaded-window] + [:app :lt.objs.app/notify-init-window] [:app :lt.objs.cli/open-on-args] [:app :lt.objs.editor.pool/init-syntax-selector] [:app :lt.objs.cli/open!] diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 0c3bb7a1c..c1f3df428 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -98,10 +98,10 @@ (when closing (close true)))) -(behavior ::notify-loaded-window - :triggers #{:show} +(behavior ::notify-init-window + :triggers #{:init} :reaction (fn [this] - (ipc/send "loadedWindow" (window-number)))) + (ipc/send "initWindow" (window-number)))) (behavior ::store-position-on-close :triggers #{:closed :refresh} diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 468dd5004..fd19a052a 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -34,14 +34,6 @@ (object/raise workspace/current-ws :add.file! path)))) (object/raise opener/opener :new! path)))) -;; (defn args-key [winid] -;; (str "window" winid "args")) - -(defn args [] -;; (or (app/fetch (args-key (app/window-number))) -;; (and (= (app/window-number) 0) (first (app/args)))) - ) - (defn is-lt-binary? [path] (#{"ltbin" "Atom" "deploy" "LightTable.exe" "LightTable"} (string/trim (files/basename path)))) @@ -50,22 +42,33 @@ (not (empty? path)) (not (is-lt-binary? path)))) +(def parsed-args "Map of commandline options parsed by optimist. :_ contains non-option args." nil) + +;; (defn args-key [winid] +;; (str "window" winid "args")) + +(defn args [] + ;; TODO: (or (app/fetch (args-key (app/window-number))) + (and (= (app/window-number) 1) (seq (filter valid-path? (:_ parsed-args))))) + ;;********************************************************* ;; Behaviors ;;********************************************************* -(defn process-argv [argv] - (let [args (parse-args argv) - path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] - [(files/resolve (:dir args) path) line]) - (filter valid-path? (:_ args))) - paths (map first path-line-pairs) - open-dir? (some files/dir? paths)] - (when open-dir? - (object/merge! workspace/current-ws {:initialized? true})) - (open-paths path-line-pairs (:add args)))) +(ipc/on "argv" #(set! parsed-args (parse-args %))) -(ipc/on "argv" process-argv) +(behavior ::open-on-args + :triggers #{:post-init} + :desc "App: Process commandline arguments" + :reaction (fn [this] + (let [path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] + [(files/resolve (:dir parsed-args) path) line]) + (filter valid-path? (:_ parsed-args))) + paths (map first path-line-pairs) + open-dir? (some files/dir? paths)] + (when open-dir? + (object/merge! workspace/current-ws {:initialized? true})) + (open-paths path-line-pairs true)))) ; (behavior ::open! ; :triggers #{:open!} From 9783c250b0737b2d1473b2b10d4544d546e33a95 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 19 Dec 2014 03:02:11 -0500 Subject: [PATCH 393/656] Move argument parsing to browser side. This allows us to print to the console before starting up a full LT e.g. help. Also brought back :add option. @ibdknox I removed the new and wait options since I don't see them used anywhere. --- deploy/core/main.js | 25 +++++++++++++++++++++++-- src/lt/objs/cli.cljs | 16 +++------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index bdfa0c775..806fedbc4 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -3,6 +3,8 @@ var BrowserWindow = require('browser-window'); // Module to create native brows var dialog = require("dialog"); var ipc = require("ipc"); var fs = require('fs'); +var optimist = require('optimist'); +var parsedArgs; // Report crashes to our server. // require('crash-reporter').tart(); @@ -18,7 +20,8 @@ app.on('window-all-closed', function() { app.quit(); }); -var browserWindowOptions = require(__dirname + '/../package.json').browserWindowOptions; +var packageJSON = require(__dirname + '/../package.json'), + browserWindowOptions = packageJSON.browserWindowOptions; browserWindowOptions.icon = __dirname + '/' + browserWindowOptions.icon; function createWindow() { @@ -53,7 +56,7 @@ app.on('ready', function() { }); ipc.on("initWindow", function(event, id) { - windows[id].webContents.send('argv', process.argv); + windows[id].webContents.send('cli', parsedArgs); }); ipc.on("closeWindow", function(event, id) { @@ -129,3 +132,21 @@ app.on('ready', function() { createWindow(); }); + +function parseArgs() { + optimist.usage("Light Table " + packageJSON.version + "\n" + + // TODO: Use a consistent name for executables or vary executable + // name per platform. $0 currently gives an unwieldy name + "Usage: light [options] [path ...]\n\n"+ + "Paths are either a file or a directory.\n"+ + "Files can take a line number e.g. file:line."); + optimist.alias('h', 'help').boolean('h').describe('h', 'Print help'); + optimist.alias('a', 'add').boolean('a').describe('a', 'Add path(s) to workspace'); + parsedArgs = optimist.parse(process.argv); + + if (parsedArgs.help) { + optimist.showHelp(); + process.exit(0); + } +} +parseArgs(); diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index fd19a052a..13deceec3 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -4,22 +4,12 @@ [lt.objs.files :as files] [lt.objs.workspace :as workspace] [lt.objs.command :as cmd] - [lt.util.load :refer [node-module]] [lt.util.cljs :refer [js->clj]] [clojure.string :as string] [lt.util.ipc :as ipc] [lt.objs.opener :as opener]) (:require-macros [lt.macros :refer [behavior]])) -(defn parse-args [argv] - (-> (.. (node-module "optimist") - (options (js-obj "n" (js-obj "boolean" true "alias" "new") - "a" (js-obj "boolean" true "alias" "add") - "w" (js-obj "boolean" true "alias" "wait") - "h" (js-obj "boolean" true "alias" "help"))) - (parse argv)) - (js->clj :keywordize-keys true))) - (defn open-paths [path-line-pairs add?] (doseq [[path line] path-line-pairs :when (not= path (.-execPath js/process))] @@ -44,6 +34,8 @@ (def parsed-args "Map of commandline options parsed by optimist. :_ contains non-option args." nil) +(ipc/on "cli" #(set! parsed-args (js->clj % :keywordize-keys true))) + ;; (defn args-key [winid] ;; (str "window" winid "args")) @@ -55,8 +47,6 @@ ;; Behaviors ;;********************************************************* -(ipc/on "argv" #(set! parsed-args (parse-args %))) - (behavior ::open-on-args :triggers #{:post-init} :desc "App: Process commandline arguments" @@ -68,7 +58,7 @@ open-dir? (some files/dir? paths)] (when open-dir? (object/merge! workspace/current-ws {:initialized? true})) - (open-paths path-line-pairs true)))) + (open-paths path-line-pairs (:add parsed-args))))) ; (behavior ::open! ; :triggers #{:open!} From 69d07c34ea0edeaad322a416b926c803e080f417 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 19 Dec 2014 04:13:14 -0500 Subject: [PATCH 394/656] Fix dev tools borked by c1de64b --- src/lt/objs/dev.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/dev.cljs b/src/lt/objs/dev.cljs index ffa297041..8071d02ef 100644 --- a/src/lt/objs/dev.cljs +++ b/src/lt/objs/dev.cljs @@ -4,12 +4,13 @@ [lt.objs.cache :as cache] [lt.objs.notifos :as notifos] [lt.objs.command :as cmd] + [lt.util.ipc :as ipc] [lt.objs.app :as app])) (cmd/command {:command :dev-inspector :desc "Dev: Open Developer Tools" :exec (fn [] - (.send app/ipc "toggleDevTools" (app/window-number)))}) + (ipc/send "toggleDevTools" (app/window-number)))}) (cmd/command {:command :toggle-edge :desc "Toggle edge" From a229c598bd60507d2a02a8b2ed80638f9181a0d8 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 19 Dec 2014 04:18:48 -0500 Subject: [PATCH 395/656] Clean up main.js Add use strict, declare undeclared vars, move top-level statements to fns and just have one starting point through start() --- deploy/core/main.js | 58 +++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 806fedbc4..b42ddd2d3 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -1,30 +1,22 @@ -var app = require('app'); // Module to control application life. -var BrowserWindow = require('browser-window'); // Module to create native browser window. -var dialog = require("dialog"); -var ipc = require("ipc"); -var fs = require('fs'); -var optimist = require('optimist'); -var parsedArgs; +"use strict"; -// Report crashes to our server. -// require('crash-reporter').tart(); +var app = require('app'), // Module to control application life. + BrowserWindow = require('browser-window'), // Module to create native browser window. + dialog = require("dialog"), + ipc = require("ipc"), + fs = require('fs'), + optimist = require('optimist'); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the javascript object is GCed. var windows = {}; -app.commandLine.appendSwitch('remote-debugging-port', '8315'); - -// Quit when all windows are closed. -app.on('window-all-closed', function() { - app.quit(); -}); - -var packageJSON = require(__dirname + '/../package.json'), - browserWindowOptions = packageJSON.browserWindowOptions; -browserWindowOptions.icon = __dirname + '/' + browserWindowOptions.icon; +var packageJSON = require(__dirname + '/../package.json'); +var parsedArgs, windowClosing; // vars used by multiple functions function createWindow() { + var browserWindowOptions = packageJSON.browserWindowOptions; + browserWindowOptions.icon = __dirname + '/' + browserWindowOptions.icon; var window = new BrowserWindow(browserWindowOptions); windows[window.id] = window; window.focus(); @@ -46,11 +38,9 @@ function createWindow() { }); return window; -} +}; -// This method will be called when atom-shell has done everything -// initialization and ready for creating browser windows. -app.on('ready', function() { +function onReady() { ipc.on("createWindow", function(event, info) { createWindow(); }); @@ -112,7 +102,7 @@ app.on('ready', function() { mod, func, args, target, method) { if (win(wid)) { - data = {win: win(wid)}; + var data = {win: win(wid)}; mod = modulify(mod, data); args = argify(args, data); @@ -131,7 +121,7 @@ app.on('ready', function() { }); createWindow(); -}); +}; function parseArgs() { optimist.usage("Light Table " + packageJSON.version + "\n" + @@ -149,4 +139,20 @@ function parseArgs() { process.exit(0); } } -parseArgs(); + +function start() { + app.commandLine.appendSwitch('remote-debugging-port', '8315'); + + // This method will be called when atom-shell has done everything + // initialization and ready for creating browser windows. + app.on('ready', onReady); + + // Quit when all windows are closed. + app.on('window-all-closed', function() { + app.quit(); + }); + + parseArgs(); +}; + +start(); From b5b1c142b6d92d3f254c93aa43432230d4d31e14 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Fri, 19 Dec 2014 11:18:52 -0800 Subject: [PATCH 396/656] upgrade to atom-shell 0.20.1 - it dramatically improves retina performance Signed-off-by: Chris Granger --- shell/Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 4020d57c4..4aa9c162e 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.19.3", + version: "0.20.1", outputDir: "./atom-shell", rebuild: true } From eabfda9a7d61a86bda5888bee6e64ec0355a46be Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 22 Dec 2014 11:20:47 -0500 Subject: [PATCH 397/656] Start LT with open file(s) from a file manager * Couldn't use remote or ipc/callback in cli.cljs because open-file event happens before any windows (and cljs) are loaded * This handles one or more files that are selected and right click opened with 'Open With' - only verified on a mac * Preserved behavior that files are only opened in first window * TODO: open from file manager when LT is already open --- deploy/core/main.js | 5 +++++ src/lt/objs/cli.cljs | 33 ++++++++++++++------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index b42ddd2d3..2d9c48575 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -10,6 +10,7 @@ var app = require('app'), // Module to control application life. // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the javascript object is GCed. var windows = {}; +var openFiles = []; // Track files for open-file event var packageJSON = require(__dirname + '/../package.json'); var parsedArgs, windowClosing; // vars used by multiple functions @@ -47,6 +48,7 @@ function onReady() { ipc.on("initWindow", function(event, id) { windows[id].webContents.send('cli', parsedArgs); + windows[id].webContents.send('openFile', openFiles); }); ipc.on("closeWindow", function(event, id) { @@ -152,6 +154,9 @@ function start() { app.quit(); }); + app.on('open-file', function(event, path) { + openFiles.push(path); + }); parseArgs(); }; diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 13deceec3..ab402b02f 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -36,12 +36,15 @@ (ipc/on "cli" #(set! parsed-args (js->clj % :keywordize-keys true))) -;; (defn args-key [winid] -;; (str "window" winid "args")) +(def open-files "Files to open from a file manager" nil) -(defn args [] - ;; TODO: (or (app/fetch (args-key (app/window-number))) - (and (= (app/window-number) 1) (seq (filter valid-path? (:_ parsed-args))))) +(ipc/on "openFile" #(set! open-files (js->clj %))) + +(defn args + "Returns truthy for any arguments passed from the commandline or from a file manager" + [] + (or (seq (filter valid-path? (:_ parsed-args))) + (seq open-files))) ;;********************************************************* ;; Behaviors @@ -60,17 +63,9 @@ (object/merge! workspace/current-ws {:initialized? true})) (open-paths path-line-pairs (:add parsed-args))))) -; (behavior ::open! -; :triggers #{:open!} -; :desc "App: Open a path from a file manager e.g. Finder" -; :reaction (fn [this path] -; (when (= (app/fetch :focusedWindow) (app/window-number)) -; (let [args (parse-args (rebuild-argv path)) -; paths (map #(files/resolve (:dir args) %) (filter valid-path? (:_ args))) -; open-dir? (some files/dir? paths)] -; (if (or (:new args) -; (and open-dir? (not (:add args)))) -; (let [winid (inc (app/fetch :window-id))] -; (app/store! (args-key winid) path) -; (app/open-window)) -; (open-paths (map vector paths) (:add args))))))) +(behavior ::open! + :triggers #{:post-init} + :desc "App: Open path(s) from a file manager e.g. Finder" + :reaction (fn [this] + (when (= 1 (app/window-number)) + (open-paths (map vector open-files) (:add parsed-args))))) From 7e93c2873094dee5615a29aa0704e0f7a98fb336 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 22 Dec 2014 11:48:25 -0500 Subject: [PATCH 398/656] Fix open cli path and intro for 2 or more windows * After first window, cli paths and intro were incorrectly opening and not opening respectively. * Added a first-window? helper and used it in a number of places. Fixed an incorrect check in deploy.cljs --- src/lt/objs/app.cljs | 3 +++ src/lt/objs/cli.cljs | 15 +++++++++------ src/lt/objs/deploy.cljs | 2 +- src/lt/objs/intro.cljs | 35 +++++++++++++++++------------------ src/lt/objs/workspace.cljs | 2 +- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index c1f3df428..4e80b7467 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -19,6 +19,9 @@ (defn window-number [] (.-id win)) +(defn first-window? [] + (= 1 (window-number))) + (defn prevent-close [] (set! closing false)) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index ab402b02f..2fd446ae6 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -41,10 +41,12 @@ (ipc/on "openFile" #(set! open-files (js->clj %))) (defn args - "Returns truthy for any arguments passed from the commandline or from a file manager" + "Returns truthy if LT opened with any path arguments. Only returns truthy on first window + since subsequent windows don't open path arguments." [] - (or (seq (filter valid-path? (:_ parsed-args))) - (seq open-files))) + (and (app/first-window?) + (or (seq (filter valid-path? (:_ parsed-args))) + (seq open-files)))) ;;********************************************************* ;; Behaviors @@ -54,18 +56,19 @@ :triggers #{:post-init} :desc "App: Process commandline arguments" :reaction (fn [this] - (let [path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] + (when (app/first-window?) + (let [path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] [(files/resolve (:dir parsed-args) path) line]) (filter valid-path? (:_ parsed-args))) paths (map first path-line-pairs) open-dir? (some files/dir? paths)] (when open-dir? (object/merge! workspace/current-ws {:initialized? true})) - (open-paths path-line-pairs (:add parsed-args))))) + (open-paths path-line-pairs (:add parsed-args)))))) (behavior ::open! :triggers #{:post-init} :desc "App: Open path(s) from a file manager e.g. Finder" :reaction (fn [this] - (when (= 1 (app/window-number)) + (when (app/first-window?) (open-paths (map vector open-files) (:add parsed-args))))) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 981c0422e..17b3543cd 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -190,7 +190,7 @@ :reaction (fn [this] ;; (when-let [proxy (proxy?)] ;; (.defaults request (clj->js {:proxy proxy}))) - (when (= (app/window-number) 0) + (when (app/first-window?) (set! js/localStorage.fetchedVersion nil)) (check-version) (every version-timeout check-version))) diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index d4765de1a..8c6794950 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -51,23 +51,22 @@ ])) (behavior ::show-intro - :triggers #{:post-init} - :type :user - :exclusive [::show-new-file] - :desc "App: Open the welcome screen when Light Table starts" - :reaction (fn [this] - (when-not (cli/args) - (let [intro (object/create ::intro)] -;; (.focus app/win) - (dom/focus (dom/$ :body)) - (tabs/add! intro) - (tabs/active! intro))))) + :triggers #{:post-init} + :type :user + :exclusive [::show-new-file] + :desc "App: Open the welcome screen when Light Table starts" + :reaction (fn [this] + (when-not (cli/args) + (let [intro (object/create ::intro)] + (dom/focus (dom/$ :body)) + (tabs/add! intro) + (tabs/active! intro))))) (behavior ::show-new-file - :triggers #{:post-init} - :type :user - :exclusive [::show-intro] - :desc "App: Open a new file when Light Table starts" - :reaction (fn [this] - (when-not (cli/args) - (cmd/exec! :new-file)))) + :triggers #{:post-init} + :type :user + :exclusive [::show-intro] + :desc "App: Open a new file when Light Table starts" + :reaction (fn [this] + (when-not (cli/args) + (cmd/exec! :new-file)))) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 3fe5b92ad..5297b045e 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -208,7 +208,7 @@ (behavior ::reconstitute-last-workspace :triggers #{:post-init} :reaction (fn [app] - (when (and (= (app/window-number) 1) + (when (and (app/first-window?) (not (:initialized @current-ws))) (when-let [ws (first (all))] (open current-ws (-> ws :path (files/basename))))) ;;for backwards compat From 08131f8b14db74c39fc50f2306699f971bcb5212 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 22 Dec 2014 13:37:25 -0500 Subject: [PATCH 399/656] Handle files from file manager once LT is already open --- deploy/core/main.js | 13 ++++++++++++- deploy/settings/default/default.behaviors | 1 + src/lt/objs/cli.cljs | 10 +++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 2d9c48575..2139fb2b8 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -154,8 +154,19 @@ function start() { app.quit(); }); + // open-file operates in two modes - before and after startup. + // On startup and before a window has opened, event paths are + // saved and then opened once windows are available. + // After startup, event paths are sent to available windows. app.on('open-file', function(event, path) { - openFiles.push(path); + if (Object.keys(windows).length > 0) { + Object.keys(windows).forEach(function(id) { + windows[id].webContents.send('openFileAfterStartup', path); + }); + } + else { + openFiles.push(path); + } }); parseArgs(); }; diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 8bb7fce1d..8c3bb55fd 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -15,6 +15,7 @@ [:app :lt.objs.cli/open-on-args] [:app :lt.objs.editor.pool/init-syntax-selector] [:app :lt.objs.cli/open!] + [:app :lt.objs.cli/open-after-startup!] [:app :lt.objs.thread/shutdown-worker-on-close] [:app :lt.objs.animations/animate-on-init] [:app :lt.objs.app/store-position-on-close] diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 2fd446ae6..242257a14 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -39,6 +39,7 @@ (def open-files "Files to open from a file manager" nil) (ipc/on "openFile" #(set! open-files (js->clj %))) +(ipc/on "openFileAfterStartup" #(object/raise app/app :open! %)) (defn args "Returns truthy if LT opened with any path arguments. Only returns truthy on first window @@ -68,7 +69,14 @@ (behavior ::open! :triggers #{:post-init} - :desc "App: Open path(s) from a file manager e.g. Finder" + :desc "App: Open path(s) from a file manager e.g. Finder on startup" :reaction (fn [this] (when (app/first-window?) (open-paths (map vector open-files) (:add parsed-args))))) + +(behavior ::open-after-startup! + :triggers #{:open!} + :desc "App: Open path(s) from a file manager after startup" + :reaction (fn [this path] + (when (= (app/fetch :focusedWindow) (app/window-number)) + (open-paths [[path]] (:add parsed-args))))) From fda37a3d0e52086168c8abae7e5a97b7df8c405f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 23 Dec 2014 11:12:47 -0500 Subject: [PATCH 400/656] Add a build script to replace *_deps.sh Based on https://github.com/oakmac/cljsbuild-ui/blob/e7c4832b6c7e38a3b11e8aa8a5b2d7d57e005613/release.sh There are still a few todos and has only been verified to work on osx. Bumped project.clj to upcoming version since script uses its version. --- build.sh | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++ project.clj | 2 +- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..a3876c541 --- /dev/null +++ b/build.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash +set -e + +# Create LightTable release using our local Atom Shell installation +# (Mac, Linux, or Cygwin) + +#---------------------------------------------------------------------- +# Get OS-specific Atom details +#---------------------------------------------------------------------- + +ATOM_DIR="shell/atom-shell" + +# from: http://stackoverflow.com/a/17072017/142317 +if [ "$(uname)" == "Darwin" ]; then + OS="mac" + EXE="Atom.app/Contents/MacOS/Atom" + PLIST="Atom.app/Contents/Info.plist" + RESOURCES="Atom.app/Contents/Resources" + +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + OS="linux" + EXE="atom" + RESOURCES="resources" + +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then + OS="windows" + EXE="atom.exe" + RESOURCES="resources" + +else + echo "Cannot detect a supported OS." + exit 1 +fi + +#---------------------------------------------------------------------- +# Determine release name and output location +#---------------------------------------------------------------------- + +META=`head -n 1 project.clj` +NAME=`echo $META | cut -d' ' -f2` +VERSION=`echo $META | cut -d' ' -f3 | tr -d '"'` + +BUILDS=builds +mkdir -p $BUILDS + +RELEASE="$NAME-$VERSION-$OS" +RELEASE_DIR="$BUILDS/$RELEASE" +RELEASE_ZIP="$BUILDS/${RELEASE}.zip" +RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" + +rm -rf $RELEASE_DIR $RELEASE_ZIP + +#---------------------------------------------------------------------- +# Copy Atom installation and app directory into output location +#---------------------------------------------------------------------- + +echo "Creating $RELEASE_DIR ..." + +cp -R $ATOM_DIR $RELEASE_DIR +mkdir $RELEASE_RSRC/app +cp -R deploy/core $RELEASE_RSRC/app/ +cp deploy/package.json $RELEASE_RSRC/app/ +cp -R deploy/settings $RELEASE_RSRC/app/ +# TODO: Clone plugins instead of relying on *_deps.sh +cp -R deploy/plugins $RELEASE_RSRC/app/ + +#---------------------------------------------------------------------- +# Polishing +#---------------------------------------------------------------------- + +if [ "$OS" == "mac" ]; then + + FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" + + # TODO: Port keys from previous plist + defaults write $FULL_PLIST CFBundleIconFile 'app/core/img/lticon.png' + defaults write $FULL_PLIST CFBundleDisplayName 'Light Table' + defaults write $FULL_PLIST CFBundleIdentifier 'com.kodowa.LightTable' + # TODO: Fix enabling causes LSOpenURLsWithRole() failed ... error -10810 + # defaults write $FULL_PLIST CFBundleName 'LightTable' + + mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app + +elif [ "$OS" == "linux" ]; then + + mv $RELEASE_DIR/atom $RELEASE_DIR/LightTable + +elif [ "$OS" == "windows" ]; then + + winresourcer --operation=Update \ + --exeFile=$RELEASE_DIR/atom.exe \ + --resourceType=Icongroup \ + --resourceName:1 \ + --resourceFile:$RELEASE_RSRC/app/img/clojure-logo.ico + + mv $RELEASE_DIR/atom.exe $RELEASE_DIR/LightTable.exe + +fi + +#---------------------------------------------------------------------- +# Create zip +#---------------------------------------------------------------------- + +if [ "$1" == "-z" ]; then + zip -r $RELEASE_ZIP $RELEASE_DIR +fi diff --git a/project.clj b/project.clj index bc255351c..c26d20147 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject lighttable "0.1.0" +(defproject lighttable "0.8.0" :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] From 5c3fcbd53e64b6f0009e7caf9762178e9367fb00 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 26 Dec 2014 10:39:49 -0500 Subject: [PATCH 401/656] Enhancements to build script * Clone plugins by name and version * Specify $VERSION to build to a different dir * Ensure script can start from any directory * Copy over executables * gitignore builds dir --- .gitignore | 1 + build.sh | 64 +++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index cf01ef5ba..ff8880b20 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ deploy/nw.pak deploy/light .nrepl-port /node_modules/ +/builds/ diff --git a/build.sh b/build.sh index a3876c541..15db0d18a 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -e +# Ensure we start in assumed directory +cd "$(dirname "${BASH_SOURCE[0]}")" + # Create LightTable release using our local Atom Shell installation # (Mac, Linux, or Cygwin) @@ -16,16 +19,23 @@ if [ "$(uname)" == "Darwin" ]; then EXE="Atom.app/Contents/MacOS/Atom" PLIST="Atom.app/Contents/Info.plist" RESOURCES="Atom.app/Contents/Resources" + PLATFORM_DIR="platform/mac" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then OS="linux" EXE="atom" RESOURCES="resources" + if [ $(getconf LONG_BIT) == "64" ]; then + PLATFORM_DIR="platform/linux" + else + PLATFORM_DIR="platform/linux64" + fi elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then OS="windows" EXE="atom.exe" RESOURCES="resources" + PLATFORM_DIR="platform/win" else echo "Cannot detect a supported OS." @@ -38,7 +48,8 @@ fi META=`head -n 1 project.clj` NAME=`echo $META | cut -d' ' -f2` -VERSION=`echo $META | cut -d' ' -f3 | tr -d '"'` +DEFAULT_VERSION=`echo $META | cut -d' ' -f3 | tr -d '"'` +: ${VERSION:="$DEFAULT_VERSION"} BUILDS=builds mkdir -p $BUILDS @@ -46,7 +57,7 @@ mkdir -p $BUILDS RELEASE="$NAME-$VERSION-$OS" RELEASE_DIR="$BUILDS/$RELEASE" RELEASE_ZIP="$BUILDS/${RELEASE}.zip" -RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" +RELEASE_RSRC="$(pwd)/$RELEASE_DIR/$RESOURCES" rm -rf $RELEASE_DIR $RELEASE_ZIP @@ -57,17 +68,58 @@ rm -rf $RELEASE_DIR $RELEASE_ZIP echo "Creating $RELEASE_DIR ..." cp -R $ATOM_DIR $RELEASE_DIR +rm -f $RELEASE_DIR/version +rm -f $RELEASE_DIR/LICENSE + mkdir $RELEASE_RSRC/app cp -R deploy/core $RELEASE_RSRC/app/ cp deploy/package.json $RELEASE_RSRC/app/ cp -R deploy/settings $RELEASE_RSRC/app/ -# TODO: Clone plugins instead of relying on *_deps.sh -cp -R deploy/plugins $RELEASE_RSRC/app/ + + +#---------------------------------------------------------------------- +# Fetch plugins and copy into output location +#---------------------------------------------------------------------- + +# TODO: Handle node/node +PLUGINS=("Clojure,0.1.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.2" + "Paredit,0.0.4" "Python,0.0.5" "Rainbow,0.0.8") + +PLUGINS_DIR="$RELEASE_RSRC/app/plugins" +mkdir -p $PLUGINS_DIR +# Plugins cache +mkdir -p deploy/plugins + +pushd deploy/plugins + for plugin in "${PLUGINS[@]}" ; do + NAME="${plugin%%,*}" + VERSION="${plugin##*,}" + if [ -d $NAME ]; then + echo "Updating plugin $NAME $VERSION..." + cd $NAME + git checkout --quiet master + git pull --quiet + git checkout --quiet $VERSION + cd - + else + echo "Cloning plugin $NAME $VERSION..." + git clone "https://github.com/LightTable/$NAME" + cd $NAME + git checkout --quiet $VERSION + cd - + fi + cp -R $NAME $PLUGINS_DIR/ + rm -rf "$PLUGINS_DIR/$NAME/.git" + done +popd #---------------------------------------------------------------------- # Polishing #---------------------------------------------------------------------- +# Copy over platform-specific files e.g. executables +cp $PLATFORM_DIR/* $RELEASE_DIR/ + if [ "$OS" == "mac" ]; then FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" @@ -91,7 +143,7 @@ elif [ "$OS" == "windows" ]; then --exeFile=$RELEASE_DIR/atom.exe \ --resourceType=Icongroup \ --resourceName:1 \ - --resourceFile:$RELEASE_RSRC/app/img/clojure-logo.ico + --resourceFile:$RELEASE_RSRC/app/core/img/lticon.png mv $RELEASE_DIR/atom.exe $RELEASE_DIR/LightTable.exe @@ -104,3 +156,5 @@ fi if [ "$1" == "-z" ]; then zip -r $RELEASE_ZIP $RELEASE_DIR fi + +echo DONE! From 8ef9899fcd21211ea8c25d4ff71f498c87a761c1 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 26 Dec 2014 16:04:58 -0500 Subject: [PATCH 402/656] Fix icon not showing up in osx dock Copied app.icns from mac tarball --- build.sh | 2 +- deploy/core/img/app.icns | Bin 0 -> 247796 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 deploy/core/img/app.icns diff --git a/build.sh b/build.sh index 15db0d18a..f7660442d 100755 --- a/build.sh +++ b/build.sh @@ -125,7 +125,7 @@ if [ "$OS" == "mac" ]; then FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" # TODO: Port keys from previous plist - defaults write $FULL_PLIST CFBundleIconFile 'app/core/img/lticon.png' + defaults write $FULL_PLIST CFBundleIconFile 'app/core/img/app.icns' defaults write $FULL_PLIST CFBundleDisplayName 'Light Table' defaults write $FULL_PLIST CFBundleIdentifier 'com.kodowa.LightTable' # TODO: Fix enabling causes LSOpenURLsWithRole() failed ... error -10810 diff --git a/deploy/core/img/app.icns b/deploy/core/img/app.icns new file mode 100644 index 0000000000000000000000000000000000000000..18e5d04e46ba3d6ddec8053c369d93c03ac21887 GIT binary patch literal 247796 zcmeFZcU+W7wm1HCAP31HIfo|G-Q=8e4w6x#qKE>LM4oPvVn$SQh9(+jbPQv5#xOfM z8qi6*_s;I@&ZhhR?z=1S{Jzzoj&pZ*_Ws__``7O_O=zB~bLyNrb?Vd!wYjjOisIb; zkIhwlH;Q84Kg2W_^W24Q0h@ACHzd3B@)^d5;!u=@n=Q}TTa)r*7+*?;#kF^|_wb3f zr^*?|pJFM?nI>-8x-C^hwt`_IDJs{6lPjt{C#GbI7$$_GHn~x9MrL6fDJqs>lGSuJ zyHIR4<&4i>4AW|=zDYpI%1|!&?8z{>N8G7A{__U-N2?W8c|5WpfO5>1HrQz_j7kqo zjn(4Fvq*;&j-z*kv!1Q3Dod8~CIe=vxav_XE*m4q^KC-^;0@8f{=tF%fr7F_ObbJ; zh#1xie&}57EXvC{e)Zy|H&0cR_ApGntH9Q4aFQNxK2;Og$1p8Hflg7g6XTNUvnMKV zG0ge)WKaL`*RNc=cA>5ACc|79?${qz^7h@EkKfJSew|_7={WUxv z9J<`OqcA3Z*U>QlT86nb)O-49ji@N2MUwB8h0nvS)176z_Uzg_UXqB<7mqZbzc==} zq_!=jFFUQ2Vdlj9kB#&V_K0^B=EZDbn7+y;QEOvO{qEY_w3teU5vSyB+**{AU$7}5 zFmNZs9IxBc+$wI|O^a%`Z#{m9VKE?+S_Zw#%QR!X^3}zbx|&_r;jnrINi~)e{Xw7`@W_fyMSQocwb+CUvF<; zfA_&dXAUt{p4-YPiX~6|^wspmyW%-@&SUVmqQQFQ9R#v9^CdRh< zG^N0$@|kDPn9Y>Dn5!?t(hv3b^L7)uJ9-90Sx_?aR1tZKuC0`wgP*&blQZATCm=Z7 zgJQ8MdJQa|**ZD7IlFlI2ZscOhRacMcAaa_M3e%XVp-U^d3bt<(BZ0K;n6CTsaG3$ zyqSP)wsNqu;_(F@?jF98LW;8S>LAZ5C@$ui;;B$ZwxN6I_KuFW=8{l-in0{8ljplu zpWg|j)GYF@U&e~P%`6JJEXv$f3cF$T`Mn^DrEP6w>niZD>->5h#iq0@MKAiZDLm(K zC{3PcSY)hU-n#^)oK`JqP({fqsj9Q?1`++pQ8VG$D|oyoqBPl5HDO63rDtklt}K1b z5>XsB<&LN7T&j?Hw!|D!F*P%`R=R`EG)1#Goaax$>?LL<%E-XPiXu;2e$*4smKjL_ z-_X*4jO)KXn=Fhru~DY(g;4Al{S2fNxWtU*XPGLosC&Vb44chjvp}ivUFm?NC`WSB zisxMhH|?FPJo5d&PPH8Hhk}Z z#Ka(XpP2Mq4^t5+d2WLBt<>{jb!#XY^ISXvW8y+w zOzfPT94*(ez%G4h*Jn&U#ZfY}b@2*I^0U%5wze|S)m9O&b$-T_VIUkeL;HYWp_!7B zrnaV*h8joo;_((rL59nfGjToz*Rc&p}b+RI^f;_cpO=vMMTpcZ?{cB>r%*>VS zpts9Z?4+9;c8Io96>ZzOJBlZnt87zjOSE%LIr4IZQEkUggGpZ}hoeOtP zwKdi^G}h5)?ug&kzw`E;{(4c{kpmZ*E>y1NWZKJ}z6lag9(4)-K z5;GMY8XVy5?!}K9nV+7PNZ&KB^(Mt-=D)!#FEPErQKA0s0(bkg8L>ovN-{G$w=i9n zmfv}gS;5o5@Q@&Hp@5e)E1qIWW<>K^ryDcqsXOH1RCZc$u%A$9n>ii|p#N-s9&(H799h|vKp5N;o9jJ{IraQY0O`pDZ z=RW;T^PM*rhKlkA33&2+Xkci!;G;~{n)!3zeEHSaUw^am!)$9>cJKIG>Z%;{%tDKZR z2mImTiNjAi(hA~&%MXoANxI{E7ZVc`;*;C%699Klj*gE_bbobtQ)N|2lwZ=u;`CjM zvGECUQPHQF!w)aYV!PDiKOT7o}FKwsHm%NY-tzoso&E6 zRq5u^qHH_q^LNI^JH;K1zrL}prmm^2t+l0bOWRk4MVs>T1kfLevB-SA z_~gqk|82fmR8BuEC@jdy@&W#3=El*(dk-8s+&erpFgQ9sd91a0Pt}%fc?Efy>3$#p zV%Of*($=y6!2Xt|JuopXlSs%_vFdmKDu9_@92T9BV7k?tgXo< z_Of(MidN`l&eGEIa{CHQ9`Q1@B3+iBfBDDH$GZ<7I(%T@(eGNn)BD}EuKuypuf5Bx ztT5laH&dOH78@BEGqU)Qeq{Lg(W8ftKiivC($IW~EZVz!Dz=msWTwYeKY6m)`b7Wn zHy?}Z_l`UzqIbS}S7m8#T5?#+H;)#dEYeRzi`q{oT6^CA4*M;0zH-O5&6_e3L-u|9 zSoDNm^aFseFCV?}^jq@uSA8AZ%8Rp;1NZ&<@#2%GPZpm%dHVFp*LMa!TKqM`tT5j{ z`e?MeEH~D-{_Dq!7}F#AvBBb#udWV$w)h+J{C5u*pS)3!&r& zv2T6**@FiUAASDh?~g}l(d{Rz&mZ9V(+gjY?#wB9``1tD$J-Yl{m1DxQRDQ}Z>0Sn zJbd`*$-BRMqr0zZ+sM5Ki%&ki{~IDZ;@iI^&%gWp;ll@yKKT80$=UPcb)_x6!$lLzPkBS!uQ{P_TY;z9=`Yedl#-iyU*!Qn;*RW z+jrl%dgc1{(RR9P_>CVbuWA{_vxZui*KcS8u*`X8N^rXRiM7!ucst zLC}8k{NFzQ=)L#fz5Kg(&t1ND`|X=IZ(o`{_lNn}+2MNMR`UGY_dmFQ=ho%#-+$xE z^;@^!x^?sV>GQvzmW+=ai*F&%zq)(>)-}1C7k~fN`Ae7Iq_2BkyL#re??;9QdV2Du zdgIZxn^&*hxcKkP58wachadj@(WN&}pZd+fU|;vKa)|8;^ZA8K7cN}9c;>PPtVE22P>rne7tbx^rpH`cj?mKq$$lms?$4LKoMKgGb)smdDii#p=(q-mU-vAu_)EfdF+S(^(C3#s|w&$J@f3j z3IFQvXUuMj%cVM)|9tijU;oJ*rMNPb_~-i{A^Rj{KUz={x(soxJ9Y0;XXD=485P??x$4cY#bddEsWP|Yv>yq*x=-##H9`s!k#gM zl)_%FmJD0nFUZ$d$oCfTo!o>D?*5+2Y!O#Uo|3LFDV%+j7KiWe-Qz)^ikyWf1RtL3?McI0J z3*GoU7Z+zw@4z5YuzIWp(P(mJ3&az!hSq}T>f~zY?&##^;q4m~92^uJ6mLnIIe5(e zxS5%~t&2Nfz<2Qr35jtopj1bJNA|54lSg|N$2cC_IrL7B} zFLW0O+&zNBJaM39@k51c4aX^&R!UhmV;x1QJJ|ADjvhN9?$bTieIPQ-7!X-bL95u8 zm}yE8XSa21%ASd!*fO?OA>aMSU;g?R`mcKb3wA+;K!H&1?B_f~MzF-p%CAFn2R7x% zMByl@=3r+h@CpbDjfe;>{x!2xivXu=yd9;qp}DLa8#89V+8$%ncCvNg`veh&IW;pI zz%R7db~T$`1wSprWs4};wdORnPSei8)jKdSI5;ez1a3>rs=b`O_UI}*rlfudHb;(f zz-R~uD0u^(XHZx~M2LPUyq-80>#o-sBto#nNGKJytd@p`mXfqJfP*rYqLz`#dS&<= zS6g#shgVzADk`fQni?6Ksk;!^Vl-``WQlWfts!+{wc#061tT-K4a~Kr4cjOY>y>6w z!H2ubLEp&4%+SJT;mY6FE1&^I9p-aq43!}2aEIUA~*pv%{BxT?7!a7#?jfs&p#w4*2~eA&vzCG-Q8SW3?W?XHp=Qn z)63pQ3VLR?j(jig;OLm}AWsKla|Z`!CnpC}4R!}*{i5M{Ls^#UdP|<8n@2!sR7wcn zTF=nR#-3+uv0hi5-Tou&67ZX)sAFp9;N~5akQm@%rm16MX<=@xtD~-|%4(yG)_@Yd zOI&XpWj$jXSO16*FGmw~B@J3vR$E&~LqiP;=%tG8r({GdT}oD2$Hv3k!_8I~)5=v+ zSJTi?S5uK`qn=OaGiCr`1@KOR#ga32c5$>bQ4~?~Y&2C{r=kGjU$z{gtofsSv?C0&l7YK!JkzF$)2@eh&iS&C~GCPqU5fPu2Q}zyNj)f2w zA0CS4?$Gjlr<@6TnwD^;(3+N5%*@TtpK3}?O3T`M__NjK*P@fcLqh_6gaUVgn^Vcm zRExwGz^7+t=jP_;&UEEuWfpgheMZP!Vy;CdgoT6z`FRS2uC7kyGxU^`L^={2VaN$* z{>(^ec3#WO#PjwMiQyq3!2v#i?P9-mRx;f(We>mBJkA#Qny${-Jh(6}Z456`X+>Ui zXlNj5?8GCDB^a~qG{%9G2d=e+SJM7jErg^#IcxwUmO@29PIBKI2M`4 z6lxf`9h#q@Cmp1tpMC8I=GsVeW_rrzG0E`r_JgCt1O4!^m26-(8`xTe_RrCi)U;@> zd4BXw=FP*!X{kwBCuWB}Sq1+D%>llDq;)&9$1hZ9pV&V)H7Ox8IzMxUnJ?dvnw*p* zo*!Oozt}%II503YGik>CP)J z-?p_R+21QVcXP$ovea6pJ{;}iVxr@BeoTatuzzTDY;<&NY^aavFW*&DUtd?XF~U0_ zBr-NRriQ5tPek*`@KFEDj4TWcoa9GDqfR5E=nzTwR48bVplDtGKDQrnrUa%quC}v@tI;)@XQ@ z;zt7$!-v}Ub{=YnKk)p)!$-P~_YDs8cD9S^Yl_57XKwMPg8ZzEWQ!5fewq2KYv{y* z0|yTsIe79}2V=X^FK%tBE!@qBvx_$7=WIwzv6Hd}4UY^Q-PgJQ;E|(;M<<4c=t1A% z@$re#PI#&6wiefI$}iZMmzAEJ;xx7f_`vafZSClB=*WS6ZOyxP?-8}MwzYNcYi+8o z+>$NIHOkqLnvmo&zS{hgz57LCaZ6i!=Yd1;%e1xAZAu+`JKEdZ#I@VE6=%~~@tJ8! zvGI;;?LVgXH0){GLyKB~qjO(JOY`m~nih%Z=BB2q^5V>l^t80(_?Q^pTKo5_c2(8Z z)xs&(+}hf^ z^umn=qI|W2!ji2-mK`pMn=b{r6h-5B;c2r%jp~Qa_JmLG%74D zDJd>2$j!>g!V1~6abrPVenxm`cuaCaTtdj3q&?0|rioEek#qz*GAf=C%-ezb0EdYx&s(_HeSVvsRWxt6Tc=ffY8KRxNNApJkM={y+HP_kaG~+pnKl5YKZL zZh!a3KXm+H@TYGsE}XmY=8e1W-ToFB@&5eAmyd28*p!hJO-IN^Mr=Iu;L*dDN1}%+ zj~>hwrRNlGZP>f#Z3ZEC{l7eUXRNV&bIHb>jP&%h{DrUK>wOAuFWkZ6Czijtykl!+ zeaDd_U#!CYvWKqNR$j6xm+0ZRx=)`xezFM9GH3D0;$wQz`tjq%o~oMNon5E@jkI58 z-rv=L2`eec$w)~~i0=9l4Wu1di%(h>jla6m-rRC%;nUx(HvXt-Pxa32TMBd1lM~~k z2EL&e*=Q_!Vz)?oJz4zfgP#2d#y@%d+qLEmyLVP@-BOaDk%V~3__vQSWYQRY@E1sU zINjBE_sa(_n^#qC+fueEhp5y^_{3Y__O_9d3TiL(%szOs+7|BDg@qG!J1RC8=BCF* zg-?9*m<+?7z@q=Q&t{_>E1tbX@+)z*!vp&@>?$Z1%7_~_9C`VsH(BYXk=CzB^GK3#m?{?CsV z;qd=tXh&hzzIdJW}s|_240<60^wr z;;+oNk8d4p5sg27^2K+n6OZPPA3k{a#h2qXOp|A@_twvzK79Q6k!Vrx$roQRzy5T* zwWay+$4{R_|I>rTNA!d2FCM?$!wi>i&4}Fd*_RIyCIG#UAAihzd8V^PM7Lc3^7FN! zqy0nT<$wIeMdrexV;wcQyKjH_q%)_Bjow z6Z5m<2YZ--T}^QP*Y4W=`uD5U{^_%aq6fS$9z1x5dFQoDm#$vB`bK}%#xkg?=EiQO zzouz-V_kK1Mdc@}oBp3aZ~4Oh!542aA6~e6_1g98H(x(iw{825nx@7R%!H_=v9@OC zw$fCo{(uNPdH_>A`-=~+Gw+?da^>o^Yd5cq9oSRV)Olj?40B^@^l;OT^1_1nH&)fh zpC3H@)rIQ)ii*GxM`EBm1@_x=8&SE6fice)OzjgcO<#RJuUwFvVlEAg4EOi;9QAGRUF-1M+xOnSdF{rHTi36xtUS1V`>nU{-h1c%{TtV> zUb-lmXD$rDoIH8#h&W8@C_>=n%B}0-tL!UpO84%&m)^X1ep14m?HTItJ$~d+N5UFk zetq%U8Dn?_|0pVUVr`E zYpmS!KfACn-P?1b`^2$>``X*G*JkMJg|kvS|J0c?^lQ{< z@hSSWJz^H8<|LAl?ykd!5AACei!#ovg8p)H21go%7>G?fKQ}uwEoqrH#^=e=Aq=5& zUmM-DJ9!QA<9?W)BRIN^$stlMnH(E|sYs8=;eX)r;SRc0Rov3iR(hL=?K1O4_drXZ zTt6(_k&&T(x{vB_>(lM;Jt)RnYdds6w0bUsA#?Efv14>M=U8|5ak__f@_1`EeaxU6 zF46r>^$qmCHqoBy_g6uF(s2aAn}gy*^ik>veTc$e?1Kjn(}xWA)mPQi&Ek$uv2@Wa zGau8PdplsRbad?9OLubi?cLi!w~O{t9rRwEeXZ5och&A`5w|pcxC;1Ab4P27Sj=i^ zrQ7IMZi`q1)2CI7uB_Nm*WA>&r|whI4!g7Wu8P*}R3*JbzH&$9b{G}gx6_rn_;dT# zoV2Vm#Cpq$?~=CInJ4eG-xJ^8e^2@D?d!MiKz8oG3k4wEi3gUcrB-aZXP7c+tOyAi z{~uoeB)atDuoGM-(iiLbAHRTVtsNYRWqTTT|I(|eSQCyy;w)5>GV^%^;OBlXGassu z4jg1c{_P*erhf9z|IH+zv9vubo?m_~F4jp{}~RHX=M~I(pi=dWHxXnpoMH${i=^ z1>}{uySg|#@_2TZrWQPV2PX%b zC-34e^zyMnI=D2wL5g3244X@_Su(6qil^n`47}9c?YG z?3`Sj?0GhJ&hBs!1vzk~85qw=KnR;ceFr?g*ouK46w!VH|KHh$`kBq0#-9z9?3)Z_hIr5x6 zobl7%&4cg2b98n0^l%q=MmfI%0Gt@7WVx2Y06$M}+RM<_7i4&PySocr92}gSodtY* z2Ya5qtB@~n7t&sG-tHcLVaO>sNG5|O?8GPlWR%iiQF=Z;{(hdmKHgqFK7Ijy9(>x< zz{SDdNyvBhaIv%F*28bNBJ}4G0SG4G0Vl^OHYBV6?p)$QZ@f^7Qla^Y`-e!?b!KeZbor zli z4m?*6FDH9PJ4c}>?XKeG?IGkNei|4EAR(e)Zb+OX#X3N7mCcby`W(zK#bHs(9<-;0 zAK>^C<_a8a?Og=|CkHzRfrlrA4+JB-!xxb=Iz$d*3JH%5kn5!65bSqw=>IV+OQ<09 z5D2{keBB^th(6ib^LQQ}u8v3_@$~lc@(u_Lq=Q<6)9I^L9G?WN@8Z9Rg7 zgFgm_K(LlKR-V1Hx2J=-F%Q6;uy&js`9gufi}u#`^#d@()&MO4-yuQ4VG)TgAkfA? zC`|auz#LeVuCLJ1fe5XKqq&`%(ACkw!Nr{jfG3$wAOC=0FbZ$L69;p{Ba(w;+L7Wx z>AL#|g$Q1O26pLSP1@Vr*}8fOoLz;U$h2`rAlFF7D`DzAjlsygb7|*5?Eda zeA-^g0czXT)6;|R$oHY$O|hi>vA&U!gi(b8NGKxJp(HselH?ungyV%gQZa$15lU8INcid! zk$J|7Lp{`=1%r4JSBTOa}!$^S7#@I zhZpT5C*20H6JXEs#%|%~gP}t>gLz2Rz(DnU-Ms^#SNTIk)gW>@M{#9kk5e3TWMH8l zNRwx4BjU;0Tlgi$C1=vv?A*daQIReZ`-|~iSX3l^7hna0$G*DlQ16tk2j80xB&uK}nG-BhNXEv=GYZuMBgBKvCiV2)1q>yw86-h7gaKky~N5dxnJunRiIR z_+m5m2?%hOE;WETrKYK>prkAXWBqqzFOb9@EOIrTCC`b+v+8A*yAdy1p^33o=NTE~ zsw@Sh;UxtWmuFN0T_%>m6Jue+ADzDDQHSPXPz}?%f`uFC=mK!bAbdy zH$t0{-NiTjd$eSW$(Vm*QYiF-vetL9GPAHZ=q8qtB8XQpQR66ZWjF`P zY+0^K*nUb=!`g~xZ)`qHE^>^ zChIUmToyzFho2V^4Xk zLC+{_a^+~wUW#Tbak%VNa1hk}lo|^Z-a8 z@HAJHMY`ADP&&8s>my-Ya!iljhBZg z3K?fc9C=kU9^cCsKtn@=Li}CLG&wkO9CjtSl=h z53Jh8`g%ILy6bTo)7LXmr7Zt0)hiQ3JYJ5e3o2Gu11X&Q8I>jGw2q#ds)C}D5=+Ze zY{WJ+G@y+Yjf`}jckZEBEbJcmA%@Y9Y(wb;9HY1#St;{X0YckEPYp^@O~=Ftz10m3 zjEszpkUeTZS^Ry4Xf_Gyy2cXHmD)$JV~L*CH8W6=kx?))qm8vp&CQIBO)bqW4A+~O z{7l!ivkd5dP2bvBg)5_GZf0s`WNK++L;tx->|gP zQBqJgMpi0Gmo+ga{f!MQtc;{o|F|oJ?UkN^y-$Eo`*V zb>$VTuXM$3@K$V~jixSbtf!`HVs2_|sBdIuZfa&>X{8{Y`k%+T%)FhM736GfY+__= zZfR|9WMF7)W?^AvWo^Lv=L1$>X71#aW<~SO%!~|;O-)S6HO% zqigo&viv9~GZU@#M!E*Z#u&9ZZKY_49h%JR&kk6FbS zYye3x!Ju`K{rZbt-_GB$t+aSkgsriOshKHe1yW^bq(r*@(*Y}EZt^O(78e$$xLH_= z%rva5EX>hY<`;YFg4BY_EhQzJ^ZaeC(8t8o+RDPzYCTQ#^-qz$GBv8wuH|Lr6~!^G zww5Nev5Y0A#so?QU4P1@SGww;FmdDd^0F=ETT+BJ=wuErjJ2f-$(H>^r1uId%Qu&A z-If_(ZEi(da&4@w4B2ZvUtMso;DjW-omWv-TwJy#FWlA?i_XT*#!wdO1b`TUJ0i5+8BRU*45A}trSU5g1Duee+(G(SA+zH)#gfwX zQf01bpmiwD1*Wpio6ELr3br@IHi%mctPr924wm}VtGaTn59XZoDcw?1RGb@Nh}7@Z zE=x=SCG(HFsF0x*7ZsIkLavmD0yb_oWwQhm@2mAVo^-NECBLE!i-z$J8{xyi-^fty9}mcOiMiyHker^D z6dCMJ3Ov{f%Bt(uTUuM2>#MQcpOF+16cMic@wcMialZfl_rItA!2RKmfBfN(;vd+B z6uXm*k<7*`(qg^DTo6V_#iu4lhq)POYN=`xg=OL3;s#%hVbHVXXG=@Z{{ElOx)_;d z=4(abr;(ESAH)!Oxi^>sj7Mxtd`fa`kfZT>qPNV=E$v<0gdXnhd{+d)dl(pxxEq83 z;7~~n^BY}?^%8&%a`-)?6H=2BqkJq(j7+U@3VD6B`bPSDyN`AqIV?J) zeGun@BVAp`j`#GOIC1jC@t#gomOM-|xIGd&;oRzevD;Y^s8NY&iE-f`)~4omj*iX( z0bk(d=j#_7=ojo`Z>_JcfZ1CoqpYN?qN<{zq@ZJ9s3D6%axvE|)=OtD;l4*qLP~Oc zn7geRN(~%gmEvX%A8+^&;h+f#f?Lq0#`pRK6SBW;oCiqa5!bU%tJSo*IfS^w@Grx(4Pv zM@N)Sz@g*e;VI<1Ia%v*Ctd(lN7|roG|~dYgjPm|7Ch87(5}{Q0&jTkh(`(qQXxV9 zUM|)~TCf+jOssiMu5K{c`FuBW#*ha=0ykSDB@P?{Ysz|6+h z-pRqq$<@Wv&)3JF4pI-qStmR+$lKYa$s zgLhuud}mVdVUMGQi^!Sd>gM81yU5{R_BIB}Ecl7nh}T)?jO5zfNM z0Mnw4Vi=SFt_|1=rYO%9MK){-$0!vIZ9_9FYdd&$91-Gh_wWjU_=h9MH9aXh7_MV` zYt!|5&@8autZ7?yxao1+w6=n2XQ-p4t);E}5;8Q+YevTF#H=tjrJ$~+ZDe9%VF_oR z3nX3W;TsTuwAh5S)P(3Dp}UKnm5IKdKFm=ISOchWvW87+ZenVvtE;1}t)-!@tIX+r zF=iazPAMys+PH9>)YwXzT6%`2mM9A1**oGI95`!3!sAj?p>O=$1x~gWM!KqMT3EFf z7M7M)1hAQ@fv%ReF1c+5(IYh_R?kb=aC5Oxp3_Q&uw>*F)pfP?QCkRxxM0wjzsR@* z%w4dLyPKn}nW3(Vs+tCu)dOckYOl+&4M1UnL@FyO);2?ioZN$U%Gn!f|imK~0MA|x9 z>sPs}ql>B2MM;yErn<5s=j4xhF@iEPwulAk5VHjwE=xvPRZ~;jzyMWNE&~6M;6TJF z5E`(zu{H+P9JZ{iiW+EF)6&$`($Um{5YyW7_*-M0Dx6V9(&NFnOvR8Mcg~l7@kqwG&Z*w5x(Mu6HukUB@MEQ6=~%)F2b; z;K4dtU4Gp*sj94#;rs{`+`J?3NQzm9DGj!ozJD@k&(_k?WWA;W;!84epuAO8 zUO_=wMV`aruwL$a=sb#Wpa`)_8J4Q9vArYhz~Wic7F;tUZ8g~glqOeJSxsG8Nd+uX zl2?|4cZkJ)$r$)<$H;C^vyM_S3L1upP0%*-SX^dC`kJb62&uE#962RyaY{;D85uba zcJh~N7-3QLhS!&k?&@qcBMWOAOX=D)!5UJ+py2C~k>x<)kpMOeonNAsBSV*EbKo~d zDI#sIh}DOarID_dy6j;LND-L1=*q!}Un(T@8l#lKz+-GRmZH7|RE>qXsfn?nj*hC# zF?Jhgkj<6-ah$S;QkGN4olKfo%PNYpoU1Qa#tQTAmv3CZPG4h@9~>n1B5|K2?<*l? z_l7i!_2#Wx^iAr92+!NDQrGCK?boR5?bl9Tf6MqQB)f z+zivRBw8L>!Cg&gY^P@*PT4)*-Bkg ztNTQcs8{Ah?_T6X?q~GL9$dcn?l^`UKE}q!TSho2cS4>icMMfe<1J&L2fZpVI|Wu(=9VBiKKPL95+#+-cQn1l@T5o;ExCo!Y9}wlT)*Da&q$vLL>y0 z(K7SN!HMDFp~1o7lPwiF@nOOKeu!(stb-NCZ*y1X^98=q`Sl0;CIF6>sLxCzdzMrw zk~hJL(n8d%NsOnarl-1VHbkP9AC?YwWbALr8#1%9bMm8+kSxXZ;j!_dq2a-v&RrYR zVi0=qg#qX7=>e0E4_xv>H_x!_nteUvw1m_*vZkg)l9nkh!Ge$6DMFrj%3x;ZWNl_d zfFGQl2>KulnU+b=9`9y-}sU%VkP3LzZ?eEfjMQ%DPR5Um&D8iE#i&Vzzh{8He1VMNh2HgV6Jb=u^$Rq;V^d~gOgM@E1=4;> zzFwZlhal$)cXzQ+#a-Z=Qgvt$Q$o_CTO{nM$w_*O4Y;&K7IfjCU@R?Bz!+v0hU;_U z07)h+3O7Rmkxc%!9k})k=^t=&Waek2#75Aenj};UIYOMDNC%lQWI4dPmKOwX5}lmD z-D9F@DF#yViizU_&(u^asZyPpre_Sm=6T71&FS$`k&zLRv8Yzf!JKX0Exs;AwZzT^(J7o~iTzR{=G^(dR2K2n*3V$$Tq2Bawh8#D(ZLZ0q4 zpGD}>5D48Ik-d}EJ}T80(=*T*61G$p*H#=gEuLY`&eHRu1$}AxZ*RlK?5xa;wDipE zoQ;(&-NVx(QmrV(m64o;yT9l#V~9scU=U&BbE${@Labe{oQ|<+u!}W~MJz{F7I_m{ zmy^mT?n$C&Eu@vkq$U`d{0sA=EoC`5*}$5WU9h#eYh-F>T#9lXAuj`Ljz;Mj6i6r? zBu7LN%b70{stTNO(BQlJ=Iuiv@D$NZz{0|ko>n4@ioC(mS$a+Z_ep`axmjG_G%t$^ z1IdBydE#v4oV+c&v2G-DA43@A4UBXU}B#&qWMeK#GL z06`prLqrxEFpGfM9x_i#6BeW;y1)gDr%uh!bnn`foelc(N@_d%C#Po@CSLM0Jt;9h zI-CwQg1&~VNClH9NEC@X<1~lVFW=%LlT!9UKhlzYQ}S5DGg3^g^CqB3T33B)VXm*K zEH5W3E4QFRd}0CvnV*o-q=}Ul3oLPjCXj?ka$o@Mr-gYVSop54IIcOn5G(|~qEr!r zFzF|HN|{U^ZnlCjqIz3A&jxLx1wGVf&kwa!6y)XS=N0ZcI3}5yo0(soGdKjm#3XWY zA58HO!bLhz*4GayI083XsOX9-QILSGL~S~~K;hc}gkj!JNe>dW%-ayQjH1v`sIQM)3@KATNzw0oHf;&Y!i!zfTFk}uvnisA~;3GlD z3Hd`#o_Pn!3X_}0u0|*mOXNT$?kZRS5;>s4*8;>vA3qo7XNC{fmjPL6(;!9y($`iS zhpwM6%^!_iAHC!!_Lp2o|I}Wb3)qK2<{FT#Ji{a zU`y4;^cWBq1RKPOXN*@FI6F0TxUn=p56mlV9m5t6iC@!^GAqo}K^X4C z7NBVewDolDZz|1*fpzTbiG0KaKXW_8UTmDg8p+lMdv0cQ{=)h5^f}J?3zsg^mt-!Z zKJU^c(Pb-Xq1@$55IxM<^h9sR4q(j5$txC*qk0XTT+@<*Rg@#cF#B=O!@%%xU-!YL zvJG)0U)SBSpZQ~si47uKJg>5W)v~v_-i5#Sttc^HuYw-w+EYent3lxxi7+T^b2GDJ z(iyVAO#$R$hv8vRGceHCKRDQb{J@?qSy6$$-fofqi(#%BSy#K=QWu%8T%(Ze!C&iaQ${T74$#}3dH z8$x}3T;dP~zGq}Xd_%T=m4g_QWNP;4b!G(#Ix9%fF+qrCa(;Gd^q8nT2if1S2siD) z#e@@>uIW+f*fA4NMkYt4Gl5%Dhj2XtC^&Yor93{s$2kr`p1Xz?@H`orJ14bGiX`e& zQv=t2b^rdod-w0Z^Dh4Q)vrYF%DwmAukL?Yt|8xP~Ld*ipGVj)RNPUbCwxaWl=+ zVN@haQ4aKp`i%&keJ2l8#QD2PaT%7=%w4@KKI z`8QI(cYA7jysvXtVO9oqrsUKOSz8VP9XLC)iV=$m^EQHYOAm2z2}wU{9MuSKkMG$K z%qM)kXKHOOGLbR06-3t$(-LK}g-EA{%zn$9`MlJGnw>e@eTk$*-JF;j>}oF0&O)Vp za&k&~#zyfNJtaFiIlXF_BCG4k@D!=K99A3xLUQp5e$xF)`%5B)2|#$?+QF8#l(#Uq zaug%z*VUvKobJhY}=gX?ChDYcaZ&bxvQ&Xdmij= zAfuCHlhZa7woj1NIkSq42o077q(-WI>3&upF4%Pj%AteXQ;LA^+elXJ)XXYJ1Ed_4V#Jlj zxEf~wZ~Pt{9PSn6m*MKuPm?n@Y{*EB4`1D8g7RAjAaw*Em^uxyA*K#Jr#d@-@GcO} z)Kui-a*Y%^Nu0<{PRT4kEPBC9MJX>wv9N{*=>b__85qR%F2hPF$UU%S8_4@CJx7$K zl9`6Ep})6>M{ri-@o~|VDw#iWSRz&$=8vA&gl_L3_wV=R=RsOhl0aG_ogkZ-l$>6$ zXAm5n9+6I;EMydFA4ueY3{pBY)H1As0^zP5JEi#Yvob|ldYOm@gar6_1twSQ>mMB_ z#7PflQgcUh4x7&CNYhQ!yB$c%#_9vM)&!Nr#N-WI4vd1E!?;`md71{UO}ee^(EW98PiS#wYhS0O5n8&83^m>8-4774&wkifvm zwSv2)#zzN-=rMYfHHIHX#6wGbwj*tggusg0UAP@-S50jrZk=jqpd01u>#HjYv(lpB za-fiZFB=*W6&)KFPbVs-NbyMphE8C`$BSauMd2)g!zVeu2MHz!O32JNGZGLsK87^_ zjK(7%l3*PlAJ|h5oQpN})w}9z>g#al4{)|L+SOKWChH;`fN+i_3B9o~aq)>sX+fvR zdWgwLO-;rXTd{GmbfhXsB)%p19eo|8nc(C`oKt5e30+VuqwC2&NKishyX)%+!s^

tXHE>MRgsEn8U!^fKjt-{Je*aG8>w)BNpX>g9YRmQl`9l@SW2^nHOLh>=P%$+aBM`l z$eX??d|Tzt zT?Lnb5_fl1Rc^WndiI(XeYLP;M#8 z%}h^>L_P+=$4APqWiOFd1>BCd@W#3G=T47{hq%}?hDSuhT0>neyQ`$rxU;_Y|7Gv3 zBM-)F78_S$Q&y~2tlE81Gx&^!_yDTk?c)+YLDN=hgvrK774 z#b?Seq0ARps}d69j4dsoGE7YjwNVG`j3lZg?$}0c5&U82QZ%peA}u)XXBQWvsCp_W zjE$w@W)d=E<05^W9nAlQN!c>3EUfVpqe(gJ18*H{%?))lHBssu1ub|w&=_=DDihFH z6KiM;b5m1e14uQ|zi`~)&}HlPMIpQxV;*Q>Zf<@$9k+`86Ljyx&kYizPW=ff?0k(1%3$-o&I8(Sz5#0Y&0GgR;ZqLHDVItKID!M$6zpf2NvxjaN{(C%jy zQ2Am7xmRPzf`u_k{M zGx0Mv!k6V}Z}%6Zg(YPrg3$pg5GZ>=M@Lj(vt!x*;DC48T3c9JnxH(Mp~*#p7^)2@ zBl2ZvXrQZg`GWkZLqBdu3c>e(MqvXnJvS#WFE=+MHZq21m|_DJ=;~x|_b*7=iqF!D z26M%1?d=^2l_-To+0Vmdadxn^v9hoxjJ%xetel){aS_pU)O74Ef;=dD4BKBMvaEz5IpCqS4P__nfLCZ&SrLK;ax}yBKQwI<*;b>JQ}rk>>aE@q6y{-4=`BG5M}8o{aJc?2o2TJ z(oj-3FDtcs)8_Tlc{I)iViFMH@j+*nFyMvyd$7PO%0bN0$`R9J#KO+ThO!a@pp6Zh zq&ci6kQ`SxocqFlqgZHT;b3oPZADo5CtKC8=<8Dkv-S1hFxAr5QdhZfUiS3CEn7Cu z;DJI`#}YHy*Z9(+sj%5WKJKXSLprHAIa@oTg2^4IIeQ8dfDaE2VouH|63B7&@Nh** z!L4i*8FX=Ww6(KF={+NTqY1WxN_oWEQg;h zH99od4>f{ZNP8Dl8>DQUfcb{Tlz?uvqHT}ZL25`{Law{Fmm8PM;c&S$1=ivX1XJ&d zJh8+BRrGaqbaiz=o`$9dYBH)oeq^O~ZQL}Im+x^A25UULM#OP+H8RlKjl*(5eM4Lf zB-pu-kko4?PPisS)fQ_qs0Sv;-OJn417#CA;4Xz)i1tuEJVND*02-j8r=vq@%~sb? zSJy<-8x>_z`R>Gzn>J4*nZVUDg2Or-pQa=wg!#C0SR59c&80l1xVv&4C=!4A8`sJS zbvmU8B;hQJq+EHEMi<^5?(VK^HjUA@wY0W0!Nim!lm;lHqNRp9Qr6T}VaH>KgveIe zQxaP?PbA6^(CFlpv{Y;XVgfx;Lz%Tk)#%^a)bVQJ^ zr-!GPmyfS6+mGLu>-v#~c?+l0AFp4(;=J~FGp~T-;RcSgP!$x6G}P0VD*yrvD_T=P zLtRZ>l~S3igk3l!=FIW^TPFbcKacnMkaj&$(P06;K3?8Fw67R~UVZ)j{M_6=p|&#L z$IpS|JHCwn>PfE7;ZT?e)+U(YXA8&Qjr(5GQYW&grV5wwWo2@G1vy!nlM>q(hLQCi zk-U9Ak??f!h4^s1r}&Vfp#gyb{=SZP#=nG*FMzLa z8+_NV(~XSltQ&$iTUy{Mq*??U{5c?kVoi0y(qM-=nz~ww0cB2?IqI`DQT39HxuU}P z^KvL@d1Tk3a6$sk;ro4Yet?2!ew3#u83b?C^YZnj{ig&3_`12WF{Pcbe}IIG@>X*P z>@(REO|jN&%B{ zCM&un%0238K~+GWRg`I!S*mK_<|TA;!j>LK=2H6?^9(@92YN4knS3!47HBT>=_be}Ts&RKi2{b2Eyfrt2g{z~bMyc`< zz}d>ms>%>+cz;M4;!`Ii4@@8;p`*_$7@^ex9voL!n#=F%?%_duGST^l@}~p%{k*;0 zDK3)@WzQAFEuqdE<;nE&^5A&R@_@v+IN1<86Gb+()S!}7E>p^L;77Sk9L(_Bq1fu_ zlgA|wF5!`fV39u0K#<|ZMJW#GC$1|(fZQ-8y;wftzJ7$O-X5-~HOpZ`_p;oC@FHIJ zpxozy|KJC7qcf~`QclfKTSHk%Ss4)&093jJfl(j_kus-I1X=RH1Rz2xdfjnRA6JUS z01cC%S_z`7D^w8WEe1%8qpznMG&6@{3v<9%a#NHW<;vjFuA+F(qIkwTWhA7lse*H4 zMb4!eii&W%;^_F)$x|n!kL{aaB~qSx-Tb`0pegy94ug-L|RERAylM; zya0hqR#2=#G>64yaM;{UxHJ5Zv%Mu~GlV&d69A=)7ZrJ*#H&mM<*Wgl>5LVPa^`n&p<#UpLk=OTgg(kk5W?b)SSuC-*XDDgJYk&7bap|FV+)vg z1_oN#3tq(DOo6^2pm0H67MpmnQzx*2KeTHC1!+6ow3i!&!npQWr<{082U*Q1mI#{+ z9RvbGKMiAuLcY)+u(j|eXINe^zXV)dh(X~j?qCCB&p=-rWr-DdPI;ER`1!MEWw4z_ zQRyQRyBG0jLIzBiiyQ3-o5C7vu_Fv}T#j;P;A(;_E+LF|6NNxP63D_#IS9jChtcln z#ByOd&A~rlE9PKlMN|seR4QCNFLz#^EyqM7Jo>cA3F)H}`&Y&ieS*=t?Z|Slv!*Qh zNo{G`j?dnKcAO7e1U3#v2+K7F4%HGN<4)*RXwSA2!|lM%!?(RX$8NH{J-i}@`npIL zk-tF8iNX<&?IwH#XDL|`)QvrQ_y=AnmJsULSv%TT)8_odg+p2M!>BmPQ2vwilHiy~ZIPw+yVzup2bNm$9iiHWI{7 zg}Vg_c4(95G6mi~%yo&ZP?l5hc1v> z@NC17J8}5PUS2^S3|EV;8Hy;fuJ9XOF*0GB@tIq)tmfJgL*Io3iYO;1-lA@1ZjLWc zGXb(=w4lrxW|X;@nVGSH)@6AjaqQF6WzL<)Srn$Q%!y+XM<&>YC9+w|$be zHD$~-!ZX@P_==&v_GS4qr>K(*qzcS9Eh~qE3iyN1oPt~Ij5IGa4hT08qM=9W@*}BB zkA(+)1NcQJp;|mPt;CEc;y2j}TV`y%a7mcXlmYt+*O2duA$?^swtEKpTFU3ooP-yT zI>CP$PJ2pr^4T-z&J!=uMLAxe8iBd2=c>ciX2SJA8w!wShUP4*$rw>{$N~0n*u+uV zln$S+fvX_^48=)}Y+WrCdDN(umWIDohI4k3oWiBcME#umEBx&`sjsc2MQJm%SekrV zsGA_F%}X28GrVGotq%s&%;d@ySSQ$BXb?k~(&E$Bq4fC3Mu*a45#Ca|f;s?_InI(2 zKrEUJobv*57a_KkyugLCCA`xBB+Mzo#$;)@s!zssG&D7}baatyW<+7o8Q7SlDYQ)~w)}c`)oT1Iq zV!#AjOpxGIl_ab?dFu2z=xVG8XAs7Ef`=puBzXig%D4Okg-c_B?i`f0gQ#V4o7<~xT3BB2;zK$k$X{532U^9sv4~h z^6|~5s=`thP?9@-0iOcG93R9MF#ou*C-frU~$Q9#Z`{wcM~msuzs&!?zJU8EEz z5x*J<0#yZfXiZ9kPaU?+WM0%7&g}4c;UaZOP>E0l6Ppi2s!V}hpoIUqi1ay$LkK1n zKnWPAn3H0V!ILL3Xw`%wglfm_)KpZuL;;EK!bR={_C)~zX=t$2XAPD)J1-BGZZKX_4qd-tkMc+q$KErqK6J0lRkYKA(zK#DPgei#2McBptM)4u!<6< z5PgACaFwSNs0(~b%3O>Ub(yJr2?qs}rwJ z5H;iB>^>$*9it@$PRj6ta3_BpPiA~~0q5NSxIino$%~TNszf$3YP2d#SqLs&*th36 zvV3y#tP9jdt|IH=bm(#ELkDr){Ss0<7y40-q~Ni$$51iZYkWGXp2a_9GfK2T8sK|A za)>J-1lK=A<2dIe>x2k#x+Cu7palD%@I*1NJN=8fyusYZe8 zH=1tTpsu~4<9{z^yrs|kMFjYq@q?cLX|>;LxO{X=wLolba+ZgcuY#s zt+8JoJ$d}(2{JAPA3uJCFZwYPf1n?)euD0zPo6w|G}4rv5QWHf)G|&?PDMmbUU7L< zO-)sCc^cZN01#ms+F|wm1H8}vzUFjSBehG|3ZNA)iik)_)5mFP@#Ck@tJ_3XcJ`8< zrUU&W!}O5wz#uB0qYgPW#6OH8;;f-%s7u~k7ips^Co7MsrmUu=Z)j|3>%=1d3r~Z; zlwFrg^L_mP%#q>lssyg(6}X@@u*7re(nT0i)ZjwEG2)B`-V6S?=bCgtX?{6)Qa)o!8C{W^@P`W_LG0t=4=3G!Q z4Jf-kh*q!sGc(kX;*8wUeG=;N-j7oitGM~<~qtZg1!Z; zktGCuc&s`JUD3Mv+HH+zT1hR4Q+hjCvcV_@M3dIt~|0>cfR0Ty8JS`uB%VLBL_T39)- z+&sMf1B0Vex`^aqgq~fm$&dA-94yVv;pIV33a}394FSg(BKn*t7B2;D*P@;wP{WU_ z;(;1*oq)gqjR>Ow0^ug%9tL5cJjmXXGM{Gg=P(6?#AKH9qK=k5dzts>gs4iTTiib z;d=V`1w~z}Z5<+HZN?tOg-c^6N_K|Csv)j9!alfhCd{NWI388B$?O^$9U0^G7Qn!G zjAFQeO9&dGMivv98Xg_%D+}W|!>wuW#PR@2WLi~c_XvSmj2(j$7aMxwNG1mWx|j-p zxeOS%4ybdpupyK=tHdhrBR7vrVc1Fk1;&UUpa@C4CKasFIYZ4?eYrIDN-i7^zku-6 z^0vW#9>zj!fSkE3(1HUTb2Bq^iGUq~wjnqlJ5R}p!QR7Kd{)V$9(OD@O!^p*+b6@p zn@Zpyk#9oP7;AJMo_6JjVxJCYfty!ANMhNo{;>fb5~4rBG=c+CAN(S-n6%wkfEUL``>Nssz2Smz_4EsgD{Sc- z{x>XVc>0{swb&feK#u%$HDU2!8%?0jkXA$|&!`5rkPC{Ak?9RELW=9CzzCR#b`T66 zCs{nGJEOx*siFQp-kzSmK~Y&ZdN3LKhj}6nvH<1cWD5oos&IG&Ed+N9$bx%-k`W=M zntE6pX`}&#FzN<^1c;J=xbYGFKw;X>8@n?y+L03#8~_hNNK{5`_aK^FOpFmcQQ#aL zaM)x~X5!dK!wshkS2z4)#3&;W(x+rJquYlu1_EOcIA}JadsrZ7+9-KWqz<~3$OK{D z$k?6Hk)De9(7?ce;K<~P+YtJZ(TRaVjCD7K+WK(nkfSFf5Tp-hk`@}9!$}G65xRm) zpOn#xyN%JIKokbV6+jF;A(NMlKcKJn{E<;$3^b-jg$4(P$K^ElLl`lEdBU)faE(J; z&X#88rhov3J~^dOA$bpQs+@u6;kb-e{B53OQzPye79w^mz|hdFJRz7tbnVFKP)lxH zR9IM4QbjkY8y5JJ4&E#!eoH&+iRlA>0MCwBQ^9_gcsJk&lRgbP2nJZ>3j&xBgo*JW zdUb5<4o{np4YwC2#YRNNW?siM5CS(RMh1l@dO7a!qkvh^I>ttn;amfSSBB~7XJ38VG5-{qVQF@FI@-{XPOu93AyXFlo8i`F`#vkP5UQ5546yZsuT?e+t;1iKxVuZpEj*Xd=)JgUDZXzLM zI=W)Q5Iii@M0)wg$g%)QzytZ7jJvP979SOzRMtyGToBCS&6EvT3~t_PzS-1Jo*u#_ z^To{62umDKkRe$-B*_!1(Vc`C8gj&d0OQ|@@UlnwiO6CxonRX^I%~MME+Z~F=4w?R zNF}l{z=K&2pLKVC58D3SZZ3}ZrR@>DVrFcpM=TIU9zoJlQj*e&A()UD3pNCc(8WQ= zoiPZrAkk%*VRG`AMuS@dM8ZJSoRN`%_TuE|=$OJ2l2Xfrc`FuZC!%`-T<|^t3l*2C?iQ z*+zPrXat7Ye@f~If^kmhXAhFej)~41nM^b>I{1(=7{drLV9N1yCvQQ(TH959H6|i5 zF1>-Y`GL^f8Jy4ofFhI*k<}O$XLoa1EY}VjZbNPLOPHWY-y)GQ(#qjoM1etB4r9E8 z2w?z&Kw#L$d`IU(-fk7dM}pcPTaF4prym$XT>mJ{I0M5sS2HFc_kc=7{o_d`yl?eC*NjT4ZHH^uze0T_oVgOx& z`nwyh`q-Obc~d@_GX9(CUTlygjw&Z&fQaag-D>_6i9N_`jLdW}r?)XJ$UiVBIP@x* zMW)%GH2ig8p<&qkLjwc!;PURq3?CZKZ1@dZ>>WQEUj{Lb2BV_i~0BcRbAIpbnKqs`Os!0n1yZ#Rl7;29WQ*3UCJhempNV2FNtH3*IY3~&UB8kjyb*xOSd zVxsjI*j`kQ7CNjP(Sf&7LyQr6fB}JEVw|V}0dk8&Sf7UaZ?(T?0TB~@u={3qh=(i1 znda&llHY@Y#^+EkZ-O8w;ME|{s>3i3_JeU~%LGFEJFnU6UeM-|C$WDowR_6G;|A$H z#HIxchKJcBB0MdCo5j=@f_}N%T90$XNx$IF1D%y|KJYQ)ER5@$)=roQ9#8NSQR6QM z#>gGu-a#HUID-t>P=A%Tu_9q-$36svQF{gVA3kSaH0X+n!30U{kriYUhlx3Kzo8u` zu;bw6P|uBwU{3(iEEd}%rXKJ8*GfQC8X0VQn2CX-23DgF7-8s8TfEg}J>Yao97QJH zf&B*#96Qgd!ETL+0a@D7iHm4A22?0}WWne_$?t%BFf`oPSr+5#0k1EP8`#{Sk^vUp z`!D_ZiUV%(O2i{1GwEfQwjeG2x>aY?Bo5=T#5_PY)oVtTTM#mE+c=uZ&F z8CiL!;vP9$9_sI@PYw2T;}9r{!|}=NBI@Wbg8-Dh>c`!ZQO1zg0@OHxq6#yv~ z$33AL${D=u;|U3mmxF{kqL9k|e)2s)^)DIdA8ar1V3QaJTYDS`n&>K_Mv;uHLF7%c z!KVgAh`11Y9@v7Q7~s_K$~%<<0KM1VTomh1_z6fHg|J=2Dlt6R;Z8^?w{SSYhEotiZ{>ZY(=915GspR(eYxH7HCJ13vL?2EJz! z1`mvu_5rU1?h%CQxVUhgCcCh_GH!v4KPTNDK=l#LFd>~hHbb}b^jUvp4A6dwgb5vj zI#lSq<>qXK6A~S}(9-tqem1l;AK(V35RUZr<=#dV{52YzuQ@mcbHr(nqZ1A*I3dNI zLj!-p@hGE*m_VZknV1-?p=m^$4b{d0>S1&=4%exOEjVEh_H}bKzoMgUNXO>a-s}$NXXj+4MftF8 zP4v`N)O9VL-F!o$laM`;6dxTP?C<4mT7}?^L~9qykpY%c4$}}3MS4cq*t;g)?BsbL zfcINpe;&QU3oB+TOqi88)$4zZSqikMi^UFR=0&;!8u?LP4 zus-0mWr4n@+4%(pg{8$MW#yGsHPw|BWkrSANg-StBW(>0T_Y27a+-x$HL?z{-L6zl zfH^vH90YI(WdkTt7?`G(oVeQr4e__=<42|))F*j>*OKm^M3%mxR)Y5|pDNu_R#8@7 zURhm(Dkas`Xpone0zeaea-w1aH9)Qpaffkq{9ydVBk+zS-~w_jlK%5+c#- zuc8u|;3ZuxQBzY}S65SXev%6Ev?BIay|U4YB3*j5LJQo0VmaVpb;(> zW5l>1W=mP^9J=>;jbm5&idZ*20PE=nZci^zaSwgHeeIQm%;zPg=+3gYvb1r8gU>fG zJSHJID}dx?-ME&6lD zogFvJ(g|QeSy>6jupDfqP&nrRSXy6Kk(Y}5_w_~y1`aZ*#bC4^H!KLq;w21dlEW}xw6L2+qS96@X^tt>At%*#qkj0kXd zw!A{NujJH8Ug0o0X!D4~!bIj_PdD8~-=@1}ba%BkT`%T|Oi4vqDY9TI*p-K>s_X0O zYU>(m%5qZBATl;F2`O5cP(bO90zlK4V*zC{^N}7#K{cE zd)Y@O{XlnD7n@*pcHM5d-ca%{Fidy~#7#$s&iaOi`ufKD%7S#H|D|S8*&DO63kvc8 zSWr+B)ke5kR9aGk&YxgtLZ~+j>Q)V|KUugk_n^nK*Z5>;nI4`#>*=_Co7G9*p4oZ3 zy}7Zzm@E*_ip$adk_X7dG^FZQ){|bJjnze&C>D}kRE$q3)x6vs@UtYM6@aaUWmL&r zWGZB5q{fGOyI33H@ciuQ(um3!J7;%vw0E?3cD6Lt*A?+F3(HDN z%Q)qXDysHiT^%|yUT>%^&CATnEiQ)!Dk~{2%qO|;nFXP@fY+Q;gg@lvWg|~BB__zj z$xL7E0*XEyliZ4C-CpCX;05U!=<5OA?e?|~^f_&BZ)`6rE2^RAD$oS9I4_&Z5X%iFbE4^5PHqmJH478tYEopNyMwWg3dv?T zyeW)u zZfCSn?bAA1n;Ndy*H6s8!qO5}=~f6RnFzJ@;3XM82u%aXgyhs#mKGNk@qQ|lgrRsFRllLGwyL}Y z&AGEC(pwu+5$c_eh-9R{CLz@;Haq}TA5>(dj!pn#!ar~8>g?+5=;&;tnuSrX>qaBQ zj;dWyQ&)ZsB>q}mOAs*)A){Ceu_)D2bxiPps^f>osi$kjYbwi23vy6WhNrgck~66E zxdbs8$%05(j|lW)JLsM}E;%ubGl6-llgxwm&eo=;n>TJ?GEg-O&}A2xWEg*|uB(AP zL3#~CRPjmG2mrUSktW5?@Lus+bjK~q%S_MkC4y5Of0as^o0N<+P2eG!JTlbB)!F3Y zi9Zp+)@RLatyJ5j*7mj=*Ka`9Yig_6H6pb0+ULQfgvqVB$Y*YQ1%xoIqydVkZy;4smFu8sigGj4GJS|?Umcf(jHK8& zq<2I`Mn;5%hJ^(Buxzx>NNwg#L->rIHr=9Hra)qDUWc%NHW&|d-PGFJQYh{(mYF%sM(YE;fcB28V_O2l#Sq z_2r}|^csS(pEQue`Hr{dpGx1S1e|u?|Un%sj7|Dm1U(R#YOqo0K+3JA}%Hltc;E#goOqn zo;SeHowC$AyOXyJVgP?BuczvSp!tdXajQfi29-QHVWA)&{BZn#fGDbBF6{b}qT;;t zlvKAHNWUx(jfp1J6Hr$`ARIvp0hFI8k}GWW=hp!kdOGLo+bq>YdNkrqKmQPHy^5ek7(2=Mjx@pfa`8YoU&6O-we zQevSpVg1t;{7?-QRQarm%8K&p!ouOPJ8-3w6CrYNLle*Xov}OA*lzsw&PWZcO~M;+ zr>HO&byX6Bin=qy;g?1@c~nePcxYHKOj>WGM7Xl-u3X-eLWUlQKbH^-j#17kW0sbn z^am5S%_`@sDCZRN7og=eJ72UQADMJTg$0F0bRj5T{v4+%l1Z#;l7ADqXMNKboH?L)j8gjlP8%EkScz+9p883pWoCiaU| z5u=bUnnfrofYnC6c;9*Wg(?sOMc^vlmk+dcxx~yN6(UmOqa#s}J0utlxWht1g8dQr zj#z5qWpp&tKFq^|6Z3vHs4C2(b7zu_vFx0@9GHeM4)e*?3#kGo_(kQ2=3S^F*^2n=SM1EY$U}sKChpz#7{&C?!fkBAv_n~}eBEbOS0gB)YbFea0-p^wr zNfAZLT_(yQQR$2fPC6@tlz8HY2P22d<|kF$*ctq!79Tf*FP&F>Ck^kJlAfB9gyfvK zaLgt@U#^$9J0j0%lIUY+uBWt*M+yY+E^1!EFTyJmL`wOfrUNUDiL22Wf~1&EHu%qX zEuEbvND3yAk|bF{ZL)46mYgG^rN z&^t+})K#@KxuX9alKvsC}-s#VM9T!G&mI*~HMX!ZElI@}Lrs zRi88oMBq-a2*gB3b7Lms;1W;BTVX6vv8(aF_$4AN(9@OV!61GgL?H^?-J2v%ab1v8 zfex~~80Ep>Xl@h}3X+au;5SAL70Uz?E1n zZ>GHiTuCf9PckCVp;mBn{EL)+pU|LS4x$4Ef)FGa%tnZyXbAK?ZWLcs2!AlvVJesz z6dX+Bkrl)TjTIB3?peyPKzJy&%pl)`T2Rdxj2xVQ5$=bUN}7r;xqk!|ed?;@bm=qXKq*c)#OsvF| z7oVpm?Zxn9dr_X#ynu|`Wjhm(mW8z)<-qUgNF&XP<_K~*u76#=i}G@FXSwkM)s5rM z@8Rz0O?wHDTo?~LMdB9HR48{Q?urGsF58{Y&5iO{>_$6SB6q+7S)Ukk7ot=!2U%<+ z@OG1Nz;JgtBmK!ufD3(q1V(;5a40UHs~hdg=SG-_wVZYn0HsJEB6ozGEjN~{0CJk} zFRqhuJBamyXVTcj+=8+ag=-o4OQb9_i)Qjd05JgV4z4T?A4xg^FbgQii2@iO`N3lI zLC{$Y3>>~m&J;(Gjr(LH$8A1t73&h2;x5(*!#6TDHAjU5N9cLlQH11oJ5xN5I6}nB z%n(|}q-e^`g+b9Sd{EK2923-XXyJ)NCFDLi3*ydjpheUCB%7F`8Bl@Zc)z0+(umP{ z2QiFD9Y?_oJIYoVv&4>rQ$GkSVw2@OohgO?y;fkV0QLv6UQodvP@SsLn6db14-O|400xV4QHNx!$XwRY!4WFlNUW;&Zf zViE1YKy47Fy@Nf+fzQ#A?IZv^M@OU{Ir2F;vh4-PX$S5QPu!gtc)Jjs=w^CIO3)V3 zGlBaT(Qb$m6M?u|*iA&RBHlcOvCW>vJ5XT2@s9h%*%0!I+?)iF42;Zt+EI|Cgdq6` zX|sT(90Uk0fMq*Q!?BL7Ib7IUnwt6+)|O@zsr`T?7eO;8t7@VFQSKa}+q0$AwQv_q z9da*BEp07VZ3fEVFm&8?`4I7{&8MZ!(W3D;mNrXgp0>7*4!&_srE_OapFDp0f*K-B zr6TX$^U+t}?vZH#vRHs&qjst{>uZNrWi z8(z9qq^-9fp%^c)_vDozr$7Dt`9EW|Eq5CkG8hsfjBg*`IPi@F|KH#MQ{W%?KpU99 z|KLMwk$>WYpYLx`_?V2Md<Ks^nY#q zZ~XtKmjA!k|6g1GeQo*sNBuAVwg2U3d~Nyv+W24F{`=bF|8?bGfT4mcnt$lyZ~Q+3 z47G3g{}B73|NqPX`VaH}8~%Uz|Gx46AD#c-+iSq_up0@2IJfM^KJe4w*GuufBq2;d|QA2|GxhI z*ZJQ+y#9Q{|GM_i*XIA<%s;AF)gAe10{|V1PJ_2|AJxb&L z&p$qY7=O62lxIr`7p+r4E0Xb*!~}XeEun9&fmf_kblNl zFNt1D|I3df`^6Z{|Ij`E+KBvZUfRE2{eSBh{{Kil`uFQH`Tyr1|B-n0@95ut|HgrD z9QbEBps%@QH-k|^bi!nVv&)uE5pxs6@3V9)?Mw|!w=N@h^XKCkJnG@;9DO}4bFyOa zz6FGZ$$J>nG)=CUPfTucJYAuQZi;ZLkPkkrZhyWTs+U0VG$1agIeunbma%o>O%sXs(vdzYP1w>Yb9zDz;e+(O^Pc-aq|_H5a* z>4))ijLE#~2nq-=_{J|YW=cp%OP~GsuW@C@EWW?}EAwyv%KzVg^=A-vF^cK{5p;(o zKGiPxw;f_5#vH?5*CQ803bt-r5pU{U@q{&_TH$A#5dDfpYPsE;5_IR!`X%JcPe+_T zwwgtI&%HjYJml20dB00c6;r*#5}E3nYS~IRd{Rx}sPvW%>1}S_`0~JS1|=(n_HL0^ z-8NnPo{!D}jjr#PKjAC8>-zAvYR7ZQCtEf=Jjvb=QNGW@ZwI*%T;o>5By}U7HE}1M z=_B;C#fj|Ij%!ZUEK-eCYAqh!6kKeRlNbHJIy?nXUz(TTJfH_ z%H}WPgTCPUzU+qgTCQJS#Dh_$PKfhd>pyk|)^={%Hnm~f zikIT4Q=4r}O|;{_6#MeuiCq0YzN7WQ4vU4=Mf=XXmi~Hmbn-e?zn&t+*Z`H@(of09 z){oTRSh%k{?&`YyFPEjVeU#S5&iDJ`-%)wrnUVDQS!Q+)d4gO+~dd=I6!&9e36^xpq+H%O}{MJwyxbhG@o9SUc{ zmCk64eb)Z{fS^V#F1^LdHtKY4>^d@ZimZpw{0-xubExL2~#%*ue-9=jl zZl`-NqF z>orbfcHTKZf9YcJHtUe}vR9YcvLtUWDS5bQW08%ABWu7VtM$WdJ%uX{i%0ql0wqnV z#5`n=EF9mY{@SIZ_77*_+wT@LR7cX1)g8hO)=P!v>ghPFt9@fyHe>OlhSwox!2ePa#?2Tc!O?qK=jB za!)Q=VZ>Mdu}kXmtMD1d>kf~~OI_A3ebXLt=Gr`~H(^cbe zZ^^RTmdE6BO6#^3O^RLBO<{o%In9jwKdK06||-K4(`HFB}%P%?jn1KZ%G|tA2iu-96>QM z&0?1yFpt{)=;rffRD}Qf*^2pB*Idoa(O|kaN`7hCC3so?iOeLg>&g7m8foTl3DZGql~1s zH;br8bAOVVafiPo!boMab;^{32|5e6&vZT|bJXTuYr_aDeDqM|JsE%TOSbB}EYqU? z7#JCAJz6#6)A`AzyM!)0Z)mJpwr5^s?DOTzg(HeJIDE^b%`$;nQgCWur4B-@G~#GJW;3^QTW~A6wkkFLL$B zy7!;gxr+rV>7Uxa=slmgXU$ySJMqtcXQgdVvivMiv#34e!LE^-H9x57yH~Gy@wlw? z!>xzO3Pa`73z7yxVkT>pUA|%6()wy<<$&uXHr+;kv<)!5wV(y#11Ao%vXxo^(P2;SfI!@h08 zw~YcD&RIWMZ<}bMQ}6+6_^Bi5?l{O$PZlJaP=?DH!#*WA0Ld}8{;4bQnt zwvAeT?$UoJHZJ^}nlP z?(9jPUb9`Tp!v$BOW`wY9ZWW@*=%v=;|7=g=dR~;PF?bLt68*$8T;v;GiwVf_V@0Q zqCYQ=cH3daJ$qH_$PNdkpS3T3dOmozVuzjEvbA+vMdObrHI4`d>R3!qcoC)GpgQ^W z45ee=v1C4MEswMn7`x0_yKJ+iSvEJ~>~Ph~OL2qqeM536yGKWB&hM8tE^hX*8P(_( z?x?>O$5o$JoE+I{a^tg1S+wFwrM&{$kJcBB@h|UMwPWSJmWPJT^(Ioy?RN(%64tw| z`JiNWHsa2Kp@(Lnodw5CVxMq3ENd>`z4^U#gqdyC!3IozAh^8*{R~+Vs2**OnufC zx6MfUK07zyl}FjkO<~#dx9(|E|L&)ESsIS9Bg;Km2RCOd@tgYPj}1q?1-|e7;exNB zvRkj1`tFv)1~(kbjPja$l)4`Fn-v7S+V|M3b=r(a`K!fD+bVusfBL@4&vBY!b4K>u ztqxegPQI^uT3muPZ&7%_iGz=Qcg|%b#YLM~u?FULe5tya*OfOqR`vYnSetEr8#efx z`|7Rz)$5{({aWg7sHU%T*`Bu!!pi5aw7WbJiG8A@a=s{eeWXp*yU(kRJvlnqlIk$8 zcBP^5a&wW^ykXkqd5j!4@SgnWlm*S(1iHh`S8OSDe%A2IC(#pI7A&r2rt0pLb7h>r zX*(3v+|kixG~%Q%X)xAGZY?WfaJO}Kl_DZvAuY^g~%b< z`CsO3YaHDisQb{Pf2{s`m9O=U8Co{Ut9NW2@n88)^Yibr+vhHR*Sq&hWNOY#I$73A z_dCio@ZrE*?ed4RMtzDiRH9vC{)qX4m9xuPy1=GVMdn4|q{o0?J5bZPE$endX{xVn6=IXq2fmv}2tHdYEi~A;>TzR-DK2w1j zt6rM@U?e@;Z*v&E*>!)6=Y@KKE2baDB__T9qVYYmZ(6tiNzX(pClyZO)Zk4CyHw}T z$yJ&3lj+^nuh-u1N?#$*7brVRxbjE2h+VzhAD>+ilz8?%omtb-V7umCe&GmlFO~edP~+vUL*ToiDQ9ujK!&>x%Nz&JQ)g z9!}ONLLbxS74_9J4#_YwE-VqHmYDpc5Thb3@#w0Nw&CmA`}Os!1Pa+p4-Ai#nU2jE zS$W`;{gHfC`#oASPH5A=<=OxK$H7nW3!*!A1uR*8KS}+O#P6T0rA+P2IEftd#;Wy*Z=QCj z_|ujd#=d;#?MBTOZ!mf8Hu_ zZJ@c~%|5R`&dxgM^59j1L!kP-%4OW9^Dj-Gen0)xoH(}Gw4LY}kpPL@j+NzjJ&D^_L zWbw55?e(H3fo~^ITiu<#I?Vb9fR(vn?z+v;Tt&Vv@ zsZ(Ab&d@*u(YtPJ@0xT;vzCv`4u5I$nd_(0qo^$$`E-7r@L<2(Xu|a9BTBPdlzeyD zSr^J)v~w@@uev7r$mE{Vk%N(Iw!YmV`}XPKhA6GcX-P^(9=SV(<_q5u8#{K)W@K%Y z%A75QI~CQAN6i?VHT_Hi>+`zSBN|+<`2)un#H2d)y>~ob{elx>lq~8O)|;+ll5o_^ z%IPNqZo>7s+y^>#m6`MA`zPpqQrkT%!ECQgsOU4RJ$YV_9{kc}aLRwiSV8Kp&(x++ zmotvZlE%Njc(El=q-T43j+Nu9oL_I3wWU{vR4cVz{vcc*`2FkSLEGn!>i^EQ7Qe%O ztDS#eGR$q#5j7nx#eH8~4Iae_*I56d9x!{zcK&*W?N@t^%RM`Os98#_AK&^=_e|R2 z#CMj%y;_M?yXeE;E$s_S8FMIIP-*;K=2K2k==#J%K1Ov<>c7kUwf9lnnwcf}`r6Z1 zZT8J+HL16-E4wxKPMi)owzxOoLD8PtX1NUhUK6H)QK zpHFPt{Qk{~wO7ST4Ia+FC-GjdW=-mLiTt*o54gSA?*Bk@k)h*yxwwzh4teLb8ASfj zVrduo+4EGIQqzIj0LdrwW=-)uB$;^IZHlvLy}|CO2U{%jo5~hQF1@=zGVK0$ze;Q| zi84A8#cDV^)}R}^%Uha%ir|e+sCT+*npW^HTBW(ALVtY6$sfu1oF#p9vT(Ca1JmuK ziGWICyiel2Ggb5SBu+R4Zo49?ce!-tz4V>EO|N%01t?TMdi~?3yy|n*%9+d|xl8Pe zUVG<1Y5S?P@#37z%;1=XTA~u{&r>;P-p*sckg;F#OnS@qN;{EtFPmqau}z;oPj-2Z z=kS~5gFea0odf<#9S!mG-x+5f7%eIFx$HP!g4xsis_I=v!*cbVkJ>E5LIxx>mlmkx zIGkxKa!4J*20cdD|N9 z635)7!g`>2-DuUeHzC@q#M5ps>-1(kU;opNAKKgE_U!uj?vHo!+_~Y|@2AOz|N8X% z4dLNgr&UXRuAC?mQQdpuh|Sp}uYocCF4(s3rbPVCnzf@1_e(S1-t%_2wMZ=PJd=4x9>K zoGJfkfkpkTZkN^W%mO3YsX;qr@~KYY<$g)deW!!J*edK-e=hs!)XGc#;>#P(?>MKr z)@aTT_1A|RVhS&;U3=r2nmK<&cYyxq0^xwi_b7`q;pG|~eR;+!^q!ZN1(a^HIo{lK z@X*tA!{Rk!`%{~y8(CN{)xl5O*-Wl_x23kug3-I}Qwx1%D|hg}{={W_>BiolYwmnA+GDgncEL0M zjhowVtZ}e(iz+izd}r+Sp?lkDOUJS$8#m8hIJO~_KJ{DYz^r$^zlYRGw#<)udpi43 z;rV^;Ba$go8Y^9wLZRN<)9~@-3rX{gM>(_h&!yGgD$Kc3=Q8J@(CL$(oAU2z-wrnQ zy~JvoJc-TOy3eg~x~tLgyPF4|PgHJOC z-$LCl?Boe6FqP` z>EjPM$M}A-_THT^z&$%<*?fQRm4p3{qs%3|1!@|rU-z3Ssy>~T(0e~I-NtL-OZ(MH zPu^W0zp|jqRhnUM6V$nBbz0~A1pym&hUSiJNp0*Z2|E||T-J+@E=NJE?Maoh?e;LgT` zpOWQ^^Paf}H2Jd^ZY-@k$U42dK=$rJ#eKj3v`?vQi_Y^kM~V-y!-N~< z$E;?xz|xKehllsd#6Ma)-b-F9Z#uML;Bi#v=NU^=-KMVIV?3>_bCKHf>BG)#2XAip zgTLp{Au-0ab9_?b!Pm14Zu$5vNL*0jza{hWChDw);+1HHYio`FxDhs(krp9xIDSE- zm`l*ryvlp72NyYvi)5_+#Z5Z4G>61Lf2Y`83_0C%rr-=0HSH%0Zz$cP;iQb;>>3Y_;7}Vt1I)gYAijHzj$^ zZ*JXeVH5VH)O-WWnx(a!8`mSnZt^U=bxmdZdcBjcR@P?;W#q;Ex?6qmnpJzni!&ch zo~2&nv^u);sq@R%rSKtC$sDlyC^CMGnsI_X`Hp;3`_pQ@EoNDfmEIaZOPz6;S-NNc zi6N`sZ%nb9VKr|_@uh2nyMO$oaj$vH^33=1{vQBUK&rnz9)Ra9)2T!I#@?Md**H-b zAU^cI_sr_+7WZEvfPYc$>gLLf%cZkb%o+Wq$wh@J;4Az2r539evs&Ko@gbExM$`Jl z6p8YtSO)bKN}`c;`LeDG`ZI&DA{)Qy^8_NLBT62i{Fe}Q5gA%O$&Ac+2bOv-5m8z2 zWL*N%`%DKNht?ViO>o!Lq3+T*%gqpv3oJj$zo}lf7-qNxGQrTZayBk{7E`@#O|v2t zh%2j0S>7)#sCAl3SA;)sLie1o$RVjRP;&T_kMaE~2`>5E+u1qoBFR0X6J2$YC62K+ z{Mzji5_f~Ijx#9#ceBEO`UR5Q;vHeDJHx=go~C^Ad56ssqb=m~!gcyZM0pNe3s)8{ zIP4S=XTv@w4z9~~MszImY~Bx(m)|)2@S>2EMtrg{6(XrMPudb%j_5`{Ar_a$(^z%Q zplc%d-mc)1No5l-2?$NWV3N~OtsJ-wVDEYyI_78YY=-iOP9O&?5-uDtMa9M3DeohD zl8L^GfB$SXC!tYXZo-^jRe|45> zI5(R{cU0l{rtY&n|a%a zxsPBBXF$_O9B^0Vd`Vqv2?l8B(rQ4I*Gme^pp;ufnmELFxvFGG zZynZ@)`YX1kGkvF_gEr)?jz^GU^?xu4gHmD@v(3jS&8h-Rg^ks1ge_W(2@-K1>Zxf55<` zM>QFeapww&%{nk5I2tZ90J8NE9XJ9p5@%)Z!vZGFw>-PlQ4b_`F28yQUL1x+D8YbBaaN)B6rhiDM!=(+!Q z&%x4u43YR90Eu0*XBSqKCU>KZbg$QwOUWbO>|TuRE#wIEdkjJHQV^7+iZmbpYcHg| z$82M--uyq`ySa@2G+dCC~}qb-Wn1V>%Xm4k>yeEm`Ub6)Sq2 zVG$5=373|7TkuCZ7Q2<-rE%3lXeh56T@Di+EPVOiX`%KIvB-cPmB~zWVHb1vvI291 zji>`E=E!HcF-TO|vv0A6f;iJA+6>X(;$R&GfK(L|k=Z^=bCGV<9e8{w?UsQ0)K9)&<21VHe#i16X5Q26gtdoI}|-+JdqNd|>K zzpGjwNyjQA+l)Agqwk9z+hoOXi}tY3!_j_z9)r>NcQ(sM77BO$%A0uU=6?H#GN-x| zmd@0CD1Dn%M~0qqY }wqF%O?H-h(0ud~)jSVM{xi1XM%~q*HWU5ZIF<8@PR6@l~ zG$y*y-n zupb(})iaOMa~sud=b}o;6cw`yfq`a268al+fs<7vccUw903H$2 z+$YaJ(|PMmHv$_yw=E162R7{I)FKm!j4Z$Emi{yqr`n`~?hpvk5MZjBBjF!|&EgyU zY`r-_I35gy(>nbJhxHut{U-?GXbI)H)z<+HDf%Z~k89?+gV3KW1|6Tll!SEo-j#jh zW?-y3H`iN(lMNJ2CLxy9MQUYyyLO{BUZ0p^-$+lwPC6|bPfL+T{ZwamFmw!L*}0tjaZ~?C1cS4K5yKP~qh}Z7uedubQ)rRw zhO`hp4M<(JwE%dohr7XChFw#4rRJ_}l$NGeT$5=MKY<@~24EdT|5J-FG!zke*t2srhLyPV4Km<)lVG!O{|O@=CltR*nPphg0=#B_ zYj@Iv;;}RX@<5bX{}!hlqwt-p)n&JvjTfK3FhBlYyj&MCv#Ni7U5e}(GVNy(gmiM@ zjnW?tg_+FH67Ua)+arL{TB#(~cdLs`nN?!vmw;%x%#^12ImxyHT6=4%RzseWxuVj~ zb_S3qW{oTn*AHEoNR+-X5YCus_a=?jr-vAHS+l(~#;&B9Hs=}l84CQXwVA3A>u7S%8C>-Rn9`s9* ztmP}u>V~AcH2PQ(5xf}lJ3+84)SU%;dCb~s4jO#31^@tH|1v&*bg4xZ7>$CuZ-BL8 zA<>>9Z8X#w<5BYZarHxi3mT&1Xi;^n+LhxdS=8}Pzez3dj0!DpQOx%q%RvuXV6WfH z((*-{>*6WLcK`svm|}o2z8;e6`^(v>&GrLrEk?!4fDT~Nx#Vt!7i^Nh3ict8qg(KD z)71SqwtW8RyYqW^+-R7R*c?ErSJcm{AY5dqMyX5oHfE+cDFEqpO}eF-*c&)Ws+Y`99~gON z_RP_3m@y+Vvmb?Hb_n1hMjp1UG8V4|cv%|#Njev!kJKjEvj^6hl6%m9(Lwxe*h8Np ziC?}Uq{TeTsNhAYkNe@9kYs|q<}rQGMa7`70sa^!jhdx7#Q zoQ*nxyyu-CLSs17dmB)f%u5_+hMoH6pJ=< z4>0C4pTD^s(nr6840(be00$E#=_`%29e1iK$SqS#Ix|LdpMGfWF2L9xiRd17b&1!_ zdZD)4Nwaj{c(ye|>zd{kDsSzGj_IDM=0$CqZ`o?f%>b8NJs4%_mM!8p z9PYcgb(u(_ zd2jq^lw4pK2p`nRV>((xn*-JJu4aLBb=2!irizuf8^q9%~042-zTUX4JOOYQd@toSKu84)nG>t5(Lii%m*Aw`arZ&KbIC@ z*}JxcwDGD^v_X9~h3;xDEG)(VBpuRicG`pk-)w=eaFVHalH1=+O?;|1B%fDz@ouA% zO{|wUqWi52JF?#)N5*17ZrxkF1`fFMww|xK(a(G7FsjLi;$w1R$z!WVG1y!{jWC2s z(au-yo|`q6&;|?q;?8KGWD@7ABBdab0{IoKonKnBa8q!Rjcq|?L1a+9;4nt>XEVM; zx*}5^+1?nu(Ma?}k7SIs_^a+P^YX_cI^0o03-$I&OK*{JfG2%G^%S8x#u;@|HXdL_ zjDgKf1;5HJ&S0=>NQ*3`q2^!7*iwVuoNl*F0gt*G6~1m@N`eEP^by^v9Fod@V$tx> z$j#=iB%sE9EVn~s(8Dsuz}}w_yF8G?Xn4H$bD3Jb!!bMISR@)koNWBVc>z?`C*{R` zmLT{QYd>q~;6`T%x^GyvA?ZDPX&50p);Mp#1phLUp+)DPh#Es5 z!N~o<_VABa&`f8Yml11>o)tg$Jq1o;G7?8IB66|aDI~2;9eBd2ANoZF@U&a<7f>`d zfX1IdH8I+<<*jiXL>H|)n?jo3_(ZXrCv9@3xWlFZji6>h!|eM6hcQ1o<1Pukof=`t zC&aW{=WKT-yXRlWL=6yZ$FOgCjUcapi)}((x6SQX{Wu%&d{Y8B2_xZZr2LNy4;&+# zvj@S2X6*3*Bt2&?QSV*IYuuMgLn}YJg7-HBJi?KP?CN`^X#4z=$#3rjaTVeMenku? z5ZAK+93g**SV$Mr=6HBn;w2I%Z2mZUZ_cp0oc37>i301{R=|$}<_#GA=Lk;7yMSe% z7kq&Zd3tG!=S=uz$*7nOJ_C_s70{l7`UFEGDWe^qGaTC}5LX-#0eLr(W$6=iG@`GD z=Db#RhNd0E(CWgC{G&3D3YpG|f%<@22raN4hB!I5N0i4siawa3jTIjF$Lj$4I#k_3e?AbP%1#|YcF`?b6E$|_|KBu7pCAgwfmzN56AL7m*;(P)+fT)7XaB8-aL z3E_F;i>;kTM{m!=)W$yFPYC=yB|!KK4&qw#u*fDaRo#^8n+Nv?ujZ$;RrMEeD`k$` zY7*>9X&n<7b8s`ls3m-8x~Nb`*`~|Z<(MuvawQpOy4`ZnvVsJrUGl;IP5VvzGRwHP z6g-MLUe?fSs=`f(@=?xp&aHC+fSw8mrGIz?SI+giDKUD(!DS!+7JMLwy-#Tv&m57^j7ziU^n zVE!)EzKfbMXbtMOalO|)hLQCMPnS}3KWVDQvojs;@*+h_hO4pjXHNZLFKu+nQMS(d zeBOxJ3xtPLgFPLD*ku{?cV;bw#5R6Cpfx3BAIu2A55S!nmabu#2l>nDGv8?B@1SBa zBZ!7kGT^cfyO)+^@L9dK^2RZr_*R*-0guD+sd)AAr;@w0o0IiU>~m=BWpura zqwhH4A*tK3Um!Yf9e@{Ba)89;$W}XbgM(FBsy}oFt?tAm23rZVZvAGt!g!f8OsJ?v z^%Ze}zpUH_l_^g>^2zFVg%%4akLqu5lwK_}iE-wEEKy zB7%w6QBa|2_ztttDa|7RtnC}=R}B)ESP(tjIB|CZ&EPhn^lw#_k4{oFvec?L1yb&I zE;JS|icqyfr1DPurZdiPZ0S2HT&E>VPaAqb*CxG&ekhWtg>@<1w| zJ{LsK;C}!>S%}@vCw^EGllJ~08c$%JGg7h&!QFVuWL6#6AiBlx+IMm-i=(<4of)x2 zC>n7+-4YG1Ze9)%)Bk=A+a*CrzB%_;)CJEoh{+(xF`8uTLg`m_m}4~L?U-*AditLi9*044?J3&Kv9g1h#fUTskOVQW;{y)EK)HLC z9;7G5TIYtaJsL*{sq^NcXzJ6YtE-DSh)dY6zFFkvK$;F~FWWmbbytgAljum3xwQ1g zFuLfM{DF4_&f*uT8ht)Wy)y&xwc31?Tfl8&l3Pad#%T}FO^qhwHVJuf zr+KW(pl1nMw1k2bnsRzqA(<$dRx+TMDv*O4sK&bfHjjbo>wZmbNJl_-SLq@iy?5I# z1t_s0R=Ix!QDH>il@mS4Yl0TQ{;^cOQt;+Qmer+B0MA&OPG}m$4X3Td+Rt30nr*6us)oI+9Hk77Z zTjNvoHuB|{Nk`xzfwd_u(WkVciaqwhC&W?Q^tQEb@#eX!YH(RSj?EMB1m>g(y%EuTopwNBcgQzlmfCJxx z3S>7$Oo)^;GB>Fiy&;FUWA=dowDG2z&7T$9f{emHN(g;ReH1bbNty{;gy)?QkRAUpKvlw(0tn zC{Yz@hNwRt#YHhRSLvjg0EJ(lc0m+~awBy`Bo{jJx(I8FO~BG#r6*#HiZb!6V) z>Z8(cfCPwh!|960mDlB!Ik)Ckh!L8RO4o>II^U5?!kmDdFGfQ*|GV zL`Hk`Y}=xFACG+BhS<3i^g)z6HqwZq8BmSDw9ZXX^9(oA`>?p{&pTJQ*HL89wU+G+ z^kP*03*2Rhd87Pt5334XqLOW3E>sp`vV$VMPdCDSc|9GThZ{_lqnm^J6JgFXk~z92 zrIA9JF0za*Sze?H-5>8!P)2x4g1ZF}&Y$FY>QiU01T4&w01^Ka`38s%>lFAFJqdhY zuZ^K2-ddb#$hRf|EC$m{O$4=+SCh+y!Xj+hoFJn)lP=m8LM0J`1CvAG?VF(<*z z>4UNlCtP!0?~*bpv?MZxjes-O$Y&xek$yHxzxz-^->O{vna1igZJz+ImdUMy*;kT4 zdxmAoN7dRBua6JyPlk>AB~v1VQFY70Oq_ep;ZuFPuSRe-l^B;&-+LPnPXrCNR>IWu zJwbG>MM-HcWo9Yay|VNlAy9-N0cC%vVfgNVY?tfk#cNI_L|&#n^tyZyBXb9gYDsyw zgoW8K76!_i-vXhdGE7q|ZN@!TL<_+GAf|p$x6~^UzlW&HdA=YN|YH zf0fIJ(&&AKnmb!5L_H+o^S_ZNU{3J#_EQdx2otJ;P%HzBGXHnbptpuBRuZUVK68AkqM}Ap4UuEu#l>>4Es38c<4b_ayjM6KDJ_)A1u{Fj{RNB zLD~9Js`@f%x)c96XxrN8I1ZS*NaZWwzi0b9o>KW{!+F+8zKQ*3MObG^c8LtDpHi3e`D7L zKH35~D@P8++t!LM*~w8f9>%zZg#pmrfC3f1?S-%?2oA13*3c{#Qa%by~YZLh1;UWM^74HQXNT{OI8?&|?kaogj?g$v*nF;NnO zp~!-c7@0x7RUrtm*|$!u{XEa6qYJNl>wT3yO4h3^mx>?0$Ll-%n-wW{1#>V9={wTb z-=~8FxwPm*y1eHUQyX)0oP60hFJo2tyqaX#sHXPa8oy2)RhzoGTJ z&D~Xka|9Xo`+icQ5(`OX7^8IiSmXyq4KY(i?P_F7RPE@=EN--+@@O zL>9xeYZk}9dWB(rFNN-qb4vBBuh>7yIWDV|3GA}zeKlO6{2ZW^$JmLyou!>QSUv4O z@v7Lhw9{EKZ%g%GH)Cz{2)X9`a!M~BJAAJUv)jfJpB+ay}e88a{+<%Xs zu#RzBJ=H$?t<5Gjs=BEIaor+6)M%0Y^k&=uore!F>4A-@ zxJ1yeX!i@~g0UyXNY!go9qOJ;&3lpW_MQq0qnhbxSc=$Q=YZavuLPYMtz~+TrLNum z?^DUgsWAPzpk2J5jChROo|P^G+$|+B;&SOg;@SfwvuB2vU8hG4m$}-W^55kEt3SY-yH)Ylx;Z%f#i;tGoTI= z8A@R@hplrozSqxvFYto}U!6o72ZIr}_5$s17)!^BV4McAhWGz_WA7zfan{YVqOB&~ z+!DU=C~Q`3WoJ}saSm(;`waXuTau{`#Nm;C-H!;5wNr0gs}wk7!-?QeA()v42--pWBzNvoF`Ryh|m8EG)iB&-HslH zI4RMPld~O^#y{WrE;6qFSkdG+AN>Q07fHgWqO8(6Tue5oEqfge zu%HYk!IFMqi%fVl*T$_1wg!EIbDlGi<;97^kIV7H1wnr2T+FeNoP|p4x4hk?f`<&4)qcLK548Hzy>NAY9IR6BNNjDNp!UDpHGI?g(vbYHaL3&%@LrKHpCW zeZG{S_zMo=TJxx~U~gQca>d&}me^4Gst4)~Lt3z$Y?;p8ZZK=XhR&~hU3?W-Vbce# z&FLv?DVUP(Y}#~eG7bk`dWGf1A?YxUOFEA`ntDcf#Cm^-OUZ0>4=gG=464YIHgs>& za>zbbS@4`TJzWWX0M|fv4TQE+u72`9>7FiEOP64m z9Yx|{ZNjSaVb0@VVU3pu3I8#jtt?OxYpw$U2g#kPf4kT0(qhUA!|YyO)SS^7pdz?^ zUZc>aEd2Yf!vgnEw4aSOR8WVwE$uc{OlauYwBFpnBh}P z0q`vwj;g?upFl(*P*s+G@rHWo-zttzs~3L@BXx*(W*-u1b9BBr3D!C{uH7`@k?6r7 zs=2ss#VNu5F9`45fL>^%bv7E+Lz1x1qL{yz3~MGlvfif z2_AESoir%RZ(~4vd7V9y$e5VPiNDh^a3?onIgLN=b{s|agaN4|br9+Xb<(_m@MbM6 z_5Hlo>K)Eos78Y&oQE(a%69;)&FK^VJpwgydF3pd>OEo8D_bP8azsy?gJVGH6Z=HT zW@RH);usf44bcIXy{kavON{Tr1nBNDK`oP3Z;`N*$Uu^_Ghip__140^L8}kx(Rpwn zk>G%&<)7RMA-75UPU|e*VV9wj_+@?vu zCqS@uDtTVg0cDZR9Ll^x->FXl^L!3*@M(g54mi&jG$f81Af*tr37bD=gP33wz5by7>+)R1XY_NPl zx7uOdhXA1=)E0r7GiPmGW%4B#3t=Ug%kN%{>nXq0(>*aj=L*m(d;e&zQ`>_<*bI4Y z%9@4i4&ak3+-YeEp{dDC0M6R`31^8Tr9S3(Vv`J0Go-+8T8M7VNU=wCSbuqo!U@!x zp+h2(tRNk^xv0NBVt3RtLHl3E7x#WnRfO*@VAC6@aTe;F3j*S7o)-;J#Vc7WHaA|u zdH2CSlIlar_wfO52oR!y>mFQI4N^Co;x>2?X(`Uij{_d#vmb056sD9`d*9Xsxx`qVnIMBgOuy$pN!C zX?k#cU=k`=boDxtBEFlgOnO_&L0uKU22~o;q8R%#YbKarQrpS4ezX*kk`NAK%jQWxkpus7)X&P6V>cXf#I6#zg#b^powBVX7;08n)wz6nz)2_i4Ji>xp7E)&gsl0UCB+rx=1Q27g^Fj*Q+yI@V6 z3DF_X*2iQ|{+-bA@DxyuNUS7>g-qAlUT=MVy9F-WBw9PHa3QDy28o*8D|@?vn?~#= zP*kdFQsYF5$dWh>CFAi0`;}=5e;2JziXe}os`qr+1bS#f@0|Y8-PtfiIOpVy43TpV zQFVe%ri|%hcH-w=5YVS&*i5P9D_rGVIFrPMRW$x5!&Li=GSO*rOHB1Kn3@CvP*G{y zc&0&lNKzcRxAPyW;yyB;r;7N%ECj>sRcNPMTFcCi*=nR;pt@tEwMDi00PWt+GaF1$ z`~k;7P_tJL3F;i(hacgsM5#V%6&>D9sHS4&`F%hp!KZPPG!hUqF8Zhaq1c7~og}LW zGRN2{9}pJ6jD=5ZN-h;wx#)E(4lg7v0jiyp$ZPHMPRV?3JEcf-u{|mz4+o?NuSjk; z=d{;x)dZHO+{Xwyos3~Rsp2T0v2X)w(9O|VqMVp_&=JBhk3@f`=e}@)SG*B$#&dBq z|3Cq7My03tvWD=$2306nKC=QdYK*YcO3l7iqF;zuY*o??lz0^-%3I@xFm%_eKIR4W z!!B$jVi;kVl|X*waJ%3#Eu5{}J$zRSO!b!`IXwkc@I`1KMnc?&f z=&WNK%&iMi{pdh;+!V9C51a;1gH3PZFzIVyVvE1;rA!lHla`<(A0MdqZG;#^B@M6x zNzs=TAq-CY+Ht1=DO=-s5KwHwS7F&`M3D8E zmd$vy!)r$F3@))s7U(ZK;Fl+i8=NN~FSP7NK(BlbXiuT?PW;cd_9@v6srKveqy)g* z_nURk@N~=Jx{dst3YOiCT)FyA6|))z3!G@Psyyq(3y>yP?4A6Rq*_u`FF*H&!x90( zFy}ba5?SkvPpUBeO66M4b%`TbWgiF#-7ucw-Y8xzCHiD=Q1K1N-pn7zoxthxs+^+} zfRi20VGRS8JqP$imZD)?kH9d@p}50rv@9=nb?n)o3ZBy5VTzdgn^}nz&GD-xyN59rlSzHV zlEU$_c>q@#3@?9z4#--hM4N&{)DM>urGe|H)t_~IL!=%GR)NnVIVvpgu4C>LrYxX6 z)Dq?zqpKCEuk&-^zUnCWH4^`9Su=S#4$oDmuWos+J<{I%z5A`53bh5J`W);TI$pU( znCqV5vmZUk^wq^;WI`T?QP$OkK3L$b(ZA^0+PlY;`hF>%*=kw2JU@Nb=2N>$cd|e{7*e&ZSvAwVDnQ-_s zaWCi<165+J8~kg5`;XQbp_LfNCG7tr2>Do?z{YfGj9>z;d0JvzcG-_IL>wp{5!nU6 zhugU2DFkQ&+HE|4%P0kSZ2`p+N}`Wo;G_zmf8gNA?U z`b9-)k0-qQ=8XqNgwWDMRPkYyfAc=?O?7LEZP^!NHYRwa+&ual710$ziWC0d zQtWKtDcZz+ZasrEs-#`i@E~{m&p{l{46wz#X!b&Swo;^7e!nfE;3u$?SI*mSh>}yCkC+7+KAC>F?iV#?18A^To6iTUA zopqNFf(PzArX+fxMd2RM3F*GZ3PUM}{|3E-iu>q6_GPU)IfSHO87)rGXXIIi=E5mQ z&ng6?r&_SIo1vL{Wsk>TEMajt%=3`5SKbO5b3isb)HKDGY8kU6+D(AGD#&rN5r~Hw z-_OG4pM_r^f_Sp!Y*yq#Nr5Jdna`I2{sORdL^Ng{VM-8R|6MsorQ@IiYXdz1H0-Bi zC@;eNFT(sU!vc28{dOyjmUoQUL^8h$OAJ5};{ROK*fQ~&tBcrQg*Y%DfTJDSEaX?@ z`=4OOEkQ26nGC)_lW3*VcAN?=VS5YkzY1%rR@j|$sIwPx8Bv;cINt3u4mrjlH1pji z!*fnNl?8e_?e!F})W`2vrO+28A4iIoT-etHI}H0>Tqj%WX?1NbvT1uC(P-(u___ml z*IN4lX(oSRJkZxQXs;M#0*H=>rRc-uFDZF88y3(rwbfPCH=_wdZpKA^EB{yvssemj7m`!Bx`uW9yVg0?re%-Uj?ddD__HX-pmi@a6 zh4pX$cJ%N2ddj}75A+_#yacx_0bA~(zuD{iGGnz)f6!7N&|rrb5b*?0zVYNk`;oeH04J2bT#=c z7EhQ#Zn{!&dqd~VxghK$uR(@GtrEi4f&@9ZF-0J>Br)3u&k-+*>xs}Tz~U7jMK%N6 znv)Xq(Rfwt=>_hOL`>&wiEzpSUn7ohxL?GsBwXH8Hoac$6eStjU2!}PZoN*>fzUC48Io@B20N&}4B)tvej;hX z08(ygL?iHga|kY`Bw96o%}45VK%TaGJ2;L*z%>bOv+Nifh!#Oy;Pld0A29Qx^JtxE z>u=tHa)3&9WX`4~7le24Kw`DB(}2v)p=_r98&HDzQ^Na&g$x|FT@x+K;Gh-{aeoTX zd#_5n6+`E?C$oL2&LZd8M^6P>YliB$Nd;{mu?)rwDOl7bSX_?dl?rHo2ShSP4m9A2 zd?k^wOdKaGjt;(Hm6I3Nh*r_OqG?7hlPnC(OF>;jN@EBB{#+&yOWV5( z0CBtv+x%+R7CpNVMdc45+rNp)I9+0oKIs*JH*{PbD z9k<&w{*YBhh+eA}r~gof529aC|9^yo?u~PhW`9&;^M%>Gjx>xUkFom~z{={yH**lO ziF{cG&8(?*XT~Bu?y;DO0{RK1yXg@BUGQjs^}GvL5n&x_CV(n^_+$Je9x^CR7ISo#+4_Y z>{l=z`>qu<_vH?0aYYEhe=*sTXP8IarWxgp0G$BGq8g;8p^#x61}YyeKPUeAeU*uI zZt$}Am%mU;wnM}DRo!m@)`|eO309ElbV&4fv3xAO-RlysDLQZPCT&n5e}^NVESy-v zY>ni{w)wb6@Z;|J<4|2TeOMxt$=TWnSPTMuMCi#91PvIN!AlM}4{GHG(NrU}G#J*{ z?JyVjlcKC1|7*XbB~3S-1w8*ryspoH?lso6?MuU~7^SD0G;f_e+}v!;`!K>BhsAyV zeL;v|oUxy!W1g&pXn@Za=8`YR9RXX2nQ?fwFX3rRxKmEGP+gwR*RrMKnEOw+F3&a) zYxH(?awkoF_xtb9;u$>(Cy`W22{QLo zlk$5laPV7HbC-#>;A!I;qaOUIRGzmKDvt8D`$zvfUTd{*U zU0d^v4sGVIw;eC}#a6<2@`z0MGk-=!w}6RfIi2;A|RF+C1octN(wHh_OI=xcrF}5uZu)^t6dW zOJ?TgnkXI5)U3%S{R(O@b(JVo*<}653ZA`~ZRXDx6xDb*OY-mm6T$^!fLS9=D%wL^ zK!MT7(8cwDYCn0S5~|msTe?FKk?#J=Nnkz}`Y9CSEtt^nD)(E4enTd_wlZNvLBYo& z{}q~ZX}5`#!yfG(!N`_}7I}P>X2B2kF8_GF>_Q7l6A~g2BSoeQ-^T|5o%`CV)1OzK z4Dn+Og3!9yx-amekwmjo(Z(}*=JHds3A^14`u>*D6YiPS?`ll+R>(M?x&S-~jo2cS zv`0yUs439UDYZ2xPX4jIdy{Kx2X*EG1#f5>zBc8Fhe9k${{y_n4#$$3ytXKPIf>7q<<)T{pA!|%T9`FSfH9CTJgR@D^${o4sraYOh*O{p)|&P!&xIOkp^oko!-vaF>N zyp;MkfW=XH(py-8#Dh$wH2Yg!UxIxRZj_S`lbT!_`Y4-rm@j$ZH?BO|HaZc3zVJ4I z3Fu9nBJmi5Tm&Bz6OTJ`K5~Q94)NAiv#Z8)`vFd;OtqOAstZZP+05AN-FY5iu3drR zeXS2EYb1`V)FdVi<(92p_Wrs_4etIlFqmKEFd}Mc7eGnv5TlFEO{PGUA;4V-VfPP1 zbB6D|)-hb?Om6)oU26TXae+$gP9AP!x`Tx7#Uf{CQxhhaM6!T-C>JctS8QKd(dllr z!UK_eyeF8W5Ry+k*wwM4QS|diJbrAOA7&+uU`|9MnyHmWya`6*go-z_sGh0V?LkkKiM2r`QMZby6C^k}6&{U!agd)F! z+-1pa5I$wp$#2MWP=`aD4FIouxEZ>__7~xDOu!arL;rjnS#c&lbH%>cEO3*=_WG@!wW!$?Os4Kn=*bXa*toiHPRjT1tz zITI1d#iN~fAOMMJy-@QG=t3UEX%(0ku(KG-zQV?~^_eI$y+MFnY2w_$C(q$;8gXZf z?UKg34Io0h@EWlSW#h}NS*Wm6d$k4Bkuu4gatycaqIo}XTRgtMJxTraDIXr2zyE*A zoKvbb5Qzrm65NYAHYnX$*6>M)m=r2?UBnl&%*5Eo|yl$rEa_Z_1gzP7V zQc1op66rI1m?`8yY$%Kvqvx8-!=dL@d-w?!F%6KLJbu)#;#Ql-s|tSww(`xyzYLfN z=Uyj}x{~yj)#GF5KfD2H1Aoswp&Rx(1%1iSx_DSAI>3}7zqX^w7wfEYmCXBtpim`2;mMQEef7(Cho<)7YUlB1Ex5Ug8jc<< z-0GFb$LWt_|9eDH`pMH{X&E|vmeSiSjsn|xJ>URwO1BRCJ1QlCZZKC%7A32f-k$3kSa93%S>1rp# z?=``ak_*k+G}#r&XHqEI-ZDoLZP#XSBbD;sIupp7~*;s%(wd?vr5 z-Iv)V|CBg}{POP1bMI=W`oYwh4W^Wsn+YD~Ar*dXg|;2u;VB zgI;{7sqY&@9NPNax<}X?wbfPsG z9pD6pJ5+9z_L%lrZy#9Zhedk3*=#fCEK0|)<<6btC5zbyQMxMG1sHginDP!4)X7(( z9jJqFLmruiMuzBKD0%nG4ynrVEK^~ZDK+&;mZJ0@`y z0000>u^OGQUs6~;Z66OBbx;HC?p)E!>cONF!Bi{Z;#PdPCQ9SduoUZ7ya5dy-Jm>y zZBdUm?Y(!DY#29JlIxNHE&^ohwo1SYQHJX9r*B3(-DJZe5X6kP?30AG+tdD(>=@n_ z;}52HfLiA{E$`pr&1&HphKCH{uh0&pd z2q7f3!^&w|7Rp9Dp3sjJ%4m31lDQ$EfpY5ypA?SH?9};%@Q|`&c%PpvTqkA8+G%Qf-qz-_sdHBGT@9wQA%+ zmchRNK6vf&;U9~+Yj~z%#XW#fNb74q>49ID>Y_LEWjI+eT@8~jEMYd?*K zxaC3<>7y^{&s2yt?};(w2v%+0apQxA_DnKvGj$hQEiqus8&qKuj>_8mMXim2luR_*IIw=A~# zYA$ZPY#v~>cmFAJD)4CK>m<;4sm=^x^zdR9g}p&?&JljSn|;@ph2!yzrE!}cW1HZh z;9V7)-%w#9zmXcaM5$^UL%Q{kZR{7O`t0rW+&Iop18tGmfgGRTe7jjJ^wPQro75Uy z`hVL}tk8Y~I6$htCNs~bWG4?z0cs6XC|-L(bCy)sod|ZTg$wkMJ@w4v?%m2xI4#)i zg!50=JDGxp$nzTZsu_R@X=wGWF1zRH_HRwpNt#HQDHJE96~zBy4O?sXNB?t5oES`m ze!~K-D4teOEi00g+)n&Y5pe$_hEv2F23Vyk1E?Dv7fL-qyJI!Cc{pkhND7O%7>8@l z5I0QmpJkA&1)|`HG9mX(TyCsw4^>1>OUeoSsVpz@$W*WBN+SG4SQ|#1z8i0#XhVPv zlsT99MLx$FQC(2=p~vu_8??FHK0$=rN+kn}6-4f9^L;N6`mB7C8Pmb%nd~_vj6u*^ z)7U@K)6IcZV75iTnpmav<6M_E(U^pxr3#S0y}2gUrOvf$ejecM5JZXwJ^l)fTdt(x zBod&plW}!me|ToyHdFc|-_R|naPD|PZ2K+5IKDkg;PR!SVd2h8*M@Se(99C3H9fQD z!VKdEeC%W&Z(-@`!JnUh4JW&SpF7gWXuN@wt+h6nBC!Z!;-|k|Utn@1$WeJm{OgYn zWk+{Y(q88ym*^>>IcIKO*dJL(eb{{`dGfVkFH*S>8WE<*^?O^~CY6Q^;QjSRf) znR@lj7xL-EibPf+?km$SfmJnd3|cBd7S$$fLXod`wXjAfsI0+Uoyiz_EZR`d=RJ%D zI~mJV{&key~?;1<~xl4fR01mV|fB*mh0ZsXU>XIF<{-xe;bSmg|jmP0a z(sazAQBOaE26^;D!{_O6EilvTH@xo^m_-(QyfmX8BW}iw_KWrYzEvVPlTQ4u0Fudb zAUjxUPYFzne!VYs=V$VoS{Tf970*L@^152rB#-3FA_0Qmh$dQrnZvp%@F;-354GvU90MN!YWD(mlCwVn$eT4** zd4ji~JAeBED3qPv6>3b!H?Q{Y%*q$c+(5$SJ}N&q3ohv>d6Mp6LelvpRqMP_+$WgS zXmRZG9xzvCp)<~8wmlZOe|w3FsZ^-6yEOUWw0Z=n2z(-Mt6eczMS%N3&;wUP5!`$a zwj!!1H1i@~;5Cl%*_(g>&Jr=&^qH!n7si^|O~IAR_cnBUXUl0|k})&+Ee@8-S}`+3R0Y-$rj zkxEs#(iBcLgFQ*WljR}`)g>UV2={PDlx*1dqXinBts`GM@hW&G6|ou)o?{LUPKDVE z5IbZte)@sgNpa4viWWWmI%<&B{z6#l6gp313)|sK z7)&r;_((VJ8+t6tHqLZwQ6uKfx?$(#&BZxX^=q%GV!sPQ?u>K!+gaiJAh)eH)4gNH z0j{++9tV4+Xavv=R)LR6FlQe&DiFN0Sqt?3v83^njicU*{R(qkYO{yX&SbV&;DdAF z)uI%~9^!p4N-?icoUjXPr{((usVxo$cf}P6UVDH2ES18RUbaJ@ErB@&xGCF-*{_O+ z9xWE!ii!VkhnRa*t%N=C@^9i(7tpU0o*SRrrC!>~Al%4Im#ye1*X zY+n0mcKg}Xb;A3OYyM@t`w=S&nm^*V@qpH1Z}@=L>V5E-VL_(Z{2EKGH4audZ)^j+ zO7valBe*7@Z;m30rYi9xdI1z)iuGWw3-@2^Tp64a!;;Ku^K$+i&{C&2kk0lZt-8YcBc`j3v35&{#l7N z?~}{R+vG!B_;a2zs$gHF=0x&Imd4IDErXc1EwYx)1BJtZ66`D6fO}l*Tl{9tc81;J z)7B?Ad7p-ov?->9UQwfiO?~78!!Tue-ySbxe%`Ze*VvGN1eW07$%YEn`Iu&1>;`hO zfK>^v)kT>xgAjPTmpUKo7JQb!6s^(>*05T>z4BP()8;;*2e*U54LN#1G!#EHA4LGIfiQM0v6J?;X`#_}1H7SJWVmRC}#;`W1V< zJ3woJfF5SfMZpa<30osQZkVSgUXFMzpG)jxTmEYhAJLb%y{K+#V=wO=#*8Y7>mNTN zYd{WweBuFg!da9O&ay{y6`cs@3e3Dpa8DRu9im1^6%4pf!s8xS0xRK<3HLwyw-?r;;-Yj2p-Z@bnVlqSy+|i5I4RLBGDEpIwse;$6!{;2G=O3^B zoXz8W44Dw%I15?~12HzI=Zu8sB4+N=-|G0}-gfQLU^j+k1}^iPXK^iyyv%XvAlwe3 zZ1#d8zESx4=$I^f%&{tNOWL-=oKB}ev>UwDVQ-iAK4rqVF*MI)M^K~+Gd5~J6ehVr zvh*CgsJBZ>DS_`@Y{E#Xb%RH2_nmGL6o5I6Zr^pv-I=*ELYczn(lOhJj`e@&Z1 zNGr5j=qYOU;=IH~lyK-GjAJ7juRT0WeHqi^NRp0GX1PZ}dd!w(#?GA?aTO^~MRbb9V>bQS}h`8uohdsz+d1s(V zfaKk6V9>SaL7BX)mJo-@JgM0=2GRK;NUYP+qma1~=6*0a{r@U#iw=q(H)XE81^LnU zs$WKCVi&8M#`=|kw|%wwGv5d32DJ?i=|kHg$Ti8!MsXmq-n)u^R^Mb->p8h19qfMKhgtC1{b7Lg9{k~0tie>?<@%0tIdAOd7_z3FU&5J>|3Z|IT=|g* zHkRPBhO!@Y_mkn;%E-xIuU$&2cD9(zDVeJf!P`x6u3{K$rv6M~`y{+g z|5nnuAdrchp3c?7iL7T>btgmMr6t9>99M=$BkTi6lnKW9N!ZjoS9$Ijs?>%*%(V!| zi<$7OU)#`H>OgcqGO9sL28X#LVtntolgFD5gAnd9ouyS_K8_X+KMmhy?|RC{^`-G9 z=#RSIsC%~a^2U8IWY7q~ivc`hVBe1W3j)e~n_n`Se#I;2%{~7S1 z2?a5OFwWMt(`J1~$;Pp7DfYlUmPi>(uehS3paazdW*!gZz2{1faW~4xs!8zW3%b>8 zXN8+2I|}IG(_vNUfcjsVRvlftWn!w84&3Uf_0yJ)lC^CJ((#{OH%c~u zRe#!msvl&#(At~*@e*(Ieh6qwkV)@ShsWTy;OHH+z`P(h>;y`zxaF3P-wPz?X>J* zlL(zZQp$nM^T!%!U8@^SyWXX~-#H8Cnj}~A1GA0{HzS{0Q|QQ*cR&7izru#>7Rii0 zzz;tP0-!lS7CJGx8EWh9YiHdCZrXpbWx=N}*`DFNeZS9yHWKVdM-)NDfaN~g$LkdWU##U|S@#!CiT);5;YXi#B_+KGb!$v(K@q)4^VnWJ zu`esHHQdFwZWf9d=M8K7nOvrTyY-i^HiyI&GHGf}8q@zePo4ND9~+kjii6K;2}&*I zl+48h<6rJVp&D^iBmv?)VzbO647=%Cbk5*%(&oJ00wQavw$Cs5h0F@{!$nPNKj8;{ z6U5bAroY$?a>?1qO0MwsEmJy15`F2<`kw9B`dsiGvg*EaZV;>p6DnJr6=)&P(pncg za^k256%R8maX7ns*g!!wJk2+KN*(fPJ97=&J9v$JQ5jw633~iolo8h~!05X-uhH&hHQ`%40A>CQjtl z639wpa>SywL8QTGF<9VM^yx5Fp!HRU>3FCQXp92{FAAyO3-)QS;DJ`10I2EW5zyuw zEBQGK5e1t$+%hW*>Re5pZ5cFCtpyOU=0yf@9%JJr;H4QM?N_i*^Z zB{s^)wvf-XmK2d#8AMTa?@!LJw>`gO!zIVWyP4llcZzefd^&h=kiTZN?SO(0ZRw0; z8a}r(OE&+1_3k4q*cmW;%L|B@uK5NB)wzDhTlJA>@y-YTXNG_1kW-Z}E*=FLQDdLJ z7IO((0t|wPz#lMg_Q(HVTPAtMP6<&-H8ao_$5)mEl@6g%>AG|4AQiv5)yQF`j`5R% zXLEnnVNkWv2^>e(TP(xFF@b-CWLjcmT55FmTO?$gT4c*b4{+FL#S$a%-HxHy*i&EQ z3)zHuFwxy#u)1JslnOgCMn;l^MomeN(gKi-l;{!85nReMi!DF@4#~R3e^;&VFkO!M^SORtFGY$nJmE< zG)|0E^`;3cx+52kMwBsjLC)<;7*N)0*{?5%1sRUYK;8)=6EimVQyBZsi)-}KDgj+o z6U-?@{E=@#_zSWwArpw zx@=Du5z9Rb#IC97%<$C(if_*p(P?+UHp0rO4yf<5Yb_QYe>@xl$8Kq_q3MJrOeKl{kuBGWi{QpjCc6k;Dqa*5 z>}bsZA|%BgR5geJ%eHzqb?>#Vw_Hy(n~tG?66Er-Ozg57x6=U@b~7i0#?v(=q;;iW$}+P}|68(G z6OjV4xhuXOHQp9yk&T2}rdGRuH8|_ybYwswjyol~zij8oqb?}jvdgw+j~M0qAa4{p zgxxRzEGXY5qBZspWSgx3ycGLk7T8A(nepZl~DaKcn1QG%Fayg~> zB)jImp%Mpy6SP#J*P=Igx12MMuk#hXC7LHrY}320{S%&gHVOsHW{o0K-XESgMcxta zIk($$vN=AF1^EKobp=7Y{`F9D_&AyVr%-)kN>muF; zgO};+suRYgg7Tq%mt~lXxxKa&MPteq!5(6@M1(Hm)>d6}B=;wlVa5sqX)=2pOCYGl z&Hii5vvC(>PE@|rkVWKz#LN%$)Et=gKbK0 zbf0q=0^BG!F#jRzq5KTl8S66zH*&tWj@e-Kp3Z!UPVH~<|7}4;UjA8HYRG2l*cQ$7 z+vfF(r^3eQ$X!*w`@FD6|3Jd3KPwr7WR2&XhMkf8rjT>Wo?DGg>c6i6q8X`o)R_ek z+`=~{<_t%f1*mwep3+(B=sAJHbYMIf#uX77YWR0d+S!o6Q?6~%NlEt8A@xGLJJzg1 z!2c(`T7LDdPz5U%9?^EP1rX8L>+V5rL30V&8Oj2t)8LBmfLpZY8-8O=wvZNvr0TlI z!5#owh{)BkD6nUz{_OFAPtT|-A$@jpIrd^0BlYcj6>{?f&e%*^?y%q^YmoBzocNQJ zp|XIEYX5MnyuA~8r_Wx(xA2t5=>LDuJ}P2R<4HpU?S|73K=_WXepAc;<5oG)v@k<)YSJ3oOi6q@6x z9KyfzWwA)5S)Ep}>)!qNBRYZ*aAl$S-&ppX!Ij#=G4v4ZkpkS3MzqqM1XLDCd1Ao8 z1Ft?oU-_J57&!sPI;iLy_knW96KA{4+o1;P$ZV?UWA<5^4IHB(Z`0*nYsUCK&iz&Q zz!3#a@GT(Waf%yY5DOL$u>)46@_@@DlwuhTQlWf@%L)_=WM$Wz-M&zT*{Dseqy!5ZnL_yHD90TR%)1T{RK35*FZRlRS|MPvg2W zu{0Q6Qe~anr`nIp{DoQfefpAL!x=VzQu`>q^x=!cX#vM29^WW-Uz9n%Dg}WZ`dWcc zY#e@HC+=7i!hhkQ-GdO4M_;rkW8o21xw|^Z65MB&g#r0;psc=Vwqk z`;}UiWPm#wtX90T5P>Y}%D?kpcPEm5cNfrpydP<;0_nh;rrYkz&Qfd{Qt-RV6DN%Y zn3sMPMAf93f;3xG>RhDvl9(YwrDO}$l$*$g$>T8~qpRC%8ke_MRktIdlCE*gCtof7 z{NayYgg5H`&MX%S$A+A5h|(joAOfpq-U1#$KlV3uLiKT54I`mMX6PYlF0`kbGGJWc zCX=bnC%Pf_gNMS-YZwQfsza(CE^FVN+YX`X8bvs{yT{02lqYy~wo1UW4K?tSGkdcn zQue%d@Pb*%Q9$gZIN9crW=R(KI^NZGr2sGgV?|u|P&m0UM1Fiq*N{q8^z72mrT2b$ zZ5cBLLo-)inN`_D6CUNM#p&wgI!I-77Vyr4Qn=J~bCBt_iSS3K>RHF=&T42RESauL zG@mKGjynokLwFvC)CwUMuj)ad{=w|wOan|;ASsthk?CY1NK?#C0Id%B1e zFd&}mir1Fn`IdV+Hle&Qwi*sZ{VgCt2gv^w2S^EBVzy0OsY!)!GB8eTL|cvGgC~XI5uq~?O961RPwPF6U7eGhHp%YQ=bb%Yt5Ea-`JCzJ3qYS*d-yo5lY^( z%*+(${*p`|juO?GiG^Ky^HxiCE0({xj;F`=A`KnR-dtk)`y$?>f`Uj;Xy&KHcKuVA4W2MAYH+6x}rU?u+{0FpD(@M3jW!#pSVA7P0G{D z0-8(HlcX9m%%vG4KCfY8%(P>^>@ij2h@IXXDFzuqkyp`VHR~6faTWoZlJoy-y^uJE z^JXJ&SQ@Ab|6}MnsijVN38w2w>pZ^prRD&FQHp8s=wyGLdhZadekIP@B66vq@w-K- z7V@8$7WYH(c=f)u9y)gny`egggugj4Zqe>)( z^gi+U|0AwQ5H|>98hPXzE#@~KBBRS-lv%U1ynsy-{d`PbQtCN&{ z%=1p2xy#_vqpE9sHE4wF9>v(&5MDuqa8EZFR%21JJYn|CgJmv+U2rp@Q38t`Q088< z$al*mbw6l*p*zjJ)7xh<#35uI6Y8jzP9Wo<*U9gG~oNpj#ELk{6rnW!A zYWN$E*t_6OyTHmjph<=VoGvVZ6rM<4svmv1cscq`2&63E(V6fqET9`3ZBM$@&0P+Q zFue0(p*cTM&IjaQ&yW`G@t4h+)(2C&#P9}6)7;(Qax;;=K6f{^}3<;|1G$g z$#J|rDbhD(M2~mNyJM?zLf>1Uv24V)%t8*kK-N~isHG%4o<&s$I)O|Yq9*YfE=@YdX2pNf>Eg6Dp^vAv^&i z2RD0cUy_nazyFM880guu6k}oi_;R;UHe>|3d)l)ewcW(ZIj2wFAHKR&>D>n zjH}Q;H!xN!#@FP4(rfKvY^(IVi%E7J?POsY*9y2oL*fC)4|Uzo4hLcIN0E>VZ&&h< zKd6i9sl?_N4WeTBr&4s@^33FJBc>o}`VV{4lQg{?()2&Of!@Xx0}me%Q$S6n*nuj# z!;(c*KdU;!(s{d2nkm)8w9U;0c4>mTX{L_Lw zekXR#rRcIu*xH9_DMEI*&*1p+W(3}Ji!v9IS9A?vCd&x=Qu^zq^eqIZ@o=^)fQgX< z&g3r6CP!`a@jk)>kY2?*93CwlRM}A5$JD(G^z_B_sGJI4LNZAIN+*XPprG*%b8Ft3 zUvFY|D`E!pvOQ`{DL3neMe#q^rOyf^=|n2qku?<{-0Lw`DFS*}xoUxQN|yQ8V1R;- zMQowFh8O>T_i3IH86rn`!&MWUlYIf){mD`Y-g7&JDA|E>cpo4PBqj7wTA9#E;EyFm zLtjs%G$D|}LMbh_Mj0vwRCChu&eUNAcSpnfXoDQ)K;MtVN=#Vy=0S0C1G2|i`UtanBEt_AB zI%6%WiKd{GYIJruPGwmAVkr*5j2~ovaCs&88CfV%J8VBZ4 zRp&9(*VM;%Vl9|RB^g!Nc~Y3JZ2Id7>#KPFQs+zT4ChV+-kU06&hzO) zp}2mmoQuWt+K@%&^VYyl>p-E_FR^|W-&S@DVb{+X*Vj$NAK|Y1g(2S9Rth!~A@p72 z5(OBtHp1E-0&h37Db@$#X(DQ5Q5{MJPFceK166URnF?XnlAX=zb{*U@Nl1j#iQ+o; zN})FYZ%O$0RT1Yr$?&Hj9W4ZtL|rL~<8EIB%Fgw^%#J6JuiTm{iOkQah%=A{K@>n= z2li0@d&ewUR%oNG-^`2tucoq+-+B1vGH-wUBxH&Z^4QK$^7+#5P$JwfO@WKD=FmSB z(l#+_fM)`Ks-l!`mN-mcM-ENR&4+@w^w5*M9&MG5$_mdp3BT5GLNybeb30TQp;eAN zidzss8otPn<|tYOvaw_6)YrqfQ|aoxvN1*fVH);E9(L2}95@#d>^Elg6t5?n`lWY- zREhwqfsma?6OSHZdHL5t9X8iq>rwha0{$YuvFrsyJvnL%z%BwYn30&op%g1=4YjR} z0AKVRWCVSm@l1gLureP9>^-F=DYEk!VL69{HBa9#0R*3#2}A#X^8yvL?_}M*SX}ym zk`GqUucGwnN$m2vz-0S7QO>f;Vo|vynNJ661bkA)MG}W|^@<06EuR{bG}l@Y(AXL~ z7w=LTG&4?<{CJ#?7_xdS;VdVG2-EV0~kMUmnFc_ z6aK|vLEXW?BAMW!!|p_YGw~y%D1Kzl@YQ2aU{YV4tCN!=K z0OIc$O32R#%QJ-#38$Ty#LLn+Da7uM>wk+FjUPRS_a%;UO2N2KPHEJe&NA%3YRHnglfBO_Xdy+I3#A?x8=(REK z*=$9pVrOJ4&(cS}eli#om6tX>VPUd7^nk4n-cGXTsiC{_SxDg^9oCnMo6k~k708|S zsORO~@3w!iLDMTpN>M_168(-HcWy<-o5gBJx&2wT&wCmI{|8h*)HTaMl>8`sBR93y zI7jC#m-aMnhdy8*_{SI5Tvv>0?ynL~LfI=Pz*Zs(LM~Dcvih*mmnHYHdx}27!bC>Z zLW5XyRR00sdn=tVd|gWN z`WqYWhuV_rgs~Hs-4u<&EGk*IFRf4Nxe525w6t#OT48X{c<-8+#>;Y2lA$Zk!nIFC z#vu(r;KJ|gtvUA$lPL@@c7 zMjB-pALF5yKVYJS%MLuA2=nsf@np>8TEv(+l6)^Ptr(`e+>5|0PmDD1y1aB(NtHSM zr?GwgQSOqz$O4n!n%LX6NuSY$3IJI^l7q`BOm#z__!OAbvy0d zZ##*9WI^Gt$`C$wv110pZq;tmL)sZp`1vs1EB>SBYJa~|%Nc=Q(`Og!foG}!(T{Jd z>~BM;D_AQfA9Q;03 zK%E+5VeW8ltSBj5^+VkUm}^@&9JvRS^*j^)pbNA~ADP|XT^7Exh;znX3wd)qHfMn; zIiV}3$>!94KQU{z#k?g%$}r?-!fpY_3G)8vqc09y=*-&l)h*(0&vZa%L^=&w7KtVz zc94>U%Ir3wD43gHryOtm(~d$%jIsngaYpms@w7ST@=n#oQzhtB!WiTBp5mpz zGWMumh`Nviqta&Ud4&rH^v;Y(5_+VJ^yovtPcGx;PF!jI&P`R_Q(|mq9F`NX_qxIq z=qA*bFxM-pTFQf<_#E>5SJDEQFl}n`%GkAH@?ZqPQqq;Xx|DkUw0dPkbQPD$W>1Js zrEPCPuSyV=h;Hp~&wQ2&uRZY3s3yt27^rNWiS+4IT_jKw8+d?N3dyJ-vQ9kXczkBr zwD32|7c(XITq4_E4(%C=xe*7CPrXWJpf%um+v5(iJJ5csw;zovFSJ?a2%+R_W=8Y! zb!_&IPJ$sbX+{_}8L-?Lh*Fz0cILM`b(=$~=CD~mlLo{mDyVyOLL%pgP?)TPREU0k z(xLCC$_~QY4_+r7`VdUHHoAU=wZ66$pkL?Bg-eEG@~xfdX68N?Sg8WB%VSL5PC&F_ zUpRDHuV4?LFsUxxFwZ{BOF~8^yFFM@9zGztPLy(EH!1!(A@muAmg0bXfIGb^+e)qncUsGrp{XJkN0rTR*{;J!ArrZK5T#oU}c{ zC3iL>M9TIo)lwq5*S|F!LHf~6&}JaqB$k=crAf1)KXLPU-V_v7soLe?YsUEuYl53v z6=%6j#BoK8LrCTCSz%(f3b~&4`eZGPG|T4|yYs(9U0S{6XlYnin&Tc`CtWIPdQjwr z8O|xfiQBxAPX4}7-7lfvf))N<6hfC*=IB1dS!Wtpw+UF#*TTXL0G%ofQZD)`B;-By zw5Uzb-Ce2*6a-27|7)cZRv^qd%Rk9|2@D|p`eFn1W&D(o{l0~tAlMHNDe;e$*nu>- zdnw(BK;=41QXMmPm}$R~6&VEu^6@5w3YlQO2|=cz->2^wto3W?ETt*3uMf5AQB06P z0eY@l;jR<9^0ogL=Q!dHdH`S)=mxb73`T??xGah&tgD>yF2!umniu~^ zz(+4nZ1GJ^c=-}9Oz@ZM<5`G@I4^~)Q3?&WCPqCQ7z~Zoh|oa3nQ5xVC8&S3de2&x z;m{#$X0EQyhAsjiqX_itO>Wp4KYU|3Hc@FfvFh2K03UyAChWA}F7*whRhgPkl1ZEM zs;h~1R%yDE3|x6GP7&shiyzTY4x{V@Ns1o&E>BFHLnn1w3e>Ow*F`EW;X9+<9`?^B zs?e}3m_)d=;wdPl{dU`nT2sX4bST}#uNo{8`CY=ZBuaplAQ3!1vjq+!b0N38IPcRKC3j~I%tYAn(V|YmUw_1<>c;csbMaT1R+Z7lJ32DCT&vb5P2L3oCwL>O zkz**U6(j;=;GKU@h2&XInXQnSAIBy0wV4s>?a^%c;R}&*LD_Z1`d`2k2xk%?i0p`+ z*eg(f@~yJR0oeR;6lSGK9gw>d;&$H~VyjpyKho=LR^Ajxj#%e-bj1{o0rA-K5`p_v znqZ*@OhHZS|(aDEPa4@{pxT$$OVL@S^ckWErrhpfJy8eIb$H zd^vms1f)x5y=xjqB09;8~}B!GN(5cRJiAl@w;lZD>58C`aaKR~-xVR<}~tp7n< z=x-xVbDDXj0f9T0Akt_Io?N&pn&iV1UWr;%?b@7Pb^KZQJ?rt`+dtka;C|q;N9t8q zZ$g&7E;%dX_V;gnU8?@x$bWBfSpB`h{@&34H?-^O?dJ#T>xTLLRQ|51ubj2Nm<@oF22kBH`yqdn z$%EM7A~hcIkh~_@B_8ol;>M&O&t{#IpW%k?I+HzSRX86!=`~S>8J557o<_;XMxB== z(Vf|x%BqXrlDOIkZEFzaOluy**;@uzR_tGVX0ZVk1_4H)?!s#`MH#35-cV-uT*dDj zze@)+d;I8(CgR-FkEbFlHE>Z62R0IG`x9s$w3quYMQNPN_0SMzV23JQ1?2tbKPs$Q zF8_Syr0_GkI*6?X$36P?RZc}MKu8X9(yuJtS zMPOgd?;-fM#lP>qb?cfI-{gCP6^i-X>y5QY7@T2#fGrij>aT^;iXGEy3kUjXSSu8M zd)0%lCo}3}MDzZ%bX(s{ooV--bv-b!>PvRg}alST3vA?gc zZBK6t=;wo8Gj~=PS(@2TRrXK`!*Y0V$}?;AbzU3Qf=7`py}n2}6dV57LQswKFqixT z_|LPez-od@sRmR*hJ)-MmOYm%UP;6)uF4m=l22(i#ISu`(xnjoG!~lQpDw?#Jz0RO!Q2ae^zZBp_Btwit6sEaVTb!H`D@dpCP1tv#(+tKbsDH zCK;Ghfdhv5TvQR(>H$KkJ_pQBpmZvGa5<|3SBKXGns1)9!@rp>E#Q^Biv)<0%`BB- zq_)_{$qj4kNovFW153l`TD6xJhxbyx?wb{J(jcLyfM<=YqT_9Uewh4&{nEgp0EVo2 zOC)K_yLc5rzl~!wh+rw%dm*A7o6UFCRB7VoG(?4@;*CtOzwHZ3pUk_>u&Y~rj>_ax zRC*$KFkXGIsbkS-kzBe7{p%0)A8?1{Y33zQJQwB`FBLN6Sr{QkY=S(HIuE%IHktoG zkMD0B$p)~5<;&9BH2s@oz>sK9NZ(pFWjzgf-!$V5kF2{?65?&cE~Prc!7;+@BVV+ka+=T4n*+ ztB?C(3$AElLYaPM=zYSE#6udSX{w5EiYCgogU&6Nit4{g68{iq5YbX%PW-;`=_i_O z>i*`T={AwN26V8nQ797l3@f-5D zyGg2#joREaTK22>Wi_FZ&t1J)M5+;v-UzXM^@}1p^#_UK;n}$SERPlgWXEJQ$q;sd zO5OA>f@lFCp+&T7^-m&GQA{#&myJmfVRl+NL+^j5cJ*{zq4L|U0m!@Y@2K9*>xM6G zeLdDj6&D)r_YobK#Z;B^y0a2>Ru9|@>+Wg>`^h|Vi!K~|X{Ubd-&J}+W6F*UjwoO9 zgbwQ`{Zi2Z?%zRSH0eu_gAG9qg&vH2)0j4hgbuf#_3k4Xd(6wr+xoBcvc!`|xW1gL zZhu-&ZlK3dD0f~uro9pgCS4~sy7|6eN3}5kNzt$We9$m=zftd!nv9w1${`?|)=m6K zKSs$iY7d;H^1p3%B8<9amieQQN4B$)W3!-Lfg!Q;?)e`M$CMrAc(|E)n}DgLpmq!2 zbEYUF`Dg5S7dWiyvUi&4PQ&swWiyx7-}8nkMpT!x zL!@8MBBxo8Oi)?Nxo^Iv5`G~GWU-3+zB-DdwiuKd^Xi{smR={eD)o0-2h&o;sh0uq zZYMnu%(1utzi>?)Dv<+~|9X4nVIT`A7q7Fv&ybF8p*SSoccwGZk5Ei{6gITEA?@kR zTN1WQ(yd6qTs>rn!bwrGZC^2B1JnFUORk4lLjIZBO%WX(*elv};MP=CQR~R)gm!54 z%|Q`jLd#$jmtE(avXZb=sU+y%!mQeDaPFxs> zSjZbAqLR!&Ns?YcvTs~X^)o-*yFV0me(YY1dG@F&Dc%TeZYR4xs^;q!kR~#u;y*

#j;;Z1=^gYI&Q@`JeGyvr@jK`XG69zivHTN~RsVng zf1}*7&ynBS=uD(sp5f9hRYL%(nCh0vzwi?CA*t3S8B!7g33VCqd9<+vrveP!P$KK! zLYFreL~FG%T4=-deDREPmCIVN%@yiqYfxHT@+U!o&a?!3H6pR z*7;>uWrKpeS}$D&u=B9hn%UJiU7G|PB^g6Tf4pH&JcGn4I4x<(|2o ze7fB}o(^9xT@GW6hAFOUB+v5)snE&v;sU+w+J+;wf;HPzcCM2g^lVyIo*rJ!AsXbR zn~US{GybK{B)vbUfR}(U0jonW?^IBnFX^RpsWCw4RQHCgo*UF~rRDOhJ&uf?QY9Ii z?J7GtY`p`JC{55UIJ#rowr$(CZQHhO+qOM-Y}>ZI_xs=5jTgJyQC*dpot+iY6&;aX zU3HEhy|0)tiLAV~LP^+?NyhDJ64CW8AzcDwtt7BU4gA2^AfDW}Op2i*J)|uEZ(fZ@I$2ZN_n|^=E_KqN$a~dNCuZT-L!j-8i zmOr90a_of0ae>M55_2Zit~YF?1CS&TSow_@I4ZlP8{tXqME-qbQ&B2WB!zrF1p4Dw zr!*jOM91Sb3n#TrL4FTiSW$-uRULo5&Ox>%U`OJt%MMrv@+W>uf|ct$WePZnRP4#n z#Y(}?jW}oSk?Gkgyaz+FOrHy5c0_VB2uq*qYwh&nqXPS-^?+8ayHoMVL-)l5+*cZ`T{UJYiX1)sf ztbb^C^+)D2pUF5B5pvAhG{=z;yWO3ip*%$4Ew;xLmeqL^!w!^^VNzX@(|Jd__(u@+ zR-4Nt1|&AbjIOKT{C!DQcBNMzY}ubF<=ud%PU{IK4hJP)5#SSbe2@qI%=rXXect&( zvtvtwP>uhBuvE;-Qw?@im=wX^^6U3+84L1#W8p}n2i`RobR7Z?#JmJ3*D%k~DVcQS zbL-c!BXPzr7lX4P4%$&A>9btrcX)5L1f}7k5cvljTy6&>u`SmVG4Yc!TqN8~@`EQ{ z<{**^44Imd9%$UvCyYh+G%#nDH>N#H@Zo(qQk8it4j@qO)X6x&J^4wjIR|#R@HD@>gh`D<1GDk z58mSUpBm@##Hrp+Solp>Cn#(8q6GD#TDcJf`!Zg>a1Cw)J`k?x2eca*IJgA2cpy!U#A;bxJ?PYC;e&2MSgSS6Kbnm~&@tDs< zCF2^zLa4GqLV~G-IGYN0aA*D_1oc`}4V&IO@(ONfS*8a&);IFmDm9KdY@jy5oEkA~ z5;?x+0YFLsHyfHsgo`H{pd^@a{zCpxaP6Bf4w=5#3rqR9sO>+qW~vzXrPTB6yE#=w+^UAEe`w_hfNC^fq{=eiR{wqde@wU}tnN_uQjO?3L+#?+zRzzgC+ za+G_@?azuh=ea#I!0V?c)fM^=LiWTZ_$h}i*TxLG{s!N1mvuvy9DK#)LQ@S{@4GK< z6R;(a!9}nzjM;kdOL0bVq&gK;avWEuANgkId`)?cK%C9y5f?P6i8WN0QKdHLdE124 z$lPwAt;L?}B4SuIfpfHvzLnODv*^28C5F-YuqCrPlv{%~OqggXF_#YXC}H+Nc9@*h zxQfXti_7za9(lW(x64`rt7JD+V`iCS+xs&1vBx!TPe{Vb^I(XXb0s%jV!cD>qbr)@ z74tfdAGj3NSf5{Ryat$Wyqu2Oon`_arLBwSd6CJzxWu)Fcy`VsgTB%Lg4}IhHxp0i zWv2sL?6cPC>r;`9Y!;kx{ba`lS{=N@M0svbvi?O1yV`MpWS!Q3En}21ID`v`3kiZk zA|1GoEG)_-;)JRWU8y5#8f8skicYJBx(_#>MEyaG6H%7~F>)y>twCWHpOl`V0SeXh zeHOdCZ&bC-=vq@&&$G?7>h=l_P>8iJ+hN9Oy$%R?Wfj1)CKD1%03l+U4X-C4lxKsX z5pff%1sF-)9?Ag^8rZ!v5(Jjbp}Au%vfu-8sx~u$Mbv4-(P=|9{z2de}r-B=Bmd z1&FrM()}$+XEyNCo^zoY_cyTv=7k_Sl;*tf%Waiarzp6WahuKP4mraV1u-ufY1O{l zky`6<7Ak&yrs8~X)K~FCB5-H)M7eXCPXUg7IgcW-KwvOb`{QJTcG+}&pmH(fF1ALm z!Q`*&EZQwaGh=Pzts9q>jQ3g`lfXUWG z@eq)cqh)so-%LYK79K;#LLGO>@jbdfm7*X{@}Xe%(MhrQdP6E7@9O&`zkQH6o$Y*rY0S2zI%0S^&r2 zRc<(FHo~Vsof(;rXF~ly-i+?QYNmF@-wbyNe3Y-^sptzXip2^MFu4FqKeZjL1g#{q z*xQEX(AZ^mk;8TOVvND`&Ix(`)Y={NB2^OtOH%!DGizGzZpl&0$EN+vW3jchefDXd zget;Ahi%v)`c{!7U%PkA*Uyj5b{=!{#bbRTmkTd}|0N>q!oa}LOK94kWO@{I+45rM ztE)bp1;UY4{WFqpq2t#`X^NkhXwumpP9yR6k6;?O?sh)_lcS-|8zJkad=BCROl0b( zGBhGC%ZP%K>!d?nbA~9m7GW$kpZ!%q*v{D7wzNh#X%l-3zwTzVzrmuu!p22en6q%s z{wdF@O55jjYxn5sru<3sfmkAM%!gOY!X6@H!x%*>af+lgxHJ)aFV6WEqaVw|B0yBW z<9WRm=|kYKeJ`ksU4$BTPkmi2H&u}wrp1*a@MI&@onFl7H6O}ILo4C=2e$93u1qrd zT`JmfRfqt6j;52iy3_C{1xm9&o6AuAs`q3PbQSq3iGY`32Acj^n+^ZG6Lqv_LDYuv zXnyC>qG=>ffHR;nZ5{(_RJ5ea9|<&JV-s-Omn@ZjiB?eS9`Fm+O*CZOIVPy8StGAo z?QNY$;)xjh?1}KG%;0>f`V;zJf!b-Zo-5xK?91hDbS9z(aTC`@;3zs`M^4()o0s&^;QYRe_p`x~j9kpa{~_8?q|~o#T^k zNs^~#<{`Y8CPp~Rdz18Nb-Wpfs}zG?f^t1TU^gXRJ4f_i(Y^LAp#Jg$Q4G1sx!6*j zV+{laZ}YrEo)upVaZ{RhIJT{ss^I|^ST;ZBWT`viH2t%Wz>@$4GetlixiY*n&siz} zAHMh|bm!_xQ6>C(Fn+(@G?aSoagOw5F`7WI`cHbbz)^9G}52h&FExD5TCi*FQf7YIbc9==j#{RpujJs z8Vb#tOJhrwR}TKW0K%Kg3EGe8x=UY?en0+03_U2|I5DjzVSo!0Gc%jCi>*%XsYjAI zkT?go(Zb4CfAR^F6i)O`2b}V63iN||{%{NW5%n&28 zu2pEvFPC>VUSedAD#P;MM?D{7(AW~IHG-Qb;w`P*XA3CcCqzV}yS~7Oc zLgB4lt43mN{<=oE`(A^oS2hKFN#q?Rj&VItpc% zWUT|m{3XKAjtuBtgK>$2>vmnym~5@Dq%T5nd-4$M#)8e~2c;FL<0*owYo!EaSw~<-D^r!C?Ne0|u~ELMyp2=O zA$iY0Do6IS#jan^7%+yNhm>=@B~Z)*!@MK}uxa}vG>@R_$+YSIpfcKfNB zcwO1`<{>7Lp-BLBo!MfQ-xI-Usla{&WiOOsI+9*vd{P}Zy1%tHs>gOS(KS`b&0GK# zSs`=y-Qb6V!IC&!H7S1|_bUh0ptMRO8=}G9Mq%cg03kC)%uc4uLB=kDyX#(`)_;M? z?3Pl3`JQZsC^+KkM=@aFa!O@T6OCbqxbAdQ;}=PQ5SBNy=|u%_2)Y*CjgnV>VG_J~ z5VS+vS%WpDeOv2S!3ACWEj`=^wo><&rxE>^lu`Qe-G37LNsY)01Y zwE+oxO0&4R7wc&M6@kjp%O@h&bU8ab=113C2tJY(Ca33FxnxkMqgz9aV0%h8e>{zV zC=i20ZKSDNzsqiROf{>fS)q&k(CJ5fxmh>W&VXL{(JXXB7mNR)VuBqS_Ld9n@DObL zTaXYV^|XJa#7Ifl|N5P*G``T{*$Dw!8B^fKk{-fZC*ke4#0|pG*D#4axz|#FyX`UI>8Eh!_?7Y@%Rv)F;$VsS+|o^?5$}QKE|#Yk8Wt zcU$_$vPwn{{!r%}O(q;@N}-F76j>{@{?dS0y|Qf7W5F4zdE(QhFL{jl^`=aJP)C%< zIo9J8O~-zL(*9Zmmab$$JMjfPBZ6I1-{+cdJ_i$H5Z zBKP{kq7~{&qasG^h>{S@wh=;p561(-z&u?F}Jvs2R$}15Foe2?9ol16)W07PXA50W~!ziFS^;=;r*zdLm;>r;pRNR=>(Tm|L zdE&#%2zPL}ZzX_Y@kiVBg@LP5ZwBsmA!uWV0CNTxWl*qk5N{hVx{i*X$3Pt@ufvQ@ z%^9wR<9p?W#n>*+0%Z{5bxqcf{uH*mK!Ke-N457+$+wT56J>Q5mfvSCc|1>peFhWA z5`-tp2#i)TT4-A%XYP`7cG+89pEl$kB?16Z|HLq0@x)`Uc=2r_y|DnrFry$JKJ=Ul zDjT{aOFjdCXSyq|mjZPFF4NwQKi<@nT0fGMV{mF{&H*G`!;%&S-`w<*kFlh_KH>0w z%a?yqKL|&<3%JPbqW6Hb3dr$Mz9RMCM8dwY$8=|5rP6LZMsz=P;d%gATmGkUQ~-2v z&U#DLF3^r9L->#tK5@S%krpi1CPJVL>@g^` z3eg3`(r6z@=k8y}Z#-L(_u3xED%1*NOC`aOThQy9HI&&srCqcMpyJIMOsir8&#Zz< zY%*-pm{M0Z5F@3-9`L?D+#VRS=v*B)Hpsr#MFq%jrq0w)hdJL}IXxeMnX(hOT_9TK ztEpP#eqjl<6fTO}{rR7n47SMYa(}BeVnez~>NaDA7$C?4L+!mtzoLJQB#rxgzihH8 z%&R7?u&~FmFmAcW@k|>FrEYyLktdlis~NeRcBrCJ?PQGP)-^XykJN-&T{979Nhyx^ zGLiFVME02M60~!{4Jej}JSR{`KZf?mQ|bSfLV+MDE5;7mYT@dtK44a7_8LX^Rw+@A zKG*uyA;SjOJ6+nvg$J*GgzR&XEy9Aoj?|d&&dXK|2o&8jI3jAQ_%tjV@o`^J{?VM& zD$pb-Yr;w+(ROqMz$hks`iV=as4n*)y==e3yD!EI&R~bt-UU)w-0zBBRRcJm6qUSa zq$R_^h=1BBwYikKGkJLRYBi;z3_8)_GTo)j z_FJvTB=pRR`$#t4z-W3?mRYg9Z!c%yiSU9AmVN-ATomBLDS(R!-Wj|4iE~}+TtiGD z%5FzB1D)4466|E#JUG9?TkMja(>Ku%0<`hoZ=HG0kVJnS!EL$o>O7a>!*7$h!G=@U z=5044_UE**l-sf9i>k0Mahx5RX?GDrOkHy?6@xerY@gc+0)ZC5Y(!m9Oeb@r zIzK@3pt;SD@1dV_J(>O3GsLao#d)hab9}znOn(Ne{on*^$i@{Jzz84gN z18-=6Rt}{Pv3k7R*vPqf@~j}}0*dub!t^(>Uojcwb_iMuT%G7SJv5eohm)OZx!gzT z>Dt($$lg|g6GeKuC%B{p&&!)yD>!da{{cmKzVbh8* zpWTDBW@YEpE(!F(lkzA|S+5Ct>A7k*K@h!1#jZ?SlN74mLNO>Er5~EZ!OLgLB++o? z?vtpG1yQl^_NT7Xks=??iRf3-n$}lVk_%7@)oa#v)J5*wqRDtmy4jgn=l)BBf)GdW z7K)I5%&zK&K@b9JV_-e9XPbGvxCuEfz7Y6}f~h!ne4lqN3J3e{>9{jx3YAn=`0?80 zx+6Ie;>>#t=C8AT_9{Xp&p@b+A1VZR&!zGSMJB01c-2VL*hLMJ8$g>E+~Y~!5+MZY zAjJlz9%1la^mmSqT~m_FjxRz4`&njuW9MN}2nJzeNN{$fXx9`s&$4~{pxqwFF!{@$ zuD*ckbZ^#&cG@0#{dALmSl`77J|(0UGMpIk1N6cQc=NaF@`n?Vh0zaNFN$tTW~ z!P=YCqOu`B8A^`0-j~T&T<^>4GH*X;%lFJpx-VfEG4QTA;e3MP*``CS3?2ymi(Th>3 zbJiIJC)>tGDDjW(9i*0K@zQk$b<4j=5cbBwxc2P2s(;OSiUx_D5^7%9&%k@O>b_n9 z&26Tw?Kd$RGpaxjoGn&rCWJW~Jb!rd+f4C~P#>U8Gf?b2H9gmHcJ@Eho4zK%tQ6DJ zH!pZw3%v1vYySBY$Nuwol&7TYHro^Fk7XX_#&9;*z7!n*pfzq%4hcJ?Z zon>-Buv_Ks#Y4H@pmN?ZMrna_IYGUbDD9yiH#SCH!jfXxYCnBF*E>-pLWW|4u8o}_ zY>KO^$&F4%HC=Ypoj^0$7}u>$r@{0`!1?v+S(0SP`_HdT6E!l1^s_*P0qr((cJ*!o z_=!G28>L*`#1k%HnN0#52vN!GEN*i(l?QP8V#0w?Vq_5VJWMt=B~cC*I?$t6-R-EhaCbx;qs(bGU$Ht;R~sxTb|dS)jp88%b36HqUT=F z;>9F$czryU%~BhVV2FRb2@!O90UwiIbg{1USx(LH4quvoR`WKBKJ^$rwfd~Yt|h-K z*L;`YHdK6scAKO3fJOAaB;!JtxZ#{JFGwRf{Uvd3F2&@OS43mYW4|xV(2UexN#gDh z#_v0VUO(!v@8liPG=2nb#)o;Vv8u#Qda}#jrqb@ozsZJs)RUj`+0YaqQO|Y=8&+wk zbU2`fkC6%~NkYMk4vsqZkvRCHmp*4^z8}J-<@Y8xl7RdPb$Y*ckKCsJ@x3)hgCpp< zJbLf4P5-aTcYh|1<>^b7;H6g?TCshihGdfdlQ;5 zYVAcs9~YS@%JN;Y=$ud0d%nWMRN%e%sr_Y#?)!CV97!7+UX0-<%Ac**jWP0Tk<0jb zm(* z6u_*j=Q4|C-k{ggxzLD%@LoWS1Z3nX65x=e6VwQel@6sqYxlpZsC7c8W=h^8 z;a3>fz5!1bv|k_C=b-8pZl0Gv3qs-)R)WVBWBD zI4r^<2B*F`$QgA#J+=ifbWM{KH-?x#c=opXJ$+%)@f;)9BiUDFb||#e_Ih@Jz0$+X7T|Y`)^~Gjl_iK?q92T? z#t)eZ%S-p;^P9@q=gLw>hCV{L5-i`6qT1r`uX<`zVnf4pDT#V!`v(S$m1A~}U^3N! z+Wd1a5w&6l7K%anfA?f^@~nv+@64w^i6>SRhPe<)3#_sw02 z09xABjQuV_v`oYcZq0dAg1KG<}UTcwVkOrKzEZejOEhtA}HiU8Quz)-#$U^ z*YEbcn6M`i7y`mq%!Vbimn}Ey>`tfq{MYa0IEf2cC9LP-Id<2S-2@4`X{sSm?ii}> z1lCIc@UUJ{#{eB56vn9EUJv!c?m5!okOpmZpdpld ziJf--kSEr76C@Urhp3-J<%c?DXd^pUWpn$ii20?=Lq!OGodbc7AW=RE3cGEgA*!CT zSakEm_D3p0%*gfm2Ib)v-B%qznV#W2W=SU61(S!|*c|$e8G3Hh@1=FeM5C6M*(wGW zM0mX=VIECfREqvnRaRb>rJW8?oh&5pciqB>o&x}gDEZ$oKwHY=v#b2=E641OV_?8vu!)UtC=N z|17^c0LXy?(viW*_TAz*o58bdu41+1Yt$*fGM@E=rudW8b=yEJCeOw~ACQaN*N> z4ik7Ncpnk0h2x0gE_D*{14W+jx-%ZQE(cc!KVw3|0aW=iP zGD_euVT-=67nrPEv2~(~kmRae%9g{if~_DrcY)>sC7&-2zDe?1kwZuf0>8Akx(*pH z=T7%bzuXkG$P3lDT7j$qt{iIt4WoKT(pi=LV7PKFh(?)Y_+O5cqIX75G5CUyQ2JiLFxYjP=$^9=%jN?R z`Os)_1I)wip`6WG^-N@Kg3PGH1Fw`RCB83A`-fWe-1+Nfo{d#mxar#UkvdEZo9u*; zcjt_z`L6haq=u*k$?&4>hHSwdWdsfdflWNm{9+-(0eE2-1HoLAlJBF^+nR$l#zjp| z)D%RCKhD6dv24C<*SYBgv!VZi^;zj3YkH&k=1ovE$&X4)u~^d7t%UkemT%jl&&~`h zud_)k0aG=L$u-%$4f64*hwDqLf6z1E%|28kA^S{OpdkRI3D!tw{}wN)3W=@u!v*{q z8N}Sag~UuQFW_BQoZZz$IjeemPFF70azXyFv>11j;6ZkY9bD_5s*XKFI1jFPM2gD3 zUFZv8ocABalo{dvs9(9ju9a>8L!u9;U!Z5aa*~6#k_ef&KG2@hdg>aGOVAuC~#P-8t z0NV*xzD|pLRf;K&K#Rfa3`;C^(S7>Qtyls7z2v|5^&Sh&pM;E1o6-9WTRg#@v9hvq zzERtpx5#Gn`Gc==_IdhC9S_05e$!^OAE@@%9|B%cCj@rp@Wz zkkQ{xdch~i+;dbuKepyXxJirHiq7v0Oqo0&FA{VFMhTWHa;nMdpFSSQ8n0PFy+6~6 z?D=*0Bj{y?cm4YkqvCyVwq9l6+vfV+zp92hps4Y$h2-iV4cGX&kNT~x2`D^OVN$WH z)%Id4bNa_)VBQra*L;BB&9Mrqjai)W^TiiWpIsVsFIKnrv8LDNZvsCZcL zhfuGzgDBI6{OUya6k}9~;?n{I484QZHFkd4=p>N~*GO&dD`;Vs1`pTnAP|3ku~@x{Z4Y(ZWcD#J zfWczZMA#{Gjdc+LR#yv5PFY|hQqWol?K&a8f4)qtRMlb3(npu?zOa16Xv1t9>n~dC zygg65w=Oroe324P}MaN(i8-XFlU%*xT;kQV1cMyqKl;a13sG4L< zOgkkO-x(q%{(}iQib!BMU-x+!S~X-*gr>?Lf|mJ%efi^V*MHN+Hehc8I6N zBAcwBI~aG*8Khovw}R8R8Rx(|B#-xGLq$K(Vbj^|p7MfUYNlK~DVI-<=z>v2HJe9y zY@!Mwl-3?fG%!=Vxc}54I+7<=S6nWj0!!CTf$L)r=nKJP!Eq{WU{)w_{lA5JYOx8IU z2qH6u@O=8U@NTTE%OV;7>svHCSpAQ#8LqWFs}gKU*0v*CLv2f0Ck;k9yQ)kpYs-WN zKkVexjx>i3DZc=;3yxgd8jw_6 zi0ayDK44j-UMz?ZuPH8L`^QajZSIAO3C3)IeyC=539q&#=kGHD#zLrM_^gX4A4JAJ zD24qwBDQt2`YNl~F+zEU??H#juvu|ucnRPelOIv=!fl>%x#Z;TNL?QpT_tWD?9U6e za5M<{GJ{&Il@3~}V7e@YR+g1p?&Sqbgow`EO@ttuo}oN(@f`v28LMF`eUy*b5lXao zCxYxB({DZ@dO#LRi(1ZkPj6bvHa=C`a%ViSlRtnAV~6&N8Z|3I3w6agRCFRt<_7;J z6Ptw{l&hrYPXV*|AVVaJ*eiG@tRW#Cv?sGmSi)sZ*q@YJ@KmzTCN={-xeg@9LH-sK zwdQ6i-bI()0cZFHc;^sK71Z;e)WOwwd{^wC>sxSwIxb9{5{;Zeao@R}+)ts|CSps- z=xZCvgd#^c5eTjST6`5L!_QxmyPV#%vy2zGB1t4asLdND*2=dcCo0hJ-r z#+pYer+}jTU+q^RKFyrCC=;?vxa6m1`!9UK>V1R(FtDfE?#r@5+v>>=I}P4OlgeGk z#2Lp%qn1WwLxw~&Nry&@8cIJ#?xs+@T~7y*CIPWB2%yWcua&WS;GtFEV~eDS1jq8L zRsDB*@#+@feTH`#f!XPtQ1O9^;Do9?@cocQH!HFoOiV?O{6o+$)W=gm=RlQE%WV*} zooRUZQbLl#Gx&5NI?u?Cgw3I-JdGH0^TGUPhg{0`TjoAp&f23GzlXo$CvX92nleN^ zDUo1S$E~pYlyJW-_VqzLj}8EEi%OrAJZ8PdCpP1?oZLz;W~3#Z=NzwG^u2?$&XZ7n ziC_#E-v|woO8Ln_tx{{IP_MhIxbem;Zdy)Q1}UYu%g22ZQ9nr^r%cl^sWo{4?`hf5Hwb4x zHg6I#3!~Z-nU9zcwUq9WKh zD$#+HzU{t?I#tf>q%E?bL!rF(DF5O)ReGx!&Xb~)OeN84Zce0IL)D5c^KlDCO2AT) z#h$6&yxhL>%qL?t9SGDx$?Mt(6a!r8U2y7#YW+bnXONpG9R#|hr{Mrx=A~Em5+iZ3 z>~0)aU^BMxS1%xLGOe+!;kWSnn|y_dlmHGBLGg~7|U@~_%_HPT9R3Pyog@BA`)~cjj$(|;0XAm zAOJ!x))a5XOCyNFlTzHCmW2zYL{5PkS{;6c-~u^2GtdVP znY&ZZ5?d{(n)r`{;cRU>4%DC3l3EH=&KId4ysz8<#=IaeJVh7IjNwnpccgUB zO(R2vIV>+#{leGMQs&itcBbMC$PFFK+ncZ8=ldVi&F8{X+XBnHJ<9NK$>~i<9-F3J z(UOf^LYZOo$XlF|IoCROx>Q$=2b1vj0H#(HF9l7DfGWipq2toOrcod?&YihL1tle0 zxAQXbv_Ex3)~G7V9A*j;8Y=H6@X~&v>QXDuzrk+tUWhf|Mr{}Wh?Wc zDo_O>Td1wv+iswVDi02BVKcJsxpO<=XXJ2%F=D;mqQX>i4S)PKycuE-!*ltu#L_L7 zNl9bh87?4tG+iiX*=4-L3T0hR$`8;2-GhXsVX}7MVB(9Zds&?$(Ob^^l+dZ2VXql= zer^A>-d0{kI4s_J4kULV*W*3PyEsIuypvHob)>~5UJ(Xt3td|JguR40!Ya7}suzwn zQaFHg?o`^Yr72Q&Wq~_{zPEZfX4Q*}C)NeX70ON>fWhGmdI#{gCD!vU`w5xP%3tuC zkTc$YbOcv6@9Ga%6=e-}w%QMwAky>pb?iVoV27?!lCogVIL}1#RUOdbv+B7EreLK? z$@fm9N?hagyDN`48?oe2DEZvD{}7{ZH)&5I&XIk`rGO|rWOF0E8Z3+g1GeyD9}}(% zj$clx0~KDeCESG+*Rw>-*TlwtXjBI}ewhK*yP-v+M{JG{@-RJ)wh6w(=&GGPt z6_&_-78NiXVu|96Els1rn;pu}c(Xm?-R^I9GDTQgJyIYn@IhB2ASua?N5Q0J+*FFD zv7K5e@si2+OH}P{p(!=?E#Y{J3eGEUD(&1risxg9JpOc5QiA{rctBp+xU{*Ljy6 zrpj2ZGumpvmvyQ;z`COx>WW=sWuI_|}igI$drzja%;9 zwswuK=a8&-R;cqAU&69ljE}Tz>2hv9+}b6zx^LsHz3waMRLMkxG* z!BKeE)<(f56ncsdM+Ko|jzX@Ffq4i6qFo;Dz|=8()I0 z%~@{eRHi*WzG2zb@-qSGgFXpX%NI{n0GX-bZI71v_WWycZQLbDA2f2;LpKh!)KOrJ zN8Tn=wB)sZR42`_JUaN7bddz-rcGaa0v9lIHTejj2RrrV%f?(GJ}yI1Y3eq)w#Y1Y zlF^?X2>x*mU{N0*)}j3iiY%b;Ru8Vqc8%Wi!EJiE>z*Bdd$kn%>qvN;uvv7QVF*Dj z@BH-`DU5Uah=-o0V!7|6$w&vn-73n3pL{reg`4}@e-Xs>od_<~k2J7$r= z{+QSWeh?MnPvw$b=vx%j-~o}r&%q82ank?(A*1c9$_akJ1iQ8&fE5QwSx_69<%J$6 zs`d+-WbxjIF=*o0w z+Fvw+=(Zb4`b#DGKICb>u}0bW3|*?bDUubJ?~Kk~l3FE!nI0)qH{!6{YarM}E+#vH zQeC{`3zS5~=rxx}G?`jd}$#xy)Xv2pM8jO92 z+?*k0uIo^O#_dG8V|%dTe`%|)(e<{uPnY?AG0`)sc=`>L%qSRBVi~LOYeDhxY9>RH zrg3kHpE34JQ9ag?!@Pp31{_<|vT;gd@oUsV-qr}Cs)i}ql?BJ(GT3|A-+PyBZKf>7 z`F?r%V(4#*2w@Kn*K4xjfT_|B?`Nt>^u{5$0Y(T7I^!qP7G08hLOx^NkEPum8KbHf zV3O6nb6OPmDy}`gWE(BL@b!#W)apsd{X#7Vw2|^YdEgs|3Jkw(YJl!lPXFXg)}>Xw=Z}}wC2ssm`ZL`X74%Ahyk0$jdX@~M%6C(e3W9__ zj$SIw$m{hGT7Xs{I?xf0XqsYC3K3%BZCiEjS!s{O%uVrgW%^%V8&9;(8#~8}X8v*J z>f-CrH1)I&VE+_@Lr5*TqP(^r**>B9jrFQVsf*mqIeULKMz!=xk)O0x#9zUK@G;lp zLWmCm5jI%yD|~HvrWQ@WH8`)pgGQ4>I>wfi}3jCRbKvjp^pZJ=SuL!250)2#fUF!5-p4I^Vff;XV;qJ{_*l&Pa z$Y029fz=j|g`KDGxY;sYoYiv!hY&S$x`_snyf^Y)oFpFm3VKq*@p~^)2UAD9LUOci zUc+7D^{Gptk-ViX!pkPV!s9nfXEC1b4e+B}sVCpcw`KPB9pTBDt*O-hEX7#GkqC?? z1#o=0re9!74xRfqsg88YLM@oY%=9X{b zXL^Mfiq!Si9_aegV{(fZpnUg3C4h>5He#Pzwet7L=t@(rFj3$#MO?MZDcLf(3Qkj8;SM_}01B>oRbauFDV2=mBz-+Z_X&^bvZr`broY*McZ-r|9TTU6FsB;CIj3 z-j-EE^6UD3ch8|Qf4)!M?#qamd1o=cNTW5oD-F)2e@)RTp^pSYx~B4gx5ABsdF3gV zHnp_TbBRv{9G4yR^Hiv%YcAmk@X(nBKY%ITPD#}ULZE4V?f?BNW~Qv#aEF9iSH<>4 zzMMtImPdvQ6-~+D*v3N&&8#avpCz0bL48v~jcmw4bVJOm<0 z-JQ4$>ru;pcc7EmNSwDj-qckRUKURHTrzLt?a(TN@i6?aN1)5uXk1U%Cpp&c_*tw$ zea9k)niieXUy1F8wH$mQ`EN}zf7gSjJLQ0x3R-WVC{DQOr*=zyN5)&=xW$U|&*i2` zss;87bRA2(tjRkiQjV*r(n2Qb1xV_gm>g+S2o=kL>t(i{5ifLzEH29$n++M08c*_a zWzLTB8E?2yWV`eCBk|UXg55L!?gT`IPvrs^INAw+_g^#0L(qy3g-m$|fcjrju%X$v zrm2GUSQ71sqRwq&P~$Xn#DDPR=>ZY8ft?6a#5In6l(9&&13SKO32%4+5r+0TN!gts z&x@qiFP+|JLV`A;O=3k#7bbPza~l+a)qGUr!sa@M3OqJ7_?SY>dgPs?cIlmypj=uh zY5i;ivxn|kG2C8iUi>eQ;Tm`nncR$NG9|PeZ>L#6Z$)G?w>W115NjlXA7N5HR@$Uz z>7pa-dGMvl>#%fSkzl1Q0Ehv;+~?SHJ7&Wzjtm{z%eTI(iNDmD{{*WH!Uw{mxmR8% zrJ#!*6U_xO%R^PVWK1mT`7^?1PXiQg2~tv1g>*f?I{Y+36XRZ4fM@g^!^tEkijNF9 z0iH9slrLDV*;cN{si>%J|Ll1vN)RVX5XYJk75S;Cc7x0(;S5<9lymnJ2)z7xE4VB| zu39+@Y^YQ>yE3FEuaOfeny;_r&@iqYyxmQl>sP;Y*0P`Y)ten!ko3ikRCsgiZnVWa z+uasUhh7fGM-e+6Z0+bYt}0IgNuQiT9%Wx&RTArpuovQ#>hHzc76DZBa|(O+8J%}H{+${`QFYcxns~B= z@ijffUR4P;Xp#VulyZK@F9+A!lfyAcj5_ie@O94p*N}uG zcE7F|N$=B#zy#(tyPsyBhCE0+90Fvij*{oafV7u`wo+=%7Nw|W-=9}n3^vX&Pxir! zs;!%N>+1{^kTl!z zrssLRGFt2*d_H;VoBvr&&{BXI9(yFjlsH$mC3;enNx_$KsHsK)11la!~V$e%J{ zCgD;gwnms%i4G8kU(grEs3lZHP{-A3m0cS6Om}^F`llOF6_DG4kQD(}+5-?>k2C2D z+xMF~DTonoKTYzZua$d@HnN6M*T?gLV0IbP|*8i$M&nxClE(5Ifo(5(8*YRtIBc^e{lB^pbrEL zu;!W%G%yxc#dao(t`Hc2Q6FN|Gu6xcJKD6r=g$MUw16)Lu~LRl5CUW0$uIj1iG26@qcZUZ*cH5~QPl(; zFQoAdmbopoT0jQtoq!y@!~dc)tlA>mJLYFS*}D~Y4@z&sBjao*gfuT`drI@bIku-H zMo0j8AXJ1$A|=`0VRf%%Dx0!OXiDkLcm6N`wt0)dmsWD<0;|3P-|$g^nN~jTOE;tK zDR3^`n|gFH3%{*aIt+ww6KKrZYuEJxMN=^gXUD6>a&>k}XGseY{$)*zZ)Xyp9WtYN z+MqMyRI8D#yLwZ-T8KW+>*~9j>Ono}by5A+8>=UxYTET|@eLThEo8!IRPLNYUiKA!Mt zUoZE= zUP_oVl6p3oM`yMtzzoq2qs02SQ7(hoIUt-ul;uL+62Hhw#@-L_?54>z>EEl^o}#R? zV!B=B@zm#0J2F#mU?St9Klo~@La4~<9)&x0SvnQF^UQT*ZoB_SLZ2NpiWJDK8z-1178MigBW!U!^Wxrv?0>U0 zpb&JmOs9tMH;}5=;Oh70ict>)yz>y-`ucx#g6LR+nO-OX0rR>JjxAb#KT;bCP++nD zO>U?<;NMAxdl+gFwq$S9?H|i#O@6pG8I-22-2)AF7I%{xs*|ODS|-Q13*cN3QXp~w3N$r;x$2}=KRFW( zp8oAAp~{E=jCzG;KHMXWy(L1znA*-6F{0q^P#`-%!b{EFN*MetoJ4CqdOF8Je*zS| z?bsOBHH}JMMIBmMG($XXn+M9(j)9_X&}Wngf_z2a2QSi{X(G}S8rZdf$CrsfnPEgS zsLAATo@<_HBK=G%!E|URX@X{0RjWk}F@Uri643bWm6V(kf}XG2C7iRa8+{Oglc1Dg z2*Lj{tYK(n-YjZjdieH9&~^vlc|*7$!yOO)Oj0dPL|8lC%f~saYbWkr03Y|`K?nlS>-46gXqLz2G5gMumFz5 ze};9`plgWg4iu?^6!g0v$QDv=5`I9xll~O4h`*aO0c40tsth-3g6zxX0rE5uf);l2 zB-~rEK!W(pQwQoBb>6o+9gtd?gLGG8+}X-6L(C%tJ76HvD<9zis;drkC+rCIv-xE` zACASUCH|WGx=!c=@6fd!2}-GDBB`so|8gpy%Ar9ox^gYgg4tuVPg9esDerR-2&|BN ztk6a)m;@8D1bs?-G(t7GCLT8`D0;WtMkLs=&!~Q;%m7tqT|6MpyeNJ*y~03I)m(pa zRP2eu;6EuccGcJ393rbcD%R-!I+<^ad!t8F9i`^{oKO|Rg4htTcRlo!jvl5KO~tNz z3n&Up`xp>}$f$UfM_}||BEZ~+ZFS%!XR3B=z#H7dchiuf z?V=%_)8>(7(5jGo#~~X?0G1@f&w+-6cK#3J@+R8B$mV|VGW|yC=Pz~=v)n(8WYP#G z^v}8-w5f!Z2>V)z_DVD9*fgz6$4~^j@gX)<8{SR*cYr$)H10r3_2rdJIlmD@;)LE?P@Vua?iwyva6< zjBKtw5)K65#ndrh4lvrtPWGg~ofL37(%_w3bkUOwk;x=I8tpvub2DFoKE?t5k~b-Y zP&_Ex>K*WS6g z&C+G-*aO{%!~x2`5;dCD3=G8l{vw+*Cs1gpffcd0)fiQ!jBl2l{agb(7H>Wa;<1N_ z_dnF?Xc`Tb=N}PEdalOS`Z<(!?y>ZQP$nwXUF(@6`@}RX9*l~cVVOh2&G5RH63$p9 z#8a#Ntuw}~CjRLTCGx_vwF&0<+WgzB@7&Os*uWj9#YpU@Y8|yt2ZVIehbLF+H)tWxv zP-y%;H^A~iKx8s@kWH2(4tYnZC|Wdw*M#V`L#sg9@0)(?)}wF@yWOQD=NIwtmqqFu zeC%*qZP&wl&Gv#uy3})5K84^|4Km=QomCXFuBTfCJ4uqvRPoLj)ga%ABqM1!}*-ou+ z4bt~cW>6r^AiZ(;_|!X^Lee#g@5%AbENYX#_^u2dHG5R zh3p5gk^mc+T7=2fng-*4%qIM18(*jzIbbMVUX(m*k=JZ1^UF~q$W|^UoCKYu&qlZM z9a#R@_xC7QF^&(jtolcUhr0YIfZ7jd?>OvZA=`d!Jb03X?dccIOutNfi0=D7+yG-( ztmp}V-B&~Z8UUc)nYYt~h&t$M+jk~tha7-kzj47NXgVk4@+IRt);xI| zeFFt9bBoT-ZrRB(nI3JzyAt;WPF}hcfUTe3zE*UhDsL}a$+pY5&JGDEZ4x$O1k;L| zBBrQV(LWF9Jdp>;1_OV~{rnD)Br$At?YXJ$ICGYYYQc0|t3q~PAU)xI>KMbY6H zBQDJKfKF88Pq8Nvq17;t+V`*x-{)2|k<2?1b#Qu48irW?Xq^8dx;^ErzE1%Gu#ur7 zHl(aSX5HzWn)rVBOO`nqpt`}Ww6$o3w48C4!}m0Q04h|?zd8Pb86?x`G@`az92F#B zDdMy!@XVH9%ep4&P~=LMM;7vX_%%@21C%xPHVYKEkuO_Gev*3y0{?AI ziuXPpLhmq4?s<7EleEIJK;)_$Wp#`-)z+xR478&;3}7(g#HV)350Z@KEdaTo$V$d& z4?}3K#KOgU7Xr@qqKAAfwnIyF!qe8WuZ(=YoSyD=015J-6;QmsSyHwt2e(OHT4Dc2~vJtFA_*xieZ>9Qkr)JnlMX zk(UPdmSJ;h3oOIAThFWpl78#~VlB@K2uu3df&*HNRj)6^%HyU+bPOASh8hw(y0TP3 zmwPA*5r(+*=e=7tEYcRO_Qm=eu`{Tb* zc8M@LX+BB$&%~2cw|5kHX+@yT3-;CA1ZQN~tRjeL-nY^B(6!P)n<x z;`wg4#o&HV`g}i-(1PP&v+fVQ;pC7kr|I}`z{$m}vlt%VA873QI4!K%w`g@AOKioj zxNCQpxAnc_gihP4eQ@z;eGluUcv^QeTyJd7v?){%&4Sj_EOcR|HySNKGj-7<;8eGE zwb1Kv%6Shfq(xhcs5;7&uhCa@^Z*{v?k)gIa5o$`Mvq-+Q2f2&OJQ}WmHEnR4b(4L<#M4EVC*@?vBdj|5 z$Ydc0&dhHvjD%Yk%3OiPd^Dq0P1GvDdo4?T#wQ@8&F4)`v)tNxha`hVr8+SF#n1jQ z=7cTUoTQ_0Thv;k5}^PLBpzmj0O&9-kE;t7lAtRj1BuM2S1nHx5!;SxHgq#FEYIir zmw~I0%$j7@exz{DEvi*BsKgA9v^&xZ4CS2c)_&l_}jBX+ST<{IoC71K&eQA*I zKp!HHN1e^^EYY#IR_%eCi zl%91xQwxQb$RCcwjwzf?Fdr&_Z}2CL1cf`PpMD+FO(T!V{G|5OcCjR#3;^$n1o2;d z8w};bO0ctx{>2PDIY7})Dx86(f`f)-e%U(G(;=`MEijACw4+uZ9>Bcs<|`BM=)38X zc{VK(c-9Uil|k>)A7QowyB{Dssf2W}MPcUd(iRS*VqFqnW9YhK2g_tXFDg5fVEOem zxLw1IcEI&L4i^~v6YQj#5-9S!aaA-Wb2q%6k6ca45)#@XRR9~oVyih@0a0D;|d*Ghb{4Y zX6vGI9*UAx;c7zi`^Ka9r-D;UmLy~NXpm}YiHn4TAw%OI3_!*TKR&Gf5Bs&a#EGUI zw3gs5(O3wQzyd_SRqJ2^Tt5*?!t^YEoRnka(*w)YW|OpUtvs?r!=N6R0sX<8(TRtW{D<@P!8(kP)7B0octvHJ1QZOeZZq&Z!>~IOP+ahnwkUM` zo&f(Eg-mgrT~>PcHzn2!N9ujxvv|_koI9PjEYM~ANWtl$<~usorI}5-%`2$^4WG0W zaf`By^3gmT+;sg`D`HzpJ^xgbSjbe92T}=5dNT1iNHRWo2z?dy@DM*`*uPN~|JOh!&NK z(f|>%2qm5v_R)S=`h>G-B-`sPbF&`BYeI|xJ-60?m&az%78k;JAW3W2MC5qt)6+G2 z!{_tg9*X7M0iLcd^7I|g0}^x|gJ&VH(d)jc@2uhtIs+^WhbN3nT*x@6n{e_vE0%4} zsVu?5b5A!pWQto9I)YlIcpbC1wZ45R-Ypi!8fvtvXq%)>^?bac>R7zv|59ox?Z!f_ zj33q7NHgO1v3?|le^K0-*QWL>NVhH`8moBqWeCPB!!*QdYrxipUYM$s&>G=Opo=m2 z3Y|3t%cm0jgHid(tg-d&W3(2s&)wwRmQ(Wf5n9*QI0=@v@u6k z5w|)fgG-F=Jj@Wx4q!ZUeWdQ_DLp=Z zP(@ugyw&f}y0N>fG8sX+-OI9ZkLi(ibhS6D9(gXN)gD8S+2*a&?P}czO|gGNNUCkJ zj1t_wQ=603r4kif+94DJYm~Y5U^~(t#|_e{c8F<&#zy0zs!(RnZ&?dG#>rZCM8|>c znO`%w&KXm$TU$?y?+DT_$S1ch=W@An?Qs}-2g2V$a-vjQIw*3$pH}$EZyv+;Eq$Wg zA@yOKI46|S9?~XCVc1TZ`Mr~6XJgP24#?_6< zHW8LVR|w4b)rhqU%*vP$Fj9@ik9XcGb6(pvo;8=ZD+DPxlT6EMQrEM3N@- z@g;v4eRrsc@P2ei24qf%3gU{RKet(%9U1HA6ZonONmx@D zK!L|w&}XElpaZ;o#n1SgEk6@-RnecEoZmj?78uzm2SuK{&}wTH07uL(;Sv+FO_dN7 zYSDffNY0~FmWWmqpw<2tQ4oi^=0%@}mPkbjx*ts^J}s$z>vZEIFxai#f=LG=esvu5 z23txHweEj}dZl~hA2Ru0B*1rdK(-l5gTwWYE;2bqjbHzN`y9Mcbx4w|VKKZwjFyMZ z3){J0g!O=IL)%wa9FrX>p5J9#@?j{nb(*|T4@*NCo3bHm@18tg5a?iuz+YQDxKEdm z{-Z+KP&P9VGMP%KBKEah;*M?)XOQ9=TaGS9wyD%fb^EWRCFL<4~eb5s6>n7NoSV z*)W!bzs?|3ixqibK!%nF$>+977D*}z{^qY%g{vOj2kAX_w|&%wN@9JwvoC?FRsQl+ zSN|&9k3{r%J&k@no>1g9nk=;_)MepCaAs8# z+nzY)0O6Q;uxmefsiv>E$BWd{%HpMhttx26=~ zrC6JCdJK#}XeUh)knt@AaX9H1tQFYY6?Qcob-Y#*E$nS{QFL(ZJV^1Tus}#1x;jpu zvMGM>Q{%MBljjoPwNovvm~?Lq(R%QQ4y^j`5ed|-1nTYOay-Pi$k(?A5WmH=(4!fU zEuu}*(xL{#bHPZYuMRn%W#o3LHvob%&@n;MH#NIB`}duEkC>y~ZNL+(ughMy6d56z zoDT*_$5ZP);r7;H);EkW!YNT#cV|(LHa&70*__qhAJ*gE!ABxbj}}D7!P2a*b*8rz zdg)d=70AcP#pm+7Z5)H{XMgANzt6+e=04w0=zYGO!1xOez5L(I2;7ql*;sypP_#g2 zShAGC5|5>Y9tVS>^xypPmDB=)@r)dm1wcOGA$pY>VN1G5I|Q-I4@+; zOQrb&F$d!Es5T2M(b$vhC4Q zA|g!hFY@9+>X1BUdx87?LE5igV7N1?bB7cijT#b)5T=qJTVJ7{67%ydM&G6Q)>`(H zV73)E2<**HD9YxF{b5;~GT4aCQ(xw}D-pcZ{;{0s7?P9zy2rXywn7r1Byj|`Ealky)I~!MLGNh@ z1oi26yw9T$j!2q*as4dEe}W%txoo+~CW?C59uuyve1cvVfn9PslsPa4w&6D8ZZCff zK-VXUG?f<&TE;rYb*xn<(3LK*jt)J_U$FYoI&)iG62*;obf()Ni&iTN()hP?SXS4~ zQ>gDP8W(fhjLeSo$%%Pkokmca-aMKJu^nItErOqYlvkrKM&v%KZyGAndN-O6=hJ^k zhm49fV#h2Rz4b30$BVRc{nEL^)?k$8+;C@F8LHY^svJ;C(q5QYh2{MGa=%;r2r<;} zYEItm+ruNM59FaQZfHyaUA)#%5*dD*Zi7k`T!4@TknZ8Dq3W^Q> zqIP!n?YW(@`A!lt^CNk@sLceiINzNUIYv~ywVC`8VGFfZR8>M=4d7udCOiTxj=AFJ z(^P09dQzn9ONg z(K{5>vjJ6D-O4@EGSRGRg_^CM6CYbHwIuX)1A4dk2z{=4)+8+cfL?ZQ8KyniPcWjp z`7vq6U9RBc^u?1~hL&#I)UF4`?a4&dYQ;Cfk?IrD^z(dgHrK7MmAZO+*)Z~RazGy@D1Goa8>5vNG>`k+8m=Dvd+bYk~h^x zsNY!z)0~c0!C6Sfb+*UMz7pHQH3OCd<){GYw?hL|-Ypb;bN_*qi3-KPdhm^w98?jR$^Qg*2WGPq==S#tF0Q z*_IbI(QF=->AR;utQHSVA zI$E)Z=BUgDMr}k8t+lE_mhqqJZ^7SKW~CeR1JLObM1@;vt$9enhQ6!ged zVk@0k4NMp~(KI`hbYhubdsn<_V|rs`GO#v`511F+YfWfLQN9ktouR`4u0@rY5v3Gu zC0@u{#6-`nkALDv7Rm%hkWGGF239)<+`S(pfCH(&(XO4`fN`9@469Wp74j1UOjToL zCoQOT{Y73@ukc65?wU^#=iB+=4U*uCQd)j@+BTCwTef&tOwG1v0->z4fBzSZ_cy1e zer{WRS98)0jhO!}N$N~AeTybFG6c-t1n)?1B@9el(#HIoLzb_M<(U1W#7UfC$vWCL9-()NDT$pnYo-eJmPP=9E<<(x!a zF5v*XX}NXH>st==`W8h-h|C$sTH5j2KAjBbz9Zd^R_`GfsEnoB$ zGYL_;1oP1YeE5$qRNrDWVI$PFBM24Q=!H-ZVS)z4kj6hb=bi;m6_N8oM4DmLh?9~I zs3q^7ZT%UU`fut{xcaEMZw^@^VBbcf+FB_&^vma=2Lj1JPHPGEwoMJ+c`46DOIOUUsifE`9}qZrp6&s0>nAUsnTAxbw^ud%+Hm7-3FJd{}S zASgo!Q^P^TJlI8R`I9i!Lm3UHa=%KsZpT8d8uqp8x0RwkI`pN{u84wN1@4Idf7C{J z-@Caxs+^IF{tWq6qrUxLgZZCemTO)v@@{+=`v(1cke$#TTxmP46|Dos)A=kWZlFh70rg z;Bzi0k!{)OUzhbS#{{FYMP^y~uIg3Un&sFYK5U*Rg?DmQEkiL3)3bi*K+Np{qbf|U zCdLr4jew6Zx$Vwt=Cnj;tQN|qxPjCuIqB_RX*PiHx%s3%RFL?h%2nqho^q0&B0M{p zq`YB{906TGlV)#|^r}63N7V*TW6wA(4LgRL(aDAbRE2-H_*a|WTVHLdO3xW2cUpO5 z=c$iE%jC3)8@fw!LG+Zi4uIiZ{!EwVmFLXu;TBX{Ks(N7k70E9h6w}viPlQg0{##3 zi+cqbldrdG#jMf9)^oz%SzdwZAFBwj^JE#YiH2=Xqe69E!o8Rl_fQMS4+js1Mf zh@kznHQUJv?>%C1-(+z5Eum4c;Fw?r?4;yM$)u7#T5K5>eoJ*mM!vA~*{DaQeBGoy zO2%Q|vE~u5k;2{_l&>tD)2w@0s_BX>U4(Y8@_17zJ1)X?^lVvBjTt!ub%sQ#0v&+- zXuCI zuPr_fk-$fY{@lAcBQHLs$S+e9qhpBbn`_~u-GC_W$4iSa#p{CL-fsynRl->7bJ)Cup!KW&qxgAu}UM_E9{4E=9NfhFqJo)$D(f;@8fbN310OFoYf7 zZa2zOBi!aM5lOyDP2wy^cw+k1H7#bhOY`ymbBU zkp!Lcz^3X7Q%e{8AuF&!v7!4hl8A%e#%S8!0J>D^y-rr(VqCbGG$Ql7DKW0*1RG@- z9vl74WeOOrYw~elHTB!1zQ`%i-{D6==@UklK_0^KjM^Kzt>|F`^N|}gByr+XREjOn zLB4HawdhN&3-L@aU(?EcD&%px>LmdB$~W(Oq~c>&0I>-cuUs$jJ>nd|QOs_N|6qgvfB$p2CHUV5 z8wO~m14gv_NapZwR z5aa!{%e%uH6QyH{UO+~;P-PKI$QdZ{^tEG84*6IDIF@%jgG9jSpMl&gih~PBE!yA4 z14TZsNccI4u3PmwmA_;W5lq{_!b|8N^0=0J$*XzC?yaHBTu=M64OGVxwCp!!SO&k8 z7GC#`)Qyf~-|uQ}fR`^CBIvxAz?%F6hrm}LBXVCo28W#`X40>k_%^>Hm@GAwW;vz; zM^qFM(s-;fk;$A!^XUM)^q)`wXEV+eGJ}!D@LTWBCzwE)ZBB;YS%%jmyulN1$cK+x z{B3*FDRVHXxgkaEb-#*HpxW!!zm&9)moJ(`&9mV6#Qz@*3Pg0zwT&O7YfLL%6m(w2KTi(L5i1=$2uPJPj7P>0HFD%Ea=5)F5F{ zoXFGi7=jG5BzbAx1IWncs!WY?W0B2?hN(YyV@21S{R`*-g375$Y&WNIjkeVw>!}t5 zohzkz(<8z0Yc_`F%U8*QQdgQLc4vbfawE^e$)AOhAA;DjQ0C?AXaqU6nYX_bCnM_M~6g%MR2gtgG z+)uJ=5O)Hp6$H$7@4ID8?()X=;L`O)FS zX+ZZ8OMAMh*7CTTMT2AxA81l0iAxab;&25W zu{YNpri6kJ0000000000000bw)U6{X;YZOYIL-UU!GBzFEEA5QINpB`5Un~ZWeQ{y zEovwL0000000000045LK3U8jbvt6Y-G{kOvQ%0{85;R-~dZxa@-IvROd zsKrSlP>{f(>@J+YJL}uA_G8= z5J1WWLXCgt@ar=Bd#wH)`u_&xXYlFc_;%I&JqbUC-edT5&-^<&{vFqU4PNveb^wq@ zto?s777gD1QCfee5gv4TYIC5xMmb$zi(9UDIKN+L1QmqnAJ(K#GAXN*r4;opf9eKb zJZo?bM4eAliOo01Vt0jvk>GLtodn!T%ob&BMEKqP`0vbU|2|NcaBux=zL{#~f(0OZ zowTIdOLKtKBPl=w&LMzCK4r?IyzoFt9r^ zB}lssJAg4X?51fQ6TKz+$+0s2cxc&yrz5g2hZXFuBKkkqhh`Pt3D|-t^{4$m&UGUI zYXi2K%XL1kLtwBGj>M%z^qk#fM9wsCsDPy;tOqC~-uX}_jp>(;M>ySA6^DVWvJl$P{YOB}~lS|6bC* zo+wtRy;hEIPmMIU3!g_u6r~xyP;@=IiEU=t@$@L^yD-NQOCBkV*{M8r^QYR>oGp6j zoCQ6$ECOibWU*bdWZiwN(PMRMfW~nO#^ka$V4pN#DTnM$HqIn!P-c}ahCAH~i>NrX z7rNSXJ`57i0q{kNJBR@1>8SPC@|7{$wl*|A)vkGT0e^$=^~ny)>RC?W&?1MnC!W$U z_Wj?m+u_T%Xy^;4h2@b(>D=uE#XCPfOI3^zh;UB1rXX~`iJ>hqK&fyq%L}kfPup3M zHrU7l3RHjHz}xQP>wdZ>PEW-My7M0YN@W<}CEyX{%qWi8@qFCWl7+qpVFa7`VL<|I zp5kxV+<=|H75hvCh+w5Daua#n`8-YndW6lN)UV&0Kb5G8;gk?=A2?~pR0J#PM?mKJ zzE5|mtCBX+FX!b>9{c9$o}6Ej>Eg1iB*>EUw~%ekOe)(n{*YBhhZ)aN8!0-KZ19r- zCkVXxkfFHER)RqkT1?-(K8)OS@U-2hrb)IAlS{A}vVR)ZSqXRAS+b~plJJRBAbvy- zb-1T9);LkKj@p`$IC@n0+&E(rkPOPb=VmCp`)CuFXK-Ib5+(<=#roIo2+-2M7=aS5 z%pu8s$XgH_`#!`cjeo@^&Gv2H&wd8aiaa7ljUMc*fV+5Qf}(peZ1Juuu;yeFNhmf= zY>LHTi!H4>SXWu?IL74dZu<0t6Rm2O~AuxB`qO!p@k+X~(0v(_f%z+b^(5fhkZ?o^I(GoKoWa0Tx_c>GfUNVJc$} z4Cdry%yIp9g(`m8L?*|1i;&vER5iea;;q&8Hj^ah87}1t#@f9(jpnOPHr-)kq;ow+ zw(EU@NnVU_*$b2pw|Tgf+Lba3-O6U5udbF?d7TVxM**&qm6f*lmeok@79or}q<5bd z<3UJlU!w-?HIrkt3c>r{d{1uomCN-}U(V%7GkHiQO@yHz6eGI3g$rNRbgL%=SHTl4Mfu9xTiP6ACKNX#J76fZCjx)T~20m*aK;n!! zih*}bhXP~zJ<4CRBaFk>M}KyrAN>Ll2TOk;Ue(7kl^B_54g@lnh`#kR5}ZmaDxwm! z$cH@`=LMMnUgG8OVr^PE9V7$tFUY`vllK?`Bf~qdNY-+tBCGepsL1pk#hk~vAFHlY zXdC)>+W61ozH~^h`@WQvr2!kqm*7@==v#6g|N9fAk@00BEWhHV%rJ*n%)7kZ`o2G8k^JRP0!bcW7Efwg`i);5Fah-*6aIU2Ud!Ag(?T4X2VrGc=zDj|w*&qjF@51L+;;xEny& z9sfZ0#|KaLIwVeE6lT9znBH5W;kMCO#U$K@@atxR2v+DAopP3;+a}CGQ&CQN$!MpP zQZzwsBWcX62kgqV#z?r6`^tJOky#Zhd}awE>^?bz-{lX#WXl$FQdb@#)+WL|Y%?)i zTBeFb_5gb|XHcZR2jrx(TWZT2FG{J+CgfPODB75N_H?uT1!wUn8S4*FH~>2J5d&Z|3LW&dy0MIPDb8Mg(8#dOV@PreZL4?z7SjwuS3fTWUHY z^`FN>m%4H(VS&PVW{Zk(`}Ly)aE}E|VgT+rc9e)#j*fIxTt#6`EHr-K9#NA{2h{75 zy~4Nxq=y4>S+?+&-{C5vKi6k+SN~O_{~MQ2>G96B%?{DH?RR>YLYi}Mswh~IJ5pS& zqK0_IXkdY)*UDh6ux$voN|{koEu;BCBS_7rLVm&8u*c{J5+=jP4{le06S~Z(C6h%b zUz)W~+8qD&oF=Aqk#|F0JF9dm(rMx8s&;pX(bX&uhs^dAu3=-j#LF zJ&@PQhE(^#@afBmw;&89M>H7~QpA`FWQ}m)40a^$;vg7EDi71*Jvk$9?*%G=;Dn}B z8H)-;ledT;n#fxM-`4T2@LKuNLihq1jxf+G=kZ6oty2T4t+atxWNU zm-bT3Q(s@(Vi&uFpG31c#r6$mZ%#46y>n8n0xBmlk?tgnfDoS3`~0Zl&})m!sTT@g zLh(=75?pRnqZ@PfG$KAzO=wx6u|tNgv5dR6suETh5}H>!{ra;zK=lGT_*WwyHBxIW zw)djDIGy6MBb~Mz?Efdc{C23s8>37F`(Z|&uOQAhez@+X>SZA zeBzN}<7|oShbUK9QxcWJL~khu^&dhsJ~qlqBoq(8hRC^7K~Lke$}kfE^r;mU8P z$gp#i$`-(edWj0JhSNj)e+=gIgWHx{21I^u(45g4NZ3D=oNzHN-f0h$>?LHfSw-*) z&z@IymgC1B>m9TTeSnAY{N8*p`D@%>lO7AxFr5HOJT8VB!1@$DQoK54=O=1M)hVo% zIt&KX8Z<2`^2V!QgYLjiD+TgBTAhIBARZpfj8l9i+h*6CK41HXzeKI}gn@aC`rq}+ z2A}ZW4*VjUw6BP^Ze4~gDAeiyLaM{oew?KIvQZ2W5u45Q-rl9cAQ5i)XnmQ& z9eC0}XfI9EfnThDm=m_C5PJvIMLW2%mWyJ1S*X^7dZo}^r zm!_PGP9zFspQ?%#!=~djOF?ctxvPD7l;M9N?RzEf`;HHZTPsl{q2I#)AXp%UWGf$Y z?m~X6H14SU(B_us5TFRo4C(KIugKSC?80)}8r~p&vLt8CpGen@6yEIKlV`)gP$9k# zlMiHG6aI>xNDig&n-5G&QJTpz zT{?{|z=%bZQ?*9^ii%53yw@1K%I7RKb?%(`*O7A)Sh?oaCqwEKI{-%dk{#jUg@Qp} zZ~1t!IWpHPjM-%}l`mRH=df^jh-6LBia7Faf%G${xmo~sDjcSpzBwuM%jh^GfLl0ysTTW+<`~ z&ER_Q8lUZ4HD{^+Ds(o(#Dtu~yNWH0Uf#pqeHsdw?@-OBO-5;&mJtPw2fUJueDu3$ zf_?aAQCL%1VkyO3(jtq1`@+(Wy#4OF2_kq_j$aR=snOgk^XFP-IIeVhvsO1VH`DJG zJopUuHQM0njlJBv5HVrzVJ>r!ui zaIz4&*dR*)avsuj*>Dfl6g&+50R!Wql~q*A#6)*?gP~_6n9x_*uo6jcmH2;g@9LsA z`P5XyRS;0}j*2=6YR8HdF;bAe000am8rgctgoE7cJ0mT~4qAZBORxaH<)FBj4e-k? zq|?JKcVANZt{ykRzK^^6nljF3VPeDWwi0+*W*j!i89S0Ch0-=GoHiU>OosXMi6GR~_cv}Kq7|Ax+~(WDf*2_xNq`?s^D+?3)%p+zbBZ|`lclUbtJ|{mM*H&s zG|cBUjjOUpq@YP56XipnhGeN8FJq<7eaPGa{$2yqry)TRDIcO2z>QjqTW1vBzGudH znlAwTMd!)*d>Pc_Z!iq`aSpF%r|#VT_Uj*&=x0Pws|(Ct=)LjSTZO3qSD!A9(Na+V zgc_o&xx3v-57_N)73I&v64{nrAKqc2T>vx-&gZFs_*WHB_f2s!z~A#w*$ZpTpx?Y^ zKU5m5N;l;O)j|@|!UYi*=e&s!ImFmSq6;_-T$}=axH5QGDK`O-4^JEx%2^>&<{J}m zopnG2GK`|=`5=l{BoSuAE;&|cfNP5P^u@kwU-&p$rBgR0YN&^M1FALjqUNp&5pPbd zkoOH;yZu@$4eO_cpgrvUjU@^ybuzT-Vs-&1`kb8=Us-w79@53(WY zvG1~jhU(>HO9z7<0|C-p(D+y~&NdjBqMj*Oa`Y_%x->)!;xKCK6OF3j8!G8jLwJr3 zmSa&t_X{^csxZ0-w+|C^a7Cs|jYuPNU9*4%myeB#lZGN@Igs6F(FFDa+@1v@WV=VV%%n_s2shLVC9o z$;<#zPbCyFtAuWZwS&j^@%HGd8@tLh>}7eAE?bvDnO3e}r`Mzgh#<-FQ$6fbhyQ=y zvv&EZM-+A`(t_+Xu%)x9KsAB~H{t7m{Sza6BOkZ8M=#Y*1$CvO5A7J2^Rx%NtqpLj zytWt$3Va)fgcIU;*|Q4(05z|Z{evO@1sHKtuPUko>ly2J-_89EEk)TI~WG^LZa{pDWQL|5tv@+t9Hi-a~Rlc)<%1fdwFeRoWZyOCrp{U zLNkMyQ;>Zu*AC0IO@jdqVzvi;;S7wHQj-XTkrIg-B2I;YSEx*6fPkU`KmY&$022CI zxNtZX6_A|vervy74-c^#uW_ms<7DEyepJLp&!wfw(Gm9Z+EVd80ZS7Z%&~KGO%Osp z2psEv>LhpK-#AX6VBR9}pT}IUd9(0A+?%T3bBZkfOBQp&m zdqs8HP$0u8zPM+-QWH7Cq+90@XWuR^-bCjx5Q-@z*pG#08M7>h*u(q(buQ)vx#J=A zkBM4=r1P1M!CX!}1UPtAxol^l(RzEB} zm$-(rn$pE#)4`R>sT`UrT#P|HdVZxzGJn!QfpNN=WwTIrh7|+6QZA?a_e2U4^S}$cUjyBRigJZ0juofAs#brNhfR{qty0 zymr0*M;>aveCpMrW6enspIfu@A|4;$k29U!nL7qYA}!cOzhq^aNztQ`~L(Fc7p8_L;%IBeYTv% z2R0mExclUMeiJw>Up7<8{-;^dey~n$Igkhe2K@=af@fvb!{u6)J+%+a687!NiG`&t z8@Y#5|1@2;$&NwEepXeQ3bK@OBzl8YfP&>{VPl(<)IcfbBK@RW-?RHV1M(Y1iAj2cY3OKP)OZx*dM2E}6qMCEL<^pC!C`n~iLTn| z5QI^c9j6=S!^^#j zk)YkSKzoW4M<$~`95#E}SiIAr>mFp*i8MKk!N?;!&yM^;eW^_V4Z<2L%oV?~Q~DoO z7wR`A1Y0Vvrdf4%=%ZY~Ic>w;1e0kUB|=5M-8c|z+HO>|qn)&#lW2)T`Z)Rn_RHDU zidArgy9BzO?k7CHgRHjE{OAvJ&zG*jDRiyl8&ED_J7*nfr4UuzS+j)@Sx+{-csqqH zup*~+MEaR`4xLMIV5&+8)m1QG@|K0ABp$5H5T>luoTf>#92fD@W`E}l4My)Z`*4A5 z#V}N1OPO80ky`Lg%R}+K@y@VF#`%J3U4;^9>=uCf%>9k#TlGgFtuYT^{Vx1j*+6TS^r)CRvrjIt4=Lt+f6H0iKTt5KggZ=++FUroTJT~C7|6X3=%r&dU1sQS6Xvi zOfM6wP5VE9mJR%}REl^t#k~}2jYjYa90ciY7GhYIQ69l(PRNp(w-LW??F;j0&!*dUHoNkx8vdwBk|Nb@W3xz__B$63!~( z*Zk7v)`lY?*y-=u%XLoC^1kig7*F>m`88Xg*QW+noUdE>zg?Gd0a@WUm1X>Lhpl(L zQ(BfEM~@W59;YHK>m#PW%GFd8EJ#=z?}2k>n0tik2ykly!OcQ*^9SU0a+#$?sULNe ziA%G~3|I=s!6bX{R-s`vfXLu6q=00mC)O|#vUEd0xGXPJk34KP#RGWb4sCe~piqh# zl%5M;Hg-3x0(mDjC&11)f+7V(jw(r(+Fg)K=1z*3$@3h=ndoj+G+w%^Xyb(Y=!*Kh zM_izEbxhk7Y%LF-Ps9LFqjIW@;7}!6*^x+tDQQ5mQV~W0yv<4NY8CL25Z(>Kc|hmc z2v?PT!Axs=>IvVsh7-luq!NfW01t^k2w&q>S%54p-MD6V#bLrCkNf8v|4{0DN7FF3 zuiq~NJDqN0FPH#G0^+_< z2&10Ua#OW$+WG^(wA7bq!3#s@%VIY!6#Sc2;C@FF{_>B8qs>&`QzgJ7fIing@;k*G z$7HMdBD_i^BePgjE>pz)WFC`(_m@TG$#Sh;V_j?5gz6uLa8?XU(m(=BBZXJsF+=lli8*pAhHTsyg0_0DsXtM z;rC;DxWQ#1y^(EE#J_l{UyK8-U-PW1#B9Ig_WBk6-uORnbKkeUyuRM_Z@0R?;og1r z_q&Jf?*sPtRr`C3{k_)!^d84<7Ir`J1MK7z4$u?0BSxuMHB!1XWSLL4H8+axFp}ez zJ4img5VE$RdY=LFhg5nah8VwiWmNLg{9%;tyw;kQN*qi+flNP!!NP($2P?@MhBc8v z8#hka&Qo7nM!8zMK$bJ75H65%@c&9~ff)JY@r;;t1sOuTnI?YISH15dqby*-7RB=XdkYAE6+M11{GnYO;X2KiAHg}(*V3CspzK;O&?KGfV z219kb+;3IrXKa1fPfoiP*JZC;`66j~_VvF_r^EZ=UrTeoQwGxenxXabl#0$CE^Y*GXLRn^hy7WF;J3*_{)$8cHoQorGTpe&s7aO%|S zr|lypjW>7cn$pCw(V4@8Z4rG{NEohUqxjGoO*K_zuF*mfWyH4|!VQOuv{1TSsha}s z6d9vDTF}Gb;vmNEb<#HT8zV0LelyYH z9p2tU1JxagnuY=m*zdfY9W%MuUKJ5gk17vbr-srB4k+pn^1(iBSr8Q0FB0{||A?g! z0s*}m^+&v`c;hL^nD)(H%60`b#Iot+pCd=$7>I3$+1C6l{#E99m+EiIe1_A1H>LQ^ zWI4cAzaf#Fy$gac{Q;P3aXF297v2DOMu_C#Rh?c=kC7yfe>LFQzLpu2j8{e4Ujy4}PV6 zjyR1k4z5-(w;}T1gZ2AD4A>ojbT&dXQ~L8B55Yb!L1W1V zw5gR2{8|g(i>n0&Bwwsd2;!TIRGngPE!Zl;+%f_oz~cu)H%#9O#ZwiXc~Rf>pTnpR zN?C8k$RB9Rae3-jo8I%GsMhr4&YpD6027e*qZ@Yv2$4Uk`OQk-`qus`NcpUMzzJgR1jX9A0Y68eMySUy1!z(Wbix_!mm@}7z4R)x7gs8K=N^$Eq=paBgkO=^V(|%rP$I4)1BTr7o#xw(!FCw$5Y60LQkr-UI&@eo=my zp@BF~e`(qS=Yc81*$J1jiR6-ibMob>bCc9+JmsS(KA55H;Y5yeMIUwvM?aNzu0Zve z7Mt7XB$MJZ-dE@`l@#th;#ZQD^pXb!F*~~#C{L1Moznb?Kg7UK%9?ch ztqoh>(MX=zeJIj0{a^u-vwfnW!jT^0danxFC%G0dtF3kZ8jntbNpZrkyu|&Hq97Wl zhygIDx&KWs`wC!fZ@3{hw^lA61fSKerSrtyCa(PCOS0gePEQcL5b85dz@GQ2`EmWfk>ZYVlIr}_DcRmd>wla+lDWYh_OQt zB5BO*JOIl7Vv$Dq1`rR}N{Xs%j$oo-;Nv++y4@LAEPsG1EgNkN;wy1V9>s0{9*|l6 zI+)zweYjj-q9fjh-Mg>rcn>$tb4YG~lgqK4qW2%X!OV!xyo;9?v#6?T(v|X09HAcX z!CD$4mYTxa-5Nicq5%kLXDbrp%w)cK{Zih>Tos?P@f5gpbTlPq*Mr`uJ=CquM13{?Rx(+z__|xz zp|{g8LddpJSWh}Tag@|`Zcdao-JA?Y17~dCU>fvMI;Um#vDa#`ZVam| zl4H9aX!(X&e)9)2^T><>Def!C3!i25YQI3ts`eD$#u=ZE#j5u-dLzECFn5*N2_M$~ zJNj^}*&USx8r6HqZ>_OT>^`m+Rj?h-90-vcN!Cip$=8pTDPs)tW%kuNFcr1EaKF&> zX6~k0mnk45`J5}wF+EY?*_UA7KuLS?N>b}~?Hn@MIR?>L(2*o+Y3%}QP8o z`#E|lp!Ri8ftD-SVh>;GH!86G#M#056sZ)J)WA=VD~85xoVSRfp%fAX$d^A#Oir?I zgJIZL_sPz;sq!S*U(<*^wPrhXF#mX`_BFr6zycy948V!mW>thl9VZfuVI3r&VllT7 zGK75r3GltBeth!+>dc7Cu2O<*1gKX&FONGH?Iot(nFTOf)LoEH3H7lg)qTIgiXYt& z{qqzbF8Q@Zc+W*+1V)dWnw8ZcZu~IL>G=sfOX$pjxZ@MMMqK%yu2p8T6aJ-7+NuQI zdpW6UWkUej0qF!@=~2_frl!p_7t`W7G*w_uVs5&eb>wwL&ndG1b%bVOrDZ_wro*2| z@j$Wyf|Z=6{pKdtHCZxasfLhx>PBw}H0m3Yw}TBUaKSFMB@64^GvQcg+sYOhw84#j z+cS#wy=|zzmPJhya*gP>U-YfbL_PVat+m&t+^v`EQLLYW(Vw@8jO)|2;(i4tB|b-L zNyKoJyV9QkYXGS8&0Tc8rb%b$ND({tPn7?A9gpJ}-VOx+e}dd)$!!olV0W*_Vo%<+ zeJ3m=R!75jdpwKEyhq810I5bUv#=!xHyPEbEyViHZ?{KWyZ%|4FdyEbK|bb(J;^wW zEHB3!Je0ZB8=>uty{-IhhV%EXewpPSQr9m|ilh0rSsbUgkwzCsFk+$9A`^%dFVpZN$GL2uL@eq%m%_l&|Vx3Yw7eHVi>nbWgm|g}-N3c+C@6C~9{< zFf9wrWU^4RHiG$BN708VAEHi=6~QY#j9jsyf}mbH7LChDDm*3s}SAQ zO68O`=8T<}9kHcy(33?@+Pvs0?&WblXx+})lWXEvci98$k7;>dmw)mK>djw82#a@~mv!?+5um(&poBKL z++p-^S$q=ciLDzP>;xOk`km~VJjR$78;0ixpNI21=v5`GF;4)3)17v@7&El3y<1xO z{*B>(k{`p@BQ$6u%l>n!R~+L&sr2@$?IC&a_a&Tn1Tg7tyjBeaNmqg5;)|e=!^1Sm zyoS+xTv6*l0wuIxXUWlO4{YqEp@7BHacLS5PrjsyCYB{eNDZS$yVz+Tau6s_7@{iF zlAzTakKc7{KNER1_B0KJ#U?0RVHbR;H zrue2Zx0VkKam64G335vl-J)9ek};;!?XoW52guW{B7QHPSOjgE1h@6W`p5e_l};Ap zlkY})sJ;Ih|1|ievu>!Ij6=h!Zh%^ zt>NfT|0(ZMC=twfw2&t%t+3!eIMy*PIUyR_ML$* z>ONL8)l@9iYO*39E4h@Dc7+PGEO?7x?qJ@|fOHJF_^aYQFFHPP)rY`^<(*d|e|>}n zt{UVkI4wMlgZPQYsTgOORhLKa9wJ@iWVkM+8#z>s{+pP7Q6+Q(Zt&{!`WvpjC;Y-Z zNrn>4mwza&9@mIZ5b>ChvwPX7va>K}v_~u?mNN4}#GTZC&pnxI*8s?;f-rW12Dm!I z7t(!aEFozl>PaBPj2_HWwZGBdw6T~z=`i0L%9j z{Fv91IMxwKu;jTW`bI4t6bwB9-DDA3-+P#42%|I~1sbgq`x$;vYDMiW`kq;_t8Vn# znwlmsz)oC^;qiMDj7H(!K|q9r)3zzXuF*=_hh_f{Nxkw?KXLG)76%j%#-ntIVtue& z>=zwZsGA*+TT)pw1)1pLFp7pE=SQLQ?a$I!P)}B$a1MEHe&|q&28m$)RedwVTue9K z>e&r&1>>h%F@W#Uh{i<>cfIZcfvE4Dp zh5)^V9A)ABu|2wVo2H0Ys96~)DmxfeYP=c<(4(Ud(< z$Vz_e7n-VmW->P8EoA>Q)Ozo+NK~uYdQ}(cjYYJTdyUXLjeuNAwVphba-d34m)YV( zi1g>gPm?2hyk`?ACZ$8D<_*(2!vy>0V5?Pgq~6cwvu500rq^dA_0$ploa~WWXm#_* zlNnYYCrLO#in`QoU&v- zidZ623>^DYd`|IPE}G`Hf`<1Kf|<8IzDU^?7`jBz?B@cQvHyb=fBP&QobF+~Q(3X4 zva#AT2E)e)(3_}{>3bbfMiO5@?tT;`c-vv4Wp(t^4StXCq_paJRLl`{ux~aV3;Tyv zYL^-Am{grGGLG5;@qJV!9H_;#dj1#2krci%V(qdF6qya|&1>cXgx;UgygLNTmlv+h zW)V=fEw=-fELu|ysO)m1a<3lnV5`1~{`nLIf%fDO5)gjXfV@FKVebo@Z4>Q?G*&#~ z21W3-o_mO{NmDd)S3qsgbI*9dZeUxMn3uQhCw4+l^GmG_2f|0E41d<_zlzQ9*)tv$ zuI)=69oY7+NwdS}qFzg{zo)Z&i-Nc|f78X`7&`d)*E=0^UJ@Wi=)5j|7lnU!;M|Q2 z^)bz zkJ<%B5UivDm``9dUls3m=;K`QcLI~rA7F+wdiSc{QjiP)at)JqDtb8bmLF)D%hLAYB{)k0?ygoRt_{A?D-sfEH6dzbTot zv3xEu;~k%dxD5CV-#j^7j}k}qu6_SSJc$2=XA2D&iz4dUfX-cz^Cy5y^gim%xv@)~ zF;9HldG}K1p{Q||u3L;cj@gMWHNCY8^7h@eIH$6)g9j)F2l1jZmnjL%#0QbP2n^vi ztT=es+dtK1UpKCKZP~s(JOM<6gfvO3>w~`<+*-8JA^cf(GQ!OV3J>UCfkaCg7#su_ zhNMI01IzN-C_O)lNRDCjay|W4@0{6$he-pI!Y;vi?PJgeQTP_BW=r3V8}P5uCzmcz z>M%yUIp!qYO==@Yw|;E7HC_cVpcE#8SU6kXiVO&pNDC%BjSK8fzhAQ<7g;Soa7m&^}3pWb`b5qBJYZ z3AlNNn>`=PUKs6$lrZYabvxNa=*21KXci9W^5Vwm>=)vdI;$2p#SpQZ} zqdJR&*8efgLIK*Mo`Mxi;SO9dHblCHfz`05_ZCT}hz$?XsWT&Cp@{!O#{rr2KTQj& z{|#OI!i#(%>|whwkdH0f31hJ{vMto5(qj~H-#7K&V`cItN9MpyB<=)O1n3i_{hJhc z!b$#y`8F9rRH2++msXd-PyBcc5ZqmREB5`!%R}1X>pMpHv~v$mA^yd==COKx3*T%Y zj}>W5LMeJGN91Cj7u44qp-PfBO%jAD3-Uyh0Qk`tS7h=|Yz3t2y}5x+7I9;gJZqbq zmyta0XiW%sXJMkrdb}k+!hD4}MS_>+lo_5L*stOY{>(?J~6 zWt_$J-4MC1y?ZFyeJeFXD&!V+DKxQQNPUrEd&6UYV-%T*T{;d6kFG3}(70Yd6iY`g z6aPIyH&)G2>;`A!NBNA389z3EjXZ5JA6rE3XdDMtsY3J&=K0+xxu!tY2~BgwW(kf3 zHH^ZX7Jw;S7jD+9#G0$Zn^c1b3Z+u!Q2k5;Ys?!NYU`e%za?*y#9qu*+l+r8!C+`P zKP~__1~4Ec)DyIR^-Y3>Wr^LIv&egzM25yxX(g$sTiP>x^_jPB+^2FIf1 z)fQI?0>bgGF12$dMdb=D9t~3La}>l81O=)*v9;Iq7HZn0g0sbC9Pe?iJf8;?U-YSO zh|OF|0Flsg%SfbyyKujpGTOR0VM{aU4{BI=zE1_I&B2h3B#*X`xx$z`Lm!!H*pxyHxMsV~0CtTQ+8V`SaC*HuEAn4gS1$!>Tuk;+~5s zTSrxFuV+lL!@QD$d5E6|7~qIEF06gsU~K|hLFPL<%^?7+ubou4!`nEj1i=OHTEIE6 z#OC>{Q zMVsLMTZhEIR*Do`kS<#7oQWO}da>jv#)#=VZ&_b{Dpr@DvP!dD(J#J~*H-SvBWABH zZx0n#CL%{YZP{{P?8DCkJ1K*1Nc)ud0lTj{E`IA#EX~0f(yyCJ(1_Zt_3vU-{_HP^ zg{%rXL=9bNeVT8*;Q$qvQ)GdL4g_i13QSz?{*xBU?xwL#_wOdiMKX^NzEthllZ%QC zAwG*SPsZVJTGGpjofbM9L^U`BtWa5x>^caJT%==oLKz|$6b0%;j-7yb!43Z91mSH- z22_V+p9v096875|v`}>qyOlF$0vzHqU%6RZ0n3v~6B~4O{tI$0f>I6QdD@&zGKUlAl39($r8dx(&cX7uXXX+h+I*9jg0Mh zdR6C@JlN|)xEuN4_+Af9m)my({{)#}Dp>LXA4mktI}P|Phmxd7TV2YS57BAV&RzqlmaDMXWC2KqIvTx$2u3)|1D&QU?9CxFDBJC(-#q&wSOmjRurO_#xe z9;YLY_hkH=2dn|2hl)HWb_5PMrLc9p(>iK14wO3)t)a%g4PQatms07p8Mi77&hYa; zE8PkXaD{qX{AiJKK^~5a`E}{M$7|Y0xvy5PyH0I7owQ)tf!6P|?7543T&+^4?BHsV z3=+MZa^t!$sR6ZxN`h9S<#axqWz*P(SPe7qM@aj$IjK!hFrw>{0BqO0Q{4+D-4HoPau88FmN# zZ&i$z+cwtC6Nv2RHU!mE9R-*EHG)clS#VQDw9gWh%>%nbb38DjHzPQYa~C*b3G=CW zKw`&4A35|BZ{4H+EOZHCPB2C!4AkhE{E!KV2H70^Wb-ts*EZBPJ4=~Dkr^(u{PZ24 zu0@EcFXL3F8+MbjkxvGz7%M`)$3!Ze_)n?nxKszFNr>$*Mj*Ff9f3ZXikAC@+#AK6 zvxI~qKoT!so^-dEd9jXuQrO0SC?EejS!TzM0a7~XTkYU%yevhc8Dk8R94}W-&U0w^ z(r2UUknimga&2`79(#(&*@e??PX{85Os6d>vgSQbwGVG%-~B#k)osin)Nk32?0(zI z5nU-zMR`bZy$rk3cbu&BEXFSZMUb&i?_#4w(A8y;Xz)E=+B51YD22;1wZ=coU7Wjk z$NK8xjeY2+ks&1xE9&Xi^8nD}d}W(Qv=B3nh2=*uIjkt;YBY7RjdmuU@_;fisG3WL z!Bk995-x2fuHz_4NUPZyo+xgD3$vc75gege9dmyJr`9!4Dumaez3>zcW`>*wrEo&B z9DF<3H&^ToZyTrYl*(vR*B2DCQw;wq*=eYlI;)!n0A}=s*)3wMc@b<1l$h(=He!ZL z!ZUMrU(h5&42eE<;Bt%Rq4Fg>MPZv7fV;L;ZX13mK0@VeZM*ud{x&n-+it}wcBj3- z6F8f8w?L7=BP{pzZRFC`>s8EVE7u|6a(Z0Jmx1`k`;F24u#Z8IH=2~&2q~FYm&LE{ z^m?5FrE?FDiG=SS8b=OjedCS)GvrJCx{HGN_e^HN`%bRHEPqxdPytcPuur5op)&cy zQWKuOnct%2p}p$5Cf5EDOU!ZvM;)Ixt!k*h zT(r8eI6l_90;K5va;A49HMHnuw^kuT{oGF8R)%;1hq_fU*xm>GV5;SEJ003%rvp2? zz1y(Z+UQWh#Hh}9V!~FY_y+7ID9i)TL7MPHS{Bk2C6L+*ftjnX3>tIQxZ-}Xx zHeR`_L*(@7Pvx9NUX|u!H~~^YcN;8qt$jLc@vywk%*5EhEG;7abQ)c*QdO{n0>Gy557Guv8BVNN8S{UTtlI1Miwr!?i<%PB zeZ2)Zw(P5k_0ntIN+gLih<2REqslJkibC)r-;gGV%HQ z&RJiS0yVJ#%3Ej1f?BItV6630ruZe4=1aLf^TPqLE@M$RMYT!HP$_W}Bl-LT&A}@d z`->K>8;08VDY6OK!ae^r>l;9Dt7MBkN=5*Wa*b)b5uc`nz7pHIAaIChX zJZ?t~X9g$87p0}tYoq+;3hGsOa2}l`z$i^+V75D~<6wL1-Z#h-r|l6MSvMQ(@G5qb zgCosj*p8u%ncOvKLx)p~EqbV6fMyf}Lax`0b^wk=s@>vpO_H(6i_2r}%P?k0(A85p zeI}zPH4o+vK2K)`+}iJr^QA@R z_J02A)`9NNo(XZ0;ArhZExxtc5|NH;hax zm@c-+e3phtX|5EM%v=QX~^f@Wzj zdFB5M^9OI(9clHL4SjE=Fh4488qW7ft8xKcFB;cq15DCP9nhm5*?HM8bbiD6)uyHrr}0r#MZNYl4h&FIB88-F~mvM zBCZ=~+`n$*f@MFJ-pM~uYI~y88Kr_)%S071OUgDyXm2lYEu4!%?B&yP)QzT#FbCp7 zZR<8{w-&JfOfK-+P(u&a`*?q{4|&y{mW@du2HNx$wev&8LR>OpIJsgnS_k_RdIgTwovhN)>mtkjgyptyQJy@bYV;@do;5Sj|TZmgaMO>nqTHy^+zGC&EAga zeno7iqHZIGW>BE0VTZ*CF>pCVwQMdOF20ay((tNq#!f7B{?3OW`P==*%yj+{x`&(U zEWV8McMpwg=0xWb;-Wx-)J_>cClf;iooX#s+vrpfi8Z09l2WlooFG7HMa!5{L^Dwq zGXZp909awe8HI=Ib)Z0jK(y~&#cT~YLo~t`{(0nBM-Ql5k!%pZH^5GXT`8-QIXpT6 z;HPICJQL!i&I3hCTd?1R&^;Xc*-T^Mmn;h(z|5v$qVOeJqPAGw9PbhW)KfpHIx-DW z)2@FU)bTI07TLIqe!pJRZTjHNBG!4Y?F@DN?IOw~+}q9_YcY|4)c+E}e~D~yFYpWN zngXSt9?SgEWBScSBQg(m@6KCDnbd2+YoHP5g6IYy6=eXhZFGeFY zw&)ihp6D|f0-QP9R8Ra|niNt=n(!fOiVSuA1wF@%GFv}OhM`|Pg4B`%77pV5Ijib3 z(3eqc^vhIi#L5}Ej|`sR=a~_uxr{~BoFU?92H>1mi<&_Ai16f1dE^DT5;EZ9ZSfh3 z^9C1IPjeUvB-BVMajc+jkFA*HuAWAypOKl6D{OYaAF^oPvjO^?;fB%`GovEklN>Q? zea)`>H^yWn^UeG8QkkC3k!*{d&>6CX?wx2|i@XdT$}h{eWr7>baMv;sKJadAgoqxR zTt135h^mRk)%Y7{<(G40qVl;Rn^Y3BCzcSy@`^&H zwek(JxfcO}(H+v*xUAXi9=FPe#^T9E}r?o|k0v0&YF zE?=ktGNb>2=Xz(>*+OuxOaFOB!Ht3$Zk|MMc|#hXt>iipw+N^sRv%Oiwo*?Sg^luX z2E(0SYSCF(j+Pjpe%*5XBN_h_ya%GY>~B$$FqtyrH&|7sPT`4f&v31Ghj$vST+oUE z+^Lo)uy1N8#P^r>{T(L}N!42ZT%_|7_?6(R!! zyg)D~KuN28FaX4u5%Yqf!tn8AwFGLMEZdKj;=7yB?aMVhCEhOC@UM@>I%ap{QLeo& z?lAF%#N^h9xiZ#Sl%0`9An+8|9Ut#FSC>5PYJ(6 z6_|Hv`vP809AnlPadSy(Ma>h<8CI`$zhq95X;;Ne%Fc@gV7czvH=sjHU>>9oX5ES;I!8C zmC|H7OcOh2ZA#W@p<1WJnF{EMxp36?N~$8n_vGaVLm(P0u7Q>ZuPY)8JF$%8lCrlk zzP$InO{iN=3T{QO6d#=@RCrwIjkNUExC&II&ogR46sPjRHVA*&+RUrt2J6*Azp%J% zic3!my;V^+3_^^$;3P2}yI_Y+*I!5ZZT})BAeNWX{tCQLcSQ?9yrT)LQWXKiqat>h zI^96S&R`D>7Yu~kG=|Key)Cg>ge*eh8+H9=E2(yqAZ~{-a7Ijct4tuRx-*0>_~Aus zy@8J|@)X$w&UTz1ovW-yzYU&AvHiyJ52$+x;N6C~Xt1=yTg)KuAmMNJJ_7HCtoGG> zTi;tBA~2O>9&_gpPY%T)*(m>VW`#OepGxF!o*)7Zo+P*mFO3@}HaT#gLSC);wCbh# z!{R_w8u8}_TRLteRS(*M$o+rg_WBt9-tWI}bzis8KQFhwo9*tK_;=BLzJpkP-s-Qb zw-4LgW%YNw^d84y!>zgh@-YYOmiEg4Dy$t_S91UE-4XHv3F|tMJ0lg_ZpNO+! zc7md&nP?R8uX-;YO8*ANTnM65%Ci9@pG0wMsyHpRLNv!TKi zA;Tl9{10g~AjER*`I9qvXdw@JRnI#0Oi;>LLpN*mCMntvP z`2iSY>{!NSnjhveqJjwS9^+Cg8#k7KNjc3jKAa-V5ui}R(-wFp{|Q4|MhWM^sXaZH z&p-73+tu(Xb4e9YoXm|HAi)G#kYPgAZ+8Pe&z`d^FfV?VN;0n!S7>uN4jHDt!KR+eLVbF2T{`^} zkH2v#;dl|1z-xHT^##l>OsE(e%HO!9vB!f7NOB*5t$B*=BBVfcm;`Tc&Z{qq4QmC)Td(g3*iNqVY@ulT&m}Yw@R;J0 zghdT>X!D5r;ER{tAMq}Qwv!q!G} zb$%_(L~YI!>5r*04SXAc5S>n@K|WYZxm%d)jcGBmo)s~(sIX$lPlaf(bDI0wa6Gjd z&l7yftu1^?NB!|2^)Su6m}T~-I|@da5O9#j?X zj>U-nlS9&6D29ZjO}5d{=oP(VNw=WGzAN@foH|_nX;E~poK_Q95pm2tMgn3&pEqhR zQ>%=+_saf#4TTQ`=(*4syMitr0v~;FYk5+ASjaSR0{&khc_qNLD_YmOdQd#TX{3GF zrwx50fm#07WlTzl(UW#eqM&@M6k@)V_NsYkLvKA}F`PkXX&s#n%cTWh~K7n3^WyizJ z^)euKSuls%n$Y8KRNZ>#nWo9PoD8d$(Tsz+j>O$ulMVlOR|rNX(;x!*VStzHUXEsB z>K!G`<|w1SO(^}*EUF^er)^wS;aCg^C<9y=(@d-FI6sKQ;`FXu!mPk@+u5I#Vy9eh zE)`lbnx?9NzYp3>HE3)(2#pj4F0I#3WwWTT|90fN^(>AXJ0_r4J43JE0ve(7|5I)y zwC)2!=wt9P!@#47e7iWEy}k>L0AZDEtQ!Y_zeWN3_=8lBt+FdH-}g}Q3Jg*0SFG#U zE4gotRM6IXx5TqN_EVhC_I@E;r z6YBWA>ak*!^yu85fuI~7>Aq*bvF714s3-lx;2(O@>5yXWlP%r&hUU9J6S<(RM_OPi zTF1=7h+8XWe8Iw1*Qio?LwhfRT$*7h|45Ghlxg4Gu>&5StB&pU-FljW)HI^#`)+`W zYT=#9gf990kx!?`*fm$W^U3DJ56HR6Nnt8y>4U6qtjg$d|4Mdt^8M>ag#5;}aWJl|$Vk?RbOBVOliId6EsFml?xx>~!Ro?2D;6L!90(MZvDw(nnC>+NbPM#KPe55^cWy;###LF>vI=m>=?BWIiFp& zt;nJDpQ0!Ue6b9Qe0QBo?kU`xv%J}R^)e2%? z^=gy0#H^cSm*>Q@ZOytZkNu_a&+o{)QfQTPW45fbhIQ}VsE575V?U8`-~_69mYzo> zh5ZA+1KPh?6z2q72_r0%Yh>aQIcQJ3#m4(0E|F$zm9@@Xio7OyYR5LaGPpO&7JH4 zf6<=u33zg5np*wicqKYP=)Y;J(jUUF3->P33lfrXh9T+_bQ(75T7@gY z*{z)gq~o?N2fJ8rPraIf6ck6&C%RsEYt3KlzbU-t+U3{jjDI{fO%QeMv;ydN+|*fj z0F@YxS_h3$$w3_f-qYg*L#5tKCBxi$wwi2?-Hb7=(zXcHt_S<5yi2ft&sX96~7+T8rA>FE^ zOkVBlX$aJlDqI%cMYl#a_H98CJu6jbqIlTHd5imiZ5~e12(vkqVDov@NXr5eO7oo< z)(!W0)r^NS@sFo-^@hm!aZL> zke~C;H2Y(`P>Z^Zl;n}GbV^#N0vyU~=*kfif+#!@5XN#l*-odi6G7JkiEWmHUr*Us zb3O**z8oA{g1ji+{|H3wQm?7kyZ<@cR1{u_HZjP7UQt|PKt?XFd3I$v1@YYtGhgY* zxif{nWP4ZUVAlDy`EZ|INP?1Uk+CEj!<{;D3SkWahm*43h<2a(`p&tAk2NB(jWsWW^ZxtHQ=+}x|P5La_67buAR!jK> zgb!1(a;!rcsrYfUEQdk|c;_$ppXw)md@Oy%WiOu}Z-`=^Bw$?-k5LDVyxwt+5yXQJ zK_cte6D6Q<9_CMR3(GL(&h~*Y!o4?^b}5ZPPG&I!#5aKclFtGJkA?<7JMvH}gBgJ| zo&QElFGo@TIa}q~`;B(JQ=w-n#KmYDi1OShl-c{R19nIsxy98KdhK4}-`e^X(6j6x zw`o%m_H{*MTi~CqUq?grFaH`fuvJiEx+1KX2H8nD;{M`X-p#|O58%c62*3!{@L4SF zA2ddpz4PiW%+>w6qKJlw-?l;a|QcCz=?L zd%p>&5igUo!D?dZN2+VyccX+s(a>!9aD-5+f~H~+5LF}NC&l&e^@ubtwEENe2AuhKzDG|lKrvI0;WmAaOxgf{ z^X6OaY3q1=733C%@AruRf6qQFgHYor&IhArq^E~%43yOt@w(MTmn`AU$-FTA=hfGv z8GQrf;*Mq-m<;WO4%_jqul}4xGoS4MqDg!eyO}d0}MV60o zHBIIL)sfp3p&s9?g=JQk&-@?kwdW?Pd2tU5Bp1nF^L-bz2t zNDZHr)@hIw>P4k~O`TZJ&-D$rY%44kznP%|&Mr{9pbk!P3RpcSq$t`lC&-80xyCnmurJ}pWd3Ln80e55GH zwIeo2Z?qIJa`k~iKw5XfpJR=a;+=65d1H0Ifh{brkcfAPqLxPR>LVy~bHrF#a z6t6b-7Dm{geTV{@!|1A0G2H;v<}u6y#=B5pBTj`v0?bw4Uz;K|9FzgReJS+?$=?`| zBZ8IU#Bi+$3P;MxW~&{;C>aw?LGa$ruSBWOK6mN*V%d0ORVP}PpAp0pUw(} z1e6PvCi#3C1HO;o$)fe*d32Qk$O9B9!F3cDFHhb!X#ZF;ber4U|0^5pSh6w-ER0@} zQVVvYMXf8flcL9#nY$N zl=yC8u4qLr2Ht0=B4bPcQeL#V5AH?*>GV+MfPd6ZVEiWqt2x)O-G#KT!^>MR5Xwu?l9Cd6^oy)qo^M+A& zYaJ zt;-9<5IxOo4km3V{fryZSwU#cgbNj|1Kcu8?O`J(ILKjselJJk-VK=oe5ThQ+E7AN zOGXop!air)?qRS1DQH!POTy>8s1EaZ-#SzAo&CCL1~~)U<8yM((#t==aD*Asz{r;> zHxY_FY`;T$!0*7tRXX>(9H;>&w)4^mb6Olw)d^nt;9W`hj)3{LE28a&Zn0aSiVNd~ zb|G|VSn0=DQRsKn&JR<;rb;LdeK;Yqm*GU5L((dHM(0|a5H>*8+2Smdo|uS6rY4ld zfQ1JrndXyb)(A&6m}4tbYMJ{js!@mNd)6AP-vP6&TdOYxS{CwhGS%ZV<2`p(%Wk-d zeN(`bUGx(|>98J1XD|$RaK#ZHss4~v^93Ixr%RL#xqeW)YJWl(wQNczEBQhxElhBR z2p;b#F|LTJUSgrnKkyxcMS^iZf~uqBvd(4HS%~%>`&G>`U&<}3;4n;fJPv0oFDhIw z5(Y_42ctCK{^H`YN>YJbcr~`kTniLM1H@V3K=Zj?pFrE)0wD7guij7O0LW~Pr2d`l z%E=yi^oVWP3v7kI{fGpa$FN!AefsKciDSkJdqdapmGh$UbzzphIN46q`NV}89*xER zOVA~!uD^4VkC0YSKS63R;RsW=Dj1e}v+z5ht=SdEay9>nV%$iC}s zo-_0ed<2B_bdcUltPkY;Vdv3jEu(N z1OZs<$jiNlvN{{LRJdBbFB1IHs@H>>b?kC;D1B0QH#&;IXFlTXt7Q+)UFsz*1b_1U zq)?q6)XzZN!%>l}=0zUuqPn%$1>+d%Oure|-io++qe?XfMrMX)r@^T^Xq=anmc*jv z(CLBUTbN|s4ID5}H&==u|2ruxToeO2ZtMX}6cs&2A@tB!hp!?n5ZM7f(fp-z+O)od zX1=ozZ(is9n=PpKcCj1-~B7HAk}`KR(NhF}PslXjbk z+j{?SC$D%kk~6lJ3?8ZwSEG9MpBY*xWdHyG8YpM=o>JpTs`KgxkaNV_QM?w|oS!A_ zM1`SR>8MM21N|P#=8q&Z>sJBr^M3};3?mYWoNbfA{xhnA#-Wjgu;$FiZpm1<>-ZjX zW1YWP-pSZda#5_pKLU-JSP}>Iw&l}$z%cgMp8fTBE=X!A+h%+&Fxe%gg`7Nwgyx_0kK6fD+nhuV)Ji{(fKU}=6V3)Qj0#9Z>?xjV zX*Xo2gBJ=f>kf)av5KA@8IU7;LmR-#sasC);d5!-9#ZzD!|2@`YiAt2$v|mb?`r^y zDfF5_i;MV|S5Qo(E=QI+QEFq2g|BBLn)&(?m3Qt7;H%OymgImXK)%wH1kbY5hgpgm z>@Shp0^y^zvB&+%AV|rfhsIHF0I=7_eN#Pwii|A(J2_`rCYh5Mr^$x-dN~W|Y`23H zXPTsC!~NY6EMZl>^Aijls@hU-a>#}MOdY1Lw#3W@C`-|MO*KbJc1psOG15 z+grWZl0K!~Lg0$8+WZY}mVm->TSQ+^41Nq*4-Dyg|5NOfe7|*sLV)*`JrNYZNL!UU zudcb9nG!&Ku(%g@Pue-NhSGY*zHBxeLq`~B(U_&l!plBKYJX-AQ>0WlVq ze`P2Try~Zo_)pp`e8h!_`_o7SgQ-vKqq#33jZ2V)1RDi#MVY@iW7G=iXv*<#Sbq_| z?@6J+ECjwevIypp89P4s<$%hyw&c%>WL(<22j%e=d&G3hQD+fiFDPZFD)QjAOd?gJ zv5)?cNl#%j4d9&o_3`5cuWO6S#aXMc!2DOgpo;PBT=P$>X>K{a-yEyjc)lg1;$ z@ETcD&{SYBJAulbYq7{fmJCdbe7Tf5nNaYatf+9Y$$D#@>)K zqD(G}-~FcIh%KF6$|6qxfnHV*pJ{->go$DX2`zi%93)qyXOZ&rbMX8ICmL;c^sa}y zQ|nc0HvazGw?OGd0xS&ORU}Xq(iI*F#KBG^r1o*R%`@m5&B@d<$~G7DVRS);JC^K zN)PMo4u38c5}B)(mILF{iCfIc_?D=%ywnq2*?LSDP28;6z&-_~wjSgq3Y?%|y&Xq%)wagFc zB~}S^yps@V2GdlSV1^S?&FiPmCLTq(SPzqybw+m{5Z+%{QT!d-2g&_0dah&%zNkCg zeZg54avWli5Uqvt+Ve&6XZffaHE2_?ZFNYkE%>^)gbhajLdOp=-ign(BeoA>(Ue4n zs1;yxeGf*npW*=wYq&Y@J236`2GX+_CZB~s{pHJ+TQiC-wc5MP`kB`k2_g2evYtIx z%s0@Qs9U&an0*DTrG60;*zqw*!FoEC2sPR(Fbrz+sp{c@yX$`3g`%!wQX)gw+H)T~ zu4Vvx3!*&l5Ez853xf5{CuATi&x2I_Exsbr3=kTN-Ov&BhCy?&w6kCq?H(J2alAlU zyari2+b6mWADWVur|9BeRBgqu2X$41O>Rjku>x8A03q z0~?2+j2VP-YUwZ2l4~TF#{D2F$s#7O^=Ey#x+>Gm^=A!;IOq3>)iVZ6o7>L_MR+ca zMyz+TT42VZP14j542r65;*c(QKVJm@8u88&Nl8P$(8!sxtQWKZMyOarU-?qcYxsN* z+>W6u*6+0gLHL==A8&EUzfp8m!{_X;J~~mCl|}+s;<@X@1!XQbGLuQm1te>!x>NH2 z(BpiMqTNb2rgtjN_{=WJnHUBbK9mKtHCnyrzT;{v=aYSN1GkVY283s=}%H9fQd z5s?Gw5MBq=&8gY)TY*bucIPVF1eB3H9mD}+qb z@#QlSD&({62n)23Vizv>5IC75tiRXRIFv;E>=sK*I0Ic=Y#!LFpH9c2uGcea!$C;1%}+WfxE$WoN4TfbqE&9e9H#bk4M4@FLbRYp`5?uC z)_;b1{PcSQ>z8h&c_vD))Ao$fxTrqK#Yb9u3XP<|Q=|W__G;`@J)y>LeE4(3h6JNw$pNH-n60EsRL2nI? zHb~~14H_KCxn3)+A7ytkG2z;&M2~H26|}K5c8h0^R(dn;tok2qj#NdN=klR z@xL-CtwUOK`N5lI8o(ih-T|}5$lW}kRO3hP-*E5{vc8x-(3T2upN=lzY#4mZsPOTB z7&LK<%lDJUzMy!NU*8~1n__o3)7q}SHM?5_yy`HPczS4yyqpaaOaE+9DnVUS&OYtN zx(%T}fI41(T)iOr_bf1cvy)zPJbxjA+iy`kgyMT{?mL` z-Z|+knyD8hMqp#V1GStRUMx?i3(_1kpkng<70$#*LDXxBum+&+Yr&TAd4@Rh>do=P z^V1`_&7rUiB`H&8!5q!P0c)edf>Te+?Rw1ZMefo65A=PUY6$^c%gd*xmgp0G0TlZP zX1e-jf*(8SYp6$vzEzF9svwo#H(5W}U3P6%f@=3K9mbL)g5%$h-ADeUg7gPil3-C% zEsEuKn4QXqlxn)Dl ztWahCZk|`vDd^eFL3uDLhiF6CQ(1t=+ZtQLW6e%AiY)65onfN%^zV);1 zNG*}&g&0=w@i?e&hAL=bHAvmX&@pr{xUY*-33URYeass|02-5%GZ<-{7=9FQUM;i9 zwsjfmE39Pz_6c3qtX(9Dn+qq7HMA`8b#~=&GG}`W$|qURX#ZoVRrSboYw~1}boibL zlxqt;)usrH+jNbx<;wqmukC<)sh9Katv;<75IP)O^if$qJ=Jarf;ZrJ&WG96W0eSf zLc^q$nbtbKmBd-SE@*#QjmJo8OLUU(!5`M@!L zqJ)V{i;&(3b`#MtYh9xRcMt@=ko34|rhv_UQ$pAb2_+neCFziWkOehrZk;BB%(8=N zzO7wpQD(g&${7hMB?)Lu_Tmp$nL!1ezT2goT| zEl|-hZ~$`}*^Bxr@DMCzqsPEr1q`%?piqB1ra@Hx>v_5xmawe<8^G)RpKx~A4S{3= zg*`9tOh-Xa`)KZCsXF{y7AkAcyEpo(a_6yfCHcZYPAkzL0b}>9W&pDsay^^u_3>If z;c}_@Nq1oOytBoxL5}`uupqwjx1Y(sa1+;eWq@OE;4A zzcm~mGV$DKB%&!|rh3qF#5!I!BV*7Wg)bRj`C~@)dANG2TYVUF?i<3A>tL(0?42h< zOoxg%>XMh5H)6v_eIq<`*FM2;5FGP@(P*fT++{@E5T^3A$;4IfSV~lDF0~>^-!XKdXR=M_De%(Y@#J$}u>y?Vl0vJy6A!N;O zJX=gqLEJD1tcl*cCs3Nip}>+ye+^hwTzkGdwMN7F z#|KSt`;EBw>?++HoD|1E3k?gQrTpqbZ+!P2moxzJs&KXn-%WOej7K!nE{AyL#AxT8 z_lHds*J13LX76{73v`2C#Evhq{t^_njSbPcF3O3a6iFKmMgz$RL8WJ~MKp^+YHU8{ zr5cF`2saG|388s};OWhE`@coU^O8_&Smzh}X(=RBO?(M*d1ng#PYH~%&ydYC62HK< zux$7sGOgNC{~k_Yog0%6R*=`?ughgq=!eRHida6Hl!mUNyf8K;F^sM3BpQ!neXF!w zi~l(0{>_jAgZx&QdFHaPH0vuK`f;KJ-6*TF%VF;2@-6piB-S;R9@Mz0N(cBU7Bat? zLpQTv1dG7EXE9i;65T-_-n(y3RJI1NnmkK;Rt88gjTmc}DA|w0mF6lCk8ml?RfE38 z@axR|ySdLYc_%fv|7q$T$=r!{-XpLQSDQ3@;2W}dCtH`+ z;&PR6BVw>yny zHGUVA8Tf6Z?hOx}R5}Mj`_z41Gn;~?Z>Jwk?D;%acwxTR14=l?Nz91m0kPV;zKH1Y zz)yAL<`%5*nna6iA~h)clzGXdkqk@v5f#ulo06j3^K1+^G*w=hBEKtCx)!d5BW}B< z{mTFq(|1Teay4Qn+Abs{j7y~5zgq+ibn7r5u+jn9}DOtb{*)1ln z2g2ahn|usweLdz&C&MVsT`;Kfp>TpC{DNk7xpxk6gB@&ax~Od7u}_9AqV=d<*Gy?P z|6S0eb~pWug|UI!v43KuIlVGkcXQpcXnNkmr>HBe&UJ2qis#|5?4EI*pO+-Lf5yKq zM!UhSjJeg2cj&?R($i&(8Td(n`qmbi+GIu2K9P!O9Cd^!!z0+qGPF!lA+i+fb5 zg}j^jOJ_g|9RCd%z4!*1*!GwFsls0s(Sq4>IMD^+3#qL)RJue5^Y(eH+ui*#Iqzu3 z7Qs_*KlfEm0ER_XD|B&A=I#aR7+~&w0H3o71M0~MupJ}nU!7Rsq3;8x+96op2Zfba zi_v{3XqKNd!F0i*cfPNS*w@Isn}N)-EzOQ#W2KmE^dJzD%Mb=|lPCLlF|P_JI~C z!V$S!^Ce6q*YF)iGgIBS(03NOK+SlH%a$yv9;sOFfm}X|1j>NUYWSs0yKXc1RH|J)#FeeAEAP}86aA4 z;%ihhwKha8wKQG}lGpwMKwNIOugM@>N>2!^!9a8hh??)Bl3Ux6~kn9jgbK-`scS~<^GR*Mw}6eEwDPIJ66P?-A!yv0m!FCy0UJhyh+ zJ8^5LH7xwf!$-cR3M2ydl&r!J5Y)c5OCWs(HGj^v;{K%gp$A{f8coFh50>k`n}uN*VFbhVJA?xaxxRs@3=*g0lf*aHGHh)*vW zY8`)7BoPB&yFcRk3?b+r#v=B&cKYC43BgB(#+JS4C=4ILde`?XjF@||e8D*sKc(JI z1~Wo1qCE=RubbxizHgi6`Mz)n#)$_?!Qee{H7`=os!J`Aq<}6`|9|!ItB>21O21OR z`%?qv?0OopO4k>@&N9#(64yJYBmaN=1~Wr*ueNQBBhdgCXIrre*w)v44ki#LQb3K`5O&a#i?RRmBV4$Eow-c4yZWKb6}#45HNL ztMO4E_j9WaUwfihi9}ahpZ6u&vU-I7XWZUY5(@*tRT&Ity?QA&{}BcY#QA(uuoTVs z{7J~{7(;+@Aujd=R{sNz(R&3z00000000000LNuU_as~+r}pUoj$F2KB80_>tog<9 z?FmtA6^Z{%qv=S_Zhz#jp6TpJmyAXmWUs z-C;K*w{@|l-@#}gWP_U~f_26cQ}O+@41Aru6iAMai2X_eErhr&+U#rPK!s$>9h9lNA2tWK2E4{@_S|d zy*PijO5eAmpWEAa?d%iwl5nTU>U^Dp)8zHnK26U)Pe~uEZ@*VjbL8o!pC_ZAjY6&#iEA zCOE>7)Uhh`;}2CN2_fFL=bjF4QwFSgKxUwZU1cx-f7k(Vqzrq}H3@&=(L9vwYL}8z z>!`;7V|bQ7~X zE40KuP@-!e+o<#R>j8kLPn3*vS%3j2{mi8l72zywtIHF4y42!26|`Rt#lHd|k_du{ zWuSK!9Pb$&7Y-jS?U%!&{S`LMRLfDHzvVa@XAhhUWv?#bN2h>Ue?=R^bI1S{f14zX zbH1LVxpouG>@^98n@je*bJ&uaC{ZHQ%V@WPafb&r#+VR&qye;L$|4B~4meaFXP4gX z5NQUULA+XC*(0erWGpf36^t^_X6n%zp+mNmefobsIYqhX@Mx+bLYBu);iSeU9H;E~ zoqdE^P$IbDY-_r(KBq&)_AEQc>F3dI4ca2n3TR1-_KJ?EimEq<8B;erX3=6{P(+iN zR^ifxJNHevt=1hGuhFT_thO85aEkY^=-aYfhCzybdqH_6Acl{5c72d7D58x)ZD&DQ z9KjQo#4pQigjE9N@yD8)BBQgNv#UwR;?ckBXlM6SD{U^?uGo{=mU^&JtWBs18;sta z+S9;k%4%3ez)_}9^nboRvjQQe*tw`5Qb|3g%!$RUg&YAroJA%{8{ILup+b`UFvEv0=F@LB9D~FiUOp77P$VUd^@= zcYc6t$$fB~!xJ5fpW*BFOiDlh9yd=B=>CPMZHFd4iO^XV7a|Ha=%-p&{DMrhYjfsK z6g85X^s9&Yk7eY1gU(;D5Nb4$jVzoVbL3W%|8q!)5s4T9`mjr33uw0c|2YfLIiao; zr$8)+Vd=2WupLstU+y^MYrz|af&J)5l}x!#E*T0t8Tu|vm#Wr4xD;~D!R#52|3Tio zo2JJ!Zv3ba;bv z5^b&W-HJtd7q%XMD+@3WR)yb$^-~y#!owvKcwb-dJRwQ1-^97`%-L`kV5f2Mh>Tzi7h%To#o9H0B=`MQfu{ZgVaJ(8%K{K_P_po~^UuJmk&v~>*5s$YndL(mWfsdhJA2W!=KT~#($LEpJ{L^y=;I(( z{SWe%!ZuU6@4=tud)WGzmQIlXVI5g{lL+nR_&Q3lLIiQHI02P!+J?fexjuu=CgyAI ztmOk)C$l=_XQikp3eYX}jx~^9*OW9Vrvr*v(4yCt!rbeMMi0H;^?9eMN&Ze)Z5YfZ zDnDl@GNH zBRGQE7&Tq>Ja#I_Smz1C((bc>E>9w+j|mh$k%Tn+llZNBde(C|jIO_=*5(LZkgKs*Jh|9|9D z-{;ix1U;I{?!Q@{rqe*jVipP;&<+SEor};-Z{Ib*xKXuMRO-LKZq?b41p&`9VcsLt zf(tG4_p5HAAmC+u)@r@m5fvq5(j7#DpR7+7fZ{h>W_ay$1CzogXS-=D2{965ETh~A zE_ZaUa*do_K_$7W1_xkueNE`5f0!;{6lH(_{lUy1lp(cZ{+nGOIru#6LV}9Ke)9v_ zlrRoZ_)nz^kF}R)XL;oH5smcIpLM1en%zf$#R=}aX`UnhIAP+VtLcp=gUSKBg7IhT zQXX}V&h4Y^@VGro4#59m>Q~pLHFp!V0fEDzK6{DWY-SHssNUlt!buBq&yQz?I<@Iw zxi19LIFpbW(%u1wXo{sV2lx3AWJ#<@7QJ(cY-I=>Ap*5pv$4JIZa>+c=Lu~J0rW|6 z(7S%i`-D~`X~`j(G)ooCTveF&)@V;;GUE1-n(RE=Br8o2rEnli?XoRWGc2xxT`PDQ zW-cLj-0}8+m$h(Eem^%vf>3Hn{8ZOB^p2qTiOvo&8oGn+cy_j#gRYVCz^-ZC6l5LP zeI&NOp)8xxSoYJnsVhDJD*I-vdM3pHKDy5#*EN>1y1@x8J)qi7hmwQ5M-0(tgZjDV zO#+<+V>zJec@Lr&s=6^>w|c#uC|AQ7I7?QErEhhy&dSiiD`Hd1O3rS$Hccx!Y|gNDY(F_*XH; ze(*Bt*`oV0P0w35dWV@}g|g;dFExpMKDLU5QVCnOK|2LxC)FU1Zm+Aq_^o|ol6e|f zms|G%mYNPX8jQ#37oFocEv@M5{=^=GTRQR$)o<}~4##O+d;89n!?ICWyX%baXy3Z8 zXLVr-|17kFZY)xd9*}j-O4aIzSHMc}NA#6&>`6*jPYA+Py?a!tL0>Kjf%i z+CEtlKlwqz4we*9u~^vJwG?eQl`@U`5%lfQn@zrmEKEvA*2oJ>{!e?h-ymRcIuD0e znqvt6JJsnAsl|V~=lMgI>F)KAry_b4exLDvd)2{(ZSV~#l>zszj@t&mkZi@n^e15V zFA(S%h&q7Z?_Kub;X~cb>XNVc2xSa|_|qO&CAs-S415s-z_(iBj%8&kz5(EoEnf~K z&;HnzdM2mc#VV#Bgtdl6Y6QBG{k6yaA9AruA&asJy54e*Mn*?-xGi@N+U_kU|2{|_ z{({Z0s9H*>ByuGtZxwQ|=jQ(<-cHyJL}eUsp(aLb^{T(j3GR4Z80@^QQeG9dYPSDd zRAO{vvly9%6eaNMziNpp0fESXm?eeQ*UmwB17krZ1^Mj(OM<9BNGlEiZut28Zje>w zE)J)u%-7eT=-FL&#vxlJ)%6 zl6l}`?wQuRZ^4i_O=*|moR_xb4(_^^GYVpxW7H=QPuiZmrJ(4lN!okSY{I|$<;|>C zUu_fdcA;kpM#&V}A9r!0njN0PIM#I`(rOX7qmm6Jk?QGA9#NJ>^qaudp#lq!I+)FK z9PcQND*%J)`zb4I`qO~Ye)5;KTVDh}zBQhRFDgQa$gOyvE@EF z?Z5QwZEDTZTx?~|XX8W_>ww3}A-lnc*J-AiSVS4X9RGjk5Q@Q4K~vQz`GWMnq~3*W1c2B(}CBPs6QDJo&gGmC6}eldh6!-zHjn|-An{x z0O6$&na8Y$FVdaR=QwFAWQOe5#U&1saHxV_{%IPxWyM}PFRkJm@i4fX2zhbjFu|*N z-;#eA5VFHISm<=KibxY{^-(TiCFk6&;c)l&3-$7W6JA(d0!?003O*SY|6hbh=PjD| zsRjI`91fiViIlT9JZRGvo?z~@;(wTfF|XS)wvbq6!AhHzl|ofqOHFc_jgO1T05z68 z+v|24p<35vRJ5d=@hYg6Qq*39!6dtf(Q3BBFu-fNi(5N`$et9MFDy%tp%sJ7#-)`4 z%vA=lmU<1jGL74!qpanH_+R^p%3kL9jPL&6VA!a$A%v$VSbs0s(ro!FwW3dU?2n)E zc2mMLWhELGbVOb(os03TO)V^J|&1sS%fYPQ$ zz0h;ajN?7lCzrqXm}@ypY&@Py@=p8k*!e~8<$3JlN5InZ!GD8qUmD}F-BzvF30_>^ z9=#t@EB1Cv?9a`w5z~<1FWSj!C@;KV^!J`wuT6A+d(XtWT0gHv&521; zHxV1UIO|7O0A`D-E`s3(*v_+z5EM}vLB)b(t#S(q@|l=)B!ixx(wCA`_lKA&BK*Yz zO?+eZlTTpid$HOk#B0K<*89imzmt^VEP1{1WsKh@ZPpCil9x3zTVL1UHoS35P!<}= z0ZlFpfw9?V_mWzN>QRyg{p?Tg2+!tD{ar13A*ka|Vg60roHpFvezH7pFC12@%p6hjcheP9u84GI@X3?;`-c|pP3A?PyZyG=l}vO0-XQ=JTD9p<()SG1z;x( z-Nfq*4Nlg|??0!u{+1xUj`6YJ~kHL?YewY`CL_tsLu80%k36)-zHM;K3B&ic}Fc5Gq_wDdX zp?t_~xk~Q0Dl0qDTp8*y6_iG08OAh)k=-82)EDlFi1+caK_eggH0bEON`xzfa1sl% zY4f6;vC1K-AwrXG#6{!e3`5R3XvOcSfVjym%vdcDQJ=xw2_5L2cZlk;*9w3j{99z^WUE7JRAp(EV4krt z57FE#%c}r3pMabVJPEWBs{BGF#HR>DKx}iCjZJR*vB%89-glhQk-~Rh!oT`*Gqi=Hh>-93mCj?PgW@GVlOp6bb=Ik3Cri%bA8n8d|8xl z-vugBXxyM|zw^>+Sb>>5+VAV@(g85?AOB)tuoeUGt-ATXZ=2@#?PSM{)}TOn^o|wG zyT-!6^&)4^&7-?ra|R;U*ej{V!)qKFGA>^Hn)4`m4SeXcT^`i@ z;9S(KFhcNPkG&_i%FT=3QM9;#g*6Q*MzDBk@abr~eQR~Rb8+norF#4=I*&t-5S(vf z1|K-TAsNI}!euborU)D~&LRoigPeoo#-$N-6kq_8Y`1iN3cvzW=8RARU(w$Zu{l>d z@b>ykja4xN+0RxU|3G=jYTK<_<-ke}D3HIu@L?U|Rt}RIs1z1GSV~OE(8ifNW72ko zq3U*)1D|qE4Xog>!4%6pYr`-W2N^{(>T%1q++qztPY6>yKw97bSEOu-RAFLvWi2dF zgA408$2#V8eoVgV9RNxg?jd?$J!4XYhy^)s$<63Lh=U){@W~aYVX1AD8plI-!V+TF zyaSsZ!(oz4aK?lI0aRZUsT`S!{hGO^Vqa{{zopFv?MzQ5%a(MjsU!^1r-4ZpwmUL@ z!k3X9)YWutZ%AGC*N1`vIM0^G;nv+moqsA9Yahi|Jtm z$b3n|loP$ASQhcu)pd$ppOJAMF_4Q$a@!w-h3!zgw=UXiu=h~1A*o7O991mIWPI)7 z8|ZSK06n&E3bCs^SA-WUFs2z|VnPA~nPEYTDNgNf%MFxLt$DPAK{--d*k#G+_!7hP z?p(O?a=Hj?$_S{7X>_U>z}8(GSyLAEYVCw&*aLTv$W?tyMw(EU=WYa#6Xa4O&NP7# zMZiA;2>I0B4$FeE8`=FdAUGH#AG5R?>A{L|l?g z3{){M=%3VsRamCY&ld|Y^R`59p_;3#b&7%dmQ${+Kc7v&h|*i=I*2vbo`Ul6smbV! zc}Ae*Nj3CN7IbNOWKQE_(8s2?vL77vVqRM}u*}$(aW&gcY_Qa6;qt61J9U(o)yBse zfX*E4D5|}_=tr)#Y*&~yBd2}F4ru=x9of#c2YC4^I!r`NOI;c+(4Nizg?|RiXjJY{eiGjlG8_AUr8{Hi&YgSJMm>Yot5d>v z45rB?>~>e`C(4PlO=DO&?Ir{%rZ7f^C*Q%QX4=aai*~S0T8GQwhX_$y)Mjd)jkg z5v73_Z|(IU!qus09abmZ1NJyk#=STtYRXRH(ab!r{6k1fkK=e$J&#+p8UJ&t7>^flu2~LS_K-lYYk=w=VrwFJFBLRn zUWj;OC=dp9u0#!LukfrZK;a7QL^?!FI~icNwPf;0qr8J9CUhGGP@t*`L57Dbsf_~h zP&q4Y==T2M()Ojl%gciCmf@D1+rt+iXO@*KPjjb7%mdtyL&grt=X1Wh2c!Rg`mC|X zH0e6I%~fjoRoIw4iH)}=65~`pcaJ14A!0py{{U@3lD|(UKZqbOoNf?X^w7Y*M7YKJ?>T%V#@kE-H^0g?mggYhsutOqonGq2o~?dNoJ6#Ci@+$CDu7QGtbVgyL=Z<91k0y zy>=f|5_IBb{Lv!u{^b0*p|yQcrboD*gm$T64T#vexM@OcQ64y?rOP@M&e&LavaRKG(Ky;UCX_dox6uR_Tj>#B0|IR2s2l;ada zy3kqzfJPEcR2{^7w;ZC=GSg>gkWY+=CVejCCDI|6rsGh7ky{KtX=1!Xpgk~{_l+xQ z%~0y}Y~MB*{IpmdLQi4?>(747R*eQGV*Inh0htW3Pyc_(A?oo=KmZ035>em)00075 zcU&xg)L=kZ55l(V=J~#Fo96kxZ=2@%zJD3`0snu|x2g^^>bc*zT{IJjEPBX%z~~HE zIM;hZ5f}gyZP=+n%)TrN;PSmoc8i`vgNq{%2|NAxR_m40m(1nBrYiOwo=?NujsH(1 zyLjzL zaKAfu(fKz-aT8qrQE8tAl(SZ7XzCta>;(vPVtC~-DcqKXN_9goq!AQ*{T5;27^2k` z=#EnOe7K;lZq{hFliayiE$H{cxmt;y-oD>))_Bg(@b1E8${5q2Uwdx?W%801@PKc3 zBW$Dd?|%n}YBGjaNHnSax!4CDT(0r?%e%H!^0a>1CoV?)V^G5=Q=^_PHIni#4dCW| zdKl?7r@Y$|@6v}&G>;7S2g* z{4aEmVN}^`Hr%2@=C+@jd_{B>@`z`HI03F##Xfr`Db#dalMnxO$-Y?}?XV1)NwHiB zz9YY__uh7Gl)TYO#jeyh%Km0b#m58Drw%9U80HOIz*A1)BLQ1q6&7E|>&?!aV)=p>lPttvh@I+% zVY96ZR0r#72Z9Y*=oVT3QO^bj{h?#5`k!2O;BT#k60qL(2clgK^<>%gxN#NBHViE= zi*n#w-U=94u;FN$wJhKnMtNgXkvcRcIBB<<>*FBaR&-^TC+Y;V_wh#^=9FFe0Of)H z_$QCaj`l|P0TJbTW|KM4uhv9RWTJw`>|*Gck-Tzy2mm53FJXle(fCi4F*aQd<-aTB zIld-onEw;Us)eZIA0I;v_r5K<4f-SexeBbx=HvNZ(yO3GvE|3;WipkH{(Jw6n@ zsfd;{TMl!oR^N1ntT|$7j)c&zfwuSVV8GTYIj57v+`U&9LU=E2D{Wa>2>YUd8jA8y0a< ztmvGW5MgE{T0wB$@1o^0I$K(-&!8bP73vWU1GG=M_jg?tKnRgENlohDDejD!%_%*? z6Nbiq6IsXfmR`f@U?x4~=6glUur-n3xdEm!(%8Huhu{6gIyT_CFyelDzyUW)rUL&k zJ^9PB6KLUzCjI0nEIJ@kK?CPH!&a~HsH_wHiLEl?XdGx<`|17a`Wn_TSkA(OLV@Da9Mr?`8jO-t$&P;Ihc;i5`4X*jm?4&r25()nt%$atD%%(wWLc z9j(q&TDq(VRE9Pk{G~u~YVCXq(pPsMR2mmUCgDHe6OQvo4bS2V%fGN%8C;Mt-hYPD z03-s{O7i`AtE(qWiTtviczgNrr3D1G{+=Z|sOpL-Eax-RWdRsy)(?5L9(j*3iuCOg zgT2MJA9JRS)&p?HVD&N*+s7Ik_L~Y90;I~v#t;1_ z4DTOEkj8Ht08uGxU3+}%&Etyfy_Gwvlq!ingr9f-5u6i=L!wKnEO!>W5@1O3{@xOK zeO3*UCLXYM7_I_F+{9h}3DFIu^Am z{~u`0LulQ~7^?vJE9cx-%@&4GCBNEMsC?XW<vIM(V-A?kH`!p_1Ms3d5#7x(U?lOMeh{9xFV-gN@oU7Pg^^x z^(*h-m=!no%dFakVyAgQLv-9j($=Gww_7!Y!fqFjL22Ki5b3jZ>;lb&3LErEjjb?n zKW!ZBL+H+QuLWND^E|l7ECP6XoXyOuE(F%X3K!9onh$8ln7*I;VEgYvO<`DtLO=C! zvlsKC#onMuEuZ}6mcaI;y~a7jeJJe*`}cM2h($J{;M3)IZF|{svF+PvkC(pUw^yxH z_@)aEXnxXL-7!qabmWBFW6?^W{Ph^H|5CV)+o{$i8}dunNy>BtTtp8yE7#crOuj&p z=Uzo(sLW$ZUxEtG3EeyW2M0PyB;X+-rb3cM1-|g_4#=Nn3)y4hX6dfE`rF&P1VqIx zw}vf)@s0pk+twM_232`TL!sC?KDnX@CW!v@Wew!+mX7G1`-b~WpDr#LGnygM0H&xbIFD+ZoY4u=J~#Fo9xKnQ2=OJk}%!N-{n!>Te?#7 zOHy424-qn16N348p8tE%G+gT67iU34R}DZmbjbYDtfvgcWEah(l&31y9KBt@s$?S~ zE`g3Hc)J>+D{81vM(R+LW^?$kl;cWv_R!|>grjkv6pzjv2C0o)TlN-hkl+7JWA|8O zKm7W58TsZ zOdUEh0*0Pah6LL7_-r)yS&|ML0Gelr$_lcxzySE{yQY$}w4d8I21n&@x*~U6nHWmH zB|D*&(LO6fRvnE=osBse->|~c+kgyHwNH5hgGjux84N|A_?72X-h+V0#=3Ik z$MJT-i)S{^p{M-9*9{c0_R8B!o;rZm_47mUlFRhH6a;)}3NK4olrf{|8<* zI6d%Tn8LqNN*63Y_Fyq6%?KE}PJc*L~eSUZh|A1MM zm?~BezJlq&S3-}Dj~>{<*|_oSs6BUz(HQP~t=e)-S?G>tD+gER>a$t0WYg@^MvS!E zxuqh5dez0|i_=9Pi03hRtqo4-j_OcG<&T+UKTgMA>h5QcVLIIHhhh*@!zNmGSDNSK zv6*<_oT86YPC+JghYl+8V8(?U9)H-&wpw9&MYEfY*Rbqp(iTMLQ291#1};v$tiwXw z(SIZwmu2)lDP5Nh$`$FF+4Q4P&%=mY!^O1Jtf{XoncS2kYVh_1 zH?<-OQ-nygq-W~FTHKKcVOj3IHF*A*rnP<9|7SWv`PvFqU9t%`Iiw9F0vNfs`lyu) zF`-@IX9X>73FmrU&XP5U9(w@zTpTi5Cv7K0x49?oT69ZKe=PUwSPlI7yvH(5J zaDj0?FAS!v_{6MLGBITu$5x|P(WJj(?DGj>Jw?YpH>~%DsTf`~9oFR$s-xhA-=Y6H zL=j$|_9Ao4d?@`${`MEnDGlMRd?QjW$poWO>?XK!nCLTo1Z*@JQT8Ph@CB)ivRP{8mTfww)WLUfk3WfhDu`AsX?^LoVMn%6j-E8`AgV zsAc0cB@R1UmrVnY8S`A|aEvT5L#O$BmMV{-qEI%&sEcY255+VLmqI4}Y9{P#blf<3 zi98%FrHsSvlv2?KgVAi<)-T3p)H$*bf&`_(O!xmQLP-897|$$iceqzl%65B6lq*CP zvlHVCvg2~E#+k}48#1F{qZMuYZEp**=aj*^p#eVUpl1J)$Lr>rWxNAh)$PyUDlb|8(ukbV%YF@XC z>I1@t)^aEC4zEg*Dza3dg33E$EW2o$2mgQd0U*TYfsXI*Fr-+%DzASJdV1GOpy5?5 zn3?Jmdy~T%EezbZ-Ql&Ls9!K1Slk8O;8Okh;l-xK3DVnQ-r@>Ov(l)eN}X@CAQvFe zYqB{QLNh%s+-=!8I%*LusRVZ|44HYr>)UkLGNjh?d4fy-IS^)H`1L7Orh!T`1VF@C zZM_rDNmuwOA2buzq(xQI!5?8oX@0g3EP>4_@koJdaMRYh~+5sf!lPl4h z(1lxvF=5DI_mXgQ&!DOc2MXVYl9?6kbX_Zi?11+fxtfvLBzP%39CQM(Q~ zF3lly{#X!5$fKtJI(_bBs-QSBobOtgj|VVj_#CDpI^l4k;sJJ1&L)?=3wUF-Ofz-& zQ3=nqiZb%LkJSsc?tNT}-clu5(~$*orN?^QgIrHB36<7#arsD-)g?x`%FFpQ+lduOGK8+^ztb0Keo(8J(+PV+(U&8*X ziDu(v(8kEA$2N=Yola;;&88hRax3vOa$}_AeM9z06^fdsofZc7mpz^)y8=C>dJ;bt zB+>=Bj-uUXy1c81tCRDh`M~bdf#Qiu1dV6{wN{R{AJ!BwSi#(O!uuO2K%B-kqFy_P zu8paJ$5lH;==U0=%rB0b0)X}^521h-pBxbh@VG%%*{-fy)O7bW#Gs z@|^yH5Y%IuaLVg;rE8MhLP(+Dcyhn*GiFjzmD9R-{Pp9Gl&%0EDd z{QBirXq?R&kS@^rD)={CJV}w1+usD@tUE`c%-j6^ig4rGqWR3kTHAr%4p}cU*Wsr4 zTJzKH_mqh$1)?bUpJu`y{vmsZ!#DUmMZ9)29hM~-b4jhv8(ZCGd)i(9DgP@ zBXfWRA}cV;S(kCM4rX;-Gg!r$&x#G{Lt{;LI9NkC&E}gkaH(rp{fF|@R?f;{$6X7) zgry@D6zv(-#08ybVBw8C0$UOQLe^EzYsjIfM}N@cDBzlRNl5A}2>^x27(OE} zP;?eE-t7nCCDOVIMyI00QqrPyN<_UyoS5w0O%65&!{!d{UaCr1fI2UG!evJEJ7ChKmLW@92m-F$)q_8Yj@;+ipMWO3Vq$v5PYFt~vngfxIq?3*;sTBIET zqJcdFG7S!|f#oero7=3iL((9#lOkix)65Atp9j;XdT_0t8VU%`N%wE#^~45Fx6_33J_-7Uf#)(}U7KoGT0n_zRGx8%6!b zT?$)w?XeWvHf<80zcs@p#fR&hyjypLb6g_F=`b00HLh3gD~F*)cNz^X)#er;)F|Q? zxn2BZazU*mT_6h-nFmLw=Ts4$h3;%3_yt(WHk~3c5+q^6+oJ9^vvK( zFtudbn?0zlmy5qx8S4KoY=YHNkUt+A;&|WUQh8tnN!cGuskiiDtp`)tTeUM1-9OmC z<0{KsCbozx5ChG#!iNgEJ&wC`#-Jw@Yvue2EX~iT_B_;!(Zvucaz=-MtIr|u4rMx` zKJm$1#nKfQ=<75B@ap{TDpD~2Rzxv;vWQaB%91AIopRDvR#9@7MyO|}FKB=Vz)AxDfV3aGzEljTIkIe8g#p_mc zdZET0_&f#|pYJRtswE;WN~u zeoKtn$T>rA_(*XzVG`W9ZxI=;UUCT@7{@#OCjPv0z3TGE^)Mxu z^zC||QYVb(MY{u`vh0WL?gi(0=bB@-4jfScvD^$B^eI~zt=`0?w0_;0?J$VIlK2*C z>8!&=C{9KeA&D4>Vw{E@)zzR{O=VtzX+k4176OgH znv`Z?U)P&KHd%q}3!cUA$wC53J%W{4%sb-mk^Q9s)tXj|%yg90hyVuaaND)Y1bK5` z#>@AyDO59ya^%_?d*6^Z`S^~Z1oHKSG8U4hEPXmpk`WBUUJu20DEK{9nGl5n(xQH~ z`)!dcE2mv{#> zGZ2ITWK#^TO$g+{;IefadS6ycL+d1106C5mt#(mc*4+qLWL>9bg1dvL6;}4j%*ep0= zc-2hW8)4y|oDd^IeJ{juN$d~P&zcR?k@~D-rH!vtiw@kt!nvfCqDIT>q zgzdR9-)SNPuNNVWIAz`MM(KEr|*Q2sgu6|%j{&`D&&^t#64d3ik^@LYJ5Q+gl zSOUS6flwzf&7v^VP}hmFnMBp;4-ZA9{1XCU2XTf_JF*Wm`Q6-Th%lI(uUxV_l{%kE zL2+xwO9o#qOyl+ z^oirZ3nlbtwwsUT{kXkNfJO}1YH6%BJ{0Ue9$%ODU{a3lBj7AP5yJ~f)2}79`;6~6 zOwW#%H>!fihgK1`P7Bx5j+6N_+`__dnzZfMCCgLkSFGZ4e3M<0%m{06!31pU2SX8KI-2h3&*hB`preFZxe7XY@V3YrgEEZ-x7NDBcw( zi_tHyOd~q=0@R#F7r9_%RL%s?BmUEs)8!Vbo69jLWWXaK=6b48&XC4hPKMe2Ul9sS zzNd99xuoOtD5T|d9MN{1sC)LJ(^g&IrFxh8O0(g0iq*#_W%9gGY3D(kfa7;U*wL?a zrs@zzy7c#KeRB`>m`OeSf{nso-3qg-=IMbSt*E{a0AC{t02DvEEcq$}q8<6IV)*!Y z&gUf1`8yZCc*FyQybo3;v!)IWbAdp=OBxewMy`SHej;2cnl(dy%Pu#_Ck41$`;17u z`%I8mLa~&p)sS=ny+9r7KN`om?PJ1#<_f(6mWQUtJcv17AI#bTaA}n9Nc8L6e_v)T zw$ign9eIKW&RA!sN3V9-f7quqaD{`oVqE3Te_VrRhMS-dL9h&H&@GL2dUbt&n zOM<*bp5iiV6awmv6DfAAO~gIe;!FBgte%I)HVz@t@l+pY150CV!BVL6j?maFgjpL5iWDLwAH230BfHl9o@>Cw^4me`I-mVkCOi>RQdy=Z{{E zqLUOT5!Iga%GDdF=uZ*FNfJ}lMU5Y<^kT*&Jx!OgDsH_H$%XLblvmZ>ZLlX+Y4O_F zOu>)juZ@`z>F&MI5d=OUX97(m(NEc}8ATMZ5b@b^$+LhiYAsKsZ6@yY?h znqaZ|5SX+h8LC5lt7ZyK*HL62Y)-3yyTr#fW&4V^<s-%5q%2&fpb>n6I8D#4SMhuJQ2IEGAx2#h}an zLkczItzeQVPsjb_20-*9j0x~md}apHb$0L}l+`(ElZ9bdKBWcO9oDoRZkca&qRNc) zACir^umY;;pQ^7d+Xrsb%tr{jpJ<~xu=-OE*zQa@ta#A}5#hijE&^VGGPh?2+{s!) z@%y6ZjZUJ08|(A7EptC{v4eUou+uGn^!mT3iq*re1JdhXukN}`ZF+(D3?vf~9IjAd zx2PZ#6(br#fB*&&@~H5TVj-(lJjq@;rxe+%Q_6%!W(S(%h~*8cv_Uy;6pMu!hQSb6 zmdatQYUD2K;}YoIfaJalt`N9)v=#MkXNhx6Vb@~@L&c&KvTcG(z{GU-eWZD)PeBET z0=|+9S=j@w4gyiu|F!cwTj!?sSKKm`6r=hfw&6tKBcn)oZwkja0Hn3)Zv)@qwAi z`ZOTz3b_{(i`*#n^}kVNpvDCFpd-+TF6?{bWo^n;M=AXsCzm_D+nW2U^i3@oAYbio z6fcHXJFetlmM8MuVfzK?GNQOf7F#?M0AyB6;C@E!+lA<`=!9$OpJgq9dQ{fGOd4UE3*Y1zWaKH!8ukMy5^sI`!t1u3nOCMzUxBUvixRsaB9#NN~>@IK&f zP6Z$U2!x`8ErNqPhqTts277$79TSJ7Z?9)y7}`@gr}L_-j%|!{9GykTx;>Owroadv z+euCY*+l3NdyvzqtloLKiMk{b&h?vrP#Z}=xfV9z_D4Xx5j)J(;=g){S_{-tJ2>TS zwlIg^$RV@Ii^u@ZFUKzu5f)_3#wxCS?k-|-40(}#)x!`rVQ~|oVt6S2mHUN`3QF+f z;by_N*o^bd!4RC##;?pKx?)h{@f@BZGF-o7*y}SDurVKRu1d^Z0*UvQ-S#8DEdVM0 zxym{ul`BfN6-NcpJregXgUDOXZ8x2eBY?p{_MhUf`tUESKNB5C|78)HSs!zNws#ad z+<-U7FTRsxZwN*Pc;tkf1KGgPV6VG#v+bnzj|{7+oA@psUAArj7Zl2qJtw_J~@BTt?`(%n!K(RxPyOutfhvQfTz2 z`DH+D>m%#V94l6m>T}5?krG#rztts8mIj{A$bZ141|?N5PT0)gg4k9X{;RYvk-{Zy zL%Dco@(C|@%LsQi98{5eFqOnWhkmJI$+Md^4F4fpl|^rQMD|wL${>m*j`ZZ5BJsam z)T82qU-ePRnmm^t;W%0Cm8ed!Vj>8q)lO7vWN?4Uo51+)U`NYR@uT8LN#p4z+mDVC zHhSGIdT9JiO^-jd;Hik4G*OL$cGf=Ox2 zspFIC(vFz9s6Xq5yjpZ|UmPxiiyE-G&5FKw9I{Xlqy*JIDAlkeIs zf3kT9mlG8vnl={*%)cWxC=+0s-T~{QqP#2#D%R?^3YU*NVLz)&UzIy zo%o=v*U)=yOHS$O|t%Px^fc+gE zFt`i)jIyfwrPko=xF5TMRc+FmG~AZpwEppLpsr$Vb*83ddLF+3$O4#0dal>Lxu-c~ z2U{#+9>ma6q~(MHutZF}hwWyhte0#ARt#ni-Sx^a_NbyOCbfI^W~phoJ1y&G8)}%W z5Mz-72$o|qi2ekY>~OY)7BqJIt#A{IdqH*jG4Zb^i9?Ifx}hv)_k)0N{%o3l68=CB zTn?#aeu7e}M90=-Q!`)gFeJC#Caq@M#haNf;O6@wP=tQ~+sXhkU7aVi_gN8%|5NwV9JrOL2L!kj?-kTc^<_iw@p6?1 z2st^luW7&-_2wDXOL8M>hNIVtSaWlq^K0Cwa2hZeC$$U39>a1o=;V;q+UD4;SgT(yyr?SG?#4**XObwS&Yb3lMzfsCj2BT@Sze zm5={JQ#Zg>>!N-AtQb<%>a|(dDA79DRayn+E==S`B)caK`; z3J-t_d2~PYpMR(9;5_oWVDZEN7)U5{XV@GHXyG9I5zR~_7%~~S&!Fw)FJ8n44vdv} zf*ue;TWKPgA77Uf^t}2-Jv=)rPC7n?`r~o0t`(|IR@ikT{+_Il(<+Ub?-2D%UFOdA zVQ)56dl2|vOb(ml8E?2Px|uk&r05W-$|s!4H?43N8FBE|xnv(T^okGVH;hkXFv_1< z`hI4TA}xoGvey_Wl}?zATXq|adZ9+BCs}{#Kpm;K0g5+?AyboXY$=Iv;h>i2$K<{6 zhKmV)GO7kc#`_Abn-P2@*glBDi28Tx^J~(RD0(7JIsj@zflcE=G=-1m@2Ek=qQmg8 zisd^S*?}<9?uw)P&r=b8h=vbahqP>RwaD{wn~Z@~EJN%{>qUL)VsTVzfl14MjUJ~j z){I8JELL1)HeIdEwmDwY&l7m5Q`MneO=05oPZmH*Q92rx{n9Gb@jyWYqO>|pE+$fH z0I4B56$SC7pQCH+IO-T5?bo~>M}H~@$l96TD&ALTfJbQzbHgNj5z*YKmKAL;w3Tbd z?#0xl2mAdqU^)#VuuJdIdhLc3a7GIj@@s`vU1_>nyWUk8fWsBWLgtk`4@9n z1zqom@^A{g(ePOTm_m`K8eE;f>wQQgG21z)BFkF~u{T@+@c~f&X4lRpty_c0JZgH| zoUiEV_C191Vmp-=8)M^v_A7g{+1t4}ZWvO+fgCMIA#ZU`I#m9XIyqD9%Y5w7`GDM0 z=WyZc>@nHv=T;lY+e8)X5gr$1aajnSqvrL#Qa_p|9P16pF?8}F9@ zAwSW!P)+L1o=ivElQAwK}+s8vh$d0TK7Y0+r#-;ItYxqbs`pTC+n-7i~Ot zrx@uqz}c+>;YFFF=XY&jaad4Cc>VNE8(nx|7yu;jjo?$9-a}A@d@|y4ChwkC7TKr5 zICPyo=8+2|aGkYn+ielkWEQDSzDjv20)tq*<`?AZ3>>Bh} zVlDPXn#^|iP;(p=qejjezWr0dggCQuEL2j74n}qsh+fFEY3?=kx#$Bj9EV6av(y$X zQTk(xZLRKxklmY*T`!rE_j7*kj#Nq4FNwFET^Gtx*WsSwf2*%f9?s7wch{;>YFpM& ze>9ILJvk@>qwHTf3J{jtH`WtR_>f?|B_QE?idAJ_6j*3!^wi`BjTu#tt1Gmwd zbwj-l__Qe>Nbe+vt-O=g(>api4wmu_-u*C0fsj7#sS4Bru$evZ6_xezcZOZ81dkbq z$}rEGHr*9p!LsQ1$zl1ZvA_&jtM>Q64I!iRHYjEWpTP)Cf~THANoYLzJ|za@Uqjsb zbeLo7{YpeTCC?8rP^#Ckxys?SLk&wd*1bCjoSy{d^yGINs>(TAxQh~S3HMMtQd|BF z*YOoOmAgY)cCXqBnaOIcdd|qPkX+c*HJORnS8N_6uz*vf&#lO(bHwb^YiDQ)c7A*J z$@f<+;dNetxaPy3mL6ar(W<@?xY~Qj@P0dM{{v3oe6_IlK^*%? zOW1RI@FQ3ycfalR55mZXwqA8G64~(Uk}oQ&fNkZiW_yW2f&xr`|036EEmR2rq@utW zJWL(fCM+TGRsozJxW2+8Ql2~mFLK2IFXUi^(-@P#<90wTh`Z^P@L<+#4LN`fe32%Tl_n63f0ehx|7#l3NInxiDrm;^#OWJBQ&tDQ*l3rMab;+5l!WfbMQ*)6Z|9K2f&lpuGi53fac74h4 zs7Nw>X9E{z+n%rrU4hEON;r#U+vk-^f*+6FJN;0W@l&pRL!#BWnh$~cND)V&DIRUP zbx~o4pcW&@oIRTA08kniJP(Uh8=irA81+AT@slne#=Y}31v~YQWP4)x$$c5mFA7am zpvty@U#z+5b5{^bI8eiQ=DNo=%fX4p;BKQ8B)2DlU>XwKVb#C!i5EP=i6 zwnD@tq=%MyoLA21uIK&4AuJS$R>u}(C(a;}UvFcbznErc|H$*a`$v>~sIr7uOt4g}u}_X4ocBdR#zVF;(b zq5?e0>TG1u7GoHo^5ZO@?lt|6V{PI@vGmb|mz9MiD!T&yMg{u)? zZdMY}(WH=ng_j!9&tVbylA;;{MZyGf|0q^ERdy2=u(Rn8GoA^>Ytl2Gw4Ea-UhIf} zR1vCdRBh6JTCiY-beTmVpEzA3!k&)d{igP&4RWVi19*HCw~+o;vKEtlj!G%BNP=ft z&bSGzcj!6$tVQ`vjMmMzDa5Ixh6cgE;8t>m&=B|Ov`wwvJ!d2k5q)jZ8RK7%8>n*4 zWo?lyD>T|YU2R#iqIe!6T}HXNiMr5<5}rXQYbmT4w5dgI^G|_P;b6$$Bd*OA{IvoG z_cd=erJ?Z+l}4CoH5Y$K|5HfkGDbE{#hnHhK6bS~x3;c;dZ;z3;?m|J))$pZU8{~A z4=Ie0bTLmy=-$VRQ4LALRE-N9vj~9s0cij_0Y+6ZAKfJCSUB1kLa`&DYY+Q!TiKh+ zlZ$YGW-F!{bT3(hGY6!f$*zem7yn^ZiY{=c7DK~bX$1=|yR0%_jLidMYPuY95~wJB zn9I-&>`lDSf9~~h-2TyiK46o4*vtTD;*bl;gPQ7i$SHKDNA|J$nk%-;T&#Ud;bQ`y zUD(>(6XA%hEEi>E%rEJLH#d8oN>L%v(fznR5)_jk;*?jA zOk9PpC+(Qns|UnuU?FPH92|U>l5mZn&!ji4u;*joW*kjSWLYE9>#JJhIlplyigcPb zsMbRlV@!FsKYr2!XLA0W4aNBH#>Dob_}PE)x;8`yvm11$3Q?snj;Eyy61iwP{5R}P ze(k4qM1OuCj$Hw9`+K6#W-p~|-S$-1g;X5J>FGg=ho7rIEY zx>81F-vdc5kI2PQK2d~c46$hC?j?~CI{0MKArffC*@qtd+kyWw9fko^i$gN-pm4#h zZ=Q)K177byF1QX*Nqr3(T*|)@tTj$kK(oAm`VW;jfjO9av6SNjq_A~R3 zh=O;)>t&j6BbhQ(zDvsn`Wl@H=UuS9&UU6-9DD>@UEnXSQ9RIdM(?N?_fqGY#}`%F z&nCD1+QvyuAJyi*?cHUGNGL@>%HFrXXDpOQS!kNU3m0X*UmN4TNkPHY%xMC3(02fI; z+2E@s|1@M9v*$HGTT%22%qWhS(+E$4hYDWNCzf)Pctp^k2)Cb3i zm~^ft>9NYp73YeU@~aHzoB{V>hfG%lnD0xg z1K-i2ITb)2Z#yTJJ9R`byG*eAja8H8@*2{VJl~ap2Iu>2`lwul!M>i(@FyzuA8zj} z069yXP*Nfgh7vZOOwo4eD6Waer@h=3mdix}4-LWOUs4G$`y2Zx;OZ88PMJ zv=x1$o|~u3ni5R5ZaXzVS&h`6_vePHs6^+U8A^1S1NHBM8B+2NdFq9(auBCLb7Y-Q?No7+B+}XNx z>3f7^ChV!lz4b9S}VWHFibC$x+t9@QBN*MO>$ zXvtUDXE<)E9br#B(2B%s68_|yeqF9o@;mRh`n56(>~#6IM|yjMoyL7S4*Q>^9#{W= z&|mMg)>)n+EcpDppiB@D_WTV&Cibu%A;?FRU+yhQ-}+k{IrWl^lK*XHz=EpX!f8&| zFAMVr(-SoP2`37?Hw0r}r_-eu25A*DR7R^4+Vi$1SH5|?_u@ew<2DQBvLvU%?9hT) z&1IoV56N?!&vN-Qw&$%kB*+IuvsQS%|2EhM6!$9IZR^)RcO76>+|l_@HpU~bO=iQ@ zbE?)gIm3rI5Wh~GMHJldR`ywRhBxzcY85H=3-=mflW&g6u%x%A24h5R+c{`{hk z$wHQ7J<})BPHPyGXelCH%$+5#&g56k6723($8(St$dLOfM$}WV z$cUewX1R+}g=vKz1AQWE|0f=z+m+pAN?<7cg;0&pD=q|M4qM;zc1}BnUr9yzj7C`? z39X2fAJdhIcKMG+01nmiA%+0QTNlg+Kli2z(4gdMby;BN_BUpqB0BCkLSiq!L}zfO zJ)E*E{DN&!_pU8jzcn~JIK_TouZN$i2MPw$(4=~5hXrmJHVL+iC}-Owa+DFIf1DT; zqV8E?1-`|zSDD#7X(a|_){%M%BX+1wlQWdnu9dDw!~F%QU(42HGzKB^!(#9VGk!7k zXy(v`2_a1URu4wP6BFq^6zorjTAa6^FG{J6d_mUzqmm^V~lM`s!tw$jN%<_eoADe-IJup`y(tLm2Aw>UZP(a$8lgVaT%~%I~>sso~FX5 zALi|%gO_B2X?epR5#=;iF!n^k1>UijcWGkzi>0zTi$MM>2bPUO54BtzpkP7?rZF{eJNOiI1SVB|aLDdP_I9c!F!6fH>;U7lzm{NI| zN(@46oNL5PYXri5@y44k<7=Vvq#(WLZcz%=t>WDuzhVC$8wh0)nW%VF4NO|62X+9E zN9!xw#1bqV3xqHx{T~cB=Ry(@FngSsZ1?jmDaZU*`4j4&nUE!G~cW1)KkR zC*F!vsmqXS$!`pgGcDiMZac(-kdmU=^(QvzGnzlGXLpfxza!qmwy=F}g}=mb}D&+9vD)ft^Q zZ|R`EE53!h<|UMHkDcjF9AlIh@9IQg)-zW#|B zcEoyLIjV?h81z-!`%5R{2m9T5;r;s3p#D-ZSqq$gYYJyjaY0Qgz}b;ov|0|kPJ!ax zT2j*Sip@3i zz^h@@4ZTalw_Be(820f|oXv8nX8u5q8U{(IHzIpLHJaR+T@>=ep&wx27iUDeleQ9T zq~K<3fVT2K9Y%Itp3Ve~y-q0>7Jd)5Ali;$;1g z^}ULOaP=Jv?|SCoj`M?GeSPoM6~3EAc3fx1AcQ>PCqr-Tl(v9F$Cu;?_$qK!-9sah z_E+J~ZN@uRkMASz0cStA)9H7Io~~{P7H6k*EvX?c z_g##sP&H~Liys)L5VxpFF)UYeeIgsyt}ZwqYO;Fo*ji5H&%H)I@y>P(hKk(U^JpB& zGsA*B(a-VzwDT|RFR}SBIOo7JLbq@_i!GLKvf%F3bzPTJf-T6oe2)hyxi0M)(od8B ze$4dygNjoh!C|Id1(-&l+&@5(Dh~h%t+uFRdFHYL+_9(uH(9`)t|~f4mO0ZE&48gw zrHc8`?0RQlv+ER~E^xFeS^lp`qFDbJ#D7*hB>YWJ43OD|&<_IXP>S=H5kp@?KsGD? z9-Yeawm2*kj>$gOksz}C3YZfQ%+7IB>M0YBWKG=*N!&1i2PgI{V7$8aT6+{o(@NUg zxG{-?WYEILZekE6cdn5$V;V~d;jowNVNmDdF!utb6b>f*Dc6AQyL4-5lp7$&7rh2i z>ioaEHybxX8)u(_NGPoQI-f$&pA(TeO?jyUo7`Tm?litxg!1R>l^?AjjJv07xNtt~ zTV+~yq%=MKeFrA8!Sgi3er7zP&p_kR`LEDBa!^nw zO-8u~*E$YcCo(!i6xOeI485ci#eGLEotl^~9pPR~md%lKmOrBo7WmY);QapoQP_6v zpw^WkRW`wY^=L}ESAReP|9|oQy&=Ql`hwu^(|7IZUi!M{zOMbRtF|B8)}MV{YhPDo z{q=WC`+C~_yPpq-=>iV@5&qtSc+a1|(eiq1)8zFdK2Jgr_~>z zew*)~*M|K5(IdZ4U#n=L-=pa7(tqdfK=5U1#5MNk+Z|cz+8cbD2RACre)4%HfYT;g ziv2Nbb@P1RT=PRrl#B)p;OHcR8<^-^6|wI5UEy*+wYRun?nr8msrP9i&dA6Uy(Pm4 z)&ZXQ2xse=f%!)l>>w|OX)xEI6Fd0PJHl%El^Fy|%MWjx=Vjb~1JsIYVK{R`MH7Mb z9dv^OPH?|}BFby{H95PEO|ELuN6dy|>rUmwln0@*rQDsHa>Ca(`*xyc^A8To9q(cKPVwqhMF-T8*bLA^@S`6D7Y?YuGlo*?xRbx+=Z(t|>$wv2X5j2YpY3 zb10PNJ9}_eXny!JfHcJrj8GvtDED^a1UrxMaa=FSYU$>SrBh9d(v| zb)ln>j>saePsFK!a5^BcB_?xRX&+Mkxc*9bJ!(gng)`#CbIpHbV$=RxAUemx`rQGy zxcuI`OsuNJm9g#ZIWnCTL&{p^gb9e`J2(S^1~oRC^Svm$GQK6J&Z1izSszZll~%av zJ)=sw8`qX`{3JB0)O=g8Ai)zJEP=u^zpBQ(41)em`zK9K!QeCLu-N+S?+7osykbdl zWQK+OAQutMbLJa#dIM)KbhK-K_tA_c^CB#j$c^{_8Z|;Y{(N>tHJD zH`fdr)>6OCj!k~^*Z%7lvzRszd6MDvAcLT({%2ThSIKO^R^F0$UX&KhHD@0)f)SK_ zp~W3U#H{*dOHwZqE5=+fA-gF{&wSptDJia9?5;d{XAk5abKyvbMXty>L8m55eSsCg zTTTzL3qAnxAm58Y+6V##PW$~qwm4}>+L@MUxsz^(xcpXSzp>7!y<-0(QbS6Bn9ToP zamg?kAMXVI_9+n7%dhv7zCX?>%wDsYg0-dv>tTuT;l7NE@C+k8X&2qHcXEilTsTF5 zugKLo5zd+aSRnz(bDp*7tj^c-baJgW+xTD|FMf1MJ2zlSovWcTW!8JDu%b=Iso_};?kW(z{Ez%7%_ zrpU>Y_AvT+)~3g(2B9)m8111ph`g{vaW^$S^%(VsS_O6ZJw_ z3;o(?!UMk&ke4R;ln=S}!rR^0ESTiz5r7?r1m6*?LfC##20?RAFpNVR?s*ond8d z(o(hnpCR$(6HckgWo{S*$;^8&5)5Up2Y=Y!>@= zg36Dw1g?vfSUE5oZzp>^LT-Wd$tcIV4A;2l*s{Ns>SGLq;$A_>YVweVyFz#iZU2b5 zlCH9URM!%Ac#rZ@xt8L3lGDnb8QL|1P<$lL5tO`h=UqWtz75vOEZxT3+Kz~X1^Gl4 z%@q~j0brraVw6S+h;-2^IG#ZTo)0#EWx~>+^emWs%;~|_QVP2Wjs!QypEjb(@i0gdMc#5; z6fDAKhlkz9{CvQ7>ynB--va%@yDi0ABKW3*eKjWEgN4cE^%+3P&eTw35=5YZ-(TL9 zA2u)(Op}H>$}cr?2V?n&}#RS(vta>s4^dA?v|l?GDWk5bX86ntf9 zDLJZFss|@UuD9W*<8EM9`dxIj5~Nq3qzwT~K%2+564`$eMKDNGgr2=wivI#X+>%tu zp(t_mhd@F^B2sg|DJf1WpBZ>#>)Ae6xh)^{cNJ#tt+Xzq6FjnE3qho#UypXr=6l%Y zbp{rQqCg>n0KKM^Et!ZZ(dl-yTB5fWkXP_eOKR+{muUuZ{L=dKFu|!&mh$|2ZfQ3A zn!9KA{mbn`um+VlDSkcyjOQq7;ghU8{=#aa;45_C^>VP-T;>fjMU$XuUN*or;YeSR z7;Np!Qi05xP}T57WkrpyKNs~FL&S#b1u-<8SaIMP*@z7~o%nntk#;jrUx);Ro)az9 z&k{@bw)+UbP-2pv%?}n*rUnGDaiZ$ciurIcjcx4Hj1uknL?W&GJgFAVKCkHZD{)5e z{PH>h=Bl1-S-B>9jI?IUKObWXTQw#QJ{l-l4dCVk1<9DqS_gOH_?llpie|#uHckF0 zwP3Mm8{6F~@(AXPNj!r&f5)K*LhdUbZO?tOY!36{Bk_uw>?93cwxwprt)S9y69a#< zVJX~mpcsYgaA^EF2BWL{^wyJ49TP|!Z#BJWW8DEeAum@XP(W;sbcbafhr`$`Z_U8; z72^HiBspIJ2+>i-@YJjXD*}@3bWe;hKYY4H2PV9v@aiY z)+ewlu;O4St>2>pV&_T5P8LjCoAQ~a8OeIq9ME@Q$7`N&3y6oI-b@UXwV(fEv zi_mn|R~U+r#R<{_3$t=2Jl8AvsDO|_YwA%{>A3W0ek;XC<2_k{j~s=sZI)cy(8ydn zf#k10)sshyk*6V@TNGl*c+o=8nv1@4m@-*0^J#a}p}I{C>d~P=Lrt zsA^i?(FRnLvXs-_MTVmWFQ9CzP-WiOgt9OHg;qVN$?N2ut0R!P$0pdv3uIlgZ*cB~ zL-pnSDoIq+%1_L_)Z`rICoe#Mwv^g`o;~vJUx$ux9bw7)3iEajMYH~-x2ix24&@XM z@Ds9pEo_CJV&senrdUkGs?X4vnhNL>g1<-ppXM-kEFs%EUF zK)YvN|955%tqFn-U*qg{gL}U-vy(2@SjL-z;1Do zHz7dGbYt2Gnb#J$H{UQI8RZf#>v(Zqj| zBNNEs#Br#fp3!3~+Br9}$#JYGQY^~ppF#pq($HKfFdT#8JvM9&WoZ9k(a}Uz(_=Jw zbGE23tpXV$=d%?lG%};n27kul7!Jr0y$!Xv-2+J9iC0adw;$rzmee$8y9+URA#Cga zbTRzg)qaZkazARa5}e;b-N**| zVFOo8Bm@O*{=euPlo6Lowy71Hv6bS`Ik zFKxJ@noL!OmLUH&@NfTd)Za3#e2D79GYH_HTG z_V~zT(a-I;&{j+kg5Xis~5io(&&$t)E0z}?Pgdg&KSn*GAEVliNZa=o%5+91wL6d!ydI_7WfX&UMUi7K?RuhXB(QVhXbzI{)(j}mT++mWtdfw zTJ3PWO9%Cu<$1-coc;uVs4-J>aBdNQLLevh!(G0DZ;Z#sTopY8X?U-^WO`WBS_3C4 z4gS~@zL&#sncqhk^T|mcHC4Ll`Dwixk!ONNtEn=nb-z4XHquEG^Q&~xzxi9Z^@C-c z{UBlpO04az(t{=80>}<^G4vUPCXQ}Md#)m-SSjOl$0`+)=9m**%s7~LGm|2=McUG? ztb}#ZwiHS>-c$3)yd*Spovp>M z)+n4-G4P?Kj(#0%DIIt1A|S*xUS>Q^4z)1mIkmQ)&G~Q*;M~oj=s^&T(T)9+A%ejl zI2$%2tFIANjP?A|E^mTGT$^vD)t%lfyu~yv!(FXl2>4{oatgUuD_xo0MN`DB`R)rm zl)u`K_z8G@<2|oTQRyPZBcCEsh*P9bj_<=zfemXm^c#Ea%8mv2tdcbioArE-zY!}z zbx;UEK+-K0_&N(thnDcO5NT8z?>asJ1)?}YB<;hc&Yy6mc7PZS)xr6sKZcY?sgF?C z%3CFov1V6=YVq|9?zT}a72sy$TMJY61lTzKk0-QPDKUx@*o$D6V_g2_a- zt{XcAfsm}z%+u2M6&Pq~HH3&AxuK3dVfu_G+~;8;KOes^qnA@;4yb-u&i@Om~F5+?NzmB z?u}@dNbDm!qR0(!=?&8g*k;WEN^!^@VvM>GiBp&V=>VSLoQXH$tWVaSbI4&v80a2*D(< zE=6!;LvABYatVI5GMcED;*Y5FHx(!bq;pU=M%-K_2R;peGJptGw0uQwv-bum68CZa->4>I;w4b!ob?cuA_W~Y5PA^abC<>O%x@B_-V?OM0 zTNN(FxS@TTP#rgtV}Wd%5usRBad~Wy*M@F$Um9p(k)n>voZAB*)%t;8mgf5e1xA$H zZQugH<@MKD$SzRpJh$$+#6~gh-ft%zQYs0|tfn}-CtVqF_oWc|ojp>dRGMA56QYNp zmF+DwxMS@iTbu4X=Xl7@p^wM3h2ngDCl{zWWF7~rM2^#hn^kRH(=w=Hjvk5mhq@Qj z*F<@Eb*#FWT^+hI;^Zq3@&V6B7ND#E%h$EeW*q#I5GsfFbX@rlb7-Lp)nE_Bdp@zxx7%YcWG{z-(!)0VI7Z|wRc^8$AiYw9{7$$c#S0(WWrA9?jf0+!iPyZ{9 z#=FHUeB`?J=NZ9?leZ;5Ai@G@UKz_vx^p~>TdMi~9_&wvzuU@$mVjo6Y)(N|+aAZj z1v1J%q%~H3XylWDxg1zVHh=cIN3}M#%mLy^LX|k}zjC1lfdKF+7?R8TVFrKk<7l)F z?P#c+Yea?M=y{FReg||KEkw0^XsmM7W5d@svjf@XbaMGL<01bO+H)->y2pgr}3)d|TJ zg!j^uAYmeCf53^T=jcZa!^@t<8u6{4Jy0ub`gW-876}+zD}wWB5CHIpM05uSvX?fK zgZpP_WYeV3Fhm+j>$|BW|9c-h#T)e;mT6@bS?1O!HxN-aDiPDW*dij@B}b7$0>&QE zp9T03{^ReChK@sibO$>G>Zs*lc3|(l?0LZ1uYz_C7S2uWk;xQ~ut{822g9aoNq-rn zh^D_f8O>hk$S{Nw+MQQBK^crl16QF^285hqr6_XVk{)9J ze!}k@Nvoa>R=VKHrWL;{wD@~Tp&@I(ayyf6ZoV{D;xX}0xB16C_}zdEVsg~4H_4vu z&OSU>9K&mkU;wPo@z#aucQF8bqQq_eF0ADUVvL>Q>dAE1qk zCIz+~jgTzz3VE%1tzPosi}}xCo|4 z+AQFde*l+2kmzh5$MNirh34A}nl)alMjDY63)(9f-P#@$6lWQf*Dgkwwx0h zhgMY=rezeyhsp@9$`DGGUsm4dv&eHpb~4-Qp>SsAB{jbc3mb6}@~&!jmMJZ$-;m1x za-7Hu0r*zkeBUtR@G{_QIk3>DguHx7>i6i{-CsRh8+7;(}lew zDQ9LzSny?+ltPEI{B zECeTs{UB1+u+WZauL_fh<7TT$HuAhP_6VAJRmJ34SP=x#owb?+P&eL0SLWNC}w)nzS@Dxay{=1tA6W`Ui{0NKoC^U0ydGlamt8 zgRbYe^HfPPSE-BuNbzIm%VtS6K}LBiM^PZqazAh??Ff)tq)VNF@4trk`jg`Lh)c!E z(d^I1e*XAaUK?Y;R(C1Z(#XD`SX}b|Qzt_vcnFs1@(fB6=tcoy0*ojQT1^Q((?lAR-w;X`k0hH44@wA6ZvLr|naS z+-*HXOyh&#SI2hd<2HeZKx_S4Ve{pKM8q)Q`)Cp6!$`$(qD$FW;wEqpl4#oJm<&;B zIE7bm@!i!ZFT6&ROxg>7g!=f5P5Dy`$g8Jmj-Rg`S0P}E4VEpSWI*(;Ox3R1@ZW0W z3{Y77F6XErBB-K}vMDnzV~r|g3$_%vJJ#!xb6w;sJx*zkihF51v$vp`{Q<2Ra0fhu zYJp4P!=MlCPd&Y?pKTUaoJ4F62;fU#8wDKtz*8I>PV@@oBPeLr0mo#|flb?@%}J#& zF!;d@`a%p1xVqrbR;!A0Hj(^$+?ud`&m;Jo0)7s{DV$1RA+?fm0<}}B;Vwx@2Q+=x zH+x+G6l9S>_>6$7N4S|*7}+}M{9&_Fqzhms>~g3Ox;JXfSl|CdJ?YTY7B$_-({d;! z0#S4h!Kt4nIM-%4cI?hz8A9>GHqoo3uIor9Jg~Y3-ly7!P=DlpAOdYpGL8WtvPoYO zR`wed8BdM1#loCdPd&rq;2Ox0Q1AbHPfZs9k`GA^wH@$nafSH(!mIYI^+p81w7 zPDfs3NP~w-;M*8G$FxG{M7=M96e^Q@p^)6tJfCVAL8VhSo@IQo8b;U$a=%u>S{8~d zZ3WZXs+aLVxaRa0E&Bo+IQUL{C&{N}Kvd=Ki*o*h(B;cq674n|qQ)Zm_VAKw9Qsv# zv_|CFVcM!9?Oddbt{4xi!@xH{MT880C`!fsAr;X|cM4#;VbC!DfQki1F0Ox}iJ$y1 z`j;>q#nxon`J(p$neW=+mI9T%!(Kb6ISW9&Y#%3|MRzCO3!ZCri7>!(DttD$1*b=m z{ghV0ECaj3?gq@Y+Jq6k;;^SwQCS_N7Q0Df;gMQ}D2sckfvyd(~m~A}` z%5d%{4VW5ZqILCu=mb=kYBgHjbV2dQfDgofNDes40uE(|>RfCQXbQS+Fk|cuHtn>B z`Vl)tzY~QgZ^N4$|9PKSmPdY zl03Ewzvl530t_;w$98`ZoUjLTfP9jKBEGye%>hNBN;O&i@hg)O@-Pu=BX@~UtGGD* zJK(dh@-K#&y2Mp#yoS6|^~uu`fArDcFjGLl;$dh`LIjwOIt`t)J5T?A^i?DNbfsHJ z6!HKWUCqv;UyDy(Zev2h6_EBsU9b3Ii}~*fdbS4F z{W~Mf0iOz0r(L*jh@9R4C^A|!^%il|M8Kw2xxzf1Z7a zqC@4^!8`qK?%zCzkLq|u`5N_N_l*tqr|T&7HB3*qHWY4Lb>-@>y{NQ96wyADHfqRTp=p( z0`cok%iNI7p?Hr<vzkdQeMFbqO!b)HtuV?iOAov7WC3!yLg)1;^ZA?5mRtUdPdoehfZeX zxqi*B6efb7lsr`|w-L&8k0VHLR;($^Agkz77#9Lt!6~mUc~kk0M4ihFn68Fz{|{>$RgWH5h&^OGyV`V!8GH$f3QZCTYj7= zAgW7Ulu`>w&C4Gg_bohm!1vfImEuf|K_*}fN6gDyuAd)$oSV;{u>$REsEExz5=c_gpBw6abes zX`5?4-AKG1v;(h906|3xvyT$L@0)fTYe`!|%YbI6=ERON|HIyH4#1Q5xqO!NMa*Otv}q8XFoz7nx&#aq9d zweah-bqoZ;&ikj5MEMp|y|84lwm_3XXV8nLQ|pflM4u4ug!@z)Gz zYP?HTDwmM5J7=Z1+aCHc|9_bbu}}XiEDf{(0R`bgm?N(W+@Eo$Y}p*8JAoE5f`STw zd$R2xvM5v6K_`M6H&309Hm(8^1!NV33@p^h^%3N$CJ9XeVg*kRp_;JWN1@;nH1ysh zOO`wD=*F3^A@;xrr8=fk6rNjRiID|CI<}xR6@!L9t}VQv5!SI3^xfp`faGzv?&kcz zEy+gCK_>ZTitGu3;+#pMU|tnq`cC@is`3)VkfNQMi0d?9n!W<%8_galGdfnba7VBO2R#7%q+RM3??dc4asHd;d=Fnq-wG zP4?GK6t-7eWCyj`vlzoCLQ(ZWI@=bue^W)~R~R=~22bqi zT39JF!FLx}hU!59^U!LoOfMB9uFjr5;b$wYodGTa&b8*x0EKC6jQg2lBfMx%kUJOj z8R=KM!HJrdl;5CbcEBglDFP^}Wc}3N+NM@qIc}$+rf`}VYi}mE?Ru?K41zt~>%JD``STJy5*MNCEI2nR(dommKDDfV0W*e9 zZ&|*l%+tnSmoFT0=Sc1jqAiX_YMU9)5T>1sHy%)aOfSI^h{z~X7Te8fohW41CB@6V9YQf?5w`RFz>u1$5BQAAo}w!Y7< zEI+*N2IOT0TMqkht#qtDDJ?UG@r)G$NhhnE3)9Mv&M~pj@DLh{x9rvMABAlogKk_0 zC|*{DgvrYafV$rbiiPqF+6KA+ZJ{Vfu4{yORVlE?&-gjM=QWQV2r(Zi4*5wITa$4U z>0O7ds;d1lx+Y?tTj>(LY9Hi*noRCH*3UxuR_JeL)th&Ew3Om;i>?KmUAP(8l0ebU z%#OEB$0dK)ePfksxcSna1{{e)`46_c9?A6kLWAbE=f~PdJm-HK>yjw-})ek^e~WtrblqY5nw3@w|@or~1_+ zJ|i-dZS z#L++gh60L~yQwv0?Z41Oj*XJ%ql)0YzaZe$P-ltIpDtn22mp_Eo_4J$8odv*zIg~} zoP10Hc>T?|E=WYyRNrHFRdA~4XPJe=3pM?rFh)S=~|Sqv6XmZQ&)0AVMsE34`< zEF~E?NO$Zn4ZO={j4Fc50*x5wj@CzC!M7udN6!>ph;fEh3d8wA(@wgzI(WEhlnI&A zv@&9voNrfl+wJzGdwDa3TMBcS02J9=Nak!DN?EYQrz|woAfk8&O})_JgNo}oN~o`@ z0aE%>dtOwM?n)^kUN-nA`-gpU4#fd9QMhz^q68HSYiUN2o_$!sktp}CF2>g?q5w`v z5oPt6{l)dqL|`UZ_=_U5rfnpgmJKO50ke#|2!p2gpr51+0-+yjpHoc z`Izn=zp5rP>X0u6tM-Da!pxD9fr`!6ZW-kt*Cy+iKWXLZZy09d0_cuUhca3l-%|+-x=Sd^7jiP1T znDC^wkHWW^VVj|}AXEqN)fv^y-RY9+msf~CeOdc?ylJ5q9+dx3 z1?0R_NGWWvY)OUA2-a|Edjl5n4(iz2|5aqETPnN&^4P6BIU(*@B`x{~V3 zsPzp%djM1A4jx?>{tZwkXi; z#FF3NM@N}xwf{Wy8iYhdn1JF8lg6F*S!WhGHa@J4O}(beR_s^+slx#qwl zT6PG=P)$HPWa(!xDGk$A;HcM>4PdRp$ZyEDFu_E#RA!j792>I@sW&nl9EmM_t5r26 zKATj!q*B&DE!Nz4eKc()c32NNAcYa_ia_v&QW`-+G@vqa#*A?LN%fk?5i#;7z88SV z=O;6`0c~GKTr~cNO5Dn)`5IBtRx-TS-!(hp@RR1f(J1%cPDtO!88&5hBwBM>fYEt; z?y~zSxS#$avIi>8s!Tth&2Gw+V;#*;@Ik-Cm?WWu%Zo5L1)%~w9)TvLblShMwz;tv z3ooVK2U8}w!0kknOfR1;1@?*v*GLRKbQwP@<&5c7sN3@WV>YYM?HED+Oz~lz<%ctb zzESnLBVN?im>%d51L$xrTcwZg3rV>2VTWyHyV-}q#nV*Q&DA2{Zlfu_jk=(@1vRJgP!TH zEtLexJb#1X5B)EBu)+CeHk!`{5;uhO=Fjx=5%#ACt)|9&b;;vZdgPA;VaViB% z!zvIRZ2q{&c(JcE`FJd;(_!IcNl4Zu{iwE$%~x*QEsLGwR5T6hQ0fkxZsgCy`r+$E z(%Z~u$gBm966t&->+Z9;@(w?K=G>SJEG9X+>Yj1R%L3Qlf7mWML6?Al>pD|8o7ae| zz;)`~79lV^f)#?lF74Ny9>P2NM@Go;{Mjc%^V%L$!uoIF(J!W}OqA>7nA0l!7~VXj z_X4*Mz-W4DVM;A3G=kmsCi}HH{rvV4YiuV&FuHh2qV-LA%dr+0 z1;WYPuwSysnmSV-^QAp*n1W)Z^@cJ;kRx;9;03_+ffuq z!lZCEKaH`VdON5tnOXs<=d% zJi)HbZ>4`G$fQ$F;ps!HFtVR>5ol@&&(0nSVT(={qS`5@>4ns>tYp!lj{v~9wz>13 zKY%kRCwdObV#YCFoS{#9wJ{FGiZ$&Fsgb0p7s>bbYJ^DT6=7|lga(1++qElW_a|5h zS39nOIL1U>*`*|e z3Q}Qgxs{V#8@`g%|6hJE^rCHkv|)N|QgOz<=*|C6(t=zTMeoN4qmlp~kF7V;EnAkS z6YxQkf@O(^>3mQXeF{rDS{guDJ9^3O8*o?t=@UPNX3mn|`QXILSZHjzq+tnqXPa@10^D-}dsB zHtnl(dv(NCezULT09ZLI_Sk2pf*x+Zi?nu;R~M`&}2XNZ;e65Z#k;Uk0XoWGegIX;?!TmL+;Yk`hT}pa=_&0WkhX_^p-o zC0CgNGE;5?;$-{(NMZj512rF-yul}^vu+cS>xZO7?ySHR$YS~9Ys}7N26q{iM=*K4 ziCd%1u~DA-uS9Z2O4rqht;*82S!#d6{Ohb#xaowqNsxA7zrA`tD$Q4-y=29pt=Dn( zY^WM+4ZO99c*zK3Q1a!wr$!6wqiKbyq5GVDJz#djQI;pbN;eCpOraKp7L$zv#k0ug zeVmQG3tw@uZSjI=X4dh?#f9S5*FI^+E|I5v#f0T2jK z3t;1O_bX`crUNwjy&mZ04m?v5@njUJX#GNH;Z#>`?gT6ip?s9^&X&ol)I= z)lPqIVY-^2#yO7<55D2bJ3}sJDBON}jiCzr8%J#3ws^=RMfL(=TJo3R_UHpMjO9(b zt`mImM)?-5hWt6_ph0N15JWg+kB`Uq@-)K-WqHN@SCe>O)}Tajkxr1XPpl7HtHB=c z7^0Bc16R$X#x|W%7YucH%8Rb|L9@oFca0}LS`y()GEBIYjFS-9mzkDLB+TAF(dU1P zD<&xomU*qgt}9C!&n62t;!T9Ct|Uj{*xZkI9bHmlcma$$UnN{(iV4e zArf$I$X=;ppRdgL4HgdFn2k*$-eo`?!(P-?o|=NCS#^TK<%R5@5UvK1Kb zv|O)3lsKE{LIYf%LRQ3}Qw_g;2J39?eCjfbj+WB+B}fxgV~f0CImh~@_{GsjZBvFL`cM;(I_w9U#Q?#(gNB90Dc92GFa%9a8m9NrI&U5%km>5s6y z3l-5#KpqzV3ySR=gl8anPws77SlJF38F_WS0BYzx`_acL)gFeMEl@6G4*dPgPp=l= z>xX(-`^g!xXsDt}C2FfY@EcX7@>Z6Q3nh6Eyc9bs4d|XUM4v_(*!|sGSh(VyvDfI3 zm;VRWyttQBnW<<=xJqK*O_OcyiGB@;vYpucfa#t~sOSgXL`qp+d0)7;6u}}Hz1xwj zacDiP24@e}jE@Wej-DX?Po?Tl>;;qry=jtYdq*G94ds}ddst&O9RR%!$S;Y6pkf8c0LSVbV6 zfwj;Jj6Q02q>1p)V5%a;ECdY#ez!n3M$do0L1RtZ(Gpu{Um-g$^HQ-xH=q@zCAHT* zXjI_F|7Xe?tOtMV|0)W=YbIPIdhE1tuv?6OkQO2$LtM6Qu46i5AVCG-xqQTbI61^o z9Fa_|$M?vGD4CP?X+V9|O)GZC+Fdz_f}h&mP|Osipi|yVUmnl9#*wOY7O1z3u);XL zs~^0`wr;R#bv@GBJh!l8o@+OsZ03R(|1te&K;Yvuf{wK?)}B>c=xrKgjPm{UQB*Rw zxgfoncaH*duOP536YSYL^kcb7kn2FDE%*(~X^s)_({Lp@1rNop@H=Bn1Ez3bCz1&k z?rEI3A?oR1YQRdW0iXJDTO*yb{rgQ;5k>}qchf#qnJ{Hp{P`tD8Gfd7!TY|GgD4SF zjs&&<{}`ZGG(2vk%GBZU^C5_1v&A0d(#TOj_&!J!O~vdKKKYu1p$#^izDF(8QaE=i zDngk|>#doJ+06Y6bHa}&QFwij1Te6g?mJufIg13j{BxD|(b`{31&Su?n#`hgT50=}{!c(@fFp_P3{yrlSym^c zn(MXshp_3fAuVR~Lp<3FmXfvN;0njh>pp2_L>5`7x~`Tr&gR(O)~8!saCB^qU`6JT z8|K3K2Ayl%w73REE)RF?og2b`YM4MJcJN_dA9z z@hw0N&akY~&2|zLK#x0PGxb@pWmWseN-J68NM7zcj|JvE0xmYD>H)bzz5z)Hcd=1_ zfyIDjiD4pd=d=1XmKJICaoZKjKdaWBRF;!8-GXfraE=O;G#pVB0<%RGCdlejquP-J zB1OPvfdP1ONSn#nVVtMG1WIQIX1~!2Pcp`Br;l;s; z6ZpB`rU{gB4u)EzK?I%Xug{(up06nU{zExeZIEy2dN9M^wNXUW8z!&vg59Cs2(e(Z-vS6CvP;WIHZ61OI=)+WafyKz9F1Pk;YVD%Kol zH?CT>`eiWRlFyOJToo?+IE;apdj>qPF+o|`PDD`c)avRNLOSJeA##r_JGVy|cr&4$ zFZ$Z8F7qW9M8ie5r6G&}hYgTu9TH3e4pV4HoIyH4^(Gm=_K8gswPusT-ZyW*C30;l zzR+>FBVHxQV*NH@uEBrbeWI38z}=)g^!-IW;9fkxXNeyHYDy+?9hc+gA({RY`p_YB zL*)Z4y#Fr$TJvq>t5EuSG8=|;P=il6eJFj|ru*ONCn%Q%VkcI7H>3QMr!%j&IOC~L~3_L4oT@C5>Ke1g{+SVu3Ml0O{wgUwIzCBfTIbKx9>aRnx1|8x4x}3q3a!H z$Vf8Q2TDM>)VXD#8POm<;Ppg`*lML&H<)}Xyk6>v#x0YeN69JYNhij1$coK|SQEED z9DqAj1#;p^354GS4BdUaRDE8tzT}2-mA6|W)<^s!Po`>z{HbXSqfLW0*R)d|f7sa6dcWXUu%$HlR<+f@ML!`jE}ux&~d{pU3-S z9H;lkN7t;N45P|?r*S@qnx0m zXhizO!Eh=5&bWJrN`YTkH_aGL-`rae33uove%KA7-&c7Tz1hh_Zhh^FV#)E!{)rTL z*C{aTBZbk56Jl=Bd)MyG_!e`)J!G7<|T63!tqvW94{pPv0(&Tu?-*@rlA?8qcV*&Do#ZvGWlLvYh@aYvn^PyP%$*i+xB4 z?9`Zh6Z&oV`$;&P?Ta4G3J>lz9 z*I7vqu-p054;Fe*RViLeGjo>vLUJs=Aw^b&;n7BL>V~@tz-y^3Wki5wR4HBF*!bua z9&IPltfOSypQfqv2XnpTupCT4eRh85s#ptk_g^i_=jI0m7morI9iJzfXKYhHXH>og z2;B;sO58H2Y4p@F#9UP8jXGo%unrvWE3FDxp{qo$dVSPoNl8Zf)1lunb zxRr)kcz9_QV<_GT1nE@$~}Y&Yi@?Jz^967ADOP{)CXwxeR7W-!~GAA z1^yfg|7>nVf=Ej%m(t3#dkJ$9U}&HGNnH_B5ORUXpi2qE18YFB;^lTB7hyW9wuAAB z9sP#((=XRcVZJ${JFHDFgu$DdpWUo1H}2L;*Wc7|HKHLDUUZvE#!pdAD%#mSB?6l$ z<4d4*NY!Y;f^XlDtB$AU{+O~tUKP-YB;_uhn!ER@~Ez39FcfX5x z>8qhdz{8sR=|?M^k~oCO*f^L{;29!y0mLAwNu4^z)`|C)RgW6D(_cyC__lyep5r`T ztWOpY4)`derEV8V)tsdgSZHA56Tfzh59W|Bb;lS}iT=+gF@3m(x#*n&bhRM5OkZDd zNv4_g@W)4_t-dpr6Ni0dANe1v;yJ!_!vqvly_p@ex^O5Y1v+;-Ri*q9XA}K3bPBf~ z0-p`+w%g8D(FmuRwLVi;k*u#HaIUZq`eo(+( zuq!Nyx*TNe{njae>N`TW99HvqRRww%zXvnot6$n$_e?>v$H+4`J0_ z^CSOH4^Aag`GcPm*!TGgSneR->sAYNy}JTUS(ZxagLuc@{qwj%tv2vzzkWVJ=@t8` z!=!eC{YFFJ1~V3;U*m_nTaW#a(D?``U@a>SbJXK z0Y&e<*bm$LCxdaBCD063YHO=Ly-{7Di@xwvUkLo4M~sJE*EwPQg<1sA&!;t1u>qL( z%OP=!eB!_IyijT9EQp19EM}AIm!x#+x(tR|?&<`_c?GC1?$7U%(tpX&#B$3PzNsUQ zVMpr0Xk{0)e>Sg5+c7->uYy9DWg5*4i@-?I7F4ZaczD=-+=sdx^RBBg_GIXssOeZ5 z0m9m=o}Z*1e^3bM{V?vmfLs_X<EI7@ z8(|c?d!jd@9rt^N7x#h`wa(cJW1TtV8>N?-qI zRWhmcD#c5)flnPp!f}c3Jc&h?x7XoM!v>&_A`?YgnJ?OXjH6&eg=SQI!T~Q@SAMX^ z)zG6-UyI=WMG8KipHd#?YAAf$!^BibV&1%pMG5Ge9I+oCW0z2{Cl+=q{a=_v|0X{{ z6l3};ep6Gt8U9{?a@v}geM$SglEQ1dE-@o>$ShG0Ul*xfphRc5k~j+m(1x-D$L&96 zaq?YjBS%4913%mB57{E{x`i(&%v*t_pUHAgZ#!S}&wS~B^p1KP>q?^Gv+X7N=JZ%{ zI8me!4ve3|JywivpqM#S5xiL)?Dc1ItnOgy z(=`h4wL7clUpdDtMF72K^FgNr`NAvGs~Nd}Zqvo0|8e-Ohmf0&^^?u9-%PgOd&|ab z?!BES8+!5yk{_pIFY!VXPmIGrSB!acYq?ZtRuO2xV0rjnlB=KPNz=5}irFfV=FAi| zTOXo{*TE_wsXb5G`1o5TUP_Vm{a;w_y1|wdNLqlF4kayq(xeUQTYkh4Oa{bloV}rl zEmwOuog#(3omO=<-DNIn`2F5Q@)4z z_`EYkhkpyM)L!n21B1phnWpOhNGc0qT!ZxsRhi0Dhz_KbktK>i{Cl&&4u!Zs2WbuU z7d=5LLVM9!F9fBp{=&}t5^dB&OJdo3MQ01CqE6g5(5TCZyLIW>=i=-a4341mM0SNI zU>xI8Cvd~YS4M~t8kPPa5wILUa+T$$K?sW`noz=8&xmA?6V*Mgn&Pns#w z_Uq=V@JQCh+14)kEtHgYzvJ+t64PsIFXiva-D>g)ZiM4%F1%X`BxBkILu!~;X=Tt= z(6v@o$Un}d)Sht|M#3h9OvWJzz6P4kqNvn4xA-YVMIRa-_5}2D#mRt2XM-=-Wd5bj z)3id1g@F!yku$=>w4d=auK?zfWV&c0I;zPRwdXx@-@2D0v){9nj_pc^5X+3Unx~C} z!BjqtX(+C0B5Jh=_UD^GSsi;ZWIp!c&BWZGmr>>L9LUm%p%5P%IXf@LOG%Eza? zQFhsswPNurjNUgYoJR%nTxgAQP!KX1I*^%$i zw9b*ZZ5+Os2i!%Y1a4G9^IlfVk!0ptD}vdIOiUHqv^K^yCsKc({3KDa6mkhafKjY5OFv|zcweGkLPPkOeK%MUmzjbnxMHa8hL~NyL=8ZT?g(f`ik)2+ zxmT%g?C*Fm-DBb5AkcYRE7%Tc!m~G7PF}jYm{GJ#TufSSzy1|88U8qRc7Pz z;TeC0Dqp2jWeiE9JlP;a{jbmsi#mhIu?Gj^2cvDSzmZ+)Af)=zCL&ZTA))-9FkLla zl&^cMV4|TRknHD|I>TPSe_Cq!) zoe5I3&D{MkTA0p`s=zUI9;$L5+~GIZsbVfb(|FHpVu|} zrGh(M4fj=0BT&@2I0!suq%2kH~S*1q{$GMn>#M65GC@%Q!C!Nkq zYa=%{F<;v~Dq)4&xK;mw%Jw*|&rb84@4xBDC-Tqv`&HepAD7{ei3VRO$m6QSYs8%Y z69#b_w@pl&2qiM8+j|GG(A)h6V=_$tf8blA01I0AAuHNtuirugB1PcFkzFK63WL5D ze`Q=vCOG24sm4>h4R0)iM`o~g{9`FpbYauHWBnaUyi%NFKW z{`K74l%N{&97;)(ZJYF;f2g|c(Aa-pG8n`zM51M~!CY{LUwa(Sc;#QHVMss&2;VOA z3m1@a#V3rr(qo-g{s4BcOEwK2dAxJ6ks_3 z!$@QPU%E|+@ydVxYL!8V@{FevB^fpVjmf_HN82Y4$zY|D zs=6f;^{`V^9Fa+%iKZ5zhjQKcoJQU%tvuR&7*+2=i1l4#g#HSsV@_Q}TCxlI7y~ed z&=pDe_b(5F_OvUcl;p&!a*~jUYZbNXT*~w&mkOVSI4c5-j=!BBCGw5;iyCJh-ZDJI z-grWrI8gq#{R}35;%xAEb+G9A-$$J_G@;vSn*hfo85vFAve%$T;2jnoZtAL-fw2N{ z2+WvnheIy~1i)QOXq;yl(Fho=&%RQIQ=DR4EJxmgtGTaocnyz~u}r@RooZP5>KVb| z<^NxEs8ymH%R0uAIL$A)XH(9}Ed->9~J&ru+@R4@L{Dv}h(9&;KK<8*xAzRHz2~ z)~FIxm^z*Hx5=OXZjdXIbDk5ZtspiQ3vPS&v#fyWW4o-Ke<0C;we z;VeP$`9H{xZI%y-H6|b)WI4fRnAKfdd0K3GF*aWvEeQ(H_pdE2EM*vhnW&_;PDoZ< zf3gR>iY)Hq=8(f28Xi;P(Y#{~>CvCcZJ6R~EZHf?D}O{^w@@xK?_^D#SCBf<#b|Jk zuZ=w3e((PY3CP8PCwSb&s_MB3e-|p8+)H;f0;v{bcRd6w14a2Ie~+CN!CO zf!4N-58OcbGXRkY=f-6@W$UP(D0ybq4`dml4c74-EN!Qq1-$4So+sCic#>F?Bj`9j z_P#rwd5!Ap}^;DC@>C3nDm_15RDUcV`kBrYdAMG&&<6N8o3K0`$CwnMZ|2- z2*rbo=*LDhonInuJE0qW6(t5(S7q$#9}iML;+=Cl8w-SjS_y_953-9BB@)xpo)WyM z>==%?ylLh6ZvLUom1GrNUx#Sv>%(;J{-@s%0agDFY`@j{NgWR&Hpyl%k(?n09@UbW zf5ZqJM%bmcqH4a(f`vKZqe-KE1;}a?V_yOpU4xCJgR`cMC0H8 zfB#oD8ANFdC8ZNOpp@0~&KL{Ilo!6*s-J8OZkz$fyzpj;KMwXbE0CGd+NLM5=bDr< zI;%TnSCG?nPfXIq5BLV3m~7)`un3?dp6fZ9cwRo~bZwEzj1Rk?neq^*Op3YN4Bs}< zrejFj#RAlAER@K4#E8@8#SuHIoWJy+f2Zu=Ae<15=)IR%gl%dFO-+Z;upsmh@uR+g zS5mRM_qI6|uBr5chQeCvN75&BZXMDeg@WQhu>X8OJ-wg}2|j`l(TO?VkI7POz0&U$ zjb7(o*`V#UIQ)Q;A>JTh@gc!j1Z0}n;qu+eoL8Jr<~UNCd4npQW319V3$}R@iFvgm zr~aGXHbg3)WIMj6if&5qrNbG6@HrxhzYz>QbL^BVYn|KjAp_*$27_K+b~ zPNgP41(w8Tc=ebXq;@>KL$nw>Yiq@)ut$SIVNvT*7vqq7)FBHaixY6hdix`kB88~z zRn1-V4I4H?Fy&BgpK~BpcH8yV?+g*=1~9{n~63?rX1AB77Z>|98GB!uXkR-}POG`{*Nc#S~A2{%xo zO0kfyec4#e5?zUrWIIYcD%#Kt#NES*!r7LBI#aIj3LQ{kaI?*Qn=jP|4Ac;r_ z91Ap(G7EdL#C)JT?0eMizZi~%kGQavmYwAiiN{CLR2(9Bix6`9CoTT7m2p%c-M&IT zZ;jZ&rXA2%)b_I!#J+uFUds3IsU#mjeawZ3JERB7UdZM>&bv#R{Hy%D`WnGJBQ|nU zhk*T1Y7wQPvb&^859EG-?!`a@AElLsYIoG&;C;TJMzzSRgU_VuP$kxob<<3aXU@E83hXST%Vg;Px!4rHlHa#w(bQ=YB9MS2-(Z` zEZ{Mz>bnvnfZ*D2%0CBvoJnwzUvz_TJwDyxRcxn|$!j0&2+Y`IQv`HsT27GT-oAOV zgtvd0Jv$4eODYprWHx$<{1hCcxqX|NgnU1&KB($XzlHoiTNl1@WCt+leoyISn-QS< z2ktJjwtC=bwr1$315_$-kG&&&jMo`&m2&MP1o^c?|2u5=!tR$3tI%1vxzVOS#XF76 zaYjLy8UJ0iXe&n|?d-Va-DMZN6FyCQkJQk0^~TGq>?i&%n!I!5eG{Zo>9J}VcS#hY zU#zKcU_N45=C)$K3{F8X_BfdTTMW!XgD0IdDW3(I2@A+!+!h#|#hw`ltY5Nr6@l-+ z*+An1>)m-`Fi;3H6@L(ZaXE}#^};ebJ2LX*`(NYUaVPHbb#9`ts#YNBY5|#gXe`iy zr(pY`%IxOq?{bwsrS5ld4=m1%9dcH)*Su0^PQkDVEO$X)PFqRxi;(jl{l zG;ia=uucw-=PtAqeAn0Z==V&L_=uR2BhpQ74?q(!$B&YXIX5A!13}{?b4;9|N6x$O>Vk&i7jV{-m7t#~!~FP}nH@2iIh9 zp~pWH?TxrF9{SjH--8_Esy4@;nkC0&DXpB{#s+CThbO8M*K#1(2%)#>Dh`f4=b)Vz zYsJjw)5K0-v7wWYs+#>HwWO=;uR+~oufRrIVRxd+*m~HR)^gvcGpQ_$9%U@k+N^4> z@|ESGgqsNFM~@o+WW|bU)s7jXPGnSQAC*{ewK63>j^$OQdHWItFUnuIFqdn96apKy z?YV&B1t+iaYS>qh#7thMGbe2OePtF_dB=`iLG>o>)`awGBJiH*D%KRx4e2YRL!Kqa zR(_!Ctnw2&s4h8elYpq19YiqHpUt$m)^!tR@qN&nCta%N%Y&%zM|@IJj4=||B&!O= zyT{5lM%_JeBAYVOxJXr*GsN{7V3kK+g2t z>lg&Yzd7a;ZJHR%=EP7#Jbss-e*&V%iRIR)O$+zf(pw46@jxhL$`JUR>&8Q$WQ!a0 z3Nu8$l8sXkgQ(>zb{7%u`Xxo}bOE2EAxr8jwjrhvMrIAGP(QOjQ(aFIyfpaMr3&O| zayADX&Dq4W{&mcG_olY|D}0?6@P(2jSZzGNc&^wtuXe4&0M?d6NkIQ|G-a63)Fi^C zlKq(-I($etWEt*po<3K(%ck-cO*oWB#R+tv1q3kf9B+Y&>x86-a~guq@2eRD164(g zf#>M7#xh#SX30&Az17wZP}E{-W*ANQRS~iQyYmpZ-8t&hopT&RN@S)Ew2q-(ydo94nta;DA2s zh7}Q&A{cwV$mD6cHt$@O2#%#eT?T&aqt^H7uHF+%8ISvs^$5d>8yx>>ty_=C##hpz zy>eaAS!kIxo2*N-9@~b>F7s8PKeP>g2+GmWq)r|u^~iG;fMIiy^(BCSFvD6}F^r}5 zF@(tN-mgajeLrN_Es$Ok@C*@?U>2#`a|!c)7ghG}l=c(gxe5FP)t~2dIw}LVvVHH@UDv-sKi7Tay%zeU z-@laNWIHva75g?x7o6*)7{uAB0xYZH_rHjb>E0ghX3Q8&^+DX?X8zr_jB>uv37F4i zoq`Ix8olKJQwi4$E4FlIjQ?%%(~=oY68&b=r5V3LCXov0U&uvGj-*dtn19=Dy_g1< zHm@=Fd^9!WY@EVB&C>=7pQkrF*%iJz1-qNil?6gFx;tWQVFUN+wcgU#2VzfNQg4FX z+Z7OHSKHGEMQg39?@7_FT22)xYs2e<6h2`wL1EZ&AP^P?i3B^HED8|J*rzQp4Jc3# ztRnlukLd{!(C=w+2(@lj4Q)eKrmvFYF4wx>kEvhGAv+FvMX1o+&isd0NjEm2HpFN# zuJCxCab)IoCt-(Uf=TopG@v&|bLj-6m?;;W%vZAjEnWMqDrU3%|IY~JK zT0~@8aFtRrel~+V7RLS`qDbD5aqF`AEBZTYX25>IUEqPcQedofNE6{u=W9Y;`ywe}|E5DoyQU6yo=Itcs`hathIIv0P zw!j7SJzLBU0=-8fGC`nbKj0v*82V)&)&tajI#$idiIsk_UL9c0m*zuoMgcUzt|y;RJTfd5VzCD_4G`&|PF1wY3qCqm8}+CqjF_msk| zYzrDkNTf~jbJ30A4CLRKJ(zK`s!icsf7LtxMoX4EC0)v>W6kdI zlllZ2Z0Te4?@wb;ewFw5%Kjs{BcuCcE9rYbDAz`y+=!|Y7e)APM|0oy{&k!=#dz_ z`(xWthR{2}BQt5{KIXCMyqxm)Q0^sIe~=feUHdcW6?A7kW=iq$Nc-ivZf$*3ZM)1! zBpPDkfT*Trz19zF*6iW8I#u7ZVkGpsr8+dQ{DA|8;8_*E6~aqbbOO&xlsd(;PZ z5$;3PQeL|1Hu^Db#88l(Ua$VHUh5HxI9HZXvz^FNBiqJbXzyat$j=@2x8*-ZQIW$J z3$ZI2UmX`%#L}lV@pTLceeMMnaMCJ^WiR$YiQY&27+@ug4QS#~t|$%`NrP3G*Yg`& zdEXECu)O8{GEZIz5VPfuK_tK&Js8a^kKyb8W3p>vb3*i}x|(bC$_Eh2 z^D@8pWm=}l`|iQ!Nm29_$r?WYEg+|(_9>Vx5wzw_aya9uHb=w97q)kg}9 zs2^msBpWI<_UTd9xc6mfp@axAa~=YbH}rL}h`(NljtK@i`K&R`jr8yKJ$o`XYSR0F z3WOX;8lH+*=Pwwrv)y@7K1R%urYd5jIGY;1Vm30At~>rZST9#UbDm*OMDz(N|1{CX zrk^dj)$f6OpoQeBaNa_yBGzJL#qUH@}x-C_fE+r5?d5Ed@ZSoCAAX8cG!Dc z70N3@FumJTcJDrDq1SE)MS5;MdB00(FKR4a3VHZD6~7o+Tfo-;Ni;Ur3)z)y(Ooe( z(u%lt)ZjWbEZ+VJPdZPr({hz7u97>LVzmL|5iH{(`XQVT?44=OKrv*YRMB-L+3Ju_ zz_OC?JVAVOe3N12{EUaZFRU_5N>$x4V%C&rZOx%8Kk$QGK6y~VyR1?v&j!uWb$txR zV6$Z(#8J$dD+zO|CC7-@&1lmE{)4@%gx*8QFw*BsuW0VFItn-!!&E+AfyMLG2u*04Z;QglAXM@W;pv?E`!9*;5pDEV_CKx&Qx7?Knj z6CTD$<@8(7VU4WSW9|>fu4`gpvK#+1n32Fx-gp!w#->q^R*_@Pf&i+36YqKxihO!6 z&Hzo{TN;Rhx?{2;H<}jyL=isEV~_c3O6(rfkovRQve^`W6)r zAjSM!Po>QJgCKwMn#F1}#iN{p^qfF1l}G0DG@u&Ylo$YO%0Y{O$fCdpCRSRXQv6MG zIM~W->XRV1t0IGSE^d0t!5yWk-;c;3Dssl zjd|Y5=72Pe2%pqS zHw4dfO}ox0EbksFB}>voGp9!%(N;l%9@6}7;P4M?x>$DW;0X02kVQBh&&*=se8CPy zMG9+5*X7{E9XF{;0#tuwl>?Eo3PD(y3#4sMxS0x+%n5EkIpq~_Xn*v@Jn&_bedmrz{ z-h2psNX1{YVzwURxkLX@B$$L-0!O*04+O#2%~ zjcW7XGeb+};;qA4M1D7CegXpo%|$T6yqgksO}@OyU@uexs`{DtiVe|$W!)k<_EYNe zT@+A+*dAqC5;SkjEl@}iSkK$vOhdD!h`%t4PeGDaETfslkE_&uHYnoFi6GL*eF&%xp>6?( zp;-#_^6t{)fV#K04lGKy^=i_TJBodybZMUH0|TKy!pQgo5&jI|dEW%d5|*$XKS{%j z;J$EdZs%Q%#_Ty8F1ao%6g-zlrWFZV4Tmr=BNV`gNskb5HzEM(O$5{idKO)1fG=xa z9iPE~Q6Y)&?8El|538=j+Qv$GuXxTL9e znKW*_a-<@NcN}1e-&79fWmC_TpaGLFzgILOq4ZTCOw;b$m5;eG!7Z%H3>@mb*qxc` zN?r5^W!JL_?;)4#mtr4KVT=Y;Uy(lOCkp`O-Y&fh% z1co!=D1CK)lBUrYP)PO6{cJsBNw$@L8DFv4dw{NJT1RmFR{)Bx`7p_w%lU8L-~>v0 zzI*T2xb^0i($gbSHhKF4e}I}5;*7`cBgI|)fE^E40h1n2Si4PmDUlo)1mUzB->Tf3 zE{E;)APS{JmnpcRe0YSTG+9~S@yhK%*bzYvnRFOm5P)+)-I@Bkq;3l{lv}OkxL$q@ z3=31wr=hGQzTY3=z*Mm5ZCQFpJA*q+@VcMUw1`ah|2@3f*scY20v*~*yk~8Ac5&gXg!Fn$%YZ&?^-U)ewjOt94ihh% z5w}1qDUy^653H<>1HhjZ+VKFO=cG3JUyYK3Z?ivw)@f<-jv}`}zS~+CXBzs)ST@BC zzYF~XnGVn>WDu1hWXp`F^aAAfRy_#18q@KH5N3z-(NrpwJo_Mx*sgc!>Ats;VL6K| zdoctgerUhTTpEXHGudxjJANT#@-o|l>Yw@jQXDc-NH;`(3n)bU2+1}+@QgUiYc4Ol zF9C--zA8b3KjT&dKmJe3l7GCSQm`Lw9`T_84h;k@3{FNr0qY57R9#84jXL{5IU@I; zd`=pLtp+KE%eSltyx2Oc-;zq@AOZ_8-=6J19<+_vTPi|w!{tWm?BFSrs4?7V7FF;r ztM!*#{IyCBRDF!d;-v>LqM!m?Wsg?s`(FC*V@4zNUPL`J*h*J$Z^C+HV2j7rV14fJttO zXttEt*U42WoVau8Mg-H|*XVtSgkJ`m5Z+?OXojuo{Z8y#2xcGTqCyC>V)l*2Qtgw5 zw!rjGHG%!h7!%XyBq!&VzG_G#og#{ZQazl5WH%J4*lQydp=)=X!M@Q1ZxNomsvO3d zoSxWjDa2WtNkmPW*UIRjRtXrI%D9|CO&fb4mdi>G23G(ZrMgecP^CS}2&?l8(1U0O z7kY+}s`yxa>V=g?M#rt|397Gw}QKji8TmmQp|9AcpY?7w)iWGKwtD z{J|$E_VovUAXg!fY09$+)2Ixx3jXG;2EcY$iK22`w45QA4I_OotN) zsLAk2D<%mr$PU3EjZ#{|I zsN&Y^aBXk~C(zNDrJ92|SlFP5PFC=5N}e$B%WcD$>L$CRVnZ03~B~Ns3g0kfEd*jKDSy!OimBH@6k>3ohc+Z9P_j?)n*Go&& z`wbkzdZp3CkwdK`i_U@Qj@cm@<%f!u7hH2OZE+)ghcpml?57o@1R{fnh#XdXLk@jf z%I4d*5jp;#(6NyDy#hvJRg%G0jxj zy0+7bLrle5^)H!7K|sH`ZIS}_s_05-F)6Gfd{JQ;j2YS)u|?GXDB8F zc|C$D6MHR^aih27Hzp(l#hk_*z?ntu7ie7&=l;y{QkUo7o?0rumo5Y*Lw;*`1zWF| z^1;(L^fGmlL|5~3*aV0Au3*h;usW*BcYBaP6hI+u7rO7l$cttreAGL=GJA@Mx|~gz zBfNK4ZphJ0n`L&?mmfUaq@Pue@M27S8mwf<=+X<08T`J4?gUR_q1LbFVdnn=EtONk zg-3ayBhQde=Mr)(nuB*2D{2F?oU|QjV7kq*))+S1`mJX)Yl?IE*r^JKesBoExPPaG zbRol?S}^$7@ww;IwB6!tPeo%~YkjC@P>CB2{qWT!rGM!*A5PI~r}Wq%-2Vo4%$P8j zMymYITkh{=DBK(I`an1?J2OngqO4>$gSbC2=5B4DewqJBja%({n~UV$ZRLzw$T3uP z`rbDWgk(fLs@@JCzVZKcD|yLf1vPONkKJb!`m&)Vc($|slv3Oz^1#`=+0Wv9#hR6Z zu^&!aj&P>z-~9aKo??`}Q_|bx0V8*2QSz-`0fR~aN6bYgt>2RDU*?8W-?&nBii&4s zbr!;TZ(L!a9Xc|K;bCSAnaY;+CzZH1VdLO?h#c|5eqiOCtB@M2D_4u>ElkYRSKcI- z8yF)t$;bh~9ig6P4SaH=Bln!1#K0xqF?68nd>!E~UM>j-|5i+3D;lVAv1=c5EGL{` z3U>u z`(S4{xBjV@X*US`;CPVS1WqEpM9arix9l(=-y|;sKefQX0v|O;%<13UU17D?c;l?y zcVjv3wAaS}2S9EAXBN*`+d7F#Nvz^Ge2R<@=}~-kwE$jw*7YYzD|Pm6OO-_`gZdpR zZbcJxfE>zFW(Nn-w}M_ib{f9XV}BjFiQIRo(og{{GW(fBrDK``_#2~?fw`*!ex<@{ zD*$Vz{EJ9D-p6ixQ4pc7ECSF3u^i4fGaenoi7FC+=1`V?D1H5Q&WV?*1((#rnrjoC zJWH*6ZHVc_FEAapGsda6ST-E#jFwuqZL^xJs{eO7%=|A6ds(x&pdtYY{m@#r7-^+Akp7WA>5B z>#@DPVw`cmAH%HQ^!7NuGj)f+5PfkBFNRznOAS|nH4Rntm&K6UkAO2BkY&*EG-)REwPh~4e9}a z#Ugfvy3Re6#42c_{!o+nGCo+zupuc|pKbbrJ}I8!!NzbNP(FlmJaA>ZwohD1{s{f{ z?r-tvGy&_Tci7E)Z0Lt!xxKC)&Sm!0!L{RfEa3;*i32<(UIDw?PsNi8MjIu4g$8W$ z7CwOk(3**lGqoD>#tpxcb85hL(0UJ`4T}cqRtR$iLG&h|QNlPXi~${zkSp)coK=EX zu#P|f6aK-z%YvD{EcQhreg~LEeWj0zIbFs;Ln~XF_3frYs4mF zx~Oq$@bZ=yeYPIj@NgmkM?6Y)1(<`Q`XLJSt#J=v`e0v|1wv{AIO8CgEgJLY*l1 zX41h)8a#%(5f!ZW9n#i#*X!UBu=z8c-eJ@D_H^~i)>}D52MsT;iUCqXzFfd<%^tnc z;fU^OKWQt58ZNJWjr64>GCG`#B(B>;e>=>wq2!+#1*{19GnXi!)!gfZ+^5F$;-BMpZLfUV+Mw2CMmAL4h(VRqP%oV64EDu#K+zD}OzAYb)e=WQQyKX=2rK?a`vzqB9349+aP!&p1I0L4zFM z({1#lZ`BsV+n^Mskm#T4v0CL)sHUG7sO-*G2I1+rDs>QU4=Vc$d=EQ30|QJNJJCxu zYtjq-=HLOAj;HVQZBII}DigtzxfMKBcU=;OU($^V|--8?)SvAJU1H`lc zH&B$Heb%(da~6gy-&~SnHSXKH#AhxmKiEB9Y~Fsk9@#fD!2f_POTDYF1eesVKxJ%} zKSOdgOm!-=b+kIo$vbC%1N!|z6UwW|k8+LLw|Qx}BkOFvOH!^m0IWRFw9g5rqVZo=i;si}|t)H-bPGbrYDsn9Bo+Ggyu`Jg3@@c{=%}^}{i6@0Zg6 zW;9D5oennFkaOpMt3*gAmV?nMyri2^O@wOszblgd=Y4fG;p- z*9nupQ_Al`DCP!y)=CE+K*h_~_}zXoDb~Dcc&%s1H$gDPxxaq8jm#-3Z|R7XvQ1Th zNTtL>Tc79Wb?$f3ML|KI2xe8R1{LLP4ahj?>Ks6c5l|LGJXJv+f9ABeH~i9Uj1KMb z;ff7^=s%v(10(ZSRcV}JS4t~^4-Uj3de~eW#nuXBb^BOy<%*4OY9zxi+23raRX3)g z+0dhjcu=UzyFDWsIknN4mhI8$A$c&JJRktHaDL0fk9UFLOo^R<@i1Jt^u8w*fKS5% zs~7T4EgBdD6ar`+5nWD_TiTlm(A!6c-*o=|3I$=4H}aR`86{yF$H#`Ekaa{~5wIV# zrpm;y4#4`>G;xw3d?%72mhImg!Q4*g9tYj@pD~d!d-?)IFKliBL5}!dK58xrtKK$6 zz|sDd2_GxQD^=A-mIDOs?PoXuHz}8=r*^Y3#6uCe_N#V zd>$FhT=P|Y@;EF@7dDmE_Xv%kEWP`*EnCcHe4GCQ?io2O_eDsENioOPQakKkgc<6? zJdp0O6R6@mGUr5MzPJ0(1)?Y9Gn7)jEEJPevR=1B6Qw9{ty@Z}`F`Y?I zzXJ%p@cv=5DXbD&Jzcb5? z_`WMmPYcG?&aPQC;>g;p# z`t!a|PkcM{dp=KIoAdi!pAXaD>f7jd>2^ExoB8|Xfw6Rrt>)M#?{e0y`Jl1EA zMAH-^{1x8+S!<{-7Hi-*;g4YZY-w3o;>+tnSi$^txY2>!0-N(FZahpx?k17zWmRYe zzc({Pb%T;3>RsDxjPRs!Ww0md()G{XPNFWXFYxO4ZjC<=TXeL-ubN-Zrfb&+19wDw zK~HN60zm#cM5}cY{uu7H8uhE$-+YCGBQGUktN>O(slVy3^^T57LEzjHu#Jj!@6C7% zC7-HV+Qf?$q@9Hy$Y)Ya%jSEU;b^WC;KqmqBEk(#=nh*p>vDAWGQI=O&TL0%#UKPf zIMp#btmo0epf$52f=0C(TB&SH2q5~p%&4hGA4nU}3$VX`UInM!JnRlB%HuVO1zb!3 zsRG1qtO{fvvlewsC&4T;sKPt&)mA}3$BG6Z!r_f&LwdN@1fLi5Wg}M+zly&`pLv%L z$5s??C4>DuIlO@;`n=Y3Xao8<{uBatI1IddvYp_Oyz&sL&7-~Ui4ug@lz0Vk)t}k8 zR8G5if(8r@HER5(Le7%bRG$9X^U(F+6pW_tEFO|_ze3j2GX;YdmDx6Bhk8jHsa(Bq zZq_2akI(Lx&NMUXPo;+|A5Z-4c*>%d2g_$h0J>>2O*~CNv<`)y9njQo?+IQkmA+}! zs_6^d8>d`8OdUw*%)vn@7l9siSbP_q@sEK-y$#*|nC)niHFo#Ey zp@bbKQ+|?kW~B)`z)vPyuZtFl{t_{{zpv<2rZovVF5~r(SZLiMfYL;yb^59df-vj= zQ?SI;tF@=7G0A}lWT{eDfukbV`S6;5ae}kE;jf0{yLdd+hv+~pU^5bUh`tk04>b(R zIOs;MlNnL?G#9&`gYfcK2_qr5u5X>*!n#&Ac=2yrOR9(|>N|`#5_Qs7&P{8-GDLPq zbCC#wiGFw0I-)H)0hVF;J`x}+^-F(w(fe9W7Ar1k`{R3JYzeEL{{cS|vPhlm92Yl! zxUfl9!;%w`?Y1OD?3HVI@AtoYb!K;1+SxS8jUA%H_o;iZQ)2)cDFScj%KfA&BZ|uN zT;J7#Xb{h;oKAnb2~?n_?^c`n zTE|k|%4wL~mG@_#UpEed55h{H+xgNt?{)`3V)fF4d;lu_Wh(&IfA92&X&li<>hRv< zV{aY1?3`Sk?f~4ja+g0YO&hS?pYBFy-P^11Hm>(iyW=yfHA#kZS$qjt&U+2oTaY%d z&yiAL`Y7t0Kbp}#6&f}l3EY3~ocdP7??LCeKrqq*3*bhzk~PjMFJ~wMNv-ZxCGjr! znNV|sO{tiMjrK{q0eC+G@gvT+@6@*`MwCsV(Ls6v;1o&(eo2w(D*mg?_y7!Jnnu!u zWJR%ReqPy9KRxN>@XVw}43E0efV;y=(zR_nS`1gqM>`8cR0Pspi_8o4nZX+6_NSsm zff92LqlB&ZbBwf-+diFv<^pr;%>=|XF+QRz25zNOI-y?Paf_y~e5NFdBxvLW4bb%0c(7&1ot`_l&VU8S~VL5V<>eMDY!^TLQ6p{Gw_Db0JHlfZr$_yttvV7 z1f0C$5X9tnfXV-IVBrZUsW*I8sKJu2vPBce$M7l%xQWpoerm)@3r%c^ zkqZ)N(T=6n72zHfmveO@k~JPtS7Nl!1nu1n${WSVwaM53pzCxEpKB!ReJSJ&Xp6J! zbrZ~z#S>HT*m`!pwfHSrJwcQK zUfVmqSOd^^hs94ME}XBI;1{|*@yla0;sCv!+6jN+^!hBFMxFXv@)(+5p7>wYl>zl* z@l|M?kEKVBEmadxn&U4o=M;TJI89N&+eMVxm;TB2H}?WjYEg z#k;9zd)s>v#C8J;@M+0%WB+x@tIIlq#ar=Z3NQ@NC;Z)Vo{_BQmZ4@%!?G{nM)|&T zkukpP-WOyCyPI@=`sozxY}H#>D`TUtVh2`wvj|btfz}4UL?ckIJPrW=auoHm-E6F- z_k83}nt3y(q)ELrv%2=;BioIMI75kqj}Vuh1>{G--9}>KnN8CVlw&2)jl|}8g7O<= z|1+}aIowIak0?yv4v7k6Pc;+!IXjnA2D& zXWQH$8QFjM-0t{nHX99Yr~h3#m+|cdsZbx%^=8NzScr+{N}{^18Ua~t1PW3r6!n?G14xXHLSeb5p*lNk=&WaB1d z@ynB4CXFFdgCk*QaPD&)iH1(34stH`#gm8ToF@_-SLBy_O*DY%1q;ru9UkA7m?`=y zzKl3I8BO)LVpzyDj>VShYS}z*f*s621Jg{iU$u`0M)WoO3BbuNxor->9zLg5V56mu zSG*^10`pU$dxtlZ*W7Z+7f%_ocTcC8-$?p`;OiIjOR|G&N z)R`m|hKR!IY4HFyKJhYfu=r#k6el93C{morH!8!(ZwGxo0ZKA$hO-IL6=T=c)@IX1 zKGC$4gJ=5mVimzl)UOvEUe103;;zouWvzW#ATPwGb|E=7;w4 z2TS(a58FS8-%a$tZZx_$KB7@c&t}HE-#1LNbPjGvIWT+JL&--bCtmunJr-~|`92LJ zyX9Y)!$}&#ubfwUkK{5}2+tG4NMX!aCyM)0q;iT7mGLE73_(9+RcTxtA%O0!tVwvV zty+<5OZ7|fIP~c6^3_|DpqcNF=)q?&CmYJU4_lK54LJXMFXS8wdfQLGe_j+99?ak< z5SYG7$?gb~$t*$yzVIl!ED4_dI=Vvm`KR&V?2{g9?Oa3U-V;g=w2+#Jh@><=>{2!j=GhwiSoU2 z%I*m9^zzf+9AjR|N)eml6&4s2HV44+U*ZV&l#7bQvIvYwGtMF%s%0)!G{U-chg7X+ zXjm}qpqz4gv}^u=!t0ZnF_q}Hx8L(-Dj(ueSAElGEgW{Eo>;P%@2btss&n~%4QReS z70nGA!+X{o9P?0h4~EcwJt-`VdX`s7ttB&A%0))pnEPpPT5lB65ABv4848xzOoXO8 zHU7zD`zdSFelR09l|?XhEdQd6`Qx z^JUOS2aSAWVl6Z$DY7UIyoBmH&2C?As7e!Nm6-ed>V$H6=M@%^ zp7}p+gJ`OnGAFZLzo&lkVL9FGgtnNdQW#&1O!eVko6^Yef%thGalq2Q$Xm!84RI zYWDuiEcjWx>~3DZ2E|=!%gWO^ue6=OlzOrL=@|t-cF+HB1W0!RX5_D@pm}V2?Fx?`ftOOyhC*XtkD~ytp1X!y=5=d9 zOHHFA zqAUJUM(l6{VUL6aYGsGbW9?xFR-l?()0y;+ zYj}8^R_B#Rt|0Yrc>c$g1;05US-20nOhfrMf_f}e8<}j8V3>6(IxMbez=7MMQTk`2 z-({)EX6&2W$qR^RcOs<=EF3d9r#Y0d@M79ZZ;#jX?ua5++mHZ+T$e@FinFIG1GWo& zW9#Ri?Hm231PbxZJ;w)on$YJW#Jk*#(fES0I6(6N|32uf$$qJMW9#ijz6eBwi%olg zaTVOkYsQ=Q?pFpz#JQnVrkrjZ&c>;X=^=rw5ngf{O}}SJmC~x+ztA{^W*j3W)V?`;|pI+>a&NHd0}isBAohuvUe({(e0y7z8iw+hZt`$U@f}p2<A{3>z7T?atzE)SRDe%ZyWbPlcl6b_!DU6*m<^ z{iikk+dVJhOdOaUC-DiZ=jZICP1F`$N>wBZP>whKwUFeFvms1bw}b)cGMohxdymu{ z^_>sNHIh^j7E#v+X#lHgqb!@@JkW|ur~CjxPGwaoEMxx&t%2A1YF?x+ygcEI3~kW9 z+Zy-=?EV@(ZMzr{Ij*t18O$_lf&?CV2A>Rp@&9rRPEd;7z&r+k=LsXX;|#hXcyaFx zZaXge9`lapRt=(zQ$T4dln9j1LhZcR%<8=k`F)g;u@Mp1>=*M*8MU;=$%~0TLr`OP z=;OOM6k2%nw9u%mrUp|#&=AEgr~Tzj0;R!@9z!#Mr$>KdB&g=0uW2?6G0w9No}N}f zGh1C2`gsx%6|r%Ja0mvt)76}2kku$UWc22{PqYeXp&BLP|6y)|iM01E1BXo$nGCT{ z`L-b_{pBh{0n#K9TU3>Fj z5C01G31-lPz+S*LfM87}eZ8PHE#x_WuAq(b3j2>Yx-=4PDctH7@Oi(&Qq6VW*>F>z zJehg-_@KT2A$1d1*GkH4gIWoUSo+61g-Pb~?z`eQbJo5Pz}@;VvS>HKMLQ=4)mmXE z9L3RZHNC3Xu-OSm^1@#I^DyleXXNz7v{K(;#@QoBiAuS|vy{%S+O(_Lo|s$QAl^uK zVdy`=-WKOx)CKG!EC;aZXq#TgaOfl1o-<$=zD5+1awWc1P$AuDMPPv>WuR?VW_1QG zSVcCaA}%MRauxLEF@BMQl*f)%^Hyzc`#vpL3?lTnS-9qX0pE~d5VX{4vB_!_Yu((x z$@qy=)$5Ks+eE-ZWm&hL*{0~Oi+G7{8~GVC=;_P>bauRlWZzq+KAa9PN0J#OJ!SpU zHt!z+ykc1ru+x-4*6rpMA$8sxM?X5ly<79F_NLsnC_wD_HJbu~dZgxlG!>1f$zO82 zJeRx-!H36n>xEPCb78*n0TT0>QzB_%qrA^4gxQmZ(s+@4$qmGH)KBa9+byZoDrDV^ zy{Cr?kbueh-$bm44;KUT#s(R5?-4kO#m%QkfmSMaLP%UBlNyxeY_&6-nIRc96&@(F zd_X#|{;X@x6LFbkE4S1VEwAWiKL1;@FuXeBrY24CbjB9)TJ>dTb7Zc9tI9codEynD zAD2s}1LT`br4GDk<@AACcOP4}(Cixq0lO-u1*pfiRc7PsNjmU9$BzjQB zz>YuOU2wB;e-uxC#2DT97&AhJ^V#Pr$qE&J$0IM4jS_C#CIx8nRy^rT3eK;8G^vhb zDtp*%Q4__B+AQ0bqFFNok6y;)Ds1gZVL*R(=qE;xOPKk&e<>k|P#AyTOa9Ej@9sg! zCR}-Ic6c7Ogt3EsX1+=azyK#qNGiUwPDg20)Q28Fag!xb)9L>AcUy-197~;rWtLCJ(J*2^PMXPcAI>`=J8-juuy7S@?yydKTDRDw^ z52i)2Zg;h~5rRov;*YNcJ1)ZQj!sEAs9&V9 zfXvjBB&RhC)}E6kq9QT?G6pYlHgxhI-Q1wEkYiUPjRfpeT8M}t%9~Y+mL}W4sD&SxI7{DyVj*Z_?)2Lk`|W zw8_=5)0@clV|e41*=0a~bAecF&Brly5ai`7qRbx6H;mPl(os}ZhD8-3=)4$lPyxOI z=JBp1c@$#8jFdu^YBsau;^H^QAG(yhRrbx<=H%f7zAnZ~T;2rLC78`+o!~=9N0j$y zs}+)Cb@E${Nw>eG`7cP;Nc(oRx!TuYZO_DYybB;%BKv(?D#0kFw1hI+s}#M;;$s5# z3oo-L=RK8v0FkU%228UU2*?BcZp2zYNkTYzgX0F6bsBV4h+g_~sx5tfB1+LdW#4WQ zq0gu3@_+f$kLRoef80AoHZo_)|v*s1K6A+9qX^by(`qEZ2=Ve+tlfK z8?yPn2RN(VzCs++O~XXf90L@*7vjJu%pJo1E)^nvEeyTdqi2+gHk70fe3PB*{uR&U zlvl0$IGXf@!J;BDFLvQGYlG~q_}@ZKFU4cl(!4-sEVH2P6@DZ0V_Cs_E)+|ne z#4q%fkh^IYb2s!G9wsFIUm#SBG;!YRc#G{V?3%6<0_uT%-eTXCXxL|K6x_R?1wWfC z`W6!opZKtaHd^e1( zPN&XkV5hy%NE>jSnfgb5lE0dbprZ*g;sD}hiZ3+MGw!4bhR-Q4FSBiTR^TA^;)vA^r2ASTQ zx9urhoPEj=l!&FHzw+oiWgA;rZ=Z&BKEjba*^VE?ueTW8O?$X>gji6c5V>kVkms&{ z&*kCQMO*0=S6Cy{-rM$~+(fh<$Cm21`j|ny<;!drxmd}yaLx#-yNJ}X+=~A)CGXF3 zdB`zEI?j06PdEkv=UUu<-HDI8OdX$bgckH;>1X0Jbm~Q8f4Lr@3bcEvhvr1`w$7ou zY0VL}{}i8I*K1z^Y1Fmlkj`C+hUr|71<-$bul%5)V;hToMxs$9nfP z?z|DY|2k@!D_#A7O=`gC1yKeYFh>6FNg01%eu|+&&sJ^BGgB#ceVfN4JtG}|7NG=3 z8gXv<#oB_x$%OK(Ld@`gdWD|I>>uj4Z$QbMt zFurEQAo&!osI@r|(c`@CFP?vy46#rDD|O>cX>kBT{y42#MEVW&bAWsoWuYS8A_?a8 zXsC$HxLu=7!cmx3MkMX^8;IRMtB;5M7*+b>$c{pUb~zCCf}&6a&A)9 zf%uZlX99;*06ql=VhLF)FWg`)spTdRo|(?*HN74XuWJ%(BJ#MC2v94bkSXiy?lkDuG8Llx^fPX4;? zCIPb0l&q!dD%j%(7h}Q}*()bmIR(mr5Ox6pzWiCcHIctk26y#6*NC zn%1I+W)aZMHOSvl1h;N8OEaL|D+5%3FWS3TX)9b6x7RRV(Cs?w`0z65F3NrkHQQe& z#?&)PFeMr;qFVc_?7J#i+7m43Wu|f1-@+v4JyRjusTz3N_nFPnz*qi zA#~;AtR&i3?f1Y_06y~DuQHH5`i|H1KoJB5iKNAIL}2c3DXl(zrgK;o@bN`($6J)~ z=Jt9bLHVl%lRuo?jDlHkA;S1P@LNLwIm#@&6Yj;(4}r`Dk8L*F$7v<(1Z}D`u@P!@ z7Kw`!gu?5O@r)G$NhhmxAwF;=&flm5%qVMv0TAqQ@yxRC*k?3?dt3HV>Qy)_W>n z8L!?Ad4$e3P?i7*HC`7Ur+{a}Wb!JhRH&xvi5AGH`@L(JpQtB8^6~-Vnx`FWKTUV9kFFiC6uECVp zR_7LQsaR}dIX*!y*`oVn!39|?g8oYNV1^%vuPBiBt^vt4DfZaQFq5C=Hw zDu|H=>@@}~8qDP4Dv#6(0Y{<1j|oEp1Fr2KA)Wr$B?R-3$j@xA0d?^crr2y)eqpjr z)UD1j)imeKeaoXI#0HJAyhYQiL_2S>(!FTd z2@VUHXj(4__>1!7TFx6Jnd*Ua0(9_rgk^Z;Tf#8r$C&>80Rw73NOhX1iiuE55_`2B zE(>tPxH3Vp$mXQVZRs~gAzG3ylSM0B2!(g)>4#hJ=p`E}Wp`IRe&A*q-g4!6D4tA%xoDYIKf=%k)6o&|VBzL8*WmC>aDM zt2Y64osfuU`_D5kWQf`hQs~QV&wUB%?lq2`!n=hA0|6%K>bjHKWxX# zv|;=2ZfFSY>zQ*?08m>%LCNiL9=hm~Hs{ixz*#jKTGnSt?a5Sj8Q9>@2CIX7zLcd6&7BceO6l#KOWv{g{cGqdjf7dK_-Vd5!QLSlwM29`3;L)4|9F2!o;Ibm8#l1aKl3aE+VPp)cMLUd z-HB#qpMB4-3PB7%=(2aMr++t@43?@905C@ZejJ~lg1y4TjsTskC)yzahpNo zorN>-DrBdj(J__ALOw0`e#pyJQg4Lml9!cvUL!~Kp)xE1@&w6f%$0FkqhrPYZ=}0G z0T9B|>!~mFb>bCi1Jl8A{Q)V#DH1}M3gMx}&j8Yn{4Q%Wq}`eqzoGHLzB9BxeqQGk zBi?EF&lKj9>++XI0=eXFwd;jGEWb4R6|v*<^sv39`U5>8SNqw3Z_^UeXm`FZ5aC^p zAk5Cl*Iu=nI(5`EGB=vpgmdqtu>G)LR>0PmX(%v(_~O_k;mrH>0JVT${1^}=Bte}+ zDovJ~rAcK=j2_4}!fm`yO*Xn8*HL9({BDKqLE3jh2}&5V0pBM5#gOK7JtETbdE{D~ zQZfs-%xY99(DkG$-y|LvAHn_vz|wb^#Zynb-;MHI7@&+>o@ZietstLp;00JXwOqW@ zFft-O>T=M+J985?GIlh-E2)lNCZ|c@v?1S>>n1lZQxg1L4ZpyY7ySn!5#Y@wnm1Hw zkC9tYv9-2}-b=$Ob0V_>lbD+mV{ud}sGBp0THJXrp&GkL9&$^ZNEzu`i{K{VAL*%i zaNLv42+FQx#8hc@o9GXX${^Vt=)n5_4@sztRRzM5v>e}^uS_d`@(@sl3%KKxXWHH% ze6}9d#;WdFuZbM0vvvM;)AXmZ0R zYbPy2mf|Y9hbhQ-c05KsD!uK}XU9rO`R0C8kUQbtt{^^` z{G8tzs)_8aLhA0FkVeZn;pG!_<{pD$5P;+ z7HN7Box&m$6Umdb9vd3t`Liav7nCQWsrg^9vTL?ltet%?=I`wh0%8sTYeJME0Pw`^-?Q%3CK36s}fytD{{WRWd?sce1FxG8(Q*#7t7hnfF$iO%XI-7?zWrrYGPN#ttb zc^F^L?zB0wA!As#vod;Gerym`-HJN(`_4T?WttyU-U3!8WBeFp<8P=~YZYA7K?mI? zlJ;8dL94?cw6?$Fp;kWS|4k6M%pWaF!1wEyVv=BS<&e@&d;8zDmkK0387%O0!|1nN zVn~|VG?UeF3Ie5I1PUlf{_?F$HB8EQ2OJ4)>ROnNk3#jwW`ACOM#cW>70uzc6M;3> zIOMd|zq1~xP~3|MQ=k7I5ER-|cYSQjif*r7*Wvx7prRJBPBF{SHT?P@DnzOP?oUOD zS1KqB5qvZ#H)LHOW_ef&s6P9o2XApdAB%3{e*~)Y=$!0QtkxzWHE69A)X_(Wp|?`V zaplN|Frd9rOeoVzDG%G!zb_Z^68sJAdhR5L!3oRNq*qf$EI0NuXN~nOc&?o7#|%fC zzK**gCe6mxJgEY*6nY1R+@p%KUj5C*ho~otx$&{mb>@B1%RNzW2rU4`<56LSX_Twb za-nY25$+q2Dc#6*OLK%vR~B~+8>;e7*JV)(WL8qJ*So;4&~M)4sn$k7NL(uhIu7lY z_E3#^oKvFa@NOuG-t200RLSml1H#E|RXrvVcPsde^A5DQYW%)&7|-PikXE*m#;Q z&@F&A`GHWmpVE5(|jCEJacd@Vxb_xx$EUfRmsF26K~kI1MlB5N9KihKVZer7@dzlq&KR zph;@5Osu&atbixA-Q+a??}-f&7KqZ9oDXfh>ZV4378n!A)P{8C10*u|5pj0=-5m$ zMrw(LYTc;yv;n&jfqH}DHicS0KjWcc;J_3?)BhpW;f0PbGeY=f!dr@h3g6OAiQ*Ou zr%^v|*OZHEM>*zMB}ws_OQ&Mqdkt4&_3uofYqYP1n%{BoGF#Z8MG#s=b`#3!l64)% zO)+{KZ|ODlVa6?(?lz1NkkyC7GDq$uDw}+hwjF7k!FHSVdoxs`sU#Fyx4?=o2y$?`Y1ljTJ(Xr9rGM+nsuzkvauVdCXrR!^@fQ{->40i5gogoF`YkcMDo zLm*_6;y-PQ)TL*RAsJTV>g*bv_FlS^n9Tu{F43m{5>0;3P+ths3FHDQ6;MCYg~d5H zZT{|cB*{{})}&EvCbwQ6WRd9QOaLVXsCn-c`g>8Q-G2WTj*6esn})G3{XyM+gF^vc z8U?C+2AcvgK^GZkP_)17lXoYJ$*{WKWDe|Kp9K&{>YGG2!E;s=UjV?r)KSP%aUO6j zV|}RRj94G%K3x8P_3ZypuUxzk{Ce0lRv3|7p(l*%X!dy8t13SVW~DBpF^OoZK5d8& z&ZtX&{~kFLH_n$nk62XCPaHg3RC!{Oc`eq!KeeX_K5$rJ_jQk`7V~d~QL8V`N8JV6 z`9>gT8KM6^Mix%0XBExO4d|a!hhNYWniY+>Bh*e>!ZAyvJ;M<(+8WUBLK@uNBaEAi z{D?S@u4o|%HjXqiRfS&p?#RQw7L=0qvLMNK(wIlc5{rIcfpf>KurYLhxDs?sd*~@h zxC@}hbEbzrc*CJ@IX3n)y8s(BdvU*S-{PRu+FFouN_QCHa2Sr~Mg6;X*xc+z$Evuk z=%vtOQ!guTq%_6_)837-C=dndI`k`;sG?V9&@B$_3y}%W+!K0@d)yvO9G3-vF{7F3 zSnZB+ z0*2*mxzBk75keBA@}Blgkf{Q8oauOS3DihVI7N*?OoX4JCu5$reG!8KXTS3n6{$Q7 zuk+$KB5YMU!<0#uC9(rIH~!isd&-cIKP713e$#QhOE1l+v7Cp|r zSSPF~kLi%jEImXqd_hCbzcV-L0-pkK+dYGI-PjMx&DwGLb!A6zqq~NAwpw#qcorP7 z35k3P7^6E-{{wcY9ZQ|!xoi$i_fxm>xh)*zA2U74G{ANV=b8|R!_HxIe)?$TgM^mRP zIVfB%@NY}q2&8p)g+P$G<>4tvOILI>*dC;L9(CI%iYvmnPsyep-p;&0>~pOC9Yb@K zC*aT=J))njT;pN($k)C!aF%{eC^ebUOI-jTLsN6ANNL|&DQxRS129dl zVKo7O$)qNtF*~sd{+Bkc?n?{^{D9>bzk#HLfDD~r&FL1~Qk4^q^+`{J0eOfE+>do0 zndN{X8czAKYk(jo=2d}Elf$NFM6Z{ef~0Ow$$lHQ#yau_>iC$QS4^)sjbm}EGR?=W za?hG`Km2JV5PqsU*_ulMzh{p6zL5eY@C~q1 zx9(}K2k?&i@}Bm$e9GsN&Lo3_SCI+e2TH;gT@Ccq0JN5hx$Cj}w80khF?F!`|9I5~ z$;LX3IBE%guhGOBESRC6k>5!>eRh#W07oH;1kt6u8?JQ?AS{Gp->^ExEW1nT}u21#6jZ>6_v&kW(CH75ExL%SKW9Z!O8@ZQ66pM@u6&I zcSfr+e4Y{3_)4bB4|%n15lYb^7GZbcy%{m8-~65l0$6jh@xa0M0zIb~D}shZv0&o$ z37jVIFETgN%5Z?r6Bp`^QKgvN}gqA4F*%0Q;vyI4qr886EFg_yk>a86Wfri-R5Z6mG<_4^k*kpa!=~}(>`$^ z<_}Xc=b8o%kjQV|hqTpS`hGr1%-p*{=H0Nfv2^SC4Ndof-M5LUKp?kUF???c4*IT} zMCdgWZFe_04b9iP*kc!AK)*!duATwVZ5=16El`;kYCum;aE`MZ6T4TjuY+G1E65iH z%fQeaYzy$8P1DBYKcvAR-d@u8Hru55svhLG+~EsiRyJvK0DX>WinT?H9(NrD$4M(F z;N~Rm%1-J26S3_(viINGS@et|?NR4#^EJZ}8+iK5rCd?oz8(f+@h0QPb1)Kk@d zQnlYZ=e%=|%eJaz?Gt8k-R&L^9wZwRZ2Z6bU_re&hwM_2x_bwsJ@JG{-ry|896=$i;HC{BIXTeKnev+zN*(@kNs2Y{%k14$|(RS zau5XzP2d4w#$mq^1$V|mOwqc_bwNb=i)VK9XG>fkOcAJ{YraE~z3qbEJH1iZigTt&tJhVh$@qSLj(J3$yO9 zj_EZ{9-G-4y$W+M>jae;X`>58OQywMD;in0zY3hfWAe?FWKg;4MwB+Pt8{f8i5zc` zRsA-{ivNU`fV%qD5atlAEDUWHK_;25eVV4XZ7K10Sh@8_5|wT9aNu;1_|<2-1Fxzd z^R>5Fcu9gfH=!>70?lB)+!v~={QfNnLz^Vt`v|N}YtfZe9 z9Fb|A3y=E`!nxmUUN6C5lP6Uz$ZRc%fmFZTAkM8{hcwWN=a4m0%Xoo*JjX2e!3R0? z?VGl58k%*)$&P<&^Dk4NI<8ss(^^Y^Stj*x*Xm}vIetySJC7FB#t1)~GPivofPhmN zLoB(8VK0!iI0e1uM8t?~Nem8p^p>@UWe)Mki~lUBbk_S)DNgIB4`j-#-EPYy5?8AB ziFI&83wyBptj0=yYe-v5H-LfUKwA>73_!x+=bJxUhz;F3rNCYUgW?bOVb)7p?&EO2;le!i} z%S{blDJlWV&I6McuX49V{68@Vkad@cGpqyW&ZXAsTaIMO0}jt2VcDKbUc$E_SEnNS zqvLMq#J@f^@emOIT6UMqn;rA)-`F#!S>1h~=MC^2W3;#dl?NPRTSSl< z#l`*0c@0dh32oKCda2|M-|fRATD$7}AF9>N{d)T9pPe&5LW01_3YBgy&RKiH&Qs_t zW8`jnO4gf7VP>s1M3!tuk}bYL9uXk~LGWq#{e1q|gMX>1aO%(p>>z@}b8<-c1#A~0 zThqmEXkdoDi+7yM0=cbzgVo~B22WD6UD1~Qf1ta@gijxpsmr)cWJ3yH05N{|KSRK; z_8=gdbW*e(B+li%L7Vx?ZbDZ^GB|ZLhq{%=`S5JHU?QC51zCYbm`We%ybjz`qffI) zguq26C!nV(`xFm|ofKn2 zGufu8Lbd5MY#27&VVmLn{8jC*Cp#!V{+VP4r;NA{I?YwcD^E_Tz`9GccEYr6v7ll3 z<^AaOQ>js-w}=GseQxl^r6&`R-b*4Bs{IfiB?3er)QMh)Qw=(+{~Xl04C^Wqo1}v{ zz4$2aJ0}JR$%?FY74nmrJm2?ohCCy>DtstH6nQIy2sG#`ulBn;)7G0oadZWsS^k!f zJshQpirS;m=VE7|THiX2HN8@HD)GGc@8fWIRr2nGHkhw+X74x}A| zhUtgChcL7s5iAsEcEG9c<{?s&jD@7X1PFLO_-yo|*&<`KoUs2N;Z_PAm0k`Js7i9> zdp0{6IhsX6+jkOu#~(vp1Ws33pDox+Asag zLnkOpsH_%F=@_wPurJw2HN@Fn(tCv%&19Mv?5;sr!`>I|J^7Xt1(H0nsS zq_Zn_mbBu_HPL(ACkpRB0^)f7ueummr|TJ7CIc5GniL27mo4lOOVEgfOn4x`TAKNT zX?uSh-1YQON9t5hnl6E0LNkxPd}Kd0BeDtKN!q!MYUwj&jN2?SKG=C;B-}dw0fsa~ zEFGNxy-Q?H1%pxkBaF1W*1`{z{G@>>J{%3cVP<$4G4%sOixiBXi-~i+885$!eKzFz zhdPi+6EytzZ7eJfx>Vg#cB#M1s;Tw?gCoqWL`I7gC@<5<(Pk4YO%cj7O)7R|&}G5T zNgp>Ayw#%2(%JmXQ5)wlRa>;Y)6?DeU+xUEK&|YGRuF>Z8At!#&3jANj1t8WhCP#G zLTMw4CQ5n`I;124G#L-j;AgGmj~ZJRgA$tQaFN$v4frETbB|y}?quy$^a2eqV`)td z6XD#%@-yoRFZ-xKT*kG~*s1Z|AKP0wQNZUgBBt7sR7tCezW_}Y^+^naD`&dL=8(j0 zn^OD83;Mzm!N>L`aQJzBKbTvj#pNUL|RR|BBpwA4XY9 zar9{5BrfXpp7o3JU@Q6931x2B*cBF}5$XXiY^6))E-&<7mD9Ot_<5gm+JaHACO-d! zhK<(?kLHB71f5IbX~e0>lB!%^qlKtcaCWVt7n(?9QQ1l?Kw&Nh&Hei$;A#5dp_$5LSU1{wb5j9m+!W9>rA*6`V1)yF8JK5) z2&$ZzYfa+U@igMC=ykqkt@#(S=bONC&A{Idrz%7E3udcv0;8|rjNY-cOY+d%o>VP} z>=F$-NJ6wSAKzEdFjkD7N4nVz)t%r%wIsYyL>iQw$>7RBbnR^+S9Rqrjd;z4%mn;0 zE~6G~U+mM5;gKX*S?qzM#>`o@>OR{Tw%OUar2zlUfZyJB;g;&5HC+CKpqb;))2F4c zFUmPQwaJ|S8}FZ(s!-|R*DUOI`y z%1InDOlx@2-YP5r%XoBQn3j#MA-v9c4jWZdQ0ikc>}$VN=!R7)z02klaA%f+2%-4B&MnFRD+x;?qonkbuUKgCQ#aYGZm%UdsAuu%-DbGYvK` z_;yng=RY}b-%rAdBBgk)J;Hu%;R{Sbq^R1Q`ex52-NW>(Wz@BuPKP#zccsC5?F2Sa zR?L32dLMml6n}(r~ZD9&x13 z+rk1EY$p+qZwx!n;B$>)@OUVpnl4eo%a35Z?(}$fmN*9@=LHXT5%YQ2Ah;$y&bVdZ zSWuNxP)?`m^TS_`Ja@1w)NlH;5?H`&C&IhMu87!IiObf80sOi6&xFzq)cKdgqU<2a z_Rx9d2zPs5{yuU+4orExGxmTNtD3J>q=h2r*xi^!4Gob`CkgF5P-g4&2_}t39GjP- z-D)VKnTyKdbToW83SW|-YDXxJg;1P1OT>&ET_MYL(*}EFdV!#!a{VHop3!VA_=VU! zy>Q|TT9OSs>Gg&!L)3gRQjXnHFXAu2$X;hgpaaP2jCzjGL{-s0-CvkW!DR;wp2)eC z3RO@5r*#tX%x6-B?Xz3UX(-hbWLucEv|i? z`;vY6#sThynI@_pq-V$tUa@Aqqz3id*W$Y-;j4ZeyXv6FOA0ATPRo3NZ@#?OeFO5I z9zpef`+z$eQ(;5DtZgAe;x=+Kip*0zp96bIz@YDVzmk)@GGjKT57fUw+Dt;iFd>ra+*RS zFACdMf;?B$Q9K+kieJ&Cs_0cMnyGm3X$>z@s0qQ4TehCHL=PMMuCM425ISZ=O5qREmL`&TfFK4{VUHB{0{}xp3YLr_A(8XFQn(bN9lK%C-m3_BFcCiqUkv(6qiE`S z$zvuf_QXYPJFCIs*%wy;m5)jXdTP*YqEZXQ-E&J38^Ek101JzqY>lCrp&H28DjDs` zP7^y?q&ZZx+wm;k<0U${y*u))X7Lwj$MPfqFUFu~X~4X!lvtk+Zh@n4$BjwgxgcX< zuWnrPOles!_PzmCWbY=KNDdo~KpLcJ+Xd|%!V(T3dAL|})WN1;H zaWCEjfT;Z=&<+OIel&^6m2u7NlMWW+icD)lW{juun`KOHBD@*J!0hl>w z#sNH!ulT9h?p`>u_-ykC=HKJO&dWF8!G-AERQuX{DE)Ope#XmP1R4R9Pk5TC8sG4jppFb>=}=vvl4fyzUsQxdWCwxkV(4!?LXJUYMR&An^g z_!3d2K-4-eVsf4x1P#xERtqb^X>E3X4)D@!88zVKq|%LHw5j(Ib<)5ZwVKV^#5;^LL|VG6d0i|=@1eE7T~2l$G+?49b*%Q>$T+M7>t0!Qc;>+z(b4@ zY?AiMhyCH~HUqk@4NEX7pGs=gW zzURE1_|UBmKI~Qf(Z>8!c&F0Rpdr>n9|r_3cG3MUt@82EG% zb?7%1Y+_1vcUyGKn!~MO?mc@_fLa)6wf@W5#@*ZsU`Aa`XB<(|GQ#_&1ar3;oBofZ zd^iHV_T33W9sG9p$DEofZXLsPXBF}c8@BFtpJ!N2e-C(tv3Fso`M>*&&f^ujngb%D z6yaPmzVzr|(x*vrqmdIgI>0PD&rGbbGBLg#yDWhv%3<$nZ7brpDkh_ZBOZfw_KP!H z(UlqrXh9@8C%zg5NgS2-Jx}KaYxfcKhu|h^OD5h$iNe-u;0(M8)_o5qu@ajVuXMsw zP;BFdaEf?!Uai@GiL%B;Fs(VqPrK5$UYX)0yf)=u@)G#SfA~X>1Xg9AN2G4Oj?;Q$ zaD@YPo3ScTKff2lofx2r8#ynDIElAJh%HtqE3}z!;h=rzS-0S+BZ9c(MH43QzL~c& zD$04@zwYU$eyshD;D_*s8H~m`CHDgCl{KO$B5mC<_}fN}kH;Cxp5}A^7379Ovw{NF zQwFV5YV{k26X%^%hBq-?&keW;hLPE^Xw?j&N2pu|5#T|D-&=2AEnHNMtZ!B-bz04+ zD_kO!pssvOj7t9a-%_20qIc0XFt5Xj8}=3+d(dIyj_%mCqQu)M6U#VDe|w;8@i(<* zFo$W&3!P^PAK~N?C@~PYq`_=BA;ueu_8z0cxQRx^fC}YwE}-VnDN6wSc16eM_$i1} zRm>K3P@(QMHaaMr){Z2TY!j*`jdTtS=Q2mmRLZr@2`P-Ue zhR~4Pc@ohNN&5~QCyrUcG>fOpg-8N=ps3p-D+;gIb?^_62QqaGg5hEmSJBQVr!&(y zb^!TUhFK6A)b{YEO%D1V`bX{S==|xLIz&dTCza~j3Z{5=N}>lGJIg4yprS62y5osXpu*RGnh{nyy!E#712nK#t1re zhg#)gu`K4zC0whtD-u8{0r?i*Rr%HtYc^?}F}b%OUg-9(?LMU}x$1hD_#V_l-BqkB z^Q$r7(#z%|r~w_%t*0!x3M~RMkx-9990A3Aurqj@$_?!W$~Of6J^)@fSSfgkgT*!x8pdx z*9y_MECLkQScm@qsJDp&o7RI=IC?^&JCSi>N!RFI`=YInZEna})AY*r70=#=AheL7 z3E=Tf7~9l`oUGva8p1F{-P<1aY=@W7@rEjc75sL&VQ^XnF5~Z z;>L!gS1MJKsTr6OA{u1D`44 zlV$MJEc__<_Ix?BiOlMsIjwaF?yb(g>#}Wl6rWna#DX8Pz)GxWd=*M!Lz}1NQn^+B7!2BRUm_~LY5-rz8M)d zPKqz4bkLU_j%w->rLuR4SQHaBihGoYw)8D#n@bdi`Sw zmmEnxL3v$MREO|FLqcCDTCD;r&G8+-xj}7O_M(K4nZ@9FbHL}JlDTD1rvAR>iQbft zVUsPcVXLKPk@6NrA!All?x3_Ta21r7_fA3&Jf^%A%L2#aLd1tb$zS`vBO@8Y*ApyYzk*BI! z^SaZShjQr{O=}>pB(3fBw*W(vO>hDnJ=ew*-=z3+l?6Wga@LL!3RwOaq0_&jR~%)Y z=j|n2z7VBBC-TSh_<=`gIth5V;yFuEyzl7=gMd# zjPAnqYVWq}-#``%Lq<`MM{}QBlhu=21a?dHC+pP6a%UkGL+ zwVV)yjtwjeW5!{88funOxu;0oI5ijgAH@{V?;nyH6j@>n!1SrgTeUKcY*Y0Ji`}!o zG~u+O za2PeQw7}_S(GN))hsiXsT1vPju{wR4)bR71wty0#XF_4?_FcW~nBO~}*_@3D!K4R! zs`|}Pq7mL8Dq>Ytz8Ki6u`bq>fe>S{mKPekr6Bx9sB99KMd|Yt?!hk|HPT~+bR5zv zNZcCB@i<+n0y))WsE3V~k+P0H!NL35(8KlMMO4Q|i`z3CplKk{MSyHqn*^%9`yC6ipSD-lH(#zHXyJ|#fl2hq^)5jic){E9Yvvc& zD_L!XxWJ+X5_L?=7W`8b*uS}@f7^I0_M%ot0mw_)f5S}P&%UVC<+H6-$9CPM-L%F# z5uJKPH1+LiVCp$nRm?HDi}bvQOu_LQd>d|-G@C#iP^)8?gl~?B9UpdV)FP*>Uq=*s z>;~zvsA7(mRlp>=!TZgtWp%^s1Q%Bgs;XiC@98s5f>Cvg=4O{d_jX6}HGT zODu}C>?!Rc5h%+$0Bon9EdBjYRzpP06CcOKqv3?(?vtW4_ys936>>Y3`|nYOjt4W! z`=t&r)mlBkzRA6&$U^l!tgIfF@xVLRE&`5-VxAq~4uA*;(<&(&TQVD%+NP!rgpm`q z`OCIVl=9S`b#dG@whiCY?pLw%@E%IW-r{SyQZn_d)Df{+`Fh>SxFHX6#d%QWwjjFg z0dZ6lOqWG|6KEVq!Sy^JdeX=v{Na1E7a;5Xlx;8#pysEeK_sDHdhg{s1F54)mSxTd z8V(%KqBv<7(QGbxP1a(QF;MB87zFHAysXT(DT8w7?c+LlnN=LE>r=p(mlA|wcN#yw z#s~Z{4;eg|$LXrgF*ffseaH~>;1!|#j+jZ984OVLMw3+rTL{^=1i|eW(CeLb5s6Sa zl5tQpQp9VVBTz3kp=w+#>*M=TQH z>yIe6c!~V5x@VFf#2=F|$PI1h+TvB>0iK|sD@`73)hUGe&({}41FR!}fhnDayEn1s zWtZJI%SxE3cTgwl5(~6EVbT(C-I)!}l4v>6s~GqE2C=Cf3V^jsOejjq5KmhDfD9UwhmZ|W#p$fH>-$zwR9sjOmP0A5cuc8o1 zuPn#8!M9Pc!tKkP_XsU}XQ}l1Ai1zom-US>U)!PC#d=`BX9N?xHEu-Un=kZF1Abhh zMWsaZ{54#>3tXVeDo$CCa}9_g-rzjFxD`zhP{je!_0ofM)V^-h6MY6PNYF^*@=Gpn zkhdyaZW=Mf)U$jOv3S_=9hq6QocGmo>?ShOqu+5LUax^JIly`Uc&(0QW(x3wp}os_ zqzZ^~dK*E-Q^-G7xvSs-Bv|Rx(-_NP;)$nNuyV%Wn5^K4VMrgPgx5pCj@iaoc=Bq9 z{n)N`Q<))+hsH`e+hwmcdD^o9Ard8T0(wAg_>K@zN#Cwzh?N;??Y=O11zS>C#cauw zlA`y7dVEXaT*2EZ6mRUVmpMxxogys3;Q-dn1SjQ8Y>vXPc|ZVa?5?ey?lwfY7T2`c zjbir6jfXe zyI!JNPT7&hnru-K{&xx(5MH!>?l(yUBT>r{Fyx9czMFn;wwU*Cz;`kqbXkH@%=?P$ z*%VlRF&fHTJF%ne{#m07qexq4SVYRIYYB3UVS0H(I99Aq%TxF=dUNa~Eb3{DX*t ztWr|!UmsIa_o8| zPfu*UQXlIPF%0Z~@{&pYJ|Ys0i9Ly4N#UA-MnU%nc|guF^ZBuB+j-Q+UTBZMr$#s( zR*D6N>@5dNml!3Ykq`BFa3dTECXh%bs>jDjJt~XnQF+Lj6+3Y_mp1pf*+Z6*owxot z-rXh)WF)%k02}HBsk}bss(?Ty`;(Nsnt$P4yDrM}9kxw8AemA>1bc6QR-Q1m)NWf`A*jxkJ}G9kM5^gE=84 zu!x?85m5;`{SCk>8=bUzDF(kWkBa&1vBG3a*FFzE!D5POV|g{yz8Ns_;XHRX(#+u3 zWy8K@YNQ;|(+<0+VTgLzj-BRI#dcpEEmacEs@a~uarkN9 zD9)v8T6X)iMAkyNpqVho*M((;%2B1z`vS8NDq%J*2CE=dPyt|rBBc|BmSi8VK?VDk ztd9d{j|>4yi^RqcUET~?SwH5g0N!&8`$)Ptt8!Rf1Fx`2Z6qy)%5F|D#asTy%tLFD zW#NGJU?Q({Jp347v9RGtXvy>WfakxL>F6?5m-{{F-<%pryW{CEH~@`qXKhHw=9MiL zxsIEFeI~}=dtOmiv2nGvHtu&N_$8HOKQf?Y;nr0Ge%zC5kp&y$=Nfg&W0EH$1~q`iDEJgNnfT9IrGBt z`*iIe9HT`D*TMBh2AWg0Jo4Ux+%==$$(`|b*w{h7MKJ1(V;Zc zFh(7FvO#|ipBUhDNX0-rxm@0`c}nf(Fy%gozCaTqT+D%&6qp3n`ffmhg zCGVX&nX%p88m@sXh`94!iHULSxCqTe&=97_t3QheL}RWWE+Z*czGlux?l-(qeZQwJ zsGxA4@`iyO4I&;;fXYYp>_aw8FF(Lp$rJn}2=z-!Zqj0!evWUnO!ugM@x#+7dqDQ) zlBkJi3znWMd_>8bHcSIj8PHqplu!HN-v}&bQ9-vwuy@e_bCr zyLbnl+ju4JC^V+WA(9BV4I|VIO|TGN0n7ZE!L;lYeY= zv7Dr)&qcvIKjEuyp?50Eq13>r)Cy5NsEkr>LLAmhA<4DFtrDsl=2+TXgB31hXtWwq z!UqtA50ycBzwivv+dC1Pj6zhEIgjFU)0u4UeB#lv;_3Y+YG!Q?b7%)c*}lzEkXM=m z>&RQt?Pl-&C0R7Gpi!+G`jMPG;Es`i$HAK&^FD-$Ww5Tc11tOMd6D;LKLI+Nrm47- zu^vq<@EGFHA(f_4ftBuyz{L@|afYZmp^dVmsgML{!y$G1x0y8Iz!X0H?VXlQ?XjsG zqAzc>U-2}@1-dhy(T$ECNR7qUIWR(W=mNt^^K_|iVT0?AFOO$YFx_A?9k1zg3Lhfy z`BV6io?$AcW}_b;U0@--_Q-&}&M6|FF^2I+z)EngJv$Urp|vfg;x^~4nkn=8<%-vw zz1JGi-0{NK-~a(CUa2WcQFmuH(H!~j1iM`cDRj4RAxiw@`x=Rr0#X5Z42k9WEep+4 z^D35E{A*q)guTE862tPeS1#|7lHSI$B5T;g7d15u)1yW2N9~7Y?X+zMNY5y50|mgs zfs)EsfH=zZ-@F|jZ92c;BVwSL2)s41}_^K zk8c&M`WBKbr@_CP;udJi=ZGt{7b-81a@*_mV-)FU6(s*kRT1h$5XvFKAvf6FJd!b@ z)G#}YnSbg1f-}!yV-qB1$mM_ePeC{_luWGyUoJ89=D%;h`QF}i8D?4SDkuKhJ_q^Vk8Y)^U=!Hmi5hFl*^9wS zkh|#NerS+9?&1{&^G`tU+c(~_XIi+oeUN0kf9F-Z5O0H+Z5Mu`c2 znFU?WtNCkmr&3dMa7BYv_x-nVd2SHAs)UQMI#rdTczjaTd#OOC*3Te93j+Xaak)8d z$CT!g!z3C*U6I@v7ida2@bTbcz>=)oJ(>tY6pvBY^(udw1+`H$?qa$?h;hEEgMh&X z4xeTIK6hxB#iaZ!92S*64EcAQW7GWB`E210up7aaXi z#NPPn>`8%FRUjBcp_TSH!j={~4^Zob*W#%}Upeel78C;Fu~Pi>4oy7jfxMmCTG>M) zTMJTQA~>i93-jGO)Wf1yPO6feL}Je5)oCthF*reUQmC^e^y*Io7$uaFyWm-G)<3^x zvv(FkZsFNEyCk{qh=)#k*e&x`_4CzKYBnup#$)s$C68_NM`i+}uAHg|99A7~vU$RsyL;*x1z=2@#I8xZlzB7ulwFyU zH;_B5-Q~)-FGV_y0!1%xq#qR6mQf(rsq!$}OFg^6@|3F=j;0mi2a5qmWFYn$m@aIk zdKgjoFLtSsgHS|KXQ60$$8^ZRW0B*t=oyv={bEg!vk>#9 z)H>U(CyUiEk^!3^bE?2+_9y5BB}UE@2RU;zu-ZAY@t{>b z>*w89>|2etPdv}!A({s2otArlzRrjFvLr2S@@xcBdIANGVCGwq$oco4b4KDl9UxW& zpsVrinAJC`nzR@F@Sd7f?OhD7eueBz8Or0a6j;}$?sxtt6 z=5{}$NkXEML0p2cVd{$T*|gRV3Dqv-6?bmeAn3eD0_I@0IiYe{x{qM>+@mQNhG;~* z>C7m|l^-$|uT%VjGNayDC6xV`D?kPo)@ zwwKir(Yr3x&4D2$>2@_T>_)?pW{i?PMZJt9GabDqCwWgQ)S2Y7x1%WtmST7oRK*L1 zk_Vqf{l=hdA0XrCVB&zJ^lyaTgYGY4|tpN`a(8LggAFogM!&C!Aepy zs?peBH^M048Bv?o)uM!R!GR4zOZL-&%EBc9z8b@&<0Pi&`_#7%t)Kua2F^wlrJKRE z`YJ7_{I0LVZ>>~ae0%Rh0OXzrx63nb^8F(=4DTHkQKLoLo3vepJ9O^OKzm^A8ghbYk4x;AG^(zCe)o? z{2*$;Y^W8vEDkdz9kK(4HJdyWTc5?LqoAnwZL4c$1bu((F#R{}r4h>YRXb1{5SDC` zTc<#Y%x8r$W*@L;lS#|y%JPVLyi;QYm}dMuFRi=)lwl&nbmj*M+^TXS@h$Dq8b9o> zj3$$Dr!c_Cd3w``b2lao00L*^AM98zIAGACnR7KLY$ILQFNX}wc>T&u*e~8CgTQse zXE{C-$&OVd6A3h}^d=%adOZE$?<4kKN^f6D3$BZr$=l0c2iIc@KGemTS!dS}A-y&=msgZxR-R`IUfW1rJOhx ze_s$DpN0RNs*d8Z$n<(q*}j+(cJ`EtK#SkS^IneTv9iZ--(KIW+ast2gAvNQ_0tLT zOOoWa4fOh;8)p1RFuco2Dc1KZX(Y3!RX$LJ;BjL>C&iNT#w6r=zp}RB) z>2tL(+Pvknu-n$K8rKN(6zEL&V9%siuCOswQUTEU-W%;Kr_?Vql;_KQPQKjmS{ly) z>9~}?4!W;Fp4}T zh|(<4nI|ClDwRjUN=4(D+c^=Jx7!lkg}##6x+nODtYZi=Kr5O%Vgxj*RHV*p%!U!9 zH+_s_Row9bWgx9A?T+g1@hmqlWA9!&rK7R?UV$E$j=))viAIV&eR@*JxL?|I7nd(BFK{k)f_x1!)4Z_ z327K(kY<3AT-f=CUVJ4+RdTa$qMF4xV;>lY;)V5&nG}c;J1<%r2Ps|)>0ft_r3E(& zepiMg5OOB}AmBfhiqq^AZ8Nkh9@o#dF$n?~E>&=SkN@#8htvX3&^>6Q(qCBv4GlV% zS~f6n)OhoQ*EA&EHv*USjSiV_(~@q$`Yh{uPURb6XRkvMm>5%6uZO**`h*0$0ErPK zQQ!&w+lJP2{!%81MWzRHeSqRm$x;c2;K*#(dkfEa)6Y5)Cg)5w-cKHC(PRKJdNyRt z6TP23wSt}uKMIF?1!Vw2+54@{vR`L00T+~*4Z^Kk&(>B^f332N+~(a7J(Z>TW@6nn zq=B${w0Zf??GS3_-_|UKbc|^h$#I1Ckz7yk3!s`P+VPyJ`ovtHl~{pcvb02*;_c%D zDDNF95>ln}FS#XZz_Z5((M`^65S#H7^MyJ#yrGgdB0|9HoQ)!|7uy8buCEd{ieod_0AP5eagV$>>z=+X~RW{V;n#*(>8((zG)Ss(k1ieqru6Fw|K@N ziw>PB313Q4m*a8fHlUzVYp%_u2oWl85(6yb^wMkve)_RYzfrqENRC(t{58zPUr-O0rMcTVeF!Jnhx>#O8Lkc;f@?w&CO$e(wPdWah6)}Gl7 zRNnvGpg%R3k#gFT@z3Pi*}nWdmab+8F^xk zUqLn2_*+%p?HgGnY@K4<{&L1BG`(|h%NWcGS9TJ75$ciR+3`K!C}dlgu72b*IrA@t zXg3A6ngX#@sP$ig0xVz7DM-qk;!nMWBMv(mcEg7WD-bJyY%|dYSVTn()NC6Od22`Q#mi?#sPy%{$^mF8f$;+b13=pzjXZ_@uwukGo$mHuc8y>(0sFRb5V$hFV zp2e1*?ePx=$c*Ok;uD-=rjlZCJIvX{EGux-v)(|^o>vI=vJ@&odyat9E&ZOh(PjT& zo({c1E=!TW{b8VNqgmr0PxUzo+k$6R{b>BimAWU1-|9l+wDj7^zD0KDTy{fe-;>pr z2@~yZ4&liIIVgP)V5t2B_FJt1i{A^QyOIj!ziRETxX1<-`ipkJrv-$ zM?_Myl+ladaN==SsvtHWqV9eWki7y;Lx=c;0YSLhj(veh!eAC}5;mOl>M~P3LKKSK zUu68FO5Hep_yEG(&|*HU>iP1Aauva~NNHA*KB2D~i!f%Cl`@<%?JjwZL!pACS#9Mo zul+Da!INAZCk@;7wBHCDYO~UPYsEAm{kx=!lEM;O0OE1-N)a?s!PSOC&CWh|0tX0g z<8#B*3|Dx}=#XhBX5o?)i;uc_2 zhMvP_PvTePeD?vIa1R{7jLapRnqs{CR(JKr-mE{9My*z9N~K?F?9|81pMtz|K%Y9d z>tnR2mLSxayFOJZL2~wp_ z>A@2AoOiBiGa{6z60MJ1uF{X2#^hvZ4{A*xt`XwZNAK!L#pDs`C_v^5j5Mw!u{m9D zrMMEv64elx&Ipz$w-Z;v zmblPl{W6O}67)RH6YIGE4=lbI6MBoBK$GG0mWU@0D;-$=k3KuD)N+wFLYB&MiVT6Fk`5FD zf>J71+KHk(-=-0OL#V=o86A93n9F$-Bzz*US0a%ICx|yo*HSWqJe9#;|WOk#9&lLpX=zBSDL;I_wuO%t;Jwg3Be>OoAs8#-omcM!L zj8s)k+2F-VF|E6AE+*XC{)c$2q`ZxCwl}MSI?LF2Af9FP2RB$V%{F*@zmYQaBgEL@ zD-3unp?NTy^BN)pktdWn@0}R0Wcty@h6y6TnYff66+&<#N92y`%;#=-eiYS5(Z2Z5 zY5dBFOctYgqWOnLCobV$l$8IvJKU@~?|dE|Nptp}d~^6`k>$uVTrarcOE9Ns@+Jv- zw1S{jf0otkMIM_+6%Pu@F^4;ar{t%Y?0XtMqmj=$xJ@5e!GIRFHdoiE*CUc+LTDs5 zji@>S`VW}f7kUtvn%H99Z)>B0^Dyu;GC%q&M>QjM{KFn?oa%%|B}PqgrxHay&t+Ru zc&j?9%Ajdl!jmYz6f|s$t`Gj=r{e)6@CJs>y_w{dW;{LeS^qv`` zrv*Jm}p0JQT+e_zt$q@ds>9w0r)D*&fP^s zj(kr7e8D;J%2SWM_R3S=|E_t@9smG_gcPs$I~M>9ce&1gZ_{?2hSA#f!Dp9!`hPF8 zlWK946B6n{SwH^&vmon(vrh&Q)?3dC>nmP;G!c&+S!=noSkJq#|kpt)Q{y$^Xaw*z6H0ZP(;)-ci>Oyk)AGtX8?n(=0u~r z{eoeBDCLTdQ2NY0-WCwKkV1F8ZJ`Nf1fm-S1=)~c10Kg;&jlf(N(-DIMt-tSlmvwF z^bi%Rp#bHvV(4kXTFIAVXT=-6_1W!;)r=t7wn{t2TwjL6pv9T7P-)`fpuKm99jK*Z zs?{%L@f53XDA%jDs~Krzx#v_Rt=B9-L9a)gcX|^gtZ88J-ZjVGVa0B`BH1^UT@$gg zQ2FwED7+k89i*1S^m7EzU+E{1bS?h>9UqTP2<1tM%_)~vRdWJW1_^gP53*Dd|J8_y zY$swq12`8BJnu_Ae*J|mo`%Hz_?P{%KX0(@ZIDztb3&$ezG-5Jk>AB34&Lyg+(S_U zW5|^;yEY%69Z04n?l>>{NlLA~*ftuPjY_6uwCgKl**~HRmyU;H*>W!j2>f5_7a#6* z7Lq7-HSX2M!aOhC$D+LrE-?DN2wTG9^B`MLE)taQvk(7~2L1&A3<)WD z%m0ly#7Y!~__Pt%004&g1iU(O1H0cS{PF+)O=euX$dJ3pR0UW9Q!|uCi8?Nn?B*IH z=ajyQ7;!I}7QY5*%?m}R3nkte3h^`HeMNWB;r~RNNd{8jt;k}tb58aDk^6J;h*8xn zF6OCpe6RjvqiIcd^S1Ri^_&TO;B!uzenxS!l6NY+uF1Bx(_=*bOEARK;LpGg_av{~9)K^Zsb%g^rz^ zq{{zzkB~0xx80YohBJ#W{61^`R8wMJAuf>u=s!R42Zk{nZt~QXTy~vB#x)~d@BC8l zy69A%;gA2rM#C+a6EpA8$!f0ITuBp@3>g*H{0gpSnQJQpGh?X=(}FEg@VdUa0W${d zBe~rXjM6G=<_aA6N0K9sWzPA|zKr=vMq@Q6Z^$e{xS6MJ=Iqzq*I}5o@`qJ{OHm># LwUfjQ$X literal 0 HcmV?d00001 From 471f05fc525c39f771e7e61b0e64139f05720a89 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 28 Dec 2014 11:40:33 -0500 Subject: [PATCH 403/656] Update mac script for atom * Remove open -a. It was causing two applications to open. Assuming this was only needed for node-webkit. * No whitespace parsing needed to fix #1292 since atom correctly parses whitespace args and provides them to process.argv. * File permission needs to be executable. We were relying on an executable version of this from the .zip in osx_deps.sh. --- platform/mac/light | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) mode change 100644 => 100755 platform/mac/light diff --git a/platform/mac/light b/platform/mac/light old mode 100644 new mode 100755 index 6460f51ad..c263c8277 --- a/platform/mac/light +++ b/platform/mac/light @@ -19,17 +19,4 @@ then exit 1 fi -LTAPPCLI=$APP_DIR/LightTable.app/Contents/MacOS/node-webkit -PWD=`pwd` -ARGS="$@" - -CORRECTED=${ARGS//-/} -CORRECTED=${CORRECTED// /} - -if [ $# != 0 ]; then - LTCLI=true $LTAPPCLI "dir=$PWD$CORRECTED" & -else - LTCLI=true $LTAPPCLI & -fi - -open -a LightTable +LTCLI=true "${APP_DIR}/LightTable.app/Contents/MacOS/Atom" --dir=`pwd` "$@" & From b63fe571f0eb676f2af1b0786b08ea495eb5326b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 28 Dec 2014 13:49:53 -0500 Subject: [PATCH 404/656] Fix init-codemirror by adding back harmony flag String.contains and String.endsWith are only available with harmony enabled --- deploy/core/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/core/main.js b/deploy/core/main.js index 2139fb2b8..e4e2f98cb 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -144,6 +144,7 @@ function parseArgs() { function start() { app.commandLine.appendSwitch('remote-debugging-port', '8315'); + app.commandLine.appendSwitch('js-flags', '--harmony'); // This method will be called when atom-shell has done everything // initialization and ready for creating browser windows. From ad816e942a0a73612d518c51d06aa67bdce431cc Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 29 Dec 2014 01:31:50 -0500 Subject: [PATCH 405/656] Introduce script/build.sh to handle deps and then build app * build.sh moved to build-app.sh since it's useful to keep a separate script for rebuilding app + cli * Moved plugins to script/build.sh since it's a dependency and not build-app concern --- build.sh => script/build-app.sh | 53 ++++------------------------- script/build.sh | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 46 deletions(-) rename build.sh => script/build-app.sh (73%) create mode 100755 script/build.sh diff --git a/build.sh b/script/build-app.sh similarity index 73% rename from build.sh rename to script/build-app.sh index f7660442d..19809ecbf 100755 --- a/build.sh +++ b/script/build-app.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash set -e -# Ensure we start in assumed directory -cd "$(dirname "${BASH_SOURCE[0]}")" - # Create LightTable release using our local Atom Shell installation # (Mac, Linux, or Cygwin) +# Ensure we start in project root +cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. + #---------------------------------------------------------------------- # Get OS-specific Atom details #---------------------------------------------------------------------- @@ -52,8 +52,6 @@ DEFAULT_VERSION=`echo $META | cut -d' ' -f3 | tr -d '"'` : ${VERSION:="$DEFAULT_VERSION"} BUILDS=builds -mkdir -p $BUILDS - RELEASE="$NAME-$VERSION-$OS" RELEASE_DIR="$BUILDS/$RELEASE" RELEASE_ZIP="$BUILDS/${RELEASE}.zip" @@ -66,52 +64,15 @@ rm -rf $RELEASE_DIR $RELEASE_ZIP #---------------------------------------------------------------------- echo "Creating $RELEASE_DIR ..." - -cp -R $ATOM_DIR $RELEASE_DIR -rm -f $RELEASE_DIR/version -rm -f $RELEASE_DIR/LICENSE +mkdir -p $RELEASE_DIR +cp -R $ATOM_DIR/Atom.app $RELEASE_DIR/ mkdir $RELEASE_RSRC/app cp -R deploy/core $RELEASE_RSRC/app/ cp deploy/package.json $RELEASE_RSRC/app/ cp -R deploy/settings $RELEASE_RSRC/app/ - - -#---------------------------------------------------------------------- -# Fetch plugins and copy into output location -#---------------------------------------------------------------------- - -# TODO: Handle node/node -PLUGINS=("Clojure,0.1.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.2" - "Paredit,0.0.4" "Python,0.0.5" "Rainbow,0.0.8") - -PLUGINS_DIR="$RELEASE_RSRC/app/plugins" -mkdir -p $PLUGINS_DIR -# Plugins cache -mkdir -p deploy/plugins - -pushd deploy/plugins - for plugin in "${PLUGINS[@]}" ; do - NAME="${plugin%%,*}" - VERSION="${plugin##*,}" - if [ -d $NAME ]; then - echo "Updating plugin $NAME $VERSION..." - cd $NAME - git checkout --quiet master - git pull --quiet - git checkout --quiet $VERSION - cd - - else - echo "Cloning plugin $NAME $VERSION..." - git clone "https://github.com/LightTable/$NAME" - cd $NAME - git checkout --quiet $VERSION - cd - - fi - cp -R $NAME $PLUGINS_DIR/ - rm -rf "$PLUGINS_DIR/$NAME/.git" - done -popd +cp -R deploy/plugins "${RELEASE_RSRC}"/app/ +rm -rf "${RELEASE_RSRC}"/app/plugins/*/.git #---------------------------------------------------------------------- # Polishing diff --git a/script/build.sh b/script/build.sh new file mode 100755 index 000000000..8404e89be --- /dev/null +++ b/script/build.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +set -e + +# Build LightTable app and CLI and place in builds/. +# Specify $VERSION to override default build version. +# This script primarily installs dependencies and sets up +# the app before calling build-app.sh to build it. + +# Check if lein is installed +lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } +if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then + echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; +fi + +# Check if npm is installed +npm --version >/dev/null 2>&1 || { echo >&2 "Please install npm before running this script."; exit 1; } + +# Ensure we start in project root +cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. + +# Ensure we have current version of atom-shell +pushd shell + npm install -g grunt-cli + npm install + grunt download-atom-shell +popd + +# Build the core cljs +lein cljsbuild clean && lein cljsbuild once + +# Fetch plugins +PLUGINS=("Clojure,0.1.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.2" + "Paredit,0.0.4" "Python,0.0.5" "Rainbow,0.0.8") + +# Plugins cache +mkdir -p deploy/plugins + +pushd deploy/plugins + for plugin in "${PLUGINS[@]}" ; do + NAME="${plugin%%,*}" + VERSION="${plugin##*,}" + if [ -d $NAME ]; then + echo "Updating plugin $NAME $VERSION..." + cd $NAME + git checkout --quiet master + git pull --quiet + git checkout --quiet $VERSION + cd - + else + echo "Cloning plugin $NAME $VERSION..." + git clone "https://github.com/LightTable/$NAME" + cd $NAME + git checkout --quiet $VERSION + cd - + fi + done +popd + +script/build-app.sh From 19bc0ef101fb13f8d7ee99cda039ac4553773246 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 30 Dec 2014 08:13:07 -0500 Subject: [PATCH 406/656] Use atom's node for worker-thread atom ships with its own node - https://github.com/atom/atom-shell/tree/master/vendor. No weird behavior is observed e.g. chromium getting spun up. This change removes the need to package LT with a node binary. --- src/lt/objs/thread.cljs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index c07a565e8..54d5450bb 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -57,16 +57,19 @@ :reaction (fn [app] (object/raise worker :kill!))) -(defn node-exe [] - (if (platform/win?) - "/plugins/node/node.exe" - "/plugins/node/node")) - +;; Provides a forked thread, mainly for use with background macro. Parent thread +;; sends messages to child thread. Child thread performs work and sends results +;; back to parent thread. (object/object* ::worker-thread :tags #{:worker-thread} :queue [] :init (fn [this] - (let [worker (.fork cp (files/lt-home "/core/node_modules/lighttable/background/threadworker.js") (clj->js ["--harmony"]) (clj->js {:execPath (files/lt-home (node-exe)) :silent true}))] + (let [worker (.fork cp (files/lt-home "/core/node_modules/lighttable/background/threadworker.js") + (clj->js ["--harmony"]) + (clj->js {:execPath js/process.execPath + :silent true + :env {"ATOM_SHELL_INTERNAL_RUN_AS_NODE" 1} + :cwd files/pwd}))] (.on (.-stdout worker) "data" (fn [data] (console/loc-log {:file "thread" :line "stdout" From db0fc4848a776368fc351e3d0c66ce2fc12e1c9d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 30 Dec 2014 08:45:34 -0500 Subject: [PATCH 407/656] Remove osx_deps script - replaced by script/build.sh --- osx_deps.sh | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 osx_deps.sh diff --git a/osx_deps.sh b/osx_deps.sh deleted file mode 100644 index 94fa2f53d..000000000 --- a/osx_deps.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# Check if lein is installed -lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } -if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then - echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; -fi - - -#remove the previously built plugins, binary, and executable -rm -rf deploy/plugins -rm -rf deploy/LightTable.app -rm deploy/light - -#get the LightTable.app binary -curl -O http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.2/LightTableMac.zip -unzip LightTableMac.zip -mv LightTable/* deploy/ -rmdir LightTable/ -rm LightTableMac.zip - -cp -r platform/mac/* deploy/ - -#build the core cljs of LightTable -lein cljsbuild clean && lein cljsbuild once - -#Get the plugins from the binary -cd deploy -mv LightTable.app/Contents/Resources/app.nw/plugins plugins -cd plugins - -#Make sure we have the latest clojure -rm -rf clojure -git clone https://github.com/LightTable/Clojure.git clojure -cd clojure -./build.sh - -#Remove the app.nw so we use our local copy -cd ../../ -rm -rf LightTable.app/Contents/Resources/app.nw From ba89485130a0581c88536cb79a36be88cc04f7f6 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 30 Dec 2014 12:07:02 -0500 Subject: [PATCH 408/656] LightTable.app displays name correctly with latest atom-shell --- script/build-app.sh | 3 +-- shell/Gruntfile.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 19809ecbf..282706268 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -89,8 +89,7 @@ if [ "$OS" == "mac" ]; then defaults write $FULL_PLIST CFBundleIconFile 'app/core/img/app.icns' defaults write $FULL_PLIST CFBundleDisplayName 'Light Table' defaults write $FULL_PLIST CFBundleIdentifier 'com.kodowa.LightTable' - # TODO: Fix enabling causes LSOpenURLsWithRole() failed ... error -10810 - # defaults write $FULL_PLIST CFBundleName 'LightTable' + defaults write $FULL_PLIST CFBundleName 'LightTable' mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 4aa9c162e..a52342462 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.20.1", + version: "0.20.3", outputDir: "./atom-shell", rebuild: true } From 9e424dc7099223ae9fd7d3d959e116efa6fa13cc Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 30 Dec 2014 12:09:29 -0500 Subject: [PATCH 409/656] Sign osx app to avoid endless osx firewall dialogs Now that LT has its own name, we were getting endless osx firewall dialogs. More context at http://apple.stackexchange.com/questions/3271/how-to-get-rid-of-firewall-accept-incoming-connections-dialog --- script/build-app.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/build-app.sh b/script/build-app.sh index 282706268..0dd10dbda 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -93,6 +93,9 @@ if [ "$OS" == "mac" ]; then mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app + # Sign app to avoid endless “accept incoming connections” dialogs + codesign --force --deep --sign - $RELEASE_DIR/LightTable.app + elif [ "$OS" == "linux" ]; then mv $RELEASE_DIR/atom $RELEASE_DIR/LightTable From eb0365c2b92eb54d41ddad299db3a1422703de65 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 31 Dec 2014 02:03:40 -0500 Subject: [PATCH 410/656] Remove last traces of node-webkit menu Menu doesn't have a type property so there isn't a need for create-menu. MenuItem doesn't have :key or :modifiers --- src/lt/objs/menu.cljs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 7d4223aeb..de7273ad7 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -12,13 +12,6 @@ (def Menu (.require remote "menu")) (def MenuItem (.require remote "menu-item")) -(defn create-menu - ([] (create-menu nil)) - ([type] - (if type - (Menu. (js-obj "type" type)) - (Menu.)))) - (declare submenu) (defn menu-item [opts] @@ -38,7 +31,7 @@ (MenuItem. (clj->js opts)))) (defn submenu [items] - (let [menu (create-menu)] + (let [menu (Menu.)] (doseq [i items :when i] (.append menu (menu-item i))) @@ -124,19 +117,19 @@ {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"} {:type "separator"} (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) - {:label "File" :submenu [(cmd-item "New file" :new-file {:key "n"}) - (cmd-item "Open file" :open-file {:key "o" :modifiers "cmd-shift"}) + {:label "File" :submenu [(cmd-item "New file" :new-file) + (cmd-item "Open file" :open-file) {:label "Open folder" :click #(do (cmd/exec! :workspace.show :force) (cmd/exec! :workspace.add-folder))} (cmd-item "Open recent workspace" :workspace.show-recents {}) - (cmd-item "Save file" :save {:key "s"}) - (cmd-item "Save file as.." :save-as {:key "s" :modifiers "cmd-shift"}) + (cmd-item "Save file" :save) + (cmd-item "Save file as.." :save-as) {:type "separator"} - (cmd-item "New window" :window.new {:key "n" :modifiers "cmd-shift"}) - (cmd-item "Close window" :window.close {:key "w" :modifiers "cmd-shift"}) + (cmd-item "New window" :window.new) + (cmd-item "Close window" :window.close) {:type "separator"} - (cmd-item "Close file" :tabs.close {:key "w"}) + (cmd-item "Close file" :tabs.close) ]} (if (platform/mac?) {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:selector "undo:" :accelerator "CommandOrControl+Z"}) From a66a33df7049793371f445d3b863a5395c359c1e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 31 Dec 2014 02:12:40 -0500 Subject: [PATCH 411/656] Fix main-menu getting called 4 times on init Also fixed up indentation on menu behaviors --- src/lt/objs/menu.cljs | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index de7273ad7..3685f7a1d 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -170,37 +170,37 @@ ])) (behavior ::create-menu - :triggers #{:init} - :reaction (fn [this] - (when (platform/mac?) - (set! (.-menu app/win) nil) - ) - (main-menu))) + :triggers #{:init} + :reaction (fn [this] + (when (platform/mac?) + (set! (.-menu app/win) nil) + ) + (main-menu))) (behavior ::recreate-menu - :debounce 20 - :triggers #{:app.keys.load :init} - :reaction (fn [app] - (when (platform/mac?) - (main-menu)))) + :debounce 20 + :triggers #{:app.keys.load} + :reaction (fn [app] + (when (platform/mac?) + (main-menu)))) (behavior ::set-menu - :triggers #{:focus :init} - :reaction (fn [this] - (when (platform/mac?) - (main-menu)))) + :triggers #{:focus} + :reaction (fn [this] + (when (platform/mac?) + (main-menu)))) (behavior ::remove-menu-close - :triggers #{:closed :blur} - :reaction (fn [this] - (when (platform/mac?) - (unknown-menu)))) + :triggers #{:closed :blur} + :reaction (fn [this] + (when (platform/mac?) + (unknown-menu)))) (behavior ::menu! - :triggers #{:menu!} - :reaction (fn [this e] - (let [items (sort-by :order (filter identity (object/raise-reduce this :menu+ [] e)))] - (-> (menu items) - (show-menu))) - (dom/prevent e) - (dom/stop-propagation e))) + :triggers #{:menu!} + :reaction (fn [this e] + (let [items (sort-by :order (filter identity (object/raise-reduce this :menu+ [] e)))] + (-> (menu items) + (show-menu))) + (dom/prevent e) + (dom/stop-propagation e))) From 24b1c0bea13633cd788428de9cf901666d93a2df Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 31 Dec 2014 15:47:33 -0500 Subject: [PATCH 412/656] Merge open and save file dialog implementations * We are able to get sheets on osx with remote, contrary to b912f02af40c6ed35887675b7192827872fd4e70. Perhaps an older atom-shell bug. * Merging the two provides consistent dialog behavior from workspace or menu. * Extended open dialogs to have multiple selections which is additional functionality that the opener implementation provided. * Removed invalid :properties to showSaveDialog - probably for node-webkit. --- src/lt/objs/dialogs.cljs | 19 +++++++++---------- src/lt/objs/opener.cljs | 24 ++++-------------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/lt/objs/dialogs.cljs b/src/lt/objs/dialogs.cljs index 46335a263..d7111dbb3 100644 --- a/src/lt/objs/dialogs.cljs +++ b/src/lt/objs/dialogs.cljs @@ -8,16 +8,15 @@ (def dialog (.require remote "dialog")) (defn dir [obj event] - (let [files (.showOpenDialog dialog #js {:properties #js ["openDirectory"]})] - (when files - (object/raise obj event (first files))))) + (let [files (.showOpenDialog dialog app/win #js {:properties #js ["openDirectory" "multiSelections"]})] + (doseq [file files] + (object/raise obj event file)))) (defn file [obj event] - (let [files (.showOpenDialog dialog #js {:properties #js ["openFile"]})] - (when files - (object/raise obj event (first files))))) + (let [files (.showOpenDialog dialog app/win #js {:properties #js ["openFile" "multiSelections"]})] + (doseq [file files] + (object/raise obj event file)))) -(defn save-as [obj event] - (let [files (.showSaveDialog dialog #js {:properties #js ["createDirectory"]})] - (when files - (object/raise obj event (first files))))) +(defn save-as [obj event path] + (when-let [file (.showSaveDialog dialog app/win #js {:defaultPath path})] + (object/raise obj event file))) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index dc4f00144..d7314c012 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -14,7 +14,6 @@ [lt.objs.notifos :as notifos] [lt.objs.files :as files] [lt.util.dom :as dom] - [lt.util.ipc :as ipc] [lt.util.cljs :refer [->dottedkw]]) (:use [crate.binding :only [bound map-bound]]) (:use-macros [crate.def-macros :only [defpartial]] @@ -24,15 +23,6 @@ ;; transient docs ;;********************************************************** -(defn open-input [this & [ev dir?]] - (ipc/callback this (or ev :open!) - :dialog.showOpenDialog ipc/win {:properties [(if dir? :openDirectory :openFile) - :multiSelections]})) - -(defn save-input [this path] - (ipc/callback this :save-as! - :dialog.showSaveDialog ipc/win {:defaultPath path})) - (defn path->info [path] (when path (let [type (files/path->type path)] @@ -63,12 +53,12 @@ fname (:name info) ext (when-let [e (:exts info)] (str "." (name (first e))))] - (save-input this (files/join path (str fname ext)))))) + (dialogs/save-as this :save-as! (files/join path (str fname ext)))))) (behavior ::save-as-rename! :triggers #{:save-as-rename!} :reaction (fn [this] - (save-input this (-> @this :info :path)))) + (dialogs/save-as this :save-as! (-> @this :info :path)))) (behavior ::save-as :triggers #{:save-as!} @@ -142,12 +132,6 @@ :reaction (fn [this bool] (object/merge! this {:open-linked-doc bool}))) -(behavior ::open-dialog - :triggers #{:open-dialog!} - :reaction (fn [opener paths] - (doseq [path paths :when path] - (object/raise opener :open! path)))) - (behavior ::open-standard-editor :triggers #{:open!} :reaction (fn [obj path] @@ -218,7 +202,7 @@ :tags #{:opener} :triggers #{} :open-files #{} - :behaviors [::open-standard-editor ::open-dialog] + :behaviors [::open-standard-editor] :init (fn [this])) (def opener (object/create ::opener)) @@ -231,7 +215,7 @@ (cmd/command {:command :open-file :desc "File: Open file" :exec (fn [] - (open-input opener :open-dialog!))}) + (dialogs/file opener :open!))}) (cmd/command {:command :open-path :desc "File: Open path" From b5a71aac3b06d29b5fe93625b37347e4757467b2 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 1 Jan 2015 13:17:38 -0500 Subject: [PATCH 413/656] Add file-type definition for gherkin - close #1795 --- deploy/settings/default/default.behaviors | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index b17bc41f0..900c651a6 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -276,6 +276,7 @@ {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} + {:exts [:feature], :mime "text/x-feature", :tags [:editor.gherkin], :name "gherkin"} {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} {:exts [:haml], :mime "text/x-haml", :tags [:editor.haml], :name "HAML"} From e3fc0f74c3cbe181963ba5ac51587b66ca82466f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 1 Jan 2015 13:57:51 -0500 Subject: [PATCH 414/656] Capitalize extension name to be consistent --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 900c651a6..154205df6 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -276,7 +276,7 @@ {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} - {:exts [:feature], :mime "text/x-feature", :tags [:editor.gherkin], :name "gherkin"} + {:exts [:feature], :mime "text/x-feature", :tags [:editor.gherkin], :name "Gherkin"} {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} {:exts [:haml], :mime "text/x-haml", :tags [:editor.haml], :name "HAML"} From 1c4cb33171ad946a846e64d45757d0f943931d12 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 1 Jan 2015 17:45:05 -0500 Subject: [PATCH 415/656] Use Info.plist from LightTableMac.zip file instead of atom's plist * Use LT's existing plist since we have a complicated definition for CFBundleDocumentTypes. * Copied file to platform/mac, set CFBundleExecutable and CFBundleTypeIconFile to correct values and removed SCMPath and SCMRevision since they are left over keys from node-webkit --- platform/mac/Info.plist | 182 ++++++++++++++++++++++++++++++++++++++++ script/build-app.sh | 15 ++-- 2 files changed, 188 insertions(+), 9 deletions(-) create mode 100644 platform/mac/Info.plist diff --git a/platform/mac/Info.plist b/platform/mac/Info.plist new file mode 100644 index 000000000..efc0afb02 --- /dev/null +++ b/platform/mac/Info.plist @@ -0,0 +1,182 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + Light Table + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + clj + cljs + edn + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeName + Clojure Source + CFBundleTypeRole + Editor + LSIsAppleDefaultForType + + + + CFBundleTypeExtensions + + txt + text + utf8 + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeMIMETypes + + text/plain + + CFBundleTypeName + Plain Text File + CFBundleTypeRole + Editor + LSIsAppleDefaultForType + + + + CFBundleTypeExtensions + + html + phtml + shtml + xhtml + htm + pht + sht + xht + phtm + shtm + xhtm + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeMIMETypes + + text/html + + CFBundleTypeName + HTML Source File + CFBundleTypeRole + Editor + LSIsAppleDefaultForType + + LSItemContentTypes + + public.html + + + + CFBundleTypeExtensions + + js + htc + jscript + javascript + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeMIMETypes + + text/javascript + + CFBundleTypeName + JavaScript Source File + CFBundleTypeRole + Editor + LSIsAppleDefaultForType + + LSItemContentTypes + + com.netscape.javascript-source + + + + CFBundleTypeExtensions + + py + rpy + cpy + python + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeMIMETypes + + text/x-python-script + + CFBundleTypeName + Python Source File + CFBundleTypeRole + Editor + LSItemContentTypes + + public.python-script + + + + CFBundleTypeExtensions + + css + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeName + Cascading style sheet + CFBundleTypeRole + Editor + + + CFBundleTypeExtensions + + markdown + markd + mdown + md + + CFBundleTypeIconFile + app/core/img/app.icns + CFBundleTypeName + Markdown document + CFBundleTypeRole + Editor + + + CFBundleExecutable + Atom + CFBundleIconFile + app/core/img/app.icns + CFBundleIdentifier + com.kodowa.LightTable + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + LightTable + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.6.2 + LSApplicationCategoryType + + LSFileQuarantineEnabled + + LSMinimumSystemVersion + 10.7.5 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/script/build-app.sh b/script/build-app.sh index 0dd10dbda..cadb7d16a 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -78,18 +78,13 @@ rm -rf "${RELEASE_RSRC}"/app/plugins/*/.git # Polishing #---------------------------------------------------------------------- -# Copy over platform-specific files e.g. executables -cp $PLATFORM_DIR/* $RELEASE_DIR/ - if [ "$OS" == "mac" ]; then - FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" + cp $PLATFORM_DIR/light $RELEASE_DIR/ + cp $PLATFORM_DIR/Info.plist $RELEASE_DIR/$PLIST - # TODO: Port keys from previous plist - defaults write $FULL_PLIST CFBundleIconFile 'app/core/img/app.icns' - defaults write $FULL_PLIST CFBundleDisplayName 'Light Table' - defaults write $FULL_PLIST CFBundleIdentifier 'com.kodowa.LightTable' - defaults write $FULL_PLIST CFBundleName 'LightTable' + FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" + defaults write $FULL_PLIST CFBundleShortVersionString $VERSION mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app @@ -98,6 +93,8 @@ if [ "$OS" == "mac" ]; then elif [ "$OS" == "linux" ]; then + cp $PLATFORM_DIR/LightTable $RELEASE_DIR/ + mv $RELEASE_DIR/atom $RELEASE_DIR/LightTable elif [ "$OS" == "windows" ]; then From 7bfb2f65427182294c4582bb6bf1234daa193791 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 2 Jan 2015 11:58:21 -0500 Subject: [PATCH 416/656] Revert back to older atom-shell where remote-debugging works This allows console to work again. In b5b1c142b6d92d3f254c93aa43432230d4d31e14 we upgraded to an atom-shell where remote-debugging /json doesn't seem to work. Details at atom/atom-shell#969 --- shell/Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index a52342462..87cc0dd19 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.20.3", + version: "0.19.5", outputDir: "./atom-shell", rebuild: true } From eb526db55c5bf0e0fb81b08d0fdb00f2faef3108 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 3 Jan 2015 13:33:32 -0500 Subject: [PATCH 417/656] Updating atom-shell app works Removed unused exec-path and mac-resources-path --- src/lt/objs/deploy.cljs | 56 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 17b3543cd..d6d9745e2 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -29,8 +29,8 @@ (defn tar-path [v] (if (cache/fetch :edge) - (str "http://temp2.kodowa.com.s3.amazonaws.com/playground/releases/" v ".tar.gz") - (str "https://d35ac8ww5dfjyg.cloudfront.net/playground/releases/" v ".tar.gz"))) + (str "https://api.github.com/repos/LightTable/LightTable/tarball/master") + (str "https://api.github.com/repos/LightTable/LightTable/tarball/" v))) (def version-regex #"^\d+\.\d+\.\d+(-.*)?$") @@ -67,12 +67,6 @@ (defn is-newer? [v1 v2] (compare-versions (str->version v1) (str->version v2))) -(defn exec-path [] - (.-execPath js/process)) - -(defn mac-resources-path [p] - (.resolve fs-path (exec-path) (files/join "../../../../../Resources" p))) - (defn download-file [from to cb] (let [options (js-obj "url" from "headers" (js-obj "User-Agent" "Light Table")) @@ -84,8 +78,8 @@ (defn download-zip [ver cb] (let [n (notifos/working (str "Downloading version " ver " .."))] (download-file (tar-path ver) (str home-path "/tmp.tar.gz") (fn [e r body] - (notifos/done-working) - (cb e r body))))) + (notifos/done-working) + (cb e r body))))) (defn untar [from to cb] (let [t (.createReadStream fs from)] @@ -95,8 +89,9 @@ (on "end" cb)))) (defn move-tmp [] - (doseq [file (files/full-path-ls (str home-path "/tmp/"))] - (.cp shell "-rf" file home-path)) + (let [parent-dir (first (files/full-path-ls (str home-path "/tmp/")))] + (doseq [file (files/full-path-ls (str parent-dir "/deploy/"))] + (.cp shell "-rf" file home-path))) (.rm shell "-rf" (str home-path "/tmp*"))) (defn fetch-and-deploy [ver] @@ -112,10 +107,7 @@ restart to get the latest and greatest.") :buttons [{:label "ok"}]})))))) -(defn version-url [] - (if (cache/fetch :edge) - "http://app.kodowa.com/latest-version/nw-edge" - "http://app.kodowa.com/latest-version/nw")) +(def tags-url "https://api.github.com/repos/LightTable/LightTable/tags") (defn should-update-popup [data] (popup/popup! {:header "There's a newer version of Light Table!" @@ -125,20 +117,28 @@ :action (fn [] (fetch-and-deploy data))}]})) +(defn ->latest-version [body] + (->> (js/JSON.parse body) + ;; Ensure only version tags + (keep #(when (re-find version-regex (.-name %)) (.-name %))) + sort + last)) + (defn check-version [& [notify?]] - (fetch/xhr (version-url) {} + (fetch/xhr tags-url {} (fn [data] - (when (re-seq version-regex data) - (if (and (not= data "") - (not= data (:version version)) - (is-newer? (:version version) data) - (or notify? - (not= js/localStorage.fetchedVersion data))) - (do - (set! js/localStorage.fetchedVersion data) - (should-update-popup data)) - (when notify? - (notifos/set-msg! (str "At latest version: " (:version version))))))))) + (let [latest-version (->latest-version data)] + (when (re-find version-regex latest-version) + (if (and (not= latest-version "") + (not= latest-version (:version version)) + (is-newer? (:version version) latest-version) + (or notify? + (not= js/localStorage.fetchedVersion latest-version))) + (do + (set! js/localStorage.fetchedVersion latest-version) + (should-update-popup latest-version)) + (when notify? + (notifos/set-msg! (str "At latest version: " (:version version)))))))))) (defn binary-version [] (aget js/process.versions "node-webkit")) From 5d9501652ce8e036d8671151844e11d33a5221dd Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 4 Jan 2015 09:50:39 -0500 Subject: [PATCH 418/656] Update binary detection Change :nw key to :atom-shell key and remove unused fs-path, fns and setup key in version.json --- deploy/core/version.json | 2 +- src/lt/objs/deploy.cljs | 64 ++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 37 deletions(-) diff --git a/deploy/core/version.json b/deploy/core/version.json index 024b5705f..af9dbabd8 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.7.2","setup":"0.3.0","nw":"0.8.4"} \ No newline at end of file +{"version":"0.7.2","atom-shell":"0.19.5"} diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index d6d9745e2..d027deb0a 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -18,7 +18,6 @@ (def shell (load/node-module "shelljs")) (def fs (js/require "fs")) -(def fs-path (js/require "path")) (def zlib (js/require "zlib")) (def request (load/node-module "request")) (def tar (load/node-module "tar")) @@ -64,7 +63,9 @@ (= (:minor v2) (:minor v1)) (< (:patch v2) (:patch v1))))))) -(defn is-newer? [v1 v2] +(defn is-newer? + "Returns true if second version is newer/greater than first version." + [v1 v2] (compare-versions (str->version v1) (str->version v2))) (defn download-file [from to cb] @@ -117,7 +118,9 @@ :action (fn [] (fetch-and-deploy data))}]})) -(defn ->latest-version [body] +(defn ->latest-version + "Returns latest LT version for github api tags endpoint." + [body] (->> (js/JSON.parse body) ;; Ensure only version tags (keep #(when (re-find version-regex (.-name %)) (.-name %))) @@ -140,8 +143,11 @@ (when notify? (notifos/set-msg! (str "At latest version: " (:version version)))))))))) -(defn binary-version [] - (aget js/process.versions "node-webkit")) +(defn binary-version + "Binary/atom-shell version. The two versions are in sync since binaries updates + only occur with atom-shell updates." + [] + (aget js/process.versions "atom-shell")) (defui button [label & [cb]] [:div.button.right label] @@ -155,44 +161,30 @@ Light Table website so you can download the updated version." :buttons [{:label "Download latest" :action (fn [] - (.Shell.openExternal (js/require "nw.gui") "http://www.lighttable.com") - (popup/remain-open) - )}]})) - -(defn check-nw-version [obj] - (assoc obj :nw-version (is-newer? (binary-version) (:nw version)))) - -(defn notify [obj] - (let [{:keys [nw-version]} obj] - (cond - nw-version (alert-binary-update) - :else obj))) - -(defn check-all [] - (-> {} -;; (check-nw-version) -;; (notify) - )) + (platform/open-url "http://www.lighttable.com") + (popup/remain-open))}]})) ;;********************************************************* ;; Behaviors ;;********************************************************* (behavior ::check-deploy - :triggers #{:deploy} - :reaction (fn [this] - (check-all))) + :triggers #{:deploy} + :reaction (fn [this] + ;; Latest :atom-shell version changes after LT auto-updates and user restarts + (when (is-newer? (binary-version) (:atom-shell version)) + (alert-binary-update)))) (behavior ::check-version - :triggers #{:init} - :type :user - :desc "App: Automatically check for updates" - :reaction (fn [this] -;; (when-let [proxy (proxy?)] -;; (.defaults request (clj->js {:proxy proxy}))) - (when (app/first-window?) - (set! js/localStorage.fetchedVersion nil)) - (check-version) - (every version-timeout check-version))) + :triggers #{:init} + :type :user + :desc "App: Automatically check for updates" + :reaction (fn [this] + ;; (when-let [proxy (proxy?)] + ;; (.defaults request (clj->js {:proxy proxy}))) + (when (app/first-window?) + (set! js/localStorage.fetchedVersion nil)) + (check-version) + (every version-timeout check-version))) (object/tag-behaviors :app [::check-deploy]) From b96e19133d29f071b10e517b5ef9925f604d5a38 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 4 Jan 2015 15:04:43 -0500 Subject: [PATCH 419/656] Revert back to explicit window events and ipc channels Removed unused complexity of ipc/callback --- deploy/core/main.js | 69 ++++++------------------------- src/lt/objs/app.cljs | 9 +--- src/lt/objs/clients/devtools.cljs | 7 +--- src/lt/util/ipc.cljs | 30 +------------- 4 files changed, 19 insertions(+), 96 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index e4e2f98cb..a50b94b90 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -22,6 +22,16 @@ function createWindow() { windows[window.id] = window; window.focus(); + window.on("blur", function() { + window.webContents.send("app", "blur"); + }); + window.on("devtools-opened", function() { + window.webContents.send("devtools", "disconnect"); + }); + window.on("devtools-closed", function() { + window.webContents.send("devtools", "reconnect!"); + }); + windowClosing = false; window.on("close", function(e) { if (!windowClosing) { @@ -49,6 +59,9 @@ function onReady() { ipc.on("initWindow", function(event, id) { windows[id].webContents.send('cli', parsedArgs); windows[id].webContents.send('openFile', openFiles); + windows[id].on("focus", function() { + windows[id].webContents.send("app", "focus"); + }); }); ipc.on("closeWindow", function(event, id) { @@ -66,62 +79,6 @@ function onReady() { } }); - // Generic IPC callback utilities - - function win(wid) { - return wid && windows[wid]; - } - - function catargs(a, args) { - for (var i = 0; i < args.length; i++) { - a[a.length] = args[i]; - } - return a; - } - - function argify1(arg, data) { - if (arg == ":lt.util.ipc/win") { - return data.win; - } - return arg; - } - - function modulify(arg, data) { - arg = argify1(arg, data); - if (typeof arg == 'string') - arg = require(arg); - return arg; - } - - function argify(args, data) { - for (var i = 0; i < args.length; i++) { - args[i] = argify1(args[i], data); - } - return args; - } - - ipc.on(":lt.util.ipc/callback", function(e, wid, - mod, func, args, - target, method) { - if (win(wid)) { - var data = {win: win(wid)}; - mod = modulify(mod, data); - args = argify(args, data); - - args[args.length] = function() { - if (win(wid)) { - var argList = [":lt.util.ipc/callback", target, method]; - catargs(argList, arguments); - var wc = win(wid).webContents; - if (wc) { - wc.send.apply(wc, argList); - } - } - }; - mod[func].apply(mod, args); - } - }); - createWindow(); }; diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 4e80b7467..b495a0cec 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -37,8 +37,6 @@ (ipc/send "closeWindow" (window-number)) (.close win)))) -(ipc/on "app" #(object/raise app (keyword %))) - (defn refresh [] (js/window.location.reload true)) @@ -224,11 +222,8 @@ (def app (object/create ::app)) -(ipc/callback app :blur - [ipc/win :on] :blur) - -(ipc/callback app :focus - [ipc/win :on] :focus) +;; Handles events e.g. focus, blur and close +(ipc/on "app" #(object/raise app (keyword %))) (set! (.-onbeforeunload js/window) (fn [] "This will navigate the main LT window and all work will be lost, are you sure you want to do this?")) diff --git a/src/lt/objs/clients/devtools.cljs b/src/lt/objs/clients/devtools.cljs index 85e76daf7..746d68c4c 100644 --- a/src/lt/objs/clients/devtools.cljs +++ b/src/lt/objs/clients/devtools.cljs @@ -199,11 +199,8 @@ (def local (object/create ::devtools-client)) -(ipc/callback local :disconnect - [ipc/win :on] :devtools-opened) - -(ipc/callback local :reconnect! - [ipc/win :on] :devtools-closed) +;; Handle events e.g. disconnect and reconnect! +(ipc/on "devtools" #(object/raise local (keyword %))) ;;********************************************************* ;; Behaviors diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs index 4230e088e..1256af454 100644 --- a/src/lt/util/ipc.cljs +++ b/src/lt/util/ipc.cljs @@ -1,40 +1,14 @@ (ns lt.util.ipc - "Util functions for the ipc renderer - https://github.com/atom/atom-shell/blob/master/docs/api/ipc-renderer.md" - (:require [lt.object :as object] - [clojure.string :as string])) + "Util functions for the ipc renderer - https://github.com/atom/atom-shell/blob/master/docs/api/ipc-renderer.md") -(def remote (js/require "remote")) (def ipc (js/require "ipc")) -(def wid (-> remote .getCurrentWindow .-id)) - -(def win (str ::win)) (defn send "Delegates to ipc.send which asynchronously sends args to the browser process's channel." [channel & args] - (.apply (.-send ipc) ipc (-> args (conj channel) clj->js))) + (apply (.-send ipc) channel (clj->js args))) (defn on "Delegates to ipc.on which defines a callback to fire for the given channel." [channel cb] (.on ipc channel cb)) - -(defn on-with-delete [channel cb] - (js-delete (.-_events ipc) channel) - (on channel cb)) - -(on-with-delete (str ::callback) - (fn [id method & args] - (apply object/raise (object/by-id id) (keyword method) args))) - -(defn callback - "Similar to a remote module call. Sends a ::callback message which kicks off - a return ::callback message when the browser process is done. Sent message args - include the object id and behavior to trigger on the return message." - [target method func & args] - (let [[mod func] (if (coll? func) - (map name func) - (string/split (name func) "."))] - (send (str ::callback) wid - mod func (clj->js (or args [])) - (object/->id target) (name method)))) From 987cbe2a22db25c6240caa4f9424314fa073f0da Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 4 Jan 2015 15:28:07 -0500 Subject: [PATCH 420/656] Misc minor atom-shell cleanup * Remove unused package.json and atom-app and active-dialog vars * Use app for version * Remove initial-focus behavior from default since it has been deleted * Give meaningful name to shell/package.json --- deploy/core/main.js | 2 +- deploy/core/package.json | 5 ----- deploy/settings/default/default.behaviors | 1 - shell/package.json | 2 +- src/lt/objs/app.cljs | 1 - src/lt/objs/sidebar/workspace.cljs | 2 -- 6 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 deploy/core/package.json diff --git a/deploy/core/main.js b/deploy/core/main.js index a50b94b90..efac25427 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -83,7 +83,7 @@ function onReady() { }; function parseArgs() { - optimist.usage("Light Table " + packageJSON.version + "\n" + + optimist.usage("\nLight Table " + app.getVersion() + "\n" + // TODO: Use a consistent name for executables or vary executable // name per platform. $0 currently gives an unwieldy name "Usage: light [options] [path ...]\n\n"+ diff --git a/deploy/core/package.json b/deploy/core/package.json deleted file mode 100644 index dade30949..000000000 --- a/deploy/core/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "hello-app", - "version": "0.1.0", - "main": "main.js" -} diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 8c3bb55fd..95146e76f 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -23,7 +23,6 @@ [:app :lt.objs.tabs/init-sortable] [:app :lt.objs.deploy/check-version] [:app :lt.objs.style/style-on-init] - [:app :lt.objs.app/initial-focus] [:app :lt.objs.app/track-focus] [:app :lt.objs.app/blur-class] [:app :lt.objs.app/focus-class] diff --git a/shell/package.json b/shell/package.json index c5828ca23..ec0e3f28c 100644 --- a/shell/package.json +++ b/shell/package.json @@ -1,5 +1,5 @@ { - "name": "hello-atom-build", + "name": "download-atom-shell", "version": "0.1.0", "devDependencies": { "grunt": "^0.4.5", diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index b495a0cec..ea087a31d 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -10,7 +10,6 @@ (:require-macros [lt.macros :refer [behavior]])) (def remote (js/require "remote")) -(def atom-app (.require remote "app")) (def win (.getCurrentWindow remote)) (def frame (js/require "web-frame")) (def closing true) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 344180e79..f0995578a 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -15,8 +15,6 @@ [clojure.string :as string]) (:require-macros [lt.macros :refer [behavior defui]])) -(def active-dialog nil) - (defn files-and-folders [path] (let [fs (workspace/files-and-folders path)] {:files (mapv #(object/create ::workspace.file %) (:files fs)) From 41fc1905455d25365afbf4828cd9fe1a34d55250 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 5 Jan 2015 19:53:22 -0500 Subject: [PATCH 421/656] Update open to be backwards compatible for urls A number of plugins rely on platform/open to open urls - https://github.com/search?p=3&q=objs.platform+open+language%3Aclojure&ref=searchresults&type=Code&utf8=%E2%9C%93. Also couldn't use files in platform for exists check since that created a circular dependency --- src/lt/objs/platform.cljs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index 3c4a49883..58180fac4 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -5,6 +5,7 @@ (def atom-shell true) +(def fs (js/require "fs")) (def clipboard (js/require "clipboard")) (def shell (js/require "shell")) @@ -17,12 +18,17 @@ "linux" :linux "darwin" :mac)) -(defn open [path] - (.openItem shell path)) - (defn open-url [path] (.openExternal shell path)) +(defn open + "If the given path exists, open it with the desktop's default manner. + Otherwise, open it as an external protocol e.g. a url." + [path] + (if (.existsSync fs path) + (.openItem shell path) + (open-url path))) + (defn show-item [path] (.showItemInFolder shell path)) From 66f03d5e3279a4dd4ffaf6a1422422a014748d6b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 5 Jan 2015 20:07:05 -0500 Subject: [PATCH 422/656] Upgrade to latest atom-shell now that atom/atom-shell#969 is fixed --- shell/Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 87cc0dd19..983260383 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.19.5", + version: "0.20.4", outputDir: "./atom-shell", rebuild: true } From 2b0e9086927f5870966b9937efbf1c0e6ae47d95 Mon Sep 17 00:00:00 2001 From: Joshua Cole Date: Thu, 8 Jan 2015 13:52:49 -0800 Subject: [PATCH 423/656] Makes inline result address more specific to fix #1213 LightTable/Clojure#32 --- src/lt/objs/eval.cljs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 5896d80f5..8858b3919 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -303,13 +303,14 @@ (let [ed (:ed @this) type (or (:type opts) :inline) line (ed/line-handle ed (:line loc)) + ch (:ch loc) res-obj (object/create ::inline-result {:ed this :class (name type) :opts opts :result res :loc loc :line line})] - (when-let [prev (get (@this :widgets) [line type])] + (when-let [prev (get (@this :widgets) [line ch type])] (when (:open @prev) (object/merge! res-obj {:open true})) (object/raise prev :clear!)) @@ -317,7 +318,7 @@ (doseq [widget (map #(get (@this :widgets) [(ed/line-handle ed %) type]) (range (:start-line loc) (:line loc))) :when widget] (object/raise widget :clear!))) - (object/update! this [:widgets] assoc [line type] res-obj)))) + (object/update! this [:widgets] assoc [line ch type] res-obj)))) ;;**************************************************** ;; underline result @@ -478,8 +479,10 @@ :desc "Eval: Clear inline results" :exec (fn [] (when-let [ed (pool/last-active)] - (doseq [[_ w] (:widgets @ed)] - (object/raise w :clear!))))}) + (let [widgets (:widgets @ed)] + (object/merge! ed {:widgets {}}) + (doseq [[_ w] widgets] + (object/raise w :clear!)))))}) (cmd/command {:command :eval-editor :desc "Eval: Eval editor contents" From 7975b2bc282fbcc4f6a495303c02caa699ced1d9 Mon Sep 17 00:00:00 2001 From: Jakub Fojtl Date: Sat, 10 Jan 2015 01:57:51 +0100 Subject: [PATCH 424/656] #1788 Added keybinding of F11 to fullscreen --- deploy/settings/default/default.keymap | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 7e7b33c96..c46a4177d 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -9,6 +9,7 @@ [:app "pmeta-o" :navigate-workspace-transient] [:app "pmeta-shift-=" :window.zoom-in] [:app "pmeta-r" :refresh-connected-browser] + [:app "f11" :window.fullscreen] [:browser "pmeta-l" :browser.url-bar.focus] From cf8b5650034d403974022e76eb96b7f3d387f92d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 11 Jan 2015 14:00:53 -0500 Subject: [PATCH 425/656] Update build script to work with ubuntu 64 bit * No longer need old linux build script * Revert to copying full atom project into release dir since that approach is OS agnostic * Copy over atom-shell license with ours * Remove unnecessary pwd since the cd at the top ensures paths are correct * Renamed atom executable to LightTable and cli to light to be consistent with osx --- linux_deps.sh | 36 -------------------------- platform/linux64/{LightTable => light} | 15 ++--------- script/build-app.sh | 12 +++++---- 3 files changed, 9 insertions(+), 54 deletions(-) delete mode 100755 linux_deps.sh rename platform/linux64/{LightTable => light} (68%) mode change 100644 => 100755 diff --git a/linux_deps.sh b/linux_deps.sh deleted file mode 100755 index b99c530fa..000000000 --- a/linux_deps.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# Check if lein is installed -lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } -if [ "$(echo `lein version` | grep 'Leiningen 1.\|2.0')" ]; then - echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; -fi - -which curl &> /dev/null -if [ $? -ne 0 ]; then - echo "Please install curl before running this." - exit -fi - -echo "### Fetching binaries ###" -BITS="" -if [ $(getconf LONG_BIT) == "64" ]; then BITS="64"; fi -TARBALL=LightTableLinux$BITS.tar.gz -curl -O https://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/$TARBALL -tar -xzf $TARBALL -rm $TARBALL -cp -ar deploy/* LightTable -rm -rf deploy -mv LightTable deploy - -echo "### Building cljs ###" -lein cljsbuild clean && lein cljsbuild once - -echo "### Fetching clojure plugin ###" -cd deploy/plugins -rm -rf clojure -git clone https://github.com/LightTable/Clojure.git clojure - -echo "### Building clojure plugin ###" -cd clojure -./build.sh diff --git a/platform/linux64/LightTable b/platform/linux64/light old mode 100644 new mode 100755 similarity index 68% rename from platform/linux64/LightTable rename to platform/linux64/light index e9884365d..8aa92255d --- a/platform/linux64/LightTable +++ b/platform/linux64/light @@ -1,6 +1,6 @@ #!/usr/bin/env bash -BIN=ltbin +BIN=LightTable HERE=`dirname $(readlink -f $0)` LIBUDEV_0=libudev.so.0 @@ -30,15 +30,4 @@ add_udev_symlinks() { add_udev_symlinks -ARGS="$@" - -CORRECTED=${ARGS//-/} -CORRECTED=${CORRECTED// /} - -if [ -t 0 ] && [ $# != 0 ]; then - #We're in a terminal... - LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN "dir=`pwd`$CORRECTED" & -else - #We were double clicked - LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN & -fi +LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN --dir=`pwd` "$@" & diff --git a/script/build-app.sh b/script/build-app.sh index cadb7d16a..01aca0962 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -26,9 +26,9 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then EXE="atom" RESOURCES="resources" if [ $(getconf LONG_BIT) == "64" ]; then - PLATFORM_DIR="platform/linux" - else PLATFORM_DIR="platform/linux64" + else + PLATFORM_DIR="platform/linux" fi elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then @@ -55,7 +55,7 @@ BUILDS=builds RELEASE="$NAME-$VERSION-$OS" RELEASE_DIR="$BUILDS/$RELEASE" RELEASE_ZIP="$BUILDS/${RELEASE}.zip" -RELEASE_RSRC="$(pwd)/$RELEASE_DIR/$RESOURCES" +RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" rm -rf $RELEASE_DIR $RELEASE_ZIP @@ -65,7 +65,9 @@ rm -rf $RELEASE_DIR $RELEASE_ZIP echo "Creating $RELEASE_DIR ..." mkdir -p $RELEASE_DIR -cp -R $ATOM_DIR/Atom.app $RELEASE_DIR/ +cp -R $ATOM_DIR/* $RELEASE_DIR +rm -f $RELEASE_DIR/version +cp LICENSE.md $RELEASE_DIR/LICENSE mkdir $RELEASE_RSRC/app cp -R deploy/core $RELEASE_RSRC/app/ @@ -93,7 +95,7 @@ if [ "$OS" == "mac" ]; then elif [ "$OS" == "linux" ]; then - cp $PLATFORM_DIR/LightTable $RELEASE_DIR/ + cp $PLATFORM_DIR/light $RELEASE_DIR/ mv $RELEASE_DIR/atom $RELEASE_DIR/LightTable From 5781bd9dc991a9fd40477ab9d034a74bec3def48 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 11 Jan 2015 14:09:43 -0500 Subject: [PATCH 426/656] Combine 32 + 64 bit linux commandline scripts Reduce need to maintain two scripts and two linux downloads. Move 32/64 bit detection to script since it only varies by $FOLDERS. --- platform/linux/LightTable | 44 ------------------------------- platform/{linux64 => linux}/light | 10 ++++--- script/build-app.sh | 6 +---- 3 files changed, 8 insertions(+), 52 deletions(-) delete mode 100644 platform/linux/LightTable rename platform/{linux64 => linux}/light (63%) diff --git a/platform/linux/LightTable b/platform/linux/LightTable deleted file mode 100644 index 095b3978f..000000000 --- a/platform/linux/LightTable +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -BIN=ltbin -HERE=`dirname $(readlink -f $0)` - -LIBUDEV_0=libudev.so.0 -LIBUDEV_1=libudev.so.1 - -add_udev_symlinks() { - # 32-bit specific; look for libudev.so.0, and if that can't be - # found link it to libudev.so.1 - FOLDERS="/lib /lib/i386-linux-gnu /usr/lib /usr/lib/i386-linux-gnu" - - for folder in $FOLDERS; do - if [ -f "${folder}/${LIBUDEV_0}" ]; then - return 0 - fi - done - - for folder in $FOLDERS; do - if [ -f "${folder}/${LIBUDEV_1}" ]; then - ln -snf "${folder}/${LIBUDEV_1}" "${HERE}/${LIBUDEV_0}" - return 0 - fi - done - - echo "${LIBUDEV_0} or ${LIBUDEV_1} not found in any of ${FOLDERS}". - exit 1 -} - -add_udev_symlinks - -ARGS="$@" - -CORRECTED=${ARGS//-/} -CORRECTED=${CORRECTED// /} - -if [ -t 0 ] && [ $# != 0 ]; then - #We're in a terminal... - LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN "dir=`pwd`$CORRECTED" & -else - #We were double clicked - LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN & -fi diff --git a/platform/linux64/light b/platform/linux/light similarity index 63% rename from platform/linux64/light rename to platform/linux/light index 8aa92255d..9ae32229e 100755 --- a/platform/linux64/light +++ b/platform/linux/light @@ -7,9 +7,13 @@ LIBUDEV_0=libudev.so.0 LIBUDEV_1=libudev.so.1 add_udev_symlinks() { - # 64-bit specific; look for libudev.so.0, and if that can't be - # found link it to libudev.so.1 - FOLDERS="/lib64 /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib64 /usr/lib /lib" + # look for libudev.so.0, and if that can't be found link it to libudev.so.1 + # detect 64-bit or default to 32-bit + if [ $(getconf LONG_BIT) == "64" ]; then + FOLDERS="/lib64 /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib64 /usr/lib /lib" + else + FOLDERS="/lib /lib/i386-linux-gnu /usr/lib /usr/lib/i386-linux-gnu" + fi for folder in $FOLDERS; do if [ -f "${folder}/${LIBUDEV_0}" ]; then diff --git a/script/build-app.sh b/script/build-app.sh index 01aca0962..290ff269a 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -25,11 +25,7 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then OS="linux" EXE="atom" RESOURCES="resources" - if [ $(getconf LONG_BIT) == "64" ]; then - PLATFORM_DIR="platform/linux64" - else - PLATFORM_DIR="platform/linux" - fi + PLATFORM_DIR="platform/linux" elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then OS="windows" From b7e533bd6eab06f98ea22864ef0e73bbe617e89b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 12 Jan 2015 05:39:39 -0800 Subject: [PATCH 427/656] build script works in windows 7 cygwin Added a workaround for #1025 cljsbuild bug. We'll probably still need to copy bootstrap.js.* from another env for a release. Also removed winresourcer since it doesn't update resource file correctly. --- script/build-app.sh | 8 +------- script/build.sh | 5 +++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 290ff269a..74baa4816 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -27,7 +27,7 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then RESOURCES="resources" PLATFORM_DIR="platform/linux" -elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then +elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then OS="windows" EXE="atom.exe" RESOURCES="resources" @@ -97,12 +97,6 @@ elif [ "$OS" == "linux" ]; then elif [ "$OS" == "windows" ]; then - winresourcer --operation=Update \ - --exeFile=$RELEASE_DIR/atom.exe \ - --resourceType=Icongroup \ - --resourceName:1 \ - --resourceFile:$RELEASE_RSRC/app/core/img/lticon.png - mv $RELEASE_DIR/atom.exe $RELEASE_DIR/LightTable.exe fi diff --git a/script/build.sh b/script/build.sh index 8404e89be..daa4bde15 100755 --- a/script/build.sh +++ b/script/build.sh @@ -26,6 +26,11 @@ pushd shell popd # Build the core cljs + +# Workaround for #1025 windows bug +if [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then + sed -i 's/:source-map/;;:source-map/' project.clj +fi lein cljsbuild clean && lein cljsbuild once # Fetch plugins From b1b6a3b247d7dd4061404d383a21eca06cdf9055 Mon Sep 17 00:00:00 2001 From: Steven Cordwell Date: Tue, 13 Jan 2015 14:53:32 +1300 Subject: [PATCH 428/656] Add reStructuredText file type --- deploy/settings/default/default.behaviors | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 154205df6..d91ebd9d6 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -303,6 +303,7 @@ {:exts [:r], :mime "text/x-rsrc", :tags [:editor.r], :name "R"} {:exts [:rb], :mime "text/x-ruby", :tags [:editor.ruby], :name "Ruby"} {:exts [:rs], :mime "text/x-rustsrc", :tags [:editor.rust], :name "Rust"} + {:exts [:rst], :mime "text/x-rst", :tags [:editor.restructuredtext], :name "reStructuredText"} {:exts [:sass], :mime "text/x-sass", :tags [:editor.sass], :name "Sass"} {:exts [:scala], :mime "text/x-scala", :tags [:editor.scala], :name "Scala"} {:exts [:ss :scm :sch], :mime "text/x-scheme", :tags [:editor.scheme], :name "Scheme"} From 34266c2e2bf273d6cd5dd4854743146b96b5864b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 15 Jan 2015 19:01:45 -0500 Subject: [PATCH 429/656] Global vars instead of load-order dependent channels for fix Fix opening files on linux. cli ipc message (:init stage) doesn't arrive by the time :open-on-args (:post-init stage) is called. Rather than cobble an even more feeble solution, fetch the necessary :open-on-args browser vars as soon as a window is defined with remote's API. --- deploy/core/main.js | 13 ++++++------- src/lt/objs/cli.cljs | 15 +++++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index efac25427..20a85f8b7 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -10,10 +10,10 @@ var app = require('app'), // Module to control application life. // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the javascript object is GCed. var windows = {}; -var openFiles = []; // Track files for open-file event +global.browserOpenFiles = []; // Track files for open-file event var packageJSON = require(__dirname + '/../package.json'); -var parsedArgs, windowClosing; // vars used by multiple functions +var windowClosing; // vars used by multiple functions function createWindow() { var browserWindowOptions = packageJSON.browserWindowOptions; @@ -57,8 +57,7 @@ function onReady() { }); ipc.on("initWindow", function(event, id) { - windows[id].webContents.send('cli', parsedArgs); - windows[id].webContents.send('openFile', openFiles); + // Moving this to createWindow() causes js loading issues windows[id].on("focus", function() { windows[id].webContents.send("app", "focus"); }); @@ -91,9 +90,9 @@ function parseArgs() { "Files can take a line number e.g. file:line."); optimist.alias('h', 'help').boolean('h').describe('h', 'Print help'); optimist.alias('a', 'add').boolean('a').describe('a', 'Add path(s) to workspace'); - parsedArgs = optimist.parse(process.argv); + global.browserParsedArgs = optimist.parse(process.argv); - if (parsedArgs.help) { + if (global.browserParsedArgs.help) { optimist.showHelp(); process.exit(0); } @@ -123,7 +122,7 @@ function start() { }); } else { - openFiles.push(path); + global.browserOpenFiles.push(path); } }); parseArgs(); diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 242257a14..822023940 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -10,6 +10,8 @@ [lt.objs.opener :as opener]) (:require-macros [lt.macros :refer [behavior]])) +(def remote (js/require "remote")) + (defn open-paths [path-line-pairs add?] (doseq [[path line] path-line-pairs :when (not= path (.-execPath js/process))] @@ -32,13 +34,14 @@ (not (empty? path)) (not (is-lt-binary? path)))) -(def parsed-args "Map of commandline options parsed by optimist. :_ contains non-option args." nil) +(def parsed-args "Map of commandline options parsed by optimist" + (js->clj (.getGlobal remote "browserParsedArgs") :keywordize-keys true)) -(ipc/on "cli" #(set! parsed-args (js->clj % :keywordize-keys true))) +(def open-files "Files to open from a file manager" + (js->clj (.getGlobal remote "browserOpenFiles"))) -(def open-files "Files to open from a file manager" nil) +(def argv "Arguments used to start LightTable" (js->clj (.-argv (.-process remote)))) -(ipc/on "openFile" #(set! open-files (js->clj %))) (ipc/on "openFileAfterStartup" #(object/raise app/app :open! %)) (defn args @@ -46,7 +49,7 @@ since subsequent windows don't open path arguments." [] (and (app/first-window?) - (or (seq (filter valid-path? (:_ parsed-args))) + (or (seq (filter valid-path? argv)) (seq open-files)))) ;;********************************************************* @@ -60,7 +63,7 @@ (when (app/first-window?) (let [path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] [(files/resolve (:dir parsed-args) path) line]) - (filter valid-path? (:_ parsed-args))) + (filter valid-path? argv)) paths (map first path-line-pairs) open-dir? (some files/dir? paths)] (when open-dir? From 4bc6b32491f29821a1acc846a3474755c020a434 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 16 Jan 2015 12:16:00 -0500 Subject: [PATCH 430/656] Fix being unable to open file from cygwin terminal Passing --pwd=`pwd` doesn't work in cygwin but reading process.cwd works correctly in all platforms. Also removed unused pwd vars --- platform/linux/light | 2 +- platform/mac/light | 2 +- src/lt/objs/cli.cljs | 2 +- src/lt/objs/files.cljs | 2 +- src/lt/objs/proc.cljs | 1 - src/lt/objs/thread.cljs | 2 +- src/lt/util/load.cljs | 2 -- 7 files changed, 5 insertions(+), 8 deletions(-) diff --git a/platform/linux/light b/platform/linux/light index 9ae32229e..989515e20 100755 --- a/platform/linux/light +++ b/platform/linux/light @@ -34,4 +34,4 @@ add_udev_symlinks() { add_udev_symlinks -LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN --dir=`pwd` "$@" & +LD_LIBRARY_PATH="$HERE:$LD_LIBRARY_PATH" $HERE/$BIN "$@" & diff --git a/platform/mac/light b/platform/mac/light index c263c8277..fc32f4aca 100755 --- a/platform/mac/light +++ b/platform/mac/light @@ -19,4 +19,4 @@ then exit 1 fi -LTCLI=true "${APP_DIR}/LightTable.app/Contents/MacOS/Atom" --dir=`pwd` "$@" & +LTCLI=true "${APP_DIR}/LightTable.app/Contents/MacOS/Atom" "$@" & diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 822023940..0889178ae 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -62,7 +62,7 @@ :reaction (fn [this] (when (app/first-window?) (let [path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] - [(files/resolve (:dir parsed-args) path) line]) + [(files/resolve files/cwd path) line]) (filter valid-path? argv)) paths (map first path-line-pairs) open-dir? (some files/dir? paths)] diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 45d7b3e95..292ed4072 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -57,7 +57,7 @@ (def line-ending (.-EOL os)) (def separator (.-sep fpath)) (def available-drives #{}) -(def pwd (.resolve fpath ".")) +(def cwd "Directory process is started in" (js/process.cwd)) (when (= separator "\\") (.exec (js/require "child_process") "wmic logicaldisk get name" diff --git a/src/lt/objs/proc.cljs b/src/lt/objs/proc.cljs index bc38ed0f4..1fe44e935 100644 --- a/src/lt/objs/proc.cljs +++ b/src/lt/objs/proc.cljs @@ -11,7 +11,6 @@ (def shell (load/node-module "shelljs")) (def spawn (.-spawn (js/require "child_process"))) -(def cur-path (.pwd shell)) (def custom-env (atom {})) (def procs (atom #{})) diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index 54d5450bb..ebd271087 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -69,7 +69,7 @@ (clj->js {:execPath js/process.execPath :silent true :env {"ATOM_SHELL_INTERNAL_RUN_AS_NODE" 1} - :cwd files/pwd}))] + :cwd files/cwd}))] (.on (.-stdout worker) "data" (fn [data] (console/loc-log {:file "thread" :line "stdout" diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 3a71514af..382002e1f 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -4,8 +4,6 @@ (def fpath (js/require "path")) (def fs (js/require "fs")) -(def pwd (.resolve fpath ".")) - (def dir (str js/__dirname "/..")) (def ^:dynamic *force-reload* false) From 57a3b8e63cc1766cbaa72be24e48c3ce519d7e0e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 16 Jan 2015 13:32:40 -0500 Subject: [PATCH 431/656] Update dev instructions and tweak build packaging Switched from zip to .tar.gz to drop from ~120 GB to ~50GB. Also removed obsolete window script --- doc/developer-install.md | 67 ++++++++++++++++------------------------ script/build-app.sh | 10 +++--- windows_deps.sh | 29 ----------------- 3 files changed, 31 insertions(+), 75 deletions(-) delete mode 100755 windows_deps.sh diff --git a/doc/developer-install.md b/doc/developer-install.md index f4f766e8b..9f0d67019 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -7,54 +7,39 @@ First install or update [leiningen](http://leiningen.org/). 3. Set it to be an executable (chmod a+x ~/bin/lein). 4. Run the Lein script (eg. "./lein" or "sh lein") without quotes. -You can check your package manager. However, be sure you get version 2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). +You can also install it with your package manager but be sure to get version +2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). -Then we have to do some juggling (unless you fancy building node-webkit from source). +Then install [node and npm](http://nodejs.org/download/). Be sure you can +globally install npm packages without sudo. For OSX, this means using homebrew to install node. -On OS X: +# Build -``` bash -git clone https://github.com/LightTable/LightTable.git -cd LightTable -sh osx_deps.sh -export LT_HOME=$(pwd)/deploy -./deploy/light -``` - -On Linux: +To build LightTable from scratch on OSX, Windows Cygwin or Linux: -``` bash -git clone https://github.com/LightTable/LightTable.git -cd LightTable -bash linux_deps.sh -./deploy/LightTable +```bash +$ git clone https://github.com/LightTable/LightTable.git +$ cd LightTable +# Creates a directory in builds/ +$ script/build.sh ``` -On Windows (using Cygwin) (note: this may trigger [issue 1025](https://github.com/LightTable/LightTable/issues/1025)): - -``` bash -git clone https://github.com/LightTable/LightTable.git -cd LightTable -bash windows_deps.sh -chmod -R u+rwx deploy/ -./deploy/LightTable -``` +This will take a few minutes the first time as atom-shell and plugins are downloaded. Subsequent invocations are faster. +To override the output directory, specify `$VERSION` e.g. `VERSION=0.8.1-pre script/build.sh`. -On Windows (manual): +On subsequent builds, use `script/build-app.sh` for quicker builds that don't require updating plugins or atom-shell. +If any ClojureScript files change, you must run `lein cljsbuild once`. On Windows, you may need to comment out the :source-map +line before compiling ClojureScript to get around [issue 1025](https://github.com/LightTable/LightTable/issues/1025). -1. Clone the repo https://github.com/LightTable/LightTable.git -2. Download http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/LightTableWin.zip -3. Unzip LightTableWin.zip -4. Copy the following files from the zip into the cloned repo at LightTable/deploy/ - - ffmpegsumo.dll - - icudt.dll - - libEGL.dll - - libGLESv2.dll - - LightTable.exe - - nw.pak -5. You can also either copy the plugins/ folder over too or git clone the ones you want to modify down from github. You'll want at least the Clojure plugin and the Rainbow plugin. -6. Double click LightTable.exe +# Usage -# Building +Once you've built LightTable, run it in one of the following ways: -After the initial setup, you can compile the ClojureScript source at any time with `lein cljsbuild once`. +* OSX + * As a commandline executable: `builds/lighttable-0.8.0-mac/light` + * As an application: `open -a $PWD/builds/lighttable-0.8.0-mac/LightTable.app` +* Linux + * As a commandline executable: `builds/lighttable-0.8.0-linux/light` + * As an application: `builds/lighttable-0.8.0-linux/LightTable` +* Windows + * As an application: `builds/lighttable-0.8.0-windows/LightTable.exe` diff --git a/script/build-app.sh b/script/build-app.sh index 74baa4816..8cc0eea85 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -50,10 +50,10 @@ DEFAULT_VERSION=`echo $META | cut -d' ' -f3 | tr -d '"'` BUILDS=builds RELEASE="$NAME-$VERSION-$OS" RELEASE_DIR="$BUILDS/$RELEASE" -RELEASE_ZIP="$BUILDS/${RELEASE}.zip" +RELEASE_TARBALL="$BUILDS/${RELEASE}.tar.gz" RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" -rm -rf $RELEASE_DIR $RELEASE_ZIP +rm -rf $RELEASE_DIR $RELEASE_TARBALL #---------------------------------------------------------------------- # Copy Atom installation and app directory into output location @@ -102,11 +102,11 @@ elif [ "$OS" == "windows" ]; then fi #---------------------------------------------------------------------- -# Create zip +# Create tarball #---------------------------------------------------------------------- -if [ "$1" == "-z" ]; then - zip -r $RELEASE_ZIP $RELEASE_DIR +if [ "$1" == "--tarball" ]; then + tar -zcvf $RELEASE_TARBALL $RELEASE_DIR fi echo DONE! diff --git a/windows_deps.sh b/windows_deps.sh deleted file mode 100755 index e596c6f5d..000000000 --- a/windows_deps.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# Check if lein is installed -lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } -if [ "$(echo `lein version` | grep 'Leiningen 1.\|2.0')" ]; then - echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; -fi - -ZIPFILE=LightTableWin.zip -echo "### Fetching binaries ###" -curl -O http://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.0/$ZIPFILE -unzip $ZIPFILE -rm $ZIPFILE -cp -ar deploy/* LightTable -rm -rf deploy -mv LightTable deploy -chmod u+rwx deploy - -echo "### Building cljs ###" -lein cljsbuild clean && lein cljsbuild once - -echo "### Fetching clojure plugin ###" -cd deploy/plugins -rm -rf clojure -git clone https://github.com/LightTable/Clojure.git clojure - -echo "### Building clojure plugin ###" -cd clojure -./build.sh From 9e3747048892648503320c149ad65f8358600d8c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 24 Jan 2015 11:42:39 -0500 Subject: [PATCH 432/656] Add behavior to use CM rulers - close #892 --- src/lt/objs/editor.cljs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index aa6d86972..f7acd066b 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -715,3 +715,15 @@ (object/call-behavior-reaction :lt.objs.plugins/load-css this (filter #(= (files/ext %) "css") paths))))) + +(behavior ::set-rulers + :triggers #{:object.instant} + :type :user + :desc "Editor: Set CodeMirror rulers" + :params [{:label "Vector of rulers" + :example "[{:color \"#cfc\" :column 100 :lineStyle \"dashed\"}]"}] + :reaction (fn [this rulers] + (when-not (.getOption (->cm-ed this) "rulers") + (load/js "core/node_modules/codemirror/addon/display/rulers.js" :sync)) + (let [rulers (or rulers [{:lineStyle "dashed" :color "#aff" :column 80}])] + (set-options this {:rulers (clj->js rulers)})))) From c8e07230385b55b3552569e3317f27c5a100a836 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 25 Jan 2015 11:04:02 -0800 Subject: [PATCH 433/656] Fix closing window on Windows Unlike other OS's Windows fires blur event after window is closed. This commit applies same fix as 45b767 but only for Windows. --- deploy/core/main.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 20a85f8b7..53c3f1cbd 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -22,9 +22,16 @@ function createWindow() { windows[window.id] = window; window.focus(); - window.on("blur", function() { - window.webContents.send("app", "blur"); - }); + if (process.platform == 'win32') { + window.on("blur", function() { + if (window.webContents) + window.webContents.send("app", "blur"); + }); + } else { + window.on("blur", function() { + window.webContents.send("app", "blur"); + }); + } window.on("devtools-opened", function() { window.webContents.send("devtools", "disconnect"); }); From 9658450e3b2a9d61c706d42056656347708e9bab Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 25 Jan 2015 14:44:08 -0500 Subject: [PATCH 434/656] Clean up window closing Revert most of dffbc93 as closeWindow channel doesn't do anything that wasn't already being done - calling window.close. Close and force close work across all platforms --- deploy/core/main.js | 18 ------------------ src/lt/objs/app.cljs | 4 +--- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 53c3f1cbd..c0ed0d81b 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -13,7 +13,6 @@ var windows = {}; global.browserOpenFiles = []; // Track files for open-file event var packageJSON = require(__dirname + '/../package.json'); -var windowClosing; // vars used by multiple functions function createWindow() { var browserWindowOptions = packageJSON.browserWindowOptions; @@ -39,14 +38,6 @@ function createWindow() { window.webContents.send("devtools", "reconnect!"); }); - windowClosing = false; - window.on("close", function(e) { - if (!windowClosing) { - e.preventDefault(); - window.webContents.send("app", "close!"); - } - }); - // and load the index.html of the app. window.loadUrl('file://' + __dirname + '/LightTable.html?id=' + window.id); @@ -70,15 +61,6 @@ function onReady() { }); }); - ipc.on("closeWindow", function(event, id) { - // This feels like a bad hack - windowClosing = true; - if(id && windows[id]) { - windows[id].close(); - } - windowClosing = false; - }); - ipc.on("toggleDevTools", function(event, windowId) { if(windowId && windows[windowId]) { windows[windowId].toggleDevTools(); diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index ea087a31d..d8dc9645b 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -32,9 +32,7 @@ (when force? (object/raise app :closing) (object/raise app :closed)) - (if force? - (ipc/send "closeWindow" (window-number)) - (.close win)))) + (.close win))) (defn refresh [] (js/window.location.reload true)) From 2fddc440b5c0629e0f7e12ee3897fa8da2aa6d58 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 25 Jan 2015 15:18:26 -0500 Subject: [PATCH 435/656] Cleanup old nw gitignores Also add full path to appropriate ignores --- .gitignore | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 447ef3539..3a36a8926 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,10 @@ -cljs/ -target/ -deploy/settings/user/* -deploy/settings/default.clj -deploy/plugins/ -deploy/plugins -deploy/node-webkit* -deploy/core/cache -deploy/logs +/deploy/core/node_modules/lighttable/cljs/ +/target/ +/deploy/plugins/ .DS_Store -deploy/core/node_modules/lighttable/bootstrap.js* +/deploy/core/node_modules/lighttable/bootstrap.js* .lein-deps-sum .lein-env .lein-plugins/ -*.so -deploy/LightTable -deploy/LightTable.app -deploy/credits.html -deploy/ltbin -deploy/nw.pak -deploy/light .nrepl-port -/node_modules/ /builds/ From 08c35e1a4b46077b8b21b99372bfd12c696b74b1 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 27 Jan 2015 16:37:45 -0800 Subject: [PATCH 436/656] Move run.sh to light.sh and support multiple platforms deploy arg is relative for cygwin --- deploy/run.sh | 12 ------------ doc/developer-install.md | 4 ++++ script/light.sh | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 12 deletions(-) delete mode 100755 deploy/run.sh create mode 100755 script/light.sh diff --git a/deploy/run.sh b/deploy/run.sh deleted file mode 100755 index e2b3392eb..000000000 --- a/deploy/run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /usr/bin/env bash -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -pushd "${DIR}/../shell" - npm install -g grunt-cli - npm install - grunt download-atom-shell -popd - -"${DIR}/../shell/atom-shell/Atom.app/Contents/MacOS/Atom" $DIR --dir=`pwd` "$@" diff --git a/doc/developer-install.md b/doc/developer-install.md index 9f0d67019..39db218b2 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -43,3 +43,7 @@ Once you've built LightTable, run it in one of the following ways: * As an application: `builds/lighttable-0.8.0-linux/LightTable` * Windows * As an application: `builds/lighttable-0.8.0-windows/LightTable.exe` + +You can also run LightTable with `script/light.sh`. This script allows you to +skip running `script/build-app.sh`. While it's useful as a dev convenience, +final changes should be QAed with a fresh build from `script/build-app.sh`. diff --git a/script/light.sh b/script/light.sh new file mode 100755 index 000000000..4cff8eafc --- /dev/null +++ b/script/light.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -e + +# Opens current LightTable without needing to build it. +# Assumes script/build.sh has been run at least once + +# Ensure we start in project root +cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. +DIR=$(pwd) + +if [ "$(uname)" == "Darwin" ]; then + CLI="${DIR}/shell/atom-shell/Atom.app/Contents/MacOS/Atom" +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + CLI="${DIR}/shell/atom-shell/atom" +elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then + CLI="${DIR}/shell/atom-shell/atom.exe" +else + echo "Cannot detect a supported OS." + exit 1 +fi + +$CLI deploy "$@" From e0b10b1275ab029c2371ab7be22b17f1d25a9ec3 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 27 Jan 2015 20:04:27 -0500 Subject: [PATCH 437/656] Update build script to install grunt-cli locally Ubuntu didn't allow global npm installs without sudo. Wasn't an issue for cygwin or osx and homebrew. --- doc/developer-install.md | 3 +-- script/build.sh | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index 39db218b2..2ed38be07 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -10,8 +10,7 @@ First install or update [leiningen](http://leiningen.org/). You can also install it with your package manager but be sure to get version 2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). -Then install [node and npm](http://nodejs.org/download/). Be sure you can -globally install npm packages without sudo. For OSX, this means using homebrew to install node. +Then install [node and npm](http://nodejs.org/download/). # Build diff --git a/script/build.sh b/script/build.sh index daa4bde15..72a555cd9 100755 --- a/script/build.sh +++ b/script/build.sh @@ -20,9 +20,9 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. # Ensure we have current version of atom-shell pushd shell - npm install -g grunt-cli + npm install grunt-cli npm install - grunt download-atom-shell + node_modules/.bin/grunt download-atom-shell popd # Build the core cljs From 616bebe72e33987d064fcf036e96d82f698c6a0c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 27 Jan 2015 19:21:02 -0800 Subject: [PATCH 438/656] expr substr isn't valid on osx - close #1838 --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 72a555cd9..526402a45 100755 --- a/script/build.sh +++ b/script/build.sh @@ -28,7 +28,7 @@ popd # Build the core cljs # Workaround for #1025 windows bug -if [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then +if [ "$(echo $(uname -s) | cut -c 1-9)" == "CYGWIN_NT" ]; then sed -i 's/:source-map/;;:source-map/' project.clj fi lein cljsbuild clean && lein cljsbuild once From 65712c12cf6fef26dd2960ca9da90352025bd698 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 28 Jan 2015 17:13:56 -0500 Subject: [PATCH 439/656] Fix subtle cli bugs * Opening files from file manager doesn't initialize the same as cli files. Merging opening behaviors back to one behavior fixes this. * Certain path names can't be recognized as cli args e.g. deploy. Changing arg filtering to pick off first 1 or 2 executables fixes this. --- deploy/settings/default/default.behaviors | 1 - script/light.sh | 2 +- src/lt/objs/cli.cljs | 37 +++++++---------------- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 95146e76f..ee071588d 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -15,7 +15,6 @@ [:app :lt.objs.cli/open-on-args] [:app :lt.objs.editor.pool/init-syntax-selector] [:app :lt.objs.cli/open!] - [:app :lt.objs.cli/open-after-startup!] [:app :lt.objs.thread/shutdown-worker-on-close] [:app :lt.objs.animations/animate-on-init] [:app :lt.objs.app/store-position-on-close] diff --git a/script/light.sh b/script/light.sh index 4cff8eafc..c88c6eac0 100755 --- a/script/light.sh +++ b/script/light.sh @@ -19,4 +19,4 @@ else exit 1 fi -$CLI deploy "$@" +LT_DEV_CLI=true $CLI deploy "$@" diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 0889178ae..39276b145 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -26,14 +26,6 @@ (object/raise workspace/current-ws :add.file! path)))) (object/raise opener/opener :new! path)))) -(defn is-lt-binary? [path] - (#{"ltbin" "Atom" "deploy" "LightTable.exe" "LightTable"} (string/trim (files/basename path)))) - -(defn valid-path? [path] - (and (string? path) - (not (empty? path)) - (not (is-lt-binary? path)))) - (def parsed-args "Map of commandline options parsed by optimist" (js->clj (.getGlobal remote "browserParsedArgs") :keywordize-keys true)) @@ -45,11 +37,11 @@ (ipc/on "openFileAfterStartup" #(object/raise app/app :open! %)) (defn args - "Returns truthy if LT opened with any path arguments. Only returns truthy on first window - since subsequent windows don't open path arguments." + "Returns path arguments passed to executable or nil if none given. Only returns + on first window since subsequent windows don't open path arguments." [] (and (app/first-window?) - (or (seq (filter valid-path? argv)) + (or (seq (if js/process.env.LT_DEV_CLI (subvec argv 2) (rest argv))) (seq open-files)))) ;;********************************************************* @@ -58,26 +50,19 @@ (behavior ::open-on-args :triggers #{:post-init} - :desc "App: Process commandline arguments" + :desc "App: Process commandline or file manager arguments" :reaction (fn [this] (when (app/first-window?) (let [path-line-pairs (map #(let [[_ path line] (re-find #"^(.*?):?(\d+)?$" %)] - [(files/resolve files/cwd path) line]) - (filter valid-path? argv)) - paths (map first path-line-pairs) - open-dir? (some files/dir? paths)] - (when open-dir? - (object/merge! workspace/current-ws {:initialized? true})) - (open-paths path-line-pairs (:add parsed-args)))))) + [(files/resolve files/cwd path) line]) + (args)) + paths (map first path-line-pairs) + open-dir? (some files/dir? paths)] + (when open-dir? + (object/merge! workspace/current-ws {:initialized? true})) + (open-paths path-line-pairs (:add parsed-args)))))) (behavior ::open! - :triggers #{:post-init} - :desc "App: Open path(s) from a file manager e.g. Finder on startup" - :reaction (fn [this] - (when (app/first-window?) - (open-paths (map vector open-files) (:add parsed-args))))) - -(behavior ::open-after-startup! :triggers #{:open!} :desc "App: Open path(s) from a file manager after startup" :reaction (fn [this path] From 8fe4641ca3e8e8595de4a264bffe8b4d9cae576d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 28 Jan 2015 22:48:02 -0800 Subject: [PATCH 440/656] Fix css injection-eval filename escaping. --- src/lt/objs/clients/local.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/clients/local.cljs b/src/lt/objs/clients/local.cljs index 9b1b09f75..b649f8d22 100644 --- a/src/lt/objs/clients/local.cljs +++ b/src/lt/objs/clients/local.cljs @@ -42,7 +42,7 @@ (object/raise clients/clients :message [cb :editor.eval.js.exception {:ex e :meta (:meta data)}]))))) (defmethod on-message :editor.eval.css [_ data cb] - (let [name (string/replace (str "local-" (:name data)) #"\." "-") + (let [name (str "local-" (string/replace (:name data) #"[^a-zA-Z0-9]+" "-")) cur ($ (str "#" name))] (when cur (remove cur)) From 4a2aa2e033abd7b1869ae8de74c3da482c67d861 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 30 Jan 2015 11:10:51 -0500 Subject: [PATCH 441/656] Add credits to readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 5f9999aea..214459048 100755 --- a/README.md +++ b/README.md @@ -32,3 +32,8 @@ In order to develop for Light Table, you will need to [install a developer versi ## License All files in this project are under the [LICENSE.md](LICENSE.md) license unless otherwise stated in the file or by a dependency's license file. + +## Credits + +Big thanks to all our [contributors](https://github.com/LightTable/LightTable/graphs/contributors)! +Thanks of course to Kodowa for all they have done for Light Table and also to Cognitect for providing friday contributions for one of the core team members. From 0f372b062e277091a35e3d515b7a31e5d22fc7de Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 30 Jan 2015 16:20:22 -0500 Subject: [PATCH 442/656] Open workspace if one of the args is a directory #1830 --- src/lt/objs/cli.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 39276b145..61c82110e 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -59,7 +59,8 @@ paths (map first path-line-pairs) open-dir? (some files/dir? paths)] (when open-dir? - (object/merge! workspace/current-ws {:initialized? true})) + (object/merge! workspace/current-ws {:initialized? true}) + (cmd/exec! :workspace.show)) (open-paths path-line-pairs (:add parsed-args)))))) (behavior ::open! From 2b5e26f6818309f03f44955322e25c2162aa9e9f Mon Sep 17 00:00:00 2001 From: snufkon Date: Sat, 31 Jan 2015 17:24:34 +0900 Subject: [PATCH 443/656] fix a bug of :editor.force.wrap command --- src/lt/objs/editor/pool.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index f0d1726af..a7dc6deee 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -581,8 +581,14 @@ :exec (fn [] (when-let [ed (last-active)] (if (editor/option ed "lineWrapping") - (object/add-tags ed [:editor.force.unwrap]) - (object/add-tags ed [:editor.force.wrap]))))}) + (do + (object/remove-tags ed [:editor.force.wrap]) + (object/add-tags ed [:editor.force.unwrap]) + (notifos/set-msg! "Wrapping off" {:timeout 2000})) + (do + (object/remove-tags ed [:editor.force.unwrap]) + (object/add-tags ed [:editor.force.wrap]) + (notifos/set-msg! "Wrapping on" {:timeout 2000})))))}) (cmd/command {:command :editor.undo :desc "Editor: Undo" From 44fffd0cc969eebc993aa7eb3fb6aa3bec9e4645 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Feb 2015 16:06:20 -0500 Subject: [PATCH 444/656] Fix modifier references for OSX in doc close #1850 --- doc/workflow.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/workflow.md b/doc/workflow.md index cd09f12b5..0ec254f17 100644 --- a/doc/workflow.md +++ b/doc/workflow.md @@ -1,12 +1,12 @@ # Workflow -I'll assume you already know how to eval code (ctrl-enter), how to open the command bar (ctrl-space) and how to open files with the navigator (ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). +I'll assume you already know how to eval code (Cmd/Ctrl-enter), how to open the command bar (Ctrl-space) and how to open files with the navigator (Cmd/Ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). -Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. +Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (Cmd/Ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. -The new Light Table release supports auto-complete (tab), inline docs (ctrl-d) and jump-to-definition (ctrl-. to jump and ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. +The new Light Table release supports auto-complete (Tab), inline docs (Ctrl-d) and jump-to-definition (Ctrl-. to jump and Ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. -For hunting down behaviors, objects and other things that don't live in vars use the searcher (ctrl-shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. +For hunting down behaviors, objects and other things that don't live in vars use the searcher (Cmd/Ctrl-Shift-f). If it isn't clear how to use a given function then using the searcher to find examples will also help. -Finally, use the documentation searcher (ctrl-shift-d) for full-text search over the names and docstrings of all known vars. Most of Light Table doesn't have docstrings, but this is still useful for library code. +Finally, use the documentation searcher (Ctrl-Shift-d) for full-text search over the names and docstrings of all known vars. Most of Light Table doesn't have docstrings, but this is still useful for library code. From 28c65099c90a6ebc7816a8010f0c941d1ad553cc Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sun, 8 Feb 2015 18:37:37 -0800 Subject: [PATCH 445/656] get webview eval working Signed-off-by: Chris Granger --- .../lighttable/browserInjection.js | 110 +++++++++ deploy/settings/default/default.behaviors | 8 +- src/lt/objs/app.cljs | 3 + src/lt/objs/browser.cljs | 219 +++++++----------- src/lt/objs/clients/devtools.cljs | 79 +++---- 5 files changed, 238 insertions(+), 181 deletions(-) create mode 100644 deploy/core/node_modules/lighttable/browserInjection.js diff --git a/deploy/core/node_modules/lighttable/browserInjection.js b/deploy/core/node_modules/lighttable/browserInjection.js new file mode 100644 index 000000000..8a831ae91 --- /dev/null +++ b/deploy/core/node_modules/lighttable/browserInjection.js @@ -0,0 +1,110 @@ +(function(window) { + + var ipc = require("ipc"); + + function toArray(arrayLike) { + var final = []; + for(var i = 0, len = arrayLike.length; i < len; i++) { + final.push(arrayLike.item(i)); + } + return final; + } + + ipc.on("editor.eval.css", function(args) { + var nodeName = args.name.replace(/\./, "-"); + var code = args.code; + var styleElem = document.createElement("style"); + styleElem.type = "text/css" + styleElem.id = nodeName; + styleElem.innerHTML = code; + var prev = document.querySelector(nodeName); + if(prev) { + prev.parentNode.removeChild(prev); + } else { + var link = toArray(document.head.querySelectorAll("link")).filter(function(cur) { + return cur.href.indexOf(args.name) > -1; + }); + if(link[0]) { + link[0].parentNode.removeChild(link); + } + } + document.head.appendChild(styleElem); + }); + + + ipc.on("editor.eval.cljs.exec", function(args) { + for(var i = 0; i < args.results.length; i++) { + var data = args.results[i]; + var meta = args.results[i].meta; + meta.verbatim = true; + try { + var res = eval.call(window, args.results[i].code); + if(window.cljs) { + ipc.sendToHost("browser-raise", [args.client, "editor.eval.cljs.result", {result: cljs.core.pr_str(res), meta: meta}]); + } else { + ipc.sendToHost("browser-raise", [args.client, "editor.eval.cljs.result", {result: safeStringify(res), meta: meta}]); + } + } catch (e) { + var exdata = cljs.core.ex_data(e); + var error = ""; + if (exdata) { + error = e.message + ": " + cljs.core.pr_str(exdata); + } else { + error = cljs.core.pr_str(e); + } + + if(e.stack) { + error += "\n" + e.stack; + } + ipc.sendToHost("browser-raise", [args.client, "editor.eval.cljs.exception", {ex: error, meta: meta}]); + } + } + }); + + window.addEventListener("hashchange", function(e) { + ipc.sendToHost("browser-event", ["hashchange", {href: window.location.href, hash: window.location.hash}]); + }); + + function replacer(key, value) { + if(window.jQuery && value instanceof jQuery) { + return "[jQuery $(" + value.selector + ")]"; + } + if(value instanceof Element) { + return "[Element " + value.tagName.toLowerCase() + (value.id != "" ? "#" : "") + value.id + "]"; + } + if(value instanceof Array) { + return value; + } + if(typeof(value) == "object") { + if(cache.indexOf(value) > -1) { + return "circular"; + } + cache.push(value); + return value; + } + if(typeof value == "function") { + return "[function]"; + } + return value; + } + + function safeStringify(res) { + cache = []; + return JSON.stringify(res, replacer); + } + + window.lttools = { + watch: function(exp, meta) { + if(meta.ev == "editor.eval.cljs.watch") { + var final = cljs.core.pr_str(exp); + } else { + meta["no-inspect"] = true; + var final = safeStringify(exp); + } + ipc.sendToHost("browser-raise", [meta.obj, meta.ev, {result: final, meta: meta}]); + return exp; + } + } + + +})(window); \ No newline at end of file diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index ee071588d..76f835cc2 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -105,18 +105,16 @@ [:browser :lt.objs.browser/focus-on-show] [:browser :lt.objs.browser/set-client-name] [:browser :lt.objs.browser/rem-client] - [:browser :lt.objs.browser/store-history] [:browser :lt.objs.browser/refresh!] [:browser :lt.objs.browser/set-active] [:browser :lt.objs.browser/navigate!] [:browser :lt.objs.browser/active-context] [:browser :lt.objs.browser/inactive-context] - [:browser :lt.objs.browser/window-load-click-handler] - [:browser :lt.objs.browser/window-load-key-handler] - [:browser :lt.objs.browser/window-load-lttools] - [:browser :lt.objs.browser/menu!] + [:browser :lt.objs.browser/update-devtools-client-url] + [:browser :lt.objs.menu/menu!] [:browser :lt.objs.browser/menu+] [:browser :lt.objs.browser/back!] + [:browser :lt.objs.browser/handle-hash-change] [:client :lt.objs.clients/on-connect-drain] [:client :lt.objs.clients/queue!] diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index d8dc9645b..c92950802 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -15,6 +15,9 @@ (def closing true) (def default-zoom 1) +(defn app-url [] + (.-location.href js/window)) + (defn window-number [] (.-id win)) diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 0bd63b1c9..6f9b27ca7 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -24,8 +24,6 @@ (def utils (js-obj)) (set! js/lttools utils) -(def no-history-sites #{"data:text/html,chromewebdata"}) - (defn check-http [url] (if (and (= (.indexOf url "http") -1) (= (.indexOf url "file://") -1)) @@ -41,12 +39,15 @@ (defn to-frame [this] (dom/$ :webview (object/->content this))) +(defn client->devtools [ed] + (-> @ed (:frame) (deref) (:devtools-client))) + (defn handle-cb [cbid command data] (object/raise clients/clients :message [cbid command data])) (defn connect-client [this] - (clients/handle-connection! {:name (:urlvalue @this) + (clients/handle-connection! {:name (:url @this) :frame this :frame-id (browser-id this) :tags [:frame.client] @@ -64,7 +65,7 @@ browser)) (defui url-bar [this] - [:input.url-bar {:type "text" :placeholder "url" :value (bound this :urlvalue)}] + [:input.url-bar {:type "text" :placeholder "url" :value (bound this :url)}] :focus (fn [] (ctx/in! :browser.url-bar this) (object/raise this :active)) @@ -87,8 +88,12 @@ :click (fn [] (object/raise this :refresh!))) -(defui iframe [this] - [:webview {:src (bound (subatom this :url)) :id (browser-id this)}] + + +(defui webview [this] + [:webview {:src (bound (subatom this :url)) + :id (browser-id this) + :preload (files/lt-home "core/node_modules/lighttable/browserInjection.js")}] :focus (fn [] (object/raise this :active)) :blur (fn [] @@ -101,15 +106,14 @@ (object/object* ::browser :name "browser" :tags #{:browser} - :history [] - :history-pos -1 :url "about:blank" - :urlvalue "about:blank" :init (fn [this] - (object/merge! this {:client (connect-client this)}) + (object/merge! this {:client (connect-client this) + :devtools-client (object/create :lt.objs.clients.devtools/devtools-client (:url @this))}) + (object/raise (:devtools-client @this) :reconnect!) [:div#browser [:div.frame-shade] - (iframe this) + (webview this) [:nav (backward this) (forward this) @@ -143,23 +147,7 @@ (let [bar (dom/$ :input (object/->content this)) url (check-http (or n (dom/val bar)))] (notifos/working) - (object/merge! this {:url url :urlvalue url :loading-counter (inc (:loading-counter @this 0))})))) - -(behavior ::store-history - :triggers #{:navigate} - :reaction (fn [this loc] - (when (and - (not (no-history-sites loc)) - (not= loc (-> (:history @this) - (get (:history-pos @this))))) - (if-not (= (dec (count (:history @this))) - (:history-pos @this)) - ;;clear forward - (object/merge! this {:history (-> (subvec (:history @this) 0 (inc (:history-pos @this))) - (conj loc))}) - (object/update! this [:history] conj loc) - ) - (object/update! this [:history-pos] inc)))) + (object/merge! this {:url url :loading-counter (inc (:loading-counter @this 0))})))) (behavior ::url-focus! :triggers #{:url.focus!} @@ -217,11 +205,11 @@ {:label "copy" :order 3 :click (fn [e] - (.document.execCommand (to-frame this) "copy"))} + (.copy (to-frame this)))} {:label "paste" :order 4 :click (fn [e] - (.document.execCommand (to-frame this) "paste") + (.paste (to-frame this)) )} ) @@ -230,74 +218,51 @@ )) -;; (behavior ::window-load-click-handler -;; :triggers #{:window.loaded} -;; :reaction (fn [this window loc] -;; (.document.addEventListener window "blur" -;; (fn [e] -;; (object/raise this :inactive e))) -;; (.document.addEventListener window "contextmenu" -;; (fn [e] -;; (when-not (.-defaultPrevented e) -;; (object/raise this :menu! e)))) -;; (.document.addEventListener window "click" -;; (fn [e] -;; (object/raise this :active) -;; (when (and -;; (= (.-target.nodeName e) "A") -;; (or (and (platform/mac?) (.-metaKey e)) -;; (.-ctrlKey e))) -;; (.preventDefault e) -;; (.stopPropagation e) -;; (cmd/exec! :add-browser-tab (.-target.href e)))) -;; ))) - -;; (behavior ::window-load-key-handler -;; :triggers #{:window.loaded} -;; :reaction (fn [this window loc] -;; (let [script (.document.createElement window "script")] -;; (set! (.-type script) "text/javascript") -;; (set! (.-innerHTML script) (:content (files/open-sync "core/node_modules/lighttable/util/keyevents.js"))) -;; (.document.head.appendChild window script) -;; (aset (aget window "Mousetrap") "handleKey" -;; (fn [key char e] -;; (when (keyboard/capture key char e) -;; (dom/prevent e) -;; (dom/stop-propagation e)))) -;; ))) - -;; (behavior ::window-load-lttools -;; :triggers #{:window.loaded} -;; :reaction (fn [this window loc] -;; (set! (.-lttools window) utils))) (behavior ::init! - :triggers #{:init} - :reaction (fn [this] - (let [frame (dom/$ :iframe (object/->content this)) - bar (dom/$ :input (object/->content this))] -;; (set! (.-onload frame) (fn [] -;; (let [loc (.-contentWindow.location.href frame)] -;; (object/raise this :window.loaded (.-contentWindow frame) loc) -;; (set! (.-contentWindow.onhashchange frame) (fn [] -;; (dom/val bar (.-contentWindow.location.href frame)))) -;; (devtools/clear-scripts!) -;; (dom/val bar loc) -;; (object/raise this :navigate loc)))) - ))) - -;; (behavior ::set-client-name -;; :triggers #{:navigate} -;; :reaction (fn [this loc] -;; (let [title (.-document.title (to-frame this)) -;; title (if-not (empty? title) -;; title -;; "browser")] -;; (object/merge! this {:name title}) -;; (tabs/refresh! this) -;; (dotimes [x (:loading-counter @this)] -;; (notifos/done-working)) -;; (object/merge! (:client @this) {:name loc})))) + :triggers #{:init} + :reaction (fn [this] + (let [frame (dom/$ :webview (object/->content this)) + bar (dom/$ :input (object/->content this))] + (.addEventListener frame "ipc-message" (fn [e arg] + (let [args (aget (.-args e) 0)] + (condp = (.-channel e) + "browser-event" (object/raise this (keyword (aget args 0)) (aget args 1)) + "browser-raise" (object/raise (object/by-id (aget args 0)) + (keyword (aget args 1)) + (js->clj (aget args 2) :keywordize-keys true)) + )))) + (.addEventListener frame "contextmenu" (fn [e] + (object/raise this :menu! e))) + (.addEventListener frame "did-finish-load" (fn [] + (let [loc (.getUrl frame)] + (devtools/clear-scripts! (:devtools-client @this)) + (dom/val bar loc) + (object/raise this :navigate loc)) + ))))) + +(behavior ::handle-hash-change + :triggers #{:hashchange} + :reaction (fn [this info] + (dom/val (dom/$ :input (object/->content this)) (.-href info)))) + +(behavior ::set-client-name + :triggers #{:navigate} + :reaction (fn [this loc] + (let [title (.getTitle (to-frame this)) + title (if-not (empty? title) + title + "browser")] + (object/merge! this {:name title}) + (tabs/refresh! this) + (dotimes [x (:loading-counter @this)] + (notifos/done-working)) + (object/merge! (:client @this) {:name loc})))) + +(behavior ::update-devtools-client-url + :triggers #{:navigate} + :reaction (fn [this loc] + (object/merge! (:devtools-client @this) {:url loc}))) (behavior ::set-active :triggers #{:active :show} @@ -354,10 +319,10 @@ (when-let [ed (clients/cb->obj (:cb msg))] (let [data (:data msg) data (assoc data :code (str (:code data) "\n\n//# sourceURL=" (:path data)))] - (devtools/eval-in-frame (:frame-id @this) data (fn [res] - (when cb (cb)) - ;;TODO: check for exception, otherwise, assume success - (object/raise ed :editor.eval.js.file.success))))))) + (devtools/eval-in-webview-client (client->devtools this) data (fn [res] + (when cb (cb)) + ;;TODO: check for exception, otherwise, assume success + (object/raise ed :editor.eval.js.file.success))))))) (behavior ::html-eval :triggers #{:editor.eval.html!} @@ -368,46 +333,30 @@ :triggers #{:editor.eval.css!} :reaction (fn [this msg] (let [info (:data msg) - frame (to-frame (:frame @this)) - node-name (string/replace (:name info) #"\." "-") - node (.document.querySelector frame (str "#" node-name)) - neue (crate/html [:style {:type "text/css" :id node-name} (:code info)])] - (if node - (do - (dom/remove node) - (dom/append (.-document.head frame) neue)) - (let [links (.document.querySelectorAll frame "link") - node (first (filter #(> (.indexOf (dom/attr % :href) (:name info)) -1) (dom/lazy-nl-via-item links)))] - (when node - (dom/remove node)) - (dom/append (.-document.head frame) neue)))))) + frame (to-frame (:frame @this))] + (.send frame "editor.eval.css" #js {:name (:name info) + :code (:code info)}) + ))) (behavior ::cljs-exec :triggers #{:editor.eval.cljs.exec!} :reaction (fn [this msg] - (let [frame-id (:frame-id @this) - frame (to-frame frame-id) - window (devtools/get-frame-window frame-id) + (let [frame (to-frame (:frame @this)) info (:data msg)] - (doseq [form (:results info)] - (try - ;;TODO: this is a hack for bad compiler output. We need to just move to the latest cljs - (handle-cb (:cb msg) :editor.eval.cljs.result {:result (pr-str (.eval.call window window (string/replace (:code form) ")goog" ")\ngoog"))) - :meta (merge (:meta msg) (:meta form))}) - (catch :default e - (handle-cb (:cb msg) :editor.eval.cljs.exception {:ex e - :meta (merge (:meta msg) (:meta form))}))))))) + (.send frame "editor.eval.cljs.exec" #js {:results (clj->js (:results info)) + :client (:cb msg)})))) (defn eval-js-form [this msg] - (let [data (assoc (:data msg) :code (eval/append-source-file (-> msg :data :code) (-> msg :data :path)))] - (devtools/eval-in-frame (:frame-id @this) data - (fn [res] - (let [result (devtools/inspector->result res) - req (:data msg) - result (assoc result :meta (:meta req) :no-inspect true)] - (if-not (:ex result) - (handle-cb (:cb msg) :editor.eval.js.result result) - (handle-cb (:cb msg) :editor.eval.js.exception result))))) + (let [data (assoc (:data msg) :code (eval/append-source-file (-> msg :data :code) (-> msg :data :path))) + devtools-client (client->devtools this)] + (devtools/eval-in-webview-client devtools-client data + (fn [res] + (let [result (devtools/inspector->result devtools-client res) + req (:data msg) + result (assoc result :meta (:meta req) :no-inspect true)] + (if-not (:ex result) + (handle-cb (:cb msg) :editor.eval.js.result result) + (handle-cb (:cb msg) :editor.eval.js.exception result))))) (object/raise this :editor.eval.js.change-live! msg))) (defn must-eval-file? [msg] @@ -424,8 +373,8 @@ (when-let [ed (object/by-id (:cb msg))] (let [data (:data msg) data (assoc data :code (str (editor/->val ed) "\n\n//# sourceURL=" (-> data :path)))] - (devtools/eval-in-frame (:frame-id @this) data (fn [res] - (eval-js-form this msg))))) + (devtools/eval-in-webview-client (client->devtools this) data (fn [res] + (eval-js-form this msg))))) (eval-js-form this msg)))) ;;********************************************************* diff --git a/src/lt/objs/clients/devtools.cljs b/src/lt/objs/clients/devtools.cljs index 746d68c4c..2477be830 100644 --- a/src/lt/objs/clients/devtools.cljs +++ b/src/lt/objs/clients/devtools.cljs @@ -25,14 +25,13 @@ (defn next-id [] (swap! id inc)) -(defn find-debugger-url [info] - (let [win (app/window-number) - search (if (= win 0) - #(= (.indexOf (:url %) "id") -1) - #(> (.indexOf (:url %) (str "id=" win)) -1))] - (-> (filter search info) - (first) - (:webSocketDebuggerUrl)))) +(defn find-debugger-info [info url] + (-> + (filter (fn [cur] + (and (= (:url cur) url) + (:webSocketDebuggerUrl cur))) + info) + (first))) (defn socket [this url] (let [sock (js/WebSocket. url)] @@ -70,13 +69,13 @@ (empty? val)) "null" :else (:value v)))) -(defn msg->log [m] +(defn msg->log [this m] (let [params (:parameters m)] (for [p params] (do [:span.log-val (cond (and (= (:type p) "object") (:value p) (not (-> p :value :value))) "null" - (= (:type p) "object") (object/->content (object/create ::inspector-object local {:value p})) + (= (:type p) "object") (object/->content (object/create ::inspector-object this {:value p})) :else (:value p (:text p)))])))) (defn msg->string [m] @@ -102,13 +101,13 @@ "anonymous" (:functionName f))]]) -(defmulti handle-log-msg :level) +(defmulti handle-log-msg #(:level %2)) (defn valid-error? [text] (let [text (.toLowerCase text)] (every? #(= -1 (.indexOf text %)) ["failed to load resource: http://app.kodowa.com"]))) -(defmethod handle-log-msg "error" [msg] +(defmethod handle-log-msg "error" [this msg] (when (valid-error? (str (:text msg) ": " (:url msg))) (let [top (first (:stackTrace msg))] (console/verbatim [:div [:h3 (:text msg) @@ -121,24 +120,24 @@ "error" (error->string msg)) ))) -(defmethod handle-log-msg "log" [msg] +(defmethod handle-log-msg "log" [this msg] (let [stack (first (filter #(not= (files/basename (:url %)) "bootstrap.js") (-> msg :stackTrace))) stack (if-not stack (first (-> msg :stackTrace)) stack)] (console/loc-log {:file (files/basename (:url stack)) :line (:lineNumber stack) - :content (msg->log msg) + :content (msg->log this msg) :str-content (msg->string msg)}))) -(defmethod handle-log-msg "warning" [msg] +(defmethod handle-log-msg "warning" [this msg] (console/loc-log {:file (files/basename (:url msg)) :line (:line msg) :class "warning" :content (:text msg) :str-content (:text msg)})) -(defmethod handle-log-msg :default [msg] +(defmethod handle-log-msg :default [this msg] (console/loc-log {:file (files/basename (:url msg)) :line (:line msg) :content (:text msg) @@ -150,26 +149,20 @@ (string/replace "\n" "\\n") (string/replace "'" "\\'"))) -(defn get-frame-window [frame-id] - (let [frame (aget js/window.frames frame-id)] - (or (.-window frame) (.-contentWindow frame)))) - -(set! (.-frameWindow js/window) get-frame-window) - -(defn eval-in-frame [frame-id msg cb] - (send local {:id (next-id) :method "Runtime.evaluate" :params {:expression (str "window.frameWindow('" frame-id "').eval('" (-> msg :code extra-escape) "')")}} +(defn eval-in-webview-client [webview-client msg cb] + (send webview-client {:id (next-id) :method "Runtime.evaluate" :params {:expression (-> msg :code)}} cb)) -(defn clear-scripts! [] - (object/merge! local {:scripts {}})) +(defn clear-scripts! [this] + (object/merge! this {:scripts {}})) (defn find-script [client path] (let [found? (-> (@client :scripts) (get (files/basename path)))] found?)) -(defn script-exists? [id cb] - (send local {:id (next-id) :method "Debugger.canSetScriptSource" :params {:scriptId id}} +(defn script-exists? [this id cb] + (send this {:id (next-id) :method "Debugger.canSetScriptSource" :params {:scriptId id}} (fn [res] (cb (-> res :result :result))))) @@ -178,16 +171,16 @@ (object/update! client [:scripts (files/basename path)] dissoc k))) (defn changelive! [obj path code cb else] - (if-let [s (find-script local path)] + (if-let [s (find-script obj path)] (let [id (-> s vals first :scriptId)] - (script-exists? id + (script-exists? obj id (fn [exists?] (if-not exists? - (do (remove-script! local path id) (changelive! obj path code cb)) + (do (remove-script! obj path id) (changelive! obj path code cb)) (do (object/merge! obj {:script-id id}) ;;TODO: handle multiples - (send local {:id (next-id) :method "Debugger.setScriptSource" :params {:scriptId id :scriptSource code}} + (send obj {:id (next-id) :method "Debugger.setScriptSource" :params {:scriptId id :scriptSource code}} cb)))))) (else))) ;;********************************************************* @@ -195,9 +188,12 @@ ;;********************************************************* (object/object* ::devtools-client - :tags #{:clients.devtools}) + :tags #{:clients.devtools} + :init (fn [this url] + (object/merge! this {:url url}) + nil)) -(def local (object/create ::devtools-client)) +(def local (object/create ::devtools-client (app/app-url))) ;; Handle events e.g. disconnect and reconnect! (ipc/on "devtools" #(object/raise local (keyword %))) @@ -210,9 +206,9 @@ :triggers #{:connect!} :reaction (fn [this url] (object/merge! this {:socket (socket this url)}) - (send local {:id (next-id) :method "Console.enable"}) - (send local {:id (next-id) :method "Debugger.enable"}) - (send local {:id (next-id) :method "Network.setCacheDisabled" :params {:cacheDisabled true}}))) + (send this {:id (next-id) :method "Console.enable"}) + (send this {:id (next-id) :method "Debugger.enable"}) + (send this {:id (next-id) :method "Network.setCacheDisabled" :params {:cacheDisabled true}}))) (behavior ::clear-queue-on-connect :triggers #{:connect} @@ -247,7 +243,7 @@ :triggers #{:Console.messageAdded} :reaction (fn [this m] (let [msg (-> m :params :message)] - (handle-log-msg msg)))) + (handle-log-msg this msg)))) (behavior ::clear-console :triggers #{:clear!} @@ -268,7 +264,8 @@ (fn [d] (if-let [url (-> (js/JSON.parse d) (js->clj :keywordize-keys true) - (find-debugger-url))] + (find-debugger-info (:url @this)) + (:webSocketDebuggerUrl))] (object/raise this :connect! url) (wait 1000 #(object/raise this :reconnect!))))))) @@ -325,13 +322,13 @@ "inspector-object open" "inspector-object")) -(defn inspector->result [o] +(defn inspector->result [this o] (let [res (-> o :result) data (:result res)] (if (:wasThrown res) {:ex (:description data)} {:result (condp = (:type data) - "object" (object/->content (object/create ::inspector-object local data)) + "object" (object/->content (object/create ::inspector-object this data)) (or (:description data) (pr-str (:value data))) )}))) From f91c602d43efc122016fc53db5f44a163ed3b74e Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sun, 8 Feb 2015 18:38:05 -0800 Subject: [PATCH 446/656] move to latest atom-shell Signed-off-by: Chris Granger --- shell/Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 983260383..a3ba7ed92 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.20.4", + version: "0.21.2", outputDir: "./atom-shell", rebuild: true } From a12dc47d78825897b9a7bdcfafa72525eb4949f7 Mon Sep 17 00:00:00 2001 From: alhimik45 Date: Fri, 27 Feb 2015 15:20:52 +0600 Subject: [PATCH 447/656] add file types for codemirror modes --- deploy/settings/default/default.behaviors | 52 +++++++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d91ebd9d6..e11132813 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -267,25 +267,42 @@ [:evaler :lt.objs.eval/alert-on-no-client] [:files :lt.objs.opener/save-failed] - [:files :lt.objs.files/file-types [{:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} + [:files :lt.objs.files/file-types [{:exts [:apl :dyalog], :mime "text/apl", :tags [:editor.apl], :name "APL"} + {:exts [], :mime "text/x-asterisk", :tags [:editor.asterisk], :name "Asterisk Dialplan"} + {:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} {:exts [:cpp :mm :cc], :mime "text/x-c++src", :tags [:editor.cpp], :name "C++"} {:exts [:h], :mime "text/x-c++hdr", :tags [:editor.cpph], :name "C++ Header"} - {:exts [:cs], :mime "text/x-csharpr", :tags [:editor.csharp], :name "C#"} + {:exts [:cs], :mime "text/x-csharp", :tags [:editor.csharp], :name "C#"} + {:exts [:cbl :cob], :mime "text/x-cobol", :tags [:editor.cobol], :name "COBOL"} {:exts [:coffee], :mime "text/x-coffeescript", :tags [:editor.coffee], :name "CoffeeScript"} {:exts [:cl :lisp], :mime "text/x-common-lisp", :tags [:editor.common-lisp], :name "Common Lisp"} + {:exts [:cql :cypher :cyp], :mime "application/x-cypher-query", :tags [:editor.cypher], :name "Cypher"} + {:exts [:d], :mime "text/x-d", :tags [:editor.d], :name "D"} {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} + {:exts [:djt], :mime "text/x-django", :tags [:editor.djangotemplate], :name "Django Template"} + {:exts [:dtd], :mime "application/xml-dtd", :tags [:editor.dtd], :name "DTD"} + {:exts [:dylan :dyl :intr], :mime "text/x-dylan", :tags [:editor.dylan], :name "Dylan"} + {:exts [:ecl], :mime "text/x-ecl", :tags [:editor.ecl], :name "ECL"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} + {:exts [:e], :mime "text/x-eiffel", :tags [:editor.eiffel], :name "Eiffel"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} + {:exts [:fs], :mime "text/x-fsharp", :tags [:editor.fsharp], :name "F#"} + {:exts [:f :f90 :for :f77], :mime "text/x-fortran", :tags [:editor.fortran], :name "Fortran"} + {:exts [:s :asm], :mime "text/x-gas", :tags [:editor.gas], :name "Gas"} {:exts [:feature], :mime "text/x-feature", :tags [:editor.gherkin], :name "Gherkin"} + {:exts [], :mime "text/x-gfm", :tags [:editor.gfm], :name "GitHub Flavored Markdown"} {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} {:exts [:haml], :mime "text/x-haml", :tags [:editor.haml], :name "HAML"} {:exts [:hs], :mime "text/x-haskell", :tags [:editor.haskell], :name "Haskell"} {:exts [:hx], :mime "text/x-haxe", :tags [:editor.haxe], :name "Haxe"} {:exts [:html :htm], :mime "htmlmixed", :tags [:editor.html], :name "HTML"} + {:exts [], :mime "message/http", :tags [:editor.http], :name "HTTP"} {:exts [:ini], :mime "text/x-ini", :tags [:editor.ini], :name "INI"} + {:exts [:jade], :mime "text/x-jade", :tags [:editor.jade], :name "Jade"} {:exts [:java], :mime "text/x-java", :tags [:editor.java], :name "Java"} {:exts [:jl], :mime "text/x-julia", :tags [:editor.julia], :name "Julia"} + {:exts [:kt], :mime "text/x-kotlin", :tags [:editor.kotlin], :name "Kotlin"} {:exts [:latex :tex], :mime "text/x-stex", :tags [:editor.latex], :name "LaTeX"} {:exts [:less], :mime "text/x-less", :tags [:editor.less], :name "LESS"} {:exts [:behaviors], :mime "text/x-clojurescript", :tags [:editor.behaviors], :name "Light Table Behaviors"} @@ -293,28 +310,55 @@ {:exts [:ls], :mime "text/x-livescript", :tags [:editor.livescript], :name "LiveScript"} {:exts [:lua], :mime "text/x-lua", :tags [:editor.lua], :name "Lua"} {:exts [:md :markdown], :mime "text/x-markdown", :tags [:editor.markdown], :name "Markdown"} + {:exts [], :mime "text/mirc", :tags [:editor.mirc], :name "mIRC"} + {:exts [:mo], :mime "text/x-modelica", :tags [:editor.modelica], :name "Modelica"} {:exts [], :mime "text/x-mysql", :tags [:editor.sql :editor.mysql], :name "MySQL"} + {:exts [], :mime "text/nginx", :tags [:editor.nginx], :name "Nginx"} + {:exts [:nt], :mime "text/n-triples", :tags [:editor.ntriples], :name "NTriples"} {:exts [:ocaml :ml], :mime "text/x-ocaml", :tags [:editor.ocaml], :name "OCaml"} + {:exts [:m], :mime "text/x-octave", :tags [:editor.octave], :name "Octave"} {:exts [:pas], :mime "text/x-pascal", :tags [:editor.pascal], :name "Pascal"} {:exts [:pl], :mime "text/x-perl", :tags [:editor.perl], :name "Perl"} {:exts [:php], :mime "text/x-php", :tags [:editor.php], :name "PHP"} + {:exts [:pig], :mime "text/x-pig", :tags [:editor.pig], :name "Pig Latin"} {:exts [:txt], :mime "plaintext", :tags [:editor.plaintext], :name "Plain Text"} {:exts [:py :pyw], :mime "text/x-python", :tags [:editor.python], :name "Python"} + {:exts [:pp], :mime "text/x-puppet", :tags [:editor.puppet], :name "Puppet"} + {:exts [:q], :mime "text/x-q", :tags [:editor.q], :name "Q"} {:exts [:r], :mime "text/x-rsrc", :tags [:editor.r], :name "R"} + {:exts [], :mime "text/x-rpm-changes", :tags [:editor.rpmchanges], :name "RPM Changes"} + {:exts [:spec], :mime "text/x-rpm-spec", :tags [:editor.rpmspec], :name "RPM Spec"} + {:exts [:rst], :mime "text/x-rst", :tags [:editor.restructuredtext], :name "reStructuredText"} {:exts [:rb], :mime "text/x-ruby", :tags [:editor.ruby], :name "Ruby"} {:exts [:rs], :mime "text/x-rustsrc", :tags [:editor.rust], :name "Rust"} - {:exts [:rst], :mime "text/x-rst", :tags [:editor.restructuredtext], :name "reStructuredText"} {:exts [:sass], :mime "text/x-sass", :tags [:editor.sass], :name "Sass"} {:exts [:scala], :mime "text/x-scala", :tags [:editor.scala], :name "Scala"} {:exts [:ss :scm :sch], :mime "text/x-scheme", :tags [:editor.scheme], :name "Scheme"} + {:exts [:vert :frag], :mime "x-shader/x-vertex", :tags [:editor.vertexshader], :name "Shader"} {:exts [:sh :bash :profile :bash_profile :bashrc :zsh :zshrc], :mime "text/x-sh", :tags [:editor.shell], :name "Shell"} + {:exts [:sieve :siv], :mime "application/sieve", :tags [:editor.sieve], :name "Sieve (RFC5228)"} + {:exts [:slim], :mime "application/x-slim", :tags [:editor.slim], :name "SLIM"} + {:exts [:st], :mime "text/x-stsrc", :tags [:editor.smalltalk], :name "Smalltalk"} {:exts [:smarty], :mime "text/x-smarty", :tags [:editor.smarty], :name "Smarty"} + {:exts [], :mime "text/x-solr", :tags [:editor.solr], :name "Solr"} {:exts [:sparql], :mime "text/x-sparql-query", :tags [:editor.sparql], :name "SPARQL"} {:exts [:sql], :mime "text/x-sql", :tags [:editor.sql], :name "SQL"} + {:exts [:tcl], :mime "text/x-tcl", :tags [:editor.tcl], :name "Tcl"} + {:exts [:textile], :mime "text/x-textile", :tags [:editor.textile], :name "Textile"} + {:exts [], :mime "text/x-tiddlywiki", :tags [:editor.tiddlywiki], :name "TiddlyWiki"} + {:exts [], :mime "text/tiki", :tags [:editor.tikiwiki], :name "TikiWiki"} + {:exts [:toml], :mime "text/x-toml", :tags [:editor.toml], :name "TOML"} + {:exts [], :mime "text/x-tornado", :tags [:editor.tornado], :name "Tornado Template"} + {:exts [:ttl], :mime "text/turtle", :tags [:editor.turtle], :name "Turtle"} {:exts [:ts], :mime "text/x-typescript", :tags [:editor.typescript], :name "TypeScript"} {:exts [:vb], :mime "text/x-vb", :tags [:editor.visualbasic], :name "VB"} + {:exts [:vbs], :mime "text/vbscript", :tags [:editor.vbscript], :name "VBScript"} + {:exts [:vtl], :mime "text/velocity", :tags [:editor.velocity], :name "Velocity"} + {:exts [:v], :mime "text/x-verilog", :tags [:editor.verilog], :name "Verilog"} {:exts [:xml], :mime "application/xml", :tags [:editor.xml], :name "XML"} - {:exts [:yml :yaml], :mime "text/x-yaml", :tags [:editor.yaml], :name "YAML"}]] + {:exts [:xy :xquery], :mime "application/xquery", :tags [:editor.xquery], :name "XQuery"} + {:exts [:yml :yaml], :mime "text/x-yaml", :tags [:editor.yaml], :name "YAML"} + {:exts [:z80], :mime "text/x-z80", :tags [:editor.z80], :name "Z80 Assembly"}]] [:filter-list :lt.objs.sidebar.command/select!] [:filter-list :lt.objs.sidebar.command/filter-inactive] From cc95648d4681774a7a89800e381c1c6c2f7f6d1f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 27 Feb 2015 11:40:33 -0500 Subject: [PATCH 448/656] Tweak a few file types per linguist close #1796 Add comments explaining some empty filetypes. Use linguist config https://github.com/github/linguist/blob/master/lib/linguist/languages.yml as a reference for file types --- deploy/settings/default/default.behaviors | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index e11132813..d96c3b2c4 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -268,6 +268,7 @@ [:files :lt.objs.opener/save-failed] [:files :lt.objs.files/file-types [{:exts [:apl :dyalog], :mime "text/apl", :tags [:editor.apl], :name "APL"} + ;; No extension since .conf is an overloaded extension {:exts [], :mime "text/x-asterisk", :tags [:editor.asterisk], :name "Asterisk Dialplan"} {:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} {:exts [:cpp :mm :cc], :mime "text/x-c++src", :tags [:editor.cpp], :name "C++"} @@ -279,17 +280,18 @@ {:exts [:cql :cypher :cyp], :mime "application/x-cypher-query", :tags [:editor.cypher], :name "Cypher"} {:exts [:d], :mime "text/x-d", :tags [:editor.d], :name "D"} {:exts [:diff :patch], :mime "text/x-diff", :tags [:editor.diff], :name "Diff"} - {:exts [:djt], :mime "text/x-django", :tags [:editor.djangotemplate], :name "Django Template"} + {:exts [:djt :mustache :jinja], :mime "text/x-django", :tags [:editor.djangotemplate], :name "Django Template"} {:exts [:dtd], :mime "application/xml-dtd", :tags [:editor.dtd], :name "DTD"} - {:exts [:dylan :dyl :intr], :mime "text/x-dylan", :tags [:editor.dylan], :name "Dylan"} + {:exts [:dylan :dyl :intr :lid], :mime "text/x-dylan", :tags [:editor.dylan], :name "Dylan"} {:exts [:ecl], :mime "text/x-ecl", :tags [:editor.ecl], :name "ECL"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} {:exts [:e], :mime "text/x-eiffel", :tags [:editor.eiffel], :name "Eiffel"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} - {:exts [:fs], :mime "text/x-fsharp", :tags [:editor.fsharp], :name "F#"} + {:exts [:fs :fsi :fsx], :mime "text/x-fsharp", :tags [:editor.fsharp], :name "F#"} {:exts [:f :f90 :for :f77], :mime "text/x-fortran", :tags [:editor.fortran], :name "Fortran"} - {:exts [:s :asm], :mime "text/x-gas", :tags [:editor.gas], :name "Gas"} + {:exts [:s], :mime "text/x-gas", :tags [:editor.gas], :name "Gas"} {:exts [:feature], :mime "text/x-feature", :tags [:editor.gherkin], :name "Gherkin"} + ;; No extension since it conflicts with markdown {:exts [], :mime "text/x-gfm", :tags [:editor.gfm], :name "GitHub Flavored Markdown"} {:exts [:go], :mime "text/x-go", :tags [:editor.go], :name "Go"} {:exts [:groovy], :mime "text/x-groovy", :tags [:editor.groovy], :name "Groovy"} @@ -297,7 +299,7 @@ {:exts [:hs], :mime "text/x-haskell", :tags [:editor.haskell], :name "Haskell"} {:exts [:hx], :mime "text/x-haxe", :tags [:editor.haxe], :name "Haxe"} {:exts [:html :htm], :mime "htmlmixed", :tags [:editor.html], :name "HTML"} - {:exts [], :mime "message/http", :tags [:editor.http], :name "HTTP"} + {:exts [:http], :mime "message/http", :tags [:editor.http], :name "HTTP"} {:exts [:ini], :mime "text/x-ini", :tags [:editor.ini], :name "INI"} {:exts [:jade], :mime "text/x-jade", :tags [:editor.jade], :name "Jade"} {:exts [:java], :mime "text/x-java", :tags [:editor.java], :name "Java"} @@ -310,9 +312,11 @@ {:exts [:ls], :mime "text/x-livescript", :tags [:editor.livescript], :name "LiveScript"} {:exts [:lua], :mime "text/x-lua", :tags [:editor.lua], :name "Lua"} {:exts [:md :markdown], :mime "text/x-markdown", :tags [:editor.markdown], :name "Markdown"} - {:exts [], :mime "text/mirc", :tags [:editor.mirc], :name "mIRC"} + {:exts [:mrc], :mime "text/mirc", :tags [:editor.mirc], :name "mIRC"} {:exts [:mo], :mime "text/x-modelica", :tags [:editor.modelica], :name "Modelica"} + ;; No extension since .sql is used by SQL {:exts [], :mime "text/x-mysql", :tags [:editor.sql :editor.mysql], :name "MySQL"} + ;; No extension since .conf is an overloaded extension {:exts [], :mime "text/nginx", :tags [:editor.nginx], :name "Nginx"} {:exts [:nt], :mime "text/n-triples", :tags [:editor.ntriples], :name "NTriples"} {:exts [:ocaml :ml], :mime "text/x-ocaml", :tags [:editor.ocaml], :name "OCaml"} @@ -343,6 +347,7 @@ {:exts [], :mime "text/x-solr", :tags [:editor.solr], :name "Solr"} {:exts [:sparql], :mime "text/x-sparql-query", :tags [:editor.sparql], :name "SPARQL"} {:exts [:sql], :mime "text/x-sql", :tags [:editor.sql], :name "SQL"} + {:exts [:sv], :mime "text/x-systemverilog", :tags [:editor.systemverilog], :name "System Verilog"} {:exts [:tcl], :mime "text/x-tcl", :tags [:editor.tcl], :name "Tcl"} {:exts [:textile], :mime "text/x-textile", :tags [:editor.textile], :name "Textile"} {:exts [], :mime "text/x-tiddlywiki", :tags [:editor.tiddlywiki], :name "TiddlyWiki"} From f16c1a806b9c1f7666e17718d4a1df5cd293b304 Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Sat, 28 Feb 2015 23:55:57 +0530 Subject: [PATCH 449/656] comment toggle with pmeta-/ --- deploy/settings/default/default.keymap | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index c46a4177d..24b889230 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -25,6 +25,7 @@ [:editor "pmeta-shift-enter" :eval-editor] [:editor "ctrl-=" :editor.fold-code] [:editor "pmeta-s" :save] + [:editor "pmeta-/" :toggle-comment-selection] [:editor.keys.hinting.active "enter" :passthrough] From 8e73f59891c45f73a1b985fed69795d1061a8ecf Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Thu, 5 Mar 2015 18:26:21 -0800 Subject: [PATCH 450/656] upgrade to the latest clojurescript and fix a couple warnings/build errors Signed-off-by: Chris Granger --- .../node_modules/clojurescript/cljsDeps.js | 20168 ++++++++++------ project.clj | 8 +- shell/Gruntfile.js | 2 +- src/lt/objs/browser.cljs | 10 +- src/lt/objs/editor.cljs | 2 +- src/lt/objs/eval.cljs | 1 + src/lt/objs/langs/behaviors.cljs | 1 + src/lt/objs/plugins.cljs | 4 +- src/lt/objs/sidebar/navigate.cljs | 1 + src/lt/util/load.cljs | 2 - 10 files changed, 12995 insertions(+), 7204 deletions(-) diff --git a/deploy/core/node_modules/clojurescript/cljsDeps.js b/deploy/core/node_modules/clojurescript/cljsDeps.js index 51fd9126c..e23aceb98 100644 --- a/deploy/core/node_modules/clojurescript/cljsDeps.js +++ b/deploy/core/node_modules/clojurescript/cljsDeps.js @@ -1,73 +1,97 @@ +if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) { + Math.imul = function (a, b) { + var ah = (a >>> 16) & 0xffff; + var al = a & 0xffff; + var bh = (b >>> 16) & 0xffff; + var bl = b & 0xffff; + // the shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); + } +} + + var COMPILED = !0, goog = goog || {}; goog.global = this; +goog.isDef = function(a) { + return void 0 !== a; +}; +goog.exportPath_ = function(a, b, c) { + a = a.split("."); + c = c || goog.global; + a[0] in c || !c.execScript || c.execScript("var " + a[0]); + for (var d;a.length && (d = a.shift());) { + !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {}; + } +}; +goog.define = function(a, b) { + var c = b; + COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSURE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a])); + goog.exportPath_(a, c); +}; goog.DEBUG = !0; goog.LOCALE = "en"; goog.TRUSTED_SITE = !0; +goog.STRICT_MODE_COMPATIBLE = !1; goog.provide = function(a) { - if(!COMPILED) { - if(goog.isProvided_(a)) { + if (!COMPILED) { + if (goog.isProvided_(a)) { throw Error('Namespace "' + a + '" already declared.'); } delete goog.implicitNamespaces_[a]; - for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { - goog.implicitNamespaces_[b] = !0 + for (var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { + goog.implicitNamespaces_[b] = !0; } } - goog.exportPath_(a) + goog.exportPath_(a); }; goog.setTestOnly = function(a) { - if(COMPILED && !goog.DEBUG) { - throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); + if (COMPILED && !goog.DEBUG) { + throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : ".")); } }; +goog.forwardDeclare = function(a) { +}; COMPILED || (goog.isProvided_ = function(a) { - return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a) + return!goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a)); }, goog.implicitNamespaces_ = {}); -goog.exportPath_ = function(a, b, c) { - a = a.split("."); - c = c || goog.global; - a[0] in c || !c.execScript || c.execScript("var " + a[0]); - for(var d;a.length && (d = a.shift());) { - !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {} - } -}; goog.getObjectByName = function(a, b) { - for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) { - if(goog.isDefAndNotNull(d[e])) { - d = d[e] - }else { - return null + for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) { + if (goog.isDefAndNotNull(d[e])) { + d = d[e]; + } else { + return null; } } - return d + return d; }; goog.globalize = function(a, b) { var c = b || goog.global, d; - for(d in a) { - c[d] = a[d] + for (d in a) { + c[d] = a[d]; } }; goog.addDependency = function(a, b, c) { - if(!COMPILED) { + if (goog.DEPENDENCIES_ENABLED) { var d; a = a.replace(/\\/g, "/"); - for(var e = goog.dependencies_, f = 0;d = b[f];f++) { - e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0 + for (var e = goog.dependencies_, f = 0;d = b[f];f++) { + e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0; } - for(d = 0;b = c[d];d++) { - a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0 + for (d = 0;b = c[d];d++) { + a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0; } } }; goog.ENABLE_DEBUG_LOADER = !0; goog.require = function(a) { - if(!COMPILED && !goog.isProvided_(a)) { - if(goog.ENABLE_DEBUG_LOADER) { + if (!COMPILED && !goog.isProvided_(a)) { + if (goog.ENABLE_DEBUG_LOADER) { var b = goog.getPathFromDeps_(a); - if(b) { + if (b) { goog.included_[b] = !0; goog.writeScripts_(); - return + return; } } a = "goog.require could not find: " + a; @@ -79,158 +103,159 @@ goog.basePath = ""; goog.nullFunction = function() { }; goog.identityFunction = function(a, b) { - return a + return a; }; goog.abstractMethod = function() { throw Error("unimplemented abstract method"); }; goog.addSingletonGetter = function(a) { a.getInstance = function() { - if(a.instance_) { - return a.instance_ + if (a.instance_) { + return a.instance_; } goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); - return a.instance_ = new a - } + return a.instance_ = new a; + }; }; goog.instantiatedSingletons_ = []; -!COMPILED && goog.ENABLE_DEBUG_LOADER && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { +goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; +goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { var a = goog.global.document; - return"undefined" != typeof a && "write" in a + return "undefined" != typeof a && "write" in a; }, goog.findBasePath_ = function() { - if(goog.global.CLOSURE_BASE_PATH) { - goog.basePath = goog.global.CLOSURE_BASE_PATH - }else { - if(goog.inHtmlDocument_()) { - for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { + if (goog.global.CLOSURE_BASE_PATH) { + goog.basePath = goog.global.CLOSURE_BASE_PATH; + } else { + if (goog.inHtmlDocument_()) { + for (var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; - if("base.js" == c.substr(d - 7, 7)) { + if ("base.js" == c.substr(d - 7, 7)) { goog.basePath = c.substr(0, d - 7); - break + break; } } } } }, goog.importScript_ = function(a) { var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; - !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) + !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0); }, goog.writeScriptTag_ = function(a) { - if(goog.inHtmlDocument_()) { + if (goog.inHtmlDocument_()) { var b = goog.global.document; - if("complete" == b.readyState) { - if(/\bdeps.js$/.test(a)) { - return!1 + if ("complete" == b.readyState) { + if (/\bdeps.js$/.test(a)) { + return!1; } throw Error('Cannot write "' + a + '" after document load'); } b.write('\x3cscript type\x3d"text/javascript" src\x3d"' + a + '"\x3e\x3c/script\x3e'); - return!0 + return!0; } - return!1 + return!1; }, goog.writeScripts_ = function() { function a(e) { - if(!(e in d.written)) { - if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { - for(var g in d.requires[e]) { - if(!goog.isProvided_(g)) { - if(g in d.nameToPath) { - a(d.nameToPath[g]) - }else { + if (!(e in d.written)) { + if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { + for (var g in d.requires[e]) { + if (!goog.isProvided_(g)) { + if (g in d.nameToPath) { + a(d.nameToPath[g]); + } else { throw Error("Undefined nameToPath for " + g); } } } } - e in c || (c[e] = !0, b.push(e)) + e in c || (c[e] = !0, b.push(e)); } } var b = [], c = {}, d = goog.dependencies_, e; - for(e in goog.included_) { - d.written[e] || a(e) + for (e in goog.included_) { + d.written[e] || a(e); } - for(e = 0;e < b.length;e++) { - if(b[e]) { - goog.importScript_(goog.basePath + b[e]) - }else { + for (e = 0;e < b.length;e++) { + if (b[e]) { + goog.importScript_(goog.basePath + b[e]); + } else { throw Error("Undefined script input"); } } }, goog.getPathFromDeps_ = function(a) { - return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null + return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null; }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js")); goog.typeOf = function(a) { var b = typeof a; - if("object" == b) { - if(a) { - if(a instanceof Array) { - return"array" + if ("object" == b) { + if (a) { + if (a instanceof Array) { + return "array"; } - if(a instanceof Object) { - return b + if (a instanceof Object) { + return b; } var c = Object.prototype.toString.call(a); - if("[object Window]" == c) { - return"object" + if ("[object Window]" == c) { + return "object"; } - if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { - return"array" + if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { + return "array"; } - if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { - return"function" + if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { + return "function"; } - }else { - return"null" + } else { + return "null"; } - }else { - if("function" == b && "undefined" == typeof a.call) { - return"object" + } else { + if ("function" == b && "undefined" == typeof a.call) { + return "object"; } } - return b -}; -goog.isDef = function(a) { - return void 0 !== a + return b; }; goog.isNull = function(a) { - return null === a + return null === a; }; goog.isDefAndNotNull = function(a) { - return null != a + return null != a; }; goog.isArray = function(a) { - return"array" == goog.typeOf(a) + return "array" == goog.typeOf(a); }; goog.isArrayLike = function(a) { var b = goog.typeOf(a); - return"array" == b || "object" == b && "number" == typeof a.length + return "array" == b || "object" == b && "number" == typeof a.length; }; goog.isDateLike = function(a) { - return goog.isObject(a) && "function" == typeof a.getFullYear + return goog.isObject(a) && "function" == typeof a.getFullYear; }; goog.isString = function(a) { - return"string" == typeof a + return "string" == typeof a; }; goog.isBoolean = function(a) { - return"boolean" == typeof a + return "boolean" == typeof a; }; goog.isNumber = function(a) { - return"number" == typeof a + return "number" == typeof a; }; goog.isFunction = function(a) { - return"function" == goog.typeOf(a) + return "function" == goog.typeOf(a); }; goog.isObject = function(a) { var b = typeof a; - return"object" == b && null != a || "function" == b + return "object" == b && null != a || "function" == b; }; goog.getUid = function(a) { - return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_) + return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_); +}; +goog.hasUid = function(a) { + return!!a[goog.UID_PROPERTY_]; }; goog.removeUid = function(a) { "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); try { - delete a[goog.UID_PROPERTY_] - }catch(b) { + delete a[goog.UID_PROPERTY_]; + } catch (b) { } }; goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); @@ -239,73 +264,73 @@ goog.getHashCode = goog.getUid; goog.removeHashCode = goog.removeUid; goog.cloneObject = function(a) { var b = goog.typeOf(a); - if("object" == b || "array" == b) { - if(a.clone) { - return a.clone() + if ("object" == b || "array" == b) { + if (a.clone) { + return a.clone(); } var b = "array" == b ? [] : {}, c; - for(c in a) { - b[c] = goog.cloneObject(a[c]) + for (c in a) { + b[c] = goog.cloneObject(a[c]); } - return b + return b; } - return a + return a; }; goog.bindNative_ = function(a, b, c) { - return a.call.apply(a.bind, arguments) + return a.call.apply(a.bind, arguments); }; goog.bindJs_ = function(a, b, c) { - if(!a) { + if (!a) { throw Error(); } - if(2 < arguments.length) { + if (2 < arguments.length) { var d = Array.prototype.slice.call(arguments, 2); return function() { var c = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(c, d); - return a.apply(b, c) - } + return a.apply(b, c); + }; } return function() { - return a.apply(b, arguments) - } + return a.apply(b, arguments); + }; }; goog.bind = function(a, b, c) { Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; - return goog.bind.apply(null, arguments) + return goog.bind.apply(null, arguments); }; goog.partial = function(a, b) { var c = Array.prototype.slice.call(arguments, 1); return function() { - var b = Array.prototype.slice.call(arguments); - b.unshift.apply(b, c); - return a.apply(this, b) - } + var b = c.slice(); + b.push.apply(b, arguments); + return a.apply(this, b); + }; }; goog.mixin = function(a, b) { - for(var c in b) { - a[c] = b[c] + for (var c in b) { + a[c] = b[c]; } }; goog.now = goog.TRUSTED_SITE && Date.now || function() { - return+new Date + return+new Date; }; goog.globalEval = function(a) { - if(goog.global.execScript) { - goog.global.execScript(a, "JavaScript") - }else { - if(goog.global.eval) { - if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ \x3d 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { - goog.global.eval(a) - }else { + if (goog.global.execScript) { + goog.global.execScript(a, "JavaScript"); + } else { + if (goog.global.eval) { + if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ \x3d 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { + goog.global.eval(a); + } else { var b = goog.global.document, c = b.createElement("script"); c.type = "text/javascript"; c.defer = !1; c.appendChild(b.createTextNode(a)); b.body.appendChild(c); - b.body.removeChild(c) + b.body.removeChild(c); } - }else { + } else { throw Error("goog.globalEval not available"); } } @@ -313,39 +338,37 @@ goog.globalEval = function(a) { goog.evalWorksForGlobals_ = null; goog.getCssName = function(a, b) { var c = function(a) { - return goog.cssNameMapping_[a] || a + return goog.cssNameMapping_[a] || a; }, d = function(a) { a = a.split("-"); - for(var b = [], d = 0;d < a.length;d++) { - b.push(c(a[d])) + for (var b = [], d = 0;d < a.length;d++) { + b.push(c(a[d])); } - return b.join("-") + return b.join("-"); }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) { - return a + return a; }; - return b ? a + "-" + d(b) : d(a) + return b ? a + "-" + d(b) : d(a); }; goog.setCssNameMapping = function(a, b) { goog.cssNameMapping_ = a; - goog.cssNameMappingStyle_ = b + goog.cssNameMappingStyle_ = b; }; !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); goog.getMsg = function(a, b) { - var c = b || {}, d; - for(d in c) { - var e = ("" + c[d]).replace(/\$/g, "$$$$"); - a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e) - } - return a + b && (a = a.replace(/\{\$([^}]+)}/g, function(a, d) { + return d in b ? b[d] : a; + })); + return a; }; goog.getMsgWithFallback = function(a, b) { - return a + return a; }; goog.exportSymbol = function(a, b, c) { - goog.exportPath_(a, b, c) + goog.exportPath_(a, b, c); }; goog.exportProperty = function(a, b, c) { - a[b] = c + a[b] = c; }; goog.inherits = function(a, b) { function c() { @@ -353,1151 +376,1304 @@ goog.inherits = function(a, b) { c.prototype = b.prototype; a.superClass_ = b.prototype; a.prototype = new c; - a.prototype.constructor = a + a.prototype.constructor = a; + a.base = function(a, c, f) { + var g = Array.prototype.slice.call(arguments, 2); + return b.prototype[c].apply(a, g); + }; }; goog.base = function(a, b, c) { var d = arguments.callee.caller; - if(d.superClass_) { - return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)) - } - for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { - if(g.prototype[b] === d) { - f = !0 - }else { - if(f) { - return g.prototype[b].apply(a, e) + if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) { + throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C"); + } + if (d.superClass_) { + return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)); + } + for (var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { + if (g.prototype[b] === d) { + f = !0; + } else { + if (f) { + return g.prototype[b].apply(a, e); } } } - if(a[b] === d) { - return a.constructor.prototype[b].apply(a, e) + if (a[b] === d) { + return a.constructor.prototype[b].apply(a, e); } throw Error("goog.base called from a method of one name to a method of a different name"); }; goog.scope = function(a) { - a.call(goog.global) + a.call(goog.global); +}; +COMPILED || (goog.global.COMPILED = COMPILED); +goog.defineClass = function(a, b) { + var c = b.constructor, d = b.statics; + c && c != Object.prototype.constructor || (c = function() { + throw Error("cannot instantiate an interface (no constructor defined)."); + }); + c = goog.defineClass.createSealingConstructor_(c, a); + a && goog.inherits(c, a); + delete b.constructor; + delete b.statics; + goog.defineClass.applyProperties_(c.prototype, b); + null != d && (d instanceof Function ? d(c) : goog.defineClass.applyProperties_(c, d)); + return c; +}; +goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG; +goog.defineClass.createSealingConstructor_ = function(a, b) { + if (goog.defineClass.SEAL_CLASS_INSTANCES && Object.seal instanceof Function) { + if (b && b.prototype && b.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]) { + return a; + } + var c = function() { + var b = a.apply(this, arguments) || this; + this.constructor === c && Object.seal(b); + return b; + }; + return c; + } + return a; +}; +goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); +goog.defineClass.applyProperties_ = function(a, b) { + for (var c in b) { + Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); + } + for (var d = 0;d < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++) { + c = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d], Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); + } }; +goog.tagUnsealableClass = function(a) { + !COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] = !0); +}; +goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable"; goog.string = {}; +goog.string.DETECT_DOUBLE_ESCAPING = !1; goog.string.Unicode = {NBSP:"\u00a0"}; goog.string.startsWith = function(a, b) { - return 0 == a.lastIndexOf(b, 0) + return 0 == a.lastIndexOf(b, 0); }; goog.string.endsWith = function(a, b) { var c = a.length - b.length; - return 0 <= c && a.indexOf(b, c) == c + return 0 <= c && a.indexOf(b, c) == c; }; goog.string.caseInsensitiveStartsWith = function(a, b) { - return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)) + return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)); }; goog.string.caseInsensitiveEndsWith = function(a, b) { - return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)) + return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)); +}; +goog.string.caseInsensitiveEquals = function(a, b) { + return a.toLowerCase() == b.toLowerCase(); }; goog.string.subs = function(a, b) { - for(var c = 1;c < arguments.length;c++) { - var d = String(arguments[c]).replace(/\$/g, "$$$$"); - a = a.replace(/\%s/, d) + for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1);e.length && 1 < c.length;) { + d += c.shift() + e.shift(); } - return a + return d + c.join("%s"); }; goog.string.collapseWhitespace = function(a) { - return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, "") + return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, ""); }; goog.string.isEmpty = function(a) { - return/^[\s\xa0]*$/.test(a) + return/^[\s\xa0]*$/.test(a); }; goog.string.isEmptySafe = function(a) { - return goog.string.isEmpty(goog.string.makeSafe(a)) + return goog.string.isEmpty(goog.string.makeSafe(a)); }; goog.string.isBreakingWhitespace = function(a) { - return!/[^\t\n\r ]/.test(a) + return!/[^\t\n\r ]/.test(a); }; goog.string.isAlpha = function(a) { - return!/[^a-zA-Z]/.test(a) + return!/[^a-zA-Z]/.test(a); }; goog.string.isNumeric = function(a) { - return!/[^0-9]/.test(a) + return!/[^0-9]/.test(a); }; goog.string.isAlphaNumeric = function(a) { - return!/[^a-zA-Z0-9]/.test(a) + return!/[^a-zA-Z0-9]/.test(a); }; goog.string.isSpace = function(a) { - return" " == a + return " " == a; }; goog.string.isUnicodeChar = function(a) { - return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a + return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a; }; goog.string.stripNewlines = function(a) { - return a.replace(/(\r\n|\r|\n)+/g, " ") + return a.replace(/(\r\n|\r|\n)+/g, " "); }; goog.string.canonicalizeNewlines = function(a) { - return a.replace(/(\r\n|\r|\n)/g, "\n") + return a.replace(/(\r\n|\r|\n)/g, "\n"); }; goog.string.normalizeWhitespace = function(a) { - return a.replace(/\xa0|\s/g, " ") + return a.replace(/\xa0|\s/g, " "); }; goog.string.normalizeSpaces = function(a) { - return a.replace(/\xa0|[ \t]+/g, " ") + return a.replace(/\xa0|[ \t]+/g, " "); }; goog.string.collapseBreakingSpaces = function(a) { - return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "") + return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ""); }; goog.string.trim = function(a) { - return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "") + return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, ""); }; goog.string.trimLeft = function(a) { - return a.replace(/^[\s\xa0]+/, "") + return a.replace(/^[\s\xa0]+/, ""); }; goog.string.trimRight = function(a) { - return a.replace(/[\s\xa0]+$/, "") + return a.replace(/[\s\xa0]+$/, ""); }; goog.string.caseInsensitiveCompare = function(a, b) { var c = String(a).toLowerCase(), d = String(b).toLowerCase(); - return c < d ? -1 : c == d ? 0 : 1 + return c < d ? -1 : c == d ? 0 : 1; }; goog.string.numerateCompareRegExp_ = /(\.\d+)|(\d+)|(\D+)/g; goog.string.numerateCompare = function(a, b) { - if(a == b) { - return 0 + if (a == b) { + return 0; } - if(!a) { - return-1 + if (!a) { + return-1; } - if(!b) { - return 1 + if (!b) { + return 1; } - for(var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { + for (var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { var g = c[f], h = d[f]; - if(g != h) { - return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1 + if (g != h) { + return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1; } } - return c.length != d.length ? c.length - d.length : a < b ? -1 : 1 + return c.length != d.length ? c.length - d.length : a < b ? -1 : 1; }; goog.string.urlEncode = function(a) { - return encodeURIComponent(String(a)) + return encodeURIComponent(String(a)); }; goog.string.urlDecode = function(a) { - return decodeURIComponent(a.replace(/\+/g, " ")) + return decodeURIComponent(a.replace(/\+/g, " ")); }; goog.string.newLineToBr = function(a, b) { - return a.replace(/(\r\n|\r|\n)/g, b ? "\x3cbr /\x3e" : "\x3cbr\x3e") + return a.replace(/(\r\n|\r|\n)/g, b ? "\x3cbr /\x3e" : "\x3cbr\x3e"); }; goog.string.htmlEscape = function(a, b) { - if(b) { - return a.replace(goog.string.amperRe_, "\x26amp;").replace(goog.string.ltRe_, "\x26lt;").replace(goog.string.gtRe_, "\x26gt;").replace(goog.string.quotRe_, "\x26quot;") - } - if(!goog.string.allRe_.test(a)) { - return a - } - -1 != a.indexOf("\x26") && (a = a.replace(goog.string.amperRe_, "\x26amp;")); - -1 != a.indexOf("\x3c") && (a = a.replace(goog.string.ltRe_, "\x26lt;")); - -1 != a.indexOf("\x3e") && (a = a.replace(goog.string.gtRe_, "\x26gt;")); - -1 != a.indexOf('"') && (a = a.replace(goog.string.quotRe_, "\x26quot;")); - return a -}; -goog.string.amperRe_ = /&/g; -goog.string.ltRe_ = //g; -goog.string.quotRe_ = /\"/g; -goog.string.allRe_ = /[&<>\"]/; + if (b) { + a = a.replace(goog.string.AMP_RE_, "\x26amp;").replace(goog.string.LT_RE_, "\x26lt;").replace(goog.string.GT_RE_, "\x26gt;").replace(goog.string.QUOT_RE_, "\x26quot;").replace(goog.string.SINGLE_QUOTE_RE_, "\x26#39;").replace(goog.string.NULL_RE_, "\x26#0;"), goog.string.DETECT_DOUBLE_ESCAPING && (a = a.replace(goog.string.E_RE_, "\x26#101;")); + } else { + if (!goog.string.ALL_RE_.test(a)) { + return a; + } + -1 != a.indexOf("\x26") && (a = a.replace(goog.string.AMP_RE_, "\x26amp;")); + -1 != a.indexOf("\x3c") && (a = a.replace(goog.string.LT_RE_, "\x26lt;")); + -1 != a.indexOf("\x3e") && (a = a.replace(goog.string.GT_RE_, "\x26gt;")); + -1 != a.indexOf('"') && (a = a.replace(goog.string.QUOT_RE_, "\x26quot;")); + -1 != a.indexOf("'") && (a = a.replace(goog.string.SINGLE_QUOTE_RE_, "\x26#39;")); + -1 != a.indexOf("\x00") && (a = a.replace(goog.string.NULL_RE_, "\x26#0;")); + goog.string.DETECT_DOUBLE_ESCAPING && -1 != a.indexOf("e") && (a = a.replace(goog.string.E_RE_, "\x26#101;")); + } + return a; +}; +goog.string.AMP_RE_ = /&/g; +goog.string.LT_RE_ = //g; +goog.string.QUOT_RE_ = /"/g; +goog.string.SINGLE_QUOTE_RE_ = /'/g; +goog.string.NULL_RE_ = /\x00/g; +goog.string.E_RE_ = /e/g; +goog.string.ALL_RE_ = goog.string.DETECT_DOUBLE_ESCAPING ? /[\x00&<>"'e]/ : /[\x00&<>"']/; goog.string.unescapeEntities = function(a) { - return goog.string.contains(a, "\x26") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a + return goog.string.contains(a, "\x26") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a; }; -goog.string.unescapeEntitiesUsingDom_ = function(a) { - var b = {"\x26amp;":"\x26", "\x26lt;":"\x3c", "\x26gt;":"\x3e", "\x26quot;":'"'}, c = document.createElement("div"); - return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, e) { - var f = b[a]; - if(f) { - return f +goog.string.unescapeEntitiesWithDocument = function(a, b) { + return goog.string.contains(a, "\x26") ? goog.string.unescapeEntitiesUsingDom_(a, b) : a; +}; +goog.string.unescapeEntitiesUsingDom_ = function(a, b) { + var c = {"\x26amp;":"\x26", "\x26lt;":"\x3c", "\x26gt;":"\x3e", "\x26quot;":'"'}, d; + d = b ? b.createElement("div") : goog.global.document.createElement("div"); + return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, b) { + var g = c[a]; + if (g) { + return g; } - if("#" == e.charAt(0)) { - var g = Number("0" + e.substr(1)); - isNaN(g) || (f = String.fromCharCode(g)) + if ("#" == b.charAt(0)) { + var h = Number("0" + b.substr(1)); + isNaN(h) || (g = String.fromCharCode(h)); } - f || (c.innerHTML = a + " ", f = c.firstChild.nodeValue.slice(0, -1)); - return b[a] = f - }) + g || (d.innerHTML = a + " ", g = d.firstChild.nodeValue.slice(0, -1)); + return c[a] = g; + }); }; goog.string.unescapePureXmlEntities_ = function(a) { return a.replace(/&([^;]+);/g, function(a, c) { switch(c) { case "amp": - return"\x26"; + return "\x26"; case "lt": - return"\x3c"; + return "\x3c"; case "gt": - return"\x3e"; + return "\x3e"; case "quot": return'"'; default: - if("#" == c.charAt(0)) { + if ("#" == c.charAt(0)) { var d = Number("0" + c.substr(1)); - if(!isNaN(d)) { - return String.fromCharCode(d) + if (!isNaN(d)) { + return String.fromCharCode(d); } } - return a + return a; } - }) + }); }; goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; goog.string.whitespaceEscape = function(a, b) { - return goog.string.newLineToBr(a.replace(/ /g, " \x26#160;"), b) + return goog.string.newLineToBr(a.replace(/ /g, " \x26#160;"), b); +}; +goog.string.preserveSpaces = function(a) { + return a.replace(/(^|[\n ]) /g, "$1" + goog.string.Unicode.NBSP); }; goog.string.stripQuotes = function(a, b) { - for(var c = b.length, d = 0;d < c;d++) { + for (var c = b.length, d = 0;d < c;d++) { var e = 1 == c ? b : b.charAt(d); - if(a.charAt(0) == e && a.charAt(a.length - 1) == e) { - return a.substring(1, a.length - 1) + if (a.charAt(0) == e && a.charAt(a.length - 1) == e) { + return a.substring(1, a.length - 1); } } - return a + return a; }; goog.string.truncate = function(a, b, c) { c && (a = goog.string.unescapeEntities(a)); a.length > b && (a = a.substring(0, b - 3) + "..."); c && (a = goog.string.htmlEscape(a)); - return a + return a; }; goog.string.truncateMiddle = function(a, b, c, d) { c && (a = goog.string.unescapeEntities(a)); - if(d && a.length > b) { + if (d && a.length > b) { d > b && (d = b); var e = a.length - d; - a = a.substring(0, b - d) + "..." + a.substring(e) - }else { - a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)) + a = a.substring(0, b - d) + "..." + a.substring(e); + } else { + a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)); } c && (a = goog.string.htmlEscape(a)); - return a + return a; }; goog.string.specialEscapeChars_ = {"\x00":"\\0", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\"}; goog.string.jsEscapeCache_ = {"'":"\\'"}; goog.string.quote = function(a) { a = String(a); - if(a.quote) { - return a.quote() + if (a.quote) { + return a.quote(); } - for(var b = ['"'], c = 0;c < a.length;c++) { + for (var b = ['"'], c = 0;c < a.length;c++) { var d = a.charAt(c), e = d.charCodeAt(0); - b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)) + b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)); } b.push('"'); - return b.join("") + return b.join(""); }; goog.string.escapeString = function(a) { - for(var b = [], c = 0;c < a.length;c++) { - b[c] = goog.string.escapeChar(a.charAt(c)) + for (var b = [], c = 0;c < a.length;c++) { + b[c] = goog.string.escapeChar(a.charAt(c)); } - return b.join("") + return b.join(""); }; goog.string.escapeChar = function(a) { - if(a in goog.string.jsEscapeCache_) { - return goog.string.jsEscapeCache_[a] + if (a in goog.string.jsEscapeCache_) { + return goog.string.jsEscapeCache_[a]; } - if(a in goog.string.specialEscapeChars_) { - return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a] + if (a in goog.string.specialEscapeChars_) { + return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a]; } var b = a, c = a.charCodeAt(0); - if(31 < c && 127 > c) { - b = a - }else { - if(256 > c) { - if(b = "\\x", 16 > c || 256 < c) { - b += "0" + if (31 < c && 127 > c) { + b = a; + } else { + if (256 > c) { + if (b = "\\x", 16 > c || 256 < c) { + b += "0"; } - }else { - b = "\\u", 4096 > c && (b += "0") + } else { + b = "\\u", 4096 > c && (b += "0"); } - b += c.toString(16).toUpperCase() + b += c.toString(16).toUpperCase(); } - return goog.string.jsEscapeCache_[a] = b + return goog.string.jsEscapeCache_[a] = b; }; goog.string.toMap = function(a) { - for(var b = {}, c = 0;c < a.length;c++) { - b[a.charAt(c)] = !0 + for (var b = {}, c = 0;c < a.length;c++) { + b[a.charAt(c)] = !0; } - return b + return b; }; goog.string.contains = function(a, b) { - return-1 != a.indexOf(b) + return-1 != a.indexOf(b); +}; +goog.string.caseInsensitiveContains = function(a, b) { + return goog.string.contains(a.toLowerCase(), b.toLowerCase()); }; goog.string.countOf = function(a, b) { - return a && b ? a.split(b).length - 1 : 0 + return a && b ? a.split(b).length - 1 : 0; }; goog.string.removeAt = function(a, b, c) { var d = a; - 0 <= b && (b < a.length && 0 < c) && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); - return d + 0 <= b && b < a.length && 0 < c && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); + return d; }; goog.string.remove = function(a, b) { - var c = RegExp(goog.string.regExpEscape(b), ""); - return a.replace(c, "") + var c = new RegExp(goog.string.regExpEscape(b), ""); + return a.replace(c, ""); }; goog.string.removeAll = function(a, b) { - var c = RegExp(goog.string.regExpEscape(b), "g"); - return a.replace(c, "") + var c = new RegExp(goog.string.regExpEscape(b), "g"); + return a.replace(c, ""); }; goog.string.regExpEscape = function(a) { - return String(a).replace(/([-()\[\]{}+?*.$\^|,:# b ? 1 : 0 + return a < b ? -1 : a > b ? 1 : 0; }; goog.string.HASHCODE_MAX_ = 4294967296; goog.string.hashCode = function(a) { - for(var b = 0, c = 0;c < a.length;++c) { - b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_ + for (var b = 0, c = 0;c < a.length;++c) { + b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_; } - return b + return b; }; goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0; goog.string.createUniqueString = function() { - return"goog_" + goog.string.uniqueStringCounter_++ + return "goog_" + goog.string.uniqueStringCounter_++; }; goog.string.toNumber = function(a) { var b = Number(a); - return 0 == b && goog.string.isEmpty(a) ? NaN : b + return 0 == b && goog.string.isEmpty(a) ? NaN : b; +}; +goog.string.isLowerCamelCase = function(a) { + return/^[a-z]+([A-Z][a-z]*)*$/.test(a); +}; +goog.string.isUpperCamelCase = function(a) { + return/^([A-Z][a-z]*)+$/.test(a); }; goog.string.toCamelCase = function(a) { return String(a).replace(/\-([a-z])/g, function(a, c) { - return c.toUpperCase() - }) + return c.toUpperCase(); + }); }; goog.string.toSelectorCase = function(a) { - return String(a).replace(/([A-Z])/g, "-$1").toLowerCase() + return String(a).replace(/([A-Z])/g, "-$1").toLowerCase(); }; goog.string.toTitleCase = function(a, b) { var c = goog.isString(b) ? goog.string.regExpEscape(b) : "\\s"; - return a.replace(RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) { - return b + c.toUpperCase() - }) + return a.replace(new RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) { + return b + c.toUpperCase(); + }); }; goog.string.parseInt = function(a) { isFinite(a) && (a = String(a)); - return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN + return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN; +}; +goog.string.splitLimit = function(a, b, c) { + a = a.split(b); + for (var d = [];0 < c && a.length;) { + d.push(a.shift()), c--; + } + a.length && d.push(a.join(b)); + return d; +}; +goog.object = {}; +goog.object.forEach = function(a, b, c) { + for (var d in a) { + b.call(c, a[d], d, a); + } +}; +goog.object.filter = function(a, b, c) { + var d = {}, e; + for (e in a) { + b.call(c, a[e], e, a) && (d[e] = a[e]); + } + return d; +}; +goog.object.map = function(a, b, c) { + var d = {}, e; + for (e in a) { + d[e] = b.call(c, a[e], e, a); + } + return d; +}; +goog.object.some = function(a, b, c) { + for (var d in a) { + if (b.call(c, a[d], d, a)) { + return!0; + } + } + return!1; +}; +goog.object.every = function(a, b, c) { + for (var d in a) { + if (!b.call(c, a[d], d, a)) { + return!1; + } + } + return!0; +}; +goog.object.getCount = function(a) { + var b = 0, c; + for (c in a) { + b++; + } + return b; +}; +goog.object.getAnyKey = function(a) { + for (var b in a) { + return b; + } +}; +goog.object.getAnyValue = function(a) { + for (var b in a) { + return a[b]; + } +}; +goog.object.contains = function(a, b) { + return goog.object.containsValue(a, b); +}; +goog.object.getValues = function(a) { + var b = [], c = 0, d; + for (d in a) { + b[c++] = a[d]; + } + return b; +}; +goog.object.getKeys = function(a) { + var b = [], c = 0, d; + for (d in a) { + b[c++] = d; + } + return b; +}; +goog.object.getValueByKeys = function(a, b) { + for (var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { + } + return a; +}; +goog.object.containsKey = function(a, b) { + return b in a; +}; +goog.object.containsValue = function(a, b) { + for (var c in a) { + if (a[c] == b) { + return!0; + } + } + return!1; +}; +goog.object.findKey = function(a, b, c) { + for (var d in a) { + if (b.call(c, a[d], d, a)) { + return d; + } + } +}; +goog.object.findValue = function(a, b, c) { + return(b = goog.object.findKey(a, b, c)) && a[b]; +}; +goog.object.isEmpty = function(a) { + for (var b in a) { + return!1; + } + return!0; +}; +goog.object.clear = function(a) { + for (var b in a) { + delete a[b]; + } +}; +goog.object.remove = function(a, b) { + var c; + (c = b in a) && delete a[b]; + return c; +}; +goog.object.add = function(a, b, c) { + if (b in a) { + throw Error('The object already contains the key "' + b + '"'); + } + goog.object.set(a, b, c); +}; +goog.object.get = function(a, b, c) { + return b in a ? a[b] : c; +}; +goog.object.set = function(a, b, c) { + a[b] = c; +}; +goog.object.setIfUndefined = function(a, b, c) { + return b in a ? a[b] : a[b] = c; +}; +goog.object.clone = function(a) { + var b = {}, c; + for (c in a) { + b[c] = a[c]; + } + return b; +}; +goog.object.unsafeClone = function(a) { + var b = goog.typeOf(a); + if ("object" == b || "array" == b) { + if (a.clone) { + return a.clone(); + } + var b = "array" == b ? [] : {}, c; + for (c in a) { + b[c] = goog.object.unsafeClone(a[c]); + } + return b; + } + return a; +}; +goog.object.transpose = function(a) { + var b = {}, c; + for (c in a) { + b[a[c]] = c; + } + return b; +}; +goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); +goog.object.extend = function(a, b) { + for (var c, d, e = 1;e < arguments.length;e++) { + d = arguments[e]; + for (c in d) { + a[c] = d[c]; + } + for (var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { + c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]); + } + } +}; +goog.object.create = function(a) { + var b = arguments.length; + if (1 == b && goog.isArray(arguments[0])) { + return goog.object.create.apply(null, arguments[0]); + } + if (b % 2) { + throw Error("Uneven number of arguments"); + } + for (var c = {}, d = 0;d < b;d += 2) { + c[arguments[d]] = arguments[d + 1]; + } + return c; +}; +goog.object.createSet = function(a) { + var b = arguments.length; + if (1 == b && goog.isArray(arguments[0])) { + return goog.object.createSet.apply(null, arguments[0]); + } + for (var c = {}, d = 0;d < b;d++) { + c[arguments[d]] = !0; + } + return c; +}; +goog.object.createImmutableView = function(a) { + var b = a; + Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b)); + return b; +}; +goog.object.isImmutableView = function(a) { + return!!Object.isFrozen && Object.isFrozen(a); +}; +goog.string.StringBuffer = function(a, b) { + null != a && this.append.apply(this, arguments); +}; +goog.string.StringBuffer.prototype.buffer_ = ""; +goog.string.StringBuffer.prototype.set = function(a) { + this.buffer_ = "" + a; +}; +goog.string.StringBuffer.prototype.append = function(a, b, c) { + this.buffer_ += a; + if (null != b) { + for (var d = 1;d < arguments.length;d++) { + this.buffer_ += arguments[d]; + } + } + return this; +}; +goog.string.StringBuffer.prototype.clear = function() { + this.buffer_ = ""; +}; +goog.string.StringBuffer.prototype.getLength = function() { + return this.buffer_.length; +}; +goog.string.StringBuffer.prototype.toString = function() { + return this.buffer_; }; goog.debug = {}; goog.debug.Error = function(a) { - Error.captureStackTrace ? Error.captureStackTrace(this, goog.debug.Error) : this.stack = Error().stack || ""; - a && (this.message = String(a)) + if (Error.captureStackTrace) { + Error.captureStackTrace(this, goog.debug.Error); + } else { + var b = Error().stack; + b && (this.stack = b); + } + a && (this.message = String(a)); }; goog.inherits(goog.debug.Error, Error); goog.debug.Error.prototype.name = "CustomError"; +goog.dom = {}; +goog.dom.NodeType = {ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, ENTITY_REFERENCE:5, ENTITY:6, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9, DOCUMENT_TYPE:10, DOCUMENT_FRAGMENT:11, NOTATION:12}; goog.asserts = {}; goog.asserts.ENABLE_ASSERTS = goog.DEBUG; goog.asserts.AssertionError = function(a, b) { b.unshift(a); goog.debug.Error.call(this, goog.string.subs.apply(null, b)); b.shift(); - this.messagePattern = a + this.messagePattern = a; }; goog.inherits(goog.asserts.AssertionError, goog.debug.Error); goog.asserts.AssertionError.prototype.name = "AssertionError"; +goog.asserts.DEFAULT_ERROR_HANDLER = function(a) { + throw a; +}; +goog.asserts.errorHandler_ = goog.asserts.DEFAULT_ERROR_HANDLER; goog.asserts.doAssertFailure_ = function(a, b, c, d) { var e = "Assertion failed"; - if(c) { + if (c) { var e = e + (": " + c), f = d - }else { - a && (e += ": " + a, f = b) + } else { + a && (e += ": " + a, f = b); } - throw new goog.asserts.AssertionError("" + e, f || []); + a = new goog.asserts.AssertionError("" + e, f || []); + goog.asserts.errorHandler_(a); +}; +goog.asserts.setErrorHandler = function(a) { + goog.asserts.ENABLE_ASSERTS && (goog.asserts.errorHandler_ = a); }; goog.asserts.assert = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !a && goog.asserts.doAssertFailure_("", null, b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.fail = function(a, b) { - if(goog.asserts.ENABLE_ASSERTS) { - throw new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1)); - } + goog.asserts.ENABLE_ASSERTS && goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1))); }; goog.asserts.assertNumber = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isNumber(a) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertString = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isString(a) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertFunction = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isFunction(a) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertObject = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isObject(a) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertArray = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isArray(a) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertBoolean = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(a) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; +}; +goog.asserts.assertElement = function(a, b, c) { + !goog.asserts.ENABLE_ASSERTS || goog.isObject(a) && a.nodeType == goog.dom.NodeType.ELEMENT || goog.asserts.doAssertFailure_("Expected Element but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); + return a; }; goog.asserts.assertInstanceof = function(a, b, c, d) { !goog.asserts.ENABLE_ASSERTS || a instanceof b || goog.asserts.doAssertFailure_("instanceof check failed.", null, c, Array.prototype.slice.call(arguments, 3)); - return a + return a; +}; +goog.asserts.assertObjectPrototypeIsIntact = function() { + for (var a in Object.prototype) { + goog.asserts.fail(a + " should not be enumerable in Object.prototype."); + } }; goog.array = {}; goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE; +goog.array.ASSUME_NATIVE_FUNCTIONS = !1; goog.array.peek = function(a) { - return a[a.length - 1] + return a[a.length - 1]; }; +goog.array.last = goog.array.peek; goog.array.ARRAY_PROTOTYPE_ = Array.prototype; -goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.indexOf ? function(a, b, c) { +goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.indexOf) ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c); } : function(a, b, c) { c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c; - if(goog.isString(a)) { - return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1 + if (goog.isString(a)) { + return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1; } - for(;c < a.length;c++) { - if(c in a && a[c] === b) { - return c + for (;c < a.length;c++) { + if (c in a && a[c] === b) { + return c; } } - return-1 + return-1; }; -goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.lastIndexOf ? function(a, b, c) { +goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.lastIndexOf) ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c) + return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c); } : function(a, b, c) { c = null == c ? a.length - 1 : c; 0 > c && (c = Math.max(0, a.length + c)); - if(goog.isString(a)) { - return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1 + if (goog.isString(a)) { + return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1; } - for(;0 <= c;c--) { - if(c in a && a[c] === b) { - return c + for (;0 <= c;c--) { + if (c in a && a[c] === b) { + return c; } } - return-1 + return-1; }; -goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.forEach ? function(a, b, c) { +goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.forEach) ? function(a, b, c) { goog.asserts.assert(null != a.length); - goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c) + goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - f in e && b.call(c, e[f], f, a) + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + f in e && b.call(c, e[f], f, a); } }; goog.array.forEachRight = function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { - d in e && b.call(c, e[d], d, a) + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { + d in e && b.call(c, e[d], d, a); } }; -goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.filter ? function(a, b, c) { +goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.filter) ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { - if(h in g) { + for (var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { + if (h in g) { var k = g[h]; - b.call(c, k, h, a) && (e[f++] = k) + b.call(c, k, h, a) && (e[f++] = k); } } - return e + return e; }; -goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.map ? function(a, b, c) { +goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.map) ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { - g in f && (e[g] = b.call(c, f[g], g, a)) + for (var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { + g in f && (e[g] = b.call(c, f[g], g, a)); } - return e + return e; }; -goog.array.reduce = function(a, b, c, d) { - if(a.reduce) { - return d ? a.reduce(goog.bind(b, d), c) : a.reduce(b, c) - } +goog.array.reduce = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduce) ? function(a, b, c, d) { + goog.asserts.assert(null != a.length); + d && (b = goog.bind(b, d)); + return goog.array.ARRAY_PROTOTYPE_.reduce.call(a, b, c); +} : function(a, b, c, d) { var e = c; goog.array.forEach(a, function(c, g) { - e = b.call(d, e, c, g, a) + e = b.call(d, e, c, g, a); }); - return e + return e; }; -goog.array.reduceRight = function(a, b, c, d) { - if(a.reduceRight) { - return d ? a.reduceRight(goog.bind(b, d), c) : a.reduceRight(b, c) - } +goog.array.reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduceRight) ? function(a, b, c, d) { + goog.asserts.assert(null != a.length); + d && (b = goog.bind(b, d)); + return goog.array.ARRAY_PROTOTYPE_.reduceRight.call(a, b, c); +} : function(a, b, c, d) { var e = c; goog.array.forEachRight(a, function(c, g) { - e = b.call(d, e, c, g, a) + e = b.call(d, e, c, g, a); }); - return e + return e; }; -goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.some ? function(a, b, c) { +goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.some) ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if(f in e && b.call(c, e[f], f, a)) { - return!0 + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if (f in e && b.call(c, e[f], f, a)) { + return!0; } } - return!1 + return!1; }; -goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.every ? function(a, b, c) { +goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.every) ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if(f in e && !b.call(c, e[f], f, a)) { - return!1 + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if (f in e && !b.call(c, e[f], f, a)) { + return!1; } } - return!0 + return!0; }; goog.array.count = function(a, b, c) { var d = 0; goog.array.forEach(a, function(a, f, g) { - b.call(c, a, f, g) && ++d + b.call(c, a, f, g) && ++d; }, c); - return d + return d; }; goog.array.find = function(a, b, c) { b = goog.array.findIndex(a, b, c); - return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b] + return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; }; goog.array.findIndex = function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if(f in e && b.call(c, e[f], f, a)) { - return f + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if (f in e && b.call(c, e[f], f, a)) { + return f; } } - return-1 + return-1; }; goog.array.findRight = function(a, b, c) { b = goog.array.findIndexRight(a, b, c); - return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b] + return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; }; goog.array.findIndexRight = function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { - if(d in e && b.call(c, e[d], d, a)) { - return d + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { + if (d in e && b.call(c, e[d], d, a)) { + return d; } } - return-1 + return-1; }; goog.array.contains = function(a, b) { - return 0 <= goog.array.indexOf(a, b) + return 0 <= goog.array.indexOf(a, b); }; goog.array.isEmpty = function(a) { - return 0 == a.length + return 0 == a.length; }; goog.array.clear = function(a) { - if(!goog.isArray(a)) { - for(var b = a.length - 1;0 <= b;b--) { - delete a[b] + if (!goog.isArray(a)) { + for (var b = a.length - 1;0 <= b;b--) { + delete a[b]; } } - a.length = 0 + a.length = 0; }; goog.array.insert = function(a, b) { - goog.array.contains(a, b) || a.push(b) + goog.array.contains(a, b) || a.push(b); }; goog.array.insertAt = function(a, b, c) { - goog.array.splice(a, c, 0, b) + goog.array.splice(a, c, 0, b); }; goog.array.insertArrayAt = function(a, b, c) { - goog.partial(goog.array.splice, a, c, 0).apply(null, b) + goog.partial(goog.array.splice, a, c, 0).apply(null, b); }; goog.array.insertBefore = function(a, b, c) { var d; - 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d) + 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d); }; goog.array.remove = function(a, b) { var c = goog.array.indexOf(a, b), d; (d = 0 <= c) && goog.array.removeAt(a, c); - return d + return d; }; goog.array.removeAt = function(a, b) { goog.asserts.assert(null != a.length); - return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length + return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length; }; goog.array.removeIf = function(a, b, c) { b = goog.array.findIndex(a, b, c); - return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1 + return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1; }; goog.array.concat = function(a) { - return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments) + return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); +}; +goog.array.join = function(a) { + return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); }; goog.array.toArray = function(a) { var b = a.length; - if(0 < b) { - for(var c = Array(b), d = 0;d < b;d++) { - c[d] = a[d] + if (0 < b) { + for (var c = Array(b), d = 0;d < b;d++) { + c[d] = a[d]; } - return c + return c; } - return[] + return[]; }; goog.array.clone = goog.array.toArray; goog.array.extend = function(a, b) { - for(var c = 1;c < arguments.length;c++) { + for (var c = 1;c < arguments.length;c++) { var d = arguments[c], e; - if(goog.isArray(d) || (e = goog.isArrayLike(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) { - a.push.apply(a, d) - }else { - if(e) { - for(var f = a.length, g = d.length, h = 0;h < g;h++) { - a[f + h] = d[h] + if (goog.isArray(d) || (e = goog.isArrayLike(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) { + a.push.apply(a, d); + } else { + if (e) { + for (var f = a.length, g = d.length, h = 0;h < g;h++) { + a[f + h] = d[h]; } - }else { - a.push(d) + } else { + a.push(d); } } } }; goog.array.splice = function(a, b, c, d) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)) + return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)); }; goog.array.slice = function(a, b, c) { goog.asserts.assert(null != a.length); - return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c) + return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c); }; -goog.array.removeDuplicates = function(a, b) { - for(var c = b || a, d = {}, e = 0, f = 0;f < a.length;) { - var g = a[f++], h = goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g; - Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, c[e++] = g) +goog.array.removeDuplicates = function(a, b, c) { + b = b || a; + var d = function(a) { + return goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g; + }; + c = c || d; + for (var d = {}, e = 0, f = 0;f < a.length;) { + var g = a[f++], h = c(g); + Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, b[e++] = g); } - c.length = e + b.length = e; }; goog.array.binarySearch = function(a, b, c) { - return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b) + return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b); }; goog.array.binarySelect = function(a, b, c) { - return goog.array.binarySearch_(a, b, !0, void 0, c) + return goog.array.binarySearch_(a, b, !0, void 0, c); }; goog.array.binarySearch_ = function(a, b, c, d, e) { - for(var f = 0, g = a.length, h;f < g;) { + for (var f = 0, g = a.length, h;f < g;) { var k = f + g >> 1, l; l = c ? b.call(e, a[k], k, a) : b(d, a[k]); - 0 < l ? f = k + 1 : (g = k, h = !l) + 0 < l ? f = k + 1 : (g = k, h = !l); } - return h ? f : ~f + return h ? f : ~f; }; goog.array.sort = function(a, b) { - goog.asserts.assert(null != a.length); - goog.array.ARRAY_PROTOTYPE_.sort.call(a, b || goog.array.defaultCompare) + a.sort(b || goog.array.defaultCompare); }; goog.array.stableSort = function(a, b) { - for(var c = 0;c < a.length;c++) { - a[c] = {index:c, value:a[c]} + for (var c = 0;c < a.length;c++) { + a[c] = {index:c, value:a[c]}; } var d = b || goog.array.defaultCompare; goog.array.sort(a, function(a, b) { - return d(a.value, b.value) || a.index - b.index + return d(a.value, b.value) || a.index - b.index; }); - for(c = 0;c < a.length;c++) { - a[c] = a[c].value + for (c = 0;c < a.length;c++) { + a[c] = a[c].value; } }; goog.array.sortObjectsByKey = function(a, b, c) { var d = c || goog.array.defaultCompare; goog.array.sort(a, function(a, c) { - return d(a[b], c[b]) - }) + return d(a[b], c[b]); + }); }; goog.array.isSorted = function(a, b, c) { b = b || goog.array.defaultCompare; - for(var d = 1;d < a.length;d++) { + for (var d = 1;d < a.length;d++) { var e = b(a[d - 1], a[d]); - if(0 < e || 0 == e && c) { - return!1 + if (0 < e || 0 == e && c) { + return!1; } } - return!0 + return!0; }; goog.array.equals = function(a, b, c) { - if(!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { - return!1 + if (!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { + return!1; } var d = a.length; c = c || goog.array.defaultCompareEquality; - for(var e = 0;e < d;e++) { - if(!c(a[e], b[e])) { - return!1 + for (var e = 0;e < d;e++) { + if (!c(a[e], b[e])) { + return!1; } } - return!0 -}; -goog.array.compare = function(a, b, c) { - return goog.array.equals(a, b, c) + return!0; }; goog.array.compare3 = function(a, b, c) { c = c || goog.array.defaultCompare; - for(var d = Math.min(a.length, b.length), e = 0;e < d;e++) { + for (var d = Math.min(a.length, b.length), e = 0;e < d;e++) { var f = c(a[e], b[e]); - if(0 != f) { - return f + if (0 != f) { + return f; } } - return goog.array.defaultCompare(a.length, b.length) + return goog.array.defaultCompare(a.length, b.length); }; goog.array.defaultCompare = function(a, b) { - return a > b ? 1 : a < b ? -1 : 0 + return a > b ? 1 : a < b ? -1 : 0; }; goog.array.defaultCompareEquality = function(a, b) { - return a === b + return a === b; }; goog.array.binaryInsert = function(a, b, c) { c = goog.array.binarySearch(a, b, c); - return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1 + return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1; }; goog.array.binaryRemove = function(a, b, c) { b = goog.array.binarySearch(a, b, c); - return 0 <= b ? goog.array.removeAt(a, b) : !1 + return 0 <= b ? goog.array.removeAt(a, b) : !1; }; -goog.array.bucket = function(a, b) { - for(var c = {}, d = 0;d < a.length;d++) { - var e = a[d], f = b(e, d, a); - goog.isDef(f) && (c[f] || (c[f] = [])).push(e) +goog.array.bucket = function(a, b, c) { + for (var d = {}, e = 0;e < a.length;e++) { + var f = a[e], g = b.call(c, f, e, a); + goog.isDef(g) && (d[g] || (d[g] = [])).push(f); } - return c + return d; }; goog.array.toObject = function(a, b, c) { var d = {}; goog.array.forEach(a, function(e, f) { - d[b.call(c, e, f, a)] = e + d[b.call(c, e, f, a)] = e; }); - return d + return d; }; goog.array.range = function(a, b, c) { var d = [], e = 0, f = a; c = c || 1; void 0 !== b && (e = a, f = b); - if(0 > c * (f - e)) { - return[] + if (0 > c * (f - e)) { + return[]; } - if(0 < c) { - for(a = e;a < f;a += c) { - d.push(a) + if (0 < c) { + for (a = e;a < f;a += c) { + d.push(a); } - }else { - for(a = e;a > f;a += c) { - d.push(a) + } else { + for (a = e;a > f;a += c) { + d.push(a); } } - return d + return d; }; goog.array.repeat = function(a, b) { - for(var c = [], d = 0;d < b;d++) { - c[d] = a + for (var c = [], d = 0;d < b;d++) { + c[d] = a; } - return c + return c; }; goog.array.flatten = function(a) { - for(var b = [], c = 0;c < arguments.length;c++) { + for (var b = [], c = 0;c < arguments.length;c++) { var d = arguments[c]; - goog.isArray(d) ? b.push.apply(b, goog.array.flatten.apply(null, d)) : b.push(d) + goog.isArray(d) ? b.push.apply(b, goog.array.flatten.apply(null, d)) : b.push(d); } - return b + return b; }; goog.array.rotate = function(a, b) { goog.asserts.assert(null != a.length); a.length && (b %= a.length, 0 < b ? goog.array.ARRAY_PROTOTYPE_.unshift.apply(a, a.splice(-b, b)) : 0 > b && goog.array.ARRAY_PROTOTYPE_.push.apply(a, a.splice(0, -b))); - return a + return a; +}; +goog.array.moveItem = function(a, b, c) { + goog.asserts.assert(0 <= b && b < a.length); + goog.asserts.assert(0 <= c && c < a.length); + b = goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1); + goog.array.ARRAY_PROTOTYPE_.splice.call(a, c, 0, b[0]); }; goog.array.zip = function(a) { - if(!arguments.length) { - return[] + if (!arguments.length) { + return[]; } - for(var b = [], c = 0;;c++) { - for(var d = [], e = 0;e < arguments.length;e++) { + for (var b = [], c = 0;;c++) { + for (var d = [], e = 0;e < arguments.length;e++) { var f = arguments[e]; - if(c >= f.length) { - return b + if (c >= f.length) { + return b; } - d.push(f[c]) + d.push(f[c]); } - b.push(d) + b.push(d); } }; goog.array.shuffle = function(a, b) { - for(var c = b || Math.random, d = a.length - 1;0 < d;d--) { + for (var c = b || Math.random, d = a.length - 1;0 < d;d--) { var e = Math.floor(c() * (d + 1)), f = a[d]; a[d] = a[e]; - a[e] = f + a[e] = f; } }; -goog.object = {}; -goog.object.forEach = function(a, b, c) { - for(var d in a) { - b.call(c, a[d], d, a) - } +var cljs = {core:{}}; +cljs.core._STAR_clojurescript_version_STAR_ = "0.0-2913"; +cljs.core._STAR_unchecked_if_STAR_ = !1; +"undefined" === typeof cljs.core._STAR_print_fn_STAR_ && (cljs.core._STAR_print_fn_STAR_ = function(a) { + throw Error("No *print-fn* fn set for evaluation environment"); +}); +cljs.core.set_print_fn_BANG_ = function(a) { + return cljs.core._STAR_print_fn_STAR_ = a; }; -goog.object.filter = function(a, b, c) { - var d = {}, e; - for(e in a) { - b.call(c, a[e], e, a) && (d[e] = a[e]) - } - return d +cljs.core._STAR_flush_on_newline_STAR_ = !0; +cljs.core._STAR_print_newline_STAR_ = !0; +cljs.core._STAR_print_readably_STAR_ = !0; +cljs.core._STAR_print_meta_STAR_ = !1; +cljs.core._STAR_print_dup_STAR_ = !1; +cljs.core._STAR_print_length_STAR_ = null; +cljs.core._STAR_print_level_STAR_ = null; +"undefined" === typeof cljs.core._STAR_loaded_libs_STAR_ && (cljs.core._STAR_loaded_libs_STAR_ = null); +cljs.core.pr_opts = function() { + return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", -151457939), cljs.core._STAR_flush_on_newline_STAR_, new cljs.core.Keyword(null, "readably", "readably", 1129599760), cljs.core._STAR_print_readably_STAR_, new cljs.core.Keyword(null, "meta", "meta", 1499536964), cljs.core._STAR_print_meta_STAR_, new cljs.core.Keyword(null, "dup", "dup", 556298533), cljs.core._STAR_print_dup_STAR_, new cljs.core.Keyword(null, "print-length", "print-length", + 1931866356), cljs.core._STAR_print_length_STAR_], null); }; -goog.object.map = function(a, b, c) { - var d = {}, e; - for(e in a) { - d[e] = b.call(c, a[e], e, a) - } - return d +cljs.core.enable_console_print_BANG_ = function() { + cljs.core._STAR_print_newline_STAR_ = !1; + return cljs.core._STAR_print_fn_STAR_ = function() { + var a = function(a) { + return console.log.apply(console, cljs.core.into_array.cljs$core$IFn$_invoke$arity$1 ? cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.into_array.call(null, a)); + }, b = function(b) { + var d = null; + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); + }; + b.cljs$lang$maxFixedArity = 0; + b.cljs$lang$applyTo = function(b) { + b = cljs.core.seq(b); + return a(b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(); }; -goog.object.some = function(a, b, c) { - for(var d in a) { - if(b.call(c, a[d], d, a)) { - return!0 - } - } - return!1 +cljs.core.truth_ = function(a) { + return null != a && !1 !== a; }; -goog.object.every = function(a, b, c) { - for(var d in a) { - if(!b.call(c, a[d], d, a)) { - return!1 - } - } - return!0 +cljs.core.not_native = null; +cljs.core.identical_QMARK_ = function(a, b) { + return a === b; }; -goog.object.getCount = function(a) { - var b = 0, c; - for(c in a) { - b++ - } - return b +cljs.core.nil_QMARK_ = function(a) { + return null == a; }; -goog.object.getAnyKey = function(a) { - for(var b in a) { - return b - } +cljs.core.array_QMARK_ = function(a) { + return a instanceof Array; }; -goog.object.getAnyValue = function(a) { - for(var b in a) { - return a[b] - } +cljs.core.number_QMARK_ = function(a) { + return "number" === typeof a; }; -goog.object.contains = function(a, b) { - return goog.object.containsValue(a, b) -}; -goog.object.getValues = function(a) { - var b = [], c = 0, d; - for(d in a) { - b[c++] = a[d] - } - return b -}; -goog.object.getKeys = function(a) { - var b = [], c = 0, d; - for(d in a) { - b[c++] = d - } - return b -}; -goog.object.getValueByKeys = function(a, b) { - for(var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { - } - return a -}; -goog.object.containsKey = function(a, b) { - return b in a -}; -goog.object.containsValue = function(a, b) { - for(var c in a) { - if(a[c] == b) { - return!0 - } - } - return!1 -}; -goog.object.findKey = function(a, b, c) { - for(var d in a) { - if(b.call(c, a[d], d, a)) { - return d - } - } -}; -goog.object.findValue = function(a, b, c) { - return(b = goog.object.findKey(a, b, c)) && a[b] -}; -goog.object.isEmpty = function(a) { - for(var b in a) { - return!1 - } - return!0 -}; -goog.object.clear = function(a) { - for(var b in a) { - delete a[b] - } -}; -goog.object.remove = function(a, b) { - var c; - (c = b in a) && delete a[b]; - return c -}; -goog.object.add = function(a, b, c) { - if(b in a) { - throw Error('The object already contains the key "' + b + '"'); - } - goog.object.set(a, b, c) -}; -goog.object.get = function(a, b, c) { - return b in a ? a[b] : c -}; -goog.object.set = function(a, b, c) { - a[b] = c -}; -goog.object.setIfUndefined = function(a, b, c) { - return b in a ? a[b] : a[b] = c -}; -goog.object.clone = function(a) { - var b = {}, c; - for(c in a) { - b[c] = a[c] - } - return b -}; -goog.object.unsafeClone = function(a) { - var b = goog.typeOf(a); - if("object" == b || "array" == b) { - if(a.clone) { - return a.clone() - } - var b = "array" == b ? [] : {}, c; - for(c in a) { - b[c] = goog.object.unsafeClone(a[c]) - } - return b - } - return a -}; -goog.object.transpose = function(a) { - var b = {}, c; - for(c in a) { - b[a[c]] = c - } - return b -}; -goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); -goog.object.extend = function(a, b) { - for(var c, d, e = 1;e < arguments.length;e++) { - d = arguments[e]; - for(c in d) { - a[c] = d[c] - } - for(var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { - c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]) - } - } -}; -goog.object.create = function(a) { - var b = arguments.length; - if(1 == b && goog.isArray(arguments[0])) { - return goog.object.create.apply(null, arguments[0]) - } - if(b % 2) { - throw Error("Uneven number of arguments"); - } - for(var c = {}, d = 0;d < b;d += 2) { - c[arguments[d]] = arguments[d + 1] - } - return c -}; -goog.object.createSet = function(a) { - var b = arguments.length; - if(1 == b && goog.isArray(arguments[0])) { - return goog.object.createSet.apply(null, arguments[0]) - } - for(var c = {}, d = 0;d < b;d++) { - c[arguments[d]] = !0 - } - return c -}; -goog.object.createImmutableView = function(a) { - var b = a; - Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b)); - return b -}; -goog.object.isImmutableView = function(a) { - return!!Object.isFrozen && Object.isFrozen(a) -}; -goog.string.StringBuffer = function(a, b) { - null != a && this.append.apply(this, arguments) -}; -goog.string.StringBuffer.prototype.buffer_ = ""; -goog.string.StringBuffer.prototype.set = function(a) { - this.buffer_ = "" + a -}; -goog.string.StringBuffer.prototype.append = function(a, b, c) { - this.buffer_ += a; - if(null != b) { - for(var d = 1;d < arguments.length;d++) { - this.buffer_ += arguments[d] - } - } - return this -}; -goog.string.StringBuffer.prototype.clear = function() { - this.buffer_ = "" -}; -goog.string.StringBuffer.prototype.getLength = function() { - return this.buffer_.length -}; -goog.string.StringBuffer.prototype.toString = function() { - return this.buffer_ -}; -var cljs = {core:{}}; -cljs.core._STAR_unchecked_if_STAR_ = !1; -cljs.core._STAR_print_fn_STAR_ = function(a) { - throw Error("No *print-fn* fn set for evaluation environment"); -}; -cljs.core.set_print_fn_BANG_ = function(a) { - return cljs.core._STAR_print_fn_STAR_ = a -}; -cljs.core._STAR_flush_on_newline_STAR_ = !0; -cljs.core._STAR_print_newline_STAR_ = !0; -cljs.core._STAR_print_readably_STAR_ = !0; -cljs.core._STAR_print_meta_STAR_ = !1; -cljs.core._STAR_print_dup_STAR_ = !1; -cljs.core._STAR_print_length_STAR_ = null; -cljs.core._STAR_print_level_STAR_ = null; -cljs.core.pr_opts = function() { - return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857), cljs.core._STAR_flush_on_newline_STAR_, new cljs.core.Keyword(null, "readably", "readably", 4441712502), cljs.core._STAR_print_readably_STAR_, new cljs.core.Keyword(null, "meta", "meta", 1017252215), cljs.core._STAR_print_meta_STAR_, new cljs.core.Keyword(null, "dup", "dup", 1014004081), cljs.core._STAR_print_dup_STAR_, new cljs.core.Keyword(null, "print-length", "print-length", - 3960797560), cljs.core._STAR_print_length_STAR_], null) -}; -cljs.core.enable_console_print_BANG_ = function() { - cljs.core._STAR_print_newline_STAR_ = !1; - return cljs.core._STAR_print_fn_STAR_ = function() { - var a = function(a) { - return console.log.apply(console, cljs.core.into_array.call(null, a)) - }, b = function(b) { - var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) - }; - b.cljs$lang$maxFixedArity = 0; - b.cljs$lang$applyTo = function(b) { - b = cljs.core.seq(b); - return a(b) - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }() -}; -cljs.core.truth_ = function(a) { - return null != a && !1 !== a -}; -cljs.core.not_native = null; -cljs.core.identical_QMARK_ = function(a, b) { - return a === b -}; -cljs.core.nil_QMARK_ = function(a) { - return null == a -}; -cljs.core.array_QMARK_ = function(a) { - return a instanceof Array +cljs.core.not = function(a) { + return cljs.core.truth_(a) ? !1 : !0; }; -cljs.core.number_QMARK_ = function(a) { - return"number" === typeof a +cljs.core.some_QMARK_ = function(a) { + return null != a; }; -cljs.core.not = function(a) { - return cljs.core.truth_(a) ? !1 : !0 +cljs.core.object_QMARK_ = function(a) { + return null != a ? a.constructor === Object : !1; }; cljs.core.string_QMARK_ = function(a) { - return goog.isString(a) + return goog.isString(a); }; cljs.core.native_satisfies_QMARK_ = function(a, b) { - return a[goog.typeOf(null == b ? null : b)] ? !0 : a._ ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null + var c; + c = goog.typeOf(null == b ? null : b); + return a[c] ? !0 : a._ ? !0 : !1; }; cljs.core.is_proto_ = function(a) { - return a.constructor.prototype === a + return a.constructor.prototype === a; }; cljs.core._STAR_main_cli_fn_STAR_ = null; cljs.core.type = function(a) { - return null == a ? null : a.constructor + return null == a ? null : a.constructor; }; cljs.core.missing_protocol = function(a, b) { - var c = cljs.core.type.call(null, b), c = cljs.core.truth_(cljs.core.truth_(c) ? c.cljs$lang$type : c) ? c.cljs$lang$ctorStr : goog.typeOf(b); - return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")) + var c = cljs.core.type(b), c = cljs.core.truth_(cljs.core.truth_(c) ? c.cljs$lang$type : c) ? c.cljs$lang$ctorStr : goog.typeOf(b); + return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")); }; cljs.core.type__GT_str = function(a) { var b = a.cljs$lang$ctorStr; - return cljs.core.truth_(b) ? b : "" + cljs.core.str(a) + return cljs.core.truth_(b) ? b : "" + cljs.core.str(a); }; +cljs.core.load_file = function(a) { + return cljs.core.truth_(COMPILED) ? null : goog.importScript_(a); +}; +"undefined" !== typeof Symbol && "function" === function() { + return goog.typeOf(Symbol); +}() ? cljs.core.ITER_SYMBOL = Symbol.iterator : cljs.core.ITER_SYMBOL = "@@iterator"; cljs.core.make_array = function() { - var a = null, b = function(b, d) { - return a.call(null, d) - }, a = function(a, d) { + var a = null, a = function(b, c) { switch(arguments.length) { case 1: - return Array(a); + return Array(b); case 2: - return b.call(this, a, d) + return a.cljs$core$IFn$_invoke$arity$1(c); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return Array(a) + return Array(a); }; - a.cljs$core$IFn$_invoke$arity$2 = b; - return a + a.cljs$core$IFn$_invoke$arity$2 = function(b, c) { + return a.cljs$core$IFn$_invoke$arity$1(c); + }; + return a; }(); cljs.core.aclone = function(a) { - for(var b = a.length, c = Array(b), d = 0;;) { - if(d < b) { - c[d] = a[d], d += 1 - }else { - break + for (var b = a.length, c = Array(b), d = 0;;) { + if (d < b) { + c[d] = a[d], d += 1; + } else { + break; } } - return c + return c; }; cljs.core.array = function(a) { - return Array.prototype.slice.call(arguments) + for (var b = Array(arguments.length), c = 0;;) { + if (c < b.length) { + b[c] = arguments[c], c += 1; + } else { + return b; + } + } }; cljs.core.aget = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.apply.call(null, a, a.call(null, b, c), d) + var h = a; + b = a.cljs$core$IFn$_invoke$arity$2(b, c); + return cljs.core.apply.cljs$core$IFn$_invoke$arity$3 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$3(h, b, d) : cljs.core.apply.call(null, h, b, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -1505,35 +1681,49 @@ cljs.core.aget = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 2: return a[d]; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a[b] + return a[b]; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.aset = function() { var a = null, b = function() { var b = function(b, c, d, h) { - return cljs.core.apply.call(null, a, b[c], d, h) + var k = a; + b = b[c]; + return cljs.core.apply.cljs$core$IFn$_invoke$arity$4 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$4(k, b, d, h) : cljs.core.apply.call(null, k, b, d, h); }, d = function(a, d, g, h) { var k = null; - 3 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, d, g, k) + if (3 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 3);k < l.length;) { + l[k] = arguments[k + 3], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, d, g, k); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -1543,312 +1733,422 @@ cljs.core.aset = function() { a = cljs.core.next(a); var h = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, h, a) + return b(d, g, h, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e, f) { switch(arguments.length) { case 3: return a[d] = e; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, e, cljs.core.array_seq(arguments, 3)) + var g = null; + if (3 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { + h[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$3 = function(a, b, e) { - return a[b] = e + return a[b] = e; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.alength = function(a) { - return a.length + return a.length; }; cljs.core.into_array = function() { var a = null, b = function(b) { - return a.call(null, null, b) + return a.cljs$core$IFn$_invoke$arity$2(null, b); }, c = function(a, b) { - return cljs.core.reduce.call(null, function(a, b) { + var c = function(a, b) { a.push(b); - return a - }, [], b) + return a; + }, g = []; + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(c, g, b) : cljs.core.reduce.call(null, c, g, b); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; +}(); +cljs.core.js_invoke = function() { + var a = function(a, b, e) { + return a[b].apply(a, cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(e)); + }, b = function(b, d, e) { + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return a.call(this, b, d, f); + }; + b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$applyTo = function(b) { + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.rest(b); + return a(d, e, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; }(); cljs.core.Fn = function() { - return{} + return{}; }(); cljs.core.IFn = function() { - return{} + return{}; }(); cljs.core._invoke = function() { var a = null, b = function(a) { - if(a ? a.cljs$core$IFn$_invoke$arity$1 : a) { - return a.cljs$core$IFn$_invoke$arity$1(a) + if (a ? a.cljs$core$IFn$_invoke$arity$1 : a) { + return a.cljs$core$IFn$_invoke$arity$1(a); } var b; - b = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._invoke._, !b)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + b = cljs.core._invoke; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._invoke._, !b)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return b.call(null, a) + return b.call(null, a); }, c = function(a, b) { - if(a ? a.cljs$core$IFn$_invoke$arity$2 : a) { - return a.cljs$core$IFn$_invoke$arity$2(a, b) + if (a ? a.cljs$core$IFn$_invoke$arity$2 : a) { + return a.cljs$core$IFn$_invoke$arity$2(a, b); } var c; - c = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._invoke._, !c)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + c = cljs.core._invoke; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._invoke._, !c)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, d = function(a, b, c) { - if(a ? a.cljs$core$IFn$_invoke$arity$3 : a) { - return a.cljs$core$IFn$_invoke$arity$3(a, b, c) + if (a ? a.cljs$core$IFn$_invoke$arity$3 : a) { + return a.cljs$core$IFn$_invoke$arity$3(a, b, c); } var d; - d = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._invoke._, !d)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + d = cljs.core._invoke; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._invoke._, !d)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }, e = function(a, b, c, d) { - if(a ? a.cljs$core$IFn$_invoke$arity$4 : a) { - return a.cljs$core$IFn$_invoke$arity$4(a, b, c, d) + if (a ? a.cljs$core$IFn$_invoke$arity$4 : a) { + return a.cljs$core$IFn$_invoke$arity$4(a, b, c, d); } var e; - e = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!e && (e = cljs.core._invoke._, !e)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + e = cljs.core._invoke; + var f; + f = goog.typeOf(null == a ? null : a); + e = e[f]; + if (!e && (e = cljs.core._invoke._, !e)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return e.call(null, a, b, c, d) + return e.call(null, a, b, c, d); }, f = function(a, b, c, d, e) { - if(a ? a.cljs$core$IFn$_invoke$arity$5 : a) { - return a.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) + if (a ? a.cljs$core$IFn$_invoke$arity$5 : a) { + return a.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e); } var f; - f = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!f && (f = cljs.core._invoke._, !f)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + f = cljs.core._invoke; + var g; + g = goog.typeOf(null == a ? null : a); + f = f[g]; + if (!f && (f = cljs.core._invoke._, !f)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return f.call(null, a, b, c, d, e) + return f.call(null, a, b, c, d, e); }, g = function(a, b, c, d, e, f) { - if(a ? a.cljs$core$IFn$_invoke$arity$6 : a) { - return a.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) + if (a ? a.cljs$core$IFn$_invoke$arity$6 : a) { + return a.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f); } var g; - g = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._invoke._, !g)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + g = cljs.core._invoke; + var h; + h = goog.typeOf(null == a ? null : a); + g = g[h]; + if (!g && (g = cljs.core._invoke._, !g)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return g.call(null, a, b, c, d, e, f) + return g.call(null, a, b, c, d, e, f); }, h = function(a, b, c, d, e, f, g) { - if(a ? a.cljs$core$IFn$_invoke$arity$7 : a) { - return a.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) + if (a ? a.cljs$core$IFn$_invoke$arity$7 : a) { + return a.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g); } var h; - h = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!h && (h = cljs.core._invoke._, !h)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + h = cljs.core._invoke; + var k; + k = goog.typeOf(null == a ? null : a); + h = h[k]; + if (!h && (h = cljs.core._invoke._, !h)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return h.call(null, a, b, c, d, e, f, g) + return h.call(null, a, b, c, d, e, f, g); }, k = function(a, b, c, d, e, f, g, h) { - if(a ? a.cljs$core$IFn$_invoke$arity$8 : a) { - return a.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) + if (a ? a.cljs$core$IFn$_invoke$arity$8 : a) { + return a.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h); } var k; - k = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!k && (k = cljs.core._invoke._, !k)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + k = cljs.core._invoke; + var l; + l = goog.typeOf(null == a ? null : a); + k = k[l]; + if (!k && (k = cljs.core._invoke._, !k)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return k.call(null, a, b, c, d, e, f, g, h) + return k.call(null, a, b, c, d, e, f, g, h); }, l = function(a, b, c, d, e, f, g, h, k) { - if(a ? a.cljs$core$IFn$_invoke$arity$9 : a) { - return a.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) + if (a ? a.cljs$core$IFn$_invoke$arity$9 : a) { + return a.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k); } var l; - l = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!l && (l = cljs.core._invoke._, !l)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + l = cljs.core._invoke; + var m; + m = goog.typeOf(null == a ? null : a); + l = l[m]; + if (!l && (l = cljs.core._invoke._, !l)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return l.call(null, a, b, c, d, e, f, g, h, k) + return l.call(null, a, b, c, d, e, f, g, h, k); }, m = function(a, b, c, d, e, f, g, h, k, l) { - if(a ? a.cljs$core$IFn$_invoke$arity$10 : a) { - return a.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) + if (a ? a.cljs$core$IFn$_invoke$arity$10 : a) { + return a.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l); } var m; - m = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!m && (m = cljs.core._invoke._, !m)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + m = cljs.core._invoke; + var q; + q = goog.typeOf(null == a ? null : a); + m = m[q]; + if (!m && (m = cljs.core._invoke._, !m)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return m.call(null, a, b, c, d, e, f, g, h, k, l) + return m.call(null, a, b, c, d, e, f, g, h, k, l); }, n = function(a, b, c, d, e, f, g, h, k, l, m) { - if(a ? a.cljs$core$IFn$_invoke$arity$11 : a) { - return a.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) + if (a ? a.cljs$core$IFn$_invoke$arity$11 : a) { + return a.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m); } + var q; + q = cljs.core._invoke; var n; - n = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!n && (n = cljs.core._invoke._, !n)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); - } - return n.call(null, a, b, c, d, e, f, g, h, k, l, m) - }, p = function(a, b, c, d, e, f, g, h, k, l, m, n) { - if(a ? a.cljs$core$IFn$_invoke$arity$12 : a) { - return a.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) - } - var p; - p = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!p && (p = cljs.core._invoke._, !p)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + n = goog.typeOf(null == a ? null : a); + q = q[n]; + if (!q && (q = cljs.core._invoke._, !q)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return p.call(null, a, b, c, d, e, f, g, h, k, l, m, n) - }, q = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { - if(a ? a.cljs$core$IFn$_invoke$arity$13 : a) { - return a.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) + return q.call(null, a, b, c, d, e, f, g, h, k, l, m); + }, p = function(a, b, c, d, e, f, g, h, k, l, m, q) { + if (a ? a.cljs$core$IFn$_invoke$arity$12 : a) { + return a.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, q); } - var q; - q = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!q && (q = cljs.core._invoke._, !q)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + var n; + n = cljs.core._invoke; + var r; + r = goog.typeOf(null == a ? null : a); + n = n[r]; + if (!n && (n = cljs.core._invoke._, !n)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return q.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p) - }, r = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { - if(a ? a.cljs$core$IFn$_invoke$arity$14 : a) { - return a.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) + return n.call(null, a, b, c, d, e, f, g, h, k, l, m, q); + }, q = function(a, b, c, d, e, f, g, h, k, l, m, q, n) { + if (a ? a.cljs$core$IFn$_invoke$arity$13 : a) { + return a.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, q, n); } var r; - r = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!r && (r = cljs.core._invoke._, !r)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + r = cljs.core._invoke; + var p; + p = goog.typeOf(null == a ? null : a); + r = r[p]; + if (!r && (r = cljs.core._invoke._, !r)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return r.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q) - }, s = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { - if(a ? a.cljs$core$IFn$_invoke$arity$15 : a) { - return a.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) + return r.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n); + }, r = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r) { + if (a ? a.cljs$core$IFn$_invoke$arity$14 : a) { + return a.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, q, n, r); } + var p; + p = cljs.core._invoke; var s; - s = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!s && (s = cljs.core._invoke._, !s)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + s = goog.typeOf(null == a ? null : a); + p = p[s]; + if (!p && (p = cljs.core._invoke._, !p)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return s.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) - }, t = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { - if(a ? a.cljs$core$IFn$_invoke$arity$16 : a) { - return a.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) + return p.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r); + }, s = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p) { + if (a ? a.cljs$core$IFn$_invoke$arity$15 : a) { + return a.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p); } + var s; + s = cljs.core._invoke; var t; - t = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!t && (t = cljs.core._invoke._, !t)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + t = goog.typeOf(null == a ? null : a); + s = s[t]; + if (!s && (s = cljs.core._invoke._, !s)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return t.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) - }, v = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { - if(a ? a.cljs$core$IFn$_invoke$arity$17 : a) { - return a.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) + return s.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p); + }, t = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) { + if (a ? a.cljs$core$IFn$_invoke$arity$16 : a) { + return a.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); } + var t; + t = cljs.core._invoke; var u; - u = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!u && (u = cljs.core._invoke._, !u)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); - } - return u.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) - }, u = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { - if(a ? a.cljs$core$IFn$_invoke$arity$18 : a) { - return a.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) - } - var w; - w = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!w && (w = cljs.core._invoke._, !w)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + u = goog.typeOf(null == a ? null : a); + t = t[u]; + if (!t && (t = cljs.core._invoke._, !t)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return w.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) - }, w = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) { - if(a ? a.cljs$core$IFn$_invoke$arity$19 : a) { - return a.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) + return t.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); + }, u = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) { + if (a ? a.cljs$core$IFn$_invoke$arity$17 : a) { + return a.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); } + var u; + u = cljs.core._invoke; var v; - v = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!v && (v = cljs.core._invoke._, !v)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + v = goog.typeOf(null == a ? null : a); + u = u[v]; + if (!u && (u = cljs.core._invoke._, !u)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - return v.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) - }, B = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) { - if(a ? a.cljs$core$IFn$_invoke$arity$20 : a) { - return a.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) + return u.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); + }, v = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) { + if (a ? a.cljs$core$IFn$_invoke$arity$18 : a) { + return a.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); } - var B; - B = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!B && (B = cljs.core._invoke._, !B)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); - } - return B.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) - }, I = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) { - if(a ? a.cljs$core$IFn$_invoke$arity$21 : a) { - return a.cljs$core$IFn$_invoke$arity$21(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) + var v; + v = cljs.core._invoke; + var w; + w = goog.typeOf(null == a ? null : a); + v = v[w]; + if (!v && (v = cljs.core._invoke._, !v)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); } - var I; - I = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!I && (I = cljs.core._invoke._, !I)) { - throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + return v.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); + }, w = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) { + if (a ? a.cljs$core$IFn$_invoke$arity$19 : a) { + return a.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); } - return I.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) - }, a = function(a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T) { + var w; + w = cljs.core._invoke; + var y; + y = goog.typeOf(null == a ? null : a); + w = w[y]; + if (!w && (w = cljs.core._invoke._, !w)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); + } + return w.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); + }, y = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) { + if (a ? a.cljs$core$IFn$_invoke$arity$20 : a) { + return a.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); + } + var y; + y = cljs.core._invoke; + var F; + F = goog.typeOf(null == a ? null : a); + y = y[F]; + if (!y && (y = cljs.core._invoke._, !y)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); + } + return y.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); + }, F = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) { + if (a ? a.cljs$core$IFn$_invoke$arity$21 : a) { + return a.cljs$core$IFn$_invoke$arity$21(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); + } + var F; + F = cljs.core._invoke; + var L; + L = goog.typeOf(null == a ? null : a); + F = F[L]; + if (!F && (F = cljs.core._invoke._, !F)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); + } + return F.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); + }, L = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) { + if (a ? a.cljs$core$IFn$_invoke$arity$22 : a) { + return a.cljs$core$IFn$_invoke$arity$22(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); + } + var L; + L = cljs.core._invoke; + var V; + V = goog.typeOf(null == a ? null : a); + L = L[V]; + if (!L && (L = cljs.core._invoke._, !L)) { + throw cljs.core.missing_protocol("IFn.-invoke", a); + } + return L.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); + }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { switch(arguments.length) { case 1: return b.call(this, a); case 2: return c.call(this, a, x); case 3: - return d.call(this, a, x, y); + return d.call(this, a, x, z); case 4: - return e.call(this, a, x, y, z); + return e.call(this, a, x, z, A); case 5: - return f.call(this, a, x, y, z, A); + return f.call(this, a, x, z, A, B); case 6: - return g.call(this, a, x, y, z, A, C); + return g.call(this, a, x, z, A, B, C); case 7: - return h.call(this, a, x, y, z, A, C, D); + return h.call(this, a, x, z, A, B, C, D); case 8: - return k.call(this, a, x, y, z, A, C, D, E); + return k.call(this, a, x, z, A, B, C, D, E); case 9: - return l.call(this, a, x, y, z, A, C, D, E, F); + return l.call(this, a, x, z, A, B, C, D, E, G); case 10: - return m.call(this, a, x, y, z, A, C, D, E, F, G); + return m.call(this, a, x, z, A, B, C, D, E, G, H); case 11: - return n.call(this, a, x, y, z, A, C, D, E, F, G, H); + return n.call(this, a, x, z, A, B, C, D, E, G, H, I); case 12: - return p.call(this, a, x, y, z, A, C, D, E, F, G, H, J); + return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); case 13: - return q.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K); + return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); case 14: - return r.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L); + return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); case 15: - return s.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M); + return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); case 16: - return t.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N); + return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); case 17: - return v.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O); + return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); case 18: - return u.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P); + return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); case 19: - return w.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q); + return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); case 20: - return B.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S); + return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); case 21: - return I.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T) + return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); + case 22: + return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); } throw Error("Invalid arity: " + arguments.length); }; @@ -1868,846 +2168,1250 @@ cljs.core._invoke = function() { a.cljs$core$IFn$_invoke$arity$14 = r; a.cljs$core$IFn$_invoke$arity$15 = s; a.cljs$core$IFn$_invoke$arity$16 = t; - a.cljs$core$IFn$_invoke$arity$17 = v; - a.cljs$core$IFn$_invoke$arity$18 = u; + a.cljs$core$IFn$_invoke$arity$17 = u; + a.cljs$core$IFn$_invoke$arity$18 = v; a.cljs$core$IFn$_invoke$arity$19 = w; - a.cljs$core$IFn$_invoke$arity$20 = B; - a.cljs$core$IFn$_invoke$arity$21 = I; - return a + a.cljs$core$IFn$_invoke$arity$20 = y; + a.cljs$core$IFn$_invoke$arity$21 = F; + a.cljs$core$IFn$_invoke$arity$22 = L; + return a; }(); +cljs.core.ICloneable = function() { + return{}; +}(); +cljs.core._clone = function(a) { + if (a ? a.cljs$core$ICloneable$_clone$arity$1 : a) { + return a.cljs$core$ICloneable$_clone$arity$1(a); + } + var b; + b = cljs.core._clone; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._clone._, !b)) { + throw cljs.core.missing_protocol("ICloneable.-clone", a); + } + return b.call(null, a); +}; cljs.core.ICounted = function() { - return{} + return{}; }(); cljs.core._count = function(a) { - if(a ? a.cljs$core$ICounted$_count$arity$1 : a) { - return a.cljs$core$ICounted$_count$arity$1(a) + if (a ? a.cljs$core$ICounted$_count$arity$1 : a) { + return a.cljs$core$ICounted$_count$arity$1(a); } var b; - b = cljs.core._count[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._count._, !b)) { - throw cljs.core.missing_protocol.call(null, "ICounted.-count", a); + b = cljs.core._count; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._count._, !b)) { + throw cljs.core.missing_protocol("ICounted.-count", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IEmptyableCollection = function() { - return{} + return{}; }(); cljs.core._empty = function(a) { - if(a ? a.cljs$core$IEmptyableCollection$_empty$arity$1 : a) { - return a.cljs$core$IEmptyableCollection$_empty$arity$1(a) + if (a ? a.cljs$core$IEmptyableCollection$_empty$arity$1 : a) { + return a.cljs$core$IEmptyableCollection$_empty$arity$1(a); } var b; - b = cljs.core._empty[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._empty._, !b)) { - throw cljs.core.missing_protocol.call(null, "IEmptyableCollection.-empty", a); + b = cljs.core._empty; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._empty._, !b)) { + throw cljs.core.missing_protocol("IEmptyableCollection.-empty", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ICollection = function() { - return{} + return{}; }(); cljs.core._conj = function(a, b) { - if(a ? a.cljs$core$ICollection$_conj$arity$2 : a) { - return a.cljs$core$ICollection$_conj$arity$2(a, b) + if (a ? a.cljs$core$ICollection$_conj$arity$2 : a) { + return a.cljs$core$ICollection$_conj$arity$2(a, b); } var c; - c = cljs.core._conj[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._conj._, !c)) { - throw cljs.core.missing_protocol.call(null, "ICollection.-conj", a); + c = cljs.core._conj; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._conj._, !c)) { + throw cljs.core.missing_protocol("ICollection.-conj", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IIndexed = function() { - return{} + return{}; }(); cljs.core._nth = function() { var a = null, b = function(a, b) { - if(a ? a.cljs$core$IIndexed$_nth$arity$2 : a) { - return a.cljs$core$IIndexed$_nth$arity$2(a, b) + if (a ? a.cljs$core$IIndexed$_nth$arity$2 : a) { + return a.cljs$core$IIndexed$_nth$arity$2(a, b); } var c; - c = cljs.core._nth[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._nth._, !c)) { - throw cljs.core.missing_protocol.call(null, "IIndexed.-nth", a); + c = cljs.core._nth; + var g; + g = goog.typeOf(null == a ? null : a); + c = c[g]; + if (!c && (c = cljs.core._nth._, !c)) { + throw cljs.core.missing_protocol("IIndexed.-nth", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, c = function(a, b, c) { - if(a ? a.cljs$core$IIndexed$_nth$arity$3 : a) { - return a.cljs$core$IIndexed$_nth$arity$3(a, b, c) + if (a ? a.cljs$core$IIndexed$_nth$arity$3 : a) { + return a.cljs$core$IIndexed$_nth$arity$3(a, b, c); } var g; - g = cljs.core._nth[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._nth._, !g)) { - throw cljs.core.missing_protocol.call(null, "IIndexed.-nth", a); + g = cljs.core._nth; + var h; + h = goog.typeOf(null == a ? null : a); + g = g[h]; + if (!g && (g = cljs.core._nth._, !g)) { + throw cljs.core.missing_protocol("IIndexed.-nth", a); } - return g.call(null, a, b, c) + return g.call(null, a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.ASeq = function() { - return{} + return{}; }(); cljs.core.ISeq = function() { - return{} + return{}; }(); cljs.core._first = function(a) { - if(a ? a.cljs$core$ISeq$_first$arity$1 : a) { - return a.cljs$core$ISeq$_first$arity$1(a) + if (a ? a.cljs$core$ISeq$_first$arity$1 : a) { + return a.cljs$core$ISeq$_first$arity$1(a); } var b; - b = cljs.core._first[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._first._, !b)) { - throw cljs.core.missing_protocol.call(null, "ISeq.-first", a); + b = cljs.core._first; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._first._, !b)) { + throw cljs.core.missing_protocol("ISeq.-first", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._rest = function(a) { - if(a ? a.cljs$core$ISeq$_rest$arity$1 : a) { - return a.cljs$core$ISeq$_rest$arity$1(a) + if (a ? a.cljs$core$ISeq$_rest$arity$1 : a) { + return a.cljs$core$ISeq$_rest$arity$1(a); } var b; - b = cljs.core._rest[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._rest._, !b)) { - throw cljs.core.missing_protocol.call(null, "ISeq.-rest", a); + b = cljs.core._rest; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._rest._, !b)) { + throw cljs.core.missing_protocol("ISeq.-rest", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.INext = function() { - return{} + return{}; }(); cljs.core._next = function(a) { - if(a ? a.cljs$core$INext$_next$arity$1 : a) { - return a.cljs$core$INext$_next$arity$1(a) + if (a ? a.cljs$core$INext$_next$arity$1 : a) { + return a.cljs$core$INext$_next$arity$1(a); } var b; - b = cljs.core._next[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._next._, !b)) { - throw cljs.core.missing_protocol.call(null, "INext.-next", a); + b = cljs.core._next; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._next._, !b)) { + throw cljs.core.missing_protocol("INext.-next", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ILookup = function() { - return{} + return{}; }(); cljs.core._lookup = function() { var a = null, b = function(a, b) { - if(a ? a.cljs$core$ILookup$_lookup$arity$2 : a) { - return a.cljs$core$ILookup$_lookup$arity$2(a, b) + if (a ? a.cljs$core$ILookup$_lookup$arity$2 : a) { + return a.cljs$core$ILookup$_lookup$arity$2(a, b); } var c; - c = cljs.core._lookup[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._lookup._, !c)) { - throw cljs.core.missing_protocol.call(null, "ILookup.-lookup", a); + c = cljs.core._lookup; + var g; + g = goog.typeOf(null == a ? null : a); + c = c[g]; + if (!c && (c = cljs.core._lookup._, !c)) { + throw cljs.core.missing_protocol("ILookup.-lookup", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, c = function(a, b, c) { - if(a ? a.cljs$core$ILookup$_lookup$arity$3 : a) { - return a.cljs$core$ILookup$_lookup$arity$3(a, b, c) + if (a ? a.cljs$core$ILookup$_lookup$arity$3 : a) { + return a.cljs$core$ILookup$_lookup$arity$3(a, b, c); } var g; - g = cljs.core._lookup[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._lookup._, !g)) { - throw cljs.core.missing_protocol.call(null, "ILookup.-lookup", a); + g = cljs.core._lookup; + var h; + h = goog.typeOf(null == a ? null : a); + g = g[h]; + if (!g && (g = cljs.core._lookup._, !g)) { + throw cljs.core.missing_protocol("ILookup.-lookup", a); } - return g.call(null, a, b, c) + return g.call(null, a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.IAssociative = function() { - return{} + return{}; }(); cljs.core._contains_key_QMARK_ = function(a, b) { - if(a ? a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 : a) { - return a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2(a, b) + if (a ? a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 : a) { + return a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2(a, b); } var c; - c = cljs.core._contains_key_QMARK_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._contains_key_QMARK_._, !c)) { - throw cljs.core.missing_protocol.call(null, "IAssociative.-contains-key?", a); + c = cljs.core._contains_key_QMARK_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._contains_key_QMARK_._, !c)) { + throw cljs.core.missing_protocol("IAssociative.-contains-key?", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._assoc = function(a, b, c) { - if(a ? a.cljs$core$IAssociative$_assoc$arity$3 : a) { - return a.cljs$core$IAssociative$_assoc$arity$3(a, b, c) + if (a ? a.cljs$core$IAssociative$_assoc$arity$3 : a) { + return a.cljs$core$IAssociative$_assoc$arity$3(a, b, c); } var d; - d = cljs.core._assoc[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc._, !d)) { - throw cljs.core.missing_protocol.call(null, "IAssociative.-assoc", a); + d = cljs.core._assoc; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._assoc._, !d)) { + throw cljs.core.missing_protocol("IAssociative.-assoc", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IMap = function() { - return{} + return{}; }(); cljs.core._dissoc = function(a, b) { - if(a ? a.cljs$core$IMap$_dissoc$arity$2 : a) { - return a.cljs$core$IMap$_dissoc$arity$2(a, b) + if (a ? a.cljs$core$IMap$_dissoc$arity$2 : a) { + return a.cljs$core$IMap$_dissoc$arity$2(a, b); } var c; - c = cljs.core._dissoc[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._dissoc._, !c)) { - throw cljs.core.missing_protocol.call(null, "IMap.-dissoc", a); + c = cljs.core._dissoc; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._dissoc._, !c)) { + throw cljs.core.missing_protocol("IMap.-dissoc", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IMapEntry = function() { - return{} + return{}; }(); cljs.core._key = function(a) { - if(a ? a.cljs$core$IMapEntry$_key$arity$1 : a) { - return a.cljs$core$IMapEntry$_key$arity$1(a) + if (a ? a.cljs$core$IMapEntry$_key$arity$1 : a) { + return a.cljs$core$IMapEntry$_key$arity$1(a); } var b; - b = cljs.core._key[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._key._, !b)) { - throw cljs.core.missing_protocol.call(null, "IMapEntry.-key", a); + b = cljs.core._key; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._key._, !b)) { + throw cljs.core.missing_protocol("IMapEntry.-key", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._val = function(a) { - if(a ? a.cljs$core$IMapEntry$_val$arity$1 : a) { - return a.cljs$core$IMapEntry$_val$arity$1(a) + if (a ? a.cljs$core$IMapEntry$_val$arity$1 : a) { + return a.cljs$core$IMapEntry$_val$arity$1(a); } var b; - b = cljs.core._val[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._val._, !b)) { - throw cljs.core.missing_protocol.call(null, "IMapEntry.-val", a); + b = cljs.core._val; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._val._, !b)) { + throw cljs.core.missing_protocol("IMapEntry.-val", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISet = function() { - return{} + return{}; }(); cljs.core._disjoin = function(a, b) { - if(a ? a.cljs$core$ISet$_disjoin$arity$2 : a) { - return a.cljs$core$ISet$_disjoin$arity$2(a, b) + if (a ? a.cljs$core$ISet$_disjoin$arity$2 : a) { + return a.cljs$core$ISet$_disjoin$arity$2(a, b); } var c; - c = cljs.core._disjoin[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._disjoin._, !c)) { - throw cljs.core.missing_protocol.call(null, "ISet.-disjoin", a); + c = cljs.core._disjoin; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._disjoin._, !c)) { + throw cljs.core.missing_protocol("ISet.-disjoin", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IStack = function() { - return{} + return{}; }(); cljs.core._peek = function(a) { - if(a ? a.cljs$core$IStack$_peek$arity$1 : a) { - return a.cljs$core$IStack$_peek$arity$1(a) + if (a ? a.cljs$core$IStack$_peek$arity$1 : a) { + return a.cljs$core$IStack$_peek$arity$1(a); } var b; - b = cljs.core._peek[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._peek._, !b)) { - throw cljs.core.missing_protocol.call(null, "IStack.-peek", a); + b = cljs.core._peek; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._peek._, !b)) { + throw cljs.core.missing_protocol("IStack.-peek", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._pop = function(a) { - if(a ? a.cljs$core$IStack$_pop$arity$1 : a) { - return a.cljs$core$IStack$_pop$arity$1(a) + if (a ? a.cljs$core$IStack$_pop$arity$1 : a) { + return a.cljs$core$IStack$_pop$arity$1(a); } var b; - b = cljs.core._pop[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._pop._, !b)) { - throw cljs.core.missing_protocol.call(null, "IStack.-pop", a); + b = cljs.core._pop; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._pop._, !b)) { + throw cljs.core.missing_protocol("IStack.-pop", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IVector = function() { - return{} + return{}; }(); cljs.core._assoc_n = function(a, b, c) { - if(a ? a.cljs$core$IVector$_assoc_n$arity$3 : a) { - return a.cljs$core$IVector$_assoc_n$arity$3(a, b, c) + if (a ? a.cljs$core$IVector$_assoc_n$arity$3 : a) { + return a.cljs$core$IVector$_assoc_n$arity$3(a, b, c); } var d; - d = cljs.core._assoc_n[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc_n._, !d)) { - throw cljs.core.missing_protocol.call(null, "IVector.-assoc-n", a); + d = cljs.core._assoc_n; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._assoc_n._, !d)) { + throw cljs.core.missing_protocol("IVector.-assoc-n", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IDeref = function() { - return{} + return{}; }(); cljs.core._deref = function(a) { - if(a ? a.cljs$core$IDeref$_deref$arity$1 : a) { - return a.cljs$core$IDeref$_deref$arity$1(a) + if (a ? a.cljs$core$IDeref$_deref$arity$1 : a) { + return a.cljs$core$IDeref$_deref$arity$1(a); } var b; - b = cljs.core._deref[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._deref._, !b)) { - throw cljs.core.missing_protocol.call(null, "IDeref.-deref", a); + b = cljs.core._deref; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._deref._, !b)) { + throw cljs.core.missing_protocol("IDeref.-deref", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IDerefWithTimeout = function() { - return{} + return{}; }(); cljs.core._deref_with_timeout = function(a, b, c) { - if(a ? a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3 : a) { - return a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3(a, b, c) + if (a ? a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3 : a) { + return a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3(a, b, c); } var d; - d = cljs.core._deref_with_timeout[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._deref_with_timeout._, !d)) { - throw cljs.core.missing_protocol.call(null, "IDerefWithTimeout.-deref-with-timeout", a); + d = cljs.core._deref_with_timeout; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._deref_with_timeout._, !d)) { + throw cljs.core.missing_protocol("IDerefWithTimeout.-deref-with-timeout", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IMeta = function() { - return{} + return{}; }(); cljs.core._meta = function(a) { - if(a ? a.cljs$core$IMeta$_meta$arity$1 : a) { - return a.cljs$core$IMeta$_meta$arity$1(a) + if (a ? a.cljs$core$IMeta$_meta$arity$1 : a) { + return a.cljs$core$IMeta$_meta$arity$1(a); } var b; - b = cljs.core._meta[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._meta._, !b)) { - throw cljs.core.missing_protocol.call(null, "IMeta.-meta", a); + b = cljs.core._meta; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._meta._, !b)) { + throw cljs.core.missing_protocol("IMeta.-meta", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IWithMeta = function() { - return{} + return{}; }(); cljs.core._with_meta = function(a, b) { - if(a ? a.cljs$core$IWithMeta$_with_meta$arity$2 : a) { - return a.cljs$core$IWithMeta$_with_meta$arity$2(a, b) + if (a ? a.cljs$core$IWithMeta$_with_meta$arity$2 : a) { + return a.cljs$core$IWithMeta$_with_meta$arity$2(a, b); } var c; - c = cljs.core._with_meta[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._with_meta._, !c)) { - throw cljs.core.missing_protocol.call(null, "IWithMeta.-with-meta", a); + c = cljs.core._with_meta; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._with_meta._, !c)) { + throw cljs.core.missing_protocol("IWithMeta.-with-meta", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IReduce = function() { - return{} + return{}; }(); cljs.core._reduce = function() { var a = null, b = function(a, b) { - if(a ? a.cljs$core$IReduce$_reduce$arity$2 : a) { - return a.cljs$core$IReduce$_reduce$arity$2(a, b) + if (a ? a.cljs$core$IReduce$_reduce$arity$2 : a) { + return a.cljs$core$IReduce$_reduce$arity$2(a, b); } var c; - c = cljs.core._reduce[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._reduce._, !c)) { - throw cljs.core.missing_protocol.call(null, "IReduce.-reduce", a); + c = cljs.core._reduce; + var g; + g = goog.typeOf(null == a ? null : a); + c = c[g]; + if (!c && (c = cljs.core._reduce._, !c)) { + throw cljs.core.missing_protocol("IReduce.-reduce", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, c = function(a, b, c) { - if(a ? a.cljs$core$IReduce$_reduce$arity$3 : a) { - return a.cljs$core$IReduce$_reduce$arity$3(a, b, c) + if (a ? a.cljs$core$IReduce$_reduce$arity$3 : a) { + return a.cljs$core$IReduce$_reduce$arity$3(a, b, c); } var g; - g = cljs.core._reduce[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._reduce._, !g)) { - throw cljs.core.missing_protocol.call(null, "IReduce.-reduce", a); + g = cljs.core._reduce; + var h; + h = goog.typeOf(null == a ? null : a); + g = g[h]; + if (!g && (g = cljs.core._reduce._, !g)) { + throw cljs.core.missing_protocol("IReduce.-reduce", a); } - return g.call(null, a, b, c) + return g.call(null, a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.IKVReduce = function() { - return{} + return{}; }(); cljs.core._kv_reduce = function(a, b, c) { - if(a ? a.cljs$core$IKVReduce$_kv_reduce$arity$3 : a) { - return a.cljs$core$IKVReduce$_kv_reduce$arity$3(a, b, c) + if (a ? a.cljs$core$IKVReduce$_kv_reduce$arity$3 : a) { + return a.cljs$core$IKVReduce$_kv_reduce$arity$3(a, b, c); } var d; - d = cljs.core._kv_reduce[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._kv_reduce._, !d)) { - throw cljs.core.missing_protocol.call(null, "IKVReduce.-kv-reduce", a); + d = cljs.core._kv_reduce; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._kv_reduce._, !d)) { + throw cljs.core.missing_protocol("IKVReduce.-kv-reduce", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IEquiv = function() { - return{} + return{}; }(); cljs.core._equiv = function(a, b) { - if(a ? a.cljs$core$IEquiv$_equiv$arity$2 : a) { - return a.cljs$core$IEquiv$_equiv$arity$2(a, b) + if (a ? a.cljs$core$IEquiv$_equiv$arity$2 : a) { + return a.cljs$core$IEquiv$_equiv$arity$2(a, b); } var c; - c = cljs.core._equiv[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._equiv._, !c)) { - throw cljs.core.missing_protocol.call(null, "IEquiv.-equiv", a); + c = cljs.core._equiv; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._equiv._, !c)) { + throw cljs.core.missing_protocol("IEquiv.-equiv", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IHash = function() { - return{} + return{}; }(); cljs.core._hash = function(a) { - if(a ? a.cljs$core$IHash$_hash$arity$1 : a) { - return a.cljs$core$IHash$_hash$arity$1(a) + if (a ? a.cljs$core$IHash$_hash$arity$1 : a) { + return a.cljs$core$IHash$_hash$arity$1(a); } var b; - b = cljs.core._hash[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._hash._, !b)) { - throw cljs.core.missing_protocol.call(null, "IHash.-hash", a); + b = cljs.core._hash; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._hash._, !b)) { + throw cljs.core.missing_protocol("IHash.-hash", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISeqable = function() { - return{} + return{}; }(); cljs.core._seq = function(a) { - if(a ? a.cljs$core$ISeqable$_seq$arity$1 : a) { - return a.cljs$core$ISeqable$_seq$arity$1(a) + if (a ? a.cljs$core$ISeqable$_seq$arity$1 : a) { + return a.cljs$core$ISeqable$_seq$arity$1(a); } var b; - b = cljs.core._seq[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._seq._, !b)) { - throw cljs.core.missing_protocol.call(null, "ISeqable.-seq", a); + b = cljs.core._seq; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._seq._, !b)) { + throw cljs.core.missing_protocol("ISeqable.-seq", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISequential = function() { - return{} + return{}; }(); cljs.core.IList = function() { - return{} + return{}; }(); cljs.core.IRecord = function() { - return{} + return{}; }(); cljs.core.IReversible = function() { - return{} + return{}; }(); cljs.core._rseq = function(a) { - if(a ? a.cljs$core$IReversible$_rseq$arity$1 : a) { - return a.cljs$core$IReversible$_rseq$arity$1(a) + if (a ? a.cljs$core$IReversible$_rseq$arity$1 : a) { + return a.cljs$core$IReversible$_rseq$arity$1(a); } var b; - b = cljs.core._rseq[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._rseq._, !b)) { - throw cljs.core.missing_protocol.call(null, "IReversible.-rseq", a); + b = cljs.core._rseq; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._rseq._, !b)) { + throw cljs.core.missing_protocol("IReversible.-rseq", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISorted = function() { - return{} + return{}; }(); cljs.core._sorted_seq = function(a, b) { - if(a ? a.cljs$core$ISorted$_sorted_seq$arity$2 : a) { - return a.cljs$core$ISorted$_sorted_seq$arity$2(a, b) + if (a ? a.cljs$core$ISorted$_sorted_seq$arity$2 : a) { + return a.cljs$core$ISorted$_sorted_seq$arity$2(a, b); } var c; - c = cljs.core._sorted_seq[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._sorted_seq._, !c)) { - throw cljs.core.missing_protocol.call(null, "ISorted.-sorted-seq", a); + c = cljs.core._sorted_seq; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._sorted_seq._, !c)) { + throw cljs.core.missing_protocol("ISorted.-sorted-seq", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._sorted_seq_from = function(a, b, c) { - if(a ? a.cljs$core$ISorted$_sorted_seq_from$arity$3 : a) { - return a.cljs$core$ISorted$_sorted_seq_from$arity$3(a, b, c) + if (a ? a.cljs$core$ISorted$_sorted_seq_from$arity$3 : a) { + return a.cljs$core$ISorted$_sorted_seq_from$arity$3(a, b, c); } var d; - d = cljs.core._sorted_seq_from[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._sorted_seq_from._, !d)) { - throw cljs.core.missing_protocol.call(null, "ISorted.-sorted-seq-from", a); + d = cljs.core._sorted_seq_from; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._sorted_seq_from._, !d)) { + throw cljs.core.missing_protocol("ISorted.-sorted-seq-from", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._entry_key = function(a, b) { - if(a ? a.cljs$core$ISorted$_entry_key$arity$2 : a) { - return a.cljs$core$ISorted$_entry_key$arity$2(a, b) + if (a ? a.cljs$core$ISorted$_entry_key$arity$2 : a) { + return a.cljs$core$ISorted$_entry_key$arity$2(a, b); } var c; - c = cljs.core._entry_key[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._entry_key._, !c)) { - throw cljs.core.missing_protocol.call(null, "ISorted.-entry-key", a); + c = cljs.core._entry_key; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._entry_key._, !c)) { + throw cljs.core.missing_protocol("ISorted.-entry-key", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._comparator = function(a) { - if(a ? a.cljs$core$ISorted$_comparator$arity$1 : a) { - return a.cljs$core$ISorted$_comparator$arity$1(a) + if (a ? a.cljs$core$ISorted$_comparator$arity$1 : a) { + return a.cljs$core$ISorted$_comparator$arity$1(a); } var b; - b = cljs.core._comparator[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._comparator._, !b)) { - throw cljs.core.missing_protocol.call(null, "ISorted.-comparator", a); + b = cljs.core._comparator; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._comparator._, !b)) { + throw cljs.core.missing_protocol("ISorted.-comparator", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IWriter = function() { - return{} + return{}; }(); cljs.core._write = function(a, b) { - if(a ? a.cljs$core$IWriter$_write$arity$2 : a) { - return a.cljs$core$IWriter$_write$arity$2(a, b) + if (a ? a.cljs$core$IWriter$_write$arity$2 : a) { + return a.cljs$core$IWriter$_write$arity$2(a, b); } var c; - c = cljs.core._write[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._write._, !c)) { - throw cljs.core.missing_protocol.call(null, "IWriter.-write", a); + c = cljs.core._write; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._write._, !c)) { + throw cljs.core.missing_protocol("IWriter.-write", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._flush = function(a) { - if(a ? a.cljs$core$IWriter$_flush$arity$1 : a) { - return a.cljs$core$IWriter$_flush$arity$1(a) + if (a ? a.cljs$core$IWriter$_flush$arity$1 : a) { + return a.cljs$core$IWriter$_flush$arity$1(a); } var b; - b = cljs.core._flush[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._flush._, !b)) { - throw cljs.core.missing_protocol.call(null, "IWriter.-flush", a); + b = cljs.core._flush; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._flush._, !b)) { + throw cljs.core.missing_protocol("IWriter.-flush", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IPrintWithWriter = function() { - return{} + return{}; }(); cljs.core._pr_writer = function(a, b, c) { - if(a ? a.cljs$core$IPrintWithWriter$_pr_writer$arity$3 : a) { - return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(a, b, c) + if (a ? a.cljs$core$IPrintWithWriter$_pr_writer$arity$3 : a) { + return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(a, b, c); } var d; - d = cljs.core._pr_writer[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._pr_writer._, !d)) { - throw cljs.core.missing_protocol.call(null, "IPrintWithWriter.-pr-writer", a); + d = cljs.core._pr_writer; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._pr_writer._, !d)) { + throw cljs.core.missing_protocol("IPrintWithWriter.-pr-writer", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IPending = function() { - return{} + return{}; }(); cljs.core._realized_QMARK_ = function(a) { - if(a ? a.cljs$core$IPending$_realized_QMARK_$arity$1 : a) { - return a.cljs$core$IPending$_realized_QMARK_$arity$1(a) + if (a ? a.cljs$core$IPending$_realized_QMARK_$arity$1 : a) { + return a.cljs$core$IPending$_realized_QMARK_$arity$1(a); } var b; - b = cljs.core._realized_QMARK_[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._realized_QMARK_._, !b)) { - throw cljs.core.missing_protocol.call(null, "IPending.-realized?", a); + b = cljs.core._realized_QMARK_; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._realized_QMARK_._, !b)) { + throw cljs.core.missing_protocol("IPending.-realized?", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IWatchable = function() { - return{} + return{}; }(); cljs.core._notify_watches = function(a, b, c) { - if(a ? a.cljs$core$IWatchable$_notify_watches$arity$3 : a) { - return a.cljs$core$IWatchable$_notify_watches$arity$3(a, b, c) + if (a ? a.cljs$core$IWatchable$_notify_watches$arity$3 : a) { + return a.cljs$core$IWatchable$_notify_watches$arity$3(a, b, c); } var d; - d = cljs.core._notify_watches[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._notify_watches._, !d)) { - throw cljs.core.missing_protocol.call(null, "IWatchable.-notify-watches", a); + d = cljs.core._notify_watches; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._notify_watches._, !d)) { + throw cljs.core.missing_protocol("IWatchable.-notify-watches", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._add_watch = function(a, b, c) { - if(a ? a.cljs$core$IWatchable$_add_watch$arity$3 : a) { - return a.cljs$core$IWatchable$_add_watch$arity$3(a, b, c) + if (a ? a.cljs$core$IWatchable$_add_watch$arity$3 : a) { + return a.cljs$core$IWatchable$_add_watch$arity$3(a, b, c); } var d; - d = cljs.core._add_watch[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._add_watch._, !d)) { - throw cljs.core.missing_protocol.call(null, "IWatchable.-add-watch", a); + d = cljs.core._add_watch; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._add_watch._, !d)) { + throw cljs.core.missing_protocol("IWatchable.-add-watch", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._remove_watch = function(a, b) { - if(a ? a.cljs$core$IWatchable$_remove_watch$arity$2 : a) { - return a.cljs$core$IWatchable$_remove_watch$arity$2(a, b) + if (a ? a.cljs$core$IWatchable$_remove_watch$arity$2 : a) { + return a.cljs$core$IWatchable$_remove_watch$arity$2(a, b); } var c; - c = cljs.core._remove_watch[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._remove_watch._, !c)) { - throw cljs.core.missing_protocol.call(null, "IWatchable.-remove-watch", a); + c = cljs.core._remove_watch; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._remove_watch._, !c)) { + throw cljs.core.missing_protocol("IWatchable.-remove-watch", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IEditableCollection = function() { - return{} + return{}; }(); cljs.core._as_transient = function(a) { - if(a ? a.cljs$core$IEditableCollection$_as_transient$arity$1 : a) { - return a.cljs$core$IEditableCollection$_as_transient$arity$1(a) + if (a ? a.cljs$core$IEditableCollection$_as_transient$arity$1 : a) { + return a.cljs$core$IEditableCollection$_as_transient$arity$1(a); } var b; - b = cljs.core._as_transient[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._as_transient._, !b)) { - throw cljs.core.missing_protocol.call(null, "IEditableCollection.-as-transient", a); + b = cljs.core._as_transient; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._as_transient._, !b)) { + throw cljs.core.missing_protocol("IEditableCollection.-as-transient", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ITransientCollection = function() { - return{} + return{}; }(); cljs.core._conj_BANG_ = function(a, b) { - if(a ? a.cljs$core$ITransientCollection$_conj_BANG_$arity$2 : a) { - return a.cljs$core$ITransientCollection$_conj_BANG_$arity$2(a, b) + if (a ? a.cljs$core$ITransientCollection$_conj_BANG_$arity$2 : a) { + return a.cljs$core$ITransientCollection$_conj_BANG_$arity$2(a, b); } var c; - c = cljs.core._conj_BANG_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._conj_BANG_._, !c)) { - throw cljs.core.missing_protocol.call(null, "ITransientCollection.-conj!", a); + c = cljs.core._conj_BANG_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._conj_BANG_._, !c)) { + throw cljs.core.missing_protocol("ITransientCollection.-conj!", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._persistent_BANG_ = function(a) { - if(a ? a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 : a) { - return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(a) + if (a ? a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 : a) { + return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(a); } var b; - b = cljs.core._persistent_BANG_[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._persistent_BANG_._, !b)) { - throw cljs.core.missing_protocol.call(null, "ITransientCollection.-persistent!", a); + b = cljs.core._persistent_BANG_; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._persistent_BANG_._, !b)) { + throw cljs.core.missing_protocol("ITransientCollection.-persistent!", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ITransientAssociative = function() { - return{} + return{}; }(); cljs.core._assoc_BANG_ = function(a, b, c) { - if(a ? a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 : a) { - return a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(a, b, c) + if (a ? a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 : a) { + return a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(a, b, c); } var d; - d = cljs.core._assoc_BANG_[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc_BANG_._, !d)) { - throw cljs.core.missing_protocol.call(null, "ITransientAssociative.-assoc!", a); + d = cljs.core._assoc_BANG_; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._assoc_BANG_._, !d)) { + throw cljs.core.missing_protocol("ITransientAssociative.-assoc!", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.ITransientMap = function() { - return{} + return{}; }(); cljs.core._dissoc_BANG_ = function(a, b) { - if(a ? a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 : a) { - return a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2(a, b) + if (a ? a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 : a) { + return a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2(a, b); } var c; - c = cljs.core._dissoc_BANG_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._dissoc_BANG_._, !c)) { - throw cljs.core.missing_protocol.call(null, "ITransientMap.-dissoc!", a); + c = cljs.core._dissoc_BANG_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._dissoc_BANG_._, !c)) { + throw cljs.core.missing_protocol("ITransientMap.-dissoc!", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.ITransientVector = function() { - return{} + return{}; }(); cljs.core._assoc_n_BANG_ = function(a, b, c) { - if(a ? a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 : a) { - return a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3(a, b, c) + if (a ? a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 : a) { + return a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3(a, b, c); } var d; - d = cljs.core._assoc_n_BANG_[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc_n_BANG_._, !d)) { - throw cljs.core.missing_protocol.call(null, "ITransientVector.-assoc-n!", a); + d = cljs.core._assoc_n_BANG_; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._assoc_n_BANG_._, !d)) { + throw cljs.core.missing_protocol("ITransientVector.-assoc-n!", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._pop_BANG_ = function(a) { - if(a ? a.cljs$core$ITransientVector$_pop_BANG_$arity$1 : a) { - return a.cljs$core$ITransientVector$_pop_BANG_$arity$1(a) + if (a ? a.cljs$core$ITransientVector$_pop_BANG_$arity$1 : a) { + return a.cljs$core$ITransientVector$_pop_BANG_$arity$1(a); } var b; - b = cljs.core._pop_BANG_[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._pop_BANG_._, !b)) { - throw cljs.core.missing_protocol.call(null, "ITransientVector.-pop!", a); + b = cljs.core._pop_BANG_; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._pop_BANG_._, !b)) { + throw cljs.core.missing_protocol("ITransientVector.-pop!", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ITransientSet = function() { - return{} + return{}; }(); cljs.core._disjoin_BANG_ = function(a, b) { - if(a ? a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 : a) { - return a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2(a, b) + if (a ? a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 : a) { + return a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2(a, b); } var c; - c = cljs.core._disjoin_BANG_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._disjoin_BANG_._, !c)) { - throw cljs.core.missing_protocol.call(null, "ITransientSet.-disjoin!", a); + c = cljs.core._disjoin_BANG_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._disjoin_BANG_._, !c)) { + throw cljs.core.missing_protocol("ITransientSet.-disjoin!", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IComparable = function() { - return{} + return{}; }(); cljs.core._compare = function(a, b) { - if(a ? a.cljs$core$IComparable$_compare$arity$2 : a) { - return a.cljs$core$IComparable$_compare$arity$2(a, b) + if (a ? a.cljs$core$IComparable$_compare$arity$2 : a) { + return a.cljs$core$IComparable$_compare$arity$2(a, b); } var c; - c = cljs.core._compare[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._compare._, !c)) { - throw cljs.core.missing_protocol.call(null, "IComparable.-compare", a); + c = cljs.core._compare; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._compare._, !c)) { + throw cljs.core.missing_protocol("IComparable.-compare", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IChunk = function() { - return{} + return{}; }(); cljs.core._drop_first = function(a) { - if(a ? a.cljs$core$IChunk$_drop_first$arity$1 : a) { - return a.cljs$core$IChunk$_drop_first$arity$1(a) + if (a ? a.cljs$core$IChunk$_drop_first$arity$1 : a) { + return a.cljs$core$IChunk$_drop_first$arity$1(a); } var b; - b = cljs.core._drop_first[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._drop_first._, !b)) { - throw cljs.core.missing_protocol.call(null, "IChunk.-drop-first", a); + b = cljs.core._drop_first; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._drop_first._, !b)) { + throw cljs.core.missing_protocol("IChunk.-drop-first", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IChunkedSeq = function() { - return{} + return{}; }(); cljs.core._chunked_first = function(a) { - if(a ? a.cljs$core$IChunkedSeq$_chunked_first$arity$1 : a) { - return a.cljs$core$IChunkedSeq$_chunked_first$arity$1(a) + if (a ? a.cljs$core$IChunkedSeq$_chunked_first$arity$1 : a) { + return a.cljs$core$IChunkedSeq$_chunked_first$arity$1(a); } var b; - b = cljs.core._chunked_first[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._chunked_first._, !b)) { - throw cljs.core.missing_protocol.call(null, "IChunkedSeq.-chunked-first", a); + b = cljs.core._chunked_first; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._chunked_first._, !b)) { + throw cljs.core.missing_protocol("IChunkedSeq.-chunked-first", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._chunked_rest = function(a) { - if(a ? a.cljs$core$IChunkedSeq$_chunked_rest$arity$1 : a) { - return a.cljs$core$IChunkedSeq$_chunked_rest$arity$1(a) + if (a ? a.cljs$core$IChunkedSeq$_chunked_rest$arity$1 : a) { + return a.cljs$core$IChunkedSeq$_chunked_rest$arity$1(a); } var b; - b = cljs.core._chunked_rest[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._chunked_rest._, !b)) { - throw cljs.core.missing_protocol.call(null, "IChunkedSeq.-chunked-rest", a); + b = cljs.core._chunked_rest; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._chunked_rest._, !b)) { + throw cljs.core.missing_protocol("IChunkedSeq.-chunked-rest", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IChunkedNext = function() { - return{} + return{}; }(); cljs.core._chunked_next = function(a) { - if(a ? a.cljs$core$IChunkedNext$_chunked_next$arity$1 : a) { - return a.cljs$core$IChunkedNext$_chunked_next$arity$1(a) + if (a ? a.cljs$core$IChunkedNext$_chunked_next$arity$1 : a) { + return a.cljs$core$IChunkedNext$_chunked_next$arity$1(a); } var b; - b = cljs.core._chunked_next[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._chunked_next._, !b)) { - throw cljs.core.missing_protocol.call(null, "IChunkedNext.-chunked-next", a); + b = cljs.core._chunked_next; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._chunked_next._, !b)) { + throw cljs.core.missing_protocol("IChunkedNext.-chunked-next", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.INamed = function() { - return{} + return{}; }(); cljs.core._name = function(a) { - if(a ? a.cljs$core$INamed$_name$arity$1 : a) { - return a.cljs$core$INamed$_name$arity$1(a) + if (a ? a.cljs$core$INamed$_name$arity$1 : a) { + return a.cljs$core$INamed$_name$arity$1(a); } var b; - b = cljs.core._name[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._name._, !b)) { - throw cljs.core.missing_protocol.call(null, "INamed.-name", a); + b = cljs.core._name; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._name._, !b)) { + throw cljs.core.missing_protocol("INamed.-name", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._namespace = function(a) { - if(a ? a.cljs$core$INamed$_namespace$arity$1 : a) { - return a.cljs$core$INamed$_namespace$arity$1(a) + if (a ? a.cljs$core$INamed$_namespace$arity$1 : a) { + return a.cljs$core$INamed$_namespace$arity$1(a); } var b; - b = cljs.core._namespace[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._namespace._, !b)) { - throw cljs.core.missing_protocol.call(null, "INamed.-namespace", a); + b = cljs.core._namespace; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._namespace._, !b)) { + throw cljs.core.missing_protocol("INamed.-namespace", a); } - return b.call(null, a) + return b.call(null, a); }; -cljs.core.StringBufferWriter = function(a) { - this.sb = a; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 1073741824 +cljs.core.IAtom = function() { + return{}; +}(); +cljs.core.IReset = function() { + return{}; +}(); +cljs.core._reset_BANG_ = function(a, b) { + if (a ? a.cljs$core$IReset$_reset_BANG_$arity$2 : a) { + return a.cljs$core$IReset$_reset_BANG_$arity$2(a, b); + } + var c; + c = cljs.core._reset_BANG_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._reset_BANG_._, !c)) { + throw cljs.core.missing_protocol("IReset.-reset!", a); + } + return c.call(null, a, b); }; -cljs.core.StringBufferWriter.cljs$lang$type = !0; -cljs.core.StringBufferWriter.cljs$lang$ctorStr = "cljs.core/StringBufferWriter"; -cljs.core.StringBufferWriter.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/StringBufferWriter") +cljs.core.ISwap = function() { + return{}; +}(); +cljs.core._swap_BANG_ = function() { + var a = null, b = function(a, b) { + if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$2 : a) { + return a.cljs$core$ISwap$_swap_BANG_$arity$2(a, b); + } + var c; + c = cljs.core._swap_BANG_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._swap_BANG_._, !c)) { + throw cljs.core.missing_protocol("ISwap.-swap!", a); + } + return c.call(null, a, b); + }, c = function(a, b, c) { + if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$3 : a) { + return a.cljs$core$ISwap$_swap_BANG_$arity$3(a, b, c); + } + var d; + d = cljs.core._swap_BANG_; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._swap_BANG_._, !d)) { + throw cljs.core.missing_protocol("ISwap.-swap!", a); + } + return d.call(null, a, b, c); + }, d = function(a, b, c, d) { + if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$4 : a) { + return a.cljs$core$ISwap$_swap_BANG_$arity$4(a, b, c, d); + } + var e; + e = cljs.core._swap_BANG_; + var m; + m = goog.typeOf(null == a ? null : a); + e = e[m]; + if (!e && (e = cljs.core._swap_BANG_._, !e)) { + throw cljs.core.missing_protocol("ISwap.-swap!", a); + } + return e.call(null, a, b, c, d); + }, e = function(a, b, c, d, e) { + if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$5 : a) { + return a.cljs$core$ISwap$_swap_BANG_$arity$5(a, b, c, d, e); + } + var m; + m = cljs.core._swap_BANG_; + var n; + n = goog.typeOf(null == a ? null : a); + m = m[n]; + if (!m && (m = cljs.core._swap_BANG_._, !m)) { + throw cljs.core.missing_protocol("ISwap.-swap!", a); + } + return m.call(null, a, b, c, d, e); + }, a = function(a, g, h, k, l) { + switch(arguments.length) { + case 2: + return b.call(this, a, g); + case 3: + return c.call(this, a, g, h); + case 4: + return d.call(this, a, g, h, k); + case 5: + return e.call(this, a, g, h, k, l); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$5 = e; + return a; +}(); +cljs.core.IVolatile = function() { + return{}; +}(); +cljs.core._vreset_BANG_ = function(a, b) { + if (a ? a.cljs$core$IVolatile$_vreset_BANG_$arity$2 : a) { + return a.cljs$core$IVolatile$_vreset_BANG_$arity$2(a, b); + } + var c; + c = cljs.core._vreset_BANG_; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._vreset_BANG_._, !c)) { + throw cljs.core.missing_protocol("IVolatile.-vreset!", a); + } + return c.call(null, a, b); +}; +cljs.core.IIterable = function() { + return{}; +}(); +cljs.core._iterator = function(a) { + if (a ? a.cljs$core$IIterable$_iterator$arity$1 : a) { + return a.cljs$core$IIterable$_iterator$arity$1(a); + } + var b; + b = cljs.core._iterator; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._iterator._, !b)) { + throw cljs.core.missing_protocol("IIterable.-iterator", a); + } + return b.call(null, a); +}; +cljs.core.StringBufferWriter = function(a) { + this.sb = a; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 1073741824; }; cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_write$arity$2 = function(a, b) { - return this.sb.append(b) + return this.sb.append(b); }; cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_flush$arity$1 = function(a) { - return null + return null; +}; +cljs.core.StringBufferWriter.cljs$lang$type = !0; +cljs.core.StringBufferWriter.cljs$lang$ctorStr = "cljs.core/StringBufferWriter"; +cljs.core.StringBufferWriter.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/StringBufferWriter"); }; cljs.core.__GT_StringBufferWriter = function(a) { - return new cljs.core.StringBufferWriter(a) + return new cljs.core.StringBufferWriter(a); }; cljs.core.pr_str_STAR_ = function(a) { var b = new goog.string.StringBuffer, c = new cljs.core.StringBufferWriter(b); - cljs.core._pr_writer.call(null, a, c, cljs.core.pr_opts.call(null)); - cljs.core._flush.call(null, c); - return"" + cljs.core.str(b) + a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(null, c, cljs.core.pr_opts()); + c.cljs$core$IWriter$_flush$arity$1(null); + return "" + cljs.core.str(b); +}; +cljs.core.int_rotate_left = function(a, b) { + return a << b | a >>> -b; +}; +"undefined" !== typeof Math.imul && 0 !== function() { + return Math.imul.cljs$core$IFn$_invoke$arity$2 ? Math.imul.cljs$core$IFn$_invoke$arity$2(4294967295, 5) : Math.imul.call(null, 4294967295, 5); +}() ? cljs.core.imul = function(a, b) { + return Math.imul.cljs$core$IFn$_invoke$arity$2 ? Math.imul.cljs$core$IFn$_invoke$arity$2(a, b) : Math.imul.call(null, a, b); +} : cljs.core.imul = function(a, b) { + var c = a & 65535, d = b & 65535; + return c * d + ((a >>> 16 & 65535) * d + c * (b >>> 16 & 65535) << 16 >>> 0) | 0; +}; +cljs.core.m3_seed = 0; +cljs.core.m3_C1 = 3432918353; +cljs.core.m3_C2 = 461845907; +cljs.core.m3_mix_K1 = function(a) { + return cljs.core.imul(cljs.core.int_rotate_left(cljs.core.imul(a, cljs.core.m3_C1), 15), cljs.core.m3_C2); +}; +cljs.core.m3_mix_H1 = function(a, b) { + return cljs.core.imul(cljs.core.int_rotate_left(a ^ b, 13), 5) + 3864292196; +}; +cljs.core.m3_fmix = function(a, b) { + var c = a ^ b, c = cljs.core.imul(c ^ c >>> 16, 2246822507), c = cljs.core.imul(c ^ c >>> 13, 3266489909); + return c ^ c >>> 16; +}; +cljs.core.m3_hash_int = function(a) { + if (0 === a) { + return a; + } + a = cljs.core.m3_mix_K1(a); + a = cljs.core.m3_mix_H1(cljs.core.m3_seed, a); + return cljs.core.m3_fmix(a, 4); +}; +cljs.core.m3_hash_unencoded_chars = function(a) { + var b; + a: { + b = 1; + for (var c = cljs.core.m3_seed;;) { + if (b < a.length) { + var d = b + 2, c = cljs.core.m3_mix_H1(c, cljs.core.m3_mix_K1(a.charCodeAt(b - 1) | a.charCodeAt(b) << 16)); + b = d; + } else { + b = c; + break a; + } + } + b = void 0; + } + b = 1 === (a.length & 1) ? b ^ cljs.core.m3_mix_K1(a.charCodeAt(a.length - 1)) : b; + return cljs.core.m3_fmix(b, cljs.core.imul(2, a.length)); +}; +cljs.core.string_hash_cache = function() { + return{}; +}(); +cljs.core.string_hash_cache_count = 0; +cljs.core.hash_string_STAR_ = function(a) { + if (null != a) { + var b = a.length; + if (0 < b) { + for (var c = 0, d = 0;;) { + if (c < b) { + var e = c + 1, d = cljs.core.imul(31, d) + a.charCodeAt(c), c = e + } else { + return d; + } + } + } else { + return 0; + } + } else { + return 0; + } +}; +cljs.core.add_to_string_hash_cache = function(a) { + var b = cljs.core.hash_string_STAR_(a); + cljs.core.string_hash_cache[a] = b; + cljs.core.string_hash_cache_count += 1; + return b; +}; +cljs.core.hash_string = function(a) { + 255 < cljs.core.string_hash_cache_count && (cljs.core.string_hash_cache = {}, cljs.core.string_hash_cache_count = 0); + var b = cljs.core.string_hash_cache[a]; + return "number" === typeof b ? b : cljs.core.add_to_string_hash_cache(a); +}; +cljs.core.hash = function(a) { + return a && (a.cljs$lang$protocol_mask$partition0$ & 4194304 || a.cljs$core$IHash$) ? a.cljs$core$IHash$_hash$arity$1(null) : "number" === typeof a ? (Math.floor.cljs$core$IFn$_invoke$arity$1 ? Math.floor.cljs$core$IFn$_invoke$arity$1(a) : Math.floor.call(null, a)) % 2147483647 : !0 === a ? 1 : !1 === a ? 0 : "string" === typeof a ? cljs.core.m3_hash_int(cljs.core.hash_string(a)) : a instanceof Date ? a.valueOf() : null == a ? 0 : cljs.core._hash(a); +}; +cljs.core.hash_combine = function(a, b) { + return a ^ b + 2654435769 + (a << 6) + (a >> 2); }; cljs.core.instance_QMARK_ = function(a, b) { - return b instanceof a + return b instanceof a; }; cljs.core.symbol_QMARK_ = function(a) { - return a instanceof cljs.core.Symbol + return a instanceof cljs.core.Symbol; }; cljs.core.hash_symbol = function(a) { - return cljs.core.hash_combine.call(null, cljs.core.hash.call(null, a.ns), cljs.core.hash.call(null, a.name)) + return cljs.core.hash_combine(cljs.core.m3_hash_unencoded_chars(a.name), cljs.core.hash_string(a.ns)); }; cljs.core.compare_symbols = function(a, b) { - if(cljs.core.truth_(cljs.core._EQ_.call(null, a, b))) { - return 0 + if (a.str === b.str) { + return 0; } - if(cljs.core.truth_(function() { - var c = cljs.core.not.call(null, a.ns); - return c ? b.ns : c + if (cljs.core.truth_(function() { + var c = cljs.core.not(a.ns); + return c ? b.ns : c; }())) { - return-1 + return-1; } - if(cljs.core.truth_(a.ns)) { - if(cljs.core.not.call(null, b.ns)) { - return 1 + if (cljs.core.truth_(a.ns)) { + if (cljs.core.not(b.ns)) { + return 1; } - var c = cljs.core.compare.call(null, a.ns, b.ns); - return 0 === c ? cljs.core.compare.call(null, a.name, b.name) : c + var c = goog.array.defaultCompare(a.ns, b.ns); + return 0 === c ? goog.array.defaultCompare(a.name, b.name) : c; } - return new cljs.core.Keyword(null, "default", "default", 2558708147) ? cljs.core.compare.call(null, a.name, b.name) : null + return goog.array.defaultCompare(a.name, b.name); }; cljs.core.Symbol = function(a, b, c, d, e) { this.ns = a; @@ -2716,135 +3420,388 @@ cljs.core.Symbol = function(a, b, c, d, e) { this._hash = d; this._meta = e; this.cljs$lang$protocol_mask$partition0$ = 2154168321; - this.cljs$lang$protocol_mask$partition1$ = 4096 -}; -cljs.core.Symbol.cljs$lang$type = !0; -cljs.core.Symbol.cljs$lang$ctorStr = "cljs.core/Symbol"; -cljs.core.Symbol.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Symbol") + this.cljs$lang$protocol_mask$partition1$ = 4096; }; cljs.core.Symbol.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, this.str) + return cljs.core._write(b, this.str); }; cljs.core.Symbol.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return this.name + return this.name; }; cljs.core.Symbol.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return this.ns + return this.ns; }; cljs.core.Symbol.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this._hash; - return null != a ? a : this._hash = a = cljs.core.hash_symbol.call(null, this) + return null != a ? a : this._hash = a = cljs.core.hash_symbol(this); }; cljs.core.Symbol.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, b) + return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, b); }; cljs.core.Symbol.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta + return this._meta; }; cljs.core.Symbol.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, b = function(a, b) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(b, this, null); + }, c = function(a, b, c) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(b, this, c); + }, a = function(a, e, f) { switch(arguments.length) { case 2: - return cljs.core._lookup.call(null, c, this, null); + return b.call(this, a, e); case 3: - return cljs.core._lookup.call(null, c, this, d) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + return a; }(); cljs.core.Symbol.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.Symbol.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core._lookup.call(null, a, this, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(a, this, null); }; cljs.core.Symbol.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, a, this, b) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(a, this, b); }; cljs.core.Symbol.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.Symbol ? this.str === b.str : !1 + return b instanceof cljs.core.Symbol ? this.str === b.str : !1; }; cljs.core.Symbol.prototype.toString = function() { - return this.str + return this.str; +}; +cljs.core.Symbol.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.Symbol.cljs$lang$type = !0; +cljs.core.Symbol.cljs$lang$ctorStr = "cljs.core/Symbol"; +cljs.core.Symbol.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Symbol"); }; cljs.core.__GT_Symbol = function(a, b, c, d, e) { - return new cljs.core.Symbol(a, b, c, d, e) + return new cljs.core.Symbol(a, b, c, d, e); }; cljs.core.symbol = function() { var a = null, b = function(b) { - return b instanceof cljs.core.Symbol ? b : a.call(null, null, b) + return b instanceof cljs.core.Symbol ? b : a.cljs$core$IFn$_invoke$arity$2(null, b); }, c = function(a, b) { var c = null != a ? [cljs.core.str(a), cljs.core.str("/"), cljs.core.str(b)].join("") : b; - return new cljs.core.Symbol(a, b, c, null, null) + return new cljs.core.Symbol(a, b, c, null, null); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.Var = function(a, b, c) { + this.val = a; + this.sym = b; + this._meta = c; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 163841; +}; +cljs.core.Var.prototype.call = function() { + var a = null, b = function(a) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null); + }, c = function(a, b) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b); + }, d = function(a, b, c) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c); + }, e = function(a, b, c, d) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d); + }, f = function(a, b, c, d, e) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e); + }, g = function(a, b, c, d, e, f) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f); + }, h = function(a, b, c, d, e, f, g) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g); + }, k = function(a, b, c, d, e, f, g, h) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h); + }, l = function(a, b, c, d, e, f, g, h, k) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k); + }, m = function(a, b, c, d, e, f, g, h, k, l) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l); + }, n = function(a, b, c, d, e, f, g, h, k, l, m) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m); + }, p = function(a, b, c, d, e, f, g, h, k, l, m, q) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q); + }, q = function(a, b, c, d, e, f, g, h, k, l, m, q, n) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n); + }, r = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r); + }, s = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p); + }, t = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); + }, u = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); + }, v = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); + }, w = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); + }, y = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); + }, F = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) { + a = this; + return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); + }, L = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) { + a = this; + a = a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null); + return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) : cljs.core.apply.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); + }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, x); + case 3: + return d.call(this, a, x, z); + case 4: + return e.call(this, a, x, z, A); + case 5: + return f.call(this, a, x, z, A, B); + case 6: + return g.call(this, a, x, z, A, B, C); + case 7: + return h.call(this, a, x, z, A, B, C, D); + case 8: + return k.call(this, a, x, z, A, B, C, D, E); + case 9: + return l.call(this, a, x, z, A, B, C, D, E, G); + case 10: + return m.call(this, a, x, z, A, B, C, D, E, G, H); + case 11: + return n.call(this, a, x, z, A, B, C, D, E, G, H, I); + case 12: + return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); + case 13: + return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); + case 14: + return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); + case 15: + return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); + case 16: + return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); + case 17: + return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); + case 18: + return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); + case 19: + return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); + case 20: + return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); + case 21: + return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); + case 22: + return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + a.cljs$core$IFn$_invoke$arity$3 = d; + a.cljs$core$IFn$_invoke$arity$4 = e; + a.cljs$core$IFn$_invoke$arity$5 = f; + a.cljs$core$IFn$_invoke$arity$6 = g; + a.cljs$core$IFn$_invoke$arity$7 = h; + a.cljs$core$IFn$_invoke$arity$8 = k; + a.cljs$core$IFn$_invoke$arity$9 = l; + a.cljs$core$IFn$_invoke$arity$10 = m; + a.cljs$core$IFn$_invoke$arity$11 = n; + a.cljs$core$IFn$_invoke$arity$12 = p; + a.cljs$core$IFn$_invoke$arity$13 = q; + a.cljs$core$IFn$_invoke$arity$14 = r; + a.cljs$core$IFn$_invoke$arity$15 = s; + a.cljs$core$IFn$_invoke$arity$16 = t; + a.cljs$core$IFn$_invoke$arity$17 = u; + a.cljs$core$IFn$_invoke$arity$18 = v; + a.cljs$core$IFn$_invoke$arity$19 = w; + a.cljs$core$IFn$_invoke$arity$20 = y; + a.cljs$core$IFn$_invoke$arity$21 = F; + a.cljs$core$IFn$_invoke$arity$22 = L; + return a; }(); +cljs.core.Var.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$0 = function() { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$3 = function(a, b, c) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$4 = function(a, b, c, d) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$5 = function(a, b, c, d, e) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$6 = function(a, b, c, d, e, f) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$7 = function(a, b, c, d, e, f, g) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$8 = function(a, b, c, d, e, f, g, h) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$9 = function(a, b, c, d, e, f, g, h, k) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$10 = function(a, b, c, d, e, f, g, h, k, l) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$11 = function(a, b, c, d, e, f, g, h, k, l, m) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$12 = function(a, b, c, d, e, f, g, h, k, l, m, n) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$13 = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$14 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$15 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$16 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$17 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$18 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$19 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$20 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { + return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); +}; +cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$21 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { + var F = this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null); + return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : cljs.core.apply.call(null, F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); +}; +cljs.core.Var.prototype.cljs$core$Fn$ = !0; +cljs.core.Var.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta; +}; +cljs.core.Var.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + return this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null); +}; +cljs.core.Var.cljs$lang$type = !0; +cljs.core.Var.cljs$lang$ctorStr = "cljs.core/Var"; +cljs.core.Var.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Var"); +}; +cljs.core.__GT_Var = function(a, b, c) { + return new cljs.core.Var(a, b, c); +}; +cljs.core.iterable_QMARK_ = function(a) { + return a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IIterable$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IIterable, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IIterable, a); +}; +cljs.core.clone = function(a) { + return cljs.core._clone(a); +}; +cljs.core.cloneable_QMARK_ = function(a) { + return a ? a.cljs$lang$protocol_mask$partition1$ & 8192 || a.cljs$core$ICloneable$ ? !0 : a.cljs$lang$protocol_mask$partition1$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ICloneable, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ICloneable, a); +}; cljs.core.seq = function(a) { - if(null == a) { - return null - } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$)) { - return cljs.core._seq.call(null, a) + if (null == a) { + return null; } - if(a instanceof Array || "string" === typeof a) { - return 0 === a.length ? null : new cljs.core.IndexedSeq(a, 0) + if (a && (a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$)) { + return a.cljs$core$ISeqable$_seq$arity$1(null); } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a)) { - return cljs.core._seq.call(null, a) + if (a instanceof Array || "string" === typeof a) { + return 0 === a.length ? null : new cljs.core.IndexedSeq(a, 0); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error([cljs.core.str(a), cljs.core.str("is not ISeqable")].join("")); + if (cljs.core.native_satisfies_QMARK_(cljs.core.ISeqable, a)) { + return cljs.core._seq(a); } - return null + throw Error([cljs.core.str(a), cljs.core.str(" is not ISeqable")].join("")); }; cljs.core.first = function(a) { - if(null == a) { - return null + if (null == a) { + return null; } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$)) { - return cljs.core._first.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$)) { + return a.cljs$core$ISeq$_first$arity$1(null); } - a = cljs.core.seq.call(null, a); - return null == a ? null : cljs.core._first.call(null, a) + a = cljs.core.seq(a); + return null == a ? null : cljs.core._first(a); }; cljs.core.rest = function(a) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$) ? cljs.core._rest.call(null, a) : (a = cljs.core.seq.call(null, a)) ? cljs.core._rest.call(null, a) : cljs.core.List.EMPTY : cljs.core.List.EMPTY + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$) ? a.cljs$core$ISeq$_rest$arity$1(null) : (a = cljs.core.seq(a)) ? cljs.core._rest(a) : cljs.core.List.EMPTY : cljs.core.List.EMPTY; }; cljs.core.next = function(a) { - return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$) ? cljs.core._next.call(null, a) : cljs.core.seq.call(null, cljs.core.rest.call(null, a)) + return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$) ? a.cljs$core$INext$_next$arity$1(null) : cljs.core.seq(cljs.core.rest(a)); }; cljs.core._EQ_ = function() { var a = null, b = function(a, b) { - return null == a ? null == b : a === b || cljs.core._equiv.call(null, a, b) + return null == a ? null == b : a === b || cljs.core._equiv(a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(a.call(null, b, c)) { - if(cljs.core.next.call(null, d)) { - b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return a.call(null, c, cljs.core.first.call(null, d)) + for (;;) { + if (a.cljs$core$IFn$_invoke$arity$2(b, c)) { + if (cljs.core.next(d)) { + b = c, c = cljs.core.first(d), d = cljs.core.next(d); + } else { + return a.cljs$core$IFn$_invoke$arity$2(c, cljs.core.first(d)); } - }else { - return!1 + } else { + return!1; } } }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -2852,10 +3809,10 @@ cljs.core._EQ_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -2863,104 +3820,199 @@ cljs.core._EQ_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); +cljs.core.ES6Iterator = function(a) { + this.s = a; +}; +cljs.core.ES6Iterator.prototype.next = function() { + if (null != this.s) { + var a = cljs.core.first(this.s); + this.s = cljs.core.next(this.s); + return{done:!1, value:a}; + } + return{done:!0, value:null}; +}; +cljs.core.ES6Iterator.cljs$lang$type = !0; +cljs.core.ES6Iterator.cljs$lang$ctorStr = "cljs.core/ES6Iterator"; +cljs.core.ES6Iterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ES6Iterator"); +}; +cljs.core.__GT_ES6Iterator = function(a) { + return new cljs.core.ES6Iterator(a); +}; +cljs.core.es6_iterator = function(a) { + return new cljs.core.ES6Iterator(cljs.core.seq(a)); +}; +cljs.core.ES6IteratorSeq = function(a, b, c) { + this.value = a; + this.iter = b; + this._rest = c; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 8388672; +}; +cljs.core.ES6IteratorSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + return this.value; +}; +cljs.core.ES6IteratorSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + null == this._rest && (a = this.iter, this._rest = cljs.core.es6_iterator_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.es6_iterator_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.es6_iterator_seq.call(null, a)); + return this._rest; +}; +cljs.core.ES6IteratorSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; +}; +cljs.core.ES6IteratorSeq.cljs$lang$type = !0; +cljs.core.ES6IteratorSeq.cljs$lang$ctorStr = "cljs.core/ES6IteratorSeq"; +cljs.core.ES6IteratorSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ES6IteratorSeq"); +}; +cljs.core.__GT_ES6IteratorSeq = function(a, b, c) { + return new cljs.core.ES6IteratorSeq(a, b, c); +}; +cljs.core.es6_iterator_seq = function(a) { + var b = a.next(); + return cljs.core.truth_(b.done) ? cljs.core.List.EMPTY : new cljs.core.ES6IteratorSeq(b.value, a, null); +}; +cljs.core.mix_collection_hash = function(a, b) { + var c = cljs.core.m3_seed, d = cljs.core.m3_mix_K1(a), c = cljs.core.m3_mix_H1(c, d); + return cljs.core.m3_fmix(c, b); +}; +cljs.core.hash_ordered_coll = function(a) { + var b = 0, c = 1; + for (a = cljs.core.seq(a);;) { + if (null != a) { + b += 1, c = cljs.core.imul(31, c) + cljs.core.hash(cljs.core.first(a)) | 0, a = cljs.core.next(a); + } else { + return cljs.core.mix_collection_hash(c, b); + } + } +}; +cljs.core.empty_ordered_hash = cljs.core.mix_collection_hash(1, 0); +cljs.core.hash_unordered_coll = function(a) { + var b = 0, c = 0; + for (a = cljs.core.seq(a);;) { + if (null != a) { + b += 1, c = c + cljs.core.hash(cljs.core.first(a)) | 0, a = cljs.core.next(a); + } else { + return cljs.core.mix_collection_hash(c, b); + } + } +}; +cljs.core.empty_unordered_hash = cljs.core.mix_collection_hash(0, 0); cljs.core.ICounted["null"] = !0; cljs.core._count["null"] = function(a) { - return 0 + return 0; }; Date.prototype.cljs$core$IEquiv$ = !0; Date.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof Date && this.toString() === b.toString() + return b instanceof Date && this.toString() === b.toString(); }; cljs.core.IEquiv.number = !0; cljs.core._equiv.number = function(a, b) { - return a === b + return a === b; }; cljs.core.IMeta["function"] = !0; cljs.core._meta["function"] = function(a) { - return null + return null; }; cljs.core.Fn["function"] = !0; cljs.core.IHash._ = !0; cljs.core._hash._ = function(a) { - return goog.getUid(a) + return goog.getUid(a); }; cljs.core.inc = function(a) { - return a + 1 + return a + 1; }; cljs.core.Reduced = function(a) { this.val = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32768 + this.cljs$lang$protocol_mask$partition0$ = 32768; +}; +cljs.core.Reduced.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + return this.val; }; cljs.core.Reduced.cljs$lang$type = !0; cljs.core.Reduced.cljs$lang$ctorStr = "cljs.core/Reduced"; cljs.core.Reduced.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Reduced") -}; -cljs.core.Reduced.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.val + return cljs.core._write(b, "cljs.core/Reduced"); }; cljs.core.__GT_Reduced = function(a) { - return new cljs.core.Reduced(a) + return new cljs.core.Reduced(a); }; cljs.core.reduced = function(a) { - return new cljs.core.Reduced(a) + return new cljs.core.Reduced(a); }; cljs.core.reduced_QMARK_ = function(a) { - return a instanceof cljs.core.Reduced + return a instanceof cljs.core.Reduced; +}; +cljs.core.ensure_reduced = function(a) { + return cljs.core.reduced_QMARK_(a) ? a : cljs.core.reduced(a); +}; +cljs.core.unreduced = function(a) { + return cljs.core.reduced_QMARK_(a) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a) : a; +}; +cljs.core.deref = function(a) { + return cljs.core._deref(a); }; cljs.core.ci_reduce = function() { var a = null, b = function(a, b) { - var c = cljs.core._count.call(null, a); - if(0 === c) { - return b.call(null) - } - for(var d = cljs.core._nth.call(null, a, 0), k = 1;;) { - if(k < c) { - d = b.call(null, d, cljs.core._nth.call(null, a, k)); - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + var c = cljs.core._count(a); + if (0 === c) { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + } + for (var d = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, 0), k = 1;;) { + if (k < c) { + var l = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, k), d = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, l) : b.call(null, d, l); + if (cljs.core.reduced_QMARK_(d)) { + return cljs.core.deref(d); } - k += 1 - }else { - return d + k += 1; + } else { + return d; } } }, c = function(a, b, c) { - for(var d = cljs.core._count.call(null, a), k = 0;;) { - if(k < d) { - c = b.call(null, c, cljs.core._nth.call(null, a, k)); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + var d = cljs.core._count(a), k = c; + for (c = 0;;) { + if (c < d) { + var l = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, c), k = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(k, l) : b.call(null, k, l); + if (cljs.core.reduced_QMARK_(k)) { + return cljs.core.deref(k); } - k += 1 - }else { - return c + c += 1; + } else { + return k; } } }, d = function(a, b, c, d) { - for(var k = cljs.core._count.call(null, a);;) { - if(d < k) { - c = b.call(null, c, cljs.core._nth.call(null, a, d)); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + for (var k = cljs.core._count(a);;) { + if (d < k) { + var l = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, d); + c = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, l) : b.call(null, c, l); + if (cljs.core.reduced_QMARK_(c)) { + return cljs.core.deref(c); } - d += 1 - }else { - return c + d += 1; + } else { + return c; } } }, a = function(a, f, g, h) { @@ -2970,54 +4022,56 @@ cljs.core.ci_reduce = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.array_reduce = function() { var a = null, b = function(a, b) { var c = a.length; - if(0 === a.length) { - return b.call(null) - } - for(var d = a[0], k = 1;;) { - if(k < c) { - d = b.call(null, d, a[k]); - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (0 === a.length) { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + } + for (var d = a[0], k = 1;;) { + if (k < c) { + var l = a[k], d = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, l) : b.call(null, d, l); + if (cljs.core.reduced_QMARK_(d)) { + return cljs.core.deref(d); } - k += 1 - }else { - return d + k += 1; + } else { + return d; } } }, c = function(a, b, c) { - for(var d = a.length, k = 0;;) { - if(k < d) { - c = b.call(null, c, a[k]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + var d = a.length, k = c; + for (c = 0;;) { + if (c < d) { + var l = a[c], k = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(k, l) : b.call(null, k, l); + if (cljs.core.reduced_QMARK_(k)) { + return cljs.core.deref(k); } - k += 1 - }else { - return c + c += 1; + } else { + return k; } } }, d = function(a, b, c, d) { - for(var k = a.length;;) { - if(d < k) { - c = b.call(null, c, a[d]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + for (var k = a.length;;) { + if (d < k) { + var l = a[d]; + c = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, l) : b.call(null, c, l); + if (cljs.core.reduced_QMARK_(c)) { + return cljs.core.deref(c); } - d += 1 - }else { - return c + d += 1; + } else { + return c; } } }, a = function(a, f, g, h) { @@ -3027,301 +4081,367 @@ cljs.core.array_reduce = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.counted_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ICounted, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ICounted, a); }; cljs.core.indexed_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a); }; -cljs.core.IndexedSeq = function(a, b) { +cljs.core.IndexedSeqIterator = function(a, b) { this.arr = a; this.i = b; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 166199550 }; -cljs.core.IndexedSeq.cljs$lang$type = !0; -cljs.core.IndexedSeq.cljs$lang$ctorStr = "cljs.core/IndexedSeq"; -cljs.core.IndexedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/IndexedSeq") +cljs.core.IndexedSeqIterator.prototype.hasNext = function() { + return this.i < this.arr.length; }; -cljs.core.IndexedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) +cljs.core.IndexedSeqIterator.prototype.next = function() { + var a = this.arr[this.i]; + this.i += 1; + return a; }; -cljs.core.IndexedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : null +cljs.core.IndexedSeqIterator.cljs$lang$type = !0; +cljs.core.IndexedSeqIterator.cljs$lang$ctorStr = "cljs.core/IndexedSeqIterator"; +cljs.core.IndexedSeqIterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/IndexedSeqIterator"); }; -cljs.core.IndexedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.__GT_IndexedSeqIterator = function(a, b) { + return new cljs.core.IndexedSeqIterator(a, b); }; -cljs.core.IndexedSeq.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - a = cljs.core._count.call(null, this); - return 0 < a ? new cljs.core.RSeq(this, a - 1, null) : null +cljs.core.IndexedSeq = function(a, b) { + this.arr = a; + this.i = b; + this.cljs$lang$protocol_mask$partition0$ = 166199550; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; cljs.core.IndexedSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_(this); }; -cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.i], this.i + 1) +cljs.core.IndexedSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; -cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.array_reduce.call(null, this.arr, b, c, this.i) +cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + var c = b + this.i; + return c < this.arr.length ? this.arr[c] : null; }; -cljs.core.IndexedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this +cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + a = b + this.i; + return a < this.arr.length ? this.arr[a] : c; }; -cljs.core.IndexedSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.arr.length - this.i +cljs.core.IndexedSeq.prototype.cljs$core$IIterable$ = !0; +cljs.core.IndexedSeq.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { + return new cljs.core.IndexedSeqIterator(this.arr, this.i); }; -cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.arr[this.i] +cljs.core.IndexedSeq.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.IndexedSeq(this.arr, this.i); }; -cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : cljs.core.List.EMPTY +cljs.core.IndexedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : null; }; -cljs.core.IndexedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.IndexedSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.arr.length - this.i; }; -cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - var c = b + this.i; - return c < this.arr.length ? this.arr[c] : null +cljs.core.IndexedSeq.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + a = cljs.core._count(this); + return 0 < a ? new cljs.core.RSeq(this, a - 1, null) : null; }; -cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - a = b + this.i; - return a < this.arr.length ? this.arr[a] : c +cljs.core.IndexedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_ordered_coll(this); +}; +cljs.core.IndexedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2 ? cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2(this, b) : cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.IndexedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.List.EMPTY + return cljs.core.List.EMPTY; +}; +cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, this.arr[this.i], this.i + 1); +}; +cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, c, this.i); +}; +cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + return this.arr[this.i]; +}; +cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : cljs.core.List.EMPTY; +}; +cljs.core.IndexedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; +}; +cljs.core.IndexedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.cljs$core$IFn$_invoke$arity$2 ? cljs.core.cons.cljs$core$IFn$_invoke$arity$2(b, this) : cljs.core.cons.call(null, b, this); +}; +cljs.core.IndexedSeq.cljs$lang$type = !0; +cljs.core.IndexedSeq.cljs$lang$ctorStr = "cljs.core/IndexedSeq"; +cljs.core.IndexedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/IndexedSeq"); }; cljs.core.__GT_IndexedSeq = function(a, b) { - return new cljs.core.IndexedSeq(a, b) + return new cljs.core.IndexedSeq(a, b); +}; +cljs.core.IndexedSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.prim_seq = function() { var a = null, b = function(b) { - return a.call(null, b, 0) + return a.cljs$core$IFn$_invoke$arity$2(b, 0); }, c = function(a, b) { - return b < a.length ? new cljs.core.IndexedSeq(a, b) : null + return b < a.length ? new cljs.core.IndexedSeq(a, b) : null; }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.array_seq = function() { var a = null, b = function(a) { - return cljs.core.prim_seq.call(null, a, 0) + return cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(a, 0); }, c = function(a, b) { - return cljs.core.prim_seq.call(null, a, b) + return cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(a, b); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.RSeq = function(a, b, c) { this.ci = a; this.i = b; this.meta = c; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374862 + this.cljs$lang$protocol_mask$partition0$ = 32374990; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.RSeq.cljs$lang$type = !0; -cljs.core.RSeq.cljs$lang$ctorStr = "cljs.core/RSeq"; -cljs.core.RSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/RSeq") +cljs.core.RSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.RSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.RSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.RSeq.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.RSeq(this.ci, this.i, this.meta); +}; +cljs.core.RSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : null; +}; +cljs.core.RSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.i + 1; }; cljs.core.RSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) + return cljs.core.hash_ordered_coll(this); }; -cljs.core.RSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.RSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2 ? cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2(this, b) : cljs.core.equiv_sequential.call(null, this, b); }; -cljs.core.RSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.RSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + a = cljs.core.List.EMPTY; + var b = this.meta; + return cljs.core.with_meta.cljs$core$IFn$_invoke$arity$2 ? cljs.core.with_meta.cljs$core$IFn$_invoke$arity$2(a, b) : cljs.core.with_meta.call(null, a, b); }; cljs.core.RSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2 ? cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this) : cljs.core.seq_reduce.call(null, b, this); }; cljs.core.RSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.RSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this -}; -cljs.core.RSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.i + 1 + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3 ? cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this) : cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.RSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core._nth.call(null, this.ci, this.i) + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.ci, this.i); }; cljs.core.RSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : null + return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : cljs.core.List.EMPTY; }; -cljs.core.RSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.RSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.RSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.RSeq(this.ci, this.i, b) + return new cljs.core.RSeq(this.ci, this.i, b); }; -cljs.core.RSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.RSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.cljs$core$IFn$_invoke$arity$2 ? cljs.core.cons.cljs$core$IFn$_invoke$arity$2(b, this) : cljs.core.cons.call(null, b, this); }; -cljs.core.RSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.RSeq.cljs$lang$type = !0; +cljs.core.RSeq.cljs$lang$ctorStr = "cljs.core/RSeq"; +cljs.core.RSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/RSeq"); }; cljs.core.__GT_RSeq = function(a, b, c) { - return new cljs.core.RSeq(a, b, c) + return new cljs.core.RSeq(a, b, c); +}; +cljs.core.RSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.second = function(a) { - return cljs.core.first.call(null, cljs.core.next.call(null, a)) + return cljs.core.first(cljs.core.next(a)); }; cljs.core.ffirst = function(a) { - return cljs.core.first.call(null, cljs.core.first.call(null, a)) + return cljs.core.first(cljs.core.first(a)); }; cljs.core.nfirst = function(a) { - return cljs.core.next.call(null, cljs.core.first.call(null, a)) + return cljs.core.next(cljs.core.first(a)); }; cljs.core.fnext = function(a) { - return cljs.core.first.call(null, cljs.core.next.call(null, a)) + return cljs.core.first(cljs.core.next(a)); }; cljs.core.nnext = function(a) { - return cljs.core.next.call(null, cljs.core.next.call(null, a)) + return cljs.core.next(cljs.core.next(a)); }; cljs.core.last = function(a) { - for(;;) { - var b = cljs.core.next.call(null, a); - if(null != b) { - a = b - }else { - return cljs.core.first.call(null, a) + for (;;) { + var b = cljs.core.next(a); + if (null != b) { + a = b; + } else { + return cljs.core.first(a); } } }; cljs.core.IEquiv._ = !0; cljs.core._equiv._ = function(a, b) { - return a === b + return a === b; }; cljs.core.conj = function() { - var a = null, b = function(a, b) { - return null != a ? cljs.core._conj.call(null, a, b) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b) - }, c = function() { + var a = null, b = function() { + return cljs.core.PersistentVector.EMPTY; + }, c = function(a, b) { + return null != a ? cljs.core._conj(a, b) : cljs.core._conj(cljs.core.List.EMPTY, b); + }, d = function() { var b = function(b, c, d) { - for(;;) { - if(cljs.core.truth_(d)) { - b = a.call(null, b, c), c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return a.call(null, b, c) + for (;;) { + if (cljs.core.truth_(d)) { + b = a.cljs$core$IFn$_invoke$arity$2(b, c), c = cljs.core.first(d), d = cljs.core.next(d); + } else { + return a.cljs$core$IFn$_invoke$arity$2(b, c); } } - }, c = function(a, c, e) { - var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + }, c = function(a, c, d) { + var f = null; + if (2 < arguments.length) { + for (var f = 0, m = Array(arguments.length - 2);f < m.length;) { + m[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(m, 0); + } + return b.call(this, a, c, f); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.next(a); - var e = cljs.core.first(a); + var d = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, d, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), a = function(a, e, f) { + return c; + }(), a = function(a, f, g) { switch(arguments.length) { + case 0: + return b.call(this); + case 1: + return a; case 2: - return b.call(this, a, e); + return c.call(this, a, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return d.cljs$core$IFn$_invoke$arity$variadic(a, f, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + a.cljs$lang$applyTo = d.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$0 = b; + a.cljs$core$IFn$_invoke$arity$1 = function(a) { + return a; + }; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$variadic = d.cljs$core$IFn$_invoke$arity$variadic; + return a; }(); cljs.core.empty = function(a) { - return null == a ? null : cljs.core._empty.call(null, a) + return null == a ? null : cljs.core._empty(a); }; cljs.core.accumulating_seq_count = function(a) { - a = cljs.core.seq.call(null, a); - for(var b = 0;;) { - if(cljs.core.counted_QMARK_.call(null, a)) { - return b + cljs.core._count.call(null, a) + a = cljs.core.seq(a); + for (var b = 0;;) { + if (cljs.core.counted_QMARK_(a)) { + return b + cljs.core._count(a); } - a = cljs.core.next.call(null, a); - b += 1 + a = cljs.core.next(a); + b += 1; } }; cljs.core.count = function(a) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$) ? cljs.core._count.call(null, a) : a instanceof Array ? a.length : "string" === typeof a ? a.length : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) ? cljs.core._count.call(null, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.accumulating_seq_count.call(null, a) : null : 0 + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$) ? a.cljs$core$ICounted$_count$arity$1(null) : a instanceof Array ? a.length : "string" === typeof a ? a.length : cljs.core.native_satisfies_QMARK_(cljs.core.ICounted, a) ? cljs.core._count(a) : cljs.core.accumulating_seq_count(a) : 0; }; cljs.core.linear_traversal_nth = function() { var a = null, b = function(a, b) { - for(;;) { - if(null == a) { + for (;;) { + if (null == a) { throw Error("Index out of bounds"); } - if(0 === b) { - if(cljs.core.seq.call(null, a)) { - return cljs.core.first.call(null, a) + if (0 === b) { + if (cljs.core.seq(a)) { + return cljs.core.first(a); } throw Error("Index out of bounds"); } - if(cljs.core.indexed_QMARK_.call(null, a)) { - return cljs.core._nth.call(null, a, b) + if (cljs.core.indexed_QMARK_(a)) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, b); } - if(cljs.core.seq.call(null, a)) { - var c = cljs.core.next.call(null, a), g = b - 1; + if (cljs.core.seq(a)) { + var c = cljs.core.next(a), g = b - 1; a = c; - b = g - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error("Index out of bounds"); - } - return null + b = g; + } else { + throw Error("Index out of bounds"); } } }, c = function(a, b, c) { - for(;;) { - if(null == a) { - return c + for (;;) { + if (null == a) { + return c; } - if(0 === b) { - return cljs.core.seq.call(null, a) ? cljs.core.first.call(null, a) : c + if (0 === b) { + return cljs.core.seq(a) ? cljs.core.first(a) : c; } - if(cljs.core.indexed_QMARK_.call(null, a)) { - return cljs.core._nth.call(null, a, b, c) + if (cljs.core.indexed_QMARK_(a)) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(a, b, c); } - if(cljs.core.seq.call(null, a)) { - a = cljs.core.next.call(null, a), b -= 1 - }else { - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null + if (cljs.core.seq(a)) { + a = cljs.core.next(a), b -= 1; + } else { + return c; } } }, a = function(a, e, f) { @@ -3329,115 +4449,116 @@ cljs.core.linear_traversal_nth = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.nth = function() { var a = null, b = function(a, b) { - if(null == a) { - return null + if ("number" !== typeof b) { + throw Error("index argument to nth must be a number"); } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { - return cljs.core._nth.call(null, a, b) + if (null == a) { + return a; } - if(a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : null + if (a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { + return a.cljs$core$IIndexed$_nth$arity$2(null, b); } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { - return cljs.core._nth.call(null, a, b) + if (a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : null; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - if(a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { - return cljs.core.linear_traversal_nth.call(null, a, b) - } - throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str.call(null, cljs.core.type.call(null, a)))].join("")); + if (cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a)) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, b); } - return null + if (a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) { + return cljs.core.linear_traversal_nth.cljs$core$IFn$_invoke$arity$2(a, b); + } + throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str(cljs.core.type(a)))].join("")); }, c = function(a, b, c) { - if(null != a) { - if(a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { - return cljs.core._nth.call(null, a, b, c) - } - if(a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : c - } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { - return cljs.core._nth.call(null, a, b) - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - if(a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { - return cljs.core.linear_traversal_nth.call(null, a, b, c) - } - throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str.call(null, cljs.core.type.call(null, a)))].join("")); - } - return null + if ("number" !== typeof b) { + throw Error("index argument to nth must be a number."); + } + if (null == a) { + return c; + } + if (a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { + return a.cljs$core$IIndexed$_nth$arity$3(null, b, c); } - return c + if (a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : c; + } + if (cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a)) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, b); + } + if (a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) { + return cljs.core.linear_traversal_nth.cljs$core$IFn$_invoke$arity$3(a, b, c); + } + throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str(cljs.core.type(a)))].join("")); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); +cljs.core.nthrest = function(a, b) { + for (var c = b, d = a;;) { + if (0 < c && cljs.core.seq(d)) { + c -= 1, d = cljs.core.rest(d); + } else { + return d; + } + } +}; cljs.core.get = function() { var a = null, b = function(a, b) { - if(null == a) { - return null - } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$)) { - return cljs.core._lookup.call(null, a, b) - } - if(a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : null - } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a)) { - return cljs.core._lookup.call(null, a, b) - } - new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? a.cljs$core$ILookup$_lookup$arity$2(null, b) : a instanceof Array ? b < a.length ? a[b] : null : "string" === typeof a ? b < a.length ? a[b] : null : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, a) ? cljs.core._lookup.cljs$core$IFn$_invoke$arity$2(a, b) : null; }, c = function(a, b, c) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? cljs.core._lookup.call(null, a, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a) ? cljs.core._lookup.call(null, a, b, c) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null : c + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? a.cljs$core$ILookup$_lookup$arity$3(null, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, a) ? cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(a, b, c) : c : c; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.assoc = function() { var a = null, b = function(a, b, c) { - return null != a ? cljs.core._assoc.call(null, a, b, c) : cljs.core.PersistentHashMap.fromArrays.call(null, [b], [c]) + return null != a ? cljs.core._assoc(a, b, c) : cljs.core.PersistentHashMap.fromArrays([b], [c]); }, c = function() { var b = function(b, c, d, e) { - for(;;) { - if(b = a.call(null, b, c, d), cljs.core.truth_(e)) { - c = cljs.core.first.call(null, e), d = cljs.core.second.call(null, e), e = cljs.core.nnext.call(null, e) - }else { - return b + for (;;) { + if (b = a.cljs$core$IFn$_invoke$arity$3(b, c, d), cljs.core.truth_(e)) { + c = cljs.core.first(e), d = cljs.core.second(e), e = cljs.core.nnext(e); + } else { + return b; } } }, c = function(a, c, e, k) { var l = null; - 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, e, l) + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return b.call(this, a, c, e, l); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -3447,16 +4568,23 @@ cljs.core.assoc = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a) + return b(c, e, k, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f, g) { switch(arguments.length) { case 3: return b.call(this, a, e, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) + var h = null; + if (3 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { + k[h] = arguments[h + 3], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); } throw Error("Invalid arity: " + arguments.length); }; @@ -3464,28 +4592,33 @@ cljs.core.assoc = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.dissoc = function() { var a = null, b = function(a, b) { - return cljs.core._dissoc.call(null, a, b) + return null == a ? null : cljs.core._dissoc(a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(null == b) { - return null + for (;;) { + if (null == b) { + return null; } - b = a.call(null, b, c); - if(cljs.core.truth_(d)) { - c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return b + b = a.cljs$core$IFn$_invoke$arity$2(b, c); + if (cljs.core.truth_(d)) { + c = cljs.core.first(d), d = cljs.core.next(d); + } else { + return b; } } }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -3493,10 +4626,10 @@ cljs.core.dissoc = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3504,109 +4637,304 @@ cljs.core.dissoc = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.fn_QMARK_ = function(a) { var b = goog.isFunction(a); - return b ? b : a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$Fn$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) -}; -cljs.core.with_meta = function with_meta(b, c) { - return cljs.core.fn_QMARK_.call(null, b) && !(b ? b.cljs$lang$protocol_mask$partition0$ & 262144 || b.cljs$core$IWithMeta$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, b)) ? with_meta.call(null, function() { - "undefined" === typeof cljs.core.t6140 && (cljs.core.t6140 = function(b, c, f, g) { - this.meta = b; - this.o = c; - this.with_meta = f; - this.meta6141 = g; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 393217 - }, cljs.core.t6140.cljs$lang$type = !0, cljs.core.t6140.cljs$lang$ctorStr = "cljs.core/t6140", cljs.core.t6140.cljs$lang$ctorPrWriter = function(b, c, f) { - return cljs.core._write.call(null, c, "cljs.core/t6140") - }, cljs.core.t6140.prototype.call = function() { - var b = function(b, c) { - return cljs.core.apply.call(null, b.o, c) - }, c = function(c, e) { - c = this; - var h = null; - 1 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return b.call(this, c, h) - }; - c.cljs$lang$maxFixedArity = 1; - c.cljs$lang$applyTo = function(c) { - var e = cljs.core.first(c); - c = cljs.core.rest(c); - return b(e, c) - }; - c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), cljs.core.t6140.prototype.apply = function(b, c) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, c))) - }, cljs.core.t6140.prototype.cljs$core$IFn$_invoke$arity$2 = function() { - var b = function(b) { - return cljs.core.apply.call(null, self__.o, b) - }, c = function(c) { - var e = null; - 0 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return b.call(this, e) - }; - c.cljs$lang$maxFixedArity = 0; - c.cljs$lang$applyTo = function(c) { - c = cljs.core.seq(c); - return b(c) - }; - c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), cljs.core.t6140.prototype.cljs$core$Fn$ = !0, cljs.core.t6140.prototype.cljs$core$IMeta$_meta$arity$1 = function(b) { - return this.meta6141 - }, cljs.core.t6140.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(b, c) { - return new cljs.core.t6140(this.meta, this.o, this.with_meta, c) - }, cljs.core.__GT_t6140 = function(b, c, f, g) { - return new cljs.core.t6140(b, c, f, g) - }); - return new cljs.core.t6140(c, b, with_meta, null) - }(), c) : null == b ? null : cljs.core._with_meta.call(null, b, c) + return cljs.core.truth_(b) ? b : a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$Fn$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.Fn, a) : cljs.core.native_satisfies_QMARK_(cljs.core.Fn, a); +}; +cljs.core.MetaFn = function(a, b) { + this.afn = a; + this.meta = b; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 393217; +}; +cljs.core.MetaFn.prototype.call = function() { + var a = null, b = function(a) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$0 ? a.afn.cljs$core$IFn$_invoke$arity$0() : a.afn.call(null); + }, c = function(a, b) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$1 ? a.afn.cljs$core$IFn$_invoke$arity$1(b) : a.afn.call(null, b); + }, d = function(a, b, c) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$2 ? a.afn.cljs$core$IFn$_invoke$arity$2(b, c) : a.afn.call(null, b, c); + }, e = function(a, b, c, d) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$3 ? a.afn.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.afn.call(null, b, c, d); + }, f = function(a, b, c, d, e) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$4 ? a.afn.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.afn.call(null, b, c, d, e); + }, g = function(a, b, c, d, e, f) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$5 ? a.afn.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : a.afn.call(null, b, c, d, e, f); + }, h = function(a, b, c, d, e, f, g) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$6 ? a.afn.cljs$core$IFn$_invoke$arity$6(b, c, d, e, f, g) : a.afn.call(null, b, c, d, e, f, g); + }, k = function(a, b, c, d, e, f, g, h) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$7 ? a.afn.cljs$core$IFn$_invoke$arity$7(b, c, d, e, f, g, h) : a.afn.call(null, b, c, d, e, f, g, h); + }, l = function(a, b, c, d, e, f, g, h, k) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$8 ? a.afn.cljs$core$IFn$_invoke$arity$8(b, c, d, e, f, g, h, k) : a.afn.call(null, b, c, d, e, f, g, h, k); + }, m = function(a, b, c, d, e, f, g, h, k, l) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$9 ? a.afn.cljs$core$IFn$_invoke$arity$9(b, c, d, e, f, g, h, k, l) : a.afn.call(null, b, c, d, e, f, g, h, k, l); + }, n = function(a, b, c, d, e, f, g, h, k, l, m) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$10 ? a.afn.cljs$core$IFn$_invoke$arity$10(b, c, d, e, f, g, h, k, l, m) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m); + }, p = function(a, b, c, d, e, f, g, h, k, l, m, q) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$11 ? a.afn.cljs$core$IFn$_invoke$arity$11(b, c, d, e, f, g, h, k, l, m, q) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q); + }, q = function(a, b, c, d, e, f, g, h, k, l, m, q, n) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$12 ? a.afn.cljs$core$IFn$_invoke$arity$12(b, c, d, e, f, g, h, k, l, m, q, n) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n); + }, r = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$13 ? a.afn.cljs$core$IFn$_invoke$arity$13(b, c, d, e, f, g, h, k, l, m, q, n, r) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r); + }, s = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$14 ? a.afn.cljs$core$IFn$_invoke$arity$14(b, c, d, e, f, g, h, k, l, m, q, n, r, p) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p); + }, t = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$15 ? a.afn.cljs$core$IFn$_invoke$arity$15(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); + }, u = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$16 ? a.afn.cljs$core$IFn$_invoke$arity$16(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); + }, v = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$17 ? a.afn.cljs$core$IFn$_invoke$arity$17(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); + }, w = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$18 ? a.afn.cljs$core$IFn$_invoke$arity$18(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); + }, y = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$19 ? a.afn.cljs$core$IFn$_invoke$arity$19(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); + }, F = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) { + a = this; + return a.afn.cljs$core$IFn$_invoke$arity$20 ? a.afn.cljs$core$IFn$_invoke$arity$20(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); + }, L = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) { + a = this.afn; + return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) : cljs.core.apply.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); + }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, x); + case 3: + return d.call(this, a, x, z); + case 4: + return e.call(this, a, x, z, A); + case 5: + return f.call(this, a, x, z, A, B); + case 6: + return g.call(this, a, x, z, A, B, C); + case 7: + return h.call(this, a, x, z, A, B, C, D); + case 8: + return k.call(this, a, x, z, A, B, C, D, E); + case 9: + return l.call(this, a, x, z, A, B, C, D, E, G); + case 10: + return m.call(this, a, x, z, A, B, C, D, E, G, H); + case 11: + return n.call(this, a, x, z, A, B, C, D, E, G, H, I); + case 12: + return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); + case 13: + return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); + case 14: + return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); + case 15: + return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); + case 16: + return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); + case 17: + return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); + case 18: + return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); + case 19: + return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); + case 20: + return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); + case 21: + return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); + case 22: + return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$3 = d; + a.cljs$core$IFn$_invoke$arity$4 = e; + a.cljs$core$IFn$_invoke$arity$5 = f; + a.cljs$core$IFn$_invoke$arity$6 = g; + a.cljs$core$IFn$_invoke$arity$7 = h; + a.cljs$core$IFn$_invoke$arity$8 = k; + a.cljs$core$IFn$_invoke$arity$9 = l; + a.cljs$core$IFn$_invoke$arity$10 = m; + a.cljs$core$IFn$_invoke$arity$11 = n; + a.cljs$core$IFn$_invoke$arity$12 = p; + a.cljs$core$IFn$_invoke$arity$13 = q; + a.cljs$core$IFn$_invoke$arity$14 = r; + a.cljs$core$IFn$_invoke$arity$15 = s; + a.cljs$core$IFn$_invoke$arity$16 = t; + a.cljs$core$IFn$_invoke$arity$17 = u; + a.cljs$core$IFn$_invoke$arity$18 = v; + a.cljs$core$IFn$_invoke$arity$19 = w; + a.cljs$core$IFn$_invoke$arity$20 = y; + a.cljs$core$IFn$_invoke$arity$21 = F; + a.cljs$core$IFn$_invoke$arity$22 = L; + return a; +}(); +cljs.core.MetaFn.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$0 = function() { + return this.afn.cljs$core$IFn$_invoke$arity$0 ? this.afn.cljs$core$IFn$_invoke$arity$0() : this.afn.call(null); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.afn.cljs$core$IFn$_invoke$arity$1 ? this.afn.cljs$core$IFn$_invoke$arity$1(a) : this.afn.call(null, a); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.afn.cljs$core$IFn$_invoke$arity$2 ? this.afn.cljs$core$IFn$_invoke$arity$2(a, b) : this.afn.call(null, a, b); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$3 = function(a, b, c) { + return this.afn.cljs$core$IFn$_invoke$arity$3 ? this.afn.cljs$core$IFn$_invoke$arity$3(a, b, c) : this.afn.call(null, a, b, c); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$4 = function(a, b, c, d) { + return this.afn.cljs$core$IFn$_invoke$arity$4 ? this.afn.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : this.afn.call(null, a, b, c, d); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$5 = function(a, b, c, d, e) { + return this.afn.cljs$core$IFn$_invoke$arity$5 ? this.afn.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) : this.afn.call(null, a, b, c, d, e); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$6 = function(a, b, c, d, e, f) { + return this.afn.cljs$core$IFn$_invoke$arity$6 ? this.afn.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) : this.afn.call(null, a, b, c, d, e, f); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$7 = function(a, b, c, d, e, f, g) { + return this.afn.cljs$core$IFn$_invoke$arity$7 ? this.afn.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) : this.afn.call(null, a, b, c, d, e, f, g); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$8 = function(a, b, c, d, e, f, g, h) { + return this.afn.cljs$core$IFn$_invoke$arity$8 ? this.afn.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) : this.afn.call(null, a, b, c, d, e, f, g, h); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$9 = function(a, b, c, d, e, f, g, h, k) { + return this.afn.cljs$core$IFn$_invoke$arity$9 ? this.afn.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) : this.afn.call(null, a, b, c, d, e, f, g, h, k); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$10 = function(a, b, c, d, e, f, g, h, k, l) { + return this.afn.cljs$core$IFn$_invoke$arity$10 ? this.afn.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$11 = function(a, b, c, d, e, f, g, h, k, l, m) { + return this.afn.cljs$core$IFn$_invoke$arity$11 ? this.afn.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$12 = function(a, b, c, d, e, f, g, h, k, l, m, n) { + return this.afn.cljs$core$IFn$_invoke$arity$12 ? this.afn.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$13 = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { + return this.afn.cljs$core$IFn$_invoke$arity$13 ? this.afn.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$14 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { + return this.afn.cljs$core$IFn$_invoke$arity$14 ? this.afn.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$15 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { + return this.afn.cljs$core$IFn$_invoke$arity$15 ? this.afn.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$16 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { + return this.afn.cljs$core$IFn$_invoke$arity$16 ? this.afn.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$17 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { + return this.afn.cljs$core$IFn$_invoke$arity$17 ? this.afn.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$18 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { + return this.afn.cljs$core$IFn$_invoke$arity$18 ? this.afn.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$19 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { + return this.afn.cljs$core$IFn$_invoke$arity$19 ? this.afn.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$20 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { + return this.afn.cljs$core$IFn$_invoke$arity$20 ? this.afn.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); +}; +cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$21 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { + var F = this.afn; + return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : cljs.core.apply.call(null, F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); +}; +cljs.core.MetaFn.prototype.cljs$core$Fn$ = !0; +cljs.core.MetaFn.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.MetaFn(this.afn, b); +}; +cljs.core.MetaFn.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.MetaFn.cljs$lang$type = !0; +cljs.core.MetaFn.cljs$lang$ctorStr = "cljs.core/MetaFn"; +cljs.core.MetaFn.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/MetaFn"); +}; +cljs.core.__GT_MetaFn = function(a, b) { + return new cljs.core.MetaFn(a, b); +}; +cljs.core.with_meta = function(a, b) { + var c; + if (c = cljs.core.fn_QMARK_(a)) { + c = !(a ? a.cljs$lang$protocol_mask$partition0$ & 262144 || a.cljs$core$IWithMeta$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IWithMeta, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IWithMeta, a)); + } + return c ? new cljs.core.MetaFn(a, b) : null == a ? null : cljs.core._with_meta(a, b); }; cljs.core.meta = function(a) { var b; - b = (b = null != a) ? a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, a) : b; - return b ? cljs.core._meta.call(null, a) : null + b = (b = null != a) ? a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a) : b; + return b ? cljs.core._meta(a) : null; }; cljs.core.peek = function(a) { - return null == a ? null : cljs.core._peek.call(null, a) + return null == a ? null : cljs.core._peek(a); }; cljs.core.pop = function(a) { - return null == a ? null : cljs.core._pop.call(null, a) + return null == a ? null : cljs.core._pop(a); }; cljs.core.disj = function() { var a = null, b = function(a, b) { - return cljs.core._disjoin.call(null, a, b) + return null == a ? null : cljs.core._disjoin(a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(null == b) { - return null + for (;;) { + if (null == b) { + return null; } - b = a.call(null, b, c); - if(cljs.core.truth_(d)) { - c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return b + b = a.cljs$core$IFn$_invoke$arity$2(b, c); + if (cljs.core.truth_(d)) { + c = cljs.core.first(d), d = cljs.core.next(d); + } else { + return b; } } }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -3614,10 +4942,10 @@ cljs.core.disj = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3625,193 +4953,202 @@ cljs.core.disj = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a -}(); -cljs.core.string_hash_cache = function() { - return{} + return a; }(); -cljs.core.string_hash_cache_count = 0; -cljs.core.add_to_string_hash_cache = function(a) { - var b = goog.string.hashCode(a); - cljs.core.string_hash_cache[a] = b; - cljs.core.string_hash_cache_count += 1; - return b -}; -cljs.core.check_string_hash_cache = function(a) { - 255 < cljs.core.string_hash_cache_count && (cljs.core.string_hash_cache = {}, cljs.core.string_hash_cache_count = 0); - var b = cljs.core.string_hash_cache[a]; - return"number" === typeof b ? b : cljs.core.add_to_string_hash_cache.call(null, a) -}; -cljs.core.hash = function(a) { - return a && (a.cljs$lang$protocol_mask$partition0$ & 4194304 || a.cljs$core$IHash$) ? cljs.core._hash.call(null, a) : "number" === typeof a ? Math.floor(a) % 2147483647 : !0 === a ? 1 : !1 === a ? 0 : "string" === typeof a ? cljs.core.check_string_hash_cache.call(null, a) : null == a ? 0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._hash.call(null, a) : null -}; cljs.core.empty_QMARK_ = function(a) { - return null == a || cljs.core.not.call(null, cljs.core.seq.call(null, a)) + return null == a || cljs.core.not(cljs.core.seq(a)); }; cljs.core.coll_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 8 || a.cljs$core$ICollection$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 8 || a.cljs$core$ICollection$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ICollection, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ICollection, a); }; cljs.core.set_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 4096 || a.cljs$core$ISet$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 4096 || a.cljs$core$ISet$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISet, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISet, a); }; cljs.core.associative_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 512 || a.cljs$core$IAssociative$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 512 || a.cljs$core$IAssociative$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IAssociative, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IAssociative, a); }; cljs.core.sequential_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16777216 || a.cljs$core$ISequential$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 16777216 || a.cljs$core$ISequential$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISequential, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISequential, a); }; cljs.core.sorted_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 268435456 || a.cljs$core$ISorted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 268435456 || a.cljs$core$ISorted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISorted, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISorted, a); }; cljs.core.reduceable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 524288 || a.cljs$core$IReduce$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 524288 || a.cljs$core$IReduce$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, a); }; cljs.core.map_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 1024 || a.cljs$core$IMap$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 1024 || a.cljs$core$IMap$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IMap, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IMap, a); }; cljs.core.vector_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16384 || a.cljs$core$IVector$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 16384 || a.cljs$core$IVector$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IVector, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IVector, a); }; cljs.core.chunked_seq_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition1$ & 512 || a.cljs$core$IChunkedSeq$ ? !0 : !1 : !1 + return a ? a.cljs$lang$protocol_mask$partition1$ & 512 || a.cljs$core$IChunkedSeq$ ? !0 : !1 : !1; }; cljs.core.js_obj = function() { var a = null, b = function() { var a = function(a) { - return cljs.core.apply.call(null, goog.object.create, a) + var b = goog.object.create; + return cljs.core.apply.cljs$core$IFn$_invoke$arity$2 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$2(b, a) : cljs.core.apply.call(null, b, a); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, g = Array(arguments.length - 0);d < g.length;) { + g[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(g, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a) { switch(arguments.length) { case 0: return{}; default: - return b.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)) + var d = null; + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(d); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 0; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return{} + return{}; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.js_keys = function(a) { - var b = []; - goog.object.forEach(a, function(a, d, e) { - return b.push(d) - }); - return b + var b = [], c = function(a, b) { + return function(a, c, d) { + return b.push(c); + }; + }(a, b); + goog.object.forEach(a, c); + return b; }; cljs.core.js_delete = function(a, b) { - return delete a[b] + return delete a[b]; }; cljs.core.array_copy = function(a, b, c, d, e) { - for(;;) { - if(0 === e) { - return c + for (;;) { + if (0 === e) { + return c; } c[d] = a[b]; d += 1; e -= 1; - b += 1 + b += 1; } }; cljs.core.array_copy_downward = function(a, b, c, d, e) { b += e - 1; - for(d += e - 1;;) { - if(0 === e) { - return c + for (d += e - 1;;) { + if (0 === e) { + return c; } c[d] = a[b]; d -= 1; e -= 1; - b -= 1 + b -= 1; } }; cljs.core.lookup_sentinel = function() { - return{} + return{}; }(); cljs.core.false_QMARK_ = function(a) { - return!1 === a + return!1 === a; }; cljs.core.true_QMARK_ = function(a) { - return!0 === a + return!0 === a; }; cljs.core.undefined_QMARK_ = function(a) { - return void 0 === a + return void 0 === a; }; cljs.core.seq_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a); }; cljs.core.seqable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeqable, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeqable, a); }; cljs.core.boolean$ = function(a) { - return cljs.core.truth_(a) ? !0 : !1 + return cljs.core.truth_(a) ? !0 : !1; }; cljs.core.ifn_QMARK_ = function(a) { - var b = cljs.core.fn_QMARK_.call(null, a); - return b ? b : a ? a.cljs$lang$protocol_mask$partition0$ & 1 || a.cljs$core$IFn$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) + var b = cljs.core.fn_QMARK_(a); + return b ? b : a ? a.cljs$lang$protocol_mask$partition0$ & 1 || a.cljs$core$IFn$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IFn, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IFn, a); }; cljs.core.integer_QMARK_ = function(a) { - return"number" === typeof a && !isNaN(a) && Infinity !== a && parseFloat(a) === parseInt(a, 10) + return "number" === typeof a && cljs.core.not(isNaN(a)) && Infinity !== a && parseFloat(a) === parseInt(a, 10); }; cljs.core.contains_QMARK_ = function(a, b) { - return cljs.core.get.call(null, a, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? !1 : !0 + return cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? !1 : !0; }; cljs.core.find = function(a, b) { - return null != a && cljs.core.associative_QMARK_.call(null, a) && cljs.core.contains_QMARK_.call(null, a, b) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, cljs.core.get.call(null, a, b)], null) : null + return null != a && cljs.core.associative_QMARK_(a) && cljs.core.contains_QMARK_(a, b) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b)], null) : null; }; cljs.core.distinct_QMARK_ = function() { var a = null, b = function(a, b) { - return!cljs.core._EQ_.call(null, a, b) + return!cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b); }, c = function() { var a = function(a, b, c) { - if(cljs.core._EQ_.call(null, a, b)) { - return!1 - } - a = cljs.core.PersistentHashSet.fromArray([b, a], !0); - for(b = c;;) { - var d = cljs.core.first.call(null, b); - c = cljs.core.next.call(null, b); - if(cljs.core.truth_(b)) { - if(cljs.core.contains_QMARK_.call(null, a, d)) { - return!1 + if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b)) { + return!1; + } + a = cljs.core.PersistentHashSet.fromArray([a, b], !0); + for (b = c;;) { + var d = cljs.core.first(b); + c = cljs.core.next(b); + if (cljs.core.truth_(b)) { + if (cljs.core.contains_QMARK_(a, d)) { + return!1; } - a = cljs.core.conj.call(null, a, d); - b = c - }else { - return!0 + a = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d); + b = c; + } else { + return!0; } } }, b = function(b, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return a.call(this, b, c, k); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -3819,10 +5156,10 @@ cljs.core.distinct_QMARK_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b) + return a(c, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3830,51 +5167,52 @@ cljs.core.distinct_QMARK_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); -cljs.core.sequence = function(a) { - return cljs.core.seq_QMARK_.call(null, a) ? a : (a = cljs.core.seq.call(null, a)) ? a : cljs.core.List.EMPTY -}; cljs.core.compare = function(a, b) { - if(a === b) { - return 0 + if (a === b) { + return 0; } - if(null == a) { - return-1 + if (null == a) { + return-1; } - if(null == b) { - return 1 + if (null == b) { + return 1; } - if(cljs.core.type.call(null, a) === cljs.core.type.call(null, b)) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 2048 || a.cljs$core$IComparable$) ? cljs.core._compare.call(null, a, b) : goog.array.defaultCompare(a, b) + if (cljs.core.type(a) === cljs.core.type(b)) { + return a && (a.cljs$lang$protocol_mask$partition1$ & 2048 || a.cljs$core$IComparable$) ? a.cljs$core$IComparable$_compare$arity$2(null, b) : goog.array.defaultCompare(a, b); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error("compare on non-nil objects of different types"); - } - return null + throw Error("compare on non-nil objects of different types"); }; cljs.core.compare_indexed = function() { var a = null, b = function(b, c) { - var f = cljs.core.count.call(null, b), g = cljs.core.count.call(null, c); - return f < g ? -1 : f > g ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a.call(null, b, c, f, 0) : null + var f = cljs.core.count(b), g = cljs.core.count(c); + return f < g ? -1 : f > g ? 1 : a.cljs$core$IFn$_invoke$arity$4(b, c, f, 0); }, c = function(a, b, c, g) { - for(;;) { - var h = cljs.core.compare.call(null, cljs.core.nth.call(null, a, g), cljs.core.nth.call(null, b, g)); - if(0 === h && g + 1 < c) { - g += 1 - }else { - return h + for (;;) { + var h = cljs.core.compare(cljs.core.nth.cljs$core$IFn$_invoke$arity$2(a, g), cljs.core.nth.cljs$core$IFn$_invoke$arity$2(b, g)); + if (0 === h && g + 1 < c) { + g += 1; + } else { + return h; } } }, a = function(a, e, f, g) { @@ -3882,77 +5220,84 @@ cljs.core.compare_indexed = function() { case 2: return b.call(this, a, e); case 4: - return c.call(this, a, e, f, g) + return c.call(this, a, e, f, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$4 = c; - return a + return a; }(); cljs.core.fn__GT_comparator = function(a) { - return cljs.core._EQ_.call(null, a, cljs.core.compare) ? cljs.core.compare : function(b, c) { - var d = a.call(null, b, c); - return"number" === typeof d ? d : cljs.core.truth_(d) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : 0 - } + return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, cljs.core.compare) ? cljs.core.compare : function(b, c) { + var d = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + return "number" === typeof d ? d : cljs.core.truth_(d) ? -1 : cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, b) : a.call(null, c, b)) ? 1 : 0; + }; }; cljs.core.sort = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.compare, b) + return a.cljs$core$IFn$_invoke$arity$2(cljs.core.compare, b); }, c = function(a, b) { - if(cljs.core.seq.call(null, b)) { - var c = cljs.core.to_array.call(null, b); - goog.array.stableSort(c, cljs.core.fn__GT_comparator.call(null, a)); - return cljs.core.seq.call(null, c) - } - return cljs.core.List.EMPTY + if (cljs.core.seq(b)) { + var c; + c = cljs.core.to_array.cljs$core$IFn$_invoke$arity$1 ? cljs.core.to_array.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.to_array.call(null, b); + var g = cljs.core.fn__GT_comparator(a); + goog.array.stableSort(c, g); + return cljs.core.seq(c); + } + return cljs.core.List.EMPTY; }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.sort_by = function() { var a = null, b = function(b, c) { - return a.call(null, b, cljs.core.compare, c) + return a.cljs$core$IFn$_invoke$arity$3(b, cljs.core.compare, c); }, c = function(a, b, c) { - return cljs.core.sort.call(null, function(c, f) { - return cljs.core.fn__GT_comparator.call(null, b).call(null, a.call(null, c), a.call(null, f)) - }, c) + return cljs.core.sort.cljs$core$IFn$_invoke$arity$2(function(c, f) { + return cljs.core.fn__GT_comparator(b).call(null, a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f)); + }, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.seq_reduce = function() { var a = null, b = function(a, b) { - var c = cljs.core.seq.call(null, b); - return c ? cljs.core.reduce.call(null, a, cljs.core.first.call(null, c), cljs.core.next.call(null, c)) : a.call(null) + var c = cljs.core.seq(b); + if (c) { + var g = cljs.core.first(c), c = cljs.core.next(c); + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, g, c) : cljs.core.reduce.call(null, a, g, c); + } + return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); }, c = function(a, b, c) { - for(c = cljs.core.seq.call(null, c);;) { - if(c) { - b = a.call(null, b, cljs.core.first.call(null, c)); - if(cljs.core.reduced_QMARK_.call(null, b)) { - return cljs.core.deref.call(null, b) + for (c = cljs.core.seq(c);;) { + if (c) { + var g = cljs.core.first(c); + b = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, g) : a.call(null, b, g); + if (cljs.core.reduced_QMARK_(b)) { + return cljs.core.deref(b); } - c = cljs.core.next.call(null, c) - }else { - return b + c = cljs.core.next(c); + } else { + return b; } } }, a = function(a, e, f) { @@ -3960,59 +5305,127 @@ cljs.core.seq_reduce = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.shuffle = function(a) { - a = cljs.core.to_array.call(null, a); + a = cljs.core.to_array.cljs$core$IFn$_invoke$arity$1 ? cljs.core.to_array.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.to_array.call(null, a); goog.array.shuffle(a); - return cljs.core.vec.call(null, a) + return cljs.core.vec.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vec.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.vec.call(null, a); }; cljs.core.reduce = function() { var a = null, b = function(a, b) { - return b && (b.cljs$lang$protocol_mask$partition0$ & 524288 || b.cljs$core$IReduce$) ? cljs.core._reduce.call(null, b, a) : b instanceof Array ? cljs.core.array_reduce.call(null, b, a) : "string" === typeof b ? cljs.core.array_reduce.call(null, b, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, b) ? cljs.core._reduce.call(null, b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b) : null + return b && (b.cljs$lang$protocol_mask$partition0$ & 524288 || b.cljs$core$IReduce$) ? b.cljs$core$IReduce$_reduce$arity$2(null, a) : b instanceof Array ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$2(b, a) : "string" === typeof b ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$2(b, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, b) ? cljs.core._reduce.cljs$core$IFn$_invoke$arity$2(b, a) : cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(a, b); }, c = function(a, b, c) { - return c && (c.cljs$lang$protocol_mask$partition0$ & 524288 || c.cljs$core$IReduce$) ? cljs.core._reduce.call(null, c, a, b) : c instanceof Array ? cljs.core.array_reduce.call(null, c, a, b) : "string" === typeof c ? cljs.core.array_reduce.call(null, c, a, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, c) ? cljs.core._reduce.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b, c) : null + return c && (c.cljs$lang$protocol_mask$partition0$ & 524288 || c.cljs$core$IReduce$) ? c.cljs$core$IReduce$_reduce$arity$3(null, a, b) : c instanceof Array ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$3(c, a, b) : "string" === typeof c ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$3(c, a, b) : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, c) ? cljs.core._reduce.cljs$core$IFn$_invoke$arity$3(c, a, b) : cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.reduce_kv = function(a, b, c) { - return null != c ? cljs.core._kv_reduce.call(null, c, a, b) : b + return null != c ? cljs.core._kv_reduce(c, a, b) : b; }; -cljs.core._PLUS_ = function() { - var a = null, b = function() { - var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b + c, d) - }, d = function(a, d, g) { - var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) - }; - d.cljs$lang$maxFixedArity = 2; - d.cljs$lang$applyTo = function(a) { - var d = cljs.core.first(a); +cljs.core.identity = function(a) { + return a; +}; +cljs.core.completing = function() { + var a = null, b = function(b) { + return a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.identity); + }, c = function(a, b) { + return function() { + var c = null, g = function() { + return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); + }, h = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, k = function(b, c) { + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return g.call(this); + case 1: + return h.call(this, a); + case 2: + return k.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = g; + c.cljs$core$IFn$_invoke$arity$1 = h; + c.cljs$core$IFn$_invoke$arity$2 = k; + return c; + }(); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.transduce = function() { + var a = null, b = function(b, c, f) { + return a.cljs$core$IFn$_invoke$arity$4(b, c, c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null), f); + }, c = function(a, b, c, g) { + a = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + c = cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, c, g); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }, a = function(a, e, f, g) { + switch(arguments.length) { + case 3: + return b.call(this, a, e, f); + case 4: + return c.call(this, a, e, f, g); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$3 = b; + a.cljs$core$IFn$_invoke$arity$4 = c; + return a; +}(); +cljs.core._PLUS_ = function() { + var a = null, b = function() { + var b = function(b, c, d) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b + c, d); + }, d = function(a, d, g) { + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); + }; + d.cljs$lang$maxFixedArity = 2; + d.cljs$lang$applyTo = function(a) { + var d = cljs.core.first(a); a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4022,32 +5435,44 @@ cljs.core._PLUS_ = function() { case 2: return a + d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0 + return 0; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b + return a + b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b - c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b - c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4055,10 +5480,10 @@ cljs.core._ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4066,29 +5491,41 @@ cljs.core._ = function() { case 2: return a - d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a + return-a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b + return a - b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._STAR_ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b * c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b * c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4096,10 +5533,10 @@ cljs.core._STAR_ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4109,34 +5546,46 @@ cljs.core._STAR_ = function() { case 2: return a * d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1 + return 1; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b + return a * b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._SLASH_ = function() { var a = null, b = function(b) { - return a.call(null, 1, b) + return a.cljs$core$IFn$_invoke$arity$2(1, b); }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, a.call(null, b, c), d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, a.cljs$core$IFn$_invoke$arity$2(b, c), d); }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4144,10 +5593,10 @@ cljs.core._SLASH_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4155,7 +5604,14 @@ cljs.core._SLASH_ = function() { case 2: return a / e; default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; @@ -4163,29 +5619,34 @@ cljs.core._SLASH_ = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a / b + return a / b; }; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._LT_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a < b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b < cljs.core.first.call(null, c) + for (;;) { + if (a < b) { + if (cljs.core.next(c)) { + a = b, b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return b < cljs.core.first(c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4193,10 +5654,10 @@ cljs.core._LT_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4204,39 +5665,51 @@ cljs.core._LT_ = function() { case 2: return a < d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a < b + return a < b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._LT__EQ_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a <= b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b <= cljs.core.first.call(null, c) + for (;;) { + if (a <= b) { + if (cljs.core.next(c)) { + a = b, b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return b <= cljs.core.first(c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4244,10 +5717,10 @@ cljs.core._LT__EQ_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4255,39 +5728,51 @@ cljs.core._LT__EQ_ = function() { case 2: return a <= d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a <= b + return a <= b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._GT_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a > b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b > cljs.core.first.call(null, c) + for (;;) { + if (a > b) { + if (cljs.core.next(c)) { + a = b, b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return b > cljs.core.first(c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4295,10 +5780,10 @@ cljs.core._GT_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4306,39 +5791,51 @@ cljs.core._GT_ = function() { case 2: return a > d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a > b + return a > b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._GT__EQ_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a >= b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b >= cljs.core.first.call(null, c) + for (;;) { + if (a >= b) { + if (cljs.core.next(c)) { + a = b, b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return b >= cljs.core.first(c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4346,10 +5843,10 @@ cljs.core._GT__EQ_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4357,34 +5854,46 @@ cljs.core._GT__EQ_ = function() { case 2: return a >= d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a >= b + return a >= b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.dec = function(a) { - return a - 1 + return a - 1; }; cljs.core.max = function() { var a = null, b = function(a, b) { - return a > b ? a : b + return a > b ? a : b; }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b > c ? b : c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b > c ? b : c, d); }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4392,10 +5901,10 @@ cljs.core.max = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4403,29 +5912,41 @@ cljs.core.max = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.min = function() { var a = null, b = function(a, b) { - return a < b ? a : b + return a < b ? a : b; }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b < c ? b : c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b < c ? b : c, d); }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4433,10 +5954,10 @@ cljs.core.min = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4444,66 +5965,75 @@ cljs.core.min = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.byte$ = function(a) { - return a + return a; }; cljs.core.char$ = function(a) { - if("number" === typeof a) { - return String.fromCharCode(a) + if ("number" === typeof a) { + return String.fromCharCode(a); } - if("string" === typeof a && 1 === a.length) { - return a + if ("string" === typeof a && 1 === a.length) { + return a; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error("Argument to char must be a character or number"); - } - return null + throw Error("Argument to char must be a character or number"); }; cljs.core.short$ = function(a) { - return a + return a; }; cljs.core.float$ = function(a) { - return a + return a; }; cljs.core.double$ = function(a) { - return a + return a; }; cljs.core.unchecked_byte = function(a) { - return a + return a; }; cljs.core.unchecked_char = function(a) { - return a + return a; }; cljs.core.unchecked_short = function(a) { - return a + return a; }; cljs.core.unchecked_float = function(a) { - return a + return a; }; cljs.core.unchecked_double = function(a) { - return a + return a; }; cljs.core.unchecked_add = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b + c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b + c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4511,10 +6041,10 @@ cljs.core.unchecked_add = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4524,32 +6054,44 @@ cljs.core.unchecked_add = function() { case 2: return a + d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0 + return 0; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b + return a + b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_add_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b + c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b + c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4557,10 +6099,10 @@ cljs.core.unchecked_add_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4570,40 +6112,52 @@ cljs.core.unchecked_add_int = function() { case 2: return a + d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0 + return 0; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b + return a + b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_dec = function(a) { - return a - 1 + return a - 1; }; cljs.core.unchecked_dec_int = function(a) { - return a - 1 + return a - 1; }; cljs.core.unchecked_divide_int = function() { var a = null, b = function(b) { - return a.call(null, 1, b) + return a.cljs$core$IFn$_invoke$arity$2(1, b); }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, a.call(null, b, c), d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, a.cljs$core$IFn$_invoke$arity$2(b, c), d); }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4611,10 +6165,10 @@ cljs.core.unchecked_divide_int = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4622,7 +6176,14 @@ cljs.core.unchecked_divide_int = function() { case 2: return a / e; default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; @@ -4630,25 +6191,30 @@ cljs.core.unchecked_divide_int = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a / b + return a / b; }; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_inc = function(a) { - return a + 1 + return a + 1; }; cljs.core.unchecked_inc_int = function(a) { - return a + 1 + return a + 1; }; cljs.core.unchecked_multiply = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b * c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b * c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4656,10 +6222,10 @@ cljs.core.unchecked_multiply = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4669,32 +6235,44 @@ cljs.core.unchecked_multiply = function() { case 2: return a * d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1 + return 1; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b + return a * b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_multiply_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b * c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b * c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4702,10 +6280,10 @@ cljs.core.unchecked_multiply_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4715,41 +6293,53 @@ cljs.core.unchecked_multiply_int = function() { case 2: return a * d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1 + return 1; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b + return a * b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_negate = function(a) { - return-a + return-a; }; cljs.core.unchecked_negate_int = function(a) { - return-a + return-a; }; cljs.core.unchecked_remainder_int = function(a, b) { - return cljs.core.mod.call(null, a, b) + return cljs.core.mod.cljs$core$IFn$_invoke$arity$2 ? cljs.core.mod.cljs$core$IFn$_invoke$arity$2(a, b) : cljs.core.mod.call(null, a, b); }; -cljs.core.unchecked_substract = function() { +cljs.core.unchecked_subtract = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b - c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b - c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4757,10 +6347,10 @@ cljs.core.unchecked_substract = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4768,29 +6358,41 @@ cljs.core.unchecked_substract = function() { case 2: return a - d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a + return-a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b + return a - b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); -cljs.core.unchecked_substract_int = function() { +cljs.core.unchecked_subtract_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b - c, d) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b - c, d); }, d = function(a, d, g) { var h = null; - 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4798,10 +6400,10 @@ cljs.core.unchecked_substract_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4809,158 +6411,329 @@ cljs.core.unchecked_substract_int = function() { case 2: return a - d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a + return-a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b + return a - b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.fix = function(a) { - return 0 <= a ? Math.floor.call(null, a) : Math.ceil.call(null, a) + return 0 <= a ? Math.floor.cljs$core$IFn$_invoke$arity$1 ? Math.floor.cljs$core$IFn$_invoke$arity$1(a) : Math.floor.call(null, a) : Math.ceil.cljs$core$IFn$_invoke$arity$1 ? Math.ceil.cljs$core$IFn$_invoke$arity$1(a) : Math.ceil.call(null, a); }; cljs.core.int$ = function(a) { - return a | 0 + return a | 0; }; cljs.core.unchecked_int = function(a) { - return cljs.core.fix.call(null, a) + return cljs.core.fix(a); }; cljs.core.long$ = function(a) { - return cljs.core.fix.call(null, a) + return cljs.core.fix(a); }; cljs.core.unchecked_long = function(a) { - return cljs.core.fix.call(null, a) + return cljs.core.fix(a); }; cljs.core.booleans = function(a) { - return a + return a; }; cljs.core.bytes = function(a) { - return a + return a; }; cljs.core.chars = function(a) { - return a + return a; }; cljs.core.shorts = function(a) { - return a + return a; }; cljs.core.ints = function(a) { - return a + return a; }; cljs.core.floats = function(a) { - return a + return a; }; cljs.core.doubles = function(a) { - return a + return a; }; cljs.core.longs = function(a) { - return a + return a; }; cljs.core.js_mod = function(a, b) { - return a % b + return a % b; }; cljs.core.mod = function(a, b) { - return(a % b + b) % b + return(a % b + b) % b; }; cljs.core.quot = function(a, b) { - return cljs.core.fix.call(null, (a - a % b) / b) + return cljs.core.fix((a - a % b) / b); }; cljs.core.rem = function(a, b) { - var c = cljs.core.quot.call(null, a, b); - return a - b * c + var c = cljs.core.quot(a, b); + return a - b * c; }; -cljs.core.rand = function() { +cljs.core.bit_xor = function() { var a = null, b = function() { - return Math.random.call(null) - }, c = function(b) { - return b * a.call(null) - }, a = function(a) { + var b = function(b, c, d) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b ^ c, d); + }, d = function(a, d, g) { + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); + }; + d.cljs$lang$maxFixedArity = 2; + d.cljs$lang$applyTo = function(a) { + var d = cljs.core.first(a); + a = cljs.core.next(a); + var g = cljs.core.first(a); + a = cljs.core.rest(a); + return b(d, g, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = b; + return d; + }(), a = function(a, d, e) { switch(arguments.length) { - case 0: - return b.call(this); - case 1: - return c.call(this, a) + case 2: + return a ^ d; + default: + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); } throw Error("Invalid arity: " + arguments.length); }; - a.cljs$core$IFn$_invoke$arity$0 = b; - a.cljs$core$IFn$_invoke$arity$1 = c; - return a + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = b.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return a ^ b; + }; + a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.bit_and = function() { + var a = null, b = function() { + var b = function(b, c, d) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b & c, d); + }, d = function(a, d, g) { + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); + }; + d.cljs$lang$maxFixedArity = 2; + d.cljs$lang$applyTo = function(a) { + var d = cljs.core.first(a); + a = cljs.core.next(a); + var g = cljs.core.first(a); + a = cljs.core.rest(a); + return b(d, g, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = b; + return d; + }(), a = function(a, d, e) { + switch(arguments.length) { + case 2: + return a & d; + default: + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = b.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return a & b; + }; + a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.bit_or = function() { + var a = null, b = function() { + var b = function(b, c, d) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b | c, d); + }, d = function(a, d, g) { + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); + }; + d.cljs$lang$maxFixedArity = 2; + d.cljs$lang$applyTo = function(a) { + var d = cljs.core.first(a); + a = cljs.core.next(a); + var g = cljs.core.first(a); + a = cljs.core.rest(a); + return b(d, g, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = b; + return d; + }(), a = function(a, d, e) { + switch(arguments.length) { + case 2: + return a | d; + default: + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = b.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return a | b; + }; + a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.bit_and_not = function() { + var a = null, b = function() { + var b = function(b, c, d) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b & ~c, d); + }, d = function(a, d, g) { + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, d, h); + }; + d.cljs$lang$maxFixedArity = 2; + d.cljs$lang$applyTo = function(a) { + var d = cljs.core.first(a); + a = cljs.core.next(a); + var g = cljs.core.first(a); + a = cljs.core.rest(a); + return b(d, g, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = b; + return d; + }(), a = function(a, d, e) { + switch(arguments.length) { + case 2: + return a & ~d; + default: + var f = null; + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = b.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return a & ~b; + }; + a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; + return a; }(); -cljs.core.rand_int = function(a) { - return cljs.core.fix.call(null, cljs.core.rand.call(null, a)) -}; -cljs.core.bit_xor = function(a, b) { - return a ^ b -}; -cljs.core.bit_and = function(a, b) { - return a & b -}; -cljs.core.bit_or = function(a, b) { - return a | b -}; -cljs.core.bit_and_not = function(a, b) { - return a & ~b -}; cljs.core.bit_clear = function(a, b) { - return a & ~(1 << b) + return a & ~(1 << b); }; cljs.core.bit_flip = function(a, b) { - return a ^ 1 << b + return a ^ 1 << b; }; cljs.core.bit_not = function(a) { - return~a + return~a; }; cljs.core.bit_set = function(a, b) { - return a | 1 << b + return a | 1 << b; }; cljs.core.bit_test = function(a, b) { - return 0 != (a & 1 << b) + return 0 != (a & 1 << b); }; cljs.core.bit_shift_left = function(a, b) { - return a << b + return a << b; }; cljs.core.bit_shift_right = function(a, b) { - return a >> b + return a >> b; }; cljs.core.bit_shift_right_zero_fill = function(a, b) { - return a >>> b + return a >>> b; }; cljs.core.unsigned_bit_shift_right = function(a, b) { - return a >>> b + return a >>> b; }; cljs.core.bit_count = function(a) { a -= a >> 1 & 1431655765; a = (a & 858993459) + (a >> 2 & 858993459); - return 16843009 * (a + (a >> 4) & 252645135) >> 24 + return 16843009 * (a + (a >> 4) & 252645135) >> 24; }; cljs.core._EQ__EQ_ = function() { var a = null, b = function(a, b) { - return cljs.core._equiv.call(null, a, b) + return cljs.core._equiv(a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(a.call(null, b, c)) { - if(cljs.core.next.call(null, d)) { - b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return a.call(null, c, cljs.core.first.call(null, d)) + for (;;) { + if (a.cljs$core$IFn$_invoke$arity$2(b, c)) { + if (cljs.core.next(d)) { + b = c, c = cljs.core.first(d), d = cljs.core.next(d); + } else { + return a.cljs$core$IFn$_invoke$arity$2(c, cljs.core.first(d)); } - }else { - return!1 + } else { + return!1; } } }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4968,10 +6741,10 @@ cljs.core._EQ__EQ_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4979,81 +6752,100 @@ cljs.core._EQ__EQ_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.pos_QMARK_ = function(a) { - return 0 < a + return 0 < a; }; cljs.core.zero_QMARK_ = function(a) { - return 0 === a + return 0 === a; }; cljs.core.neg_QMARK_ = function(a) { - return 0 > a + return 0 > a; }; cljs.core.nthnext = function(a, b) { - for(var c = b, d = cljs.core.seq.call(null, a);;) { - if(d && 0 < c) { - c -= 1, d = cljs.core.next.call(null, d) - }else { - return d + for (var c = b, d = cljs.core.seq(a);;) { + if (d && 0 < c) { + c -= 1, d = cljs.core.next(d); + } else { + return d; } } }; cljs.core.str = function() { var a = null, b = function(a) { - return null == a ? "" : a.toString() + return null == a ? "" : goog.string.buildString(a); }, c = function() { var b = function(b, c) { - for(var d = new goog.string.StringBuffer(a.call(null, b)), e = c;;) { - if(cljs.core.truth_(e)) { - d = d.append(a.call(null, cljs.core.first.call(null, e))), e = cljs.core.next.call(null, e) - }else { - return d.toString() + for (var d = new goog.string.StringBuffer(a.cljs$core$IFn$_invoke$arity$1(b)), e = c;;) { + if (cljs.core.truth_(e)) { + d = d.append(a.cljs$core$IFn$_invoke$arity$1(cljs.core.first(e))), e = cljs.core.next(e); + } else { + return d.toString(); } } }, c = function(a, c) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return b.call(this, a, e) + if (1 < arguments.length) { + for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { + k[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, e); }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, a) + return b(c, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e) { switch(arguments.length) { case 0: - return""; + return ""; case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + var f = null; + if (1 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { + g[f] = arguments[f + 1], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 1; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return"" + return ""; }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.subs = function() { var a = null, a = function(a, c, d) { @@ -5061,89 +6853,111 @@ cljs.core.subs = function() { case 2: return a.substring(c); case 3: - return a.substring(c, d) + return a.substring(c, d); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return a.substring(c) + return a.substring(c); }; a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return a.substring(c, d) + return a.substring(c, d); }; - return a + return a; }(); cljs.core.equiv_sequential = function(a, b) { - return cljs.core.boolean$.call(null, cljs.core.sequential_QMARK_.call(null, b) ? function() { - for(var c = cljs.core.seq.call(null, a), d = cljs.core.seq.call(null, b);;) { - if(null == c) { - return null == d - } - if(null == d) { - return!1 + return cljs.core.boolean$(cljs.core.sequential_QMARK_(b) ? cljs.core.counted_QMARK_(a) && cljs.core.counted_QMARK_(b) && cljs.core.count(a) !== cljs.core.count(b) ? !1 : function() { + for (var c = cljs.core.seq(a), d = cljs.core.seq(b);;) { + if (null == c) { + return null == d; } - if(cljs.core._EQ_.call(null, cljs.core.first.call(null, c), cljs.core.first.call(null, d))) { - c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d) - }else { - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null + if (null != d && cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.first(c), cljs.core.first(d))) { + c = cljs.core.next(c), d = cljs.core.next(d); + } else { + return!1; } } - }() : null) -}; -cljs.core.hash_combine = function(a, b) { - return a ^ b + 2654435769 + (a << 6) + (a >> 2) + }() : null); }; cljs.core.hash_coll = function(a) { - if(cljs.core.seq.call(null, a)) { - var b = cljs.core.hash.call(null, cljs.core.first.call(null, a)); - for(a = cljs.core.next.call(null, a);;) { - if(null == a) { - return b + if (cljs.core.seq(a)) { + var b = cljs.core.hash(cljs.core.first(a)); + for (a = cljs.core.next(a);;) { + if (null == a) { + return b; } - b = cljs.core.hash_combine.call(null, b, cljs.core.hash.call(null, cljs.core.first.call(null, a))); - a = cljs.core.next.call(null, a) + b = cljs.core.hash_combine(b, cljs.core.hash(cljs.core.first(a))); + a = cljs.core.next(a); } - }else { - return 0 + } else { + return 0; } }; cljs.core.hash_imap = function(a) { var b = 0; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { - var c = cljs.core.first.call(null, a), b = (b + (cljs.core.hash.call(null, cljs.core.key.call(null, c)) ^ cljs.core.hash.call(null, cljs.core.val.call(null, c)))) % 4503599627370496; - a = cljs.core.next.call(null, a) - }else { - return b + for (a = cljs.core.seq(a);;) { + if (a) { + var c = cljs.core.first(a), b = (b + (cljs.core.hash(function() { + var a = c; + return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a); + }()) ^ cljs.core.hash(function() { + var a = c; + return cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a); + }()))) % 4503599627370496; + a = cljs.core.next(a); + } else { + return b; } } }; cljs.core.hash_iset = function(a) { var b = 0; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { - var c = cljs.core.first.call(null, a), b = (b + cljs.core.hash.call(null, c)) % 4503599627370496; - a = cljs.core.next.call(null, a) - }else { - return b + for (a = cljs.core.seq(a);;) { + if (a) { + var c = cljs.core.first(a), b = (b + cljs.core.hash(c)) % 4503599627370496; + a = cljs.core.next(a); + } else { + return b; } } }; cljs.core.extend_object_BANG_ = function(a, b) { - for(var c = cljs.core.seq.call(null, b), d = null, e = 0, f = 0;;) { - if(f < e) { - var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null), h = cljs.core.name.call(null, h); - a[h] = g; - f += 1 - }else { - if(c = cljs.core.seq.call(null, c)) { - cljs.core.chunked_seq_QMARK_.call(null, c) ? (e = cljs.core.chunk_first.call(null, c), c = cljs.core.chunk_rest.call(null, c), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, c), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), d = cljs.core.name.call(null, d), a[d] = e, c = cljs.core.next.call(null, c), d = null, e = 0), f = 0 - }else { - break + for (var c = cljs.core.seq(b), d = null, e = 0, f = 0;;) { + if (f < e) { + var g = d.cljs$core$IIndexed$_nth$arity$2(null, f), h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 0, null), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 1, null), k = function() { + var a = h; + return cljs.core.name.cljs$core$IFn$_invoke$arity$1 ? cljs.core.name.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.name.call(null, a); + }(); + a[k] = g; + f += 1; + } else { + if (c = cljs.core.seq(c)) { + var l = c; + if (cljs.core.chunked_seq_QMARK_(l)) { + e = function() { + var a = l; + return cljs.core.chunk_first.cljs$core$IFn$_invoke$arity$1 ? cljs.core.chunk_first.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.chunk_first.call(null, a); + }(), c = function() { + var a = l; + return cljs.core.chunk_rest.cljs$core$IFn$_invoke$arity$1 ? cljs.core.chunk_rest.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.chunk_rest.call(null, a); + }(), d = e, e = cljs.core.count(e); + } else { + var c = cljs.core.first(l), m = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), d = function() { + var a = m; + return cljs.core.name.cljs$core$IFn$_invoke$arity$1 ? cljs.core.name.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.name.call(null, a); + }(); + a[d] = c; + c = cljs.core.next(l); + d = null; + e = 0; + } + f = 0; + } else { + break; } } } - return a + return a; }; cljs.core.List = function(a, b, c, d, e) { this.meta = a; @@ -5151,239 +6965,293 @@ cljs.core.List = function(a, b, c, d, e) { this.rest = c; this.count = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 65937646 + this.cljs$lang$protocol_mask$partition0$ = 65937646; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.List.cljs$lang$type = !0; -cljs.core.List.cljs$lang$ctorStr = "cljs.core/List"; -cljs.core.List.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/List") +cljs.core.List.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.List.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.List.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.List.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.List.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.List(this.meta, this.first, this.rest, this.count, this.__hash); }; cljs.core.List.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 1 === this.count ? null : this.rest + return 1 === this.count ? null : this.rest; }; -cljs.core.List.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.List(this.meta, b, this, this.count + 1, null) +cljs.core.List.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.count; }; -cljs.core.List.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.List.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { + return this.first; }; -cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) +cljs.core.List.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { + return cljs.core._rest(this); }; -cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) +cljs.core.List.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.List.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this +cljs.core.List.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.List.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.count +cljs.core.List.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core._with_meta(cljs.core.List.EMPTY, this.meta); }; -cljs.core.List.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.first +cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; -cljs.core.List.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return cljs.core._rest.call(null, this) +cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.List.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.first + return this.first; }; cljs.core.List.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 1 === this.count ? cljs.core.List.EMPTY : this.rest + return 1 === this.count ? cljs.core.List.EMPTY : this.rest; }; -cljs.core.List.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.List.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.List.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.List(b, this.first, this.rest, this.count, this.__hash) + return new cljs.core.List(b, this.first, this.rest, this.count, this.__hash); }; -cljs.core.List.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.List.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.List(this.meta, b, this, this.count + 1, null); }; -cljs.core.List.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.List.EMPTY +cljs.core.List.cljs$lang$type = !0; +cljs.core.List.cljs$lang$ctorStr = "cljs.core/List"; +cljs.core.List.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/List"); }; cljs.core.__GT_List = function(a, b, c, d, e) { - return new cljs.core.List(a, b, c, d, e) + return new cljs.core.List(a, b, c, d, e); +}; +cljs.core.List.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.EmptyList = function(a) { this.meta = a; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 65937614 -}; -cljs.core.EmptyList.cljs$lang$type = !0; -cljs.core.EmptyList.cljs$lang$ctorStr = "cljs.core/EmptyList"; -cljs.core.EmptyList.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/EmptyList") -}; -cljs.core.EmptyList.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return 0 -}; -cljs.core.EmptyList.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return null -}; -cljs.core.EmptyList.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.List(this.meta, b, null, 1, null) + this.cljs$lang$protocol_mask$partition0$ = 65937614; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; cljs.core.EmptyList.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_(this); }; -cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) +cljs.core.EmptyList.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; -cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) +cljs.core.EmptyList.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.EmptyList.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return null +cljs.core.EmptyList.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.EmptyList(this.meta); +}; +cljs.core.EmptyList.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return null; }; cljs.core.EmptyList.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 0 + return 0; }; cljs.core.EmptyList.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return null + return null; }; cljs.core.EmptyList.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { throw Error("Can't pop empty list"); }; +cljs.core.EmptyList.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.empty_ordered_hash; +}; +cljs.core.EmptyList.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.EmptyList.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return this; +}; +cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); +}; +cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); +}; cljs.core.EmptyList.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null + return null; }; cljs.core.EmptyList.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.List.EMPTY + return cljs.core.List.EMPTY; }; -cljs.core.EmptyList.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.EmptyList.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return null; }; cljs.core.EmptyList.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.EmptyList(b) + return new cljs.core.EmptyList(b); }; -cljs.core.EmptyList.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.EmptyList.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.List(this.meta, b, null, 1, null); }; -cljs.core.EmptyList.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return this +cljs.core.EmptyList.cljs$lang$type = !0; +cljs.core.EmptyList.cljs$lang$ctorStr = "cljs.core/EmptyList"; +cljs.core.EmptyList.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/EmptyList"); }; cljs.core.__GT_EmptyList = function(a) { - return new cljs.core.EmptyList(a) + return new cljs.core.EmptyList(a); }; cljs.core.List.EMPTY = new cljs.core.EmptyList(null); +cljs.core.EmptyList.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; cljs.core.reversible_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 134217728 || a.cljs$core$IReversible$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 134217728 || a.cljs$core$IReversible$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IReversible, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IReversible, a); }; cljs.core.rseq = function(a) { - return cljs.core._rseq.call(null, a) + return cljs.core._rseq(a); }; cljs.core.reverse = function(a) { - return cljs.core.reversible_QMARK_.call(null, a) ? cljs.core.rseq.call(null, a) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a) + return cljs.core.reversible_QMARK_(a) ? cljs.core.rseq(a) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj, cljs.core.List.EMPTY, a); }; cljs.core.list = function() { var a = function(a) { var b; - if(a instanceof cljs.core.IndexedSeq) { - b = a.arr - }else { + if (a instanceof cljs.core.IndexedSeq && 0 === a.i) { + b = a.arr; + } else { a: { - for(b = [];;) { - if(null != a) { - b.push(cljs.core._first.call(null, a)), a = cljs.core._next.call(null, a) - }else { - break a + for (b = [];;) { + if (null != a) { + b.push(a.cljs$core$ISeq$_first$arity$1(null)), a = a.cljs$core$INext$_next$arity$1(null); + } else { + break a; } } - b = void 0 + b = void 0; } } a = b.length; - for(var e = cljs.core.List.EMPTY;;) { - if(0 < a) { - var f = a - 1, e = cljs.core._conj.call(null, e, b[a - 1]); - a = f - }else { - return e + for (var e = cljs.core.List.EMPTY;;) { + if (0 < a) { + var f = a - 1, e = e.cljs$core$ICollection$_conj$arity$2(null, b[a - 1]); + a = f; + } else { + return e; } } }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.Cons = function(a, b, c, d) { this.meta = a; this.first = b; this.rest = c; this.__hash = d; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 65929452 + this.cljs$lang$protocol_mask$partition0$ = 65929452; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.Cons.cljs$lang$type = !0; -cljs.core.Cons.cljs$lang$ctorStr = "cljs.core/Cons"; -cljs.core.Cons.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Cons") +cljs.core.Cons.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.Cons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.Cons.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.Cons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.Cons.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Cons(this.meta, this.first, this.rest, this.__hash); }; cljs.core.Cons.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return null == this.rest ? null : cljs.core.seq.call(null, this.rest) + return null == this.rest ? null : cljs.core.seq(this.rest); }; -cljs.core.Cons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.Cons(null, b, this, this.__hash) +cljs.core.Cons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.Cons.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.Cons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.Cons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.Cons.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.Cons.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.Cons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.Cons.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.first + return this.first; }; cljs.core.Cons.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null == this.rest ? cljs.core.List.EMPTY : this.rest + return null == this.rest ? cljs.core.List.EMPTY : this.rest; }; -cljs.core.Cons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.Cons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.Cons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Cons(b, this.first, this.rest, this.__hash) + return new cljs.core.Cons(b, this.first, this.rest, this.__hash); }; -cljs.core.Cons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.Cons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.Cons(null, b, this, this.__hash); }; -cljs.core.Cons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.Cons.cljs$lang$type = !0; +cljs.core.Cons.cljs$lang$ctorStr = "cljs.core/Cons"; +cljs.core.Cons.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Cons"); }; cljs.core.__GT_Cons = function(a, b, c, d) { - return new cljs.core.Cons(a, b, c, d) + return new cljs.core.Cons(a, b, c, d); +}; +cljs.core.Cons.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.cons = function(a, b) { var c; c = (c = null == b) ? c : b ? b.cljs$lang$protocol_mask$partition0$ & 64 || b.cljs$core$ISeq$ ? !0 : !1 : !1; - return c ? new cljs.core.Cons(null, a, b, null) : new cljs.core.Cons(null, a, cljs.core.seq.call(null, b), null) + return c ? new cljs.core.Cons(null, a, b, null) : new cljs.core.Cons(null, a, cljs.core.seq(b), null); }; cljs.core.list_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 33554432 || a.cljs$core$IList$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 33554432 || a.cljs$core$IList$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IList, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IList, a); +}; +cljs.core.hash_keyword = function(a) { + return cljs.core.hash_symbol(a) + 2654435769 | 0; +}; +cljs.core.compare_keywords = function(a, b) { + if (a.fqn === b.fqn) { + return 0; + } + if (cljs.core.truth_(function() { + var c = cljs.core.not(a.ns); + return c ? b.ns : c; + }())) { + return-1; + } + if (cljs.core.truth_(a.ns)) { + if (cljs.core.not(b.ns)) { + return 1; + } + var c = goog.array.defaultCompare(a.ns, b.ns); + return 0 === c ? goog.array.defaultCompare(a.name, b.name) : c; + } + return goog.array.defaultCompare(a.name, b.name); }; cljs.core.Keyword = function(a, b, c, d) { this.ns = a; @@ -5391,95 +7259,102 @@ cljs.core.Keyword = function(a, b, c, d) { this.fqn = c; this._hash = d; this.cljs$lang$protocol_mask$partition0$ = 2153775105; - this.cljs$lang$protocol_mask$partition1$ = 4096 -}; -cljs.core.Keyword.cljs$lang$type = !0; -cljs.core.Keyword.cljs$lang$ctorStr = "cljs.core/Keyword"; -cljs.core.Keyword.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Keyword") + this.cljs$lang$protocol_mask$partition1$ = 4096; }; cljs.core.Keyword.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, [cljs.core.str(":"), cljs.core.str(this.fqn)].join("")) + return cljs.core._write(b, [cljs.core.str(":"), cljs.core.str(this.fqn)].join("")); }; cljs.core.Keyword.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return this.name + return this.name; }; cljs.core.Keyword.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return this.ns + return this.ns; }; cljs.core.Keyword.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - null == this._hash && (this._hash = cljs.core.hash_combine.call(null, cljs.core.hash.call(null, this.ns), cljs.core.hash.call(null, this.name)) + 2654435769); - return this._hash + a = this._hash; + return null != a ? a : this._hash = a = cljs.core.hash_keyword(this); }; cljs.core.Keyword.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, b = function(a, b) { + return cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, this); + }, c = function(a, b, c) { + return cljs.core.get.cljs$core$IFn$_invoke$arity$3(b, this, c); + }, a = function(a, e, f) { switch(arguments.length) { case 2: - return cljs.core.get.call(null, c, this); + return b.call(this, a, e); case 3: - return cljs.core.get.call(null, c, this, d) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + return a; }(); cljs.core.Keyword.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.Keyword.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core.get.call(null, a, this) + return cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, this); }; cljs.core.Keyword.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core.get.call(null, a, this, b) + return cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, this, b); }; cljs.core.Keyword.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.Keyword ? this.fqn === b.fqn : !1 + return b instanceof cljs.core.Keyword ? this.fqn === b.fqn : !1; }; cljs.core.Keyword.prototype.toString = function() { - return[cljs.core.str(":"), cljs.core.str(this.fqn)].join("") + return[cljs.core.str(":"), cljs.core.str(this.fqn)].join(""); +}; +cljs.core.Keyword.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.Keyword.cljs$lang$type = !0; +cljs.core.Keyword.cljs$lang$ctorStr = "cljs.core/Keyword"; +cljs.core.Keyword.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Keyword"); }; cljs.core.__GT_Keyword = function(a, b, c, d) { - return new cljs.core.Keyword(a, b, c, d) + return new cljs.core.Keyword(a, b, c, d); }; cljs.core.keyword_QMARK_ = function(a) { - return a instanceof cljs.core.Keyword + return a instanceof cljs.core.Keyword; }; cljs.core.keyword_identical_QMARK_ = function(a, b) { - return a === b ? !0 : a instanceof cljs.core.Keyword && b instanceof cljs.core.Keyword ? a.fqn === b.fqn : !1 + return a === b ? !0 : a instanceof cljs.core.Keyword && b instanceof cljs.core.Keyword ? a.fqn === b.fqn : !1; }; cljs.core.namespace = function(a) { - if(a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { - return cljs.core._namespace.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { + return a.cljs$core$INamed$_namespace$arity$1(null); } throw Error([cljs.core.str("Doesn't support namespace: "), cljs.core.str(a)].join("")); }; cljs.core.keyword = function() { var a = null, b = function(a) { - if(a instanceof cljs.core.Keyword) { - return a - } - if(a instanceof cljs.core.Symbol) { - return new cljs.core.Keyword(cljs.core.namespace.call(null, a), cljs.core.name.call(null, a), a.str, null) + if (a instanceof cljs.core.Keyword) { + return a; } - if("string" === typeof a) { - var b = a.split("/"); - return 2 === b.length ? new cljs.core.Keyword(b[0], b[1], a, null) : new cljs.core.Keyword(null, b[0], a, null) + if (a instanceof cljs.core.Symbol) { + var b = cljs.core.Keyword, c = cljs.core.namespace(a), g; + g = cljs.core.name.cljs$core$IFn$_invoke$arity$1 ? cljs.core.name.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.name.call(null, a); + return new b(c, g, a.str, null); } - return null + return "string" === typeof a ? (b = a.split("/"), 2 === b.length ? new cljs.core.Keyword(b[0], b[1], a, null) : new cljs.core.Keyword(null, b[0], a, null)) : null; }, c = function(a, b) { - return new cljs.core.Keyword(a, b, [cljs.core.str(cljs.core.truth_(a) ? [cljs.core.str(a), cljs.core.str("/")].join("") : null), cljs.core.str(b)].join(""), null) + return new cljs.core.Keyword(a, b, [cljs.core.str(cljs.core.truth_(a) ? [cljs.core.str(a), cljs.core.str("/")].join("") : null), cljs.core.str(b)].join(""), null); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.LazySeq = function(a, b, c, d) { this.meta = a; @@ -5487,146 +7362,152 @@ cljs.core.LazySeq = function(a, b, c, d) { this.s = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988 + this.cljs$lang$protocol_mask$partition0$ = 32374988; }; -cljs.core.LazySeq.cljs$lang$type = !0; -cljs.core.LazySeq.cljs$lang$ctorStr = "cljs.core/LazySeq"; -cljs.core.LazySeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/LazySeq") +cljs.core.LazySeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.LazySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.LazySeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.LazySeq.prototype.sval = function() { + null != this.fn && (this.s = this.fn.cljs$core$IFn$_invoke$arity$0 ? this.fn.cljs$core$IFn$_invoke$arity$0() : this.fn.call(null), this.fn = null); + return this.s; +}; +cljs.core.LazySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; cljs.core.LazySeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - cljs.core._seq.call(null, this); - return null == this.s ? null : cljs.core.next.call(null, this.s) + cljs.core._seq(this); + return null == this.s ? null : cljs.core.next(this.s); }; -cljs.core.LazySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.LazySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.LazySeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.LazySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.LazySeq.prototype.sval = function() { - null != this.fn && (this.s = this.fn.call(null), this.fn = null); - return this.s +cljs.core.LazySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.LazySeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.LazySeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); +}; +cljs.core.LazySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + cljs.core._seq(this); + return null == this.s ? null : cljs.core.first(this.s); +}; +cljs.core.LazySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + cljs.core._seq(this); + return null != this.s ? cljs.core.rest(this.s) : cljs.core.List.EMPTY; }; cljs.core.LazySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { this.sval(); - if(null == this.s) { - return null + if (null == this.s) { + return null; } - for(a = this.s;;) { - if(a instanceof cljs.core.LazySeq) { - a = a.sval() - }else { - return this.s = a, cljs.core.seq.call(null, this.s) + for (a = this.s;;) { + if (a instanceof cljs.core.LazySeq) { + a = a.sval(); + } else { + return this.s = a, cljs.core.seq(this.s); } } }; -cljs.core.LazySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - cljs.core._seq.call(null, this); - return null == this.s ? null : cljs.core.first.call(null, this.s) -}; -cljs.core.LazySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - cljs.core._seq.call(null, this); - return null != this.s ? cljs.core.rest.call(null, this.s) : cljs.core.List.EMPTY -}; -cljs.core.LazySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) -}; cljs.core.LazySeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.LazySeq(b, this.fn, this.s, this.__hash) + return new cljs.core.LazySeq(b, this.fn, this.s, this.__hash); }; -cljs.core.LazySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.LazySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.LazySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.LazySeq.cljs$lang$type = !0; +cljs.core.LazySeq.cljs$lang$ctorStr = "cljs.core/LazySeq"; +cljs.core.LazySeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/LazySeq"); }; cljs.core.__GT_LazySeq = function(a, b, c, d) { - return new cljs.core.LazySeq(a, b, c, d) + return new cljs.core.LazySeq(a, b, c, d); +}; +cljs.core.LazySeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.ChunkBuffer = function(a, b) { this.buf = a; this.end = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2 -}; -cljs.core.ChunkBuffer.cljs$lang$type = !0; -cljs.core.ChunkBuffer.cljs$lang$ctorStr = "cljs.core/ChunkBuffer"; -cljs.core.ChunkBuffer.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ChunkBuffer") + this.cljs$lang$protocol_mask$partition0$ = 2; }; cljs.core.ChunkBuffer.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end + return this.end; }; cljs.core.ChunkBuffer.prototype.add = function(a) { this.buf[this.end] = a; - return this.end += 1 + return this.end += 1; }; cljs.core.ChunkBuffer.prototype.chunk = function(a) { a = new cljs.core.ArrayChunk(this.buf, 0, this.end); this.buf = null; - return a + return a; +}; +cljs.core.ChunkBuffer.cljs$lang$type = !0; +cljs.core.ChunkBuffer.cljs$lang$ctorStr = "cljs.core/ChunkBuffer"; +cljs.core.ChunkBuffer.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ChunkBuffer"); }; cljs.core.__GT_ChunkBuffer = function(a, b) { - return new cljs.core.ChunkBuffer(a, b) + return new cljs.core.ChunkBuffer(a, b); }; cljs.core.chunk_buffer = function(a) { - return new cljs.core.ChunkBuffer(Array(a), 0) + return new cljs.core.ChunkBuffer(Array(a), 0); }; cljs.core.ArrayChunk = function(a, b, c) { this.arr = a; this.off = b; this.end = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 524306 -}; -cljs.core.ArrayChunk.cljs$lang$type = !0; -cljs.core.ArrayChunk.cljs$lang$ctorStr = "cljs.core/ArrayChunk"; -cljs.core.ArrayChunk.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ArrayChunk") + this.cljs$lang$protocol_mask$partition0$ = 524306; }; cljs.core.ArrayChunk.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.off], this.off + 1) + return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, this.arr[this.off], this.off + 1); }; cljs.core.ArrayChunk.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.array_reduce.call(null, this.arr, b, c, this.off) + return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, c, this.off); }; cljs.core.ArrayChunk.prototype.cljs$core$IChunk$ = !0; cljs.core.ArrayChunk.prototype.cljs$core$IChunk$_drop_first$arity$1 = function(a) { - if(this.off === this.end) { + if (this.off === this.end) { throw Error("-drop-first of empty chunk"); } - return new cljs.core.ArrayChunk(this.arr, this.off + 1, this.end) + return new cljs.core.ArrayChunk(this.arr, this.off + 1, this.end); }; cljs.core.ArrayChunk.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return this.arr[this.off + b] + return this.arr[this.off + b]; }; cljs.core.ArrayChunk.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.end - this.off ? this.arr[this.off + b] : c + return 0 <= b && b < this.end - this.off ? this.arr[this.off + b] : c; }; cljs.core.ArrayChunk.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end - this.off + return this.end - this.off; +}; +cljs.core.ArrayChunk.cljs$lang$type = !0; +cljs.core.ArrayChunk.cljs$lang$ctorStr = "cljs.core/ArrayChunk"; +cljs.core.ArrayChunk.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ArrayChunk"); }; cljs.core.__GT_ArrayChunk = function(a, b, c) { - return new cljs.core.ArrayChunk(a, b, c) + return new cljs.core.ArrayChunk(a, b, c); }; cljs.core.array_chunk = function() { var a = null, b = function(a) { - return new cljs.core.ArrayChunk(a, 0, a.length) + return new cljs.core.ArrayChunk(a, 0, a.length); }, c = function(a, b) { - return new cljs.core.ArrayChunk(a, b, a.length) + return new cljs.core.ArrayChunk(a, b, a.length); }, d = function(a, b, c) { - return new cljs.core.ArrayChunk(a, b, c) + return new cljs.core.ArrayChunk(a, b, c); }, a = function(a, f, g) { switch(arguments.length) { case 1: @@ -5634,14 +7515,14 @@ cljs.core.array_chunk = function() { case 2: return c.call(this, a, f); case 3: - return d.call(this, a, f, g) + return d.call(this, a, f, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; - return a + return a; }(); cljs.core.ChunkedCons = function(a, b, c, d) { this.chunk = a; @@ -5649,286 +7530,297 @@ cljs.core.ChunkedCons = function(a, b, c, d) { this.meta = c; this.__hash = d; this.cljs$lang$protocol_mask$partition0$ = 31850732; - this.cljs$lang$protocol_mask$partition1$ = 1536 + this.cljs$lang$protocol_mask$partition1$ = 1536; }; -cljs.core.ChunkedCons.cljs$lang$type = !0; -cljs.core.ChunkedCons.cljs$lang$ctorStr = "cljs.core/ChunkedCons"; -cljs.core.ChunkedCons.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ChunkedCons") +cljs.core.ChunkedCons.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.ChunkedCons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.ChunkedCons.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.ChunkedCons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; cljs.core.ChunkedCons.prototype.cljs$core$INext$_next$arity$1 = function(a) { - if(1 < cljs.core._count.call(null, this.chunk)) { - return new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) + if (1 < cljs.core._count(this.chunk)) { + return new cljs.core.ChunkedCons(cljs.core._drop_first(this.chunk), this.more, this.meta, null); } - a = cljs.core._seq.call(null, this.more); - return null == a ? null : a + a = cljs.core._seq(this.more); + return null == a ? null : a; }; -cljs.core.ChunkedCons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.ChunkedCons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.ChunkedCons.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.ChunkedCons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.ChunkedCons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this +cljs.core.ChunkedCons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.ChunkedCons.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core._nth.call(null, this.chunk, 0) + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.chunk, 0); }; cljs.core.ChunkedCons.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 1 < cljs.core._count.call(null, this.chunk) ? new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) : null == this.more ? cljs.core.List.EMPTY : this.more + return 1 < cljs.core._count(this.chunk) ? new cljs.core.ChunkedCons(cljs.core._drop_first(this.chunk), this.more, this.meta, null) : null == this.more ? cljs.core.List.EMPTY : this.more; }; -cljs.core.ChunkedCons.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { - return null == this.more ? null : this.more +cljs.core.ChunkedCons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; -cljs.core.ChunkedCons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { + return this.chunk; }; -cljs.core.ChunkedCons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ChunkedCons(this.chunk, this.more, b, this.__hash) +cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { + return null == this.more ? cljs.core.List.EMPTY : this.more; }; -cljs.core.ChunkedCons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.ChunkedCons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.ChunkedCons(this.chunk, this.more, b, this.__hash); }; -cljs.core.ChunkedCons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.ChunkedCons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { - return this.chunk +cljs.core.ChunkedCons.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { + return null == this.more ? null : this.more; }; -cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { - return null == this.more ? cljs.core.List.EMPTY : this.more +cljs.core.ChunkedCons.cljs$lang$type = !0; +cljs.core.ChunkedCons.cljs$lang$ctorStr = "cljs.core/ChunkedCons"; +cljs.core.ChunkedCons.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ChunkedCons"); }; cljs.core.__GT_ChunkedCons = function(a, b, c, d) { - return new cljs.core.ChunkedCons(a, b, c, d) + return new cljs.core.ChunkedCons(a, b, c, d); +}; +cljs.core.ChunkedCons.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.chunk_cons = function(a, b) { - return 0 === cljs.core._count.call(null, a) ? b : new cljs.core.ChunkedCons(a, b, null, null) + return 0 === cljs.core._count(a) ? b : new cljs.core.ChunkedCons(a, b, null, null); }; cljs.core.chunk_append = function(a, b) { - return a.add(b) + return a.add(b); }; cljs.core.chunk = function(a) { - return a.chunk() + return a.chunk(); }; cljs.core.chunk_first = function(a) { - return cljs.core._chunked_first.call(null, a) + return cljs.core._chunked_first(a); }; cljs.core.chunk_rest = function(a) { - return cljs.core._chunked_rest.call(null, a) + return cljs.core._chunked_rest(a); }; cljs.core.chunk_next = function(a) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 1024 || a.cljs$core$IChunkedNext$) ? cljs.core._chunked_next.call(null, a) : cljs.core.seq.call(null, cljs.core._chunked_rest.call(null, a)) + return a && (a.cljs$lang$protocol_mask$partition1$ & 1024 || a.cljs$core$IChunkedNext$) ? cljs.core._chunked_next(a) : cljs.core.seq(cljs.core._chunked_rest(a)); }; cljs.core.to_array = function(a) { - for(var b = [];;) { - if(cljs.core.seq.call(null, a)) { - b.push(cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a) - }else { - return b + for (var b = [];;) { + if (cljs.core.seq(a)) { + b.push(cljs.core.first(a)), a = cljs.core.next(a); + } else { + return b; } } }; cljs.core.to_array_2d = function(a) { - var b = Array(cljs.core.count.call(null, a)), c = 0; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { - b[c] = cljs.core.to_array.call(null, cljs.core.first.call(null, a)), c += 1, a = cljs.core.next.call(null, a) - }else { - break + var b = Array(cljs.core.count(a)), c = 0; + for (a = cljs.core.seq(a);;) { + if (a) { + b[c] = cljs.core.to_array(cljs.core.first(a)), c += 1, a = cljs.core.next(a); + } else { + break; } } - return b + return b; }; cljs.core.int_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_(b)) { + for (var g = 0, h = cljs.core.seq(b);;) { + if (h && g < a) { + c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.long_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_(b)) { + for (var g = 0, h = cljs.core.seq(b);;) { + if (h && g < a) { + c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.double_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_(b)) { + for (var g = 0, h = cljs.core.seq(b);;) { + if (h && g < a) { + c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.object_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_(b)) { + for (var g = 0, h = cljs.core.seq(b);;) { + if (h && g < a) { + c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.bounded_count = function(a, b) { - if(cljs.core.counted_QMARK_.call(null, a)) { - return cljs.core.count.call(null, a) + if (cljs.core.counted_QMARK_(a)) { + return cljs.core.count(a); } - for(var c = a, d = b, e = 0;;) { - if(0 < d && cljs.core.seq.call(null, c)) { - c = cljs.core.next.call(null, c), d -= 1, e += 1 - }else { - return e + for (var c = a, d = b, e = 0;;) { + if (0 < d && cljs.core.seq(c)) { + c = cljs.core.next(c), d -= 1, e += 1; + } else { + return e; } } }; cljs.core.spread = function spread(b) { - return null == b ? null : null == cljs.core.next.call(null, b) ? cljs.core.seq.call(null, cljs.core.first.call(null, b)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.cons.call(null, cljs.core.first.call(null, b), spread.call(null, cljs.core.next.call(null, b))) : null + return null == b ? null : null == cljs.core.next(b) ? cljs.core.seq(cljs.core.first(b)) : cljs.core.cons(cljs.core.first(b), spread(cljs.core.next(b))); }; cljs.core.concat = function() { var a = null, b = function() { return new cljs.core.LazySeq(null, function() { - return null - }, null, null) + return null; + }, null, null); }, c = function(a) { return new cljs.core.LazySeq(null, function() { - return a - }, null, null) + return a; + }, null, null); }, d = function(b, c) { return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, b); - return d ? cljs.core.chunked_seq_QMARK_.call(null, d) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, d), a.call(null, cljs.core.chunk_rest.call(null, d), c)) : cljs.core.cons.call(null, cljs.core.first.call(null, d), a.call(null, cljs.core.rest.call(null, d), c)) : c - }, null, null) + var d = cljs.core.seq(b); + return d ? cljs.core.chunked_seq_QMARK_(d) ? cljs.core.chunk_cons(cljs.core.chunk_first(d), a.cljs$core$IFn$_invoke$arity$2(cljs.core.chunk_rest(d), c)) : cljs.core.cons(cljs.core.first(d), a.cljs$core$IFn$_invoke$arity$2(cljs.core.rest(d), c)) : c; + }, null, null); }, e = function() { var b = function(b, c, d) { return function n(a, b) { return new cljs.core.LazySeq(null, function() { - var c = cljs.core.seq.call(null, a); - return c ? cljs.core.chunked_seq_QMARK_.call(null, c) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, c), n.call(null, cljs.core.chunk_rest.call(null, c), b)) : cljs.core.cons.call(null, cljs.core.first.call(null, c), n.call(null, cljs.core.rest.call(null, c), b)) : cljs.core.truth_(b) ? n.call(null, cljs.core.first.call(null, b), cljs.core.next.call(null, b)) : null - }, null, null) - }.call(null, a.call(null, b, c), d) + var c = cljs.core.seq(a); + return c ? cljs.core.chunked_seq_QMARK_(c) ? cljs.core.chunk_cons(cljs.core.chunk_first(c), n(cljs.core.chunk_rest(c), b)) : cljs.core.cons(cljs.core.first(c), n(cljs.core.rest(c), b)) : cljs.core.truth_(b) ? n(cljs.core.first(b), cljs.core.next(b)) : null; + }, null, null); + }(a.cljs$core$IFn$_invoke$arity$2(b, c), d); }, c = function(a, c, d) { var e = null; - 2 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, e) + if (2 < arguments.length) { + for (var e = 0, g = Array(arguments.length - 2);e < g.length;) { + g[e] = arguments[e + 2], ++e; + } + e = new cljs.core.IndexedSeq(g, 0); + } + return b.call(this, a, c, e); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -5936,10 +7828,10 @@ cljs.core.concat = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, a) + return b(c, d, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, g, h) { switch(arguments.length) { case 0: @@ -5949,7 +7841,14 @@ cljs.core.concat = function() { case 2: return d.call(this, a, g); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, cljs.core.array_seq(arguments, 2)) + var k = null; + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, k); } throw Error("Invalid arity: " + arguments.length); }; @@ -5959,24 +7858,29 @@ cljs.core.concat = function() { a.cljs$core$IFn$_invoke$arity$1 = c; a.cljs$core$IFn$_invoke$arity$2 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.list_STAR_ = function() { var a = null, b = function(a) { - return cljs.core.seq.call(null, a) + return cljs.core.seq(a); }, c = function(a, b) { - return cljs.core.cons.call(null, a, b) + return cljs.core.cons(a, b); }, d = function(a, b, c) { - return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, c)) + return cljs.core.cons(a, cljs.core.cons(b, c)); }, e = function(a, b, c, d) { - return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, d))) + return cljs.core.cons(a, cljs.core.cons(b, cljs.core.cons(c, d))); }, f = function() { var a = function(a, b, c, d, e) { - return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.spread.call(null, e))))) + return cljs.core.cons(a, cljs.core.cons(b, cljs.core.cons(c, cljs.core.cons(d, cljs.core.spread(e))))); }, b = function(b, c, d, e, f) { var h = null; - 4 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return a.call(this, b, c, d, e, h) + if (4 < arguments.length) { + for (var h = 0, r = Array(arguments.length - 4);h < r.length;) { + r[h] = arguments[h + 4], ++h; + } + h = new cljs.core.IndexedSeq(r, 0); + } + return a.call(this, b, c, d, e, h); }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -5988,10 +7892,10 @@ cljs.core.list_STAR_ = function() { b = cljs.core.next(b); var f = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, f, b) + return a(c, d, e, f, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, h, k, l, m) { switch(arguments.length) { case 1: @@ -6003,7 +7907,14 @@ cljs.core.list_STAR_ = function() { case 4: return e.call(this, a, h, k, l); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, cljs.core.array_seq(arguments, 4)) + var n = null; + if (4 < arguments.length) { + for (var n = 0, p = Array(arguments.length - 4);n < p.length;) { + p[n] = arguments[n + 4], ++n; + } + n = new cljs.core.IndexedSeq(p, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, n); } throw Error("Invalid arity: " + arguments.length); }; @@ -6014,156 +7925,375 @@ cljs.core.list_STAR_ = function() { a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$4 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.transient$ = function(a) { - return cljs.core._as_transient.call(null, a) + return cljs.core._as_transient(a); }; cljs.core.persistent_BANG_ = function(a) { - return cljs.core._persistent_BANG_.call(null, a) -}; -cljs.core.conj_BANG_ = function(a, b) { - return cljs.core._conj_BANG_.call(null, a, b) -}; -cljs.core.assoc_BANG_ = function(a, b, c) { - return cljs.core._assoc_BANG_.call(null, a, b, c) -}; -cljs.core.dissoc_BANG_ = function(a, b) { - return cljs.core._dissoc_BANG_.call(null, a, b) + return cljs.core._persistent_BANG_(a); }; -cljs.core.pop_BANG_ = function(a) { - return cljs.core._pop_BANG_.call(null, a) -}; -cljs.core.disj_BANG_ = function(a, b) { - return cljs.core._disjoin_BANG_.call(null, a, b) -}; -cljs.core.apply_to = function(a, b, c) { - var d = cljs.core.seq.call(null, c); - if(0 === b) { - return a.call(null) - } - c = cljs.core._first.call(null, d); - var e = cljs.core._rest.call(null, d); - if(1 === b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) - } - var d = cljs.core._first.call(null, e), f = cljs.core._rest.call(null, e); - if(2 === b) { - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d) - } - var e = cljs.core._first.call(null, f), g = cljs.core._rest.call(null, f); - if(3 === b) { - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e) - } - var f = cljs.core._first.call(null, g), h = cljs.core._rest.call(null, g); - if(4 === b) { - return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.call(null, c, d, e, f) - } - g = cljs.core._first.call(null, h); - h = cljs.core._rest.call(null, h); - if(5 === b) { - return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.call(null, c, d, e, f, g) - } - a = cljs.core._first.call(null, h); - var k = cljs.core._rest.call(null, h); - if(6 === b) { - return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, a) : a.call(null, c, d, e, f, g, a) - } - var h = cljs.core._first.call(null, k), l = cljs.core._rest.call(null, k); - if(7 === b) { - return a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, a, h) : a.call(null, c, d, e, f, g, a, h) - } - var k = cljs.core._first.call(null, l), m = cljs.core._rest.call(null, l); - if(8 === b) { - return a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, a, h, k) : a.call(null, c, d, e, f, g, a, h, k) - } - var l = cljs.core._first.call(null, m), n = cljs.core._rest.call(null, m); - if(9 === b) { - return a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, a, h, k, l) : a.call(null, c, d, e, f, g, a, h, k, l) - } - var m = cljs.core._first.call(null, n), p = cljs.core._rest.call(null, n); - if(10 === b) { - return a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, a, h, k, l, m) : a.call(null, c, d, e, f, g, a, h, k, l, m) - } - var n = cljs.core._first.call(null, p), q = cljs.core._rest.call(null, p); - if(11 === b) { - return a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, a, h, k, l, m, n) : a.call(null, c, d, e, f, g, a, h, k, l, m, n) - } - var p = cljs.core._first.call(null, q), r = cljs.core._rest.call(null, q); - if(12 === b) { - return a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, a, h, k, l, m, n, p) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p) - } - var q = cljs.core._first.call(null, r), s = cljs.core._rest.call(null, r); - if(13 === b) { - return a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, a, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q) - } - var r = cljs.core._first.call(null, s), t = cljs.core._rest.call(null, s); - if(14 === b) { - return a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, a, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r) - } - var s = cljs.core._first.call(null, t), v = cljs.core._rest.call(null, t); - if(15 === b) { - return a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) - } - var t = cljs.core._first.call(null, v), u = cljs.core._rest.call(null, v); - if(16 === b) { - return a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) - } - var v = cljs.core._first.call(null, u), w = cljs.core._rest.call(null, u); - if(17 === b) { - return a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) - } - var u = cljs.core._first.call(null, w), B = cljs.core._rest.call(null, w); - if(18 === b) { - return a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) - } - w = cljs.core._first.call(null, B); - B = cljs.core._rest.call(null, B); - if(19 === b) { - return a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) - } - var I = cljs.core._first.call(null, B); - cljs.core._rest.call(null, B); - if(20 === b) { - return a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) - } - throw Error("Only up to 20 arguments supported on functions"); -}; -cljs.core.apply = function() { - var a = null, b = function(a, b) { - var c = a.cljs$lang$maxFixedArity; - if(a.cljs$lang$applyTo) { - var d = cljs.core.bounded_count.call(null, b, c + 1); - return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b) - } - return a.apply(a, cljs.core.to_array.call(null, b)) - }, c = function(a, b, c) { - b = cljs.core.list_STAR_.call(null, b, c); - c = a.cljs$lang$maxFixedArity; - if(a.cljs$lang$applyTo) { - var d = cljs.core.bounded_count.call(null, b, c + 1); - return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b) - } - return a.apply(a, cljs.core.to_array.call(null, b)) - }, d = function(a, b, c, d) { - b = cljs.core.list_STAR_.call(null, b, c, d); - c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) - }, e = function(a, b, c, d, e) { - b = cljs.core.list_STAR_.call(null, b, c, d, e); - c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) - }, f = function() { - var a = function(a, b, c, d, e, f) { - b = cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.cons.call(null, e, cljs.core.spread.call(null, f))))); - c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) - }, b = function(b, c, d, e, f, h) { - var r = null; - 5 < arguments.length && (r = cljs.core.array_seq(Array.prototype.slice.call(arguments, 5), 0)); - return a.call(this, b, c, d, e, f, r) +cljs.core.conj_BANG_ = function() { + var a = null, b = function() { + return cljs.core.transient$(cljs.core.PersistentVector.EMPTY); + }, c = function(a, b) { + return cljs.core._conj_BANG_(a, b); + }, d = function() { + var a = function(a, b, c) { + for (;;) { + if (a = cljs.core._conj_BANG_(a, b), cljs.core.truth_(c)) { + b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return a; + } + } + }, b = function(b, c, d) { + var f = null; + if (2 < arguments.length) { + for (var f = 0, m = Array(arguments.length - 2);f < m.length;) { + m[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(m, 0); + } + return a.call(this, b, c, f); }; - b.cljs$lang$maxFixedArity = 5; + b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, f, g) { + switch(arguments.length) { + case 0: + return b.call(this); + case 1: + return a; + case 2: + return c.call(this, a, f); + default: + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return d.cljs$core$IFn$_invoke$arity$variadic(a, f, h); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = d.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$0 = b; + a.cljs$core$IFn$_invoke$arity$1 = function(a) { + return a; + }; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$variadic = d.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.assoc_BANG_ = function() { + var a = null, b = function(a, b, c) { + return cljs.core._assoc_BANG_(a, b, c); + }, c = function() { + var a = function(a, b, c, d) { + for (;;) { + if (a = cljs.core._assoc_BANG_(a, b, c), cljs.core.truth_(d)) { + b = cljs.core.first(d), c = cljs.core.second(d), d = cljs.core.nnext(d); + } else { + return a; + } + } + }, b = function(b, c, e, k) { + var l = null; + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return a.call(this, b, c, e, l); + }; + b.cljs$lang$maxFixedArity = 3; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var k = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, e, k, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, e, f, g) { + switch(arguments.length) { + case 3: + return b.call(this, a, e, f); + default: + var h = null; + if (3 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { + k[h] = arguments[h + 3], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 3; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$3 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.dissoc_BANG_ = function() { + var a = null, b = function(a, b) { + return cljs.core._dissoc_BANG_(a, b); + }, c = function() { + var a = function(a, b, c) { + for (;;) { + if (a = cljs.core._dissoc_BANG_(a, b), cljs.core.truth_(c)) { + b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return a; + } + } + }, b = function(b, c, e) { + var k = null; + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return a.call(this, b, c, k); + }; + b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, e, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, e, f) { + switch(arguments.length) { + case 2: + return b.call(this, a, e); + default: + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.pop_BANG_ = function(a) { + return cljs.core._pop_BANG_(a); +}; +cljs.core.disj_BANG_ = function() { + var a = null, b = function(a, b) { + return cljs.core._disjoin_BANG_(a, b); + }, c = function() { + var a = function(a, b, c) { + for (;;) { + if (a = cljs.core._disjoin_BANG_(a, b), cljs.core.truth_(c)) { + b = cljs.core.first(c), c = cljs.core.next(c); + } else { + return a; + } + } + }, b = function(b, c, e) { + var k = null; + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return a.call(this, b, c, k); + }; + b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, e, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, e, f) { + switch(arguments.length) { + case 2: + return b.call(this, a, e); + default: + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.apply_to = function(a, b, c) { + var d = cljs.core.seq(c); + if (0 === b) { + return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); + } + c = cljs.core._first(d); + var e = cljs.core._rest(d); + if (1 === b) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + } + var d = cljs.core._first(e), f = cljs.core._rest(e); + if (2 === b) { + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d); + } + var e = cljs.core._first(f), g = cljs.core._rest(f); + if (3 === b) { + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e); + } + var f = cljs.core._first(g), h = cljs.core._rest(g); + if (4 === b) { + return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.call(null, c, d, e, f); + } + var g = cljs.core._first(h), k = cljs.core._rest(h); + if (5 === b) { + return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.call(null, c, d, e, f, g); + } + var h = cljs.core._first(k), l = cljs.core._rest(k); + if (6 === b) { + return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, h) : a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, h) : a.call(null, c, d, e, f, g, h); + } + var k = cljs.core._first(l), m = cljs.core._rest(l); + if (7 === b) { + return a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, h, k) : a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, h, k) : a.call(null, c, d, e, f, g, h, k); + } + var l = cljs.core._first(m), n = cljs.core._rest(m); + if (8 === b) { + return a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, h, k, l) : a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, h, k, l) : a.call(null, c, d, e, f, g, h, k, l); + } + var m = cljs.core._first(n), p = cljs.core._rest(n); + if (9 === b) { + return a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, h, k, l, m) : a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, h, k, l, m) : a.call(null, c, d, e, f, g, h, k, l, m); + } + var n = cljs.core._first(p), q = cljs.core._rest(p); + if (10 === b) { + return a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, h, k, l, m, n) : a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, h, k, l, m, n) : a.call(null, c, d, e, f, g, h, k, l, m, n); + } + var p = cljs.core._first(q), r = cljs.core._rest(q); + if (11 === b) { + return a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, h, k, l, m, n, p) : a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, h, k, l, m, n, p) : a.call(null, c, d, e, f, g, h, k, l, m, n, p); + } + var q = cljs.core._first(r), s = cljs.core._rest(r); + if (12 === b) { + return a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, h, k, l, m, n, p, q) : a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q); + } + var r = cljs.core._first(s), t = cljs.core._rest(s); + if (13 === b) { + return a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, h, k, l, m, n, p, q, r) : a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r); + } + var s = cljs.core._first(t), u = cljs.core._rest(t); + if (14 === b) { + return a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, h, k, l, m, n, p, q, r, s) : a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s); + } + var t = cljs.core._first(u), v = cljs.core._rest(u); + if (15 === b) { + return a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); + } + var u = cljs.core._first(v), w = cljs.core._rest(v); + if (16 === b) { + return a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); + } + var v = cljs.core._first(w), y = cljs.core._rest(w); + if (17 === b) { + return a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); + } + var w = cljs.core._first(y), F = cljs.core._rest(y); + if (18 === b) { + return a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); + } + y = cljs.core._first(F); + F = cljs.core._rest(F); + if (19 === b) { + return a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); + } + var L = cljs.core._first(F); + cljs.core._rest(F); + if (20 === b) { + return a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, L) : a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, L) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, L); + } + throw Error("Only up to 20 arguments supported on functions"); +}; +cljs.core.apply = function() { + var a = null, b = function(a, b) { + var c = a.cljs$lang$maxFixedArity; + if (a.cljs$lang$applyTo) { + var d = cljs.core.bounded_count(b, c + 1); + return d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b); + } + return a.apply(a, cljs.core.to_array(b)); + }, c = function(a, b, c) { + b = cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$2(b, c); + c = a.cljs$lang$maxFixedArity; + if (a.cljs$lang$applyTo) { + var d = cljs.core.bounded_count(b, c + 1); + return d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b); + } + return a.apply(a, cljs.core.to_array(b)); + }, d = function(a, b, c, d) { + b = cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$3(b, c, d); + c = a.cljs$lang$maxFixedArity; + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count(b, c + 1), d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array(b)); + }, e = function(a, b, c, d, e) { + b = cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(b, c, d, e); + c = a.cljs$lang$maxFixedArity; + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count(b, c + 1), d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array(b)); + }, f = function() { + var a = function(a, b, c, d, e, f) { + b = cljs.core.cons(b, cljs.core.cons(c, cljs.core.cons(d, cljs.core.cons(e, cljs.core.spread(f))))); + c = a.cljs$lang$maxFixedArity; + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count(b, c + 1), d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array(b)); + }, b = function(b, c, d, e, f, h) { + var r = null; + if (5 < arguments.length) { + for (var r = 0, s = Array(arguments.length - 5);r < s.length;) { + s[r] = arguments[r + 5], ++r; + } + r = new cljs.core.IndexedSeq(s, 0); + } + return a.call(this, b, c, d, e, f, r); + }; + b.cljs$lang$maxFixedArity = 5; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.next(b); @@ -6175,10 +8305,10 @@ cljs.core.apply = function() { b = cljs.core.next(b); var h = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, f, h, b) + return a(c, d, e, f, h, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, h, k, l, m, n) { switch(arguments.length) { case 2: @@ -6190,7 +8320,14 @@ cljs.core.apply = function() { case 5: return e.call(this, a, h, k, l, m); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)) + var p = null; + if (5 < arguments.length) { + for (var p = 0, q = Array(arguments.length - 5);p < q.length;) { + q[p] = arguments[p + 5], ++p; + } + p = new cljs.core.IndexedSeq(q, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, p); } throw Error("Invalid arity: " + arguments.length); }; @@ -6201,37 +8338,114 @@ cljs.core.apply = function() { a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$5 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.vary_meta = function() { - var a = function(a, b, e) { - return cljs.core.with_meta.call(null, a, cljs.core.apply.call(null, b, cljs.core.meta.call(null, a), e)) - }, b = function(b, d, e) { - var f = null; - 2 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, f) - }; - b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = function(b) { - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(d, e, b) + var a = null, b = function(a, b) { + return cljs.core.with_meta(a, function() { + var c = cljs.core.meta(a); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + }()); + }, c = function(a, b, c) { + return cljs.core.with_meta(a, function() { + var d = cljs.core.meta(a); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, c) : b.call(null, d, c); + }()); + }, d = function(a, b, c, d) { + return cljs.core.with_meta(a, function() { + var e = cljs.core.meta(a); + return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(e, c, d) : b.call(null, e, c, d); + }()); + }, e = function(a, b, c, d, e) { + return cljs.core.with_meta(a, function() { + var f = cljs.core.meta(a); + return b.cljs$core$IFn$_invoke$arity$4 ? b.cljs$core$IFn$_invoke$arity$4(f, c, d, e) : b.call(null, f, c, d, e); + }()); + }, f = function(a, b, c, d, e, f) { + return cljs.core.with_meta(a, function() { + var g = cljs.core.meta(a); + return b.cljs$core$IFn$_invoke$arity$5 ? b.cljs$core$IFn$_invoke$arity$5(g, c, d, e, f) : b.call(null, g, c, d, e, f); + }()); + }, g = function() { + var a = function(a, b, c, d, e, f, g) { + return cljs.core.with_meta(a, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.meta(a), c, d, e, cljs.core.array_seq([f, g], 0))); + }, b = function(b, c, d, e, f, g, k) { + var t = null; + if (6 < arguments.length) { + for (var t = 0, u = Array(arguments.length - 6);t < u.length;) { + u[t] = arguments[t + 6], ++t; + } + t = new cljs.core.IndexedSeq(u, 0); + } + return a.call(this, b, c, d, e, f, g, t); + }; + b.cljs$lang$maxFixedArity = 6; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var f = cljs.core.first(b); + b = cljs.core.next(b); + var g = cljs.core.first(b); + b = cljs.core.next(b); + var k = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, e, f, g, k, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, k, l, m, n, p, q) { + switch(arguments.length) { + case 2: + return b.call(this, a, k); + case 3: + return c.call(this, a, k, l); + case 4: + return d.call(this, a, k, l, m); + case 5: + return e.call(this, a, k, l, m, n); + case 6: + return f.call(this, a, k, l, m, n, p); + default: + var r = null; + if (6 < arguments.length) { + for (var r = 0, s = Array(arguments.length - 6);r < s.length;) { + s[r] = arguments[r + 6], ++r; + } + r = new cljs.core.IndexedSeq(s, 0); + } + return g.cljs$core$IFn$_invoke$arity$variadic(a, k, l, m, n, p, r); + } + throw Error("Invalid arity: " + arguments.length); }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + a.cljs$lang$maxFixedArity = 6; + a.cljs$lang$applyTo = g.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$5 = e; + a.cljs$core$IFn$_invoke$arity$6 = f; + a.cljs$core$IFn$_invoke$arity$variadic = g.cljs$core$IFn$_invoke$arity$variadic; + return a; }(); cljs.core.not_EQ_ = function() { var a = null, b = function(a, b) { - return!cljs.core._EQ_.call(null, a, b) + return!cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b); }, c = function() { var a = function(a, b, c) { - return cljs.core.not.call(null, cljs.core.apply.call(null, cljs.core._EQ_, a, b, c)) + return cljs.core.not(cljs.core.apply.cljs$core$IFn$_invoke$arity$4(cljs.core._EQ_, a, b, c)); }, b = function(b, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return a.call(this, b, c, k); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -6239,10 +8453,10 @@ cljs.core.not_EQ_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b) + return a(c, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -6250,136 +8464,590 @@ cljs.core.not_EQ_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!1 + return!1; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.not_empty = function(a) { - return cljs.core.seq.call(null, a) ? a : null + return cljs.core.seq(a) ? a : null; +}; +cljs.core.nil_iter = function nil_iter() { + "undefined" === typeof cljs.core.t7727 && (cljs.core.t7727 = function(b, c) { + this.nil_iter = b; + this.meta7728 = c; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 393216; + }, cljs.core.t7727.prototype.hasNext = function() { + return!1; + }, cljs.core.t7727.prototype.next = function() { + return Error("No such element"); + }, cljs.core.t7727.prototype.remove = function() { + return Error("Unsupported operation"); + }, cljs.core.t7727.prototype.cljs$core$IMeta$_meta$arity$1 = function(b) { + return this.meta7728; + }, cljs.core.t7727.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(b, c) { + return new cljs.core.t7727(this.nil_iter, c); + }, cljs.core.t7727.cljs$lang$type = !0, cljs.core.t7727.cljs$lang$ctorStr = "cljs.core/t7727", cljs.core.t7727.cljs$lang$ctorPrWriter = function(b, c, d) { + return cljs.core._write(c, "cljs.core/t7727"); + }, cljs.core.__GT_t7727 = function(b, c) { + return new cljs.core.t7727(b, c); + }); + return new cljs.core.t7727(nil_iter, cljs.core.PersistentArrayMap.EMPTY); +}; +cljs.core.StringIter = function(a, b) { + this.s = a; + this.i = b; +}; +cljs.core.StringIter.prototype.hasNext = function() { + return this.i < this.s.length; +}; +cljs.core.StringIter.prototype.next = function() { + var a = this.s.charAt(this.i); + this.i += 1; + return a; +}; +cljs.core.StringIter.prototype.remove = function() { + return Error("Unsupported operation"); +}; +cljs.core.StringIter.cljs$lang$type = !0; +cljs.core.StringIter.cljs$lang$ctorStr = "cljs.core/StringIter"; +cljs.core.StringIter.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/StringIter"); +}; +cljs.core.__GT_StringIter = function(a, b) { + return new cljs.core.StringIter(a, b); +}; +cljs.core.string_iter = function(a) { + return new cljs.core.StringIter(a, 0); +}; +cljs.core.ArrayIter = function(a, b) { + this.arr = a; + this.i = b; +}; +cljs.core.ArrayIter.prototype.hasNext = function() { + return this.i < this.arr.length; +}; +cljs.core.ArrayIter.prototype.next = function() { + var a = this.arr[this.i]; + this.i += 1; + return a; +}; +cljs.core.ArrayIter.prototype.remove = function() { + return Error("Unsupported operation"); +}; +cljs.core.ArrayIter.cljs$lang$type = !0; +cljs.core.ArrayIter.cljs$lang$ctorStr = "cljs.core/ArrayIter"; +cljs.core.ArrayIter.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ArrayIter"); +}; +cljs.core.__GT_ArrayIter = function(a, b) { + return new cljs.core.ArrayIter(a, b); +}; +cljs.core.array_iter = function(a) { + return new cljs.core.ArrayIter(a, 0); +}; +cljs.core.INIT = {}; +cljs.core.START = {}; +cljs.core.SeqIter = function(a, b) { + this._seq = a; + this._next = b; +}; +cljs.core.SeqIter.prototype.hasNext = function() { + this._seq === cljs.core.INIT ? (this._seq = cljs.core.START, this._next = cljs.core.seq(this._next)) : this._seq === this._next && (this._next = cljs.core.next(this._seq)); + return null != this._next; +}; +cljs.core.SeqIter.prototype.next = function() { + if (cljs.core.not(this.hasNext())) { + throw Error("No such element"); + } + this._seq = this._next; + return cljs.core.first(this._next); +}; +cljs.core.SeqIter.prototype.remove = function() { + return Error("Unsupported operation"); +}; +cljs.core.SeqIter.cljs$lang$type = !0; +cljs.core.SeqIter.cljs$lang$ctorStr = "cljs.core/SeqIter"; +cljs.core.SeqIter.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/SeqIter"); +}; +cljs.core.__GT_SeqIter = function(a, b) { + return new cljs.core.SeqIter(a, b); }; +cljs.core.seq_iter = function(a) { + return new cljs.core.SeqIter(cljs.core.INIT, a); +}; +cljs.core.iter = function(a) { + if (null == a) { + return cljs.core.nil_iter(); + } + if ("string" === typeof a) { + return cljs.core.string_iter(a); + } + if (a instanceof Array) { + return cljs.core.array_iter(a); + } + if (cljs.core.iterable_QMARK_(a)) { + return cljs.core._iterator(a); + } + if (cljs.core.seqable_QMARK_(a)) { + return cljs.core.seq_iter(a); + } + throw Error([cljs.core.str("Cannot create iterator from "), cljs.core.str(a)].join("")); +}; +cljs.core.lazy_transformer = function(a) { + return new cljs.core.LazyTransformer(a, null, null, null); +}; +cljs.core.Stepper = function(a, b) { + this.xform = a; + this.iter = b; +}; +cljs.core.Stepper.prototype.step = function(a) { + for (var b = this;;) { + if (cljs.core.truth_(function() { + var c = null != a.stepper; + return c ? b.iter.hasNext() : c; + }())) { + if (cljs.core.reduced_QMARK_(function() { + var c = b.iter.next(); + return b.xform.cljs$core$IFn$_invoke$arity$2 ? b.xform.cljs$core$IFn$_invoke$arity$2(a, c) : b.xform.call(null, a, c); + }())) { + null != a.rest && (a.rest.stepper = null); + } else { + continue; + } + } + break; + } + return null == a.stepper ? null : b.xform.cljs$core$IFn$_invoke$arity$1 ? b.xform.cljs$core$IFn$_invoke$arity$1(a) : b.xform.call(null, a); +}; +cljs.core.Stepper.cljs$lang$type = !0; +cljs.core.Stepper.cljs$lang$ctorStr = "cljs.core/Stepper"; +cljs.core.Stepper.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Stepper"); +}; +cljs.core.__GT_Stepper = function(a, b) { + return new cljs.core.Stepper(a, b); +}; +cljs.core.stepper = function(a, b) { + var c = function() { + var a = null, b = function(a) { + (cljs.core.reduced_QMARK_(a) ? cljs.core.deref(a) : a).stepper = null; + return a; + }, c = function(a, b) { + a.first = b; + a.rest = cljs.core.lazy_transformer(a.stepper); + a.stepper = null; + return a.rest; + }, a = function(a, d) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, d); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; + }(); + return new cljs.core.Stepper(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), b); +}; +cljs.core.MultiStepper = function(a, b, c) { + this.xform = a; + this.iters = b; + this.nexts = c; +}; +cljs.core.MultiStepper.prototype.hasNext = function() { + for (var a = cljs.core.seq(this.iters);;) { + if (null != a) { + var b = cljs.core.first(a); + if (cljs.core.not(b.hasNext())) { + return!1; + } + a = cljs.core.next(a); + } else { + return!0; + } + } +}; +cljs.core.MultiStepper.prototype.next = function() { + for (var a = this.iters.length, b = 0;;) { + if (b < a) { + this.nexts[b] = this.iters[b].next(), b += 1; + } else { + break; + } + } + return cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(this.nexts, 0); +}; +cljs.core.MultiStepper.prototype.step = function(a) { + for (var b = this;;) { + if (cljs.core.truth_(function() { + var c = null != a.stepper; + return c ? b.hasNext() : c; + }())) { + if (cljs.core.reduced_QMARK_(cljs.core.apply.cljs$core$IFn$_invoke$arity$2(this.xform, cljs.core.cons(a, b.next())))) { + null != a.rest && (a.rest.stepper = null); + } else { + continue; + } + } + break; + } + return null == a.stepper ? null : this.xform.cljs$core$IFn$_invoke$arity$1 ? this.xform.cljs$core$IFn$_invoke$arity$1(a) : this.xform.call(null, a); +}; +cljs.core.MultiStepper.cljs$lang$type = !0; +cljs.core.MultiStepper.cljs$lang$ctorStr = "cljs.core/MultiStepper"; +cljs.core.MultiStepper.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/MultiStepper"); +}; +cljs.core.__GT_MultiStepper = function(a, b, c) { + return new cljs.core.MultiStepper(a, b, c); +}; +cljs.core.multi_stepper = function() { + var a = null, b = function(b, c) { + return a.cljs$core$IFn$_invoke$arity$3(b, c, Array(c.length)); + }, c = function(a, b, c) { + var g = function() { + var a = null, b = function(a) { + a = cljs.core.reduced_QMARK_(a) ? cljs.core.deref(a) : a; + a.stepper = null; + return a; + }, c = function(a, b) { + a.first = b; + a.rest = cljs.core.lazy_transformer(a.stepper); + a.stepper = null; + return a.rest; + }, a = function(a, d) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, d); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; + }(); + return new cljs.core.MultiStepper(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(g) : a.call(null, g), b, c); + }, a = function(a, e, f) { + switch(arguments.length) { + case 2: + return b.call(this, a, e); + case 3: + return c.call(this, a, e, f); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + return a; +}(); +cljs.core.LazyTransformer = function(a, b, c, d) { + this.stepper = a; + this.first = b; + this.rest = c; + this.meta = d; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 31719628; +}; +cljs.core.LazyTransformer.prototype.cljs$core$INext$_next$arity$1 = function(a) { + null != this.stepper && cljs.core._seq(this); + return null == this.rest ? null : cljs.core._seq(this.rest); +}; +cljs.core.LazyTransformer.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + null != this.stepper && cljs.core._seq(this); + return null == this.rest ? null : this.first; +}; +cljs.core.LazyTransformer.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + null != this.stepper && cljs.core._seq(this); + return null == this.rest ? cljs.core.List.EMPTY : this.rest; +}; +cljs.core.LazyTransformer.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + null != this.stepper && this.stepper.step(this); + return null == this.rest ? null : this; +}; +cljs.core.LazyTransformer.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_ordered_coll(this); +}; +cljs.core.LazyTransformer.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return null != cljs.core._seq(this) ? cljs.core.equiv_sequential(this, b) : cljs.core.sequential_QMARK_(b) && null == cljs.core.seq(b); +}; +cljs.core.LazyTransformer.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.List.EMPTY; +}; +cljs.core.LazyTransformer.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, cljs.core._seq(this)); +}; +cljs.core.LazyTransformer.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.LazyTransformer(this.stepper, this.first, this.rest, b); +}; +cljs.core.LazyTransformer.cljs$lang$type = !0; +cljs.core.LazyTransformer.cljs$lang$ctorStr = "cljs.core/LazyTransformer"; +cljs.core.LazyTransformer.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/LazyTransformer"); +}; +cljs.core.__GT_LazyTransformer = function(a, b, c, d) { + return new cljs.core.LazyTransformer(a, b, c, d); +}; +cljs.core.LazyTransformer.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; +cljs.core.LazyTransformer.create = function(a, b) { + return new cljs.core.LazyTransformer(cljs.core.stepper(a, cljs.core.iter(b)), null, null, null); +}; +cljs.core.LazyTransformer.createMulti = function(a, b) { + for (var c = [], d = cljs.core.seq(b), e = null, f = 0, g = 0;;) { + if (g < f) { + var h = e.cljs$core$IIndexed$_nth$arity$2(null, g); + c.push(cljs.core.iter(h)); + g += 1; + } else { + if (d = cljs.core.seq(d)) { + e = d, cljs.core.chunked_seq_QMARK_(e) ? (d = cljs.core.chunk_first(e), g = cljs.core.chunk_rest(e), e = d, f = cljs.core.count(d), d = g) : (d = cljs.core.first(e), c.push(cljs.core.iter(d)), d = cljs.core.next(e), e = null, f = 0), g = 0; + } else { + break; + } + } + } + return new cljs.core.LazyTransformer(cljs.core.multi_stepper.cljs$core$IFn$_invoke$arity$3(a, c, Array(c.length)), null, null, null); +}; +cljs.core.sequence = function() { + var a = null, b = function(a) { + return cljs.core.seq_QMARK_(a) ? a : (a = cljs.core.seq(a)) ? a : cljs.core.List.EMPTY; + }, c = function(a, b) { + return cljs.core.LazyTransformer.create(a, b); + }, d = function() { + var a = function(a, b, c) { + return cljs.core.LazyTransformer.createMulti(a, cljs.core.to_array(cljs.core.cons(b, c))); + }, b = function(b, c, d) { + var f = null; + if (2 < arguments.length) { + for (var f = 0, m = Array(arguments.length - 2);f < m.length;) { + m[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(m, 0); + } + return a.call(this, b, c, f); + }; + b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, f, g) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, f); + default: + var h = null; + if (2 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { + k[h] = arguments[h + 2], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return d.cljs$core$IFn$_invoke$arity$variadic(a, f, h); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$applyTo = d.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$variadic = d.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); cljs.core.every_QMARK_ = function(a, b) { - for(;;) { - if(null == cljs.core.seq.call(null, b)) { - return!0 + for (;;) { + if (null == cljs.core.seq(b)) { + return!0; } - if(cljs.core.truth_(a.call(null, cljs.core.first.call(null, b)))) { - var c = a, d = cljs.core.next.call(null, b); + if (cljs.core.truth_(function() { + var c = cljs.core.first(b); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }())) { + var c = a, d = cljs.core.next(b); a = c; - b = d - }else { - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null + b = d; + } else { + return!1; } } }; cljs.core.not_every_QMARK_ = function(a, b) { - return!cljs.core.every_QMARK_.call(null, a, b) + return!cljs.core.every_QMARK_(a, b); }; cljs.core.some = function(a, b) { - for(;;) { - if(cljs.core.seq.call(null, b)) { - var c = a.call(null, cljs.core.first.call(null, b)); - if(cljs.core.truth_(c)) { - return c + for (;;) { + if (cljs.core.seq(b)) { + var c; + c = cljs.core.first(b); + c = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + if (cljs.core.truth_(c)) { + return c; } - var c = a, d = cljs.core.next.call(null, b); + c = a; + var d = cljs.core.next(b); a = c; - b = d - }else { - return null + b = d; + } else { + return null; } } }; cljs.core.not_any_QMARK_ = function(a, b) { - return cljs.core.not.call(null, cljs.core.some.call(null, a, b)) + return cljs.core.not(cljs.core.some(a, b)); }; cljs.core.even_QMARK_ = function(a) { - if(cljs.core.integer_QMARK_.call(null, a)) { - return 0 === (a & 1) + if (cljs.core.integer_QMARK_(a)) { + return 0 === (a & 1); } throw Error([cljs.core.str("Argument must be an integer: "), cljs.core.str(a)].join("")); }; cljs.core.odd_QMARK_ = function(a) { - return!cljs.core.even_QMARK_.call(null, a) -}; -cljs.core.identity = function(a) { - return a + return!cljs.core.even_QMARK_(a); }; cljs.core.complement = function(a) { return function() { var b = null, c = function() { + return cljs.core.not(a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null)); + }, d = function(b) { + return cljs.core.not(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)); + }, e = function(b, c) { + return cljs.core.not(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c)); + }, f = function() { var b = function(b, c, d) { - return cljs.core.not.call(null, cljs.core.apply.call(null, a, b, c, d)) - }, c = function(a, c, e) { - var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return cljs.core.not(cljs.core.apply.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); + }, c = function(a, c, d) { + var e = null; + if (2 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 2);e < f.length;) { + f[e] = arguments[e + 2], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return b.call(this, a, c, e); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.next(a); - var e = cljs.core.first(a); + var d = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, d, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), b = function(b, e, f) { + return c; + }(), b = function(a, b, k) { switch(arguments.length) { case 0: - return cljs.core.not.call(null, a.call(null)); + return c.call(this); case 1: - return cljs.core.not.call(null, a.call(null, b)); + return d.call(this, a); case 2: - return cljs.core.not.call(null, a.call(null, b, e)); + return e.call(this, a, b); default: - return c.cljs$core$IFn$_invoke$arity$variadic(b, e, cljs.core.array_seq(arguments, 2)) + var l = null; + if (2 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 2);l < m.length;) { + m[l] = arguments[l + 2], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, b, l); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = c.cljs$lang$applyTo; - return b - }() + b.cljs$lang$applyTo = f.cljs$lang$applyTo; + b.cljs$core$IFn$_invoke$arity$0 = c; + b.cljs$core$IFn$_invoke$arity$1 = d; + b.cljs$core$IFn$_invoke$arity$2 = e; + b.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return b; + }(); }; cljs.core.constantly = function(a) { return function() { var b = function(b) { - 0 < arguments.length && cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0); - return a + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + new cljs.core.IndexedSeq(e, 0); + } + return a; }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { cljs.core.seq(b); - return a + return a; }; b.cljs$core$IFn$_invoke$arity$variadic = function(b) { - return a + return a; }; - return b - }() + return b; + }(); }; cljs.core.comp = function() { var a = null, b = function() { - return cljs.core.identity + return cljs.core.identity; }, c = function(a, b) { return function() { var c = null, d = function() { + var c = b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }, e = function(c) { + c = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }, m = function(c, d) { + var e; + e = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); + }, n = function(c, d, e) { + c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, d, e) : b.call(null, c, d, e); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }, p = function() { var c = function(c, d, e, h) { - return a.call(null, cljs.core.apply.call(null, b, c, d, e, h)) + c = cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, c, d, e, h); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); }, d = function(a, b, d, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -6389,38 +9057,75 @@ cljs.core.comp = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }(), c = function(c, e, h, p) { + return d; + }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: - return a.call(null, b.call(null)); + return d.call(this); case 1: - return a.call(null, b.call(null, c)); + return e.call(this, a); case 2: - return a.call(null, b.call(null, c, e)); + return m.call(this, a, b); case 3: - return a.call(null, b.call(null, c, e, h)); + return n.call(this, a, b, c); default: - return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)) + var g = null; + if (3 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { + h[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = d.cljs$lang$applyTo; - return c - }() + c.cljs$lang$applyTo = p.cljs$lang$applyTo; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = e; + c.cljs$core$IFn$_invoke$arity$2 = m; + c.cljs$core$IFn$_invoke$arity$3 = n; + c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function() { + var d; + d = c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null); + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + }, m = function(d) { + d = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + }, n = function(d, e) { + var k; + k = c.cljs$core$IFn$_invoke$arity$2 ? c.cljs$core$IFn$_invoke$arity$2(d, e) : c.call(null, d, e); + k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(k) : b.call(null, k); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(k) : a.call(null, k); + }, p = function(d, e, k) { + d = c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(d, e, k) : c.call(null, d, e, k); + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + }, q = function() { var d = function(d, e, k, l) { - return a.call(null, b.call(null, cljs.core.apply.call(null, c, d, e, k, l))) + d = cljs.core.apply.cljs$core$IFn$_invoke$arity$5(c, d, e, k, l); + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); }, e = function(a, b, c, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -6430,59 +9135,82 @@ cljs.core.comp = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e - }(), d = function(d, k, p, q) { + return e; + }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: - return a.call(null, b.call(null, c.call(null))); + return e.call(this); case 1: - return a.call(null, b.call(null, c.call(null, d))); + return m.call(this, a); case 2: - return a.call(null, b.call(null, c.call(null, d, k))); + return n.call(this, a, b); case 3: - return a.call(null, b.call(null, c.call(null, d, k, p))); + return p.call(this, a, b, c); default: - return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)) + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return q.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = e.cljs$lang$applyTo; - return d - }() + d.cljs$lang$applyTo = q.cljs$lang$applyTo; + d.cljs$core$IFn$_invoke$arity$0 = e; + d.cljs$core$IFn$_invoke$arity$1 = m; + d.cljs$core$IFn$_invoke$arity$2 = n; + d.cljs$core$IFn$_invoke$arity$3 = p; + d.cljs$core$IFn$_invoke$arity$variadic = q.cljs$core$IFn$_invoke$arity$variadic; + return d; + }(); }, e = function() { var a = function(a, b, c, d) { - var e = cljs.core.reverse.call(null, cljs.core.list_STAR_.call(null, a, b, c, d)); - return function() { - var a = function(a) { - a = cljs.core.apply.call(null, cljs.core.first.call(null, e), a); - for(var b = cljs.core.next.call(null, e);;) { - if(b) { - a = cljs.core.first.call(null, b).call(null, a), b = cljs.core.next.call(null, b) - }else { - return a + return function(a) { + return function() { + var b = function(b) { + b = cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.first(a), b); + for (var c = cljs.core.next(a);;) { + if (c) { + b = cljs.core.first(c).call(null, b), c = cljs.core.next(c); + } else { + return b; + } } - } - }, b = function(b) { - var c = null; - 0 < arguments.length && (c = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, c) - }; - b.cljs$lang$maxFixedArity = 0; - b.cljs$lang$applyTo = function(b) { - b = cljs.core.seq(b); - return a(b) - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }() + }, c = function(a) { + var c = null; + if (0 < arguments.length) { + for (var c = 0, d = Array(arguments.length - 0);c < d.length;) { + d[c] = arguments[c + 0], ++c; + } + c = new cljs.core.IndexedSeq(d, 0); + } + return b.call(this, c); + }; + c.cljs$lang$maxFixedArity = 0; + c.cljs$lang$applyTo = function(a) { + a = cljs.core.seq(a); + return b(a); + }; + c.cljs$core$IFn$_invoke$arity$variadic = b; + return c; + }(); + }(cljs.core.reverse(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d))); }, b = function(b, c, d, e) { var g = null; - 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + if (3 < arguments.length) { + for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { + p[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(p, 0); + } + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -6492,10 +9220,10 @@ cljs.core.comp = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 0: @@ -6507,7 +9235,14 @@ cljs.core.comp = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + var l = null; + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); } throw Error("Invalid arity: " + arguments.length); }; @@ -6515,87 +9250,244 @@ cljs.core.comp = function() { a.cljs$lang$applyTo = e.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.partial = function() { var a = null, b = function(a, b) { return function() { - var c = function(c) { - return cljs.core.apply.call(null, a, b, c) - }, d = function(a) { - var b = null; - 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return c.call(this, b) - }; - d.cljs$lang$maxFixedArity = 0; - d.cljs$lang$applyTo = function(a) { - a = cljs.core.seq(a); - return c(a) + var c = null, d = function() { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + }, e = function(c) { + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + }, m = function(c, d) { + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); + }, n = function(c, d, e) { + return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.call(null, b, c, d, e); + }, p = function() { + var c = function(c, d, e, h) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, b, c, d, e, cljs.core.array_seq([h], 0)); + }, d = function(a, b, d, e) { + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); + }; + d.cljs$lang$maxFixedArity = 3; + d.cljs$lang$applyTo = function(a) { + var b = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return c(b, d, e, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d; + }(), c = function(a, b, c, f) { + switch(arguments.length) { + case 0: + return d.call(this); + case 1: + return e.call(this, a); + case 2: + return m.call(this, a, b); + case 3: + return n.call(this, a, b, c); + default: + var g = null; + if (3 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { + h[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); + } + throw Error("Invalid arity: " + arguments.length); }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }() + c.cljs$lang$maxFixedArity = 3; + c.cljs$lang$applyTo = p.cljs$lang$applyTo; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = e; + c.cljs$core$IFn$_invoke$arity$2 = m; + c.cljs$core$IFn$_invoke$arity$3 = n; + c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; + return c; + }(); }, c = function(a, b, c) { return function() { - var d = function(d) { - return cljs.core.apply.call(null, a, b, c, d) - }, e = function(a) { - var b = null; - 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return d.call(this, b) - }; - e.cljs$lang$maxFixedArity = 0; - e.cljs$lang$applyTo = function(a) { - a = cljs.core.seq(a); - return d(a) + var d = null, e = function() { + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + }, m = function(d) { + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); + }, n = function(d, e) { + return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.call(null, b, c, d, e); + }, p = function(d, e, k) { + return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(b, c, d, e, k) : a.call(null, b, c, d, e, k); + }, q = function() { + var d = function(d, e, k, l) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, b, c, d, e, cljs.core.array_seq([k, l], 0)); + }, e = function(a, b, c, e) { + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return d.call(this, a, b, c, f); + }; + e.cljs$lang$maxFixedArity = 3; + e.cljs$lang$applyTo = function(a) { + var b = cljs.core.first(a); + a = cljs.core.next(a); + var c = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return d(b, c, e, a); + }; + e.cljs$core$IFn$_invoke$arity$variadic = d; + return e; + }(), d = function(a, b, c, d) { + switch(arguments.length) { + case 0: + return e.call(this); + case 1: + return m.call(this, a); + case 2: + return n.call(this, a, b); + case 3: + return p.call(this, a, b, c); + default: + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return q.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); + } + throw Error("Invalid arity: " + arguments.length); }; - e.cljs$core$IFn$_invoke$arity$variadic = d; - return e - }() + d.cljs$lang$maxFixedArity = 3; + d.cljs$lang$applyTo = q.cljs$lang$applyTo; + d.cljs$core$IFn$_invoke$arity$0 = e; + d.cljs$core$IFn$_invoke$arity$1 = m; + d.cljs$core$IFn$_invoke$arity$2 = n; + d.cljs$core$IFn$_invoke$arity$3 = p; + d.cljs$core$IFn$_invoke$arity$variadic = q.cljs$core$IFn$_invoke$arity$variadic; + return d; + }(); }, d = function(a, b, c, d) { return function() { - var e = function(e) { - return cljs.core.apply.call(null, a, b, c, d, e) - }, m = function(a) { - var b = null; - 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return e.call(this, b) - }; - m.cljs$lang$maxFixedArity = 0; - m.cljs$lang$applyTo = function(a) { - a = cljs.core.seq(a); - return e(a) + var e = null, m = function() { + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); + }, n = function(e) { + return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.call(null, b, c, d, e); + }, p = function(e, l) { + return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(b, c, d, e, l) : a.call(null, b, c, d, e, l); + }, q = function(e, l, m) { + return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(b, c, d, e, l, m) : a.call(null, b, c, d, e, l, m); + }, r = function() { + var e = function(e, l, m, q) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, b, c, d, e, cljs.core.array_seq([l, m, q], 0)); + }, l = function(a, b, c, d) { + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return e.call(this, a, b, c, f); + }; + l.cljs$lang$maxFixedArity = 3; + l.cljs$lang$applyTo = function(a) { + var b = cljs.core.first(a); + a = cljs.core.next(a); + var c = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.rest(a); + return e(b, c, d, a); + }; + l.cljs$core$IFn$_invoke$arity$variadic = e; + return l; + }(), e = function(a, b, c, d) { + switch(arguments.length) { + case 0: + return m.call(this); + case 1: + return n.call(this, a); + case 2: + return p.call(this, a, b); + case 3: + return q.call(this, a, b, c); + default: + var e = null; + if (3 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { + f[e] = arguments[e + 3], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return r.cljs$core$IFn$_invoke$arity$variadic(a, b, c, e); + } + throw Error("Invalid arity: " + arguments.length); }; - m.cljs$core$IFn$_invoke$arity$variadic = e; - return m - }() + e.cljs$lang$maxFixedArity = 3; + e.cljs$lang$applyTo = r.cljs$lang$applyTo; + e.cljs$core$IFn$_invoke$arity$0 = m; + e.cljs$core$IFn$_invoke$arity$1 = n; + e.cljs$core$IFn$_invoke$arity$2 = p; + e.cljs$core$IFn$_invoke$arity$3 = q; + e.cljs$core$IFn$_invoke$arity$variadic = r.cljs$core$IFn$_invoke$arity$variadic; + return e; + }(); }, e = function() { var a = function(a, b, c, d, e) { return function() { var f = function(f) { - return cljs.core.apply.call(null, a, b, c, d, cljs.core.concat.call(null, e, f)) + return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, b, c, d, cljs.core.concat.cljs$core$IFn$_invoke$arity$2(e, f)); }, g = function(a) { var b = null; - 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return f.call(this, b) + if (0 < arguments.length) { + for (var b = 0, c = Array(arguments.length - 0);b < c.length;) { + c[b] = arguments[b + 0], ++b; + } + b = new cljs.core.IndexedSeq(c, 0); + } + return f.call(this, b); }; g.cljs$lang$maxFixedArity = 0; g.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return f(a) + return f(a); }; g.cljs$core$IFn$_invoke$arity$variadic = f; - return g - }() + return g; + }(); }, b = function(b, c, d, e, g) { var p = null; - 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return a.call(this, b, c, d, e, p) + if (4 < arguments.length) { + for (var p = 0, q = Array(arguments.length - 4);p < q.length;) { + q[p] = arguments[p + 4], ++p; + } + p = new cljs.core.IndexedSeq(q, 0); + } + return a.call(this, b, c, d, e, p); }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -6607,10 +9499,10 @@ cljs.core.partial = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, g, b) + return a(c, d, e, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 1: @@ -6622,31 +9514,52 @@ cljs.core.partial = function() { case 4: return d.call(this, a, g, h, k); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) + var m = null; + if (4 < arguments.length) { + for (var m = 0, n = Array(arguments.length - 4);m < n.length;) { + n[m] = arguments[m + 4], ++m; + } + m = new cljs.core.IndexedSeq(n, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, m); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 4; a.cljs$lang$applyTo = e.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.fnil = function() { var a = null, b = function(a, b) { return function() { - var c = null, d = function() { + var c = null, d = function(c) { + c = null == c ? b : c; + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }, k = function(c, d) { + var g = null == c ? b : c; + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(g, d) : a.call(null, g, d); + }, l = function(c, d, g) { + c = null == c ? b : c; + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, g) : a.call(null, c, d, g); + }, m = function() { var c = function(c, d, g, h) { - return cljs.core.apply.call(null, a, null == c ? b : c, d, g, h) + return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, null == c ? b : c, d, g, h); }, d = function(a, b, d, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -6656,36 +9569,59 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }(), c = function(c, g, m, n) { + return d; + }(), c = function(a, b, c, e) { switch(arguments.length) { case 1: - return a.call(null, null == c ? b : c); + return d.call(this, a); case 2: - return a.call(null, null == c ? b : c, g); + return k.call(this, a, b); case 3: - return a.call(null, null == c ? b : c, g, m); + return l.call(this, a, b, c); default: - return d.cljs$core$IFn$_invoke$arity$variadic(c, g, m, cljs.core.array_seq(arguments, 3)) + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = d.cljs$lang$applyTo; - return c - }() + c.cljs$lang$applyTo = m.cljs$lang$applyTo; + c.cljs$core$IFn$_invoke$arity$1 = d; + c.cljs$core$IFn$_invoke$arity$2 = k; + c.cljs$core$IFn$_invoke$arity$3 = l; + c.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; + return c; + }(); }, c = function(a, b, c) { return function() { - var d = null, k = function() { + var d = null, k = function(d, h) { + var k = null == d ? b : d, l = null == h ? c : h; + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, l) : a.call(null, k, l); + }, l = function(d, h, k) { + d = null == d ? b : d; + h = null == h ? c : h; + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(d, h, k) : a.call(null, d, h, k); + }, m = function() { var d = function(d, h, k, l) { - return cljs.core.apply.call(null, a, null == d ? b : d, null == h ? c : h, k, l) + return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, null == d ? b : d, null == h ? c : h, k, l); }, h = function(a, b, c, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return d.call(this, a, b, c, f); }; h.cljs$lang$maxFixedArity = 3; h.cljs$lang$applyTo = function(a) { @@ -6695,34 +9631,57 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; h.cljs$core$IFn$_invoke$arity$variadic = d; - return h - }(), d = function(d, h, n, p) { + return h; + }(), d = function(a, b, c, d) { switch(arguments.length) { case 2: - return a.call(null, null == d ? b : d, null == h ? c : h); + return k.call(this, a, b); case 3: - return a.call(null, null == d ? b : d, null == h ? c : h, n); + return l.call(this, a, b, c); default: - return k.cljs$core$IFn$_invoke$arity$variadic(d, h, n, cljs.core.array_seq(arguments, 3)) + var e = null; + if (3 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { + f[e] = arguments[e + 3], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, c, e); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = k.cljs$lang$applyTo; - return d - }() + d.cljs$lang$applyTo = m.cljs$lang$applyTo; + d.cljs$core$IFn$_invoke$arity$2 = k; + d.cljs$core$IFn$_invoke$arity$3 = l; + d.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; + return d; + }(); }, d = function(a, b, c, d) { return function() { - var k = null, l = function() { - var k = function(k, l, m, n) { - return cljs.core.apply.call(null, a, null == k ? b : k, null == l ? c : l, null == m ? d : m, n) + var k = null, l = function(d, h) { + var k = null == d ? b : d, l = null == h ? c : h; + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, l) : a.call(null, k, l); + }, m = function(k, l, m) { + k = null == k ? b : k; + l = null == l ? c : l; + m = null == m ? d : m; + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(k, l, m) : a.call(null, k, l, m); + }, n = function() { + var k = function(k, l, m, q) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, null == k ? b : k, null == l ? c : l, null == m ? d : m, q); }, l = function(a, b, c, d) { var e = null; - 3 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return k.call(this, a, b, c, e) + if (3 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { + f[e] = arguments[e + 3], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return k.call(this, a, b, c, e); }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -6732,25 +9691,35 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return k(b, c, d, a) + return k(b, c, d, a); }; l.cljs$core$IFn$_invoke$arity$variadic = k; - return l - }(), k = function(k, n, p, q) { + return l; + }(), k = function(a, b, c, d) { switch(arguments.length) { case 2: - return a.call(null, null == k ? b : k, null == n ? c : n); + return l.call(this, a, b); case 3: - return a.call(null, null == k ? b : k, null == n ? c : n, null == p ? d : p); + return m.call(this, a, b, c); default: - return l.cljs$core$IFn$_invoke$arity$variadic(k, n, p, cljs.core.array_seq(arguments, 3)) + var e = null; + if (3 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { + f[e] = arguments[e + 3], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, e); } throw Error("Invalid arity: " + arguments.length); }; k.cljs$lang$maxFixedArity = 3; - k.cljs$lang$applyTo = l.cljs$lang$applyTo; - return k - }() + k.cljs$lang$applyTo = n.cljs$lang$applyTo; + k.cljs$core$IFn$_invoke$arity$2 = l; + k.cljs$core$IFn$_invoke$arity$3 = m; + k.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; + return k; + }(); }, a = function(a, f, g, h) { switch(arguments.length) { case 2: @@ -6758,104 +9727,485 @@ cljs.core.fnil = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; +}(); +cljs.core.map_indexed = function() { + var a = null, b = function(a) { + return function(b) { + return function(c) { + return function() { + var g = null, h = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(g, h) { + var k; + k = cljs.core._vreset_BANG_(c, cljs.core._deref(c) + 1); + k = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, h) : a.call(null, k, h); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, k) : b.call(null, g, k); + }, g = function(a, b) { + switch(arguments.length) { + case 0: + return h.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + g.cljs$core$IFn$_invoke$arity$0 = h; + g.cljs$core$IFn$_invoke$arity$1 = k; + g.cljs$core$IFn$_invoke$arity$2 = l; + return g; + }(); + }(cljs.core.volatile_BANG_.cljs$core$IFn$_invoke$arity$1 ? cljs.core.volatile_BANG_.cljs$core$IFn$_invoke$arity$1(-1) : cljs.core.volatile_BANG_.call(null, -1)); + }; + }, c = function(a, b) { + return function g(b, c) { + return new cljs.core.LazySeq(null, function() { + var e = cljs.core.seq(c); + if (e) { + if (cljs.core.chunked_seq_QMARK_(e)) { + for (var m = cljs.core.chunk_first(e), n = cljs.core.count(m), p = cljs.core.chunk_buffer(n), q = 0;;) { + if (q < n) { + cljs.core.chunk_append(p, function() { + var c = b + q, e = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(m, q); + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, e) : a.call(null, c, e); + }()), q += 1; + } else { + break; + } + } + return cljs.core.chunk_cons(cljs.core.chunk(p), g(b + n, cljs.core.chunk_rest(e))); + } + return cljs.core.cons(function() { + var c = cljs.core.first(e); + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + }(), g(b + 1, cljs.core.rest(e))); + } + return null; + }, null, null); + }(0, b); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; }(); -cljs.core.map_indexed = function(a, b) { - return function d(b, f) { +cljs.core.keep = function() { + var a = null, b = function(a) { + return function(b) { + return function() { + var c = null, g = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, h = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, k = function(c, f) { + var g; + g = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f); + return null == g ? c : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, g) : b.call(null, c, g); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return g.call(this); + case 1: + return h.call(this, a); + case 2: + return k.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = g; + c.cljs$core$IFn$_invoke$arity$1 = h; + c.cljs$core$IFn$_invoke$arity$2 = k; + return c; + }(); + }; + }, c = function(b, c) { return new cljs.core.LazySeq(null, function() { - var g = cljs.core.seq.call(null, f); - if(g) { - if(cljs.core.chunked_seq_QMARK_.call(null, g)) { - for(var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { - if(m < k) { - cljs.core.chunk_append.call(null, l, a.call(null, b + m, cljs.core._nth.call(null, h, m))), m += 1 - }else { - break + var f = cljs.core.seq(c); + if (f) { + if (cljs.core.chunked_seq_QMARK_(f)) { + for (var g = cljs.core.chunk_first(f), h = cljs.core.count(g), k = cljs.core.chunk_buffer(h), l = 0;;) { + if (l < h) { + var m = function() { + var a = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(g, l); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }(); + null != m && cljs.core.chunk_append(k, m); + l += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))) + return cljs.core.chunk_cons(cljs.core.chunk(k), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.chunk_rest(f))); } - return cljs.core.cons.call(null, a.call(null, b, cljs.core.first.call(null, g)), d.call(null, b + 1, cljs.core.rest.call(null, g))) + h = function() { + var a = cljs.core.first(f); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }(); + return null == h ? a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(f)) : cljs.core.cons(h, a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(f))); + } + return null; + }, null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.Atom = function(a, b, c, d) { + this.state = a; + this.meta = b; + this.validator = c; + this.watches = d; + this.cljs$lang$protocol_mask$partition0$ = 6455296; + this.cljs$lang$protocol_mask$partition1$ = 16386; +}; +cljs.core.Atom.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return goog.getUid(this); +}; +cljs.core.Atom.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = function(a, b, c) { + for (var d = cljs.core.seq(this.watches), e = null, f = 0, g = 0;;) { + if (g < f) { + a = e.cljs$core$IIndexed$_nth$arity$2(null, g); + var h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null); + a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 1, null); + var k = b, l = c; + a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(h, this, k, l) : a.call(null, h, this, k, l); + g += 1; + } else { + if (a = cljs.core.seq(d)) { + d = a, cljs.core.chunked_seq_QMARK_(d) ? (e = cljs.core.chunk_first(d), d = cljs.core.chunk_rest(d), a = e, f = cljs.core.count(e), e = a) : (a = cljs.core.first(d), h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 1, null), e = h, f = b, g = c, a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(e, this, f, g) : a.call(null, e, this, f, g), d = cljs.core.next(d), e = null, f = 0), g = 0; + } else { + return null; } - return null - }, null, null) - }.call(null, 0, b) + } + } }; -cljs.core.keep = function keep(b, c) { - return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, c); - if(d) { - if(cljs.core.chunked_seq_QMARK_.call(null, d)) { - for(var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { - if(h < f) { - var k = b.call(null, cljs.core._nth.call(null, e, h)); - null != k && cljs.core.chunk_append.call(null, g, k); - h += 1 - }else { - break +cljs.core.Atom.prototype.cljs$core$IWatchable$_add_watch$arity$3 = function(a, b, c) { + this.watches = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.watches, b, c); + return this; +}; +cljs.core.Atom.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = function(a, b) { + return this.watches = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(this.watches, b); +}; +cljs.core.Atom.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.Atom.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + return this.state; +}; +cljs.core.Atom.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return this === b; +}; +cljs.core.Atom.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.Atom.cljs$lang$type = !0; +cljs.core.Atom.cljs$lang$ctorStr = "cljs.core/Atom"; +cljs.core.Atom.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Atom"); +}; +cljs.core.__GT_Atom = function(a, b, c, d) { + return new cljs.core.Atom(a, b, c, d); +}; +cljs.core.atom = function() { + var a = null, b = function(a) { + return new cljs.core.Atom(a, null, null, null); + }, c = function() { + var a = function(a, b) { + var c = cljs.core.seq_QMARK_(b) ? cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map, b) : b, d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "validator", "validator", -1966190681)), c = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "meta", "meta", 1499536964)); + return new cljs.core.Atom(a, c, d, null); + }, b = function(b, c) { + var e = null; + if (1 < arguments.length) { + for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { + k[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, e); + }; + b.cljs$lang$maxFixedArity = 1; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + default: + var f = null; + if (1 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { + g[f] = arguments[f + 1], ++f; } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, f); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 1; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.reset_BANG_ = function(a, b) { + if (a instanceof cljs.core.Atom) { + var c = a.validator; + if (null != c && !cljs.core.truth_(c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(b) : c.call(null, b))) { + throw Error([cljs.core.str("Assert failed: "), cljs.core.str("Validator rejected reference state"), cljs.core.str("\n"), cljs.core.str(function() { + var a = cljs.core.list(new cljs.core.Symbol(null, "validate", "validate", 1439230700, null), new cljs.core.Symbol(null, "new-value", "new-value", -1567397401, null)); + return cljs.core.pr_str.cljs$core$IFn$_invoke$arity$1 ? cljs.core.pr_str.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.pr_str.call(null, a); + }())].join("")); + } + c = a.state; + a.state = b; + null != a.watches && cljs.core._notify_watches(a, c, b); + return b; + } + return cljs.core._reset_BANG_(a, b); +}; +cljs.core.swap_BANG_ = function() { + var a = null, b = function(a, b) { + return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, function() { + var c = a.state; + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + }()) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$2(a, b); + }, c = function(a, b, c) { + return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, function() { + var d = a.state; + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, c) : b.call(null, d, c); + }()) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$3(a, b, c); + }, d = function(a, b, c, d) { + return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, function() { + var e = a.state; + return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(e, c, d) : b.call(null, e, c, d); + }()) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$4(a, b, c, d); + }, e = function() { + var a = function(a, b, c, d, e) { + return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, a.state, c, d, e)) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e); + }, b = function(b, c, d, e, g) { + var p = null; + if (4 < arguments.length) { + for (var p = 0, q = Array(arguments.length - 4);p < q.length;) { + q[p] = arguments[p + 4], ++p; } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), keep.call(null, b, cljs.core.chunk_rest.call(null, d))) + p = new cljs.core.IndexedSeq(q, 0); } - e = b.call(null, cljs.core.first.call(null, d)); - return null == e ? keep.call(null, b, cljs.core.rest.call(null, d)) : cljs.core.cons.call(null, e, keep.call(null, b, cljs.core.rest.call(null, d))) + return a.call(this, b, c, d, e, p); + }; + b.cljs$lang$maxFixedArity = 4; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var g = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, e, g, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, g, h, k, l) { + switch(arguments.length) { + case 2: + return b.call(this, a, g); + case 3: + return c.call(this, a, g, h); + case 4: + return d.call(this, a, g, h, k); + default: + var m = null; + if (4 < arguments.length) { + for (var m = 0, n = Array(arguments.length - 4);m < n.length;) { + n[m] = arguments[m + 4], ++m; + } + m = new cljs.core.IndexedSeq(n, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, m); } - return null - }, null, null) + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 4; + a.cljs$lang$applyTo = e.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.compare_and_set_BANG_ = function(a, b, c) { + return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a.cljs$core$IDeref$_deref$arity$1(null), b) ? (cljs.core.reset_BANG_(a, c), !0) : !1; }; -cljs.core.keep_indexed = function(a, b) { - return function d(b, f) { - return new cljs.core.LazySeq(null, function() { - var g = cljs.core.seq.call(null, f); - if(g) { - if(cljs.core.chunked_seq_QMARK_.call(null, g)) { - for(var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { - if(m < k) { - var n = a.call(null, b + m, cljs.core._nth.call(null, h, m)); - null != n && cljs.core.chunk_append.call(null, l, n); - m += 1 - }else { - break +cljs.core.set_validator_BANG_ = function(a, b) { + return a.validator = b; +}; +cljs.core.get_validator = function(a) { + return a.validator; +}; +cljs.core.Volatile = function(a) { + this.state = a; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32768; +}; +cljs.core.Volatile.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + return this.state; +}; +cljs.core.Volatile.prototype.cljs$core$IVolatile$ = !0; +cljs.core.Volatile.prototype.cljs$core$IVolatile$_vreset_BANG_$arity$2 = function(a, b) { + return this.state = b; +}; +cljs.core.Volatile.cljs$lang$type = !0; +cljs.core.Volatile.cljs$lang$ctorStr = "cljs.core/Volatile"; +cljs.core.Volatile.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Volatile"); +}; +cljs.core.__GT_Volatile = function(a) { + return new cljs.core.Volatile(a); +}; +cljs.core.volatile_BANG_ = function(a) { + return new cljs.core.Volatile(a); +}; +cljs.core.volatile_QMARK_ = function(a) { + return a instanceof cljs.core.Volatile; +}; +cljs.core.vreset_BANG_ = function(a, b) { + return cljs.core._vreset_BANG_(a, b); +}; +cljs.core.keep_indexed = function() { + var a = null, b = function(a) { + return function(b) { + return function(c) { + return function() { + var g = null, h = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(g, h) { + var k; + k = c.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, c.cljs$core$IDeref$_deref$arity$1(null) + 1); + k = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, h) : a.call(null, k, h); + return null == k ? g : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, k) : b.call(null, g, k); + }, g = function(a, b) { + switch(arguments.length) { + case 0: + return h.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + g.cljs$core$IFn$_invoke$arity$0 = h; + g.cljs$core$IFn$_invoke$arity$1 = k; + g.cljs$core$IFn$_invoke$arity$2 = l; + return g; + }(); + }(cljs.core.volatile_BANG_(-1)); + }; + }, c = function(a, b) { + return function g(b, c) { + return new cljs.core.LazySeq(null, function() { + var e = cljs.core.seq(c); + if (e) { + if (cljs.core.chunked_seq_QMARK_(e)) { + for (var m = cljs.core.chunk_first(e), n = cljs.core.count(m), p = cljs.core.chunk_buffer(n), q = 0;;) { + if (q < n) { + var r = function() { + var c = b + q, e = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(m, q); + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, e) : a.call(null, c, e); + }(); + null != r && cljs.core.chunk_append(p, r); + q += 1; + } else { + break; + } } + return cljs.core.chunk_cons(cljs.core.chunk(p), g(b + n, cljs.core.chunk_rest(e))); } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))) + n = function() { + var c = cljs.core.first(e); + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + }(); + return null == n ? g(b + 1, cljs.core.rest(e)) : cljs.core.cons(n, g(b + 1, cljs.core.rest(e))); } - h = a.call(null, b, cljs.core.first.call(null, g)); - return null == h ? d.call(null, b + 1, cljs.core.rest.call(null, g)) : cljs.core.cons.call(null, h, d.call(null, b + 1, cljs.core.rest.call(null, g))) - } - return null - }, null, null) - }.call(null, 0, b) -}; + return null; + }, null, null); + }(0, b); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); cljs.core.every_pred = function() { var a = null, b = function(a) { return function() { var b = null, c = function(b) { - return cljs.core.boolean$.call(null, a.call(null, b)) + return cljs.core.boolean$(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)); }, d = function(b, c) { - return cljs.core.boolean$.call(null, function() { - var d = a.call(null, b); - return cljs.core.truth_(d) ? a.call(null, c) : d - }()) + return cljs.core.boolean$(function() { + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return cljs.core.truth_(d) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) : d; + }()); }, e = function(b, c, d) { - return cljs.core.boolean$.call(null, function() { - var e = a.call(null, b); - return cljs.core.truth_(e) ? (e = a.call(null, c), cljs.core.truth_(e) ? a.call(null, d) : e) : e - }()) + return cljs.core.boolean$(function() { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return cljs.core.truth_(e) ? (e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), cljs.core.truth_(e) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d) : e) : e; + }()); }, m = function() { var c = function(c, d, e, h) { - return cljs.core.boolean$.call(null, b.call(null, c, d, e) && cljs.core.every_QMARK_.call(null, a, h)) + return cljs.core.boolean$(b.cljs$core$IFn$_invoke$arity$3(c, d, e) && cljs.core.every_QMARK_(a, h)); }, d = function(a, b, d, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -6865,10 +10215,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: @@ -6880,48 +10230,63 @@ cljs.core.every_pred = function() { case 3: return e.call(this, a, b, f); default: - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)) + var s = null; + if (3 < arguments.length) { + for (var s = 0, t = Array(arguments.length - 3);s < t.length;) { + t[s] = arguments[s + 3], ++s; + } + s = new cljs.core.IndexedSeq(t, 0); + } + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, s); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = m.cljs$lang$applyTo; b.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; b.cljs$core$IFn$_invoke$arity$1 = c; b.cljs$core$IFn$_invoke$arity$2 = d; b.cljs$core$IFn$_invoke$arity$3 = e; b.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return b - }() + return b; + }(); }, c = function(a, b) { return function() { var c = null, d = function(c) { - return cljs.core.boolean$.call(null, function() { - var d = a.call(null, c); - return cljs.core.truth_(d) ? b.call(null, c) : d - }()) + return cljs.core.boolean$(function() { + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(d) ? b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c) : d; + }()); }, e = function(c, d) { - return cljs.core.boolean$.call(null, function() { - var e = a.call(null, c); - return cljs.core.truth_(e) && (e = a.call(null, d), cljs.core.truth_(e)) ? (e = b.call(null, c), cljs.core.truth_(e) ? b.call(null, d) : e) : e - }()) + return cljs.core.boolean$(function() { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(e) && (e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d), cljs.core.truth_(e)) ? (e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c), cljs.core.truth_(e) ? b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d) : e) : e; + }()); }, m = function(c, d, e) { - return cljs.core.boolean$.call(null, function() { - var h = a.call(null, c); - return cljs.core.truth_(h) && (h = a.call(null, d), cljs.core.truth_(h) && (h = a.call(null, e), cljs.core.truth_(h) && (h = b.call(null, c), cljs.core.truth_(h)))) ? (h = b.call(null, d), cljs.core.truth_(h) ? b.call(null, e) : h) : h - }()) + return cljs.core.boolean$(function() { + var h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(h) && (h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d), cljs.core.truth_(h) && (h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e), cljs.core.truth_(h) && (h = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c), cljs.core.truth_(h)))) ? (h = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(h) ? + b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e) : h) : h; + }()); }, n = function() { var d = function(d, e, k, l) { - return cljs.core.boolean$.call(null, c.call(null, d, e, k) && cljs.core.every_QMARK_.call(null, function(c) { - var d = a.call(null, c); - return cljs.core.truth_(d) ? b.call(null, c) : d - }, l)) + return cljs.core.boolean$(c.cljs$core$IFn$_invoke$arity$3(d, e, k) && cljs.core.every_QMARK_(function(c) { + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(d) ? b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c) : d; + }, l)); }, e = function(a, b, c, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -6931,10 +10296,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e + return e; }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: @@ -6946,48 +10311,62 @@ cljs.core.every_pred = function() { case 3: return m.call(this, a, b, c); default: - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + var g = null; + if (3 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { + h[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = n.cljs$lang$applyTo; c.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; c.cljs$core$IFn$_invoke$arity$1 = d; c.cljs$core$IFn$_invoke$arity$2 = e; c.cljs$core$IFn$_invoke$arity$3 = m; c.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return c - }() + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function(d) { - return cljs.core.boolean$.call(null, function() { - var e = a.call(null, d); - return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e - }()) + return cljs.core.boolean$(function() { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return cljs.core.truth_(e) ? (e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(e) ? c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d) : e) : e; + }()); }, m = function(d, e) { - return cljs.core.boolean$.call(null, function() { - var k = a.call(null, d); - return cljs.core.truth_(k) && (k = b.call(null, d), cljs.core.truth_(k) && (k = c.call(null, d), cljs.core.truth_(k) && (k = a.call(null, e), cljs.core.truth_(k)))) ? (k = b.call(null, e), cljs.core.truth_(k) ? c.call(null, e) : k) : k - }()) + return cljs.core.boolean$(function() { + var k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return cljs.core.truth_(k) && (k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(k) && (k = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d), cljs.core.truth_(k) && (k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e), cljs.core.truth_(k)))) ? (k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e), cljs.core.truth_(k) ? + c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e) : k) : k; + }()); }, n = function(d, e, k) { - return cljs.core.boolean$.call(null, function() { - var l = a.call(null, d); - return cljs.core.truth_(l) && (l = b.call(null, d), cljs.core.truth_(l) && (l = c.call(null, d), cljs.core.truth_(l) && (l = a.call(null, e), cljs.core.truth_(l) && (l = b.call(null, e), cljs.core.truth_(l) && (l = c.call(null, e), cljs.core.truth_(l) && (l = a.call(null, k), cljs.core.truth_(l))))))) ? (l = b.call(null, k), cljs.core.truth_(l) ? c.call(null, k) : l) : l - }()) + return cljs.core.boolean$(function() { + var l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return cljs.core.truth_(l) && (l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(l) && (l = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d), cljs.core.truth_(l) && (l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e), cljs.core.truth_(l) && (l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e), cljs.core.truth_(l) && + (l = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e), cljs.core.truth_(l) && (l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(k) : a.call(null, k), cljs.core.truth_(l))))))) ? (l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(k) : b.call(null, k), cljs.core.truth_(l) ? c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(k) : c.call(null, k) : l) : l; + }()); }, p = function() { var e = function(e, l, m, n) { - return cljs.core.boolean$.call(null, d.call(null, e, l, m) && cljs.core.every_QMARK_.call(null, function(d) { - var e = a.call(null, d); - return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e - }, n)) + return cljs.core.boolean$(d.cljs$core$IFn$_invoke$arity$3(e, l, m) && cljs.core.every_QMARK_(function(d) { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return cljs.core.truth_(e) ? (e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(e) ? c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d) : e) : e; + }, n)); }, l = function(a, b, c, d) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return e.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return e.call(this, a, b, c, f); }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -6997,10 +10376,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return e(b, c, d, a) + return e(b, c, d, a); }; l.cljs$core$IFn$_invoke$arity$variadic = e; - return l + return l; }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: @@ -7012,91 +10391,125 @@ cljs.core.every_pred = function() { case 3: return n.call(this, a, b, c); default: - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = p.cljs$lang$applyTo; d.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; d.cljs$core$IFn$_invoke$arity$1 = e; d.cljs$core$IFn$_invoke$arity$2 = m; d.cljs$core$IFn$_invoke$arity$3 = n; d.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return d - }() + return d; + }(); }, e = function() { var a = function(a, b, c, d) { - var e = cljs.core.list_STAR_.call(null, a, b, c, d); - return function() { - var a = null, b = function(a) { - return cljs.core.every_QMARK_.call(null, function(b) { - return b.call(null, a) - }, e) - }, c = function(a, b) { - return cljs.core.every_QMARK_.call(null, function(c) { - var d = c.call(null, a); - return cljs.core.truth_(d) ? c.call(null, b) : d - }, e) - }, d = function(a, b, c) { - return cljs.core.every_QMARK_.call(null, function(d) { - var e = d.call(null, a); - return cljs.core.truth_(e) ? (e = d.call(null, b), cljs.core.truth_(e) ? d.call(null, c) : e) : e - }, e) - }, f = function() { - var b = function(b, c, d, f) { - return cljs.core.boolean$.call(null, a.call(null, b, c, d) && cljs.core.every_QMARK_.call(null, function(a) { - return cljs.core.every_QMARK_.call(null, a, f) - }, e)) - }, c = function(a, c, d, e) { - var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, d, f) + return function(a) { + return function() { + var b = null, c = function(b) { + return cljs.core.every_QMARK_(function(a) { + return function(a) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + }; + }(a), a); + }, d = function(b, c) { + return cljs.core.every_QMARK_(function(a) { + return function(a) { + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return cljs.core.truth_(d) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) : d; + }; + }(a), a); + }, e = function(b, c, d) { + return cljs.core.every_QMARK_(function(a) { + return function(a) { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return cljs.core.truth_(e) ? (e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), cljs.core.truth_(e) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d) : e) : e; + }; + }(a), a); + }, f = function() { + var c = function(c, d, e, f) { + return cljs.core.boolean$(b.cljs$core$IFn$_invoke$arity$3(c, d, e) && cljs.core.every_QMARK_(function(a) { + return function(a) { + return cljs.core.every_QMARK_(a, f); + }; + }(a), a)); + }, d = function(a, b, d, e) { + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); + }; + d.cljs$lang$maxFixedArity = 3; + d.cljs$lang$applyTo = function(a) { + var b = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return c(b, d, e, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d; + }(), b = function(a, b, g, h) { + switch(arguments.length) { + case 0: + return!0; + case 1: + return c.call(this, a); + case 2: + return d.call(this, a, b); + case 3: + return e.call(this, a, b, g); + default: + var k = null; + if (3 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 3);k < l.length;) { + l[k] = arguments[k + 3], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, b, g, k); + } + throw Error("Invalid arity: " + arguments.length); }; - c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = function(a) { - var c = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return b(c, d, e, a) + b.cljs$lang$maxFixedArity = 3; + b.cljs$lang$applyTo = f.cljs$lang$applyTo; + b.cljs$core$IFn$_invoke$arity$0 = function() { + return!0; }; - c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), a = function(a, e, g, h) { - switch(arguments.length) { - case 0: - return!0; - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - case 3: - return d.call(this, a, e, g); - default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)) - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 3; - a.cljs$lang$applyTo = f.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a - }() + b.cljs$core$IFn$_invoke$arity$1 = c; + b.cljs$core$IFn$_invoke$arity$2 = d; + b.cljs$core$IFn$_invoke$arity$3 = e; + b.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return b; + }(); + }(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); }, b = function(b, c, d, e) { var g = null; - 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + if (3 < arguments.length) { + for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { + p[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(p, 0); + } + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -7106,10 +10519,10 @@ cljs.core.every_pred = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -7119,7 +10532,14 @@ cljs.core.every_pred = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + var l = null; + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); } throw Error("Invalid arity: " + arguments.length); }; @@ -7129,31 +10549,37 @@ cljs.core.every_pred = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.some_fn = function() { var a = null, b = function(a) { return function() { var b = null, c = function(b) { - return a.call(null, b) + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); }, d = function(b, c) { - var d = a.call(null, b); - return cljs.core.truth_(d) ? d : a.call(null, c) + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return cljs.core.truth_(d) ? d : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); }, e = function(b, c, d) { - b = a.call(null, b); - if(cljs.core.truth_(b)) { - return b + b = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + if (cljs.core.truth_(b)) { + return b; } - c = a.call(null, c); - return cljs.core.truth_(c) ? c : a.call(null, d) + c = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(c) ? c : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); }, m = function() { var c = function(c, d, e, h) { - c = b.call(null, c, d, e); - return cljs.core.truth_(c) ? c : cljs.core.some.call(null, a, h) + c = b.cljs$core$IFn$_invoke$arity$3(c, d, e); + return cljs.core.truth_(c) ? c : cljs.core.some(a, h); }, d = function(a, b, d, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -7163,10 +10589,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: @@ -7178,67 +10604,83 @@ cljs.core.some_fn = function() { case 3: return e.call(this, a, b, f); default: - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)) + var s = null; + if (3 < arguments.length) { + for (var s = 0, t = Array(arguments.length - 3);s < t.length;) { + t[s] = arguments[s + 3], ++s; + } + s = new cljs.core.IndexedSeq(t, 0); + } + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, s); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = m.cljs$lang$applyTo; b.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; b.cljs$core$IFn$_invoke$arity$1 = c; b.cljs$core$IFn$_invoke$arity$2 = d; b.cljs$core$IFn$_invoke$arity$3 = e; b.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return b - }() + return b; + }(); }, c = function(a, b) { return function() { var c = null, d = function(c) { - var d = a.call(null, c); - return cljs.core.truth_(d) ? d : b.call(null, c) + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(d) ? d : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); }, e = function(c, d) { - var e = a.call(null, c); - if(cljs.core.truth_(e)) { - return e + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + if (cljs.core.truth_(e)) { + return e; } - e = a.call(null, d); - if(cljs.core.truth_(e)) { - return e + e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + if (cljs.core.truth_(e)) { + return e; } - e = b.call(null, c); - return cljs.core.truth_(e) ? e : b.call(null, d) + e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + return cljs.core.truth_(e) ? e : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); }, m = function(c, d, e) { - var h = a.call(null, c); - if(cljs.core.truth_(h)) { - return h + var h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + if (cljs.core.truth_(h)) { + return h; } - h = a.call(null, d); - if(cljs.core.truth_(h)) { - return h + h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + if (cljs.core.truth_(h)) { + return h; } - h = a.call(null, e); - if(cljs.core.truth_(h)) { - return h + h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); + if (cljs.core.truth_(h)) { + return h; } - c = b.call(null, c); - if(cljs.core.truth_(c)) { - return c + c = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + if (cljs.core.truth_(c)) { + return c; } - d = b.call(null, d); - return cljs.core.truth_(d) ? d : b.call(null, e) + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return cljs.core.truth_(d) ? d : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e); }, n = function() { var d = function(d, e, k, l) { - d = c.call(null, d, e, k); - return cljs.core.truth_(d) ? d : cljs.core.some.call(null, function(c) { - var d = a.call(null, c); - return cljs.core.truth_(d) ? d : b.call(null, c) - }, l) + d = c.cljs$core$IFn$_invoke$arity$3(d, e, k); + return cljs.core.truth_(d) ? d : cljs.core.some(function(c) { + return function(c) { + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(d) ? d : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + }; + }(d), l); }, e = function(a, b, c, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -7248,10 +10690,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e + return e; }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: @@ -7263,95 +10705,109 @@ cljs.core.some_fn = function() { case 3: return m.call(this, a, b, c); default: - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + var g = null; + if (3 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { + h[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = n.cljs$lang$applyTo; c.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; c.cljs$core$IFn$_invoke$arity$1 = d; c.cljs$core$IFn$_invoke$arity$2 = e; c.cljs$core$IFn$_invoke$arity$3 = m; c.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return c - }() + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function(d) { - var e = a.call(null, d); - if(cljs.core.truth_(e)) { - return e + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + if (cljs.core.truth_(e)) { + return e; } - e = b.call(null, d); - return cljs.core.truth_(e) ? e : c.call(null, d) + e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return cljs.core.truth_(e) ? e : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); }, m = function(d, e) { - var k = a.call(null, d); - if(cljs.core.truth_(k)) { - return k + var k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + if (cljs.core.truth_(k)) { + return k; } - k = b.call(null, d); - if(cljs.core.truth_(k)) { - return k + k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + if (cljs.core.truth_(k)) { + return k; } - k = c.call(null, d); - if(cljs.core.truth_(k)) { - return k + k = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); + if (cljs.core.truth_(k)) { + return k; } - k = a.call(null, e); - if(cljs.core.truth_(k)) { - return k + k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); + if (cljs.core.truth_(k)) { + return k; } - k = b.call(null, e); - return cljs.core.truth_(k) ? k : c.call(null, e) + k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e); + return cljs.core.truth_(k) ? k : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e); }, n = function(d, e, k) { - var l = a.call(null, d); - if(cljs.core.truth_(l)) { - return l + var l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + if (cljs.core.truth_(l)) { + return l; } - l = b.call(null, d); - if(cljs.core.truth_(l)) { - return l + l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + if (cljs.core.truth_(l)) { + return l; } - d = c.call(null, d); - if(cljs.core.truth_(d)) { - return d + d = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); + if (cljs.core.truth_(d)) { + return d; } - d = a.call(null, e); - if(cljs.core.truth_(d)) { - return d + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); + if (cljs.core.truth_(d)) { + return d; } - d = b.call(null, e); - if(cljs.core.truth_(d)) { - return d + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e); + if (cljs.core.truth_(d)) { + return d; } - e = c.call(null, e); - if(cljs.core.truth_(e)) { - return e + e = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e); + if (cljs.core.truth_(e)) { + return e; } - e = a.call(null, k); - if(cljs.core.truth_(e)) { - return e + e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(k) : a.call(null, k); + if (cljs.core.truth_(e)) { + return e; } - e = b.call(null, k); - return cljs.core.truth_(e) ? e : c.call(null, k) + e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(k) : b.call(null, k); + return cljs.core.truth_(e) ? e : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(k) : c.call(null, k); }, p = function() { var e = function(e, l, m, n) { - e = d.call(null, e, l, m); - return cljs.core.truth_(e) ? e : cljs.core.some.call(null, function(d) { - var e = a.call(null, d); - if(cljs.core.truth_(e)) { - return e - } - e = b.call(null, d); - return cljs.core.truth_(e) ? e : c.call(null, d) - }, n) + e = d.cljs$core$IFn$_invoke$arity$3(e, l, m); + return cljs.core.truth_(e) ? e : cljs.core.some(function(d) { + return function(d) { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + if (cljs.core.truth_(e)) { + return e; + } + e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + return cljs.core.truth_(e) ? e : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); + }; + }(e), n); }, l = function(a, b, c, d) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return e.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return e.call(this, a, b, c, f); }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -7361,10 +10817,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return e(b, c, d, a) + return e(b, c, d, a); }; l.cljs$core$IFn$_invoke$arity$variadic = e; - return l + return l; }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: @@ -7376,96 +10832,130 @@ cljs.core.some_fn = function() { case 3: return n.call(this, a, b, c); default: - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = p.cljs$lang$applyTo; d.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; d.cljs$core$IFn$_invoke$arity$1 = e; d.cljs$core$IFn$_invoke$arity$2 = m; d.cljs$core$IFn$_invoke$arity$3 = n; d.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return d - }() + return d; + }(); }, e = function() { var a = function(a, b, c, d) { - var e = cljs.core.list_STAR_.call(null, a, b, c, d); - return function() { - var a = null, b = function(a) { - return cljs.core.some.call(null, function(b) { - return b.call(null, a) - }, e) - }, c = function(a, b) { - return cljs.core.some.call(null, function(c) { - var d = c.call(null, a); - return cljs.core.truth_(d) ? d : c.call(null, b) - }, e) - }, d = function(a, b, c) { - return cljs.core.some.call(null, function(d) { - var e = d.call(null, a); - if(cljs.core.truth_(e)) { - return e + return function(a) { + return function() { + var b = null, c = function(b) { + return cljs.core.some(function(a) { + return function(a) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + }; + }(a), a); + }, d = function(b, c) { + return cljs.core.some(function(a) { + return function(a) { + var d; + d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return cljs.core.truth_(d) ? d : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + }; + }(a), a); + }, e = function(b, c, d) { + return cljs.core.some(function(a) { + return function(a) { + var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + if (cljs.core.truth_(e)) { + return e; + } + e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return cljs.core.truth_(e) ? e : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + }; + }(a), a); + }, f = function() { + var c = function(c, d, e, f) { + c = b.cljs$core$IFn$_invoke$arity$3(c, d, e); + return cljs.core.truth_(c) ? c : cljs.core.some(function(a, b) { + return function(a) { + return cljs.core.some(a, f); + }; + }(c, a), a); + }, d = function(a, b, d, e) { + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); + }; + d.cljs$lang$maxFixedArity = 3; + d.cljs$lang$applyTo = function(a) { + var b = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return c(b, d, e, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d; + }(), b = function(a, b, g, h) { + switch(arguments.length) { + case 0: + return null; + case 1: + return c.call(this, a); + case 2: + return d.call(this, a, b); + case 3: + return e.call(this, a, b, g); + default: + var k = null; + if (3 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 3);k < l.length;) { + l[k] = arguments[k + 3], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, b, g, k); } - e = d.call(null, b); - return cljs.core.truth_(e) ? e : d.call(null, c) - }, e) - }, f = function() { - var b = function(b, c, d, f) { - b = a.call(null, b, c, d); - return cljs.core.truth_(b) ? b : cljs.core.some.call(null, function(a) { - return cljs.core.some.call(null, a, f) - }, e) - }, c = function(a, c, d, e) { - var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, d, f) + throw Error("Invalid arity: " + arguments.length); }; - c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = function(a) { - var c = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return b(c, d, e, a) + b.cljs$lang$maxFixedArity = 3; + b.cljs$lang$applyTo = f.cljs$lang$applyTo; + b.cljs$core$IFn$_invoke$arity$0 = function() { + return null; }; - c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), a = function(a, e, g, h) { - switch(arguments.length) { - case 0: - return null; - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - case 3: - return d.call(this, a, e, g); - default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)) - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 3; - a.cljs$lang$applyTo = f.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$0 = function() { - return null - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a - }() + b.cljs$core$IFn$_invoke$arity$1 = c; + b.cljs$core$IFn$_invoke$arity$2 = d; + b.cljs$core$IFn$_invoke$arity$3 = e; + b.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return b; + }(); + }(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); }, b = function(b, c, d, e) { var g = null; - 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + if (3 < arguments.length) { + for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { + p[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(p, 0); + } + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -7475,10 +10965,10 @@ cljs.core.some_fn = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -7488,7 +10978,14 @@ cljs.core.some_fn = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + var l = null; + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); } throw Error("Invalid arity: " + arguments.length); }; @@ -7498,51 +10995,135 @@ cljs.core.some_fn = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.map = function() { - var a = null, b = function(b, c) { + var a = null, b = function(a) { + return function(b) { + return function() { + var c = null, d = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, e = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, f = function(c, d) { + var e; + e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, e) : b.call(null, c, e); + }, p = function() { + var c = function(c, d, e) { + d = cljs.core.apply.cljs$core$IFn$_invoke$arity$3(a, d, e); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); + }, d = function(a, b, d) { + var e = null; + if (2 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 2);e < f.length;) { + f[e] = arguments[e + 2], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return c.call(this, a, b, e); + }; + d.cljs$lang$maxFixedArity = 2; + d.cljs$lang$applyTo = function(a) { + var b = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.rest(a); + return c(b, d, a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d; + }(), c = function(a, b, c) { + switch(arguments.length) { + case 0: + return d.call(this); + case 1: + return e.call(this, a); + case 2: + return f.call(this, a, b); + default: + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, g); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$lang$maxFixedArity = 2; + c.cljs$lang$applyTo = p.cljs$lang$applyTo; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = e; + c.cljs$core$IFn$_invoke$arity$2 = f; + c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; + return c; + }(); + }; + }, c = function(b, c) { return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, c); - if(d) { - if(cljs.core.chunked_seq_QMARK_.call(null, d)) { - for(var e = cljs.core.chunk_first.call(null, d), l = cljs.core.count.call(null, e), m = cljs.core.chunk_buffer.call(null, l), n = 0;;) { - if(n < l) { - cljs.core.chunk_append.call(null, m, b.call(null, cljs.core._nth.call(null, e, n))), n += 1 - }else { - break + var d = cljs.core.seq(c); + if (d) { + if (cljs.core.chunked_seq_QMARK_(d)) { + for (var e = cljs.core.chunk_first(d), f = cljs.core.count(e), n = cljs.core.chunk_buffer(f), p = 0;;) { + if (p < f) { + cljs.core.chunk_append(n, function() { + var a = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, p); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }()), p += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, m), a.call(null, b, cljs.core.chunk_rest.call(null, d))) + return cljs.core.chunk_cons(cljs.core.chunk(n), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.chunk_rest(d))); } - return cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, d)), a.call(null, b, cljs.core.rest.call(null, d))) + return cljs.core.cons(function() { + var a = cljs.core.first(d); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }(), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(d))); } - return null - }, null, null) - }, c = function(b, c, d) { + return null; + }, null, null); + }, d = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var e = cljs.core.seq.call(null, c), l = cljs.core.seq.call(null, d); - return e && l ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, e), cljs.core.first.call(null, l)), a.call(null, b, cljs.core.rest.call(null, e), cljs.core.rest.call(null, l))) : null - }, null, null) - }, d = function(b, c, d, e) { + var e = cljs.core.seq(c), f = cljs.core.seq(d); + return e && f ? cljs.core.cons(function() { + var a = cljs.core.first(e), c = cljs.core.first(f); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(a, c) : b.call(null, a, c); + }(), a.cljs$core$IFn$_invoke$arity$3(b, cljs.core.rest(e), cljs.core.rest(f))) : null; + }, null, null); + }, e = function(b, c, d, e) { return new cljs.core.LazySeq(null, function() { - var l = cljs.core.seq.call(null, c), m = cljs.core.seq.call(null, d), n = cljs.core.seq.call(null, e); - return l && m && n ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, l), cljs.core.first.call(null, m), cljs.core.first.call(null, n)), a.call(null, b, cljs.core.rest.call(null, l), cljs.core.rest.call(null, m), cljs.core.rest.call(null, n))) : null - }, null, null) - }, e = function() { + var f = cljs.core.seq(c), n = cljs.core.seq(d), p = cljs.core.seq(e); + return f && n && p ? cljs.core.cons(function() { + var a = cljs.core.first(f), c = cljs.core.first(n), d = cljs.core.first(p); + return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(a, c, d) : b.call(null, a, c, d); + }(), a.cljs$core$IFn$_invoke$arity$4(b, cljs.core.rest(f), cljs.core.rest(n), cljs.core.rest(p))) : null; + }, null, null); + }, f = function() { var b = function(b, c, d, e, f) { - return a.call(null, function(a) { - return cljs.core.apply.call(null, b, a) - }, function q(b) { + var g = function s(b) { return new cljs.core.LazySeq(null, function() { - var c = a.call(null, cljs.core.seq, b); - return cljs.core.every_QMARK_.call(null, cljs.core.identity, c) ? cljs.core.cons.call(null, a.call(null, cljs.core.first, c), q.call(null, a.call(null, cljs.core.rest, c))) : null - }, null, null) - }.call(null, cljs.core.conj.call(null, f, e, d, c))) - }, c = function(a, c, d, e, g) { - var p = null; - 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return b.call(this, a, c, d, e, p) + var c = a.cljs$core$IFn$_invoke$arity$2(cljs.core.seq, b); + return cljs.core.every_QMARK_(cljs.core.identity, c) ? cljs.core.cons(a.cljs$core$IFn$_invoke$arity$2(cljs.core.first, c), s(a.cljs$core$IFn$_invoke$arity$2(cljs.core.rest, c))) : null; + }, null, null); + }; + return a.cljs$core$IFn$_invoke$arity$2(function(a) { + return function(a) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(b, a); + }; + }(g), g(cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(f, e, cljs.core.array_seq([d, c], 0)))); + }, c = function(a, c, d, e, f) { + var h = null; + if (4 < arguments.length) { + for (var h = 0, r = Array(arguments.length - 4);h < r.length;) { + r[h] = arguments[h + 4], ++h; + } + h = new cljs.core.IndexedSeq(r, 0); + } + return b.call(this, a, c, d, e, h); }; c.cljs$lang$maxFixedArity = 4; c.cljs$lang$applyTo = function(a) { @@ -7552,181 +11133,331 @@ cljs.core.map = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.next(a); - var g = cljs.core.first(a); + var f = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, g, a) + return b(c, d, e, f, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), a = function(a, g, h, k, l) { + return c; + }(), a = function(a, h, k, l, m) { switch(arguments.length) { + case 1: + return b.call(this, a); case 2: - return b.call(this, a, g); + return c.call(this, a, h); case 3: - return c.call(this, a, g, h); + return d.call(this, a, h, k); case 4: - return d.call(this, a, g, h, k); + return e.call(this, a, h, k, l); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) + var n = null; + if (4 < arguments.length) { + for (var n = 0, p = Array(arguments.length - 4);n < p.length;) { + p[n] = arguments[n + 4], ++n; + } + n = new cljs.core.IndexedSeq(p, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, n); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 4; - a.cljs$lang$applyTo = e.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - a.cljs$core$IFn$_invoke$arity$4 = d; - a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + a.cljs$lang$applyTo = f.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$3 = d; + a.cljs$core$IFn$_invoke$arity$4 = e; + a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return a; }(); -cljs.core.take = function take(b, c) { - return new cljs.core.LazySeq(null, function() { - if(0 < b) { - var d = cljs.core.seq.call(null, c); - return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take.call(null, b - 1, cljs.core.rest.call(null, d))) : null +cljs.core.take = function() { + var a = null, b = function(a) { + return function(b) { + return function(a) { + return function() { + var c = null, d = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(c, d) { + var g = cljs.core.deref(a), h = a.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, a.cljs$core$IDeref$_deref$arity$1(null) - 1), g = 0 < g ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d) : c; + return 0 < h ? g : cljs.core.ensure_reduced(g); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return d.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = k; + c.cljs$core$IFn$_invoke$arity$2 = l; + return c; + }(); + }(cljs.core.volatile_BANG_(a)); + }; + }, c = function(b, c) { + return new cljs.core.LazySeq(null, function() { + if (0 < b) { + var f = cljs.core.seq(c); + return f ? cljs.core.cons(cljs.core.first(f), a.cljs$core$IFn$_invoke$arity$2(b - 1, cljs.core.rest(f))) : null; + } + return null; + }, null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); } - return null - }, null, null) -}; -cljs.core.drop = function(a, b) { - var c = function(a, b) { - for(;;) { - var c = cljs.core.seq.call(null, b); - if(0 < a && c) { - var g = a - 1, c = cljs.core.rest.call(null, c); - a = g; - b = c - }else { - return c + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.drop = function() { + var a = null, b = function(a) { + return function(b) { + return function(a) { + return function() { + var c = null, d = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(c, d) { + var g = cljs.core.deref(a); + a.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, a.cljs$core$IDeref$_deref$arity$1(null) - 1); + return 0 < g ? c : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return d.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = k; + c.cljs$core$IFn$_invoke$arity$2 = l; + return c; + }(); + }(cljs.core.volatile_BANG_(a)); + }; + }, c = function(a, b) { + return new cljs.core.LazySeq(null, function(c) { + return function() { + return c(a, b); + }; + }(function(a, b) { + for (;;) { + var c = cljs.core.seq(b); + if (0 < a && c) { + var d = a - 1, c = cljs.core.rest(c); + a = d; + b = c; + } else { + return c; + } } + }), null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); } + throw Error("Invalid arity: " + arguments.length); }; - return new cljs.core.LazySeq(null, function() { - return c.call(null, a, b) - }, null, null) -}; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); cljs.core.drop_last = function() { var a = null, b = function(b) { - return a.call(null, 1, b) + return a.cljs$core$IFn$_invoke$arity$2(1, b); }, c = function(a, b) { - return cljs.core.map.call(null, function(a, b) { - return a - }, b, cljs.core.drop.call(null, a, b)) + return cljs.core.map.cljs$core$IFn$_invoke$arity$3(function(a, b) { + return a; + }, b, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(a, b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.take_last = function(a, b) { - for(var c = cljs.core.seq.call(null, b), d = cljs.core.seq.call(null, cljs.core.drop.call(null, a, b));;) { - if(d) { - c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d) - }else { - return c + for (var c = cljs.core.seq(b), d = cljs.core.seq(cljs.core.drop.cljs$core$IFn$_invoke$arity$2(a, b));;) { + if (d) { + c = cljs.core.next(c), d = cljs.core.next(d); + } else { + return c; } } }; -cljs.core.drop_while = function(a, b) { - var c = function(a, b) { - for(;;) { - var c = cljs.core.seq.call(null, b); - if(cljs.core.truth_(function() { - var b = c; - return b ? a.call(null, cljs.core.first.call(null, c)) : b - }())) { - var g = a, h = cljs.core.rest.call(null, c); - a = g; - b = h - }else { - return c +cljs.core.drop_while = function() { + var a = null, b = function(a) { + return function(b) { + return function(c) { + return function() { + var g = null, h = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(g, h) { + var k = cljs.core.deref(c); + if (cljs.core.truth_(cljs.core.truth_(k) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(h) : a.call(null, h) : k)) { + return g; + } + cljs.core.vreset_BANG_(c, null); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, h) : b.call(null, g, h); + }, g = function(a, b) { + switch(arguments.length) { + case 0: + return h.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + g.cljs$core$IFn$_invoke$arity$0 = h; + g.cljs$core$IFn$_invoke$arity$1 = k; + g.cljs$core$IFn$_invoke$arity$2 = l; + return g; + }(); + }(cljs.core.volatile_BANG_(!0)); + }; + }, c = function(a, b) { + return new cljs.core.LazySeq(null, function(c) { + return function() { + return c(a, b); + }; + }(function(a, b) { + for (;;) { + var c = cljs.core.seq(b); + if (cljs.core.truth_(function() { + var b = c; + return b ? (b = cljs.core.first(c), a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)) : b; + }())) { + var d = a, e = cljs.core.rest(c); + a = d; + b = e; + } else { + return c; + } } + }), null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); } + throw Error("Invalid arity: " + arguments.length); }; - return new cljs.core.LazySeq(null, function() { - return c.call(null, a, b) - }, null, null) -}; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); cljs.core.cycle = function cycle(b) { return new cljs.core.LazySeq(null, function() { - var c = cljs.core.seq.call(null, b); - return c ? cljs.core.concat.call(null, c, cycle.call(null, c)) : null - }, null, null) + var c = cljs.core.seq(b); + return c ? cljs.core.concat.cljs$core$IFn$_invoke$arity$2(c, cycle(c)) : null; + }, null, null); }; cljs.core.split_at = function(a, b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take.call(null, a, b), cljs.core.drop.call(null, a, b)], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take.cljs$core$IFn$_invoke$arity$2(a, b), cljs.core.drop.cljs$core$IFn$_invoke$arity$2(a, b)], null); }; cljs.core.repeat = function() { var a = null, b = function(b) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, b, a.call(null, b)) - }, null, null) + return cljs.core.cons(b, a.cljs$core$IFn$_invoke$arity$1(b)); + }, null, null); }, c = function(b, c) { - return cljs.core.take.call(null, b, a.call(null, c)) + return cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, a.cljs$core$IFn$_invoke$arity$1(c)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.replicate = function(a, b) { - return cljs.core.take.call(null, a, cljs.core.repeat.call(null, b)) + return cljs.core.take.cljs$core$IFn$_invoke$arity$2(a, cljs.core.repeat.cljs$core$IFn$_invoke$arity$1(b)); }; cljs.core.repeatedly = function() { var a = null, b = function(b) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, b.call(null), a.call(null, b)) - }, null, null) + return cljs.core.cons(b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null), a.cljs$core$IFn$_invoke$arity$1(b)); + }, null, null); }, c = function(b, c) { - return cljs.core.take.call(null, b, a.call(null, c)) + return cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, a.cljs$core$IFn$_invoke$arity$1(c)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.iterate = function iterate(b, c) { - return cljs.core.cons.call(null, c, new cljs.core.LazySeq(null, function() { - return iterate.call(null, b, b.call(null, c)) - }, null, null)) + return cljs.core.cons(c, new cljs.core.LazySeq(null, function() { + var d; + d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + return iterate(b, d); + }, null, null)); }; cljs.core.interleave = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq.call(null, b), g = cljs.core.seq.call(null, c); - return f && g ? cljs.core.cons.call(null, cljs.core.first.call(null, f), cljs.core.cons.call(null, cljs.core.first.call(null, g), a.call(null, cljs.core.rest.call(null, f), cljs.core.rest.call(null, g)))) : null - }, null, null) + var f = cljs.core.seq(b), g = cljs.core.seq(c); + return f && g ? cljs.core.cons(cljs.core.first(f), cljs.core.cons(cljs.core.first(g), a.cljs$core$IFn$_invoke$arity$2(cljs.core.rest(f), cljs.core.rest(g)))) : null; + }, null, null); }, c = function() { var b = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var e = cljs.core.map.call(null, cljs.core.seq, cljs.core.conj.call(null, d, c, b)); - return cljs.core.every_QMARK_.call(null, cljs.core.identity, e) ? cljs.core.concat.call(null, cljs.core.map.call(null, cljs.core.first, e), cljs.core.apply.call(null, a, cljs.core.map.call(null, cljs.core.rest, e))) : null - }, null, null) + var e = cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.seq, cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(d, c, cljs.core.array_seq([b], 0))); + return cljs.core.every_QMARK_(cljs.core.identity, e) ? cljs.core.concat.cljs$core$IFn$_invoke$arity$2(cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.first, e), cljs.core.apply.cljs$core$IFn$_invoke$arity$2(a, cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.rest, e))) : null; + }, null, null); }, c = function(a, c, e) { var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + if (2 < arguments.length) { + for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { + l[k] = arguments[k + 2], ++k; + } + k = new cljs.core.IndexedSeq(l, 0); + } + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -7734,16 +11465,23 @@ cljs.core.interleave = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var g = null; + if (2 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { + h[g] = arguments[g + 2], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); } throw Error("Invalid arity: " + arguments.length); }; @@ -7751,110 +11489,244 @@ cljs.core.interleave = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; +}(); +cljs.core.interpose = function() { + var a = null, b = function(a) { + return function(b) { + return function(c) { + return function() { + var g = null, h = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(g, h) { + if (cljs.core.truth_(cljs.core.deref(c))) { + var k; + k = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, a) : b.call(null, g, a); + return cljs.core.reduced_QMARK_(k) ? k : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(k, h) : b.call(null, k, h); + } + cljs.core.vreset_BANG_(c, !0); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, h) : b.call(null, g, h); + }, g = function(a, b) { + switch(arguments.length) { + case 0: + return h.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + g.cljs$core$IFn$_invoke$arity$0 = h; + g.cljs$core$IFn$_invoke$arity$1 = k; + g.cljs$core$IFn$_invoke$arity$2 = l; + return g; + }(); + }(cljs.core.volatile_BANG_(!1)); + }; + }, c = function(a, b) { + return cljs.core.drop.cljs$core$IFn$_invoke$arity$2(1, cljs.core.interleave.cljs$core$IFn$_invoke$arity$2(cljs.core.repeat.cljs$core$IFn$_invoke$arity$1(a), b)); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; }(); -cljs.core.interpose = function(a, b) { - return cljs.core.drop.call(null, 1, cljs.core.interleave.call(null, cljs.core.repeat.call(null, a), b)) -}; cljs.core.flatten1 = function(a) { return function c(a, e) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq.call(null, a); - return f ? cljs.core.cons.call(null, cljs.core.first.call(null, f), c.call(null, cljs.core.rest.call(null, f), e)) : cljs.core.seq.call(null, e) ? c.call(null, cljs.core.first.call(null, e), cljs.core.rest.call(null, e)) : null - }, null, null) - }.call(null, null, a) + var f = cljs.core.seq(a); + return f ? cljs.core.cons(cljs.core.first(f), c(cljs.core.rest(f), e)) : cljs.core.seq(e) ? c(cljs.core.first(e), cljs.core.rest(e)) : null; + }, null, null); + }(null, a); }; cljs.core.mapcat = function() { - var a = null, b = function(a, b) { - return cljs.core.flatten1.call(null, cljs.core.map.call(null, a, b)) + var a = null, b = function(a) { + return cljs.core.comp.cljs$core$IFn$_invoke$arity$2(cljs.core.map.cljs$core$IFn$_invoke$arity$1(a), cljs.core.cat); }, c = function() { - var a = function(a, b, c) { - return cljs.core.flatten1.call(null, cljs.core.apply.call(null, cljs.core.map, a, b, c)) - }, b = function(b, c, e) { - var k = null; - 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, c, k) + var a = function(a, b) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.concat, cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.map, a, b)); + }, b = function(b, c) { + var e = null; + if (1 < arguments.length) { + for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { + k[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, e); }; - b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b) + return a(c, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }(), a = function(a, e, f) { + return b; + }(), a = function(a, e) { switch(arguments.length) { - case 2: - return b.call(this, a, e); + case 1: + return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + var f = null; + if (1 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { + g[f] = arguments[f + 1], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, f); } throw Error("Invalid arity: " + arguments.length); }; - a.cljs$lang$maxFixedArity = 2; + a.cljs$lang$maxFixedArity = 1; a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); -cljs.core.filter = function filter(b, c) { - return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, c); - if(d) { - if(cljs.core.chunked_seq_QMARK_.call(null, d)) { - for(var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { - if(h < f) { - cljs.core.truth_(b.call(null, cljs.core._nth.call(null, e, h))) && cljs.core.chunk_append.call(null, g, cljs.core._nth.call(null, e, h)), h += 1 - }else { - break +cljs.core.filter = function() { + var a = null, b = function(a) { + return function(b) { + return function() { + var c = null, g = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, h = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, k = function(c, f) { + return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f)) ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, f) : b.call(null, c, f) : c; + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return g.call(this); + case 1: + return h.call(this, a); + case 2: + return k.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = g; + c.cljs$core$IFn$_invoke$arity$1 = h; + c.cljs$core$IFn$_invoke$arity$2 = k; + return c; + }(); + }; + }, c = function(b, c) { + return new cljs.core.LazySeq(null, function() { + var f = cljs.core.seq(c); + if (f) { + if (cljs.core.chunked_seq_QMARK_(f)) { + for (var g = cljs.core.chunk_first(f), h = cljs.core.count(g), k = cljs.core.chunk_buffer(h), l = 0;;) { + if (l < h) { + cljs.core.truth_(function() { + var a = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(g, l); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }()) && cljs.core.chunk_append(k, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(g, l)), l += 1; + } else { + break; + } } + return cljs.core.chunk_cons(cljs.core.chunk(k), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.chunk_rest(f))); } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), filter.call(null, b, cljs.core.chunk_rest.call(null, d))) + h = cljs.core.first(f); + f = cljs.core.rest(f); + return cljs.core.truth_(b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(h) : b.call(null, h)) ? cljs.core.cons(h, a.cljs$core$IFn$_invoke$arity$2(b, f)) : a.cljs$core$IFn$_invoke$arity$2(b, f); } - e = cljs.core.first.call(null, d); - d = cljs.core.rest.call(null, d); - return cljs.core.truth_(b.call(null, e)) ? cljs.core.cons.call(null, e, filter.call(null, b, d)) : filter.call(null, b, d) + return null; + }, null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); } - return null - }, null, null) -}; -cljs.core.remove = function(a, b) { - return cljs.core.filter.call(null, cljs.core.complement.call(null, a), b) -}; + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.remove = function() { + var a = null, b = function(a) { + return cljs.core.filter.cljs$core$IFn$_invoke$arity$1(cljs.core.complement(a)); + }, c = function(a, b) { + return cljs.core.filter.cljs$core$IFn$_invoke$arity$2(cljs.core.complement(a), b); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); cljs.core.tree_seq = function(a, b, c) { return function e(c) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, c, cljs.core.truth_(a.call(null, c)) ? cljs.core.mapcat.call(null, e, b.call(null, c)) : null) - }, null, null) - }.call(null, c) + return cljs.core.cons(c, cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)) ? cljs.core.mapcat.cljs$core$IFn$_invoke$arity$variadic(e, cljs.core.array_seq([b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c)], 0)) : null); + }, null, null); + }(c); }; cljs.core.flatten = function(a) { - return cljs.core.filter.call(null, function(a) { - return!cljs.core.sequential_QMARK_.call(null, a) - }, cljs.core.rest.call(null, cljs.core.tree_seq.call(null, cljs.core.sequential_QMARK_, cljs.core.seq, a))) -}; -cljs.core.into = function(a, b) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core.transient$.call(null, a), b)) : cljs.core.reduce.call(null, cljs.core._conj, a, b) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, b) + return cljs.core.filter.cljs$core$IFn$_invoke$arity$2(function(a) { + return!cljs.core.sequential_QMARK_(a); + }, cljs.core.rest(cljs.core.tree_seq(cljs.core.sequential_QMARK_, cljs.core.seq, a))); }; +cljs.core.into = function() { + var a = null, b = function(a, b) { + return null != a ? a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.with_meta(cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj_BANG_, cljs.core.transient$(a), b)), cljs.core.meta(a)) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, a, b) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj, cljs.core.List.EMPTY, b); + }, c = function(a, b, c) { + return a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.with_meta(cljs.core.persistent_BANG_(cljs.core.transduce.cljs$core$IFn$_invoke$arity$4(b, cljs.core.conj_BANG_, cljs.core.transient$(a), c)), cljs.core.meta(a)) : cljs.core.transduce.cljs$core$IFn$_invoke$arity$4(b, cljs.core.conj, a, c); + }, a = function(a, e, f) { + switch(arguments.length) { + case 2: + return b.call(this, a, e); + case 3: + return c.call(this, a, e, f); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + return a; +}(); cljs.core.mapv = function() { var a = null, b = function(a, b) { - return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(b, c) { - return cljs.core.conj_BANG_.call(null, b, a.call(null, c)) - }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)) + return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, c) { + return cljs.core.conj_BANG_.cljs$core$IFn$_invoke$arity$2(b, a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)); + }, cljs.core.transient$(cljs.core.PersistentVector.EMPTY), b)); }, c = function(a, b, c) { - return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c)) + return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY, cljs.core.map.cljs$core$IFn$_invoke$arity$3(a, b, c)); }, d = function(a, b, c, d) { - return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c, d)) + return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY, cljs.core.map.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); }, e = function() { var a = function(a, b, c, d, e) { - return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.apply.call(null, cljs.core.map, a, b, c, d, e)) + return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(cljs.core.map, a, b, c, d, cljs.core.array_seq([e], 0))); }, b = function(b, c, d, e, g) { var p = null; - 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return a.call(this, b, c, d, e, p) + if (4 < arguments.length) { + for (var p = 0, q = Array(arguments.length - 4);p < q.length;) { + q[p] = arguments[p + 4], ++p; + } + p = new cljs.core.IndexedSeq(q, 0); + } + return a.call(this, b, c, d, e, p); }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -7866,10 +11738,10 @@ cljs.core.mapv = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, g, b) + return a(c, d, e, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 2: @@ -7879,7 +11751,14 @@ cljs.core.mapv = function() { case 4: return d.call(this, a, g, h, k); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) + var m = null; + if (4 < arguments.length) { + for (var m = 0, n = Array(arguments.length - 4);m < n.length;) { + n[m] = arguments[m + 4], ++m; + } + m = new cljs.core.IndexedSeq(n, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, m); } throw Error("Invalid arity: " + arguments.length); }; @@ -7889,34 +11768,34 @@ cljs.core.mapv = function() { a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.filterv = function(a, b) { - return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(b, d) { - return cljs.core.truth_(a.call(null, d)) ? cljs.core.conj_BANG_.call(null, b, d) : b - }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)) + return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, d) { + return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d)) ? cljs.core.conj_BANG_.cljs$core$IFn$_invoke$arity$2(b, d) : b; + }, cljs.core.transient$(cljs.core.PersistentVector.EMPTY), b)); }; cljs.core.partition = function() { var a = null, b = function(b, c) { - return a.call(null, b, b, c) + return a.cljs$core$IFn$_invoke$arity$3(b, b, c); }, c = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var h = cljs.core.seq.call(null, d); - if(h) { - var k = cljs.core.take.call(null, b, h); - return b === cljs.core.count.call(null, k) ? cljs.core.cons.call(null, k, a.call(null, b, c, cljs.core.drop.call(null, c, h))) : null + var h = cljs.core.seq(d); + if (h) { + var k = cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, h); + return b === cljs.core.count(k) ? cljs.core.cons(k, a.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(c, h))) : null; } - return null - }, null, null) + return null; + }, null, null); }, d = function(b, c, d, h) { return new cljs.core.LazySeq(null, function() { - var k = cljs.core.seq.call(null, h); - if(k) { - var l = cljs.core.take.call(null, b, k); - return b === cljs.core.count.call(null, l) ? cljs.core.cons.call(null, l, a.call(null, b, c, d, cljs.core.drop.call(null, c, k))) : cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.core.take.call(null, b, cljs.core.concat.call(null, l, d))) + var k = cljs.core.seq(h); + if (k) { + var l = cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, k); + return b === cljs.core.count(l) ? cljs.core.cons(l, a.cljs$core$IFn$_invoke$arity$4(b, c, d, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(c, k))) : cljs.core._conj(cljs.core.List.EMPTY, cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, cljs.core.concat.cljs$core$IFn$_invoke$arity$2(l, d))); } - return null - }, null, null) + return null; + }, null, null); }, a = function(a, f, g, h) { switch(arguments.length) { case 2: @@ -7924,34 +11803,34 @@ cljs.core.partition = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.get_in = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, null) + return a.cljs$core$IFn$_invoke$arity$3(b, c, null); }, c = function(a, b, c) { var g = cljs.core.lookup_sentinel; - for(b = cljs.core.seq.call(null, b);;) { - if(b) { + for (b = cljs.core.seq(b);;) { + if (b) { var h = a; - if(h ? h.cljs$lang$protocol_mask$partition0$ & 256 || h.cljs$core$ILookup$ || (h.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) { - a = cljs.core.get.call(null, a, cljs.core.first.call(null, b), g); - if(g === a) { - return c + if (h ? h.cljs$lang$protocol_mask$partition0$ & 256 || h.cljs$core$ILookup$ || (h.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, h)) : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, h)) { + a = cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, cljs.core.first(b), g); + if (g === a) { + return c; } - b = cljs.core.next.call(null, b) - }else { - return c + b = cljs.core.next(b); + } else { + return c; } - }else { - return a + } else { + return a; } } }, a = function(a, e, f) { @@ -7959,39 +11838,56 @@ cljs.core.get_in = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.assoc_in = function assoc_in(b, c, d) { - var e = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, assoc_in.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d) + var e = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, assoc_in(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e), c, d)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, d); }; cljs.core.update_in = function() { var a = null, b = function(b, c, d) { - var e = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d.call(null, cljs.core.get.call(null, b, e))) + var e = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, a.cljs$core$IFn$_invoke$arity$3(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e), c, d)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, function() { + var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e); + return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(a) : d.call(null, a); + }()); }, c = function(b, c, d, e) { - var f = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, f, a.call(null, cljs.core.get.call(null, b, f), c, d, e)) : cljs.core.assoc.call(null, b, f, d.call(null, cljs.core.get.call(null, b, f), e)) + var f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, f, a.cljs$core$IFn$_invoke$arity$4(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, f), c, d, e)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, f, function() { + var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, f); + return d.cljs$core$IFn$_invoke$arity$2 ? d.cljs$core$IFn$_invoke$arity$2(a, e) : d.call(null, a, e); + }()); }, d = function(b, c, d, e, f) { - var n = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, n, a.call(null, cljs.core.get.call(null, b, n), c, d, e, f)) : cljs.core.assoc.call(null, b, n, d.call(null, cljs.core.get.call(null, b, n), e, f)) + var n = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, n, a.cljs$core$IFn$_invoke$arity$5(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, n), c, d, e, f)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, n, function() { + var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, n); + return d.cljs$core$IFn$_invoke$arity$3 ? d.cljs$core$IFn$_invoke$arity$3(a, e, f) : d.call(null, a, e, f); + }()); }, e = function(b, c, d, e, f, n) { - var p = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, p, a.call(null, cljs.core.get.call(null, b, p), c, d, e, f, n)) : cljs.core.assoc.call(null, b, p, d.call(null, cljs.core.get.call(null, b, p), e, f, n)) + var p = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, p, a.cljs$core$IFn$_invoke$arity$6(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, p), c, d, e, f, n)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, p, function() { + var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, p); + return d.cljs$core$IFn$_invoke$arity$4 ? d.cljs$core$IFn$_invoke$arity$4(a, e, f, n) : d.call(null, a, e, f, n); + }()); }, f = function() { var b = function(b, c, d, e, f, g, h) { - var s = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, a, cljs.core.get.call(null, b, s), c, d, e, f, g, h)) : cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, d, cljs.core.get.call(null, b, s), e, f, g, h)) + var s = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, s, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, s), c, d, e, cljs.core.array_seq([f, g, h], 0))) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, s, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(d, cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, s), e, f, g, cljs.core.array_seq([h], 0))); }, c = function(a, c, d, e, f, h, r) { var s = null; - 6 < arguments.length && (s = cljs.core.array_seq(Array.prototype.slice.call(arguments, 6), 0)); - return b.call(this, a, c, d, e, f, h, s) + if (6 < arguments.length) { + for (var s = 0, t = Array(arguments.length - 6);s < t.length;) { + t[s] = arguments[s + 6], ++s; + } + s = new cljs.core.IndexedSeq(t, 0); + } + return b.call(this, a, c, d, e, f, h, s); }; c.cljs$lang$maxFixedArity = 6; c.cljs$lang$applyTo = function(a) { @@ -8007,10 +11903,93 @@ cljs.core.update_in = function() { a = cljs.core.next(a); var r = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, f, h, r, a) + return b(c, d, e, f, h, r, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; + }(), a = function(a, h, k, l, m, n, p) { + switch(arguments.length) { + case 3: + return b.call(this, a, h, k); + case 4: + return c.call(this, a, h, k, l); + case 5: + return d.call(this, a, h, k, l, m); + case 6: + return e.call(this, a, h, k, l, m, n); + default: + var q = null; + if (6 < arguments.length) { + for (var q = 0, r = Array(arguments.length - 6);q < r.length;) { + r[q] = arguments[q + 6], ++q; + } + q = new cljs.core.IndexedSeq(r, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, q); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 6; + a.cljs$lang$applyTo = f.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$3 = b; + a.cljs$core$IFn$_invoke$arity$4 = c; + a.cljs$core$IFn$_invoke$arity$5 = d; + a.cljs$core$IFn$_invoke$arity$6 = e; + a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return a; +}(); +cljs.core.update = function() { + var a = null, b = function(a, b, c) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { + var d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); + return c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); + }()); + }, c = function(a, b, c, d) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { + var e = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); + return c.cljs$core$IFn$_invoke$arity$2 ? c.cljs$core$IFn$_invoke$arity$2(e, d) : c.call(null, e, d); + }()); + }, d = function(a, b, c, d, e) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { + var f = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); + return c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(f, d, e) : c.call(null, f, d, e); + }()); + }, e = function(a, b, c, d, e, f) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { + var p = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); + return c.cljs$core$IFn$_invoke$arity$4 ? c.cljs$core$IFn$_invoke$arity$4(p, d, e, f) : c.call(null, p, d, e, f); + }()); + }, f = function() { + var a = function(a, b, c, d, e, f, g) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(c, cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b), d, e, f, cljs.core.array_seq([g], 0))); + }, b = function(b, c, d, e, f, h, r) { + var s = null; + if (6 < arguments.length) { + for (var s = 0, t = Array(arguments.length - 6);s < t.length;) { + t[s] = arguments[s + 6], ++s; + } + s = new cljs.core.IndexedSeq(t, 0); + } + return a.call(this, b, c, d, e, f, h, s); + }; + b.cljs$lang$maxFixedArity = 6; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var f = cljs.core.first(b); + b = cljs.core.next(b); + var h = cljs.core.first(b); + b = cljs.core.next(b); + var r = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, e, f, h, r, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; }(), a = function(a, h, k, l, m, n, p) { switch(arguments.length) { case 3: @@ -8022,7 +12001,14 @@ cljs.core.update_in = function() { case 6: return e.call(this, a, h, k, l, m, n); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, cljs.core.array_seq(arguments, 6)) + var q = null; + if (6 < arguments.length) { + for (var q = 0, r = Array(arguments.length - 6);q < r.length;) { + r[q] = arguments[q + 6], ++q; + } + q = new cljs.core.IndexedSeq(r, 0); + } + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, q); } throw Error("Invalid arity: " + arguments.length); }; @@ -8033,93 +12019,135 @@ cljs.core.update_in = function() { a.cljs$core$IFn$_invoke$arity$5 = d; a.cljs$core$IFn$_invoke$arity$6 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.VectorNode = function(a, b) { this.edit = a; - this.arr = b + this.arr = b; }; cljs.core.VectorNode.cljs$lang$type = !0; cljs.core.VectorNode.cljs$lang$ctorStr = "cljs.core/VectorNode"; cljs.core.VectorNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/VectorNode") + return cljs.core._write(b, "cljs.core/VectorNode"); }; cljs.core.__GT_VectorNode = function(a, b) { - return new cljs.core.VectorNode(a, b) + return new cljs.core.VectorNode(a, b); }; cljs.core.pv_fresh_node = function(a) { - return new cljs.core.VectorNode(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]) + return new cljs.core.VectorNode(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); }; cljs.core.pv_aget = function(a, b) { - return a.arr[b] + return a.arr[b]; }; cljs.core.pv_aset = function(a, b, c) { - return a.arr[b] = c + return a.arr[b] = c; }; cljs.core.pv_clone_node = function(a) { - return new cljs.core.VectorNode(a.edit, cljs.core.aclone.call(null, a.arr)) + return new cljs.core.VectorNode(a.edit, cljs.core.aclone(a.arr)); }; cljs.core.tail_off = function(a) { a = a.cnt; - return 32 > a ? 0 : a - 1 >>> 5 << 5 + return 32 > a ? 0 : a - 1 >>> 5 << 5; }; cljs.core.new_path = function(a, b, c) { - for(;;) { - if(0 === b) { - return c + for (;;) { + if (0 === b) { + return c; } - var d = cljs.core.pv_fresh_node.call(null, a); - cljs.core.pv_aset.call(null, d, 0, c); + var d = cljs.core.pv_fresh_node(a); + cljs.core.pv_aset(d, 0, c); c = d; - b -= 5 + b -= 5; } }; cljs.core.push_tail = function push_tail(b, c, d, e) { - var f = cljs.core.pv_clone_node.call(null, d), g = b.cnt - 1 >>> c & 31; - 5 === c ? cljs.core.pv_aset.call(null, f, g, e) : (d = cljs.core.pv_aget.call(null, d, g), b = null != d ? push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, null, c - 5, e), cljs.core.pv_aset.call(null, f, g, b)); - return f + var f = cljs.core.pv_clone_node(d), g = b.cnt - 1 >>> c & 31; + 5 === c ? cljs.core.pv_aset(f, g, e) : (d = cljs.core.pv_aget(d, g), b = null != d ? push_tail(b, c - 5, d, e) : cljs.core.new_path(null, c - 5, e), cljs.core.pv_aset(f, g, b)); + return f; }; cljs.core.vector_index_out_of_bounds = function(a, b) { throw Error([cljs.core.str("No item "), cljs.core.str(a), cljs.core.str(" in vector of length "), cljs.core.str(b)].join("")); }; -cljs.core.array_for = function(a, b) { - if(0 <= b && b < a.cnt) { - if(b >= cljs.core.tail_off.call(null, a)) { - return a.tail +cljs.core.first_array_for_longvec = function(a) { + var b = a.root; + for (a = a.shift;;) { + if (0 < a) { + b = cljs.core.pv_aget(b, 0), a -= 5; + } else { + return b.arr; } - for(var c = a.root, d = a.shift;;) { - if(0 < d) { - c = cljs.core.pv_aget.call(null, c, b >>> d & 31), d -= 5 - }else { - return c.arr - } + } +}; +cljs.core.unchecked_array_for = function(a, b) { + if (b >= cljs.core.tail_off(a)) { + return a.tail; + } + for (var c = a.root, d = a.shift;;) { + if (0 < d) { + c = cljs.core.pv_aget(c, b >>> d & 31), d -= 5; + } else { + return c.arr; } - }else { - return cljs.core.vector_index_out_of_bounds.call(null, b, a.cnt) } }; +cljs.core.array_for = function(a, b) { + return 0 <= b && b < a.cnt ? cljs.core.unchecked_array_for(a, b) : cljs.core.vector_index_out_of_bounds(b, a.cnt); +}; cljs.core.do_assoc = function do_assoc(b, c, d, e, f) { - var g = cljs.core.pv_clone_node.call(null, d); - if(0 === c) { - cljs.core.pv_aset.call(null, g, e & 31, f) - }else { + var g = cljs.core.pv_clone_node(d); + if (0 === c) { + cljs.core.pv_aset(g, e & 31, f); + } else { var h = e >>> c & 31; - cljs.core.pv_aset.call(null, g, h, do_assoc.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, h), e, f)) + cljs.core.pv_aset(g, h, do_assoc(b, c - 5, cljs.core.pv_aget(d, h), e, f)); } - return g + return g; }; cljs.core.pop_tail = function pop_tail(b, c, d) { var e = b.cnt - 2 >>> c & 31; - if(5 < c) { - b = pop_tail.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, e)); - if(null == b && 0 === e) { - return null + if (5 < c) { + b = pop_tail(b, c - 5, cljs.core.pv_aget(d, e)); + if (null == b && 0 === e) { + return null; } - d = cljs.core.pv_clone_node.call(null, d); - cljs.core.pv_aset.call(null, d, e, b); - return d + d = cljs.core.pv_clone_node(d); + cljs.core.pv_aset(d, e, b); + return d; + } + if (0 === e) { + return null; } - return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = cljs.core.pv_clone_node.call(null, d), cljs.core.pv_aset.call(null, d, e, null), d) : null + d = cljs.core.pv_clone_node(d); + cljs.core.pv_aset(d, e, null); + return d; +}; +cljs.core.RangedIterator = function(a, b, c, d, e, f) { + this.i = a; + this.base = b; + this.arr = c; + this.v = d; + this.start = e; + this.end = f; +}; +cljs.core.RangedIterator.prototype.hasNext = function() { + return this.i < this.end; +}; +cljs.core.RangedIterator.prototype.next = function() { + 32 === this.i - this.base && (this.arr = cljs.core.unchecked_array_for(this.v, this.i), this.base += 32); + var a = this.arr[this.i & 31]; + this.i += 1; + return a; +}; +cljs.core.RangedIterator.cljs$lang$type = !0; +cljs.core.RangedIterator.cljs$lang$ctorStr = "cljs.core/RangedIterator"; +cljs.core.RangedIterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/RangedIterator"); +}; +cljs.core.__GT_RangedIterator = function(a, b, c, d, e, f) { + return new cljs.core.RangedIterator(a, b, c, d, e, f); +}; +cljs.core.ranged_iterator = function(a, b, c) { + return new cljs.core.RangedIterator(b, b - b % 32, b < cljs.core.count(a) ? cljs.core.unchecked_array_for(a, b) : null, a, b, c); }; cljs.core.PersistentVector = function(a, b, c, d, e, f) { this.meta = a; @@ -8128,208 +12156,290 @@ cljs.core.PersistentVector = function(a, b, c, d, e, f) { this.root = d; this.tail = e; this.__hash = f; - this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 167668511 + this.cljs$lang$protocol_mask$partition0$ = 167668511; + this.cljs$lang$protocol_mask$partition1$ = 8196; }; -cljs.core.PersistentVector.cljs$lang$type = !0; -cljs.core.PersistentVector.cljs$lang$ctorStr = "cljs.core/PersistentVector"; -cljs.core.PersistentVector.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentVector") -}; -cljs.core.PersistentVector.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientVector(this.cnt, this.shift, cljs.core.tv_editable_root.call(null, this.root), cljs.core.tv_editable_tail.call(null, this.tail)) +cljs.core.PersistentVector.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.PersistentVector.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.PersistentVector.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; cljs.core.PersistentVector.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.PersistentVector.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) -}; -cljs.core.PersistentVector.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if(0 <= b && b < this.cnt) { - return cljs.core.tail_off.call(null, this) <= b ? (a = cljs.core.aclone.call(null, this.tail), a[b & 31] = c, new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, a, null)) : new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, cljs.core.do_assoc.call(null, this, this.shift, this.root, b, c), this.tail, null) - } - if(b === this.cnt) { - return cljs.core._conj.call(null, this, c) - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds [0,"), cljs.core.str(this.cnt), cljs.core.str("]")].join("")); - } - return null -}; -cljs.core.PersistentVector.prototype.call = function() { - var a = null; - return a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$IIndexed$_nth$arity$2(null, c); - case 3: - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d) - } - throw Error("Invalid arity: " + arguments.length); - } -}(); -cljs.core.PersistentVector.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) -}; -cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$IIndexed$_nth$arity$2(null, a) -}; -cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$IIndexed$_nth$arity$3(null, a, b) + return "number" === typeof b ? cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c) : c; }; cljs.core.PersistentVector.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - a = [0, c]; - for(c = 0;;) { - if(c < this.cnt) { - var d = cljs.core.array_for.call(null, this, c), e = d.length; + a = 0; + for (var d = c;;) { + if (a < this.cnt) { + var e = cljs.core.unchecked_array_for(this, a); + c = e.length; a: { - for(var f = 0, g = a[1];;) { - if(f < e) { - if(g = b.call(null, g, f + c, d[f]), cljs.core.reduced_QMARK_.call(null, g)) { - d = g; - break a - }else { - f += 1 + for (var f = 0;;) { + if (f < c) { + var g = f + a, h = e[f], d = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(d, g, h) : b.call(null, d, g, h); + if (cljs.core.reduced_QMARK_(d)) { + e = d; + break a; } - }else { - a[0] = e; - d = a[1] = g; - break a + f += 1; + } else { + e = d; + break a; } } - d = void 0 + e = void 0; } - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (cljs.core.reduced_QMARK_(e)) { + return b = e, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); } - c += a[0] - }else { - return a[1] + a += c; + d = e; + } else { + return d; } } }; -cljs.core.PersistentVector.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - if(32 > this.cnt - cljs.core.tail_off.call(null, this)) { - for(var c = this.tail.length, d = Array(c + 1), e = 0;;) { - if(e < c) { - d[e] = this.tail[e], e += 1 - }else { - break - } - } - d[c] = b; - return new cljs.core.PersistentVector(this.meta, this.cnt + 1, this.shift, this.root, d, null) - } - c = (d = this.cnt >>> 5 > 1 << this.shift) ? this.shift + 5 : this.shift; - d ? (d = cljs.core.pv_fresh_node.call(null, null), cljs.core.pv_aset.call(null, d, 0, this.root), cljs.core.pv_aset.call(null, d, 1, cljs.core.new_path.call(null, null, this.shift, new cljs.core.VectorNode(null, this.tail)))) : d = cljs.core.push_tail.call(null, this, this.shift, this.root, new cljs.core.VectorNode(null, this.tail)); - return new cljs.core.PersistentVector(this.meta, this.cnt + 1, c, d, [b], null) +cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + return cljs.core.array_for(this, b)[b & 31]; }; -cljs.core.PersistentVector.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < this.cnt ? new cljs.core.RSeq(this, this.cnt - 1, null) : null +cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 <= b && b < this.cnt ? cljs.core.unchecked_array_for(this, b)[b & 31] : c; }; -cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return cljs.core._nth.call(null, this, 0) +cljs.core.PersistentVector.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + if (0 <= b && b < this.cnt) { + return cljs.core.tail_off(this) <= b ? (a = cljs.core.aclone(this.tail), a[b & 31] = c, new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, a, null)) : new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, cljs.core.do_assoc(this, this.shift, this.root, b, c), this.tail, null); + } + if (b === this.cnt) { + return cljs.core._conj(this, c); + } + throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds [0,"), cljs.core.str(this.cnt), cljs.core.str("]")].join("")); }; -cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return cljs.core._nth.call(null, this, 1) +cljs.core.PersistentVector.prototype.cljs$core$IIterable$ = !0; +cljs.core.PersistentVector.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { + return cljs.core.ranged_iterator(this, 0, this.cnt); }; -cljs.core.PersistentVector.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.PersistentVector.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) +cljs.core.PersistentVector.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, this.tail, this.__hash); }; -cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) +cljs.core.PersistentVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.cnt; }; -cljs.core.PersistentVector.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 === this.cnt ? null : 32 > this.cnt ? cljs.core.array_seq.call(null, this.tail) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.chunked_seq.call(null, this, 0, 0) : null +cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, 0); }; -cljs.core.PersistentVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt +cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, 1); }; cljs.core.PersistentVector.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core._nth.call(null, this, this.cnt - 1) : null + return 0 < this.cnt ? cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, this.cnt - 1) : null; }; cljs.core.PersistentVector.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - if(0 === this.cnt) { + if (0 === this.cnt) { throw Error("Can't pop empty vector"); } - if(1 === this.cnt) { - return cljs.core._with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) - } - if(1 < this.cnt - cljs.core.tail_off.call(null, this)) { - return new cljs.core.PersistentVector(this.meta, this.cnt - 1, this.shift, this.root, this.tail.slice(0, -1), null) + if (1 === this.cnt) { + return cljs.core._with_meta(cljs.core.PersistentVector.EMPTY, this.meta); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - a = cljs.core.array_for.call(null, this, this.cnt - 2); - var b = cljs.core.pop_tail.call(null, this, this.shift, this.root), b = null == b ? cljs.core.PersistentVector.EMPTY_NODE : b, c = this.cnt - 1; - return 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? new cljs.core.PersistentVector(this.meta, c, this.shift - 5, cljs.core.pv_aget.call(null, b, 0), a, null) : new cljs.core.PersistentVector(this.meta, c, this.shift, b, a, null) + if (1 < this.cnt - cljs.core.tail_off(this)) { + return new cljs.core.PersistentVector(this.meta, this.cnt - 1, this.shift, this.root, this.tail.slice(0, -1), null); } - return null + a = cljs.core.unchecked_array_for(this, this.cnt - 2); + var b = cljs.core.pop_tail(this, this.shift, this.root), b = null == b ? cljs.core.PersistentVector.EMPTY_NODE : b, c = this.cnt - 1; + return 5 < this.shift && null == cljs.core.pv_aget(b, 1) ? new cljs.core.PersistentVector(this.meta, c, this.shift - 5, cljs.core.pv_aget(b, 0), a, null) : new cljs.core.PersistentVector(this.meta, c, this.shift, b, a, null); }; -cljs.core.PersistentVector.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return cljs.core._assoc.call(null, this, b, c) +cljs.core.PersistentVector.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return 0 < this.cnt ? new cljs.core.RSeq(this, this.cnt - 1, null) : null; +}; +cljs.core.PersistentVector.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; cljs.core.PersistentVector.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + if (b instanceof cljs.core.PersistentVector) { + if (this.cnt === cljs.core.count(b)) { + for (var c = cljs.core._iterator(this), d = cljs.core._iterator(b);;) { + if (cljs.core.truth_(c.hasNext())) { + var e = c.next(), f = d.next(); + if (!cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(e, f)) { + return!1; + } + } else { + return!0; + } + } + } else { + return!1; + } + } else { + return cljs.core.equiv_sequential(this, b); + } +}; +cljs.core.PersistentVector.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + var b = this; + return new cljs.core.TransientVector(b.cnt, b.shift, function() { + var a = b.root; + return cljs.core.tv_editable_root.cljs$core$IFn$_invoke$arity$1 ? cljs.core.tv_editable_root.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.tv_editable_root.call(null, a); + }(), function() { + var a = b.tail; + return cljs.core.tv_editable_tail.cljs$core$IFn$_invoke$arity$1 ? cljs.core.tv_editable_tail.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.tv_editable_tail.call(null, a); + }()); +}; +cljs.core.PersistentVector.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, this.meta); +}; +cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); +}; +cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + a = 0; + for (var d = c;;) { + if (a < this.cnt) { + var e = cljs.core.unchecked_array_for(this, a); + c = e.length; + a: { + for (var f = 0;;) { + if (f < c) { + var g = e[f], d = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, g) : b.call(null, d, g); + if (cljs.core.reduced_QMARK_(d)) { + e = d; + break a; + } + f += 1; + } else { + e = d; + break a; + } + } + e = void 0; + } + if (cljs.core.reduced_QMARK_(e)) { + return b = e, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + } + a += c; + d = e; + } else { + return d; + } + } +}; +cljs.core.PersistentVector.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + if ("number" === typeof b) { + return cljs.core._assoc_n(this, b, c); + } + throw Error("Vector's key for assoc must be a number."); +}; +cljs.core.PersistentVector.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + if (0 === this.cnt) { + return null; + } + if (32 >= this.cnt) { + return new cljs.core.IndexedSeq(this.tail, 0); + } + a = cljs.core.first_array_for_longvec(this); + return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(this, a, 0, 0) : cljs.core.chunked_seq.call(null, this, a, 0, 0); }; cljs.core.PersistentVector.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(b, this.cnt, this.shift, this.root, this.tail, this.__hash) + return new cljs.core.PersistentVector(b, this.cnt, this.shift, this.root, this.tail, this.__hash); }; -cljs.core.PersistentVector.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.PersistentVector.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + if (32 > this.cnt - cljs.core.tail_off(this)) { + for (var c = this.tail.length, d = Array(c + 1), e = 0;;) { + if (e < c) { + d[e] = this.tail[e], e += 1; + } else { + break; + } + } + d[c] = b; + return new cljs.core.PersistentVector(this.meta, this.cnt + 1, this.shift, this.root, d, null); + } + c = (d = this.cnt >>> 5 > 1 << this.shift) ? this.shift + 5 : this.shift; + d ? (d = cljs.core.pv_fresh_node(null), cljs.core.pv_aset(d, 0, this.root), cljs.core.pv_aset(d, 1, cljs.core.new_path(null, this.shift, new cljs.core.VectorNode(null, this.tail)))) : d = cljs.core.push_tail(this, this.shift, this.root, new cljs.core.VectorNode(null, this.tail)); + return new cljs.core.PersistentVector(this.meta, this.cnt + 1, c, d, [b], null); }; -cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return cljs.core.array_for.call(null, this, b)[b & 31] +cljs.core.PersistentVector.prototype.call = function() { + var a = null, a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$IIndexed$_nth$arity$2(null, c); + case 3: + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$IIndexed$_nth$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); + }; + return a; +}(); +cljs.core.PersistentVector.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; -cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c +cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$IIndexed$_nth$arity$2(null, a); }; -cljs.core.PersistentVector.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) +cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$IIndexed$_nth$arity$3(null, a, b); +}; +cljs.core.PersistentVector.cljs$lang$type = !0; +cljs.core.PersistentVector.cljs$lang$ctorStr = "cljs.core/PersistentVector"; +cljs.core.PersistentVector.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentVector"); }; cljs.core.__GT_PersistentVector = function(a, b, c, d, e, f) { - return new cljs.core.PersistentVector(a, b, c, d, e, f) + return new cljs.core.PersistentVector(a, b, c, d, e, f); }; cljs.core.PersistentVector.EMPTY_NODE = new cljs.core.VectorNode(null, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); -cljs.core.PersistentVector.EMPTY = new cljs.core.PersistentVector(null, 0, 5, cljs.core.PersistentVector.EMPTY_NODE, [], 0); +cljs.core.PersistentVector.EMPTY = new cljs.core.PersistentVector(null, 0, 5, cljs.core.PersistentVector.EMPTY_NODE, [], cljs.core.empty_ordered_hash); cljs.core.PersistentVector.fromArray = function(a, b) { - var c = a.length, d = b ? a : cljs.core.aclone.call(null, a); - if(32 > c) { - return new cljs.core.PersistentVector(null, c, 5, cljs.core.PersistentVector.EMPTY_NODE, d, null) + var c = a.length, d = b ? a : cljs.core.aclone(a); + if (32 > c) { + return new cljs.core.PersistentVector(null, c, 5, cljs.core.PersistentVector.EMPTY_NODE, d, null); } - for(var e = d.slice(0, 32), f = new cljs.core.PersistentVector(null, 32, 5, cljs.core.PersistentVector.EMPTY_NODE, e, null), e = 32, g = cljs.core._as_transient.call(null, f);;) { - if(e < c) { - f = e + 1, g = cljs.core.conj_BANG_.call(null, g, d[e]), e = f - }else { - return cljs.core.persistent_BANG_.call(null, g) + for (var e = d.slice(0, 32), f = 32, g = (new cljs.core.PersistentVector(null, 32, 5, cljs.core.PersistentVector.EMPTY_NODE, e, null)).cljs$core$IEditableCollection$_as_transient$arity$1(null);;) { + if (f < c) { + e = f + 1, g = cljs.core.conj_BANG_.cljs$core$IFn$_invoke$arity$2(g, d[f]), f = e; + } else { + return cljs.core.persistent_BANG_(g); } } }; +cljs.core.PersistentVector.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; cljs.core.vec = function(a) { - return cljs.core._persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core._as_transient.call(null, cljs.core.PersistentVector.EMPTY), a)) + return a instanceof Array ? cljs.core.PersistentVector.fromArray(a, !0) : cljs.core._persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj_BANG_, cljs.core._as_transient(cljs.core.PersistentVector.EMPTY), a)); }; cljs.core.vector = function() { var a = function(a) { - return a instanceof cljs.core.IndexedSeq ? cljs.core.PersistentVector.fromArray.call(null, a.arr, !0) : cljs.core.vec.call(null, a) + return a instanceof cljs.core.IndexedSeq && 0 === a.i ? cljs.core.PersistentVector.fromArray(a.arr, !0) : cljs.core.vec(a); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.ChunkedSeq = function(a, b, c, d, e, f) { this.vec = a; @@ -8338,77 +12448,110 @@ cljs.core.ChunkedSeq = function(a, b, c, d, e, f) { this.off = d; this.meta = e; this.__hash = f; - this.cljs$lang$protocol_mask$partition0$ = 32243948; - this.cljs$lang$protocol_mask$partition1$ = 1536 + this.cljs$lang$protocol_mask$partition0$ = 32375020; + this.cljs$lang$protocol_mask$partition1$ = 1536; }; -cljs.core.ChunkedSeq.cljs$lang$type = !0; -cljs.core.ChunkedSeq.cljs$lang$ctorStr = "cljs.core/ChunkedSeq"; -cljs.core.ChunkedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ChunkedSeq") +cljs.core.ChunkedSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.ChunkedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.ChunkedSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.ChunkedSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; cljs.core.ChunkedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? null : a) : cljs.core._chunked_next.call(null, this) + if (this.off + 1 < this.node.length) { + a = this.vec; + var b = this.node, c = this.i, d = this.off + 1; + a = cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : cljs.core.chunked_seq.call(null, a, b, c, d); + return null == a ? null : a; + } + return cljs.core._chunked_next(this); }; -cljs.core.ChunkedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.ChunkedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.ChunkedSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.ChunkedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.ChunkedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, this.meta); }; cljs.core.ChunkedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b) + var c = this; + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(function() { + var a = c.vec, b = c.i + c.off, f = cljs.core.count(c.vec); + return cljs.core.subvec.cljs$core$IFn$_invoke$arity$3 ? cljs.core.subvec.cljs$core$IFn$_invoke$arity$3(a, b, f) : cljs.core.subvec.call(null, a, b, f); + }(), b); }; cljs.core.ChunkedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b, c) -}; -cljs.core.ChunkedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + var d = this; + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(function() { + var a = d.vec, b = d.i + d.off, c = cljs.core.count(d.vec); + return cljs.core.subvec.cljs$core$IFn$_invoke$arity$3 ? cljs.core.subvec.cljs$core$IFn$_invoke$arity$3(a, b, c) : cljs.core.subvec.call(null, a, b, c); + }(), b, c); }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.node[this.off] + return this.node[this.off]; }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? cljs.core.List.EMPTY : a) : cljs.core._chunked_rest.call(null, this) + if (this.off + 1 < this.node.length) { + a = this.vec; + var b = this.node, c = this.i, d = this.off + 1; + a = cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : cljs.core.chunked_seq.call(null, a, b, c, d); + return null == a ? cljs.core.List.EMPTY : a; + } + return cljs.core._chunked_rest(this); }; -cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { - a = this.node.length; - a = this.i + a < cljs.core._count.call(null, this.vec) ? cljs.core.chunked_seq.call(null, this.vec, this.i + a, 0) : null; - return null == a ? null : a +cljs.core.ChunkedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; -cljs.core.ChunkedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { + return cljs.core.array_chunk.cljs$core$IFn$_invoke$arity$2(this.node, this.off); }; -cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off, b) +cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { + a = this.i + this.node.length; + if (a < cljs.core._count(this.vec)) { + var b = this.vec, c = cljs.core.unchecked_array_for(this.vec, a); + return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(b, c, a, 0) : cljs.core.chunked_seq.call(null, b, c, a, 0); + } + return cljs.core.List.EMPTY; }; -cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + var c = this.vec, d = this.node, e = this.i, f = this.off; + return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$5 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$5(c, d, e, f, b) : cljs.core.chunked_seq.call(null, c, d, e, f, b); }; -cljs.core.ChunkedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) +cljs.core.ChunkedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { - return cljs.core.array_chunk.call(null, this.node, this.off) +cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { + a = this.i + this.node.length; + if (a < cljs.core._count(this.vec)) { + var b = this.vec, c = cljs.core.unchecked_array_for(this.vec, a); + return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(b, c, a, 0) : cljs.core.chunked_seq.call(null, b, c, a, 0); + } + return null; }; -cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { - a = this.node.length; - a = this.i + a < cljs.core._count.call(null, this.vec) ? cljs.core.chunked_seq.call(null, this.vec, this.i + a, 0) : null; - return null == a ? cljs.core.List.EMPTY : a +cljs.core.ChunkedSeq.cljs$lang$type = !0; +cljs.core.ChunkedSeq.cljs$lang$ctorStr = "cljs.core/ChunkedSeq"; +cljs.core.ChunkedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ChunkedSeq"); }; cljs.core.__GT_ChunkedSeq = function(a, b, c, d, e, f) { - return new cljs.core.ChunkedSeq(a, b, c, d, e, f) + return new cljs.core.ChunkedSeq(a, b, c, d, e, f); +}; +cljs.core.ChunkedSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.chunked_seq = function() { var a = null, b = function(a, b, c) { - return new cljs.core.ChunkedSeq(a, cljs.core.array_for.call(null, a, b), b, c, null, null) + return new cljs.core.ChunkedSeq(a, cljs.core.array_for(a, b), b, c, null, null); }, c = function(a, b, c, d) { - return new cljs.core.ChunkedSeq(a, b, c, d, null, null) + return new cljs.core.ChunkedSeq(a, b, c, d, null, null); }, d = function(a, b, c, d, k) { - return new cljs.core.ChunkedSeq(a, b, c, d, k, null) + return new cljs.core.ChunkedSeq(a, b, c, d, k, null); }, a = function(a, f, g, h, k) { switch(arguments.length) { case 3: @@ -8416,14 +12559,14 @@ cljs.core.chunked_seq = function() { case 4: return c.call(this, a, f, g, h); case 5: - return d.call(this, a, f, g, h, k) + return d.call(this, a, f, g, h, k); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$4 = c; a.cljs$core$IFn$_invoke$arity$5 = d; - return a + return a; }(); cljs.core.Subvec = function(a, b, c, d, e) { this.meta = a; @@ -8431,185 +12574,215 @@ cljs.core.Subvec = function(a, b, c, d, e) { this.start = c; this.end = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32400159 + this.cljs$lang$protocol_mask$partition0$ = 166617887; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.Subvec.cljs$lang$type = !0; -cljs.core.Subvec.cljs$lang$ctorStr = "cljs.core/Subvec"; -cljs.core.Subvec.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Subvec") +cljs.core.Subvec.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.Subvec.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.Subvec.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; cljs.core.Subvec.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.Subvec.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) -}; -cljs.core.Subvec.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - var d = this, e = d.start + b; - return cljs.core.build_subvec.call(null, d.meta, cljs.core.assoc.call(null, d.v, e, c), d.start, function() { - var a = d.end, b = e + 1; - return a > b ? a : b - }(), null) + return "number" === typeof b ? cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c) : c; }; -cljs.core.Subvec.prototype.call = function() { - var a = null; - return a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$IIndexed$_nth$arity$2(null, c); - case 3: - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d) - } - throw Error("Invalid arity: " + arguments.length); - } -}(); -cljs.core.Subvec.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) -}; -cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$IIndexed$_nth$arity$2(null, a) -}; -cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$IIndexed$_nth$arity$3(null, a, b) -}; -cljs.core.Subvec.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.build_subvec.call(null, this.meta, cljs.core._assoc_n.call(null, this.v, this.end, b), this.start, this.end + 1, null) +cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + return 0 > b || this.end <= this.start + b ? cljs.core.vector_index_out_of_bounds(b, this.end - this.start) : cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.v, this.start + b); }; -cljs.core.Subvec.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 > b || this.end <= this.start + b ? c : cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this.v, this.start + b, c); }; -cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) +cljs.core.Subvec.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + var d = this.start + b; + a = this.meta; + c = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.v, d, c); + b = this.start; + var e = this.end, d = d + 1, d = e > d ? e : d; + return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(a, c, b, d, null) : cljs.core.build_subvec.call(null, a, c, b, d, null); }; -cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) +cljs.core.Subvec.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.Subvec.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - var b = this; - return function d(a) { - return a === b.end ? null : cljs.core.cons.call(null, cljs.core._nth.call(null, b.v, a), new cljs.core.LazySeq(null, function() { - return d.call(null, a + 1) - }, null, null)) - }.call(null, b.start) +cljs.core.Subvec.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Subvec(this.meta, this.v, this.start, this.end, this.__hash); }; cljs.core.Subvec.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end - this.start + return this.end - this.start; }; cljs.core.Subvec.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return cljs.core._nth.call(null, this.v, this.end - 1) + return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.v, this.end - 1); }; cljs.core.Subvec.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - if(this.start === this.end) { + if (this.start === this.end) { throw Error("Can't pop empty vector"); } - return cljs.core.build_subvec.call(null, this.meta, this.v, this.start, this.end - 1, null) + a = this.meta; + var b = this.v, c = this.start, d = this.end - 1; + return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(a, b, c, d, null) : cljs.core.build_subvec.call(null, a, b, c, d, null); }; -cljs.core.Subvec.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return cljs.core._assoc.call(null, this, b, c) +cljs.core.Subvec.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return this.start !== this.end ? new cljs.core.RSeq(this, this.end - this.start - 1, null) : null; +}; +cljs.core.Subvec.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; cljs.core.Subvec.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.Subvec.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, this.meta); +}; +cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); +}; +cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(this, b, c); +}; +cljs.core.Subvec.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + if ("number" === typeof b) { + return cljs.core._assoc_n(this, b, c); + } + throw Error("Subvec's key for assoc must be a number."); +}; +cljs.core.Subvec.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + var b = this; + return function(a) { + return function e(f) { + return f === b.end ? null : cljs.core.cons(cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b.v, f), new cljs.core.LazySeq(null, function(a) { + return function() { + return e(f + 1); + }; + }(a), null, null)); + }; + }(this)(b.start); }; cljs.core.Subvec.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.build_subvec.call(null, b, this.v, this.start, this.end, this.__hash) + var c = this.v, d = this.start, e = this.end, f = this.__hash; + return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : cljs.core.build_subvec.call(null, b, c, d, e, f); }; -cljs.core.Subvec.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.Subvec.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + var c = this.meta, d = cljs.core._assoc_n(this.v, this.end, b), e = this.start, f = this.end + 1; + return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(c, d, e, f, null) : cljs.core.build_subvec.call(null, c, d, e, f, null); }; -cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return 0 > b || this.end <= this.start + b ? cljs.core.vector_index_out_of_bounds.call(null, b, this.end - this.start) : cljs.core._nth.call(null, this.v, this.start + b) +cljs.core.Subvec.prototype.call = function() { + var a = null, a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$IIndexed$_nth$arity$2(null, c); + case 3: + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$IIndexed$_nth$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); + }; + return a; +}(); +cljs.core.Subvec.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; -cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 > b || this.end <= this.start + b ? c : cljs.core._nth.call(null, this.v, this.start + b, c) +cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$IIndexed$_nth$arity$2(null, a); }; -cljs.core.Subvec.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) +cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$IIndexed$_nth$arity$3(null, a, b); +}; +cljs.core.Subvec.cljs$lang$type = !0; +cljs.core.Subvec.cljs$lang$ctorStr = "cljs.core/Subvec"; +cljs.core.Subvec.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Subvec"); }; cljs.core.__GT_Subvec = function(a, b, c, d, e) { - return new cljs.core.Subvec(a, b, c, d, e) + return new cljs.core.Subvec(a, b, c, d, e); +}; +cljs.core.Subvec.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.build_subvec = function(a, b, c, d, e) { - for(;;) { - if(b instanceof cljs.core.Subvec) { - c = b.start + c, d = b.start + d, b = b.v - }else { - var f = cljs.core.count.call(null, b); - if(0 > c || 0 > d || c > f || d > f) { + for (;;) { + if (b instanceof cljs.core.Subvec) { + c = b.start + c, d = b.start + d, b = b.v; + } else { + var f = cljs.core.count(b); + if (0 > c || 0 > d || c > f || d > f) { throw Error("Index out of bounds"); } - return new cljs.core.Subvec(a, b, c, d, e) + return new cljs.core.Subvec(a, b, c, d, e); } } }; cljs.core.subvec = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, cljs.core.count.call(null, b)) + return a.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.count(b)); }, c = function(a, b, c) { - return cljs.core.build_subvec.call(null, null, a, b, c, null) + return cljs.core.build_subvec(null, a, b, c, null); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.tv_ensure_editable = function(a, b) { - return a === b.edit ? b : new cljs.core.VectorNode(a, cljs.core.aclone.call(null, b.arr)) + return a === b.edit ? b : new cljs.core.VectorNode(a, cljs.core.aclone(b.arr)); }; cljs.core.tv_editable_root = function(a) { - return new cljs.core.VectorNode({}, cljs.core.aclone.call(null, a.arr)) + return new cljs.core.VectorNode({}, cljs.core.aclone(a.arr)); }; cljs.core.tv_editable_tail = function(a) { var b = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; - cljs.core.array_copy.call(null, a, 0, b, 0, a.length); - return b + cljs.core.array_copy(a, 0, b, 0, a.length); + return b; }; cljs.core.tv_push_tail = function tv_push_tail(b, c, d, e) { - var f = cljs.core.tv_ensure_editable.call(null, b.root.edit, d), g = b.cnt - 1 >>> c & 31; - cljs.core.pv_aset.call(null, f, g, 5 === c ? e : function() { - var d = cljs.core.pv_aget.call(null, f, g); - return null != d ? tv_push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, b.root.edit, c - 5, e) + var f = cljs.core.tv_ensure_editable(b.root.edit, d), g = b.cnt - 1 >>> c & 31; + cljs.core.pv_aset(f, g, 5 === c ? e : function() { + var d = cljs.core.pv_aget(f, g); + return null != d ? tv_push_tail(b, c - 5, d, e) : cljs.core.new_path(b.root.edit, c - 5, e); }()); - return f + return f; }; cljs.core.tv_pop_tail = function tv_pop_tail(b, c, d) { - d = cljs.core.tv_ensure_editable.call(null, b.root.edit, d); + d = cljs.core.tv_ensure_editable(b.root.edit, d); var e = b.cnt - 2 >>> c & 31; - if(5 < c) { - b = tv_pop_tail.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, e)); - if(null == b && 0 === e) { - return null + if (5 < c) { + b = tv_pop_tail(b, c - 5, cljs.core.pv_aget(d, e)); + if (null == b && 0 === e) { + return null; } - cljs.core.pv_aset.call(null, d, e, b); - return d + cljs.core.pv_aset(d, e, b); + return d; } - return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (cljs.core.pv_aset.call(null, d, e, null), d) : null + if (0 === e) { + return null; + } + cljs.core.pv_aset(d, e, null); + return d; }; -cljs.core.editable_array_for = function(a, b) { - if(0 <= b && b < a.cnt) { - if(b >= cljs.core.tail_off.call(null, a)) { - return a.tail - } - for(var c = a.root, d = c, e = a.shift;;) { - if(0 < e) { - d = cljs.core.tv_ensure_editable.call(null, c.edit, cljs.core.pv_aget.call(null, d, b >>> e & 31)), e -= 5 - }else { - return d.arr - } +cljs.core.unchecked_editable_array_for = function(a, b) { + if (b >= cljs.core.tail_off(a)) { + return a.tail; + } + for (var c = a.root, d = c, e = a.shift;;) { + if (0 < e) { + d = cljs.core.tv_ensure_editable(c.edit, cljs.core.pv_aget(d, b >>> e & 31)), e -= 5; + } else { + return d.arr; } - }else { - throw Error([cljs.core.str("No item "), cljs.core.str(b), cljs.core.str(" in transient vector of length "), cljs.core.str(a.cnt)].join("")); } }; cljs.core.TransientVector = function(a, b, c, d) { @@ -8618,143 +12791,150 @@ cljs.core.TransientVector = function(a, b, c, d) { this.root = c; this.tail = d; this.cljs$lang$protocol_mask$partition0$ = 275; - this.cljs$lang$protocol_mask$partition1$ = 88 -}; -cljs.core.TransientVector.cljs$lang$type = !0; -cljs.core.TransientVector.cljs$lang$ctorStr = "cljs.core/TransientVector"; -cljs.core.TransientVector.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientVector") + this.cljs$lang$protocol_mask$partition1$ = 88; }; cljs.core.TransientVector.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); cljs.core.TransientVector.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.TransientVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.TransientVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.TransientVector.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.TransientVector.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) + return "number" === typeof b ? cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c) : c; }; cljs.core.TransientVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(this.root.edit) { - return cljs.core.array_for.call(null, this, b)[b & 31] + if (this.root.edit) { + return cljs.core.array_for(this, b)[b & 31]; } throw Error("nth after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c + return 0 <= b && b < this.cnt ? cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, b) : c; }; cljs.core.TransientVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if(this.root.edit) { - return this.cnt + if (this.root.edit) { + return this.cnt; } throw Error("count after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 = function(a, b, c) { var d = this; - if(d.root.edit) { - if(0 <= b && b < d.cnt) { - return cljs.core.tail_off.call(null, this) <= b ? d.tail[b & 31] = c : (a = function f(a, h) { - var k = cljs.core.tv_ensure_editable.call(null, d.root.edit, h); - if(0 === a) { - cljs.core.pv_aset.call(null, k, b & 31, c) - }else { - var l = b >>> a & 31; - cljs.core.pv_aset.call(null, k, l, f.call(null, a - 5, cljs.core.pv_aget.call(null, k, l))) - } - return k - }.call(null, d.shift, d.root), d.root = a), this - } - if(b === d.cnt) { - return cljs.core._conj_BANG_.call(null, this, c) + if (d.root.edit) { + if (0 <= b && b < d.cnt) { + return cljs.core.tail_off(this) <= b ? d.tail[b & 31] = c : (a = function(a) { + return function g(a, e) { + var l = cljs.core.tv_ensure_editable(d.root.edit, e); + if (0 === a) { + cljs.core.pv_aset(l, b & 31, c); + } else { + var m = b >>> a & 31; + cljs.core.pv_aset(l, m, g(a - 5, cljs.core.pv_aget(l, m))); + } + return l; + }; + }(this).call(null, d.shift, d.root), d.root = a), this; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds for TransientVector of length"), cljs.core.str(d.cnt)].join("")); + if (b === d.cnt) { + return cljs.core._conj_BANG_(this, c); } - return null + throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds for TransientVector of length"), cljs.core.str(d.cnt)].join("")); } throw Error("assoc! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_pop_BANG_$arity$1 = function(a) { - if(this.root.edit) { - if(0 === this.cnt) { + if (this.root.edit) { + if (0 === this.cnt) { throw Error("Can't pop empty vector"); } - if(1 === this.cnt) { - return this.cnt = 0, this - } - if(0 < (this.cnt - 1 & 31)) { - return this.cnt -= 1, this - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - a = cljs.core.editable_array_for.call(null, this, this.cnt - 2); - var b; - b = cljs.core.tv_pop_tail.call(null, this, this.shift, this.root); - b = null != b ? b : new cljs.core.VectorNode(this.root.edit, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); - 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? (this.root = cljs.core.tv_ensure_editable.call(null, this.root.edit, cljs.core.pv_aget.call(null, b, 0)), this.shift -= 5) : this.root = b; - this.cnt -= 1; - this.tail = a; - return this + if (1 === this.cnt) { + this.cnt = 0; + } else { + if (0 < (this.cnt - 1 & 31)) { + this.cnt -= 1; + } else { + a = cljs.core.unchecked_editable_array_for(this, this.cnt - 2); + var b; + b = cljs.core.tv_pop_tail(this, this.shift, this.root); + b = null != b ? b : new cljs.core.VectorNode(this.root.edit, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); + 5 < this.shift && null == cljs.core.pv_aget(b, 1) ? (this.root = cljs.core.tv_ensure_editable(this.root.edit, cljs.core.pv_aget(b, 0)), this.shift -= 5) : this.root = b; + this.cnt -= 1; + this.tail = a; + } } - return null + return this; } throw Error("pop! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - return cljs.core._assoc_n_BANG_.call(null, this, b, c) + if ("number" === typeof b) { + return cljs.core._assoc_n_BANG_(this, b, c); + } + throw Error("TransientVector's key for assoc! must be a number."); }; cljs.core.TransientVector.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - if(this.root.edit) { - if(32 > this.cnt - cljs.core.tail_off.call(null, this)) { - this.tail[this.cnt & 31] = b - }else { + if (this.root.edit) { + if (32 > this.cnt - cljs.core.tail_off(this)) { + this.tail[this.cnt & 31] = b; + } else { var c = new cljs.core.VectorNode(this.root.edit, this.tail), d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; d[0] = b; this.tail = d; - if(this.cnt >>> 5 > 1 << this.shift) { + if (this.cnt >>> 5 > 1 << this.shift) { var d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], e = this.shift + 5; d[0] = this.root; - d[1] = cljs.core.new_path.call(null, this.root.edit, this.shift, c); + d[1] = cljs.core.new_path(this.root.edit, this.shift, c); this.root = new cljs.core.VectorNode(this.root.edit, d); - this.shift = e - }else { - this.root = cljs.core.tv_push_tail.call(null, this, this.shift, this.root, c) + this.shift = e; + } else { + this.root = cljs.core.tv_push_tail(this, this.shift, this.root, c); } } this.cnt += 1; - return this + return this; } throw Error("conj! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - if(this.root.edit) { + if (this.root.edit) { this.root.edit = null; - a = this.cnt - cljs.core.tail_off.call(null, this); + a = this.cnt - cljs.core.tail_off(this); var b = Array(a); - cljs.core.array_copy.call(null, this.tail, 0, b, 0, a); - return new cljs.core.PersistentVector(null, this.cnt, this.shift, this.root, b, null) + cljs.core.array_copy(this.tail, 0, b, 0, a); + return new cljs.core.PersistentVector(null, this.cnt, this.shift, this.root, b, null); } throw Error("persistent! called twice"); }; +cljs.core.TransientVector.cljs$lang$type = !0; +cljs.core.TransientVector.cljs$lang$ctorStr = "cljs.core/TransientVector"; +cljs.core.TransientVector.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/TransientVector"); +}; cljs.core.__GT_TransientVector = function(a, b, c, d) { - return new cljs.core.TransientVector(a, b, c, d) + return new cljs.core.TransientVector(a, b, c, d); }; cljs.core.PersistentQueueSeq = function(a, b, c, d) { this.meta = a; @@ -8762,46 +12942,52 @@ cljs.core.PersistentQueueSeq = function(a, b, c, d) { this.rear = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 31850572 + this.cljs$lang$protocol_mask$partition0$ = 31850572; }; -cljs.core.PersistentQueueSeq.cljs$lang$type = !0; -cljs.core.PersistentQueueSeq.cljs$lang$ctorStr = "cljs.core/PersistentQueueSeq"; -cljs.core.PersistentQueueSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentQueueSeq") +cljs.core.PersistentQueueSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.PersistentQueueSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.PersistentQueueSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) -}; -cljs.core.PersistentQueueSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.PersistentQueueSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this +cljs.core.PersistentQueueSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first.call(null, this.front) + return cljs.core.first(this.front); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return(a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueueSeq(this.meta, a, this.rear, null) : null == this.rear ? cljs.core._empty.call(null, this) : new cljs.core.PersistentQueueSeq(this.meta, this.rear, null, null) + return(a = cljs.core.next(this.front)) ? new cljs.core.PersistentQueueSeq(this.meta, a, this.rear, null) : null == this.rear ? cljs.core._empty(this) : new cljs.core.PersistentQueueSeq(this.meta, this.rear, null, null); }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentQueueSeq(b, this.front, this.rear, this.__hash) + return new cljs.core.PersistentQueueSeq(b, this.front, this.rear, this.__hash); }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.PersistentQueueSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.PersistentQueueSeq.cljs$lang$type = !0; +cljs.core.PersistentQueueSeq.cljs$lang$ctorStr = "cljs.core/PersistentQueueSeq"; +cljs.core.PersistentQueueSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentQueueSeq"); }; cljs.core.__GT_PersistentQueueSeq = function(a, b, c, d) { - return new cljs.core.PersistentQueueSeq(a, b, c, d) + return new cljs.core.PersistentQueueSeq(a, b, c, d); +}; +cljs.core.PersistentQueueSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.PersistentQueue = function(a, b, c, d, e) { this.meta = a; @@ -8809,127 +12995,139 @@ cljs.core.PersistentQueue = function(a, b, c, d, e) { this.front = c; this.rear = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 31858766 + this.cljs$lang$protocol_mask$partition0$ = 31858766; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.PersistentQueue.cljs$lang$type = !0; -cljs.core.PersistentQueue.cljs$lang$ctorStr = "cljs.core/PersistentQueue"; -cljs.core.PersistentQueue.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentQueue") -}; -cljs.core.PersistentQueue.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.PersistentQueue.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.PersistentQueue.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - var c = this; - return cljs.core.truth_(c.front) ? new cljs.core.PersistentQueue(c.meta, c.count + 1, c.front, cljs.core.conj.call(null, function() { - var a = c.rear; - return cljs.core.truth_(a) ? a : cljs.core.PersistentVector.EMPTY - }(), b), null) : new cljs.core.PersistentQueue(c.meta, c.count + 1, cljs.core.conj.call(null, c.front, b), cljs.core.PersistentVector.EMPTY, null) +cljs.core.PersistentQueue.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; -cljs.core.PersistentQueue.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.PersistentQueue.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.PersistentQueue.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - var b = this, c = cljs.core.seq.call(null, b.rear); - return cljs.core.truth_(function() { - var a = b.front; - return cljs.core.truth_(a) ? a : c - }()) ? new cljs.core.PersistentQueueSeq(null, b.front, cljs.core.seq.call(null, c), null) : null +cljs.core.PersistentQueue.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentQueue(this.meta, this.count, this.front, this.rear, this.__hash); }; cljs.core.PersistentQueue.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.count + return this.count; }; cljs.core.PersistentQueue.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return cljs.core.first.call(null, this.front) + return cljs.core.first(this.front); }; cljs.core.PersistentQueue.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return cljs.core.truth_(this.front) ? (a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueue(this.meta, this.count - 1, a, this.rear, null) : new cljs.core.PersistentQueue(this.meta, this.count - 1, cljs.core.seq.call(null, this.rear), cljs.core.PersistentVector.EMPTY, null) : this + return cljs.core.truth_(this.front) ? (a = cljs.core.next(this.front)) ? new cljs.core.PersistentQueue(this.meta, this.count - 1, a, this.rear, null) : new cljs.core.PersistentQueue(this.meta, this.count - 1, cljs.core.seq(this.rear), cljs.core.PersistentVector.EMPTY, null) : this; +}; +cljs.core.PersistentQueue.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +}; +cljs.core.PersistentQueue.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.PersistentQueue.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.PersistentQueue.EMPTY, this.meta); }; cljs.core.PersistentQueue.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first.call(null, this.front) + return cljs.core.first(this.front); }; cljs.core.PersistentQueue.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.rest.call(null, cljs.core.seq.call(null, this)) + return cljs.core.rest(cljs.core.seq(this)); }; -cljs.core.PersistentQueue.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.PersistentQueue.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + var b = this, c = cljs.core.seq(b.rear); + return cljs.core.truth_(function() { + var a = b.front; + return cljs.core.truth_(a) ? a : c; + }()) ? new cljs.core.PersistentQueueSeq(null, b.front, cljs.core.seq(c), null) : null; }; cljs.core.PersistentQueue.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentQueue(b, this.count, this.front, this.rear, this.__hash) + return new cljs.core.PersistentQueue(b, this.count, this.front, this.rear, this.__hash); }; -cljs.core.PersistentQueue.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.PersistentQueue.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + var c = this; + return cljs.core.truth_(c.front) ? new cljs.core.PersistentQueue(c.meta, c.count + 1, c.front, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(function() { + var a = c.rear; + return cljs.core.truth_(a) ? a : cljs.core.PersistentVector.EMPTY; + }(), b), null) : new cljs.core.PersistentQueue(c.meta, c.count + 1, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(c.front, b), cljs.core.PersistentVector.EMPTY, null); }; -cljs.core.PersistentQueue.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentQueue.EMPTY +cljs.core.PersistentQueue.cljs$lang$type = !0; +cljs.core.PersistentQueue.cljs$lang$ctorStr = "cljs.core/PersistentQueue"; +cljs.core.PersistentQueue.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentQueue"); }; cljs.core.__GT_PersistentQueue = function(a, b, c, d, e) { - return new cljs.core.PersistentQueue(a, b, c, d, e) + return new cljs.core.PersistentQueue(a, b, c, d, e); +}; +cljs.core.PersistentQueue.EMPTY = new cljs.core.PersistentQueue(null, 0, null, cljs.core.PersistentVector.EMPTY, cljs.core.empty_ordered_hash); +cljs.core.PersistentQueue.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; -cljs.core.PersistentQueue.EMPTY = new cljs.core.PersistentQueue(null, 0, null, cljs.core.PersistentVector.EMPTY, 0); cljs.core.NeverEquiv = function() { this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2097152 + this.cljs$lang$protocol_mask$partition0$ = 2097152; +}; +cljs.core.NeverEquiv.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return!1; +}; +cljs.core.NeverEquiv.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; cljs.core.NeverEquiv.cljs$lang$type = !0; cljs.core.NeverEquiv.cljs$lang$ctorStr = "cljs.core/NeverEquiv"; cljs.core.NeverEquiv.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/NeverEquiv") -}; -cljs.core.NeverEquiv.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return!1 + return cljs.core._write(b, "cljs.core/NeverEquiv"); }; cljs.core.__GT_NeverEquiv = function() { - return new cljs.core.NeverEquiv + return new cljs.core.NeverEquiv; }; cljs.core.never_equiv = new cljs.core.NeverEquiv; cljs.core.equiv_map = function(a, b) { - return cljs.core.boolean$.call(null, cljs.core.map_QMARK_.call(null, b) ? cljs.core.count.call(null, a) === cljs.core.count.call(null, b) ? cljs.core.every_QMARK_.call(null, cljs.core.identity, cljs.core.map.call(null, function(a) { - return cljs.core._EQ_.call(null, cljs.core.get.call(null, b, cljs.core.first.call(null, a), cljs.core.never_equiv), cljs.core.second.call(null, a)) - }, a)) : null : null) + return cljs.core.boolean$(cljs.core.map_QMARK_(b) ? cljs.core.count(a) === cljs.core.count(b) ? cljs.core.every_QMARK_(cljs.core.identity, cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(a) { + return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(a), cljs.core.never_equiv), cljs.core.second(a)); + }, a)) : null : null); }; cljs.core.scan_array = function(a, b, c) { - for(var d = c.length, e = 0;;) { - if(e < d) { - if(b === c[e]) { - return e + for (var d = c.length, e = 0;;) { + if (e < d) { + if (b === c[e]) { + return e; } - e += a - }else { - return null + e += a; + } else { + return null; } } }; cljs.core.obj_map_compare_keys = function(a, b) { - var c = cljs.core.hash.call(null, a), d = cljs.core.hash.call(null, b); - return c < d ? -1 : c > d ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null + var c = cljs.core.hash(a), d = cljs.core.hash(b); + return c < d ? -1 : c > d ? 1 : 0; }; cljs.core.obj_map__GT_hash_map = function(a, b, c) { var d = a.keys, e = d.length, f = a.strobj; - a = cljs.core.meta.call(null, a); - for(var g = 0, h = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { - if(g < e) { - var k = d[g], g = g + 1, h = cljs.core.assoc_BANG_.call(null, h, k, f[k]) - }else { - return cljs.core.with_meta.call(null, cljs.core.persistent_BANG_.call(null, cljs.core.assoc_BANG_.call(null, h, b, c)), a) + a = cljs.core.meta(a); + for (var g = 0, h = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { + if (g < e) { + var k = d[g], g = g + 1, h = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(h, k, f[k]) + } else { + return cljs.core.with_meta(cljs.core.persistent_BANG_(cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(h, b, c)), a); } } }; cljs.core.obj_clone = function(a, b) { var c; c = {}; - for(var d = b.length, e = 0;;) { - if(e < d) { + for (var d = b.length, e = 0;;) { + if (e < d) { var f = b[e]; c[f] = a[f]; - e += 1 - }else { - break + e += 1; + } else { + break; } } - return c + return c; }; cljs.core.ObjMap = function(a, b, c, d, e) { this.meta = a; @@ -8937,825 +13135,1050 @@ cljs.core.ObjMap = function(a, b, c, d, e) { this.strobj = c; this.update_count = d; this.__hash = e; + this.cljs$lang$protocol_mask$partition0$ = 16123663; this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 16123663 }; -cljs.core.ObjMap.cljs$lang$type = !0; -cljs.core.ObjMap.cljs$lang$ctorStr = "cljs.core/ObjMap"; -cljs.core.ObjMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ObjMap") +cljs.core.ObjMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.ObjMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return cljs.core.transient$.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this)) +cljs.core.ObjMap.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); +}; +cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + var d = this; + return cljs.core.truth_(function() { + var a; + a = goog.isString(b); + return cljs.core.truth_(a) ? null != cljs.core.scan_array(1, b, d.keys) : a; + }()) ? d.strobj[b] : c; +}; +cljs.core.ObjMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { + a = this.keys.sort(cljs.core.obj_map_compare_keys); + for (var d = c;;) { + if (cljs.core.seq(a)) { + var e = c = cljs.core.first(a); + c = this.strobj[c]; + c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(d, e, c) : b.call(null, d, e, c); + if (cljs.core.reduced_QMARK_(c)) { + return b = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + } + a = cljs.core.rest(a); + d = c; + } else { + return d; + } + } +}; +cljs.core.ObjMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.ObjMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.keys.length; }; cljs.core.ObjMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); }; -cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) +cljs.core.ObjMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_map(this, b); }; -cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? this.strobj[b] : c +cljs.core.ObjMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return cljs.core.transient$(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentHashMap.EMPTY, this)); +}; +cljs.core.ObjMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.ObjMap.EMPTY, this.meta); +}; +cljs.core.ObjMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { + var c = this; + if (cljs.core.truth_(function() { + var a; + a = goog.isString(b); + return cljs.core.truth_(a) ? null != cljs.core.scan_array(1, b, c.keys) : a; + }())) { + var d = cljs.core.aclone(c.keys), e = cljs.core.obj_clone(c.strobj, c.keys); + d.splice(cljs.core.scan_array(1, b, d), 1); + delete e[b]; + return new cljs.core.ObjMap(c.meta, d, e, c.update_count + 1, null); + } + return this; }; cljs.core.ObjMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if(goog.isString(b)) { - if(this.update_count > cljs.core.ObjMap.HASHMAP_THRESHOLD || this.keys.length >= cljs.core.ObjMap.HASHMAP_THRESHOLD) { - return cljs.core.obj_map__GT_hash_map.call(null, this, b, c) + if (cljs.core.truth_(goog.isString(b))) { + if (this.update_count > cljs.core.ObjMap.HASHMAP_THRESHOLD || this.keys.length >= cljs.core.ObjMap.HASHMAP_THRESHOLD) { + return cljs.core.obj_map__GT_hash_map(this, b, c); } - if(null != cljs.core.scan_array.call(null, 1, b, this.keys)) { - return a = cljs.core.obj_clone.call(null, this.strobj, this.keys), a[b] = c, new cljs.core.ObjMap(this.meta, this.keys, a, this.update_count + 1, null) + if (null != cljs.core.scan_array(1, b, this.keys)) { + return a = cljs.core.obj_clone(this.strobj, this.keys), a[b] = c, new cljs.core.ObjMap(this.meta, this.keys, a, this.update_count + 1, null); } - a = cljs.core.obj_clone.call(null, this.strobj, this.keys); - var d = cljs.core.aclone.call(null, this.keys); + a = cljs.core.obj_clone(this.strobj, this.keys); + var d = cljs.core.aclone(this.keys); a[b] = c; d.push(b); - return new cljs.core.ObjMap(this.meta, d, a, this.update_count + 1, null) + return new cljs.core.ObjMap(this.meta, d, a, this.update_count + 1, null); } - return cljs.core.obj_map__GT_hash_map.call(null, this, b, c) + return cljs.core.obj_map__GT_hash_map(this, b, c); }; cljs.core.ObjMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? !0 : !1 + var c = this; + return cljs.core.truth_(function() { + var a; + a = goog.isString(b); + return cljs.core.truth_(a) ? null != cljs.core.scan_array(1, b, c.keys) : a; + }()) ? !0 : !1; +}; +cljs.core.ObjMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + var b = this; + return 0 < b.keys.length ? cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(a) { + return function(a) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, b.strobj[a]], null); + }; + }(this), b.keys.sort(cljs.core.obj_map_compare_keys)) : null; +}; +cljs.core.ObjMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.ObjMap(b, this.keys, this.strobj, this.update_count, this.__hash); +}; +cljs.core.ObjMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.vector_QMARK_(b) ? cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, this, b); }; cljs.core.ObjMap.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); cljs.core.ObjMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.ObjMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.ObjMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; -cljs.core.ObjMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - for(a = this.keys.sort(cljs.core.obj_map_compare_keys);;) { - if(cljs.core.seq.call(null, a)) { - var d = cljs.core.first.call(null, a); - c = b.call(null, c, d, this.strobj[d]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) - } - a = cljs.core.rest.call(null, a) - }else { - return c - } - } +cljs.core.ObjMap.cljs$lang$type = !0; +cljs.core.ObjMap.cljs$lang$ctorStr = "cljs.core/ObjMap"; +cljs.core.ObjMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ObjMap"); }; -cljs.core.ObjMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) +cljs.core.__GT_ObjMap = function(a, b, c, d, e) { + return new cljs.core.ObjMap(a, b, c, d, e); }; -cljs.core.ObjMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.ObjMap.EMPTY = new cljs.core.ObjMap(null, [], function() { + return{}; +}(), 0, cljs.core.empty_unordered_hash); +cljs.core.ObjMap.HASHMAP_THRESHOLD = 8; +cljs.core.ObjMap.fromObject = function(a, b) { + return new cljs.core.ObjMap(null, a, b, 0, null); }; -cljs.core.ObjMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - var b = this; - return 0 < b.keys.length ? cljs.core.map.call(null, function(a) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, b.strobj[a]], null) - }, b.keys.sort(cljs.core.obj_map_compare_keys)) : null +cljs.core.ES6EntriesIterator = function(a) { + this.s = a; }; -cljs.core.ObjMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.keys.length +cljs.core.ES6EntriesIterator.prototype.next = function() { + if (null != this.s) { + var a = cljs.core.first(this.s), b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 1, null); + this.s = cljs.core.next(this.s); + return{done:!1, value:[b, a]}; + } + return{done:!0, value:null}; }; -cljs.core.ObjMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) +cljs.core.ES6EntriesIterator.cljs$lang$type = !0; +cljs.core.ES6EntriesIterator.cljs$lang$ctorStr = "cljs.core/ES6EntriesIterator"; +cljs.core.ES6EntriesIterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ES6EntriesIterator"); }; -cljs.core.ObjMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ObjMap(b, this.keys, this.strobj, this.update_count, this.__hash) +cljs.core.__GT_ES6EntriesIterator = function(a) { + return new cljs.core.ES6EntriesIterator(a); }; -cljs.core.ObjMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.es6_entries_iterator = function(a) { + return new cljs.core.ES6EntriesIterator(cljs.core.seq(a)); }; -cljs.core.ObjMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.ObjMap.EMPTY, this.meta) +cljs.core.ES6SetEntriesIterator = function(a) { + this.s = a; }; -cljs.core.ObjMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if(goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys)) { - var c = cljs.core.aclone.call(null, this.keys), d = cljs.core.obj_clone.call(null, this.strobj, this.keys); - c.splice(cljs.core.scan_array.call(null, 1, b, c), 1); - delete d[b]; - return new cljs.core.ObjMap(this.meta, c, d, this.update_count + 1, null) +cljs.core.ES6SetEntriesIterator.prototype.next = function() { + if (null != this.s) { + var a = cljs.core.first(this.s); + this.s = cljs.core.next(this.s); + return{done:!1, value:[a, a]}; } - return this + return{done:!0, value:null}; }; -cljs.core.__GT_ObjMap = function(a, b, c, d, e) { - return new cljs.core.ObjMap(a, b, c, d, e) +cljs.core.ES6SetEntriesIterator.cljs$lang$type = !0; +cljs.core.ES6SetEntriesIterator.cljs$lang$ctorStr = "cljs.core/ES6SetEntriesIterator"; +cljs.core.ES6SetEntriesIterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ES6SetEntriesIterator"); }; -cljs.core.ObjMap.EMPTY = new cljs.core.ObjMap(null, [], function() { - return{} -}(), 0, 0); -cljs.core.ObjMap.HASHMAP_THRESHOLD = 8; -cljs.core.ObjMap.fromObject = function(a, b) { - return new cljs.core.ObjMap(null, a, b, 0, null) +cljs.core.__GT_ES6SetEntriesIterator = function(a) { + return new cljs.core.ES6SetEntriesIterator(a); +}; +cljs.core.es6_set_entries_iterator = function(a) { + return new cljs.core.ES6SetEntriesIterator(cljs.core.seq(a)); }; cljs.core.array_map_index_of_nil_QMARK_ = function(a, b, c) { b = a.length; - for(c = 0;;) { - if(b <= c) { - return-1 - } - if(null == a[c]) { - return c + for (c = 0;;) { + if (b <= c) { + return-1; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - c += 2 - }else { - return null + if (null == a[c]) { + return c; } + c += 2; } }; cljs.core.array_map_index_of_keyword_QMARK_ = function(a, b, c) { b = a.length; c = c.fqn; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } var e = a[d]; - if(e instanceof cljs.core.Keyword && c === e.fqn) { - return d - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (e instanceof cljs.core.Keyword && c === e.fqn) { + return d; } + d += 2; } }; cljs.core.array_map_index_of_symbol_QMARK_ = function(a, b, c) { b = a.length; c = c.str; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } var e = a[d]; - if(e instanceof cljs.core.Symbol && c === e.str) { - return d - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (e instanceof cljs.core.Symbol && c === e.str) { + return d; } + d += 2; } }; cljs.core.array_map_index_of_identical_QMARK_ = function(a, b, c) { b = a.length; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } - if(c === a[d]) { - return d - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (c === a[d]) { + return d; } + d += 2; } }; cljs.core.array_map_index_of_equiv_QMARK_ = function(a, b, c) { b = a.length; - for(var d = 0;;) { - if(b <= d) { - return-1 - } - if(cljs.core._EQ_.call(null, c, a[d])) { - return d + for (var d = 0;;) { + if (b <= d) { + return-1; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, a[d])) { + return d; } + d += 2; } }; cljs.core.array_map_index_of = function(a, b) { var c = a.arr; - return b instanceof cljs.core.Keyword ? cljs.core.array_map_index_of_keyword_QMARK_.call(null, c, a, b) : goog.isString(b) || "number" === typeof b ? cljs.core.array_map_index_of_identical_QMARK_.call(null, c, a, b) : b instanceof cljs.core.Symbol ? cljs.core.array_map_index_of_symbol_QMARK_.call(null, c, a, b) : null == b ? cljs.core.array_map_index_of_nil_QMARK_.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.array_map_index_of_equiv_QMARK_.call(null, - c, a, b) : null + return b instanceof cljs.core.Keyword ? cljs.core.array_map_index_of_keyword_QMARK_(c, a, b) : cljs.core.truth_(function() { + var a; + a = goog.isString(b); + return cljs.core.truth_(a) ? a : "number" === typeof b; + }()) ? cljs.core.array_map_index_of_identical_QMARK_(c, a, b) : b instanceof cljs.core.Symbol ? cljs.core.array_map_index_of_symbol_QMARK_(c, a, b) : null == b ? cljs.core.array_map_index_of_nil_QMARK_(c, a, b) : cljs.core.array_map_index_of_equiv_QMARK_(c, a, b); }; cljs.core.array_map_extend_kv = function(a, b, c) { a = a.arr; - for(var d = a.length, e = Array(d + 2), f = 0;;) { - if(f < d) { - e[f] = a[f], f += 1 - }else { - break + for (var d = a.length, e = Array(d + 2), f = 0;;) { + if (f < d) { + e[f] = a[f], f += 1; + } else { + break; } } e[d] = b; e[d + 1] = c; - return e + return e; }; cljs.core.PersistentArrayMapSeq = function(a, b, c) { this.arr = a; this.i = b; this._meta = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374990 + this.cljs$lang$protocol_mask$partition0$ = 32374990; }; -cljs.core.PersistentArrayMapSeq.cljs$lang$type = !0; -cljs.core.PersistentArrayMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapSeq"; -cljs.core.PersistentArrayMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMapSeq") +cljs.core.PersistentArrayMapSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) +cljs.core.PersistentArrayMapSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : null + return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : null; }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return(this.arr.length - this.i) / 2; }; -cljs.core.PersistentArrayMapSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_ordered_coll(this); +}; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this._meta); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); +}; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null); +}; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : cljs.core.List.EMPTY; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return(this.arr.length - this.i) / 2 +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentArrayMapSeq(this.arr, this.i, b); }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null) +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); +}; +cljs.core.PersistentArrayMapSeq.cljs$lang$type = !0; +cljs.core.PersistentArrayMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapSeq"; +cljs.core.PersistentArrayMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentArrayMapSeq"); +}; +cljs.core.__GT_PersistentArrayMapSeq = function(a, b, c) { + return new cljs.core.PersistentArrayMapSeq(a, b, c); }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : cljs.core.List.EMPTY +cljs.core.PersistentArrayMapSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.persistent_array_map_seq = function(a, b, c) { + return b <= a.length - 2 ? new cljs.core.PersistentArrayMapSeq(a, b, c) : null; }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentArrayMapSeq(this.arr, this.i, b) +cljs.core.PersistentArrayMapIterator = function(a, b, c) { + this.arr = a; + this.i = b; + this.cnt = c; }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta +cljs.core.PersistentArrayMapIterator.prototype.hasNext = function() { + return this.i < this.cnt; }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) +cljs.core.PersistentArrayMapIterator.prototype.next = function() { + var a = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null); + this.i += 2; + return a; }; -cljs.core.__GT_PersistentArrayMapSeq = function(a, b, c) { - return new cljs.core.PersistentArrayMapSeq(a, b, c) +cljs.core.PersistentArrayMapIterator.cljs$lang$type = !0; +cljs.core.PersistentArrayMapIterator.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapIterator"; +cljs.core.PersistentArrayMapIterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentArrayMapIterator"); }; -cljs.core.persistent_array_map_seq = function(a, b, c) { - return b <= a.length - 2 ? new cljs.core.PersistentArrayMapSeq(a, b, c) : null +cljs.core.__GT_PersistentArrayMapIterator = function(a, b, c) { + return new cljs.core.PersistentArrayMapIterator(a, b, c); }; cljs.core.PersistentArrayMap = function(a, b, c, d) { this.meta = a; this.cnt = b; this.arr = c; this.__hash = d; - this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 16123663 + this.cljs$lang$protocol_mask$partition0$ = 16647951; + this.cljs$lang$protocol_mask$partition1$ = 8196; }; -cljs.core.PersistentArrayMap.cljs$lang$type = !0; -cljs.core.PersistentArrayMap.cljs$lang$ctorStr = "cljs.core/PersistentArrayMap"; -cljs.core.PersistentArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMap") +cljs.core.PersistentArrayMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientArrayMap({}, this.arr.length, cljs.core.aclone.call(null, this.arr)) +cljs.core.PersistentArrayMap.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) +cljs.core.PersistentArrayMap.prototype.keys = function() { + return cljs.core.es6_iterator(cljs.core.keys.cljs$core$IFn$_invoke$arity$1 ? cljs.core.keys.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.keys.call(null, this)); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) +cljs.core.PersistentArrayMap.prototype.entries = function() { + return cljs.core.es6_entries_iterator(cljs.core.seq(this)); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - a = cljs.core.array_map_index_of.call(null, this, b); - return-1 === a ? c : this.arr[a + 1] +cljs.core.PersistentArrayMap.prototype.values = function() { + return cljs.core.es6_iterator(cljs.core.vals.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vals.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.vals.call(null, this)); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - a = cljs.core.array_map_index_of.call(null, this, b); - return-1 === a ? this.cnt < cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (c = cljs.core.array_map_extend_kv.call(null, this, b, c), new cljs.core.PersistentArrayMap(this.meta, this.cnt + 1, c, null)) : cljs.core._with_meta.call(null, cljs.core._assoc.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this), b, c), this.meta) : c === this.arr[a + 1] ? this : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = cljs.core.aclone.call(null, this.arr), b[a + 1] = c, - new cljs.core.PersistentArrayMap(this.meta, this.cnt, b, null)) : null +cljs.core.PersistentArrayMap.prototype.has = function(a) { + return cljs.core.contains_QMARK_(this, a); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return-1 !== cljs.core.array_map_index_of.call(null, this, b) +cljs.core.PersistentArrayMap.prototype.get = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; -cljs.core.PersistentArrayMap.prototype.call = function() { - var a = null; - return a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) +cljs.core.PersistentArrayMap.prototype.forEach = function(a) { + for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { + if (e < d) { + var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); + a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); + e += 1; + } else { + if (b = cljs.core.seq(b)) { + cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; + } else { + return null; + } } - throw Error("Invalid arity: " + arguments.length); } -}(); -cljs.core.PersistentArrayMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) +cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) +cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + a = cljs.core.array_map_index_of(this, b); + return-1 === a ? c : this.arr[a + 1]; }; cljs.core.PersistentArrayMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { a = this.arr.length; - for(var d = 0;;) { - if(d < a) { - c = b.call(null, c, this.arr[d], this.arr[d + 1]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + for (var d = 0;;) { + if (d < a) { + var e = this.arr[d], f = this.arr[d + 1]; + c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, e, f) : b.call(null, c, e, f); + if (cljs.core.reduced_QMARK_(c)) { + return b = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); } - d += 2 - }else { - return c + d += 2; + } else { + return c; } } }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) +cljs.core.PersistentArrayMap.prototype.cljs$core$IIterable$ = !0; +cljs.core.PersistentArrayMap.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { + return new cljs.core.PersistentArrayMapIterator(this.arr, 0, 2 * this.cnt); }; -cljs.core.PersistentArrayMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.PersistentArrayMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.persistent_array_map_seq.call(null, this.arr, 0, null) +cljs.core.PersistentArrayMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentArrayMap(this.meta, this.cnt, this.arr, this.__hash); }; cljs.core.PersistentArrayMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt + return this.cnt; }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) +cljs.core.PersistentArrayMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentArrayMap(b, this.cnt, this.arr, this.__hash) +cljs.core.PersistentArrayMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + if (b && (b.cljs$lang$protocol_mask$partition0$ & 1024 || b.cljs$core$IMap$)) { + var c = this.arr.length; + if (this.cnt === b.cljs$core$ICounted$_count$arity$1(null)) { + for (var d = 0;;) { + if (d < c) { + var e = b.cljs$core$ILookup$_lookup$arity$3(null, this.arr[d], cljs.core.lookup_sentinel); + if (e !== cljs.core.lookup_sentinel) { + if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this.arr[d + 1], e)) { + d += 2; + } else { + return!1; + } + } else { + return!1; + } + } else { + return!0; + } + } + } else { + return!1; + } + } else { + return cljs.core.equiv_map(this, b); + } }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.PersistentArrayMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return new cljs.core.TransientArrayMap({}, this.arr.length, cljs.core.aclone(this.arr)); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta.call(null, cljs.core.PersistentArrayMap.EMPTY, this.meta) + return cljs.core._with_meta(cljs.core.PersistentArrayMap.EMPTY, this.meta); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if(0 <= cljs.core.array_map_index_of.call(null, this, b)) { + if (0 <= cljs.core.array_map_index_of(this, b)) { var c = this.arr.length, d = c - 2; - if(0 === d) { - return cljs.core._empty.call(null, this) + if (0 === d) { + return cljs.core._empty(this); } - for(var d = Array(d), e = 0, f = 0;;) { - if(e >= c) { - return new cljs.core.PersistentArrayMap(this.meta, this.cnt - 1, d, null) - } - if(cljs.core._EQ_.call(null, b, this.arr[e])) { - e += 2 - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d[f] = this.arr[e], d[f + 1] = this.arr[e + 1], f += 2, e += 2 - }else { - return null - } + for (var d = Array(d), e = 0, f = 0;;) { + if (e >= c) { + return new cljs.core.PersistentArrayMap(this.meta, this.cnt - 1, d, null); } + cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(b, this.arr[e]) || (d[f] = this.arr[e], d[f + 1] = this.arr[e + 1], f += 2); + e += 2; + } + } else { + return this; + } +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + a = cljs.core.array_map_index_of(this, b); + if (-1 === a) { + return this.cnt < cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (c = cljs.core.array_map_extend_kv(this, b, c), new cljs.core.PersistentArrayMap(this.meta, this.cnt + 1, c, null)) : cljs.core._with_meta(cljs.core._assoc(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentHashMap.EMPTY, this), b, c), this.meta); + } + if (c === this.arr[a + 1]) { + return this; + } + b = cljs.core.aclone(this.arr); + b[a + 1] = c; + return new cljs.core.PersistentArrayMap(this.meta, this.cnt, b, null); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { + return-1 !== cljs.core.array_map_index_of(this, b); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.persistent_array_map_seq(this.arr, 0, null); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentArrayMap(b, this.cnt, this.arr, this.__hash); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + if (cljs.core.vector_QMARK_(b)) { + return cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)); + } + for (var c = this, d = cljs.core.seq(b);;) { + if (null == d) { + return c; + } + var e = cljs.core.first(d); + if (cljs.core.vector_QMARK_(e)) { + c = cljs.core._assoc(c, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 1)), d = cljs.core.next(d); + } else { + throw Error("conj on a map takes map entries or seqables of map entries"); } - }else { - return this } }; +cljs.core.PersistentArrayMap.prototype.call = function() { + var a = null, a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + case 3: + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; +}(); +cljs.core.PersistentArrayMap.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); +}; +cljs.core.PersistentArrayMap.cljs$lang$type = !0; +cljs.core.PersistentArrayMap.cljs$lang$ctorStr = "cljs.core/PersistentArrayMap"; +cljs.core.PersistentArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentArrayMap"); +}; cljs.core.__GT_PersistentArrayMap = function(a, b, c, d) { - return new cljs.core.PersistentArrayMap(a, b, c, d) + return new cljs.core.PersistentArrayMap(a, b, c, d); }; -cljs.core.PersistentArrayMap.EMPTY = new cljs.core.PersistentArrayMap(null, 0, [], null); +cljs.core.PersistentArrayMap.EMPTY = new cljs.core.PersistentArrayMap(null, 0, [], cljs.core.empty_unordered_hash); cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD = 8; cljs.core.PersistentArrayMap.fromArray = function(a, b, c) { - a = b ? a : cljs.core.aclone.call(null, a); - if(c) { - return new cljs.core.PersistentArrayMap(null, a.length / 2, a, null) + a = b ? a : cljs.core.aclone(a); + if (c) { + return new cljs.core.PersistentArrayMap(null, a.length / 2, a, null); } c = a.length; b = 0; - for(var d = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { - if(b < c) { - var e = b + 2, d = cljs.core._assoc_BANG_.call(null, d, a[b], a[b + 1]); - b = e - }else { - return cljs.core._persistent_BANG_.call(null, d) + for (var d = cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY);;) { + if (b < c) { + var e = b + 2, d = cljs.core._assoc_BANG_(d, a[b], a[b + 1]); + b = e; + } else { + return cljs.core._persistent_BANG_(d); } } }; +cljs.core.PersistentArrayMap.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; cljs.core.TransientArrayMap = function(a, b, c) { this.editable_QMARK_ = a; this.len = b; this.arr = c; this.cljs$lang$protocol_mask$partition1$ = 56; - this.cljs$lang$protocol_mask$partition0$ = 258 -}; -cljs.core.TransientArrayMap.cljs$lang$type = !0; -cljs.core.TransientArrayMap.cljs$lang$ctorStr = "cljs.core/TransientArrayMap"; -cljs.core.TransientArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientArrayMap") + this.cljs$lang$protocol_mask$partition0$ = 258; }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 = function(a, b) { - if(cljs.core.truth_(this.editable_QMARK_)) { - var c = cljs.core.array_map_index_of.call(null, this, b); + if (cljs.core.truth_(this.editable_QMARK_)) { + var c = cljs.core.array_map_index_of(this, b); 0 <= c && (this.arr[c] = this.arr[this.len - 2], this.arr[c + 1] = this.arr[this.len - 1], c = this.arr, c.pop(), c.pop(), this.len -= 2); - return this + return this; } throw Error("dissoc! after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - if(cljs.core.truth_(this.editable_QMARK_)) { - a = cljs.core.array_map_index_of.call(null, this, b); - if(-1 === a) { - return this.len + 2 <= 2 * cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (this.len += 2, this.arr.push(b), this.arr.push(c), this) : cljs.core.assoc_BANG_.call(null, cljs.core.array__GT_transient_hash_map.call(null, this.len, this.arr), b, c) + var d = this; + if (cljs.core.truth_(d.editable_QMARK_)) { + a = cljs.core.array_map_index_of(this, b); + if (-1 === a) { + return d.len + 2 <= 2 * cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (d.len += 2, d.arr.push(b), d.arr.push(c), this) : cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(function() { + var a = d.len, b = d.arr; + return cljs.core.array__GT_transient_hash_map.cljs$core$IFn$_invoke$arity$2 ? cljs.core.array__GT_transient_hash_map.cljs$core$IFn$_invoke$arity$2(a, b) : cljs.core.array__GT_transient_hash_map.call(null, a, b); + }(), b, c); } - c !== this.arr[a + 1] && (this.arr[a + 1] = c); - return this + c !== d.arr[a + 1] && (d.arr[a + 1] = c); + return this; } throw Error("assoc! after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - if(cljs.core.truth_(this.editable_QMARK_)) { - if(b ? b.cljs$lang$protocol_mask$partition0$ & 2048 || b.cljs$core$IMapEntry$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) { - return cljs.core._assoc_BANG_.call(null, this, cljs.core.key.call(null, b), cljs.core.val.call(null, b)) - } - for(var c = cljs.core.seq.call(null, b), d = this;;) { - var e = cljs.core.first.call(null, c); - if(cljs.core.truth_(e)) { - c = cljs.core.next.call(null, c), d = cljs.core._assoc_BANG_.call(null, d, cljs.core.key.call(null, e), cljs.core.val.call(null, e)) - }else { - return d + if (cljs.core.truth_(this.editable_QMARK_)) { + if (b ? b.cljs$lang$protocol_mask$partition0$ & 2048 || b.cljs$core$IMapEntry$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, b)) : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, b)) { + return cljs.core._assoc_BANG_(this, cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.key.call(null, b), cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.val.call(null, b)); + } + for (var c = cljs.core.seq(b), d = this;;) { + var e = cljs.core.first(c); + if (cljs.core.truth_(e)) { + var f = e, c = cljs.core.next(c), d = cljs.core._assoc_BANG_(d, function() { + var a = f; + return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a); + }(), function() { + var a = f; + return cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a); + }()) + } else { + return d; } } - }else { + } else { throw Error("conj! after persistent!"); } }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - if(cljs.core.truth_(this.editable_QMARK_)) { - return this.editable_QMARK_ = !1, new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, this.len, 2), this.arr, null) + if (cljs.core.truth_(this.editable_QMARK_)) { + return this.editable_QMARK_ = !1, new cljs.core.PersistentArrayMap(null, cljs.core.quot(this.len, 2), this.arr, null); } throw Error("persistent! called twice"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.TransientArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - if(cljs.core.truth_(this.editable_QMARK_)) { - return a = cljs.core.array_map_index_of.call(null, this, b), -1 === a ? c : this.arr[a + 1] + if (cljs.core.truth_(this.editable_QMARK_)) { + return a = cljs.core.array_map_index_of(this, b), -1 === a ? c : this.arr[a + 1]; } throw Error("lookup after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if(cljs.core.truth_(this.editable_QMARK_)) { - return cljs.core.quot.call(null, this.len, 2) + if (cljs.core.truth_(this.editable_QMARK_)) { + return cljs.core.quot(this.len, 2); } throw Error("count after persistent!"); }; +cljs.core.TransientArrayMap.cljs$lang$type = !0; +cljs.core.TransientArrayMap.cljs$lang$ctorStr = "cljs.core/TransientArrayMap"; +cljs.core.TransientArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/TransientArrayMap"); +}; cljs.core.__GT_TransientArrayMap = function(a, b, c) { - return new cljs.core.TransientArrayMap(a, b, c) + return new cljs.core.TransientArrayMap(a, b, c); }; cljs.core.array__GT_transient_hash_map = function(a, b) { - for(var c = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY), d = 0;;) { - if(d < a) { - c = cljs.core.assoc_BANG_.call(null, c, b[d], b[d + 1]), d += 2 - }else { - return c + for (var c = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY), d = 0;;) { + if (d < a) { + c = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(c, b[d], b[d + 1]), d += 2; + } else { + return c; } } }; cljs.core.Box = function(a) { - this.val = a + this.val = a; }; cljs.core.Box.cljs$lang$type = !0; cljs.core.Box.cljs$lang$ctorStr = "cljs.core/Box"; cljs.core.Box.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Box") + return cljs.core._write(b, "cljs.core/Box"); }; cljs.core.__GT_Box = function(a) { - return new cljs.core.Box(a) + return new cljs.core.Box(a); }; cljs.core.key_test = function(a, b) { - return a === b ? !0 : cljs.core.keyword_identical_QMARK_.call(null, a, b) ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._EQ_.call(null, a, b) : null + return a === b ? !0 : cljs.core.keyword_identical_QMARK_(a, b) ? !0 : cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b); }; cljs.core.mask = function(a, b) { - return a >>> b & 31 + return a >>> b & 31; }; cljs.core.clone_and_set = function() { var a = null, b = function(a, b, c) { - a = cljs.core.aclone.call(null, a); + a = cljs.core.aclone(a); a[b] = c; - return a + return a; }, c = function(a, b, c, g, h) { - a = cljs.core.aclone.call(null, a); + a = cljs.core.aclone(a); a[b] = c; a[g] = h; - return a + return a; }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h) + return c.call(this, a, e, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a + return a; }(); cljs.core.remove_pair = function(a, b) { var c = Array(a.length - 2); - cljs.core.array_copy.call(null, a, 0, c, 0, 2 * b); - cljs.core.array_copy.call(null, a, 2 * (b + 1), c, 2 * b, c.length - 2 * b); - return c + cljs.core.array_copy(a, 0, c, 0, 2 * b); + cljs.core.array_copy(a, 2 * (b + 1), c, 2 * b, c.length - 2 * b); + return c; }; cljs.core.bitmap_indexed_node_index = function(a, b) { - return cljs.core.bit_count.call(null, a & b - 1) + return cljs.core.bit_count(a & b - 1); }; cljs.core.bitpos = function(a, b) { - return 1 << (a >>> b & 31) + return 1 << (a >>> b & 31); }; cljs.core.edit_and_set = function() { var a = null, b = function(a, b, c, g) { a = a.ensure_editable(b); a.arr[c] = g; - return a + return a; }, c = function(a, b, c, g, h, k) { a = a.ensure_editable(b); a.arr[c] = g; a.arr[h] = k; - return a + return a; }, a = function(a, e, f, g, h, k) { switch(arguments.length) { case 4: return b.call(this, a, e, f, g); case 6: - return c.call(this, a, e, f, g, h, k) + return c.call(this, a, e, f, g, h, k); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$4 = b; a.cljs$core$IFn$_invoke$arity$6 = c; - return a + return a; }(); cljs.core.inode_kv_reduce = function(a, b, c) { - for(var d = a.length, e = 0;;) { - if(e < d) { - var f = a[e]; - null != f ? c = b.call(null, c, f, a[e + 1]) : (f = a[e + 1], c = null != f ? f.kv_reduce(b, c) : c); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + for (var d = a.length, e = 0, f = c;;) { + if (e < d) { + c = a[e]; + if (null != c) { + var g = a[e + 1]; + c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(f, c, g) : b.call(null, f, c, g); + } else { + c = a[e + 1], c = null != c ? c.kv_reduce(b, f) : f; + } + if (cljs.core.reduced_QMARK_(c)) { + return a = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); } - e += 2 - }else { - return c + e += 2; + f = c; + } else { + return f; } } }; cljs.core.BitmapIndexedNode = function(a, b, c) { this.edit = a; this.bitmap = b; - this.arr = c + this.arr = c; }; -cljs.core.BitmapIndexedNode.cljs$lang$type = !0; -cljs.core.BitmapIndexedNode.cljs$lang$ctorStr = "cljs.core/BitmapIndexedNode"; -cljs.core.BitmapIndexedNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/BitmapIndexedNode") +cljs.core.BitmapIndexedNode.prototype.ensure_editable = function(a) { + if (a === this.edit) { + return this; + } + var b = cljs.core.bit_count(this.bitmap), c = Array(0 > b ? 4 : 2 * (b + 1)); + cljs.core.array_copy(this.arr, 0, c, 0, 2 * b); + return new cljs.core.BitmapIndexedNode(a, this.bitmap, c); +}; +cljs.core.BitmapIndexedNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { + var f = 1 << (c >>> b & 31); + if (0 === (this.bitmap & f)) { + return this; + } + var g = cljs.core.bitmap_indexed_node_index(this.bitmap, f), h = this.arr[2 * g], k = this.arr[2 * g + 1]; + return null == h ? (b = k.inode_without_BANG_(a, b + 5, c, d, e), b === k ? this : null != b ? cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, 2 * g + 1, b) : this.bitmap === f ? null : this.edit_and_remove_pair(a, f, g)) : cljs.core.key_test(d, h) ? (e[0] = !0, this.edit_and_remove_pair(a, f, g)) : this; }; cljs.core.BitmapIndexedNode.prototype.edit_and_remove_pair = function(a, b, c) { - if(this.bitmap === b) { - return null + if (this.bitmap === b) { + return null; } a = this.ensure_editable(a); var d = a.arr, e = d.length; a.bitmap ^= b; - cljs.core.array_copy.call(null, d, 2 * (c + 1), d, 2 * c, e - 2 * (c + 1)); + cljs.core.array_copy(d, 2 * (c + 1), d, 2 * c, e - 2 * (c + 1)); d[e - 2] = null; d[e - 1] = null; - return a -}; -cljs.core.BitmapIndexedNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - var g = 1 << (c >>> b & 31), h = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, g); - if(0 === (this.bitmap & g)) { - var k = cljs.core.bit_count.call(null, this.bitmap); - if(2 * k < this.arr.length) { - return a = this.ensure_editable(a), b = a.arr, f.val = !0, cljs.core.array_copy_downward.call(null, b, 2 * h, b, 2 * (h + 1), 2 * (k - h)), b[2 * h] = d, b[2 * h + 1] = e, a.bitmap |= g, a - } - if(16 <= k) { - h = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; - h[c >>> b & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f); - for(e = d = 0;;) { - if(32 > d) { - 0 !== (this.bitmap >>> d & 1) && (h[d] = null != this.arr[e] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, cljs.core.hash.call(null, this.arr[e]), this.arr[e], this.arr[e + 1], f) : this.arr[e + 1], e += 2), d += 1 - }else { - break - } - } - return new cljs.core.ArrayNode(a, k + 1, h) - } - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = Array(2 * (k + 4)), cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * h), b[2 * h] = d, b[2 * h + 1] = e, cljs.core.array_copy.call(null, this.arr, 2 * h, b, 2 * (h + 1), 2 * (k - h)), f.val = !0, a = this.ensure_editable(a), a.arr = b, a.bitmap |= g, a) : null - } - k = this.arr[2 * h]; - g = this.arr[2 * h + 1]; - return null == k ? (k = g.inode_assoc_BANG_(a, b + 5, c, d, e, f), k === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, k)) : cljs.core.key_test.call(null, d, k) ? e === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, e) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (f.val = !0, cljs.core.edit_and_set.call(null, this, a, 2 * h, null, 2 * h + 1, cljs.core.create_node.call(null, a, b + 5, k, g, c, d, e))) : null + return a; }; cljs.core.BitmapIndexedNode.prototype.inode_seq = function() { - return cljs.core.create_inode_seq.call(null, this.arr) -}; -cljs.core.BitmapIndexedNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { - var f = 1 << (c >>> b & 31); - if(0 === (this.bitmap & f)) { - return this - } - var g = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, f), h = this.arr[2 * g], k = this.arr[2 * g + 1]; - return null == h ? (b = k.inode_without_BANG_(a, b + 5, c, d, e), b === k ? this : null != b ? cljs.core.edit_and_set.call(null, this, a, 2 * g + 1, b) : this.bitmap === f ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.edit_and_remove_pair(a, f, g) : null) : cljs.core.key_test.call(null, d, h) ? (e[0] = !0, this.edit_and_remove_pair(a, f, g)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null -}; -cljs.core.BitmapIndexedNode.prototype.ensure_editable = function(a) { - if(a === this.edit) { - return this - } - var b = cljs.core.bit_count.call(null, this.bitmap), c = Array(0 > b ? 4 : 2 * (b + 1)); - cljs.core.array_copy.call(null, this.arr, 0, c, 0, 2 * b); - return new cljs.core.BitmapIndexedNode(a, this.bitmap, c) + var a = this.arr; + return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.create_inode_seq.call(null, a); }; cljs.core.BitmapIndexedNode.prototype.kv_reduce = function(a, b) { - return cljs.core.inode_kv_reduce.call(null, this.arr, a, b) + return cljs.core.inode_kv_reduce(this.arr, a, b); }; -cljs.core.BitmapIndexedNode.prototype.inode_find = function(a, b, c, d) { +cljs.core.BitmapIndexedNode.prototype.inode_lookup = function(a, b, c, d) { var e = 1 << (b >>> a & 31); - if(0 === (this.bitmap & e)) { - return d + if (0 === (this.bitmap & e)) { + return d; } - var f = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; - return null == e ? f.inode_find(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [e, f], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + var f = cljs.core.bitmap_indexed_node_index(this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; + return null == e ? f.inode_lookup(a + 5, b, c, d) : cljs.core.key_test(c, e) ? f : d; }; -cljs.core.BitmapIndexedNode.prototype.inode_without = function(a, b, c) { - var d = 1 << (b >>> a & 31); - if(0 === (this.bitmap & d)) { - return this - } - var e = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, d), f = this.arr[2 * e], g = this.arr[2 * e + 1]; - return null == f ? (a = g.inode_without(a + 5, b, c), a === g ? this : null != a ? new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * e + 1, a)) : this.bitmap === d ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair.call(null, this.arr, e)) : null) : cljs.core.key_test.call(null, c, f) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair.call(null, - this.arr, e)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null +cljs.core.BitmapIndexedNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { + var g = 1 << (c >>> b & 31), h = cljs.core.bitmap_indexed_node_index(this.bitmap, g); + if (0 === (this.bitmap & g)) { + var k = cljs.core.bit_count(this.bitmap); + if (2 * k < this.arr.length) { + var l = this.ensure_editable(a), m = l.arr; + f.val = !0; + cljs.core.array_copy_downward(m, 2 * h, m, 2 * (h + 1), 2 * (k - h)); + m[2 * h] = d; + m[2 * h + 1] = e; + l.bitmap |= g; + return l; + } + if (16 <= k) { + g = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; + g[c >>> b & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f); + for (l = h = 0;;) { + if (32 > h) { + 0 !== (this.bitmap >>> h & 1) && (g[h] = null != this.arr[l] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, cljs.core.hash(this.arr[l]), this.arr[l], this.arr[l + 1], f) : this.arr[l + 1], l += 2), h += 1; + } else { + break; + } + } + return new cljs.core.ArrayNode(a, k + 1, g); + } + m = Array(2 * (k + 4)); + cljs.core.array_copy(this.arr, 0, m, 0, 2 * h); + m[2 * h] = d; + m[2 * h + 1] = e; + cljs.core.array_copy(this.arr, 2 * h, m, 2 * (h + 1), 2 * (k - h)); + f.val = !0; + l = this.ensure_editable(a); + l.arr = m; + l.bitmap |= g; + return l; + } + var n = this.arr[2 * h], p = this.arr[2 * h + 1]; + if (null == n) { + return k = p.inode_assoc_BANG_(a, b + 5, c, d, e, f), k === p ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, 2 * h + 1, k); + } + if (cljs.core.key_test(d, n)) { + return e === p ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, 2 * h + 1, e); + } + f.val = !0; + return cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$6(this, a, 2 * h, null, 2 * h + 1, function() { + var f = b + 5; + return cljs.core.create_node.cljs$core$IFn$_invoke$arity$7 ? cljs.core.create_node.cljs$core$IFn$_invoke$arity$7(a, f, n, p, c, d, e) : cljs.core.create_node.call(null, a, f, n, p, c, d, e); + }()); }; cljs.core.BitmapIndexedNode.prototype.inode_assoc = function(a, b, c, d, e) { - var f = 1 << (b >>> a & 31), g = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, f); - if(0 === (this.bitmap & f)) { - var h = cljs.core.bit_count.call(null, this.bitmap); - if(16 <= h) { - g = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; - g[b >>> a & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e); - for(d = c = 0;;) { - if(32 > c) { - 0 !== (this.bitmap >>> c & 1) && (g[c] = null != this.arr[d] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, cljs.core.hash.call(null, this.arr[d]), this.arr[d], this.arr[d + 1], e) : this.arr[d + 1], d += 2), c += 1 - }else { - break + var f = 1 << (b >>> a & 31), g = cljs.core.bitmap_indexed_node_index(this.bitmap, f); + if (0 === (this.bitmap & f)) { + var h = cljs.core.bit_count(this.bitmap); + if (16 <= h) { + f = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; + f[b >>> a & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e); + for (var k = g = 0;;) { + if (32 > g) { + 0 !== (this.bitmap >>> g & 1) && (f[g] = null != this.arr[k] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, cljs.core.hash(this.arr[k]), this.arr[k], this.arr[k + 1], e) : this.arr[k + 1], k += 2), g += 1; + } else { + break; } } - return new cljs.core.ArrayNode(null, h + 1, g) + return new cljs.core.ArrayNode(null, h + 1, f); } - a = Array(2 * (h + 1)); - cljs.core.array_copy.call(null, this.arr, 0, a, 0, 2 * g); - a[2 * g] = c; - a[2 * g + 1] = d; - cljs.core.array_copy.call(null, this.arr, 2 * g, a, 2 * (g + 1), 2 * (h - g)); + k = Array(2 * (h + 1)); + cljs.core.array_copy(this.arr, 0, k, 0, 2 * g); + k[2 * g] = c; + k[2 * g + 1] = d; + cljs.core.array_copy(this.arr, 2 * g, k, 2 * (g + 1), 2 * (h - g)); e.val = !0; - return new cljs.core.BitmapIndexedNode(null, this.bitmap | f, a) + return new cljs.core.BitmapIndexedNode(null, this.bitmap | f, k); + } + var l = this.arr[2 * g], m = this.arr[2 * g + 1]; + if (null == l) { + return h = m.inode_assoc(a + 5, b, c, d, e), h === m ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, 2 * g + 1, h)); } - h = this.arr[2 * g]; - f = this.arr[2 * g + 1]; - return null == h ? (h = f.inode_assoc(a + 5, b, c, d, e), h === f ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * g + 1, h))) : cljs.core.key_test.call(null, c, h) ? d === f ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * g + 1, d)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (e.val = !0, new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, - this.arr, 2 * g, null, 2 * g + 1, cljs.core.create_node.call(null, a + 5, h, f, b, c, d)))) : null + if (cljs.core.key_test(c, l)) { + return d === m ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, 2 * g + 1, d)); + } + e.val = !0; + return new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$5(this.arr, 2 * g, null, 2 * g + 1, function() { + var e = a + 5; + return cljs.core.create_node.cljs$core$IFn$_invoke$arity$6 ? cljs.core.create_node.cljs$core$IFn$_invoke$arity$6(e, l, m, b, c, d) : cljs.core.create_node.call(null, e, l, m, b, c, d); + }())); }; -cljs.core.BitmapIndexedNode.prototype.inode_lookup = function(a, b, c, d) { +cljs.core.BitmapIndexedNode.prototype.inode_find = function(a, b, c, d) { var e = 1 << (b >>> a & 31); - if(0 === (this.bitmap & e)) { - return d + if (0 === (this.bitmap & e)) { + return d; + } + var f = cljs.core.bitmap_indexed_node_index(this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; + return null == e ? f.inode_find(a + 5, b, c, d) : cljs.core.key_test(c, e) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [e, f], null) : d; +}; +cljs.core.BitmapIndexedNode.prototype.inode_without = function(a, b, c) { + var d = 1 << (b >>> a & 31); + if (0 === (this.bitmap & d)) { + return this; } - var f = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; - return null == e ? f.inode_lookup(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? f : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + var e = cljs.core.bitmap_indexed_node_index(this.bitmap, d), f = this.arr[2 * e], g = this.arr[2 * e + 1]; + return null == f ? (a = g.inode_without(a + 5, b, c), a === g ? this : null != a ? new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, 2 * e + 1, a)) : this.bitmap === d ? null : new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair(this.arr, e))) : cljs.core.key_test(c, f) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair(this.arr, e)) : this; +}; +cljs.core.BitmapIndexedNode.cljs$lang$type = !0; +cljs.core.BitmapIndexedNode.cljs$lang$ctorStr = "cljs.core/BitmapIndexedNode"; +cljs.core.BitmapIndexedNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/BitmapIndexedNode"); }; cljs.core.__GT_BitmapIndexedNode = function(a, b, c) { - return new cljs.core.BitmapIndexedNode(a, b, c) + return new cljs.core.BitmapIndexedNode(a, b, c); }; cljs.core.BitmapIndexedNode.EMPTY = new cljs.core.BitmapIndexedNode(null, 0, []); cljs.core.pack_array_node = function(a, b, c) { - var d = a.arr; - a = 2 * (a.cnt - 1); - for(var e = Array(a), f = 0, g = 1, h = 0;;) { - if(f < a) { - f !== c && null != d[f] && (e[g] = d[f], g += 2, h |= 1 << f), f += 1 - }else { - return new cljs.core.BitmapIndexedNode(b, h, e) + var d = a.arr, e = d.length; + a = Array(2 * (a.cnt - 1)); + for (var f = 0, g = 1, h = 0;;) { + if (f < e) { + f !== c && null != d[f] && (a[g] = d[f], g += 2, h |= 1 << f), f += 1; + } else { + return new cljs.core.BitmapIndexedNode(b, h, a); } } }; cljs.core.ArrayNode = function(a, b, c) { this.edit = a; this.cnt = b; - this.arr = c -}; -cljs.core.ArrayNode.cljs$lang$type = !0; -cljs.core.ArrayNode.cljs$lang$ctorStr = "cljs.core/ArrayNode"; -cljs.core.ArrayNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ArrayNode") -}; -cljs.core.ArrayNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - var g = c >>> b & 31, h = this.arr[g]; - if(null == h) { - return a = cljs.core.edit_and_set.call(null, this, a, g, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f)), a.cnt += 1, a - } - b = h.inode_assoc_BANG_(a, b + 5, c, d, e, f); - return b === h ? this : cljs.core.edit_and_set.call(null, this, a, g, b) + this.arr = c; }; -cljs.core.ArrayNode.prototype.inode_seq = function() { - return cljs.core.create_array_node_seq.call(null, this.arr) +cljs.core.ArrayNode.prototype.ensure_editable = function(a) { + return a === this.edit ? this : new cljs.core.ArrayNode(a, this.cnt, cljs.core.aclone(this.arr)); }; cljs.core.ArrayNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { var f = c >>> b & 31, g = this.arr[f]; - if(null == g) { - return this + if (null == g) { + return this; } b = g.inode_without_BANG_(a, b + 5, c, d, e); - if(b === g) { - return this + if (b === g) { + return this; } - if(null == b) { - if(8 >= this.cnt) { - return cljs.core.pack_array_node.call(null, this, a, f) + if (null == b) { + if (8 >= this.cnt) { + return cljs.core.pack_array_node(this, a, f); } - a = cljs.core.edit_and_set.call(null, this, a, f, b); + a = cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, f, b); a.cnt -= 1; - return a + return a; } - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.edit_and_set.call(null, this, a, f, b) : null + return cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, f, b); }; -cljs.core.ArrayNode.prototype.ensure_editable = function(a) { - return a === this.edit ? this : new cljs.core.ArrayNode(a, this.cnt, cljs.core.aclone.call(null, this.arr)) +cljs.core.ArrayNode.prototype.inode_seq = function() { + var a = this.arr; + return cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.create_array_node_seq.call(null, a); }; cljs.core.ArrayNode.prototype.kv_reduce = function(a, b) { - for(var c = this.arr.length, d = 0, e = b;;) { - if(d < c) { + for (var c = this.arr.length, d = 0, e = b;;) { + if (d < c) { var f = this.arr[d]; - if(null != f && (e = f.kv_reduce(a, e), cljs.core.reduced_QMARK_.call(null, e))) { - return cljs.core.deref.call(null, e) + if (null != f && (e = f.kv_reduce(a, e), cljs.core.reduced_QMARK_(e))) { + return c = e, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(c) : cljs.core.deref.call(null, c); } - d += 1 - }else { - return e + d += 1; + } else { + return e; } } }; -cljs.core.ArrayNode.prototype.inode_find = function(a, b, c, d) { +cljs.core.ArrayNode.prototype.inode_lookup = function(a, b, c, d) { var e = this.arr[b >>> a & 31]; - return null != e ? e.inode_find(a + 5, b, c, d) : d + return null != e ? e.inode_lookup(a + 5, b, c, d) : d; }; -cljs.core.ArrayNode.prototype.inode_without = function(a, b, c) { - var d = b >>> a & 31, e = this.arr[d]; - return null != e ? (a = e.inode_without(a + 5, b, c), a === e ? this : null == a ? 8 >= this.cnt ? cljs.core.pack_array_node.call(null, this, null, d) : new cljs.core.ArrayNode(null, this.cnt - 1, cljs.core.clone_and_set.call(null, this.arr, d, a)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, d, a)) : null) : this +cljs.core.ArrayNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { + var g = c >>> b & 31, h = this.arr[g]; + if (null == h) { + return a = cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, g, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f)), a.cnt += 1, a; + } + b = h.inode_assoc_BANG_(a, b + 5, c, d, e, f); + return b === h ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, g, b); }; cljs.core.ArrayNode.prototype.inode_assoc = function(a, b, c, d, e) { var f = b >>> a & 31, g = this.arr[f]; - if(null == g) { - return new cljs.core.ArrayNode(null, this.cnt + 1, cljs.core.clone_and_set.call(null, this.arr, f, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e))) + if (null == g) { + return new cljs.core.ArrayNode(null, this.cnt + 1, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, f, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e))); } a = g.inode_assoc(a + 5, b, c, d, e); - return a === g ? this : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, f, a)) + return a === g ? this : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, f, a)); }; -cljs.core.ArrayNode.prototype.inode_lookup = function(a, b, c, d) { +cljs.core.ArrayNode.prototype.inode_find = function(a, b, c, d) { var e = this.arr[b >>> a & 31]; - return null != e ? e.inode_lookup(a + 5, b, c, d) : d + return null != e ? e.inode_find(a + 5, b, c, d) : d; +}; +cljs.core.ArrayNode.prototype.inode_without = function(a, b, c) { + var d = b >>> a & 31, e = this.arr[d]; + return null != e ? (a = e.inode_without(a + 5, b, c), a === e ? this : null == a ? 8 >= this.cnt ? cljs.core.pack_array_node(this, null, d) : new cljs.core.ArrayNode(null, this.cnt - 1, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, d, a)) : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, d, a))) : this; +}; +cljs.core.ArrayNode.cljs$lang$type = !0; +cljs.core.ArrayNode.cljs$lang$ctorStr = "cljs.core/ArrayNode"; +cljs.core.ArrayNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ArrayNode"); }; cljs.core.__GT_ArrayNode = function(a, b, c) { - return new cljs.core.ArrayNode(a, b, c) + return new cljs.core.ArrayNode(a, b, c); }; cljs.core.hash_collision_node_find_index = function(a, b, c) { b *= 2; - for(var d = 0;;) { - if(d < b) { - if(cljs.core.key_test.call(null, c, a[d])) { - return d + for (var d = 0;;) { + if (d < b) { + if (cljs.core.key_test(c, a[d])) { + return d; } - d += 2 - }else { - return-1 + d += 2; + } else { + return-1; } } }; @@ -9763,43 +14186,24 @@ cljs.core.HashCollisionNode = function(a, b, c, d) { this.edit = a; this.collision_hash = b; this.cnt = c; - this.arr = d -}; -cljs.core.HashCollisionNode.cljs$lang$type = !0; -cljs.core.HashCollisionNode.cljs$lang$ctorStr = "cljs.core/HashCollisionNode"; -cljs.core.HashCollisionNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/HashCollisionNode") + this.arr = d; }; -cljs.core.HashCollisionNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - if(c === this.collision_hash) { - b = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, d); - if(-1 === b) { - if(this.arr.length > 2 * this.cnt) { - return a = cljs.core.edit_and_set.call(null, this, a, 2 * this.cnt, d, 2 * this.cnt + 1, e), f.val = !0, a.cnt += 1, a - } - b = this.arr.length; - c = Array(b + 2); - cljs.core.array_copy.call(null, this.arr, 0, c, 0, b); - c[b] = d; - c[b + 1] = e; - f.val = !0; - return this.ensure_editable_array(a, this.cnt + 1, c) - } - return this.arr[b + 1] === e ? this : cljs.core.edit_and_set.call(null, this, a, b + 1, e) +cljs.core.HashCollisionNode.prototype.ensure_editable = function(a) { + if (a === this.edit) { + return this; } - return(new cljs.core.BitmapIndexedNode(a, 1 << (this.collision_hash >>> b & 31), [null, this, null, null])).inode_assoc_BANG_(a, b, c, d, e, f) -}; -cljs.core.HashCollisionNode.prototype.inode_seq = function() { - return cljs.core.create_inode_seq.call(null, this.arr) + var b = Array(2 * (this.cnt + 1)); + cljs.core.array_copy(this.arr, 0, b, 0, 2 * this.cnt); + return new cljs.core.HashCollisionNode(a, this.collision_hash, this.cnt, b); }; cljs.core.HashCollisionNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { - b = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, d); - if(-1 === b) { - return this + b = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, d); + if (-1 === b) { + return this; } e[0] = !0; - if(1 === this.cnt) { - return null + if (1 === this.cnt) { + return null; } a = this.ensure_editable(a); e = a.arr; @@ -9808,68 +14212,88 @@ cljs.core.HashCollisionNode.prototype.inode_without_BANG_ = function(a, b, c, d, e[2 * this.cnt - 1] = null; e[2 * this.cnt - 2] = null; a.cnt -= 1; - return a + return a; }; -cljs.core.HashCollisionNode.prototype.ensure_editable = function(a) { - if(a === this.edit) { - return this - } - var b = Array(2 * (this.cnt + 1)); - cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * this.cnt); - return new cljs.core.HashCollisionNode(a, this.collision_hash, this.cnt, b) +cljs.core.HashCollisionNode.prototype.inode_seq = function() { + var a = this.arr; + return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.create_inode_seq.call(null, a); }; cljs.core.HashCollisionNode.prototype.kv_reduce = function(a, b) { - return cljs.core.inode_kv_reduce.call(null, this.arr, a, b) + return cljs.core.inode_kv_reduce(this.arr, a, b); }; -cljs.core.HashCollisionNode.prototype.inode_find = function(a, b, c, d) { - a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); - return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[a], this.arr[a + 1]], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null +cljs.core.HashCollisionNode.prototype.inode_lookup = function(a, b, c, d) { + a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c); + return 0 > a ? d : cljs.core.key_test(c, this.arr[a]) ? this.arr[a + 1] : d; }; -cljs.core.HashCollisionNode.prototype.inode_without = function(a, b, c) { - a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); - return-1 === a ? this : 1 === this.cnt ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt - 1, cljs.core.remove_pair.call(null, this.arr, cljs.core.quot.call(null, a, 2))) : null +cljs.core.HashCollisionNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { + if (c === this.collision_hash) { + b = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, d); + if (-1 === b) { + if (this.arr.length > 2 * this.cnt) { + return a = cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$6(this, a, 2 * this.cnt, d, 2 * this.cnt + 1, e), f.val = !0, a.cnt += 1, a; + } + b = this.arr.length; + c = Array(b + 2); + cljs.core.array_copy(this.arr, 0, c, 0, b); + c[b] = d; + c[b + 1] = e; + f.val = !0; + return this.ensure_editable_array(a, this.cnt + 1, c); + } + return this.arr[b + 1] === e ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, b + 1, e); + } + return(new cljs.core.BitmapIndexedNode(a, 1 << (this.collision_hash >>> b & 31), [null, this, null, null])).inode_assoc_BANG_(a, b, c, d, e, f); }; cljs.core.HashCollisionNode.prototype.inode_assoc = function(a, b, c, d, e) { - return b === this.collision_hash ? (a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c), -1 === a ? (a = 2 * this.cnt, b = Array(a + 2), cljs.core.array_copy.call(null, this.arr, 0, b, 0, a), b[a] = c, b[a + 1] = d, e.val = !0, new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt + 1, b)) : cljs.core._EQ_.call(null, this.arr[a], d) ? this : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt, cljs.core.clone_and_set.call(null, this.arr, - a + 1, d))) : (new cljs.core.BitmapIndexedNode(null, 1 << (this.collision_hash >>> a & 31), [null, this])).inode_assoc(a, b, c, d, e) -}; -cljs.core.HashCollisionNode.prototype.inode_lookup = function(a, b, c, d) { - a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); - return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? this.arr[a + 1] : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + return b === this.collision_hash ? (a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c), -1 === a ? (a = 2 * this.cnt, b = Array(a + 2), cljs.core.array_copy(this.arr, 0, b, 0, a), b[a] = c, b[a + 1] = d, e.val = !0, new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt + 1, b)) : cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this.arr[a], d) ? this : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, + a + 1, d))) : (new cljs.core.BitmapIndexedNode(null, 1 << (this.collision_hash >>> a & 31), [null, this])).inode_assoc(a, b, c, d, e); }; cljs.core.HashCollisionNode.prototype.ensure_editable_array = function(a, b, c) { - return a === this.edit ? (this.arr = c, this.cnt = b, this) : new cljs.core.HashCollisionNode(this.edit, this.collision_hash, b, c) + return a === this.edit ? (this.arr = c, this.cnt = b, this) : new cljs.core.HashCollisionNode(this.edit, this.collision_hash, b, c); +}; +cljs.core.HashCollisionNode.prototype.inode_find = function(a, b, c, d) { + a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c); + return 0 > a ? d : cljs.core.key_test(c, this.arr[a]) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[a], this.arr[a + 1]], null) : d; +}; +cljs.core.HashCollisionNode.prototype.inode_without = function(a, b, c) { + a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c); + return-1 === a ? this : 1 === this.cnt ? null : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt - 1, cljs.core.remove_pair(this.arr, cljs.core.quot(a, 2))); +}; +cljs.core.HashCollisionNode.cljs$lang$type = !0; +cljs.core.HashCollisionNode.cljs$lang$ctorStr = "cljs.core/HashCollisionNode"; +cljs.core.HashCollisionNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/HashCollisionNode"); }; cljs.core.__GT_HashCollisionNode = function(a, b, c, d) { - return new cljs.core.HashCollisionNode(a, b, c, d) + return new cljs.core.HashCollisionNode(a, b, c, d); }; cljs.core.create_node = function() { var a = null, b = function(a, b, c, g, h, k) { - var l = cljs.core.hash.call(null, b); - if(l === g) { - return new cljs.core.HashCollisionNode(null, l, 2, [b, c, h, k]) + var l = cljs.core.hash(b); + if (l === g) { + return new cljs.core.HashCollisionNode(null, l, 2, [b, c, h, k]); } var m = new cljs.core.Box(!1); - return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a, l, b, c, m).inode_assoc(a, g, h, k, m) + return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a, l, b, c, m).inode_assoc(a, g, h, k, m); }, c = function(a, b, c, g, h, k, l) { - var m = cljs.core.hash.call(null, c); - if(m === h) { - return new cljs.core.HashCollisionNode(null, m, 2, [c, g, k, l]) + var m = cljs.core.hash(c); + if (m === h) { + return new cljs.core.HashCollisionNode(null, m, 2, [c, g, k, l]); } var n = new cljs.core.Box(!1); - return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b, m, c, g, n).inode_assoc_BANG_(a, b, h, k, l, n) + return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b, m, c, g, n).inode_assoc_BANG_(a, b, h, k, l, n); }, a = function(a, e, f, g, h, k, l) { switch(arguments.length) { case 6: return b.call(this, a, e, f, g, h, k); case 7: - return c.call(this, a, e, f, g, h, k, l) + return c.call(this, a, e, f, g, h, k, l); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$6 = b; a.cljs$core$IFn$_invoke$arity$7 = c; - return a + return a; }(); cljs.core.NodeSeq = function(a, b, c, d, e) { this.meta = a; @@ -9878,87 +14302,100 @@ cljs.core.NodeSeq = function(a, b, c, d, e) { this.s = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374860 + this.cljs$lang$protocol_mask$partition0$ = 32374860; }; -cljs.core.NodeSeq.cljs$lang$type = !0; -cljs.core.NodeSeq.cljs$lang$ctorStr = "cljs.core/NodeSeq"; -cljs.core.NodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/NodeSeq") +cljs.core.NodeSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.NodeSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.NodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; cljs.core.NodeSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.NodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.NodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.NodeSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.NodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.NodeSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.NodeSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.NodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.NodeSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null == this.s ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.nodes[this.i], this.nodes[this.i + 1]], null) : cljs.core.first.call(null, this.s) + return null == this.s ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.nodes[this.i], this.nodes[this.i + 1]], null) : cljs.core.first(this.s); }; cljs.core.NodeSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null == this.s ? cljs.core.create_inode_seq.call(null, this.nodes, this.i + 2, null) : cljs.core.create_inode_seq.call(null, this.nodes, this.i, cljs.core.next.call(null, this.s)) + if (null == this.s) { + a = this.nodes; + var b = this.i + 2; + return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3(a, b, null) : cljs.core.create_inode_seq.call(null, a, b, null); + } + a = this.nodes; + var b = this.i, c = cljs.core.next(this.s); + return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3(a, b, c) : cljs.core.create_inode_seq.call(null, a, b, c); }; -cljs.core.NodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.NodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.NodeSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.NodeSeq(b, this.nodes, this.i, this.s, this.__hash) + return new cljs.core.NodeSeq(b, this.nodes, this.i, this.s, this.__hash); }; -cljs.core.NodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.NodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.NodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.NodeSeq.cljs$lang$type = !0; +cljs.core.NodeSeq.cljs$lang$ctorStr = "cljs.core/NodeSeq"; +cljs.core.NodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/NodeSeq"); }; cljs.core.__GT_NodeSeq = function(a, b, c, d, e) { - return new cljs.core.NodeSeq(a, b, c, d, e) + return new cljs.core.NodeSeq(a, b, c, d, e); +}; +cljs.core.NodeSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.create_inode_seq = function() { var a = null, b = function(b) { - return a.call(null, b, 0, null) + return a.cljs$core$IFn$_invoke$arity$3(b, 0, null); }, c = function(a, b, c) { - if(null == c) { - for(c = a.length;;) { - if(b < c) { - if(null != a[b]) { - return new cljs.core.NodeSeq(null, a, b, null, null) + if (null == c) { + for (c = a.length;;) { + if (b < c) { + if (null != a[b]) { + return new cljs.core.NodeSeq(null, a, b, null, null); } var g = a[b + 1]; - if(cljs.core.truth_(g) && (g = g.inode_seq(), cljs.core.truth_(g))) { - return new cljs.core.NodeSeq(null, a, b + 2, g, null) + if (cljs.core.truth_(g) && (g = g.inode_seq(), cljs.core.truth_(g))) { + return new cljs.core.NodeSeq(null, a, b + 2, g, null); } - b += 2 - }else { - return null + b += 2; + } else { + return null; } } - }else { - return new cljs.core.NodeSeq(null, a, b, c, null) + } else { + return new cljs.core.NodeSeq(null, a, b, c, null); } }, a = function(a, e, f) { switch(arguments.length) { case 1: return b.call(this, a); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.ArrayNodeSeq = function(a, b, c, d, e) { this.meta = a; @@ -9967,84 +14404,92 @@ cljs.core.ArrayNodeSeq = function(a, b, c, d, e) { this.s = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374860 + this.cljs$lang$protocol_mask$partition0$ = 32374860; }; -cljs.core.ArrayNodeSeq.cljs$lang$type = !0; -cljs.core.ArrayNodeSeq.cljs$lang$ctorStr = "cljs.core/ArrayNodeSeq"; -cljs.core.ArrayNodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ArrayNodeSeq") +cljs.core.ArrayNodeSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.ArrayNodeSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.ArrayNodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.ArrayNodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.ArrayNodeSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.ArrayNodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first.call(null, this.s) + return cljs.core.first(this.s); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.create_array_node_seq.call(null, null, this.nodes, this.i, cljs.core.next.call(null, this.s)) + a = this.nodes; + var b = this.i, c = cljs.core.next(this.s); + return cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$4(null, a, b, c) : cljs.core.create_array_node_seq.call(null, null, a, b, c); }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ArrayNodeSeq(b, this.nodes, this.i, this.s, this.__hash) + return new cljs.core.ArrayNodeSeq(b, this.nodes, this.i, this.s, this.__hash); }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.ArrayNodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.ArrayNodeSeq.cljs$lang$type = !0; +cljs.core.ArrayNodeSeq.cljs$lang$ctorStr = "cljs.core/ArrayNodeSeq"; +cljs.core.ArrayNodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ArrayNodeSeq"); }; cljs.core.__GT_ArrayNodeSeq = function(a, b, c, d, e) { - return new cljs.core.ArrayNodeSeq(a, b, c, d, e) + return new cljs.core.ArrayNodeSeq(a, b, c, d, e); +}; +cljs.core.ArrayNodeSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.create_array_node_seq = function() { var a = null, b = function(b) { - return a.call(null, null, b, 0, null) + return a.cljs$core$IFn$_invoke$arity$4(null, b, 0, null); }, c = function(a, b, c, g) { - if(null == g) { - for(g = b.length;;) { - if(c < g) { + if (null == g) { + for (g = b.length;;) { + if (c < g) { var h = b[c]; - if(cljs.core.truth_(h) && (h = h.inode_seq(), cljs.core.truth_(h))) { - return new cljs.core.ArrayNodeSeq(a, b, c + 1, h, null) + if (cljs.core.truth_(h) && (h = h.inode_seq(), cljs.core.truth_(h))) { + return new cljs.core.ArrayNodeSeq(a, b, c + 1, h, null); } - c += 1 - }else { - return null + c += 1; + } else { + return null; } } - }else { - return new cljs.core.ArrayNodeSeq(a, b, c, g, null) + } else { + return new cljs.core.ArrayNodeSeq(a, b, c, g, null); } }, a = function(a, e, f, g) { switch(arguments.length) { case 1: return b.call(this, a); case 4: - return c.call(this, a, e, f, g) + return c.call(this, a, e, f, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$4 = c; - return a + return a; }(); cljs.core.PersistentHashMap = function(a, b, c, d, e, f) { this.meta = a; @@ -10053,113 +14498,177 @@ cljs.core.PersistentHashMap = function(a, b, c, d, e, f) { this.has_nil_QMARK_ = d; this.nil_val = e; this.__hash = f; - this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 16123663 + this.cljs$lang$protocol_mask$partition0$ = 16123663; + this.cljs$lang$protocol_mask$partition1$ = 8196; }; -cljs.core.PersistentHashMap.cljs$lang$type = !0; -cljs.core.PersistentHashMap.cljs$lang$ctorStr = "cljs.core/PersistentHashMap"; -cljs.core.PersistentHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentHashMap") +cljs.core.PersistentHashMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.PersistentHashMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientHashMap({}, this.root, this.cnt, this.has_nil_QMARK_, this.nil_val) +cljs.core.PersistentHashMap.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; -cljs.core.PersistentHashMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) +cljs.core.PersistentHashMap.prototype.keys = function() { + return cljs.core.es6_iterator(cljs.core.keys.cljs$core$IFn$_invoke$arity$1 ? cljs.core.keys.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.keys.call(null, this)); +}; +cljs.core.PersistentHashMap.prototype.entries = function() { + return cljs.core.es6_entries_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentHashMap.prototype.values = function() { + return cljs.core.es6_iterator(cljs.core.vals.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vals.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.vals.call(null, this)); +}; +cljs.core.PersistentHashMap.prototype.has = function(a) { + return cljs.core.contains_QMARK_(this, a); +}; +cljs.core.PersistentHashMap.prototype.get = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a); +}; +cljs.core.PersistentHashMap.prototype.forEach = function(a) { + for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { + if (e < d) { + var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); + a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); + e += 1; + } else { + if (b = cljs.core.seq(b)) { + cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; + } else { + return null; + } + } + } }; cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) : null + return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash(b), b, c); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { + this.has_nil_QMARK_ && (a = this.nil_val, c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, null, a) : b.call(null, c, null, a)); + return cljs.core.reduced_QMARK_(c) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(c) : cljs.core.deref.call(null, c) : null != this.root ? this.root.kv_reduce(b, c) : c; +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentHashMap(this.meta, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.cnt; +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_map(this, b); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return new cljs.core.TransientHashMap({}, this.root, this.cnt, this.has_nil_QMARK_, this.nil_val); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core._with_meta(cljs.core.PersistentHashMap.EMPTY, this.meta); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { + if (null == b) { + return this.has_nil_QMARK_ ? new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, this.root, !1, null, null) : this; + } + if (null == this.root) { + return this; + } + var c = this.root.inode_without(0, cljs.core.hash(b), b); + return c === this.root ? this : new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, c, this.has_nil_QMARK_, this.nil_val, null); }; cljs.core.PersistentHashMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if(null == b) { - return this.has_nil_QMARK_ && c === this.nil_val ? this : new cljs.core.PersistentHashMap(this.meta, this.has_nil_QMARK_ ? this.cnt : this.cnt + 1, this.root, !0, c, null) + if (null == b) { + return this.has_nil_QMARK_ && c === this.nil_val ? this : new cljs.core.PersistentHashMap(this.meta, this.has_nil_QMARK_ ? this.cnt : this.cnt + 1, this.root, !0, c, null); } a = new cljs.core.Box(!1); - b = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc(0, cljs.core.hash.call(null, b), b, c, a); - return b === this.root ? this : new cljs.core.PersistentHashMap(this.meta, a.val ? this.cnt + 1 : this.cnt, b, this.has_nil_QMARK_, this.nil_val, null) + b = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc(0, cljs.core.hash(b), b, c, a); + return b === this.root ? this : new cljs.core.PersistentHashMap(this.meta, a.val ? this.cnt + 1 : this.cnt, b, this.has_nil_QMARK_, this.nil_val, null); }; cljs.core.PersistentHashMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return null == b ? this.has_nil_QMARK_ : null == this.root ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, cljs.core.lookup_sentinel) !== cljs.core.lookup_sentinel : null + return null == b ? this.has_nil_QMARK_ : null == this.root ? !1 : this.root.inode_lookup(0, cljs.core.hash(b), b, cljs.core.lookup_sentinel) !== cljs.core.lookup_sentinel; +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 < this.cnt ? (a = null != this.root ? this.root.inode_seq() : null, this.has_nil_QMARK_ ? cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, this.nil_val], null), a) : a) : null; +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentHashMap(b, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + if (cljs.core.vector_QMARK_(b)) { + return cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)); + } + for (var c = this, d = cljs.core.seq(b);;) { + if (null == d) { + return c; + } + var e = cljs.core.first(d); + if (cljs.core.vector_QMARK_(e)) { + c = cljs.core._assoc(c, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 1)), d = cljs.core.next(d); + } else { + throw Error("conj on a map takes map entries or seqables of map entries"); + } + } }; cljs.core.PersistentHashMap.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); cljs.core.PersistentHashMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.PersistentHashMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentHashMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - a = this.has_nil_QMARK_ ? b.call(null, c, null, this.nil_val) : c; - return cljs.core.reduced_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : null != this.root ? this.root.kv_reduce(b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) -}; -cljs.core.PersistentHashMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.cnt ? (a = null != this.root ? this.root.inode_seq() : null, this.has_nil_QMARK_ ? cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, this.nil_val], null), a) : a) : null -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentHashMap(b, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; -cljs.core.PersistentHashMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.PersistentHashMap.cljs$lang$type = !0; +cljs.core.PersistentHashMap.cljs$lang$ctorStr = "cljs.core/PersistentHashMap"; +cljs.core.PersistentHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentHashMap"); }; -cljs.core.PersistentHashMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta.call(null, cljs.core.PersistentHashMap.EMPTY, this.meta) +cljs.core.__GT_PersistentHashMap = function(a, b, c, d, e, f) { + return new cljs.core.PersistentHashMap(a, b, c, d, e, f); }; -cljs.core.PersistentHashMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if(null == b) { - return this.has_nil_QMARK_ ? new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, this.root, !1, null, null) : this - } - if(null == this.root) { - return this - } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - var c = this.root.inode_without(0, cljs.core.hash.call(null, b), b); - return c === this.root ? this : new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, c, this.has_nil_QMARK_, this.nil_val, null) +cljs.core.PersistentHashMap.EMPTY = new cljs.core.PersistentHashMap(null, 0, null, !1, null, cljs.core.empty_unordered_hash); +cljs.core.PersistentHashMap.fromArray = function(a, b) { + for (var c = b ? a : cljs.core.aclone(a), d = c.length, e = 0, f = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { + if (e < d) { + var g = e + 2, f = cljs.core._assoc_BANG_(f, c[e], c[e + 1]), e = g + } else { + return cljs.core._persistent_BANG_(f); + } } - return null -}; -cljs.core.__GT_PersistentHashMap = function(a, b, c, d, e, f) { - return new cljs.core.PersistentHashMap(a, b, c, d, e, f) }; -cljs.core.PersistentHashMap.EMPTY = new cljs.core.PersistentHashMap(null, 0, null, !1, null, 0); cljs.core.PersistentHashMap.fromArrays = function(a, b) { - for(var c = a.length, d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { - if(d < c) { - var f = d + 1, e = cljs.core._assoc_BANG_.call(null, e, a[d], b[d]), d = f - }else { - return cljs.core.persistent_BANG_.call(null, e) + for (var c = a.length, d = 0, e = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { + if (d < c) { + var f = d + 1, e = e.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(null, a[d], b[d]), d = f + } else { + return cljs.core.persistent_BANG_(e); } } }; +cljs.core.PersistentHashMap.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; cljs.core.TransientHashMap = function(a, b, c, d, e) { this.edit = a; this.root = b; @@ -10167,99 +14676,107 @@ cljs.core.TransientHashMap = function(a, b, c, d, e) { this.has_nil_QMARK_ = d; this.nil_val = e; this.cljs$lang$protocol_mask$partition1$ = 56; - this.cljs$lang$protocol_mask$partition0$ = 258 -}; -cljs.core.TransientHashMap.cljs$lang$type = !0; -cljs.core.TransientHashMap.cljs$lang$ctorStr = "cljs.core/TransientHashMap"; -cljs.core.TransientHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientHashMap") + this.cljs$lang$protocol_mask$partition0$ = 258; }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 = function(a, b) { - return this.without_BANG_(b) + return this.without_BANG_(b); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - return this.assoc_BANG_(b, c) + return this.assoc_BANG_(b, c); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - return this.conj_BANG_(b) + return this.conj_BANG_(b); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - return this.persistent_BANG_() + return this.persistent_BANG_(); }; cljs.core.TransientHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : null : null == this.root ? null : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b) + return null == b ? this.has_nil_QMARK_ ? this.nil_val : null : null == this.root ? null : this.root.inode_lookup(0, cljs.core.hash(b), b); }; cljs.core.TransientHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) + return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash(b), b, c); }; cljs.core.TransientHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if(this.edit) { - return this.count + if (this.edit) { + return this.count; } throw Error("count after persistent!"); }; cljs.core.TransientHashMap.prototype.conj_BANG_ = function(a) { - if(this.edit) { - if(a ? a.cljs$lang$protocol_mask$partition0$ & 2048 || a.cljs$core$IMapEntry$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) { - return this.assoc_BANG_(cljs.core.key.call(null, a), cljs.core.val.call(null, a)) + if (this.edit) { + if (a ? a.cljs$lang$protocol_mask$partition0$ & 2048 || a.cljs$core$IMapEntry$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, a)) { + return this.assoc_BANG_(cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a), cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a)); } - a = cljs.core.seq.call(null, a); - for(var b = this;;) { - var c = cljs.core.first.call(null, a); - if(cljs.core.truth_(c)) { - a = cljs.core.next.call(null, a), b = b.assoc_BANG_(cljs.core.key.call(null, c), cljs.core.val.call(null, c)) - }else { - return b + a = cljs.core.seq(a); + for (var b = this;;) { + var c = cljs.core.first(a); + if (cljs.core.truth_(c)) { + var d = c; + a = cljs.core.next(a); + b = b.assoc_BANG_(function() { + var a = d; + return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a); + }(), function() { + var a = d; + return cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a); + }()); + } else { + return b; } } - }else { + } else { throw Error("conj! after persistent"); } }; cljs.core.TransientHashMap.prototype.assoc_BANG_ = function(a, b) { - if(this.edit) { - if(null == a) { - this.nil_val !== b && (this.nil_val = b), this.has_nil_QMARK_ || (this.count += 1, this.has_nil_QMARK_ = !0) - }else { - var c = new cljs.core.Box(!1), d = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc_BANG_(this.edit, 0, cljs.core.hash.call(null, a), a, b, c); + if (this.edit) { + if (null == a) { + this.nil_val !== b && (this.nil_val = b), this.has_nil_QMARK_ || (this.count += 1, this.has_nil_QMARK_ = !0); + } else { + var c = new cljs.core.Box(!1), d = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc_BANG_(this.edit, 0, cljs.core.hash(a), a, b, c); d !== this.root && (this.root = d); - c.val && (this.count += 1) + c.val && (this.count += 1); } - return this + return this; } throw Error("assoc! after persistent!"); }; cljs.core.TransientHashMap.prototype.without_BANG_ = function(a) { - if(this.edit) { - if(null == a) { - this.has_nil_QMARK_ && (this.has_nil_QMARK_ = !1, this.nil_val = null, this.count -= 1) - }else { - if(null != this.root) { + if (this.edit) { + if (null == a) { + this.has_nil_QMARK_ && (this.has_nil_QMARK_ = !1, this.nil_val = null, this.count -= 1); + } else { + if (null != this.root) { var b = new cljs.core.Box(!1); - a = this.root.inode_without_BANG_(this.edit, 0, cljs.core.hash.call(null, a), a, b); + a = this.root.inode_without_BANG_(this.edit, 0, cljs.core.hash(a), a, b); a !== this.root && (this.root = a); - cljs.core.truth_(b[0]) && (this.count -= 1) + cljs.core.truth_(b[0]) && (this.count -= 1); } } - return this + return this; } throw Error("dissoc! after persistent!"); }; cljs.core.TransientHashMap.prototype.persistent_BANG_ = function() { - if(this.edit) { - return this.edit = null, new cljs.core.PersistentHashMap(null, this.count, this.root, this.has_nil_QMARK_, this.nil_val, null) + if (this.edit) { + return this.edit = null, new cljs.core.PersistentHashMap(null, this.count, this.root, this.has_nil_QMARK_, this.nil_val, null); } throw Error("persistent! called twice"); }; +cljs.core.TransientHashMap.cljs$lang$type = !0; +cljs.core.TransientHashMap.cljs$lang$ctorStr = "cljs.core/TransientHashMap"; +cljs.core.TransientHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/TransientHashMap"); +}; cljs.core.__GT_TransientHashMap = function(a, b, c, d, e) { - return new cljs.core.TransientHashMap(a, b, c, d, e) + return new cljs.core.TransientHashMap(a, b, c, d, e); }; cljs.core.tree_map_seq_push = function(a, b, c) { - for(var d = b;;) { - if(null != a) { - b = c ? a.left : a.right, d = cljs.core.conj.call(null, d, a), a = b - }else { - return d + for (var d = b;;) { + if (null != a) { + b = c ? a.left : a.right, d = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(d, a), a = b; + } else { + return d; } } }; @@ -10270,110 +14787,109 @@ cljs.core.PersistentTreeMapSeq = function(a, b, c, d, e) { this.cnt = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374862 + this.cljs$lang$protocol_mask$partition0$ = 32374862; }; -cljs.core.PersistentTreeMapSeq.cljs$lang$type = !0; -cljs.core.PersistentTreeMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentTreeMapSeq"; -cljs.core.PersistentTreeMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMapSeq") +cljs.core.PersistentTreeMapSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.PersistentTreeMapSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return 0 > this.cnt ? cljs.core.count(cljs.core.next(this)) + 1 : this.cnt; }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); }; -cljs.core.PersistentTreeMapSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this -}; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 0 > this.cnt ? cljs.core.count.call(null, cljs.core.next.call(null, this)) + 1 : this.cnt + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.peek.call(null, this.stack) + return cljs.core.peek(this.stack); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = cljs.core.first.call(null, this.stack); - a = cljs.core.tree_map_seq_push.call(null, this.ascending_QMARK_ ? a.right : a.left, cljs.core.next.call(null, this.stack), this.ascending_QMARK_); - return null != a ? new cljs.core.PersistentTreeMapSeq(null, a, this.ascending_QMARK_, this.cnt - 1, null) : cljs.core.List.EMPTY + a = cljs.core.first(this.stack); + a = cljs.core.tree_map_seq_push(this.ascending_QMARK_ ? a.right : a.left, cljs.core.next(this.stack), this.ascending_QMARK_); + return null != a ? new cljs.core.PersistentTreeMapSeq(null, a, this.ascending_QMARK_, this.cnt - 1, null) : cljs.core.List.EMPTY; }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeMapSeq(b, this.stack, this.ascending_QMARK_, this.cnt, this.__hash) + return new cljs.core.PersistentTreeMapSeq(b, this.stack, this.ascending_QMARK_, this.cnt, this.__hash); }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.PersistentTreeMapSeq.cljs$lang$type = !0; +cljs.core.PersistentTreeMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentTreeMapSeq"; +cljs.core.PersistentTreeMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentTreeMapSeq"); }; cljs.core.__GT_PersistentTreeMapSeq = function(a, b, c, d, e) { - return new cljs.core.PersistentTreeMapSeq(a, b, c, d, e) + return new cljs.core.PersistentTreeMapSeq(a, b, c, d, e); +}; +cljs.core.PersistentTreeMapSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.create_tree_map_seq = function(a, b, c) { - return new cljs.core.PersistentTreeMapSeq(null, cljs.core.tree_map_seq_push.call(null, a, null, b), b, c, null) + return new cljs.core.PersistentTreeMapSeq(null, cljs.core.tree_map_seq_push(a, null, b), b, c, null); }; cljs.core.balance_left = function(a, b, c, d) { - return c instanceof cljs.core.RedNode ? c.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, c.left.blacken(), new cljs.core.BlackNode(a, b, c.right, d, null), null) : c.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.right.key, c.right.val, new cljs.core.BlackNode(c.key, c.val, c.left, c.right.left, null), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a, b, c, d, - null) : null : new cljs.core.BlackNode(a, b, c, d, null) + return c instanceof cljs.core.RedNode ? c.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, c.left.blacken(), new cljs.core.BlackNode(a, b, c.right, d, null), null) : c.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.right.key, c.right.val, new cljs.core.BlackNode(c.key, c.val, c.left, c.right.left, null), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) : new cljs.core.BlackNode(a, b, c, d, null) : new cljs.core.BlackNode(a, b, c, d, null); }; cljs.core.balance_right = function(a, b, c, d) { - return d instanceof cljs.core.RedNode ? d.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(a, b, c, d.left, null), d.right.blacken(), null) : d.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), new cljs.core.BlackNode(d.key, d.val, d.left.right, d.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a, b, c, d, null) : - null : new cljs.core.BlackNode(a, b, c, d, null) + return d instanceof cljs.core.RedNode ? d.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(a, b, c, d.left, null), d.right.blacken(), null) : d.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), new cljs.core.BlackNode(d.key, d.val, d.left.right, d.right, null), null) : new cljs.core.BlackNode(a, b, c, d, null) : new cljs.core.BlackNode(a, b, c, d, null); }; cljs.core.balance_left_del = function(a, b, c, d) { - if(c instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(a, b, c.blacken(), d, null) - } - if(d instanceof cljs.core.BlackNode) { - return cljs.core.balance_right.call(null, a, b, c, d.redden()) + if (c instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(a, b, c.blacken(), d, null); } - if(d instanceof cljs.core.RedNode && d.left instanceof cljs.core.BlackNode) { - return new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), cljs.core.balance_right.call(null, d.key, d.val, d.left.right, d.right.redden()), null) + if (d instanceof cljs.core.BlackNode) { + return cljs.core.balance_right(a, b, c, d.redden()); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error("red-black tree invariant violation"); + if (d instanceof cljs.core.RedNode && d.left instanceof cljs.core.BlackNode) { + return new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), cljs.core.balance_right(d.key, d.val, d.left.right, d.right.redden()), null); } - return null + throw Error("red-black tree invariant violation"); }; cljs.core.balance_right_del = function(a, b, c, d) { - if(d instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(a, b, c, d.blacken(), null) - } - if(c instanceof cljs.core.BlackNode) { - return cljs.core.balance_left.call(null, a, b, c.redden(), d) + if (d instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(a, b, c, d.blacken(), null); } - if(c instanceof cljs.core.RedNode && c.right instanceof cljs.core.BlackNode) { - return new cljs.core.RedNode(c.right.key, c.right.val, cljs.core.balance_left.call(null, c.key, c.val, c.left.redden(), c.right.left), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) + if (c instanceof cljs.core.BlackNode) { + return cljs.core.balance_left(a, b, c.redden(), d); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw Error("red-black tree invariant violation"); + if (c instanceof cljs.core.RedNode && c.right instanceof cljs.core.BlackNode) { + return new cljs.core.RedNode(c.right.key, c.right.val, cljs.core.balance_left(c.key, c.val, c.left.redden(), c.right.left), new cljs.core.BlackNode(a, b, c.right.right, d, null), null); } - return null + throw Error("red-black tree invariant violation"); }; cljs.core.tree_map_kv_reduce = function tree_map_kv_reduce(b, c, d) { - d = null != b.left ? tree_map_kv_reduce.call(null, b.left, c, d) : d; - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + d = null != b.left ? tree_map_kv_reduce(b.left, c, d) : d; + if (cljs.core.reduced_QMARK_(d)) { + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d); } - d = c.call(null, d, b.key, b.val); - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + var e = b.key, f = b.val; + d = c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(d, e, f) : c.call(null, d, e, f); + if (cljs.core.reduced_QMARK_(d)) { + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d); } - b = null != b.right ? tree_map_kv_reduce.call(null, b.right, c, d) : d; - return cljs.core.reduced_QMARK_.call(null, b) ? cljs.core.deref.call(null, b) : b + b = null != b.right ? tree_map_kv_reduce(b.right, c, d) : d; + return cljs.core.reduced_QMARK_(b) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b) : b; }; cljs.core.BlackNode = function(a, b, c, d, e) { this.key = a; @@ -10382,315 +14898,331 @@ cljs.core.BlackNode = function(a, b, c, d, e) { this.right = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32402207 -}; -cljs.core.BlackNode.cljs$lang$type = !0; -cljs.core.BlackNode.cljs$lang$ctorStr = "cljs.core/BlackNode"; -cljs.core.BlackNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/BlackNode") -}; -cljs.core.BlackNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + this.cljs$lang$protocol_mask$partition0$ = 32402207; }; -cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) -}; -cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) -}; -cljs.core.BlackNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c) +cljs.core.BlackNode.prototype.add_right = function(a) { + return a.balance_right(this); }; -cljs.core.BlackNode.prototype.call = function() { - var a = null; - return a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) - } - throw Error("Invalid arity: " + arguments.length); - } -}(); -cljs.core.BlackNode.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) +cljs.core.BlackNode.prototype.redden = function() { + return new cljs.core.RedNode(this.key, this.val, this.left, this.right, null); }; -cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) +cljs.core.BlackNode.prototype.blacken = function() { + return this; }; -cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) +cljs.core.BlackNode.prototype.add_left = function(a) { + return a.balance_left(this); }; -cljs.core.BlackNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null) +cljs.core.BlackNode.prototype.replace = function(a, b, c, d) { + return new cljs.core.BlackNode(a, b, c, d, null); }; -cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return this.key +cljs.core.BlackNode.prototype.balance_left = function(a) { + return new cljs.core.BlackNode(a.key, a.val, this, a.right, null); }; -cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return this.val +cljs.core.BlackNode.prototype.balance_right = function(a) { + return new cljs.core.BlackNode(a.key, a.val, a.left, this, null); }; -cljs.core.BlackNode.prototype.add_right = function(a) { - return a.balance_right(this) +cljs.core.BlackNode.prototype.remove_left = function(a) { + return cljs.core.balance_left_del(this.key, this.val, a, this.right); }; -cljs.core.BlackNode.prototype.redden = function() { - return new cljs.core.RedNode(this.key, this.val, this.left, this.right, null) +cljs.core.BlackNode.prototype.kv_reduce = function(a, b) { + return cljs.core.tree_map_kv_reduce(this, a, b); }; cljs.core.BlackNode.prototype.remove_right = function(a) { - return cljs.core.balance_right_del.call(null, this.key, this.val, this.left, a) -}; -cljs.core.BlackNode.prototype.replace = function(a, b, c, d) { - return new cljs.core.BlackNode(a, b, c, d, null) -}; -cljs.core.BlackNode.prototype.kv_reduce = function(a, b) { - return cljs.core.tree_map_kv_reduce.call(null, this, a, b) + return cljs.core.balance_right_del(this.key, this.val, this.left, a); }; -cljs.core.BlackNode.prototype.remove_left = function(a) { - return cljs.core.balance_left_del.call(null, this.key, this.val, a, this.right) +cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, null); }; -cljs.core.BlackNode.prototype.add_left = function(a) { - return a.balance_left(this) +cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c); }; -cljs.core.BlackNode.prototype.balance_left = function(a) { - return new cljs.core.BlackNode(a.key, a.val, this, a.right, null) +cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + return 0 === b ? this.key : 1 === b ? this.val : null; }; -cljs.core.BlackNode.prototype.balance_right = function(a) { - return new cljs.core.BlackNode(a.key, a.val, a.left, this, null) +cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 === b ? this.key : 1 === b ? this.val : c; }; -cljs.core.BlackNode.prototype.blacken = function() { - return this +cljs.core.BlackNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c); }; -cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) +cljs.core.BlackNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return null; }; -cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) +cljs.core.BlackNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return 2; }; -cljs.core.BlackNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key) +cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { + return this.key; }; -cljs.core.BlackNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 2 +cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { + return this.val; }; cljs.core.BlackNode.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.BlackNode.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null) + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null); }; -cljs.core.BlackNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c) +cljs.core.BlackNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; cljs.core.BlackNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) -}; -cljs.core.BlackNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b) -}; -cljs.core.BlackNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return null -}; -cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(0 === b) { - return this.key - } - if(1 === b) { - return this.val - } - new cljs.core.Keyword(null, "else", "else", 1017020587); - return null -}; -cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null + return cljs.core.equiv_sequential(this, b); }; cljs.core.BlackNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentVector.EMPTY -}; -cljs.core.__GT_BlackNode = function(a, b, c, d, e) { - return new cljs.core.BlackNode(a, b, c, d, e) + return cljs.core.PersistentVector.EMPTY; }; -cljs.core.RedNode = function(a, b, c, d, e) { - this.key = a; - this.val = b; - this.left = c; - this.right = d; - this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32402207 +cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); }; -cljs.core.RedNode.cljs$lang$type = !0; -cljs.core.RedNode.cljs$lang$ctorStr = "cljs.core/RedNode"; -cljs.core.RedNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/RedNode") +cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(this, b, c); }; -cljs.core.RedNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.BlackNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c); }; -cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) +cljs.core.BlackNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core._conj(cljs.core._conj(cljs.core.List.EMPTY, this.val), this.key); }; -cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) +cljs.core.BlackNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b); }; -cljs.core.RedNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c) +cljs.core.BlackNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null); }; -cljs.core.RedNode.prototype.call = function() { - var a = null; - return a = function(a, c, d) { +cljs.core.BlackNode.prototype.call = function() { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); -cljs.core.RedNode.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) +cljs.core.BlackNode.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; -cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) +cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a); +}; +cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; -cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) +cljs.core.BlackNode.cljs$lang$type = !0; +cljs.core.BlackNode.cljs$lang$ctorStr = "cljs.core/BlackNode"; +cljs.core.BlackNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/BlackNode"); }; -cljs.core.RedNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null) +cljs.core.__GT_BlackNode = function(a, b, c, d, e) { + return new cljs.core.BlackNode(a, b, c, d, e); }; -cljs.core.RedNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return this.key +cljs.core.BlackNode.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; -cljs.core.RedNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return this.val +cljs.core.RedNode = function(a, b, c, d, e) { + this.key = a; + this.val = b; + this.left = c; + this.right = d; + this.__hash = e; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32402207; }; cljs.core.RedNode.prototype.add_right = function(a) { - return new cljs.core.RedNode(this.key, this.val, this.left, a, null) + return new cljs.core.RedNode(this.key, this.val, this.left, a, null); }; cljs.core.RedNode.prototype.redden = function() { throw Error("red-black tree invariant violation"); }; -cljs.core.RedNode.prototype.remove_right = function(a) { - return new cljs.core.RedNode(this.key, this.val, this.left, a, null) +cljs.core.RedNode.prototype.blacken = function() { + return new cljs.core.BlackNode(this.key, this.val, this.left, this.right, null); +}; +cljs.core.RedNode.prototype.add_left = function(a) { + return new cljs.core.RedNode(this.key, this.val, a, this.right, null); }; cljs.core.RedNode.prototype.replace = function(a, b, c, d) { - return new cljs.core.RedNode(a, b, c, d, null) + return new cljs.core.RedNode(a, b, c, d, null); }; -cljs.core.RedNode.prototype.kv_reduce = function(a, b) { - return cljs.core.tree_map_kv_reduce.call(null, this, a, b) +cljs.core.RedNode.prototype.balance_left = function(a) { + return this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, this.left.blacken(), new cljs.core.BlackNode(a.key, a.val, this.right, a.right, null), null) : this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.right.key, this.right.val, new cljs.core.BlackNode(this.key, this.val, this.left, this.right.left, null), new cljs.core.BlackNode(a.key, a.val, this.right.right, a.right, null), null) : new cljs.core.BlackNode(a.key, a.val, this, a.right, null); +}; +cljs.core.RedNode.prototype.balance_right = function(a) { + return this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left, null), this.right.blacken(), null) : this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.left.key, this.left.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left.left, null), new cljs.core.BlackNode(this.key, this.val, this.left.right, this.right, null), null) : new cljs.core.BlackNode(a.key, a.val, a.left, this, null); }; cljs.core.RedNode.prototype.remove_left = function(a) { - return new cljs.core.RedNode(this.key, this.val, a, this.right, null) + return new cljs.core.RedNode(this.key, this.val, a, this.right, null); }; -cljs.core.RedNode.prototype.add_left = function(a) { - return new cljs.core.RedNode(this.key, this.val, a, this.right, null) +cljs.core.RedNode.prototype.kv_reduce = function(a, b) { + return cljs.core.tree_map_kv_reduce(this, a, b); }; -cljs.core.RedNode.prototype.balance_left = function(a) { - return this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, this.left.blacken(), new cljs.core.BlackNode(a.key, a.val, this.right, a.right, null), null) : this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.right.key, this.right.val, new cljs.core.BlackNode(this.key, this.val, this.left, this.right.left, null), new cljs.core.BlackNode(a.key, a.val, this.right.right, a.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a.key, - a.val, this, a.right, null) : null +cljs.core.RedNode.prototype.remove_right = function(a) { + return new cljs.core.RedNode(this.key, this.val, this.left, a, null); }; -cljs.core.RedNode.prototype.balance_right = function(a) { - return this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left, null), this.right.blacken(), null) : this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.left.key, this.left.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left.left, null), new cljs.core.BlackNode(this.key, this.val, this.left.right, this.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a.key, - a.val, a.left, this, null) : null +cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, null); }; -cljs.core.RedNode.prototype.blacken = function() { - return new cljs.core.BlackNode(this.key, this.val, this.left, this.right, null) +cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c); }; -cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) +cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + return 0 === b ? this.key : 1 === b ? this.val : null; }; -cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) +cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 === b ? this.key : 1 === b ? this.val : c; }; -cljs.core.RedNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key) +cljs.core.RedNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c); +}; +cljs.core.RedNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return null; }; cljs.core.RedNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 2 + return 2; +}; +cljs.core.RedNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { + return this.key; +}; +cljs.core.RedNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { + return this.val; }; cljs.core.RedNode.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.RedNode.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null) + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null); }; -cljs.core.RedNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c) +cljs.core.RedNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; cljs.core.RedNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.RedNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.PersistentVector.EMPTY; +}; +cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); +}; +cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(this, b, c); +}; +cljs.core.RedNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c); +}; +cljs.core.RedNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core._conj(cljs.core._conj(cljs.core.List.EMPTY, this.val), this.key); }; cljs.core.RedNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b) + return cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b); }; -cljs.core.RedNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return null +cljs.core.RedNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null); }; -cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(0 === b) { - return this.key - } - if(1 === b) { - return this.val - } - new cljs.core.Keyword(null, "else", "else", 1017020587); - return null +cljs.core.RedNode.prototype.call = function() { + var a = null, a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + case 3: + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; +}(); +cljs.core.RedNode.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; -cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null +cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; -cljs.core.RedNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentVector.EMPTY +cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); +}; +cljs.core.RedNode.cljs$lang$type = !0; +cljs.core.RedNode.cljs$lang$ctorStr = "cljs.core/RedNode"; +cljs.core.RedNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/RedNode"); }; cljs.core.__GT_RedNode = function(a, b, c, d, e) { - return new cljs.core.RedNode(a, b, c, d, e) + return new cljs.core.RedNode(a, b, c, d, e); +}; +cljs.core.RedNode.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.tree_map_add = function tree_map_add(b, c, d, e, f) { - if(null == c) { - return new cljs.core.RedNode(d, e, null, null, null) + if (null == c) { + return new cljs.core.RedNode(d, e, null, null, null); + } + var g; + g = c.key; + g = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, g) : b.call(null, d, g); + if (0 === g) { + return f[0] = c, null; } - var g = b.call(null, d, c.key); - return 0 === g ? (f[0] = c, null) : 0 > g ? (b = tree_map_add.call(null, b, c.left, d, e, f), null != b ? c.add_left(b) : null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = tree_map_add.call(null, b, c.right, d, e, f), null != b ? c.add_right(b) : null) : null + if (0 > g) { + return b = tree_map_add(b, c.left, d, e, f), null != b ? c.add_left(b) : null; + } + b = tree_map_add(b, c.right, d, e, f); + return null != b ? c.add_right(b) : null; }; cljs.core.tree_map_append = function tree_map_append(b, c) { - if(null == b) { - return c + if (null == b) { + return c; } - if(null == c) { - return b + if (null == c) { + return b; } - if(b instanceof cljs.core.RedNode) { - if(c instanceof cljs.core.RedNode) { - var d = tree_map_append.call(null, b.right, c.left); - return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.RedNode(b.key, b.val, b.left, d.left, null), new cljs.core.RedNode(c.key, c.val, d.right, c.right, null), null) : new cljs.core.RedNode(b.key, b.val, b.left, new cljs.core.RedNode(c.key, c.val, d, c.right, null), null) + if (b instanceof cljs.core.RedNode) { + if (c instanceof cljs.core.RedNode) { + var d = tree_map_append(b.right, c.left); + return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.RedNode(b.key, b.val, b.left, d.left, null), new cljs.core.RedNode(c.key, c.val, d.right, c.right, null), null) : new cljs.core.RedNode(b.key, b.val, b.left, new cljs.core.RedNode(c.key, c.val, d, c.right, null), null); } - return new cljs.core.RedNode(b.key, b.val, b.left, tree_map_append.call(null, b.right, c), null) + return new cljs.core.RedNode(b.key, b.val, b.left, tree_map_append(b.right, c), null); + } + if (c instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(c.key, c.val, tree_map_append(b, c.left), c.right, null); } - return c instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, tree_map_append.call(null, b, c.left), c.right, null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = tree_map_append.call(null, b.right, c.left), d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(b.key, b.val, b.left, d.left, null), new cljs.core.BlackNode(c.key, c.val, d.right, c.right, null), null) : cljs.core.balance_left_del.call(null, b.key, b.val, b.left, - new cljs.core.BlackNode(c.key, c.val, d, c.right, null))) : null + d = tree_map_append(b.right, c.left); + return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(b.key, b.val, b.left, d.left, null), new cljs.core.BlackNode(c.key, c.val, d.right, c.right, null), null) : cljs.core.balance_left_del(b.key, b.val, b.left, new cljs.core.BlackNode(c.key, c.val, d, c.right, null)); }; cljs.core.tree_map_remove = function tree_map_remove(b, c, d, e) { - if(null != c) { - var f = b.call(null, d, c.key); - if(0 === f) { - return e[0] = c, cljs.core.tree_map_append.call(null, c.left, c.right) - } - if(0 > f) { - return b = tree_map_remove.call(null, b, c.left, d, e), null != b || null != e[0] ? c.left instanceof cljs.core.BlackNode ? cljs.core.balance_left_del.call(null, c.key, c.val, b, c.right) : new cljs.core.RedNode(c.key, c.val, b, c.right, null) : null + if (null != c) { + var f; + f = c.key; + f = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, f) : b.call(null, d, f); + if (0 === f) { + return e[0] = c, cljs.core.tree_map_append(c.left, c.right); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - return b = tree_map_remove.call(null, b, c.right, d, e), null != b || null != e[0] ? c.right instanceof cljs.core.BlackNode ? cljs.core.balance_right_del.call(null, c.key, c.val, c.left, b) : new cljs.core.RedNode(c.key, c.val, c.left, b, null) : null + if (0 > f) { + return b = tree_map_remove(b, c.left, d, e), null != b || null != e[0] ? c.left instanceof cljs.core.BlackNode ? cljs.core.balance_left_del(c.key, c.val, b, c.right) : new cljs.core.RedNode(c.key, c.val, b, c.right, null) : null; } + b = tree_map_remove(b, c.right, d, e); + return null != b || null != e[0] ? c.right instanceof cljs.core.BlackNode ? cljs.core.balance_right_del(c.key, c.val, c.left, b) : new cljs.core.RedNode(c.key, c.val, c.left, b, null) : null; } - return null + return null; }; cljs.core.tree_map_replace = function tree_map_replace(b, c, d, e) { - var f = c.key, g = b.call(null, d, f); - return 0 === g ? c.replace(f, e, c.left, c.right) : 0 > g ? c.replace(f, c.val, tree_map_replace.call(null, b, c.left, d, e), c.right) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c.replace(f, c.val, c.left, tree_map_replace.call(null, b, c.right, d, e)) : null + var f = c.key, g; + g = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, f) : b.call(null, d, f); + return 0 === g ? c.replace(f, e, c.left, c.right) : 0 > g ? c.replace(f, c.val, tree_map_replace(b, c.left, d, e), c.right) : c.replace(f, c.val, c.left, tree_map_replace(b, c.right, d, e)); }; cljs.core.PersistentTreeMap = function(a, b, c, d, e) { this.comp = a; @@ -10698,432 +15230,531 @@ cljs.core.PersistentTreeMap = function(a, b, c, d, e) { this.cnt = c; this.meta = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 418776847 + this.cljs$lang$protocol_mask$partition0$ = 418776847; + this.cljs$lang$protocol_mask$partition1$ = 8192; +}; +cljs.core.PersistentTreeMap.prototype.forEach = function(a) { + for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { + if (e < d) { + var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); + a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); + e += 1; + } else { + if (b = cljs.core.seq(b)) { + cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; + } else { + return null; + } + } + } }; -cljs.core.PersistentTreeMap.cljs$lang$type = !0; -cljs.core.PersistentTreeMap.cljs$lang$ctorStr = "cljs.core/PersistentTreeMap"; -cljs.core.PersistentTreeMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMap") +cljs.core.PersistentTreeMap.prototype.get = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; -cljs.core.PersistentTreeMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) +cljs.core.PersistentTreeMap.prototype.entries = function() { + return cljs.core.es6_entries_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentTreeMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.PersistentTreeMap.prototype.keys = function() { + return cljs.core.es6_iterator(cljs.core.keys.cljs$core$IFn$_invoke$arity$1 ? cljs.core.keys.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.keys.call(null, this)); +}; +cljs.core.PersistentTreeMap.prototype.values = function() { + return cljs.core.es6_iterator(cljs.core.vals.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vals.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.vals.call(null, this)); +}; +cljs.core.PersistentTreeMap.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.PersistentTreeMap.prototype.entry_at = function(a) { + for (var b = this.tree;;) { + if (null != b) { + var c; + c = a; + var d = b.key; + c = this.comp.cljs$core$IFn$_invoke$arity$2 ? this.comp.cljs$core$IFn$_invoke$arity$2(c, d) : this.comp.call(null, c, d); + if (0 === c) { + return b; + } + b = 0 > c ? b.left : b.right; + } else { + return null; + } + } +}; +cljs.core.PersistentTreeMap.prototype.has = function(a) { + return cljs.core.contains_QMARK_(this, a); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { a = this.entry_at(b); - return null != a ? a.val : c + return null != a ? a.val : c; +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { + return null != this.tree ? cljs.core.tree_map_kv_reduce(this.tree, b, c) : c; +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, this.meta, this.__hash); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.cnt; +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return 0 < this.cnt ? cljs.core.create_tree_map_seq(this.tree, !1, this.cnt) : null; +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_map(this, b); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, 0); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { + var c = [null], d = cljs.core.tree_map_remove(this.comp, this.tree, b, c); + return null == d ? null == cljs.core.nth.cljs$core$IFn$_invoke$arity$2(c, 0) ? this : new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, null) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt - 1, this.meta, null); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { a = [null]; - var d = cljs.core.tree_map_add.call(null, this.comp, this.tree, b, c, a); - return null == d ? (a = cljs.core.nth.call(null, a, 0), cljs.core._EQ_.call(null, c, a.val) ? this : new cljs.core.PersistentTreeMap(this.comp, cljs.core.tree_map_replace.call(null, this.comp, this.tree, b, c), this.cnt, this.meta, null)) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt + 1, this.meta, null) + var d = cljs.core.tree_map_add(this.comp, this.tree, b, c, a); + return null == d ? (a = cljs.core.nth.cljs$core$IFn$_invoke$arity$2(a, 0), cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, a.val) ? this : new cljs.core.PersistentTreeMap(this.comp, cljs.core.tree_map_replace(this.comp, this.tree, b, c), this.cnt, this.meta, null)) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt + 1, this.meta, null); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return null != this.entry_at(b) + return null != this.entry_at(b); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 < this.cnt ? cljs.core.create_tree_map_seq(this.tree, !0, this.cnt) : null; +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, b, this.__hash); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + if (cljs.core.vector_QMARK_(b)) { + return cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)); + } + for (var c = this, d = cljs.core.seq(b);;) { + if (null == d) { + return c; + } + var e = cljs.core.first(d); + if (cljs.core.vector_QMARK_(e)) { + c = cljs.core._assoc(c, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 1)), d = cljs.core.next(d); + } else { + throw Error("conj on a map takes map entries or seqables of map entries"); + } + } }; cljs.core.PersistentTreeMap.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); cljs.core.PersistentTreeMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - return null != this.tree ? cljs.core.tree_map_kv_reduce.call(null, this.tree, b, c) : c -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !1, this.cnt) : null -}; -cljs.core.PersistentTreeMap.prototype.entry_at = function(a) { - for(var b = this.tree;;) { - if(null != b) { - var c = this.comp.call(null, a, b.key); - if(0 === c) { - return b - } - if(0 > c) { - b = b.left - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - b = b.right - }else { - return null - } - } - }else { - return null - } - } + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_sorted_seq$arity$2 = function(a, b) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, b, this.cnt) : null + return 0 < this.cnt ? cljs.core.create_tree_map_seq(this.tree, b, this.cnt) : null; }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = function(a, b, c) { - if(0 < this.cnt) { + if (0 < this.cnt) { a = null; - for(var d = this.tree;;) { - if(null != d) { - var e = this.comp.call(null, b, d.key); - if(0 === e) { - return new cljs.core.PersistentTreeMapSeq(null, cljs.core.conj.call(null, a, d), c, -1, null) - } - if(cljs.core.truth_(c)) { - 0 > e ? (a = cljs.core.conj.call(null, a, d), d = d.left) : d = d.right - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - 0 < e ? (a = cljs.core.conj.call(null, a, d), d = d.right) : d = d.left - }else { - return null - } + for (var d = this.tree;;) { + if (null != d) { + var e; + e = b; + var f = d.key; + e = this.comp.cljs$core$IFn$_invoke$arity$2 ? this.comp.cljs$core$IFn$_invoke$arity$2(e, f) : this.comp.call(null, e, f); + if (0 === e) { + return new cljs.core.PersistentTreeMapSeq(null, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d), c, -1, null); } - }else { - return null == a ? null : new cljs.core.PersistentTreeMapSeq(null, a, c, -1, null) + cljs.core.truth_(c) ? 0 > e ? (a = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d), d = d.left) : d = d.right : 0 < e ? (a = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d), d = d.right) : d = d.left; + } else { + return null == a ? null : new cljs.core.PersistentTreeMapSeq(null, a, c, -1, null); } } - }else { - return null + } else { + return null; } }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_entry_key$arity$2 = function(a, b) { - return cljs.core.key.call(null, b) + return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.key.call(null, b); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_comparator$arity$1 = function(a) { - return this.comp -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !0, this.cnt) : null -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, b, this.__hash) -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentTreeMap.EMPTY, this.meta) + return this.comp; }; -cljs.core.PersistentTreeMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - var c = [null], d = cljs.core.tree_map_remove.call(null, this.comp, this.tree, b, c); - return null == d ? null == cljs.core.nth.call(null, c, 0) ? this : new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, null) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt - 1, this.meta, null) +cljs.core.PersistentTreeMap.cljs$lang$type = !0; +cljs.core.PersistentTreeMap.cljs$lang$ctorStr = "cljs.core/PersistentTreeMap"; +cljs.core.PersistentTreeMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentTreeMap"); }; cljs.core.__GT_PersistentTreeMap = function(a, b, c, d, e) { - return new cljs.core.PersistentTreeMap(a, b, c, d, e) + return new cljs.core.PersistentTreeMap(a, b, c, d, e); +}; +cljs.core.PersistentTreeMap.EMPTY = new cljs.core.PersistentTreeMap(cljs.core.compare, null, 0, null, cljs.core.empty_unordered_hash); +cljs.core.PersistentTreeMap.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; -cljs.core.PersistentTreeMap.EMPTY = new cljs.core.PersistentTreeMap(cljs.core.compare, null, 0, null, 0); cljs.core.hash_map = function() { var a = function(a) { - a = cljs.core.seq.call(null, a); - for(var b = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { - if(a) { - var e = cljs.core.nnext.call(null, a), b = cljs.core.assoc_BANG_.call(null, b, cljs.core.first.call(null, a), cljs.core.second.call(null, a)); - a = e - }else { - return cljs.core.persistent_BANG_.call(null, b) + a = cljs.core.seq(a); + for (var b = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { + if (a) { + var e = cljs.core.nnext(a), b = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(a), cljs.core.second(a)); + a = e; + } else { + return cljs.core.persistent_BANG_(b); } } }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.array_map = function() { var a = function(a) { - return new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, cljs.core.count.call(null, a), 2), cljs.core.apply.call(null, cljs.core.array, a), null) + return cljs.core.PersistentArrayMap.fromArray(cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.array, a), !0, !1); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.obj_map = function() { var a = function(a) { var b = [], e; e = {}; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { - b.push(cljs.core.first.call(null, a)), e[cljs.core.first.call(null, a)] = cljs.core.second.call(null, a), a = cljs.core.nnext.call(null, a) - }else { - return cljs.core.ObjMap.fromObject.call(null, b, e) + for (a = cljs.core.seq(a);;) { + if (a) { + b.push(cljs.core.first(a)), e[cljs.core.first(a)] = cljs.core.second(a), a = cljs.core.nnext(a); + } else { + return cljs.core.ObjMap.fromObject(b, e); } } }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.sorted_map = function() { var a = function(a) { - a = cljs.core.seq.call(null, a); - for(var b = cljs.core.PersistentTreeMap.EMPTY;;) { - if(a) { - var e = cljs.core.nnext.call(null, a), b = cljs.core.assoc.call(null, b, cljs.core.first.call(null, a), cljs.core.second.call(null, a)); - a = e - }else { - return b + a = cljs.core.seq(a); + for (var b = cljs.core.PersistentTreeMap.EMPTY;;) { + if (a) { + var e = cljs.core.nnext(a), b = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(a), cljs.core.second(a)); + a = e; + } else { + return b; } } }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.sorted_map_by = function() { var a = function(a, b) { - for(var e = cljs.core.seq.call(null, b), f = new cljs.core.PersistentTreeMap(cljs.core.fn__GT_comparator.call(null, a), null, 0, null, 0);;) { - if(e) { - var g = cljs.core.nnext.call(null, e), f = cljs.core.assoc.call(null, f, cljs.core.first.call(null, e), cljs.core.second.call(null, e)), e = g - }else { - return f + for (var e = cljs.core.seq(b), f = new cljs.core.PersistentTreeMap(cljs.core.fn__GT_comparator(a), null, 0, null, 0);;) { + if (e) { + var g = cljs.core.nnext(e), f = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(f, cljs.core.first(e), cljs.core.second(e)), e = g + } else { + return f; } } }, b = function(b, d) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { + f[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.KeySeq = function(a, b) { this.mseq = a; this._meta = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988 + this.cljs$lang$protocol_mask$partition0$ = 32374988; }; -cljs.core.KeySeq.cljs$lang$type = !0; -cljs.core.KeySeq.cljs$lang$ctorStr = "cljs.core/KeySeq"; -cljs.core.KeySeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/KeySeq") +cljs.core.KeySeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.KeySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) +cljs.core.KeySeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.KeySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta; }; cljs.core.KeySeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null == a ? null : new cljs.core.KeySeq(a, this._meta) + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); + return null == a ? null : new cljs.core.KeySeq(a, this._meta); }; -cljs.core.KeySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.KeySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_ordered_coll(this); }; -cljs.core.KeySeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.KeySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.KeySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this._meta); }; cljs.core.KeySeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.KeySeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.KeySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.KeySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - a = cljs.core._first.call(null, this.mseq); - return cljs.core._key.call(null, a) + return this.mseq.cljs$core$ISeq$_first$arity$1(null).cljs$core$IMapEntry$_key$arity$1(null); }; cljs.core.KeySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null != a ? new cljs.core.KeySeq(a, this._meta) : cljs.core.List.EMPTY + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); + return null != a ? new cljs.core.KeySeq(a, this._meta) : cljs.core.List.EMPTY; }; -cljs.core.KeySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.KeySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.KeySeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.KeySeq(this.mseq, b) + return new cljs.core.KeySeq(this.mseq, b); }; -cljs.core.KeySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta +cljs.core.KeySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.KeySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) +cljs.core.KeySeq.cljs$lang$type = !0; +cljs.core.KeySeq.cljs$lang$ctorStr = "cljs.core/KeySeq"; +cljs.core.KeySeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/KeySeq"); }; cljs.core.__GT_KeySeq = function(a, b) { - return new cljs.core.KeySeq(a, b) + return new cljs.core.KeySeq(a, b); +}; +cljs.core.KeySeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.keys = function(a) { - return(a = cljs.core.seq.call(null, a)) ? new cljs.core.KeySeq(a, null) : null + return(a = cljs.core.seq(a)) ? new cljs.core.KeySeq(a, null) : null; }; cljs.core.key = function(a) { - return cljs.core._key.call(null, a) + return cljs.core._key(a); }; cljs.core.ValSeq = function(a, b) { this.mseq = a; this._meta = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988 + this.cljs$lang$protocol_mask$partition0$ = 32374988; }; -cljs.core.ValSeq.cljs$lang$type = !0; -cljs.core.ValSeq.cljs$lang$ctorStr = "cljs.core/ValSeq"; -cljs.core.ValSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ValSeq") +cljs.core.ValSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.ValSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) +cljs.core.ValSeq.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.ValSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta; }; cljs.core.ValSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null == a ? null : new cljs.core.ValSeq(a, this._meta) + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); + return null == a ? null : new cljs.core.ValSeq(a, this._meta); }; -cljs.core.ValSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.ValSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_ordered_coll(this); }; -cljs.core.ValSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.ValSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential(this, b); +}; +cljs.core.ValSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this._meta); }; cljs.core.ValSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); }; cljs.core.ValSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) -}; -cljs.core.ValSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); }; cljs.core.ValSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - a = cljs.core._first.call(null, this.mseq); - return cljs.core._val.call(null, a) + return this.mseq.cljs$core$ISeq$_first$arity$1(null).cljs$core$IMapEntry$_val$arity$1(null); }; cljs.core.ValSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null != a ? new cljs.core.ValSeq(a, this._meta) : cljs.core.List.EMPTY + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); + return null != a ? new cljs.core.ValSeq(a, this._meta) : cljs.core.List.EMPTY; }; -cljs.core.ValSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) +cljs.core.ValSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this; }; cljs.core.ValSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ValSeq(this.mseq, b) + return new cljs.core.ValSeq(this.mseq, b); }; -cljs.core.ValSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta +cljs.core.ValSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); }; -cljs.core.ValSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) +cljs.core.ValSeq.cljs$lang$type = !0; +cljs.core.ValSeq.cljs$lang$ctorStr = "cljs.core/ValSeq"; +cljs.core.ValSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ValSeq"); }; cljs.core.__GT_ValSeq = function(a, b) { - return new cljs.core.ValSeq(a, b) + return new cljs.core.ValSeq(a, b); +}; +cljs.core.ValSeq.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.vals = function(a) { - return(a = cljs.core.seq.call(null, a)) ? new cljs.core.ValSeq(a, null) : null + return(a = cljs.core.seq(a)) ? new cljs.core.ValSeq(a, null) : null; }; cljs.core.val = function(a) { - return cljs.core._val.call(null, a) + return cljs.core._val(a); }; cljs.core.merge = function() { var a = function(a) { - return cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, a)) ? cljs.core.reduce.call(null, function(a, b) { - return cljs.core.conj.call(null, cljs.core.truth_(a) ? a : cljs.core.PersistentArrayMap.EMPTY, b) - }, a) : null + return cljs.core.truth_(cljs.core.some(cljs.core.identity, a)) ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$2(function(a, b) { + return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.truth_(a) ? a : cljs.core.PersistentArrayMap.EMPTY, b); + }, a) : null; }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.merge_with = function() { var a = function(a, b) { - if(cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, b))) { + if (cljs.core.truth_(cljs.core.some(cljs.core.identity, b))) { var e = function(a) { return function(b, c) { - return cljs.core.reduce.call(null, a, cljs.core.truth_(b) ? b : cljs.core.PersistentArrayMap.EMPTY, cljs.core.seq.call(null, c)) - } + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, cljs.core.truth_(b) ? b : cljs.core.PersistentArrayMap.EMPTY, cljs.core.seq(c)); + }; }(function(b, d) { - var e = cljs.core.first.call(null, d), k = cljs.core.second.call(null, d); - return cljs.core.contains_QMARK_.call(null, b, e) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), k)) : cljs.core.assoc.call(null, b, e, k) + var e = cljs.core.first(d), k = cljs.core.second(d); + return cljs.core.contains_QMARK_(b, e) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, function() { + var d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e); + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(d, k) : a.call(null, d, k); + }()) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, k); }); - return cljs.core.reduce.call(null, e, b) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$2(e, b); } - return null + return null; }, b = function(b, d) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { + f[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.select_keys = function(a, b) { - for(var c = cljs.core.PersistentArrayMap.EMPTY, d = cljs.core.seq.call(null, b);;) { - if(d) { - var e = cljs.core.first.call(null, d), f = cljs.core.get.call(null, a, e, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", 4155500789)), c = cljs.core.not_EQ_.call(null, f, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", 4155500789)) ? cljs.core.assoc.call(null, c, e, f) : c, d = cljs.core.next.call(null, d) - }else { - return c + for (var c = cljs.core.PersistentArrayMap.EMPTY, d = cljs.core.seq(b);;) { + if (d) { + var e = cljs.core.first(d), f = cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, e, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", -1572889185)), c = cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(f, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", -1572889185)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(c, e, f) : c, d = cljs.core.next(d) + } else { + return cljs.core.with_meta(c, cljs.core.meta(a)); } } }; @@ -11131,312 +15762,410 @@ cljs.core.PersistentHashSet = function(a, b, c) { this.meta = a; this.hash_map = b; this.__hash = c; - this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 15077647 + this.cljs$lang$protocol_mask$partition0$ = 15077647; + this.cljs$lang$protocol_mask$partition1$ = 8196; }; -cljs.core.PersistentHashSet.cljs$lang$type = !0; -cljs.core.PersistentHashSet.cljs$lang$ctorStr = "cljs.core/PersistentHashSet"; -cljs.core.PersistentHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentHashSet") +cljs.core.PersistentHashSet.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.PersistentHashSet.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.PersistentHashSet.prototype.keys = function() { + return cljs.core.es6_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentHashSet.prototype.entries = function() { + return cljs.core.es6_set_entries_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentHashSet.prototype.values = function() { + return cljs.core.es6_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentHashSet.prototype.has = function(a) { + return cljs.core.contains_QMARK_(this, a); +}; +cljs.core.PersistentHashSet.prototype.forEach = function(a) { + for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { + if (e < d) { + var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); + a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); + e += 1; + } else { + if (b = cljs.core.seq(b)) { + cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; + } else { + return null; + } + } + } +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return cljs.core._contains_key_QMARK_(this.hash_map, b) ? b : c; +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.PersistentHashSet.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientHashSet(cljs.core._as_transient.call(null, this.hash_map)) +cljs.core.PersistentHashSet.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentHashSet(this.meta, this.hash_map, this.__hash); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return cljs.core._count(this.hash_map); }; cljs.core.PersistentHashSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); }; -cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) +cljs.core.PersistentHashSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.set_QMARK_(b) && cljs.core.count(this) === cljs.core.count(b) && cljs.core.every_QMARK_(function(a) { + return function(b) { + return cljs.core.contains_QMARK_(a, b); + }; + }(this), b); }; -cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._contains_key_QMARK_.call(null, this.hash_map, b) ? b : c +cljs.core.PersistentHashSet.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return new cljs.core.TransientHashSet(cljs.core._as_transient(this.hash_map)); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.PersistentHashSet.EMPTY, this.meta); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { + return new cljs.core.PersistentHashSet(this.meta, cljs.core._dissoc(this.hash_map, b), null); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.keys(this.hash_map); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentHashSet(b, this.hash_map, this.__hash); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentHashSet(this.meta, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.hash_map, b, null), null); }; cljs.core.PersistentHashSet.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); cljs.core.PersistentHashSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.PersistentHashSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentHashSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(this.meta, cljs.core.assoc.call(null, this.hash_map, b, null), null) -}; -cljs.core.PersistentHashSet.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.keys.call(null, this.hash_map) -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(this.meta, cljs.core._dissoc.call(null, this.hash_map, b), null) -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core._count.call(null, this.hash_map) -}; -cljs.core.PersistentHashSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - var c = this; - return cljs.core.set_QMARK_.call(null, b) && cljs.core.count.call(null, c) === cljs.core.count.call(null, b) && cljs.core.every_QMARK_.call(null, function(a) { - return cljs.core.contains_QMARK_.call(null, c, a) - }, b) -}; -cljs.core.PersistentHashSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(b, this.hash_map, this.__hash) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; -cljs.core.PersistentHashSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta -}; -cljs.core.PersistentHashSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentHashSet.EMPTY, this.meta) +cljs.core.PersistentHashSet.cljs$lang$type = !0; +cljs.core.PersistentHashSet.cljs$lang$ctorStr = "cljs.core/PersistentHashSet"; +cljs.core.PersistentHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentHashSet"); }; cljs.core.__GT_PersistentHashSet = function(a, b, c) { - return new cljs.core.PersistentHashSet(a, b, c) + return new cljs.core.PersistentHashSet(a, b, c); }; -cljs.core.PersistentHashSet.EMPTY = new cljs.core.PersistentHashSet(null, cljs.core.PersistentArrayMap.EMPTY, 0); +cljs.core.PersistentHashSet.EMPTY = new cljs.core.PersistentHashSet(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.empty_unordered_hash); cljs.core.PersistentHashSet.fromArray = function(a, b) { var c = a.length; - if(c <= cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD) { - b || cljs.core.aclone.call(null, a); - for(var d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { - if(d < c) { - var f = d + 1, e = cljs.core._assoc_BANG_.call(null, e, a[d], null), d = f - }else { - return new cljs.core.PersistentHashSet(null, cljs.core._persistent_BANG_.call(null, e), null) + if (c <= cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD) { + b || cljs.core.aclone(a); + for (var d = 0, e = cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY);;) { + if (d < c) { + var f = d + 1, e = cljs.core._assoc_BANG_(e, a[d], null), d = f + } else { + return new cljs.core.PersistentHashSet(null, cljs.core._persistent_BANG_(e), null); } } - }else { - for(d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashSet.EMPTY);;) { - if(d < c) { - f = d + 2, e = cljs.core._conj_BANG_.call(null, e, a[d]), d = f - }else { - return cljs.core._persistent_BANG_.call(null, e) + } else { + for (d = 0, e = cljs.core.transient$(cljs.core.PersistentHashSet.EMPTY);;) { + if (d < c) { + f = d + 1, e = cljs.core._conj_BANG_(e, a[d]), d = f; + } else { + return cljs.core._persistent_BANG_(e); } } } }; +cljs.core.PersistentHashSet.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; cljs.core.TransientHashSet = function(a) { this.transient_map = a; this.cljs$lang$protocol_mask$partition0$ = 259; - this.cljs$lang$protocol_mask$partition1$ = 136 -}; -cljs.core.TransientHashSet.cljs$lang$type = !0; -cljs.core.TransientHashSet.cljs$lang$ctorStr = "cljs.core/TransientHashSet"; -cljs.core.TransientHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientHashSet") + this.cljs$lang$protocol_mask$partition1$ = 136; }; cljs.core.TransientHashSet.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, b = function(a, b) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : b; + }, c = function(a, b, c) { + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b; + }, a = function(a, e, f) { switch(arguments.length) { case 2: - var e; - e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : c; - return e; + return b.call(this, a, e); case 3: - return e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? d : c, e + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + return a; }(); cljs.core.TransientHashSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.TransientHashSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : a + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : a; }; cljs.core.TransientHashSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? b : a + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? b : a; }; cljs.core.TransientHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.TransientHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._lookup.call(null, this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b; }; cljs.core.TransientHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.count.call(null, this.transient_map) + return cljs.core.count(this.transient_map); }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 = function(a, b) { - this.transient_map = cljs.core.dissoc_BANG_.call(null, this.transient_map, b); - return this + this.transient_map = cljs.core.dissoc_BANG_.cljs$core$IFn$_invoke$arity$2(this.transient_map, b); + return this; }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - this.transient_map = cljs.core.assoc_BANG_.call(null, this.transient_map, b, null); - return this + this.transient_map = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, null); + return this; }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - return new cljs.core.PersistentHashSet(null, cljs.core.persistent_BANG_.call(null, this.transient_map), null) + return new cljs.core.PersistentHashSet(null, cljs.core.persistent_BANG_(this.transient_map), null); +}; +cljs.core.TransientHashSet.cljs$lang$type = !0; +cljs.core.TransientHashSet.cljs$lang$ctorStr = "cljs.core/TransientHashSet"; +cljs.core.TransientHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/TransientHashSet"); }; cljs.core.__GT_TransientHashSet = function(a) { - return new cljs.core.TransientHashSet(a) + return new cljs.core.TransientHashSet(a); }; cljs.core.PersistentTreeSet = function(a, b, c) { this.meta = a; this.tree_map = b; this.__hash = c; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 417730831 -}; -cljs.core.PersistentTreeSet.cljs$lang$type = !0; -cljs.core.PersistentTreeSet.cljs$lang$ctorStr = "cljs.core/PersistentTreeSet"; -cljs.core.PersistentTreeSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentTreeSet") + this.cljs$lang$protocol_mask$partition0$ = 417730831; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.PersistentTreeSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this) +cljs.core.PersistentTreeSet.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); +}; +cljs.core.PersistentTreeSet.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.PersistentTreeSet.prototype.keys = function() { + return cljs.core.es6_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentTreeSet.prototype.entries = function() { + return cljs.core.es6_set_entries_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentTreeSet.prototype.values = function() { + return cljs.core.es6_iterator(cljs.core.seq(this)); +}; +cljs.core.PersistentTreeSet.prototype.has = function(a) { + return cljs.core.contains_QMARK_(this, a); +}; +cljs.core.PersistentTreeSet.prototype.forEach = function(a) { + for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { + if (e < d) { + var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); + a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); + e += 1; + } else { + if (b = cljs.core.seq(b)) { + cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; + } else { + return null; + } + } + } }; cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { a = this.tree_map.entry_at(b); - return null != a ? a.key : c + return null != a ? a.key : c; +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentTreeSet(this.meta, this.tree_map, this.__hash); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return cljs.core.count(this.tree_map); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return 0 < cljs.core.count(this.tree_map) ? cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key, cljs.core.rseq(this.tree_map)) : null; +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.set_QMARK_(b) && cljs.core.count(this) === cljs.core.count(b) && cljs.core.every_QMARK_(function(a) { + return function(b) { + return cljs.core.contains_QMARK_(a, b); + }; + }(this), b); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return new cljs.core.PersistentTreeSet(this.meta, cljs.core._empty(this.tree_map), 0); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeSet(this.meta, cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(this.tree_map, b), null); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.keys(this.tree_map); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeSet(b, this.tree_map, this.__hash); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeSet(this.meta, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.tree_map, b, null), null); }; cljs.core.PersistentTreeSet.prototype.call = function() { - var a = null; - return a = function(a, c, d) { + var a = null, a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; + a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + }; + a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + }; + return a; }(); cljs.core.PersistentTreeSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core.assoc.call(null, this.tree_map, b, null), null) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < cljs.core.count.call(null, this.tree_map) ? cljs.core.map.call(null, cljs.core.key, cljs.core.rseq.call(null, this.tree_map)) : null -}; -cljs.core.PersistentTreeSet.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq$arity$2 = function(a, b) { - return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq.call(null, this.tree_map, b)) + return cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key, cljs.core._sorted_seq(this.tree_map, b)); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = function(a, b, c) { - return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq_from.call(null, this.tree_map, b, c)) + return cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key, cljs.core._sorted_seq_from(this.tree_map, b, c)); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_entry_key$arity$2 = function(a, b) { - return b + return b; }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_comparator$arity$1 = function(a) { - return cljs.core._comparator.call(null, this.tree_map) + return cljs.core._comparator(this.tree_map); }; -cljs.core.PersistentTreeSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.keys.call(null, this.tree_map) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core.dissoc.call(null, this.tree_map, b), null) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.count.call(null, this.tree_map) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - var c = this; - return cljs.core.set_QMARK_.call(null, b) && cljs.core.count.call(null, c) === cljs.core.count.call(null, b) && cljs.core.every_QMARK_.call(null, function(a) { - return cljs.core.contains_QMARK_.call(null, c, a) - }, b) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(b, this.tree_map, this.__hash) -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentTreeSet.EMPTY, this.meta) +cljs.core.PersistentTreeSet.cljs$lang$type = !0; +cljs.core.PersistentTreeSet.cljs$lang$ctorStr = "cljs.core/PersistentTreeSet"; +cljs.core.PersistentTreeSet.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/PersistentTreeSet"); }; cljs.core.__GT_PersistentTreeSet = function(a, b, c) { - return new cljs.core.PersistentTreeSet(a, b, c) + return new cljs.core.PersistentTreeSet(a, b, c); +}; +cljs.core.PersistentTreeSet.EMPTY = new cljs.core.PersistentTreeSet(null, cljs.core.PersistentTreeMap.EMPTY, cljs.core.empty_unordered_hash); +cljs.core.PersistentTreeSet.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; -cljs.core.PersistentTreeSet.EMPTY = new cljs.core.PersistentTreeSet(null, cljs.core.PersistentTreeMap.EMPTY, 0); cljs.core.set_from_indexed_seq = function(a) { a = a.arr; a: { - for(var b = 0, c = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { - if(b < a.length) { - var d = b + 1, c = cljs.core._conj_BANG_.call(null, c, a[b]), b = d - }else { + for (var b = 0, c = cljs.core._as_transient(cljs.core.PersistentHashSet.EMPTY);;) { + if (b < a.length) { + var d = b + 1, c = c.cljs$core$ITransientCollection$_conj_BANG_$arity$2(null, a[b]), b = d + } else { a = c; - break a + break a; } } - a = void 0 + a = void 0; } - return cljs.core._persistent_BANG_.call(null, a) + return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(null); }; cljs.core.set = function(a) { - a = cljs.core.seq.call(null, a); - if(null == a) { - return cljs.core.PersistentHashSet.EMPTY + a = cljs.core.seq(a); + if (null == a) { + return cljs.core.PersistentHashSet.EMPTY; } - if(a instanceof cljs.core.IndexedSeq) { - return cljs.core.set_from_indexed_seq.call(null, a) + if (a instanceof cljs.core.IndexedSeq && 0 === a.i) { + return cljs.core.set_from_indexed_seq(a); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - for(var b = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { - if(null != a) { - var c = cljs.core._next.call(null, a), b = cljs.core._conj_BANG_.call(null, b, cljs.core._first.call(null, a)); - a = c - }else { - return cljs.core._persistent_BANG_.call(null, b) - } + for (var b = cljs.core._as_transient(cljs.core.PersistentHashSet.EMPTY);;) { + if (null != a) { + var c = a.cljs$core$INext$_next$arity$1(null), b = b.cljs$core$ITransientCollection$_conj_BANG_$arity$2(null, a.cljs$core$ISeq$_first$arity$1(null)); + a = c; + } else { + return b.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(null); } - }else { - return null } }; cljs.core.hash_set = function() { var a = null, b = function() { - return cljs.core.PersistentHashSet.EMPTY + return cljs.core.PersistentHashSet.EMPTY; }, c = function() { var a = function(a) { - return cljs.core.set.call(null, a) + return cljs.core.set(a); }, b = function(b) { var c = null; - 0 < arguments.length && (c = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, c) + if (0 < arguments.length) { + for (var c = 0, e = Array(arguments.length - 0);c < e.length;) { + e[c] = arguments[c + 0], ++c; + } + c = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, c); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a) { switch(arguments.length) { case 0: return b.call(this); default: - return c.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)) + var e = null; + if (0 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 0);e < f.length;) { + f[e] = arguments[e + 0], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(e); } throw Error("Invalid arity: " + arguments.length); }; @@ -11444,113 +16173,193 @@ cljs.core.hash_set = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.sorted_set = function() { var a = function(a) { - return cljs.core.reduce.call(null, cljs.core._conj, cljs.core.PersistentTreeSet.EMPTY, a) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, cljs.core.PersistentTreeSet.EMPTY, a); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.sorted_set_by = function() { var a = function(a, b) { - return cljs.core.reduce.call(null, cljs.core._conj, new cljs.core.PersistentTreeSet(null, cljs.core.sorted_map_by.call(null, a), 0), b) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, new cljs.core.PersistentTreeSet(null, cljs.core.sorted_map_by(a), 0), b); }, b = function(b, d) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { + f[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b -}(); -cljs.core.replace = function(a, b) { - if(cljs.core.vector_QMARK_.call(null, b)) { - var c = cljs.core.count.call(null, b); - return cljs.core.reduce.call(null, function(b, c) { - var f = cljs.core.find.call(null, a, cljs.core.nth.call(null, b, c)); - return cljs.core.truth_(f) ? cljs.core.assoc.call(null, b, c, cljs.core.second.call(null, f)) : b - }, b, cljs.core.take.call(null, c, cljs.core.iterate.call(null, cljs.core.inc, 0))) - } - return cljs.core.map.call(null, function(b) { - var c = cljs.core.find.call(null, a, b); - return cljs.core.truth_(c) ? cljs.core.second.call(null, c) : b - }, b) -}; -cljs.core.distinct = function(a) { - return function c(a, e) { - return new cljs.core.LazySeq(null, function() { - return function(a, d) { - for(;;) { - var e = a, k = cljs.core.nth.call(null, e, 0, null); - if(e = cljs.core.seq.call(null, e)) { - if(cljs.core.contains_QMARK_.call(null, d, k)) { - k = cljs.core.rest.call(null, e), e = d, a = k, d = e - }else { - return cljs.core.cons.call(null, k, c.call(null, cljs.core.rest.call(null, e), cljs.core.conj.call(null, d, k))) + return b; +}(); +cljs.core.replace = function() { + var a = null, b = function(a) { + return cljs.core.map.cljs$core$IFn$_invoke$arity$1(function(b) { + var c = cljs.core.find(a, b); + return cljs.core.truth_(c) ? cljs.core.val(c) : b; + }); + }, c = function(a, b) { + if (cljs.core.vector_QMARK_(b)) { + var c = cljs.core.count(b); + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b) { + return function(b, c) { + var e = cljs.core.find(a, cljs.core.nth.cljs$core$IFn$_invoke$arity$2(b, c)); + return cljs.core.truth_(e) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.second(e)) : b; + }; + }(c), b, cljs.core.take.cljs$core$IFn$_invoke$arity$2(c, cljs.core.iterate(cljs.core.inc, 0))); + } + return cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(b) { + var c = cljs.core.find(a, b); + return cljs.core.truth_(c) ? cljs.core.second(c) : b; + }, b); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.distinct = function() { + var a = null, b = function() { + return function(a) { + return function(b) { + return function() { + var c = null, g = function() { + return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); + }, h = function(b) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + }, k = function(c, f) { + if (cljs.core.contains_QMARK_(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b), f)) { + return c; + } + b.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(b.cljs$core$IDeref$_deref$arity$1(null), f)); + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, f) : a.call(null, c, f); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return g.call(this); + case 1: + return h.call(this, a); + case 2: + return k.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = g; + c.cljs$core$IFn$_invoke$arity$1 = h; + c.cljs$core$IFn$_invoke$arity$2 = k; + return c; + }(); + }(cljs.core.volatile_BANG_(cljs.core.PersistentHashSet.EMPTY)); + }; + }, c = function(a) { + return function f(a, b) { + return new cljs.core.LazySeq(null, function() { + return function(a, b) { + for (;;) { + var c = a, d = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); + if (c = cljs.core.seq(c)) { + if (cljs.core.contains_QMARK_(b, d)) { + d = cljs.core.rest(c), c = b, a = d, b = c; + } else { + return cljs.core.cons(d, f(cljs.core.rest(c), cljs.core.conj.cljs$core$IFn$_invoke$arity$2(b, d))); + } + } else { + return null; } - }else { - return null } - } - }.call(null, a, e) - }, null, null) - }.call(null, a, cljs.core.PersistentHashSet.EMPTY) -}; + }.call(null, a, b); + }, null, null); + }(a, cljs.core.PersistentHashSet.EMPTY); + }, a = function(a) { + switch(arguments.length) { + case 0: + return b.call(this); + case 1: + return c.call(this, a); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$0 = b; + a.cljs$core$IFn$_invoke$arity$1 = c; + return a; +}(); cljs.core.butlast = function(a) { - for(var b = cljs.core.PersistentVector.EMPTY;;) { - if(cljs.core.next.call(null, a)) { - b = cljs.core.conj.call(null, b, cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a) - }else { - return cljs.core.seq.call(null, b) + for (var b = cljs.core.PersistentVector.EMPTY;;) { + if (cljs.core.next(a)) { + b = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(b, cljs.core.first(a)), a = cljs.core.next(a); + } else { + return cljs.core.seq(b); } } }; cljs.core.name = function(a) { - if(a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { - return cljs.core._name.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { + return a.cljs$core$INamed$_name$arity$1(null); } - if("string" === typeof a) { - return a + if ("string" === typeof a) { + return a; } throw Error([cljs.core.str("Doesn't support name: "), cljs.core.str(a)].join("")); }; cljs.core.zipmap = function(a, b) { - for(var c = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), d = cljs.core.seq.call(null, a), e = cljs.core.seq.call(null, b);;) { - if(d && e) { - c = cljs.core.assoc_BANG_.call(null, c, cljs.core.first.call(null, d), cljs.core.first.call(null, e)), d = cljs.core.next.call(null, d), e = cljs.core.next.call(null, e) - }else { - return cljs.core.persistent_BANG_.call(null, c) + for (var c = cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY), d = cljs.core.seq(a), e = cljs.core.seq(b);;) { + if (d && e) { + c = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(c, cljs.core.first(d), cljs.core.first(e)), d = cljs.core.next(d), e = cljs.core.next(e); + } else { + return cljs.core.persistent_BANG_(c); } } }; cljs.core.max_key = function() { var a = null, b = function(a, b, c) { - return a.call(null, b) > a.call(null, c) ? b : c + return(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)) > (a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)) ? b : c; }, c = function() { var b = function(b, c, d, e) { - return cljs.core.reduce.call(null, function(c, d) { - return a.call(null, b, c, d) - }, a.call(null, b, c, d), e) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(c, d) { + return a.cljs$core$IFn$_invoke$arity$3(b, c, d); + }, a.cljs$core$IFn$_invoke$arity$3(b, c, d), e); }, c = function(a, c, e, k) { var l = null; - 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, e, l) + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return b.call(this, a, c, e, l); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -11560,10 +16369,10 @@ cljs.core.max_key = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a) + return b(c, e, k, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f, g) { switch(arguments.length) { case 2: @@ -11571,31 +16380,43 @@ cljs.core.max_key = function() { case 3: return b.call(this, a, e, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) + var h = null; + if (3 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { + k[h] = arguments[h + 3], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return b + return b; }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.min_key = function() { var a = null, b = function(a, b, c) { - return a.call(null, b) < a.call(null, c) ? b : c + return(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)) < (a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)) ? b : c; }, c = function() { var b = function(b, c, d, e) { - return cljs.core.reduce.call(null, function(c, d) { - return a.call(null, b, c, d) - }, a.call(null, b, c, d), e) + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(c, d) { + return a.cljs$core$IFn$_invoke$arity$3(b, c, d); + }, a.cljs$core$IFn$_invoke$arity$3(b, c, d), e); }, c = function(a, c, e, k) { var l = null; - 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, e, l) + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return b.call(this, a, c, e, l); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -11605,10 +16426,10 @@ cljs.core.min_key = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a) + return b(c, e, k, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f, g) { switch(arguments.length) { case 2: @@ -11616,181 +16437,352 @@ cljs.core.min_key = function() { case 3: return b.call(this, a, e, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) + var h = null; + if (3 < arguments.length) { + for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { + k[h] = arguments[h + 3], ++h; + } + h = new cljs.core.IndexedSeq(k, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return b + return b; }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); +cljs.core.ArrayList = function(a) { + this.arr = a; +}; +cljs.core.ArrayList.prototype.add = function(a) { + return this.arr.push(a); +}; +cljs.core.ArrayList.prototype.size = function() { + return this.arr.length; +}; +cljs.core.ArrayList.prototype.clear = function() { + return this.arr = []; +}; +cljs.core.ArrayList.prototype.isEmpty = function() { + return 0 === this.arr.length; +}; +cljs.core.ArrayList.prototype.toArray = function() { + return this.arr; +}; +cljs.core.ArrayList.cljs$lang$type = !0; +cljs.core.ArrayList.cljs$lang$ctorStr = "cljs.core/ArrayList"; +cljs.core.ArrayList.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/ArrayList"); +}; +cljs.core.__GT_ArrayList = function(a) { + return new cljs.core.ArrayList(a); +}; +cljs.core.array_list = function() { + return new cljs.core.ArrayList([]); +}; cljs.core.partition_all = function() { - var a = null, b = function(b, c) { - return a.call(null, b, b, c) - }, c = function(b, c, f) { + var a = null, b = function(a) { + return function(b) { + return function(c) { + return function() { + var d = null, k = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, l = function(a) { + if (!cljs.core.truth_(c.isEmpty())) { + var d = cljs.core.vec(c.toArray()); + c.clear(); + a = cljs.core.unreduced(b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(a, d) : b.call(null, a, d)); + } + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, m = function(d, h) { + c.add(h); + if (a === c.size()) { + var k = cljs.core.vec(c.toArray()); + c.clear(); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, k) : b.call(null, d, k); + } + return d; + }, d = function(a, b) { + switch(arguments.length) { + case 0: + return k.call(this); + case 1: + return l.call(this, a); + case 2: + return m.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + d.cljs$core$IFn$_invoke$arity$0 = k; + d.cljs$core$IFn$_invoke$arity$1 = l; + d.cljs$core$IFn$_invoke$arity$2 = m; + return d; + }(); + }(cljs.core.array_list()); + }; + }, c = function(b, c) { + return a.cljs$core$IFn$_invoke$arity$3(b, b, c); + }, d = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var g = cljs.core.seq.call(null, f); - return g ? cljs.core.cons.call(null, cljs.core.take.call(null, b, g), a.call(null, b, c, cljs.core.drop.call(null, c, g))) : null - }, null, null) - }, a = function(a, e, f) { + var h = cljs.core.seq(d); + return h ? cljs.core.cons(cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, h), a.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(c, h))) : null; + }, null, null); + }, a = function(a, f, g) { switch(arguments.length) { + case 1: + return b.call(this, a); case 2: - return b.call(this, a, e); + return c.call(this, a, f); case 3: - return c.call(this, a, e, f) + return d.call(this, a, f, g); } throw Error("Invalid arity: " + arguments.length); }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - return a + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$3 = d; + return a; +}(); +cljs.core.take_while = function() { + var a = null, b = function(a) { + return function(b) { + return function() { + var c = null, g = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, h = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, k = function(c, f) { + return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f)) ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, f) : b.call(null, c, f) : cljs.core.reduced(c); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return g.call(this); + case 1: + return h.call(this, a); + case 2: + return k.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = g; + c.cljs$core$IFn$_invoke$arity$1 = h; + c.cljs$core$IFn$_invoke$arity$2 = k; + return c; + }(); + }; + }, c = function(b, c) { + return new cljs.core.LazySeq(null, function() { + var f = cljs.core.seq(c); + return f ? cljs.core.truth_(function() { + var a = cljs.core.first(f); + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }()) ? cljs.core.cons(cljs.core.first(f), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(f))) : null : null; + }, null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; }(); -cljs.core.take_while = function take_while(b, c) { - return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, c); - return d ? cljs.core.truth_(b.call(null, cljs.core.first.call(null, d))) ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_while.call(null, b, cljs.core.rest.call(null, d))) : null : null - }, null, null) -}; cljs.core.mk_bound_fn = function(a, b, c) { return function(d) { - var e = cljs.core._comparator.call(null, a); - return b.call(null, e.call(null, cljs.core._entry_key.call(null, a, d), c), 0) - } + var e = cljs.core._comparator(a); + d = cljs.core._entry_key(a, d); + e = e.cljs$core$IFn$_invoke$arity$2 ? e.cljs$core$IFn$_invoke$arity$2(d, c) : e.call(null, d, c); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(e, 0) : b.call(null, e, 0); + }; }; cljs.core.subseq = function() { var a = null, b = function(a, b, c) { - var g = cljs.core.mk_bound_fn.call(null, a, b, c); - return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._GT_, cljs.core._GT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !0), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !0)) + var g = cljs.core.mk_bound_fn(a, b, c); + return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._GT_, cljs.core._GT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from(a, c, !0), cljs.core.truth_(a) ? (b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), cljs.core.truth_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b)) ? a : cljs.core.next(a)) : null) : cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(g, cljs.core._sorted_seq(a, !0)); }, c = function(a, b, c, g, h) { - var k = cljs.core._sorted_seq_from.call(null, a, c, !0); - if(cljs.core.truth_(k)) { - var l = cljs.core.nth.call(null, k, 0, null); - return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, g, h), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, b, c).call(null, l)) ? k : cljs.core.next.call(null, k)) + var k = cljs.core._sorted_seq_from(a, c, !0); + if (cljs.core.truth_(k)) { + var l = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(k, 0, null); + return cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(cljs.core.mk_bound_fn(a, g, h), cljs.core.truth_(cljs.core.mk_bound_fn(a, b, c).call(null, l)) ? k : cljs.core.next(k)); } - return null + return null; }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h) + return c.call(this, a, e, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a + return a; }(); cljs.core.rsubseq = function() { var a = null, b = function(a, b, c) { - var g = cljs.core.mk_bound_fn.call(null, a, b, c); - return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._LT_, cljs.core._LT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !1), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !1)) + var g = cljs.core.mk_bound_fn(a, b, c); + return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._LT_, cljs.core._LT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from(a, c, !1), cljs.core.truth_(a) ? (b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), cljs.core.truth_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b)) ? a : cljs.core.next(a)) : null) : cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(g, cljs.core._sorted_seq(a, !1)); }, c = function(a, b, c, g, h) { - var k = cljs.core._sorted_seq_from.call(null, a, h, !1); - if(cljs.core.truth_(k)) { - var l = cljs.core.nth.call(null, k, 0, null); - return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, b, c), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, g, h).call(null, l)) ? k : cljs.core.next.call(null, k)) + var k = cljs.core._sorted_seq_from(a, h, !1); + if (cljs.core.truth_(k)) { + var l = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(k, 0, null); + return cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(cljs.core.mk_bound_fn(a, b, c), cljs.core.truth_(cljs.core.mk_bound_fn(a, g, h).call(null, l)) ? k : cljs.core.next(k)); } - return null + return null; }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h) + return c.call(this, a, e, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a + return a; }(); +cljs.core.RangeIterator = function(a, b, c) { + this.i = a; + this.end = b; + this.step = c; +}; +cljs.core.RangeIterator.prototype.hasNext = function() { + return 0 < this.step ? this.i < this.end : this.i > this.end; +}; +cljs.core.RangeIterator.prototype.next = function() { + var a = this.i; + this.i += this.step; + return a; +}; +cljs.core.RangeIterator.cljs$lang$type = !0; +cljs.core.RangeIterator.cljs$lang$ctorStr = "cljs.core/RangeIterator"; +cljs.core.RangeIterator.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/RangeIterator"); +}; +cljs.core.__GT_RangeIterator = function(a, b, c) { + return new cljs.core.RangeIterator(a, b, c); +}; cljs.core.Range = function(a, b, c, d, e) { this.meta = a; this.start = b; this.end = c; this.step = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32375006 + this.cljs$lang$protocol_mask$partition0$ = 32375006; + this.cljs$lang$protocol_mask$partition1$ = 8192; }; -cljs.core.Range.cljs$lang$type = !0; -cljs.core.Range.cljs$lang$ctorStr = "cljs.core/Range"; -cljs.core.Range.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Range") +cljs.core.Range.prototype.toString = function() { + return cljs.core.pr_str_STAR_(this); }; -cljs.core.Range.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) +cljs.core.Range.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); }; -cljs.core.Range.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 0 < this.step ? this.start + this.step < this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null : this.start + this.step > this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null +cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + if (b < cljs.core._count(this)) { + return this.start + b * this.step; + } + if (this.start > this.end && 0 === this.step) { + return this.start; + } + throw Error("Index out of bounds"); }; -cljs.core.Range.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) +cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return b < cljs.core._count(this) ? this.start + b * this.step : this.start > this.end && 0 === this.step ? this.start : c; }; -cljs.core.Range.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) +cljs.core.Range.prototype.cljs$core$IIterable$ = !0; +cljs.core.Range.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { + return new cljs.core.RangeIterator(this.start, this.end, this.step); }; -cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) +cljs.core.Range.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta; }; -cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) +cljs.core.Range.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Range(this.meta, this.start, this.end, this.step, this.__hash); }; -cljs.core.Range.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.step ? this.start < this.end ? this : null : this.start > this.end ? this : null +cljs.core.Range.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return 0 < this.step ? this.start + this.step < this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null : this.start + this.step > this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null; }; cljs.core.Range.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.not.call(null, cljs.core._seq.call(null, this)) ? 0 : Math.ceil((this.end - this.start) / this.step) -}; -cljs.core.Range.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.start + if (cljs.core.not(cljs.core._seq(this))) { + return 0; + } + a = (this.end - this.start) / this.step; + return Math.ceil.cljs$core$IFn$_invoke$arity$1 ? Math.ceil.cljs$core$IFn$_invoke$arity$1(a) : Math.ceil.call(null, a); }; -cljs.core.Range.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null != cljs.core._seq.call(null, this) ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : cljs.core.List.EMPTY +cljs.core.Range.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); }; cljs.core.Range.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential(this, b); }; -cljs.core.Range.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Range(b, this.start, this.end, this.step, this.__hash) +cljs.core.Range.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); }; -cljs.core.Range.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta +cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); }; -cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(b < cljs.core._count.call(null, this)) { - return this.start + b * this.step - } - if(this.start > this.end && 0 === this.step) { - return this.start +cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + for (a = this.start;;) { + if (0 < this.step ? a < this.end : a > this.end) { + var d = a; + c = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); + if (cljs.core.reduced_QMARK_(c)) { + return b = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + } + a += this.step; + } else { + return c; + } } - throw Error("Index out of bounds"); }; -cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return b < cljs.core._count.call(null, this) ? this.start + b * this.step : this.start > this.end && 0 === this.step ? this.start : c +cljs.core.Range.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + return null == cljs.core._seq(this) ? null : this.start; }; -cljs.core.Range.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) +cljs.core.Range.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + return null != cljs.core._seq(this) ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : cljs.core.List.EMPTY; +}; +cljs.core.Range.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 < this.step ? this.start < this.end ? this : null : this.start > this.end ? this : null; +}; +cljs.core.Range.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.Range(b, this.start, this.end, this.step, this.__hash); +}; +cljs.core.Range.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons(b, this); +}; +cljs.core.Range.cljs$lang$type = !0; +cljs.core.Range.cljs$lang$ctorStr = "cljs.core/Range"; +cljs.core.Range.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Range"); }; cljs.core.__GT_Range = function(a, b, c, d, e) { - return new cljs.core.Range(a, b, c, d, e) + return new cljs.core.Range(a, b, c, d, e); +}; +cljs.core.Range.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); }; cljs.core.range = function() { var a = null, b = function() { - return a.call(null, 0, Number.MAX_VALUE, 1) + return a.cljs$core$IFn$_invoke$arity$3(0, Number.MAX_VALUE, 1); }, c = function(b) { - return a.call(null, 0, b, 1) + return a.cljs$core$IFn$_invoke$arity$3(0, b, 1); }, d = function(b, c) { - return a.call(null, b, c, 1) + return a.cljs$core$IFn$_invoke$arity$3(b, c, 1); }, e = function(a, b, c) { - return new cljs.core.Range(null, a, b, c, null) + return new cljs.core.Range(null, a, b, c, null); }, a = function(a, g, h) { switch(arguments.length) { case 0: @@ -11800,7 +16792,7 @@ cljs.core.range = function() { case 2: return d.call(this, a, g); case 3: - return e.call(this, a, g, h) + return e.call(this, a, g, h); } throw Error("Invalid arity: " + arguments.length); }; @@ -11808,70 +16800,190 @@ cljs.core.range = function() { a.cljs$core$IFn$_invoke$arity$1 = c; a.cljs$core$IFn$_invoke$arity$2 = d; a.cljs$core$IFn$_invoke$arity$3 = e; - return a + return a; +}(); +cljs.core.take_nth = function() { + var a = null, b = function(a) { + return function(b) { + return function(c) { + return function() { + var g = null, h = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, k = function(a) { + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, l = function(g, h) { + var k = c.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, c.cljs$core$IDeref$_deref$arity$1(null) + 1); + return 0 === cljs.core.rem(k, a) ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, h) : b.call(null, g, h) : g; + }, g = function(a, b) { + switch(arguments.length) { + case 0: + return h.call(this); + case 1: + return k.call(this, a); + case 2: + return l.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + g.cljs$core$IFn$_invoke$arity$0 = h; + g.cljs$core$IFn$_invoke$arity$1 = k; + g.cljs$core$IFn$_invoke$arity$2 = l; + return g; + }(); + }(cljs.core.volatile_BANG_(-1)); + }; + }, c = function(b, c) { + return new cljs.core.LazySeq(null, function() { + var f = cljs.core.seq(c); + return f ? cljs.core.cons(cljs.core.first(f), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(b, f))) : null; + }, null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; }(); -cljs.core.take_nth = function take_nth(b, c) { - return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, c); - return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_nth.call(null, b, cljs.core.drop.call(null, b, d))) : null - }, null, null) -}; cljs.core.split_with = function(a, b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take_while.call(null, a, b), cljs.core.drop_while.call(null, a, b)], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(a, b), cljs.core.drop_while.cljs$core$IFn$_invoke$arity$2(a, b)], null); }; -cljs.core.partition_by = function partition_by(b, c) { - return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq.call(null, c); - if(d) { - var e = cljs.core.first.call(null, d), f = b.call(null, e), e = cljs.core.cons.call(null, e, cljs.core.take_while.call(null, function(c, d) { - return function(c) { - return cljs.core._EQ_.call(null, d, b.call(null, c)) - } - }(e, f), cljs.core.next.call(null, d))); - return cljs.core.cons.call(null, e, partition_by.call(null, b, cljs.core.seq.call(null, cljs.core.drop.call(null, cljs.core.count.call(null, e), d)))) +cljs.core.partition_by = function() { + var a = null, b = function(a) { + return function(b) { + var c = cljs.core.array_list(), g = cljs.core.volatile_BANG_(new cljs.core.Keyword("cljs.core", "none", "cljs.core/none", 926646439)); + return function(c, f) { + return function() { + var g = null, m = function() { + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); + }, n = function(a) { + if (!cljs.core.truth_(c.isEmpty())) { + var d = cljs.core.vec(c.toArray()); + c.clear(); + a = cljs.core.unreduced(b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(a, d) : b.call(null, a, d)); + } + return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); + }, p = function(g, l) { + var m = cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(f) : cljs.core.deref.call(null, f), n = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(l) : a.call(null, l); + cljs.core.vreset_BANG_(f, n); + if (cljs.core.keyword_identical_QMARK_(m, new cljs.core.Keyword("cljs.core", "none", "cljs.core/none", 926646439)) || cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(n, m)) { + return c.add(l), g; + } + m = cljs.core.vec(c.toArray()); + c.clear(); + m = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, m) : b.call(null, g, m); + cljs.core.reduced_QMARK_(m) || c.add(l); + return m; + }, g = function(a, b) { + switch(arguments.length) { + case 0: + return m.call(this); + case 1: + return n.call(this, a); + case 2: + return p.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + g.cljs$core$IFn$_invoke$arity$0 = m; + g.cljs$core$IFn$_invoke$arity$1 = n; + g.cljs$core$IFn$_invoke$arity$2 = p; + return g; + }(); + }(c, g); + }; + }, c = function(b, c) { + return new cljs.core.LazySeq(null, function() { + var f = cljs.core.seq(c); + if (f) { + var g = cljs.core.first(f), h = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(g) : b.call(null, g), g = cljs.core.cons(g, cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(function(a, c, e, f) { + return function(a) { + return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a)); + }; + }(g, h, f, f), cljs.core.next(f))); + return cljs.core.cons(g, a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.seq(cljs.core.drop.cljs$core$IFn$_invoke$arity$2(cljs.core.count(g), f)))); + } + return null; + }, null, null); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); } - return null - }, null, null) -}; + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); cljs.core.frequencies = function(a) { - return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(a, c) { - return cljs.core.assoc_BANG_.call(null, a, c, cljs.core.get.call(null, a, c, 0) + 1) - }, cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), a)) + return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a, c) { + return cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(a, c, cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, c, 0) + 1); + }, cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY), a)); }; cljs.core.reductions = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq.call(null, c); - return f ? a.call(null, b, cljs.core.first.call(null, f), cljs.core.rest.call(null, f)) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b.call(null)) - }, null, null) + var f = cljs.core.seq(c); + return f ? a.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(f), cljs.core.rest(f)) : cljs.core._conj(cljs.core.List.EMPTY, b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null)); + }, null, null); }, c = function(b, c, f) { - return cljs.core.cons.call(null, c, new cljs.core.LazySeq(null, function() { - var g = cljs.core.seq.call(null, f); - return g ? a.call(null, b, b.call(null, c, cljs.core.first.call(null, g)), cljs.core.rest.call(null, g)) : null - }, null, null)) + return cljs.core.cons(c, new cljs.core.LazySeq(null, function() { + var g = cljs.core.seq(f); + return g ? a.cljs$core$IFn$_invoke$arity$3(b, function() { + var a = cljs.core.first(g); + return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, a) : b.call(null, c, a); + }(), cljs.core.rest(g)) : null; + }, null, null)); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.juxt = function() { var a = null, b = function(a) { return function() { var b = null, c = function() { + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null)], null); + }, d = function(b) { + var c = cljs.core.PersistentVector, d = cljs.core.PersistentVector.EMPTY_NODE; + b = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return new c(null, 1, 5, d, [b], null); + }, e = function(b, c) { + var d = cljs.core.PersistentVector, e = cljs.core.PersistentVector.EMPTY_NODE, g; + g = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + return new d(null, 1, 5, e, [g], null); + }, m = function(b, c, d) { + var e = cljs.core.PersistentVector, g = cljs.core.PersistentVector.EMPTY_NODE; + b = a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); + return new e(null, 1, 5, g, [b], null); + }, n = function() { var b = function(b, c, d, e) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, b, c, d, e)], null) + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e)], null); }, c = function(a, c, d, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, d, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.call(this, a, c, d, f); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -11881,38 +16993,63 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, a) + return b(c, d, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), b = function(b, d, e, g) { + return c; + }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null)], null); + return c.call(this); case 1: - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b)], null); + return d.call(this, a); case 2: - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b, d)], null); + return e.call(this, a, b); case 3: - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b, d, e)], null); + return m.call(this, a, b, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(b, d, e, cljs.core.array_seq(arguments, 3)) + var t = null; + if (3 < arguments.length) { + for (var t = 0, u = Array(arguments.length - 3);t < u.length;) { + u[t] = arguments[t + 3], ++t; + } + t = new cljs.core.IndexedSeq(u, 0); + } + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, f, t); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = c.cljs$lang$applyTo; - return b - }() + b.cljs$lang$applyTo = n.cljs$lang$applyTo; + b.cljs$core$IFn$_invoke$arity$0 = c; + b.cljs$core$IFn$_invoke$arity$1 = d; + b.cljs$core$IFn$_invoke$arity$2 = e; + b.cljs$core$IFn$_invoke$arity$3 = m; + b.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; + return b; + }(); }, c = function(a, b) { return function() { var c = null, d = function() { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null)], null); + }, e = function(c) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c)], null); + }, m = function(c, d) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d), b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d)], null); + }, n = function(c, d, e) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e), b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, d, e) : b.call(null, c, d, e)], null); + }, p = function() { var c = function(c, d, e, h) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, c, d, e, h), cljs.core.apply.call(null, b, c, d, e, h)], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, c, d, e, h), cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, c, d, e, h)], null); }, d = function(a, b, d, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -11922,38 +17059,63 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }(), c = function(c, e, h, p) { + return d; + }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null), b.call(null)], null); + return d.call(this); case 1: - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c), b.call(null, c)], null); + return e.call(this, a); case 2: - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c, e), b.call(null, c, e)], null); + return m.call(this, a, b); case 3: - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c, e, h), b.call(null, c, e, h)], null); + return n.call(this, a, b, c); default: - return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)) + var g = null; + if (3 < arguments.length) { + for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { + h[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(h, 0); + } + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = d.cljs$lang$applyTo; - return c - }() + c.cljs$lang$applyTo = p.cljs$lang$applyTo; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = e; + c.cljs$core$IFn$_invoke$arity$2 = m; + c.cljs$core$IFn$_invoke$arity$3 = n; + c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function() { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null), c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null)], null); + }, m = function(d) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d), b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d)], null); + }, n = function(d, e) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(d, e) : a.call(null, d, e), b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, e) : b.call(null, d, e), c.cljs$core$IFn$_invoke$arity$2 ? c.cljs$core$IFn$_invoke$arity$2(d, e) : c.call(null, d, e)], null); + }, p = function(d, e, k) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(d, e, k) : a.call(null, d, e, k), b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(d, e, k) : b.call(null, d, e, k), c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(d, e, k) : c.call(null, d, e, k)], null); + }, q = function() { var d = function(d, e, k, l) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, d, e, k, l), cljs.core.apply.call(null, b, d, e, k, l), cljs.core.apply.call(null, c, d, e, k, l)], null) + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, d, e, k, l), cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, d, e, k, l), cljs.core.apply.cljs$core$IFn$_invoke$arity$5(c, d, e, k, l)], null); }, e = function(a, b, c, e) { var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -11963,94 +17125,139 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e - }(), d = function(d, k, p, q) { + return e; + }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null), b.call(null), c.call(null)], null); + return e.call(this); case 1: - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d), b.call(null, d), c.call(null, d)], null); + return m.call(this, a); case 2: - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d, k), b.call(null, d, k), c.call(null, d, k)], null); + return n.call(this, a, b); case 3: - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d, k, p), b.call(null, d, k, p), c.call(null, d, k, p)], null); + return p.call(this, a, b, c); default: - return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)) + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return q.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = e.cljs$lang$applyTo; - return d - }() + d.cljs$lang$applyTo = q.cljs$lang$applyTo; + d.cljs$core$IFn$_invoke$arity$0 = e; + d.cljs$core$IFn$_invoke$arity$1 = m; + d.cljs$core$IFn$_invoke$arity$2 = n; + d.cljs$core$IFn$_invoke$arity$3 = p; + d.cljs$core$IFn$_invoke$arity$variadic = q.cljs$core$IFn$_invoke$arity$variadic; + return d; + }(); }, e = function() { var a = function(a, b, c, d) { - var e = cljs.core.list_STAR_.call(null, a, b, c, d); - return function() { - var a = null, b = function() { - return cljs.core.reduce.call(null, function(a, b) { - return cljs.core.conj.call(null, a, b.call(null)) - }, cljs.core.PersistentVector.EMPTY, e) - }, c = function(a) { - return cljs.core.reduce.call(null, function(b, c) { - return cljs.core.conj.call(null, b, c.call(null, a)) - }, cljs.core.PersistentVector.EMPTY, e) - }, d = function(a, b) { - return cljs.core.reduce.call(null, function(c, d) { - return cljs.core.conj.call(null, c, d.call(null, a, b)) - }, cljs.core.PersistentVector.EMPTY, e) - }, f = function(a, b, c) { - return cljs.core.reduce.call(null, function(d, e) { - return cljs.core.conj.call(null, d, e.call(null, a, b, c)) - }, cljs.core.PersistentVector.EMPTY, e) - }, g = function() { - var a = function(a, b, c, d) { - return cljs.core.reduce.call(null, function(e, f) { - return cljs.core.conj.call(null, e, cljs.core.apply.call(null, f, a, b, c, d)) - }, cljs.core.PersistentVector.EMPTY, e) - }, b = function(b, c, d, e) { - var f = null; - 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, f) + return function(a) { + return function() { + var b = null, c = function() { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { + return function(a, b) { + return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null)); + }; + }(a), cljs.core.PersistentVector.EMPTY, a); + }, d = function(b) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { + return function(a, c) { + return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(b) : c.call(null, b)); + }; + }(a), cljs.core.PersistentVector.EMPTY, a); + }, e = function(b, c) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { + return function(a, d) { + return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d.cljs$core$IFn$_invoke$arity$2 ? d.cljs$core$IFn$_invoke$arity$2(b, c) : d.call(null, b, c)); + }; + }(a), cljs.core.PersistentVector.EMPTY, a); + }, f = function(b, c, d) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { + return function(a, e) { + return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, e.cljs$core$IFn$_invoke$arity$3 ? e.cljs$core$IFn$_invoke$arity$3(b, c, d) : e.call(null, b, c, d)); + }; + }(a), cljs.core.PersistentVector.EMPTY, a); + }, g = function() { + var b = function(b, c, d, e) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { + return function(a, f) { + return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, cljs.core.apply.cljs$core$IFn$_invoke$arity$5(f, b, c, d, e)); + }; + }(a), cljs.core.PersistentVector.EMPTY, a); + }, c = function(a, c, d, e) { + var f = null; + if (3 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { + g[f] = arguments[f + 3], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return b.call(this, a, c, d, f); + }; + c.cljs$lang$maxFixedArity = 3; + c.cljs$lang$applyTo = function(a) { + var c = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return b(c, d, e, a); + }; + c.cljs$core$IFn$_invoke$arity$variadic = b; + return c; + }(), b = function(a, b, h, k) { + switch(arguments.length) { + case 0: + return c.call(this); + case 1: + return d.call(this, a); + case 2: + return e.call(this, a, b); + case 3: + return f.call(this, a, b, h); + default: + var l = null; + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return g.cljs$core$IFn$_invoke$arity$variadic(a, b, h, l); + } + throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, d, e, b) - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }(), a = function(a, e, h, k) { - switch(arguments.length) { - case 0: - return b.call(this); - case 1: - return c.call(this, a); - case 2: - return d.call(this, a, e); - case 3: - return f.call(this, a, e, h); - default: - return g.cljs$core$IFn$_invoke$arity$variadic(a, e, h, cljs.core.array_seq(arguments, 3)) - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 3; - a.cljs$lang$applyTo = g.cljs$lang$applyTo; - return a - }() + b.cljs$lang$applyTo = g.cljs$lang$applyTo; + b.cljs$core$IFn$_invoke$arity$0 = c; + b.cljs$core$IFn$_invoke$arity$1 = d; + b.cljs$core$IFn$_invoke$arity$2 = e; + b.cljs$core$IFn$_invoke$arity$3 = f; + b.cljs$core$IFn$_invoke$arity$variadic = g.cljs$core$IFn$_invoke$arity$variadic; + return b; + }(); + }(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); }, b = function(b, c, d, e) { var g = null; - 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + if (3 < arguments.length) { + for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { + p[g] = arguments[g + 3], ++g; + } + g = new cljs.core.IndexedSeq(p, 0); + } + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -12060,10 +17267,10 @@ cljs.core.juxt = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -12073,7 +17280,14 @@ cljs.core.juxt = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + var l = null; + if (3 < arguments.length) { + for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { + m[l] = arguments[l + 3], ++l; + } + l = new cljs.core.IndexedSeq(m, 0); + } + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); } throw Error("Invalid arity: " + arguments.length); }; @@ -12083,25 +17297,25 @@ cljs.core.juxt = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.dorun = function() { var a = null, b = function(a) { - for(;;) { - if(cljs.core.seq.call(null, a)) { - a = cljs.core.next.call(null, a) - }else { - return null + for (;;) { + if (cljs.core.seq(a)) { + a = cljs.core.next(a); + } else { + return null; } } }, c = function(a, b) { - for(;;) { - if(cljs.core.seq.call(null, b) && 0 < a) { - var c = a - 1, g = cljs.core.next.call(null, b); + for (;;) { + if (cljs.core.seq(b) && 0 < a) { + var c = a - 1, g = cljs.core.next(b); a = c; - b = g - }else { - return null + b = g; + } else { + return null; } } }, a = function(a, e) { @@ -12109,650 +17323,594 @@ cljs.core.dorun = function() { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.doall = function() { var a = null, b = function(a) { - cljs.core.dorun.call(null, a); - return a + cljs.core.dorun.cljs$core$IFn$_invoke$arity$1(a); + return a; }, c = function(a, b) { - cljs.core.dorun.call(null, a, b); - return b + cljs.core.dorun.cljs$core$IFn$_invoke$arity$2(a, b); + return b; }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.regexp_QMARK_ = function(a) { - return a instanceof RegExp + return a instanceof RegExp; }; cljs.core.re_matches = function(a, b) { - var c = a.exec(b); - return cljs.core._EQ_.call(null, cljs.core.first.call(null, c), b) ? 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) : null + if ("string" === typeof b) { + var c = a.exec(b); + return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.first(c), b) ? 1 === cljs.core.count(c) ? cljs.core.first(c) : cljs.core.vec(c) : null; + } + throw new TypeError("re-matches must match against a string."); }; cljs.core.re_find = function(a, b) { - var c = a.exec(b); - return null == c ? null : 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) + if ("string" === typeof b) { + var c = a.exec(b); + return null == c ? null : 1 === cljs.core.count(c) ? cljs.core.first(c) : cljs.core.vec(c); + } + throw new TypeError("re-find must match against a string."); }; cljs.core.re_seq = function re_seq(b, c) { - var d = cljs.core.re_find.call(null, b, c), e = c.search(b), f = cljs.core.coll_QMARK_.call(null, d) ? cljs.core.first.call(null, d) : d, g = cljs.core.subs.call(null, c, e + cljs.core.count.call(null, f)); - return cljs.core.truth_(d) ? new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, d, cljs.core.seq.call(null, g) ? re_seq.call(null, b, g) : null) - }, null, null) : null + var d = cljs.core.re_find(b, c), e = c.search(b), f = cljs.core.coll_QMARK_(d) ? cljs.core.first(d) : d, g = cljs.core.subs.cljs$core$IFn$_invoke$arity$2(c, e + cljs.core.count(f)); + return cljs.core.truth_(d) ? new cljs.core.LazySeq(null, function(c, d, e, f) { + return function() { + return cljs.core.cons(c, cljs.core.seq(f) ? re_seq(b, f) : null); + }; + }(d, e, f, g), null, null) : null; }; cljs.core.re_pattern = function(a) { - var b = cljs.core.re_find.call(null, /^(?:\(\?([idmsux]*)\))?(.*)/, a); - cljs.core.nth.call(null, b, 0, null); - a = cljs.core.nth.call(null, b, 1, null); - b = cljs.core.nth.call(null, b, 2, null); - return RegExp(b, a) + if (a instanceof RegExp) { + return a; + } + var b = cljs.core.re_find(/^(?:\(\?([idmsux]*)\))?(.*)/, a); + cljs.core.nth.cljs$core$IFn$_invoke$arity$3(b, 0, null); + a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(b, 1, null); + b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(b, 2, null); + return new RegExp(b, a); }; cljs.core.pr_sequential_writer = function(a, b, c, d, e, f, g) { var h = cljs.core._STAR_print_level_STAR_; + cljs.core._STAR_print_level_STAR_ = null == cljs.core._STAR_print_level_STAR_ ? null : cljs.core._STAR_print_level_STAR_ - 1; try { - cljs.core._STAR_print_level_STAR_ = null == cljs.core._STAR_print_level_STAR_ ? null : cljs.core._STAR_print_level_STAR_ - 1; - if(null != cljs.core._STAR_print_level_STAR_ && 0 > cljs.core._STAR_print_level_STAR_) { - return cljs.core._write.call(null, a, "#") - } - cljs.core._write.call(null, a, c); - cljs.core.seq.call(null, g) && b.call(null, cljs.core.first.call(null, g), a, f); - for(var k = cljs.core.next.call(null, g), l = (new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f);k && (null == l || 0 !== l);) { - cljs.core._write.call(null, a, d); - b.call(null, cljs.core.first.call(null, k), a, f); - var m = cljs.core.next.call(null, k); - c = l - 1; - k = m; - l = c - } - cljs.core.truth_((new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f)) && (cljs.core._write.call(null, a, d), b.call(null, "...", a, f)); - return cljs.core._write.call(null, a, e) - }finally { - cljs.core._STAR_print_level_STAR_ = h + if (null != cljs.core._STAR_print_level_STAR_ && 0 > cljs.core._STAR_print_level_STAR_) { + return cljs.core._write(a, "#"); + } + cljs.core._write(a, c); + if (0 === (new cljs.core.Keyword(null, "print-length", "print-length", 1931866356)).cljs$core$IFn$_invoke$arity$1(f)) { + cljs.core.seq(g) && cljs.core._write(a, function() { + var a = (new cljs.core.Keyword(null, "more-marker", "more-marker", -14717935)).cljs$core$IFn$_invoke$arity$1(f); + return cljs.core.truth_(a) ? a : "..."; + }()); + } else { + if (cljs.core.seq(g)) { + var k = cljs.core.first(g); + b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(k, a, f) : b.call(null, k, a, f); + } + for (var l = cljs.core.next(g), m = (new cljs.core.Keyword(null, "print-length", "print-length", 1931866356)).cljs$core$IFn$_invoke$arity$1(f) - 1;;) { + if (!l || null != m && 0 === m) { + cljs.core.seq(l) && 0 === m && (cljs.core._write(a, d), cljs.core._write(a, function() { + var a = (new cljs.core.Keyword(null, "more-marker", "more-marker", -14717935)).cljs$core$IFn$_invoke$arity$1(f); + return cljs.core.truth_(a) ? a : "..."; + }())); + break; + } else { + cljs.core._write(a, d); + var n = cljs.core.first(l); + c = a; + g = f; + b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(n, c, g) : b.call(null, n, c, g); + var p = cljs.core.next(l); + c = m - 1; + l = p; + m = c; + } + } + } + return cljs.core._write(a, e); + } finally { + cljs.core._STAR_print_level_STAR_ = h; } }; cljs.core.write_all = function() { var a = function(a, b) { - for(var e = cljs.core.seq.call(null, b), f = null, g = 0, h = 0;;) { - if(h < g) { - var k = cljs.core._nth.call(null, f, h); - cljs.core._write.call(null, a, k); - h += 1 - }else { - if(e = cljs.core.seq.call(null, e)) { - f = e, cljs.core.chunked_seq_QMARK_.call(null, f) ? (e = cljs.core.chunk_first.call(null, f), g = cljs.core.chunk_rest.call(null, f), f = e, k = cljs.core.count.call(null, e), e = g, g = k) : (k = cljs.core.first.call(null, f), cljs.core._write.call(null, a, k), e = cljs.core.next.call(null, f), f = null, g = 0), h = 0 - }else { - return null + for (var e = cljs.core.seq(b), f = null, g = 0, h = 0;;) { + if (h < g) { + var k = f.cljs$core$IIndexed$_nth$arity$2(null, h); + cljs.core._write(a, k); + h += 1; + } else { + if (e = cljs.core.seq(e)) { + f = e, cljs.core.chunked_seq_QMARK_(f) ? (e = cljs.core.chunk_first(f), g = cljs.core.chunk_rest(f), f = e, k = cljs.core.count(e), e = g, g = k) : (k = cljs.core.first(f), cljs.core._write(a, k), e = cljs.core.next(f), f = null, g = 0), h = 0; + } else { + return null; } } } }, b = function(b, d) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { + f[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.string_print = function(a) { - cljs.core._STAR_print_fn_STAR_.call(null, a); - return null + cljs.core._STAR_print_fn_STAR_.cljs$core$IFn$_invoke$arity$1 ? cljs.core._STAR_print_fn_STAR_.cljs$core$IFn$_invoke$arity$1(a) : cljs.core._STAR_print_fn_STAR_.call(null, a); + return null; }; cljs.core.flush = function() { - return null + return null; }; cljs.core.char_escapes = function() { - return{'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"} + return{'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"}; }(); cljs.core.quote_string = function(a) { return[cljs.core.str('"'), cljs.core.str(a.replace(RegExp('[\\\\"\b\f\n\r\t]', "g"), function(a) { - return cljs.core.char_escapes[a] - })), cljs.core.str('"')].join("") + return cljs.core.char_escapes[a]; + })), cljs.core.str('"')].join(""); }; -cljs.core.pr_writer = function pr_writer(b, c, d) { - if(null == b) { - return cljs.core._write.call(null, c, "nil") +cljs.core.pr_writer_impl = function(a, b, c) { + if (null == a) { + return cljs.core._write(b, "nil"); } - if(void 0 === b) { - return cljs.core._write.call(null, c, "#\x3cundefined\x3e") + if (void 0 === a) { + return cljs.core._write(b, "#\x3cundefined\x3e"); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - cljs.core.truth_(function() { - var c = cljs.core.get.call(null, d, new cljs.core.Keyword(null, "meta", "meta", 1017252215)); - return cljs.core.truth_(c) ? (c = b ? b.cljs$lang$protocol_mask$partition0$ & 131072 || b.cljs$core$IMeta$ ? !0 : b.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b)) ? cljs.core.meta.call(null, b) : c : c - }()) && (cljs.core._write.call(null, c, "^"), pr_writer.call(null, cljs.core.meta.call(null, b), c, d), cljs.core._write.call(null, c, " ")); - if(null == b) { - return cljs.core._write.call(null, c, "nil") - } - if(b.cljs$lang$type) { - return b.cljs$lang$ctorPrWriter(b, c, d) - } - if(b && (b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$)) { - return cljs.core._pr_writer.call(null, b, c, d) - } - if(cljs.core.type.call(null, b) === Boolean || "number" === typeof b) { - return cljs.core._write.call(null, c, "" + cljs.core.str(b)) - } - if(b instanceof Array) { - return cljs.core.pr_sequential_writer.call(null, c, pr_writer, "#\x3cArray [", ", ", "]\x3e", d, b) - } - if(goog.isString(b)) { - return cljs.core.truth_((new cljs.core.Keyword(null, "readably", "readably", 4441712502)).cljs$core$IFn$_invoke$arity$1(d)) ? cljs.core._write.call(null, c, cljs.core.quote_string.call(null, b)) : cljs.core._write.call(null, c, b) - } - if(cljs.core.fn_QMARK_.call(null, b)) { - return cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") - } - if(b instanceof Date) { - var e = function(b, c) { - for(var d = "" + cljs.core.str(b);;) { - if(cljs.core.count.call(null, d) < c) { - d = [cljs.core.str("0"), cljs.core.str(d)].join("") - }else { - return d - } - } - }; - return cljs.core.write_all.call(null, c, '#inst "', "" + cljs.core.str(b.getUTCFullYear()), "-", e.call(null, b.getUTCMonth() + 1, 2), "-", e.call(null, b.getUTCDate(), 2), "T", e.call(null, b.getUTCHours(), 2), ":", e.call(null, b.getUTCMinutes(), 2), ":", e.call(null, b.getUTCSeconds(), 2), ".", e.call(null, b.getUTCMilliseconds(), 3), "-", '00:00"') + if (cljs.core.truth_(function() { + var b = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "meta", "meta", 1499536964)); + return cljs.core.truth_(b) ? (b = a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a)) ? cljs.core.meta(a) : b : b; + }())) { + cljs.core._write(b, "^"); + var d = cljs.core.meta(a); + cljs.core.pr_writer.cljs$core$IFn$_invoke$arity$3 ? cljs.core.pr_writer.cljs$core$IFn$_invoke$arity$3(d, b, c) : cljs.core.pr_writer.call(null, d, b, c); + cljs.core._write(b, " "); + } + if (null == a) { + return cljs.core._write(b, "nil"); + } + if (a.cljs$lang$type) { + return a.cljs$lang$ctorPrWriter(a, b, c); + } + if (a && (a.cljs$lang$protocol_mask$partition0$ & 2147483648 || a.cljs$core$IPrintWithWriter$)) { + return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(null, b, c); + } + if (cljs.core.type(a) === Boolean || "number" === typeof a) { + return cljs.core._write(b, "" + cljs.core.str(a)); + } + if (cljs.core.object_QMARK_(a)) { + cljs.core._write(b, "#js "); + var d = cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(b) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.cljs$core$IFn$_invoke$arity$1(b), a[b]], null); + }, cljs.core.js_keys(a)), e = cljs.core.pr_writer; + return cljs.core.print_map.cljs$core$IFn$_invoke$arity$4 ? cljs.core.print_map.cljs$core$IFn$_invoke$arity$4(d, e, b, c) : cljs.core.print_map.call(null, d, e, b, c); + } + return a instanceof Array ? cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#js [", " ", "]", c, a) : cljs.core.truth_(goog.isString(a)) ? cljs.core.truth_((new cljs.core.Keyword(null, "readably", "readably", 1129599760)).cljs$core$IFn$_invoke$arity$1(c)) ? cljs.core._write(b, cljs.core.quote_string(a)) : cljs.core._write(b, a) : cljs.core.fn_QMARK_(a) ? cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(["#\x3c", "" + cljs.core.str(a), "\x3e"], 0)) : a instanceof + Date ? (d = function(a, b) { + for (var c = "" + cljs.core.str(a);;) { + if (cljs.core.count(c) < b) { + c = [cljs.core.str("0"), cljs.core.str(c)].join(""); + } else { + return c; + } } - return cljs.core.regexp_QMARK_.call(null, b) ? cljs.core.write_all.call(null, c, '#"', b.source, '"') : (b ? b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IPrintWithWriter, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IPrintWithWriter, b)) ? cljs.core._pr_writer.call(null, b, c, d) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? - cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") : null - } - return null + }, cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(['#inst "', "" + cljs.core.str(a.getUTCFullYear()), "-", d(a.getUTCMonth() + 1, 2), "-", d(a.getUTCDate(), 2), "T", d(a.getUTCHours(), 2), ":", d(a.getUTCMinutes(), 2), ":", d(a.getUTCSeconds(), 2), ".", d(a.getUTCMilliseconds(), 3), "-", '00:00"'], 0))) : cljs.core.regexp_QMARK_(a) ? cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(['#"', a.source, '"'], 0)) : (a ? a.cljs$lang$protocol_mask$partition0$ & + 2147483648 || a.cljs$core$IPrintWithWriter$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IPrintWithWriter, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IPrintWithWriter, a)) ? cljs.core._pr_writer(a, b, c) : cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(["#\x3c", "" + cljs.core.str(a), "\x3e"], 0)); +}; +cljs.core.pr_writer = function(a, b, c) { + var d = (new cljs.core.Keyword(null, "alt-impl", "alt-impl", 670969595)).cljs$core$IFn$_invoke$arity$1(c); + return cljs.core.truth_(d) ? (c = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(c, new cljs.core.Keyword(null, "fallback-impl", "fallback-impl", -1501286995), cljs.core.pr_writer_impl), d.cljs$core$IFn$_invoke$arity$3 ? d.cljs$core$IFn$_invoke$arity$3(a, b, c) : d.call(null, a, b, c)) : cljs.core.pr_writer_impl(a, b, c); }; cljs.core.pr_seq_writer = function(a, b, c) { - cljs.core.pr_writer.call(null, cljs.core.first.call(null, a), b, c); - a = cljs.core.seq.call(null, cljs.core.next.call(null, a)); - for(var d = null, e = 0, f = 0;;) { - if(f < e) { - var g = cljs.core._nth.call(null, d, f); - cljs.core._write.call(null, b, " "); - cljs.core.pr_writer.call(null, g, b, c); - f += 1 - }else { - if(a = cljs.core.seq.call(null, a)) { - d = a, cljs.core.chunked_seq_QMARK_.call(null, d) ? (a = cljs.core.chunk_first.call(null, d), e = cljs.core.chunk_rest.call(null, d), d = a, g = cljs.core.count.call(null, a), a = e, e = g) : (g = cljs.core.first.call(null, d), cljs.core._write.call(null, b, " "), cljs.core.pr_writer.call(null, g, b, c), a = cljs.core.next.call(null, d), d = null, e = 0), f = 0 - }else { - return null + cljs.core.pr_writer(cljs.core.first(a), b, c); + a = cljs.core.seq(cljs.core.next(a)); + for (var d = null, e = 0, f = 0;;) { + if (f < e) { + var g = d.cljs$core$IIndexed$_nth$arity$2(null, f); + cljs.core._write(b, " "); + cljs.core.pr_writer(g, b, c); + f += 1; + } else { + if (a = cljs.core.seq(a)) { + d = a, cljs.core.chunked_seq_QMARK_(d) ? (a = cljs.core.chunk_first(d), e = cljs.core.chunk_rest(d), d = a, g = cljs.core.count(a), a = e, e = g) : (g = cljs.core.first(d), cljs.core._write(b, " "), cljs.core.pr_writer(g, b, c), a = cljs.core.next(d), d = null, e = 0), f = 0; + } else { + return null; } } } }; cljs.core.pr_sb_with_opts = function(a, b) { var c = new goog.string.StringBuffer, d = new cljs.core.StringBufferWriter(c); - cljs.core.pr_seq_writer.call(null, a, d, b); - cljs.core._flush.call(null, d); - return c + cljs.core.pr_seq_writer(a, d, b); + d.cljs$core$IWriter$_flush$arity$1(null); + return c; }; cljs.core.pr_str_with_opts = function(a, b) { - return cljs.core.empty_QMARK_.call(null, a) ? "" : "" + cljs.core.str(cljs.core.pr_sb_with_opts.call(null, a, b)) + return cljs.core.empty_QMARK_(a) ? "" : "" + cljs.core.str(cljs.core.pr_sb_with_opts(a, b)); }; cljs.core.prn_str_with_opts = function(a, b) { - if(cljs.core.empty_QMARK_.call(null, a)) { - return"\n" + if (cljs.core.empty_QMARK_(a)) { + return "\n"; } - var c = cljs.core.pr_sb_with_opts.call(null, a, b); + var c = cljs.core.pr_sb_with_opts(a, b); c.append("\n"); - return"" + cljs.core.str(c) + return "" + cljs.core.str(c); }; cljs.core.pr_with_opts = function(a, b) { - return cljs.core.string_print.call(null, cljs.core.pr_str_with_opts.call(null, a, b)) + return cljs.core.string_print(cljs.core.pr_str_with_opts(a, b)); }; cljs.core.newline = function(a) { - cljs.core.string_print.call(null, "\n"); - return cljs.core.truth_(cljs.core.get.call(null, a, new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857))) ? cljs.core.flush.call(null) : null + cljs.core.string_print("\n"); + return cljs.core.truth_(cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", -151457939))) ? cljs.core.flush() : null; }; cljs.core.pr_str = function() { var a = function(a) { - return cljs.core.pr_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)) + return cljs.core.pr_str_with_opts(a, cljs.core.pr_opts()); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.prn_str = function() { var a = function(a) { - return cljs.core.prn_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)) + return cljs.core.prn_str_with_opts(a, cljs.core.pr_opts()); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.pr = function() { var a = function(a) { - return cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)) + return cljs.core.pr_with_opts(a, cljs.core.pr_opts()); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.print = function() { var a = function(a) { - return cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) + return cljs.core.pr_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.print_str = function() { var a = function(a) { - return cljs.core.pr_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) + return cljs.core.pr_str_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.println = function() { var a = function(a) { - cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)); - return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null + cljs.core.pr_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); + return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline(cljs.core.pr_opts()) : null; }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.println_str = function() { var a = function(a) { - return cljs.core.prn_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) + return cljs.core.prn_str_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.prn = function() { var a = function(a) { - cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)); - return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null + cljs.core.pr_with_opts(a, cljs.core.pr_opts()); + return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline(cljs.core.pr_opts()) : null; }, b = function(b) { var d = null; - 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + if (0 < arguments.length) { + for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { + e[d] = arguments[d + 0], ++d; + } + d = new cljs.core.IndexedSeq(e, 0); + } + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.print_map = function(a, b, c, d) { - return cljs.core.pr_sequential_writer.call(null, c, function(a, c, d) { - b.call(null, cljs.core.key.call(null, a), c, d); - cljs.core._write.call(null, c, " "); - return b.call(null, cljs.core.val.call(null, a), c, d) - }, "{", ", ", "}", d, cljs.core.seq.call(null, a)) -}; -cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer(c, function(a, c, d) { + var h = cljs.core.key(a); + b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(h, c, d) : b.call(null, h, c, d); + cljs.core._write(c, " "); + a = cljs.core.val(a); + return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(a, c, d) : b.call(null, a, c, d); + }, "{", ", ", "}", d, cljs.core.seq(a)); +}; +cljs.core.Volatile.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Volatile.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + cljs.core._write(b, "#\x3cVolatile: "); + cljs.core.pr_writer(this.state, b, c); + return cljs.core._write(b, "\x3e"); +}; +cljs.core.Var.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Var.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + cljs.core._write(b, "#'"); + return cljs.core.pr_writer(this.sym, b, c); }; cljs.core.IndexedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.IndexedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) -}; -cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) +cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#queue [", " ", "]", c, cljs.core.seq.call(null, this)) +cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); }; -cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +cljs.core.ES6IteratorSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ES6IteratorSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentTreeSet.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this) -}; -cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) -}; -cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#{", " ", "}", c, this); }; cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +}; +cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.print_map(this, cljs.core.pr_writer, b, c); +}; +cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +}; +cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentHashMap.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentHashMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) + return cljs.core.print_map(this, cljs.core.pr_writer, b, c); +}; +cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +}; +cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.print_map(this, cljs.core.pr_writer, b, c); }; cljs.core.PersistentHashSet.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentHashSet.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this) + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#{", " ", "}", c, this); +}; +cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +}; +cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + cljs.core._write(b, "#\x3cAtom: "); + cljs.core.pr_writer(this.state, b, c); + return cljs.core._write(b, "\x3e"); +}; +cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +}; +cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); }; cljs.core.PersistentVector.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentVector.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) -}; -cljs.core.List.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.List.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +cljs.core.PersistentQueueSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentQueueSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.EmptyList.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.EmptyList.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, "()") + return cljs.core._write(b, "()"); }; -cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) +cljs.core.LazyTransformer.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.LazyTransformer.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#queue [", " ", "]", c, cljs.core.seq(this)); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.print_map(this, cljs.core.pr_writer, b, c); }; cljs.core.Range.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.Range.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) -}; -cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) -}; -cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) +cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +cljs.core.List.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.List.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentVector.prototype.cljs$core$IComparable$ = !0; cljs.core.PersistentVector.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_indexed.call(null, this, b) + return cljs.core.compare_indexed.cljs$core$IFn$_invoke$arity$2(this, b); }; cljs.core.Subvec.prototype.cljs$core$IComparable$ = !0; cljs.core.Subvec.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_indexed.call(null, this, b) + return cljs.core.compare_indexed.cljs$core$IFn$_invoke$arity$2(this, b); }; cljs.core.Keyword.prototype.cljs$core$IComparable$ = !0; cljs.core.Keyword.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_symbols.call(null, this, b) + return cljs.core.compare_keywords(this, b); }; cljs.core.Symbol.prototype.cljs$core$IComparable$ = !0; cljs.core.Symbol.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_symbols.call(null, this, b) -}; -cljs.core.Atom = function(a, b, c, d) { - this.state = a; - this.meta = b; - this.validator = c; - this.watches = d; - this.cljs$lang$protocol_mask$partition0$ = 2153938944; - this.cljs$lang$protocol_mask$partition1$ = 2 -}; -cljs.core.Atom.cljs$lang$type = !0; -cljs.core.Atom.cljs$lang$ctorStr = "cljs.core/Atom"; -cljs.core.Atom.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Atom") -}; -cljs.core.Atom.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.getUid(this) -}; -cljs.core.Atom.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = function(a, b, c) { - a = cljs.core.seq.call(null, this.watches); - for(var d = null, e = 0, f = 0;;) { - if(f < e) { - var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); - g.call(null, h, this, b, c); - f += 1 - }else { - if(a = cljs.core.seq.call(null, a)) { - cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), h = d, e = cljs.core.count.call(null, d), d = h) : (d = cljs.core.first.call(null, a), h = cljs.core.nth.call(null, d, 0, null), g = cljs.core.nth.call(null, d, 1, null), g.call(null, h, this, b, c), a = cljs.core.next.call(null, a), d = null, e = 0), f = 0 - }else { - return null - } - } - } -}; -cljs.core.Atom.prototype.cljs$core$IWatchable$_add_watch$arity$3 = function(a, b, c) { - return this.watches = cljs.core.assoc.call(null, this.watches, b, c) -}; -cljs.core.Atom.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = function(a, b) { - return this.watches = cljs.core.dissoc.call(null, this.watches, b) -}; -cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - cljs.core._write.call(null, b, "#\x3cAtom: "); - cljs.core.pr_writer.call(null, this.state, b, c); - return cljs.core._write.call(null, b, "\x3e") -}; -cljs.core.Atom.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta -}; -cljs.core.Atom.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.state -}; -cljs.core.Atom.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return this === b -}; -cljs.core.__GT_Atom = function(a, b, c, d) { - return new cljs.core.Atom(a, b, c, d) -}; -cljs.core.atom = function() { - var a = null, b = function(a) { - return new cljs.core.Atom(a, null, null, null) - }, c = function() { - var a = function(a, b) { - var c = cljs.core.seq_QMARK_.call(null, b) ? cljs.core.apply.call(null, cljs.core.hash_map, b) : b, d = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "validator", "validator", 4199087812)), c = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "meta", "meta", 1017252215)); - return new cljs.core.Atom(a, c, d, null) - }, b = function(b, c) { - var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) - }; - b.cljs$lang$maxFixedArity = 1; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, b) - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }(), a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 1; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a -}(); -cljs.core.reset_BANG_ = function(a, b) { - var c = a.validator; - if(null != c && !cljs.core.truth_(c.call(null, b))) { - throw Error([cljs.core.str("Assert failed: "), cljs.core.str("Validator rejected reference state"), cljs.core.str("\n"), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "validate", "validate", 1233162959, null), new cljs.core.Symbol(null, "new-value", "new-value", 972165309, null))))].join("")); - } - c = a.state; - a.state = b; - null != a.watches && cljs.core._notify_watches.call(null, a, c, b); - return b -}; -cljs.core.swap_BANG_ = function() { - var a = null, b = function(a, b) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state)) - }, c = function(a, b, c) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c)) - }, d = function(a, b, c, d) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d)) - }, e = function(a, b, c, d, e) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d, e)) - }, f = function() { - var a = function(a, b, c, d, e, f) { - return cljs.core.reset_BANG_.call(null, a, cljs.core.apply.call(null, b, a.state, c, d, e, f)) - }, b = function(b, c, d, e, f, h) { - var r = null; - 5 < arguments.length && (r = cljs.core.array_seq(Array.prototype.slice.call(arguments, 5), 0)); - return a.call(this, b, c, d, e, f, r) - }; - b.cljs$lang$maxFixedArity = 5; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.next(b); - var f = cljs.core.first(b); - b = cljs.core.next(b); - var h = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, d, e, f, h, b) - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }(), a = function(a, h, k, l, m, n) { - switch(arguments.length) { - case 2: - return b.call(this, a, h); - case 3: - return c.call(this, a, h, k); - case 4: - return d.call(this, a, h, k, l); - case 5: - return e.call(this, a, h, k, l, m); - default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)) - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 5; - a.cljs$lang$applyTo = f.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - a.cljs$core$IFn$_invoke$arity$4 = d; - a.cljs$core$IFn$_invoke$arity$5 = e; - a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a -}(); -cljs.core.compare_and_set_BANG_ = function(a, b, c) { - return cljs.core._EQ_.call(null, a.state, b) ? (cljs.core.reset_BANG_.call(null, a, c), !0) : !1 -}; -cljs.core.deref = function(a) { - return cljs.core._deref.call(null, a) -}; -cljs.core.set_validator_BANG_ = function(a, b) { - return a.validator = b -}; -cljs.core.get_validator = function(a) { - return a.validator + return cljs.core.compare_symbols(this, b); }; cljs.core.alter_meta_BANG_ = function() { var a = function(a, b, e) { - return a.meta = cljs.core.apply.call(null, b, a.meta, e) + return a.meta = cljs.core.apply.cljs$core$IFn$_invoke$arity$3(b, a.meta, e); }, b = function(b, d, e) { var f = null; - 2 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, f) + if (2 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { + g[f] = arguments[f + 2], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return a.call(this, b, d, f); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -12760,238 +17918,397 @@ cljs.core.alter_meta_BANG_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, e, b) + return a(d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.reset_meta_BANG_ = function(a, b) { - return a.meta = b + return a.meta = b; }; cljs.core.add_watch = function(a, b, c) { - return cljs.core._add_watch.call(null, a, b, c) + cljs.core._add_watch(a, b, c); + return a; }; cljs.core.remove_watch = function(a, b) { - return cljs.core._remove_watch.call(null, a, b) + cljs.core._remove_watch(a, b); + return a; }; cljs.core.gensym_counter = null; cljs.core.gensym = function() { var a = null, b = function() { - return a.call(null, "G__") + return a.cljs$core$IFn$_invoke$arity$1("G__"); }, c = function(a) { - null == cljs.core.gensym_counter && (cljs.core.gensym_counter = cljs.core.atom.call(null, 0)); - return cljs.core.symbol.call(null, [cljs.core.str(a), cljs.core.str(cljs.core.swap_BANG_.call(null, cljs.core.gensym_counter, cljs.core.inc))].join("")) + if (null == cljs.core.gensym_counter) { + var b = cljs.core, c; + c = cljs.core.atom.cljs$core$IFn$_invoke$arity$1 ? cljs.core.atom.cljs$core$IFn$_invoke$arity$1(0) : cljs.core.atom.call(null, 0); + b.gensym_counter = c; + } + return cljs.core.symbol.cljs$core$IFn$_invoke$arity$1([cljs.core.str(a), cljs.core.str(cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(cljs.core.gensym_counter, cljs.core.inc))].join("")); }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a) + return c.call(this, a); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a + return a; }(); cljs.core.fixture1 = 1; cljs.core.fixture2 = 2; cljs.core.Delay = function(a, b) { - this.state = a; - this.f = b; + this.f = a; + this.value = b; this.cljs$lang$protocol_mask$partition1$ = 1; - this.cljs$lang$protocol_mask$partition0$ = 32768 -}; -cljs.core.Delay.cljs$lang$type = !0; -cljs.core.Delay.cljs$lang$ctorStr = "cljs.core/Delay"; -cljs.core.Delay.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Delay") + this.cljs$lang$protocol_mask$partition0$ = 32768; }; cljs.core.Delay.prototype.cljs$core$IPending$_realized_QMARK_$arity$1 = function(a) { - return(new cljs.core.Keyword(null, "done", "done", 1016993524)).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null, this.state)) + return cljs.core.not(this.f); }; cljs.core.Delay.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - var b = this; - return(new cljs.core.Keyword(null, "value", "value", 1125876963)).cljs$core$IFn$_invoke$arity$1(cljs.core.swap_BANG_.call(null, b.state, function(a) { - a = cljs.core.seq_QMARK_.call(null, a) ? cljs.core.apply.call(null, cljs.core.hash_map, a) : a; - var d = cljs.core.get.call(null, a, new cljs.core.Keyword(null, "done", "done", 1016993524)); - return cljs.core.truth_(d) ? a : new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null, "done", "done", 1016993524), !0, new cljs.core.Keyword(null, "value", "value", 1125876963), b.f.call(null)], null) - })) + cljs.core.truth_(this.f) && (this.value = this.f.cljs$core$IFn$_invoke$arity$0 ? this.f.cljs$core$IFn$_invoke$arity$0() : this.f.call(null), this.f = null); + return this.value; +}; +cljs.core.Delay.cljs$lang$type = !0; +cljs.core.Delay.cljs$lang$ctorStr = "cljs.core/Delay"; +cljs.core.Delay.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Delay"); }; cljs.core.__GT_Delay = function(a, b) { - return new cljs.core.Delay(a, b) + return new cljs.core.Delay(a, b); }; cljs.core.delay_QMARK_ = function(a) { - return a instanceof cljs.core.Delay + return a instanceof cljs.core.Delay; }; cljs.core.force = function(a) { - return cljs.core.delay_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : a + return cljs.core.delay_QMARK_(a) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a) : a; }; cljs.core.realized_QMARK_ = function(a) { - return cljs.core._realized_QMARK_.call(null, a) + return cljs.core._realized_QMARK_(a); +}; +cljs.core.preserving_reduced = function(a) { + return function(b, c) { + var d; + d = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); + return cljs.core.reduced_QMARK_(d) ? cljs.core.reduced(d) : d; + }; +}; +cljs.core.cat = function(a) { + return function(b) { + return function() { + var c = null, d = function() { + return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); + }, e = function(b) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + }, f = function(a, c) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(b, a, c); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return d.call(this); + case 1: + return e.call(this, a); + case 2: + return f.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = d; + c.cljs$core$IFn$_invoke$arity$1 = e; + c.cljs$core$IFn$_invoke$arity$2 = f; + return c; + }(); + }(cljs.core.preserving_reduced(a)); +}; +cljs.core.dedupe = function() { + var a = null, b = function() { + return function(a) { + return function(b) { + return function() { + var c = null, g = function() { + return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); + }, h = function(b) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + }, k = function(c, f) { + var g; + g = cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + cljs.core.vreset_BANG_(b, f); + return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(g, f) ? c : a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, f) : a.call(null, c, f); + }, c = function(a, b) { + switch(arguments.length) { + case 0: + return g.call(this); + case 1: + return h.call(this, a); + case 2: + return k.call(this, a, b); + } + throw Error("Invalid arity: " + arguments.length); + }; + c.cljs$core$IFn$_invoke$arity$0 = g; + c.cljs$core$IFn$_invoke$arity$1 = h; + c.cljs$core$IFn$_invoke$arity$2 = k; + return c; + }(); + }(cljs.core.volatile_BANG_(new cljs.core.Keyword("cljs.core", "none", "cljs.core/none", 926646439))); + }; + }, c = function(b) { + return cljs.core.sequence.cljs$core$IFn$_invoke$arity$2(a.cljs$core$IFn$_invoke$arity$0(), b); + }, a = function(a) { + switch(arguments.length) { + case 0: + return b.call(this); + case 1: + return c.call(this, a); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$0 = b; + a.cljs$core$IFn$_invoke$arity$1 = c; + return a; +}(); +cljs.core.random_sample = function() { + var a = null, b = function(a) { + return cljs.core.filter.cljs$core$IFn$_invoke$arity$1(function(b) { + return(cljs.core.rand.cljs$core$IFn$_invoke$arity$0 ? cljs.core.rand.cljs$core$IFn$_invoke$arity$0() : cljs.core.rand.call(null)) < a; + }); + }, c = function(a, b) { + return cljs.core.filter.cljs$core$IFn$_invoke$arity$2(function(b) { + return(cljs.core.rand.cljs$core$IFn$_invoke$arity$0 ? cljs.core.rand.cljs$core$IFn$_invoke$arity$0() : cljs.core.rand.call(null)) < a; + }, b); + }, a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + return a; +}(); +cljs.core.Eduction = function(a, b) { + this.xform = a; + this.coll = b; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 2173173760; +}; +cljs.core.Eduction.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +}; +cljs.core.Eduction.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.transduce.cljs$core$IFn$_invoke$arity$4(this.xform, b, c, this.coll); +}; +cljs.core.Eduction.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.seq(cljs.core.sequence.cljs$core$IFn$_invoke$arity$2(this.xform, this.coll)); +}; +cljs.core.Eduction.cljs$lang$type = !0; +cljs.core.Eduction.cljs$lang$ctorStr = "cljs.core/Eduction"; +cljs.core.Eduction.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/Eduction"); +}; +cljs.core.__GT_Eduction = function(a, b) { + return new cljs.core.Eduction(a, b); +}; +cljs.core.Eduction.prototype[cljs.core.ITER_SYMBOL] = function() { + return cljs.core.es6_iterator(this); +}; +cljs.core.eduction = function(a, b) { + return new cljs.core.Eduction(a, b); +}; +cljs.core.run_BANG_ = function(a, b) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, d) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + }, null, b); }; cljs.core.IEncodeJS = function() { - return{} + return{}; }(); cljs.core._clj__GT_js = function(a) { - if(a ? a.cljs$core$IEncodeJS$_clj__GT_js$arity$1 : a) { - return a.cljs$core$IEncodeJS$_clj__GT_js$arity$1(a) + if (a ? a.cljs$core$IEncodeJS$_clj__GT_js$arity$1 : a) { + return a.cljs$core$IEncodeJS$_clj__GT_js$arity$1(a); } var b; - b = cljs.core._clj__GT_js[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._clj__GT_js._, !b)) { - throw cljs.core.missing_protocol.call(null, "IEncodeJS.-clj-\x3ejs", a); + b = cljs.core._clj__GT_js; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._clj__GT_js._, !b)) { + throw cljs.core.missing_protocol("IEncodeJS.-clj-\x3ejs", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._key__GT_js = function(a) { - if(a ? a.cljs$core$IEncodeJS$_key__GT_js$arity$1 : a) { - return a.cljs$core$IEncodeJS$_key__GT_js$arity$1(a) + if (a ? a.cljs$core$IEncodeJS$_key__GT_js$arity$1 : a) { + return a.cljs$core$IEncodeJS$_key__GT_js$arity$1(a); } var b; - b = cljs.core._key__GT_js[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._key__GT_js._, !b)) { - throw cljs.core.missing_protocol.call(null, "IEncodeJS.-key-\x3ejs", a); + b = cljs.core._key__GT_js; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._key__GT_js._, !b)) { + throw cljs.core.missing_protocol("IEncodeJS.-key-\x3ejs", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.key__GT_js = function(a) { - return(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeJS$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) ? cljs.core._clj__GT_js.call(null, a) : "string" === typeof a || "number" === typeof a || a instanceof cljs.core.Keyword || a instanceof cljs.core.Symbol ? cljs.core.clj__GT_js.call(null, a) : cljs.core.pr_str.call(null, a) + return(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeJS$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, a)) ? cljs.core._clj__GT_js(a) : "string" === typeof a || "number" === typeof a || a instanceof cljs.core.Keyword || a instanceof cljs.core.Symbol ? cljs.core.clj__GT_js.cljs$core$IFn$_invoke$arity$1 ? cljs.core.clj__GT_js.cljs$core$IFn$_invoke$arity$1(a) : + cljs.core.clj__GT_js.call(null, a) : cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([a], 0)); }; cljs.core.clj__GT_js = function clj__GT_js(b) { - if(null == b) { - return null + if (null == b) { + return null; } - if(b ? cljs.core.truth_(cljs.core.truth_(null) ? null : b.cljs$core$IEncodeJS$) || (b.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) { - return cljs.core._clj__GT_js.call(null, b) + if (b ? cljs.core.truth_(cljs.core.truth_(null) ? null : b.cljs$core$IEncodeJS$) || (b.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, b)) : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, b)) { + return cljs.core._clj__GT_js(b); } - if(b instanceof cljs.core.Keyword) { - return cljs.core.name.call(null, b) + if (b instanceof cljs.core.Keyword) { + return cljs.core.name(b); } - if(b instanceof cljs.core.Symbol) { - return"" + cljs.core.str(b) + if (b instanceof cljs.core.Symbol) { + return "" + cljs.core.str(b); } - if(cljs.core.map_QMARK_.call(null, b)) { + if (cljs.core.map_QMARK_(b)) { var c = {}; - b = cljs.core.seq.call(null, b); - for(var d = null, e = 0, f = 0;;) { - if(f < e) { - var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); - c[cljs.core.key__GT_js.call(null, h)] = clj__GT_js.call(null, g); - f += 1 - }else { - if(b = cljs.core.seq.call(null, b)) { - cljs.core.chunked_seq_QMARK_.call(null, b) ? (e = cljs.core.chunk_first.call(null, b), b = cljs.core.chunk_rest.call(null, b), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, b), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), c[cljs.core.key__GT_js.call(null, d)] = clj__GT_js.call(null, e), b = cljs.core.next.call(null, b), d = null, e = 0), f = 0 - }else { - break + b = cljs.core.seq(b); + for (var d = null, e = 0, f = 0;;) { + if (f < e) { + var g = d.cljs$core$IIndexed$_nth$arity$2(null, f), h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 0, null), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 1, null); + c[cljs.core.key__GT_js(h)] = clj__GT_js(g); + f += 1; + } else { + if (b = cljs.core.seq(b)) { + cljs.core.chunked_seq_QMARK_(b) ? (e = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), d = e, e = cljs.core.count(e)) : (e = cljs.core.first(b), d = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(e, 0, null), e = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(e, 1, null), c[cljs.core.key__GT_js(d)] = clj__GT_js(e), b = cljs.core.next(b), d = null, e = 0), f = 0; + } else { + break; } } } - return c + return c; } - if(cljs.core.coll_QMARK_.call(null, b)) { + if (cljs.core.coll_QMARK_(b)) { c = []; - b = cljs.core.seq.call(null, cljs.core.map.call(null, clj__GT_js, b)); + b = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(clj__GT_js, b)); d = null; - for(f = e = 0;;) { - if(f < e) { - h = cljs.core._nth.call(null, d, f), c.push(h), f += 1 - }else { - if(b = cljs.core.seq.call(null, b)) { - d = b, cljs.core.chunked_seq_QMARK_.call(null, d) ? (b = cljs.core.chunk_first.call(null, d), f = cljs.core.chunk_rest.call(null, d), d = b, e = cljs.core.count.call(null, b), b = f) : (b = cljs.core.first.call(null, d), c.push(b), b = cljs.core.next.call(null, d), d = null, e = 0), f = 0 - }else { - break + for (f = e = 0;;) { + if (f < e) { + h = d.cljs$core$IIndexed$_nth$arity$2(null, f), c.push(h), f += 1; + } else { + if (b = cljs.core.seq(b)) { + d = b, cljs.core.chunked_seq_QMARK_(d) ? (b = cljs.core.chunk_first(d), f = cljs.core.chunk_rest(d), d = b, e = cljs.core.count(b), b = f) : (b = cljs.core.first(d), c.push(b), b = cljs.core.next(d), d = null, e = 0), f = 0; + } else { + break; } } } - return c + return c; } - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null + return b; }; cljs.core.IEncodeClojure = function() { - return{} + return{}; }(); cljs.core._js__GT_clj = function(a, b) { - if(a ? a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2 : a) { - return a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2(a, b) + if (a ? a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2 : a) { + return a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2(a, b); } var c; - c = cljs.core._js__GT_clj[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._js__GT_clj._, !c)) { - throw cljs.core.missing_protocol.call(null, "IEncodeClojure.-js-\x3eclj", a); + c = cljs.core._js__GT_clj; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._js__GT_clj._, !c)) { + throw cljs.core.missing_protocol("IEncodeClojure.-js-\x3eclj", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.js__GT_clj = function() { var a = null, b = function(b) { - return a.call(null, b, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672), !1], null)) + return a.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq([new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 1310784252), !1], null)], 0)); }, c = function() { var a = function(a, b) { - if(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeClojure$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) { - return cljs.core._js__GT_clj.call(null, a, cljs.core.apply.call(null, cljs.core.array_map, b)) - } - if(cljs.core.seq.call(null, b)) { - var c = cljs.core.seq_QMARK_.call(null, b) ? cljs.core.apply.call(null, cljs.core.hash_map, b) : b, d = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672)), e = cljs.core.truth_(d) ? cljs.core.keyword : cljs.core.str; - return function(a, b, c, d) { - return function s(e) { - return cljs.core.seq_QMARK_.call(null, e) ? cljs.core.doall.call(null, cljs.core.map.call(null, s, e)) : cljs.core.coll_QMARK_.call(null, e) ? cljs.core.into.call(null, cljs.core.empty.call(null, e), cljs.core.map.call(null, s, e)) : e instanceof Array ? cljs.core.vec.call(null, cljs.core.map.call(null, s, e)) : cljs.core.type.call(null, e) === Object ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, function() { - return function(a, b, c, d) { - return function R(f) { - return new cljs.core.LazySeq(null, function(a, b, c, d) { - return function() { - for(;;) { - var a = cljs.core.seq.call(null, f); - if(a) { - if(cljs.core.chunked_seq_QMARK_.call(null, a)) { - var b = cljs.core.chunk_first.call(null, a), c = cljs.core.count.call(null, b), g = cljs.core.chunk_buffer.call(null, c); - a: { - for(var h = 0;;) { - if(h < c) { - var k = cljs.core._nth.call(null, b, h); - cljs.core.chunk_append.call(null, g, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, k), s.call(null, e[k])], null)); - h += 1 - }else { - b = !0; - break a - } + var c = cljs.core.seq_QMARK_(b) ? cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map, b) : b, d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 1310784252)), e = cljs.core.truth_(d) ? cljs.core.keyword : cljs.core.str; + return function(a, c, d, e) { + return function s(f) { + return(f ? cljs.core.truth_(cljs.core.truth_(null) ? null : f.cljs$core$IEncodeClojure$) || (f.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeClojure, f)) : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeClojure, f)) ? cljs.core._js__GT_clj(f, cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.array_map, b)) : cljs.core.seq_QMARK_(f) ? cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map.cljs$core$IFn$_invoke$arity$2(s, f)) : + cljs.core.coll_QMARK_(f) ? cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.empty(f), cljs.core.map.cljs$core$IFn$_invoke$arity$2(s, f)) : f instanceof Array ? cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(s, f)) : cljs.core.type(f) === Object ? cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY, function() { + return function(a, b, c, d) { + return function L(e) { + return new cljs.core.LazySeq(null, function(a, b, c, d) { + return function() { + for (;;) { + var a = cljs.core.seq(e); + if (a) { + if (cljs.core.chunked_seq_QMARK_(a)) { + var b = cljs.core.chunk_first(a), c = cljs.core.count(b), g = cljs.core.chunk_buffer(c); + return function() { + for (var a = 0;;) { + if (a < c) { + var e = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, a); + cljs.core.chunk_append(g, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [function() { + var a = e; + return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(a) : d.call(null, a); + }(), s(f[e])], null)); + a += 1; + } else { + return!0; } - b = void 0 } - return b ? cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), R.call(null, cljs.core.chunk_rest.call(null, a))) : cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), null) - } - g = cljs.core.first.call(null, a); - return cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, g), s.call(null, e[g])], null), R.call(null, cljs.core.rest.call(null, a))) + }() ? cljs.core.chunk_cons(cljs.core.chunk(g), L(cljs.core.chunk_rest(a))) : cljs.core.chunk_cons(cljs.core.chunk(g), null); } - return null + var h = cljs.core.first(a); + return cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [function() { + var a = h; + return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(a) : d.call(null, a); + }(), s(f[h])], null), L(cljs.core.rest(a))); } + return null; } - }(a, b, c, d), null, null) - } - }(a, b, c, d).call(null, cljs.core.js_keys.call(null, e)) - }()) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? e : null - } - }(b, c, d, e).call(null, a) - } - return null + }; + }(a, b, c, d), null, null); + }; + }(a, c, d, e)(cljs.core.js_keys(f)); + }()) : f; + }; + }(b, c, d, e)(a); }, b = function(b, c) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { + k[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(k, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, b) + return a(c, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + var f = null; + if (1 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { + g[f] = arguments[f + 1], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, f); } throw Error("Invalid arity: " + arguments.length); }; @@ -12999,64 +18316,81 @@ cljs.core.js__GT_clj = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.memoize = function(a) { - var b = cljs.core.atom.call(null, cljs.core.PersistentArrayMap.EMPTY); - return function() { - var c = function(c) { - var d = cljs.core.get.call(null, cljs.core.deref.call(null, b), c); - if(cljs.core.truth_(d)) { - return d - } - d = cljs.core.apply.call(null, a, c); - cljs.core.swap_BANG_.call(null, b, cljs.core.assoc, c, d); - return d - }, d = function(a) { - var b = null; - 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return c.call(this, b) - }; - d.cljs$lang$maxFixedArity = 0; - d.cljs$lang$applyTo = function(a) { - a = cljs.core.seq(a); - return c(a) - }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }() + return function(b) { + return function() { + var c = function(c) { + var d = cljs.core.get.cljs$core$IFn$_invoke$arity$3(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b), c, cljs.core.lookup_sentinel); + d === cljs.core.lookup_sentinel && (d = cljs.core.apply.cljs$core$IFn$_invoke$arity$2(a, c), cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(b, cljs.core.assoc, c, d)); + return d; + }, d = function(a) { + var b = null; + if (0 < arguments.length) { + for (var b = 0, d = Array(arguments.length - 0);b < d.length;) { + d[b] = arguments[b + 0], ++b; + } + b = new cljs.core.IndexedSeq(d, 0); + } + return c.call(this, b); + }; + d.cljs$lang$maxFixedArity = 0; + d.cljs$lang$applyTo = function(a) { + a = cljs.core.seq(a); + return c(a); + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d; + }(); + }(function() { + var a = cljs.core.PersistentArrayMap.EMPTY; + return cljs.core.atom.cljs$core$IFn$_invoke$arity$1 ? cljs.core.atom.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.atom.call(null, a); + }()); }; cljs.core.trampoline = function() { var a = null, b = function(a) { - for(;;) { - if(a = a.call(null), !cljs.core.fn_QMARK_.call(null, a)) { - return a + for (;;) { + if (a = a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), !cljs.core.fn_QMARK_(a)) { + return a; } } }, c = function() { var b = function(b, c) { - return a.call(null, function() { - return cljs.core.apply.call(null, b, c) - }) + return a.cljs$core$IFn$_invoke$arity$1(function() { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(b, c); + }); }, c = function(a, c) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return b.call(this, a, e) + if (1 < arguments.length) { + for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { + k[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(k, 0); + } + return b.call(this, a, e); }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, a) + return b(c, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + var f = null; + if (1 < arguments.length) { + for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { + g[f] = arguments[f + 1], ++f; + } + f = new cljs.core.IndexedSeq(g, 0); + } + return c.cljs$core$IFn$_invoke$arity$variadic(a, f); } throw Error("Invalid arity: " + arguments.length); }; @@ -13064,385 +18398,423 @@ cljs.core.trampoline = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.rand = function() { var a = null, b = function() { - return a.call(null, 1) + return a.cljs$core$IFn$_invoke$arity$1(1); }, c = function(a) { - return Math.random.call(null) * a + return(Math.random.cljs$core$IFn$_invoke$arity$0 ? Math.random.cljs$core$IFn$_invoke$arity$0() : Math.random.call(null)) * a; }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a) + return c.call(this, a); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a + return a; }(); cljs.core.rand_int = function(a) { - return Math.floor.call(null, Math.random.call(null) * a) + a *= Math.random.cljs$core$IFn$_invoke$arity$0 ? Math.random.cljs$core$IFn$_invoke$arity$0() : Math.random.call(null); + return Math.floor.cljs$core$IFn$_invoke$arity$1 ? Math.floor.cljs$core$IFn$_invoke$arity$1(a) : Math.floor.call(null, a); }; cljs.core.rand_nth = function(a) { - return cljs.core.nth.call(null, a, cljs.core.rand_int.call(null, cljs.core.count.call(null, a))) + return cljs.core.nth.cljs$core$IFn$_invoke$arity$2(a, cljs.core.rand_int(cljs.core.count(a))); }; cljs.core.group_by = function(a, b) { - return cljs.core.reduce.call(null, function(b, d) { - var e = a.call(null, d); - return cljs.core.assoc.call(null, b, e, cljs.core.conj.call(null, cljs.core.get.call(null, b, e, cljs.core.PersistentVector.EMPTY), d)) - }, cljs.core.PersistentArrayMap.EMPTY, b) + return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, d) { + var e; + e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(b, e, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(b, e, cljs.core.PersistentVector.EMPTY), d)); + }, cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY), b)); }; cljs.core.make_hierarchy = function() { - return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "descendants", "descendants", 768214664), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), cljs.core.PersistentArrayMap.EMPTY], null) + return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", -2027538891), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "descendants", "descendants", 1824886031), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424), cljs.core.PersistentArrayMap.EMPTY], null); }; cljs.core._global_hierarchy = null; cljs.core.get_global_hierarchy = function() { - null == cljs.core._global_hierarchy && (cljs.core._global_hierarchy = cljs.core.atom.call(null, cljs.core.make_hierarchy.call(null))); - return cljs.core._global_hierarchy + if (null == cljs.core._global_hierarchy) { + var a = cljs.core, b; + b = cljs.core.make_hierarchy(); + b = cljs.core.atom.cljs$core$IFn$_invoke$arity$1 ? cljs.core.atom.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.atom.call(null, b); + a._global_hierarchy = b; + } + return cljs.core._global_hierarchy; }; cljs.core.swap_global_hierarchy_BANG_ = function() { var a = function(a, b) { - return cljs.core.apply.call(null, cljs.core.swap_BANG_, cljs.core.get_global_hierarchy.call(null), a, b) + return cljs.core.apply.cljs$core$IFn$_invoke$arity$4(cljs.core.swap_BANG_, cljs.core.get_global_hierarchy(), a, b); }, b = function(b, d) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { + f[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.isa_QMARK_ = function() { var a = null, b = function(b, c) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b, c) + return a.cljs$core$IFn$_invoke$arity$3(function() { + var a = cljs.core.get_global_hierarchy(); + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }(), b, c); }, c = function(b, c, f) { - var g = cljs.core._EQ_.call(null, c, f); - if(!g && !(g = cljs.core.contains_QMARK_.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(b).call(null, c), f)) && (g = cljs.core.vector_QMARK_.call(null, f)) && (g = cljs.core.vector_QMARK_.call(null, c))) { - if(g = cljs.core.count.call(null, f) === cljs.core.count.call(null, c)) { - for(var g = !0, h = 0;;) { - if(g && h !== cljs.core.count.call(null, f)) { - g = a.call(null, b, c.call(null, h), f.call(null, h)), h += 1 - }else { - return g + var g = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, f); + if (!g && !(g = cljs.core.contains_QMARK_((new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(b).call(null, c), f)) && (g = cljs.core.vector_QMARK_(f)) && (g = cljs.core.vector_QMARK_(c))) { + if (g = cljs.core.count(f) === cljs.core.count(c)) { + for (var h = !0, k = 0;;) { + if (h && k !== cljs.core.count(f)) { + h = a.cljs$core$IFn$_invoke$arity$3(b, function() { + var a = k; + return c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(a) : c.call(null, a); + }(), function() { + var a = k; + return f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(a) : f.call(null, a); + }()), k = g = k + 1; + } else { + return h; } } - }else { - return g + } else { + return g; } - }else { - return g + } else { + return g; } }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.parents = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) + return a.cljs$core$IFn$_invoke$arity$2(function() { + var a = cljs.core.get_global_hierarchy(); + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }(), b); }, c = function(a, b) { - return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b)) + return cljs.core.not_empty(cljs.core.get.cljs$core$IFn$_invoke$arity$2((new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.ancestors = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) + return a.cljs$core$IFn$_invoke$arity$2(function() { + var a = cljs.core.get_global_hierarchy(); + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }(), b); }, c = function(a, b) { - return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), b)) + return cljs.core.not_empty(cljs.core.get.cljs$core$IFn$_invoke$arity$2((new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(a), b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.descendants = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) + return a.cljs$core$IFn$_invoke$arity$2(function() { + var a = cljs.core.get_global_hierarchy(); + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }(), b); }, c = function(a, b) { - return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), b)) + return cljs.core.not_empty(cljs.core.get.cljs$core$IFn$_invoke$arity$2((new cljs.core.Keyword(null, "descendants", "descendants", 1824886031)).cljs$core$IFn$_invoke$arity$1(a), b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.derive = function() { var a = null, b = function(b, c) { - if(!cljs.core.truth_(cljs.core.namespace.call(null, c))) { - throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "namespace", "namespace", -388313324, null), new cljs.core.Symbol(null, "parent", "parent", 1659011683, null))))].join("")); + if (!cljs.core.truth_(cljs.core.namespace(c))) { + throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([cljs.core.list(new cljs.core.Symbol(null, "namespace", "namespace", 1263021155, null), new cljs.core.Symbol(null, "parent", "parent", 761652748, null))], 0)))].join("")); } - cljs.core.swap_global_hierarchy_BANG_.call(null, a, b, c); - return null + cljs.core.swap_global_hierarchy_BANG_.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq([b, c], 0)); + return null; }, c = function(a, b, c) { - if(!cljs.core.not_EQ_.call(null, b, c)) { - throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "not\x3d", "not\x3d", -1637144189, null), new cljs.core.Symbol(null, "tag", "tag", -1640416941, null), new cljs.core.Symbol(null, "parent", "parent", 1659011683, null))))].join("")); + if (!cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(b, c)) { + throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([cljs.core.list(new cljs.core.Symbol(null, "not\x3d", "not\x3d", 1466536204, null), new cljs.core.Symbol(null, "tag", "tag", 350170304, null), new cljs.core.Symbol(null, "parent", "parent", 761652748, null))], 0)))].join("")); } - var g = (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), h = (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), k = (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), l = function(a, b, c) { + var g = (new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), h = (new cljs.core.Keyword(null, "descendants", "descendants", 1824886031)).cljs$core$IFn$_invoke$arity$1(a), k = (new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(a), l = function(a, b, c) { return function(d, e, f, g, h) { - return cljs.core.reduce.call(null, function(a, b, c) { + return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a, b, c) { return function(a, b) { - return cljs.core.assoc.call(null, a, b, cljs.core.reduce.call(null, cljs.core.conj, cljs.core.get.call(null, h, b, cljs.core.PersistentHashSet.EMPTY), cljs.core.cons.call(null, g, h.call(null, g)))) - } - }(a, b, c), d, cljs.core.cons.call(null, e, f.call(null, e))) - } + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj, cljs.core.get.cljs$core$IFn$_invoke$arity$3(h, b, cljs.core.PersistentHashSet.EMPTY), cljs.core.cons(g, h.cljs$core$IFn$_invoke$arity$1 ? h.cljs$core$IFn$_invoke$arity$1(g) : h.call(null, g)))); + }; + }(a, b, c), d, cljs.core.cons(e, f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(e) : f.call(null, e))); + }; }(g, h, k); - if(cljs.core.contains_QMARK_.call(null, g.call(null, b), c)) { - b = null - }else { - if(cljs.core.contains_QMARK_.call(null, k.call(null, b), c)) { + if (cljs.core.contains_QMARK_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b), c)) { + b = null; + } else { + if (cljs.core.contains_QMARK_(k.cljs$core$IFn$_invoke$arity$1 ? k.cljs$core$IFn$_invoke$arity$1(b) : k.call(null, b), c)) { throw Error([cljs.core.str(b), cljs.core.str("already has"), cljs.core.str(c), cljs.core.str("as ancestor")].join("")); } - if(cljs.core.contains_QMARK_.call(null, k.call(null, c), b)) { + if (cljs.core.contains_QMARK_(k.cljs$core$IFn$_invoke$arity$1 ? k.cljs$core$IFn$_invoke$arity$1(c) : k.call(null, c), b)) { throw Error([cljs.core.str("Cyclic derivation:"), cljs.core.str(c), cljs.core.str("has"), cljs.core.str(b), cljs.core.str("as ancestor")].join("")); } - b = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.assoc.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b, cljs.core.conj.call(null, cljs.core.get.call(null, g, b, cljs.core.PersistentHashSet.EMPTY), c)), new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), l.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), - b, h, c, k), new cljs.core.Keyword(null, "descendants", "descendants", 768214664), l.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), c, k, b, h)], null) + b = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", -2027538891), cljs.core.assoc.cljs$core$IFn$_invoke$arity$3((new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), b, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(g, b, cljs.core.PersistentHashSet.EMPTY), c)), new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424), l((new cljs.core.Keyword(null, "ancestors", + "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(a), b, h, c, k), new cljs.core.Keyword(null, "descendants", "descendants", 1824886031), l((new cljs.core.Keyword(null, "descendants", "descendants", 1824886031)).cljs$core$IFn$_invoke$arity$1(a), c, k, b, h)], null); } - return cljs.core.truth_(b) ? b : a + return cljs.core.truth_(b) ? b : a; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.underive = function() { var a = null, b = function(b, c) { - cljs.core.swap_global_hierarchy_BANG_.call(null, a, b, c); - return null + cljs.core.swap_global_hierarchy_BANG_.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq([b, c], 0)); + return null; }, c = function(a, b, c) { - var g = (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), h = cljs.core.truth_(g.call(null, b)) ? cljs.core.disj.call(null, g.call(null, b), c) : cljs.core.PersistentHashSet.EMPTY, k = cljs.core.truth_(cljs.core.not_empty.call(null, h)) ? cljs.core.assoc.call(null, g, b, h) : cljs.core.dissoc.call(null, g, b), h = cljs.core.flatten.call(null, cljs.core.map.call(null, function(a, b, c) { + var g = (new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), h = cljs.core.truth_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b)) ? cljs.core.disj.cljs$core$IFn$_invoke$arity$2(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b), c) : cljs.core.PersistentHashSet.EMPTY, k = cljs.core.truth_(cljs.core.not_empty(h)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(g, b, h) : cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(g, + b), l = cljs.core.flatten(cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(a, b, c) { return function(a) { - return cljs.core.cons.call(null, cljs.core.first.call(null, a), cljs.core.interpose.call(null, cljs.core.first.call(null, a), cljs.core.second.call(null, a))) - } - }(g, h, k), cljs.core.seq.call(null, k))); - return cljs.core.contains_QMARK_.call(null, g.call(null, b), c) ? cljs.core.reduce.call(null, function(a, b) { - return cljs.core.apply.call(null, cljs.core.derive, a, b) - }, cljs.core.make_hierarchy.call(null), cljs.core.partition.call(null, 2, h)) : a + return cljs.core.cons(cljs.core.first(a), cljs.core.interpose.cljs$core$IFn$_invoke$arity$2(cljs.core.first(a), cljs.core.second(a))); + }; + }(g, h, k), cljs.core.seq(k))); + return cljs.core.contains_QMARK_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b), c) ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a, b, c, d) { + return function(a, b) { + return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.derive, a, b); + }; + }(g, h, k, l), cljs.core.make_hierarchy(), cljs.core.partition.cljs$core$IFn$_invoke$arity$2(2, l)) : a; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.reset_cache = function(a, b, c, d) { - cljs.core.swap_BANG_.call(null, a, function(a) { - return cljs.core.deref.call(null, b) + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(a, function(a) { + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + }); + return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(c, function(a) { + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d); }); - return cljs.core.swap_BANG_.call(null, c, function(a) { - return cljs.core.deref.call(null, d) - }) }; cljs.core.prefers_STAR_ = function prefers_STAR_(b, c, d) { - var e = cljs.core.deref.call(null, d).call(null, b), e = cljs.core.truth_(cljs.core.truth_(e) ? e.call(null, c) : e) ? !0 : null; - if(cljs.core.truth_(e)) { - return e + var e = (cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d)).call(null, b), e = cljs.core.truth_(cljs.core.truth_(e) ? e.cljs$core$IFn$_invoke$arity$1 ? e.cljs$core$IFn$_invoke$arity$1(c) : e.call(null, c) : e) ? !0 : null; + if (cljs.core.truth_(e)) { + return e; } e = function() { - for(var e = cljs.core.parents.call(null, c);;) { - if(0 < cljs.core.count.call(null, e)) { - cljs.core.truth_(prefers_STAR_.call(null, b, cljs.core.first.call(null, e), d)), e = cljs.core.rest.call(null, e) - }else { - return null + for (var e = cljs.core.parents.cljs$core$IFn$_invoke$arity$1(c);;) { + if (0 < cljs.core.count(e)) { + cljs.core.truth_(prefers_STAR_(b, cljs.core.first(e), d)), e = cljs.core.rest(e); + } else { + return null; } } }(); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = function() { - for(var e = cljs.core.parents.call(null, b);;) { - if(0 < cljs.core.count.call(null, e)) { - cljs.core.truth_(prefers_STAR_.call(null, cljs.core.first.call(null, e), c, d)), e = cljs.core.rest.call(null, e) - }else { - return null + for (var e = cljs.core.parents.cljs$core$IFn$_invoke$arity$1(b);;) { + if (0 < cljs.core.count(e)) { + cljs.core.truth_(prefers_STAR_(cljs.core.first(e), c, d)), e = cljs.core.rest(e); + } else { + return null; } } }(); - return cljs.core.truth_(e) ? e : !1 + return cljs.core.truth_(e) ? e : !1; }; cljs.core.dominates = function(a, b, c) { - c = cljs.core.prefers_STAR_.call(null, a, b, c); - return cljs.core.truth_(c) ? c : cljs.core.isa_QMARK_.call(null, a, b) + c = cljs.core.prefers_STAR_(a, b, c); + return cljs.core.truth_(c) ? c : cljs.core.isa_QMARK_.cljs$core$IFn$_invoke$arity$2(a, b); }; cljs.core.find_and_cache_best_method = function find_and_cache_best_method(b, c, d, e, f, g, h) { - var k = cljs.core.reduce.call(null, function(e, g) { - var h = cljs.core.nth.call(null, g, 0, null); - cljs.core.nth.call(null, g, 1, null); - if(cljs.core.isa_QMARK_.call(null, cljs.core.deref.call(null, d), c, h)) { + var k = cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(e, g) { + var h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 0, null); + cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 1, null); + if (cljs.core.isa_QMARK_.cljs$core$IFn$_invoke$arity$3(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d), c, h)) { var k = cljs.core.truth_(function() { var b = null == e; - return b ? b : cljs.core.dominates.call(null, h, cljs.core.first.call(null, e), f) + return b ? b : cljs.core.dominates(h, cljs.core.first(e), f); }()) ? g : e; - if(!cljs.core.truth_(cljs.core.dominates.call(null, cljs.core.first.call(null, k), h, f))) { - throw Error([cljs.core.str("Multiple methods in multimethod '"), cljs.core.str(b), cljs.core.str("' match dispatch value: "), cljs.core.str(c), cljs.core.str(" -\x3e "), cljs.core.str(h), cljs.core.str(" and "), cljs.core.str(cljs.core.first.call(null, k)), cljs.core.str(", and neither is preferred")].join("")); + if (!cljs.core.truth_(cljs.core.dominates(cljs.core.first(k), h, f))) { + throw Error([cljs.core.str("Multiple methods in multimethod '"), cljs.core.str(b), cljs.core.str("' match dispatch value: "), cljs.core.str(c), cljs.core.str(" -\x3e "), cljs.core.str(h), cljs.core.str(" and "), cljs.core.str(cljs.core.first(k)), cljs.core.str(", and neither is preferred")].join("")); } - return k + return k; } - return e - }, null, cljs.core.deref.call(null, e)); - if(cljs.core.truth_(k)) { - if(cljs.core._EQ_.call(null, cljs.core.deref.call(null, h), cljs.core.deref.call(null, d))) { - return cljs.core.swap_BANG_.call(null, g, cljs.core.assoc, c, cljs.core.second.call(null, k)), cljs.core.second.call(null, k) + return e; + }, null, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(e) : cljs.core.deref.call(null, e)); + if (cljs.core.truth_(k)) { + if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(h) : cljs.core.deref.call(null, h), cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d))) { + return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(g, cljs.core.assoc, c, cljs.core.second(k)), cljs.core.second(k); } - cljs.core.reset_cache.call(null, g, e, h, d); - return find_and_cache_best_method.call(null, b, c, d, e, f, g, h) + cljs.core.reset_cache(g, e, h, d); + return find_and_cache_best_method(b, c, d, e, f, g, h); } - return null + return null; }; cljs.core.IMultiFn = function() { - return{} + return{}; }(); cljs.core._reset = function(a) { - if(a ? a.cljs$core$IMultiFn$_reset$arity$1 : a) { - return a.cljs$core$IMultiFn$_reset$arity$1(a) + if (a ? a.cljs$core$IMultiFn$_reset$arity$1 : a) { + return a.cljs$core$IMultiFn$_reset$arity$1(a); } var b; - b = cljs.core._reset[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._reset._, !b)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-reset", a); + b = cljs.core._reset; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._reset._, !b)) { + throw cljs.core.missing_protocol("IMultiFn.-reset", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._add_method = function(a, b, c) { - if(a ? a.cljs$core$IMultiFn$_add_method$arity$3 : a) { - return a.cljs$core$IMultiFn$_add_method$arity$3(a, b, c) + if (a ? a.cljs$core$IMultiFn$_add_method$arity$3 : a) { + return a.cljs$core$IMultiFn$_add_method$arity$3(a, b, c); } var d; - d = cljs.core._add_method[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._add_method._, !d)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-add-method", a); + d = cljs.core._add_method; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._add_method._, !d)) { + throw cljs.core.missing_protocol("IMultiFn.-add-method", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._remove_method = function(a, b) { - if(a ? a.cljs$core$IMultiFn$_remove_method$arity$2 : a) { - return a.cljs$core$IMultiFn$_remove_method$arity$2(a, b) + if (a ? a.cljs$core$IMultiFn$_remove_method$arity$2 : a) { + return a.cljs$core$IMultiFn$_remove_method$arity$2(a, b); } var c; - c = cljs.core._remove_method[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._remove_method._, !c)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-remove-method", a); + c = cljs.core._remove_method; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._remove_method._, !c)) { + throw cljs.core.missing_protocol("IMultiFn.-remove-method", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._prefer_method = function(a, b, c) { - if(a ? a.cljs$core$IMultiFn$_prefer_method$arity$3 : a) { - return a.cljs$core$IMultiFn$_prefer_method$arity$3(a, b, c) + if (a ? a.cljs$core$IMultiFn$_prefer_method$arity$3 : a) { + return a.cljs$core$IMultiFn$_prefer_method$arity$3(a, b, c); } var d; - d = cljs.core._prefer_method[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._prefer_method._, !d)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-prefer-method", a); + d = cljs.core._prefer_method; + var e; + e = goog.typeOf(null == a ? null : a); + d = d[e]; + if (!d && (d = cljs.core._prefer_method._, !d)) { + throw cljs.core.missing_protocol("IMultiFn.-prefer-method", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._get_method = function(a, b) { - if(a ? a.cljs$core$IMultiFn$_get_method$arity$2 : a) { - return a.cljs$core$IMultiFn$_get_method$arity$2(a, b) + if (a ? a.cljs$core$IMultiFn$_get_method$arity$2 : a) { + return a.cljs$core$IMultiFn$_get_method$arity$2(a, b); } var c; - c = cljs.core._get_method[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._get_method._, !c)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-get-method", a); + c = cljs.core._get_method; + var d; + d = goog.typeOf(null == a ? null : a); + c = c[d]; + if (!c && (c = cljs.core._get_method._, !c)) { + throw cljs.core.missing_protocol("IMultiFn.-get-method", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._methods = function(a) { - if(a ? a.cljs$core$IMultiFn$_methods$arity$1 : a) { - return a.cljs$core$IMultiFn$_methods$arity$1(a) + if (a ? a.cljs$core$IMultiFn$_methods$arity$1 : a) { + return a.cljs$core$IMultiFn$_methods$arity$1(a); } var b; - b = cljs.core._methods[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._methods._, !b)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-methods", a); + b = cljs.core._methods; + var c; + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._methods._, !b)) { + throw cljs.core.missing_protocol("IMultiFn.-methods", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._prefers = function(a) { - if(a ? a.cljs$core$IMultiFn$_prefers$arity$1 : a) { - return a.cljs$core$IMultiFn$_prefers$arity$1(a) + if (a ? a.cljs$core$IMultiFn$_prefers$arity$1 : a) { + return a.cljs$core$IMultiFn$_prefers$arity$1(a); } var b; - b = cljs.core._prefers[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._prefers._, !b)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-prefers", a); - } - return b.call(null, a) -}; -cljs.core._dispatch = function(a, b) { - if(a ? a.cljs$core$IMultiFn$_dispatch$arity$2 : a) { - return a.cljs$core$IMultiFn$_dispatch$arity$2(a, b) - } + b = cljs.core._prefers; var c; - c = cljs.core._dispatch[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._dispatch._, !c)) { - throw cljs.core.missing_protocol.call(null, "IMultiFn.-dispatch", a); + c = goog.typeOf(null == a ? null : a); + b = b[c]; + if (!b && (b = cljs.core._prefers._, !b)) { + throw cljs.core.missing_protocol("IMultiFn.-prefers", a); } - return c.call(null, a, b) + return b.call(null, a); }; -cljs.core.do_dispatch = function(a, b, c, d) { - c = cljs.core.apply.call(null, c, d); - a = cljs.core._get_method.call(null, a, c); - if(!cljs.core.truth_(a)) { - throw Error([cljs.core.str("No method in multimethod '"), cljs.core.str(b), cljs.core.str("' for dispatch value: "), cljs.core.str(c)].join("")); - } - return cljs.core.apply.call(null, a, d) +cljs.core.throw_no_method_error = function(a, b) { + throw Error([cljs.core.str("No method in multimethod '"), cljs.core.str(a), cljs.core.str("' for dispatch value: "), cljs.core.str(b)].join("")); }; cljs.core.MultiFn = function(a, b, c, d, e, f, g, h) { this.name = a; @@ -13453,755 +18825,1083 @@ cljs.core.MultiFn = function(a, b, c, d, e, f, g, h) { this.prefer_table = f; this.method_cache = g; this.cached_hierarchy = h; - this.cljs$lang$protocol_mask$partition0$ = 4194304; - this.cljs$lang$protocol_mask$partition1$ = 256 -}; -cljs.core.MultiFn.cljs$lang$type = !0; -cljs.core.MultiFn.cljs$lang$ctorStr = "cljs.core/MultiFn"; -cljs.core.MultiFn.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/MultiFn") + this.cljs$lang$protocol_mask$partition0$ = 4194305; + this.cljs$lang$protocol_mask$partition1$ = 4352; }; cljs.core.MultiFn.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.getUid(this) + return goog.getUid(this); +}; +cljs.core.MultiFn.prototype.cljs$core$INamed$_name$arity$1 = function(a) { + return cljs.core._name(this.name); +}; +cljs.core.MultiFn.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { + return cljs.core._namespace(this.name); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_reset$arity$1 = function(a) { - cljs.core.swap_BANG_.call(null, this.method_table, function(a) { - return cljs.core.PersistentArrayMap.EMPTY - }); - cljs.core.swap_BANG_.call(null, this.method_cache, function(a) { - return cljs.core.PersistentArrayMap.EMPTY - }); - cljs.core.swap_BANG_.call(null, this.prefer_table, function(a) { - return cljs.core.PersistentArrayMap.EMPTY - }); - cljs.core.swap_BANG_.call(null, this.cached_hierarchy, function(a) { - return null - }); - return this + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.method_table, function(a) { + return function(a) { + return cljs.core.PersistentArrayMap.EMPTY; + }; + }(this)); + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.method_cache, function(a) { + return function(a) { + return cljs.core.PersistentArrayMap.EMPTY; + }; + }(this)); + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.prefer_table, function(a) { + return function(a) { + return cljs.core.PersistentArrayMap.EMPTY; + }; + }(this)); + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.cached_hierarchy, function(a) { + return function(a) { + return null; + }; + }(this)); + return this; }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_add_method$arity$3 = function(a, b, c) { - cljs.core.swap_BANG_.call(null, this.method_table, cljs.core.assoc, b, c); - cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - return this + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(this.method_table, cljs.core.assoc, b, c); + cljs.core.reset_cache(this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); + return this; }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_remove_method$arity$2 = function(a, b) { - cljs.core.swap_BANG_.call(null, this.method_table, cljs.core.dissoc, b); - cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - return this + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(this.method_table, cljs.core.dissoc, b); + cljs.core.reset_cache(this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); + return this; }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_get_method$arity$2 = function(a, b) { - cljs.core._EQ_.call(null, cljs.core.deref.call(null, this.cached_hierarchy), cljs.core.deref.call(null, this.hierarchy)) || cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - var c = cljs.core.deref.call(null, this.method_cache).call(null, b); - if(cljs.core.truth_(c)) { - return c - } - c = cljs.core.find_and_cache_best_method.call(null, this.name, b, this.hierarchy, this.method_table, this.prefer_table, this.method_cache, this.cached_hierarchy); - return cljs.core.truth_(c) ? c : cljs.core.deref.call(null, this.method_table).call(null, this.default_dispatch_val) + var c = this; + cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(function() { + var a = c.cached_hierarchy; + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }(), function() { + var a = c.hierarchy; + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }()) || cljs.core.reset_cache(c.method_cache, c.method_table, c.cached_hierarchy, c.hierarchy); + var d = function() { + var a = c.method_cache; + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }().call(null, b); + if (cljs.core.truth_(d)) { + return d; + } + d = cljs.core.find_and_cache_best_method(c.name, b, c.hierarchy, c.method_table, c.prefer_table, c.method_cache, c.cached_hierarchy); + return cljs.core.truth_(d) ? d : function() { + var a = c.method_table; + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + }().call(null, c.default_dispatch_val); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_prefer_method$arity$3 = function(a, b, c) { - if(cljs.core.truth_(cljs.core.prefers_STAR_.call(null, b, c, this.prefer_table))) { + if (cljs.core.truth_(cljs.core.prefers_STAR_(b, c, this.prefer_table))) { throw Error([cljs.core.str("Preference conflict in multimethod '"), cljs.core.str(this.name), cljs.core.str("': "), cljs.core.str(c), cljs.core.str(" is already preferred to "), cljs.core.str(b)].join("")); } - cljs.core.swap_BANG_.call(null, this.prefer_table, function(a) { - return cljs.core.assoc.call(null, a, b, cljs.core.conj.call(null, cljs.core.get.call(null, a, b, cljs.core.PersistentHashSet.EMPTY), c)) - }); - return cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy) + cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.prefer_table, function(a) { + return function(a) { + return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.PersistentHashSet.EMPTY), c)); + }; + }(this)); + return cljs.core.reset_cache(this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_methods$arity$1 = function(a) { - return cljs.core.deref.call(null, this.method_table) + a = this.method_table; + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_prefers$arity$1 = function(a) { - return cljs.core.deref.call(null, this.prefer_table) -}; -cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_dispatch$arity$2 = function(a, b) { - return cljs.core.do_dispatch.call(null, this, this.name, this.dispatch_fn, b) -}; -cljs.core.__GT_MultiFn = function(a, b, c, d, e, f, g, h) { - return new cljs.core.MultiFn(a, b, c, d, e, f, g, h) + a = this.prefer_table; + return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); }; cljs.core.MultiFn.prototype.call = function() { - var a = function(a, b) { - return cljs.core._dispatch.call(null, this, b) - }, b = function(b, d) { - var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) - }; - b.cljs$lang$maxFixedArity = 1; - b.cljs$lang$applyTo = function(b) { - var d = cljs.core.first(b); - b = cljs.core.rest(b); - return a(d, b) + var a = null, b = function(a) { + a = this; + var b = a.dispatch_fn.cljs$core$IFn$_invoke$arity$0 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$0() : a.dispatch_fn.call(null), c = this.cljs$core$IMultiFn$_get_method$arity$2(null, b); + cljs.core.truth_(c) || cljs.core.throw_no_method_error(a.name, b); + return c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null); + }, c = function(a, b) { + a = this; + var c; + c = a.dispatch_fn.cljs$core$IFn$_invoke$arity$1 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$1(b) : a.dispatch_fn.call(null, b); + var d = this.cljs$core$IMultiFn$_get_method$arity$2(null, c); + cljs.core.truth_(d) || cljs.core.throw_no_method_error(a.name, c); + return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(b) : d.call(null, b); + }, d = function(a, b, c) { + a = this; + var d; + d = a.dispatch_fn.cljs$core$IFn$_invoke$arity$2 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$2(b, c) : a.dispatch_fn.call(null, b, c); + var e = this.cljs$core$IMultiFn$_get_method$arity$2(null, d); + cljs.core.truth_(e) || cljs.core.throw_no_method_error(a.name, d); + return e.cljs$core$IFn$_invoke$arity$2 ? e.cljs$core$IFn$_invoke$arity$2(b, c) : e.call(null, b, c); + }, e = function(a, b, c, d) { + a = this; + var e; + e = a.dispatch_fn.cljs$core$IFn$_invoke$arity$3 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.dispatch_fn.call(null, b, c, d); + var f = this.cljs$core$IMultiFn$_get_method$arity$2(null, e); + cljs.core.truth_(f) || cljs.core.throw_no_method_error(a.name, e); + return f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(b, c, d) : f.call(null, b, c, d); + }, f = function(a, b, c, d, e) { + a = this; + var f; + f = a.dispatch_fn.cljs$core$IFn$_invoke$arity$4 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.dispatch_fn.call(null, b, c, d, e); + var g = this.cljs$core$IMultiFn$_get_method$arity$2(null, f); + cljs.core.truth_(g) || cljs.core.throw_no_method_error(a.name, f); + return g.cljs$core$IFn$_invoke$arity$4 ? g.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : g.call(null, b, c, d, e); + }, g = function(a, b, c, d, e, f) { + a = this; + var g; + g = a.dispatch_fn.cljs$core$IFn$_invoke$arity$5 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : a.dispatch_fn.call(null, b, c, d, e, f); + var h = this.cljs$core$IMultiFn$_get_method$arity$2(null, g); + cljs.core.truth_(h) || cljs.core.throw_no_method_error(a.name, g); + return h.cljs$core$IFn$_invoke$arity$5 ? h.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : h.call(null, b, c, d, e, f); + }, h = function(a, b, c, d, e, f, g) { + a = this; + var h; + h = a.dispatch_fn.cljs$core$IFn$_invoke$arity$6 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$6(b, c, d, e, f, g) : a.dispatch_fn.call(null, b, c, d, e, f, g); + var k = this.cljs$core$IMultiFn$_get_method$arity$2(null, h); + cljs.core.truth_(k) || cljs.core.throw_no_method_error(a.name, h); + return k.cljs$core$IFn$_invoke$arity$6 ? k.cljs$core$IFn$_invoke$arity$6(b, c, d, e, f, g) : k.call(null, b, c, d, e, f, g); + }, k = function(a, b, c, d, e, f, g, h) { + a = this; + var k; + k = a.dispatch_fn.cljs$core$IFn$_invoke$arity$7 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$7(b, c, d, e, f, g, h) : a.dispatch_fn.call(null, b, c, d, e, f, g, h); + var l = this.cljs$core$IMultiFn$_get_method$arity$2(null, k); + cljs.core.truth_(l) || cljs.core.throw_no_method_error(a.name, k); + return l.cljs$core$IFn$_invoke$arity$7 ? l.cljs$core$IFn$_invoke$arity$7(b, c, d, e, f, g, h) : l.call(null, b, c, d, e, f, g, h); + }, l = function(a, b, c, d, e, f, g, h, k) { + a = this; + var l; + l = a.dispatch_fn.cljs$core$IFn$_invoke$arity$8 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$8(b, c, d, e, f, g, h, k) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k); + var m = this.cljs$core$IMultiFn$_get_method$arity$2(null, l); + cljs.core.truth_(m) || cljs.core.throw_no_method_error(a.name, l); + return m.cljs$core$IFn$_invoke$arity$8 ? m.cljs$core$IFn$_invoke$arity$8(b, c, d, e, f, g, h, k) : m.call(null, b, c, d, e, f, g, h, k); + }, m = function(a, b, c, d, e, f, g, h, k, l) { + a = this; + var m; + m = a.dispatch_fn.cljs$core$IFn$_invoke$arity$9 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$9(b, c, d, e, f, g, h, k, l) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l); + var n = this.cljs$core$IMultiFn$_get_method$arity$2(null, m); + cljs.core.truth_(n) || cljs.core.throw_no_method_error(a.name, m); + return n.cljs$core$IFn$_invoke$arity$9 ? n.cljs$core$IFn$_invoke$arity$9(b, c, d, e, f, g, h, k, l) : n.call(null, b, c, d, e, f, g, h, k, l); + }, n = function(a, b, c, d, e, f, g, h, k, l, m) { + a = this; + var n; + n = a.dispatch_fn.cljs$core$IFn$_invoke$arity$10 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$10(b, c, d, e, f, g, h, k, l, m) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m); + var p = this.cljs$core$IMultiFn$_get_method$arity$2(null, n); + cljs.core.truth_(p) || cljs.core.throw_no_method_error(a.name, n); + return p.cljs$core$IFn$_invoke$arity$10 ? p.cljs$core$IFn$_invoke$arity$10(b, c, d, e, f, g, h, k, l, m) : p.call(null, b, c, d, e, f, g, h, k, l, m); + }, p = function(a, b, c, d, e, f, g, h, k, l, m, n) { + a = this; + var p; + p = a.dispatch_fn.cljs$core$IFn$_invoke$arity$11 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$11(b, c, d, e, f, g, h, k, l, m, n) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n); + var q = this.cljs$core$IMultiFn$_get_method$arity$2(null, p); + cljs.core.truth_(q) || cljs.core.throw_no_method_error(a.name, p); + return q.cljs$core$IFn$_invoke$arity$11 ? q.cljs$core$IFn$_invoke$arity$11(b, c, d, e, f, g, h, k, l, m, n) : q.call(null, b, c, d, e, f, g, h, k, l, m, n); + }, q = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { + a = this; + var q; + q = a.dispatch_fn.cljs$core$IFn$_invoke$arity$12 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$12(b, c, d, e, f, g, h, k, l, m, n, p) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p); + var r = this.cljs$core$IMultiFn$_get_method$arity$2(null, q); + cljs.core.truth_(r) || cljs.core.throw_no_method_error(a.name, q); + return r.cljs$core$IFn$_invoke$arity$12 ? r.cljs$core$IFn$_invoke$arity$12(b, c, d, e, f, g, h, k, l, m, n, p) : r.call(null, b, c, d, e, f, g, h, k, l, m, n, p); + }, r = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { + a = this; + var r; + r = a.dispatch_fn.cljs$core$IFn$_invoke$arity$13 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$13(b, c, d, e, f, g, h, k, l, m, n, p, q) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q); + var s = this.cljs$core$IMultiFn$_get_method$arity$2(null, r); + cljs.core.truth_(s) || cljs.core.throw_no_method_error(a.name, r); + return s.cljs$core$IFn$_invoke$arity$13 ? s.cljs$core$IFn$_invoke$arity$13(b, c, d, e, f, g, h, k, l, m, n, p, q) : s.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q); + }, s = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { + a = this; + var s; + s = a.dispatch_fn.cljs$core$IFn$_invoke$arity$14 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$14(b, c, d, e, f, g, h, k, l, m, n, p, q, r) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r); + var t = this.cljs$core$IMultiFn$_get_method$arity$2(null, s); + cljs.core.truth_(t) || cljs.core.throw_no_method_error(a.name, s); + return t.cljs$core$IFn$_invoke$arity$14 ? t.cljs$core$IFn$_invoke$arity$14(b, c, d, e, f, g, h, k, l, m, n, p, q, r) : t.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r); + }, t = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { + a = this; + var t; + t = a.dispatch_fn.cljs$core$IFn$_invoke$arity$15 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$15(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); + var u = this.cljs$core$IMultiFn$_get_method$arity$2(null, t); + cljs.core.truth_(u) || cljs.core.throw_no_method_error(a.name, t); + return u.cljs$core$IFn$_invoke$arity$15 ? u.cljs$core$IFn$_invoke$arity$15(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : u.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); + }, u = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { + a = this; + var u; + u = a.dispatch_fn.cljs$core$IFn$_invoke$arity$16 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$16(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); + var v = this.cljs$core$IMultiFn$_get_method$arity$2(null, u); + cljs.core.truth_(v) || cljs.core.throw_no_method_error(a.name, u); + return v.cljs$core$IFn$_invoke$arity$16 ? v.cljs$core$IFn$_invoke$arity$16(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : v.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); + }, v = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { + a = this; + var v; + v = a.dispatch_fn.cljs$core$IFn$_invoke$arity$17 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$17(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); + var w = this.cljs$core$IMultiFn$_get_method$arity$2(null, v); + cljs.core.truth_(w) || cljs.core.throw_no_method_error(a.name, v); + return w.cljs$core$IFn$_invoke$arity$17 ? w.cljs$core$IFn$_invoke$arity$17(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : w.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); + }, w = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { + a = this; + var w; + w = a.dispatch_fn.cljs$core$IFn$_invoke$arity$18 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$18(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); + var y = this.cljs$core$IMultiFn$_get_method$arity$2(null, w); + cljs.core.truth_(y) || cljs.core.throw_no_method_error(a.name, w); + return y.cljs$core$IFn$_invoke$arity$18 ? y.cljs$core$IFn$_invoke$arity$18(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : y.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); + }, y = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { + a = this; + var y; + y = a.dispatch_fn.cljs$core$IFn$_invoke$arity$19 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$19(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); + var F = this.cljs$core$IMultiFn$_get_method$arity$2(null, y); + cljs.core.truth_(F) || cljs.core.throw_no_method_error(a.name, y); + return F.cljs$core$IFn$_invoke$arity$19 ? F.cljs$core$IFn$_invoke$arity$19(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : F.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); + }, F = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { + a = this; + var F; + F = a.dispatch_fn.cljs$core$IFn$_invoke$arity$20 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$20(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); + var L = this.cljs$core$IMultiFn$_get_method$arity$2(null, F); + cljs.core.truth_(L) || cljs.core.throw_no_method_error(a.name, F); + return L.cljs$core$IFn$_invoke$arity$20 ? L.cljs$core$IFn$_invoke$arity$20(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : L.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); + }, L = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, F) { + a = this; + var L = cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a.dispatch_fn, b, c, d, e, cljs.core.array_seq([f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, F], 0)), V = this.cljs$core$IMultiFn$_get_method$arity$2(null, L); + cljs.core.truth_(V) || cljs.core.throw_no_method_error(a.name, L); + return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(V, b, c, d, e, cljs.core.array_seq([f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, F], 0)); + }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { + switch(arguments.length) { + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, x); + case 3: + return d.call(this, a, x, z); + case 4: + return e.call(this, a, x, z, A); + case 5: + return f.call(this, a, x, z, A, B); + case 6: + return g.call(this, a, x, z, A, B, C); + case 7: + return h.call(this, a, x, z, A, B, C, D); + case 8: + return k.call(this, a, x, z, A, B, C, D, E); + case 9: + return l.call(this, a, x, z, A, B, C, D, E, G); + case 10: + return m.call(this, a, x, z, A, B, C, D, E, G, H); + case 11: + return n.call(this, a, x, z, A, B, C, D, E, G, H, I); + case 12: + return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); + case 13: + return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); + case 14: + return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); + case 15: + return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); + case 16: + return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); + case 17: + return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); + case 18: + return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); + case 19: + return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); + case 20: + return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); + case 21: + return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); + case 22: + return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); + } + throw Error("Invalid arity: " + arguments.length); }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$3 = d; + a.cljs$core$IFn$_invoke$arity$4 = e; + a.cljs$core$IFn$_invoke$arity$5 = f; + a.cljs$core$IFn$_invoke$arity$6 = g; + a.cljs$core$IFn$_invoke$arity$7 = h; + a.cljs$core$IFn$_invoke$arity$8 = k; + a.cljs$core$IFn$_invoke$arity$9 = l; + a.cljs$core$IFn$_invoke$arity$10 = m; + a.cljs$core$IFn$_invoke$arity$11 = n; + a.cljs$core$IFn$_invoke$arity$12 = p; + a.cljs$core$IFn$_invoke$arity$13 = q; + a.cljs$core$IFn$_invoke$arity$14 = r; + a.cljs$core$IFn$_invoke$arity$15 = s; + a.cljs$core$IFn$_invoke$arity$16 = t; + a.cljs$core$IFn$_invoke$arity$17 = u; + a.cljs$core$IFn$_invoke$arity$18 = v; + a.cljs$core$IFn$_invoke$arity$19 = w; + a.cljs$core$IFn$_invoke$arity$20 = y; + a.cljs$core$IFn$_invoke$arity$21 = F; + a.cljs$core$IFn$_invoke$arity$22 = L; + return a; }(); cljs.core.MultiFn.prototype.apply = function(a, b) { - return cljs.core._dispatch.call(null, this, b) + return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$0 = function() { + var a = this.dispatch_fn.cljs$core$IFn$_invoke$arity$0 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$0() : this.dispatch_fn.call(null), b = this.cljs$core$IMultiFn$_get_method$arity$2(null, a); + cljs.core.truth_(b) || cljs.core.throw_no_method_error(this.name, a); + return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + var b; + b = this.dispatch_fn.cljs$core$IFn$_invoke$arity$1 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$1(a) : this.dispatch_fn.call(null, a); + var c = this.cljs$core$IMultiFn$_get_method$arity$2(null, b); + cljs.core.truth_(c) || cljs.core.throw_no_method_error(this.name, b); + return c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(a) : c.call(null, a); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + var c; + c = this.dispatch_fn.cljs$core$IFn$_invoke$arity$2 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$2(a, b) : this.dispatch_fn.call(null, a, b); + var d = this.cljs$core$IMultiFn$_get_method$arity$2(null, c); + cljs.core.truth_(d) || cljs.core.throw_no_method_error(this.name, c); + return d.cljs$core$IFn$_invoke$arity$2 ? d.cljs$core$IFn$_invoke$arity$2(a, b) : d.call(null, a, b); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$3 = function(a, b, c) { + var d; + d = this.dispatch_fn.cljs$core$IFn$_invoke$arity$3 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$3(a, b, c) : this.dispatch_fn.call(null, a, b, c); + var e = this.cljs$core$IMultiFn$_get_method$arity$2(null, d); + cljs.core.truth_(e) || cljs.core.throw_no_method_error(this.name, d); + return e.cljs$core$IFn$_invoke$arity$3 ? e.cljs$core$IFn$_invoke$arity$3(a, b, c) : e.call(null, a, b, c); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$4 = function(a, b, c, d) { + var e; + e = this.dispatch_fn.cljs$core$IFn$_invoke$arity$4 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : this.dispatch_fn.call(null, a, b, c, d); + var f = this.cljs$core$IMultiFn$_get_method$arity$2(null, e); + cljs.core.truth_(f) || cljs.core.throw_no_method_error(this.name, e); + return f.cljs$core$IFn$_invoke$arity$4 ? f.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : f.call(null, a, b, c, d); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$5 = function(a, b, c, d, e) { + var f; + f = this.dispatch_fn.cljs$core$IFn$_invoke$arity$5 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) : this.dispatch_fn.call(null, a, b, c, d, e); + var g = this.cljs$core$IMultiFn$_get_method$arity$2(null, f); + cljs.core.truth_(g) || cljs.core.throw_no_method_error(this.name, f); + return g.cljs$core$IFn$_invoke$arity$5 ? g.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) : g.call(null, a, b, c, d, e); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$6 = function(a, b, c, d, e, f) { + var g; + g = this.dispatch_fn.cljs$core$IFn$_invoke$arity$6 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) : this.dispatch_fn.call(null, a, b, c, d, e, f); + var h = this.cljs$core$IMultiFn$_get_method$arity$2(null, g); + cljs.core.truth_(h) || cljs.core.throw_no_method_error(this.name, g); + return h.cljs$core$IFn$_invoke$arity$6 ? h.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) : h.call(null, a, b, c, d, e, f); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$7 = function(a, b, c, d, e, f, g) { + var h; + h = this.dispatch_fn.cljs$core$IFn$_invoke$arity$7 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) : this.dispatch_fn.call(null, a, b, c, d, e, f, g); + var k = this.cljs$core$IMultiFn$_get_method$arity$2(null, h); + cljs.core.truth_(k) || cljs.core.throw_no_method_error(this.name, h); + return k.cljs$core$IFn$_invoke$arity$7 ? k.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) : k.call(null, a, b, c, d, e, f, g); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$8 = function(a, b, c, d, e, f, g, h) { + var k; + k = this.dispatch_fn.cljs$core$IFn$_invoke$arity$8 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h); + var l = this.cljs$core$IMultiFn$_get_method$arity$2(null, k); + cljs.core.truth_(l) || cljs.core.throw_no_method_error(this.name, k); + return l.cljs$core$IFn$_invoke$arity$8 ? l.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) : l.call(null, a, b, c, d, e, f, g, h); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$9 = function(a, b, c, d, e, f, g, h, k) { + var l; + l = this.dispatch_fn.cljs$core$IFn$_invoke$arity$9 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k); + var m = this.cljs$core$IMultiFn$_get_method$arity$2(null, l); + cljs.core.truth_(m) || cljs.core.throw_no_method_error(this.name, l); + return m.cljs$core$IFn$_invoke$arity$9 ? m.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) : m.call(null, a, b, c, d, e, f, g, h, k); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$10 = function(a, b, c, d, e, f, g, h, k, l) { + var m; + m = this.dispatch_fn.cljs$core$IFn$_invoke$arity$10 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l); + var n = this.cljs$core$IMultiFn$_get_method$arity$2(null, m); + cljs.core.truth_(n) || cljs.core.throw_no_method_error(this.name, m); + return n.cljs$core$IFn$_invoke$arity$10 ? n.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) : n.call(null, a, b, c, d, e, f, g, h, k, l); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$11 = function(a, b, c, d, e, f, g, h, k, l, m) { + var n; + n = this.dispatch_fn.cljs$core$IFn$_invoke$arity$11 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m); + var p = this.cljs$core$IMultiFn$_get_method$arity$2(null, n); + cljs.core.truth_(p) || cljs.core.throw_no_method_error(this.name, n); + return p.cljs$core$IFn$_invoke$arity$11 ? p.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) : p.call(null, a, b, c, d, e, f, g, h, k, l, m); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$12 = function(a, b, c, d, e, f, g, h, k, l, m, n) { + var p; + p = this.dispatch_fn.cljs$core$IFn$_invoke$arity$12 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n); + var q = this.cljs$core$IMultiFn$_get_method$arity$2(null, p); + cljs.core.truth_(q) || cljs.core.throw_no_method_error(this.name, p); + return q.cljs$core$IFn$_invoke$arity$12 ? q.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) : q.call(null, a, b, c, d, e, f, g, h, k, l, m, n); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$13 = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { + var q; + q = this.dispatch_fn.cljs$core$IFn$_invoke$arity$13 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); + var r = this.cljs$core$IMultiFn$_get_method$arity$2(null, q); + cljs.core.truth_(r) || cljs.core.throw_no_method_error(this.name, q); + return r.cljs$core$IFn$_invoke$arity$13 ? r.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) : r.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$14 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { + var r; + r = this.dispatch_fn.cljs$core$IFn$_invoke$arity$14 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); + var s = this.cljs$core$IMultiFn$_get_method$arity$2(null, r); + cljs.core.truth_(s) || cljs.core.throw_no_method_error(this.name, r); + return s.cljs$core$IFn$_invoke$arity$14 ? s.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) : s.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$15 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { + var s; + s = this.dispatch_fn.cljs$core$IFn$_invoke$arity$15 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); + var t = this.cljs$core$IMultiFn$_get_method$arity$2(null, s); + cljs.core.truth_(t) || cljs.core.throw_no_method_error(this.name, s); + return t.cljs$core$IFn$_invoke$arity$15 ? t.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) : t.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$16 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { + var t; + t = this.dispatch_fn.cljs$core$IFn$_invoke$arity$16 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); + var u = this.cljs$core$IMultiFn$_get_method$arity$2(null, t); + cljs.core.truth_(u) || cljs.core.throw_no_method_error(this.name, t); + return u.cljs$core$IFn$_invoke$arity$16 ? u.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : u.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$17 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { + var u; + u = this.dispatch_fn.cljs$core$IFn$_invoke$arity$17 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); + var v = this.cljs$core$IMultiFn$_get_method$arity$2(null, u); + cljs.core.truth_(v) || cljs.core.throw_no_method_error(this.name, u); + return v.cljs$core$IFn$_invoke$arity$17 ? v.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : v.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$18 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { + var v; + v = this.dispatch_fn.cljs$core$IFn$_invoke$arity$18 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); + var w = this.cljs$core$IMultiFn$_get_method$arity$2(null, v); + cljs.core.truth_(w) || cljs.core.throw_no_method_error(this.name, v); + return w.cljs$core$IFn$_invoke$arity$18 ? w.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : w.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$19 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { + var w; + w = this.dispatch_fn.cljs$core$IFn$_invoke$arity$19 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); + var y = this.cljs$core$IMultiFn$_get_method$arity$2(null, w); + cljs.core.truth_(y) || cljs.core.throw_no_method_error(this.name, w); + return y.cljs$core$IFn$_invoke$arity$19 ? y.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : y.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$20 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { + var y; + y = this.dispatch_fn.cljs$core$IFn$_invoke$arity$20 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); + var F = this.cljs$core$IMultiFn$_get_method$arity$2(null, y); + cljs.core.truth_(F) || cljs.core.throw_no_method_error(this.name, y); + return F.cljs$core$IFn$_invoke$arity$20 ? F.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : F.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); +}; +cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$21 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { + var F = cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(this.dispatch_fn, a, b, c, d, cljs.core.array_seq([e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y], 0)), L = this.cljs$core$IMultiFn$_get_method$arity$2(null, F); + cljs.core.truth_(L) || cljs.core.throw_no_method_error(this.name, F); + return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(L, a, b, c, d, cljs.core.array_seq([e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y], 0)); +}; +cljs.core.MultiFn.cljs$lang$type = !0; +cljs.core.MultiFn.cljs$lang$ctorStr = "cljs.core/MultiFn"; +cljs.core.MultiFn.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/MultiFn"); +}; +cljs.core.__GT_MultiFn = function(a, b, c, d, e, f, g, h) { + return new cljs.core.MultiFn(a, b, c, d, e, f, g, h); }; cljs.core.remove_all_methods = function(a) { - return cljs.core._reset.call(null, a) + return cljs.core._reset(a); }; cljs.core.remove_method = function(a, b) { - return cljs.core._remove_method.call(null, a, b) + return cljs.core._remove_method(a, b); }; cljs.core.prefer_method = function(a, b, c) { - return cljs.core._prefer_method.call(null, a, b, c) + return cljs.core._prefer_method(a, b, c); }; cljs.core.methods$ = function(a) { - return cljs.core._methods.call(null, a) + return cljs.core._methods(a); }; cljs.core.get_method = function(a, b) { - return cljs.core._get_method.call(null, a, b) + return cljs.core._get_method(a, b); }; cljs.core.prefers = function(a) { - return cljs.core._prefers.call(null, a) + return cljs.core._prefers(a); }; cljs.core.UUID = function(a) { this.uuid = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2153775104 -}; -cljs.core.UUID.cljs$lang$type = !0; -cljs.core.UUID.cljs$lang$ctorStr = "cljs.core/UUID"; -cljs.core.UUID.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/UUID") + this.cljs$lang$protocol_mask$partition0$ = 2153775104; }; cljs.core.UUID.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.string.hashCode(cljs.core.pr_str.call(null, this)) + a = cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([this], 0)); + return goog.string.hashCode(a); }; cljs.core.UUID.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, [cljs.core.str('#uuid "'), cljs.core.str(this.uuid), cljs.core.str('"')].join("")) + return cljs.core._write(b, [cljs.core.str('#uuid "'), cljs.core.str(this.uuid), cljs.core.str('"')].join("")); }; cljs.core.UUID.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.UUID && this.uuid === b.uuid + return b instanceof cljs.core.UUID && this.uuid === b.uuid; +}; +cljs.core.UUID.prototype.toString = function() { + return this.uuid; +}; +cljs.core.UUID.prototype.equiv = function(a) { + return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +}; +cljs.core.UUID.cljs$lang$type = !0; +cljs.core.UUID.cljs$lang$ctorStr = "cljs.core/UUID"; +cljs.core.UUID.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write(b, "cljs.core/UUID"); }; cljs.core.__GT_UUID = function(a) { - return new cljs.core.UUID(a) + return new cljs.core.UUID(a); }; cljs.core.ExceptionInfo = function(a, b, c) { this.message = a; this.data = b; - this.cause = c + this.cause = c; }; cljs.core.ExceptionInfo.cljs$lang$type = !0; cljs.core.ExceptionInfo.cljs$lang$ctorStr = "cljs.core/ExceptionInfo"; cljs.core.ExceptionInfo.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ExceptionInfo") + return cljs.core._write(b, "cljs.core/ExceptionInfo"); }; cljs.core.__GT_ExceptionInfo = function(a, b, c) { - return new cljs.core.ExceptionInfo(a, b, c) + return new cljs.core.ExceptionInfo(a, b, c); +}; +cljs.core.pr_writer_ex_info = function(a, b, c) { + cljs.core._write(b, "#ExceptionInfo{:message "); + cljs.core.pr_writer(a.message, b, c); + cljs.core.truth_(a.data) && (cljs.core._write(b, ", :data "), cljs.core.pr_writer(a.data, b, c)); + cljs.core.truth_(a.cause) && (cljs.core._write(b, ", :cause "), cljs.core.pr_writer(a.cause, b, c)); + return cljs.core._write(b, "}"); }; -cljs.core.ExceptionInfo.prototype = Error(); -cljs.core.ExceptionInfo.prototype.constructor = cljs.core.ExceptionInfo; cljs.core.ex_info = function() { - var a = null, b = function(a, b) { - return new cljs.core.ExceptionInfo(a, b, null) + var a = null, b = function(b, c) { + return a.cljs$core$IFn$_invoke$arity$3(b, c, null); }, c = function(a, b, c) { - return new cljs.core.ExceptionInfo(a, b, c) + cljs.core.ExceptionInfo.prototype = Error(a); + cljs.core.ExceptionInfo.prototype.name = "ExceptionInfo"; + cljs.core.ExceptionInfo.prototype.constructor = cljs.core.ExceptionInfo; + cljs.core.ExceptionInfo.prototype.toString = cljs.core.pr_str_STAR_; + cljs.core.ExceptionInfo.prototype.cljs$core$IPrintWithWriter$ = !0; + cljs.core.ExceptionInfo.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_writer_ex_info(this, b, c); + }; + return new cljs.core.ExceptionInfo(a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.ex_data = function(a) { - return a instanceof cljs.core.ExceptionInfo ? a.data : null + return a instanceof cljs.core.ExceptionInfo ? a.data : null; }; cljs.core.ex_message = function(a) { - return a instanceof Error ? a.message : null + return a instanceof Error ? a.message : null; }; cljs.core.ex_cause = function(a) { - return a instanceof cljs.core.ExceptionInfo ? a.cause : null + return a instanceof cljs.core.ExceptionInfo ? a.cause : null; }; cljs.core.comparator = function(a) { return function(b, c) { - return cljs.core.truth_(a.call(null, b, c)) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null - } -}; -cljs.core.special_symbol_QMARK_ = function(a) { - return cljs.core.contains_QMARK_.call(null, new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 19, [new cljs.core.Symbol(null, "deftype*", "deftype*", -978581244, null), null, new cljs.core.Symbol(null, "new", "new", -1640422567, null), null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null), null, new cljs.core.Symbol(null, "\x26", "\x26", -1640531489, null), null, new cljs.core.Symbol(null, "set!", "set!", -1637004872, null), null, new cljs.core.Symbol(null, - "recur", "recur", -1532142362, null), null, new cljs.core.Symbol(null, ".", ".", -1640531481, null), null, new cljs.core.Symbol(null, "ns", "ns", -1640528002, null), null, new cljs.core.Symbol(null, "do", "do", -1640528316, null), null, new cljs.core.Symbol(null, "fn*", "fn*", -1640430053, null), null, new cljs.core.Symbol(null, "throw", "throw", -1530191713, null), null, new cljs.core.Symbol(null, "letfn*", "letfn*", 1548249632, null), null, new cljs.core.Symbol(null, "js*", "js*", -1640426054, - null), null, new cljs.core.Symbol(null, "defrecord*", "defrecord*", 774272013, null), null, new cljs.core.Symbol(null, "let*", "let*", -1637213400, null), null, new cljs.core.Symbol(null, "loop*", "loop*", -1537374273, null), null, new cljs.core.Symbol(null, "try", "try", -1640416396, null), null, new cljs.core.Symbol(null, "if", "if", -1640528170, null), null, new cljs.core.Symbol(null, "def", "def", -1640432194, null), null], null), null), a) -}; -var clojure = {walk:{}}; -clojure.walk.walk = function(a, b, c) { - return cljs.core.seq_QMARK_.call(null, c) ? b.call(null, cljs.core.doall.call(null, cljs.core.map.call(null, a, c))) : cljs.core.coll_QMARK_.call(null, c) ? b.call(null, cljs.core.into.call(null, cljs.core.empty.call(null, c), cljs.core.map.call(null, a, c))) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b.call(null, c) : null -}; -clojure.walk.postwalk = function postwalk(b, c) { - return clojure.walk.walk.call(null, cljs.core.partial.call(null, postwalk, b), b, c) -}; -clojure.walk.prewalk = function prewalk(b, c) { - return clojure.walk.walk.call(null, cljs.core.partial.call(null, prewalk, b), cljs.core.identity, b.call(null, c)) -}; -clojure.walk.keywordize_keys = function(a) { - var b = function(a) { - var b = cljs.core.nth.call(null, a, 0, null); - a = cljs.core.nth.call(null, a, 1, null); - return"string" === typeof b ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null) - }; - return clojure.walk.postwalk.call(null, function(a) { - return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a - }, a) -}; -clojure.walk.stringify_keys = function(a) { - var b = function(a) { - var b = cljs.core.nth.call(null, a, 0, null); - a = cljs.core.nth.call(null, a, 1, null); - return b instanceof cljs.core.Keyword ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null) + return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c)) ? -1 : cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, b) : a.call(null, c, b)) ? 1 : 0; }; - return clojure.walk.postwalk.call(null, function(a) { - return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a - }, a) }; -clojure.walk.prewalk_replace = function(a, b) { - return clojure.walk.prewalk.call(null, function(b) { - return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b - }, b) +cljs.core.special_symbol_QMARK_ = function(a) { + return cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 19, [new cljs.core.Symbol(null, "\x26", "\x26", -2144855648, null), null, new cljs.core.Symbol(null, "defrecord*", "defrecord*", -1936366207, null), null, new cljs.core.Symbol(null, "try", "try", -1273693247, null), null, new cljs.core.Symbol(null, "loop*", "loop*", 615029416, null), null, new cljs.core.Symbol(null, "do", "do", 1686842252, null), null, new cljs.core.Symbol(null, "letfn*", + "letfn*", -110097810, null), null, new cljs.core.Symbol(null, "if", "if", 1181717262, null), null, new cljs.core.Symbol(null, "new", "new", -444906321, null), null, new cljs.core.Symbol(null, "ns", "ns", 2082130287, null), null, new cljs.core.Symbol(null, "deftype*", "deftype*", 962659890, null), null, new cljs.core.Symbol(null, "let*", "let*", 1920721458, null), null, new cljs.core.Symbol(null, "js*", "js*", -1134233646, null), null, new cljs.core.Symbol(null, "fn*", "fn*", -752876845, null), + null, new cljs.core.Symbol(null, "recur", "recur", 1202958259, null), null, new cljs.core.Symbol(null, "set!", "set!", 250714521, null), null, new cljs.core.Symbol(null, ".", ".", 1975675962, null), null, new cljs.core.Symbol(null, "quote", "quote", 1377916282, null), null, new cljs.core.Symbol(null, "throw", "throw", 595905694, null), null, new cljs.core.Symbol(null, "def", "def", 597100991, null), null], null), null), a); }; -clojure.walk.postwalk_replace = function(a, b) { - return clojure.walk.postwalk.call(null, function(b) { - return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b - }, b) +cljs.core.test = function(a) { + a = a.cljs$lang$test; + return cljs.core.truth_(a) ? (a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), new cljs.core.Keyword(null, "ok", "ok", 967785236)) : new cljs.core.Keyword(null, "no-test", "no-test", -1679482642); }; -clojure.string = {}; +var clojure = {string:{}}; clojure.string.seq_reverse = function(a) { - return cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a) + return cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a); }; +clojure.string.re_surrogate_pair = RegExp("([\\uD800-\\uDBFF])([\\uDC00-\\uDFFF])", "g"); clojure.string.reverse = function(a) { - return a.split("").reverse().join("") + return a.replace(clojure.string.re_surrogate_pair, "$2$1").split("").reverse().join(""); }; clojure.string.replace = function(a, b, c) { - if("string" === typeof b) { - return a.replace(RegExp(goog.string.regExpEscape(b), "g"), c) - } - if(cljs.core.truth_(b.hasOwnProperty("source"))) { - return a.replace(RegExp(b.source, "g"), c) + if ("string" === typeof b) { + return a.replace(new RegExp(goog.string.regExpEscape(b), "g"), c); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - throw[cljs.core.str("Invalid match arg: "), cljs.core.str(b)].join(""); + if (cljs.core.truth_(b.hasOwnProperty("source"))) { + return a.replace(new RegExp(b.source, "g"), c); } - return null + throw[cljs.core.str("Invalid match arg: "), cljs.core.str(b)].join(""); }; clojure.string.replace_first = function(a, b, c) { - return a.replace(b, c) + return a.replace(b, c); }; clojure.string.join = function() { var a = null, b = function(a) { - return cljs.core.apply.call(null, cljs.core.str, a) + var b = new goog.string.StringBuffer; + for (a = cljs.core.seq.call(null, a);;) { + if (a) { + b = b.append("" + cljs.core.str(cljs.core.first.call(null, a))), a = cljs.core.next.call(null, a); + } else { + return b.toString(); + } + } }, c = function(a, b) { - return cljs.core.apply.call(null, cljs.core.str, cljs.core.interpose.call(null, a, b)) + for (var c = new goog.string.StringBuffer, g = cljs.core.seq.call(null, b);;) { + if (g) { + c.append("" + cljs.core.str(cljs.core.first.call(null, g))), g = cljs.core.next.call(null, g), null != g && c.append(a); + } else { + return c.toString(); + } + } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); clojure.string.upper_case = function(a) { - return a.toUpperCase() + return a.toUpperCase(); }; clojure.string.lower_case = function(a) { - return a.toLowerCase() + return a.toLowerCase(); }; clojure.string.capitalize = function(a) { - return 2 > cljs.core.count.call(null, a) ? clojure.string.upper_case.call(null, a) : [cljs.core.str(clojure.string.upper_case.call(null, cljs.core.subs.call(null, a, 0, 1))), cljs.core.str(clojure.string.lower_case.call(null, cljs.core.subs.call(null, a, 1)))].join("") + return 2 > cljs.core.count.call(null, a) ? clojure.string.upper_case.call(null, a) : [cljs.core.str(clojure.string.upper_case.call(null, cljs.core.subs.call(null, a, 0, 1))), cljs.core.str(clojure.string.lower_case.call(null, cljs.core.subs.call(null, a, 1)))].join(""); }; clojure.string.pop_last_while_empty = function(a) { - for(;;) { - if(cljs.core._EQ_.call(null, "", cljs.core.peek.call(null, a))) { - a = cljs.core.pop.call(null, a) - }else { - return a + for (;;) { + if (cljs.core._EQ_.call(null, "", cljs.core.peek.call(null, a))) { + a = cljs.core.pop.call(null, a); + } else { + return a; } } }; clojure.string.discard_trailing_if_needed = function(a, b) { - return cljs.core._EQ_.call(null, 0, a) ? clojure.string.pop_last_while_empty.call(null, b) : b + return cljs.core._EQ_.call(null, 0, a) ? clojure.string.pop_last_while_empty.call(null, b) : b; }; clojure.string.split_with_empty_regex = function(a, b) { - if(0 >= b || b >= 2 + cljs.core.count.call(null, a)) { - return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a)))), "") + if (0 >= b || b >= 2 + cljs.core.count.call(null, a)) { + return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a)))), ""); } var c = cljs.core._EQ_; - if(cljs.core.truth_(c.call(null, 1, b))) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a], null) + if (cljs.core.truth_(c.call(null, 1, b))) { + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a], null); } - if(cljs.core.truth_(c.call(null, 2, b))) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["", a], null) + if (cljs.core.truth_(c.call(null, 2, b))) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["", a], null); } c = b - 2; - return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.subvec.call(null, cljs.core.vec.call(null, cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a))), 0, c))), cljs.core.subs.call(null, a, c)) + return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.subvec.call(null, cljs.core.vec.call(null, cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a))), 0, c))), cljs.core.subs.call(null, a, c)); }; clojure.string.split = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, 0) + return a.call(null, b, c, 0); }, c = function(a, b, c) { return clojure.string.discard_trailing_if_needed.call(null, c, cljs.core._EQ_.call(null, "" + cljs.core.str(b), "/(?:)/") ? clojure.string.split_with_empty_regex.call(null, a, c) : 1 > c ? cljs.core.vec.call(null, ("" + cljs.core.str(a)).split(b)) : function() { - for(var g = a, h = c, k = cljs.core.PersistentVector.EMPTY;;) { - if(cljs.core._EQ_.call(null, h, 1)) { - return cljs.core.conj.call(null, k, g) + for (var g = a, h = c, k = cljs.core.PersistentVector.EMPTY;;) { + if (cljs.core._EQ_.call(null, h, 1)) { + return cljs.core.conj.call(null, k, g); } var l = cljs.core.re_find.call(null, b, g); - if(cljs.core.truth_(l)) { + if (cljs.core.truth_(l)) { var m = l, l = g.indexOf(m), m = g.substring(l + cljs.core.count.call(null, m)), h = h - 1, k = cljs.core.conj.call(null, k, g.substring(0, l)), g = m - }else { - return cljs.core.conj.call(null, k, g) + } else { + return cljs.core.conj.call(null, k, g); } } - }()) + }()); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); clojure.string.split_lines = function(a) { - return clojure.string.split.call(null, a, /\n|\r\n/) + return clojure.string.split.call(null, a, /\n|\r\n/); }; clojure.string.trim = function(a) { - return goog.string.trim(a) + return goog.string.trim(a); }; clojure.string.triml = function(a) { - return goog.string.trimLeft(a) + return goog.string.trimLeft(a); }; clojure.string.trimr = function(a) { - return goog.string.trimRight(a) + return goog.string.trimRight(a); }; clojure.string.trim_newline = function(a) { - for(var b = a.length;;) { - if(0 === b) { - return"" + for (var b = a.length;;) { + if (0 === b) { + return ""; } var c = cljs.core.get.call(null, a, b - 1); - if(cljs.core._EQ_.call(null, c, "\n") || cljs.core._EQ_.call(null, c, "\r")) { - b -= 1 - }else { - return a.substring(0, b) + if (cljs.core._EQ_.call(null, c, "\n") || cljs.core._EQ_.call(null, c, "\r")) { + b -= 1; + } else { + return a.substring(0, b); } } }; clojure.string.blank_QMARK_ = function(a) { - return goog.string.isEmptySafe(a) + return goog.string.isEmptySafe(a); }; clojure.string.escape = function(a, b) { - for(var c = new goog.string.StringBuffer, d = a.length, e = 0;;) { - if(cljs.core._EQ_.call(null, d, e)) { - return c.toString() + for (var c = new goog.string.StringBuffer, d = a.length, e = 0;;) { + if (cljs.core._EQ_.call(null, d, e)) { + return c.toString(); } var f = a.charAt(e), g = cljs.core.get.call(null, b, f); cljs.core.truth_(g) ? c.append("" + cljs.core.str(g)) : c.append(f); - e += 1 + e += 1; } }; cljs.reader = {}; cljs.reader.PushbackReader = function() { - return{} + return{}; }(); cljs.reader.read_char = function(a) { - if(a ? a.cljs$reader$PushbackReader$read_char$arity$1 : a) { - return a.cljs$reader$PushbackReader$read_char$arity$1(a) + if (a ? a.cljs$reader$PushbackReader$read_char$arity$1 : a) { + return a.cljs$reader$PushbackReader$read_char$arity$1(a); } var b; b = cljs.reader.read_char[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.reader.read_char._, !b)) { + if (!b && (b = cljs.reader.read_char._, !b)) { throw cljs.core.missing_protocol.call(null, "PushbackReader.read-char", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.reader.unread = function(a, b) { - if(a ? a.cljs$reader$PushbackReader$unread$arity$2 : a) { - return a.cljs$reader$PushbackReader$unread$arity$2(a, b) + if (a ? a.cljs$reader$PushbackReader$unread$arity$2 : a) { + return a.cljs$reader$PushbackReader$unread$arity$2(a, b); } var c; c = cljs.reader.unread[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.reader.unread._, !c)) { + if (!c && (c = cljs.reader.unread._, !c)) { throw cljs.core.missing_protocol.call(null, "PushbackReader.unread", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.reader.StringPushbackReader = function(a, b, c) { this.s = a; this.buffer = b; - this.idx = c -}; -cljs.reader.StringPushbackReader.cljs$lang$type = !0; -cljs.reader.StringPushbackReader.cljs$lang$ctorStr = "cljs.reader/StringPushbackReader"; -cljs.reader.StringPushbackReader.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.reader/StringPushbackReader") + this.idx = c; }; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$ = !0; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$read_char$arity$1 = function(a) { - return 0 === this.buffer.length ? (this.idx += 1, this.s[this.idx]) : this.buffer.pop() + return 0 === this.buffer.length ? (this.idx += 1, this.s[this.idx]) : this.buffer.pop(); }; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$unread$arity$2 = function(a, b) { - return this.buffer.push(b) + return this.buffer.push(b); +}; +cljs.reader.StringPushbackReader.cljs$lang$type = !0; +cljs.reader.StringPushbackReader.cljs$lang$ctorStr = "cljs.reader/StringPushbackReader"; +cljs.reader.StringPushbackReader.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.reader/StringPushbackReader"); }; cljs.reader.__GT_StringPushbackReader = function(a, b, c) { - return new cljs.reader.StringPushbackReader(a, b, c) + return new cljs.reader.StringPushbackReader(a, b, c); }; cljs.reader.push_back_reader = function(a) { - return new cljs.reader.StringPushbackReader(a, [], -1) + return new cljs.reader.StringPushbackReader(a, [], -1); }; cljs.reader.whitespace_QMARK_ = function(a) { var b = goog.string.isBreakingWhitespace(a); - return cljs.core.truth_(b) ? b : "," === a + return cljs.core.truth_(b) ? b : "," === a; }; cljs.reader.numeric_QMARK_ = function(a) { - return goog.string.isNumeric(a) + return goog.string.isNumeric(a); }; cljs.reader.comment_prefix_QMARK_ = function(a) { - return";" === a + return ";" === a; }; cljs.reader.number_literal_QMARK_ = function(a, b) { return cljs.reader.numeric_QMARK_.call(null, b) || ("+" === b || "-" === b) && cljs.reader.numeric_QMARK_.call(null, function() { var b = cljs.reader.read_char.call(null, a); cljs.reader.unread.call(null, a, b); - return b - }()) + return b; + }()); }; cljs.reader.reader_error = function() { var a = function(a, b) { throw Error(cljs.core.apply.call(null, cljs.core.str, b)); }, b = function(b, d) { var e = null; - 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + if (1 < arguments.length) { + for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { + f[e] = arguments[e + 1], ++e; + } + e = new cljs.core.IndexedSeq(f, 0); + } + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.reader.macro_terminating_QMARK_ = function(a) { var b = "#" !== a; - return b && (b = "'" !== a) ? (b = ":" !== a) ? cljs.reader.macros.call(null, a) : b : b + return b && (b = "'" !== a) ? (b = ":" !== a) ? cljs.reader.macros.call(null, a) : b : b; }; cljs.reader.read_token = function(a, b) { - for(var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { - if(null == d || cljs.reader.whitespace_QMARK_.call(null, d) || cljs.reader.macro_terminating_QMARK_.call(null, d)) { - return cljs.reader.unread.call(null, a, d), c.toString() + for (var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { + if (null == d || cljs.reader.whitespace_QMARK_.call(null, d) || cljs.reader.macro_terminating_QMARK_.call(null, d)) { + return cljs.reader.unread.call(null, a, d), c.toString(); } c.append(d); - d = cljs.reader.read_char.call(null, a) + d = cljs.reader.read_char.call(null, a); } }; cljs.reader.skip_line = function(a, b) { - for(;;) { + for (;;) { var c = cljs.reader.read_char.call(null, a); - if("\n" === c || "\r" === c || null == c) { - return a + if ("\n" === c || "\r" === c || null == c) { + return a; } } }; -cljs.reader.int_pattern = cljs.core.re_pattern.call(null, "([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?"); -cljs.reader.ratio_pattern = cljs.core.re_pattern.call(null, "([-+]?[0-9]+)/([0-9]+)"); -cljs.reader.float_pattern = cljs.core.re_pattern.call(null, "([-+]?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?"); -cljs.reader.symbol_pattern = cljs.core.re_pattern.call(null, "[:]?([^0-9/].*/)?([^0-9/][^/]*)"); -cljs.reader.re_find_STAR_ = function(a, b) { +cljs.reader.int_pattern = cljs.core.re_pattern.call(null, "^([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+))(N)?$"); +cljs.reader.ratio_pattern = cljs.core.re_pattern.call(null, "^([-+]?[0-9]+)/([0-9]+)$"); +cljs.reader.float_pattern = cljs.core.re_pattern.call(null, "^([-+]?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?$"); +cljs.reader.symbol_pattern = cljs.core.re_pattern.call(null, "^[:]?([^0-9/].*/)?([^0-9/][^/]*)$"); +cljs.reader.re_matches_STAR_ = function(a, b) { var c = a.exec(b); - return null == c ? null : 1 === c.length ? c[0] : c + return null != c && c[0] === b ? 1 === c.length ? c[0] : c : null; }; cljs.reader.match_int = function(a) { - var b = cljs.reader.re_find_STAR_.call(null, cljs.reader.int_pattern, a); - a = b[2]; - if(null == a || 1 > a.length) { - a = "-" === b[1] ? -1 : 1; - var c = cljs.core.truth_(b[3]) ? [b[3], 10] : cljs.core.truth_(b[4]) ? [b[4], 16] : cljs.core.truth_(b[5]) ? [b[5], 8] : cljs.core.truth_(b[7]) ? [b[7], parseInt(b[7])] : new cljs.core.Keyword(null, "default", "default", 2558708147) ? [null, null] : null, b = c[0], c = c[1]; - return null == b ? null : a * parseInt(b, c) + a = cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a); + var b = a[2]; + if (null != (cljs.core._EQ_.call(null, b, "") ? null : b)) { + return 0; } - return 0 + var b = cljs.core.truth_(a[3]) ? [a[3], 10] : cljs.core.truth_(a[4]) ? [a[4], 16] : cljs.core.truth_(a[5]) ? [a[5], 8] : cljs.core.truth_(a[6]) ? [a[7], parseInt(a[6], 10)] : [null, null], c = b[0]; + if (null == c) { + return null; + } + b = parseInt(c, b[1]); + return "-" === a[1] ? -b : b; }; cljs.reader.match_ratio = function(a) { - a = cljs.reader.re_find_STAR_.call(null, cljs.reader.ratio_pattern, a); + a = cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a); var b = a[2]; - return parseInt(a[1]) / parseInt(b) + return parseInt(a[1], 10) / parseInt(b, 10); }; cljs.reader.match_float = function(a) { - return parseFloat(a) -}; -cljs.reader.re_matches_STAR_ = function(a, b) { - var c = a.exec(b); - return null != c && c[0] === b ? 1 === c.length ? c[0] : c : null + return parseFloat(a); }; cljs.reader.match_number = function(a) { - return cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a)) ? cljs.reader.match_int.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a)) ? cljs.reader.match_ratio.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.float_pattern, a)) ? cljs.reader.match_float.call(null, a) : null + return cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a)) ? cljs.reader.match_int.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a)) ? cljs.reader.match_ratio.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.float_pattern, a)) ? cljs.reader.match_float.call(null, a) : null; }; cljs.reader.escape_char_map = function(a) { - if("t" === a) { - return"\t" - } - if("r" === a) { - return"\r" - } - if("n" === a) { - return"\n" - } - if("\\" === a) { - return"\\" - } - if('"' === a) { - return'"' - } - if("b" === a) { - return"\b" - } - if("f" === a) { - return"\f" - } - new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return "t" === a ? "\t" : "r" === a ? "\r" : "n" === a ? "\n" : "\\" === a ? "\\" : '"' === a ? '"' : "b" === a ? "\b" : "f" === a ? "\f" : null; }; cljs.reader.read_2_chars = function(a) { - return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString() + return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString(); }; cljs.reader.read_4_chars = function(a) { - return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString() + return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString(); }; -cljs.reader.unicode_2_pattern = cljs.core.re_pattern.call(null, "[0-9A-Fa-f]{2}"); -cljs.reader.unicode_4_pattern = cljs.core.re_pattern.call(null, "[0-9A-Fa-f]{4}"); +cljs.reader.unicode_2_pattern = cljs.core.re_pattern.call(null, "^[0-9A-Fa-f]{2}$"); +cljs.reader.unicode_4_pattern = cljs.core.re_pattern.call(null, "^[0-9A-Fa-f]{4}$"); cljs.reader.validate_unicode_escape = function(a, b, c, d) { - return cljs.core.truth_(cljs.core.re_matches.call(null, a, d)) ? d : cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c, d) + return cljs.core.truth_(cljs.core.re_matches.call(null, a, d)) ? d : cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c, d); }; cljs.reader.make_unicode_char = function(a) { a = parseInt(a, 16); - return String.fromCharCode(a) + return String.fromCharCode(a); }; cljs.reader.escape_char = function(a, b) { var c = cljs.reader.read_char.call(null, b), d = cljs.reader.escape_char_map.call(null, c); - return cljs.core.truth_(d) ? d : "x" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_2_pattern, b, c, cljs.reader.read_2_chars.call(null, b))) : "u" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_4_pattern, b, c, cljs.reader.read_4_chars.call(null, b))) : cljs.reader.numeric_QMARK_.call(null, c) ? String.fromCharCode(c) : new cljs.core.Keyword(null, "else", "else", - 1017020587) ? cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c) : null + return cljs.core.truth_(d) ? d : "x" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_2_pattern, b, c, cljs.reader.read_2_chars.call(null, b))) : "u" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_4_pattern, b, c, cljs.reader.read_4_chars.call(null, b))) : cljs.reader.numeric_QMARK_.call(null, c) ? String.fromCharCode(c) : cljs.reader.reader_error.call(null, b, + "Unexpected unicode escape \\", c); }; cljs.reader.read_past = function(a, b) { - for(var c = cljs.reader.read_char.call(null, b);;) { - if(cljs.core.truth_(a.call(null, c))) { - c = cljs.reader.read_char.call(null, b) - }else { - return c + for (var c = cljs.reader.read_char.call(null, b);;) { + if (cljs.core.truth_(a.call(null, c))) { + c = cljs.reader.read_char.call(null, b); + } else { + return c; } } }; cljs.reader.read_delimited_list = function(a, b, c) { - for(var d = cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY);;) { + for (var d = cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY);;) { var e = cljs.reader.read_past.call(null, cljs.reader.whitespace_QMARK_, b); cljs.core.truth_(e) || cljs.reader.reader_error.call(null, b, "EOF while reading"); - if(a === e) { - return cljs.core.persistent_BANG_.call(null, d) + if (a === e) { + return cljs.core.persistent_BANG_.call(null, d); } var f = cljs.reader.macros.call(null, e); cljs.core.truth_(f) ? e = f.call(null, b, e) : (cljs.reader.unread.call(null, b, e), e = cljs.reader.read.call(null, b, !0, null, c)); - d = e === b ? d : cljs.core.conj_BANG_.call(null, d, e) + d = e === b ? d : cljs.core.conj_BANG_.call(null, d, e); } }; cljs.reader.not_implemented = function(a, b) { - return cljs.reader.reader_error.call(null, a, "Reader for ", b, " not implemented yet") + return cljs.reader.reader_error.call(null, a, "Reader for ", b, " not implemented yet"); }; cljs.reader.read_dispatch = function(a, b) { var c = cljs.reader.read_char.call(null, a), d = cljs.reader.dispatch_macros.call(null, c); - if(cljs.core.truth_(d)) { - return d.call(null, a, b) + if (cljs.core.truth_(d)) { + return d.call(null, a, b); } d = cljs.reader.maybe_read_tagged_type.call(null, a, c); - return cljs.core.truth_(d) ? d : cljs.reader.reader_error.call(null, a, "No dispatch macro for ", c) + return cljs.core.truth_(d) ? d : cljs.reader.reader_error.call(null, a, "No dispatch macro for ", c); }; cljs.reader.read_unmatched_delimiter = function(a, b) { - return cljs.reader.reader_error.call(null, a, "Unmached delimiter ", b) + return cljs.reader.reader_error.call(null, a, "Unmatched delimiter ", b); }; cljs.reader.read_list = function(a, b) { - return cljs.core.apply.call(null, cljs.core.list, cljs.reader.read_delimited_list.call(null, ")", a, !0)) + return cljs.core.apply.call(null, cljs.core.list, cljs.reader.read_delimited_list.call(null, ")", a, !0)); }; cljs.reader.read_comment = cljs.reader.skip_line; cljs.reader.read_vector = function(a, b) { - return cljs.reader.read_delimited_list.call(null, "]", a, !0) + return cljs.reader.read_delimited_list.call(null, "]", a, !0); }; cljs.reader.read_map = function(a, b) { var c = cljs.reader.read_delimited_list.call(null, "}", a, !0); cljs.core.odd_QMARK_.call(null, cljs.core.count.call(null, c)) && cljs.reader.reader_error.call(null, a, "Map literal must contain an even number of forms"); - return cljs.core.apply.call(null, cljs.core.hash_map, c) + return cljs.core.apply.call(null, cljs.core.hash_map, c); }; cljs.reader.read_number = function(a, b) { - for(var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { - if(cljs.core.truth_(function() { + for (var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { + if (cljs.core.truth_(function() { var a = null == d; - return a ? a : (a = cljs.reader.whitespace_QMARK_.call(null, d)) ? a : cljs.reader.macros.call(null, d) + return a ? a : (a = cljs.reader.whitespace_QMARK_.call(null, d)) ? a : cljs.reader.macros.call(null, d); }())) { cljs.reader.unread.call(null, a, d); var e = c.toString(), c = cljs.reader.match_number.call(null, e); - return cljs.core.truth_(c) ? c : cljs.reader.reader_error.call(null, a, "Invalid number format [", e, "]") + return cljs.core.truth_(c) ? c : cljs.reader.reader_error.call(null, a, "Invalid number format [", e, "]"); } c.append(d); - d = e = cljs.reader.read_char.call(null, a) + d = e = cljs.reader.read_char.call(null, a); } }; cljs.reader.read_string_STAR_ = function(a, b) { - for(var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { - if(null == d) { - return cljs.reader.reader_error.call(null, a, "EOF while reading") + for (var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { + if (null == d) { + return cljs.reader.reader_error.call(null, a, "EOF while reading"); + } + if ("\\" === d) { + c.append(cljs.reader.escape_char.call(null, c, a)); + } else { + if ('"' === d) { + return c.toString(); + } + c.append(d); } - if("\\" === d) { - c.append(cljs.reader.escape_char.call(null, c, a)), d = cljs.reader.read_char.call(null, a) - }else { - if('"' === d) { - return c.toString() + d = cljs.reader.read_char.call(null, a); + } +}; +cljs.reader.read_raw_string_STAR_ = function(a, b) { + for (var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { + if (null == d) { + return cljs.reader.reader_error.call(null, a, "EOF while reading"); + } + if ("\\" === d) { + c.append(d); + var e = cljs.reader.read_char.call(null, a); + if (null == e) { + return cljs.reader.reader_error.call(null, a, "EOF while reading"); } - if(new cljs.core.Keyword(null, "default", "default", 2558708147)) { - c.append(d), d = cljs.reader.read_char.call(null, a) - }else { - return null + var f = function() { + var a = c; + a.append(e); + return a; + }(), g = cljs.reader.read_char.call(null, a); + } else { + if ('"' === d) { + return c.toString(); } + f = function() { + var a = c; + a.append(d); + return a; + }(); + g = cljs.reader.read_char.call(null, a); } + c = f; + d = g; } }; cljs.reader.special_symbols = function(a, b) { - return"nil" === a ? null : "true" === a ? !0 : "false" === a ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null + return "nil" === a ? null : "true" === a ? !0 : "false" === a ? !1 : "/" === a ? new cljs.core.Symbol(null, "/", "/", -1371932971, null) : b; }; cljs.reader.read_symbol = function(a, b) { var c = cljs.reader.read_token.call(null, a, b); - return cljs.core.truth_(goog.string.contains(c, "/")) ? cljs.core.symbol.call(null, cljs.core.subs.call(null, c, 0, c.indexOf("/")), cljs.core.subs.call(null, c, c.indexOf("/") + 1, c.length)) : cljs.reader.special_symbols.call(null, c, cljs.core.symbol.call(null, c)) + return cljs.core.truth_(function() { + var a = goog.string.contains(c, "/"); + return cljs.core.truth_(a) ? 1 !== c.length : a; + }()) ? cljs.core.symbol.call(null, cljs.core.subs.call(null, c, 0, c.indexOf("/")), cljs.core.subs.call(null, c, c.indexOf("/") + 1, c.length)) : cljs.reader.special_symbols.call(null, c, cljs.core.symbol.call(null, c)); }; cljs.reader.read_keyword = function(a, b) { var c = cljs.reader.read_token.call(null, a, cljs.reader.read_char.call(null, a)), d = cljs.reader.re_matches_STAR_.call(null, cljs.reader.symbol_pattern, c), c = d[0], e = d[1], d = d[2]; - return void 0 !== e && ":/" === e.substring(e.length - 2, e.length) || ":" === d[d.length - 1] || -1 !== c.indexOf("::", 1) ? cljs.reader.reader_error.call(null, a, "Invalid token: ", c) : null != e && 0 < e.length ? cljs.core.keyword.call(null, e.substring(0, e.indexOf("/")), d) : cljs.core.keyword.call(null, c) + return void 0 !== e && ":/" === e.substring(e.length - 2, e.length) || ":" === d[d.length - 1] || -1 !== c.indexOf("::", 1) ? cljs.reader.reader_error.call(null, a, "Invalid token: ", c) : null != e && 0 < e.length ? cljs.core.keyword.call(null, e.substring(0, e.indexOf("/")), d) : cljs.core.keyword.call(null, c); }; cljs.reader.desugar_meta = function(a) { - return a instanceof cljs.core.Symbol ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : "string" === typeof a ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : a instanceof cljs.core.Keyword ? new cljs.core.PersistentArrayMap.fromArray([a, !0], !0, !1) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null + return a instanceof cljs.core.Symbol ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", -1290361223), a], null) : "string" === typeof a ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", -1290361223), a], null) : a instanceof cljs.core.Keyword ? new cljs.core.PersistentArrayMap.fromArray([a, !0], !0, !1) : a; }; cljs.reader.wrapping_reader = function(a) { return function(b, c) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.reader.read.call(null, b, !0, null, !0)), a) - } + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.reader.read.call(null, b, !0, null, !0)), a); + }; }; cljs.reader.throwing_reader = function(a) { return function(b, c) { - return cljs.reader.reader_error.call(null, b, a) - } + return cljs.reader.reader_error.call(null, b, a); + }; }; cljs.reader.read_meta = function(a, b) { var c = cljs.reader.desugar_meta.call(null, cljs.reader.read.call(null, a, !0, null, !0)); cljs.core.map_QMARK_.call(null, c) || cljs.reader.reader_error.call(null, a, "Metadata must be Symbol,Keyword,String or Map"); var d = cljs.reader.read.call(null, a, !0, null, !0); - return(d ? d.cljs$lang$protocol_mask$partition0$ & 262144 || d.cljs$core$IWithMeta$ || (d.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) ? cljs.core.with_meta.call(null, d, cljs.core.merge.call(null, cljs.core.meta.call(null, d), c)) : cljs.reader.reader_error.call(null, a, "Metadata can only be applied to IWithMetas") + return(d ? d.cljs$lang$protocol_mask$partition0$ & 262144 || d.cljs$core$IWithMeta$ || (d.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) ? cljs.core.with_meta.call(null, d, cljs.core.merge.call(null, cljs.core.meta.call(null, d), c)) : cljs.reader.reader_error.call(null, a, "Metadata can only be applied to IWithMetas"); }; cljs.reader.read_set = function(a, b) { - return cljs.core.set.call(null, cljs.reader.read_delimited_list.call(null, "}", a, !0)) + return cljs.core.set.call(null, cljs.reader.read_delimited_list.call(null, "}", a, !0)); }; cljs.reader.read_regex = function(a, b) { - return cljs.core.re_pattern.call(null, cljs.reader.read_string_STAR_.call(null, a, b)) + return cljs.core.re_pattern.call(null, cljs.reader.read_raw_string_STAR_.call(null, a, b)); }; cljs.reader.read_discard = function(a, b) { cljs.reader.read.call(null, a, !0, null, !0); - return a + return a; }; cljs.reader.macros = function(a) { - if('"' === a) { - return cljs.reader.read_string_STAR_ - } - if(":" === a) { - return cljs.reader.read_keyword - } - if(";" === a) { - return cljs.reader.read_comment - } - if("'" === a) { - return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null)) - } - if("@" === a) { - return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "deref", "deref", -1545057749, null)) - } - if("^" === a) { - return cljs.reader.read_meta - } - if("`" === a || "~" === a) { - return cljs.reader.not_implemented - } - if("(" === a) { - return cljs.reader.read_list - } - if(")" === a) { - return cljs.reader.read_unmatched_delimiter - } - if("[" === a) { - return cljs.reader.read_vector - } - if("]" === a) { - return cljs.reader.read_unmatched_delimiter - } - if("{" === a) { - return cljs.reader.read_map - } - if("}" === a) { - return cljs.reader.read_unmatched_delimiter - } - if("\\" === a) { - return cljs.reader.read_char - } - if("#" === a) { - return cljs.reader.read_dispatch - } - new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return'"' === a ? cljs.reader.read_string_STAR_ : ":" === a ? cljs.reader.read_keyword : ";" === a ? cljs.reader.read_comment : "'" === a ? cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "quote", "quote", 1377916282, null)) : "@" === a ? cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "deref", "deref", 1494944732, null)) : "^" === a ? cljs.reader.read_meta : "`" === a ? cljs.reader.not_implemented : "~" === a ? cljs.reader.not_implemented : "(" === a ? cljs.reader.read_list : + ")" === a ? cljs.reader.read_unmatched_delimiter : "[" === a ? cljs.reader.read_vector : "]" === a ? cljs.reader.read_unmatched_delimiter : "{" === a ? cljs.reader.read_map : "}" === a ? cljs.reader.read_unmatched_delimiter : "\\" === a ? cljs.reader.read_char : "#" === a ? cljs.reader.read_dispatch : null; }; cljs.reader.dispatch_macros = function(a) { - if("{" === a) { - return cljs.reader.read_set - } - if("\x3c" === a) { - return cljs.reader.throwing_reader.call(null, "Unreadable form") - } - if('"' === a) { - return cljs.reader.read_regex - } - if("!" === a) { - return cljs.reader.read_comment - } - if("_" === a) { - return cljs.reader.read_discard - } - new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return "{" === a ? cljs.reader.read_set : "\x3c" === a ? cljs.reader.throwing_reader.call(null, "Unreadable form") : '"' === a ? cljs.reader.read_regex : "!" === a ? cljs.reader.read_comment : "_" === a ? cljs.reader.read_discard : null; }; cljs.reader.read = function(a, b, c, d) { - for(;;) { + for (;;) { d = cljs.reader.read_char.call(null, a); - if(null == d) { - return cljs.core.truth_(b) ? cljs.reader.reader_error.call(null, a, "EOF while reading") : c - } - if(!cljs.reader.whitespace_QMARK_.call(null, d)) { - if(cljs.reader.comment_prefix_QMARK_.call(null, d)) { - a = cljs.reader.read_comment.call(null, a, d) - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - var e = cljs.reader.macros.call(null, d); - d = cljs.core.truth_(e) ? e.call(null, a, d) : cljs.reader.number_literal_QMARK_.call(null, a, d) ? cljs.reader.read_number.call(null, a, d) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.read_symbol.call(null, a, d) : null; - if(d !== a) { - return d - } - }else { - return null + if (null == d) { + return cljs.core.truth_(b) ? cljs.reader.reader_error.call(null, a, "EOF while reading") : c; + } + if (!cljs.reader.whitespace_QMARK_.call(null, d)) { + if (cljs.reader.comment_prefix_QMARK_.call(null, d)) { + a = cljs.reader.read_comment.call(null, a, d); + } else { + var e = cljs.reader.macros.call(null, d); + d = cljs.core.truth_(e) ? e.call(null, a, d) : cljs.reader.number_literal_QMARK_.call(null, a, d) ? cljs.reader.read_number.call(null, a, d) : cljs.reader.read_symbol.call(null, a, d); + if (d !== a) { + return d; } } } @@ -14209,134 +19909,218 @@ cljs.reader.read = function(a, b, c, d) { }; cljs.reader.read_string = function(a) { a = cljs.reader.push_back_reader.call(null, a); - return cljs.reader.read.call(null, a, !0, null, !1) + return cljs.reader.read.call(null, a, !1, null, !1); }; cljs.reader.zero_fill_right_and_truncate = function(a, b) { - if(cljs.core._EQ_.call(null, b, cljs.core.count.call(null, a))) { - return a + if (cljs.core._EQ_.call(null, b, cljs.core.count.call(null, a))) { + return a; } - if(b < cljs.core.count.call(null, a)) { - return cljs.core.subs.call(null, a, 0, b) + if (b < cljs.core.count.call(null, a)) { + return cljs.core.subs.call(null, a, 0, b); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - for(var c = new goog.string.StringBuffer(a);;) { - if(c.getLength() < b) { - c = c.append("0") - }else { - return c.toString() - } + for (var c = new goog.string.StringBuffer(a);;) { + if (c.getLength() < b) { + c = c.append("0"); + } else { + return c.toString(); } - }else { - return null } }; cljs.reader.divisible_QMARK_ = function(a, b) { - return 0 === cljs.core.mod.call(null, a, b) + return 0 === cljs.core.mod.call(null, a, b); }; cljs.reader.indivisible_QMARK_ = function(a, b) { - return!cljs.reader.divisible_QMARK_.call(null, a, b) + return!cljs.reader.divisible_QMARK_.call(null, a, b); }; cljs.reader.leap_year_QMARK_ = function(a) { - return cljs.reader.divisible_QMARK_.call(null, a, 4) && (cljs.reader.indivisible_QMARK_.call(null, a, 100) || cljs.reader.divisible_QMARK_.call(null, a, 400)) + return cljs.reader.divisible_QMARK_.call(null, a, 4) && (cljs.reader.indivisible_QMARK_.call(null, a, 100) || cljs.reader.divisible_QMARK_.call(null, a, 400)); }; cljs.reader.days_in_month = function() { var a = new cljs.core.PersistentVector(null, 13, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], null), b = new cljs.core.PersistentVector(null, 13, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], null); - return function(c, d) { - return cljs.core.get.call(null, cljs.core.truth_(d) ? b : a, c) - } + return function(a, b) { + return function(e, f) { + return cljs.core.get.call(null, cljs.core.truth_(f) ? b : a, e); + }; + }(a, b); }(); cljs.reader.timestamp_regex = /(\d\d\d\d)(?:-(\d\d)(?:-(\d\d)(?:[T](\d\d)(?::(\d\d)(?::(\d\d)(?:[.](\d+))?)?)?)?)?)?(?:[Z]|([-+])(\d\d):(\d\d))?/; cljs.reader.parse_int = function(a) { - a = parseInt(a); - return cljs.core.not.call(null, isNaN(a)) ? a : null + a = parseInt(a, 10); + return cljs.core.not.call(null, isNaN(a)) ? a : null; }; cljs.reader.check = function(a, b, c, d) { a <= b && b <= c || cljs.reader.reader_error.call(null, null, [cljs.core.str(d), cljs.core.str(" Failed: "), cljs.core.str(a), cljs.core.str("\x3c\x3d"), cljs.core.str(b), cljs.core.str("\x3c\x3d"), cljs.core.str(c)].join("")); - return b + return b; }; cljs.reader.parse_and_validate_timestamp = function(a) { var b = cljs.core.re_matches.call(null, cljs.reader.timestamp_regex, a); cljs.core.nth.call(null, b, 0, null); var c = cljs.core.nth.call(null, b, 1, null), d = cljs.core.nth.call(null, b, 2, null), e = cljs.core.nth.call(null, b, 3, null), f = cljs.core.nth.call(null, b, 4, null), g = cljs.core.nth.call(null, b, 5, null), h = cljs.core.nth.call(null, b, 6, null), k = cljs.core.nth.call(null, b, 7, null), l = cljs.core.nth.call(null, b, 8, null), m = cljs.core.nth.call(null, b, 9, null), n = cljs.core.nth.call(null, b, 10, null); - if(cljs.core.not.call(null, b)) { - return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")) + if (cljs.core.not.call(null, b)) { + return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")); } a = cljs.reader.parse_int.call(null, c); var b = function() { var a = cljs.reader.parse_int.call(null, d); - return cljs.core.truth_(a) ? a : 1 + return cljs.core.truth_(a) ? a : 1; }(), c = function() { var a = cljs.reader.parse_int.call(null, e); - return cljs.core.truth_(a) ? a : 1 + return cljs.core.truth_(a) ? a : 1; }(), p = function() { var a = cljs.reader.parse_int.call(null, f); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), q = function() { var a = cljs.reader.parse_int.call(null, g); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), r = function() { var a = cljs.reader.parse_int.call(null, h); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), s = function() { var a = cljs.reader.parse_int.call(null, cljs.reader.zero_fill_right_and_truncate.call(null, k, 3)); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), l = cljs.core._EQ_.call(null, l, "-") ? -1 : 1, t = function() { var a = cljs.reader.parse_int.call(null, m); - return cljs.core.truth_(a) ? a : 0 - }(), v = function() { + return cljs.core.truth_(a) ? a : 0; + }(), u = function() { var a = cljs.reader.parse_int.call(null, n); - return cljs.core.truth_(a) ? a : 0 - }(), l = l * (60 * t + v); + return cljs.core.truth_(a) ? a : 0; + }(), l = l * (60 * t + u); return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, cljs.reader.check.call(null, 1, b, 12, "timestamp month field must be in range 1..12"), cljs.reader.check.call(null, 1, c, cljs.reader.days_in_month.call(null, b, cljs.reader.leap_year_QMARK_.call(null, a)), "timestamp day field must be in range 1..last day in month"), cljs.reader.check.call(null, 0, p, 23, "timestamp hour field must be in range 0..23"), cljs.reader.check.call(null, 0, q, 59, "timestamp minute field must be in range 0..59"), - cljs.reader.check.call(null, 0, r, cljs.core._EQ_.call(null, q, 59) ? 60 : 59, "timestamp second field must be in range 0..60"), cljs.reader.check.call(null, 0, s, 999, "timestamp millisecond field must be in range 0..999"), l], null) + cljs.reader.check.call(null, 0, r, cljs.core._EQ_.call(null, q, 59) ? 60 : 59, "timestamp second field must be in range 0..60"), cljs.reader.check.call(null, 0, s, 999, "timestamp millisecond field must be in range 0..999"), l], null); }; cljs.reader.parse_timestamp = function(a) { var b = cljs.reader.parse_and_validate_timestamp.call(null, a); - if(cljs.core.truth_(b)) { + if (cljs.core.truth_(b)) { a = cljs.core.nth.call(null, b, 0, null); var c = cljs.core.nth.call(null, b, 1, null), d = cljs.core.nth.call(null, b, 2, null), e = cljs.core.nth.call(null, b, 3, null), f = cljs.core.nth.call(null, b, 4, null), g = cljs.core.nth.call(null, b, 5, null), h = cljs.core.nth.call(null, b, 6, null), b = cljs.core.nth.call(null, b, 7, null); - return new Date(Date.UTC(a, c - 1, d, e, f, g, h) - 6E4 * b) + return new Date(Date.UTC(a, c - 1, d, e, f, g, h) - 6E4 * b); } - return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")) + return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")); }; cljs.reader.read_date = function(a) { - return"string" === typeof a ? cljs.reader.parse_timestamp.call(null, a) : cljs.reader.reader_error.call(null, null, "Instance literal expects a string for its timestamp.") + return "string" === typeof a ? cljs.reader.parse_timestamp.call(null, a) : cljs.reader.reader_error.call(null, null, "Instance literal expects a string for its timestamp."); }; cljs.reader.read_queue = function(a) { - return cljs.core.vector_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentQueue.EMPTY, a) : cljs.reader.reader_error.call(null, null, "Queue literal expects a vector for its elements.") + return cljs.core.vector_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentQueue.EMPTY, a) : cljs.reader.reader_error.call(null, null, "Queue literal expects a vector for its elements."); +}; +cljs.reader.read_js = function(a) { + if (cljs.core.vector_QMARK_.call(null, a)) { + var b = []; + a = cljs.core.seq.call(null, a); + for (var c = null, d = 0, e = 0;;) { + if (e < d) { + var f = cljs.core._nth.call(null, c, e); + b.push(f); + e += 1; + } else { + if (a = cljs.core.seq.call(null, a)) { + c = a, cljs.core.chunked_seq_QMARK_.call(null, c) ? (a = cljs.core.chunk_first.call(null, c), e = cljs.core.chunk_rest.call(null, c), c = a, d = cljs.core.count.call(null, a), a = e) : (a = cljs.core.first.call(null, c), b.push(a), a = cljs.core.next.call(null, c), c = null, d = 0), e = 0; + } else { + break; + } + } + } + return b; + } + if (cljs.core.map_QMARK_.call(null, a)) { + b = {}; + a = cljs.core.seq.call(null, a); + c = null; + for (e = d = 0;;) { + if (e < d) { + var g = cljs.core._nth.call(null, c, e), f = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); + b[cljs.core.name.call(null, f)] = g; + e += 1; + } else { + if (a = cljs.core.seq.call(null, a)) { + cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), c = d, d = cljs.core.count.call(null, d)) : (d = cljs.core.first.call(null, a), c = cljs.core.nth.call(null, d, 0, null), d = cljs.core.nth.call(null, d, 1, null), b[cljs.core.name.call(null, c)] = d, a = cljs.core.next.call(null, a), c = null, d = 0), e = 0; + } else { + break; + } + } + } + return b; + } + return cljs.reader.reader_error.call(null, null, [cljs.core.str("JS literal expects a vector or map containing "), cljs.core.str("only string or unqualified keyword keys")].join("")); }; cljs.reader.read_uuid = function(a) { - return"string" === typeof a ? new cljs.core.UUID(a) : cljs.reader.reader_error.call(null, null, "UUID literal expects a string as its representation.") + return "string" === typeof a ? new cljs.core.UUID(a) : cljs.reader.reader_error.call(null, null, "UUID literal expects a string as its representation."); }; -cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null, new cljs.core.PersistentArrayMap(null, 3, ["inst", cljs.reader.read_date, "uuid", cljs.reader.read_uuid, "queue", cljs.reader.read_queue], null)); +cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null, new cljs.core.PersistentArrayMap(null, 4, ["inst", cljs.reader.read_date, "uuid", cljs.reader.read_uuid, "queue", cljs.reader.read_queue, "js", cljs.reader.read_js], null)); cljs.reader._STAR_default_data_reader_fn_STAR_ = cljs.core.atom.call(null, null); cljs.reader.maybe_read_tagged_type = function(a, b) { var c = cljs.reader.read_symbol.call(null, a, b), d = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), "" + cljs.core.str(c)), e = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); - return cljs.core.truth_(d) ? d.call(null, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.core.truth_(e) ? e.call(null, c, cljs.reader.read.call(null, a, !0, null, !1)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.reader_error.call(null, a, "Could not find tag parser for ", "" + cljs.core.str(c), " in ", cljs.core.pr_str.call(null, cljs.core.keys.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_)))) : null + return cljs.core.truth_(d) ? d.call(null, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.core.truth_(e) ? e.call(null, c, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.reader.reader_error.call(null, a, "Could not find tag parser for ", "" + cljs.core.str(c), " in ", cljs.core.pr_str.call(null, cljs.core.keys.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_)))); }; cljs.reader.register_tag_parser_BANG_ = function(a, b) { var c = "" + cljs.core.str(a), d = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), c); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_tag_table_STAR_, cljs.core.assoc, c, b); - return d + return d; }; cljs.reader.deregister_tag_parser_BANG_ = function(a) { a = "" + cljs.core.str(a); var b = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), a); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_tag_table_STAR_, cljs.core.dissoc, a); - return b + return b; }; cljs.reader.register_default_tag_parser_BANG_ = function(a) { var b = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_, function(b) { - return a - }); - return b + return function(b) { + return a; + }; + }(b)); + return b; }; cljs.reader.deregister_default_tag_parser_BANG_ = function() { var a = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_, function(a) { - return null - }); - return a + return function(a) { + return null; + }; + }(a)); + return a; +}; +clojure.walk = {}; +clojure.walk.walk = function(a, b, c) { + return cljs.core.seq_QMARK_.call(null, c) ? b.call(null, cljs.core.doall.call(null, cljs.core.map.call(null, a, c))) : cljs.core.coll_QMARK_.call(null, c) ? b.call(null, cljs.core.into.call(null, cljs.core.empty.call(null, c), cljs.core.map.call(null, a, c))) : b.call(null, c); +}; +clojure.walk.postwalk = function postwalk(b, c) { + return clojure.walk.walk.call(null, cljs.core.partial.call(null, postwalk, b), b, c); +}; +clojure.walk.prewalk = function prewalk(b, c) { + return clojure.walk.walk.call(null, cljs.core.partial.call(null, prewalk, b), cljs.core.identity, b.call(null, c)); +}; +clojure.walk.keywordize_keys = function(a) { + return clojure.walk.postwalk.call(null, function(a) { + return function(c) { + return cljs.core.map_QMARK_.call(null, c) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, a, c)) : c; + }; + }(function(a) { + var c = cljs.core.nth.call(null, a, 0, null); + a = cljs.core.nth.call(null, a, 1, null); + return "string" === typeof c ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, c), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [c, a], null); + }), a); +}; +clojure.walk.stringify_keys = function(a) { + return clojure.walk.postwalk.call(null, function(a) { + return function(c) { + return cljs.core.map_QMARK_.call(null, c) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, a, c)) : c; + }; + }(function(a) { + var c = cljs.core.nth.call(null, a, 0, null); + a = cljs.core.nth.call(null, a, 1, null); + return c instanceof cljs.core.Keyword ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name.call(null, c), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [c, a], null); + }), a); +}; +clojure.walk.prewalk_replace = function(a, b) { + return clojure.walk.prewalk.call(null, function(b) { + return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b; + }, b); +}; +clojure.walk.postwalk_replace = function(a, b) { + return clojure.walk.postwalk.call(null, function(b) { + return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b; + }, b); }; var cljsdeps = {core:{}}; diff --git a/project.clj b/project.clj index c26d20147..6144df586 100644 --- a/project.clj +++ b/project.clj @@ -1,10 +1,10 @@ (defproject lighttable "0.8.0" :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." :url "http://www.lighttable.com/" - :dependencies [[org.clojure/clojure "1.5.1"] + :dependencies [[org.clojure/clojure "1.6.0"] [crate "0.2.5"] - [fetch "0.2.0" :exclusions [org.clojure/clojure noir]] - [org.clojure/clojurescript "0.0-2138" + [fetch "0.2.2" :exclusions [org.clojure/clojure noir]] + [org.clojure/clojurescript "0.0-2913" :exclusions [org.apache.ant/ant]] ] :jvm-opts ["-Xmx1g" "-XX:+UseConcMarkSweepGC"] ; cljsbuild eats memory @@ -15,6 +15,6 @@ :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}}]} - :plugins [[lein-cljsbuild "1.0.1"]] + :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src/"] ) diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index a3ba7ed92..8184568e4 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.21.2", + version: "0.21.3", outputDir: "./atom-shell", rebuild: true } diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 6f9b27ca7..ae4b74dfd 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -235,7 +235,12 @@ (.addEventListener frame "contextmenu" (fn [e] (object/raise this :menu! e))) (.addEventListener frame "did-finish-load" (fn [] - (let [loc (.getUrl frame)] + (let [loc (.getUrl frame) + ;; there's a bug in atom-shell where webviews pointed at file:// urls don't + ;; correctly return their location + loc (if (= "about:blank" loc) + (.-src frame) + loc)] (devtools/clear-scripts! (:devtools-client @this)) (dom/val bar loc) (object/raise this :navigate loc)) @@ -250,7 +255,8 @@ :triggers #{:navigate} :reaction (fn [this loc] (let [title (.getTitle (to-frame this)) - title (if-not (empty? title) + title (if (and (not (empty? title)) + (not= title "about:blank")) title "browser")] (object/merge! this {:name title}) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 6cd5c48c7..e8276ada8 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -437,7 +437,7 @@ ;;********************************************************* -(behavior ::read-only +(behavior ::read-only-nocursor :triggers #{:init} :reaction (fn [obj] (set-options (:ed @obj) {:readOnly "nocursor"}))) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 5896d80f5..10d981cdc 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -15,6 +15,7 @@ [lt.objs.console :as console] [lt.util.dom :as dom] [clojure.string :as string] + [cljs.reader :as reader] [lt.objs.platform :as platform]) (:require-macros [lt.macros :refer [behavior defui]])) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 4c184507b..6fad06900 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -1,5 +1,6 @@ (ns lt.objs.langs.behaviors (:require [lt.object :as object] + [lt.objs.thread :as thread] [lt.objs.context :as ctx] [lt.objs.command :as cmd] [lt.util.dom :as dom] diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 7de9fbc45..61f63e49f 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -214,7 +214,7 @@ cache)) (defn save-cache [cache] - (files/save metadata-cache (JSON/stringify (clj->js cache)))) + (files/save metadata-cache (js/JSON.stringify (clj->js cache)))) (defn latest-metadata-sha [] (fetch/xhr [:get metadata-commits] {} @@ -250,7 +250,7 @@ (if (files/exists? metadata-cache) (-> (files/open-sync metadata-cache) (:content) - (JSON/parse) + (js/JSON.parse) (js->clj :keywordize-keys true)))) (defn search-plugins [plugins search] diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index f16a73d39..719640252 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -1,5 +1,6 @@ (ns lt.objs.sidebar.navigate (:require [lt.object :as object] + [lt.objs.thread :as thread] [lt.objs.workspace :as workspace] [lt.objs.context :as ctx] [lt.objs.sidebar.command :as cmd] diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 382002e1f..a024cd352 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -8,8 +8,6 @@ (def ^:dynamic *force-reload* false) -(def fpath (js/require "path")) - (def separator (.-sep fpath)) (defn absolute? [path] From 20681a35258a95632e4c099d003399b98f5cb4ea Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Mar 2015 16:35:41 -0500 Subject: [PATCH 451/656] Focus search when opening plugin manager close #1422 --- src/lt/objs/plugins.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 5c801c393..299fcf302 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -681,6 +681,7 @@ :desc "Plugins: Show plugin manager" :exec (fn [] (tabs/add-or-focus! manager) + (dom/focus (dom/$ :input (object/->content manager))) (cmd/exec! :plugin-manager.refresh))}) (cmd/command {:command :plugin-manager.update-outdated From da556afd360903e8ac7ff1e3a182e46fef4da55c Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 7 Mar 2015 20:34:56 -0800 Subject: [PATCH 452/656] Revert "upgrade to the latest clojurescript and fix a couple warnings/build errors" This reverts commit 8e73f59891c45f73a1b985fed69795d1061a8ecf. --- .../node_modules/clojurescript/cljsDeps.js | 20240 ++++++---------- project.clj | 8 +- shell/Gruntfile.js | 2 +- src/lt/objs/browser.cljs | 10 +- src/lt/objs/editor.cljs | 2 +- src/lt/objs/eval.cljs | 1 - src/lt/objs/langs/behaviors.cljs | 1 - src/lt/objs/plugins.cljs | 4 +- src/lt/objs/sidebar/navigate.cljs | 1 - src/lt/util/load.cljs | 2 + 10 files changed, 7240 insertions(+), 13031 deletions(-) diff --git a/deploy/core/node_modules/clojurescript/cljsDeps.js b/deploy/core/node_modules/clojurescript/cljsDeps.js index e23aceb98..51fd9126c 100644 --- a/deploy/core/node_modules/clojurescript/cljsDeps.js +++ b/deploy/core/node_modules/clojurescript/cljsDeps.js @@ -1,97 +1,73 @@ -if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) { - Math.imul = function (a, b) { - var ah = (a >>> 16) & 0xffff; - var al = a & 0xffff; - var bh = (b >>> 16) & 0xffff; - var bl = b & 0xffff; - // the shift by 0 fixes the sign on the high part - // the final |0 converts the unsigned value into a signed value - return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); - } -} - - var COMPILED = !0, goog = goog || {}; goog.global = this; -goog.isDef = function(a) { - return void 0 !== a; -}; -goog.exportPath_ = function(a, b, c) { - a = a.split("."); - c = c || goog.global; - a[0] in c || !c.execScript || c.execScript("var " + a[0]); - for (var d;a.length && (d = a.shift());) { - !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {}; - } -}; -goog.define = function(a, b) { - var c = b; - COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSURE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a])); - goog.exportPath_(a, c); -}; goog.DEBUG = !0; goog.LOCALE = "en"; goog.TRUSTED_SITE = !0; -goog.STRICT_MODE_COMPATIBLE = !1; goog.provide = function(a) { - if (!COMPILED) { - if (goog.isProvided_(a)) { + if(!COMPILED) { + if(goog.isProvided_(a)) { throw Error('Namespace "' + a + '" already declared.'); } delete goog.implicitNamespaces_[a]; - for (var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { - goog.implicitNamespaces_[b] = !0; + for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { + goog.implicitNamespaces_[b] = !0 } } - goog.exportPath_(a); + goog.exportPath_(a) }; goog.setTestOnly = function(a) { - if (COMPILED && !goog.DEBUG) { - throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : ".")); + if(COMPILED && !goog.DEBUG) { + throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); } }; -goog.forwardDeclare = function(a) { -}; COMPILED || (goog.isProvided_ = function(a) { - return!goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a)); + return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a) }, goog.implicitNamespaces_ = {}); +goog.exportPath_ = function(a, b, c) { + a = a.split("."); + c = c || goog.global; + a[0] in c || !c.execScript || c.execScript("var " + a[0]); + for(var d;a.length && (d = a.shift());) { + !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {} + } +}; goog.getObjectByName = function(a, b) { - for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) { - if (goog.isDefAndNotNull(d[e])) { - d = d[e]; - } else { - return null; + for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) { + if(goog.isDefAndNotNull(d[e])) { + d = d[e] + }else { + return null } } - return d; + return d }; goog.globalize = function(a, b) { var c = b || goog.global, d; - for (d in a) { - c[d] = a[d]; + for(d in a) { + c[d] = a[d] } }; goog.addDependency = function(a, b, c) { - if (goog.DEPENDENCIES_ENABLED) { + if(!COMPILED) { var d; a = a.replace(/\\/g, "/"); - for (var e = goog.dependencies_, f = 0;d = b[f];f++) { - e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0; + for(var e = goog.dependencies_, f = 0;d = b[f];f++) { + e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0 } - for (d = 0;b = c[d];d++) { - a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0; + for(d = 0;b = c[d];d++) { + a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0 } } }; goog.ENABLE_DEBUG_LOADER = !0; goog.require = function(a) { - if (!COMPILED && !goog.isProvided_(a)) { - if (goog.ENABLE_DEBUG_LOADER) { + if(!COMPILED && !goog.isProvided_(a)) { + if(goog.ENABLE_DEBUG_LOADER) { var b = goog.getPathFromDeps_(a); - if (b) { + if(b) { goog.included_[b] = !0; goog.writeScripts_(); - return; + return } } a = "goog.require could not find: " + a; @@ -103,159 +79,158 @@ goog.basePath = ""; goog.nullFunction = function() { }; goog.identityFunction = function(a, b) { - return a; + return a }; goog.abstractMethod = function() { throw Error("unimplemented abstract method"); }; goog.addSingletonGetter = function(a) { a.getInstance = function() { - if (a.instance_) { - return a.instance_; + if(a.instance_) { + return a.instance_ } goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); - return a.instance_ = new a; - }; + return a.instance_ = new a + } }; goog.instantiatedSingletons_ = []; -goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; -goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { +!COMPILED && goog.ENABLE_DEBUG_LOADER && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { var a = goog.global.document; - return "undefined" != typeof a && "write" in a; + return"undefined" != typeof a && "write" in a }, goog.findBasePath_ = function() { - if (goog.global.CLOSURE_BASE_PATH) { - goog.basePath = goog.global.CLOSURE_BASE_PATH; - } else { - if (goog.inHtmlDocument_()) { - for (var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { + if(goog.global.CLOSURE_BASE_PATH) { + goog.basePath = goog.global.CLOSURE_BASE_PATH + }else { + if(goog.inHtmlDocument_()) { + for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; - if ("base.js" == c.substr(d - 7, 7)) { + if("base.js" == c.substr(d - 7, 7)) { goog.basePath = c.substr(0, d - 7); - break; + break } } } } }, goog.importScript_ = function(a) { var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; - !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0); + !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) }, goog.writeScriptTag_ = function(a) { - if (goog.inHtmlDocument_()) { + if(goog.inHtmlDocument_()) { var b = goog.global.document; - if ("complete" == b.readyState) { - if (/\bdeps.js$/.test(a)) { - return!1; + if("complete" == b.readyState) { + if(/\bdeps.js$/.test(a)) { + return!1 } throw Error('Cannot write "' + a + '" after document load'); } b.write('\x3cscript type\x3d"text/javascript" src\x3d"' + a + '"\x3e\x3c/script\x3e'); - return!0; + return!0 } - return!1; + return!1 }, goog.writeScripts_ = function() { function a(e) { - if (!(e in d.written)) { - if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { - for (var g in d.requires[e]) { - if (!goog.isProvided_(g)) { - if (g in d.nameToPath) { - a(d.nameToPath[g]); - } else { + if(!(e in d.written)) { + if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { + for(var g in d.requires[e]) { + if(!goog.isProvided_(g)) { + if(g in d.nameToPath) { + a(d.nameToPath[g]) + }else { throw Error("Undefined nameToPath for " + g); } } } } - e in c || (c[e] = !0, b.push(e)); + e in c || (c[e] = !0, b.push(e)) } } var b = [], c = {}, d = goog.dependencies_, e; - for (e in goog.included_) { - d.written[e] || a(e); + for(e in goog.included_) { + d.written[e] || a(e) } - for (e = 0;e < b.length;e++) { - if (b[e]) { - goog.importScript_(goog.basePath + b[e]); - } else { + for(e = 0;e < b.length;e++) { + if(b[e]) { + goog.importScript_(goog.basePath + b[e]) + }else { throw Error("Undefined script input"); } } }, goog.getPathFromDeps_ = function(a) { - return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null; + return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js")); goog.typeOf = function(a) { var b = typeof a; - if ("object" == b) { - if (a) { - if (a instanceof Array) { - return "array"; + if("object" == b) { + if(a) { + if(a instanceof Array) { + return"array" } - if (a instanceof Object) { - return b; + if(a instanceof Object) { + return b } var c = Object.prototype.toString.call(a); - if ("[object Window]" == c) { - return "object"; + if("[object Window]" == c) { + return"object" } - if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { - return "array"; + if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { + return"array" } - if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { - return "function"; + if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { + return"function" } - } else { - return "null"; + }else { + return"null" } - } else { - if ("function" == b && "undefined" == typeof a.call) { - return "object"; + }else { + if("function" == b && "undefined" == typeof a.call) { + return"object" } } - return b; + return b +}; +goog.isDef = function(a) { + return void 0 !== a }; goog.isNull = function(a) { - return null === a; + return null === a }; goog.isDefAndNotNull = function(a) { - return null != a; + return null != a }; goog.isArray = function(a) { - return "array" == goog.typeOf(a); + return"array" == goog.typeOf(a) }; goog.isArrayLike = function(a) { var b = goog.typeOf(a); - return "array" == b || "object" == b && "number" == typeof a.length; + return"array" == b || "object" == b && "number" == typeof a.length }; goog.isDateLike = function(a) { - return goog.isObject(a) && "function" == typeof a.getFullYear; + return goog.isObject(a) && "function" == typeof a.getFullYear }; goog.isString = function(a) { - return "string" == typeof a; + return"string" == typeof a }; goog.isBoolean = function(a) { - return "boolean" == typeof a; + return"boolean" == typeof a }; goog.isNumber = function(a) { - return "number" == typeof a; + return"number" == typeof a }; goog.isFunction = function(a) { - return "function" == goog.typeOf(a); + return"function" == goog.typeOf(a) }; goog.isObject = function(a) { var b = typeof a; - return "object" == b && null != a || "function" == b; + return"object" == b && null != a || "function" == b }; goog.getUid = function(a) { - return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_); -}; -goog.hasUid = function(a) { - return!!a[goog.UID_PROPERTY_]; + return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_) }; goog.removeUid = function(a) { "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); try { - delete a[goog.UID_PROPERTY_]; - } catch (b) { + delete a[goog.UID_PROPERTY_] + }catch(b) { } }; goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); @@ -264,73 +239,73 @@ goog.getHashCode = goog.getUid; goog.removeHashCode = goog.removeUid; goog.cloneObject = function(a) { var b = goog.typeOf(a); - if ("object" == b || "array" == b) { - if (a.clone) { - return a.clone(); + if("object" == b || "array" == b) { + if(a.clone) { + return a.clone() } var b = "array" == b ? [] : {}, c; - for (c in a) { - b[c] = goog.cloneObject(a[c]); + for(c in a) { + b[c] = goog.cloneObject(a[c]) } - return b; + return b } - return a; + return a }; goog.bindNative_ = function(a, b, c) { - return a.call.apply(a.bind, arguments); + return a.call.apply(a.bind, arguments) }; goog.bindJs_ = function(a, b, c) { - if (!a) { + if(!a) { throw Error(); } - if (2 < arguments.length) { + if(2 < arguments.length) { var d = Array.prototype.slice.call(arguments, 2); return function() { var c = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(c, d); - return a.apply(b, c); - }; + return a.apply(b, c) + } } return function() { - return a.apply(b, arguments); - }; + return a.apply(b, arguments) + } }; goog.bind = function(a, b, c) { Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; - return goog.bind.apply(null, arguments); + return goog.bind.apply(null, arguments) }; goog.partial = function(a, b) { var c = Array.prototype.slice.call(arguments, 1); return function() { - var b = c.slice(); - b.push.apply(b, arguments); - return a.apply(this, b); - }; + var b = Array.prototype.slice.call(arguments); + b.unshift.apply(b, c); + return a.apply(this, b) + } }; goog.mixin = function(a, b) { - for (var c in b) { - a[c] = b[c]; + for(var c in b) { + a[c] = b[c] } }; goog.now = goog.TRUSTED_SITE && Date.now || function() { - return+new Date; + return+new Date }; goog.globalEval = function(a) { - if (goog.global.execScript) { - goog.global.execScript(a, "JavaScript"); - } else { - if (goog.global.eval) { - if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ \x3d 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { - goog.global.eval(a); - } else { + if(goog.global.execScript) { + goog.global.execScript(a, "JavaScript") + }else { + if(goog.global.eval) { + if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ \x3d 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { + goog.global.eval(a) + }else { var b = goog.global.document, c = b.createElement("script"); c.type = "text/javascript"; c.defer = !1; c.appendChild(b.createTextNode(a)); b.body.appendChild(c); - b.body.removeChild(c); + b.body.removeChild(c) } - } else { + }else { throw Error("goog.globalEval not available"); } } @@ -338,37 +313,39 @@ goog.globalEval = function(a) { goog.evalWorksForGlobals_ = null; goog.getCssName = function(a, b) { var c = function(a) { - return goog.cssNameMapping_[a] || a; + return goog.cssNameMapping_[a] || a }, d = function(a) { a = a.split("-"); - for (var b = [], d = 0;d < a.length;d++) { - b.push(c(a[d])); + for(var b = [], d = 0;d < a.length;d++) { + b.push(c(a[d])) } - return b.join("-"); + return b.join("-") }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) { - return a; + return a }; - return b ? a + "-" + d(b) : d(a); + return b ? a + "-" + d(b) : d(a) }; goog.setCssNameMapping = function(a, b) { goog.cssNameMapping_ = a; - goog.cssNameMappingStyle_ = b; + goog.cssNameMappingStyle_ = b }; !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); goog.getMsg = function(a, b) { - b && (a = a.replace(/\{\$([^}]+)}/g, function(a, d) { - return d in b ? b[d] : a; - })); - return a; + var c = b || {}, d; + for(d in c) { + var e = ("" + c[d]).replace(/\$/g, "$$$$"); + a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e) + } + return a }; goog.getMsgWithFallback = function(a, b) { - return a; + return a }; goog.exportSymbol = function(a, b, c) { - goog.exportPath_(a, b, c); + goog.exportPath_(a, b, c) }; goog.exportProperty = function(a, b, c) { - a[b] = c; + a[b] = c }; goog.inherits = function(a, b) { function c() { @@ -376,1304 +353,1151 @@ goog.inherits = function(a, b) { c.prototype = b.prototype; a.superClass_ = b.prototype; a.prototype = new c; - a.prototype.constructor = a; - a.base = function(a, c, f) { - var g = Array.prototype.slice.call(arguments, 2); - return b.prototype[c].apply(a, g); - }; + a.prototype.constructor = a }; goog.base = function(a, b, c) { var d = arguments.callee.caller; - if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) { - throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C"); - } - if (d.superClass_) { - return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)); - } - for (var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { - if (g.prototype[b] === d) { - f = !0; - } else { - if (f) { - return g.prototype[b].apply(a, e); + if(d.superClass_) { + return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)) + } + for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { + if(g.prototype[b] === d) { + f = !0 + }else { + if(f) { + return g.prototype[b].apply(a, e) } } } - if (a[b] === d) { - return a.constructor.prototype[b].apply(a, e); + if(a[b] === d) { + return a.constructor.prototype[b].apply(a, e) } throw Error("goog.base called from a method of one name to a method of a different name"); }; goog.scope = function(a) { - a.call(goog.global); -}; -COMPILED || (goog.global.COMPILED = COMPILED); -goog.defineClass = function(a, b) { - var c = b.constructor, d = b.statics; - c && c != Object.prototype.constructor || (c = function() { - throw Error("cannot instantiate an interface (no constructor defined)."); - }); - c = goog.defineClass.createSealingConstructor_(c, a); - a && goog.inherits(c, a); - delete b.constructor; - delete b.statics; - goog.defineClass.applyProperties_(c.prototype, b); - null != d && (d instanceof Function ? d(c) : goog.defineClass.applyProperties_(c, d)); - return c; -}; -goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG; -goog.defineClass.createSealingConstructor_ = function(a, b) { - if (goog.defineClass.SEAL_CLASS_INSTANCES && Object.seal instanceof Function) { - if (b && b.prototype && b.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]) { - return a; - } - var c = function() { - var b = a.apply(this, arguments) || this; - this.constructor === c && Object.seal(b); - return b; - }; - return c; - } - return a; -}; -goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); -goog.defineClass.applyProperties_ = function(a, b) { - for (var c in b) { - Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); - } - for (var d = 0;d < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++) { - c = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d], Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); - } + a.call(goog.global) }; -goog.tagUnsealableClass = function(a) { - !COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] = !0); -}; -goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable"; goog.string = {}; -goog.string.DETECT_DOUBLE_ESCAPING = !1; goog.string.Unicode = {NBSP:"\u00a0"}; goog.string.startsWith = function(a, b) { - return 0 == a.lastIndexOf(b, 0); + return 0 == a.lastIndexOf(b, 0) }; goog.string.endsWith = function(a, b) { var c = a.length - b.length; - return 0 <= c && a.indexOf(b, c) == c; + return 0 <= c && a.indexOf(b, c) == c }; goog.string.caseInsensitiveStartsWith = function(a, b) { - return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)); + return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)) }; goog.string.caseInsensitiveEndsWith = function(a, b) { - return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)); -}; -goog.string.caseInsensitiveEquals = function(a, b) { - return a.toLowerCase() == b.toLowerCase(); + return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)) }; goog.string.subs = function(a, b) { - for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1);e.length && 1 < c.length;) { - d += c.shift() + e.shift(); + for(var c = 1;c < arguments.length;c++) { + var d = String(arguments[c]).replace(/\$/g, "$$$$"); + a = a.replace(/\%s/, d) } - return d + c.join("%s"); + return a }; goog.string.collapseWhitespace = function(a) { - return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, ""); + return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, "") }; goog.string.isEmpty = function(a) { - return/^[\s\xa0]*$/.test(a); + return/^[\s\xa0]*$/.test(a) }; goog.string.isEmptySafe = function(a) { - return goog.string.isEmpty(goog.string.makeSafe(a)); + return goog.string.isEmpty(goog.string.makeSafe(a)) }; goog.string.isBreakingWhitespace = function(a) { - return!/[^\t\n\r ]/.test(a); + return!/[^\t\n\r ]/.test(a) }; goog.string.isAlpha = function(a) { - return!/[^a-zA-Z]/.test(a); + return!/[^a-zA-Z]/.test(a) }; goog.string.isNumeric = function(a) { - return!/[^0-9]/.test(a); + return!/[^0-9]/.test(a) }; goog.string.isAlphaNumeric = function(a) { - return!/[^a-zA-Z0-9]/.test(a); + return!/[^a-zA-Z0-9]/.test(a) }; goog.string.isSpace = function(a) { - return " " == a; + return" " == a }; goog.string.isUnicodeChar = function(a) { - return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a; + return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a }; goog.string.stripNewlines = function(a) { - return a.replace(/(\r\n|\r|\n)+/g, " "); + return a.replace(/(\r\n|\r|\n)+/g, " ") }; goog.string.canonicalizeNewlines = function(a) { - return a.replace(/(\r\n|\r|\n)/g, "\n"); + return a.replace(/(\r\n|\r|\n)/g, "\n") }; goog.string.normalizeWhitespace = function(a) { - return a.replace(/\xa0|\s/g, " "); + return a.replace(/\xa0|\s/g, " ") }; goog.string.normalizeSpaces = function(a) { - return a.replace(/\xa0|[ \t]+/g, " "); + return a.replace(/\xa0|[ \t]+/g, " ") }; goog.string.collapseBreakingSpaces = function(a) { - return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ""); + return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "") }; goog.string.trim = function(a) { - return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, ""); + return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "") }; goog.string.trimLeft = function(a) { - return a.replace(/^[\s\xa0]+/, ""); + return a.replace(/^[\s\xa0]+/, "") }; goog.string.trimRight = function(a) { - return a.replace(/[\s\xa0]+$/, ""); + return a.replace(/[\s\xa0]+$/, "") }; goog.string.caseInsensitiveCompare = function(a, b) { var c = String(a).toLowerCase(), d = String(b).toLowerCase(); - return c < d ? -1 : c == d ? 0 : 1; + return c < d ? -1 : c == d ? 0 : 1 }; goog.string.numerateCompareRegExp_ = /(\.\d+)|(\d+)|(\D+)/g; goog.string.numerateCompare = function(a, b) { - if (a == b) { - return 0; + if(a == b) { + return 0 } - if (!a) { - return-1; + if(!a) { + return-1 } - if (!b) { - return 1; + if(!b) { + return 1 } - for (var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { + for(var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { var g = c[f], h = d[f]; - if (g != h) { - return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1; + if(g != h) { + return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1 } } - return c.length != d.length ? c.length - d.length : a < b ? -1 : 1; + return c.length != d.length ? c.length - d.length : a < b ? -1 : 1 }; goog.string.urlEncode = function(a) { - return encodeURIComponent(String(a)); + return encodeURIComponent(String(a)) }; goog.string.urlDecode = function(a) { - return decodeURIComponent(a.replace(/\+/g, " ")); + return decodeURIComponent(a.replace(/\+/g, " ")) }; goog.string.newLineToBr = function(a, b) { - return a.replace(/(\r\n|\r|\n)/g, b ? "\x3cbr /\x3e" : "\x3cbr\x3e"); + return a.replace(/(\r\n|\r|\n)/g, b ? "\x3cbr /\x3e" : "\x3cbr\x3e") }; goog.string.htmlEscape = function(a, b) { - if (b) { - a = a.replace(goog.string.AMP_RE_, "\x26amp;").replace(goog.string.LT_RE_, "\x26lt;").replace(goog.string.GT_RE_, "\x26gt;").replace(goog.string.QUOT_RE_, "\x26quot;").replace(goog.string.SINGLE_QUOTE_RE_, "\x26#39;").replace(goog.string.NULL_RE_, "\x26#0;"), goog.string.DETECT_DOUBLE_ESCAPING && (a = a.replace(goog.string.E_RE_, "\x26#101;")); - } else { - if (!goog.string.ALL_RE_.test(a)) { - return a; - } - -1 != a.indexOf("\x26") && (a = a.replace(goog.string.AMP_RE_, "\x26amp;")); - -1 != a.indexOf("\x3c") && (a = a.replace(goog.string.LT_RE_, "\x26lt;")); - -1 != a.indexOf("\x3e") && (a = a.replace(goog.string.GT_RE_, "\x26gt;")); - -1 != a.indexOf('"') && (a = a.replace(goog.string.QUOT_RE_, "\x26quot;")); - -1 != a.indexOf("'") && (a = a.replace(goog.string.SINGLE_QUOTE_RE_, "\x26#39;")); - -1 != a.indexOf("\x00") && (a = a.replace(goog.string.NULL_RE_, "\x26#0;")); - goog.string.DETECT_DOUBLE_ESCAPING && -1 != a.indexOf("e") && (a = a.replace(goog.string.E_RE_, "\x26#101;")); - } - return a; -}; -goog.string.AMP_RE_ = /&/g; -goog.string.LT_RE_ = //g; -goog.string.QUOT_RE_ = /"/g; -goog.string.SINGLE_QUOTE_RE_ = /'/g; -goog.string.NULL_RE_ = /\x00/g; -goog.string.E_RE_ = /e/g; -goog.string.ALL_RE_ = goog.string.DETECT_DOUBLE_ESCAPING ? /[\x00&<>"'e]/ : /[\x00&<>"']/; + if(b) { + return a.replace(goog.string.amperRe_, "\x26amp;").replace(goog.string.ltRe_, "\x26lt;").replace(goog.string.gtRe_, "\x26gt;").replace(goog.string.quotRe_, "\x26quot;") + } + if(!goog.string.allRe_.test(a)) { + return a + } + -1 != a.indexOf("\x26") && (a = a.replace(goog.string.amperRe_, "\x26amp;")); + -1 != a.indexOf("\x3c") && (a = a.replace(goog.string.ltRe_, "\x26lt;")); + -1 != a.indexOf("\x3e") && (a = a.replace(goog.string.gtRe_, "\x26gt;")); + -1 != a.indexOf('"') && (a = a.replace(goog.string.quotRe_, "\x26quot;")); + return a +}; +goog.string.amperRe_ = /&/g; +goog.string.ltRe_ = //g; +goog.string.quotRe_ = /\"/g; +goog.string.allRe_ = /[&<>\"]/; goog.string.unescapeEntities = function(a) { - return goog.string.contains(a, "\x26") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a; + return goog.string.contains(a, "\x26") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a }; -goog.string.unescapeEntitiesWithDocument = function(a, b) { - return goog.string.contains(a, "\x26") ? goog.string.unescapeEntitiesUsingDom_(a, b) : a; -}; -goog.string.unescapeEntitiesUsingDom_ = function(a, b) { - var c = {"\x26amp;":"\x26", "\x26lt;":"\x3c", "\x26gt;":"\x3e", "\x26quot;":'"'}, d; - d = b ? b.createElement("div") : goog.global.document.createElement("div"); - return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, b) { - var g = c[a]; - if (g) { - return g; +goog.string.unescapeEntitiesUsingDom_ = function(a) { + var b = {"\x26amp;":"\x26", "\x26lt;":"\x3c", "\x26gt;":"\x3e", "\x26quot;":'"'}, c = document.createElement("div"); + return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, e) { + var f = b[a]; + if(f) { + return f } - if ("#" == b.charAt(0)) { - var h = Number("0" + b.substr(1)); - isNaN(h) || (g = String.fromCharCode(h)); + if("#" == e.charAt(0)) { + var g = Number("0" + e.substr(1)); + isNaN(g) || (f = String.fromCharCode(g)) } - g || (d.innerHTML = a + " ", g = d.firstChild.nodeValue.slice(0, -1)); - return c[a] = g; - }); + f || (c.innerHTML = a + " ", f = c.firstChild.nodeValue.slice(0, -1)); + return b[a] = f + }) }; goog.string.unescapePureXmlEntities_ = function(a) { return a.replace(/&([^;]+);/g, function(a, c) { switch(c) { case "amp": - return "\x26"; + return"\x26"; case "lt": - return "\x3c"; + return"\x3c"; case "gt": - return "\x3e"; + return"\x3e"; case "quot": return'"'; default: - if ("#" == c.charAt(0)) { + if("#" == c.charAt(0)) { var d = Number("0" + c.substr(1)); - if (!isNaN(d)) { - return String.fromCharCode(d); + if(!isNaN(d)) { + return String.fromCharCode(d) } } - return a; + return a } - }); + }) }; goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; goog.string.whitespaceEscape = function(a, b) { - return goog.string.newLineToBr(a.replace(/ /g, " \x26#160;"), b); -}; -goog.string.preserveSpaces = function(a) { - return a.replace(/(^|[\n ]) /g, "$1" + goog.string.Unicode.NBSP); + return goog.string.newLineToBr(a.replace(/ /g, " \x26#160;"), b) }; goog.string.stripQuotes = function(a, b) { - for (var c = b.length, d = 0;d < c;d++) { + for(var c = b.length, d = 0;d < c;d++) { var e = 1 == c ? b : b.charAt(d); - if (a.charAt(0) == e && a.charAt(a.length - 1) == e) { - return a.substring(1, a.length - 1); + if(a.charAt(0) == e && a.charAt(a.length - 1) == e) { + return a.substring(1, a.length - 1) } } - return a; + return a }; goog.string.truncate = function(a, b, c) { c && (a = goog.string.unescapeEntities(a)); a.length > b && (a = a.substring(0, b - 3) + "..."); c && (a = goog.string.htmlEscape(a)); - return a; + return a }; goog.string.truncateMiddle = function(a, b, c, d) { c && (a = goog.string.unescapeEntities(a)); - if (d && a.length > b) { + if(d && a.length > b) { d > b && (d = b); var e = a.length - d; - a = a.substring(0, b - d) + "..." + a.substring(e); - } else { - a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)); + a = a.substring(0, b - d) + "..." + a.substring(e) + }else { + a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)) } c && (a = goog.string.htmlEscape(a)); - return a; + return a }; goog.string.specialEscapeChars_ = {"\x00":"\\0", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\"}; goog.string.jsEscapeCache_ = {"'":"\\'"}; goog.string.quote = function(a) { a = String(a); - if (a.quote) { - return a.quote(); + if(a.quote) { + return a.quote() } - for (var b = ['"'], c = 0;c < a.length;c++) { + for(var b = ['"'], c = 0;c < a.length;c++) { var d = a.charAt(c), e = d.charCodeAt(0); - b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)); + b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)) } b.push('"'); - return b.join(""); + return b.join("") }; goog.string.escapeString = function(a) { - for (var b = [], c = 0;c < a.length;c++) { - b[c] = goog.string.escapeChar(a.charAt(c)); + for(var b = [], c = 0;c < a.length;c++) { + b[c] = goog.string.escapeChar(a.charAt(c)) } - return b.join(""); + return b.join("") }; goog.string.escapeChar = function(a) { - if (a in goog.string.jsEscapeCache_) { - return goog.string.jsEscapeCache_[a]; + if(a in goog.string.jsEscapeCache_) { + return goog.string.jsEscapeCache_[a] } - if (a in goog.string.specialEscapeChars_) { - return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a]; + if(a in goog.string.specialEscapeChars_) { + return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a] } var b = a, c = a.charCodeAt(0); - if (31 < c && 127 > c) { - b = a; - } else { - if (256 > c) { - if (b = "\\x", 16 > c || 256 < c) { - b += "0"; + if(31 < c && 127 > c) { + b = a + }else { + if(256 > c) { + if(b = "\\x", 16 > c || 256 < c) { + b += "0" } - } else { - b = "\\u", 4096 > c && (b += "0"); + }else { + b = "\\u", 4096 > c && (b += "0") } - b += c.toString(16).toUpperCase(); + b += c.toString(16).toUpperCase() } - return goog.string.jsEscapeCache_[a] = b; + return goog.string.jsEscapeCache_[a] = b }; goog.string.toMap = function(a) { - for (var b = {}, c = 0;c < a.length;c++) { - b[a.charAt(c)] = !0; + for(var b = {}, c = 0;c < a.length;c++) { + b[a.charAt(c)] = !0 } - return b; + return b }; goog.string.contains = function(a, b) { - return-1 != a.indexOf(b); -}; -goog.string.caseInsensitiveContains = function(a, b) { - return goog.string.contains(a.toLowerCase(), b.toLowerCase()); + return-1 != a.indexOf(b) }; goog.string.countOf = function(a, b) { - return a && b ? a.split(b).length - 1 : 0; + return a && b ? a.split(b).length - 1 : 0 }; goog.string.removeAt = function(a, b, c) { var d = a; - 0 <= b && b < a.length && 0 < c && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); - return d; + 0 <= b && (b < a.length && 0 < c) && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); + return d }; goog.string.remove = function(a, b) { - var c = new RegExp(goog.string.regExpEscape(b), ""); - return a.replace(c, ""); + var c = RegExp(goog.string.regExpEscape(b), ""); + return a.replace(c, "") }; goog.string.removeAll = function(a, b) { - var c = new RegExp(goog.string.regExpEscape(b), "g"); - return a.replace(c, ""); + var c = RegExp(goog.string.regExpEscape(b), "g"); + return a.replace(c, "") }; goog.string.regExpEscape = function(a) { - return String(a).replace(/([-()\[\]{}+?*.$\^|,:# b ? 1 : 0; + return a < b ? -1 : a > b ? 1 : 0 }; goog.string.HASHCODE_MAX_ = 4294967296; goog.string.hashCode = function(a) { - for (var b = 0, c = 0;c < a.length;++c) { - b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_; + for(var b = 0, c = 0;c < a.length;++c) { + b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_ } - return b; + return b }; goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0; goog.string.createUniqueString = function() { - return "goog_" + goog.string.uniqueStringCounter_++; + return"goog_" + goog.string.uniqueStringCounter_++ }; goog.string.toNumber = function(a) { var b = Number(a); - return 0 == b && goog.string.isEmpty(a) ? NaN : b; -}; -goog.string.isLowerCamelCase = function(a) { - return/^[a-z]+([A-Z][a-z]*)*$/.test(a); -}; -goog.string.isUpperCamelCase = function(a) { - return/^([A-Z][a-z]*)+$/.test(a); + return 0 == b && goog.string.isEmpty(a) ? NaN : b }; goog.string.toCamelCase = function(a) { return String(a).replace(/\-([a-z])/g, function(a, c) { - return c.toUpperCase(); - }); + return c.toUpperCase() + }) }; goog.string.toSelectorCase = function(a) { - return String(a).replace(/([A-Z])/g, "-$1").toLowerCase(); + return String(a).replace(/([A-Z])/g, "-$1").toLowerCase() }; goog.string.toTitleCase = function(a, b) { var c = goog.isString(b) ? goog.string.regExpEscape(b) : "\\s"; - return a.replace(new RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) { - return b + c.toUpperCase(); - }); + return a.replace(RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) { + return b + c.toUpperCase() + }) }; goog.string.parseInt = function(a) { isFinite(a) && (a = String(a)); - return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN; -}; -goog.string.splitLimit = function(a, b, c) { - a = a.split(b); - for (var d = [];0 < c && a.length;) { - d.push(a.shift()), c--; - } - a.length && d.push(a.join(b)); - return d; -}; -goog.object = {}; -goog.object.forEach = function(a, b, c) { - for (var d in a) { - b.call(c, a[d], d, a); - } -}; -goog.object.filter = function(a, b, c) { - var d = {}, e; - for (e in a) { - b.call(c, a[e], e, a) && (d[e] = a[e]); - } - return d; -}; -goog.object.map = function(a, b, c) { - var d = {}, e; - for (e in a) { - d[e] = b.call(c, a[e], e, a); - } - return d; -}; -goog.object.some = function(a, b, c) { - for (var d in a) { - if (b.call(c, a[d], d, a)) { - return!0; - } - } - return!1; -}; -goog.object.every = function(a, b, c) { - for (var d in a) { - if (!b.call(c, a[d], d, a)) { - return!1; - } - } - return!0; -}; -goog.object.getCount = function(a) { - var b = 0, c; - for (c in a) { - b++; - } - return b; -}; -goog.object.getAnyKey = function(a) { - for (var b in a) { - return b; - } -}; -goog.object.getAnyValue = function(a) { - for (var b in a) { - return a[b]; - } -}; -goog.object.contains = function(a, b) { - return goog.object.containsValue(a, b); -}; -goog.object.getValues = function(a) { - var b = [], c = 0, d; - for (d in a) { - b[c++] = a[d]; - } - return b; -}; -goog.object.getKeys = function(a) { - var b = [], c = 0, d; - for (d in a) { - b[c++] = d; - } - return b; -}; -goog.object.getValueByKeys = function(a, b) { - for (var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { - } - return a; -}; -goog.object.containsKey = function(a, b) { - return b in a; -}; -goog.object.containsValue = function(a, b) { - for (var c in a) { - if (a[c] == b) { - return!0; - } - } - return!1; -}; -goog.object.findKey = function(a, b, c) { - for (var d in a) { - if (b.call(c, a[d], d, a)) { - return d; - } - } -}; -goog.object.findValue = function(a, b, c) { - return(b = goog.object.findKey(a, b, c)) && a[b]; -}; -goog.object.isEmpty = function(a) { - for (var b in a) { - return!1; - } - return!0; -}; -goog.object.clear = function(a) { - for (var b in a) { - delete a[b]; - } -}; -goog.object.remove = function(a, b) { - var c; - (c = b in a) && delete a[b]; - return c; -}; -goog.object.add = function(a, b, c) { - if (b in a) { - throw Error('The object already contains the key "' + b + '"'); - } - goog.object.set(a, b, c); -}; -goog.object.get = function(a, b, c) { - return b in a ? a[b] : c; -}; -goog.object.set = function(a, b, c) { - a[b] = c; -}; -goog.object.setIfUndefined = function(a, b, c) { - return b in a ? a[b] : a[b] = c; -}; -goog.object.clone = function(a) { - var b = {}, c; - for (c in a) { - b[c] = a[c]; - } - return b; -}; -goog.object.unsafeClone = function(a) { - var b = goog.typeOf(a); - if ("object" == b || "array" == b) { - if (a.clone) { - return a.clone(); - } - var b = "array" == b ? [] : {}, c; - for (c in a) { - b[c] = goog.object.unsafeClone(a[c]); - } - return b; - } - return a; -}; -goog.object.transpose = function(a) { - var b = {}, c; - for (c in a) { - b[a[c]] = c; - } - return b; -}; -goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); -goog.object.extend = function(a, b) { - for (var c, d, e = 1;e < arguments.length;e++) { - d = arguments[e]; - for (c in d) { - a[c] = d[c]; - } - for (var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { - c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]); - } - } -}; -goog.object.create = function(a) { - var b = arguments.length; - if (1 == b && goog.isArray(arguments[0])) { - return goog.object.create.apply(null, arguments[0]); - } - if (b % 2) { - throw Error("Uneven number of arguments"); - } - for (var c = {}, d = 0;d < b;d += 2) { - c[arguments[d]] = arguments[d + 1]; - } - return c; -}; -goog.object.createSet = function(a) { - var b = arguments.length; - if (1 == b && goog.isArray(arguments[0])) { - return goog.object.createSet.apply(null, arguments[0]); - } - for (var c = {}, d = 0;d < b;d++) { - c[arguments[d]] = !0; - } - return c; -}; -goog.object.createImmutableView = function(a) { - var b = a; - Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b)); - return b; -}; -goog.object.isImmutableView = function(a) { - return!!Object.isFrozen && Object.isFrozen(a); -}; -goog.string.StringBuffer = function(a, b) { - null != a && this.append.apply(this, arguments); -}; -goog.string.StringBuffer.prototype.buffer_ = ""; -goog.string.StringBuffer.prototype.set = function(a) { - this.buffer_ = "" + a; -}; -goog.string.StringBuffer.prototype.append = function(a, b, c) { - this.buffer_ += a; - if (null != b) { - for (var d = 1;d < arguments.length;d++) { - this.buffer_ += arguments[d]; - } - } - return this; -}; -goog.string.StringBuffer.prototype.clear = function() { - this.buffer_ = ""; -}; -goog.string.StringBuffer.prototype.getLength = function() { - return this.buffer_.length; -}; -goog.string.StringBuffer.prototype.toString = function() { - return this.buffer_; + return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN }; goog.debug = {}; goog.debug.Error = function(a) { - if (Error.captureStackTrace) { - Error.captureStackTrace(this, goog.debug.Error); - } else { - var b = Error().stack; - b && (this.stack = b); - } - a && (this.message = String(a)); + Error.captureStackTrace ? Error.captureStackTrace(this, goog.debug.Error) : this.stack = Error().stack || ""; + a && (this.message = String(a)) }; goog.inherits(goog.debug.Error, Error); goog.debug.Error.prototype.name = "CustomError"; -goog.dom = {}; -goog.dom.NodeType = {ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, ENTITY_REFERENCE:5, ENTITY:6, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9, DOCUMENT_TYPE:10, DOCUMENT_FRAGMENT:11, NOTATION:12}; goog.asserts = {}; goog.asserts.ENABLE_ASSERTS = goog.DEBUG; goog.asserts.AssertionError = function(a, b) { b.unshift(a); goog.debug.Error.call(this, goog.string.subs.apply(null, b)); b.shift(); - this.messagePattern = a; + this.messagePattern = a }; goog.inherits(goog.asserts.AssertionError, goog.debug.Error); goog.asserts.AssertionError.prototype.name = "AssertionError"; -goog.asserts.DEFAULT_ERROR_HANDLER = function(a) { - throw a; -}; -goog.asserts.errorHandler_ = goog.asserts.DEFAULT_ERROR_HANDLER; goog.asserts.doAssertFailure_ = function(a, b, c, d) { var e = "Assertion failed"; - if (c) { + if(c) { var e = e + (": " + c), f = d - } else { - a && (e += ": " + a, f = b); + }else { + a && (e += ": " + a, f = b) } - a = new goog.asserts.AssertionError("" + e, f || []); - goog.asserts.errorHandler_(a); -}; -goog.asserts.setErrorHandler = function(a) { - goog.asserts.ENABLE_ASSERTS && (goog.asserts.errorHandler_ = a); + throw new goog.asserts.AssertionError("" + e, f || []); }; goog.asserts.assert = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !a && goog.asserts.doAssertFailure_("", null, b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.fail = function(a, b) { - goog.asserts.ENABLE_ASSERTS && goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1))); + if(goog.asserts.ENABLE_ASSERTS) { + throw new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1)); + } }; goog.asserts.assertNumber = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isNumber(a) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.assertString = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isString(a) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.assertFunction = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isFunction(a) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.assertObject = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isObject(a) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.assertArray = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isArray(a) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.assertBoolean = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(a) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; -}; -goog.asserts.assertElement = function(a, b, c) { - !goog.asserts.ENABLE_ASSERTS || goog.isObject(a) && a.nodeType == goog.dom.NodeType.ELEMENT || goog.asserts.doAssertFailure_("Expected Element but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a; + return a }; goog.asserts.assertInstanceof = function(a, b, c, d) { !goog.asserts.ENABLE_ASSERTS || a instanceof b || goog.asserts.doAssertFailure_("instanceof check failed.", null, c, Array.prototype.slice.call(arguments, 3)); - return a; -}; -goog.asserts.assertObjectPrototypeIsIntact = function() { - for (var a in Object.prototype) { - goog.asserts.fail(a + " should not be enumerable in Object.prototype."); - } + return a }; goog.array = {}; goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE; -goog.array.ASSUME_NATIVE_FUNCTIONS = !1; goog.array.peek = function(a) { - return a[a.length - 1]; + return a[a.length - 1] }; -goog.array.last = goog.array.peek; goog.array.ARRAY_PROTOTYPE_ = Array.prototype; -goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.indexOf) ? function(a, b, c) { +goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.indexOf ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c); + return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c) } : function(a, b, c) { c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c; - if (goog.isString(a)) { - return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1; + if(goog.isString(a)) { + return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1 } - for (;c < a.length;c++) { - if (c in a && a[c] === b) { - return c; + for(;c < a.length;c++) { + if(c in a && a[c] === b) { + return c } } - return-1; + return-1 }; -goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.lastIndexOf) ? function(a, b, c) { +goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.lastIndexOf ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c); + return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c) } : function(a, b, c) { c = null == c ? a.length - 1 : c; 0 > c && (c = Math.max(0, a.length + c)); - if (goog.isString(a)) { - return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1; + if(goog.isString(a)) { + return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1 } - for (;0 <= c;c--) { - if (c in a && a[c] === b) { - return c; + for(;0 <= c;c--) { + if(c in a && a[c] === b) { + return c } } - return-1; + return-1 }; -goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.forEach) ? function(a, b, c) { +goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.forEach ? function(a, b, c) { goog.asserts.assert(null != a.length); - goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c); + goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c) } : function(a, b, c) { - for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - f in e && b.call(c, e[f], f, a); + for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + f in e && b.call(c, e[f], f, a) } }; goog.array.forEachRight = function(a, b, c) { - for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { - d in e && b.call(c, e[d], d, a); + for(var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { + d in e && b.call(c, e[d], d, a) } }; -goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.filter) ? function(a, b, c) { +goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.filter ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c); + return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c) } : function(a, b, c) { - for (var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { - if (h in g) { + for(var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { + if(h in g) { var k = g[h]; - b.call(c, k, h, a) && (e[f++] = k); + b.call(c, k, h, a) && (e[f++] = k) } } - return e; + return e }; -goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.map) ? function(a, b, c) { +goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.map ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c); + return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c) } : function(a, b, c) { - for (var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { - g in f && (e[g] = b.call(c, f[g], g, a)); + for(var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { + g in f && (e[g] = b.call(c, f[g], g, a)) } - return e; + return e }; -goog.array.reduce = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduce) ? function(a, b, c, d) { - goog.asserts.assert(null != a.length); - d && (b = goog.bind(b, d)); - return goog.array.ARRAY_PROTOTYPE_.reduce.call(a, b, c); -} : function(a, b, c, d) { +goog.array.reduce = function(a, b, c, d) { + if(a.reduce) { + return d ? a.reduce(goog.bind(b, d), c) : a.reduce(b, c) + } var e = c; goog.array.forEach(a, function(c, g) { - e = b.call(d, e, c, g, a); + e = b.call(d, e, c, g, a) }); - return e; + return e }; -goog.array.reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduceRight) ? function(a, b, c, d) { - goog.asserts.assert(null != a.length); - d && (b = goog.bind(b, d)); - return goog.array.ARRAY_PROTOTYPE_.reduceRight.call(a, b, c); -} : function(a, b, c, d) { +goog.array.reduceRight = function(a, b, c, d) { + if(a.reduceRight) { + return d ? a.reduceRight(goog.bind(b, d), c) : a.reduceRight(b, c) + } var e = c; goog.array.forEachRight(a, function(c, g) { - e = b.call(d, e, c, g, a); + e = b.call(d, e, c, g, a) }); - return e; + return e }; -goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.some) ? function(a, b, c) { +goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.some ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c); + return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c) } : function(a, b, c) { - for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if (f in e && b.call(c, e[f], f, a)) { - return!0; + for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if(f in e && b.call(c, e[f], f, a)) { + return!0 } } - return!1; + return!1 }; -goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.every) ? function(a, b, c) { +goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.every ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c); + return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c) } : function(a, b, c) { - for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if (f in e && !b.call(c, e[f], f, a)) { - return!1; + for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if(f in e && !b.call(c, e[f], f, a)) { + return!1 } } - return!0; + return!0 }; goog.array.count = function(a, b, c) { var d = 0; goog.array.forEach(a, function(a, f, g) { - b.call(c, a, f, g) && ++d; + b.call(c, a, f, g) && ++d }, c); - return d; + return d }; goog.array.find = function(a, b, c) { b = goog.array.findIndex(a, b, c); - return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; + return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b] }; goog.array.findIndex = function(a, b, c) { - for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if (f in e && b.call(c, e[f], f, a)) { - return f; + for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if(f in e && b.call(c, e[f], f, a)) { + return f } } - return-1; + return-1 }; goog.array.findRight = function(a, b, c) { b = goog.array.findIndexRight(a, b, c); - return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; + return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b] }; goog.array.findIndexRight = function(a, b, c) { - for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { - if (d in e && b.call(c, e[d], d, a)) { - return d; + for(var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { + if(d in e && b.call(c, e[d], d, a)) { + return d } } - return-1; + return-1 }; goog.array.contains = function(a, b) { - return 0 <= goog.array.indexOf(a, b); + return 0 <= goog.array.indexOf(a, b) }; goog.array.isEmpty = function(a) { - return 0 == a.length; + return 0 == a.length }; goog.array.clear = function(a) { - if (!goog.isArray(a)) { - for (var b = a.length - 1;0 <= b;b--) { - delete a[b]; + if(!goog.isArray(a)) { + for(var b = a.length - 1;0 <= b;b--) { + delete a[b] } } - a.length = 0; + a.length = 0 }; goog.array.insert = function(a, b) { - goog.array.contains(a, b) || a.push(b); + goog.array.contains(a, b) || a.push(b) }; goog.array.insertAt = function(a, b, c) { - goog.array.splice(a, c, 0, b); + goog.array.splice(a, c, 0, b) }; goog.array.insertArrayAt = function(a, b, c) { - goog.partial(goog.array.splice, a, c, 0).apply(null, b); + goog.partial(goog.array.splice, a, c, 0).apply(null, b) }; goog.array.insertBefore = function(a, b, c) { var d; - 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d); + 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d) }; goog.array.remove = function(a, b) { var c = goog.array.indexOf(a, b), d; (d = 0 <= c) && goog.array.removeAt(a, c); - return d; + return d }; goog.array.removeAt = function(a, b) { goog.asserts.assert(null != a.length); - return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length; + return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length }; goog.array.removeIf = function(a, b, c) { b = goog.array.findIndex(a, b, c); - return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1; + return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1 }; goog.array.concat = function(a) { - return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); -}; -goog.array.join = function(a) { - return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); + return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments) }; goog.array.toArray = function(a) { var b = a.length; - if (0 < b) { - for (var c = Array(b), d = 0;d < b;d++) { - c[d] = a[d]; + if(0 < b) { + for(var c = Array(b), d = 0;d < b;d++) { + c[d] = a[d] } - return c; + return c } - return[]; + return[] }; goog.array.clone = goog.array.toArray; goog.array.extend = function(a, b) { - for (var c = 1;c < arguments.length;c++) { + for(var c = 1;c < arguments.length;c++) { var d = arguments[c], e; - if (goog.isArray(d) || (e = goog.isArrayLike(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) { - a.push.apply(a, d); - } else { - if (e) { - for (var f = a.length, g = d.length, h = 0;h < g;h++) { - a[f + h] = d[h]; + if(goog.isArray(d) || (e = goog.isArrayLike(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) { + a.push.apply(a, d) + }else { + if(e) { + for(var f = a.length, g = d.length, h = 0;h < g;h++) { + a[f + h] = d[h] } - } else { - a.push(d); + }else { + a.push(d) } } } }; goog.array.splice = function(a, b, c, d) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)); + return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)) }; goog.array.slice = function(a, b, c) { goog.asserts.assert(null != a.length); - return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c); + return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c) }; -goog.array.removeDuplicates = function(a, b, c) { - b = b || a; - var d = function(a) { - return goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g; - }; - c = c || d; - for (var d = {}, e = 0, f = 0;f < a.length;) { - var g = a[f++], h = c(g); - Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, b[e++] = g); +goog.array.removeDuplicates = function(a, b) { + for(var c = b || a, d = {}, e = 0, f = 0;f < a.length;) { + var g = a[f++], h = goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g; + Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, c[e++] = g) } - b.length = e; + c.length = e }; goog.array.binarySearch = function(a, b, c) { - return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b); + return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b) }; goog.array.binarySelect = function(a, b, c) { - return goog.array.binarySearch_(a, b, !0, void 0, c); + return goog.array.binarySearch_(a, b, !0, void 0, c) }; goog.array.binarySearch_ = function(a, b, c, d, e) { - for (var f = 0, g = a.length, h;f < g;) { + for(var f = 0, g = a.length, h;f < g;) { var k = f + g >> 1, l; l = c ? b.call(e, a[k], k, a) : b(d, a[k]); - 0 < l ? f = k + 1 : (g = k, h = !l); + 0 < l ? f = k + 1 : (g = k, h = !l) } - return h ? f : ~f; + return h ? f : ~f }; goog.array.sort = function(a, b) { - a.sort(b || goog.array.defaultCompare); + goog.asserts.assert(null != a.length); + goog.array.ARRAY_PROTOTYPE_.sort.call(a, b || goog.array.defaultCompare) }; goog.array.stableSort = function(a, b) { - for (var c = 0;c < a.length;c++) { - a[c] = {index:c, value:a[c]}; + for(var c = 0;c < a.length;c++) { + a[c] = {index:c, value:a[c]} } var d = b || goog.array.defaultCompare; goog.array.sort(a, function(a, b) { - return d(a.value, b.value) || a.index - b.index; + return d(a.value, b.value) || a.index - b.index }); - for (c = 0;c < a.length;c++) { - a[c] = a[c].value; + for(c = 0;c < a.length;c++) { + a[c] = a[c].value } }; goog.array.sortObjectsByKey = function(a, b, c) { var d = c || goog.array.defaultCompare; goog.array.sort(a, function(a, c) { - return d(a[b], c[b]); - }); + return d(a[b], c[b]) + }) }; goog.array.isSorted = function(a, b, c) { b = b || goog.array.defaultCompare; - for (var d = 1;d < a.length;d++) { + for(var d = 1;d < a.length;d++) { var e = b(a[d - 1], a[d]); - if (0 < e || 0 == e && c) { - return!1; + if(0 < e || 0 == e && c) { + return!1 } } - return!0; + return!0 }; goog.array.equals = function(a, b, c) { - if (!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { - return!1; + if(!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { + return!1 } var d = a.length; c = c || goog.array.defaultCompareEquality; - for (var e = 0;e < d;e++) { - if (!c(a[e], b[e])) { - return!1; + for(var e = 0;e < d;e++) { + if(!c(a[e], b[e])) { + return!1 } } - return!0; + return!0 +}; +goog.array.compare = function(a, b, c) { + return goog.array.equals(a, b, c) }; goog.array.compare3 = function(a, b, c) { c = c || goog.array.defaultCompare; - for (var d = Math.min(a.length, b.length), e = 0;e < d;e++) { + for(var d = Math.min(a.length, b.length), e = 0;e < d;e++) { var f = c(a[e], b[e]); - if (0 != f) { - return f; + if(0 != f) { + return f } } - return goog.array.defaultCompare(a.length, b.length); + return goog.array.defaultCompare(a.length, b.length) }; goog.array.defaultCompare = function(a, b) { - return a > b ? 1 : a < b ? -1 : 0; + return a > b ? 1 : a < b ? -1 : 0 }; goog.array.defaultCompareEquality = function(a, b) { - return a === b; + return a === b }; goog.array.binaryInsert = function(a, b, c) { c = goog.array.binarySearch(a, b, c); - return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1; + return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1 }; goog.array.binaryRemove = function(a, b, c) { b = goog.array.binarySearch(a, b, c); - return 0 <= b ? goog.array.removeAt(a, b) : !1; + return 0 <= b ? goog.array.removeAt(a, b) : !1 }; -goog.array.bucket = function(a, b, c) { - for (var d = {}, e = 0;e < a.length;e++) { - var f = a[e], g = b.call(c, f, e, a); - goog.isDef(g) && (d[g] || (d[g] = [])).push(f); +goog.array.bucket = function(a, b) { + for(var c = {}, d = 0;d < a.length;d++) { + var e = a[d], f = b(e, d, a); + goog.isDef(f) && (c[f] || (c[f] = [])).push(e) } - return d; + return c }; goog.array.toObject = function(a, b, c) { var d = {}; goog.array.forEach(a, function(e, f) { - d[b.call(c, e, f, a)] = e; + d[b.call(c, e, f, a)] = e }); - return d; + return d }; goog.array.range = function(a, b, c) { var d = [], e = 0, f = a; c = c || 1; void 0 !== b && (e = a, f = b); - if (0 > c * (f - e)) { - return[]; + if(0 > c * (f - e)) { + return[] } - if (0 < c) { - for (a = e;a < f;a += c) { - d.push(a); + if(0 < c) { + for(a = e;a < f;a += c) { + d.push(a) } - } else { - for (a = e;a > f;a += c) { - d.push(a); + }else { + for(a = e;a > f;a += c) { + d.push(a) } } - return d; + return d }; goog.array.repeat = function(a, b) { - for (var c = [], d = 0;d < b;d++) { - c[d] = a; + for(var c = [], d = 0;d < b;d++) { + c[d] = a } - return c; + return c }; goog.array.flatten = function(a) { - for (var b = [], c = 0;c < arguments.length;c++) { + for(var b = [], c = 0;c < arguments.length;c++) { var d = arguments[c]; - goog.isArray(d) ? b.push.apply(b, goog.array.flatten.apply(null, d)) : b.push(d); + goog.isArray(d) ? b.push.apply(b, goog.array.flatten.apply(null, d)) : b.push(d) } - return b; + return b }; goog.array.rotate = function(a, b) { goog.asserts.assert(null != a.length); a.length && (b %= a.length, 0 < b ? goog.array.ARRAY_PROTOTYPE_.unshift.apply(a, a.splice(-b, b)) : 0 > b && goog.array.ARRAY_PROTOTYPE_.push.apply(a, a.splice(0, -b))); - return a; -}; -goog.array.moveItem = function(a, b, c) { - goog.asserts.assert(0 <= b && b < a.length); - goog.asserts.assert(0 <= c && c < a.length); - b = goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1); - goog.array.ARRAY_PROTOTYPE_.splice.call(a, c, 0, b[0]); + return a }; goog.array.zip = function(a) { - if (!arguments.length) { - return[]; + if(!arguments.length) { + return[] } - for (var b = [], c = 0;;c++) { - for (var d = [], e = 0;e < arguments.length;e++) { + for(var b = [], c = 0;;c++) { + for(var d = [], e = 0;e < arguments.length;e++) { var f = arguments[e]; - if (c >= f.length) { - return b; + if(c >= f.length) { + return b } - d.push(f[c]); + d.push(f[c]) } - b.push(d); + b.push(d) } }; goog.array.shuffle = function(a, b) { - for (var c = b || Math.random, d = a.length - 1;0 < d;d--) { + for(var c = b || Math.random, d = a.length - 1;0 < d;d--) { var e = Math.floor(c() * (d + 1)), f = a[d]; a[d] = a[e]; - a[e] = f; + a[e] = f } }; -var cljs = {core:{}}; -cljs.core._STAR_clojurescript_version_STAR_ = "0.0-2913"; -cljs.core._STAR_unchecked_if_STAR_ = !1; -"undefined" === typeof cljs.core._STAR_print_fn_STAR_ && (cljs.core._STAR_print_fn_STAR_ = function(a) { - throw Error("No *print-fn* fn set for evaluation environment"); -}); -cljs.core.set_print_fn_BANG_ = function(a) { - return cljs.core._STAR_print_fn_STAR_ = a; +goog.object = {}; +goog.object.forEach = function(a, b, c) { + for(var d in a) { + b.call(c, a[d], d, a) + } }; -cljs.core._STAR_flush_on_newline_STAR_ = !0; -cljs.core._STAR_print_newline_STAR_ = !0; -cljs.core._STAR_print_readably_STAR_ = !0; -cljs.core._STAR_print_meta_STAR_ = !1; -cljs.core._STAR_print_dup_STAR_ = !1; -cljs.core._STAR_print_length_STAR_ = null; -cljs.core._STAR_print_level_STAR_ = null; -"undefined" === typeof cljs.core._STAR_loaded_libs_STAR_ && (cljs.core._STAR_loaded_libs_STAR_ = null); -cljs.core.pr_opts = function() { - return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", -151457939), cljs.core._STAR_flush_on_newline_STAR_, new cljs.core.Keyword(null, "readably", "readably", 1129599760), cljs.core._STAR_print_readably_STAR_, new cljs.core.Keyword(null, "meta", "meta", 1499536964), cljs.core._STAR_print_meta_STAR_, new cljs.core.Keyword(null, "dup", "dup", 556298533), cljs.core._STAR_print_dup_STAR_, new cljs.core.Keyword(null, "print-length", "print-length", - 1931866356), cljs.core._STAR_print_length_STAR_], null); +goog.object.filter = function(a, b, c) { + var d = {}, e; + for(e in a) { + b.call(c, a[e], e, a) && (d[e] = a[e]) + } + return d }; -cljs.core.enable_console_print_BANG_ = function() { - cljs.core._STAR_print_newline_STAR_ = !1; - return cljs.core._STAR_print_fn_STAR_ = function() { - var a = function(a) { - return console.log.apply(console, cljs.core.into_array.cljs$core$IFn$_invoke$arity$1 ? cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.into_array.call(null, a)); - }, b = function(b) { - var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); - }; - b.cljs$lang$maxFixedArity = 0; - b.cljs$lang$applyTo = function(b) { - b = cljs.core.seq(b); - return a(b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(); +goog.object.map = function(a, b, c) { + var d = {}, e; + for(e in a) { + d[e] = b.call(c, a[e], e, a) + } + return d }; -cljs.core.truth_ = function(a) { - return null != a && !1 !== a; +goog.object.some = function(a, b, c) { + for(var d in a) { + if(b.call(c, a[d], d, a)) { + return!0 + } + } + return!1 }; -cljs.core.not_native = null; -cljs.core.identical_QMARK_ = function(a, b) { - return a === b; +goog.object.every = function(a, b, c) { + for(var d in a) { + if(!b.call(c, a[d], d, a)) { + return!1 + } + } + return!0 }; -cljs.core.nil_QMARK_ = function(a) { - return null == a; +goog.object.getCount = function(a) { + var b = 0, c; + for(c in a) { + b++ + } + return b }; -cljs.core.array_QMARK_ = function(a) { - return a instanceof Array; +goog.object.getAnyKey = function(a) { + for(var b in a) { + return b + } }; -cljs.core.number_QMARK_ = function(a) { - return "number" === typeof a; +goog.object.getAnyValue = function(a) { + for(var b in a) { + return a[b] + } }; -cljs.core.not = function(a) { - return cljs.core.truth_(a) ? !1 : !0; +goog.object.contains = function(a, b) { + return goog.object.containsValue(a, b) +}; +goog.object.getValues = function(a) { + var b = [], c = 0, d; + for(d in a) { + b[c++] = a[d] + } + return b +}; +goog.object.getKeys = function(a) { + var b = [], c = 0, d; + for(d in a) { + b[c++] = d + } + return b +}; +goog.object.getValueByKeys = function(a, b) { + for(var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { + } + return a +}; +goog.object.containsKey = function(a, b) { + return b in a +}; +goog.object.containsValue = function(a, b) { + for(var c in a) { + if(a[c] == b) { + return!0 + } + } + return!1 +}; +goog.object.findKey = function(a, b, c) { + for(var d in a) { + if(b.call(c, a[d], d, a)) { + return d + } + } +}; +goog.object.findValue = function(a, b, c) { + return(b = goog.object.findKey(a, b, c)) && a[b] +}; +goog.object.isEmpty = function(a) { + for(var b in a) { + return!1 + } + return!0 +}; +goog.object.clear = function(a) { + for(var b in a) { + delete a[b] + } +}; +goog.object.remove = function(a, b) { + var c; + (c = b in a) && delete a[b]; + return c +}; +goog.object.add = function(a, b, c) { + if(b in a) { + throw Error('The object already contains the key "' + b + '"'); + } + goog.object.set(a, b, c) +}; +goog.object.get = function(a, b, c) { + return b in a ? a[b] : c +}; +goog.object.set = function(a, b, c) { + a[b] = c +}; +goog.object.setIfUndefined = function(a, b, c) { + return b in a ? a[b] : a[b] = c +}; +goog.object.clone = function(a) { + var b = {}, c; + for(c in a) { + b[c] = a[c] + } + return b +}; +goog.object.unsafeClone = function(a) { + var b = goog.typeOf(a); + if("object" == b || "array" == b) { + if(a.clone) { + return a.clone() + } + var b = "array" == b ? [] : {}, c; + for(c in a) { + b[c] = goog.object.unsafeClone(a[c]) + } + return b + } + return a +}; +goog.object.transpose = function(a) { + var b = {}, c; + for(c in a) { + b[a[c]] = c + } + return b +}; +goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); +goog.object.extend = function(a, b) { + for(var c, d, e = 1;e < arguments.length;e++) { + d = arguments[e]; + for(c in d) { + a[c] = d[c] + } + for(var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { + c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]) + } + } +}; +goog.object.create = function(a) { + var b = arguments.length; + if(1 == b && goog.isArray(arguments[0])) { + return goog.object.create.apply(null, arguments[0]) + } + if(b % 2) { + throw Error("Uneven number of arguments"); + } + for(var c = {}, d = 0;d < b;d += 2) { + c[arguments[d]] = arguments[d + 1] + } + return c +}; +goog.object.createSet = function(a) { + var b = arguments.length; + if(1 == b && goog.isArray(arguments[0])) { + return goog.object.createSet.apply(null, arguments[0]) + } + for(var c = {}, d = 0;d < b;d++) { + c[arguments[d]] = !0 + } + return c +}; +goog.object.createImmutableView = function(a) { + var b = a; + Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b)); + return b +}; +goog.object.isImmutableView = function(a) { + return!!Object.isFrozen && Object.isFrozen(a) +}; +goog.string.StringBuffer = function(a, b) { + null != a && this.append.apply(this, arguments) +}; +goog.string.StringBuffer.prototype.buffer_ = ""; +goog.string.StringBuffer.prototype.set = function(a) { + this.buffer_ = "" + a +}; +goog.string.StringBuffer.prototype.append = function(a, b, c) { + this.buffer_ += a; + if(null != b) { + for(var d = 1;d < arguments.length;d++) { + this.buffer_ += arguments[d] + } + } + return this +}; +goog.string.StringBuffer.prototype.clear = function() { + this.buffer_ = "" +}; +goog.string.StringBuffer.prototype.getLength = function() { + return this.buffer_.length +}; +goog.string.StringBuffer.prototype.toString = function() { + return this.buffer_ +}; +var cljs = {core:{}}; +cljs.core._STAR_unchecked_if_STAR_ = !1; +cljs.core._STAR_print_fn_STAR_ = function(a) { + throw Error("No *print-fn* fn set for evaluation environment"); +}; +cljs.core.set_print_fn_BANG_ = function(a) { + return cljs.core._STAR_print_fn_STAR_ = a +}; +cljs.core._STAR_flush_on_newline_STAR_ = !0; +cljs.core._STAR_print_newline_STAR_ = !0; +cljs.core._STAR_print_readably_STAR_ = !0; +cljs.core._STAR_print_meta_STAR_ = !1; +cljs.core._STAR_print_dup_STAR_ = !1; +cljs.core._STAR_print_length_STAR_ = null; +cljs.core._STAR_print_level_STAR_ = null; +cljs.core.pr_opts = function() { + return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857), cljs.core._STAR_flush_on_newline_STAR_, new cljs.core.Keyword(null, "readably", "readably", 4441712502), cljs.core._STAR_print_readably_STAR_, new cljs.core.Keyword(null, "meta", "meta", 1017252215), cljs.core._STAR_print_meta_STAR_, new cljs.core.Keyword(null, "dup", "dup", 1014004081), cljs.core._STAR_print_dup_STAR_, new cljs.core.Keyword(null, "print-length", "print-length", + 3960797560), cljs.core._STAR_print_length_STAR_], null) +}; +cljs.core.enable_console_print_BANG_ = function() { + cljs.core._STAR_print_newline_STAR_ = !1; + return cljs.core._STAR_print_fn_STAR_ = function() { + var a = function(a) { + return console.log.apply(console, cljs.core.into_array.call(null, a)) + }, b = function(b) { + var d = null; + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) + }; + b.cljs$lang$maxFixedArity = 0; + b.cljs$lang$applyTo = function(b) { + b = cljs.core.seq(b); + return a(b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b + }() }; -cljs.core.some_QMARK_ = function(a) { - return null != a; +cljs.core.truth_ = function(a) { + return null != a && !1 !== a +}; +cljs.core.not_native = null; +cljs.core.identical_QMARK_ = function(a, b) { + return a === b +}; +cljs.core.nil_QMARK_ = function(a) { + return null == a +}; +cljs.core.array_QMARK_ = function(a) { + return a instanceof Array }; -cljs.core.object_QMARK_ = function(a) { - return null != a ? a.constructor === Object : !1; +cljs.core.number_QMARK_ = function(a) { + return"number" === typeof a +}; +cljs.core.not = function(a) { + return cljs.core.truth_(a) ? !1 : !0 }; cljs.core.string_QMARK_ = function(a) { - return goog.isString(a); + return goog.isString(a) }; cljs.core.native_satisfies_QMARK_ = function(a, b) { - var c; - c = goog.typeOf(null == b ? null : b); - return a[c] ? !0 : a._ ? !0 : !1; + return a[goog.typeOf(null == b ? null : b)] ? !0 : a._ ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null }; cljs.core.is_proto_ = function(a) { - return a.constructor.prototype === a; + return a.constructor.prototype === a }; cljs.core._STAR_main_cli_fn_STAR_ = null; cljs.core.type = function(a) { - return null == a ? null : a.constructor; + return null == a ? null : a.constructor }; cljs.core.missing_protocol = function(a, b) { - var c = cljs.core.type(b), c = cljs.core.truth_(cljs.core.truth_(c) ? c.cljs$lang$type : c) ? c.cljs$lang$ctorStr : goog.typeOf(b); - return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")); + var c = cljs.core.type.call(null, b), c = cljs.core.truth_(cljs.core.truth_(c) ? c.cljs$lang$type : c) ? c.cljs$lang$ctorStr : goog.typeOf(b); + return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")) }; cljs.core.type__GT_str = function(a) { var b = a.cljs$lang$ctorStr; - return cljs.core.truth_(b) ? b : "" + cljs.core.str(a); + return cljs.core.truth_(b) ? b : "" + cljs.core.str(a) }; -cljs.core.load_file = function(a) { - return cljs.core.truth_(COMPILED) ? null : goog.importScript_(a); -}; -"undefined" !== typeof Symbol && "function" === function() { - return goog.typeOf(Symbol); -}() ? cljs.core.ITER_SYMBOL = Symbol.iterator : cljs.core.ITER_SYMBOL = "@@iterator"; cljs.core.make_array = function() { - var a = null, a = function(b, c) { + var a = null, b = function(b, d) { + return a.call(null, d) + }, a = function(a, d) { switch(arguments.length) { case 1: - return Array(b); + return Array(a); case 2: - return a.cljs$core$IFn$_invoke$arity$1(c); + return b.call(this, a, d) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return Array(a); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$1(c); + return Array(a) }; - return a; + a.cljs$core$IFn$_invoke$arity$2 = b; + return a }(); cljs.core.aclone = function(a) { - for (var b = a.length, c = Array(b), d = 0;;) { - if (d < b) { - c[d] = a[d], d += 1; - } else { - break; + for(var b = a.length, c = Array(b), d = 0;;) { + if(d < b) { + c[d] = a[d], d += 1 + }else { + break } } - return c; + return c }; cljs.core.array = function(a) { - for (var b = Array(arguments.length), c = 0;;) { - if (c < b.length) { - b[c] = arguments[c], c += 1; - } else { - return b; - } - } + return Array.prototype.slice.call(arguments) }; cljs.core.aget = function() { var a = null, b = function() { var b = function(b, c, d) { - var h = a; - b = a.cljs$core$IFn$_invoke$arity$2(b, c); - return cljs.core.apply.cljs$core$IFn$_invoke$arity$3 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$3(h, b, d) : cljs.core.apply.call(null, h, b, d); + return cljs.core.apply.call(null, a, a.call(null, b, c), d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -1681,49 +1505,35 @@ cljs.core.aget = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 2: return a[d]; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a[b]; + return a[b] }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.aset = function() { var a = null, b = function() { var b = function(b, c, d, h) { - var k = a; - b = b[c]; - return cljs.core.apply.cljs$core$IFn$_invoke$arity$4 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$4(k, b, d, h) : cljs.core.apply.call(null, k, b, d, h); + return cljs.core.apply.call(null, a, b[c], d, h) }, d = function(a, d, g, h) { var k = null; - if (3 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 3);k < l.length;) { - l[k] = arguments[k + 3], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, d, g, k); + 3 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, d, g, k) }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -1733,422 +1543,312 @@ cljs.core.aset = function() { a = cljs.core.next(a); var h = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, h, a); + return b(d, g, h, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e, f) { switch(arguments.length) { case 3: return a[d] = e; default: - var g = null; - if (3 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { - h[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, e, g); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, e, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$3 = function(a, b, e) { - return a[b] = e; + return a[b] = e }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.alength = function(a) { - return a.length; + return a.length }; cljs.core.into_array = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(null, b); + return a.call(null, null, b) }, c = function(a, b) { - var c = function(a, b) { + return cljs.core.reduce.call(null, function(a, b) { a.push(b); - return a; - }, g = []; - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(c, g, b) : cljs.core.reduce.call(null, c, g, b); + return a + }, [], b) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.js_invoke = function() { - var a = function(a, b, e) { - return a[b].apply(a, cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(e)); - }, b = function(b, d, e) { - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return a.call(this, b, d, f); - }; - b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = function(b) { - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(d, e, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return a }(); cljs.core.Fn = function() { - return{}; + return{} }(); cljs.core.IFn = function() { - return{}; + return{} }(); cljs.core._invoke = function() { var a = null, b = function(a) { - if (a ? a.cljs$core$IFn$_invoke$arity$1 : a) { - return a.cljs$core$IFn$_invoke$arity$1(a); + if(a ? a.cljs$core$IFn$_invoke$arity$1 : a) { + return a.cljs$core$IFn$_invoke$arity$1(a) } var b; - b = cljs.core._invoke; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._invoke._, !b)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + b = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._invoke._, !b)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return b.call(null, a); + return b.call(null, a) }, c = function(a, b) { - if (a ? a.cljs$core$IFn$_invoke$arity$2 : a) { - return a.cljs$core$IFn$_invoke$arity$2(a, b); + if(a ? a.cljs$core$IFn$_invoke$arity$2 : a) { + return a.cljs$core$IFn$_invoke$arity$2(a, b) } var c; - c = cljs.core._invoke; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._invoke._, !c)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + c = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._invoke._, !c)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return c.call(null, a, b); + return c.call(null, a, b) }, d = function(a, b, c) { - if (a ? a.cljs$core$IFn$_invoke$arity$3 : a) { - return a.cljs$core$IFn$_invoke$arity$3(a, b, c); + if(a ? a.cljs$core$IFn$_invoke$arity$3 : a) { + return a.cljs$core$IFn$_invoke$arity$3(a, b, c) } var d; - d = cljs.core._invoke; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._invoke._, !d)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + d = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._invoke._, !d)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }, e = function(a, b, c, d) { - if (a ? a.cljs$core$IFn$_invoke$arity$4 : a) { - return a.cljs$core$IFn$_invoke$arity$4(a, b, c, d); + if(a ? a.cljs$core$IFn$_invoke$arity$4 : a) { + return a.cljs$core$IFn$_invoke$arity$4(a, b, c, d) } var e; - e = cljs.core._invoke; - var f; - f = goog.typeOf(null == a ? null : a); - e = e[f]; - if (!e && (e = cljs.core._invoke._, !e)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + e = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!e && (e = cljs.core._invoke._, !e)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return e.call(null, a, b, c, d); + return e.call(null, a, b, c, d) }, f = function(a, b, c, d, e) { - if (a ? a.cljs$core$IFn$_invoke$arity$5 : a) { - return a.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e); + if(a ? a.cljs$core$IFn$_invoke$arity$5 : a) { + return a.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) } var f; - f = cljs.core._invoke; - var g; - g = goog.typeOf(null == a ? null : a); - f = f[g]; - if (!f && (f = cljs.core._invoke._, !f)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + f = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!f && (f = cljs.core._invoke._, !f)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return f.call(null, a, b, c, d, e); + return f.call(null, a, b, c, d, e) }, g = function(a, b, c, d, e, f) { - if (a ? a.cljs$core$IFn$_invoke$arity$6 : a) { - return a.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f); + if(a ? a.cljs$core$IFn$_invoke$arity$6 : a) { + return a.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) } var g; - g = cljs.core._invoke; - var h; - h = goog.typeOf(null == a ? null : a); - g = g[h]; - if (!g && (g = cljs.core._invoke._, !g)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + g = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!g && (g = cljs.core._invoke._, !g)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return g.call(null, a, b, c, d, e, f); + return g.call(null, a, b, c, d, e, f) }, h = function(a, b, c, d, e, f, g) { - if (a ? a.cljs$core$IFn$_invoke$arity$7 : a) { - return a.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g); + if(a ? a.cljs$core$IFn$_invoke$arity$7 : a) { + return a.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) } var h; - h = cljs.core._invoke; - var k; - k = goog.typeOf(null == a ? null : a); - h = h[k]; - if (!h && (h = cljs.core._invoke._, !h)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + h = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!h && (h = cljs.core._invoke._, !h)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return h.call(null, a, b, c, d, e, f, g); + return h.call(null, a, b, c, d, e, f, g) }, k = function(a, b, c, d, e, f, g, h) { - if (a ? a.cljs$core$IFn$_invoke$arity$8 : a) { - return a.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h); + if(a ? a.cljs$core$IFn$_invoke$arity$8 : a) { + return a.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) } var k; - k = cljs.core._invoke; - var l; - l = goog.typeOf(null == a ? null : a); - k = k[l]; - if (!k && (k = cljs.core._invoke._, !k)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + k = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!k && (k = cljs.core._invoke._, !k)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return k.call(null, a, b, c, d, e, f, g, h); + return k.call(null, a, b, c, d, e, f, g, h) }, l = function(a, b, c, d, e, f, g, h, k) { - if (a ? a.cljs$core$IFn$_invoke$arity$9 : a) { - return a.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k); + if(a ? a.cljs$core$IFn$_invoke$arity$9 : a) { + return a.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) } var l; - l = cljs.core._invoke; - var m; - m = goog.typeOf(null == a ? null : a); - l = l[m]; - if (!l && (l = cljs.core._invoke._, !l)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + l = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!l && (l = cljs.core._invoke._, !l)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return l.call(null, a, b, c, d, e, f, g, h, k); + return l.call(null, a, b, c, d, e, f, g, h, k) }, m = function(a, b, c, d, e, f, g, h, k, l) { - if (a ? a.cljs$core$IFn$_invoke$arity$10 : a) { - return a.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l); + if(a ? a.cljs$core$IFn$_invoke$arity$10 : a) { + return a.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) } var m; - m = cljs.core._invoke; - var q; - q = goog.typeOf(null == a ? null : a); - m = m[q]; - if (!m && (m = cljs.core._invoke._, !m)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + m = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!m && (m = cljs.core._invoke._, !m)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return m.call(null, a, b, c, d, e, f, g, h, k, l); + return m.call(null, a, b, c, d, e, f, g, h, k, l) }, n = function(a, b, c, d, e, f, g, h, k, l, m) { - if (a ? a.cljs$core$IFn$_invoke$arity$11 : a) { - return a.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m); + if(a ? a.cljs$core$IFn$_invoke$arity$11 : a) { + return a.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) } - var q; - q = cljs.core._invoke; var n; - n = goog.typeOf(null == a ? null : a); - q = q[n]; - if (!q && (q = cljs.core._invoke._, !q)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + n = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!n && (n = cljs.core._invoke._, !n)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + } + return n.call(null, a, b, c, d, e, f, g, h, k, l, m) + }, p = function(a, b, c, d, e, f, g, h, k, l, m, n) { + if(a ? a.cljs$core$IFn$_invoke$arity$12 : a) { + return a.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) } - return q.call(null, a, b, c, d, e, f, g, h, k, l, m); - }, p = function(a, b, c, d, e, f, g, h, k, l, m, q) { - if (a ? a.cljs$core$IFn$_invoke$arity$12 : a) { - return a.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, q); + var p; + p = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!p && (p = cljs.core._invoke._, !p)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - var n; - n = cljs.core._invoke; - var r; - r = goog.typeOf(null == a ? null : a); - n = n[r]; - if (!n && (n = cljs.core._invoke._, !n)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + return p.call(null, a, b, c, d, e, f, g, h, k, l, m, n) + }, q = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { + if(a ? a.cljs$core$IFn$_invoke$arity$13 : a) { + return a.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) + } + var q; + q = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!q && (q = cljs.core._invoke._, !q)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return n.call(null, a, b, c, d, e, f, g, h, k, l, m, q); - }, q = function(a, b, c, d, e, f, g, h, k, l, m, q, n) { - if (a ? a.cljs$core$IFn$_invoke$arity$13 : a) { - return a.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, q, n); + return q.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p) + }, r = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { + if(a ? a.cljs$core$IFn$_invoke$arity$14 : a) { + return a.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) } var r; - r = cljs.core._invoke; - var p; - p = goog.typeOf(null == a ? null : a); - r = r[p]; - if (!r && (r = cljs.core._invoke._, !r)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + r = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!r && (r = cljs.core._invoke._, !r)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return r.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n); - }, r = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r) { - if (a ? a.cljs$core$IFn$_invoke$arity$14 : a) { - return a.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, q, n, r); + return r.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q) + }, s = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { + if(a ? a.cljs$core$IFn$_invoke$arity$15 : a) { + return a.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) } - var p; - p = cljs.core._invoke; var s; - s = goog.typeOf(null == a ? null : a); - p = p[s]; - if (!p && (p = cljs.core._invoke._, !p)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + s = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!s && (s = cljs.core._invoke._, !s)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return p.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r); - }, s = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p) { - if (a ? a.cljs$core$IFn$_invoke$arity$15 : a) { - return a.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p); + return s.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) + }, t = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { + if(a ? a.cljs$core$IFn$_invoke$arity$16 : a) { + return a.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) } - var s; - s = cljs.core._invoke; var t; - t = goog.typeOf(null == a ? null : a); - s = s[t]; - if (!s && (s = cljs.core._invoke._, !s)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + t = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!t && (t = cljs.core._invoke._, !t)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return s.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p); - }, t = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) { - if (a ? a.cljs$core$IFn$_invoke$arity$16 : a) { - return a.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); + return t.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) + }, v = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { + if(a ? a.cljs$core$IFn$_invoke$arity$17 : a) { + return a.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) } - var t; - t = cljs.core._invoke; var u; - u = goog.typeOf(null == a ? null : a); - t = t[u]; - if (!t && (t = cljs.core._invoke._, !t)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + u = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!u && (u = cljs.core._invoke._, !u)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return t.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); - }, u = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) { - if (a ? a.cljs$core$IFn$_invoke$arity$17 : a) { - return a.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); + return u.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) + }, u = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { + if(a ? a.cljs$core$IFn$_invoke$arity$18 : a) { + return a.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) } - var u; - u = cljs.core._invoke; - var v; - v = goog.typeOf(null == a ? null : a); - u = u[v]; - if (!u && (u = cljs.core._invoke._, !u)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + var w; + w = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!w && (w = cljs.core._invoke._, !w)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return u.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); - }, v = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) { - if (a ? a.cljs$core$IFn$_invoke$arity$18 : a) { - return a.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); + return w.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) + }, w = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) { + if(a ? a.cljs$core$IFn$_invoke$arity$19 : a) { + return a.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) } var v; - v = cljs.core._invoke; - var w; - w = goog.typeOf(null == a ? null : a); - v = v[w]; - if (!v && (v = cljs.core._invoke._, !v)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); + v = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!v && (v = cljs.core._invoke._, !v)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return v.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); - }, w = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) { - if (a ? a.cljs$core$IFn$_invoke$arity$19 : a) { - return a.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); + return v.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) + }, B = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) { + if(a ? a.cljs$core$IFn$_invoke$arity$20 : a) { + return a.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) } - var w; - w = cljs.core._invoke; - var y; - y = goog.typeOf(null == a ? null : a); - w = w[y]; - if (!w && (w = cljs.core._invoke._, !w)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); - } - return w.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); - }, y = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) { - if (a ? a.cljs$core$IFn$_invoke$arity$20 : a) { - return a.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); - } - var y; - y = cljs.core._invoke; - var F; - F = goog.typeOf(null == a ? null : a); - y = y[F]; - if (!y && (y = cljs.core._invoke._, !y)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); - } - return y.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); - }, F = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) { - if (a ? a.cljs$core$IFn$_invoke$arity$21 : a) { - return a.cljs$core$IFn$_invoke$arity$21(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); - } - var F; - F = cljs.core._invoke; - var L; - L = goog.typeOf(null == a ? null : a); - F = F[L]; - if (!F && (F = cljs.core._invoke._, !F)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); - } - return F.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); - }, L = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) { - if (a ? a.cljs$core$IFn$_invoke$arity$22 : a) { - return a.cljs$core$IFn$_invoke$arity$22(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); - } - var L; - L = cljs.core._invoke; - var V; - V = goog.typeOf(null == a ? null : a); - L = L[V]; - if (!L && (L = cljs.core._invoke._, !L)) { - throw cljs.core.missing_protocol("IFn.-invoke", a); - } - return L.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); - }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { + var B; + B = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!B && (B = cljs.core._invoke._, !B)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + } + return B.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) + }, I = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) { + if(a ? a.cljs$core$IFn$_invoke$arity$21 : a) { + return a.cljs$core$IFn$_invoke$arity$21(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) + } + var I; + I = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; + if(!I && (I = cljs.core._invoke._, !I)) { + throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); + } + return I.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) + }, a = function(a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T) { switch(arguments.length) { case 1: return b.call(this, a); case 2: return c.call(this, a, x); case 3: - return d.call(this, a, x, z); + return d.call(this, a, x, y); case 4: - return e.call(this, a, x, z, A); + return e.call(this, a, x, y, z); case 5: - return f.call(this, a, x, z, A, B); + return f.call(this, a, x, y, z, A); case 6: - return g.call(this, a, x, z, A, B, C); + return g.call(this, a, x, y, z, A, C); case 7: - return h.call(this, a, x, z, A, B, C, D); + return h.call(this, a, x, y, z, A, C, D); case 8: - return k.call(this, a, x, z, A, B, C, D, E); + return k.call(this, a, x, y, z, A, C, D, E); case 9: - return l.call(this, a, x, z, A, B, C, D, E, G); + return l.call(this, a, x, y, z, A, C, D, E, F); case 10: - return m.call(this, a, x, z, A, B, C, D, E, G, H); + return m.call(this, a, x, y, z, A, C, D, E, F, G); case 11: - return n.call(this, a, x, z, A, B, C, D, E, G, H, I); + return n.call(this, a, x, y, z, A, C, D, E, F, G, H); case 12: - return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); + return p.call(this, a, x, y, z, A, C, D, E, F, G, H, J); case 13: - return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); + return q.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K); case 14: - return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); + return r.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L); case 15: - return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); + return s.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M); case 16: - return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); + return t.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N); case 17: - return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); + return v.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O); case 18: - return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); + return u.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P); case 19: - return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); + return w.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q); case 20: - return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); + return B.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S); case 21: - return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); - case 22: - return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); + return I.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T) } throw Error("Invalid arity: " + arguments.length); }; @@ -2168,1250 +1868,846 @@ cljs.core._invoke = function() { a.cljs$core$IFn$_invoke$arity$14 = r; a.cljs$core$IFn$_invoke$arity$15 = s; a.cljs$core$IFn$_invoke$arity$16 = t; - a.cljs$core$IFn$_invoke$arity$17 = u; - a.cljs$core$IFn$_invoke$arity$18 = v; + a.cljs$core$IFn$_invoke$arity$17 = v; + a.cljs$core$IFn$_invoke$arity$18 = u; a.cljs$core$IFn$_invoke$arity$19 = w; - a.cljs$core$IFn$_invoke$arity$20 = y; - a.cljs$core$IFn$_invoke$arity$21 = F; - a.cljs$core$IFn$_invoke$arity$22 = L; - return a; + a.cljs$core$IFn$_invoke$arity$20 = B; + a.cljs$core$IFn$_invoke$arity$21 = I; + return a }(); -cljs.core.ICloneable = function() { - return{}; -}(); -cljs.core._clone = function(a) { - if (a ? a.cljs$core$ICloneable$_clone$arity$1 : a) { - return a.cljs$core$ICloneable$_clone$arity$1(a); - } - var b; - b = cljs.core._clone; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._clone._, !b)) { - throw cljs.core.missing_protocol("ICloneable.-clone", a); - } - return b.call(null, a); -}; cljs.core.ICounted = function() { - return{}; + return{} }(); cljs.core._count = function(a) { - if (a ? a.cljs$core$ICounted$_count$arity$1 : a) { - return a.cljs$core$ICounted$_count$arity$1(a); + if(a ? a.cljs$core$ICounted$_count$arity$1 : a) { + return a.cljs$core$ICounted$_count$arity$1(a) } var b; - b = cljs.core._count; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._count._, !b)) { - throw cljs.core.missing_protocol("ICounted.-count", a); + b = cljs.core._count[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._count._, !b)) { + throw cljs.core.missing_protocol.call(null, "ICounted.-count", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IEmptyableCollection = function() { - return{}; + return{} }(); cljs.core._empty = function(a) { - if (a ? a.cljs$core$IEmptyableCollection$_empty$arity$1 : a) { - return a.cljs$core$IEmptyableCollection$_empty$arity$1(a); + if(a ? a.cljs$core$IEmptyableCollection$_empty$arity$1 : a) { + return a.cljs$core$IEmptyableCollection$_empty$arity$1(a) } var b; - b = cljs.core._empty; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._empty._, !b)) { - throw cljs.core.missing_protocol("IEmptyableCollection.-empty", a); + b = cljs.core._empty[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._empty._, !b)) { + throw cljs.core.missing_protocol.call(null, "IEmptyableCollection.-empty", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ICollection = function() { - return{}; + return{} }(); cljs.core._conj = function(a, b) { - if (a ? a.cljs$core$ICollection$_conj$arity$2 : a) { - return a.cljs$core$ICollection$_conj$arity$2(a, b); + if(a ? a.cljs$core$ICollection$_conj$arity$2 : a) { + return a.cljs$core$ICollection$_conj$arity$2(a, b) } var c; - c = cljs.core._conj; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._conj._, !c)) { - throw cljs.core.missing_protocol("ICollection.-conj", a); + c = cljs.core._conj[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._conj._, !c)) { + throw cljs.core.missing_protocol.call(null, "ICollection.-conj", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IIndexed = function() { - return{}; + return{} }(); cljs.core._nth = function() { var a = null, b = function(a, b) { - if (a ? a.cljs$core$IIndexed$_nth$arity$2 : a) { - return a.cljs$core$IIndexed$_nth$arity$2(a, b); + if(a ? a.cljs$core$IIndexed$_nth$arity$2 : a) { + return a.cljs$core$IIndexed$_nth$arity$2(a, b) } var c; - c = cljs.core._nth; - var g; - g = goog.typeOf(null == a ? null : a); - c = c[g]; - if (!c && (c = cljs.core._nth._, !c)) { - throw cljs.core.missing_protocol("IIndexed.-nth", a); + c = cljs.core._nth[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._nth._, !c)) { + throw cljs.core.missing_protocol.call(null, "IIndexed.-nth", a); } - return c.call(null, a, b); + return c.call(null, a, b) }, c = function(a, b, c) { - if (a ? a.cljs$core$IIndexed$_nth$arity$3 : a) { - return a.cljs$core$IIndexed$_nth$arity$3(a, b, c); + if(a ? a.cljs$core$IIndexed$_nth$arity$3 : a) { + return a.cljs$core$IIndexed$_nth$arity$3(a, b, c) } var g; - g = cljs.core._nth; - var h; - h = goog.typeOf(null == a ? null : a); - g = g[h]; - if (!g && (g = cljs.core._nth._, !g)) { - throw cljs.core.missing_protocol("IIndexed.-nth", a); + g = cljs.core._nth[goog.typeOf(null == a ? null : a)]; + if(!g && (g = cljs.core._nth._, !g)) { + throw cljs.core.missing_protocol.call(null, "IIndexed.-nth", a); } - return g.call(null, a, b, c); + return g.call(null, a, b, c) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.ASeq = function() { - return{}; + return{} }(); cljs.core.ISeq = function() { - return{}; + return{} }(); cljs.core._first = function(a) { - if (a ? a.cljs$core$ISeq$_first$arity$1 : a) { - return a.cljs$core$ISeq$_first$arity$1(a); + if(a ? a.cljs$core$ISeq$_first$arity$1 : a) { + return a.cljs$core$ISeq$_first$arity$1(a) } var b; - b = cljs.core._first; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._first._, !b)) { - throw cljs.core.missing_protocol("ISeq.-first", a); + b = cljs.core._first[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._first._, !b)) { + throw cljs.core.missing_protocol.call(null, "ISeq.-first", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._rest = function(a) { - if (a ? a.cljs$core$ISeq$_rest$arity$1 : a) { - return a.cljs$core$ISeq$_rest$arity$1(a); + if(a ? a.cljs$core$ISeq$_rest$arity$1 : a) { + return a.cljs$core$ISeq$_rest$arity$1(a) } var b; - b = cljs.core._rest; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._rest._, !b)) { - throw cljs.core.missing_protocol("ISeq.-rest", a); + b = cljs.core._rest[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._rest._, !b)) { + throw cljs.core.missing_protocol.call(null, "ISeq.-rest", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.INext = function() { - return{}; + return{} }(); cljs.core._next = function(a) { - if (a ? a.cljs$core$INext$_next$arity$1 : a) { - return a.cljs$core$INext$_next$arity$1(a); + if(a ? a.cljs$core$INext$_next$arity$1 : a) { + return a.cljs$core$INext$_next$arity$1(a) } var b; - b = cljs.core._next; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._next._, !b)) { - throw cljs.core.missing_protocol("INext.-next", a); + b = cljs.core._next[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._next._, !b)) { + throw cljs.core.missing_protocol.call(null, "INext.-next", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ILookup = function() { - return{}; + return{} }(); cljs.core._lookup = function() { var a = null, b = function(a, b) { - if (a ? a.cljs$core$ILookup$_lookup$arity$2 : a) { - return a.cljs$core$ILookup$_lookup$arity$2(a, b); + if(a ? a.cljs$core$ILookup$_lookup$arity$2 : a) { + return a.cljs$core$ILookup$_lookup$arity$2(a, b) } var c; - c = cljs.core._lookup; - var g; - g = goog.typeOf(null == a ? null : a); - c = c[g]; - if (!c && (c = cljs.core._lookup._, !c)) { - throw cljs.core.missing_protocol("ILookup.-lookup", a); + c = cljs.core._lookup[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._lookup._, !c)) { + throw cljs.core.missing_protocol.call(null, "ILookup.-lookup", a); } - return c.call(null, a, b); + return c.call(null, a, b) }, c = function(a, b, c) { - if (a ? a.cljs$core$ILookup$_lookup$arity$3 : a) { - return a.cljs$core$ILookup$_lookup$arity$3(a, b, c); + if(a ? a.cljs$core$ILookup$_lookup$arity$3 : a) { + return a.cljs$core$ILookup$_lookup$arity$3(a, b, c) } var g; - g = cljs.core._lookup; - var h; - h = goog.typeOf(null == a ? null : a); - g = g[h]; - if (!g && (g = cljs.core._lookup._, !g)) { - throw cljs.core.missing_protocol("ILookup.-lookup", a); + g = cljs.core._lookup[goog.typeOf(null == a ? null : a)]; + if(!g && (g = cljs.core._lookup._, !g)) { + throw cljs.core.missing_protocol.call(null, "ILookup.-lookup", a); } - return g.call(null, a, b, c); + return g.call(null, a, b, c) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.IAssociative = function() { - return{}; + return{} }(); cljs.core._contains_key_QMARK_ = function(a, b) { - if (a ? a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 : a) { - return a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2(a, b); + if(a ? a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 : a) { + return a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2(a, b) } var c; - c = cljs.core._contains_key_QMARK_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._contains_key_QMARK_._, !c)) { - throw cljs.core.missing_protocol("IAssociative.-contains-key?", a); + c = cljs.core._contains_key_QMARK_[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._contains_key_QMARK_._, !c)) { + throw cljs.core.missing_protocol.call(null, "IAssociative.-contains-key?", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._assoc = function(a, b, c) { - if (a ? a.cljs$core$IAssociative$_assoc$arity$3 : a) { - return a.cljs$core$IAssociative$_assoc$arity$3(a, b, c); + if(a ? a.cljs$core$IAssociative$_assoc$arity$3 : a) { + return a.cljs$core$IAssociative$_assoc$arity$3(a, b, c) } var d; - d = cljs.core._assoc; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._assoc._, !d)) { - throw cljs.core.missing_protocol("IAssociative.-assoc", a); + d = cljs.core._assoc[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._assoc._, !d)) { + throw cljs.core.missing_protocol.call(null, "IAssociative.-assoc", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core.IMap = function() { - return{}; + return{} }(); cljs.core._dissoc = function(a, b) { - if (a ? a.cljs$core$IMap$_dissoc$arity$2 : a) { - return a.cljs$core$IMap$_dissoc$arity$2(a, b); + if(a ? a.cljs$core$IMap$_dissoc$arity$2 : a) { + return a.cljs$core$IMap$_dissoc$arity$2(a, b) } var c; - c = cljs.core._dissoc; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._dissoc._, !c)) { - throw cljs.core.missing_protocol("IMap.-dissoc", a); + c = cljs.core._dissoc[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._dissoc._, !c)) { + throw cljs.core.missing_protocol.call(null, "IMap.-dissoc", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IMapEntry = function() { - return{}; + return{} }(); cljs.core._key = function(a) { - if (a ? a.cljs$core$IMapEntry$_key$arity$1 : a) { - return a.cljs$core$IMapEntry$_key$arity$1(a); + if(a ? a.cljs$core$IMapEntry$_key$arity$1 : a) { + return a.cljs$core$IMapEntry$_key$arity$1(a) } var b; - b = cljs.core._key; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._key._, !b)) { - throw cljs.core.missing_protocol("IMapEntry.-key", a); + b = cljs.core._key[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._key._, !b)) { + throw cljs.core.missing_protocol.call(null, "IMapEntry.-key", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._val = function(a) { - if (a ? a.cljs$core$IMapEntry$_val$arity$1 : a) { - return a.cljs$core$IMapEntry$_val$arity$1(a); + if(a ? a.cljs$core$IMapEntry$_val$arity$1 : a) { + return a.cljs$core$IMapEntry$_val$arity$1(a) } var b; - b = cljs.core._val; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._val._, !b)) { - throw cljs.core.missing_protocol("IMapEntry.-val", a); + b = cljs.core._val[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._val._, !b)) { + throw cljs.core.missing_protocol.call(null, "IMapEntry.-val", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ISet = function() { - return{}; + return{} }(); cljs.core._disjoin = function(a, b) { - if (a ? a.cljs$core$ISet$_disjoin$arity$2 : a) { - return a.cljs$core$ISet$_disjoin$arity$2(a, b); + if(a ? a.cljs$core$ISet$_disjoin$arity$2 : a) { + return a.cljs$core$ISet$_disjoin$arity$2(a, b) } var c; - c = cljs.core._disjoin; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._disjoin._, !c)) { - throw cljs.core.missing_protocol("ISet.-disjoin", a); + c = cljs.core._disjoin[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._disjoin._, !c)) { + throw cljs.core.missing_protocol.call(null, "ISet.-disjoin", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IStack = function() { - return{}; + return{} }(); cljs.core._peek = function(a) { - if (a ? a.cljs$core$IStack$_peek$arity$1 : a) { - return a.cljs$core$IStack$_peek$arity$1(a); + if(a ? a.cljs$core$IStack$_peek$arity$1 : a) { + return a.cljs$core$IStack$_peek$arity$1(a) } var b; - b = cljs.core._peek; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._peek._, !b)) { - throw cljs.core.missing_protocol("IStack.-peek", a); + b = cljs.core._peek[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._peek._, !b)) { + throw cljs.core.missing_protocol.call(null, "IStack.-peek", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._pop = function(a) { - if (a ? a.cljs$core$IStack$_pop$arity$1 : a) { - return a.cljs$core$IStack$_pop$arity$1(a); + if(a ? a.cljs$core$IStack$_pop$arity$1 : a) { + return a.cljs$core$IStack$_pop$arity$1(a) } var b; - b = cljs.core._pop; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._pop._, !b)) { - throw cljs.core.missing_protocol("IStack.-pop", a); + b = cljs.core._pop[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._pop._, !b)) { + throw cljs.core.missing_protocol.call(null, "IStack.-pop", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IVector = function() { - return{}; + return{} }(); cljs.core._assoc_n = function(a, b, c) { - if (a ? a.cljs$core$IVector$_assoc_n$arity$3 : a) { - return a.cljs$core$IVector$_assoc_n$arity$3(a, b, c); + if(a ? a.cljs$core$IVector$_assoc_n$arity$3 : a) { + return a.cljs$core$IVector$_assoc_n$arity$3(a, b, c) } var d; - d = cljs.core._assoc_n; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._assoc_n._, !d)) { - throw cljs.core.missing_protocol("IVector.-assoc-n", a); + d = cljs.core._assoc_n[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._assoc_n._, !d)) { + throw cljs.core.missing_protocol.call(null, "IVector.-assoc-n", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core.IDeref = function() { - return{}; + return{} }(); cljs.core._deref = function(a) { - if (a ? a.cljs$core$IDeref$_deref$arity$1 : a) { - return a.cljs$core$IDeref$_deref$arity$1(a); + if(a ? a.cljs$core$IDeref$_deref$arity$1 : a) { + return a.cljs$core$IDeref$_deref$arity$1(a) } var b; - b = cljs.core._deref; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._deref._, !b)) { - throw cljs.core.missing_protocol("IDeref.-deref", a); + b = cljs.core._deref[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._deref._, !b)) { + throw cljs.core.missing_protocol.call(null, "IDeref.-deref", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IDerefWithTimeout = function() { - return{}; + return{} }(); cljs.core._deref_with_timeout = function(a, b, c) { - if (a ? a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3 : a) { - return a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3(a, b, c); + if(a ? a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3 : a) { + return a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3(a, b, c) } var d; - d = cljs.core._deref_with_timeout; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._deref_with_timeout._, !d)) { - throw cljs.core.missing_protocol("IDerefWithTimeout.-deref-with-timeout", a); + d = cljs.core._deref_with_timeout[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._deref_with_timeout._, !d)) { + throw cljs.core.missing_protocol.call(null, "IDerefWithTimeout.-deref-with-timeout", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core.IMeta = function() { - return{}; + return{} }(); cljs.core._meta = function(a) { - if (a ? a.cljs$core$IMeta$_meta$arity$1 : a) { - return a.cljs$core$IMeta$_meta$arity$1(a); + if(a ? a.cljs$core$IMeta$_meta$arity$1 : a) { + return a.cljs$core$IMeta$_meta$arity$1(a) } var b; - b = cljs.core._meta; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._meta._, !b)) { - throw cljs.core.missing_protocol("IMeta.-meta", a); + b = cljs.core._meta[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._meta._, !b)) { + throw cljs.core.missing_protocol.call(null, "IMeta.-meta", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IWithMeta = function() { - return{}; + return{} }(); cljs.core._with_meta = function(a, b) { - if (a ? a.cljs$core$IWithMeta$_with_meta$arity$2 : a) { - return a.cljs$core$IWithMeta$_with_meta$arity$2(a, b); + if(a ? a.cljs$core$IWithMeta$_with_meta$arity$2 : a) { + return a.cljs$core$IWithMeta$_with_meta$arity$2(a, b) } var c; - c = cljs.core._with_meta; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._with_meta._, !c)) { - throw cljs.core.missing_protocol("IWithMeta.-with-meta", a); + c = cljs.core._with_meta[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._with_meta._, !c)) { + throw cljs.core.missing_protocol.call(null, "IWithMeta.-with-meta", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IReduce = function() { - return{}; + return{} }(); cljs.core._reduce = function() { var a = null, b = function(a, b) { - if (a ? a.cljs$core$IReduce$_reduce$arity$2 : a) { - return a.cljs$core$IReduce$_reduce$arity$2(a, b); + if(a ? a.cljs$core$IReduce$_reduce$arity$2 : a) { + return a.cljs$core$IReduce$_reduce$arity$2(a, b) } var c; - c = cljs.core._reduce; - var g; - g = goog.typeOf(null == a ? null : a); - c = c[g]; - if (!c && (c = cljs.core._reduce._, !c)) { - throw cljs.core.missing_protocol("IReduce.-reduce", a); + c = cljs.core._reduce[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._reduce._, !c)) { + throw cljs.core.missing_protocol.call(null, "IReduce.-reduce", a); } - return c.call(null, a, b); + return c.call(null, a, b) }, c = function(a, b, c) { - if (a ? a.cljs$core$IReduce$_reduce$arity$3 : a) { - return a.cljs$core$IReduce$_reduce$arity$3(a, b, c); + if(a ? a.cljs$core$IReduce$_reduce$arity$3 : a) { + return a.cljs$core$IReduce$_reduce$arity$3(a, b, c) } var g; - g = cljs.core._reduce; - var h; - h = goog.typeOf(null == a ? null : a); - g = g[h]; - if (!g && (g = cljs.core._reduce._, !g)) { - throw cljs.core.missing_protocol("IReduce.-reduce", a); + g = cljs.core._reduce[goog.typeOf(null == a ? null : a)]; + if(!g && (g = cljs.core._reduce._, !g)) { + throw cljs.core.missing_protocol.call(null, "IReduce.-reduce", a); } - return g.call(null, a, b, c); + return g.call(null, a, b, c) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.IKVReduce = function() { - return{}; + return{} }(); cljs.core._kv_reduce = function(a, b, c) { - if (a ? a.cljs$core$IKVReduce$_kv_reduce$arity$3 : a) { - return a.cljs$core$IKVReduce$_kv_reduce$arity$3(a, b, c); + if(a ? a.cljs$core$IKVReduce$_kv_reduce$arity$3 : a) { + return a.cljs$core$IKVReduce$_kv_reduce$arity$3(a, b, c) } var d; - d = cljs.core._kv_reduce; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._kv_reduce._, !d)) { - throw cljs.core.missing_protocol("IKVReduce.-kv-reduce", a); + d = cljs.core._kv_reduce[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._kv_reduce._, !d)) { + throw cljs.core.missing_protocol.call(null, "IKVReduce.-kv-reduce", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core.IEquiv = function() { - return{}; + return{} }(); cljs.core._equiv = function(a, b) { - if (a ? a.cljs$core$IEquiv$_equiv$arity$2 : a) { - return a.cljs$core$IEquiv$_equiv$arity$2(a, b); + if(a ? a.cljs$core$IEquiv$_equiv$arity$2 : a) { + return a.cljs$core$IEquiv$_equiv$arity$2(a, b) } var c; - c = cljs.core._equiv; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._equiv._, !c)) { - throw cljs.core.missing_protocol("IEquiv.-equiv", a); + c = cljs.core._equiv[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._equiv._, !c)) { + throw cljs.core.missing_protocol.call(null, "IEquiv.-equiv", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IHash = function() { - return{}; + return{} }(); cljs.core._hash = function(a) { - if (a ? a.cljs$core$IHash$_hash$arity$1 : a) { - return a.cljs$core$IHash$_hash$arity$1(a); + if(a ? a.cljs$core$IHash$_hash$arity$1 : a) { + return a.cljs$core$IHash$_hash$arity$1(a) } var b; - b = cljs.core._hash; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._hash._, !b)) { - throw cljs.core.missing_protocol("IHash.-hash", a); + b = cljs.core._hash[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._hash._, !b)) { + throw cljs.core.missing_protocol.call(null, "IHash.-hash", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ISeqable = function() { - return{}; + return{} }(); cljs.core._seq = function(a) { - if (a ? a.cljs$core$ISeqable$_seq$arity$1 : a) { - return a.cljs$core$ISeqable$_seq$arity$1(a); + if(a ? a.cljs$core$ISeqable$_seq$arity$1 : a) { + return a.cljs$core$ISeqable$_seq$arity$1(a) } var b; - b = cljs.core._seq; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._seq._, !b)) { - throw cljs.core.missing_protocol("ISeqable.-seq", a); + b = cljs.core._seq[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._seq._, !b)) { + throw cljs.core.missing_protocol.call(null, "ISeqable.-seq", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ISequential = function() { - return{}; + return{} }(); cljs.core.IList = function() { - return{}; + return{} }(); cljs.core.IRecord = function() { - return{}; + return{} }(); cljs.core.IReversible = function() { - return{}; + return{} }(); cljs.core._rseq = function(a) { - if (a ? a.cljs$core$IReversible$_rseq$arity$1 : a) { - return a.cljs$core$IReversible$_rseq$arity$1(a); + if(a ? a.cljs$core$IReversible$_rseq$arity$1 : a) { + return a.cljs$core$IReversible$_rseq$arity$1(a) } var b; - b = cljs.core._rseq; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._rseq._, !b)) { - throw cljs.core.missing_protocol("IReversible.-rseq", a); + b = cljs.core._rseq[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._rseq._, !b)) { + throw cljs.core.missing_protocol.call(null, "IReversible.-rseq", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ISorted = function() { - return{}; + return{} }(); cljs.core._sorted_seq = function(a, b) { - if (a ? a.cljs$core$ISorted$_sorted_seq$arity$2 : a) { - return a.cljs$core$ISorted$_sorted_seq$arity$2(a, b); + if(a ? a.cljs$core$ISorted$_sorted_seq$arity$2 : a) { + return a.cljs$core$ISorted$_sorted_seq$arity$2(a, b) } var c; - c = cljs.core._sorted_seq; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._sorted_seq._, !c)) { - throw cljs.core.missing_protocol("ISorted.-sorted-seq", a); + c = cljs.core._sorted_seq[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._sorted_seq._, !c)) { + throw cljs.core.missing_protocol.call(null, "ISorted.-sorted-seq", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._sorted_seq_from = function(a, b, c) { - if (a ? a.cljs$core$ISorted$_sorted_seq_from$arity$3 : a) { - return a.cljs$core$ISorted$_sorted_seq_from$arity$3(a, b, c); + if(a ? a.cljs$core$ISorted$_sorted_seq_from$arity$3 : a) { + return a.cljs$core$ISorted$_sorted_seq_from$arity$3(a, b, c) } var d; - d = cljs.core._sorted_seq_from; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._sorted_seq_from._, !d)) { - throw cljs.core.missing_protocol("ISorted.-sorted-seq-from", a); + d = cljs.core._sorted_seq_from[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._sorted_seq_from._, !d)) { + throw cljs.core.missing_protocol.call(null, "ISorted.-sorted-seq-from", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core._entry_key = function(a, b) { - if (a ? a.cljs$core$ISorted$_entry_key$arity$2 : a) { - return a.cljs$core$ISorted$_entry_key$arity$2(a, b); + if(a ? a.cljs$core$ISorted$_entry_key$arity$2 : a) { + return a.cljs$core$ISorted$_entry_key$arity$2(a, b) } var c; - c = cljs.core._entry_key; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._entry_key._, !c)) { - throw cljs.core.missing_protocol("ISorted.-entry-key", a); + c = cljs.core._entry_key[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._entry_key._, !c)) { + throw cljs.core.missing_protocol.call(null, "ISorted.-entry-key", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._comparator = function(a) { - if (a ? a.cljs$core$ISorted$_comparator$arity$1 : a) { - return a.cljs$core$ISorted$_comparator$arity$1(a); + if(a ? a.cljs$core$ISorted$_comparator$arity$1 : a) { + return a.cljs$core$ISorted$_comparator$arity$1(a) } var b; - b = cljs.core._comparator; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._comparator._, !b)) { - throw cljs.core.missing_protocol("ISorted.-comparator", a); + b = cljs.core._comparator[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._comparator._, !b)) { + throw cljs.core.missing_protocol.call(null, "ISorted.-comparator", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IWriter = function() { - return{}; + return{} }(); cljs.core._write = function(a, b) { - if (a ? a.cljs$core$IWriter$_write$arity$2 : a) { - return a.cljs$core$IWriter$_write$arity$2(a, b); + if(a ? a.cljs$core$IWriter$_write$arity$2 : a) { + return a.cljs$core$IWriter$_write$arity$2(a, b) } var c; - c = cljs.core._write; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._write._, !c)) { - throw cljs.core.missing_protocol("IWriter.-write", a); + c = cljs.core._write[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._write._, !c)) { + throw cljs.core.missing_protocol.call(null, "IWriter.-write", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._flush = function(a) { - if (a ? a.cljs$core$IWriter$_flush$arity$1 : a) { - return a.cljs$core$IWriter$_flush$arity$1(a); + if(a ? a.cljs$core$IWriter$_flush$arity$1 : a) { + return a.cljs$core$IWriter$_flush$arity$1(a) } var b; - b = cljs.core._flush; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._flush._, !b)) { - throw cljs.core.missing_protocol("IWriter.-flush", a); + b = cljs.core._flush[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._flush._, !b)) { + throw cljs.core.missing_protocol.call(null, "IWriter.-flush", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IPrintWithWriter = function() { - return{}; + return{} }(); cljs.core._pr_writer = function(a, b, c) { - if (a ? a.cljs$core$IPrintWithWriter$_pr_writer$arity$3 : a) { - return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(a, b, c); + if(a ? a.cljs$core$IPrintWithWriter$_pr_writer$arity$3 : a) { + return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(a, b, c) } var d; - d = cljs.core._pr_writer; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._pr_writer._, !d)) { - throw cljs.core.missing_protocol("IPrintWithWriter.-pr-writer", a); + d = cljs.core._pr_writer[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._pr_writer._, !d)) { + throw cljs.core.missing_protocol.call(null, "IPrintWithWriter.-pr-writer", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core.IPending = function() { - return{}; + return{} }(); cljs.core._realized_QMARK_ = function(a) { - if (a ? a.cljs$core$IPending$_realized_QMARK_$arity$1 : a) { - return a.cljs$core$IPending$_realized_QMARK_$arity$1(a); + if(a ? a.cljs$core$IPending$_realized_QMARK_$arity$1 : a) { + return a.cljs$core$IPending$_realized_QMARK_$arity$1(a) } var b; - b = cljs.core._realized_QMARK_; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._realized_QMARK_._, !b)) { - throw cljs.core.missing_protocol("IPending.-realized?", a); + b = cljs.core._realized_QMARK_[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._realized_QMARK_._, !b)) { + throw cljs.core.missing_protocol.call(null, "IPending.-realized?", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IWatchable = function() { - return{}; + return{} }(); cljs.core._notify_watches = function(a, b, c) { - if (a ? a.cljs$core$IWatchable$_notify_watches$arity$3 : a) { - return a.cljs$core$IWatchable$_notify_watches$arity$3(a, b, c); + if(a ? a.cljs$core$IWatchable$_notify_watches$arity$3 : a) { + return a.cljs$core$IWatchable$_notify_watches$arity$3(a, b, c) } var d; - d = cljs.core._notify_watches; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._notify_watches._, !d)) { - throw cljs.core.missing_protocol("IWatchable.-notify-watches", a); + d = cljs.core._notify_watches[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._notify_watches._, !d)) { + throw cljs.core.missing_protocol.call(null, "IWatchable.-notify-watches", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core._add_watch = function(a, b, c) { - if (a ? a.cljs$core$IWatchable$_add_watch$arity$3 : a) { - return a.cljs$core$IWatchable$_add_watch$arity$3(a, b, c); + if(a ? a.cljs$core$IWatchable$_add_watch$arity$3 : a) { + return a.cljs$core$IWatchable$_add_watch$arity$3(a, b, c) } var d; - d = cljs.core._add_watch; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._add_watch._, !d)) { - throw cljs.core.missing_protocol("IWatchable.-add-watch", a); + d = cljs.core._add_watch[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._add_watch._, !d)) { + throw cljs.core.missing_protocol.call(null, "IWatchable.-add-watch", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core._remove_watch = function(a, b) { - if (a ? a.cljs$core$IWatchable$_remove_watch$arity$2 : a) { - return a.cljs$core$IWatchable$_remove_watch$arity$2(a, b); + if(a ? a.cljs$core$IWatchable$_remove_watch$arity$2 : a) { + return a.cljs$core$IWatchable$_remove_watch$arity$2(a, b) } var c; - c = cljs.core._remove_watch; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._remove_watch._, !c)) { - throw cljs.core.missing_protocol("IWatchable.-remove-watch", a); + c = cljs.core._remove_watch[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._remove_watch._, !c)) { + throw cljs.core.missing_protocol.call(null, "IWatchable.-remove-watch", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IEditableCollection = function() { - return{}; + return{} }(); cljs.core._as_transient = function(a) { - if (a ? a.cljs$core$IEditableCollection$_as_transient$arity$1 : a) { - return a.cljs$core$IEditableCollection$_as_transient$arity$1(a); + if(a ? a.cljs$core$IEditableCollection$_as_transient$arity$1 : a) { + return a.cljs$core$IEditableCollection$_as_transient$arity$1(a) } var b; - b = cljs.core._as_transient; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._as_transient._, !b)) { - throw cljs.core.missing_protocol("IEditableCollection.-as-transient", a); + b = cljs.core._as_transient[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._as_transient._, !b)) { + throw cljs.core.missing_protocol.call(null, "IEditableCollection.-as-transient", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ITransientCollection = function() { - return{}; + return{} }(); cljs.core._conj_BANG_ = function(a, b) { - if (a ? a.cljs$core$ITransientCollection$_conj_BANG_$arity$2 : a) { - return a.cljs$core$ITransientCollection$_conj_BANG_$arity$2(a, b); + if(a ? a.cljs$core$ITransientCollection$_conj_BANG_$arity$2 : a) { + return a.cljs$core$ITransientCollection$_conj_BANG_$arity$2(a, b) } var c; - c = cljs.core._conj_BANG_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._conj_BANG_._, !c)) { - throw cljs.core.missing_protocol("ITransientCollection.-conj!", a); + c = cljs.core._conj_BANG_[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._conj_BANG_._, !c)) { + throw cljs.core.missing_protocol.call(null, "ITransientCollection.-conj!", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._persistent_BANG_ = function(a) { - if (a ? a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 : a) { - return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(a); + if(a ? a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 : a) { + return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(a) } var b; - b = cljs.core._persistent_BANG_; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._persistent_BANG_._, !b)) { - throw cljs.core.missing_protocol("ITransientCollection.-persistent!", a); + b = cljs.core._persistent_BANG_[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._persistent_BANG_._, !b)) { + throw cljs.core.missing_protocol.call(null, "ITransientCollection.-persistent!", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ITransientAssociative = function() { - return{}; + return{} }(); cljs.core._assoc_BANG_ = function(a, b, c) { - if (a ? a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 : a) { - return a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(a, b, c); + if(a ? a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 : a) { + return a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(a, b, c) } var d; - d = cljs.core._assoc_BANG_; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._assoc_BANG_._, !d)) { - throw cljs.core.missing_protocol("ITransientAssociative.-assoc!", a); + d = cljs.core._assoc_BANG_[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._assoc_BANG_._, !d)) { + throw cljs.core.missing_protocol.call(null, "ITransientAssociative.-assoc!", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core.ITransientMap = function() { - return{}; + return{} }(); cljs.core._dissoc_BANG_ = function(a, b) { - if (a ? a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 : a) { - return a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2(a, b); + if(a ? a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 : a) { + return a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2(a, b) } var c; - c = cljs.core._dissoc_BANG_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._dissoc_BANG_._, !c)) { - throw cljs.core.missing_protocol("ITransientMap.-dissoc!", a); + c = cljs.core._dissoc_BANG_[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._dissoc_BANG_._, !c)) { + throw cljs.core.missing_protocol.call(null, "ITransientMap.-dissoc!", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.ITransientVector = function() { - return{}; + return{} }(); cljs.core._assoc_n_BANG_ = function(a, b, c) { - if (a ? a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 : a) { - return a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3(a, b, c); + if(a ? a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 : a) { + return a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3(a, b, c) } var d; - d = cljs.core._assoc_n_BANG_; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._assoc_n_BANG_._, !d)) { - throw cljs.core.missing_protocol("ITransientVector.-assoc-n!", a); + d = cljs.core._assoc_n_BANG_[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._assoc_n_BANG_._, !d)) { + throw cljs.core.missing_protocol.call(null, "ITransientVector.-assoc-n!", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core._pop_BANG_ = function(a) { - if (a ? a.cljs$core$ITransientVector$_pop_BANG_$arity$1 : a) { - return a.cljs$core$ITransientVector$_pop_BANG_$arity$1(a); + if(a ? a.cljs$core$ITransientVector$_pop_BANG_$arity$1 : a) { + return a.cljs$core$ITransientVector$_pop_BANG_$arity$1(a) } var b; - b = cljs.core._pop_BANG_; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._pop_BANG_._, !b)) { - throw cljs.core.missing_protocol("ITransientVector.-pop!", a); + b = cljs.core._pop_BANG_[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._pop_BANG_._, !b)) { + throw cljs.core.missing_protocol.call(null, "ITransientVector.-pop!", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.ITransientSet = function() { - return{}; + return{} }(); cljs.core._disjoin_BANG_ = function(a, b) { - if (a ? a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 : a) { - return a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2(a, b); + if(a ? a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 : a) { + return a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2(a, b) } var c; - c = cljs.core._disjoin_BANG_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._disjoin_BANG_._, !c)) { - throw cljs.core.missing_protocol("ITransientSet.-disjoin!", a); + c = cljs.core._disjoin_BANG_[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._disjoin_BANG_._, !c)) { + throw cljs.core.missing_protocol.call(null, "ITransientSet.-disjoin!", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IComparable = function() { - return{}; + return{} }(); cljs.core._compare = function(a, b) { - if (a ? a.cljs$core$IComparable$_compare$arity$2 : a) { - return a.cljs$core$IComparable$_compare$arity$2(a, b); + if(a ? a.cljs$core$IComparable$_compare$arity$2 : a) { + return a.cljs$core$IComparable$_compare$arity$2(a, b) } var c; - c = cljs.core._compare; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._compare._, !c)) { - throw cljs.core.missing_protocol("IComparable.-compare", a); + c = cljs.core._compare[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._compare._, !c)) { + throw cljs.core.missing_protocol.call(null, "IComparable.-compare", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.IChunk = function() { - return{}; + return{} }(); cljs.core._drop_first = function(a) { - if (a ? a.cljs$core$IChunk$_drop_first$arity$1 : a) { - return a.cljs$core$IChunk$_drop_first$arity$1(a); + if(a ? a.cljs$core$IChunk$_drop_first$arity$1 : a) { + return a.cljs$core$IChunk$_drop_first$arity$1(a) } var b; - b = cljs.core._drop_first; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._drop_first._, !b)) { - throw cljs.core.missing_protocol("IChunk.-drop-first", a); + b = cljs.core._drop_first[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._drop_first._, !b)) { + throw cljs.core.missing_protocol.call(null, "IChunk.-drop-first", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IChunkedSeq = function() { - return{}; + return{} }(); cljs.core._chunked_first = function(a) { - if (a ? a.cljs$core$IChunkedSeq$_chunked_first$arity$1 : a) { - return a.cljs$core$IChunkedSeq$_chunked_first$arity$1(a); + if(a ? a.cljs$core$IChunkedSeq$_chunked_first$arity$1 : a) { + return a.cljs$core$IChunkedSeq$_chunked_first$arity$1(a) } var b; - b = cljs.core._chunked_first; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._chunked_first._, !b)) { - throw cljs.core.missing_protocol("IChunkedSeq.-chunked-first", a); + b = cljs.core._chunked_first[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._chunked_first._, !b)) { + throw cljs.core.missing_protocol.call(null, "IChunkedSeq.-chunked-first", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._chunked_rest = function(a) { - if (a ? a.cljs$core$IChunkedSeq$_chunked_rest$arity$1 : a) { - return a.cljs$core$IChunkedSeq$_chunked_rest$arity$1(a); + if(a ? a.cljs$core$IChunkedSeq$_chunked_rest$arity$1 : a) { + return a.cljs$core$IChunkedSeq$_chunked_rest$arity$1(a) } var b; - b = cljs.core._chunked_rest; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._chunked_rest._, !b)) { - throw cljs.core.missing_protocol("IChunkedSeq.-chunked-rest", a); + b = cljs.core._chunked_rest[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._chunked_rest._, !b)) { + throw cljs.core.missing_protocol.call(null, "IChunkedSeq.-chunked-rest", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.IChunkedNext = function() { - return{}; + return{} }(); cljs.core._chunked_next = function(a) { - if (a ? a.cljs$core$IChunkedNext$_chunked_next$arity$1 : a) { - return a.cljs$core$IChunkedNext$_chunked_next$arity$1(a); + if(a ? a.cljs$core$IChunkedNext$_chunked_next$arity$1 : a) { + return a.cljs$core$IChunkedNext$_chunked_next$arity$1(a) } var b; - b = cljs.core._chunked_next; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._chunked_next._, !b)) { - throw cljs.core.missing_protocol("IChunkedNext.-chunked-next", a); + b = cljs.core._chunked_next[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._chunked_next._, !b)) { + throw cljs.core.missing_protocol.call(null, "IChunkedNext.-chunked-next", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.INamed = function() { - return{}; + return{} }(); cljs.core._name = function(a) { - if (a ? a.cljs$core$INamed$_name$arity$1 : a) { - return a.cljs$core$INamed$_name$arity$1(a); + if(a ? a.cljs$core$INamed$_name$arity$1 : a) { + return a.cljs$core$INamed$_name$arity$1(a) } var b; - b = cljs.core._name; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._name._, !b)) { - throw cljs.core.missing_protocol("INamed.-name", a); + b = cljs.core._name[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._name._, !b)) { + throw cljs.core.missing_protocol.call(null, "INamed.-name", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._namespace = function(a) { - if (a ? a.cljs$core$INamed$_namespace$arity$1 : a) { - return a.cljs$core$INamed$_namespace$arity$1(a); + if(a ? a.cljs$core$INamed$_namespace$arity$1 : a) { + return a.cljs$core$INamed$_namespace$arity$1(a) } var b; - b = cljs.core._namespace; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._namespace._, !b)) { - throw cljs.core.missing_protocol("INamed.-namespace", a); + b = cljs.core._namespace[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._namespace._, !b)) { + throw cljs.core.missing_protocol.call(null, "INamed.-namespace", a); } - return b.call(null, a); -}; -cljs.core.IAtom = function() { - return{}; -}(); -cljs.core.IReset = function() { - return{}; -}(); -cljs.core._reset_BANG_ = function(a, b) { - if (a ? a.cljs$core$IReset$_reset_BANG_$arity$2 : a) { - return a.cljs$core$IReset$_reset_BANG_$arity$2(a, b); - } - var c; - c = cljs.core._reset_BANG_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._reset_BANG_._, !c)) { - throw cljs.core.missing_protocol("IReset.-reset!", a); - } - return c.call(null, a, b); -}; -cljs.core.ISwap = function() { - return{}; -}(); -cljs.core._swap_BANG_ = function() { - var a = null, b = function(a, b) { - if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$2 : a) { - return a.cljs$core$ISwap$_swap_BANG_$arity$2(a, b); - } - var c; - c = cljs.core._swap_BANG_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._swap_BANG_._, !c)) { - throw cljs.core.missing_protocol("ISwap.-swap!", a); - } - return c.call(null, a, b); - }, c = function(a, b, c) { - if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$3 : a) { - return a.cljs$core$ISwap$_swap_BANG_$arity$3(a, b, c); - } - var d; - d = cljs.core._swap_BANG_; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._swap_BANG_._, !d)) { - throw cljs.core.missing_protocol("ISwap.-swap!", a); - } - return d.call(null, a, b, c); - }, d = function(a, b, c, d) { - if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$4 : a) { - return a.cljs$core$ISwap$_swap_BANG_$arity$4(a, b, c, d); - } - var e; - e = cljs.core._swap_BANG_; - var m; - m = goog.typeOf(null == a ? null : a); - e = e[m]; - if (!e && (e = cljs.core._swap_BANG_._, !e)) { - throw cljs.core.missing_protocol("ISwap.-swap!", a); - } - return e.call(null, a, b, c, d); - }, e = function(a, b, c, d, e) { - if (a ? a.cljs$core$ISwap$_swap_BANG_$arity$5 : a) { - return a.cljs$core$ISwap$_swap_BANG_$arity$5(a, b, c, d, e); - } - var m; - m = cljs.core._swap_BANG_; - var n; - n = goog.typeOf(null == a ? null : a); - m = m[n]; - if (!m && (m = cljs.core._swap_BANG_._, !m)) { - throw cljs.core.missing_protocol("ISwap.-swap!", a); - } - return m.call(null, a, b, c, d, e); - }, a = function(a, g, h, k, l) { - switch(arguments.length) { - case 2: - return b.call(this, a, g); - case 3: - return c.call(this, a, g, h); - case 4: - return d.call(this, a, g, h, k); - case 5: - return e.call(this, a, g, h, k, l); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - a.cljs$core$IFn$_invoke$arity$4 = d; - a.cljs$core$IFn$_invoke$arity$5 = e; - return a; -}(); -cljs.core.IVolatile = function() { - return{}; -}(); -cljs.core._vreset_BANG_ = function(a, b) { - if (a ? a.cljs$core$IVolatile$_vreset_BANG_$arity$2 : a) { - return a.cljs$core$IVolatile$_vreset_BANG_$arity$2(a, b); - } - var c; - c = cljs.core._vreset_BANG_; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._vreset_BANG_._, !c)) { - throw cljs.core.missing_protocol("IVolatile.-vreset!", a); - } - return c.call(null, a, b); -}; -cljs.core.IIterable = function() { - return{}; -}(); -cljs.core._iterator = function(a) { - if (a ? a.cljs$core$IIterable$_iterator$arity$1 : a) { - return a.cljs$core$IIterable$_iterator$arity$1(a); - } - var b; - b = cljs.core._iterator; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._iterator._, !b)) { - throw cljs.core.missing_protocol("IIterable.-iterator", a); - } - return b.call(null, a); + return b.call(null, a) }; cljs.core.StringBufferWriter = function(a) { this.sb = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 1073741824; -}; -cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_write$arity$2 = function(a, b) { - return this.sb.append(b); -}; -cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_flush$arity$1 = function(a) { - return null; + this.cljs$lang$protocol_mask$partition0$ = 1073741824 }; cljs.core.StringBufferWriter.cljs$lang$type = !0; cljs.core.StringBufferWriter.cljs$lang$ctorStr = "cljs.core/StringBufferWriter"; cljs.core.StringBufferWriter.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/StringBufferWriter"); + return cljs.core._write.call(null, b, "cljs.core/StringBufferWriter") +}; +cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_write$arity$2 = function(a, b) { + return this.sb.append(b) +}; +cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_flush$arity$1 = function(a) { + return null }; cljs.core.__GT_StringBufferWriter = function(a) { - return new cljs.core.StringBufferWriter(a); + return new cljs.core.StringBufferWriter(a) }; cljs.core.pr_str_STAR_ = function(a) { var b = new goog.string.StringBuffer, c = new cljs.core.StringBufferWriter(b); - a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(null, c, cljs.core.pr_opts()); - c.cljs$core$IWriter$_flush$arity$1(null); - return "" + cljs.core.str(b); -}; -cljs.core.int_rotate_left = function(a, b) { - return a << b | a >>> -b; -}; -"undefined" !== typeof Math.imul && 0 !== function() { - return Math.imul.cljs$core$IFn$_invoke$arity$2 ? Math.imul.cljs$core$IFn$_invoke$arity$2(4294967295, 5) : Math.imul.call(null, 4294967295, 5); -}() ? cljs.core.imul = function(a, b) { - return Math.imul.cljs$core$IFn$_invoke$arity$2 ? Math.imul.cljs$core$IFn$_invoke$arity$2(a, b) : Math.imul.call(null, a, b); -} : cljs.core.imul = function(a, b) { - var c = a & 65535, d = b & 65535; - return c * d + ((a >>> 16 & 65535) * d + c * (b >>> 16 & 65535) << 16 >>> 0) | 0; -}; -cljs.core.m3_seed = 0; -cljs.core.m3_C1 = 3432918353; -cljs.core.m3_C2 = 461845907; -cljs.core.m3_mix_K1 = function(a) { - return cljs.core.imul(cljs.core.int_rotate_left(cljs.core.imul(a, cljs.core.m3_C1), 15), cljs.core.m3_C2); -}; -cljs.core.m3_mix_H1 = function(a, b) { - return cljs.core.imul(cljs.core.int_rotate_left(a ^ b, 13), 5) + 3864292196; -}; -cljs.core.m3_fmix = function(a, b) { - var c = a ^ b, c = cljs.core.imul(c ^ c >>> 16, 2246822507), c = cljs.core.imul(c ^ c >>> 13, 3266489909); - return c ^ c >>> 16; -}; -cljs.core.m3_hash_int = function(a) { - if (0 === a) { - return a; - } - a = cljs.core.m3_mix_K1(a); - a = cljs.core.m3_mix_H1(cljs.core.m3_seed, a); - return cljs.core.m3_fmix(a, 4); -}; -cljs.core.m3_hash_unencoded_chars = function(a) { - var b; - a: { - b = 1; - for (var c = cljs.core.m3_seed;;) { - if (b < a.length) { - var d = b + 2, c = cljs.core.m3_mix_H1(c, cljs.core.m3_mix_K1(a.charCodeAt(b - 1) | a.charCodeAt(b) << 16)); - b = d; - } else { - b = c; - break a; - } - } - b = void 0; - } - b = 1 === (a.length & 1) ? b ^ cljs.core.m3_mix_K1(a.charCodeAt(a.length - 1)) : b; - return cljs.core.m3_fmix(b, cljs.core.imul(2, a.length)); -}; -cljs.core.string_hash_cache = function() { - return{}; -}(); -cljs.core.string_hash_cache_count = 0; -cljs.core.hash_string_STAR_ = function(a) { - if (null != a) { - var b = a.length; - if (0 < b) { - for (var c = 0, d = 0;;) { - if (c < b) { - var e = c + 1, d = cljs.core.imul(31, d) + a.charCodeAt(c), c = e - } else { - return d; - } - } - } else { - return 0; - } - } else { - return 0; - } -}; -cljs.core.add_to_string_hash_cache = function(a) { - var b = cljs.core.hash_string_STAR_(a); - cljs.core.string_hash_cache[a] = b; - cljs.core.string_hash_cache_count += 1; - return b; -}; -cljs.core.hash_string = function(a) { - 255 < cljs.core.string_hash_cache_count && (cljs.core.string_hash_cache = {}, cljs.core.string_hash_cache_count = 0); - var b = cljs.core.string_hash_cache[a]; - return "number" === typeof b ? b : cljs.core.add_to_string_hash_cache(a); -}; -cljs.core.hash = function(a) { - return a && (a.cljs$lang$protocol_mask$partition0$ & 4194304 || a.cljs$core$IHash$) ? a.cljs$core$IHash$_hash$arity$1(null) : "number" === typeof a ? (Math.floor.cljs$core$IFn$_invoke$arity$1 ? Math.floor.cljs$core$IFn$_invoke$arity$1(a) : Math.floor.call(null, a)) % 2147483647 : !0 === a ? 1 : !1 === a ? 0 : "string" === typeof a ? cljs.core.m3_hash_int(cljs.core.hash_string(a)) : a instanceof Date ? a.valueOf() : null == a ? 0 : cljs.core._hash(a); -}; -cljs.core.hash_combine = function(a, b) { - return a ^ b + 2654435769 + (a << 6) + (a >> 2); + cljs.core._pr_writer.call(null, a, c, cljs.core.pr_opts.call(null)); + cljs.core._flush.call(null, c); + return"" + cljs.core.str(b) }; cljs.core.instance_QMARK_ = function(a, b) { - return b instanceof a; + return b instanceof a }; cljs.core.symbol_QMARK_ = function(a) { - return a instanceof cljs.core.Symbol; + return a instanceof cljs.core.Symbol }; cljs.core.hash_symbol = function(a) { - return cljs.core.hash_combine(cljs.core.m3_hash_unencoded_chars(a.name), cljs.core.hash_string(a.ns)); + return cljs.core.hash_combine.call(null, cljs.core.hash.call(null, a.ns), cljs.core.hash.call(null, a.name)) }; cljs.core.compare_symbols = function(a, b) { - if (a.str === b.str) { - return 0; + if(cljs.core.truth_(cljs.core._EQ_.call(null, a, b))) { + return 0 } - if (cljs.core.truth_(function() { - var c = cljs.core.not(a.ns); - return c ? b.ns : c; + if(cljs.core.truth_(function() { + var c = cljs.core.not.call(null, a.ns); + return c ? b.ns : c }())) { - return-1; + return-1 } - if (cljs.core.truth_(a.ns)) { - if (cljs.core.not(b.ns)) { - return 1; + if(cljs.core.truth_(a.ns)) { + if(cljs.core.not.call(null, b.ns)) { + return 1 } - var c = goog.array.defaultCompare(a.ns, b.ns); - return 0 === c ? goog.array.defaultCompare(a.name, b.name) : c; + var c = cljs.core.compare.call(null, a.ns, b.ns); + return 0 === c ? cljs.core.compare.call(null, a.name, b.name) : c } - return goog.array.defaultCompare(a.name, b.name); + return new cljs.core.Keyword(null, "default", "default", 2558708147) ? cljs.core.compare.call(null, a.name, b.name) : null }; cljs.core.Symbol = function(a, b, c, d, e) { this.ns = a; @@ -3420,388 +2716,135 @@ cljs.core.Symbol = function(a, b, c, d, e) { this._hash = d; this._meta = e; this.cljs$lang$protocol_mask$partition0$ = 2154168321; - this.cljs$lang$protocol_mask$partition1$ = 4096; + this.cljs$lang$protocol_mask$partition1$ = 4096 +}; +cljs.core.Symbol.cljs$lang$type = !0; +cljs.core.Symbol.cljs$lang$ctorStr = "cljs.core/Symbol"; +cljs.core.Symbol.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/Symbol") }; cljs.core.Symbol.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write(b, this.str); + return cljs.core._write.call(null, b, this.str) }; cljs.core.Symbol.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return this.name; + return this.name }; cljs.core.Symbol.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return this.ns; + return this.ns }; cljs.core.Symbol.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this._hash; - return null != a ? a : this._hash = a = cljs.core.hash_symbol(this); + return null != a ? a : this._hash = a = cljs.core.hash_symbol.call(null, this) }; cljs.core.Symbol.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, b); + return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, b) }; cljs.core.Symbol.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta; + return this._meta }; cljs.core.Symbol.prototype.call = function() { - var a = null, b = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(b, this, null); - }, c = function(a, b, c) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(b, this, c); - }, a = function(a, e, f) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: - return b.call(this, a, e); + return cljs.core._lookup.call(null, c, this, null); case 3: - return c.call(this, a, e, f); + return cljs.core._lookup.call(null, c, this, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + } }(); cljs.core.Symbol.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.Symbol.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(a, this, null); + return cljs.core._lookup.call(null, a, this, null) }; cljs.core.Symbol.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(a, this, b); + return cljs.core._lookup.call(null, a, this, b) }; cljs.core.Symbol.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.Symbol ? this.str === b.str : !1; + return b instanceof cljs.core.Symbol ? this.str === b.str : !1 }; cljs.core.Symbol.prototype.toString = function() { - return this.str; -}; -cljs.core.Symbol.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.Symbol.cljs$lang$type = !0; -cljs.core.Symbol.cljs$lang$ctorStr = "cljs.core/Symbol"; -cljs.core.Symbol.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Symbol"); + return this.str }; cljs.core.__GT_Symbol = function(a, b, c, d, e) { - return new cljs.core.Symbol(a, b, c, d, e); + return new cljs.core.Symbol(a, b, c, d, e) }; cljs.core.symbol = function() { var a = null, b = function(b) { - return b instanceof cljs.core.Symbol ? b : a.cljs$core$IFn$_invoke$arity$2(null, b); + return b instanceof cljs.core.Symbol ? b : a.call(null, null, b) }, c = function(a, b) { var c = null != a ? [cljs.core.str(a), cljs.core.str("/"), cljs.core.str(b)].join("") : b; - return new cljs.core.Symbol(a, b, c, null, null); + return new cljs.core.Symbol(a, b, c, null, null) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.Var = function(a, b, c) { - this.val = a; - this.sym = b; - this._meta = c; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 163841; -}; -cljs.core.Var.prototype.call = function() { - var a = null, b = function(a) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null); - }, c = function(a, b) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b); - }, d = function(a, b, c) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c); - }, e = function(a, b, c, d) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d); - }, f = function(a, b, c, d, e) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e); - }, g = function(a, b, c, d, e, f) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f); - }, h = function(a, b, c, d, e, f, g) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g); - }, k = function(a, b, c, d, e, f, g, h) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h); - }, l = function(a, b, c, d, e, f, g, h, k) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k); - }, m = function(a, b, c, d, e, f, g, h, k, l) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l); - }, n = function(a, b, c, d, e, f, g, h, k, l, m) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m); - }, p = function(a, b, c, d, e, f, g, h, k, l, m, q) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q); - }, q = function(a, b, c, d, e, f, g, h, k, l, m, q, n) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n); - }, r = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r); - }, s = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p); - }, t = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); - }, u = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); - }, v = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); - }, w = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); - }, y = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); - }, F = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) { - a = this; - return(a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null)).call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); - }, L = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) { - a = this; - a = a.val.cljs$core$IFn$_invoke$arity$0 ? a.val.cljs$core$IFn$_invoke$arity$0() : a.val.call(null); - return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) : cljs.core.apply.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); - }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, x); - case 3: - return d.call(this, a, x, z); - case 4: - return e.call(this, a, x, z, A); - case 5: - return f.call(this, a, x, z, A, B); - case 6: - return g.call(this, a, x, z, A, B, C); - case 7: - return h.call(this, a, x, z, A, B, C, D); - case 8: - return k.call(this, a, x, z, A, B, C, D, E); - case 9: - return l.call(this, a, x, z, A, B, C, D, E, G); - case 10: - return m.call(this, a, x, z, A, B, C, D, E, G, H); - case 11: - return n.call(this, a, x, z, A, B, C, D, E, G, H, I); - case 12: - return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); - case 13: - return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); - case 14: - return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); - case 15: - return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); - case 16: - return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); - case 17: - return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); - case 18: - return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); - case 19: - return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); - case 20: - return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); - case 21: - return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); - case 22: - return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - a.cljs$core$IFn$_invoke$arity$4 = e; - a.cljs$core$IFn$_invoke$arity$5 = f; - a.cljs$core$IFn$_invoke$arity$6 = g; - a.cljs$core$IFn$_invoke$arity$7 = h; - a.cljs$core$IFn$_invoke$arity$8 = k; - a.cljs$core$IFn$_invoke$arity$9 = l; - a.cljs$core$IFn$_invoke$arity$10 = m; - a.cljs$core$IFn$_invoke$arity$11 = n; - a.cljs$core$IFn$_invoke$arity$12 = p; - a.cljs$core$IFn$_invoke$arity$13 = q; - a.cljs$core$IFn$_invoke$arity$14 = r; - a.cljs$core$IFn$_invoke$arity$15 = s; - a.cljs$core$IFn$_invoke$arity$16 = t; - a.cljs$core$IFn$_invoke$arity$17 = u; - a.cljs$core$IFn$_invoke$arity$18 = v; - a.cljs$core$IFn$_invoke$arity$19 = w; - a.cljs$core$IFn$_invoke$arity$20 = y; - a.cljs$core$IFn$_invoke$arity$21 = F; - a.cljs$core$IFn$_invoke$arity$22 = L; - return a; + return a }(); -cljs.core.Var.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$0 = function() { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$3 = function(a, b, c) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$4 = function(a, b, c, d) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$5 = function(a, b, c, d, e) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$6 = function(a, b, c, d, e, f) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$7 = function(a, b, c, d, e, f, g) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$8 = function(a, b, c, d, e, f, g, h) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$9 = function(a, b, c, d, e, f, g, h, k) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$10 = function(a, b, c, d, e, f, g, h, k, l) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$11 = function(a, b, c, d, e, f, g, h, k, l, m) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$12 = function(a, b, c, d, e, f, g, h, k, l, m, n) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$13 = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$14 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$15 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$16 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$17 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$18 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$19 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$20 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { - return(this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null)).call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); -}; -cljs.core.Var.prototype.cljs$core$IFn$_invoke$arity$21 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { - var F = this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null); - return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : cljs.core.apply.call(null, F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); -}; -cljs.core.Var.prototype.cljs$core$Fn$ = !0; -cljs.core.Var.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta; -}; -cljs.core.Var.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.val.cljs$core$IFn$_invoke$arity$0 ? this.val.cljs$core$IFn$_invoke$arity$0() : this.val.call(null); -}; -cljs.core.Var.cljs$lang$type = !0; -cljs.core.Var.cljs$lang$ctorStr = "cljs.core/Var"; -cljs.core.Var.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Var"); -}; -cljs.core.__GT_Var = function(a, b, c) { - return new cljs.core.Var(a, b, c); -}; -cljs.core.iterable_QMARK_ = function(a) { - return a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IIterable$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IIterable, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IIterable, a); -}; -cljs.core.clone = function(a) { - return cljs.core._clone(a); -}; -cljs.core.cloneable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition1$ & 8192 || a.cljs$core$ICloneable$ ? !0 : a.cljs$lang$protocol_mask$partition1$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ICloneable, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ICloneable, a); -}; cljs.core.seq = function(a) { - if (null == a) { - return null; + if(null == a) { + return null + } + if(a && (a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$)) { + return cljs.core._seq.call(null, a) } - if (a && (a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$)) { - return a.cljs$core$ISeqable$_seq$arity$1(null); + if(a instanceof Array || "string" === typeof a) { + return 0 === a.length ? null : new cljs.core.IndexedSeq(a, 0) } - if (a instanceof Array || "string" === typeof a) { - return 0 === a.length ? null : new cljs.core.IndexedSeq(a, 0); + if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a)) { + return cljs.core._seq.call(null, a) } - if (cljs.core.native_satisfies_QMARK_(cljs.core.ISeqable, a)) { - return cljs.core._seq(a); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error([cljs.core.str(a), cljs.core.str("is not ISeqable")].join("")); } - throw Error([cljs.core.str(a), cljs.core.str(" is not ISeqable")].join("")); + return null }; cljs.core.first = function(a) { - if (null == a) { - return null; + if(null == a) { + return null } - if (a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$)) { - return a.cljs$core$ISeq$_first$arity$1(null); + if(a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$)) { + return cljs.core._first.call(null, a) } - a = cljs.core.seq(a); - return null == a ? null : cljs.core._first(a); + a = cljs.core.seq.call(null, a); + return null == a ? null : cljs.core._first.call(null, a) }; cljs.core.rest = function(a) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$) ? a.cljs$core$ISeq$_rest$arity$1(null) : (a = cljs.core.seq(a)) ? cljs.core._rest(a) : cljs.core.List.EMPTY : cljs.core.List.EMPTY; + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$) ? cljs.core._rest.call(null, a) : (a = cljs.core.seq.call(null, a)) ? cljs.core._rest.call(null, a) : cljs.core.List.EMPTY : cljs.core.List.EMPTY }; cljs.core.next = function(a) { - return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$) ? a.cljs$core$INext$_next$arity$1(null) : cljs.core.seq(cljs.core.rest(a)); + return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$) ? cljs.core._next.call(null, a) : cljs.core.seq.call(null, cljs.core.rest.call(null, a)) }; cljs.core._EQ_ = function() { var a = null, b = function(a, b) { - return null == a ? null == b : a === b || cljs.core._equiv(a, b); + return null == a ? null == b : a === b || cljs.core._equiv.call(null, a, b) }, c = function() { var b = function(b, c, d) { - for (;;) { - if (a.cljs$core$IFn$_invoke$arity$2(b, c)) { - if (cljs.core.next(d)) { - b = c, c = cljs.core.first(d), d = cljs.core.next(d); - } else { - return a.cljs$core$IFn$_invoke$arity$2(c, cljs.core.first(d)); + for(;;) { + if(a.call(null, b, c)) { + if(cljs.core.next.call(null, d)) { + b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) + }else { + return a.call(null, c, cljs.core.first.call(null, d)) } - } else { - return!1; + }else { + return!1 } } }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -3809,10 +2852,10 @@ cljs.core._EQ_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3820,199 +2863,104 @@ cljs.core._EQ_ = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); -cljs.core.ES6Iterator = function(a) { - this.s = a; -}; -cljs.core.ES6Iterator.prototype.next = function() { - if (null != this.s) { - var a = cljs.core.first(this.s); - this.s = cljs.core.next(this.s); - return{done:!1, value:a}; - } - return{done:!0, value:null}; -}; -cljs.core.ES6Iterator.cljs$lang$type = !0; -cljs.core.ES6Iterator.cljs$lang$ctorStr = "cljs.core/ES6Iterator"; -cljs.core.ES6Iterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ES6Iterator"); -}; -cljs.core.__GT_ES6Iterator = function(a) { - return new cljs.core.ES6Iterator(a); -}; -cljs.core.es6_iterator = function(a) { - return new cljs.core.ES6Iterator(cljs.core.seq(a)); -}; -cljs.core.ES6IteratorSeq = function(a, b, c) { - this.value = a; - this.iter = b; - this._rest = c; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 8388672; -}; -cljs.core.ES6IteratorSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.value; -}; -cljs.core.ES6IteratorSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - null == this._rest && (a = this.iter, this._rest = cljs.core.es6_iterator_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.es6_iterator_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.es6_iterator_seq.call(null, a)); - return this._rest; -}; -cljs.core.ES6IteratorSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; -}; -cljs.core.ES6IteratorSeq.cljs$lang$type = !0; -cljs.core.ES6IteratorSeq.cljs$lang$ctorStr = "cljs.core/ES6IteratorSeq"; -cljs.core.ES6IteratorSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ES6IteratorSeq"); -}; -cljs.core.__GT_ES6IteratorSeq = function(a, b, c) { - return new cljs.core.ES6IteratorSeq(a, b, c); -}; -cljs.core.es6_iterator_seq = function(a) { - var b = a.next(); - return cljs.core.truth_(b.done) ? cljs.core.List.EMPTY : new cljs.core.ES6IteratorSeq(b.value, a, null); -}; -cljs.core.mix_collection_hash = function(a, b) { - var c = cljs.core.m3_seed, d = cljs.core.m3_mix_K1(a), c = cljs.core.m3_mix_H1(c, d); - return cljs.core.m3_fmix(c, b); -}; -cljs.core.hash_ordered_coll = function(a) { - var b = 0, c = 1; - for (a = cljs.core.seq(a);;) { - if (null != a) { - b += 1, c = cljs.core.imul(31, c) + cljs.core.hash(cljs.core.first(a)) | 0, a = cljs.core.next(a); - } else { - return cljs.core.mix_collection_hash(c, b); - } - } -}; -cljs.core.empty_ordered_hash = cljs.core.mix_collection_hash(1, 0); -cljs.core.hash_unordered_coll = function(a) { - var b = 0, c = 0; - for (a = cljs.core.seq(a);;) { - if (null != a) { - b += 1, c = c + cljs.core.hash(cljs.core.first(a)) | 0, a = cljs.core.next(a); - } else { - return cljs.core.mix_collection_hash(c, b); - } - } -}; -cljs.core.empty_unordered_hash = cljs.core.mix_collection_hash(0, 0); cljs.core.ICounted["null"] = !0; cljs.core._count["null"] = function(a) { - return 0; + return 0 }; Date.prototype.cljs$core$IEquiv$ = !0; Date.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof Date && this.toString() === b.toString(); + return b instanceof Date && this.toString() === b.toString() }; cljs.core.IEquiv.number = !0; cljs.core._equiv.number = function(a, b) { - return a === b; + return a === b }; cljs.core.IMeta["function"] = !0; cljs.core._meta["function"] = function(a) { - return null; + return null }; cljs.core.Fn["function"] = !0; cljs.core.IHash._ = !0; cljs.core._hash._ = function(a) { - return goog.getUid(a); + return goog.getUid(a) }; cljs.core.inc = function(a) { - return a + 1; + return a + 1 }; cljs.core.Reduced = function(a) { this.val = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32768; -}; -cljs.core.Reduced.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.val; + this.cljs$lang$protocol_mask$partition0$ = 32768 }; cljs.core.Reduced.cljs$lang$type = !0; cljs.core.Reduced.cljs$lang$ctorStr = "cljs.core/Reduced"; cljs.core.Reduced.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Reduced"); + return cljs.core._write.call(null, b, "cljs.core/Reduced") +}; +cljs.core.Reduced.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + return this.val }; cljs.core.__GT_Reduced = function(a) { - return new cljs.core.Reduced(a); + return new cljs.core.Reduced(a) }; cljs.core.reduced = function(a) { - return new cljs.core.Reduced(a); + return new cljs.core.Reduced(a) }; cljs.core.reduced_QMARK_ = function(a) { - return a instanceof cljs.core.Reduced; -}; -cljs.core.ensure_reduced = function(a) { - return cljs.core.reduced_QMARK_(a) ? a : cljs.core.reduced(a); -}; -cljs.core.unreduced = function(a) { - return cljs.core.reduced_QMARK_(a) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a) : a; -}; -cljs.core.deref = function(a) { - return cljs.core._deref(a); + return a instanceof cljs.core.Reduced }; cljs.core.ci_reduce = function() { var a = null, b = function(a, b) { - var c = cljs.core._count(a); - if (0 === c) { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - } - for (var d = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, 0), k = 1;;) { - if (k < c) { - var l = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, k), d = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, l) : b.call(null, d, l); - if (cljs.core.reduced_QMARK_(d)) { - return cljs.core.deref(d); + var c = cljs.core._count.call(null, a); + if(0 === c) { + return b.call(null) + } + for(var d = cljs.core._nth.call(null, a, 0), k = 1;;) { + if(k < c) { + d = b.call(null, d, cljs.core._nth.call(null, a, k)); + if(cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d) } - k += 1; - } else { - return d; + k += 1 + }else { + return d } } }, c = function(a, b, c) { - var d = cljs.core._count(a), k = c; - for (c = 0;;) { - if (c < d) { - var l = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, c), k = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(k, l) : b.call(null, k, l); - if (cljs.core.reduced_QMARK_(k)) { - return cljs.core.deref(k); + for(var d = cljs.core._count.call(null, a), k = 0;;) { + if(k < d) { + c = b.call(null, c, cljs.core._nth.call(null, a, k)); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) } - c += 1; - } else { - return k; + k += 1 + }else { + return c } } }, d = function(a, b, c, d) { - for (var k = cljs.core._count(a);;) { - if (d < k) { - var l = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, d); - c = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, l) : b.call(null, c, l); - if (cljs.core.reduced_QMARK_(c)) { - return cljs.core.deref(c); + for(var k = cljs.core._count.call(null, a);;) { + if(d < k) { + c = b.call(null, c, cljs.core._nth.call(null, a, d)); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) } - d += 1; - } else { - return c; + d += 1 + }else { + return c } } }, a = function(a, f, g, h) { @@ -4022,56 +2970,54 @@ cljs.core.ci_reduce = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h); + return d.call(this, a, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a; + return a }(); cljs.core.array_reduce = function() { var a = null, b = function(a, b) { var c = a.length; - if (0 === a.length) { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - } - for (var d = a[0], k = 1;;) { - if (k < c) { - var l = a[k], d = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, l) : b.call(null, d, l); - if (cljs.core.reduced_QMARK_(d)) { - return cljs.core.deref(d); + if(0 === a.length) { + return b.call(null) + } + for(var d = a[0], k = 1;;) { + if(k < c) { + d = b.call(null, d, a[k]); + if(cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d) } - k += 1; - } else { - return d; + k += 1 + }else { + return d } } }, c = function(a, b, c) { - var d = a.length, k = c; - for (c = 0;;) { - if (c < d) { - var l = a[c], k = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(k, l) : b.call(null, k, l); - if (cljs.core.reduced_QMARK_(k)) { - return cljs.core.deref(k); + for(var d = a.length, k = 0;;) { + if(k < d) { + c = b.call(null, c, a[k]); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) } - c += 1; - } else { - return k; + k += 1 + }else { + return c } } }, d = function(a, b, c, d) { - for (var k = a.length;;) { - if (d < k) { - var l = a[d]; - c = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, l) : b.call(null, c, l); - if (cljs.core.reduced_QMARK_(c)) { - return cljs.core.deref(c); + for(var k = a.length;;) { + if(d < k) { + c = b.call(null, c, a[d]); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) } - d += 1; - } else { - return c; + d += 1 + }else { + return c } } }, a = function(a, f, g, h) { @@ -4081,367 +3027,301 @@ cljs.core.array_reduce = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h); + return d.call(this, a, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a; + return a }(); cljs.core.counted_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ICounted, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ICounted, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) }; cljs.core.indexed_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) }; -cljs.core.IndexedSeqIterator = function(a, b) { +cljs.core.IndexedSeq = function(a, b) { this.arr = a; this.i = b; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 166199550 }; -cljs.core.IndexedSeqIterator.prototype.hasNext = function() { - return this.i < this.arr.length; +cljs.core.IndexedSeq.cljs$lang$type = !0; +cljs.core.IndexedSeq.cljs$lang$ctorStr = "cljs.core/IndexedSeq"; +cljs.core.IndexedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/IndexedSeq") }; -cljs.core.IndexedSeqIterator.prototype.next = function() { - var a = this.arr[this.i]; - this.i += 1; - return a; +cljs.core.IndexedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_coll.call(null, this) }; -cljs.core.IndexedSeqIterator.cljs$lang$type = !0; -cljs.core.IndexedSeqIterator.cljs$lang$ctorStr = "cljs.core/IndexedSeqIterator"; -cljs.core.IndexedSeqIterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/IndexedSeqIterator"); +cljs.core.IndexedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : null }; -cljs.core.__GT_IndexedSeqIterator = function(a, b) { - return new cljs.core.IndexedSeqIterator(a, b); +cljs.core.IndexedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.IndexedSeq = function(a, b) { - this.arr = a; - this.i = b; - this.cljs$lang$protocol_mask$partition0$ = 166199550; - this.cljs$lang$protocol_mask$partition1$ = 8192; +cljs.core.IndexedSeq.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + a = cljs.core._count.call(null, this); + return 0 < a ? new cljs.core.RSeq(this, a - 1, null) : null }; cljs.core.IndexedSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); + return cljs.core.pr_str_STAR_.call(null, this) +}; +cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.i], this.i + 1) +}; +cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.array_reduce.call(null, this.arr, b, c, this.i) +}; +cljs.core.IndexedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; -cljs.core.IndexedSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.IndexedSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.arr.length - this.i +}; +cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + return this.arr[this.i] +}; +cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : cljs.core.List.EMPTY +}; +cljs.core.IndexedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { var c = b + this.i; - return c < this.arr.length ? this.arr[c] : null; + return c < this.arr.length ? this.arr[c] : null }; cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { a = b + this.i; - return a < this.arr.length ? this.arr[a] : c; + return a < this.arr.length ? this.arr[a] : c }; -cljs.core.IndexedSeq.prototype.cljs$core$IIterable$ = !0; -cljs.core.IndexedSeq.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { - return new cljs.core.IndexedSeqIterator(this.arr, this.i); -}; -cljs.core.IndexedSeq.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.IndexedSeq(this.arr, this.i); -}; -cljs.core.IndexedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : null; -}; -cljs.core.IndexedSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.arr.length - this.i; -}; -cljs.core.IndexedSeq.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - a = cljs.core._count(this); - return 0 < a ? new cljs.core.RSeq(this, a - 1, null) : null; -}; -cljs.core.IndexedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_ordered_coll(this); -}; -cljs.core.IndexedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2 ? cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2(this, b) : cljs.core.equiv_sequential.call(null, this, b); -}; -cljs.core.IndexedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.List.EMPTY; -}; -cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, this.arr[this.i], this.i + 1); -}; -cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, c, this.i); -}; -cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.arr[this.i]; -}; -cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : cljs.core.List.EMPTY; -}; -cljs.core.IndexedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; -}; -cljs.core.IndexedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.cljs$core$IFn$_invoke$arity$2 ? cljs.core.cons.cljs$core$IFn$_invoke$arity$2(b, this) : cljs.core.cons.call(null, b, this); -}; -cljs.core.IndexedSeq.cljs$lang$type = !0; -cljs.core.IndexedSeq.cljs$lang$ctorStr = "cljs.core/IndexedSeq"; -cljs.core.IndexedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/IndexedSeq"); +cljs.core.IndexedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.List.EMPTY }; cljs.core.__GT_IndexedSeq = function(a, b) { - return new cljs.core.IndexedSeq(a, b); -}; -cljs.core.IndexedSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.IndexedSeq(a, b) }; cljs.core.prim_seq = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(b, 0); + return a.call(null, b, 0) }, c = function(a, b) { - return b < a.length ? new cljs.core.IndexedSeq(a, b) : null; + return b < a.length ? new cljs.core.IndexedSeq(a, b) : null }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.array_seq = function() { var a = null, b = function(a) { - return cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(a, 0); + return cljs.core.prim_seq.call(null, a, 0) }, c = function(a, b) { - return cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(a, b); + return cljs.core.prim_seq.call(null, a, b) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.RSeq = function(a, b, c) { this.ci = a; this.i = b; this.meta = c; - this.cljs$lang$protocol_mask$partition0$ = 32374990; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.RSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.RSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.RSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.RSeq.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.RSeq(this.ci, this.i, this.meta); -}; -cljs.core.RSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : null; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32374862 }; -cljs.core.RSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.i + 1; +cljs.core.RSeq.cljs$lang$type = !0; +cljs.core.RSeq.cljs$lang$ctorStr = "cljs.core/RSeq"; +cljs.core.RSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/RSeq") }; cljs.core.RSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_ordered_coll(this); + return cljs.core.hash_coll.call(null, this) }; -cljs.core.RSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2 ? cljs.core.equiv_sequential.cljs$core$IFn$_invoke$arity$2(this, b) : cljs.core.equiv_sequential.call(null, this, b); +cljs.core.RSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.RSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - a = cljs.core.List.EMPTY; - var b = this.meta; - return cljs.core.with_meta.cljs$core$IFn$_invoke$arity$2 ? cljs.core.with_meta.cljs$core$IFn$_invoke$arity$2(a, b) : cljs.core.with_meta.call(null, a, b); +cljs.core.RSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.RSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2 ? cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this) : cljs.core.seq_reduce.call(null, b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.RSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3 ? cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this) : cljs.core.seq_reduce.call(null, b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.RSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this +}; +cljs.core.RSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.i + 1 }; cljs.core.RSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.ci, this.i); + return cljs.core._nth.call(null, this.ci, this.i) }; cljs.core.RSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : cljs.core.List.EMPTY; + return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : null }; -cljs.core.RSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.RSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.RSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.RSeq(this.ci, this.i, b); + return new cljs.core.RSeq(this.ci, this.i, b) }; -cljs.core.RSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.cljs$core$IFn$_invoke$arity$2 ? cljs.core.cons.cljs$core$IFn$_invoke$arity$2(b, this) : cljs.core.cons.call(null, b, this); +cljs.core.RSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.RSeq.cljs$lang$type = !0; -cljs.core.RSeq.cljs$lang$ctorStr = "cljs.core/RSeq"; -cljs.core.RSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/RSeq"); +cljs.core.RSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_RSeq = function(a, b, c) { - return new cljs.core.RSeq(a, b, c); -}; -cljs.core.RSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.RSeq(a, b, c) }; cljs.core.second = function(a) { - return cljs.core.first(cljs.core.next(a)); + return cljs.core.first.call(null, cljs.core.next.call(null, a)) }; cljs.core.ffirst = function(a) { - return cljs.core.first(cljs.core.first(a)); + return cljs.core.first.call(null, cljs.core.first.call(null, a)) }; cljs.core.nfirst = function(a) { - return cljs.core.next(cljs.core.first(a)); + return cljs.core.next.call(null, cljs.core.first.call(null, a)) }; cljs.core.fnext = function(a) { - return cljs.core.first(cljs.core.next(a)); + return cljs.core.first.call(null, cljs.core.next.call(null, a)) }; cljs.core.nnext = function(a) { - return cljs.core.next(cljs.core.next(a)); + return cljs.core.next.call(null, cljs.core.next.call(null, a)) }; cljs.core.last = function(a) { - for (;;) { - var b = cljs.core.next(a); - if (null != b) { - a = b; - } else { - return cljs.core.first(a); + for(;;) { + var b = cljs.core.next.call(null, a); + if(null != b) { + a = b + }else { + return cljs.core.first.call(null, a) } } }; cljs.core.IEquiv._ = !0; cljs.core._equiv._ = function(a, b) { - return a === b; + return a === b }; cljs.core.conj = function() { - var a = null, b = function() { - return cljs.core.PersistentVector.EMPTY; - }, c = function(a, b) { - return null != a ? cljs.core._conj(a, b) : cljs.core._conj(cljs.core.List.EMPTY, b); - }, d = function() { + var a = null, b = function(a, b) { + return null != a ? cljs.core._conj.call(null, a, b) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b) + }, c = function() { var b = function(b, c, d) { - for (;;) { - if (cljs.core.truth_(d)) { - b = a.cljs$core$IFn$_invoke$arity$2(b, c), c = cljs.core.first(d), d = cljs.core.next(d); - } else { - return a.cljs$core$IFn$_invoke$arity$2(b, c); - } - } - }, c = function(a, c, d) { - var f = null; - if (2 < arguments.length) { - for (var f = 0, m = Array(arguments.length - 2);f < m.length;) { - m[f] = arguments[f + 2], ++f; + for(;;) { + if(cljs.core.truth_(d)) { + b = a.call(null, b, c), c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) + }else { + return a.call(null, b, c) } - f = new cljs.core.IndexedSeq(m, 0); } - return b.call(this, a, c, f); + }, c = function(a, c, e) { + var k = null; + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.next(a); - var d = cljs.core.first(a); + var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(), a = function(a, f, g) { + return c + }(), a = function(a, e, f) { switch(arguments.length) { - case 0: - return b.call(this); - case 1: - return a; case 2: - return c.call(this, a, f); + return b.call(this, a, e); default: - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return d.cljs$core$IFn$_invoke$arity$variadic(a, f, h); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = d.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$0 = b; - a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; - }; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$variadic = d.cljs$core$IFn$_invoke$arity$variadic; - return a; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a }(); cljs.core.empty = function(a) { - return null == a ? null : cljs.core._empty(a); + return null == a ? null : cljs.core._empty.call(null, a) }; cljs.core.accumulating_seq_count = function(a) { - a = cljs.core.seq(a); - for (var b = 0;;) { - if (cljs.core.counted_QMARK_(a)) { - return b + cljs.core._count(a); + a = cljs.core.seq.call(null, a); + for(var b = 0;;) { + if(cljs.core.counted_QMARK_.call(null, a)) { + return b + cljs.core._count.call(null, a) } - a = cljs.core.next(a); - b += 1; + a = cljs.core.next.call(null, a); + b += 1 } }; cljs.core.count = function(a) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$) ? a.cljs$core$ICounted$_count$arity$1(null) : a instanceof Array ? a.length : "string" === typeof a ? a.length : cljs.core.native_satisfies_QMARK_(cljs.core.ICounted, a) ? cljs.core._count(a) : cljs.core.accumulating_seq_count(a) : 0; + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$) ? cljs.core._count.call(null, a) : a instanceof Array ? a.length : "string" === typeof a ? a.length : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) ? cljs.core._count.call(null, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.accumulating_seq_count.call(null, a) : null : 0 }; cljs.core.linear_traversal_nth = function() { var a = null, b = function(a, b) { - for (;;) { - if (null == a) { + for(;;) { + if(null == a) { throw Error("Index out of bounds"); } - if (0 === b) { - if (cljs.core.seq(a)) { - return cljs.core.first(a); + if(0 === b) { + if(cljs.core.seq.call(null, a)) { + return cljs.core.first.call(null, a) } throw Error("Index out of bounds"); } - if (cljs.core.indexed_QMARK_(a)) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, b); + if(cljs.core.indexed_QMARK_.call(null, a)) { + return cljs.core._nth.call(null, a, b) } - if (cljs.core.seq(a)) { - var c = cljs.core.next(a), g = b - 1; + if(cljs.core.seq.call(null, a)) { + var c = cljs.core.next.call(null, a), g = b - 1; a = c; - b = g; - } else { - throw Error("Index out of bounds"); + b = g + }else { + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error("Index out of bounds"); + } + return null } } }, c = function(a, b, c) { - for (;;) { - if (null == a) { - return c; + for(;;) { + if(null == a) { + return c } - if (0 === b) { - return cljs.core.seq(a) ? cljs.core.first(a) : c; + if(0 === b) { + return cljs.core.seq.call(null, a) ? cljs.core.first.call(null, a) : c } - if (cljs.core.indexed_QMARK_(a)) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(a, b, c); + if(cljs.core.indexed_QMARK_.call(null, a)) { + return cljs.core._nth.call(null, a, b, c) } - if (cljs.core.seq(a)) { - a = cljs.core.next(a), b -= 1; - } else { - return c; + if(cljs.core.seq.call(null, a)) { + a = cljs.core.next.call(null, a), b -= 1 + }else { + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null } } }, a = function(a, e, f) { @@ -4449,116 +3329,115 @@ cljs.core.linear_traversal_nth = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.nth = function() { var a = null, b = function(a, b) { - if ("number" !== typeof b) { - throw Error("index argument to nth must be a number"); - } - if (null == a) { - return a; + if(null == a) { + return null } - if (a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { - return a.cljs$core$IIndexed$_nth$arity$2(null, b); + if(a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { + return cljs.core._nth.call(null, a, b) } - if (a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : null; + if(a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : null } - if (cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a)) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, b); + if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { + return cljs.core._nth.call(null, a, b) } - if (a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) { - return cljs.core.linear_traversal_nth.cljs$core$IFn$_invoke$arity$2(a, b); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if(a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { + return cljs.core.linear_traversal_nth.call(null, a, b) + } + throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str.call(null, cljs.core.type.call(null, a)))].join("")); } - throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str(cljs.core.type(a)))].join("")); + return null }, c = function(a, b, c) { - if ("number" !== typeof b) { - throw Error("index argument to nth must be a number."); - } - if (null == a) { - return c; - } - if (a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { - return a.cljs$core$IIndexed$_nth$arity$3(null, b, c); - } - if (a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : c; - } - if (cljs.core.native_satisfies_QMARK_(cljs.core.IIndexed, a)) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(a, b); - } - if (a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a)) { - return cljs.core.linear_traversal_nth.cljs$core$IFn$_invoke$arity$3(a, b, c); + if(null != a) { + if(a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { + return cljs.core._nth.call(null, a, b, c) + } + if(a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : c + } + if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { + return cljs.core._nth.call(null, a, b) + } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if(a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { + return cljs.core.linear_traversal_nth.call(null, a, b, c) + } + throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str.call(null, cljs.core.type.call(null, a)))].join("")); + } + return null } - throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str(cljs.core.type(a)))].join("")); + return c }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); -cljs.core.nthrest = function(a, b) { - for (var c = b, d = a;;) { - if (0 < c && cljs.core.seq(d)) { - c -= 1, d = cljs.core.rest(d); - } else { - return d; - } - } -}; cljs.core.get = function() { var a = null, b = function(a, b) { - return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? a.cljs$core$ILookup$_lookup$arity$2(null, b) : a instanceof Array ? b < a.length ? a[b] : null : "string" === typeof a ? b < a.length ? a[b] : null : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, a) ? cljs.core._lookup.cljs$core$IFn$_invoke$arity$2(a, b) : null; + if(null == a) { + return null + } + if(a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$)) { + return cljs.core._lookup.call(null, a, b) + } + if(a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : null + } + if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a)) { + return cljs.core._lookup.call(null, a, b) + } + new cljs.core.Keyword(null, "else", "else", 1017020587); + return null }, c = function(a, b, c) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? a.cljs$core$ILookup$_lookup$arity$3(null, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, a) ? cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(a, b, c) : c : c; + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? cljs.core._lookup.call(null, a, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a) ? cljs.core._lookup.call(null, a, b, c) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null : c }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.assoc = function() { var a = null, b = function(a, b, c) { - return null != a ? cljs.core._assoc(a, b, c) : cljs.core.PersistentHashMap.fromArrays([b], [c]); + return null != a ? cljs.core._assoc.call(null, a, b, c) : cljs.core.PersistentHashMap.fromArrays.call(null, [b], [c]) }, c = function() { var b = function(b, c, d, e) { - for (;;) { - if (b = a.cljs$core$IFn$_invoke$arity$3(b, c, d), cljs.core.truth_(e)) { - c = cljs.core.first(e), d = cljs.core.second(e), e = cljs.core.nnext(e); - } else { - return b; + for(;;) { + if(b = a.call(null, b, c, d), cljs.core.truth_(e)) { + c = cljs.core.first.call(null, e), d = cljs.core.second.call(null, e), e = cljs.core.nnext.call(null, e) + }else { + return b } } }, c = function(a, c, e, k) { var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return b.call(this, a, c, e, l); + 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, c, e, l) }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -4568,23 +3447,16 @@ cljs.core.assoc = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a); + return b(c, e, k, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f, g) { switch(arguments.length) { case 3: return b.call(this, a, e, f); default: - var h = null; - if (3 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { - k[h] = arguments[h + 3], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; @@ -4592,33 +3464,28 @@ cljs.core.assoc = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.dissoc = function() { var a = null, b = function(a, b) { - return null == a ? null : cljs.core._dissoc(a, b); + return cljs.core._dissoc.call(null, a, b) }, c = function() { var b = function(b, c, d) { - for (;;) { - if (null == b) { - return null; + for(;;) { + if(null == b) { + return null } - b = a.cljs$core$IFn$_invoke$arity$2(b, c); - if (cljs.core.truth_(d)) { - c = cljs.core.first(d), d = cljs.core.next(d); - } else { - return b; + b = a.call(null, b, c); + if(cljs.core.truth_(d)) { + c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) + }else { + return b } } }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4626,10 +3493,10 @@ cljs.core.dissoc = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4637,304 +3504,109 @@ cljs.core.dissoc = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.fn_QMARK_ = function(a) { var b = goog.isFunction(a); - return cljs.core.truth_(b) ? b : a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$Fn$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.Fn, a) : cljs.core.native_satisfies_QMARK_(cljs.core.Fn, a); -}; -cljs.core.MetaFn = function(a, b) { - this.afn = a; - this.meta = b; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 393217; -}; -cljs.core.MetaFn.prototype.call = function() { - var a = null, b = function(a) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$0 ? a.afn.cljs$core$IFn$_invoke$arity$0() : a.afn.call(null); - }, c = function(a, b) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$1 ? a.afn.cljs$core$IFn$_invoke$arity$1(b) : a.afn.call(null, b); - }, d = function(a, b, c) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$2 ? a.afn.cljs$core$IFn$_invoke$arity$2(b, c) : a.afn.call(null, b, c); - }, e = function(a, b, c, d) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$3 ? a.afn.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.afn.call(null, b, c, d); - }, f = function(a, b, c, d, e) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$4 ? a.afn.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.afn.call(null, b, c, d, e); - }, g = function(a, b, c, d, e, f) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$5 ? a.afn.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : a.afn.call(null, b, c, d, e, f); - }, h = function(a, b, c, d, e, f, g) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$6 ? a.afn.cljs$core$IFn$_invoke$arity$6(b, c, d, e, f, g) : a.afn.call(null, b, c, d, e, f, g); - }, k = function(a, b, c, d, e, f, g, h) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$7 ? a.afn.cljs$core$IFn$_invoke$arity$7(b, c, d, e, f, g, h) : a.afn.call(null, b, c, d, e, f, g, h); - }, l = function(a, b, c, d, e, f, g, h, k) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$8 ? a.afn.cljs$core$IFn$_invoke$arity$8(b, c, d, e, f, g, h, k) : a.afn.call(null, b, c, d, e, f, g, h, k); - }, m = function(a, b, c, d, e, f, g, h, k, l) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$9 ? a.afn.cljs$core$IFn$_invoke$arity$9(b, c, d, e, f, g, h, k, l) : a.afn.call(null, b, c, d, e, f, g, h, k, l); - }, n = function(a, b, c, d, e, f, g, h, k, l, m) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$10 ? a.afn.cljs$core$IFn$_invoke$arity$10(b, c, d, e, f, g, h, k, l, m) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m); - }, p = function(a, b, c, d, e, f, g, h, k, l, m, q) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$11 ? a.afn.cljs$core$IFn$_invoke$arity$11(b, c, d, e, f, g, h, k, l, m, q) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q); - }, q = function(a, b, c, d, e, f, g, h, k, l, m, q, n) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$12 ? a.afn.cljs$core$IFn$_invoke$arity$12(b, c, d, e, f, g, h, k, l, m, q, n) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n); - }, r = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$13 ? a.afn.cljs$core$IFn$_invoke$arity$13(b, c, d, e, f, g, h, k, l, m, q, n, r) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r); - }, s = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$14 ? a.afn.cljs$core$IFn$_invoke$arity$14(b, c, d, e, f, g, h, k, l, m, q, n, r, p) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p); - }, t = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$15 ? a.afn.cljs$core$IFn$_invoke$arity$15(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s); - }, u = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$16 ? a.afn.cljs$core$IFn$_invoke$arity$16(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t); - }, v = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$17 ? a.afn.cljs$core$IFn$_invoke$arity$17(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u); - }, w = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$18 ? a.afn.cljs$core$IFn$_invoke$arity$18(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v); - }, y = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$19 ? a.afn.cljs$core$IFn$_invoke$arity$19(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w); - }, F = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) { - a = this; - return a.afn.cljs$core$IFn$_invoke$arity$20 ? a.afn.cljs$core$IFn$_invoke$arity$20(b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y) : a.afn.call(null, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y); - }, L = function(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) { - a = this.afn; - return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F) : cljs.core.apply.call(null, a, b, c, d, e, f, g, h, k, l, m, q, n, r, p, s, t, u, v, w, y, F); - }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, x); - case 3: - return d.call(this, a, x, z); - case 4: - return e.call(this, a, x, z, A); - case 5: - return f.call(this, a, x, z, A, B); - case 6: - return g.call(this, a, x, z, A, B, C); - case 7: - return h.call(this, a, x, z, A, B, C, D); - case 8: - return k.call(this, a, x, z, A, B, C, D, E); - case 9: - return l.call(this, a, x, z, A, B, C, D, E, G); - case 10: - return m.call(this, a, x, z, A, B, C, D, E, G, H); - case 11: - return n.call(this, a, x, z, A, B, C, D, E, G, H, I); - case 12: - return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); - case 13: - return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); - case 14: - return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); - case 15: - return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); - case 16: - return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); - case 17: - return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); - case 18: - return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); - case 19: - return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); - case 20: - return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); - case 21: - return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); - case 22: - return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - a.cljs$core$IFn$_invoke$arity$4 = e; - a.cljs$core$IFn$_invoke$arity$5 = f; - a.cljs$core$IFn$_invoke$arity$6 = g; - a.cljs$core$IFn$_invoke$arity$7 = h; - a.cljs$core$IFn$_invoke$arity$8 = k; - a.cljs$core$IFn$_invoke$arity$9 = l; - a.cljs$core$IFn$_invoke$arity$10 = m; - a.cljs$core$IFn$_invoke$arity$11 = n; - a.cljs$core$IFn$_invoke$arity$12 = p; - a.cljs$core$IFn$_invoke$arity$13 = q; - a.cljs$core$IFn$_invoke$arity$14 = r; - a.cljs$core$IFn$_invoke$arity$15 = s; - a.cljs$core$IFn$_invoke$arity$16 = t; - a.cljs$core$IFn$_invoke$arity$17 = u; - a.cljs$core$IFn$_invoke$arity$18 = v; - a.cljs$core$IFn$_invoke$arity$19 = w; - a.cljs$core$IFn$_invoke$arity$20 = y; - a.cljs$core$IFn$_invoke$arity$21 = F; - a.cljs$core$IFn$_invoke$arity$22 = L; - return a; -}(); -cljs.core.MetaFn.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$0 = function() { - return this.afn.cljs$core$IFn$_invoke$arity$0 ? this.afn.cljs$core$IFn$_invoke$arity$0() : this.afn.call(null); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.afn.cljs$core$IFn$_invoke$arity$1 ? this.afn.cljs$core$IFn$_invoke$arity$1(a) : this.afn.call(null, a); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.afn.cljs$core$IFn$_invoke$arity$2 ? this.afn.cljs$core$IFn$_invoke$arity$2(a, b) : this.afn.call(null, a, b); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$3 = function(a, b, c) { - return this.afn.cljs$core$IFn$_invoke$arity$3 ? this.afn.cljs$core$IFn$_invoke$arity$3(a, b, c) : this.afn.call(null, a, b, c); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$4 = function(a, b, c, d) { - return this.afn.cljs$core$IFn$_invoke$arity$4 ? this.afn.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : this.afn.call(null, a, b, c, d); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$5 = function(a, b, c, d, e) { - return this.afn.cljs$core$IFn$_invoke$arity$5 ? this.afn.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) : this.afn.call(null, a, b, c, d, e); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$6 = function(a, b, c, d, e, f) { - return this.afn.cljs$core$IFn$_invoke$arity$6 ? this.afn.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) : this.afn.call(null, a, b, c, d, e, f); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$7 = function(a, b, c, d, e, f, g) { - return this.afn.cljs$core$IFn$_invoke$arity$7 ? this.afn.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) : this.afn.call(null, a, b, c, d, e, f, g); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$8 = function(a, b, c, d, e, f, g, h) { - return this.afn.cljs$core$IFn$_invoke$arity$8 ? this.afn.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) : this.afn.call(null, a, b, c, d, e, f, g, h); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$9 = function(a, b, c, d, e, f, g, h, k) { - return this.afn.cljs$core$IFn$_invoke$arity$9 ? this.afn.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) : this.afn.call(null, a, b, c, d, e, f, g, h, k); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$10 = function(a, b, c, d, e, f, g, h, k, l) { - return this.afn.cljs$core$IFn$_invoke$arity$10 ? this.afn.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$11 = function(a, b, c, d, e, f, g, h, k, l, m) { - return this.afn.cljs$core$IFn$_invoke$arity$11 ? this.afn.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$12 = function(a, b, c, d, e, f, g, h, k, l, m, n) { - return this.afn.cljs$core$IFn$_invoke$arity$12 ? this.afn.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$13 = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { - return this.afn.cljs$core$IFn$_invoke$arity$13 ? this.afn.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$14 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { - return this.afn.cljs$core$IFn$_invoke$arity$14 ? this.afn.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$15 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { - return this.afn.cljs$core$IFn$_invoke$arity$15 ? this.afn.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$16 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { - return this.afn.cljs$core$IFn$_invoke$arity$16 ? this.afn.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$17 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { - return this.afn.cljs$core$IFn$_invoke$arity$17 ? this.afn.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$18 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { - return this.afn.cljs$core$IFn$_invoke$arity$18 ? this.afn.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$19 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { - return this.afn.cljs$core$IFn$_invoke$arity$19 ? this.afn.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$20 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { - return this.afn.cljs$core$IFn$_invoke$arity$20 ? this.afn.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : this.afn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); -}; -cljs.core.MetaFn.prototype.cljs$core$IFn$_invoke$arity$21 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { - var F = this.afn; - return cljs.core.apply.cljs$core$IFn$_invoke$arity$22 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$22(F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : cljs.core.apply.call(null, F, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); -}; -cljs.core.MetaFn.prototype.cljs$core$Fn$ = !0; -cljs.core.MetaFn.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.MetaFn(this.afn, b); -}; -cljs.core.MetaFn.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.MetaFn.cljs$lang$type = !0; -cljs.core.MetaFn.cljs$lang$ctorStr = "cljs.core/MetaFn"; -cljs.core.MetaFn.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/MetaFn"); -}; -cljs.core.__GT_MetaFn = function(a, b) { - return new cljs.core.MetaFn(a, b); -}; -cljs.core.with_meta = function(a, b) { - var c; - if (c = cljs.core.fn_QMARK_(a)) { - c = !(a ? a.cljs$lang$protocol_mask$partition0$ & 262144 || a.cljs$core$IWithMeta$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IWithMeta, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IWithMeta, a)); - } - return c ? new cljs.core.MetaFn(a, b) : null == a ? null : cljs.core._with_meta(a, b); + return b ? b : a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$Fn$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) +}; +cljs.core.with_meta = function with_meta(b, c) { + return cljs.core.fn_QMARK_.call(null, b) && !(b ? b.cljs$lang$protocol_mask$partition0$ & 262144 || b.cljs$core$IWithMeta$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, b)) ? with_meta.call(null, function() { + "undefined" === typeof cljs.core.t6140 && (cljs.core.t6140 = function(b, c, f, g) { + this.meta = b; + this.o = c; + this.with_meta = f; + this.meta6141 = g; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 393217 + }, cljs.core.t6140.cljs$lang$type = !0, cljs.core.t6140.cljs$lang$ctorStr = "cljs.core/t6140", cljs.core.t6140.cljs$lang$ctorPrWriter = function(b, c, f) { + return cljs.core._write.call(null, c, "cljs.core/t6140") + }, cljs.core.t6140.prototype.call = function() { + var b = function(b, c) { + return cljs.core.apply.call(null, b.o, c) + }, c = function(c, e) { + c = this; + var h = null; + 1 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return b.call(this, c, h) + }; + c.cljs$lang$maxFixedArity = 1; + c.cljs$lang$applyTo = function(c) { + var e = cljs.core.first(c); + c = cljs.core.rest(c); + return b(e, c) + }; + c.cljs$core$IFn$_invoke$arity$variadic = b; + return c + }(), cljs.core.t6140.prototype.apply = function(b, c) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, c))) + }, cljs.core.t6140.prototype.cljs$core$IFn$_invoke$arity$2 = function() { + var b = function(b) { + return cljs.core.apply.call(null, self__.o, b) + }, c = function(c) { + var e = null; + 0 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return b.call(this, e) + }; + c.cljs$lang$maxFixedArity = 0; + c.cljs$lang$applyTo = function(c) { + c = cljs.core.seq(c); + return b(c) + }; + c.cljs$core$IFn$_invoke$arity$variadic = b; + return c + }(), cljs.core.t6140.prototype.cljs$core$Fn$ = !0, cljs.core.t6140.prototype.cljs$core$IMeta$_meta$arity$1 = function(b) { + return this.meta6141 + }, cljs.core.t6140.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(b, c) { + return new cljs.core.t6140(this.meta, this.o, this.with_meta, c) + }, cljs.core.__GT_t6140 = function(b, c, f, g) { + return new cljs.core.t6140(b, c, f, g) + }); + return new cljs.core.t6140(c, b, with_meta, null) + }(), c) : null == b ? null : cljs.core._with_meta.call(null, b, c) }; cljs.core.meta = function(a) { var b; - b = (b = null != a) ? a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a) : b; - return b ? cljs.core._meta(a) : null; + b = (b = null != a) ? a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, a) : b; + return b ? cljs.core._meta.call(null, a) : null }; cljs.core.peek = function(a) { - return null == a ? null : cljs.core._peek(a); + return null == a ? null : cljs.core._peek.call(null, a) }; cljs.core.pop = function(a) { - return null == a ? null : cljs.core._pop(a); + return null == a ? null : cljs.core._pop.call(null, a) }; cljs.core.disj = function() { var a = null, b = function(a, b) { - return null == a ? null : cljs.core._disjoin(a, b); + return cljs.core._disjoin.call(null, a, b) }, c = function() { var b = function(b, c, d) { - for (;;) { - if (null == b) { - return null; + for(;;) { + if(null == b) { + return null } - b = a.cljs$core$IFn$_invoke$arity$2(b, c); - if (cljs.core.truth_(d)) { - c = cljs.core.first(d), d = cljs.core.next(d); - } else { - return b; + b = a.call(null, b, c); + if(cljs.core.truth_(d)) { + c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) + }else { + return b } } }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4942,10 +3614,10 @@ cljs.core.disj = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4953,202 +3625,193 @@ cljs.core.disj = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a +}(); +cljs.core.string_hash_cache = function() { + return{} }(); +cljs.core.string_hash_cache_count = 0; +cljs.core.add_to_string_hash_cache = function(a) { + var b = goog.string.hashCode(a); + cljs.core.string_hash_cache[a] = b; + cljs.core.string_hash_cache_count += 1; + return b +}; +cljs.core.check_string_hash_cache = function(a) { + 255 < cljs.core.string_hash_cache_count && (cljs.core.string_hash_cache = {}, cljs.core.string_hash_cache_count = 0); + var b = cljs.core.string_hash_cache[a]; + return"number" === typeof b ? b : cljs.core.add_to_string_hash_cache.call(null, a) +}; +cljs.core.hash = function(a) { + return a && (a.cljs$lang$protocol_mask$partition0$ & 4194304 || a.cljs$core$IHash$) ? cljs.core._hash.call(null, a) : "number" === typeof a ? Math.floor(a) % 2147483647 : !0 === a ? 1 : !1 === a ? 0 : "string" === typeof a ? cljs.core.check_string_hash_cache.call(null, a) : null == a ? 0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._hash.call(null, a) : null +}; cljs.core.empty_QMARK_ = function(a) { - return null == a || cljs.core.not(cljs.core.seq(a)); + return null == a || cljs.core.not.call(null, cljs.core.seq.call(null, a)) }; cljs.core.coll_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 8 || a.cljs$core$ICollection$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ICollection, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ICollection, a); + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 8 || a.cljs$core$ICollection$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) }; cljs.core.set_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 4096 || a.cljs$core$ISet$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISet, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISet, a); + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 4096 || a.cljs$core$ISet$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) }; cljs.core.associative_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 512 || a.cljs$core$IAssociative$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IAssociative, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IAssociative, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 512 || a.cljs$core$IAssociative$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) }; cljs.core.sequential_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16777216 || a.cljs$core$ISequential$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISequential, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISequential, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 16777216 || a.cljs$core$ISequential$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) }; cljs.core.sorted_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 268435456 || a.cljs$core$ISorted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISorted, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISorted, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 268435456 || a.cljs$core$ISorted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) }; cljs.core.reduceable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 524288 || a.cljs$core$IReduce$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 524288 || a.cljs$core$IReduce$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) }; cljs.core.map_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 1024 || a.cljs$core$IMap$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IMap, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IMap, a); + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 1024 || a.cljs$core$IMap$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) }; cljs.core.vector_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16384 || a.cljs$core$IVector$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IVector, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IVector, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 16384 || a.cljs$core$IVector$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) }; cljs.core.chunked_seq_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition1$ & 512 || a.cljs$core$IChunkedSeq$ ? !0 : !1 : !1; + return a ? a.cljs$lang$protocol_mask$partition1$ & 512 || a.cljs$core$IChunkedSeq$ ? !0 : !1 : !1 }; cljs.core.js_obj = function() { var a = null, b = function() { var a = function(a) { - var b = goog.object.create; - return cljs.core.apply.cljs$core$IFn$_invoke$arity$2 ? cljs.core.apply.cljs$core$IFn$_invoke$arity$2(b, a) : cljs.core.apply.call(null, b, a); + return cljs.core.apply.call(null, goog.object.create, a) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, g = Array(arguments.length - 0);d < g.length;) { - g[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(g, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a) { switch(arguments.length) { case 0: return{}; default: - var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(d); + return b.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 0; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return{}; + return{} }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.js_keys = function(a) { - var b = [], c = function(a, b) { - return function(a, c, d) { - return b.push(c); - }; - }(a, b); - goog.object.forEach(a, c); - return b; + var b = []; + goog.object.forEach(a, function(a, d, e) { + return b.push(d) + }); + return b }; cljs.core.js_delete = function(a, b) { - return delete a[b]; + return delete a[b] }; cljs.core.array_copy = function(a, b, c, d, e) { - for (;;) { - if (0 === e) { - return c; + for(;;) { + if(0 === e) { + return c } c[d] = a[b]; d += 1; e -= 1; - b += 1; + b += 1 } }; cljs.core.array_copy_downward = function(a, b, c, d, e) { b += e - 1; - for (d += e - 1;;) { - if (0 === e) { - return c; + for(d += e - 1;;) { + if(0 === e) { + return c } c[d] = a[b]; d -= 1; e -= 1; - b -= 1; + b -= 1 } }; cljs.core.lookup_sentinel = function() { - return{}; + return{} }(); cljs.core.false_QMARK_ = function(a) { - return!1 === a; + return!1 === a }; cljs.core.true_QMARK_ = function(a) { - return!0 === a; + return!0 === a }; cljs.core.undefined_QMARK_ = function(a) { - return void 0 === a; + return void 0 === a }; cljs.core.seq_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeq, a); + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) }; cljs.core.seqable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.ISeqable, a) : cljs.core.native_satisfies_QMARK_(cljs.core.ISeqable, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) }; cljs.core.boolean$ = function(a) { - return cljs.core.truth_(a) ? !0 : !1; + return cljs.core.truth_(a) ? !0 : !1 }; cljs.core.ifn_QMARK_ = function(a) { - var b = cljs.core.fn_QMARK_(a); - return b ? b : a ? a.cljs$lang$protocol_mask$partition0$ & 1 || a.cljs$core$IFn$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IFn, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IFn, a); + var b = cljs.core.fn_QMARK_.call(null, a); + return b ? b : a ? a.cljs$lang$protocol_mask$partition0$ & 1 || a.cljs$core$IFn$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) }; cljs.core.integer_QMARK_ = function(a) { - return "number" === typeof a && cljs.core.not(isNaN(a)) && Infinity !== a && parseFloat(a) === parseInt(a, 10); + return"number" === typeof a && !isNaN(a) && Infinity !== a && parseFloat(a) === parseInt(a, 10) }; cljs.core.contains_QMARK_ = function(a, b) { - return cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? !1 : !0; + return cljs.core.get.call(null, a, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? !1 : !0 }; cljs.core.find = function(a, b) { - return null != a && cljs.core.associative_QMARK_(a) && cljs.core.contains_QMARK_(a, b) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b)], null) : null; + return null != a && cljs.core.associative_QMARK_.call(null, a) && cljs.core.contains_QMARK_.call(null, a, b) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, cljs.core.get.call(null, a, b)], null) : null }; cljs.core.distinct_QMARK_ = function() { var a = null, b = function(a, b) { - return!cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b); + return!cljs.core._EQ_.call(null, a, b) }, c = function() { var a = function(a, b, c) { - if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b)) { - return!1; - } - a = cljs.core.PersistentHashSet.fromArray([a, b], !0); - for (b = c;;) { - var d = cljs.core.first(b); - c = cljs.core.next(b); - if (cljs.core.truth_(b)) { - if (cljs.core.contains_QMARK_(a, d)) { - return!1; + if(cljs.core._EQ_.call(null, a, b)) { + return!1 + } + a = cljs.core.PersistentHashSet.fromArray([b, a], !0); + for(b = c;;) { + var d = cljs.core.first.call(null, b); + c = cljs.core.next.call(null, b); + if(cljs.core.truth_(b)) { + if(cljs.core.contains_QMARK_.call(null, a, d)) { + return!1 } - a = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d); - b = c; - } else { - return!0; + a = cljs.core.conj.call(null, a, d); + b = c + }else { + return!0 } } }, b = function(b, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return a.call(this, b, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, c, k) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -5156,10 +3819,10 @@ cljs.core.distinct_QMARK_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b); + return a(c, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -5167,52 +3830,51 @@ cljs.core.distinct_QMARK_ = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); +cljs.core.sequence = function(a) { + return cljs.core.seq_QMARK_.call(null, a) ? a : (a = cljs.core.seq.call(null, a)) ? a : cljs.core.List.EMPTY +}; cljs.core.compare = function(a, b) { - if (a === b) { - return 0; + if(a === b) { + return 0 } - if (null == a) { - return-1; + if(null == a) { + return-1 } - if (null == b) { - return 1; + if(null == b) { + return 1 } - if (cljs.core.type(a) === cljs.core.type(b)) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 2048 || a.cljs$core$IComparable$) ? a.cljs$core$IComparable$_compare$arity$2(null, b) : goog.array.defaultCompare(a, b); + if(cljs.core.type.call(null, a) === cljs.core.type.call(null, b)) { + return a && (a.cljs$lang$protocol_mask$partition1$ & 2048 || a.cljs$core$IComparable$) ? cljs.core._compare.call(null, a, b) : goog.array.defaultCompare(a, b) } - throw Error("compare on non-nil objects of different types"); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error("compare on non-nil objects of different types"); + } + return null }; cljs.core.compare_indexed = function() { var a = null, b = function(b, c) { - var f = cljs.core.count(b), g = cljs.core.count(c); - return f < g ? -1 : f > g ? 1 : a.cljs$core$IFn$_invoke$arity$4(b, c, f, 0); + var f = cljs.core.count.call(null, b), g = cljs.core.count.call(null, c); + return f < g ? -1 : f > g ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a.call(null, b, c, f, 0) : null }, c = function(a, b, c, g) { - for (;;) { - var h = cljs.core.compare(cljs.core.nth.cljs$core$IFn$_invoke$arity$2(a, g), cljs.core.nth.cljs$core$IFn$_invoke$arity$2(b, g)); - if (0 === h && g + 1 < c) { - g += 1; - } else { - return h; + for(;;) { + var h = cljs.core.compare.call(null, cljs.core.nth.call(null, a, g), cljs.core.nth.call(null, b, g)); + if(0 === h && g + 1 < c) { + g += 1 + }else { + return h } } }, a = function(a, e, f, g) { @@ -5220,84 +3882,77 @@ cljs.core.compare_indexed = function() { case 2: return b.call(this, a, e); case 4: - return c.call(this, a, e, f, g); + return c.call(this, a, e, f, g) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$4 = c; - return a; + return a }(); cljs.core.fn__GT_comparator = function(a) { - return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, cljs.core.compare) ? cljs.core.compare : function(b, c) { - var d = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - return "number" === typeof d ? d : cljs.core.truth_(d) ? -1 : cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, b) : a.call(null, c, b)) ? 1 : 0; - }; + return cljs.core._EQ_.call(null, a, cljs.core.compare) ? cljs.core.compare : function(b, c) { + var d = a.call(null, b, c); + return"number" === typeof d ? d : cljs.core.truth_(d) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : 0 + } }; cljs.core.sort = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(cljs.core.compare, b); + return a.call(null, cljs.core.compare, b) }, c = function(a, b) { - if (cljs.core.seq(b)) { - var c; - c = cljs.core.to_array.cljs$core$IFn$_invoke$arity$1 ? cljs.core.to_array.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.to_array.call(null, b); - var g = cljs.core.fn__GT_comparator(a); - goog.array.stableSort(c, g); - return cljs.core.seq(c); - } - return cljs.core.List.EMPTY; + if(cljs.core.seq.call(null, b)) { + var c = cljs.core.to_array.call(null, b); + goog.array.stableSort(c, cljs.core.fn__GT_comparator.call(null, a)); + return cljs.core.seq.call(null, c) + } + return cljs.core.List.EMPTY }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.sort_by = function() { var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, cljs.core.compare, c); + return a.call(null, b, cljs.core.compare, c) }, c = function(a, b, c) { - return cljs.core.sort.cljs$core$IFn$_invoke$arity$2(function(c, f) { - return cljs.core.fn__GT_comparator(b).call(null, a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f)); - }, c); + return cljs.core.sort.call(null, function(c, f) { + return cljs.core.fn__GT_comparator.call(null, b).call(null, a.call(null, c), a.call(null, f)) + }, c) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.seq_reduce = function() { var a = null, b = function(a, b) { - var c = cljs.core.seq(b); - if (c) { - var g = cljs.core.first(c), c = cljs.core.next(c); - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, g, c) : cljs.core.reduce.call(null, a, g, c); - } - return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); + var c = cljs.core.seq.call(null, b); + return c ? cljs.core.reduce.call(null, a, cljs.core.first.call(null, c), cljs.core.next.call(null, c)) : a.call(null) }, c = function(a, b, c) { - for (c = cljs.core.seq(c);;) { - if (c) { - var g = cljs.core.first(c); - b = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, g) : a.call(null, b, g); - if (cljs.core.reduced_QMARK_(b)) { - return cljs.core.deref(b); + for(c = cljs.core.seq.call(null, c);;) { + if(c) { + b = a.call(null, b, cljs.core.first.call(null, c)); + if(cljs.core.reduced_QMARK_.call(null, b)) { + return cljs.core.deref.call(null, b) } - c = cljs.core.next(c); - } else { - return b; + c = cljs.core.next.call(null, c) + }else { + return b } } }, a = function(a, e, f) { @@ -5305,116 +3960,48 @@ cljs.core.seq_reduce = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.shuffle = function(a) { - a = cljs.core.to_array.cljs$core$IFn$_invoke$arity$1 ? cljs.core.to_array.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.to_array.call(null, a); + a = cljs.core.to_array.call(null, a); goog.array.shuffle(a); - return cljs.core.vec.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vec.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.vec.call(null, a); + return cljs.core.vec.call(null, a) }; cljs.core.reduce = function() { var a = null, b = function(a, b) { - return b && (b.cljs$lang$protocol_mask$partition0$ & 524288 || b.cljs$core$IReduce$) ? b.cljs$core$IReduce$_reduce$arity$2(null, a) : b instanceof Array ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$2(b, a) : "string" === typeof b ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$2(b, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, b) ? cljs.core._reduce.cljs$core$IFn$_invoke$arity$2(b, a) : cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(a, b); + return b && (b.cljs$lang$protocol_mask$partition0$ & 524288 || b.cljs$core$IReduce$) ? cljs.core._reduce.call(null, b, a) : b instanceof Array ? cljs.core.array_reduce.call(null, b, a) : "string" === typeof b ? cljs.core.array_reduce.call(null, b, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, b) ? cljs.core._reduce.call(null, b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b) : null }, c = function(a, b, c) { - return c && (c.cljs$lang$protocol_mask$partition0$ & 524288 || c.cljs$core$IReduce$) ? c.cljs$core$IReduce$_reduce$arity$3(null, a, b) : c instanceof Array ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$3(c, a, b) : "string" === typeof c ? cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$3(c, a, b) : cljs.core.native_satisfies_QMARK_(cljs.core.IReduce, c) ? cljs.core._reduce.cljs$core$IFn$_invoke$arity$3(c, a, b) : cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(a, b, c); + return c && (c.cljs$lang$protocol_mask$partition0$ & 524288 || c.cljs$core$IReduce$) ? cljs.core._reduce.call(null, c, a, b) : c instanceof Array ? cljs.core.array_reduce.call(null, c, a, b) : "string" === typeof c ? cljs.core.array_reduce.call(null, c, a, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, c) ? cljs.core._reduce.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b, c) : null }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.reduce_kv = function(a, b, c) { - return null != c ? cljs.core._kv_reduce(c, a, b) : b; -}; -cljs.core.identity = function(a) { - return a; + return null != c ? cljs.core._kv_reduce.call(null, c, a, b) : b }; -cljs.core.completing = function() { - var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.identity); - }, c = function(a, b) { - return function() { - var c = null, g = function() { - return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); - }, h = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, k = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return g.call(this); - case 1: - return h.call(this, a); - case 2: - return k.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = g; - c.cljs$core$IFn$_invoke$arity$1 = h; - c.cljs$core$IFn$_invoke$arity$2 = k; - return c; - }(); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.transduce = function() { - var a = null, b = function(b, c, f) { - return a.cljs$core$IFn$_invoke$arity$4(b, c, c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null), f); - }, c = function(a, b, c, g) { - a = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - c = cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, c, g); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }, a = function(a, e, f, g) { - switch(arguments.length) { - case 3: - return b.call(this, a, e, f); - case 4: - return c.call(this, a, e, f, g); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$3 = b; - a.cljs$core$IFn$_invoke$arity$4 = c; - return a; -}(); cljs.core._PLUS_ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b + c, d); + return cljs.core.reduce.call(null, a, b + c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -5422,10 +4009,10 @@ cljs.core._PLUS_ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -5435,44 +4022,32 @@ cljs.core._PLUS_ = function() { case 2: return a + d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0; + return 0 }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b; + return a + b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b - c, d); + return cljs.core.reduce.call(null, a, b - c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -5480,10 +4055,10 @@ cljs.core._ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -5491,41 +4066,29 @@ cljs.core._ = function() { case 2: return a - d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a; + return-a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b; + return a - b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._STAR_ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b * c, d); + return cljs.core.reduce.call(null, a, b * c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -5533,10 +4096,10 @@ cljs.core._STAR_ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -5546,46 +4109,34 @@ cljs.core._STAR_ = function() { case 2: return a * d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1; + return 1 }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b; + return a * b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._SLASH_ = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(1, b); + return a.call(null, 1, b) }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, a.cljs$core$IFn$_invoke$arity$2(b, c), d); + return cljs.core.reduce.call(null, a, a.call(null, b, c), d) }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -5593,10 +4144,10 @@ cljs.core._SLASH_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -5604,14 +4155,7 @@ cljs.core._SLASH_ = function() { case 2: return a / e; default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; @@ -5619,34 +4163,29 @@ cljs.core._SLASH_ = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a / b; + return a / b }; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._LT_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for (;;) { - if (a < b) { - if (cljs.core.next(c)) { - a = b, b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return b < cljs.core.first(c); + for(;;) { + if(a < b) { + if(cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) + }else { + return b < cljs.core.first.call(null, c) } - } else { - return!1; + }else { + return!1 } } }, b = function(b, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, d, h) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -5654,10 +4193,10 @@ cljs.core._LT_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b); + return a(d, g, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -5665,51 +4204,39 @@ cljs.core._LT_ = function() { case 2: return a < d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a < b; + return a < b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._LT__EQ_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for (;;) { - if (a <= b) { - if (cljs.core.next(c)) { - a = b, b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return b <= cljs.core.first(c); + for(;;) { + if(a <= b) { + if(cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) + }else { + return b <= cljs.core.first.call(null, c) } - } else { - return!1; + }else { + return!1 } } }, b = function(b, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, d, h) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -5717,10 +4244,10 @@ cljs.core._LT__EQ_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b); + return a(d, g, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -5728,51 +4255,39 @@ cljs.core._LT__EQ_ = function() { case 2: return a <= d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a <= b; + return a <= b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._GT_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for (;;) { - if (a > b) { - if (cljs.core.next(c)) { - a = b, b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return b > cljs.core.first(c); + for(;;) { + if(a > b) { + if(cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) + }else { + return b > cljs.core.first.call(null, c) } - } else { - return!1; + }else { + return!1 } } }, b = function(b, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, d, h) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -5780,10 +4295,10 @@ cljs.core._GT_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b); + return a(d, g, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -5791,51 +4306,39 @@ cljs.core._GT_ = function() { case 2: return a > d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a > b; + return a > b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core._GT__EQ_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for (;;) { - if (a >= b) { - if (cljs.core.next(c)) { - a = b, b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return b >= cljs.core.first(c); + for(;;) { + if(a >= b) { + if(cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) + }else { + return b >= cljs.core.first.call(null, c) } - } else { - return!1; + }else { + return!1 } } }, b = function(b, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, d, h) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -5843,10 +4346,10 @@ cljs.core._GT__EQ_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b); + return a(d, g, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -5854,46 +4357,34 @@ cljs.core._GT__EQ_ = function() { case 2: return a >= d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a >= b; + return a >= b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.dec = function(a) { - return a - 1; + return a - 1 }; cljs.core.max = function() { var a = null, b = function(a, b) { - return a > b ? a : b; + return a > b ? a : b }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b > c ? b : c, d); + return cljs.core.reduce.call(null, a, b > c ? b : c, d) }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -5901,10 +4392,10 @@ cljs.core.max = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -5912,41 +4403,29 @@ cljs.core.max = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.min = function() { var a = null, b = function(a, b) { - return a < b ? a : b; + return a < b ? a : b }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b < c ? b : c, d); + return cljs.core.reduce.call(null, a, b < c ? b : c, d) }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -5954,10 +4433,10 @@ cljs.core.min = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -5965,75 +4444,66 @@ cljs.core.min = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.byte$ = function(a) { - return a; + return a }; cljs.core.char$ = function(a) { - if ("number" === typeof a) { - return String.fromCharCode(a); + if("number" === typeof a) { + return String.fromCharCode(a) } - if ("string" === typeof a && 1 === a.length) { - return a; + if("string" === typeof a && 1 === a.length) { + return a } - throw Error("Argument to char must be a character or number"); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error("Argument to char must be a character or number"); + } + return null }; cljs.core.short$ = function(a) { - return a; + return a }; cljs.core.float$ = function(a) { - return a; + return a }; cljs.core.double$ = function(a) { - return a; + return a }; cljs.core.unchecked_byte = function(a) { - return a; + return a }; cljs.core.unchecked_char = function(a) { - return a; + return a }; cljs.core.unchecked_short = function(a) { - return a; + return a }; cljs.core.unchecked_float = function(a) { - return a; + return a }; cljs.core.unchecked_double = function(a) { - return a; + return a }; cljs.core.unchecked_add = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b + c, d); + return cljs.core.reduce.call(null, a, b + c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -6041,10 +4511,10 @@ cljs.core.unchecked_add = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -6054,44 +4524,32 @@ cljs.core.unchecked_add = function() { case 2: return a + d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0; + return 0 }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b; + return a + b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.unchecked_add_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b + c, d); + return cljs.core.reduce.call(null, a, b + c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -6099,10 +4557,10 @@ cljs.core.unchecked_add_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -6112,52 +4570,40 @@ cljs.core.unchecked_add_int = function() { case 2: return a + d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0; + return 0 }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b; + return a + b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.unchecked_dec = function(a) { - return a - 1; + return a - 1 }; cljs.core.unchecked_dec_int = function(a) { - return a - 1; + return a - 1 }; cljs.core.unchecked_divide_int = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(1, b); + return a.call(null, 1, b) }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, a.cljs$core$IFn$_invoke$arity$2(b, c), d); + return cljs.core.reduce.call(null, a, a.call(null, b, c), d) }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -6165,10 +4611,10 @@ cljs.core.unchecked_divide_int = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -6176,14 +4622,7 @@ cljs.core.unchecked_divide_int = function() { case 2: return a / e; default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; @@ -6191,30 +4630,25 @@ cljs.core.unchecked_divide_int = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a / b; + return a / b }; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.unchecked_inc = function(a) { - return a + 1; + return a + 1 }; cljs.core.unchecked_inc_int = function(a) { - return a + 1; + return a + 1 }; cljs.core.unchecked_multiply = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b * c, d); + return cljs.core.reduce.call(null, a, b * c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -6222,10 +4656,10 @@ cljs.core.unchecked_multiply = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -6235,44 +4669,32 @@ cljs.core.unchecked_multiply = function() { case 2: return a * d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1; + return 1 }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b; + return a * b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.unchecked_multiply_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b * c, d); + return cljs.core.reduce.call(null, a, b * c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -6280,10 +4702,10 @@ cljs.core.unchecked_multiply_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -6293,53 +4715,41 @@ cljs.core.unchecked_multiply_int = function() { case 2: return a * d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1; + return 1 }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b; + return a * b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.unchecked_negate = function(a) { - return-a; + return-a }; cljs.core.unchecked_negate_int = function(a) { - return-a; + return-a }; cljs.core.unchecked_remainder_int = function(a, b) { - return cljs.core.mod.cljs$core$IFn$_invoke$arity$2 ? cljs.core.mod.cljs$core$IFn$_invoke$arity$2(a, b) : cljs.core.mod.call(null, a, b); + return cljs.core.mod.call(null, a, b) }; -cljs.core.unchecked_subtract = function() { +cljs.core.unchecked_substract = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b - c, d); + return cljs.core.reduce.call(null, a, b - c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -6347,10 +4757,10 @@ cljs.core.unchecked_subtract = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -6358,41 +4768,29 @@ cljs.core.unchecked_subtract = function() { case 2: return a - d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a; + return-a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b; + return a - b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); -cljs.core.unchecked_subtract_int = function() { +cljs.core.unchecked_substract_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b - c, d); + return cljs.core.reduce.call(null, a, b - c, d) }, d = function(a, d, g) { var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); + 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, d, h) }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -6400,10 +4798,10 @@ cljs.core.unchecked_subtract_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a); + return b(d, g, a) }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; + return d }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -6411,329 +4809,158 @@ cljs.core.unchecked_subtract_int = function() { case 2: return a - d; default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a; + return-a }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b; + return a - b }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.fix = function(a) { - return 0 <= a ? Math.floor.cljs$core$IFn$_invoke$arity$1 ? Math.floor.cljs$core$IFn$_invoke$arity$1(a) : Math.floor.call(null, a) : Math.ceil.cljs$core$IFn$_invoke$arity$1 ? Math.ceil.cljs$core$IFn$_invoke$arity$1(a) : Math.ceil.call(null, a); + return 0 <= a ? Math.floor.call(null, a) : Math.ceil.call(null, a) }; cljs.core.int$ = function(a) { - return a | 0; + return a | 0 }; cljs.core.unchecked_int = function(a) { - return cljs.core.fix(a); + return cljs.core.fix.call(null, a) }; cljs.core.long$ = function(a) { - return cljs.core.fix(a); + return cljs.core.fix.call(null, a) }; cljs.core.unchecked_long = function(a) { - return cljs.core.fix(a); + return cljs.core.fix.call(null, a) }; cljs.core.booleans = function(a) { - return a; + return a }; cljs.core.bytes = function(a) { - return a; + return a }; cljs.core.chars = function(a) { - return a; + return a }; cljs.core.shorts = function(a) { - return a; + return a }; cljs.core.ints = function(a) { - return a; + return a }; cljs.core.floats = function(a) { - return a; + return a }; cljs.core.doubles = function(a) { - return a; + return a }; cljs.core.longs = function(a) { - return a; + return a }; cljs.core.js_mod = function(a, b) { - return a % b; + return a % b }; cljs.core.mod = function(a, b) { - return(a % b + b) % b; + return(a % b + b) % b }; cljs.core.quot = function(a, b) { - return cljs.core.fix((a - a % b) / b); + return cljs.core.fix.call(null, (a - a % b) / b) }; cljs.core.rem = function(a, b) { - var c = cljs.core.quot(a, b); - return a - b * c; + var c = cljs.core.quot.call(null, a, b); + return a - b * c }; -cljs.core.bit_xor = function() { - var a = null, b = function() { - var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b ^ c, d); - }, d = function(a, d, g) { - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); - }; - d.cljs$lang$maxFixedArity = 2; - d.cljs$lang$applyTo = function(a) { - var d = cljs.core.first(a); - a = cljs.core.next(a); - var g = cljs.core.first(a); - a = cljs.core.rest(a); - return b(d, g, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; - }(), a = function(a, d, e) { - switch(arguments.length) { - case 2: - return a ^ d; - default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = b.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a ^ b; - }; - a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.bit_and = function() { - var a = null, b = function() { - var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b & c, d); - }, d = function(a, d, g) { - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); - }; - d.cljs$lang$maxFixedArity = 2; - d.cljs$lang$applyTo = function(a) { - var d = cljs.core.first(a); - a = cljs.core.next(a); - var g = cljs.core.first(a); - a = cljs.core.rest(a); - return b(d, g, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; - }(), a = function(a, d, e) { - switch(arguments.length) { - case 2: - return a & d; - default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = b.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a & b; - }; - a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.bit_or = function() { - var a = null, b = function() { - var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b | c, d); - }, d = function(a, d, g) { - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); - }; - d.cljs$lang$maxFixedArity = 2; - d.cljs$lang$applyTo = function(a) { - var d = cljs.core.first(a); - a = cljs.core.next(a); - var g = cljs.core.first(a); - a = cljs.core.rest(a); - return b(d, g, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; - }(), a = function(a, d, e) { - switch(arguments.length) { - case 2: - return a | d; - default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = b.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a | b; - }; - a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.bit_and_not = function() { +cljs.core.rand = function() { var a = null, b = function() { - var b = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, b & ~c, d); - }, d = function(a, d, g) { - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, d, h); - }; - d.cljs$lang$maxFixedArity = 2; - d.cljs$lang$applyTo = function(a) { - var d = cljs.core.first(a); - a = cljs.core.next(a); - var g = cljs.core.first(a); - a = cljs.core.rest(a); - return b(d, g, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = b; - return d; - }(), a = function(a, d, e) { + return Math.random.call(null) + }, c = function(b) { + return b * a.call(null) + }, a = function(a) { switch(arguments.length) { - case 2: - return a & ~d; - default: - var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, f); + case 0: + return b.call(this); + case 1: + return c.call(this, a) } throw Error("Invalid arity: " + arguments.length); }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = b.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a & ~b; - }; - a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a; + a.cljs$core$IFn$_invoke$arity$0 = b; + a.cljs$core$IFn$_invoke$arity$1 = c; + return a }(); +cljs.core.rand_int = function(a) { + return cljs.core.fix.call(null, cljs.core.rand.call(null, a)) +}; +cljs.core.bit_xor = function(a, b) { + return a ^ b +}; +cljs.core.bit_and = function(a, b) { + return a & b +}; +cljs.core.bit_or = function(a, b) { + return a | b +}; +cljs.core.bit_and_not = function(a, b) { + return a & ~b +}; cljs.core.bit_clear = function(a, b) { - return a & ~(1 << b); + return a & ~(1 << b) }; cljs.core.bit_flip = function(a, b) { - return a ^ 1 << b; + return a ^ 1 << b }; cljs.core.bit_not = function(a) { - return~a; + return~a }; cljs.core.bit_set = function(a, b) { - return a | 1 << b; + return a | 1 << b }; cljs.core.bit_test = function(a, b) { - return 0 != (a & 1 << b); + return 0 != (a & 1 << b) }; cljs.core.bit_shift_left = function(a, b) { - return a << b; + return a << b }; cljs.core.bit_shift_right = function(a, b) { - return a >> b; + return a >> b }; cljs.core.bit_shift_right_zero_fill = function(a, b) { - return a >>> b; + return a >>> b }; cljs.core.unsigned_bit_shift_right = function(a, b) { - return a >>> b; + return a >>> b }; cljs.core.bit_count = function(a) { a -= a >> 1 & 1431655765; a = (a & 858993459) + (a >> 2 & 858993459); - return 16843009 * (a + (a >> 4) & 252645135) >> 24; + return 16843009 * (a + (a >> 4) & 252645135) >> 24 }; cljs.core._EQ__EQ_ = function() { var a = null, b = function(a, b) { - return cljs.core._equiv(a, b); + return cljs.core._equiv.call(null, a, b) }, c = function() { var b = function(b, c, d) { - for (;;) { - if (a.cljs$core$IFn$_invoke$arity$2(b, c)) { - if (cljs.core.next(d)) { - b = c, c = cljs.core.first(d), d = cljs.core.next(d); - } else { - return a.cljs$core$IFn$_invoke$arity$2(c, cljs.core.first(d)); + for(;;) { + if(a.call(null, b, c)) { + if(cljs.core.next.call(null, d)) { + b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) + }else { + return a.call(null, c, cljs.core.first.call(null, d)) } - } else { - return!1; + }else { + return!1 } } }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -6741,10 +4968,10 @@ cljs.core._EQ__EQ_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -6752,100 +4979,81 @@ cljs.core._EQ__EQ_ = function() { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0; + return!0 }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.pos_QMARK_ = function(a) { - return 0 < a; + return 0 < a }; cljs.core.zero_QMARK_ = function(a) { - return 0 === a; + return 0 === a }; cljs.core.neg_QMARK_ = function(a) { - return 0 > a; + return 0 > a }; cljs.core.nthnext = function(a, b) { - for (var c = b, d = cljs.core.seq(a);;) { - if (d && 0 < c) { - c -= 1, d = cljs.core.next(d); - } else { - return d; + for(var c = b, d = cljs.core.seq.call(null, a);;) { + if(d && 0 < c) { + c -= 1, d = cljs.core.next.call(null, d) + }else { + return d } } }; cljs.core.str = function() { var a = null, b = function(a) { - return null == a ? "" : goog.string.buildString(a); + return null == a ? "" : a.toString() }, c = function() { var b = function(b, c) { - for (var d = new goog.string.StringBuffer(a.cljs$core$IFn$_invoke$arity$1(b)), e = c;;) { - if (cljs.core.truth_(e)) { - d = d.append(a.cljs$core$IFn$_invoke$arity$1(cljs.core.first(e))), e = cljs.core.next(e); - } else { - return d.toString(); + for(var d = new goog.string.StringBuffer(a.call(null, b)), e = c;;) { + if(cljs.core.truth_(e)) { + d = d.append(a.call(null, cljs.core.first.call(null, e))), e = cljs.core.next.call(null, e) + }else { + return d.toString() } } }, c = function(a, c) { var e = null; - if (1 < arguments.length) { - for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { - k[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return b.call(this, a, e) }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, a); + return b(c, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e) { switch(arguments.length) { case 0: - return ""; + return""; case 1: return b.call(this, a); default: - var f = null; - if (1 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { - g[f] = arguments[f + 1], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, f); + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 1; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return ""; + return"" }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.subs = function() { var a = null, a = function(a, c, d) { @@ -6853,111 +5061,89 @@ cljs.core.subs = function() { case 2: return a.substring(c); case 3: - return a.substring(c, d); + return a.substring(c, d) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return a.substring(c); + return a.substring(c) }; a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return a.substring(c, d); + return a.substring(c, d) }; - return a; + return a }(); cljs.core.equiv_sequential = function(a, b) { - return cljs.core.boolean$(cljs.core.sequential_QMARK_(b) ? cljs.core.counted_QMARK_(a) && cljs.core.counted_QMARK_(b) && cljs.core.count(a) !== cljs.core.count(b) ? !1 : function() { - for (var c = cljs.core.seq(a), d = cljs.core.seq(b);;) { - if (null == c) { - return null == d; + return cljs.core.boolean$.call(null, cljs.core.sequential_QMARK_.call(null, b) ? function() { + for(var c = cljs.core.seq.call(null, a), d = cljs.core.seq.call(null, b);;) { + if(null == c) { + return null == d } - if (null != d && cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.first(c), cljs.core.first(d))) { - c = cljs.core.next(c), d = cljs.core.next(d); - } else { - return!1; + if(null == d) { + return!1 + } + if(cljs.core._EQ_.call(null, cljs.core.first.call(null, c), cljs.core.first.call(null, d))) { + c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d) + }else { + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null } } - }() : null); + }() : null) +}; +cljs.core.hash_combine = function(a, b) { + return a ^ b + 2654435769 + (a << 6) + (a >> 2) }; cljs.core.hash_coll = function(a) { - if (cljs.core.seq(a)) { - var b = cljs.core.hash(cljs.core.first(a)); - for (a = cljs.core.next(a);;) { - if (null == a) { - return b; + if(cljs.core.seq.call(null, a)) { + var b = cljs.core.hash.call(null, cljs.core.first.call(null, a)); + for(a = cljs.core.next.call(null, a);;) { + if(null == a) { + return b } - b = cljs.core.hash_combine(b, cljs.core.hash(cljs.core.first(a))); - a = cljs.core.next(a); + b = cljs.core.hash_combine.call(null, b, cljs.core.hash.call(null, cljs.core.first.call(null, a))); + a = cljs.core.next.call(null, a) } - } else { - return 0; + }else { + return 0 } }; cljs.core.hash_imap = function(a) { var b = 0; - for (a = cljs.core.seq(a);;) { - if (a) { - var c = cljs.core.first(a), b = (b + (cljs.core.hash(function() { - var a = c; - return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a); - }()) ^ cljs.core.hash(function() { - var a = c; - return cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a); - }()))) % 4503599627370496; - a = cljs.core.next(a); - } else { - return b; + for(a = cljs.core.seq.call(null, a);;) { + if(a) { + var c = cljs.core.first.call(null, a), b = (b + (cljs.core.hash.call(null, cljs.core.key.call(null, c)) ^ cljs.core.hash.call(null, cljs.core.val.call(null, c)))) % 4503599627370496; + a = cljs.core.next.call(null, a) + }else { + return b } } }; cljs.core.hash_iset = function(a) { var b = 0; - for (a = cljs.core.seq(a);;) { - if (a) { - var c = cljs.core.first(a), b = (b + cljs.core.hash(c)) % 4503599627370496; - a = cljs.core.next(a); - } else { - return b; + for(a = cljs.core.seq.call(null, a);;) { + if(a) { + var c = cljs.core.first.call(null, a), b = (b + cljs.core.hash.call(null, c)) % 4503599627370496; + a = cljs.core.next.call(null, a) + }else { + return b } } }; cljs.core.extend_object_BANG_ = function(a, b) { - for (var c = cljs.core.seq(b), d = null, e = 0, f = 0;;) { - if (f < e) { - var g = d.cljs$core$IIndexed$_nth$arity$2(null, f), h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 0, null), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 1, null), k = function() { - var a = h; - return cljs.core.name.cljs$core$IFn$_invoke$arity$1 ? cljs.core.name.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.name.call(null, a); - }(); - a[k] = g; - f += 1; - } else { - if (c = cljs.core.seq(c)) { - var l = c; - if (cljs.core.chunked_seq_QMARK_(l)) { - e = function() { - var a = l; - return cljs.core.chunk_first.cljs$core$IFn$_invoke$arity$1 ? cljs.core.chunk_first.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.chunk_first.call(null, a); - }(), c = function() { - var a = l; - return cljs.core.chunk_rest.cljs$core$IFn$_invoke$arity$1 ? cljs.core.chunk_rest.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.chunk_rest.call(null, a); - }(), d = e, e = cljs.core.count(e); - } else { - var c = cljs.core.first(l), m = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), d = function() { - var a = m; - return cljs.core.name.cljs$core$IFn$_invoke$arity$1 ? cljs.core.name.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.name.call(null, a); - }(); - a[d] = c; - c = cljs.core.next(l); - d = null; - e = 0; - } - f = 0; - } else { - break; + for(var c = cljs.core.seq.call(null, b), d = null, e = 0, f = 0;;) { + if(f < e) { + var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null), h = cljs.core.name.call(null, h); + a[h] = g; + f += 1 + }else { + if(c = cljs.core.seq.call(null, c)) { + cljs.core.chunked_seq_QMARK_.call(null, c) ? (e = cljs.core.chunk_first.call(null, c), c = cljs.core.chunk_rest.call(null, c), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, c), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), d = cljs.core.name.call(null, d), a[d] = e, c = cljs.core.next.call(null, c), d = null, e = 0), f = 0 + }else { + break } } } - return a; + return a }; cljs.core.List = function(a, b, c, d, e) { this.meta = a; @@ -6965,293 +5151,239 @@ cljs.core.List = function(a, b, c, d, e) { this.rest = c; this.count = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition0$ = 65937646; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.List.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.List.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 65937646 }; -cljs.core.List.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.List.cljs$lang$type = !0; +cljs.core.List.cljs$lang$ctorStr = "cljs.core/List"; +cljs.core.List.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/List") }; -cljs.core.List.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.List(this.meta, this.first, this.rest, this.count, this.__hash); +cljs.core.List.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; cljs.core.List.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 1 === this.count ? null : this.rest; + return 1 === this.count ? null : this.rest }; -cljs.core.List.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.count; +cljs.core.List.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.List(this.meta, b, this, this.count + 1, null) }; -cljs.core.List.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.first; +cljs.core.List.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.List.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return cljs.core._rest(this); +cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.seq_reduce.call(null, b, this) }; -cljs.core.List.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.seq_reduce.call(null, b, c, this) }; -cljs.core.List.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.List.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; -cljs.core.List.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.List.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.count }; -cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); +cljs.core.List.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { + return this.first }; -cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); +cljs.core.List.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { + return cljs.core._rest.call(null, this) }; cljs.core.List.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.first; + return this.first }; cljs.core.List.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 1 === this.count ? cljs.core.List.EMPTY : this.rest; + return 1 === this.count ? cljs.core.List.EMPTY : this.rest }; -cljs.core.List.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.List.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.List.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.List(b, this.first, this.rest, this.count, this.__hash); + return new cljs.core.List(b, this.first, this.rest, this.count, this.__hash) }; -cljs.core.List.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.List(this.meta, b, this, this.count + 1, null); +cljs.core.List.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.List.cljs$lang$type = !0; -cljs.core.List.cljs$lang$ctorStr = "cljs.core/List"; -cljs.core.List.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/List"); +cljs.core.List.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.List.EMPTY }; cljs.core.__GT_List = function(a, b, c, d, e) { - return new cljs.core.List(a, b, c, d, e); -}; -cljs.core.List.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.List(a, b, c, d, e) }; cljs.core.EmptyList = function(a) { this.meta = a; - this.cljs$lang$protocol_mask$partition0$ = 65937614; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.EmptyList.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.EmptyList.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 65937614 }; -cljs.core.EmptyList.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.EmptyList.cljs$lang$type = !0; +cljs.core.EmptyList.cljs$lang$ctorStr = "cljs.core/EmptyList"; +cljs.core.EmptyList.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/EmptyList") }; -cljs.core.EmptyList.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.EmptyList(this.meta); +cljs.core.EmptyList.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return 0 }; cljs.core.EmptyList.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return null; + return null }; -cljs.core.EmptyList.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 0; +cljs.core.EmptyList.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.List(this.meta, b, null, 1, null) }; -cljs.core.EmptyList.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return null; +cljs.core.EmptyList.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.EmptyList.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - throw Error("Can't pop empty list"); +cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.seq_reduce.call(null, b, this) }; -cljs.core.EmptyList.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.empty_ordered_hash; +cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.seq_reduce.call(null, b, c, this) }; -cljs.core.EmptyList.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.EmptyList.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return null }; -cljs.core.EmptyList.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return this; +cljs.core.EmptyList.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return 0 }; -cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); +cljs.core.EmptyList.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { + return null }; -cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); +cljs.core.EmptyList.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { + throw Error("Can't pop empty list"); }; cljs.core.EmptyList.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null; + return null }; cljs.core.EmptyList.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.List.EMPTY; + return cljs.core.List.EMPTY }; -cljs.core.EmptyList.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return null; +cljs.core.EmptyList.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.EmptyList.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.EmptyList(b); + return new cljs.core.EmptyList(b) }; -cljs.core.EmptyList.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.List(this.meta, b, null, 1, null); +cljs.core.EmptyList.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.EmptyList.cljs$lang$type = !0; -cljs.core.EmptyList.cljs$lang$ctorStr = "cljs.core/EmptyList"; -cljs.core.EmptyList.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/EmptyList"); +cljs.core.EmptyList.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return this }; cljs.core.__GT_EmptyList = function(a) { - return new cljs.core.EmptyList(a); + return new cljs.core.EmptyList(a) }; cljs.core.List.EMPTY = new cljs.core.EmptyList(null); -cljs.core.EmptyList.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; cljs.core.reversible_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 134217728 || a.cljs$core$IReversible$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IReversible, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IReversible, a); + return a ? a.cljs$lang$protocol_mask$partition0$ & 134217728 || a.cljs$core$IReversible$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) }; cljs.core.rseq = function(a) { - return cljs.core._rseq(a); + return cljs.core._rseq.call(null, a) }; cljs.core.reverse = function(a) { - return cljs.core.reversible_QMARK_(a) ? cljs.core.rseq(a) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj, cljs.core.List.EMPTY, a); + return cljs.core.reversible_QMARK_.call(null, a) ? cljs.core.rseq.call(null, a) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a) }; cljs.core.list = function() { var a = function(a) { var b; - if (a instanceof cljs.core.IndexedSeq && 0 === a.i) { - b = a.arr; - } else { + if(a instanceof cljs.core.IndexedSeq) { + b = a.arr + }else { a: { - for (b = [];;) { - if (null != a) { - b.push(a.cljs$core$ISeq$_first$arity$1(null)), a = a.cljs$core$INext$_next$arity$1(null); - } else { - break a; + for(b = [];;) { + if(null != a) { + b.push(cljs.core._first.call(null, a)), a = cljs.core._next.call(null, a) + }else { + break a } } - b = void 0; + b = void 0 } } a = b.length; - for (var e = cljs.core.List.EMPTY;;) { - if (0 < a) { - var f = a - 1, e = e.cljs$core$ICollection$_conj$arity$2(null, b[a - 1]); - a = f; - } else { - return e; + for(var e = cljs.core.List.EMPTY;;) { + if(0 < a) { + var f = a - 1, e = cljs.core._conj.call(null, e, b[a - 1]); + a = f + }else { + return e } } }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.Cons = function(a, b, c, d) { this.meta = a; this.first = b; this.rest = c; this.__hash = d; - this.cljs$lang$protocol_mask$partition0$ = 65929452; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.Cons.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.Cons.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.Cons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.Cons.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.Cons(this.meta, this.first, this.rest, this.__hash); + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 65929452 }; -cljs.core.Cons.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return null == this.rest ? null : cljs.core.seq(this.rest); +cljs.core.Cons.cljs$lang$type = !0; +cljs.core.Cons.cljs$lang$ctorStr = "cljs.core/Cons"; +cljs.core.Cons.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/Cons") }; cljs.core.Cons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.Cons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.Cons.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return null == this.rest ? null : cljs.core.seq.call(null, this.rest) }; -cljs.core.Cons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.Cons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.Cons(null, b, this, this.__hash) +}; +cljs.core.Cons.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.Cons.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.Cons.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.Cons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.Cons.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.first; + return this.first }; cljs.core.Cons.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null == this.rest ? cljs.core.List.EMPTY : this.rest; + return null == this.rest ? cljs.core.List.EMPTY : this.rest }; -cljs.core.Cons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.Cons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.Cons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Cons(b, this.first, this.rest, this.__hash); + return new cljs.core.Cons(b, this.first, this.rest, this.__hash) }; -cljs.core.Cons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.Cons(null, b, this, this.__hash); +cljs.core.Cons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.Cons.cljs$lang$type = !0; -cljs.core.Cons.cljs$lang$ctorStr = "cljs.core/Cons"; -cljs.core.Cons.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Cons"); +cljs.core.Cons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_Cons = function(a, b, c, d) { - return new cljs.core.Cons(a, b, c, d); -}; -cljs.core.Cons.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.Cons(a, b, c, d) }; cljs.core.cons = function(a, b) { var c; c = (c = null == b) ? c : b ? b.cljs$lang$protocol_mask$partition0$ & 64 || b.cljs$core$ISeq$ ? !0 : !1 : !1; - return c ? new cljs.core.Cons(null, a, b, null) : new cljs.core.Cons(null, a, cljs.core.seq(b), null); + return c ? new cljs.core.Cons(null, a, b, null) : new cljs.core.Cons(null, a, cljs.core.seq.call(null, b), null) }; cljs.core.list_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 33554432 || a.cljs$core$IList$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IList, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IList, a); -}; -cljs.core.hash_keyword = function(a) { - return cljs.core.hash_symbol(a) + 2654435769 | 0; -}; -cljs.core.compare_keywords = function(a, b) { - if (a.fqn === b.fqn) { - return 0; - } - if (cljs.core.truth_(function() { - var c = cljs.core.not(a.ns); - return c ? b.ns : c; - }())) { - return-1; - } - if (cljs.core.truth_(a.ns)) { - if (cljs.core.not(b.ns)) { - return 1; - } - var c = goog.array.defaultCompare(a.ns, b.ns); - return 0 === c ? goog.array.defaultCompare(a.name, b.name) : c; - } - return goog.array.defaultCompare(a.name, b.name); + return a ? a.cljs$lang$protocol_mask$partition0$ & 33554432 || a.cljs$core$IList$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) }; cljs.core.Keyword = function(a, b, c, d) { this.ns = a; @@ -7259,102 +5391,95 @@ cljs.core.Keyword = function(a, b, c, d) { this.fqn = c; this._hash = d; this.cljs$lang$protocol_mask$partition0$ = 2153775105; - this.cljs$lang$protocol_mask$partition1$ = 4096; + this.cljs$lang$protocol_mask$partition1$ = 4096 +}; +cljs.core.Keyword.cljs$lang$type = !0; +cljs.core.Keyword.cljs$lang$ctorStr = "cljs.core/Keyword"; +cljs.core.Keyword.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/Keyword") }; cljs.core.Keyword.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write(b, [cljs.core.str(":"), cljs.core.str(this.fqn)].join("")); + return cljs.core._write.call(null, b, [cljs.core.str(":"), cljs.core.str(this.fqn)].join("")) }; cljs.core.Keyword.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return this.name; + return this.name }; cljs.core.Keyword.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return this.ns; + return this.ns }; cljs.core.Keyword.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this._hash; - return null != a ? a : this._hash = a = cljs.core.hash_keyword(this); + null == this._hash && (this._hash = cljs.core.hash_combine.call(null, cljs.core.hash.call(null, this.ns), cljs.core.hash.call(null, this.name)) + 2654435769); + return this._hash }; cljs.core.Keyword.prototype.call = function() { - var a = null, b = function(a, b) { - return cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, this); - }, c = function(a, b, c) { - return cljs.core.get.cljs$core$IFn$_invoke$arity$3(b, this, c); - }, a = function(a, e, f) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: - return b.call(this, a, e); + return cljs.core.get.call(null, c, this); case 3: - return c.call(this, a, e, f); + return cljs.core.get.call(null, c, this, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + } }(); cljs.core.Keyword.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.Keyword.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, this); + return cljs.core.get.call(null, a, this) }; cljs.core.Keyword.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, this, b); + return cljs.core.get.call(null, a, this, b) }; cljs.core.Keyword.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.Keyword ? this.fqn === b.fqn : !1; + return b instanceof cljs.core.Keyword ? this.fqn === b.fqn : !1 }; cljs.core.Keyword.prototype.toString = function() { - return[cljs.core.str(":"), cljs.core.str(this.fqn)].join(""); -}; -cljs.core.Keyword.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.Keyword.cljs$lang$type = !0; -cljs.core.Keyword.cljs$lang$ctorStr = "cljs.core/Keyword"; -cljs.core.Keyword.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Keyword"); + return[cljs.core.str(":"), cljs.core.str(this.fqn)].join("") }; cljs.core.__GT_Keyword = function(a, b, c, d) { - return new cljs.core.Keyword(a, b, c, d); + return new cljs.core.Keyword(a, b, c, d) }; cljs.core.keyword_QMARK_ = function(a) { - return a instanceof cljs.core.Keyword; + return a instanceof cljs.core.Keyword }; cljs.core.keyword_identical_QMARK_ = function(a, b) { - return a === b ? !0 : a instanceof cljs.core.Keyword && b instanceof cljs.core.Keyword ? a.fqn === b.fqn : !1; + return a === b ? !0 : a instanceof cljs.core.Keyword && b instanceof cljs.core.Keyword ? a.fqn === b.fqn : !1 }; cljs.core.namespace = function(a) { - if (a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { - return a.cljs$core$INamed$_namespace$arity$1(null); + if(a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { + return cljs.core._namespace.call(null, a) } throw Error([cljs.core.str("Doesn't support namespace: "), cljs.core.str(a)].join("")); }; cljs.core.keyword = function() { var a = null, b = function(a) { - if (a instanceof cljs.core.Keyword) { - return a; + if(a instanceof cljs.core.Keyword) { + return a + } + if(a instanceof cljs.core.Symbol) { + return new cljs.core.Keyword(cljs.core.namespace.call(null, a), cljs.core.name.call(null, a), a.str, null) } - if (a instanceof cljs.core.Symbol) { - var b = cljs.core.Keyword, c = cljs.core.namespace(a), g; - g = cljs.core.name.cljs$core$IFn$_invoke$arity$1 ? cljs.core.name.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.name.call(null, a); - return new b(c, g, a.str, null); + if("string" === typeof a) { + var b = a.split("/"); + return 2 === b.length ? new cljs.core.Keyword(b[0], b[1], a, null) : new cljs.core.Keyword(null, b[0], a, null) } - return "string" === typeof a ? (b = a.split("/"), 2 === b.length ? new cljs.core.Keyword(b[0], b[1], a, null) : new cljs.core.Keyword(null, b[0], a, null)) : null; + return null }, c = function(a, b) { - return new cljs.core.Keyword(a, b, [cljs.core.str(cljs.core.truth_(a) ? [cljs.core.str(a), cljs.core.str("/")].join("") : null), cljs.core.str(b)].join(""), null); + return new cljs.core.Keyword(a, b, [cljs.core.str(cljs.core.truth_(a) ? [cljs.core.str(a), cljs.core.str("/")].join("") : null), cljs.core.str(b)].join(""), null) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.LazySeq = function(a, b, c, d) { this.meta = a; @@ -7362,152 +5487,146 @@ cljs.core.LazySeq = function(a, b, c, d) { this.s = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988; -}; -cljs.core.LazySeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); + this.cljs$lang$protocol_mask$partition0$ = 32374988 }; -cljs.core.LazySeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.LazySeq.prototype.sval = function() { - null != this.fn && (this.s = this.fn.cljs$core$IFn$_invoke$arity$0 ? this.fn.cljs$core$IFn$_invoke$arity$0() : this.fn.call(null), this.fn = null); - return this.s; +cljs.core.LazySeq.cljs$lang$type = !0; +cljs.core.LazySeq.cljs$lang$ctorStr = "cljs.core/LazySeq"; +cljs.core.LazySeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/LazySeq") }; -cljs.core.LazySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.LazySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; cljs.core.LazySeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - cljs.core._seq(this); - return null == this.s ? null : cljs.core.next(this.s); + cljs.core._seq.call(null, this); + return null == this.s ? null : cljs.core.next.call(null, this.s) }; -cljs.core.LazySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +cljs.core.LazySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.LazySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.LazySeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.LazySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.LazySeq.prototype.sval = function() { + null != this.fn && (this.s = this.fn.call(null), this.fn = null); + return this.s }; cljs.core.LazySeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.LazySeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); -}; -cljs.core.LazySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - cljs.core._seq(this); - return null == this.s ? null : cljs.core.first(this.s); -}; -cljs.core.LazySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - cljs.core._seq(this); - return null != this.s ? cljs.core.rest(this.s) : cljs.core.List.EMPTY; + return cljs.core.seq_reduce.call(null, b, c, this) }; cljs.core.LazySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { this.sval(); - if (null == this.s) { - return null; + if(null == this.s) { + return null } - for (a = this.s;;) { - if (a instanceof cljs.core.LazySeq) { - a = a.sval(); - } else { - return this.s = a, cljs.core.seq(this.s); + for(a = this.s;;) { + if(a instanceof cljs.core.LazySeq) { + a = a.sval() + }else { + return this.s = a, cljs.core.seq.call(null, this.s) } } }; +cljs.core.LazySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + cljs.core._seq.call(null, this); + return null == this.s ? null : cljs.core.first.call(null, this.s) +}; +cljs.core.LazySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + cljs.core._seq.call(null, this); + return null != this.s ? cljs.core.rest.call(null, this.s) : cljs.core.List.EMPTY +}; +cljs.core.LazySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) +}; cljs.core.LazySeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.LazySeq(b, this.fn, this.s, this.__hash); + return new cljs.core.LazySeq(b, this.fn, this.s, this.__hash) }; -cljs.core.LazySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.LazySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.LazySeq.cljs$lang$type = !0; -cljs.core.LazySeq.cljs$lang$ctorStr = "cljs.core/LazySeq"; -cljs.core.LazySeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/LazySeq"); +cljs.core.LazySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_LazySeq = function(a, b, c, d) { - return new cljs.core.LazySeq(a, b, c, d); -}; -cljs.core.LazySeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.LazySeq(a, b, c, d) }; cljs.core.ChunkBuffer = function(a, b) { this.buf = a; this.end = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2; + this.cljs$lang$protocol_mask$partition0$ = 2 +}; +cljs.core.ChunkBuffer.cljs$lang$type = !0; +cljs.core.ChunkBuffer.cljs$lang$ctorStr = "cljs.core/ChunkBuffer"; +cljs.core.ChunkBuffer.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ChunkBuffer") }; cljs.core.ChunkBuffer.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end; + return this.end }; cljs.core.ChunkBuffer.prototype.add = function(a) { this.buf[this.end] = a; - return this.end += 1; + return this.end += 1 }; cljs.core.ChunkBuffer.prototype.chunk = function(a) { a = new cljs.core.ArrayChunk(this.buf, 0, this.end); this.buf = null; - return a; -}; -cljs.core.ChunkBuffer.cljs$lang$type = !0; -cljs.core.ChunkBuffer.cljs$lang$ctorStr = "cljs.core/ChunkBuffer"; -cljs.core.ChunkBuffer.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ChunkBuffer"); + return a }; cljs.core.__GT_ChunkBuffer = function(a, b) { - return new cljs.core.ChunkBuffer(a, b); + return new cljs.core.ChunkBuffer(a, b) }; cljs.core.chunk_buffer = function(a) { - return new cljs.core.ChunkBuffer(Array(a), 0); + return new cljs.core.ChunkBuffer(Array(a), 0) }; cljs.core.ArrayChunk = function(a, b, c) { this.arr = a; this.off = b; this.end = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 524306; + this.cljs$lang$protocol_mask$partition0$ = 524306 +}; +cljs.core.ArrayChunk.cljs$lang$type = !0; +cljs.core.ArrayChunk.cljs$lang$ctorStr = "cljs.core/ArrayChunk"; +cljs.core.ArrayChunk.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ArrayChunk") }; cljs.core.ArrayChunk.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, this.arr[this.off], this.off + 1); + return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.off], this.off + 1) }; cljs.core.ArrayChunk.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.array_reduce.cljs$core$IFn$_invoke$arity$4(this.arr, b, c, this.off); + return cljs.core.array_reduce.call(null, this.arr, b, c, this.off) }; cljs.core.ArrayChunk.prototype.cljs$core$IChunk$ = !0; cljs.core.ArrayChunk.prototype.cljs$core$IChunk$_drop_first$arity$1 = function(a) { - if (this.off === this.end) { + if(this.off === this.end) { throw Error("-drop-first of empty chunk"); } - return new cljs.core.ArrayChunk(this.arr, this.off + 1, this.end); + return new cljs.core.ArrayChunk(this.arr, this.off + 1, this.end) }; cljs.core.ArrayChunk.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return this.arr[this.off + b]; + return this.arr[this.off + b] }; cljs.core.ArrayChunk.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.end - this.off ? this.arr[this.off + b] : c; + return 0 <= b && b < this.end - this.off ? this.arr[this.off + b] : c }; cljs.core.ArrayChunk.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end - this.off; -}; -cljs.core.ArrayChunk.cljs$lang$type = !0; -cljs.core.ArrayChunk.cljs$lang$ctorStr = "cljs.core/ArrayChunk"; -cljs.core.ArrayChunk.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ArrayChunk"); + return this.end - this.off }; cljs.core.__GT_ArrayChunk = function(a, b, c) { - return new cljs.core.ArrayChunk(a, b, c); + return new cljs.core.ArrayChunk(a, b, c) }; cljs.core.array_chunk = function() { var a = null, b = function(a) { - return new cljs.core.ArrayChunk(a, 0, a.length); + return new cljs.core.ArrayChunk(a, 0, a.length) }, c = function(a, b) { - return new cljs.core.ArrayChunk(a, b, a.length); + return new cljs.core.ArrayChunk(a, b, a.length) }, d = function(a, b, c) { - return new cljs.core.ArrayChunk(a, b, c); + return new cljs.core.ArrayChunk(a, b, c) }, a = function(a, f, g) { switch(arguments.length) { case 1: @@ -7515,14 +5634,14 @@ cljs.core.array_chunk = function() { case 2: return c.call(this, a, f); case 3: - return d.call(this, a, f, g); + return d.call(this, a, f, g) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; - return a; + return a }(); cljs.core.ChunkedCons = function(a, b, c, d) { this.chunk = a; @@ -7530,297 +5649,286 @@ cljs.core.ChunkedCons = function(a, b, c, d) { this.meta = c; this.__hash = d; this.cljs$lang$protocol_mask$partition0$ = 31850732; - this.cljs$lang$protocol_mask$partition1$ = 1536; + this.cljs$lang$protocol_mask$partition1$ = 1536 }; -cljs.core.ChunkedCons.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.ChunkedCons.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.ChunkedCons.cljs$lang$type = !0; +cljs.core.ChunkedCons.cljs$lang$ctorStr = "cljs.core/ChunkedCons"; +cljs.core.ChunkedCons.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ChunkedCons") }; -cljs.core.ChunkedCons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.ChunkedCons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; cljs.core.ChunkedCons.prototype.cljs$core$INext$_next$arity$1 = function(a) { - if (1 < cljs.core._count(this.chunk)) { - return new cljs.core.ChunkedCons(cljs.core._drop_first(this.chunk), this.more, this.meta, null); + if(1 < cljs.core._count.call(null, this.chunk)) { + return new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) } - a = cljs.core._seq(this.more); - return null == a ? null : a; + a = cljs.core._seq.call(null, this.more); + return null == a ? null : a }; -cljs.core.ChunkedCons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +cljs.core.ChunkedCons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.ChunkedCons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.ChunkedCons.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.ChunkedCons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.ChunkedCons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.ChunkedCons.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.chunk, 0); + return cljs.core._nth.call(null, this.chunk, 0) }; cljs.core.ChunkedCons.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 1 < cljs.core._count(this.chunk) ? new cljs.core.ChunkedCons(cljs.core._drop_first(this.chunk), this.more, this.meta, null) : null == this.more ? cljs.core.List.EMPTY : this.more; -}; -cljs.core.ChunkedCons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; + return 1 < cljs.core._count.call(null, this.chunk) ? new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) : null == this.more ? cljs.core.List.EMPTY : this.more }; -cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { - return this.chunk; +cljs.core.ChunkedCons.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { + return null == this.more ? null : this.more }; -cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { - return null == this.more ? cljs.core.List.EMPTY : this.more; +cljs.core.ChunkedCons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.ChunkedCons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ChunkedCons(this.chunk, this.more, b, this.__hash); + return new cljs.core.ChunkedCons(this.chunk, this.more, b, this.__hash) }; -cljs.core.ChunkedCons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.ChunkedCons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.ChunkedCons.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { - return null == this.more ? null : this.more; +cljs.core.ChunkedCons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; -cljs.core.ChunkedCons.cljs$lang$type = !0; -cljs.core.ChunkedCons.cljs$lang$ctorStr = "cljs.core/ChunkedCons"; -cljs.core.ChunkedCons.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ChunkedCons"); +cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { + return this.chunk }; -cljs.core.__GT_ChunkedCons = function(a, b, c, d) { - return new cljs.core.ChunkedCons(a, b, c, d); +cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { + return null == this.more ? cljs.core.List.EMPTY : this.more }; -cljs.core.ChunkedCons.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.__GT_ChunkedCons = function(a, b, c, d) { + return new cljs.core.ChunkedCons(a, b, c, d) }; cljs.core.chunk_cons = function(a, b) { - return 0 === cljs.core._count(a) ? b : new cljs.core.ChunkedCons(a, b, null, null); + return 0 === cljs.core._count.call(null, a) ? b : new cljs.core.ChunkedCons(a, b, null, null) }; cljs.core.chunk_append = function(a, b) { - return a.add(b); + return a.add(b) }; cljs.core.chunk = function(a) { - return a.chunk(); + return a.chunk() }; cljs.core.chunk_first = function(a) { - return cljs.core._chunked_first(a); + return cljs.core._chunked_first.call(null, a) }; cljs.core.chunk_rest = function(a) { - return cljs.core._chunked_rest(a); + return cljs.core._chunked_rest.call(null, a) }; cljs.core.chunk_next = function(a) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 1024 || a.cljs$core$IChunkedNext$) ? cljs.core._chunked_next(a) : cljs.core.seq(cljs.core._chunked_rest(a)); + return a && (a.cljs$lang$protocol_mask$partition1$ & 1024 || a.cljs$core$IChunkedNext$) ? cljs.core._chunked_next.call(null, a) : cljs.core.seq.call(null, cljs.core._chunked_rest.call(null, a)) }; cljs.core.to_array = function(a) { - for (var b = [];;) { - if (cljs.core.seq(a)) { - b.push(cljs.core.first(a)), a = cljs.core.next(a); - } else { - return b; + for(var b = [];;) { + if(cljs.core.seq.call(null, a)) { + b.push(cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a) + }else { + return b } } }; cljs.core.to_array_2d = function(a) { - var b = Array(cljs.core.count(a)), c = 0; - for (a = cljs.core.seq(a);;) { - if (a) { - b[c] = cljs.core.to_array(cljs.core.first(a)), c += 1, a = cljs.core.next(a); - } else { - break; + var b = Array(cljs.core.count.call(null, a)), c = 0; + for(a = cljs.core.seq.call(null, a);;) { + if(a) { + b[c] = cljs.core.to_array.call(null, cljs.core.first.call(null, a)), c += 1, a = cljs.core.next.call(null, a) + }else { + break } } - return b; + return b }; cljs.core.int_array = function() { var a = null, b = function(b) { - return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); + return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) }, c = function(a, b) { var c = Array(a); - if (cljs.core.seq_QMARK_(b)) { - for (var g = 0, h = cljs.core.seq(b);;) { - if (h && g < a) { - c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); - } else { - return c; + if(cljs.core.seq_QMARK_.call(null, b)) { + for(var g = 0, h = cljs.core.seq.call(null, b);;) { + if(h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) + }else { + return c } } - } else { - for (g = 0;;) { - if (g < a) { - c[g] = b, g += 1; - } else { - break; + }else { + for(g = 0;;) { + if(g < a) { + c[g] = b, g += 1 + }else { + break } } - return c; + return c } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.long_array = function() { var a = null, b = function(b) { - return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); + return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) }, c = function(a, b) { var c = Array(a); - if (cljs.core.seq_QMARK_(b)) { - for (var g = 0, h = cljs.core.seq(b);;) { - if (h && g < a) { - c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); - } else { - return c; + if(cljs.core.seq_QMARK_.call(null, b)) { + for(var g = 0, h = cljs.core.seq.call(null, b);;) { + if(h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) + }else { + return c } } - } else { - for (g = 0;;) { - if (g < a) { - c[g] = b, g += 1; - } else { - break; + }else { + for(g = 0;;) { + if(g < a) { + c[g] = b, g += 1 + }else { + break } } - return c; + return c } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.double_array = function() { var a = null, b = function(b) { - return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); + return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) }, c = function(a, b) { var c = Array(a); - if (cljs.core.seq_QMARK_(b)) { - for (var g = 0, h = cljs.core.seq(b);;) { - if (h && g < a) { - c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); - } else { - return c; + if(cljs.core.seq_QMARK_.call(null, b)) { + for(var g = 0, h = cljs.core.seq.call(null, b);;) { + if(h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) + }else { + return c } } - } else { - for (g = 0;;) { - if (g < a) { - c[g] = b, g += 1; - } else { - break; + }else { + for(g = 0;;) { + if(g < a) { + c[g] = b, g += 1 + }else { + break } } - return c; + return c } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.object_array = function() { var a = null, b = function(b) { - return "number" === typeof b ? a.cljs$core$IFn$_invoke$arity$2(b, null) : cljs.core.into_array.cljs$core$IFn$_invoke$arity$1(b); + return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) }, c = function(a, b) { var c = Array(a); - if (cljs.core.seq_QMARK_(b)) { - for (var g = 0, h = cljs.core.seq(b);;) { - if (h && g < a) { - c[g] = cljs.core.first(h), g += 1, h = cljs.core.next(h); - } else { - return c; + if(cljs.core.seq_QMARK_.call(null, b)) { + for(var g = 0, h = cljs.core.seq.call(null, b);;) { + if(h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) + }else { + return c } } - } else { - for (g = 0;;) { - if (g < a) { - c[g] = b, g += 1; - } else { - break; + }else { + for(g = 0;;) { + if(g < a) { + c[g] = b, g += 1 + }else { + break } } - return c; + return c } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.bounded_count = function(a, b) { - if (cljs.core.counted_QMARK_(a)) { - return cljs.core.count(a); + if(cljs.core.counted_QMARK_.call(null, a)) { + return cljs.core.count.call(null, a) } - for (var c = a, d = b, e = 0;;) { - if (0 < d && cljs.core.seq(c)) { - c = cljs.core.next(c), d -= 1, e += 1; - } else { - return e; + for(var c = a, d = b, e = 0;;) { + if(0 < d && cljs.core.seq.call(null, c)) { + c = cljs.core.next.call(null, c), d -= 1, e += 1 + }else { + return e } } }; cljs.core.spread = function spread(b) { - return null == b ? null : null == cljs.core.next(b) ? cljs.core.seq(cljs.core.first(b)) : cljs.core.cons(cljs.core.first(b), spread(cljs.core.next(b))); + return null == b ? null : null == cljs.core.next.call(null, b) ? cljs.core.seq.call(null, cljs.core.first.call(null, b)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.cons.call(null, cljs.core.first.call(null, b), spread.call(null, cljs.core.next.call(null, b))) : null }; cljs.core.concat = function() { var a = null, b = function() { return new cljs.core.LazySeq(null, function() { - return null; - }, null, null); + return null + }, null, null) }, c = function(a) { return new cljs.core.LazySeq(null, function() { - return a; - }, null, null); + return a + }, null, null) }, d = function(b, c) { return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq(b); - return d ? cljs.core.chunked_seq_QMARK_(d) ? cljs.core.chunk_cons(cljs.core.chunk_first(d), a.cljs$core$IFn$_invoke$arity$2(cljs.core.chunk_rest(d), c)) : cljs.core.cons(cljs.core.first(d), a.cljs$core$IFn$_invoke$arity$2(cljs.core.rest(d), c)) : c; - }, null, null); + var d = cljs.core.seq.call(null, b); + return d ? cljs.core.chunked_seq_QMARK_.call(null, d) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, d), a.call(null, cljs.core.chunk_rest.call(null, d), c)) : cljs.core.cons.call(null, cljs.core.first.call(null, d), a.call(null, cljs.core.rest.call(null, d), c)) : c + }, null, null) }, e = function() { var b = function(b, c, d) { return function n(a, b) { return new cljs.core.LazySeq(null, function() { - var c = cljs.core.seq(a); - return c ? cljs.core.chunked_seq_QMARK_(c) ? cljs.core.chunk_cons(cljs.core.chunk_first(c), n(cljs.core.chunk_rest(c), b)) : cljs.core.cons(cljs.core.first(c), n(cljs.core.rest(c), b)) : cljs.core.truth_(b) ? n(cljs.core.first(b), cljs.core.next(b)) : null; - }, null, null); - }(a.cljs$core$IFn$_invoke$arity$2(b, c), d); + var c = cljs.core.seq.call(null, a); + return c ? cljs.core.chunked_seq_QMARK_.call(null, c) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, c), n.call(null, cljs.core.chunk_rest.call(null, c), b)) : cljs.core.cons.call(null, cljs.core.first.call(null, c), n.call(null, cljs.core.rest.call(null, c), b)) : cljs.core.truth_(b) ? n.call(null, cljs.core.first.call(null, b), cljs.core.next.call(null, b)) : null + }, null, null) + }.call(null, a.call(null, b, c), d) }, c = function(a, c, d) { var e = null; - if (2 < arguments.length) { - for (var e = 0, g = Array(arguments.length - 2);e < g.length;) { - g[e] = arguments[e + 2], ++e; - } - e = new cljs.core.IndexedSeq(g, 0); - } - return b.call(this, a, c, e); + 2 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, e) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -7828,10 +5936,10 @@ cljs.core.concat = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, a); + return b(c, d, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, g, h) { switch(arguments.length) { case 0: @@ -7841,14 +5949,7 @@ cljs.core.concat = function() { case 2: return d.call(this, a, g); default: - var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, k); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; @@ -7858,29 +5959,24 @@ cljs.core.concat = function() { a.cljs$core$IFn$_invoke$arity$1 = c; a.cljs$core$IFn$_invoke$arity$2 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.list_STAR_ = function() { var a = null, b = function(a) { - return cljs.core.seq(a); + return cljs.core.seq.call(null, a) }, c = function(a, b) { - return cljs.core.cons(a, b); + return cljs.core.cons.call(null, a, b) }, d = function(a, b, c) { - return cljs.core.cons(a, cljs.core.cons(b, c)); + return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, c)) }, e = function(a, b, c, d) { - return cljs.core.cons(a, cljs.core.cons(b, cljs.core.cons(c, d))); + return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, d))) }, f = function() { var a = function(a, b, c, d, e) { - return cljs.core.cons(a, cljs.core.cons(b, cljs.core.cons(c, cljs.core.cons(d, cljs.core.spread(e))))); + return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.spread.call(null, e))))) }, b = function(b, c, d, e, f) { var h = null; - if (4 < arguments.length) { - for (var h = 0, r = Array(arguments.length - 4);h < r.length;) { - r[h] = arguments[h + 4], ++h; - } - h = new cljs.core.IndexedSeq(r, 0); - } - return a.call(this, b, c, d, e, h); + 4 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); + return a.call(this, b, c, d, e, h) }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -7892,10 +5988,10 @@ cljs.core.list_STAR_ = function() { b = cljs.core.next(b); var f = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, f, b); + return a(c, d, e, f, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, h, k, l, m) { switch(arguments.length) { case 1: @@ -7907,14 +6003,7 @@ cljs.core.list_STAR_ = function() { case 4: return e.call(this, a, h, k, l); default: - var n = null; - if (4 < arguments.length) { - for (var n = 0, p = Array(arguments.length - 4);n < p.length;) { - p[n] = arguments[n + 4], ++n; - } - n = new cljs.core.IndexedSeq(p, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, n); + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, cljs.core.array_seq(arguments, 4)) } throw Error("Invalid arity: " + arguments.length); }; @@ -7925,1129 +6014,372 @@ cljs.core.list_STAR_ = function() { a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$4 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.transient$ = function(a) { - return cljs.core._as_transient(a); + return cljs.core._as_transient.call(null, a) }; cljs.core.persistent_BANG_ = function(a) { - return cljs.core._persistent_BANG_(a); + return cljs.core._persistent_BANG_.call(null, a) }; -cljs.core.conj_BANG_ = function() { - var a = null, b = function() { - return cljs.core.transient$(cljs.core.PersistentVector.EMPTY); - }, c = function(a, b) { - return cljs.core._conj_BANG_(a, b); - }, d = function() { - var a = function(a, b, c) { - for (;;) { - if (a = cljs.core._conj_BANG_(a, b), cljs.core.truth_(c)) { - b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return a; - } - } - }, b = function(b, c, d) { - var f = null; - if (2 < arguments.length) { - for (var f = 0, m = Array(arguments.length - 2);f < m.length;) { - m[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(m, 0); - } - return a.call(this, b, c, f); +cljs.core.conj_BANG_ = function(a, b) { + return cljs.core._conj_BANG_.call(null, a, b) +}; +cljs.core.assoc_BANG_ = function(a, b, c) { + return cljs.core._assoc_BANG_.call(null, a, b, c) +}; +cljs.core.dissoc_BANG_ = function(a, b) { + return cljs.core._dissoc_BANG_.call(null, a, b) +}; +cljs.core.pop_BANG_ = function(a) { + return cljs.core._pop_BANG_.call(null, a) +}; +cljs.core.disj_BANG_ = function(a, b) { + return cljs.core._disjoin_BANG_.call(null, a, b) +}; +cljs.core.apply_to = function(a, b, c) { + var d = cljs.core.seq.call(null, c); + if(0 === b) { + return a.call(null) + } + c = cljs.core._first.call(null, d); + var e = cljs.core._rest.call(null, d); + if(1 === b) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) + } + var d = cljs.core._first.call(null, e), f = cljs.core._rest.call(null, e); + if(2 === b) { + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d) + } + var e = cljs.core._first.call(null, f), g = cljs.core._rest.call(null, f); + if(3 === b) { + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e) + } + var f = cljs.core._first.call(null, g), h = cljs.core._rest.call(null, g); + if(4 === b) { + return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.call(null, c, d, e, f) + } + g = cljs.core._first.call(null, h); + h = cljs.core._rest.call(null, h); + if(5 === b) { + return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.call(null, c, d, e, f, g) + } + a = cljs.core._first.call(null, h); + var k = cljs.core._rest.call(null, h); + if(6 === b) { + return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, a) : a.call(null, c, d, e, f, g, a) + } + var h = cljs.core._first.call(null, k), l = cljs.core._rest.call(null, k); + if(7 === b) { + return a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, a, h) : a.call(null, c, d, e, f, g, a, h) + } + var k = cljs.core._first.call(null, l), m = cljs.core._rest.call(null, l); + if(8 === b) { + return a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, a, h, k) : a.call(null, c, d, e, f, g, a, h, k) + } + var l = cljs.core._first.call(null, m), n = cljs.core._rest.call(null, m); + if(9 === b) { + return a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, a, h, k, l) : a.call(null, c, d, e, f, g, a, h, k, l) + } + var m = cljs.core._first.call(null, n), p = cljs.core._rest.call(null, n); + if(10 === b) { + return a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, a, h, k, l, m) : a.call(null, c, d, e, f, g, a, h, k, l, m) + } + var n = cljs.core._first.call(null, p), q = cljs.core._rest.call(null, p); + if(11 === b) { + return a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, a, h, k, l, m, n) : a.call(null, c, d, e, f, g, a, h, k, l, m, n) + } + var p = cljs.core._first.call(null, q), r = cljs.core._rest.call(null, q); + if(12 === b) { + return a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, a, h, k, l, m, n, p) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p) + } + var q = cljs.core._first.call(null, r), s = cljs.core._rest.call(null, r); + if(13 === b) { + return a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, a, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q) + } + var r = cljs.core._first.call(null, s), t = cljs.core._rest.call(null, s); + if(14 === b) { + return a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, a, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r) + } + var s = cljs.core._first.call(null, t), v = cljs.core._rest.call(null, t); + if(15 === b) { + return a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) + } + var t = cljs.core._first.call(null, v), u = cljs.core._rest.call(null, v); + if(16 === b) { + return a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) + } + var v = cljs.core._first.call(null, u), w = cljs.core._rest.call(null, u); + if(17 === b) { + return a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) + } + var u = cljs.core._first.call(null, w), B = cljs.core._rest.call(null, w); + if(18 === b) { + return a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) + } + w = cljs.core._first.call(null, B); + B = cljs.core._rest.call(null, B); + if(19 === b) { + return a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) + } + var I = cljs.core._first.call(null, B); + cljs.core._rest.call(null, B); + if(20 === b) { + return a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) + } + throw Error("Only up to 20 arguments supported on functions"); +}; +cljs.core.apply = function() { + var a = null, b = function(a, b) { + var c = a.cljs$lang$maxFixedArity; + if(a.cljs$lang$applyTo) { + var d = cljs.core.bounded_count.call(null, b, c + 1); + return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b) + } + return a.apply(a, cljs.core.to_array.call(null, b)) + }, c = function(a, b, c) { + b = cljs.core.list_STAR_.call(null, b, c); + c = a.cljs$lang$maxFixedArity; + if(a.cljs$lang$applyTo) { + var d = cljs.core.bounded_count.call(null, b, c + 1); + return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b) + } + return a.apply(a, cljs.core.to_array.call(null, b)) + }, d = function(a, b, c, d) { + b = cljs.core.list_STAR_.call(null, b, c, d); + c = a.cljs$lang$maxFixedArity; + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) + }, e = function(a, b, c, d, e) { + b = cljs.core.list_STAR_.call(null, b, c, d, e); + c = a.cljs$lang$maxFixedArity; + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) + }, f = function() { + var a = function(a, b, c, d, e, f) { + b = cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.cons.call(null, e, cljs.core.spread.call(null, f))))); + c = a.cljs$lang$maxFixedArity; + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) + }, b = function(b, c, d, e, f, h) { + var r = null; + 5 < arguments.length && (r = cljs.core.array_seq(Array.prototype.slice.call(arguments, 5), 0)); + return a.call(this, b, c, d, e, f, r) }; - b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$maxFixedArity = 5; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.next(b); var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var f = cljs.core.first(b); + b = cljs.core.next(b); + var h = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, b); + return a(c, d, e, f, h, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, f, g) { + return b + }(), a = function(a, h, k, l, m, n) { switch(arguments.length) { - case 0: - return b.call(this); - case 1: - return a; case 2: - return c.call(this, a, f); - default: - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return d.cljs$core$IFn$_invoke$arity$variadic(a, f, h); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = d.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$0 = b; - a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; - }; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$variadic = d.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.assoc_BANG_ = function() { - var a = null, b = function(a, b, c) { - return cljs.core._assoc_BANG_(a, b, c); - }, c = function() { - var a = function(a, b, c, d) { - for (;;) { - if (a = cljs.core._assoc_BANG_(a, b, c), cljs.core.truth_(d)) { - b = cljs.core.first(d), c = cljs.core.second(d), d = cljs.core.nnext(d); - } else { - return a; - } - } - }, b = function(b, c, e, k) { - var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return a.call(this, b, c, e, l); - }; - b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.next(b); - var k = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, e, k, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, e, f, g) { - switch(arguments.length) { - case 3: - return b.call(this, a, e, f); - default: - var h = null; - if (3 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { - k[h] = arguments[h + 3], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 3; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$3 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.dissoc_BANG_ = function() { - var a = null, b = function(a, b) { - return cljs.core._dissoc_BANG_(a, b); - }, c = function() { - var a = function(a, b, c) { - for (;;) { - if (a = cljs.core._dissoc_BANG_(a, b), cljs.core.truth_(c)) { - b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return a; - } - } - }, b = function(b, c, e) { - var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return a.call(this, b, c, k); - }; - b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, e, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, e, f) { - switch(arguments.length) { - case 2: - return b.call(this, a, e); - default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.pop_BANG_ = function(a) { - return cljs.core._pop_BANG_(a); -}; -cljs.core.disj_BANG_ = function() { - var a = null, b = function(a, b) { - return cljs.core._disjoin_BANG_(a, b); - }, c = function() { - var a = function(a, b, c) { - for (;;) { - if (a = cljs.core._disjoin_BANG_(a, b), cljs.core.truth_(c)) { - b = cljs.core.first(c), c = cljs.core.next(c); - } else { - return a; - } - } - }, b = function(b, c, e) { - var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return a.call(this, b, c, k); - }; - b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, e, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, e, f) { - switch(arguments.length) { - case 2: - return b.call(this, a, e); - default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.apply_to = function(a, b, c) { - var d = cljs.core.seq(c); - if (0 === b) { - return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); - } - c = cljs.core._first(d); - var e = cljs.core._rest(d); - if (1 === b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - } - var d = cljs.core._first(e), f = cljs.core._rest(e); - if (2 === b) { - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d); - } - var e = cljs.core._first(f), g = cljs.core._rest(f); - if (3 === b) { - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e); - } - var f = cljs.core._first(g), h = cljs.core._rest(g); - if (4 === b) { - return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.call(null, c, d, e, f); - } - var g = cljs.core._first(h), k = cljs.core._rest(h); - if (5 === b) { - return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.call(null, c, d, e, f, g); - } - var h = cljs.core._first(k), l = cljs.core._rest(k); - if (6 === b) { - return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, h) : a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, h) : a.call(null, c, d, e, f, g, h); - } - var k = cljs.core._first(l), m = cljs.core._rest(l); - if (7 === b) { - return a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, h, k) : a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, h, k) : a.call(null, c, d, e, f, g, h, k); - } - var l = cljs.core._first(m), n = cljs.core._rest(m); - if (8 === b) { - return a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, h, k, l) : a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, h, k, l) : a.call(null, c, d, e, f, g, h, k, l); - } - var m = cljs.core._first(n), p = cljs.core._rest(n); - if (9 === b) { - return a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, h, k, l, m) : a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, h, k, l, m) : a.call(null, c, d, e, f, g, h, k, l, m); - } - var n = cljs.core._first(p), q = cljs.core._rest(p); - if (10 === b) { - return a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, h, k, l, m, n) : a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, h, k, l, m, n) : a.call(null, c, d, e, f, g, h, k, l, m, n); - } - var p = cljs.core._first(q), r = cljs.core._rest(q); - if (11 === b) { - return a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, h, k, l, m, n, p) : a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, h, k, l, m, n, p) : a.call(null, c, d, e, f, g, h, k, l, m, n, p); - } - var q = cljs.core._first(r), s = cljs.core._rest(r); - if (12 === b) { - return a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, h, k, l, m, n, p, q) : a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q); - } - var r = cljs.core._first(s), t = cljs.core._rest(s); - if (13 === b) { - return a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, h, k, l, m, n, p, q, r) : a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r); - } - var s = cljs.core._first(t), u = cljs.core._rest(t); - if (14 === b) { - return a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, h, k, l, m, n, p, q, r, s) : a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s); - } - var t = cljs.core._first(u), v = cljs.core._rest(u); - if (15 === b) { - return a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); - } - var u = cljs.core._first(v), w = cljs.core._rest(v); - if (16 === b) { - return a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); - } - var v = cljs.core._first(w), y = cljs.core._rest(w); - if (17 === b) { - return a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); - } - var w = cljs.core._first(y), F = cljs.core._rest(y); - if (18 === b) { - return a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); - } - y = cljs.core._first(F); - F = cljs.core._rest(F); - if (19 === b) { - return a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); - } - var L = cljs.core._first(F); - cljs.core._rest(F); - if (20 === b) { - return a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, L) : a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, L) : a.call(null, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, L); - } - throw Error("Only up to 20 arguments supported on functions"); -}; -cljs.core.apply = function() { - var a = null, b = function(a, b) { - var c = a.cljs$lang$maxFixedArity; - if (a.cljs$lang$applyTo) { - var d = cljs.core.bounded_count(b, c + 1); - return d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b); - } - return a.apply(a, cljs.core.to_array(b)); - }, c = function(a, b, c) { - b = cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$2(b, c); - c = a.cljs$lang$maxFixedArity; - if (a.cljs$lang$applyTo) { - var d = cljs.core.bounded_count(b, c + 1); - return d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b); - } - return a.apply(a, cljs.core.to_array(b)); - }, d = function(a, b, c, d) { - b = cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$3(b, c, d); - c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count(b, c + 1), d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array(b)); - }, e = function(a, b, c, d, e) { - b = cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(b, c, d, e); - c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count(b, c + 1), d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array(b)); - }, f = function() { - var a = function(a, b, c, d, e, f) { - b = cljs.core.cons(b, cljs.core.cons(c, cljs.core.cons(d, cljs.core.cons(e, cljs.core.spread(f))))); - c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count(b, c + 1), d <= c ? cljs.core.apply_to(a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array(b)); - }, b = function(b, c, d, e, f, h) { - var r = null; - if (5 < arguments.length) { - for (var r = 0, s = Array(arguments.length - 5);r < s.length;) { - s[r] = arguments[r + 5], ++r; - } - r = new cljs.core.IndexedSeq(s, 0); - } - return a.call(this, b, c, d, e, f, r); - }; - b.cljs$lang$maxFixedArity = 5; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.next(b); - var f = cljs.core.first(b); - b = cljs.core.next(b); - var h = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, d, e, f, h, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, h, k, l, m, n) { - switch(arguments.length) { - case 2: - return b.call(this, a, h); - case 3: - return c.call(this, a, h, k); - case 4: - return d.call(this, a, h, k, l); - case 5: - return e.call(this, a, h, k, l, m); - default: - var p = null; - if (5 < arguments.length) { - for (var p = 0, q = Array(arguments.length - 5);p < q.length;) { - q[p] = arguments[p + 5], ++p; - } - p = new cljs.core.IndexedSeq(q, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, p); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 5; - a.cljs$lang$applyTo = f.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - a.cljs$core$IFn$_invoke$arity$4 = d; - a.cljs$core$IFn$_invoke$arity$5 = e; - a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.vary_meta = function() { - var a = null, b = function(a, b) { - return cljs.core.with_meta(a, function() { - var c = cljs.core.meta(a); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - }()); - }, c = function(a, b, c) { - return cljs.core.with_meta(a, function() { - var d = cljs.core.meta(a); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, c) : b.call(null, d, c); - }()); - }, d = function(a, b, c, d) { - return cljs.core.with_meta(a, function() { - var e = cljs.core.meta(a); - return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(e, c, d) : b.call(null, e, c, d); - }()); - }, e = function(a, b, c, d, e) { - return cljs.core.with_meta(a, function() { - var f = cljs.core.meta(a); - return b.cljs$core$IFn$_invoke$arity$4 ? b.cljs$core$IFn$_invoke$arity$4(f, c, d, e) : b.call(null, f, c, d, e); - }()); - }, f = function(a, b, c, d, e, f) { - return cljs.core.with_meta(a, function() { - var g = cljs.core.meta(a); - return b.cljs$core$IFn$_invoke$arity$5 ? b.cljs$core$IFn$_invoke$arity$5(g, c, d, e, f) : b.call(null, g, c, d, e, f); - }()); - }, g = function() { - var a = function(a, b, c, d, e, f, g) { - return cljs.core.with_meta(a, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.meta(a), c, d, e, cljs.core.array_seq([f, g], 0))); - }, b = function(b, c, d, e, f, g, k) { - var t = null; - if (6 < arguments.length) { - for (var t = 0, u = Array(arguments.length - 6);t < u.length;) { - u[t] = arguments[t + 6], ++t; - } - t = new cljs.core.IndexedSeq(u, 0); - } - return a.call(this, b, c, d, e, f, g, t); - }; - b.cljs$lang$maxFixedArity = 6; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.next(b); - var f = cljs.core.first(b); - b = cljs.core.next(b); - var g = cljs.core.first(b); - b = cljs.core.next(b); - var k = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, d, e, f, g, k, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, k, l, m, n, p, q) { - switch(arguments.length) { - case 2: - return b.call(this, a, k); - case 3: - return c.call(this, a, k, l); - case 4: - return d.call(this, a, k, l, m); - case 5: - return e.call(this, a, k, l, m, n); - case 6: - return f.call(this, a, k, l, m, n, p); - default: - var r = null; - if (6 < arguments.length) { - for (var r = 0, s = Array(arguments.length - 6);r < s.length;) { - s[r] = arguments[r + 6], ++r; - } - r = new cljs.core.IndexedSeq(s, 0); - } - return g.cljs$core$IFn$_invoke$arity$variadic(a, k, l, m, n, p, r); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 6; - a.cljs$lang$applyTo = g.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - a.cljs$core$IFn$_invoke$arity$4 = d; - a.cljs$core$IFn$_invoke$arity$5 = e; - a.cljs$core$IFn$_invoke$arity$6 = f; - a.cljs$core$IFn$_invoke$arity$variadic = g.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.not_EQ_ = function() { - var a = null, b = function(a, b) { - return!cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b); - }, c = function() { - var a = function(a, b, c) { - return cljs.core.not(cljs.core.apply.cljs$core$IFn$_invoke$arity$4(cljs.core._EQ_, a, b, c)); - }, b = function(b, c, e) { - var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return a.call(this, b, c, k); - }; - b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, e, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, e, f) { - switch(arguments.length) { - case 1: - return!1; - case 2: - return b.call(this, a, e); - default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!1; - }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.not_empty = function(a) { - return cljs.core.seq(a) ? a : null; -}; -cljs.core.nil_iter = function nil_iter() { - "undefined" === typeof cljs.core.t7727 && (cljs.core.t7727 = function(b, c) { - this.nil_iter = b; - this.meta7728 = c; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 393216; - }, cljs.core.t7727.prototype.hasNext = function() { - return!1; - }, cljs.core.t7727.prototype.next = function() { - return Error("No such element"); - }, cljs.core.t7727.prototype.remove = function() { - return Error("Unsupported operation"); - }, cljs.core.t7727.prototype.cljs$core$IMeta$_meta$arity$1 = function(b) { - return this.meta7728; - }, cljs.core.t7727.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(b, c) { - return new cljs.core.t7727(this.nil_iter, c); - }, cljs.core.t7727.cljs$lang$type = !0, cljs.core.t7727.cljs$lang$ctorStr = "cljs.core/t7727", cljs.core.t7727.cljs$lang$ctorPrWriter = function(b, c, d) { - return cljs.core._write(c, "cljs.core/t7727"); - }, cljs.core.__GT_t7727 = function(b, c) { - return new cljs.core.t7727(b, c); - }); - return new cljs.core.t7727(nil_iter, cljs.core.PersistentArrayMap.EMPTY); -}; -cljs.core.StringIter = function(a, b) { - this.s = a; - this.i = b; -}; -cljs.core.StringIter.prototype.hasNext = function() { - return this.i < this.s.length; -}; -cljs.core.StringIter.prototype.next = function() { - var a = this.s.charAt(this.i); - this.i += 1; - return a; -}; -cljs.core.StringIter.prototype.remove = function() { - return Error("Unsupported operation"); -}; -cljs.core.StringIter.cljs$lang$type = !0; -cljs.core.StringIter.cljs$lang$ctorStr = "cljs.core/StringIter"; -cljs.core.StringIter.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/StringIter"); -}; -cljs.core.__GT_StringIter = function(a, b) { - return new cljs.core.StringIter(a, b); -}; -cljs.core.string_iter = function(a) { - return new cljs.core.StringIter(a, 0); -}; -cljs.core.ArrayIter = function(a, b) { - this.arr = a; - this.i = b; -}; -cljs.core.ArrayIter.prototype.hasNext = function() { - return this.i < this.arr.length; -}; -cljs.core.ArrayIter.prototype.next = function() { - var a = this.arr[this.i]; - this.i += 1; - return a; -}; -cljs.core.ArrayIter.prototype.remove = function() { - return Error("Unsupported operation"); -}; -cljs.core.ArrayIter.cljs$lang$type = !0; -cljs.core.ArrayIter.cljs$lang$ctorStr = "cljs.core/ArrayIter"; -cljs.core.ArrayIter.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ArrayIter"); -}; -cljs.core.__GT_ArrayIter = function(a, b) { - return new cljs.core.ArrayIter(a, b); -}; -cljs.core.array_iter = function(a) { - return new cljs.core.ArrayIter(a, 0); -}; -cljs.core.INIT = {}; -cljs.core.START = {}; -cljs.core.SeqIter = function(a, b) { - this._seq = a; - this._next = b; -}; -cljs.core.SeqIter.prototype.hasNext = function() { - this._seq === cljs.core.INIT ? (this._seq = cljs.core.START, this._next = cljs.core.seq(this._next)) : this._seq === this._next && (this._next = cljs.core.next(this._seq)); - return null != this._next; -}; -cljs.core.SeqIter.prototype.next = function() { - if (cljs.core.not(this.hasNext())) { - throw Error("No such element"); - } - this._seq = this._next; - return cljs.core.first(this._next); -}; -cljs.core.SeqIter.prototype.remove = function() { - return Error("Unsupported operation"); -}; -cljs.core.SeqIter.cljs$lang$type = !0; -cljs.core.SeqIter.cljs$lang$ctorStr = "cljs.core/SeqIter"; -cljs.core.SeqIter.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/SeqIter"); -}; -cljs.core.__GT_SeqIter = function(a, b) { - return new cljs.core.SeqIter(a, b); -}; -cljs.core.seq_iter = function(a) { - return new cljs.core.SeqIter(cljs.core.INIT, a); -}; -cljs.core.iter = function(a) { - if (null == a) { - return cljs.core.nil_iter(); - } - if ("string" === typeof a) { - return cljs.core.string_iter(a); - } - if (a instanceof Array) { - return cljs.core.array_iter(a); - } - if (cljs.core.iterable_QMARK_(a)) { - return cljs.core._iterator(a); - } - if (cljs.core.seqable_QMARK_(a)) { - return cljs.core.seq_iter(a); - } - throw Error([cljs.core.str("Cannot create iterator from "), cljs.core.str(a)].join("")); -}; -cljs.core.lazy_transformer = function(a) { - return new cljs.core.LazyTransformer(a, null, null, null); -}; -cljs.core.Stepper = function(a, b) { - this.xform = a; - this.iter = b; -}; -cljs.core.Stepper.prototype.step = function(a) { - for (var b = this;;) { - if (cljs.core.truth_(function() { - var c = null != a.stepper; - return c ? b.iter.hasNext() : c; - }())) { - if (cljs.core.reduced_QMARK_(function() { - var c = b.iter.next(); - return b.xform.cljs$core$IFn$_invoke$arity$2 ? b.xform.cljs$core$IFn$_invoke$arity$2(a, c) : b.xform.call(null, a, c); - }())) { - null != a.rest && (a.rest.stepper = null); - } else { - continue; - } - } - break; - } - return null == a.stepper ? null : b.xform.cljs$core$IFn$_invoke$arity$1 ? b.xform.cljs$core$IFn$_invoke$arity$1(a) : b.xform.call(null, a); -}; -cljs.core.Stepper.cljs$lang$type = !0; -cljs.core.Stepper.cljs$lang$ctorStr = "cljs.core/Stepper"; -cljs.core.Stepper.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Stepper"); -}; -cljs.core.__GT_Stepper = function(a, b) { - return new cljs.core.Stepper(a, b); -}; -cljs.core.stepper = function(a, b) { - var c = function() { - var a = null, b = function(a) { - (cljs.core.reduced_QMARK_(a) ? cljs.core.deref(a) : a).stepper = null; - return a; - }, c = function(a, b) { - a.first = b; - a.rest = cljs.core.lazy_transformer(a.stepper); - a.stepper = null; - return a.rest; - }, a = function(a, d) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, d); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; - }(); - return new cljs.core.Stepper(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), b); -}; -cljs.core.MultiStepper = function(a, b, c) { - this.xform = a; - this.iters = b; - this.nexts = c; -}; -cljs.core.MultiStepper.prototype.hasNext = function() { - for (var a = cljs.core.seq(this.iters);;) { - if (null != a) { - var b = cljs.core.first(a); - if (cljs.core.not(b.hasNext())) { - return!1; - } - a = cljs.core.next(a); - } else { - return!0; - } - } -}; -cljs.core.MultiStepper.prototype.next = function() { - for (var a = this.iters.length, b = 0;;) { - if (b < a) { - this.nexts[b] = this.iters[b].next(), b += 1; - } else { - break; - } - } - return cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(this.nexts, 0); -}; -cljs.core.MultiStepper.prototype.step = function(a) { - for (var b = this;;) { - if (cljs.core.truth_(function() { - var c = null != a.stepper; - return c ? b.hasNext() : c; - }())) { - if (cljs.core.reduced_QMARK_(cljs.core.apply.cljs$core$IFn$_invoke$arity$2(this.xform, cljs.core.cons(a, b.next())))) { - null != a.rest && (a.rest.stepper = null); - } else { - continue; - } - } - break; - } - return null == a.stepper ? null : this.xform.cljs$core$IFn$_invoke$arity$1 ? this.xform.cljs$core$IFn$_invoke$arity$1(a) : this.xform.call(null, a); -}; -cljs.core.MultiStepper.cljs$lang$type = !0; -cljs.core.MultiStepper.cljs$lang$ctorStr = "cljs.core/MultiStepper"; -cljs.core.MultiStepper.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/MultiStepper"); -}; -cljs.core.__GT_MultiStepper = function(a, b, c) { - return new cljs.core.MultiStepper(a, b, c); -}; -cljs.core.multi_stepper = function() { - var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, Array(c.length)); - }, c = function(a, b, c) { - var g = function() { - var a = null, b = function(a) { - a = cljs.core.reduced_QMARK_(a) ? cljs.core.deref(a) : a; - a.stepper = null; - return a; - }, c = function(a, b) { - a.first = b; - a.rest = cljs.core.lazy_transformer(a.stepper); - a.stepper = null; - return a.rest; - }, a = function(a, d) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, d); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; - }(); - return new cljs.core.MultiStepper(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(g) : a.call(null, g), b, c); - }, a = function(a, e, f) { - switch(arguments.length) { - case 2: - return b.call(this, a, e); + return b.call(this, a, h); case 3: - return c.call(this, a, e, f); + return c.call(this, a, h, k); + case 4: + return d.call(this, a, h, k, l); + case 5: + return e.call(this, a, h, k, l, m); + default: + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)) } throw Error("Invalid arity: " + arguments.length); }; + a.cljs$lang$maxFixedArity = 5; + a.cljs$lang$applyTo = f.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$5 = e; + a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return a }(); -cljs.core.LazyTransformer = function(a, b, c, d) { - this.stepper = a; - this.first = b; - this.rest = c; - this.meta = d; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 31719628; -}; -cljs.core.LazyTransformer.prototype.cljs$core$INext$_next$arity$1 = function(a) { - null != this.stepper && cljs.core._seq(this); - return null == this.rest ? null : cljs.core._seq(this.rest); -}; -cljs.core.LazyTransformer.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - null != this.stepper && cljs.core._seq(this); - return null == this.rest ? null : this.first; -}; -cljs.core.LazyTransformer.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - null != this.stepper && cljs.core._seq(this); - return null == this.rest ? cljs.core.List.EMPTY : this.rest; -}; -cljs.core.LazyTransformer.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - null != this.stepper && this.stepper.step(this); - return null == this.rest ? null : this; -}; -cljs.core.LazyTransformer.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_ordered_coll(this); -}; -cljs.core.LazyTransformer.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return null != cljs.core._seq(this) ? cljs.core.equiv_sequential(this, b) : cljs.core.sequential_QMARK_(b) && null == cljs.core.seq(b); -}; -cljs.core.LazyTransformer.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.List.EMPTY; -}; -cljs.core.LazyTransformer.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, cljs.core._seq(this)); -}; -cljs.core.LazyTransformer.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.LazyTransformer(this.stepper, this.first, this.rest, b); -}; -cljs.core.LazyTransformer.cljs$lang$type = !0; -cljs.core.LazyTransformer.cljs$lang$ctorStr = "cljs.core/LazyTransformer"; -cljs.core.LazyTransformer.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/LazyTransformer"); -}; -cljs.core.__GT_LazyTransformer = function(a, b, c, d) { - return new cljs.core.LazyTransformer(a, b, c, d); -}; -cljs.core.LazyTransformer.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; -cljs.core.LazyTransformer.create = function(a, b) { - return new cljs.core.LazyTransformer(cljs.core.stepper(a, cljs.core.iter(b)), null, null, null); -}; -cljs.core.LazyTransformer.createMulti = function(a, b) { - for (var c = [], d = cljs.core.seq(b), e = null, f = 0, g = 0;;) { - if (g < f) { - var h = e.cljs$core$IIndexed$_nth$arity$2(null, g); - c.push(cljs.core.iter(h)); - g += 1; - } else { - if (d = cljs.core.seq(d)) { - e = d, cljs.core.chunked_seq_QMARK_(e) ? (d = cljs.core.chunk_first(e), g = cljs.core.chunk_rest(e), e = d, f = cljs.core.count(d), d = g) : (d = cljs.core.first(e), c.push(cljs.core.iter(d)), d = cljs.core.next(e), e = null, f = 0), g = 0; - } else { - break; - } - } - } - return new cljs.core.LazyTransformer(cljs.core.multi_stepper.cljs$core$IFn$_invoke$arity$3(a, c, Array(c.length)), null, null, null); -}; -cljs.core.sequence = function() { - var a = null, b = function(a) { - return cljs.core.seq_QMARK_(a) ? a : (a = cljs.core.seq(a)) ? a : cljs.core.List.EMPTY; - }, c = function(a, b) { - return cljs.core.LazyTransformer.create(a, b); - }, d = function() { +cljs.core.vary_meta = function() { + var a = function(a, b, e) { + return cljs.core.with_meta.call(null, a, cljs.core.apply.call(null, b, cljs.core.meta.call(null, a), e)) + }, b = function(b, d, e) { + var f = null; + 2 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, d, f) + }; + b.cljs$lang$maxFixedArity = 2; + b.cljs$lang$applyTo = function(b) { + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.rest(b); + return a(d, e, b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b +}(); +cljs.core.not_EQ_ = function() { + var a = null, b = function(a, b) { + return!cljs.core._EQ_.call(null, a, b) + }, c = function() { var a = function(a, b, c) { - return cljs.core.LazyTransformer.createMulti(a, cljs.core.to_array(cljs.core.cons(b, c))); - }, b = function(b, c, d) { - var f = null; - if (2 < arguments.length) { - for (var f = 0, m = Array(arguments.length - 2);f < m.length;) { - m[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(m, 0); - } - return a.call(this, b, c, f); + return cljs.core.not.call(null, cljs.core.apply.call(null, cljs.core._EQ_, a, b, c)) + }, b = function(b, c, e) { + var k = null; + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, c, k) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.next(b); - var d = cljs.core.first(b); + var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, b); + return a(c, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, f, g) { + return b + }(), a = function(a, e, f) { switch(arguments.length) { case 1: - return b.call(this, a); + return!1; case 2: - return c.call(this, a, f); + return b.call(this, a, e); default: - var h = null; - if (2 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 2);h < k.length;) { - k[h] = arguments[h + 2], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return d.cljs$core$IFn$_invoke$arity$variadic(a, f, h); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; - a.cljs$lang$applyTo = d.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$variadic = d.cljs$core$IFn$_invoke$arity$variadic; - return a; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$1 = function(a) { + return!1 + }; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a }(); +cljs.core.not_empty = function(a) { + return cljs.core.seq.call(null, a) ? a : null +}; cljs.core.every_QMARK_ = function(a, b) { - for (;;) { - if (null == cljs.core.seq(b)) { - return!0; + for(;;) { + if(null == cljs.core.seq.call(null, b)) { + return!0 } - if (cljs.core.truth_(function() { - var c = cljs.core.first(b); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }())) { - var c = a, d = cljs.core.next(b); + if(cljs.core.truth_(a.call(null, cljs.core.first.call(null, b)))) { + var c = a, d = cljs.core.next.call(null, b); a = c; - b = d; - } else { - return!1; + b = d + }else { + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null } } }; cljs.core.not_every_QMARK_ = function(a, b) { - return!cljs.core.every_QMARK_(a, b); + return!cljs.core.every_QMARK_.call(null, a, b) }; cljs.core.some = function(a, b) { - for (;;) { - if (cljs.core.seq(b)) { - var c; - c = cljs.core.first(b); - c = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - if (cljs.core.truth_(c)) { - return c; + for(;;) { + if(cljs.core.seq.call(null, b)) { + var c = a.call(null, cljs.core.first.call(null, b)); + if(cljs.core.truth_(c)) { + return c } - c = a; - var d = cljs.core.next(b); + var c = a, d = cljs.core.next.call(null, b); a = c; - b = d; - } else { - return null; + b = d + }else { + return null } } }; cljs.core.not_any_QMARK_ = function(a, b) { - return cljs.core.not(cljs.core.some(a, b)); + return cljs.core.not.call(null, cljs.core.some.call(null, a, b)) }; cljs.core.even_QMARK_ = function(a) { - if (cljs.core.integer_QMARK_(a)) { - return 0 === (a & 1); + if(cljs.core.integer_QMARK_.call(null, a)) { + return 0 === (a & 1) } throw Error([cljs.core.str("Argument must be an integer: "), cljs.core.str(a)].join("")); }; cljs.core.odd_QMARK_ = function(a) { - return!cljs.core.even_QMARK_(a); + return!cljs.core.even_QMARK_.call(null, a) +}; +cljs.core.identity = function(a) { + return a }; cljs.core.complement = function(a) { return function() { var b = null, c = function() { - return cljs.core.not(a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null)); - }, d = function(b) { - return cljs.core.not(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)); - }, e = function(b, c) { - return cljs.core.not(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c)); - }, f = function() { var b = function(b, c, d) { - return cljs.core.not(cljs.core.apply.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); - }, c = function(a, c, d) { - var e = null; - if (2 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 2);e < f.length;) { - f[e] = arguments[e + 2], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return b.call(this, a, c, e); + return cljs.core.not.call(null, cljs.core.apply.call(null, a, b, c, d)) + }, c = function(a, c, e) { + var k = null; + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.next(a); - var d = cljs.core.first(a); + var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(), b = function(a, b, k) { + return c + }(), b = function(b, e, f) { switch(arguments.length) { case 0: - return c.call(this); + return cljs.core.not.call(null, a.call(null)); case 1: - return d.call(this, a); + return cljs.core.not.call(null, a.call(null, b)); case 2: - return e.call(this, a, b); + return cljs.core.not.call(null, a.call(null, b, e)); default: - var l = null; - if (2 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 2);l < m.length;) { - m[l] = arguments[l + 2], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, b, l); + return c.cljs$core$IFn$_invoke$arity$variadic(b, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = f.cljs$lang$applyTo; - b.cljs$core$IFn$_invoke$arity$0 = c; - b.cljs$core$IFn$_invoke$arity$1 = d; - b.cljs$core$IFn$_invoke$arity$2 = e; - b.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); + b.cljs$lang$applyTo = c.cljs$lang$applyTo; + return b + }() }; cljs.core.constantly = function(a) { return function() { var b = function(b) { - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - new cljs.core.IndexedSeq(e, 0); - } - return a; + 0 < arguments.length && cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0); + return a }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { cljs.core.seq(b); - return a; + return a }; b.cljs$core$IFn$_invoke$arity$variadic = function(b) { - return a; + return a }; - return b; - }(); + return b + }() }; cljs.core.comp = function() { var a = null, b = function() { - return cljs.core.identity; + return cljs.core.identity }, c = function(a, b) { return function() { var c = null, d = function() { - var c = b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }, e = function(c) { - c = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }, m = function(c, d) { - var e; - e = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); - }, n = function(c, d, e) { - c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, d, e) : b.call(null, c, d, e); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }, p = function() { var c = function(c, d, e, h) { - c = cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, c, d, e, h); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + return a.call(null, cljs.core.apply.call(null, b, c, d, e, h)) }, d = function(a, b, d, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return c.call(this, a, b, d, f) }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -9057,75 +6389,38 @@ cljs.core.comp = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a); + return c(b, d, e, a) }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), c = function(a, b, c, f) { + return d + }(), c = function(c, e, h, p) { switch(arguments.length) { case 0: - return d.call(this); + return a.call(null, b.call(null)); case 1: - return e.call(this, a); + return a.call(null, b.call(null, c)); case 2: - return m.call(this, a, b); + return a.call(null, b.call(null, c, e)); case 3: - return n.call(this, a, b, c); + return a.call(null, b.call(null, c, e, h)); default: - var g = null; - if (3 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { - h[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); + return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = p.cljs$lang$applyTo; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = e; - c.cljs$core$IFn$_invoke$arity$2 = m; - c.cljs$core$IFn$_invoke$arity$3 = n; - c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); + c.cljs$lang$applyTo = d.cljs$lang$applyTo; + return c + }() }, d = function(a, b, c) { return function() { var d = null, e = function() { - var d; - d = c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null); - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - }, m = function(d) { - d = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - }, n = function(d, e) { - var k; - k = c.cljs$core$IFn$_invoke$arity$2 ? c.cljs$core$IFn$_invoke$arity$2(d, e) : c.call(null, d, e); - k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(k) : b.call(null, k); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(k) : a.call(null, k); - }, p = function(d, e, k) { - d = c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(d, e, k) : c.call(null, d, e, k); - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - }, q = function() { var d = function(d, e, k, l) { - d = cljs.core.apply.cljs$core$IFn$_invoke$arity$5(c, d, e, k, l); - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + return a.call(null, b.call(null, cljs.core.apply.call(null, c, d, e, k, l))) }, e = function(a, b, c, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return d.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return d.call(this, a, b, c, f) }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -9135,82 +6430,59 @@ cljs.core.comp = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a); + return d(b, c, e, a) }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e; - }(), d = function(a, b, c, d) { + return e + }(), d = function(d, k, p, q) { switch(arguments.length) { case 0: - return e.call(this); + return a.call(null, b.call(null, c.call(null))); case 1: - return m.call(this, a); + return a.call(null, b.call(null, c.call(null, d))); case 2: - return n.call(this, a, b); + return a.call(null, b.call(null, c.call(null, d, k))); case 3: - return p.call(this, a, b, c); + return a.call(null, b.call(null, c.call(null, d, k, p))); default: - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return q.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); + return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = q.cljs$lang$applyTo; - d.cljs$core$IFn$_invoke$arity$0 = e; - d.cljs$core$IFn$_invoke$arity$1 = m; - d.cljs$core$IFn$_invoke$arity$2 = n; - d.cljs$core$IFn$_invoke$arity$3 = p; - d.cljs$core$IFn$_invoke$arity$variadic = q.cljs$core$IFn$_invoke$arity$variadic; - return d; - }(); + d.cljs$lang$applyTo = e.cljs$lang$applyTo; + return d + }() }, e = function() { var a = function(a, b, c, d) { - return function(a) { - return function() { - var b = function(b) { - b = cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.first(a), b); - for (var c = cljs.core.next(a);;) { - if (c) { - b = cljs.core.first(c).call(null, b), c = cljs.core.next(c); - } else { - return b; - } - } - }, c = function(a) { - var c = null; - if (0 < arguments.length) { - for (var c = 0, d = Array(arguments.length - 0);c < d.length;) { - d[c] = arguments[c + 0], ++c; - } - c = new cljs.core.IndexedSeq(d, 0); + var e = cljs.core.reverse.call(null, cljs.core.list_STAR_.call(null, a, b, c, d)); + return function() { + var a = function(a) { + a = cljs.core.apply.call(null, cljs.core.first.call(null, e), a); + for(var b = cljs.core.next.call(null, e);;) { + if(b) { + a = cljs.core.first.call(null, b).call(null, a), b = cljs.core.next.call(null, b) + }else { + return a } - return b.call(this, c); - }; - c.cljs$lang$maxFixedArity = 0; - c.cljs$lang$applyTo = function(a) { - a = cljs.core.seq(a); - return b(a); - }; - c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(); - }(cljs.core.reverse(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d))); + } + }, b = function(b) { + var c = null; + 0 < arguments.length && (c = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, c) + }; + b.cljs$lang$maxFixedArity = 0; + b.cljs$lang$applyTo = function(b) { + b = cljs.core.seq(b); + return a(b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b + }() }, b = function(b, c, d, e) { var g = null; - if (3 < arguments.length) { - for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { - p[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(p, 0); - } - return a.call(this, b, c, d, g); + 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return a.call(this, b, c, d, g) }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -9220,10 +6492,10 @@ cljs.core.comp = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b); + return a(c, d, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, g, h, k) { switch(arguments.length) { case 0: @@ -9235,14 +6507,7 @@ cljs.core.comp = function() { case 3: return d.call(this, a, g, h); default: - var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; @@ -9250,244 +6515,87 @@ cljs.core.comp = function() { a.cljs$lang$applyTo = e.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.partial = function() { var a = null, b = function(a, b) { return function() { - var c = null, d = function() { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - }, e = function(c) { - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - }, m = function(c, d) { - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); - }, n = function(c, d, e) { - return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.call(null, b, c, d, e); - }, p = function() { - var c = function(c, d, e, h) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, b, c, d, e, cljs.core.array_seq([h], 0)); - }, d = function(a, b, d, e) { - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); - }; - d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = function(a) { - var b = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return c(b, d, e, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), c = function(a, b, c, f) { - switch(arguments.length) { - case 0: - return d.call(this); - case 1: - return e.call(this, a); - case 2: - return m.call(this, a, b); - case 3: - return n.call(this, a, b, c); - default: - var g = null; - if (3 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { - h[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); - } - throw Error("Invalid arity: " + arguments.length); + var c = function(c) { + return cljs.core.apply.call(null, a, b, c) + }, d = function(a) { + var b = null; + 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return c.call(this, b) }; - c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = p.cljs$lang$applyTo; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = e; - c.cljs$core$IFn$_invoke$arity$2 = m; - c.cljs$core$IFn$_invoke$arity$3 = n; - c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); + d.cljs$lang$maxFixedArity = 0; + d.cljs$lang$applyTo = function(a) { + a = cljs.core.seq(a); + return c(a) + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d + }() }, c = function(a, b, c) { return function() { - var d = null, e = function() { - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - }, m = function(d) { - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); - }, n = function(d, e) { - return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.call(null, b, c, d, e); - }, p = function(d, e, k) { - return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(b, c, d, e, k) : a.call(null, b, c, d, e, k); - }, q = function() { - var d = function(d, e, k, l) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, b, c, d, e, cljs.core.array_seq([k, l], 0)); - }, e = function(a, b, c, e) { - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return d.call(this, a, b, c, f); - }; - e.cljs$lang$maxFixedArity = 3; - e.cljs$lang$applyTo = function(a) { - var b = cljs.core.first(a); - a = cljs.core.next(a); - var c = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return d(b, c, e, a); - }; - e.cljs$core$IFn$_invoke$arity$variadic = d; - return e; - }(), d = function(a, b, c, d) { - switch(arguments.length) { - case 0: - return e.call(this); - case 1: - return m.call(this, a); - case 2: - return n.call(this, a, b); - case 3: - return p.call(this, a, b, c); - default: - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return q.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); - } - throw Error("Invalid arity: " + arguments.length); + var d = function(d) { + return cljs.core.apply.call(null, a, b, c, d) + }, e = function(a) { + var b = null; + 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return d.call(this, b) }; - d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = q.cljs$lang$applyTo; - d.cljs$core$IFn$_invoke$arity$0 = e; - d.cljs$core$IFn$_invoke$arity$1 = m; - d.cljs$core$IFn$_invoke$arity$2 = n; - d.cljs$core$IFn$_invoke$arity$3 = p; - d.cljs$core$IFn$_invoke$arity$variadic = q.cljs$core$IFn$_invoke$arity$variadic; - return d; - }(); + e.cljs$lang$maxFixedArity = 0; + e.cljs$lang$applyTo = function(a) { + a = cljs.core.seq(a); + return d(a) + }; + e.cljs$core$IFn$_invoke$arity$variadic = d; + return e + }() }, d = function(a, b, c, d) { return function() { - var e = null, m = function() { - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); - }, n = function(e) { - return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.call(null, b, c, d, e); - }, p = function(e, l) { - return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(b, c, d, e, l) : a.call(null, b, c, d, e, l); - }, q = function(e, l, m) { - return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(b, c, d, e, l, m) : a.call(null, b, c, d, e, l, m); - }, r = function() { - var e = function(e, l, m, q) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, b, c, d, e, cljs.core.array_seq([l, m, q], 0)); - }, l = function(a, b, c, d) { - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return e.call(this, a, b, c, f); - }; - l.cljs$lang$maxFixedArity = 3; - l.cljs$lang$applyTo = function(a) { - var b = cljs.core.first(a); - a = cljs.core.next(a); - var c = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.rest(a); - return e(b, c, d, a); - }; - l.cljs$core$IFn$_invoke$arity$variadic = e; - return l; - }(), e = function(a, b, c, d) { - switch(arguments.length) { - case 0: - return m.call(this); - case 1: - return n.call(this, a); - case 2: - return p.call(this, a, b); - case 3: - return q.call(this, a, b, c); - default: - var e = null; - if (3 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { - f[e] = arguments[e + 3], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return r.cljs$core$IFn$_invoke$arity$variadic(a, b, c, e); - } - throw Error("Invalid arity: " + arguments.length); + var e = function(e) { + return cljs.core.apply.call(null, a, b, c, d, e) + }, m = function(a) { + var b = null; + 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return e.call(this, b) }; - e.cljs$lang$maxFixedArity = 3; - e.cljs$lang$applyTo = r.cljs$lang$applyTo; - e.cljs$core$IFn$_invoke$arity$0 = m; - e.cljs$core$IFn$_invoke$arity$1 = n; - e.cljs$core$IFn$_invoke$arity$2 = p; - e.cljs$core$IFn$_invoke$arity$3 = q; - e.cljs$core$IFn$_invoke$arity$variadic = r.cljs$core$IFn$_invoke$arity$variadic; - return e; - }(); + m.cljs$lang$maxFixedArity = 0; + m.cljs$lang$applyTo = function(a) { + a = cljs.core.seq(a); + return e(a) + }; + m.cljs$core$IFn$_invoke$arity$variadic = e; + return m + }() }, e = function() { var a = function(a, b, c, d, e) { return function() { var f = function(f) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, b, c, d, cljs.core.concat.cljs$core$IFn$_invoke$arity$2(e, f)); + return cljs.core.apply.call(null, a, b, c, d, cljs.core.concat.call(null, e, f)) }, g = function(a) { var b = null; - if (0 < arguments.length) { - for (var b = 0, c = Array(arguments.length - 0);b < c.length;) { - c[b] = arguments[b + 0], ++b; - } - b = new cljs.core.IndexedSeq(c, 0); - } - return f.call(this, b); + 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return f.call(this, b) }; g.cljs$lang$maxFixedArity = 0; g.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return f(a); + return f(a) }; g.cljs$core$IFn$_invoke$arity$variadic = f; - return g; - }(); + return g + }() }, b = function(b, c, d, e, g) { var p = null; - if (4 < arguments.length) { - for (var p = 0, q = Array(arguments.length - 4);p < q.length;) { - q[p] = arguments[p + 4], ++p; - } - p = new cljs.core.IndexedSeq(q, 0); - } - return a.call(this, b, c, d, e, p); + 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); + return a.call(this, b, c, d, e, p) }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -9499,10 +6607,10 @@ cljs.core.partial = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, g, b); + return a(c, d, e, g, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 1: @@ -9514,52 +6622,31 @@ cljs.core.partial = function() { case 4: return d.call(this, a, g, h, k); default: - var m = null; - if (4 < arguments.length) { - for (var m = 0, n = Array(arguments.length - 4);m < n.length;) { - n[m] = arguments[m + 4], ++m; - } - m = new cljs.core.IndexedSeq(n, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, m); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 4; a.cljs$lang$applyTo = e.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a; + return a }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.fnil = function() { var a = null, b = function(a, b) { return function() { - var c = null, d = function(c) { - c = null == c ? b : c; - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }, k = function(c, d) { - var g = null == c ? b : c; - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(g, d) : a.call(null, g, d); - }, l = function(c, d, g) { - c = null == c ? b : c; - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, g) : a.call(null, c, d, g); - }, m = function() { + var c = null, d = function() { var c = function(c, d, g, h) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, null == c ? b : c, d, g, h); + return cljs.core.apply.call(null, a, null == c ? b : c, d, g, h) }, d = function(a, b, d, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return c.call(this, a, b, d, f) }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -9569,59 +6656,36 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a); + return c(b, d, e, a) }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), c = function(a, b, c, e) { + return d + }(), c = function(c, g, m, n) { switch(arguments.length) { case 1: - return d.call(this, a); + return a.call(null, null == c ? b : c); case 2: - return k.call(this, a, b); + return a.call(null, null == c ? b : c, g); case 3: - return l.call(this, a, b, c); + return a.call(null, null == c ? b : c, g, m); default: - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); + return d.cljs$core$IFn$_invoke$arity$variadic(c, g, m, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = m.cljs$lang$applyTo; - c.cljs$core$IFn$_invoke$arity$1 = d; - c.cljs$core$IFn$_invoke$arity$2 = k; - c.cljs$core$IFn$_invoke$arity$3 = l; - c.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); + c.cljs$lang$applyTo = d.cljs$lang$applyTo; + return c + }() }, c = function(a, b, c) { return function() { - var d = null, k = function(d, h) { - var k = null == d ? b : d, l = null == h ? c : h; - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, l) : a.call(null, k, l); - }, l = function(d, h, k) { - d = null == d ? b : d; - h = null == h ? c : h; - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(d, h, k) : a.call(null, d, h, k); - }, m = function() { + var d = null, k = function() { var d = function(d, h, k, l) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, null == d ? b : d, null == h ? c : h, k, l); + return cljs.core.apply.call(null, a, null == d ? b : d, null == h ? c : h, k, l) }, h = function(a, b, c, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return d.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return d.call(this, a, b, c, f) }; h.cljs$lang$maxFixedArity = 3; h.cljs$lang$applyTo = function(a) { @@ -9631,57 +6695,34 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a); + return d(b, c, e, a) }; h.cljs$core$IFn$_invoke$arity$variadic = d; - return h; - }(), d = function(a, b, c, d) { + return h + }(), d = function(d, h, n, p) { switch(arguments.length) { case 2: - return k.call(this, a, b); + return a.call(null, null == d ? b : d, null == h ? c : h); case 3: - return l.call(this, a, b, c); + return a.call(null, null == d ? b : d, null == h ? c : h, n); default: - var e = null; - if (3 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { - f[e] = arguments[e + 3], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, c, e); + return k.cljs$core$IFn$_invoke$arity$variadic(d, h, n, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = m.cljs$lang$applyTo; - d.cljs$core$IFn$_invoke$arity$2 = k; - d.cljs$core$IFn$_invoke$arity$3 = l; - d.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return d; - }(); + d.cljs$lang$applyTo = k.cljs$lang$applyTo; + return d + }() }, d = function(a, b, c, d) { return function() { - var k = null, l = function(d, h) { - var k = null == d ? b : d, l = null == h ? c : h; - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, l) : a.call(null, k, l); - }, m = function(k, l, m) { - k = null == k ? b : k; - l = null == l ? c : l; - m = null == m ? d : m; - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(k, l, m) : a.call(null, k, l, m); - }, n = function() { - var k = function(k, l, m, q) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, null == k ? b : k, null == l ? c : l, null == m ? d : m, q); + var k = null, l = function() { + var k = function(k, l, m, n) { + return cljs.core.apply.call(null, a, null == k ? b : k, null == l ? c : l, null == m ? d : m, n) }, l = function(a, b, c, d) { var e = null; - if (3 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { - f[e] = arguments[e + 3], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return k.call(this, a, b, c, e); + 3 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return k.call(this, a, b, c, e) }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -9691,35 +6732,25 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return k(b, c, d, a); + return k(b, c, d, a) }; l.cljs$core$IFn$_invoke$arity$variadic = k; - return l; - }(), k = function(a, b, c, d) { + return l + }(), k = function(k, n, p, q) { switch(arguments.length) { case 2: - return l.call(this, a, b); + return a.call(null, null == k ? b : k, null == n ? c : n); case 3: - return m.call(this, a, b, c); + return a.call(null, null == k ? b : k, null == n ? c : n, null == p ? d : p); default: - var e = null; - if (3 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 3);e < f.length;) { - f[e] = arguments[e + 3], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, e); + return l.cljs$core$IFn$_invoke$arity$variadic(k, n, p, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; k.cljs$lang$maxFixedArity = 3; - k.cljs$lang$applyTo = n.cljs$lang$applyTo; - k.cljs$core$IFn$_invoke$arity$2 = l; - k.cljs$core$IFn$_invoke$arity$3 = m; - k.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return k; - }(); + k.cljs$lang$applyTo = l.cljs$lang$applyTo; + return k + }() }, a = function(a, f, g, h) { switch(arguments.length) { case 2: @@ -9727,485 +6758,104 @@ cljs.core.fnil = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h); + return d.call(this, a, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a; -}(); -cljs.core.map_indexed = function() { - var a = null, b = function(a) { - return function(b) { - return function(c) { - return function() { - var g = null, h = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(g, h) { - var k; - k = cljs.core._vreset_BANG_(c, cljs.core._deref(c) + 1); - k = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, h) : a.call(null, k, h); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, k) : b.call(null, g, k); - }, g = function(a, b) { - switch(arguments.length) { - case 0: - return h.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - g.cljs$core$IFn$_invoke$arity$0 = h; - g.cljs$core$IFn$_invoke$arity$1 = k; - g.cljs$core$IFn$_invoke$arity$2 = l; - return g; - }(); - }(cljs.core.volatile_BANG_.cljs$core$IFn$_invoke$arity$1 ? cljs.core.volatile_BANG_.cljs$core$IFn$_invoke$arity$1(-1) : cljs.core.volatile_BANG_.call(null, -1)); - }; - }, c = function(a, b) { - return function g(b, c) { - return new cljs.core.LazySeq(null, function() { - var e = cljs.core.seq(c); - if (e) { - if (cljs.core.chunked_seq_QMARK_(e)) { - for (var m = cljs.core.chunk_first(e), n = cljs.core.count(m), p = cljs.core.chunk_buffer(n), q = 0;;) { - if (q < n) { - cljs.core.chunk_append(p, function() { - var c = b + q, e = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(m, q); - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, e) : a.call(null, c, e); - }()), q += 1; - } else { - break; - } - } - return cljs.core.chunk_cons(cljs.core.chunk(p), g(b + n, cljs.core.chunk_rest(e))); - } - return cljs.core.cons(function() { - var c = cljs.core.first(e); - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - }(), g(b + 1, cljs.core.rest(e))); - } - return null; - }, null, null); - }(0, b); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); -cljs.core.keep = function() { - var a = null, b = function(a) { - return function(b) { - return function() { - var c = null, g = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, h = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, k = function(c, f) { - var g; - g = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f); - return null == g ? c : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, g) : b.call(null, c, g); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return g.call(this); - case 1: - return h.call(this, a); - case 2: - return k.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = g; - c.cljs$core$IFn$_invoke$arity$1 = h; - c.cljs$core$IFn$_invoke$arity$2 = k; - return c; - }(); - }; - }, c = function(b, c) { +cljs.core.map_indexed = function(a, b) { + return function d(b, f) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c); - if (f) { - if (cljs.core.chunked_seq_QMARK_(f)) { - for (var g = cljs.core.chunk_first(f), h = cljs.core.count(g), k = cljs.core.chunk_buffer(h), l = 0;;) { - if (l < h) { - var m = function() { - var a = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(g, l); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }(); - null != m && cljs.core.chunk_append(k, m); - l += 1; - } else { - break; + var g = cljs.core.seq.call(null, f); + if(g) { + if(cljs.core.chunked_seq_QMARK_.call(null, g)) { + for(var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { + if(m < k) { + cljs.core.chunk_append.call(null, l, a.call(null, b + m, cljs.core._nth.call(null, h, m))), m += 1 + }else { + break } } - return cljs.core.chunk_cons(cljs.core.chunk(k), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.chunk_rest(f))); + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))) } - h = function() { - var a = cljs.core.first(f); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }(); - return null == h ? a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(f)) : cljs.core.cons(h, a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(f))); - } - return null; - }, null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.Atom = function(a, b, c, d) { - this.state = a; - this.meta = b; - this.validator = c; - this.watches = d; - this.cljs$lang$protocol_mask$partition0$ = 6455296; - this.cljs$lang$protocol_mask$partition1$ = 16386; -}; -cljs.core.Atom.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.getUid(this); -}; -cljs.core.Atom.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = function(a, b, c) { - for (var d = cljs.core.seq(this.watches), e = null, f = 0, g = 0;;) { - if (g < f) { - a = e.cljs$core$IIndexed$_nth$arity$2(null, g); - var h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null); - a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 1, null); - var k = b, l = c; - a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(h, this, k, l) : a.call(null, h, this, k, l); - g += 1; - } else { - if (a = cljs.core.seq(d)) { - d = a, cljs.core.chunked_seq_QMARK_(d) ? (e = cljs.core.chunk_first(d), d = cljs.core.chunk_rest(d), a = e, f = cljs.core.count(e), e = a) : (a = cljs.core.first(d), h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 1, null), e = h, f = b, g = c, a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(e, this, f, g) : a.call(null, e, this, f, g), d = cljs.core.next(d), e = null, f = 0), g = 0; - } else { - return null; + return cljs.core.cons.call(null, a.call(null, b, cljs.core.first.call(null, g)), d.call(null, b + 1, cljs.core.rest.call(null, g))) } - } - } -}; -cljs.core.Atom.prototype.cljs$core$IWatchable$_add_watch$arity$3 = function(a, b, c) { - this.watches = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.watches, b, c); - return this; -}; -cljs.core.Atom.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = function(a, b) { - return this.watches = cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(this.watches, b); -}; -cljs.core.Atom.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.Atom.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.state; -}; -cljs.core.Atom.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return this === b; -}; -cljs.core.Atom.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.Atom.cljs$lang$type = !0; -cljs.core.Atom.cljs$lang$ctorStr = "cljs.core/Atom"; -cljs.core.Atom.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Atom"); -}; -cljs.core.__GT_Atom = function(a, b, c, d) { - return new cljs.core.Atom(a, b, c, d); + return null + }, null, null) + }.call(null, 0, b) }; -cljs.core.atom = function() { - var a = null, b = function(a) { - return new cljs.core.Atom(a, null, null, null); - }, c = function() { - var a = function(a, b) { - var c = cljs.core.seq_QMARK_(b) ? cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map, b) : b, d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "validator", "validator", -1966190681)), c = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "meta", "meta", 1499536964)); - return new cljs.core.Atom(a, c, d, null); - }, b = function(b, c) { - var e = null; - if (1 < arguments.length) { - for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { - k[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, e); - }; - b.cljs$lang$maxFixedArity = 1; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - default: - var f = null; - if (1 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { - g[f] = arguments[f + 1], ++f; +cljs.core.keep = function keep(b, c) { + return new cljs.core.LazySeq(null, function() { + var d = cljs.core.seq.call(null, c); + if(d) { + if(cljs.core.chunked_seq_QMARK_.call(null, d)) { + for(var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { + if(h < f) { + var k = b.call(null, cljs.core._nth.call(null, e, h)); + null != k && cljs.core.chunk_append.call(null, g, k); + h += 1 + }else { + break } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, f); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 1; - a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.reset_BANG_ = function(a, b) { - if (a instanceof cljs.core.Atom) { - var c = a.validator; - if (null != c && !cljs.core.truth_(c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(b) : c.call(null, b))) { - throw Error([cljs.core.str("Assert failed: "), cljs.core.str("Validator rejected reference state"), cljs.core.str("\n"), cljs.core.str(function() { - var a = cljs.core.list(new cljs.core.Symbol(null, "validate", "validate", 1439230700, null), new cljs.core.Symbol(null, "new-value", "new-value", -1567397401, null)); - return cljs.core.pr_str.cljs$core$IFn$_invoke$arity$1 ? cljs.core.pr_str.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.pr_str.call(null, a); - }())].join("")); - } - c = a.state; - a.state = b; - null != a.watches && cljs.core._notify_watches(a, c, b); - return b; - } - return cljs.core._reset_BANG_(a, b); -}; -cljs.core.swap_BANG_ = function() { - var a = null, b = function(a, b) { - return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, function() { - var c = a.state; - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - }()) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$2(a, b); - }, c = function(a, b, c) { - return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, function() { - var d = a.state; - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, c) : b.call(null, d, c); - }()) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$3(a, b, c); - }, d = function(a, b, c, d) { - return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, function() { - var e = a.state; - return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(e, c, d) : b.call(null, e, c, d); - }()) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$4(a, b, c, d); - }, e = function() { - var a = function(a, b, c, d, e) { - return a instanceof cljs.core.Atom ? cljs.core.reset_BANG_(a, cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, a.state, c, d, e)) : cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e); - }, b = function(b, c, d, e, g) { - var p = null; - if (4 < arguments.length) { - for (var p = 0, q = Array(arguments.length - 4);p < q.length;) { - q[p] = arguments[p + 4], ++p; } - p = new cljs.core.IndexedSeq(q, 0); + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), keep.call(null, b, cljs.core.chunk_rest.call(null, d))) } - return a.call(this, b, c, d, e, p); - }; - b.cljs$lang$maxFixedArity = 4; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.next(b); - var g = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, d, e, g, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, g, h, k, l) { - switch(arguments.length) { - case 2: - return b.call(this, a, g); - case 3: - return c.call(this, a, g, h); - case 4: - return d.call(this, a, g, h, k); - default: - var m = null; - if (4 < arguments.length) { - for (var m = 0, n = Array(arguments.length - 4);m < n.length;) { - n[m] = arguments[m + 4], ++m; - } - m = new cljs.core.IndexedSeq(n, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, m); + e = b.call(null, cljs.core.first.call(null, d)); + return null == e ? keep.call(null, b, cljs.core.rest.call(null, d)) : cljs.core.cons.call(null, e, keep.call(null, b, cljs.core.rest.call(null, d))) } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 4; - a.cljs$lang$applyTo = e.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - a.cljs$core$IFn$_invoke$arity$4 = d; - a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.compare_and_set_BANG_ = function(a, b, c) { - return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a.cljs$core$IDeref$_deref$arity$1(null), b) ? (cljs.core.reset_BANG_(a, c), !0) : !1; -}; -cljs.core.set_validator_BANG_ = function(a, b) { - return a.validator = b; -}; -cljs.core.get_validator = function(a) { - return a.validator; -}; -cljs.core.Volatile = function(a) { - this.state = a; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32768; -}; -cljs.core.Volatile.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.state; -}; -cljs.core.Volatile.prototype.cljs$core$IVolatile$ = !0; -cljs.core.Volatile.prototype.cljs$core$IVolatile$_vreset_BANG_$arity$2 = function(a, b) { - return this.state = b; + return null + }, null, null) }; -cljs.core.Volatile.cljs$lang$type = !0; -cljs.core.Volatile.cljs$lang$ctorStr = "cljs.core/Volatile"; -cljs.core.Volatile.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Volatile"); -}; -cljs.core.__GT_Volatile = function(a) { - return new cljs.core.Volatile(a); -}; -cljs.core.volatile_BANG_ = function(a) { - return new cljs.core.Volatile(a); -}; -cljs.core.volatile_QMARK_ = function(a) { - return a instanceof cljs.core.Volatile; -}; -cljs.core.vreset_BANG_ = function(a, b) { - return cljs.core._vreset_BANG_(a, b); -}; -cljs.core.keep_indexed = function() { - var a = null, b = function(a) { - return function(b) { - return function(c) { - return function() { - var g = null, h = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(g, h) { - var k; - k = c.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, c.cljs$core$IDeref$_deref$arity$1(null) + 1); - k = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(k, h) : a.call(null, k, h); - return null == k ? g : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, k) : b.call(null, g, k); - }, g = function(a, b) { - switch(arguments.length) { - case 0: - return h.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - g.cljs$core$IFn$_invoke$arity$0 = h; - g.cljs$core$IFn$_invoke$arity$1 = k; - g.cljs$core$IFn$_invoke$arity$2 = l; - return g; - }(); - }(cljs.core.volatile_BANG_(-1)); - }; - }, c = function(a, b) { - return function g(b, c) { - return new cljs.core.LazySeq(null, function() { - var e = cljs.core.seq(c); - if (e) { - if (cljs.core.chunked_seq_QMARK_(e)) { - for (var m = cljs.core.chunk_first(e), n = cljs.core.count(m), p = cljs.core.chunk_buffer(n), q = 0;;) { - if (q < n) { - var r = function() { - var c = b + q, e = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(m, q); - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, e) : a.call(null, c, e); - }(); - null != r && cljs.core.chunk_append(p, r); - q += 1; - } else { - break; - } +cljs.core.keep_indexed = function(a, b) { + return function d(b, f) { + return new cljs.core.LazySeq(null, function() { + var g = cljs.core.seq.call(null, f); + if(g) { + if(cljs.core.chunked_seq_QMARK_.call(null, g)) { + for(var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { + if(m < k) { + var n = a.call(null, b + m, cljs.core._nth.call(null, h, m)); + null != n && cljs.core.chunk_append.call(null, l, n); + m += 1 + }else { + break } - return cljs.core.chunk_cons(cljs.core.chunk(p), g(b + n, cljs.core.chunk_rest(e))); } - n = function() { - var c = cljs.core.first(e); - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - }(); - return null == n ? g(b + 1, cljs.core.rest(e)) : cljs.core.cons(n, g(b + 1, cljs.core.rest(e))); + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))) } - return null; - }, null, null); - }(0, b); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); + h = a.call(null, b, cljs.core.first.call(null, g)); + return null == h ? d.call(null, b + 1, cljs.core.rest.call(null, g)) : cljs.core.cons.call(null, h, d.call(null, b + 1, cljs.core.rest.call(null, g))) + } + return null + }, null, null) + }.call(null, 0, b) +}; cljs.core.every_pred = function() { var a = null, b = function(a) { return function() { var b = null, c = function(b) { - return cljs.core.boolean$(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)); + return cljs.core.boolean$.call(null, a.call(null, b)) }, d = function(b, c) { - return cljs.core.boolean$(function() { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return cljs.core.truth_(d) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) : d; - }()); + return cljs.core.boolean$.call(null, function() { + var d = a.call(null, b); + return cljs.core.truth_(d) ? a.call(null, c) : d + }()) }, e = function(b, c, d) { - return cljs.core.boolean$(function() { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return cljs.core.truth_(e) ? (e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), cljs.core.truth_(e) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d) : e) : e; - }()); + return cljs.core.boolean$.call(null, function() { + var e = a.call(null, b); + return cljs.core.truth_(e) ? (e = a.call(null, c), cljs.core.truth_(e) ? a.call(null, d) : e) : e + }()) }, m = function() { var c = function(c, d, e, h) { - return cljs.core.boolean$(b.cljs$core$IFn$_invoke$arity$3(c, d, e) && cljs.core.every_QMARK_(a, h)); + return cljs.core.boolean$.call(null, b.call(null, c, d, e) && cljs.core.every_QMARK_.call(null, a, h)) }, d = function(a, b, d, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return c.call(this, a, b, d, f) }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -10215,10 +6865,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a); + return c(b, d, e, a) }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; + return d }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: @@ -10230,63 +6880,48 @@ cljs.core.every_pred = function() { case 3: return e.call(this, a, b, f); default: - var s = null; - if (3 < arguments.length) { - for (var s = 0, t = Array(arguments.length - 3);s < t.length;) { - t[s] = arguments[s + 3], ++s; - } - s = new cljs.core.IndexedSeq(t, 0); - } - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, s); + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = m.cljs$lang$applyTo; b.cljs$core$IFn$_invoke$arity$0 = function() { - return!0; + return!0 }; b.cljs$core$IFn$_invoke$arity$1 = c; b.cljs$core$IFn$_invoke$arity$2 = d; b.cljs$core$IFn$_invoke$arity$3 = e; b.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); + return b + }() }, c = function(a, b) { return function() { var c = null, d = function(c) { - return cljs.core.boolean$(function() { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(d) ? b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c) : d; - }()); + return cljs.core.boolean$.call(null, function() { + var d = a.call(null, c); + return cljs.core.truth_(d) ? b.call(null, c) : d + }()) }, e = function(c, d) { - return cljs.core.boolean$(function() { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(e) && (e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d), cljs.core.truth_(e)) ? (e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c), cljs.core.truth_(e) ? b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d) : e) : e; - }()); + return cljs.core.boolean$.call(null, function() { + var e = a.call(null, c); + return cljs.core.truth_(e) && (e = a.call(null, d), cljs.core.truth_(e)) ? (e = b.call(null, c), cljs.core.truth_(e) ? b.call(null, d) : e) : e + }()) }, m = function(c, d, e) { - return cljs.core.boolean$(function() { - var h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(h) && (h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d), cljs.core.truth_(h) && (h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e), cljs.core.truth_(h) && (h = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c), cljs.core.truth_(h)))) ? (h = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(h) ? - b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e) : h) : h; - }()); + return cljs.core.boolean$.call(null, function() { + var h = a.call(null, c); + return cljs.core.truth_(h) && (h = a.call(null, d), cljs.core.truth_(h) && (h = a.call(null, e), cljs.core.truth_(h) && (h = b.call(null, c), cljs.core.truth_(h)))) ? (h = b.call(null, d), cljs.core.truth_(h) ? b.call(null, e) : h) : h + }()) }, n = function() { var d = function(d, e, k, l) { - return cljs.core.boolean$(c.cljs$core$IFn$_invoke$arity$3(d, e, k) && cljs.core.every_QMARK_(function(c) { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(d) ? b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c) : d; - }, l)); + return cljs.core.boolean$.call(null, c.call(null, d, e, k) && cljs.core.every_QMARK_.call(null, function(c) { + var d = a.call(null, c); + return cljs.core.truth_(d) ? b.call(null, c) : d + }, l)) }, e = function(a, b, c, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return d.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return d.call(this, a, b, c, f) }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -10296,10 +6931,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a); + return d(b, c, e, a) }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e; + return e }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: @@ -10311,62 +6946,48 @@ cljs.core.every_pred = function() { case 3: return m.call(this, a, b, c); default: - var g = null; - if (3 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { - h[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = n.cljs$lang$applyTo; c.cljs$core$IFn$_invoke$arity$0 = function() { - return!0; + return!0 }; c.cljs$core$IFn$_invoke$arity$1 = d; c.cljs$core$IFn$_invoke$arity$2 = e; c.cljs$core$IFn$_invoke$arity$3 = m; c.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); + return c + }() }, d = function(a, b, c) { return function() { var d = null, e = function(d) { - return cljs.core.boolean$(function() { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - return cljs.core.truth_(e) ? (e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(e) ? c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d) : e) : e; - }()); + return cljs.core.boolean$.call(null, function() { + var e = a.call(null, d); + return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e + }()) }, m = function(d, e) { - return cljs.core.boolean$(function() { - var k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - return cljs.core.truth_(k) && (k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(k) && (k = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d), cljs.core.truth_(k) && (k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e), cljs.core.truth_(k)))) ? (k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e), cljs.core.truth_(k) ? - c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e) : k) : k; - }()); + return cljs.core.boolean$.call(null, function() { + var k = a.call(null, d); + return cljs.core.truth_(k) && (k = b.call(null, d), cljs.core.truth_(k) && (k = c.call(null, d), cljs.core.truth_(k) && (k = a.call(null, e), cljs.core.truth_(k)))) ? (k = b.call(null, e), cljs.core.truth_(k) ? c.call(null, e) : k) : k + }()) }, n = function(d, e, k) { - return cljs.core.boolean$(function() { - var l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - return cljs.core.truth_(l) && (l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(l) && (l = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d), cljs.core.truth_(l) && (l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e), cljs.core.truth_(l) && (l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e), cljs.core.truth_(l) && - (l = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e), cljs.core.truth_(l) && (l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(k) : a.call(null, k), cljs.core.truth_(l))))))) ? (l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(k) : b.call(null, k), cljs.core.truth_(l) ? c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(k) : c.call(null, k) : l) : l; - }()); + return cljs.core.boolean$.call(null, function() { + var l = a.call(null, d); + return cljs.core.truth_(l) && (l = b.call(null, d), cljs.core.truth_(l) && (l = c.call(null, d), cljs.core.truth_(l) && (l = a.call(null, e), cljs.core.truth_(l) && (l = b.call(null, e), cljs.core.truth_(l) && (l = c.call(null, e), cljs.core.truth_(l) && (l = a.call(null, k), cljs.core.truth_(l))))))) ? (l = b.call(null, k), cljs.core.truth_(l) ? c.call(null, k) : l) : l + }()) }, p = function() { var e = function(e, l, m, n) { - return cljs.core.boolean$(d.cljs$core$IFn$_invoke$arity$3(e, l, m) && cljs.core.every_QMARK_(function(d) { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - return cljs.core.truth_(e) ? (e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), cljs.core.truth_(e) ? c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d) : e) : e; - }, n)); + return cljs.core.boolean$.call(null, d.call(null, e, l, m) && cljs.core.every_QMARK_.call(null, function(d) { + var e = a.call(null, d); + return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e + }, n)) }, l = function(a, b, c, d) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return e.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return e.call(this, a, b, c, f) }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -10376,10 +6997,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return e(b, c, d, a); + return e(b, c, d, a) }; l.cljs$core$IFn$_invoke$arity$variadic = e; - return l; + return l }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: @@ -10391,125 +7012,91 @@ cljs.core.every_pred = function() { case 3: return n.call(this, a, b, c); default: - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = p.cljs$lang$applyTo; d.cljs$core$IFn$_invoke$arity$0 = function() { - return!0; + return!0 }; d.cljs$core$IFn$_invoke$arity$1 = e; d.cljs$core$IFn$_invoke$arity$2 = m; d.cljs$core$IFn$_invoke$arity$3 = n; d.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return d; - }(); + return d + }() }, e = function() { var a = function(a, b, c, d) { - return function(a) { - return function() { - var b = null, c = function(b) { - return cljs.core.every_QMARK_(function(a) { - return function(a) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - }; - }(a), a); - }, d = function(b, c) { - return cljs.core.every_QMARK_(function(a) { - return function(a) { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return cljs.core.truth_(d) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) : d; - }; - }(a), a); - }, e = function(b, c, d) { - return cljs.core.every_QMARK_(function(a) { - return function(a) { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return cljs.core.truth_(e) ? (e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), cljs.core.truth_(e) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d) : e) : e; - }; - }(a), a); - }, f = function() { - var c = function(c, d, e, f) { - return cljs.core.boolean$(b.cljs$core$IFn$_invoke$arity$3(c, d, e) && cljs.core.every_QMARK_(function(a) { - return function(a) { - return cljs.core.every_QMARK_(a, f); - }; - }(a), a)); - }, d = function(a, b, d, e) { - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); - }; - d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = function(a) { - var b = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return c(b, d, e, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), b = function(a, b, g, h) { - switch(arguments.length) { - case 0: - return!0; - case 1: - return c.call(this, a); - case 2: - return d.call(this, a, b); - case 3: - return e.call(this, a, b, g); - default: - var k = null; - if (3 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 3);k < l.length;) { - l[k] = arguments[k + 3], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, b, g, k); - } - throw Error("Invalid arity: " + arguments.length); + var e = cljs.core.list_STAR_.call(null, a, b, c, d); + return function() { + var a = null, b = function(a) { + return cljs.core.every_QMARK_.call(null, function(b) { + return b.call(null, a) + }, e) + }, c = function(a, b) { + return cljs.core.every_QMARK_.call(null, function(c) { + var d = c.call(null, a); + return cljs.core.truth_(d) ? c.call(null, b) : d + }, e) + }, d = function(a, b, c) { + return cljs.core.every_QMARK_.call(null, function(d) { + var e = d.call(null, a); + return cljs.core.truth_(e) ? (e = d.call(null, b), cljs.core.truth_(e) ? d.call(null, c) : e) : e + }, e) + }, f = function() { + var b = function(b, c, d, f) { + return cljs.core.boolean$.call(null, a.call(null, b, c, d) && cljs.core.every_QMARK_.call(null, function(a) { + return cljs.core.every_QMARK_.call(null, a, f) + }, e)) + }, c = function(a, c, d, e) { + var f = null; + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, c, d, f) }; - b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = f.cljs$lang$applyTo; - b.cljs$core$IFn$_invoke$arity$0 = function() { - return!0; + c.cljs$lang$maxFixedArity = 3; + c.cljs$lang$applyTo = function(a) { + var c = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return b(c, d, e, a) }; - b.cljs$core$IFn$_invoke$arity$1 = c; - b.cljs$core$IFn$_invoke$arity$2 = d; - b.cljs$core$IFn$_invoke$arity$3 = e; - b.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); - }(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); + c.cljs$core$IFn$_invoke$arity$variadic = b; + return c + }(), a = function(a, e, g, h) { + switch(arguments.length) { + case 0: + return!0; + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + case 3: + return d.call(this, a, e, g); + default: + return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)) + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 3; + a.cljs$lang$applyTo = f.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$0 = function() { + return!0 + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$3 = d; + a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return a + }() }, b = function(b, c, d, e) { var g = null; - if (3 < arguments.length) { - for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { - p[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(p, 0); - } - return a.call(this, b, c, d, g); + 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return a.call(this, b, c, d, g) }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -10519,10 +7106,10 @@ cljs.core.every_pred = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b); + return a(c, d, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -10532,14 +7119,7 @@ cljs.core.every_pred = function() { case 3: return d.call(this, a, g, h); default: - var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; @@ -10549,37 +7129,31 @@ cljs.core.every_pred = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.some_fn = function() { var a = null, b = function(a) { return function() { var b = null, c = function(b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); + return a.call(null, b) }, d = function(b, c) { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return cljs.core.truth_(d) ? d : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); + var d = a.call(null, b); + return cljs.core.truth_(d) ? d : a.call(null, c) }, e = function(b, c, d) { - b = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - if (cljs.core.truth_(b)) { - return b; + b = a.call(null, b); + if(cljs.core.truth_(b)) { + return b } - c = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(c) ? c : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); + c = a.call(null, c); + return cljs.core.truth_(c) ? c : a.call(null, d) }, m = function() { var c = function(c, d, e, h) { - c = b.cljs$core$IFn$_invoke$arity$3(c, d, e); - return cljs.core.truth_(c) ? c : cljs.core.some(a, h); + c = b.call(null, c, d, e); + return cljs.core.truth_(c) ? c : cljs.core.some.call(null, a, h) }, d = function(a, b, d, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return c.call(this, a, b, d, f) }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -10589,10 +7163,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a); + return c(b, d, e, a) }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; + return d }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: @@ -10604,83 +7178,67 @@ cljs.core.some_fn = function() { case 3: return e.call(this, a, b, f); default: - var s = null; - if (3 < arguments.length) { - for (var s = 0, t = Array(arguments.length - 3);s < t.length;) { - t[s] = arguments[s + 3], ++s; - } - s = new cljs.core.IndexedSeq(t, 0); - } - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, s); + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = m.cljs$lang$applyTo; b.cljs$core$IFn$_invoke$arity$0 = function() { - return null; + return null }; b.cljs$core$IFn$_invoke$arity$1 = c; b.cljs$core$IFn$_invoke$arity$2 = d; b.cljs$core$IFn$_invoke$arity$3 = e; b.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); + return b + }() }, c = function(a, b) { return function() { var c = null, d = function(c) { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(d) ? d : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); + var d = a.call(null, c); + return cljs.core.truth_(d) ? d : b.call(null, c) }, e = function(c, d) { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - if (cljs.core.truth_(e)) { - return e; + var e = a.call(null, c); + if(cljs.core.truth_(e)) { + return e } - e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - if (cljs.core.truth_(e)) { - return e; + e = a.call(null, d); + if(cljs.core.truth_(e)) { + return e } - e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - return cljs.core.truth_(e) ? e : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); + e = b.call(null, c); + return cljs.core.truth_(e) ? e : b.call(null, d) }, m = function(c, d, e) { - var h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - if (cljs.core.truth_(h)) { - return h; + var h = a.call(null, c); + if(cljs.core.truth_(h)) { + return h } - h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - if (cljs.core.truth_(h)) { - return h; + h = a.call(null, d); + if(cljs.core.truth_(h)) { + return h } - h = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); - if (cljs.core.truth_(h)) { - return h; + h = a.call(null, e); + if(cljs.core.truth_(h)) { + return h } - c = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - if (cljs.core.truth_(c)) { - return c; + c = b.call(null, c); + if(cljs.core.truth_(c)) { + return c } - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return cljs.core.truth_(d) ? d : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e); + d = b.call(null, d); + return cljs.core.truth_(d) ? d : b.call(null, e) }, n = function() { var d = function(d, e, k, l) { - d = c.cljs$core$IFn$_invoke$arity$3(d, e, k); - return cljs.core.truth_(d) ? d : cljs.core.some(function(c) { - return function(c) { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(d) ? d : b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - }; - }(d), l); + d = c.call(null, d, e, k); + return cljs.core.truth_(d) ? d : cljs.core.some.call(null, function(c) { + var d = a.call(null, c); + return cljs.core.truth_(d) ? d : b.call(null, c) + }, l) }, e = function(a, b, c, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return d.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return d.call(this, a, b, c, f) }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -10690,10 +7248,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a); + return d(b, c, e, a) }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e; + return e }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: @@ -10705,109 +7263,95 @@ cljs.core.some_fn = function() { case 3: return m.call(this, a, b, c); default: - var g = null; - if (3 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { - h[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = n.cljs$lang$applyTo; c.cljs$core$IFn$_invoke$arity$0 = function() { - return null; + return null }; c.cljs$core$IFn$_invoke$arity$1 = d; c.cljs$core$IFn$_invoke$arity$2 = e; c.cljs$core$IFn$_invoke$arity$3 = m; c.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); + return c + }() }, d = function(a, b, c) { return function() { var d = null, e = function(d) { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - if (cljs.core.truth_(e)) { - return e; + var e = a.call(null, d); + if(cljs.core.truth_(e)) { + return e } - e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return cljs.core.truth_(e) ? e : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); + e = b.call(null, d); + return cljs.core.truth_(e) ? e : c.call(null, d) }, m = function(d, e) { - var k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - if (cljs.core.truth_(k)) { - return k; + var k = a.call(null, d); + if(cljs.core.truth_(k)) { + return k } - k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - if (cljs.core.truth_(k)) { - return k; + k = b.call(null, d); + if(cljs.core.truth_(k)) { + return k } - k = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); - if (cljs.core.truth_(k)) { - return k; + k = c.call(null, d); + if(cljs.core.truth_(k)) { + return k } - k = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); - if (cljs.core.truth_(k)) { - return k; + k = a.call(null, e); + if(cljs.core.truth_(k)) { + return k } - k = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e); - return cljs.core.truth_(k) ? k : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e); + k = b.call(null, e); + return cljs.core.truth_(k) ? k : c.call(null, e) }, n = function(d, e, k) { - var l = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - if (cljs.core.truth_(l)) { - return l; + var l = a.call(null, d); + if(cljs.core.truth_(l)) { + return l } - l = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - if (cljs.core.truth_(l)) { - return l; + l = b.call(null, d); + if(cljs.core.truth_(l)) { + return l } - d = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); - if (cljs.core.truth_(d)) { - return d; + d = c.call(null, d); + if(cljs.core.truth_(d)) { + return d } - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(e) : a.call(null, e); - if (cljs.core.truth_(d)) { - return d; + d = a.call(null, e); + if(cljs.core.truth_(d)) { + return d } - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(e) : b.call(null, e); - if (cljs.core.truth_(d)) { - return d; + d = b.call(null, e); + if(cljs.core.truth_(d)) { + return d } - e = c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(e) : c.call(null, e); - if (cljs.core.truth_(e)) { - return e; + e = c.call(null, e); + if(cljs.core.truth_(e)) { + return e } - e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(k) : a.call(null, k); - if (cljs.core.truth_(e)) { - return e; + e = a.call(null, k); + if(cljs.core.truth_(e)) { + return e } - e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(k) : b.call(null, k); - return cljs.core.truth_(e) ? e : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(k) : c.call(null, k); + e = b.call(null, k); + return cljs.core.truth_(e) ? e : c.call(null, k) }, p = function() { var e = function(e, l, m, n) { - e = d.cljs$core$IFn$_invoke$arity$3(e, l, m); - return cljs.core.truth_(e) ? e : cljs.core.some(function(d) { - return function(d) { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - if (cljs.core.truth_(e)) { - return e; - } - e = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d); - return cljs.core.truth_(e) ? e : c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); - }; - }(e), n); + e = d.call(null, e, l, m); + return cljs.core.truth_(e) ? e : cljs.core.some.call(null, function(d) { + var e = a.call(null, d); + if(cljs.core.truth_(e)) { + return e + } + e = b.call(null, d); + return cljs.core.truth_(e) ? e : c.call(null, d) + }, n) }, l = function(a, b, c, d) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return e.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return e.call(this, a, b, c, f) }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -10817,10 +7361,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return e(b, c, d, a); + return e(b, c, d, a) }; l.cljs$core$IFn$_invoke$arity$variadic = e; - return l; + return l }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: @@ -10831,131 +7375,97 @@ cljs.core.some_fn = function() { return m.call(this, a, b); case 3: return n.call(this, a, b, c); - default: - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); + default: + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = p.cljs$lang$applyTo; d.cljs$core$IFn$_invoke$arity$0 = function() { - return null; + return null }; d.cljs$core$IFn$_invoke$arity$1 = e; d.cljs$core$IFn$_invoke$arity$2 = m; d.cljs$core$IFn$_invoke$arity$3 = n; d.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return d; - }(); + return d + }() }, e = function() { var a = function(a, b, c, d) { - return function(a) { - return function() { - var b = null, c = function(b) { - return cljs.core.some(function(a) { - return function(a) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - }; - }(a), a); - }, d = function(b, c) { - return cljs.core.some(function(a) { - return function(a) { - var d; - d = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return cljs.core.truth_(d) ? d : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - }; - }(a), a); - }, e = function(b, c, d) { - return cljs.core.some(function(a) { - return function(a) { - var e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - if (cljs.core.truth_(e)) { - return e; - } - e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); - return cljs.core.truth_(e) ? e : a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - }; - }(a), a); - }, f = function() { - var c = function(c, d, e, f) { - c = b.cljs$core$IFn$_invoke$arity$3(c, d, e); - return cljs.core.truth_(c) ? c : cljs.core.some(function(a, b) { - return function(a) { - return cljs.core.some(a, f); - }; - }(c, a), a); - }, d = function(a, b, d, e) { - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); - }; - d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = function(a) { - var b = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return c(b, d, e, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), b = function(a, b, g, h) { - switch(arguments.length) { - case 0: - return null; - case 1: - return c.call(this, a); - case 2: - return d.call(this, a, b); - case 3: - return e.call(this, a, b, g); - default: - var k = null; - if (3 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 3);k < l.length;) { - l[k] = arguments[k + 3], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, b, g, k); + var e = cljs.core.list_STAR_.call(null, a, b, c, d); + return function() { + var a = null, b = function(a) { + return cljs.core.some.call(null, function(b) { + return b.call(null, a) + }, e) + }, c = function(a, b) { + return cljs.core.some.call(null, function(c) { + var d = c.call(null, a); + return cljs.core.truth_(d) ? d : c.call(null, b) + }, e) + }, d = function(a, b, c) { + return cljs.core.some.call(null, function(d) { + var e = d.call(null, a); + if(cljs.core.truth_(e)) { + return e } - throw Error("Invalid arity: " + arguments.length); + e = d.call(null, b); + return cljs.core.truth_(e) ? e : d.call(null, c) + }, e) + }, f = function() { + var b = function(b, c, d, f) { + b = a.call(null, b, c, d); + return cljs.core.truth_(b) ? b : cljs.core.some.call(null, function(a) { + return cljs.core.some.call(null, a, f) + }, e) + }, c = function(a, c, d, e) { + var f = null; + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, c, d, f) }; - b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = f.cljs$lang$applyTo; - b.cljs$core$IFn$_invoke$arity$0 = function() { - return null; + c.cljs$lang$maxFixedArity = 3; + c.cljs$lang$applyTo = function(a) { + var c = cljs.core.first(a); + a = cljs.core.next(a); + var d = cljs.core.first(a); + a = cljs.core.next(a); + var e = cljs.core.first(a); + a = cljs.core.rest(a); + return b(c, d, e, a) }; - b.cljs$core$IFn$_invoke$arity$1 = c; - b.cljs$core$IFn$_invoke$arity$2 = d; - b.cljs$core$IFn$_invoke$arity$3 = e; - b.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); - }(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); + c.cljs$core$IFn$_invoke$arity$variadic = b; + return c + }(), a = function(a, e, g, h) { + switch(arguments.length) { + case 0: + return null; + case 1: + return b.call(this, a); + case 2: + return c.call(this, a, e); + case 3: + return d.call(this, a, e, g); + default: + return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)) + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 3; + a.cljs$lang$applyTo = f.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$0 = function() { + return null + }; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = c; + a.cljs$core$IFn$_invoke$arity$3 = d; + a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return a + }() }, b = function(b, c, d, e) { var g = null; - if (3 < arguments.length) { - for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { - p[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(p, 0); - } - return a.call(this, b, c, d, g); + 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return a.call(this, b, c, d, g) }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -10965,10 +7475,10 @@ cljs.core.some_fn = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b); + return a(c, d, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -10978,14 +7488,7 @@ cljs.core.some_fn = function() { case 3: return d.call(this, a, g, h); default: - var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; @@ -10995,135 +7498,51 @@ cljs.core.some_fn = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.map = function() { - var a = null, b = function(a) { - return function(b) { - return function() { - var c = null, d = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, e = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, f = function(c, d) { - var e; - e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, e) : b.call(null, c, e); - }, p = function() { - var c = function(c, d, e) { - d = cljs.core.apply.cljs$core$IFn$_invoke$arity$3(a, d, e); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); - }, d = function(a, b, d) { - var e = null; - if (2 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 2);e < f.length;) { - f[e] = arguments[e + 2], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return c.call(this, a, b, e); - }; - d.cljs$lang$maxFixedArity = 2; - d.cljs$lang$applyTo = function(a) { - var b = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.rest(a); - return c(b, d, a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), c = function(a, b, c) { - switch(arguments.length) { - case 0: - return d.call(this); - case 1: - return e.call(this, a); - case 2: - return f.call(this, a, b); - default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, g); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$lang$maxFixedArity = 2; - c.cljs$lang$applyTo = p.cljs$lang$applyTo; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = e; - c.cljs$core$IFn$_invoke$arity$2 = f; - c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); - }; - }, c = function(b, c) { + var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { - var d = cljs.core.seq(c); - if (d) { - if (cljs.core.chunked_seq_QMARK_(d)) { - for (var e = cljs.core.chunk_first(d), f = cljs.core.count(e), n = cljs.core.chunk_buffer(f), p = 0;;) { - if (p < f) { - cljs.core.chunk_append(n, function() { - var a = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, p); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }()), p += 1; - } else { - break; + var d = cljs.core.seq.call(null, c); + if(d) { + if(cljs.core.chunked_seq_QMARK_.call(null, d)) { + for(var e = cljs.core.chunk_first.call(null, d), l = cljs.core.count.call(null, e), m = cljs.core.chunk_buffer.call(null, l), n = 0;;) { + if(n < l) { + cljs.core.chunk_append.call(null, m, b.call(null, cljs.core._nth.call(null, e, n))), n += 1 + }else { + break } } - return cljs.core.chunk_cons(cljs.core.chunk(n), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.chunk_rest(d))); + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, m), a.call(null, b, cljs.core.chunk_rest.call(null, d))) } - return cljs.core.cons(function() { - var a = cljs.core.first(d); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }(), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(d))); + return cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, d)), a.call(null, b, cljs.core.rest.call(null, d))) } - return null; - }, null, null); - }, d = function(b, c, d) { + return null + }, null, null) + }, c = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var e = cljs.core.seq(c), f = cljs.core.seq(d); - return e && f ? cljs.core.cons(function() { - var a = cljs.core.first(e), c = cljs.core.first(f); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(a, c) : b.call(null, a, c); - }(), a.cljs$core$IFn$_invoke$arity$3(b, cljs.core.rest(e), cljs.core.rest(f))) : null; - }, null, null); - }, e = function(b, c, d, e) { + var e = cljs.core.seq.call(null, c), l = cljs.core.seq.call(null, d); + return e && l ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, e), cljs.core.first.call(null, l)), a.call(null, b, cljs.core.rest.call(null, e), cljs.core.rest.call(null, l))) : null + }, null, null) + }, d = function(b, c, d, e) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c), n = cljs.core.seq(d), p = cljs.core.seq(e); - return f && n && p ? cljs.core.cons(function() { - var a = cljs.core.first(f), c = cljs.core.first(n), d = cljs.core.first(p); - return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(a, c, d) : b.call(null, a, c, d); - }(), a.cljs$core$IFn$_invoke$arity$4(b, cljs.core.rest(f), cljs.core.rest(n), cljs.core.rest(p))) : null; - }, null, null); - }, f = function() { + var l = cljs.core.seq.call(null, c), m = cljs.core.seq.call(null, d), n = cljs.core.seq.call(null, e); + return l && m && n ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, l), cljs.core.first.call(null, m), cljs.core.first.call(null, n)), a.call(null, b, cljs.core.rest.call(null, l), cljs.core.rest.call(null, m), cljs.core.rest.call(null, n))) : null + }, null, null) + }, e = function() { var b = function(b, c, d, e, f) { - var g = function s(b) { + return a.call(null, function(a) { + return cljs.core.apply.call(null, b, a) + }, function q(b) { return new cljs.core.LazySeq(null, function() { - var c = a.cljs$core$IFn$_invoke$arity$2(cljs.core.seq, b); - return cljs.core.every_QMARK_(cljs.core.identity, c) ? cljs.core.cons(a.cljs$core$IFn$_invoke$arity$2(cljs.core.first, c), s(a.cljs$core$IFn$_invoke$arity$2(cljs.core.rest, c))) : null; - }, null, null); - }; - return a.cljs$core$IFn$_invoke$arity$2(function(a) { - return function(a) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(b, a); - }; - }(g), g(cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(f, e, cljs.core.array_seq([d, c], 0)))); - }, c = function(a, c, d, e, f) { - var h = null; - if (4 < arguments.length) { - for (var h = 0, r = Array(arguments.length - 4);h < r.length;) { - r[h] = arguments[h + 4], ++h; - } - h = new cljs.core.IndexedSeq(r, 0); - } - return b.call(this, a, c, d, e, h); + var c = a.call(null, cljs.core.seq, b); + return cljs.core.every_QMARK_.call(null, cljs.core.identity, c) ? cljs.core.cons.call(null, a.call(null, cljs.core.first, c), q.call(null, a.call(null, cljs.core.rest, c))) : null + }, null, null) + }.call(null, cljs.core.conj.call(null, f, e, d, c))) + }, c = function(a, c, d, e, g) { + var p = null; + 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); + return b.call(this, a, c, d, e, p) }; c.cljs$lang$maxFixedArity = 4; c.cljs$lang$applyTo = function(a) { @@ -11133,331 +7552,181 @@ cljs.core.map = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.next(a); - var f = cljs.core.first(a); + var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, f, a); + return b(c, d, e, g, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(), a = function(a, h, k, l, m) { + return c + }(), a = function(a, g, h, k, l) { switch(arguments.length) { - case 1: - return b.call(this, a); case 2: - return c.call(this, a, h); + return b.call(this, a, g); case 3: - return d.call(this, a, h, k); + return c.call(this, a, g, h); case 4: - return e.call(this, a, h, k, l); + return d.call(this, a, g, h, k); default: - var n = null; - if (4 < arguments.length) { - for (var n = 0, p = Array(arguments.length - 4);n < p.length;) { - p[n] = arguments[n + 4], ++n; - } - n = new cljs.core.IndexedSeq(p, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, n); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 4; - a.cljs$lang$applyTo = f.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - a.cljs$core$IFn$_invoke$arity$4 = e; - a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a; + a.cljs$lang$applyTo = e.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; + return a }(); -cljs.core.take = function() { - var a = null, b = function(a) { - return function(b) { - return function(a) { - return function() { - var c = null, d = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(c, d) { - var g = cljs.core.deref(a), h = a.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, a.cljs$core$IDeref$_deref$arity$1(null) - 1), g = 0 < g ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d) : c; - return 0 < h ? g : cljs.core.ensure_reduced(g); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return d.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = k; - c.cljs$core$IFn$_invoke$arity$2 = l; - return c; - }(); - }(cljs.core.volatile_BANG_(a)); - }; - }, c = function(b, c) { - return new cljs.core.LazySeq(null, function() { - if (0 < b) { - var f = cljs.core.seq(c); - return f ? cljs.core.cons(cljs.core.first(f), a.cljs$core$IFn$_invoke$arity$2(b - 1, cljs.core.rest(f))) : null; - } - return null; - }, null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); +cljs.core.take = function take(b, c) { + return new cljs.core.LazySeq(null, function() { + if(0 < b) { + var d = cljs.core.seq.call(null, c); + return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take.call(null, b - 1, cljs.core.rest.call(null, d))) : null } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.drop = function() { - var a = null, b = function(a) { - return function(b) { - return function(a) { - return function() { - var c = null, d = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(c, d) { - var g = cljs.core.deref(a); - a.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, a.cljs$core$IDeref$_deref$arity$1(null) - 1); - return 0 < g ? c : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return d.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = k; - c.cljs$core$IFn$_invoke$arity$2 = l; - return c; - }(); - }(cljs.core.volatile_BANG_(a)); - }; - }, c = function(a, b) { - return new cljs.core.LazySeq(null, function(c) { - return function() { - return c(a, b); - }; - }(function(a, b) { - for (;;) { - var c = cljs.core.seq(b); - if (0 < a && c) { - var d = a - 1, c = cljs.core.rest(c); - a = d; - b = c; - } else { - return c; - } + return null + }, null, null) +}; +cljs.core.drop = function(a, b) { + var c = function(a, b) { + for(;;) { + var c = cljs.core.seq.call(null, b); + if(0 < a && c) { + var g = a - 1, c = cljs.core.rest.call(null, c); + a = g; + b = c + }else { + return c } - }), null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); } - throw Error("Invalid arity: " + arguments.length); }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); + return new cljs.core.LazySeq(null, function() { + return c.call(null, a, b) + }, null, null) +}; cljs.core.drop_last = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(1, b); + return a.call(null, 1, b) }, c = function(a, b) { - return cljs.core.map.cljs$core$IFn$_invoke$arity$3(function(a, b) { - return a; - }, b, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(a, b)); + return cljs.core.map.call(null, function(a, b) { + return a + }, b, cljs.core.drop.call(null, a, b)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.take_last = function(a, b) { - for (var c = cljs.core.seq(b), d = cljs.core.seq(cljs.core.drop.cljs$core$IFn$_invoke$arity$2(a, b));;) { - if (d) { - c = cljs.core.next(c), d = cljs.core.next(d); - } else { - return c; + for(var c = cljs.core.seq.call(null, b), d = cljs.core.seq.call(null, cljs.core.drop.call(null, a, b));;) { + if(d) { + c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d) + }else { + return c } } }; -cljs.core.drop_while = function() { - var a = null, b = function(a) { - return function(b) { - return function(c) { - return function() { - var g = null, h = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(g, h) { - var k = cljs.core.deref(c); - if (cljs.core.truth_(cljs.core.truth_(k) ? a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(h) : a.call(null, h) : k)) { - return g; - } - cljs.core.vreset_BANG_(c, null); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, h) : b.call(null, g, h); - }, g = function(a, b) { - switch(arguments.length) { - case 0: - return h.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - g.cljs$core$IFn$_invoke$arity$0 = h; - g.cljs$core$IFn$_invoke$arity$1 = k; - g.cljs$core$IFn$_invoke$arity$2 = l; - return g; - }(); - }(cljs.core.volatile_BANG_(!0)); - }; - }, c = function(a, b) { - return new cljs.core.LazySeq(null, function(c) { - return function() { - return c(a, b); - }; - }(function(a, b) { - for (;;) { - var c = cljs.core.seq(b); - if (cljs.core.truth_(function() { - var b = c; - return b ? (b = cljs.core.first(c), a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)) : b; - }())) { - var d = a, e = cljs.core.rest(c); - a = d; - b = e; - } else { - return c; - } +cljs.core.drop_while = function(a, b) { + var c = function(a, b) { + for(;;) { + var c = cljs.core.seq.call(null, b); + if(cljs.core.truth_(function() { + var b = c; + return b ? a.call(null, cljs.core.first.call(null, c)) : b + }())) { + var g = a, h = cljs.core.rest.call(null, c); + a = g; + b = h + }else { + return c } - }), null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); } - throw Error("Invalid arity: " + arguments.length); }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); + return new cljs.core.LazySeq(null, function() { + return c.call(null, a, b) + }, null, null) +}; cljs.core.cycle = function cycle(b) { return new cljs.core.LazySeq(null, function() { - var c = cljs.core.seq(b); - return c ? cljs.core.concat.cljs$core$IFn$_invoke$arity$2(c, cycle(c)) : null; - }, null, null); + var c = cljs.core.seq.call(null, b); + return c ? cljs.core.concat.call(null, c, cycle.call(null, c)) : null + }, null, null) }; cljs.core.split_at = function(a, b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take.cljs$core$IFn$_invoke$arity$2(a, b), cljs.core.drop.cljs$core$IFn$_invoke$arity$2(a, b)], null); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take.call(null, a, b), cljs.core.drop.call(null, a, b)], null) }; cljs.core.repeat = function() { var a = null, b = function(b) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons(b, a.cljs$core$IFn$_invoke$arity$1(b)); - }, null, null); + return cljs.core.cons.call(null, b, a.call(null, b)) + }, null, null) }, c = function(b, c) { - return cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, a.cljs$core$IFn$_invoke$arity$1(c)); + return cljs.core.take.call(null, b, a.call(null, c)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.replicate = function(a, b) { - return cljs.core.take.cljs$core$IFn$_invoke$arity$2(a, cljs.core.repeat.cljs$core$IFn$_invoke$arity$1(b)); + return cljs.core.take.call(null, a, cljs.core.repeat.call(null, b)) }; cljs.core.repeatedly = function() { var a = null, b = function(b) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons(b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null), a.cljs$core$IFn$_invoke$arity$1(b)); - }, null, null); + return cljs.core.cons.call(null, b.call(null), a.call(null, b)) + }, null, null) }, c = function(b, c) { - return cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, a.cljs$core$IFn$_invoke$arity$1(c)); + return cljs.core.take.call(null, b, a.call(null, c)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.iterate = function iterate(b, c) { - return cljs.core.cons(c, new cljs.core.LazySeq(null, function() { - var d; - d = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c); - return iterate(b, d); - }, null, null)); + return cljs.core.cons.call(null, c, new cljs.core.LazySeq(null, function() { + return iterate.call(null, b, b.call(null, c)) + }, null, null)) }; cljs.core.interleave = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(b), g = cljs.core.seq(c); - return f && g ? cljs.core.cons(cljs.core.first(f), cljs.core.cons(cljs.core.first(g), a.cljs$core$IFn$_invoke$arity$2(cljs.core.rest(f), cljs.core.rest(g)))) : null; - }, null, null); + var f = cljs.core.seq.call(null, b), g = cljs.core.seq.call(null, c); + return f && g ? cljs.core.cons.call(null, cljs.core.first.call(null, f), cljs.core.cons.call(null, cljs.core.first.call(null, g), a.call(null, cljs.core.rest.call(null, f), cljs.core.rest.call(null, g)))) : null + }, null, null) }, c = function() { var b = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var e = cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.seq, cljs.core.conj.cljs$core$IFn$_invoke$arity$variadic(d, c, cljs.core.array_seq([b], 0))); - return cljs.core.every_QMARK_(cljs.core.identity, e) ? cljs.core.concat.cljs$core$IFn$_invoke$arity$2(cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.first, e), cljs.core.apply.cljs$core$IFn$_invoke$arity$2(a, cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.rest, e))) : null; - }, null, null); + var e = cljs.core.map.call(null, cljs.core.seq, cljs.core.conj.call(null, d, c, b)); + return cljs.core.every_QMARK_.call(null, cljs.core.identity, e) ? cljs.core.concat.call(null, cljs.core.map.call(null, cljs.core.first, e), cljs.core.apply.call(null, a, cljs.core.map.call(null, cljs.core.rest, e))) : null + }, null, null) }, c = function(a, c, e) { var k = null; - if (2 < arguments.length) { - for (var k = 0, l = Array(arguments.length - 2);k < l.length;) { - l[k] = arguments[k + 2], ++k; - } - k = new cljs.core.IndexedSeq(l, 0); - } - return b.call(this, a, c, k); + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return b.call(this, a, c, k) }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -11465,23 +7734,16 @@ cljs.core.interleave = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a); + return b(c, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); default: - var g = null; - if (2 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 2);g < h.length;) { - h[g] = arguments[g + 2], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, g); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; @@ -11489,244 +7751,110 @@ cljs.core.interleave = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.interpose = function() { - var a = null, b = function(a) { - return function(b) { - return function(c) { - return function() { - var g = null, h = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(g, h) { - if (cljs.core.truth_(cljs.core.deref(c))) { - var k; - k = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, a) : b.call(null, g, a); - return cljs.core.reduced_QMARK_(k) ? k : b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(k, h) : b.call(null, k, h); - } - cljs.core.vreset_BANG_(c, !0); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, h) : b.call(null, g, h); - }, g = function(a, b) { - switch(arguments.length) { - case 0: - return h.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - g.cljs$core$IFn$_invoke$arity$0 = h; - g.cljs$core$IFn$_invoke$arity$1 = k; - g.cljs$core$IFn$_invoke$arity$2 = l; - return g; - }(); - }(cljs.core.volatile_BANG_(!1)); - }; - }, c = function(a, b) { - return cljs.core.drop.cljs$core$IFn$_invoke$arity$2(1, cljs.core.interleave.cljs$core$IFn$_invoke$arity$2(cljs.core.repeat.cljs$core$IFn$_invoke$arity$1(a), b)); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); +cljs.core.interpose = function(a, b) { + return cljs.core.drop.call(null, 1, cljs.core.interleave.call(null, cljs.core.repeat.call(null, a), b)) +}; cljs.core.flatten1 = function(a) { return function c(a, e) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(a); - return f ? cljs.core.cons(cljs.core.first(f), c(cljs.core.rest(f), e)) : cljs.core.seq(e) ? c(cljs.core.first(e), cljs.core.rest(e)) : null; - }, null, null); - }(null, a); + var f = cljs.core.seq.call(null, a); + return f ? cljs.core.cons.call(null, cljs.core.first.call(null, f), c.call(null, cljs.core.rest.call(null, f), e)) : cljs.core.seq.call(null, e) ? c.call(null, cljs.core.first.call(null, e), cljs.core.rest.call(null, e)) : null + }, null, null) + }.call(null, null, a) }; cljs.core.mapcat = function() { - var a = null, b = function(a) { - return cljs.core.comp.cljs$core$IFn$_invoke$arity$2(cljs.core.map.cljs$core$IFn$_invoke$arity$1(a), cljs.core.cat); + var a = null, b = function(a, b) { + return cljs.core.flatten1.call(null, cljs.core.map.call(null, a, b)) }, c = function() { - var a = function(a, b) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.concat, cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.map, a, b)); - }, b = function(b, c) { - var e = null; - if (1 < arguments.length) { - for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { - k[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, e); + var a = function(a, b, c) { + return cljs.core.flatten1.call(null, cljs.core.apply.call(null, cljs.core.map, a, b, c)) + }, b = function(b, c, e) { + var k = null; + 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, c, k) }; - b.cljs$lang$maxFixedArity = 1; + b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, b); + return a(c, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; - }(), a = function(a, e) { + return b + }(), a = function(a, e, f) { switch(arguments.length) { - case 1: - return b.call(this, a); + case 2: + return b.call(this, a, e); default: - var f = null; - if (1 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { - g[f] = arguments[f + 1], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, f); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) } throw Error("Invalid arity: " + arguments.length); }; - a.cljs$lang$maxFixedArity = 1; + a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); -cljs.core.filter = function() { - var a = null, b = function(a) { - return function(b) { - return function() { - var c = null, g = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, h = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, k = function(c, f) { - return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f)) ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, f) : b.call(null, c, f) : c; - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return g.call(this); - case 1: - return h.call(this, a); - case 2: - return k.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = g; - c.cljs$core$IFn$_invoke$arity$1 = h; - c.cljs$core$IFn$_invoke$arity$2 = k; - return c; - }(); - }; - }, c = function(b, c) { - return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c); - if (f) { - if (cljs.core.chunked_seq_QMARK_(f)) { - for (var g = cljs.core.chunk_first(f), h = cljs.core.count(g), k = cljs.core.chunk_buffer(h), l = 0;;) { - if (l < h) { - cljs.core.truth_(function() { - var a = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(g, l); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }()) && cljs.core.chunk_append(k, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(g, l)), l += 1; - } else { - break; - } +cljs.core.filter = function filter(b, c) { + return new cljs.core.LazySeq(null, function() { + var d = cljs.core.seq.call(null, c); + if(d) { + if(cljs.core.chunked_seq_QMARK_.call(null, d)) { + for(var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { + if(h < f) { + cljs.core.truth_(b.call(null, cljs.core._nth.call(null, e, h))) && cljs.core.chunk_append.call(null, g, cljs.core._nth.call(null, e, h)), h += 1 + }else { + break } - return cljs.core.chunk_cons(cljs.core.chunk(k), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.chunk_rest(f))); } - h = cljs.core.first(f); - f = cljs.core.rest(f); - return cljs.core.truth_(b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(h) : b.call(null, h)) ? cljs.core.cons(h, a.cljs$core$IFn$_invoke$arity$2(b, f)) : a.cljs$core$IFn$_invoke$arity$2(b, f); + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), filter.call(null, b, cljs.core.chunk_rest.call(null, d))) } - return null; - }, null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.remove = function() { - var a = null, b = function(a) { - return cljs.core.filter.cljs$core$IFn$_invoke$arity$1(cljs.core.complement(a)); - }, c = function(a, b) { - return cljs.core.filter.cljs$core$IFn$_invoke$arity$2(cljs.core.complement(a), b); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); + e = cljs.core.first.call(null, d); + d = cljs.core.rest.call(null, d); + return cljs.core.truth_(b.call(null, e)) ? cljs.core.cons.call(null, e, filter.call(null, b, d)) : filter.call(null, b, d) } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); + return null + }, null, null) +}; +cljs.core.remove = function(a, b) { + return cljs.core.filter.call(null, cljs.core.complement.call(null, a), b) +}; cljs.core.tree_seq = function(a, b, c) { return function e(c) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons(c, cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)) ? cljs.core.mapcat.cljs$core$IFn$_invoke$arity$variadic(e, cljs.core.array_seq([b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c)], 0)) : null); - }, null, null); - }(c); + return cljs.core.cons.call(null, c, cljs.core.truth_(a.call(null, c)) ? cljs.core.mapcat.call(null, e, b.call(null, c)) : null) + }, null, null) + }.call(null, c) }; cljs.core.flatten = function(a) { - return cljs.core.filter.cljs$core$IFn$_invoke$arity$2(function(a) { - return!cljs.core.sequential_QMARK_(a); - }, cljs.core.rest(cljs.core.tree_seq(cljs.core.sequential_QMARK_, cljs.core.seq, a))); + return cljs.core.filter.call(null, function(a) { + return!cljs.core.sequential_QMARK_.call(null, a) + }, cljs.core.rest.call(null, cljs.core.tree_seq.call(null, cljs.core.sequential_QMARK_, cljs.core.seq, a))) +}; +cljs.core.into = function(a, b) { + return null != a ? a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core.transient$.call(null, a), b)) : cljs.core.reduce.call(null, cljs.core._conj, a, b) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, b) }; -cljs.core.into = function() { - var a = null, b = function(a, b) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.with_meta(cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj_BANG_, cljs.core.transient$(a), b)), cljs.core.meta(a)) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, a, b) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj, cljs.core.List.EMPTY, b); - }, c = function(a, b, c) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.with_meta(cljs.core.persistent_BANG_(cljs.core.transduce.cljs$core$IFn$_invoke$arity$4(b, cljs.core.conj_BANG_, cljs.core.transient$(a), c)), cljs.core.meta(a)) : cljs.core.transduce.cljs$core$IFn$_invoke$arity$4(b, cljs.core.conj, a, c); - }, a = function(a, e, f) { - switch(arguments.length) { - case 2: - return b.call(this, a, e); - case 3: - return c.call(this, a, e, f); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - return a; -}(); cljs.core.mapv = function() { var a = null, b = function(a, b) { - return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, c) { - return cljs.core.conj_BANG_.cljs$core$IFn$_invoke$arity$2(b, a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)); - }, cljs.core.transient$(cljs.core.PersistentVector.EMPTY), b)); + return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(b, c) { + return cljs.core.conj_BANG_.call(null, b, a.call(null, c)) + }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)) }, c = function(a, b, c) { - return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY, cljs.core.map.cljs$core$IFn$_invoke$arity$3(a, b, c)); + return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c)) }, d = function(a, b, c, d) { - return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY, cljs.core.map.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); + return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c, d)) }, e = function() { var a = function(a, b, c, d, e) { - return cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentVector.EMPTY, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(cljs.core.map, a, b, c, d, cljs.core.array_seq([e], 0))); + return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.apply.call(null, cljs.core.map, a, b, c, d, e)) }, b = function(b, c, d, e, g) { var p = null; - if (4 < arguments.length) { - for (var p = 0, q = Array(arguments.length - 4);p < q.length;) { - q[p] = arguments[p + 4], ++p; - } - p = new cljs.core.IndexedSeq(q, 0); - } - return a.call(this, b, c, d, e, p); + 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); + return a.call(this, b, c, d, e, p) }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -11738,10 +7866,10 @@ cljs.core.mapv = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, g, b); + return a(c, d, e, g, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 2: @@ -11751,14 +7879,7 @@ cljs.core.mapv = function() { case 4: return d.call(this, a, g, h, k); default: - var m = null; - if (4 < arguments.length) { - for (var m = 0, n = Array(arguments.length - 4);m < n.length;) { - n[m] = arguments[m + 4], ++m; - } - m = new cljs.core.IndexedSeq(n, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, m); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) } throw Error("Invalid arity: " + arguments.length); }; @@ -11768,34 +7889,34 @@ cljs.core.mapv = function() { a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.filterv = function(a, b) { - return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, d) { - return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d)) ? cljs.core.conj_BANG_.cljs$core$IFn$_invoke$arity$2(b, d) : b; - }, cljs.core.transient$(cljs.core.PersistentVector.EMPTY), b)); + return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(b, d) { + return cljs.core.truth_(a.call(null, d)) ? cljs.core.conj_BANG_.call(null, b, d) : b + }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)) }; cljs.core.partition = function() { var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, b, c); + return a.call(null, b, b, c) }, c = function(b, c, d) { return new cljs.core.LazySeq(null, function() { - var h = cljs.core.seq(d); - if (h) { - var k = cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, h); - return b === cljs.core.count(k) ? cljs.core.cons(k, a.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(c, h))) : null; + var h = cljs.core.seq.call(null, d); + if(h) { + var k = cljs.core.take.call(null, b, h); + return b === cljs.core.count.call(null, k) ? cljs.core.cons.call(null, k, a.call(null, b, c, cljs.core.drop.call(null, c, h))) : null } - return null; - }, null, null); + return null + }, null, null) }, d = function(b, c, d, h) { return new cljs.core.LazySeq(null, function() { - var k = cljs.core.seq(h); - if (k) { - var l = cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, k); - return b === cljs.core.count(l) ? cljs.core.cons(l, a.cljs$core$IFn$_invoke$arity$4(b, c, d, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(c, k))) : cljs.core._conj(cljs.core.List.EMPTY, cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, cljs.core.concat.cljs$core$IFn$_invoke$arity$2(l, d))); + var k = cljs.core.seq.call(null, h); + if(k) { + var l = cljs.core.take.call(null, b, k); + return b === cljs.core.count.call(null, l) ? cljs.core.cons.call(null, l, a.call(null, b, c, d, cljs.core.drop.call(null, c, k))) : cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.core.take.call(null, b, cljs.core.concat.call(null, l, d))) } - return null; - }, null, null); + return null + }, null, null) }, a = function(a, f, g, h) { switch(arguments.length) { case 2: @@ -11803,34 +7924,34 @@ cljs.core.partition = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h); + return d.call(this, a, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a; + return a }(); cljs.core.get_in = function() { var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, null); + return a.call(null, b, c, null) }, c = function(a, b, c) { var g = cljs.core.lookup_sentinel; - for (b = cljs.core.seq(b);;) { - if (b) { + for(b = cljs.core.seq.call(null, b);;) { + if(b) { var h = a; - if (h ? h.cljs$lang$protocol_mask$partition0$ & 256 || h.cljs$core$ILookup$ || (h.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, h)) : cljs.core.native_satisfies_QMARK_(cljs.core.ILookup, h)) { - a = cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, cljs.core.first(b), g); - if (g === a) { - return c; + if(h ? h.cljs$lang$protocol_mask$partition0$ & 256 || h.cljs$core$ILookup$ || (h.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) { + a = cljs.core.get.call(null, a, cljs.core.first.call(null, b), g); + if(g === a) { + return c } - b = cljs.core.next(b); - } else { - return c; + b = cljs.core.next.call(null, b) + }else { + return c } - } else { - return a; + }else { + return a } } }, a = function(a, e, f) { @@ -11838,56 +7959,39 @@ cljs.core.get_in = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.assoc_in = function assoc_in(b, c, d) { - var e = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, assoc_in(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e), c, d)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, d); + var e = cljs.core.nth.call(null, c, 0, null); + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, assoc_in.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d) }; cljs.core.update_in = function() { var a = null, b = function(b, c, d) { - var e = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, a.cljs$core$IFn$_invoke$arity$3(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e), c, d)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, function() { - var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e); - return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(a) : d.call(null, a); - }()); + var e = cljs.core.nth.call(null, c, 0, null); + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d.call(null, cljs.core.get.call(null, b, e))) }, c = function(b, c, d, e) { - var f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, f, a.cljs$core$IFn$_invoke$arity$4(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, f), c, d, e)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, f, function() { - var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, f); - return d.cljs$core$IFn$_invoke$arity$2 ? d.cljs$core$IFn$_invoke$arity$2(a, e) : d.call(null, a, e); - }()); + var f = cljs.core.nth.call(null, c, 0, null); + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, f, a.call(null, cljs.core.get.call(null, b, f), c, d, e)) : cljs.core.assoc.call(null, b, f, d.call(null, cljs.core.get.call(null, b, f), e)) }, d = function(b, c, d, e, f) { - var n = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, n, a.cljs$core$IFn$_invoke$arity$5(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, n), c, d, e, f)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, n, function() { - var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, n); - return d.cljs$core$IFn$_invoke$arity$3 ? d.cljs$core$IFn$_invoke$arity$3(a, e, f) : d.call(null, a, e, f); - }()); + var n = cljs.core.nth.call(null, c, 0, null); + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, n, a.call(null, cljs.core.get.call(null, b, n), c, d, e, f)) : cljs.core.assoc.call(null, b, n, d.call(null, cljs.core.get.call(null, b, n), e, f)) }, e = function(b, c, d, e, f, n) { - var p = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, p, a.cljs$core$IFn$_invoke$arity$6(cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, p), c, d, e, f, n)) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, p, function() { - var a = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, p); - return d.cljs$core$IFn$_invoke$arity$4 ? d.cljs$core$IFn$_invoke$arity$4(a, e, f, n) : d.call(null, a, e, f, n); - }()); + var p = cljs.core.nth.call(null, c, 0, null); + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, p, a.call(null, cljs.core.get.call(null, b, p), c, d, e, f, n)) : cljs.core.assoc.call(null, b, p, d.call(null, cljs.core.get.call(null, b, p), e, f, n)) }, f = function() { var b = function(b, c, d, e, f, g, h) { - var s = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - return(c = cljs.core.nthnext(c, 1)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, s, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, s), c, d, e, cljs.core.array_seq([f, g, h], 0))) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, s, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(d, cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, s), e, f, g, cljs.core.array_seq([h], 0))); + var s = cljs.core.nth.call(null, c, 0, null); + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, a, cljs.core.get.call(null, b, s), c, d, e, f, g, h)) : cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, d, cljs.core.get.call(null, b, s), e, f, g, h)) }, c = function(a, c, d, e, f, h, r) { - var s = null; - if (6 < arguments.length) { - for (var s = 0, t = Array(arguments.length - 6);s < t.length;) { - t[s] = arguments[s + 6], ++s; - } - s = new cljs.core.IndexedSeq(t, 0); - } - return b.call(this, a, c, d, e, f, h, s); + var s = null; + 6 < arguments.length && (s = cljs.core.array_seq(Array.prototype.slice.call(arguments, 6), 0)); + return b.call(this, a, c, d, e, f, h, s) }; c.cljs$lang$maxFixedArity = 6; c.cljs$lang$applyTo = function(a) { @@ -11903,93 +8007,10 @@ cljs.core.update_in = function() { a = cljs.core.next(a); var r = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, f, h, r, a); + return b(c, d, e, f, h, r, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(), a = function(a, h, k, l, m, n, p) { - switch(arguments.length) { - case 3: - return b.call(this, a, h, k); - case 4: - return c.call(this, a, h, k, l); - case 5: - return d.call(this, a, h, k, l, m); - case 6: - return e.call(this, a, h, k, l, m, n); - default: - var q = null; - if (6 < arguments.length) { - for (var q = 0, r = Array(arguments.length - 6);q < r.length;) { - r[q] = arguments[q + 6], ++q; - } - q = new cljs.core.IndexedSeq(r, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, q); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$lang$maxFixedArity = 6; - a.cljs$lang$applyTo = f.cljs$lang$applyTo; - a.cljs$core$IFn$_invoke$arity$3 = b; - a.cljs$core$IFn$_invoke$arity$4 = c; - a.cljs$core$IFn$_invoke$arity$5 = d; - a.cljs$core$IFn$_invoke$arity$6 = e; - a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a; -}(); -cljs.core.update = function() { - var a = null, b = function(a, b, c) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { - var d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); - return c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d); - }()); - }, c = function(a, b, c, d) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { - var e = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); - return c.cljs$core$IFn$_invoke$arity$2 ? c.cljs$core$IFn$_invoke$arity$2(e, d) : c.call(null, e, d); - }()); - }, d = function(a, b, c, d, e) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { - var f = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); - return c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(f, d, e) : c.call(null, f, d, e); - }()); - }, e = function(a, b, c, d, e, f) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, function() { - var p = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b); - return c.cljs$core$IFn$_invoke$arity$4 ? c.cljs$core$IFn$_invoke$arity$4(p, d, e, f) : c.call(null, p, d, e, f); - }()); - }, f = function() { - var a = function(a, b, c, d, e, f, g) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(c, cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, b), d, e, f, cljs.core.array_seq([g], 0))); - }, b = function(b, c, d, e, f, h, r) { - var s = null; - if (6 < arguments.length) { - for (var s = 0, t = Array(arguments.length - 6);s < t.length;) { - t[s] = arguments[s + 6], ++s; - } - s = new cljs.core.IndexedSeq(t, 0); - } - return a.call(this, b, c, d, e, f, h, s); - }; - b.cljs$lang$maxFixedArity = 6; - b.cljs$lang$applyTo = function(b) { - var c = cljs.core.first(b); - b = cljs.core.next(b); - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.next(b); - var f = cljs.core.first(b); - b = cljs.core.next(b); - var h = cljs.core.first(b); - b = cljs.core.next(b); - var r = cljs.core.first(b); - b = cljs.core.rest(b); - return a(c, d, e, f, h, r, b); - }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return c }(), a = function(a, h, k, l, m, n, p) { switch(arguments.length) { case 3: @@ -12001,14 +8022,7 @@ cljs.core.update = function() { case 6: return e.call(this, a, h, k, l, m, n); default: - var q = null; - if (6 < arguments.length) { - for (var q = 0, r = Array(arguments.length - 6);q < r.length;) { - r[q] = arguments[q + 6], ++q; - } - q = new cljs.core.IndexedSeq(r, 0); - } - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, q); + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, cljs.core.array_seq(arguments, 6)) } throw Error("Invalid arity: " + arguments.length); }; @@ -12019,135 +8033,93 @@ cljs.core.update = function() { a.cljs$core$IFn$_invoke$arity$5 = d; a.cljs$core$IFn$_invoke$arity$6 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.VectorNode = function(a, b) { this.edit = a; - this.arr = b; + this.arr = b }; cljs.core.VectorNode.cljs$lang$type = !0; cljs.core.VectorNode.cljs$lang$ctorStr = "cljs.core/VectorNode"; cljs.core.VectorNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/VectorNode"); + return cljs.core._write.call(null, b, "cljs.core/VectorNode") }; cljs.core.__GT_VectorNode = function(a, b) { - return new cljs.core.VectorNode(a, b); + return new cljs.core.VectorNode(a, b) }; cljs.core.pv_fresh_node = function(a) { - return new cljs.core.VectorNode(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); + return new cljs.core.VectorNode(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]) }; cljs.core.pv_aget = function(a, b) { - return a.arr[b]; + return a.arr[b] }; cljs.core.pv_aset = function(a, b, c) { - return a.arr[b] = c; + return a.arr[b] = c }; cljs.core.pv_clone_node = function(a) { - return new cljs.core.VectorNode(a.edit, cljs.core.aclone(a.arr)); + return new cljs.core.VectorNode(a.edit, cljs.core.aclone.call(null, a.arr)) }; cljs.core.tail_off = function(a) { a = a.cnt; - return 32 > a ? 0 : a - 1 >>> 5 << 5; + return 32 > a ? 0 : a - 1 >>> 5 << 5 }; cljs.core.new_path = function(a, b, c) { - for (;;) { - if (0 === b) { - return c; + for(;;) { + if(0 === b) { + return c } - var d = cljs.core.pv_fresh_node(a); - cljs.core.pv_aset(d, 0, c); + var d = cljs.core.pv_fresh_node.call(null, a); + cljs.core.pv_aset.call(null, d, 0, c); c = d; - b -= 5; + b -= 5 } }; cljs.core.push_tail = function push_tail(b, c, d, e) { - var f = cljs.core.pv_clone_node(d), g = b.cnt - 1 >>> c & 31; - 5 === c ? cljs.core.pv_aset(f, g, e) : (d = cljs.core.pv_aget(d, g), b = null != d ? push_tail(b, c - 5, d, e) : cljs.core.new_path(null, c - 5, e), cljs.core.pv_aset(f, g, b)); - return f; + var f = cljs.core.pv_clone_node.call(null, d), g = b.cnt - 1 >>> c & 31; + 5 === c ? cljs.core.pv_aset.call(null, f, g, e) : (d = cljs.core.pv_aget.call(null, d, g), b = null != d ? push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, null, c - 5, e), cljs.core.pv_aset.call(null, f, g, b)); + return f }; cljs.core.vector_index_out_of_bounds = function(a, b) { throw Error([cljs.core.str("No item "), cljs.core.str(a), cljs.core.str(" in vector of length "), cljs.core.str(b)].join("")); }; -cljs.core.first_array_for_longvec = function(a) { - var b = a.root; - for (a = a.shift;;) { - if (0 < a) { - b = cljs.core.pv_aget(b, 0), a -= 5; - } else { - return b.arr; +cljs.core.array_for = function(a, b) { + if(0 <= b && b < a.cnt) { + if(b >= cljs.core.tail_off.call(null, a)) { + return a.tail } - } -}; -cljs.core.unchecked_array_for = function(a, b) { - if (b >= cljs.core.tail_off(a)) { - return a.tail; - } - for (var c = a.root, d = a.shift;;) { - if (0 < d) { - c = cljs.core.pv_aget(c, b >>> d & 31), d -= 5; - } else { - return c.arr; + for(var c = a.root, d = a.shift;;) { + if(0 < d) { + c = cljs.core.pv_aget.call(null, c, b >>> d & 31), d -= 5 + }else { + return c.arr + } } + }else { + return cljs.core.vector_index_out_of_bounds.call(null, b, a.cnt) } }; -cljs.core.array_for = function(a, b) { - return 0 <= b && b < a.cnt ? cljs.core.unchecked_array_for(a, b) : cljs.core.vector_index_out_of_bounds(b, a.cnt); -}; cljs.core.do_assoc = function do_assoc(b, c, d, e, f) { - var g = cljs.core.pv_clone_node(d); - if (0 === c) { - cljs.core.pv_aset(g, e & 31, f); - } else { + var g = cljs.core.pv_clone_node.call(null, d); + if(0 === c) { + cljs.core.pv_aset.call(null, g, e & 31, f) + }else { var h = e >>> c & 31; - cljs.core.pv_aset(g, h, do_assoc(b, c - 5, cljs.core.pv_aget(d, h), e, f)); + cljs.core.pv_aset.call(null, g, h, do_assoc.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, h), e, f)) } - return g; + return g }; cljs.core.pop_tail = function pop_tail(b, c, d) { var e = b.cnt - 2 >>> c & 31; - if (5 < c) { - b = pop_tail(b, c - 5, cljs.core.pv_aget(d, e)); - if (null == b && 0 === e) { - return null; + if(5 < c) { + b = pop_tail.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, e)); + if(null == b && 0 === e) { + return null } - d = cljs.core.pv_clone_node(d); - cljs.core.pv_aset(d, e, b); - return d; - } - if (0 === e) { - return null; + d = cljs.core.pv_clone_node.call(null, d); + cljs.core.pv_aset.call(null, d, e, b); + return d } - d = cljs.core.pv_clone_node(d); - cljs.core.pv_aset(d, e, null); - return d; -}; -cljs.core.RangedIterator = function(a, b, c, d, e, f) { - this.i = a; - this.base = b; - this.arr = c; - this.v = d; - this.start = e; - this.end = f; -}; -cljs.core.RangedIterator.prototype.hasNext = function() { - return this.i < this.end; -}; -cljs.core.RangedIterator.prototype.next = function() { - 32 === this.i - this.base && (this.arr = cljs.core.unchecked_array_for(this.v, this.i), this.base += 32); - var a = this.arr[this.i & 31]; - this.i += 1; - return a; -}; -cljs.core.RangedIterator.cljs$lang$type = !0; -cljs.core.RangedIterator.cljs$lang$ctorStr = "cljs.core/RangedIterator"; -cljs.core.RangedIterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/RangedIterator"); -}; -cljs.core.__GT_RangedIterator = function(a, b, c, d, e, f) { - return new cljs.core.RangedIterator(a, b, c, d, e, f); -}; -cljs.core.ranged_iterator = function(a, b, c) { - return new cljs.core.RangedIterator(b, b - b % 32, b < cljs.core.count(a) ? cljs.core.unchecked_array_for(a, b) : null, a, b, c); + return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = cljs.core.pv_clone_node.call(null, d), cljs.core.pv_aset.call(null, d, e, null), d) : null }; cljs.core.PersistentVector = function(a, b, c, d, e, f) { this.meta = a; @@ -12156,290 +8128,208 @@ cljs.core.PersistentVector = function(a, b, c, d, e, f) { this.root = d; this.tail = e; this.__hash = f; - this.cljs$lang$protocol_mask$partition0$ = 167668511; - this.cljs$lang$protocol_mask$partition1$ = 8196; + this.cljs$lang$protocol_mask$partition1$ = 4; + this.cljs$lang$protocol_mask$partition0$ = 167668511 }; -cljs.core.PersistentVector.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); +cljs.core.PersistentVector.cljs$lang$type = !0; +cljs.core.PersistentVector.cljs$lang$ctorStr = "cljs.core/PersistentVector"; +cljs.core.PersistentVector.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentVector") }; -cljs.core.PersistentVector.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.PersistentVector.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return new cljs.core.TransientVector(this.cnt, this.shift, cljs.core.tv_editable_root.call(null, this.root), cljs.core.tv_editable_tail.call(null, this.tail)) +}; +cljs.core.PersistentVector.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; cljs.core.PersistentVector.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); + return cljs.core._nth.call(null, this, b, null) }; cljs.core.PersistentVector.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return "number" === typeof b ? cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c) : c; + return cljs.core._nth.call(null, this, b, c) +}; +cljs.core.PersistentVector.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + if(0 <= b && b < this.cnt) { + return cljs.core.tail_off.call(null, this) <= b ? (a = cljs.core.aclone.call(null, this.tail), a[b & 31] = c, new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, a, null)) : new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, cljs.core.do_assoc.call(null, this, this.shift, this.root, b, c), this.tail, null) + } + if(b === this.cnt) { + return cljs.core._conj.call(null, this, c) + } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds [0,"), cljs.core.str(this.cnt), cljs.core.str("]")].join("")); + } + return null +}; +cljs.core.PersistentVector.prototype.call = function() { + var a = null; + return a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$IIndexed$_nth$arity$2(null, c); + case 3: + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d) + } + throw Error("Invalid arity: " + arguments.length); + } +}(); +cljs.core.PersistentVector.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) +}; +cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$IIndexed$_nth$arity$2(null, a) +}; +cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$IIndexed$_nth$arity$3(null, a, b) }; cljs.core.PersistentVector.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - a = 0; - for (var d = c;;) { - if (a < this.cnt) { - var e = cljs.core.unchecked_array_for(this, a); - c = e.length; + a = [0, c]; + for(c = 0;;) { + if(c < this.cnt) { + var d = cljs.core.array_for.call(null, this, c), e = d.length; a: { - for (var f = 0;;) { - if (f < c) { - var g = f + a, h = e[f], d = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(d, g, h) : b.call(null, d, g, h); - if (cljs.core.reduced_QMARK_(d)) { - e = d; - break a; + for(var f = 0, g = a[1];;) { + if(f < e) { + if(g = b.call(null, g, f + c, d[f]), cljs.core.reduced_QMARK_.call(null, g)) { + d = g; + break a + }else { + f += 1 } - f += 1; - } else { - e = d; - break a; + }else { + a[0] = e; + d = a[1] = g; + break a } } - e = void 0; + d = void 0 } - if (cljs.core.reduced_QMARK_(e)) { - return b = e, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + if(cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d) } - a += c; - d = e; - } else { - return d; + c += a[0] + }else { + return a[1] } } }; -cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return cljs.core.array_for(this, b)[b & 31]; +cljs.core.PersistentVector.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + if(32 > this.cnt - cljs.core.tail_off.call(null, this)) { + for(var c = this.tail.length, d = Array(c + 1), e = 0;;) { + if(e < c) { + d[e] = this.tail[e], e += 1 + }else { + break + } + } + d[c] = b; + return new cljs.core.PersistentVector(this.meta, this.cnt + 1, this.shift, this.root, d, null) + } + c = (d = this.cnt >>> 5 > 1 << this.shift) ? this.shift + 5 : this.shift; + d ? (d = cljs.core.pv_fresh_node.call(null, null), cljs.core.pv_aset.call(null, d, 0, this.root), cljs.core.pv_aset.call(null, d, 1, cljs.core.new_path.call(null, null, this.shift, new cljs.core.VectorNode(null, this.tail)))) : d = cljs.core.push_tail.call(null, this, this.shift, this.root, new cljs.core.VectorNode(null, this.tail)); + return new cljs.core.PersistentVector(this.meta, this.cnt + 1, c, d, [b], null) }; -cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.cnt ? cljs.core.unchecked_array_for(this, b)[b & 31] : c; +cljs.core.PersistentVector.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return 0 < this.cnt ? new cljs.core.RSeq(this, this.cnt - 1, null) : null }; -cljs.core.PersistentVector.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - if (0 <= b && b < this.cnt) { - return cljs.core.tail_off(this) <= b ? (a = cljs.core.aclone(this.tail), a[b & 31] = c, new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, a, null)) : new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, cljs.core.do_assoc(this, this.shift, this.root, b, c), this.tail, null); - } - if (b === this.cnt) { - return cljs.core._conj(this, c); - } - throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds [0,"), cljs.core.str(this.cnt), cljs.core.str("]")].join("")); +cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { + return cljs.core._nth.call(null, this, 0) }; -cljs.core.PersistentVector.prototype.cljs$core$IIterable$ = !0; -cljs.core.PersistentVector.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { - return cljs.core.ranged_iterator(this, 0, this.cnt); +cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { + return cljs.core._nth.call(null, this, 1) }; -cljs.core.PersistentVector.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.PersistentVector.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.PersistentVector.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, this.tail, this.__hash); +cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.call(null, this, b) }; -cljs.core.PersistentVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt; +cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.call(null, this, b, c) }; -cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, 0); +cljs.core.PersistentVector.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 === this.cnt ? null : 32 > this.cnt ? cljs.core.array_seq.call(null, this.tail) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.chunked_seq.call(null, this, 0, 0) : null }; -cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, 1); +cljs.core.PersistentVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.cnt }; cljs.core.PersistentVector.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, this.cnt - 1) : null; + return 0 < this.cnt ? cljs.core._nth.call(null, this, this.cnt - 1) : null }; cljs.core.PersistentVector.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - if (0 === this.cnt) { + if(0 === this.cnt) { throw Error("Can't pop empty vector"); } - if (1 === this.cnt) { - return cljs.core._with_meta(cljs.core.PersistentVector.EMPTY, this.meta); - } - if (1 < this.cnt - cljs.core.tail_off(this)) { - return new cljs.core.PersistentVector(this.meta, this.cnt - 1, this.shift, this.root, this.tail.slice(0, -1), null); + if(1 === this.cnt) { + return cljs.core._with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) } - a = cljs.core.unchecked_array_for(this, this.cnt - 2); - var b = cljs.core.pop_tail(this, this.shift, this.root), b = null == b ? cljs.core.PersistentVector.EMPTY_NODE : b, c = this.cnt - 1; - return 5 < this.shift && null == cljs.core.pv_aget(b, 1) ? new cljs.core.PersistentVector(this.meta, c, this.shift - 5, cljs.core.pv_aget(b, 0), a, null) : new cljs.core.PersistentVector(this.meta, c, this.shift, b, a, null); -}; -cljs.core.PersistentVector.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < this.cnt ? new cljs.core.RSeq(this, this.cnt - 1, null) : null; -}; -cljs.core.PersistentVector.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); -}; -cljs.core.PersistentVector.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - if (b instanceof cljs.core.PersistentVector) { - if (this.cnt === cljs.core.count(b)) { - for (var c = cljs.core._iterator(this), d = cljs.core._iterator(b);;) { - if (cljs.core.truth_(c.hasNext())) { - var e = c.next(), f = d.next(); - if (!cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(e, f)) { - return!1; - } - } else { - return!0; - } - } - } else { - return!1; - } - } else { - return cljs.core.equiv_sequential(this, b); + if(1 < this.cnt - cljs.core.tail_off.call(null, this)) { + return new cljs.core.PersistentVector(this.meta, this.cnt - 1, this.shift, this.root, this.tail.slice(0, -1), null) } -}; -cljs.core.PersistentVector.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - var b = this; - return new cljs.core.TransientVector(b.cnt, b.shift, function() { - var a = b.root; - return cljs.core.tv_editable_root.cljs$core$IFn$_invoke$arity$1 ? cljs.core.tv_editable_root.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.tv_editable_root.call(null, a); - }(), function() { - var a = b.tail; - return cljs.core.tv_editable_tail.cljs$core$IFn$_invoke$arity$1 ? cljs.core.tv_editable_tail.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.tv_editable_tail.call(null, a); - }()); -}; -cljs.core.PersistentVector.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, this.meta); -}; -cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); -}; -cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - a = 0; - for (var d = c;;) { - if (a < this.cnt) { - var e = cljs.core.unchecked_array_for(this, a); - c = e.length; - a: { - for (var f = 0;;) { - if (f < c) { - var g = e[f], d = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, g) : b.call(null, d, g); - if (cljs.core.reduced_QMARK_(d)) { - e = d; - break a; - } - f += 1; - } else { - e = d; - break a; - } - } - e = void 0; - } - if (cljs.core.reduced_QMARK_(e)) { - return b = e, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); - } - a += c; - d = e; - } else { - return d; - } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + a = cljs.core.array_for.call(null, this, this.cnt - 2); + var b = cljs.core.pop_tail.call(null, this, this.shift, this.root), b = null == b ? cljs.core.PersistentVector.EMPTY_NODE : b, c = this.cnt - 1; + return 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? new cljs.core.PersistentVector(this.meta, c, this.shift - 5, cljs.core.pv_aget.call(null, b, 0), a, null) : new cljs.core.PersistentVector(this.meta, c, this.shift, b, a, null) } + return null }; -cljs.core.PersistentVector.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if ("number" === typeof b) { - return cljs.core._assoc_n(this, b, c); - } - throw Error("Vector's key for assoc must be a number."); +cljs.core.PersistentVector.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + return cljs.core._assoc.call(null, this, b, c) }; -cljs.core.PersistentVector.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - if (0 === this.cnt) { - return null; - } - if (32 >= this.cnt) { - return new cljs.core.IndexedSeq(this.tail, 0); - } - a = cljs.core.first_array_for_longvec(this); - return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(this, a, 0, 0) : cljs.core.chunked_seq.call(null, this, a, 0, 0); +cljs.core.PersistentVector.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.PersistentVector.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(b, this.cnt, this.shift, this.root, this.tail, this.__hash); -}; -cljs.core.PersistentVector.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - if (32 > this.cnt - cljs.core.tail_off(this)) { - for (var c = this.tail.length, d = Array(c + 1), e = 0;;) { - if (e < c) { - d[e] = this.tail[e], e += 1; - } else { - break; - } - } - d[c] = b; - return new cljs.core.PersistentVector(this.meta, this.cnt + 1, this.shift, this.root, d, null); - } - c = (d = this.cnt >>> 5 > 1 << this.shift) ? this.shift + 5 : this.shift; - d ? (d = cljs.core.pv_fresh_node(null), cljs.core.pv_aset(d, 0, this.root), cljs.core.pv_aset(d, 1, cljs.core.new_path(null, this.shift, new cljs.core.VectorNode(null, this.tail)))) : d = cljs.core.push_tail(this, this.shift, this.root, new cljs.core.VectorNode(null, this.tail)); - return new cljs.core.PersistentVector(this.meta, this.cnt + 1, c, d, [b], null); + return new cljs.core.PersistentVector(b, this.cnt, this.shift, this.root, this.tail, this.__hash) }; -cljs.core.PersistentVector.prototype.call = function() { - var a = null, a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$IIndexed$_nth$arity$2(null, c); - case 3: - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$IIndexed$_nth$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); - }; - return a; -}(); -cljs.core.PersistentVector.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +cljs.core.PersistentVector.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$IIndexed$_nth$arity$2(null, a); +cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + return cljs.core.array_for.call(null, this, b)[b & 31] }; -cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$IIndexed$_nth$arity$3(null, a, b); +cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c }; -cljs.core.PersistentVector.cljs$lang$type = !0; -cljs.core.PersistentVector.cljs$lang$ctorStr = "cljs.core/PersistentVector"; -cljs.core.PersistentVector.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentVector"); +cljs.core.PersistentVector.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) }; cljs.core.__GT_PersistentVector = function(a, b, c, d, e, f) { - return new cljs.core.PersistentVector(a, b, c, d, e, f); + return new cljs.core.PersistentVector(a, b, c, d, e, f) }; cljs.core.PersistentVector.EMPTY_NODE = new cljs.core.VectorNode(null, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); -cljs.core.PersistentVector.EMPTY = new cljs.core.PersistentVector(null, 0, 5, cljs.core.PersistentVector.EMPTY_NODE, [], cljs.core.empty_ordered_hash); +cljs.core.PersistentVector.EMPTY = new cljs.core.PersistentVector(null, 0, 5, cljs.core.PersistentVector.EMPTY_NODE, [], 0); cljs.core.PersistentVector.fromArray = function(a, b) { - var c = a.length, d = b ? a : cljs.core.aclone(a); - if (32 > c) { - return new cljs.core.PersistentVector(null, c, 5, cljs.core.PersistentVector.EMPTY_NODE, d, null); + var c = a.length, d = b ? a : cljs.core.aclone.call(null, a); + if(32 > c) { + return new cljs.core.PersistentVector(null, c, 5, cljs.core.PersistentVector.EMPTY_NODE, d, null) } - for (var e = d.slice(0, 32), f = 32, g = (new cljs.core.PersistentVector(null, 32, 5, cljs.core.PersistentVector.EMPTY_NODE, e, null)).cljs$core$IEditableCollection$_as_transient$arity$1(null);;) { - if (f < c) { - e = f + 1, g = cljs.core.conj_BANG_.cljs$core$IFn$_invoke$arity$2(g, d[f]), f = e; - } else { - return cljs.core.persistent_BANG_(g); + for(var e = d.slice(0, 32), f = new cljs.core.PersistentVector(null, 32, 5, cljs.core.PersistentVector.EMPTY_NODE, e, null), e = 32, g = cljs.core._as_transient.call(null, f);;) { + if(e < c) { + f = e + 1, g = cljs.core.conj_BANG_.call(null, g, d[e]), e = f + }else { + return cljs.core.persistent_BANG_.call(null, g) } } }; -cljs.core.PersistentVector.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; cljs.core.vec = function(a) { - return a instanceof Array ? cljs.core.PersistentVector.fromArray(a, !0) : cljs.core._persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj_BANG_, cljs.core._as_transient(cljs.core.PersistentVector.EMPTY), a)); + return cljs.core._persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core._as_transient.call(null, cljs.core.PersistentVector.EMPTY), a)) }; cljs.core.vector = function() { var a = function(a) { - return a instanceof cljs.core.IndexedSeq && 0 === a.i ? cljs.core.PersistentVector.fromArray(a.arr, !0) : cljs.core.vec(a); + return a instanceof cljs.core.IndexedSeq ? cljs.core.PersistentVector.fromArray.call(null, a.arr, !0) : cljs.core.vec.call(null, a) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.ChunkedSeq = function(a, b, c, d, e, f) { this.vec = a; @@ -12448,110 +8338,77 @@ cljs.core.ChunkedSeq = function(a, b, c, d, e, f) { this.off = d; this.meta = e; this.__hash = f; - this.cljs$lang$protocol_mask$partition0$ = 32375020; - this.cljs$lang$protocol_mask$partition1$ = 1536; -}; -cljs.core.ChunkedSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.ChunkedSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition0$ = 32243948; + this.cljs$lang$protocol_mask$partition1$ = 1536 }; -cljs.core.ChunkedSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.ChunkedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - if (this.off + 1 < this.node.length) { - a = this.vec; - var b = this.node, c = this.i, d = this.off + 1; - a = cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : cljs.core.chunked_seq.call(null, a, b, c, d); - return null == a ? null : a; - } - return cljs.core._chunked_next(this); +cljs.core.ChunkedSeq.cljs$lang$type = !0; +cljs.core.ChunkedSeq.cljs$lang$ctorStr = "cljs.core/ChunkedSeq"; +cljs.core.ChunkedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ChunkedSeq") }; cljs.core.ChunkedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.ChunkedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.ChunkedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? null : a) : cljs.core._chunked_next.call(null, this) }; -cljs.core.ChunkedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, this.meta); +cljs.core.ChunkedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) +}; +cljs.core.ChunkedSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.ChunkedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - var c = this; - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(function() { - var a = c.vec, b = c.i + c.off, f = cljs.core.count(c.vec); - return cljs.core.subvec.cljs$core$IFn$_invoke$arity$3 ? cljs.core.subvec.cljs$core$IFn$_invoke$arity$3(a, b, f) : cljs.core.subvec.call(null, a, b, f); - }(), b); + return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b) }; cljs.core.ChunkedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - var d = this; - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(function() { - var a = d.vec, b = d.i + d.off, c = cljs.core.count(d.vec); - return cljs.core.subvec.cljs$core$IFn$_invoke$arity$3 ? cljs.core.subvec.cljs$core$IFn$_invoke$arity$3(a, b, c) : cljs.core.subvec.call(null, a, b, c); - }(), b, c); + return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b, c) +}; +cljs.core.ChunkedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.node[this.off]; + return this.node[this.off] }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - if (this.off + 1 < this.node.length) { - a = this.vec; - var b = this.node, c = this.i, d = this.off + 1; - a = cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : cljs.core.chunked_seq.call(null, a, b, c, d); - return null == a ? cljs.core.List.EMPTY : a; - } - return cljs.core._chunked_rest(this); -}; -cljs.core.ChunkedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; + return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? cljs.core.List.EMPTY : a) : cljs.core._chunked_rest.call(null, this) }; -cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { - return cljs.core.array_chunk.cljs$core$IFn$_invoke$arity$2(this.node, this.off); +cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { + a = this.node.length; + a = this.i + a < cljs.core._count.call(null, this.vec) ? cljs.core.chunked_seq.call(null, this.vec, this.i + a, 0) : null; + return null == a ? null : a }; -cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { - a = this.i + this.node.length; - if (a < cljs.core._count(this.vec)) { - var b = this.vec, c = cljs.core.unchecked_array_for(this.vec, a); - return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(b, c, a, 0) : cljs.core.chunked_seq.call(null, b, c, a, 0); - } - return cljs.core.List.EMPTY; +cljs.core.ChunkedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - var c = this.vec, d = this.node, e = this.i, f = this.off; - return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$5 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$5(c, d, e, f, b) : cljs.core.chunked_seq.call(null, c, d, e, f, b); + return cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off, b) }; -cljs.core.ChunkedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { - a = this.i + this.node.length; - if (a < cljs.core._count(this.vec)) { - var b = this.vec, c = cljs.core.unchecked_array_for(this.vec, a); - return cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.chunked_seq.cljs$core$IFn$_invoke$arity$4(b, c, a, 0) : cljs.core.chunked_seq.call(null, b, c, a, 0); - } - return null; +cljs.core.ChunkedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) }; -cljs.core.ChunkedSeq.cljs$lang$type = !0; -cljs.core.ChunkedSeq.cljs$lang$ctorStr = "cljs.core/ChunkedSeq"; -cljs.core.ChunkedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ChunkedSeq"); +cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { + return cljs.core.array_chunk.call(null, this.node, this.off) }; -cljs.core.__GT_ChunkedSeq = function(a, b, c, d, e, f) { - return new cljs.core.ChunkedSeq(a, b, c, d, e, f); +cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { + a = this.node.length; + a = this.i + a < cljs.core._count.call(null, this.vec) ? cljs.core.chunked_seq.call(null, this.vec, this.i + a, 0) : null; + return null == a ? cljs.core.List.EMPTY : a }; -cljs.core.ChunkedSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.__GT_ChunkedSeq = function(a, b, c, d, e, f) { + return new cljs.core.ChunkedSeq(a, b, c, d, e, f) }; cljs.core.chunked_seq = function() { var a = null, b = function(a, b, c) { - return new cljs.core.ChunkedSeq(a, cljs.core.array_for(a, b), b, c, null, null); + return new cljs.core.ChunkedSeq(a, cljs.core.array_for.call(null, a, b), b, c, null, null) }, c = function(a, b, c, d) { - return new cljs.core.ChunkedSeq(a, b, c, d, null, null); + return new cljs.core.ChunkedSeq(a, b, c, d, null, null) }, d = function(a, b, c, d, k) { - return new cljs.core.ChunkedSeq(a, b, c, d, k, null); + return new cljs.core.ChunkedSeq(a, b, c, d, k, null) }, a = function(a, f, g, h, k) { switch(arguments.length) { case 3: @@ -12559,14 +8416,14 @@ cljs.core.chunked_seq = function() { case 4: return c.call(this, a, f, g, h); case 5: - return d.call(this, a, f, g, h, k); + return d.call(this, a, f, g, h, k) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$4 = c; a.cljs$core$IFn$_invoke$arity$5 = d; - return a; + return a }(); cljs.core.Subvec = function(a, b, c, d, e) { this.meta = a; @@ -12574,215 +8431,185 @@ cljs.core.Subvec = function(a, b, c, d, e) { this.start = c; this.end = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition0$ = 166617887; - this.cljs$lang$protocol_mask$partition1$ = 8192; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32400159 }; -cljs.core.Subvec.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); +cljs.core.Subvec.cljs$lang$type = !0; +cljs.core.Subvec.cljs$lang$ctorStr = "cljs.core/Subvec"; +cljs.core.Subvec.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/Subvec") }; -cljs.core.Subvec.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.Subvec.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; cljs.core.Subvec.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); + return cljs.core._nth.call(null, this, b, null) }; cljs.core.Subvec.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return "number" === typeof b ? cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c) : c; + return cljs.core._nth.call(null, this, b, c) }; -cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return 0 > b || this.end <= this.start + b ? cljs.core.vector_index_out_of_bounds(b, this.end - this.start) : cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.v, this.start + b); +cljs.core.Subvec.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + var d = this, e = d.start + b; + return cljs.core.build_subvec.call(null, d.meta, cljs.core.assoc.call(null, d.v, e, c), d.start, function() { + var a = d.end, b = e + 1; + return a > b ? a : b + }(), null) }; -cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 > b || this.end <= this.start + b ? c : cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this.v, this.start + b, c); +cljs.core.Subvec.prototype.call = function() { + var a = null; + return a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$IIndexed$_nth$arity$2(null, c); + case 3: + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d) + } + throw Error("Invalid arity: " + arguments.length); + } +}(); +cljs.core.Subvec.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; -cljs.core.Subvec.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - var d = this.start + b; - a = this.meta; - c = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.v, d, c); - b = this.start; - var e = this.end, d = d + 1, d = e > d ? e : d; - return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(a, c, b, d, null) : cljs.core.build_subvec.call(null, a, c, b, d, null); +cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$IIndexed$_nth$arity$2(null, a) }; -cljs.core.Subvec.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$IIndexed$_nth$arity$3(null, a, b) +}; +cljs.core.Subvec.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.build_subvec.call(null, this.meta, cljs.core._assoc_n.call(null, this.v, this.end, b), this.start, this.end + 1, null) +}; +cljs.core.Subvec.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) +}; +cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.call(null, this, b) +}; +cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.call(null, this, b, c) }; -cljs.core.Subvec.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.Subvec(this.meta, this.v, this.start, this.end, this.__hash); +cljs.core.Subvec.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + var b = this; + return function d(a) { + return a === b.end ? null : cljs.core.cons.call(null, cljs.core._nth.call(null, b.v, a), new cljs.core.LazySeq(null, function() { + return d.call(null, a + 1) + }, null, null)) + }.call(null, b.start) }; cljs.core.Subvec.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end - this.start; + return this.end - this.start }; cljs.core.Subvec.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this.v, this.end - 1); + return cljs.core._nth.call(null, this.v, this.end - 1) }; cljs.core.Subvec.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - if (this.start === this.end) { + if(this.start === this.end) { throw Error("Can't pop empty vector"); } - a = this.meta; - var b = this.v, c = this.start, d = this.end - 1; - return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(a, b, c, d, null) : cljs.core.build_subvec.call(null, a, b, c, d, null); -}; -cljs.core.Subvec.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return this.start !== this.end ? new cljs.core.RSeq(this, this.end - this.start - 1, null) : null; + return cljs.core.build_subvec.call(null, this.meta, this.v, this.start, this.end - 1, null) }; -cljs.core.Subvec.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +cljs.core.Subvec.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + return cljs.core._assoc.call(null, this, b, c) }; cljs.core.Subvec.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); -}; -cljs.core.Subvec.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.PersistentVector.EMPTY, this.meta); -}; -cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); -}; -cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(this, b, c); -}; -cljs.core.Subvec.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if ("number" === typeof b) { - return cljs.core._assoc_n(this, b, c); - } - throw Error("Subvec's key for assoc must be a number."); -}; -cljs.core.Subvec.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - var b = this; - return function(a) { - return function e(f) { - return f === b.end ? null : cljs.core.cons(cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b.v, f), new cljs.core.LazySeq(null, function(a) { - return function() { - return e(f + 1); - }; - }(a), null, null)); - }; - }(this)(b.start); + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.Subvec.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - var c = this.v, d = this.start, e = this.end, f = this.__hash; - return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : cljs.core.build_subvec.call(null, b, c, d, e, f); -}; -cljs.core.Subvec.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - var c = this.meta, d = cljs.core._assoc_n(this.v, this.end, b), e = this.start, f = this.end + 1; - return cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5 ? cljs.core.build_subvec.cljs$core$IFn$_invoke$arity$5(c, d, e, f, null) : cljs.core.build_subvec.call(null, c, d, e, f, null); + return cljs.core.build_subvec.call(null, b, this.v, this.start, this.end, this.__hash) }; -cljs.core.Subvec.prototype.call = function() { - var a = null, a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$IIndexed$_nth$arity$2(null, c); - case 3: - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$IIndexed$_nth$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); - }; - return a; -}(); -cljs.core.Subvec.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +cljs.core.Subvec.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$IIndexed$_nth$arity$2(null, a); +cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + return 0 > b || this.end <= this.start + b ? cljs.core.vector_index_out_of_bounds.call(null, b, this.end - this.start) : cljs.core._nth.call(null, this.v, this.start + b) }; -cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$IIndexed$_nth$arity$3(null, a, b); +cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 > b || this.end <= this.start + b ? c : cljs.core._nth.call(null, this.v, this.start + b, c) }; -cljs.core.Subvec.cljs$lang$type = !0; -cljs.core.Subvec.cljs$lang$ctorStr = "cljs.core/Subvec"; -cljs.core.Subvec.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Subvec"); +cljs.core.Subvec.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) }; cljs.core.__GT_Subvec = function(a, b, c, d, e) { - return new cljs.core.Subvec(a, b, c, d, e); -}; -cljs.core.Subvec.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.Subvec(a, b, c, d, e) }; cljs.core.build_subvec = function(a, b, c, d, e) { - for (;;) { - if (b instanceof cljs.core.Subvec) { - c = b.start + c, d = b.start + d, b = b.v; - } else { - var f = cljs.core.count(b); - if (0 > c || 0 > d || c > f || d > f) { + for(;;) { + if(b instanceof cljs.core.Subvec) { + c = b.start + c, d = b.start + d, b = b.v + }else { + var f = cljs.core.count.call(null, b); + if(0 > c || 0 > d || c > f || d > f) { throw Error("Index out of bounds"); } - return new cljs.core.Subvec(a, b, c, d, e); + return new cljs.core.Subvec(a, b, c, d, e) } } }; cljs.core.subvec = function() { var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.count(b)); + return a.call(null, b, c, cljs.core.count.call(null, b)) }, c = function(a, b, c) { - return cljs.core.build_subvec(null, a, b, c, null); + return cljs.core.build_subvec.call(null, null, a, b, c, null) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.tv_ensure_editable = function(a, b) { - return a === b.edit ? b : new cljs.core.VectorNode(a, cljs.core.aclone(b.arr)); + return a === b.edit ? b : new cljs.core.VectorNode(a, cljs.core.aclone.call(null, b.arr)) }; cljs.core.tv_editable_root = function(a) { - return new cljs.core.VectorNode({}, cljs.core.aclone(a.arr)); + return new cljs.core.VectorNode({}, cljs.core.aclone.call(null, a.arr)) }; cljs.core.tv_editable_tail = function(a) { var b = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; - cljs.core.array_copy(a, 0, b, 0, a.length); - return b; + cljs.core.array_copy.call(null, a, 0, b, 0, a.length); + return b }; cljs.core.tv_push_tail = function tv_push_tail(b, c, d, e) { - var f = cljs.core.tv_ensure_editable(b.root.edit, d), g = b.cnt - 1 >>> c & 31; - cljs.core.pv_aset(f, g, 5 === c ? e : function() { - var d = cljs.core.pv_aget(f, g); - return null != d ? tv_push_tail(b, c - 5, d, e) : cljs.core.new_path(b.root.edit, c - 5, e); + var f = cljs.core.tv_ensure_editable.call(null, b.root.edit, d), g = b.cnt - 1 >>> c & 31; + cljs.core.pv_aset.call(null, f, g, 5 === c ? e : function() { + var d = cljs.core.pv_aget.call(null, f, g); + return null != d ? tv_push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, b.root.edit, c - 5, e) }()); - return f; + return f }; cljs.core.tv_pop_tail = function tv_pop_tail(b, c, d) { - d = cljs.core.tv_ensure_editable(b.root.edit, d); + d = cljs.core.tv_ensure_editable.call(null, b.root.edit, d); var e = b.cnt - 2 >>> c & 31; - if (5 < c) { - b = tv_pop_tail(b, c - 5, cljs.core.pv_aget(d, e)); - if (null == b && 0 === e) { - return null; + if(5 < c) { + b = tv_pop_tail.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, e)); + if(null == b && 0 === e) { + return null } - cljs.core.pv_aset(d, e, b); - return d; + cljs.core.pv_aset.call(null, d, e, b); + return d } - if (0 === e) { - return null; - } - cljs.core.pv_aset(d, e, null); - return d; + return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (cljs.core.pv_aset.call(null, d, e, null), d) : null }; -cljs.core.unchecked_editable_array_for = function(a, b) { - if (b >= cljs.core.tail_off(a)) { - return a.tail; - } - for (var c = a.root, d = c, e = a.shift;;) { - if (0 < e) { - d = cljs.core.tv_ensure_editable(c.edit, cljs.core.pv_aget(d, b >>> e & 31)), e -= 5; - } else { - return d.arr; +cljs.core.editable_array_for = function(a, b) { + if(0 <= b && b < a.cnt) { + if(b >= cljs.core.tail_off.call(null, a)) { + return a.tail } + for(var c = a.root, d = c, e = a.shift;;) { + if(0 < e) { + d = cljs.core.tv_ensure_editable.call(null, c.edit, cljs.core.pv_aget.call(null, d, b >>> e & 31)), e -= 5 + }else { + return d.arr + } + } + }else { + throw Error([cljs.core.str("No item "), cljs.core.str(b), cljs.core.str(" in transient vector of length "), cljs.core.str(a.cnt)].join("")); } }; cljs.core.TransientVector = function(a, b, c, d) { @@ -12791,150 +8618,143 @@ cljs.core.TransientVector = function(a, b, c, d) { this.root = c; this.tail = d; this.cljs$lang$protocol_mask$partition0$ = 275; - this.cljs$lang$protocol_mask$partition1$ = 88; + this.cljs$lang$protocol_mask$partition1$ = 88 +}; +cljs.core.TransientVector.cljs$lang$type = !0; +cljs.core.TransientVector.cljs$lang$ctorStr = "cljs.core/TransientVector"; +cljs.core.TransientVector.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/TransientVector") }; cljs.core.TransientVector.prototype.call = function() { - var a = null, a = function(a, c, d) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); cljs.core.TransientVector.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.TransientVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; cljs.core.TransientVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; cljs.core.TransientVector.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); + return cljs.core._nth.call(null, this, b, null) }; cljs.core.TransientVector.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return "number" === typeof b ? cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c) : c; + return cljs.core._nth.call(null, this, b, c) }; cljs.core.TransientVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if (this.root.edit) { - return cljs.core.array_for(this, b)[b & 31]; + if(this.root.edit) { + return cljs.core.array_for.call(null, this, b)[b & 31] } throw Error("nth after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.cnt ? cljs.core._nth.cljs$core$IFn$_invoke$arity$2(this, b) : c; + return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c }; cljs.core.TransientVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if (this.root.edit) { - return this.cnt; + if(this.root.edit) { + return this.cnt } throw Error("count after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 = function(a, b, c) { var d = this; - if (d.root.edit) { - if (0 <= b && b < d.cnt) { - return cljs.core.tail_off(this) <= b ? d.tail[b & 31] = c : (a = function(a) { - return function g(a, e) { - var l = cljs.core.tv_ensure_editable(d.root.edit, e); - if (0 === a) { - cljs.core.pv_aset(l, b & 31, c); - } else { - var m = b >>> a & 31; - cljs.core.pv_aset(l, m, g(a - 5, cljs.core.pv_aget(l, m))); - } - return l; - }; - }(this).call(null, d.shift, d.root), d.root = a), this; + if(d.root.edit) { + if(0 <= b && b < d.cnt) { + return cljs.core.tail_off.call(null, this) <= b ? d.tail[b & 31] = c : (a = function f(a, h) { + var k = cljs.core.tv_ensure_editable.call(null, d.root.edit, h); + if(0 === a) { + cljs.core.pv_aset.call(null, k, b & 31, c) + }else { + var l = b >>> a & 31; + cljs.core.pv_aset.call(null, k, l, f.call(null, a - 5, cljs.core.pv_aget.call(null, k, l))) + } + return k + }.call(null, d.shift, d.root), d.root = a), this } - if (b === d.cnt) { - return cljs.core._conj_BANG_(this, c); + if(b === d.cnt) { + return cljs.core._conj_BANG_.call(null, this, c) } - throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds for TransientVector of length"), cljs.core.str(d.cnt)].join("")); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds for TransientVector of length"), cljs.core.str(d.cnt)].join("")); + } + return null } throw Error("assoc! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_pop_BANG_$arity$1 = function(a) { - if (this.root.edit) { - if (0 === this.cnt) { + if(this.root.edit) { + if(0 === this.cnt) { throw Error("Can't pop empty vector"); } - if (1 === this.cnt) { - this.cnt = 0; - } else { - if (0 < (this.cnt - 1 & 31)) { - this.cnt -= 1; - } else { - a = cljs.core.unchecked_editable_array_for(this, this.cnt - 2); - var b; - b = cljs.core.tv_pop_tail(this, this.shift, this.root); - b = null != b ? b : new cljs.core.VectorNode(this.root.edit, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); - 5 < this.shift && null == cljs.core.pv_aget(b, 1) ? (this.root = cljs.core.tv_ensure_editable(this.root.edit, cljs.core.pv_aget(b, 0)), this.shift -= 5) : this.root = b; - this.cnt -= 1; - this.tail = a; - } + if(1 === this.cnt) { + return this.cnt = 0, this + } + if(0 < (this.cnt - 1 & 31)) { + return this.cnt -= 1, this + } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + a = cljs.core.editable_array_for.call(null, this, this.cnt - 2); + var b; + b = cljs.core.tv_pop_tail.call(null, this, this.shift, this.root); + b = null != b ? b : new cljs.core.VectorNode(this.root.edit, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); + 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? (this.root = cljs.core.tv_ensure_editable.call(null, this.root.edit, cljs.core.pv_aget.call(null, b, 0)), this.shift -= 5) : this.root = b; + this.cnt -= 1; + this.tail = a; + return this } - return this; + return null } throw Error("pop! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - if ("number" === typeof b) { - return cljs.core._assoc_n_BANG_(this, b, c); - } - throw Error("TransientVector's key for assoc! must be a number."); + return cljs.core._assoc_n_BANG_.call(null, this, b, c) }; cljs.core.TransientVector.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - if (this.root.edit) { - if (32 > this.cnt - cljs.core.tail_off(this)) { - this.tail[this.cnt & 31] = b; - } else { + if(this.root.edit) { + if(32 > this.cnt - cljs.core.tail_off.call(null, this)) { + this.tail[this.cnt & 31] = b + }else { var c = new cljs.core.VectorNode(this.root.edit, this.tail), d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; d[0] = b; this.tail = d; - if (this.cnt >>> 5 > 1 << this.shift) { + if(this.cnt >>> 5 > 1 << this.shift) { var d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], e = this.shift + 5; d[0] = this.root; - d[1] = cljs.core.new_path(this.root.edit, this.shift, c); + d[1] = cljs.core.new_path.call(null, this.root.edit, this.shift, c); this.root = new cljs.core.VectorNode(this.root.edit, d); - this.shift = e; - } else { - this.root = cljs.core.tv_push_tail(this, this.shift, this.root, c); + this.shift = e + }else { + this.root = cljs.core.tv_push_tail.call(null, this, this.shift, this.root, c) } } this.cnt += 1; - return this; + return this } throw Error("conj! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - if (this.root.edit) { + if(this.root.edit) { this.root.edit = null; - a = this.cnt - cljs.core.tail_off(this); + a = this.cnt - cljs.core.tail_off.call(null, this); var b = Array(a); - cljs.core.array_copy(this.tail, 0, b, 0, a); - return new cljs.core.PersistentVector(null, this.cnt, this.shift, this.root, b, null); + cljs.core.array_copy.call(null, this.tail, 0, b, 0, a); + return new cljs.core.PersistentVector(null, this.cnt, this.shift, this.root, b, null) } throw Error("persistent! called twice"); }; -cljs.core.TransientVector.cljs$lang$type = !0; -cljs.core.TransientVector.cljs$lang$ctorStr = "cljs.core/TransientVector"; -cljs.core.TransientVector.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/TransientVector"); -}; cljs.core.__GT_TransientVector = function(a, b, c, d) { - return new cljs.core.TransientVector(a, b, c, d); + return new cljs.core.TransientVector(a, b, c, d) }; cljs.core.PersistentQueueSeq = function(a, b, c, d) { this.meta = a; @@ -12942,52 +8762,46 @@ cljs.core.PersistentQueueSeq = function(a, b, c, d) { this.rear = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 31850572; -}; -cljs.core.PersistentQueueSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentQueueSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition0$ = 31850572 }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.PersistentQueueSeq.cljs$lang$type = !0; +cljs.core.PersistentQueueSeq.cljs$lang$ctorStr = "cljs.core/PersistentQueueSeq"; +cljs.core.PersistentQueueSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentQueueSeq") }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.PersistentQueueSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.PersistentQueueSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) +}; +cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first(this.front); + return cljs.core.first.call(null, this.front) }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return(a = cljs.core.next(this.front)) ? new cljs.core.PersistentQueueSeq(this.meta, a, this.rear, null) : null == this.rear ? cljs.core._empty(this) : new cljs.core.PersistentQueueSeq(this.meta, this.rear, null, null); + return(a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueueSeq(this.meta, a, this.rear, null) : null == this.rear ? cljs.core._empty.call(null, this) : new cljs.core.PersistentQueueSeq(this.meta, this.rear, null, null) }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.PersistentQueueSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentQueueSeq(b, this.front, this.rear, this.__hash); + return new cljs.core.PersistentQueueSeq(b, this.front, this.rear, this.__hash) }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.PersistentQueueSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.PersistentQueueSeq.cljs$lang$type = !0; -cljs.core.PersistentQueueSeq.cljs$lang$ctorStr = "cljs.core/PersistentQueueSeq"; -cljs.core.PersistentQueueSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentQueueSeq"); +cljs.core.PersistentQueueSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_PersistentQueueSeq = function(a, b, c, d) { - return new cljs.core.PersistentQueueSeq(a, b, c, d); -}; -cljs.core.PersistentQueueSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.PersistentQueueSeq(a, b, c, d) }; cljs.core.PersistentQueue = function(a, b, c, d, e) { this.meta = a; @@ -12995,139 +8809,127 @@ cljs.core.PersistentQueue = function(a, b, c, d, e) { this.front = c; this.rear = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition0$ = 31858766; - this.cljs$lang$protocol_mask$partition1$ = 8192; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 31858766 }; -cljs.core.PersistentQueue.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); +cljs.core.PersistentQueue.cljs$lang$type = !0; +cljs.core.PersistentQueue.cljs$lang$ctorStr = "cljs.core/PersistentQueue"; +cljs.core.PersistentQueue.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentQueue") }; -cljs.core.PersistentQueue.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.PersistentQueue.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.PersistentQueue.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.PersistentQueue.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + var c = this; + return cljs.core.truth_(c.front) ? new cljs.core.PersistentQueue(c.meta, c.count + 1, c.front, cljs.core.conj.call(null, function() { + var a = c.rear; + return cljs.core.truth_(a) ? a : cljs.core.PersistentVector.EMPTY + }(), b), null) : new cljs.core.PersistentQueue(c.meta, c.count + 1, cljs.core.conj.call(null, c.front, b), cljs.core.PersistentVector.EMPTY, null) +}; +cljs.core.PersistentQueue.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.PersistentQueue.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentQueue(this.meta, this.count, this.front, this.rear, this.__hash); +cljs.core.PersistentQueue.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + var b = this, c = cljs.core.seq.call(null, b.rear); + return cljs.core.truth_(function() { + var a = b.front; + return cljs.core.truth_(a) ? a : c + }()) ? new cljs.core.PersistentQueueSeq(null, b.front, cljs.core.seq.call(null, c), null) : null }; cljs.core.PersistentQueue.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.count; + return this.count }; cljs.core.PersistentQueue.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return cljs.core.first(this.front); + return cljs.core.first.call(null, this.front) }; cljs.core.PersistentQueue.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return cljs.core.truth_(this.front) ? (a = cljs.core.next(this.front)) ? new cljs.core.PersistentQueue(this.meta, this.count - 1, a, this.rear, null) : new cljs.core.PersistentQueue(this.meta, this.count - 1, cljs.core.seq(this.rear), cljs.core.PersistentVector.EMPTY, null) : this; -}; -cljs.core.PersistentQueue.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); -}; -cljs.core.PersistentQueue.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); -}; -cljs.core.PersistentQueue.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.PersistentQueue.EMPTY, this.meta); + return cljs.core.truth_(this.front) ? (a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueue(this.meta, this.count - 1, a, this.rear, null) : new cljs.core.PersistentQueue(this.meta, this.count - 1, cljs.core.seq.call(null, this.rear), cljs.core.PersistentVector.EMPTY, null) : this }; cljs.core.PersistentQueue.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first(this.front); + return cljs.core.first.call(null, this.front) }; cljs.core.PersistentQueue.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.rest(cljs.core.seq(this)); + return cljs.core.rest.call(null, cljs.core.seq.call(null, this)) }; -cljs.core.PersistentQueue.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - var b = this, c = cljs.core.seq(b.rear); - return cljs.core.truth_(function() { - var a = b.front; - return cljs.core.truth_(a) ? a : c; - }()) ? new cljs.core.PersistentQueueSeq(null, b.front, cljs.core.seq(c), null) : null; +cljs.core.PersistentQueue.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.PersistentQueue.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentQueue(b, this.count, this.front, this.rear, this.__hash); + return new cljs.core.PersistentQueue(b, this.count, this.front, this.rear, this.__hash) }; -cljs.core.PersistentQueue.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - var c = this; - return cljs.core.truth_(c.front) ? new cljs.core.PersistentQueue(c.meta, c.count + 1, c.front, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(function() { - var a = c.rear; - return cljs.core.truth_(a) ? a : cljs.core.PersistentVector.EMPTY; - }(), b), null) : new cljs.core.PersistentQueue(c.meta, c.count + 1, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(c.front, b), cljs.core.PersistentVector.EMPTY, null); +cljs.core.PersistentQueue.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.PersistentQueue.cljs$lang$type = !0; -cljs.core.PersistentQueue.cljs$lang$ctorStr = "cljs.core/PersistentQueue"; -cljs.core.PersistentQueue.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentQueue"); +cljs.core.PersistentQueue.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.PersistentQueue.EMPTY }; cljs.core.__GT_PersistentQueue = function(a, b, c, d, e) { - return new cljs.core.PersistentQueue(a, b, c, d, e); -}; -cljs.core.PersistentQueue.EMPTY = new cljs.core.PersistentQueue(null, 0, null, cljs.core.PersistentVector.EMPTY, cljs.core.empty_ordered_hash); -cljs.core.PersistentQueue.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.PersistentQueue(a, b, c, d, e) }; +cljs.core.PersistentQueue.EMPTY = new cljs.core.PersistentQueue(null, 0, null, cljs.core.PersistentVector.EMPTY, 0); cljs.core.NeverEquiv = function() { this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2097152; -}; -cljs.core.NeverEquiv.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return!1; -}; -cljs.core.NeverEquiv.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition0$ = 2097152 }; cljs.core.NeverEquiv.cljs$lang$type = !0; cljs.core.NeverEquiv.cljs$lang$ctorStr = "cljs.core/NeverEquiv"; cljs.core.NeverEquiv.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/NeverEquiv"); + return cljs.core._write.call(null, b, "cljs.core/NeverEquiv") +}; +cljs.core.NeverEquiv.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return!1 }; cljs.core.__GT_NeverEquiv = function() { - return new cljs.core.NeverEquiv; + return new cljs.core.NeverEquiv }; cljs.core.never_equiv = new cljs.core.NeverEquiv; cljs.core.equiv_map = function(a, b) { - return cljs.core.boolean$(cljs.core.map_QMARK_(b) ? cljs.core.count(a) === cljs.core.count(b) ? cljs.core.every_QMARK_(cljs.core.identity, cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(a) { - return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(a), cljs.core.never_equiv), cljs.core.second(a)); - }, a)) : null : null); + return cljs.core.boolean$.call(null, cljs.core.map_QMARK_.call(null, b) ? cljs.core.count.call(null, a) === cljs.core.count.call(null, b) ? cljs.core.every_QMARK_.call(null, cljs.core.identity, cljs.core.map.call(null, function(a) { + return cljs.core._EQ_.call(null, cljs.core.get.call(null, b, cljs.core.first.call(null, a), cljs.core.never_equiv), cljs.core.second.call(null, a)) + }, a)) : null : null) }; cljs.core.scan_array = function(a, b, c) { - for (var d = c.length, e = 0;;) { - if (e < d) { - if (b === c[e]) { - return e; + for(var d = c.length, e = 0;;) { + if(e < d) { + if(b === c[e]) { + return e } - e += a; - } else { - return null; + e += a + }else { + return null } } }; cljs.core.obj_map_compare_keys = function(a, b) { - var c = cljs.core.hash(a), d = cljs.core.hash(b); - return c < d ? -1 : c > d ? 1 : 0; + var c = cljs.core.hash.call(null, a), d = cljs.core.hash.call(null, b); + return c < d ? -1 : c > d ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null }; cljs.core.obj_map__GT_hash_map = function(a, b, c) { var d = a.keys, e = d.length, f = a.strobj; - a = cljs.core.meta(a); - for (var g = 0, h = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { - if (g < e) { - var k = d[g], g = g + 1, h = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(h, k, f[k]) - } else { - return cljs.core.with_meta(cljs.core.persistent_BANG_(cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(h, b, c)), a); + a = cljs.core.meta.call(null, a); + for(var g = 0, h = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { + if(g < e) { + var k = d[g], g = g + 1, h = cljs.core.assoc_BANG_.call(null, h, k, f[k]) + }else { + return cljs.core.with_meta.call(null, cljs.core.persistent_BANG_.call(null, cljs.core.assoc_BANG_.call(null, h, b, c)), a) } } }; cljs.core.obj_clone = function(a, b) { var c; c = {}; - for (var d = b.length, e = 0;;) { - if (e < d) { + for(var d = b.length, e = 0;;) { + if(e < d) { var f = b[e]; c[f] = a[f]; - e += 1; - } else { - break; + e += 1 + }else { + break } } - return c; + return c }; cljs.core.ObjMap = function(a, b, c, d, e) { this.meta = a; @@ -13135,1050 +8937,825 @@ cljs.core.ObjMap = function(a, b, c, d, e) { this.strobj = c; this.update_count = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition0$ = 16123663; this.cljs$lang$protocol_mask$partition1$ = 4; + this.cljs$lang$protocol_mask$partition0$ = 16123663 }; -cljs.core.ObjMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.ObjMap.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); -}; -cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - var d = this; - return cljs.core.truth_(function() { - var a; - a = goog.isString(b); - return cljs.core.truth_(a) ? null != cljs.core.scan_array(1, b, d.keys) : a; - }()) ? d.strobj[b] : c; -}; -cljs.core.ObjMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - a = this.keys.sort(cljs.core.obj_map_compare_keys); - for (var d = c;;) { - if (cljs.core.seq(a)) { - var e = c = cljs.core.first(a); - c = this.strobj[c]; - c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(d, e, c) : b.call(null, d, e, c); - if (cljs.core.reduced_QMARK_(c)) { - return b = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); - } - a = cljs.core.rest(a); - d = c; - } else { - return d; - } - } -}; -cljs.core.ObjMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.ObjMap.cljs$lang$type = !0; +cljs.core.ObjMap.cljs$lang$ctorStr = "cljs.core/ObjMap"; +cljs.core.ObjMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ObjMap") }; -cljs.core.ObjMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.keys.length; +cljs.core.ObjMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return cljs.core.transient$.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this)) }; cljs.core.ObjMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); -}; -cljs.core.ObjMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map(this, b); + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) }; -cljs.core.ObjMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return cljs.core.transient$(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentHashMap.EMPTY, this)); -}; -cljs.core.ObjMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.ObjMap.EMPTY, this.meta); +cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.call(null, this, b, null) }; -cljs.core.ObjMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - var c = this; - if (cljs.core.truth_(function() { - var a; - a = goog.isString(b); - return cljs.core.truth_(a) ? null != cljs.core.scan_array(1, b, c.keys) : a; - }())) { - var d = cljs.core.aclone(c.keys), e = cljs.core.obj_clone(c.strobj, c.keys); - d.splice(cljs.core.scan_array(1, b, d), 1); - delete e[b]; - return new cljs.core.ObjMap(c.meta, d, e, c.update_count + 1, null); - } - return this; +cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? this.strobj[b] : c }; cljs.core.ObjMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if (cljs.core.truth_(goog.isString(b))) { - if (this.update_count > cljs.core.ObjMap.HASHMAP_THRESHOLD || this.keys.length >= cljs.core.ObjMap.HASHMAP_THRESHOLD) { - return cljs.core.obj_map__GT_hash_map(this, b, c); + if(goog.isString(b)) { + if(this.update_count > cljs.core.ObjMap.HASHMAP_THRESHOLD || this.keys.length >= cljs.core.ObjMap.HASHMAP_THRESHOLD) { + return cljs.core.obj_map__GT_hash_map.call(null, this, b, c) } - if (null != cljs.core.scan_array(1, b, this.keys)) { - return a = cljs.core.obj_clone(this.strobj, this.keys), a[b] = c, new cljs.core.ObjMap(this.meta, this.keys, a, this.update_count + 1, null); + if(null != cljs.core.scan_array.call(null, 1, b, this.keys)) { + return a = cljs.core.obj_clone.call(null, this.strobj, this.keys), a[b] = c, new cljs.core.ObjMap(this.meta, this.keys, a, this.update_count + 1, null) } - a = cljs.core.obj_clone(this.strobj, this.keys); - var d = cljs.core.aclone(this.keys); + a = cljs.core.obj_clone.call(null, this.strobj, this.keys); + var d = cljs.core.aclone.call(null, this.keys); a[b] = c; d.push(b); - return new cljs.core.ObjMap(this.meta, d, a, this.update_count + 1, null); + return new cljs.core.ObjMap(this.meta, d, a, this.update_count + 1, null) } - return cljs.core.obj_map__GT_hash_map(this, b, c); + return cljs.core.obj_map__GT_hash_map.call(null, this, b, c) }; cljs.core.ObjMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - var c = this; - return cljs.core.truth_(function() { - var a; - a = goog.isString(b); - return cljs.core.truth_(a) ? null != cljs.core.scan_array(1, b, c.keys) : a; - }()) ? !0 : !1; -}; -cljs.core.ObjMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - var b = this; - return 0 < b.keys.length ? cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(a) { - return function(a) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, b.strobj[a]], null); - }; - }(this), b.keys.sort(cljs.core.obj_map_compare_keys)) : null; -}; -cljs.core.ObjMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ObjMap(b, this.keys, this.strobj, this.update_count, this.__hash); -}; -cljs.core.ObjMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_(b) ? cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)) : cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, this, b); + return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? !0 : !1 }; cljs.core.ObjMap.prototype.call = function() { - var a = null, a = function(a, c, d) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); cljs.core.ObjMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.ObjMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; cljs.core.ObjMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; -cljs.core.ObjMap.cljs$lang$type = !0; -cljs.core.ObjMap.cljs$lang$ctorStr = "cljs.core/ObjMap"; -cljs.core.ObjMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ObjMap"); +cljs.core.ObjMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { + for(a = this.keys.sort(cljs.core.obj_map_compare_keys);;) { + if(cljs.core.seq.call(null, a)) { + var d = cljs.core.first.call(null, a); + c = b.call(null, c, d, this.strobj[d]); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) + } + a = cljs.core.rest.call(null, a) + }else { + return c + } + } }; -cljs.core.__GT_ObjMap = function(a, b, c, d, e) { - return new cljs.core.ObjMap(a, b, c, d, e); +cljs.core.ObjMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) }; -cljs.core.ObjMap.EMPTY = new cljs.core.ObjMap(null, [], function() { - return{}; -}(), 0, cljs.core.empty_unordered_hash); -cljs.core.ObjMap.HASHMAP_THRESHOLD = 8; -cljs.core.ObjMap.fromObject = function(a, b) { - return new cljs.core.ObjMap(null, a, b, 0, null); +cljs.core.ObjMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.ES6EntriesIterator = function(a) { - this.s = a; +cljs.core.ObjMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + var b = this; + return 0 < b.keys.length ? cljs.core.map.call(null, function(a) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, b.strobj[a]], null) + }, b.keys.sort(cljs.core.obj_map_compare_keys)) : null }; -cljs.core.ES6EntriesIterator.prototype.next = function() { - if (null != this.s) { - var a = cljs.core.first(this.s), b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 1, null); - this.s = cljs.core.next(this.s); - return{done:!1, value:[b, a]}; - } - return{done:!0, value:null}; +cljs.core.ObjMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.keys.length }; -cljs.core.ES6EntriesIterator.cljs$lang$type = !0; -cljs.core.ES6EntriesIterator.cljs$lang$ctorStr = "cljs.core/ES6EntriesIterator"; -cljs.core.ES6EntriesIterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ES6EntriesIterator"); +cljs.core.ObjMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_map.call(null, this, b) }; -cljs.core.__GT_ES6EntriesIterator = function(a) { - return new cljs.core.ES6EntriesIterator(a); +cljs.core.ObjMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.ObjMap(b, this.keys, this.strobj, this.update_count, this.__hash) }; -cljs.core.es6_entries_iterator = function(a) { - return new cljs.core.ES6EntriesIterator(cljs.core.seq(a)); +cljs.core.ObjMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.ES6SetEntriesIterator = function(a) { - this.s = a; +cljs.core.ObjMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.ObjMap.EMPTY, this.meta) }; -cljs.core.ES6SetEntriesIterator.prototype.next = function() { - if (null != this.s) { - var a = cljs.core.first(this.s); - this.s = cljs.core.next(this.s); - return{done:!1, value:[a, a]}; +cljs.core.ObjMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { + if(goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys)) { + var c = cljs.core.aclone.call(null, this.keys), d = cljs.core.obj_clone.call(null, this.strobj, this.keys); + c.splice(cljs.core.scan_array.call(null, 1, b, c), 1); + delete d[b]; + return new cljs.core.ObjMap(this.meta, c, d, this.update_count + 1, null) } - return{done:!0, value:null}; + return this }; -cljs.core.ES6SetEntriesIterator.cljs$lang$type = !0; -cljs.core.ES6SetEntriesIterator.cljs$lang$ctorStr = "cljs.core/ES6SetEntriesIterator"; -cljs.core.ES6SetEntriesIterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ES6SetEntriesIterator"); -}; -cljs.core.__GT_ES6SetEntriesIterator = function(a) { - return new cljs.core.ES6SetEntriesIterator(a); +cljs.core.__GT_ObjMap = function(a, b, c, d, e) { + return new cljs.core.ObjMap(a, b, c, d, e) }; -cljs.core.es6_set_entries_iterator = function(a) { - return new cljs.core.ES6SetEntriesIterator(cljs.core.seq(a)); +cljs.core.ObjMap.EMPTY = new cljs.core.ObjMap(null, [], function() { + return{} +}(), 0, 0); +cljs.core.ObjMap.HASHMAP_THRESHOLD = 8; +cljs.core.ObjMap.fromObject = function(a, b) { + return new cljs.core.ObjMap(null, a, b, 0, null) }; cljs.core.array_map_index_of_nil_QMARK_ = function(a, b, c) { b = a.length; - for (c = 0;;) { - if (b <= c) { - return-1; + for(c = 0;;) { + if(b <= c) { + return-1 + } + if(null == a[c]) { + return c } - if (null == a[c]) { - return c; + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + c += 2 + }else { + return null } - c += 2; } }; cljs.core.array_map_index_of_keyword_QMARK_ = function(a, b, c) { b = a.length; c = c.fqn; - for (var d = 0;;) { - if (b <= d) { - return-1; + for(var d = 0;;) { + if(b <= d) { + return-1 } var e = a[d]; - if (e instanceof cljs.core.Keyword && c === e.fqn) { - return d; + if(e instanceof cljs.core.Keyword && c === e.fqn) { + return d + } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2 + }else { + return null } - d += 2; } }; cljs.core.array_map_index_of_symbol_QMARK_ = function(a, b, c) { b = a.length; c = c.str; - for (var d = 0;;) { - if (b <= d) { - return-1; + for(var d = 0;;) { + if(b <= d) { + return-1 } var e = a[d]; - if (e instanceof cljs.core.Symbol && c === e.str) { - return d; + if(e instanceof cljs.core.Symbol && c === e.str) { + return d + } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2 + }else { + return null } - d += 2; } }; cljs.core.array_map_index_of_identical_QMARK_ = function(a, b, c) { b = a.length; - for (var d = 0;;) { - if (b <= d) { - return-1; + for(var d = 0;;) { + if(b <= d) { + return-1 } - if (c === a[d]) { - return d; + if(c === a[d]) { + return d + } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2 + }else { + return null } - d += 2; } }; cljs.core.array_map_index_of_equiv_QMARK_ = function(a, b, c) { b = a.length; - for (var d = 0;;) { - if (b <= d) { - return-1; + for(var d = 0;;) { + if(b <= d) { + return-1 + } + if(cljs.core._EQ_.call(null, c, a[d])) { + return d } - if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, a[d])) { - return d; + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2 + }else { + return null } - d += 2; } }; cljs.core.array_map_index_of = function(a, b) { var c = a.arr; - return b instanceof cljs.core.Keyword ? cljs.core.array_map_index_of_keyword_QMARK_(c, a, b) : cljs.core.truth_(function() { - var a; - a = goog.isString(b); - return cljs.core.truth_(a) ? a : "number" === typeof b; - }()) ? cljs.core.array_map_index_of_identical_QMARK_(c, a, b) : b instanceof cljs.core.Symbol ? cljs.core.array_map_index_of_symbol_QMARK_(c, a, b) : null == b ? cljs.core.array_map_index_of_nil_QMARK_(c, a, b) : cljs.core.array_map_index_of_equiv_QMARK_(c, a, b); + return b instanceof cljs.core.Keyword ? cljs.core.array_map_index_of_keyword_QMARK_.call(null, c, a, b) : goog.isString(b) || "number" === typeof b ? cljs.core.array_map_index_of_identical_QMARK_.call(null, c, a, b) : b instanceof cljs.core.Symbol ? cljs.core.array_map_index_of_symbol_QMARK_.call(null, c, a, b) : null == b ? cljs.core.array_map_index_of_nil_QMARK_.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.array_map_index_of_equiv_QMARK_.call(null, + c, a, b) : null }; cljs.core.array_map_extend_kv = function(a, b, c) { a = a.arr; - for (var d = a.length, e = Array(d + 2), f = 0;;) { - if (f < d) { - e[f] = a[f], f += 1; - } else { - break; + for(var d = a.length, e = Array(d + 2), f = 0;;) { + if(f < d) { + e[f] = a[f], f += 1 + }else { + break } } e[d] = b; e[d + 1] = c; - return e; + return e }; cljs.core.PersistentArrayMapSeq = function(a, b, c) { this.arr = a; this.i = b; this._meta = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374990; + this.cljs$lang$protocol_mask$partition0$ = 32374990 }; -cljs.core.PersistentArrayMapSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentArrayMapSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.PersistentArrayMapSeq.cljs$lang$type = !0; +cljs.core.PersistentArrayMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapSeq"; +cljs.core.PersistentArrayMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMapSeq") }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_coll.call(null, this) }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : null; -}; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return(this.arr.length - this.i) / 2; -}; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_ordered_coll(this); + return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : null }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this._meta); +cljs.core.PersistentArrayMapSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); -}; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null); -}; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : cljs.core.List.EMPTY; + return cljs.core.seq_reduce.call(null, b, c, this) }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; -}; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentArrayMapSeq(this.arr, this.i, b); -}; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); -}; -cljs.core.PersistentArrayMapSeq.cljs$lang$type = !0; -cljs.core.PersistentArrayMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapSeq"; -cljs.core.PersistentArrayMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentArrayMapSeq"); + return this }; -cljs.core.__GT_PersistentArrayMapSeq = function(a, b, c) { - return new cljs.core.PersistentArrayMapSeq(a, b, c); +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return(this.arr.length - this.i) / 2 }; -cljs.core.PersistentArrayMapSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null) }; -cljs.core.persistent_array_map_seq = function(a, b, c) { - return b <= a.length - 2 ? new cljs.core.PersistentArrayMapSeq(a, b, c) : null; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { + return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : cljs.core.List.EMPTY }; -cljs.core.PersistentArrayMapIterator = function(a, b, c) { - this.arr = a; - this.i = b; - this.cnt = c; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; -cljs.core.PersistentArrayMapIterator.prototype.hasNext = function() { - return this.i < this.cnt; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentArrayMapSeq(this.arr, this.i, b) +}; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta }; -cljs.core.PersistentArrayMapIterator.prototype.next = function() { - var a = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null); - this.i += 2; - return a; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) }; -cljs.core.PersistentArrayMapIterator.cljs$lang$type = !0; -cljs.core.PersistentArrayMapIterator.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapIterator"; -cljs.core.PersistentArrayMapIterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentArrayMapIterator"); +cljs.core.__GT_PersistentArrayMapSeq = function(a, b, c) { + return new cljs.core.PersistentArrayMapSeq(a, b, c) }; -cljs.core.__GT_PersistentArrayMapIterator = function(a, b, c) { - return new cljs.core.PersistentArrayMapIterator(a, b, c); +cljs.core.persistent_array_map_seq = function(a, b, c) { + return b <= a.length - 2 ? new cljs.core.PersistentArrayMapSeq(a, b, c) : null }; cljs.core.PersistentArrayMap = function(a, b, c, d) { this.meta = a; this.cnt = b; this.arr = c; this.__hash = d; - this.cljs$lang$protocol_mask$partition0$ = 16647951; - this.cljs$lang$protocol_mask$partition1$ = 8196; + this.cljs$lang$protocol_mask$partition1$ = 4; + this.cljs$lang$protocol_mask$partition0$ = 16123663 }; -cljs.core.PersistentArrayMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); +cljs.core.PersistentArrayMap.cljs$lang$type = !0; +cljs.core.PersistentArrayMap.cljs$lang$ctorStr = "cljs.core/PersistentArrayMap"; +cljs.core.PersistentArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMap") }; -cljs.core.PersistentArrayMap.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.PersistentArrayMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return new cljs.core.TransientArrayMap({}, this.arr.length, cljs.core.aclone.call(null, this.arr)) }; -cljs.core.PersistentArrayMap.prototype.keys = function() { - return cljs.core.es6_iterator(cljs.core.keys.cljs$core$IFn$_invoke$arity$1 ? cljs.core.keys.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.keys.call(null, this)); +cljs.core.PersistentArrayMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) }; -cljs.core.PersistentArrayMap.prototype.entries = function() { - return cljs.core.es6_entries_iterator(cljs.core.seq(this)); +cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.call(null, this, b, null) }; -cljs.core.PersistentArrayMap.prototype.values = function() { - return cljs.core.es6_iterator(cljs.core.vals.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vals.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.vals.call(null, this)); +cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + a = cljs.core.array_map_index_of.call(null, this, b); + return-1 === a ? c : this.arr[a + 1] }; -cljs.core.PersistentArrayMap.prototype.has = function(a) { - return cljs.core.contains_QMARK_(this, a); +cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + a = cljs.core.array_map_index_of.call(null, this, b); + return-1 === a ? this.cnt < cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (c = cljs.core.array_map_extend_kv.call(null, this, b, c), new cljs.core.PersistentArrayMap(this.meta, this.cnt + 1, c, null)) : cljs.core._with_meta.call(null, cljs.core._assoc.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this), b, c), this.meta) : c === this.arr[a + 1] ? this : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = cljs.core.aclone.call(null, this.arr), b[a + 1] = c, + new cljs.core.PersistentArrayMap(this.meta, this.cnt, b, null)) : null }; -cljs.core.PersistentArrayMap.prototype.get = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); +cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { + return-1 !== cljs.core.array_map_index_of.call(null, this, b) }; -cljs.core.PersistentArrayMap.prototype.forEach = function(a) { - for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { - if (e < d) { - var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); - a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); - e += 1; - } else { - if (b = cljs.core.seq(b)) { - cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; - } else { - return null; - } +cljs.core.PersistentArrayMap.prototype.call = function() { + var a = null; + return a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + case 3: + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } + throw Error("Invalid arity: " + arguments.length); } +}(); +cljs.core.PersistentArrayMap.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); +cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - a = cljs.core.array_map_index_of(this, b); - return-1 === a ? c : this.arr[a + 1]; +cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; cljs.core.PersistentArrayMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { a = this.arr.length; - for (var d = 0;;) { - if (d < a) { - var e = this.arr[d], f = this.arr[d + 1]; - c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, e, f) : b.call(null, c, e, f); - if (cljs.core.reduced_QMARK_(c)) { - return b = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); + for(var d = 0;;) { + if(d < a) { + c = b.call(null, c, this.arr[d], this.arr[d + 1]); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) } - d += 2; - } else { - return c; + d += 2 + }else { + return c } } }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IIterable$ = !0; -cljs.core.PersistentArrayMap.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { - return new cljs.core.PersistentArrayMapIterator(this.arr, 0, 2 * this.cnt); +cljs.core.PersistentArrayMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.PersistentArrayMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentArrayMap(this.meta, this.cnt, this.arr, this.__hash); +cljs.core.PersistentArrayMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.persistent_array_map_seq.call(null, this.arr, 0, null) }; cljs.core.PersistentArrayMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt; -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); + return this.cnt }; cljs.core.PersistentArrayMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - if (b && (b.cljs$lang$protocol_mask$partition0$ & 1024 || b.cljs$core$IMap$)) { - var c = this.arr.length; - if (this.cnt === b.cljs$core$ICounted$_count$arity$1(null)) { - for (var d = 0;;) { - if (d < c) { - var e = b.cljs$core$ILookup$_lookup$arity$3(null, this.arr[d], cljs.core.lookup_sentinel); - if (e !== cljs.core.lookup_sentinel) { - if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this.arr[d + 1], e)) { - d += 2; - } else { - return!1; - } - } else { - return!1; - } - } else { - return!0; - } - } - } else { - return!1; - } - } else { - return cljs.core.equiv_map(this, b); - } + return cljs.core.equiv_map.call(null, this, b) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientArrayMap({}, this.arr.length, cljs.core.aclone(this.arr)); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta(cljs.core.PersistentArrayMap.EMPTY, this.meta); +cljs.core.PersistentArrayMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentArrayMap(b, this.cnt, this.arr, this.__hash) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); +cljs.core.PersistentArrayMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); +cljs.core.PersistentArrayMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core._with_meta.call(null, cljs.core.PersistentArrayMap.EMPTY, this.meta) }; cljs.core.PersistentArrayMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if (0 <= cljs.core.array_map_index_of(this, b)) { + if(0 <= cljs.core.array_map_index_of.call(null, this, b)) { var c = this.arr.length, d = c - 2; - if (0 === d) { - return cljs.core._empty(this); + if(0 === d) { + return cljs.core._empty.call(null, this) } - for (var d = Array(d), e = 0, f = 0;;) { - if (e >= c) { - return new cljs.core.PersistentArrayMap(this.meta, this.cnt - 1, d, null); + for(var d = Array(d), e = 0, f = 0;;) { + if(e >= c) { + return new cljs.core.PersistentArrayMap(this.meta, this.cnt - 1, d, null) + } + if(cljs.core._EQ_.call(null, b, this.arr[e])) { + e += 2 + }else { + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d[f] = this.arr[e], d[f + 1] = this.arr[e + 1], f += 2, e += 2 + }else { + return null + } } - cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(b, this.arr[e]) || (d[f] = this.arr[e], d[f + 1] = this.arr[e + 1], f += 2); - e += 2; - } - } else { - return this; - } -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - a = cljs.core.array_map_index_of(this, b); - if (-1 === a) { - return this.cnt < cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (c = cljs.core.array_map_extend_kv(this, b, c), new cljs.core.PersistentArrayMap(this.meta, this.cnt + 1, c, null)) : cljs.core._with_meta(cljs.core._assoc(cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentHashMap.EMPTY, this), b, c), this.meta); - } - if (c === this.arr[a + 1]) { - return this; - } - b = cljs.core.aclone(this.arr); - b[a + 1] = c; - return new cljs.core.PersistentArrayMap(this.meta, this.cnt, b, null); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return-1 !== cljs.core.array_map_index_of(this, b); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.persistent_array_map_seq(this.arr, 0, null); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentArrayMap(b, this.cnt, this.arr, this.__hash); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - if (cljs.core.vector_QMARK_(b)) { - return cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)); - } - for (var c = this, d = cljs.core.seq(b);;) { - if (null == d) { - return c; - } - var e = cljs.core.first(d); - if (cljs.core.vector_QMARK_(e)) { - c = cljs.core._assoc(c, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 1)), d = cljs.core.next(d); - } else { - throw Error("conj on a map takes map entries or seqables of map entries"); } + }else { + return this } }; -cljs.core.PersistentArrayMap.prototype.call = function() { - var a = null, a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; -}(); -cljs.core.PersistentArrayMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); -}; -cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); -}; -cljs.core.PersistentArrayMap.cljs$lang$type = !0; -cljs.core.PersistentArrayMap.cljs$lang$ctorStr = "cljs.core/PersistentArrayMap"; -cljs.core.PersistentArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentArrayMap"); -}; cljs.core.__GT_PersistentArrayMap = function(a, b, c, d) { - return new cljs.core.PersistentArrayMap(a, b, c, d); + return new cljs.core.PersistentArrayMap(a, b, c, d) }; -cljs.core.PersistentArrayMap.EMPTY = new cljs.core.PersistentArrayMap(null, 0, [], cljs.core.empty_unordered_hash); +cljs.core.PersistentArrayMap.EMPTY = new cljs.core.PersistentArrayMap(null, 0, [], null); cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD = 8; cljs.core.PersistentArrayMap.fromArray = function(a, b, c) { - a = b ? a : cljs.core.aclone(a); - if (c) { - return new cljs.core.PersistentArrayMap(null, a.length / 2, a, null); + a = b ? a : cljs.core.aclone.call(null, a); + if(c) { + return new cljs.core.PersistentArrayMap(null, a.length / 2, a, null) } c = a.length; b = 0; - for (var d = cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY);;) { - if (b < c) { - var e = b + 2, d = cljs.core._assoc_BANG_(d, a[b], a[b + 1]); - b = e; - } else { - return cljs.core._persistent_BANG_(d); + for(var d = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { + if(b < c) { + var e = b + 2, d = cljs.core._assoc_BANG_.call(null, d, a[b], a[b + 1]); + b = e + }else { + return cljs.core._persistent_BANG_.call(null, d) } } }; -cljs.core.PersistentArrayMap.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; cljs.core.TransientArrayMap = function(a, b, c) { this.editable_QMARK_ = a; this.len = b; this.arr = c; this.cljs$lang$protocol_mask$partition1$ = 56; - this.cljs$lang$protocol_mask$partition0$ = 258; + this.cljs$lang$protocol_mask$partition0$ = 258 +}; +cljs.core.TransientArrayMap.cljs$lang$type = !0; +cljs.core.TransientArrayMap.cljs$lang$ctorStr = "cljs.core/TransientArrayMap"; +cljs.core.TransientArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/TransientArrayMap") }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 = function(a, b) { - if (cljs.core.truth_(this.editable_QMARK_)) { - var c = cljs.core.array_map_index_of(this, b); + if(cljs.core.truth_(this.editable_QMARK_)) { + var c = cljs.core.array_map_index_of.call(null, this, b); 0 <= c && (this.arr[c] = this.arr[this.len - 2], this.arr[c + 1] = this.arr[this.len - 1], c = this.arr, c.pop(), c.pop(), this.len -= 2); - return this; + return this } throw Error("dissoc! after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - var d = this; - if (cljs.core.truth_(d.editable_QMARK_)) { - a = cljs.core.array_map_index_of(this, b); - if (-1 === a) { - return d.len + 2 <= 2 * cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (d.len += 2, d.arr.push(b), d.arr.push(c), this) : cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(function() { - var a = d.len, b = d.arr; - return cljs.core.array__GT_transient_hash_map.cljs$core$IFn$_invoke$arity$2 ? cljs.core.array__GT_transient_hash_map.cljs$core$IFn$_invoke$arity$2(a, b) : cljs.core.array__GT_transient_hash_map.call(null, a, b); - }(), b, c); + if(cljs.core.truth_(this.editable_QMARK_)) { + a = cljs.core.array_map_index_of.call(null, this, b); + if(-1 === a) { + return this.len + 2 <= 2 * cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (this.len += 2, this.arr.push(b), this.arr.push(c), this) : cljs.core.assoc_BANG_.call(null, cljs.core.array__GT_transient_hash_map.call(null, this.len, this.arr), b, c) } - c !== d.arr[a + 1] && (d.arr[a + 1] = c); - return this; + c !== this.arr[a + 1] && (this.arr[a + 1] = c); + return this } throw Error("assoc! after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - if (cljs.core.truth_(this.editable_QMARK_)) { - if (b ? b.cljs$lang$protocol_mask$partition0$ & 2048 || b.cljs$core$IMapEntry$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, b)) : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, b)) { - return cljs.core._assoc_BANG_(this, cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.key.call(null, b), cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.val.call(null, b)); - } - for (var c = cljs.core.seq(b), d = this;;) { - var e = cljs.core.first(c); - if (cljs.core.truth_(e)) { - var f = e, c = cljs.core.next(c), d = cljs.core._assoc_BANG_(d, function() { - var a = f; - return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a); - }(), function() { - var a = f; - return cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a); - }()) - } else { - return d; + if(cljs.core.truth_(this.editable_QMARK_)) { + if(b ? b.cljs$lang$protocol_mask$partition0$ & 2048 || b.cljs$core$IMapEntry$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) { + return cljs.core._assoc_BANG_.call(null, this, cljs.core.key.call(null, b), cljs.core.val.call(null, b)) + } + for(var c = cljs.core.seq.call(null, b), d = this;;) { + var e = cljs.core.first.call(null, c); + if(cljs.core.truth_(e)) { + c = cljs.core.next.call(null, c), d = cljs.core._assoc_BANG_.call(null, d, cljs.core.key.call(null, e), cljs.core.val.call(null, e)) + }else { + return d } } - } else { + }else { throw Error("conj! after persistent!"); } }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - if (cljs.core.truth_(this.editable_QMARK_)) { - return this.editable_QMARK_ = !1, new cljs.core.PersistentArrayMap(null, cljs.core.quot(this.len, 2), this.arr, null); + if(cljs.core.truth_(this.editable_QMARK_)) { + return this.editable_QMARK_ = !1, new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, this.len, 2), this.arr, null) } throw Error("persistent! called twice"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); + return cljs.core._lookup.call(null, this, b, null) }; cljs.core.TransientArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - if (cljs.core.truth_(this.editable_QMARK_)) { - return a = cljs.core.array_map_index_of(this, b), -1 === a ? c : this.arr[a + 1]; + if(cljs.core.truth_(this.editable_QMARK_)) { + return a = cljs.core.array_map_index_of.call(null, this, b), -1 === a ? c : this.arr[a + 1] } throw Error("lookup after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if (cljs.core.truth_(this.editable_QMARK_)) { - return cljs.core.quot(this.len, 2); + if(cljs.core.truth_(this.editable_QMARK_)) { + return cljs.core.quot.call(null, this.len, 2) } throw Error("count after persistent!"); }; -cljs.core.TransientArrayMap.cljs$lang$type = !0; -cljs.core.TransientArrayMap.cljs$lang$ctorStr = "cljs.core/TransientArrayMap"; -cljs.core.TransientArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/TransientArrayMap"); -}; cljs.core.__GT_TransientArrayMap = function(a, b, c) { - return new cljs.core.TransientArrayMap(a, b, c); + return new cljs.core.TransientArrayMap(a, b, c) }; cljs.core.array__GT_transient_hash_map = function(a, b) { - for (var c = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY), d = 0;;) { - if (d < a) { - c = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(c, b[d], b[d + 1]), d += 2; - } else { - return c; + for(var c = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY), d = 0;;) { + if(d < a) { + c = cljs.core.assoc_BANG_.call(null, c, b[d], b[d + 1]), d += 2 + }else { + return c } } }; cljs.core.Box = function(a) { - this.val = a; + this.val = a }; cljs.core.Box.cljs$lang$type = !0; cljs.core.Box.cljs$lang$ctorStr = "cljs.core/Box"; cljs.core.Box.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Box"); + return cljs.core._write.call(null, b, "cljs.core/Box") }; cljs.core.__GT_Box = function(a) { - return new cljs.core.Box(a); + return new cljs.core.Box(a) }; cljs.core.key_test = function(a, b) { - return a === b ? !0 : cljs.core.keyword_identical_QMARK_(a, b) ? !0 : cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a, b); + return a === b ? !0 : cljs.core.keyword_identical_QMARK_.call(null, a, b) ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._EQ_.call(null, a, b) : null }; cljs.core.mask = function(a, b) { - return a >>> b & 31; + return a >>> b & 31 }; cljs.core.clone_and_set = function() { var a = null, b = function(a, b, c) { - a = cljs.core.aclone(a); + a = cljs.core.aclone.call(null, a); a[b] = c; - return a; + return a }, c = function(a, b, c, g, h) { - a = cljs.core.aclone(a); + a = cljs.core.aclone.call(null, a); a[b] = c; a[g] = h; - return a; + return a }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h); + return c.call(this, a, e, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a; + return a }(); cljs.core.remove_pair = function(a, b) { var c = Array(a.length - 2); - cljs.core.array_copy(a, 0, c, 0, 2 * b); - cljs.core.array_copy(a, 2 * (b + 1), c, 2 * b, c.length - 2 * b); - return c; + cljs.core.array_copy.call(null, a, 0, c, 0, 2 * b); + cljs.core.array_copy.call(null, a, 2 * (b + 1), c, 2 * b, c.length - 2 * b); + return c }; cljs.core.bitmap_indexed_node_index = function(a, b) { - return cljs.core.bit_count(a & b - 1); + return cljs.core.bit_count.call(null, a & b - 1) }; cljs.core.bitpos = function(a, b) { - return 1 << (a >>> b & 31); + return 1 << (a >>> b & 31) }; cljs.core.edit_and_set = function() { var a = null, b = function(a, b, c, g) { a = a.ensure_editable(b); a.arr[c] = g; - return a; + return a }, c = function(a, b, c, g, h, k) { a = a.ensure_editable(b); a.arr[c] = g; a.arr[h] = k; - return a; + return a }, a = function(a, e, f, g, h, k) { switch(arguments.length) { case 4: return b.call(this, a, e, f, g); case 6: - return c.call(this, a, e, f, g, h, k); + return c.call(this, a, e, f, g, h, k) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$4 = b; a.cljs$core$IFn$_invoke$arity$6 = c; - return a; + return a }(); cljs.core.inode_kv_reduce = function(a, b, c) { - for (var d = a.length, e = 0, f = c;;) { - if (e < d) { - c = a[e]; - if (null != c) { - var g = a[e + 1]; - c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(f, c, g) : b.call(null, f, c, g); - } else { - c = a[e + 1], c = null != c ? c.kv_reduce(b, f) : f; - } - if (cljs.core.reduced_QMARK_(c)) { - return a = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + for(var d = a.length, e = 0;;) { + if(e < d) { + var f = a[e]; + null != f ? c = b.call(null, c, f, a[e + 1]) : (f = a[e + 1], c = null != f ? f.kv_reduce(b, c) : c); + if(cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c) } - e += 2; - f = c; - } else { - return f; + e += 2 + }else { + return c } } }; cljs.core.BitmapIndexedNode = function(a, b, c) { this.edit = a; this.bitmap = b; - this.arr = c; -}; -cljs.core.BitmapIndexedNode.prototype.ensure_editable = function(a) { - if (a === this.edit) { - return this; - } - var b = cljs.core.bit_count(this.bitmap), c = Array(0 > b ? 4 : 2 * (b + 1)); - cljs.core.array_copy(this.arr, 0, c, 0, 2 * b); - return new cljs.core.BitmapIndexedNode(a, this.bitmap, c); + this.arr = c }; -cljs.core.BitmapIndexedNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { - var f = 1 << (c >>> b & 31); - if (0 === (this.bitmap & f)) { - return this; - } - var g = cljs.core.bitmap_indexed_node_index(this.bitmap, f), h = this.arr[2 * g], k = this.arr[2 * g + 1]; - return null == h ? (b = k.inode_without_BANG_(a, b + 5, c, d, e), b === k ? this : null != b ? cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, 2 * g + 1, b) : this.bitmap === f ? null : this.edit_and_remove_pair(a, f, g)) : cljs.core.key_test(d, h) ? (e[0] = !0, this.edit_and_remove_pair(a, f, g)) : this; +cljs.core.BitmapIndexedNode.cljs$lang$type = !0; +cljs.core.BitmapIndexedNode.cljs$lang$ctorStr = "cljs.core/BitmapIndexedNode"; +cljs.core.BitmapIndexedNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/BitmapIndexedNode") }; cljs.core.BitmapIndexedNode.prototype.edit_and_remove_pair = function(a, b, c) { - if (this.bitmap === b) { - return null; + if(this.bitmap === b) { + return null } a = this.ensure_editable(a); var d = a.arr, e = d.length; a.bitmap ^= b; - cljs.core.array_copy(d, 2 * (c + 1), d, 2 * c, e - 2 * (c + 1)); + cljs.core.array_copy.call(null, d, 2 * (c + 1), d, 2 * c, e - 2 * (c + 1)); d[e - 2] = null; d[e - 1] = null; - return a; -}; -cljs.core.BitmapIndexedNode.prototype.inode_seq = function() { - var a = this.arr; - return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.create_inode_seq.call(null, a); -}; -cljs.core.BitmapIndexedNode.prototype.kv_reduce = function(a, b) { - return cljs.core.inode_kv_reduce(this.arr, a, b); -}; -cljs.core.BitmapIndexedNode.prototype.inode_lookup = function(a, b, c, d) { - var e = 1 << (b >>> a & 31); - if (0 === (this.bitmap & e)) { - return d; - } - var f = cljs.core.bitmap_indexed_node_index(this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; - return null == e ? f.inode_lookup(a + 5, b, c, d) : cljs.core.key_test(c, e) ? f : d; + return a }; cljs.core.BitmapIndexedNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - var g = 1 << (c >>> b & 31), h = cljs.core.bitmap_indexed_node_index(this.bitmap, g); - if (0 === (this.bitmap & g)) { - var k = cljs.core.bit_count(this.bitmap); - if (2 * k < this.arr.length) { - var l = this.ensure_editable(a), m = l.arr; - f.val = !0; - cljs.core.array_copy_downward(m, 2 * h, m, 2 * (h + 1), 2 * (k - h)); - m[2 * h] = d; - m[2 * h + 1] = e; - l.bitmap |= g; - return l; + var g = 1 << (c >>> b & 31), h = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, g); + if(0 === (this.bitmap & g)) { + var k = cljs.core.bit_count.call(null, this.bitmap); + if(2 * k < this.arr.length) { + return a = this.ensure_editable(a), b = a.arr, f.val = !0, cljs.core.array_copy_downward.call(null, b, 2 * h, b, 2 * (h + 1), 2 * (k - h)), b[2 * h] = d, b[2 * h + 1] = e, a.bitmap |= g, a } - if (16 <= k) { - g = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; - g[c >>> b & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f); - for (l = h = 0;;) { - if (32 > h) { - 0 !== (this.bitmap >>> h & 1) && (g[h] = null != this.arr[l] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, cljs.core.hash(this.arr[l]), this.arr[l], this.arr[l + 1], f) : this.arr[l + 1], l += 2), h += 1; - } else { - break; - } - } - return new cljs.core.ArrayNode(a, k + 1, g); - } - m = Array(2 * (k + 4)); - cljs.core.array_copy(this.arr, 0, m, 0, 2 * h); - m[2 * h] = d; - m[2 * h + 1] = e; - cljs.core.array_copy(this.arr, 2 * h, m, 2 * (h + 1), 2 * (k - h)); - f.val = !0; - l = this.ensure_editable(a); - l.arr = m; - l.bitmap |= g; - return l; - } - var n = this.arr[2 * h], p = this.arr[2 * h + 1]; - if (null == n) { - return k = p.inode_assoc_BANG_(a, b + 5, c, d, e, f), k === p ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, 2 * h + 1, k); - } - if (cljs.core.key_test(d, n)) { - return e === p ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, 2 * h + 1, e); - } - f.val = !0; - return cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$6(this, a, 2 * h, null, 2 * h + 1, function() { - var f = b + 5; - return cljs.core.create_node.cljs$core$IFn$_invoke$arity$7 ? cljs.core.create_node.cljs$core$IFn$_invoke$arity$7(a, f, n, p, c, d, e) : cljs.core.create_node.call(null, a, f, n, p, c, d, e); - }()); -}; -cljs.core.BitmapIndexedNode.prototype.inode_assoc = function(a, b, c, d, e) { - var f = 1 << (b >>> a & 31), g = cljs.core.bitmap_indexed_node_index(this.bitmap, f); - if (0 === (this.bitmap & f)) { - var h = cljs.core.bit_count(this.bitmap); - if (16 <= h) { - f = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; - f[b >>> a & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e); - for (var k = g = 0;;) { - if (32 > g) { - 0 !== (this.bitmap >>> g & 1) && (f[g] = null != this.arr[k] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, cljs.core.hash(this.arr[k]), this.arr[k], this.arr[k + 1], e) : this.arr[k + 1], k += 2), g += 1; - } else { - break; + if(16 <= k) { + h = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; + h[c >>> b & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f); + for(e = d = 0;;) { + if(32 > d) { + 0 !== (this.bitmap >>> d & 1) && (h[d] = null != this.arr[e] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, cljs.core.hash.call(null, this.arr[e]), this.arr[e], this.arr[e + 1], f) : this.arr[e + 1], e += 2), d += 1 + }else { + break } } - return new cljs.core.ArrayNode(null, h + 1, f); + return new cljs.core.ArrayNode(a, k + 1, h) } - k = Array(2 * (h + 1)); - cljs.core.array_copy(this.arr, 0, k, 0, 2 * g); - k[2 * g] = c; - k[2 * g + 1] = d; - cljs.core.array_copy(this.arr, 2 * g, k, 2 * (g + 1), 2 * (h - g)); - e.val = !0; - return new cljs.core.BitmapIndexedNode(null, this.bitmap | f, k); + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = Array(2 * (k + 4)), cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * h), b[2 * h] = d, b[2 * h + 1] = e, cljs.core.array_copy.call(null, this.arr, 2 * h, b, 2 * (h + 1), 2 * (k - h)), f.val = !0, a = this.ensure_editable(a), a.arr = b, a.bitmap |= g, a) : null } - var l = this.arr[2 * g], m = this.arr[2 * g + 1]; - if (null == l) { - return h = m.inode_assoc(a + 5, b, c, d, e), h === m ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, 2 * g + 1, h)); + k = this.arr[2 * h]; + g = this.arr[2 * h + 1]; + return null == k ? (k = g.inode_assoc_BANG_(a, b + 5, c, d, e, f), k === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, k)) : cljs.core.key_test.call(null, d, k) ? e === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, e) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (f.val = !0, cljs.core.edit_and_set.call(null, this, a, 2 * h, null, 2 * h + 1, cljs.core.create_node.call(null, a, b + 5, k, g, c, d, e))) : null +}; +cljs.core.BitmapIndexedNode.prototype.inode_seq = function() { + return cljs.core.create_inode_seq.call(null, this.arr) +}; +cljs.core.BitmapIndexedNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { + var f = 1 << (c >>> b & 31); + if(0 === (this.bitmap & f)) { + return this } - if (cljs.core.key_test(c, l)) { - return d === m ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, 2 * g + 1, d)); + var g = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, f), h = this.arr[2 * g], k = this.arr[2 * g + 1]; + return null == h ? (b = k.inode_without_BANG_(a, b + 5, c, d, e), b === k ? this : null != b ? cljs.core.edit_and_set.call(null, this, a, 2 * g + 1, b) : this.bitmap === f ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.edit_and_remove_pair(a, f, g) : null) : cljs.core.key_test.call(null, d, h) ? (e[0] = !0, this.edit_and_remove_pair(a, f, g)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null +}; +cljs.core.BitmapIndexedNode.prototype.ensure_editable = function(a) { + if(a === this.edit) { + return this } - e.val = !0; - return new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$5(this.arr, 2 * g, null, 2 * g + 1, function() { - var e = a + 5; - return cljs.core.create_node.cljs$core$IFn$_invoke$arity$6 ? cljs.core.create_node.cljs$core$IFn$_invoke$arity$6(e, l, m, b, c, d) : cljs.core.create_node.call(null, e, l, m, b, c, d); - }())); + var b = cljs.core.bit_count.call(null, this.bitmap), c = Array(0 > b ? 4 : 2 * (b + 1)); + cljs.core.array_copy.call(null, this.arr, 0, c, 0, 2 * b); + return new cljs.core.BitmapIndexedNode(a, this.bitmap, c) +}; +cljs.core.BitmapIndexedNode.prototype.kv_reduce = function(a, b) { + return cljs.core.inode_kv_reduce.call(null, this.arr, a, b) }; cljs.core.BitmapIndexedNode.prototype.inode_find = function(a, b, c, d) { var e = 1 << (b >>> a & 31); - if (0 === (this.bitmap & e)) { - return d; + if(0 === (this.bitmap & e)) { + return d } - var f = cljs.core.bitmap_indexed_node_index(this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; - return null == e ? f.inode_find(a + 5, b, c, d) : cljs.core.key_test(c, e) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [e, f], null) : d; + var f = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; + return null == e ? f.inode_find(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [e, f], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null }; cljs.core.BitmapIndexedNode.prototype.inode_without = function(a, b, c) { var d = 1 << (b >>> a & 31); - if (0 === (this.bitmap & d)) { - return this; + if(0 === (this.bitmap & d)) { + return this } - var e = cljs.core.bitmap_indexed_node_index(this.bitmap, d), f = this.arr[2 * e], g = this.arr[2 * e + 1]; - return null == f ? (a = g.inode_without(a + 5, b, c), a === g ? this : null != a ? new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, 2 * e + 1, a)) : this.bitmap === d ? null : new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair(this.arr, e))) : cljs.core.key_test(c, f) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair(this.arr, e)) : this; + var e = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, d), f = this.arr[2 * e], g = this.arr[2 * e + 1]; + return null == f ? (a = g.inode_without(a + 5, b, c), a === g ? this : null != a ? new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * e + 1, a)) : this.bitmap === d ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair.call(null, this.arr, e)) : null) : cljs.core.key_test.call(null, c, f) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair.call(null, + this.arr, e)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null }; -cljs.core.BitmapIndexedNode.cljs$lang$type = !0; -cljs.core.BitmapIndexedNode.cljs$lang$ctorStr = "cljs.core/BitmapIndexedNode"; -cljs.core.BitmapIndexedNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/BitmapIndexedNode"); +cljs.core.BitmapIndexedNode.prototype.inode_assoc = function(a, b, c, d, e) { + var f = 1 << (b >>> a & 31), g = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, f); + if(0 === (this.bitmap & f)) { + var h = cljs.core.bit_count.call(null, this.bitmap); + if(16 <= h) { + g = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; + g[b >>> a & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e); + for(d = c = 0;;) { + if(32 > c) { + 0 !== (this.bitmap >>> c & 1) && (g[c] = null != this.arr[d] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, cljs.core.hash.call(null, this.arr[d]), this.arr[d], this.arr[d + 1], e) : this.arr[d + 1], d += 2), c += 1 + }else { + break + } + } + return new cljs.core.ArrayNode(null, h + 1, g) + } + a = Array(2 * (h + 1)); + cljs.core.array_copy.call(null, this.arr, 0, a, 0, 2 * g); + a[2 * g] = c; + a[2 * g + 1] = d; + cljs.core.array_copy.call(null, this.arr, 2 * g, a, 2 * (g + 1), 2 * (h - g)); + e.val = !0; + return new cljs.core.BitmapIndexedNode(null, this.bitmap | f, a) + } + h = this.arr[2 * g]; + f = this.arr[2 * g + 1]; + return null == h ? (h = f.inode_assoc(a + 5, b, c, d, e), h === f ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * g + 1, h))) : cljs.core.key_test.call(null, c, h) ? d === f ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * g + 1, d)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (e.val = !0, new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, + this.arr, 2 * g, null, 2 * g + 1, cljs.core.create_node.call(null, a + 5, h, f, b, c, d)))) : null +}; +cljs.core.BitmapIndexedNode.prototype.inode_lookup = function(a, b, c, d) { + var e = 1 << (b >>> a & 31); + if(0 === (this.bitmap & e)) { + return d + } + var f = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; + return null == e ? f.inode_lookup(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? f : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null }; cljs.core.__GT_BitmapIndexedNode = function(a, b, c) { - return new cljs.core.BitmapIndexedNode(a, b, c); + return new cljs.core.BitmapIndexedNode(a, b, c) }; cljs.core.BitmapIndexedNode.EMPTY = new cljs.core.BitmapIndexedNode(null, 0, []); cljs.core.pack_array_node = function(a, b, c) { - var d = a.arr, e = d.length; - a = Array(2 * (a.cnt - 1)); - for (var f = 0, g = 1, h = 0;;) { - if (f < e) { - f !== c && null != d[f] && (a[g] = d[f], g += 2, h |= 1 << f), f += 1; - } else { - return new cljs.core.BitmapIndexedNode(b, h, a); + var d = a.arr; + a = 2 * (a.cnt - 1); + for(var e = Array(a), f = 0, g = 1, h = 0;;) { + if(f < a) { + f !== c && null != d[f] && (e[g] = d[f], g += 2, h |= 1 << f), f += 1 + }else { + return new cljs.core.BitmapIndexedNode(b, h, e) } } }; cljs.core.ArrayNode = function(a, b, c) { this.edit = a; this.cnt = b; - this.arr = c; + this.arr = c }; -cljs.core.ArrayNode.prototype.ensure_editable = function(a) { - return a === this.edit ? this : new cljs.core.ArrayNode(a, this.cnt, cljs.core.aclone(this.arr)); +cljs.core.ArrayNode.cljs$lang$type = !0; +cljs.core.ArrayNode.cljs$lang$ctorStr = "cljs.core/ArrayNode"; +cljs.core.ArrayNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ArrayNode") +}; +cljs.core.ArrayNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { + var g = c >>> b & 31, h = this.arr[g]; + if(null == h) { + return a = cljs.core.edit_and_set.call(null, this, a, g, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f)), a.cnt += 1, a + } + b = h.inode_assoc_BANG_(a, b + 5, c, d, e, f); + return b === h ? this : cljs.core.edit_and_set.call(null, this, a, g, b) +}; +cljs.core.ArrayNode.prototype.inode_seq = function() { + return cljs.core.create_array_node_seq.call(null, this.arr) }; cljs.core.ArrayNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { var f = c >>> b & 31, g = this.arr[f]; - if (null == g) { - return this; + if(null == g) { + return this } b = g.inode_without_BANG_(a, b + 5, c, d, e); - if (b === g) { - return this; + if(b === g) { + return this } - if (null == b) { - if (8 >= this.cnt) { - return cljs.core.pack_array_node(this, a, f); + if(null == b) { + if(8 >= this.cnt) { + return cljs.core.pack_array_node.call(null, this, a, f) } - a = cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, f, b); + a = cljs.core.edit_and_set.call(null, this, a, f, b); a.cnt -= 1; - return a; + return a } - return cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, f, b); + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.edit_and_set.call(null, this, a, f, b) : null }; -cljs.core.ArrayNode.prototype.inode_seq = function() { - var a = this.arr; - return cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.create_array_node_seq.call(null, a); +cljs.core.ArrayNode.prototype.ensure_editable = function(a) { + return a === this.edit ? this : new cljs.core.ArrayNode(a, this.cnt, cljs.core.aclone.call(null, this.arr)) }; cljs.core.ArrayNode.prototype.kv_reduce = function(a, b) { - for (var c = this.arr.length, d = 0, e = b;;) { - if (d < c) { + for(var c = this.arr.length, d = 0, e = b;;) { + if(d < c) { var f = this.arr[d]; - if (null != f && (e = f.kv_reduce(a, e), cljs.core.reduced_QMARK_(e))) { - return c = e, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(c) : cljs.core.deref.call(null, c); + if(null != f && (e = f.kv_reduce(a, e), cljs.core.reduced_QMARK_.call(null, e))) { + return cljs.core.deref.call(null, e) } - d += 1; - } else { - return e; + d += 1 + }else { + return e } } }; -cljs.core.ArrayNode.prototype.inode_lookup = function(a, b, c, d) { +cljs.core.ArrayNode.prototype.inode_find = function(a, b, c, d) { var e = this.arr[b >>> a & 31]; - return null != e ? e.inode_lookup(a + 5, b, c, d) : d; + return null != e ? e.inode_find(a + 5, b, c, d) : d }; -cljs.core.ArrayNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - var g = c >>> b & 31, h = this.arr[g]; - if (null == h) { - return a = cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, g, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f)), a.cnt += 1, a; - } - b = h.inode_assoc_BANG_(a, b + 5, c, d, e, f); - return b === h ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, g, b); +cljs.core.ArrayNode.prototype.inode_without = function(a, b, c) { + var d = b >>> a & 31, e = this.arr[d]; + return null != e ? (a = e.inode_without(a + 5, b, c), a === e ? this : null == a ? 8 >= this.cnt ? cljs.core.pack_array_node.call(null, this, null, d) : new cljs.core.ArrayNode(null, this.cnt - 1, cljs.core.clone_and_set.call(null, this.arr, d, a)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, d, a)) : null) : this }; cljs.core.ArrayNode.prototype.inode_assoc = function(a, b, c, d, e) { var f = b >>> a & 31, g = this.arr[f]; - if (null == g) { - return new cljs.core.ArrayNode(null, this.cnt + 1, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, f, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e))); + if(null == g) { + return new cljs.core.ArrayNode(null, this.cnt + 1, cljs.core.clone_and_set.call(null, this.arr, f, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e))) } a = g.inode_assoc(a + 5, b, c, d, e); - return a === g ? this : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, f, a)); + return a === g ? this : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, f, a)) }; -cljs.core.ArrayNode.prototype.inode_find = function(a, b, c, d) { +cljs.core.ArrayNode.prototype.inode_lookup = function(a, b, c, d) { var e = this.arr[b >>> a & 31]; - return null != e ? e.inode_find(a + 5, b, c, d) : d; -}; -cljs.core.ArrayNode.prototype.inode_without = function(a, b, c) { - var d = b >>> a & 31, e = this.arr[d]; - return null != e ? (a = e.inode_without(a + 5, b, c), a === e ? this : null == a ? 8 >= this.cnt ? cljs.core.pack_array_node(this, null, d) : new cljs.core.ArrayNode(null, this.cnt - 1, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, d, a)) : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, d, a))) : this; -}; -cljs.core.ArrayNode.cljs$lang$type = !0; -cljs.core.ArrayNode.cljs$lang$ctorStr = "cljs.core/ArrayNode"; -cljs.core.ArrayNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ArrayNode"); + return null != e ? e.inode_lookup(a + 5, b, c, d) : d }; cljs.core.__GT_ArrayNode = function(a, b, c) { - return new cljs.core.ArrayNode(a, b, c); + return new cljs.core.ArrayNode(a, b, c) }; cljs.core.hash_collision_node_find_index = function(a, b, c) { b *= 2; - for (var d = 0;;) { - if (d < b) { - if (cljs.core.key_test(c, a[d])) { - return d; + for(var d = 0;;) { + if(d < b) { + if(cljs.core.key_test.call(null, c, a[d])) { + return d } - d += 2; - } else { - return-1; + d += 2 + }else { + return-1 } } }; @@ -14186,24 +9763,43 @@ cljs.core.HashCollisionNode = function(a, b, c, d) { this.edit = a; this.collision_hash = b; this.cnt = c; - this.arr = d; + this.arr = d }; -cljs.core.HashCollisionNode.prototype.ensure_editable = function(a) { - if (a === this.edit) { - return this; +cljs.core.HashCollisionNode.cljs$lang$type = !0; +cljs.core.HashCollisionNode.cljs$lang$ctorStr = "cljs.core/HashCollisionNode"; +cljs.core.HashCollisionNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/HashCollisionNode") +}; +cljs.core.HashCollisionNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { + if(c === this.collision_hash) { + b = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, d); + if(-1 === b) { + if(this.arr.length > 2 * this.cnt) { + return a = cljs.core.edit_and_set.call(null, this, a, 2 * this.cnt, d, 2 * this.cnt + 1, e), f.val = !0, a.cnt += 1, a + } + b = this.arr.length; + c = Array(b + 2); + cljs.core.array_copy.call(null, this.arr, 0, c, 0, b); + c[b] = d; + c[b + 1] = e; + f.val = !0; + return this.ensure_editable_array(a, this.cnt + 1, c) + } + return this.arr[b + 1] === e ? this : cljs.core.edit_and_set.call(null, this, a, b + 1, e) } - var b = Array(2 * (this.cnt + 1)); - cljs.core.array_copy(this.arr, 0, b, 0, 2 * this.cnt); - return new cljs.core.HashCollisionNode(a, this.collision_hash, this.cnt, b); + return(new cljs.core.BitmapIndexedNode(a, 1 << (this.collision_hash >>> b & 31), [null, this, null, null])).inode_assoc_BANG_(a, b, c, d, e, f) +}; +cljs.core.HashCollisionNode.prototype.inode_seq = function() { + return cljs.core.create_inode_seq.call(null, this.arr) }; cljs.core.HashCollisionNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { - b = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, d); - if (-1 === b) { - return this; + b = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, d); + if(-1 === b) { + return this } e[0] = !0; - if (1 === this.cnt) { - return null; + if(1 === this.cnt) { + return null } a = this.ensure_editable(a); e = a.arr; @@ -14212,88 +9808,68 @@ cljs.core.HashCollisionNode.prototype.inode_without_BANG_ = function(a, b, c, d, e[2 * this.cnt - 1] = null; e[2 * this.cnt - 2] = null; a.cnt -= 1; - return a; + return a }; -cljs.core.HashCollisionNode.prototype.inode_seq = function() { - var a = this.arr; - return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.create_inode_seq.call(null, a); +cljs.core.HashCollisionNode.prototype.ensure_editable = function(a) { + if(a === this.edit) { + return this + } + var b = Array(2 * (this.cnt + 1)); + cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * this.cnt); + return new cljs.core.HashCollisionNode(a, this.collision_hash, this.cnt, b) }; cljs.core.HashCollisionNode.prototype.kv_reduce = function(a, b) { - return cljs.core.inode_kv_reduce(this.arr, a, b); + return cljs.core.inode_kv_reduce.call(null, this.arr, a, b) }; -cljs.core.HashCollisionNode.prototype.inode_lookup = function(a, b, c, d) { - a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c); - return 0 > a ? d : cljs.core.key_test(c, this.arr[a]) ? this.arr[a + 1] : d; +cljs.core.HashCollisionNode.prototype.inode_find = function(a, b, c, d) { + a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); + return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[a], this.arr[a + 1]], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null }; -cljs.core.HashCollisionNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - if (c === this.collision_hash) { - b = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, d); - if (-1 === b) { - if (this.arr.length > 2 * this.cnt) { - return a = cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$6(this, a, 2 * this.cnt, d, 2 * this.cnt + 1, e), f.val = !0, a.cnt += 1, a; - } - b = this.arr.length; - c = Array(b + 2); - cljs.core.array_copy(this.arr, 0, c, 0, b); - c[b] = d; - c[b + 1] = e; - f.val = !0; - return this.ensure_editable_array(a, this.cnt + 1, c); - } - return this.arr[b + 1] === e ? this : cljs.core.edit_and_set.cljs$core$IFn$_invoke$arity$4(this, a, b + 1, e); - } - return(new cljs.core.BitmapIndexedNode(a, 1 << (this.collision_hash >>> b & 31), [null, this, null, null])).inode_assoc_BANG_(a, b, c, d, e, f); +cljs.core.HashCollisionNode.prototype.inode_without = function(a, b, c) { + a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); + return-1 === a ? this : 1 === this.cnt ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt - 1, cljs.core.remove_pair.call(null, this.arr, cljs.core.quot.call(null, a, 2))) : null }; cljs.core.HashCollisionNode.prototype.inode_assoc = function(a, b, c, d, e) { - return b === this.collision_hash ? (a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c), -1 === a ? (a = 2 * this.cnt, b = Array(a + 2), cljs.core.array_copy(this.arr, 0, b, 0, a), b[a] = c, b[a + 1] = d, e.val = !0, new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt + 1, b)) : cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this.arr[a], d) ? this : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt, cljs.core.clone_and_set.cljs$core$IFn$_invoke$arity$3(this.arr, - a + 1, d))) : (new cljs.core.BitmapIndexedNode(null, 1 << (this.collision_hash >>> a & 31), [null, this])).inode_assoc(a, b, c, d, e); -}; -cljs.core.HashCollisionNode.prototype.ensure_editable_array = function(a, b, c) { - return a === this.edit ? (this.arr = c, this.cnt = b, this) : new cljs.core.HashCollisionNode(this.edit, this.collision_hash, b, c); -}; -cljs.core.HashCollisionNode.prototype.inode_find = function(a, b, c, d) { - a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c); - return 0 > a ? d : cljs.core.key_test(c, this.arr[a]) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[a], this.arr[a + 1]], null) : d; + return b === this.collision_hash ? (a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c), -1 === a ? (a = 2 * this.cnt, b = Array(a + 2), cljs.core.array_copy.call(null, this.arr, 0, b, 0, a), b[a] = c, b[a + 1] = d, e.val = !0, new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt + 1, b)) : cljs.core._EQ_.call(null, this.arr[a], d) ? this : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt, cljs.core.clone_and_set.call(null, this.arr, + a + 1, d))) : (new cljs.core.BitmapIndexedNode(null, 1 << (this.collision_hash >>> a & 31), [null, this])).inode_assoc(a, b, c, d, e) }; -cljs.core.HashCollisionNode.prototype.inode_without = function(a, b, c) { - a = cljs.core.hash_collision_node_find_index(this.arr, this.cnt, c); - return-1 === a ? this : 1 === this.cnt ? null : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt - 1, cljs.core.remove_pair(this.arr, cljs.core.quot(a, 2))); +cljs.core.HashCollisionNode.prototype.inode_lookup = function(a, b, c, d) { + a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); + return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? this.arr[a + 1] : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null }; -cljs.core.HashCollisionNode.cljs$lang$type = !0; -cljs.core.HashCollisionNode.cljs$lang$ctorStr = "cljs.core/HashCollisionNode"; -cljs.core.HashCollisionNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/HashCollisionNode"); +cljs.core.HashCollisionNode.prototype.ensure_editable_array = function(a, b, c) { + return a === this.edit ? (this.arr = c, this.cnt = b, this) : new cljs.core.HashCollisionNode(this.edit, this.collision_hash, b, c) }; cljs.core.__GT_HashCollisionNode = function(a, b, c, d) { - return new cljs.core.HashCollisionNode(a, b, c, d); + return new cljs.core.HashCollisionNode(a, b, c, d) }; cljs.core.create_node = function() { var a = null, b = function(a, b, c, g, h, k) { - var l = cljs.core.hash(b); - if (l === g) { - return new cljs.core.HashCollisionNode(null, l, 2, [b, c, h, k]); + var l = cljs.core.hash.call(null, b); + if(l === g) { + return new cljs.core.HashCollisionNode(null, l, 2, [b, c, h, k]) } var m = new cljs.core.Box(!1); - return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a, l, b, c, m).inode_assoc(a, g, h, k, m); + return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a, l, b, c, m).inode_assoc(a, g, h, k, m) }, c = function(a, b, c, g, h, k, l) { - var m = cljs.core.hash(c); - if (m === h) { - return new cljs.core.HashCollisionNode(null, m, 2, [c, g, k, l]); + var m = cljs.core.hash.call(null, c); + if(m === h) { + return new cljs.core.HashCollisionNode(null, m, 2, [c, g, k, l]) } var n = new cljs.core.Box(!1); - return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b, m, c, g, n).inode_assoc_BANG_(a, b, h, k, l, n); + return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b, m, c, g, n).inode_assoc_BANG_(a, b, h, k, l, n) }, a = function(a, e, f, g, h, k, l) { switch(arguments.length) { case 6: return b.call(this, a, e, f, g, h, k); case 7: - return c.call(this, a, e, f, g, h, k, l); + return c.call(this, a, e, f, g, h, k, l) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$6 = b; a.cljs$core$IFn$_invoke$arity$7 = c; - return a; + return a }(); cljs.core.NodeSeq = function(a, b, c, d, e) { this.meta = a; @@ -14302,100 +9878,87 @@ cljs.core.NodeSeq = function(a, b, c, d, e) { this.s = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374860; -}; -cljs.core.NodeSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.NodeSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition0$ = 32374860 }; -cljs.core.NodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.NodeSeq.cljs$lang$type = !0; +cljs.core.NodeSeq.cljs$lang$ctorStr = "cljs.core/NodeSeq"; +cljs.core.NodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/NodeSeq") }; cljs.core.NodeSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.NodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.NodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.NodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.NodeSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.NodeSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.NodeSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.NodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.NodeSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null == this.s ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.nodes[this.i], this.nodes[this.i + 1]], null) : cljs.core.first(this.s); + return null == this.s ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.nodes[this.i], this.nodes[this.i + 1]], null) : cljs.core.first.call(null, this.s) }; cljs.core.NodeSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - if (null == this.s) { - a = this.nodes; - var b = this.i + 2; - return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3(a, b, null) : cljs.core.create_inode_seq.call(null, a, b, null); - } - a = this.nodes; - var b = this.i, c = cljs.core.next(this.s); - return cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3 ? cljs.core.create_inode_seq.cljs$core$IFn$_invoke$arity$3(a, b, c) : cljs.core.create_inode_seq.call(null, a, b, c); + return null == this.s ? cljs.core.create_inode_seq.call(null, this.nodes, this.i + 2, null) : cljs.core.create_inode_seq.call(null, this.nodes, this.i, cljs.core.next.call(null, this.s)) }; -cljs.core.NodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.NodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.NodeSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.NodeSeq(b, this.nodes, this.i, this.s, this.__hash); + return new cljs.core.NodeSeq(b, this.nodes, this.i, this.s, this.__hash) }; -cljs.core.NodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.NodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.NodeSeq.cljs$lang$type = !0; -cljs.core.NodeSeq.cljs$lang$ctorStr = "cljs.core/NodeSeq"; -cljs.core.NodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/NodeSeq"); +cljs.core.NodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_NodeSeq = function(a, b, c, d, e) { - return new cljs.core.NodeSeq(a, b, c, d, e); -}; -cljs.core.NodeSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.NodeSeq(a, b, c, d, e) }; cljs.core.create_inode_seq = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$3(b, 0, null); + return a.call(null, b, 0, null) }, c = function(a, b, c) { - if (null == c) { - for (c = a.length;;) { - if (b < c) { - if (null != a[b]) { - return new cljs.core.NodeSeq(null, a, b, null, null); + if(null == c) { + for(c = a.length;;) { + if(b < c) { + if(null != a[b]) { + return new cljs.core.NodeSeq(null, a, b, null, null) } var g = a[b + 1]; - if (cljs.core.truth_(g) && (g = g.inode_seq(), cljs.core.truth_(g))) { - return new cljs.core.NodeSeq(null, a, b + 2, g, null); + if(cljs.core.truth_(g) && (g = g.inode_seq(), cljs.core.truth_(g))) { + return new cljs.core.NodeSeq(null, a, b + 2, g, null) } - b += 2; - } else { - return null; + b += 2 + }else { + return null } } - } else { - return new cljs.core.NodeSeq(null, a, b, c, null); + }else { + return new cljs.core.NodeSeq(null, a, b, c, null) } }, a = function(a, e, f) { switch(arguments.length) { case 1: return b.call(this, a); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.ArrayNodeSeq = function(a, b, c, d, e) { this.meta = a; @@ -14403,93 +9966,85 @@ cljs.core.ArrayNodeSeq = function(a, b, c, d, e) { this.i = c; this.s = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374860; -}; -cljs.core.ArrayNodeSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.ArrayNodeSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32374860 }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; +cljs.core.ArrayNodeSeq.cljs$lang$type = !0; +cljs.core.ArrayNodeSeq.cljs$lang$ctorStr = "cljs.core/ArrayNodeSeq"; +cljs.core.ArrayNodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ArrayNodeSeq") }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.ArrayNodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.ArrayNodeSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first(this.s); + return cljs.core.first.call(null, this.s) }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = this.nodes; - var b = this.i, c = cljs.core.next(this.s); - return cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$4 ? cljs.core.create_array_node_seq.cljs$core$IFn$_invoke$arity$4(null, a, b, c) : cljs.core.create_array_node_seq.call(null, null, a, b, c); + return cljs.core.create_array_node_seq.call(null, null, this.nodes, this.i, cljs.core.next.call(null, this.s)) }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.ArrayNodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ArrayNodeSeq(b, this.nodes, this.i, this.s, this.__hash); + return new cljs.core.ArrayNodeSeq(b, this.nodes, this.i, this.s, this.__hash) }; -cljs.core.ArrayNodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.ArrayNodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.ArrayNodeSeq.cljs$lang$type = !0; -cljs.core.ArrayNodeSeq.cljs$lang$ctorStr = "cljs.core/ArrayNodeSeq"; -cljs.core.ArrayNodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ArrayNodeSeq"); +cljs.core.ArrayNodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_ArrayNodeSeq = function(a, b, c, d, e) { - return new cljs.core.ArrayNodeSeq(a, b, c, d, e); -}; -cljs.core.ArrayNodeSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.ArrayNodeSeq(a, b, c, d, e) }; cljs.core.create_array_node_seq = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$4(null, b, 0, null); + return a.call(null, null, b, 0, null) }, c = function(a, b, c, g) { - if (null == g) { - for (g = b.length;;) { - if (c < g) { + if(null == g) { + for(g = b.length;;) { + if(c < g) { var h = b[c]; - if (cljs.core.truth_(h) && (h = h.inode_seq(), cljs.core.truth_(h))) { - return new cljs.core.ArrayNodeSeq(a, b, c + 1, h, null); + if(cljs.core.truth_(h) && (h = h.inode_seq(), cljs.core.truth_(h))) { + return new cljs.core.ArrayNodeSeq(a, b, c + 1, h, null) } - c += 1; - } else { - return null; + c += 1 + }else { + return null } } - } else { - return new cljs.core.ArrayNodeSeq(a, b, c, g, null); + }else { + return new cljs.core.ArrayNodeSeq(a, b, c, g, null) } }, a = function(a, e, f, g) { switch(arguments.length) { case 1: return b.call(this, a); case 4: - return c.call(this, a, e, f, g); + return c.call(this, a, e, f, g) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$4 = c; - return a; + return a }(); cljs.core.PersistentHashMap = function(a, b, c, d, e, f) { this.meta = a; @@ -14498,177 +10053,113 @@ cljs.core.PersistentHashMap = function(a, b, c, d, e, f) { this.has_nil_QMARK_ = d; this.nil_val = e; this.__hash = f; - this.cljs$lang$protocol_mask$partition0$ = 16123663; - this.cljs$lang$protocol_mask$partition1$ = 8196; -}; -cljs.core.PersistentHashMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentHashMap.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.PersistentHashMap.prototype.keys = function() { - return cljs.core.es6_iterator(cljs.core.keys.cljs$core$IFn$_invoke$arity$1 ? cljs.core.keys.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.keys.call(null, this)); -}; -cljs.core.PersistentHashMap.prototype.entries = function() { - return cljs.core.es6_entries_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentHashMap.prototype.values = function() { - return cljs.core.es6_iterator(cljs.core.vals.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vals.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.vals.call(null, this)); -}; -cljs.core.PersistentHashMap.prototype.has = function(a) { - return cljs.core.contains_QMARK_(this, a); -}; -cljs.core.PersistentHashMap.prototype.get = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); -}; -cljs.core.PersistentHashMap.prototype.forEach = function(a) { - for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { - if (e < d) { - var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); - a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); - e += 1; - } else { - if (b = cljs.core.seq(b)) { - cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; - } else { - return null; - } - } - } -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash(b), b, c); -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - this.has_nil_QMARK_ && (a = this.nil_val, c = b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, null, a) : b.call(null, c, null, a)); - return cljs.core.reduced_QMARK_(c) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(c) : cljs.core.deref.call(null, c) : null != this.root ? this.root.kv_reduce(b, c) : c; -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; + this.cljs$lang$protocol_mask$partition1$ = 4; + this.cljs$lang$protocol_mask$partition0$ = 16123663 }; -cljs.core.PersistentHashMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentHashMap(this.meta, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash); +cljs.core.PersistentHashMap.cljs$lang$type = !0; +cljs.core.PersistentHashMap.cljs$lang$ctorStr = "cljs.core/PersistentHashMap"; +cljs.core.PersistentHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentHashMap") }; -cljs.core.PersistentHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt; +cljs.core.PersistentHashMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { + return new cljs.core.TransientHashMap({}, this.root, this.cnt, this.has_nil_QMARK_, this.nil_val) }; cljs.core.PersistentHashMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map(this, b); + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) }; -cljs.core.PersistentHashMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientHashMap({}, this.root, this.cnt, this.has_nil_QMARK_, this.nil_val); -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta(cljs.core.PersistentHashMap.EMPTY, this.meta); +cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.call(null, this, b, null) }; -cljs.core.PersistentHashMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if (null == b) { - return this.has_nil_QMARK_ ? new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, this.root, !1, null, null) : this; - } - if (null == this.root) { - return this; - } - var c = this.root.inode_without(0, cljs.core.hash(b), b); - return c === this.root ? this : new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, c, this.has_nil_QMARK_, this.nil_val, null); +cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) : null }; cljs.core.PersistentHashMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if (null == b) { - return this.has_nil_QMARK_ && c === this.nil_val ? this : new cljs.core.PersistentHashMap(this.meta, this.has_nil_QMARK_ ? this.cnt : this.cnt + 1, this.root, !0, c, null); + if(null == b) { + return this.has_nil_QMARK_ && c === this.nil_val ? this : new cljs.core.PersistentHashMap(this.meta, this.has_nil_QMARK_ ? this.cnt : this.cnt + 1, this.root, !0, c, null) } a = new cljs.core.Box(!1); - b = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc(0, cljs.core.hash(b), b, c, a); - return b === this.root ? this : new cljs.core.PersistentHashMap(this.meta, a.val ? this.cnt + 1 : this.cnt, b, this.has_nil_QMARK_, this.nil_val, null); + b = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc(0, cljs.core.hash.call(null, b), b, c, a); + return b === this.root ? this : new cljs.core.PersistentHashMap(this.meta, a.val ? this.cnt + 1 : this.cnt, b, this.has_nil_QMARK_, this.nil_val, null) }; cljs.core.PersistentHashMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return null == b ? this.has_nil_QMARK_ : null == this.root ? !1 : this.root.inode_lookup(0, cljs.core.hash(b), b, cljs.core.lookup_sentinel) !== cljs.core.lookup_sentinel; -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.cnt ? (a = null != this.root ? this.root.inode_seq() : null, this.has_nil_QMARK_ ? cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, this.nil_val], null), a) : a) : null; -}; -cljs.core.PersistentHashMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentHashMap(b, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash); -}; -cljs.core.PersistentHashMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - if (cljs.core.vector_QMARK_(b)) { - return cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)); - } - for (var c = this, d = cljs.core.seq(b);;) { - if (null == d) { - return c; - } - var e = cljs.core.first(d); - if (cljs.core.vector_QMARK_(e)) { - c = cljs.core._assoc(c, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 1)), d = cljs.core.next(d); - } else { - throw Error("conj on a map takes map entries or seqables of map entries"); - } - } + return null == b ? this.has_nil_QMARK_ : null == this.root ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, cljs.core.lookup_sentinel) !== cljs.core.lookup_sentinel : null }; cljs.core.PersistentHashMap.prototype.call = function() { - var a = null, a = function(a, c, d) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); cljs.core.PersistentHashMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.PersistentHashMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; cljs.core.PersistentHashMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; -cljs.core.PersistentHashMap.cljs$lang$type = !0; -cljs.core.PersistentHashMap.cljs$lang$ctorStr = "cljs.core/PersistentHashMap"; -cljs.core.PersistentHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentHashMap"); +cljs.core.PersistentHashMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { + a = this.has_nil_QMARK_ ? b.call(null, c, null, this.nil_val) : c; + return cljs.core.reduced_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : null != this.root ? this.root.kv_reduce(b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null }; -cljs.core.__GT_PersistentHashMap = function(a, b, c, d, e, f) { - return new cljs.core.PersistentHashMap(a, b, c, d, e, f); +cljs.core.PersistentHashMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) }; -cljs.core.PersistentHashMap.EMPTY = new cljs.core.PersistentHashMap(null, 0, null, !1, null, cljs.core.empty_unordered_hash); -cljs.core.PersistentHashMap.fromArray = function(a, b) { - for (var c = b ? a : cljs.core.aclone(a), d = c.length, e = 0, f = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { - if (e < d) { - var g = e + 2, f = cljs.core._assoc_BANG_(f, c[e], c[e + 1]), e = g - } else { - return cljs.core._persistent_BANG_(f); - } +cljs.core.PersistentHashMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 < this.cnt ? (a = null != this.root ? this.root.inode_seq() : null, this.has_nil_QMARK_ ? cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, this.nil_val], null), a) : a) : null +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.cnt +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_map.call(null, this, b) +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentHashMap(b, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash) +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core._with_meta.call(null, cljs.core.PersistentHashMap.EMPTY, this.meta) +}; +cljs.core.PersistentHashMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { + if(null == b) { + return this.has_nil_QMARK_ ? new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, this.root, !1, null, null) : this + } + if(null == this.root) { + return this } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + var c = this.root.inode_without(0, cljs.core.hash.call(null, b), b); + return c === this.root ? this : new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, c, this.has_nil_QMARK_, this.nil_val, null) + } + return null +}; +cljs.core.__GT_PersistentHashMap = function(a, b, c, d, e, f) { + return new cljs.core.PersistentHashMap(a, b, c, d, e, f) }; +cljs.core.PersistentHashMap.EMPTY = new cljs.core.PersistentHashMap(null, 0, null, !1, null, 0); cljs.core.PersistentHashMap.fromArrays = function(a, b) { - for (var c = a.length, d = 0, e = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { - if (d < c) { - var f = d + 1, e = e.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(null, a[d], b[d]), d = f - } else { - return cljs.core.persistent_BANG_(e); + for(var c = a.length, d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { + if(d < c) { + var f = d + 1, e = cljs.core._assoc_BANG_.call(null, e, a[d], b[d]), d = f + }else { + return cljs.core.persistent_BANG_.call(null, e) } } }; -cljs.core.PersistentHashMap.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; cljs.core.TransientHashMap = function(a, b, c, d, e) { this.edit = a; this.root = b; @@ -14676,107 +10167,99 @@ cljs.core.TransientHashMap = function(a, b, c, d, e) { this.has_nil_QMARK_ = d; this.nil_val = e; this.cljs$lang$protocol_mask$partition1$ = 56; - this.cljs$lang$protocol_mask$partition0$ = 258; + this.cljs$lang$protocol_mask$partition0$ = 258 +}; +cljs.core.TransientHashMap.cljs$lang$type = !0; +cljs.core.TransientHashMap.cljs$lang$ctorStr = "cljs.core/TransientHashMap"; +cljs.core.TransientHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/TransientHashMap") }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 = function(a, b) { - return this.without_BANG_(b); + return this.without_BANG_(b) }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - return this.assoc_BANG_(b, c); + return this.assoc_BANG_(b, c) }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - return this.conj_BANG_(b); + return this.conj_BANG_(b) }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - return this.persistent_BANG_(); + return this.persistent_BANG_() }; cljs.core.TransientHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : null : null == this.root ? null : this.root.inode_lookup(0, cljs.core.hash(b), b); + return null == b ? this.has_nil_QMARK_ ? this.nil_val : null : null == this.root ? null : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b) }; cljs.core.TransientHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash(b), b, c); + return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) }; cljs.core.TransientHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if (this.edit) { - return this.count; + if(this.edit) { + return this.count } throw Error("count after persistent!"); }; cljs.core.TransientHashMap.prototype.conj_BANG_ = function(a) { - if (this.edit) { - if (a ? a.cljs$lang$protocol_mask$partition0$ & 2048 || a.cljs$core$IMapEntry$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IMapEntry, a)) { - return this.assoc_BANG_(cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a), cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a)); + if(this.edit) { + if(a ? a.cljs$lang$protocol_mask$partition0$ & 2048 || a.cljs$core$IMapEntry$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) { + return this.assoc_BANG_(cljs.core.key.call(null, a), cljs.core.val.call(null, a)) } - a = cljs.core.seq(a); - for (var b = this;;) { - var c = cljs.core.first(a); - if (cljs.core.truth_(c)) { - var d = c; - a = cljs.core.next(a); - b = b.assoc_BANG_(function() { - var a = d; - return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.key.call(null, a); - }(), function() { - var a = d; - return cljs.core.val.cljs$core$IFn$_invoke$arity$1 ? cljs.core.val.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.val.call(null, a); - }()); - } else { - return b; + a = cljs.core.seq.call(null, a); + for(var b = this;;) { + var c = cljs.core.first.call(null, a); + if(cljs.core.truth_(c)) { + a = cljs.core.next.call(null, a), b = b.assoc_BANG_(cljs.core.key.call(null, c), cljs.core.val.call(null, c)) + }else { + return b } } - } else { + }else { throw Error("conj! after persistent"); } }; cljs.core.TransientHashMap.prototype.assoc_BANG_ = function(a, b) { - if (this.edit) { - if (null == a) { - this.nil_val !== b && (this.nil_val = b), this.has_nil_QMARK_ || (this.count += 1, this.has_nil_QMARK_ = !0); - } else { - var c = new cljs.core.Box(!1), d = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc_BANG_(this.edit, 0, cljs.core.hash(a), a, b, c); + if(this.edit) { + if(null == a) { + this.nil_val !== b && (this.nil_val = b), this.has_nil_QMARK_ || (this.count += 1, this.has_nil_QMARK_ = !0) + }else { + var c = new cljs.core.Box(!1), d = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc_BANG_(this.edit, 0, cljs.core.hash.call(null, a), a, b, c); d !== this.root && (this.root = d); - c.val && (this.count += 1); + c.val && (this.count += 1) } - return this; + return this } throw Error("assoc! after persistent!"); }; cljs.core.TransientHashMap.prototype.without_BANG_ = function(a) { - if (this.edit) { - if (null == a) { - this.has_nil_QMARK_ && (this.has_nil_QMARK_ = !1, this.nil_val = null, this.count -= 1); - } else { - if (null != this.root) { + if(this.edit) { + if(null == a) { + this.has_nil_QMARK_ && (this.has_nil_QMARK_ = !1, this.nil_val = null, this.count -= 1) + }else { + if(null != this.root) { var b = new cljs.core.Box(!1); - a = this.root.inode_without_BANG_(this.edit, 0, cljs.core.hash(a), a, b); + a = this.root.inode_without_BANG_(this.edit, 0, cljs.core.hash.call(null, a), a, b); a !== this.root && (this.root = a); - cljs.core.truth_(b[0]) && (this.count -= 1); + cljs.core.truth_(b[0]) && (this.count -= 1) } } - return this; + return this } throw Error("dissoc! after persistent!"); }; cljs.core.TransientHashMap.prototype.persistent_BANG_ = function() { - if (this.edit) { - return this.edit = null, new cljs.core.PersistentHashMap(null, this.count, this.root, this.has_nil_QMARK_, this.nil_val, null); + if(this.edit) { + return this.edit = null, new cljs.core.PersistentHashMap(null, this.count, this.root, this.has_nil_QMARK_, this.nil_val, null) } throw Error("persistent! called twice"); }; -cljs.core.TransientHashMap.cljs$lang$type = !0; -cljs.core.TransientHashMap.cljs$lang$ctorStr = "cljs.core/TransientHashMap"; -cljs.core.TransientHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/TransientHashMap"); -}; cljs.core.__GT_TransientHashMap = function(a, b, c, d, e) { - return new cljs.core.TransientHashMap(a, b, c, d, e); + return new cljs.core.TransientHashMap(a, b, c, d, e) }; cljs.core.tree_map_seq_push = function(a, b, c) { - for (var d = b;;) { - if (null != a) { - b = c ? a.left : a.right, d = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(d, a), a = b; - } else { - return d; + for(var d = b;;) { + if(null != a) { + b = c ? a.left : a.right, d = cljs.core.conj.call(null, d, a), a = b + }else { + return d } } }; @@ -14787,109 +10270,110 @@ cljs.core.PersistentTreeMapSeq = function(a, b, c, d, e) { this.cnt = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374862; -}; -cljs.core.PersistentTreeMapSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentTreeMapSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; + this.cljs$lang$protocol_mask$partition0$ = 32374862 }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 0 > this.cnt ? cljs.core.count(cljs.core.next(this)) + 1 : this.cnt; +cljs.core.PersistentTreeMapSeq.cljs$lang$type = !0; +cljs.core.PersistentTreeMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentTreeMapSeq"; +cljs.core.PersistentTreeMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMapSeq") }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.PersistentTreeMapSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this +}; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return 0 > this.cnt ? cljs.core.count.call(null, cljs.core.next.call(null, this)) + 1 : this.cnt }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.peek(this.stack); + return cljs.core.peek.call(null, this.stack) }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = cljs.core.first(this.stack); - a = cljs.core.tree_map_seq_push(this.ascending_QMARK_ ? a.right : a.left, cljs.core.next(this.stack), this.ascending_QMARK_); - return null != a ? new cljs.core.PersistentTreeMapSeq(null, a, this.ascending_QMARK_, this.cnt - 1, null) : cljs.core.List.EMPTY; + a = cljs.core.first.call(null, this.stack); + a = cljs.core.tree_map_seq_push.call(null, this.ascending_QMARK_ ? a.right : a.left, cljs.core.next.call(null, this.stack), this.ascending_QMARK_); + return null != a ? new cljs.core.PersistentTreeMapSeq(null, a, this.ascending_QMARK_, this.cnt - 1, null) : cljs.core.List.EMPTY }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeMapSeq(b, this.stack, this.ascending_QMARK_, this.cnt, this.__hash); + return new cljs.core.PersistentTreeMapSeq(b, this.stack, this.ascending_QMARK_, this.cnt, this.__hash) }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.PersistentTreeMapSeq.cljs$lang$type = !0; -cljs.core.PersistentTreeMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentTreeMapSeq"; -cljs.core.PersistentTreeMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentTreeMapSeq"); +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; cljs.core.__GT_PersistentTreeMapSeq = function(a, b, c, d, e) { - return new cljs.core.PersistentTreeMapSeq(a, b, c, d, e); -}; -cljs.core.PersistentTreeMapSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.PersistentTreeMapSeq(a, b, c, d, e) }; cljs.core.create_tree_map_seq = function(a, b, c) { - return new cljs.core.PersistentTreeMapSeq(null, cljs.core.tree_map_seq_push(a, null, b), b, c, null); + return new cljs.core.PersistentTreeMapSeq(null, cljs.core.tree_map_seq_push.call(null, a, null, b), b, c, null) }; cljs.core.balance_left = function(a, b, c, d) { - return c instanceof cljs.core.RedNode ? c.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, c.left.blacken(), new cljs.core.BlackNode(a, b, c.right, d, null), null) : c.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.right.key, c.right.val, new cljs.core.BlackNode(c.key, c.val, c.left, c.right.left, null), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) : new cljs.core.BlackNode(a, b, c, d, null) : new cljs.core.BlackNode(a, b, c, d, null); + return c instanceof cljs.core.RedNode ? c.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, c.left.blacken(), new cljs.core.BlackNode(a, b, c.right, d, null), null) : c.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.right.key, c.right.val, new cljs.core.BlackNode(c.key, c.val, c.left, c.right.left, null), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a, b, c, d, + null) : null : new cljs.core.BlackNode(a, b, c, d, null) }; cljs.core.balance_right = function(a, b, c, d) { - return d instanceof cljs.core.RedNode ? d.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(a, b, c, d.left, null), d.right.blacken(), null) : d.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), new cljs.core.BlackNode(d.key, d.val, d.left.right, d.right, null), null) : new cljs.core.BlackNode(a, b, c, d, null) : new cljs.core.BlackNode(a, b, c, d, null); + return d instanceof cljs.core.RedNode ? d.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(a, b, c, d.left, null), d.right.blacken(), null) : d.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), new cljs.core.BlackNode(d.key, d.val, d.left.right, d.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a, b, c, d, null) : + null : new cljs.core.BlackNode(a, b, c, d, null) }; cljs.core.balance_left_del = function(a, b, c, d) { - if (c instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(a, b, c.blacken(), d, null); + if(c instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(a, b, c.blacken(), d, null) } - if (d instanceof cljs.core.BlackNode) { - return cljs.core.balance_right(a, b, c, d.redden()); + if(d instanceof cljs.core.BlackNode) { + return cljs.core.balance_right.call(null, a, b, c, d.redden()) } - if (d instanceof cljs.core.RedNode && d.left instanceof cljs.core.BlackNode) { - return new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), cljs.core.balance_right(d.key, d.val, d.left.right, d.right.redden()), null); + if(d instanceof cljs.core.RedNode && d.left instanceof cljs.core.BlackNode) { + return new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), cljs.core.balance_right.call(null, d.key, d.val, d.left.right, d.right.redden()), null) } - throw Error("red-black tree invariant violation"); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error("red-black tree invariant violation"); + } + return null }; cljs.core.balance_right_del = function(a, b, c, d) { - if (d instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(a, b, c, d.blacken(), null); + if(d instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(a, b, c, d.blacken(), null) } - if (c instanceof cljs.core.BlackNode) { - return cljs.core.balance_left(a, b, c.redden(), d); + if(c instanceof cljs.core.BlackNode) { + return cljs.core.balance_left.call(null, a, b, c.redden(), d) } - if (c instanceof cljs.core.RedNode && c.right instanceof cljs.core.BlackNode) { - return new cljs.core.RedNode(c.right.key, c.right.val, cljs.core.balance_left(c.key, c.val, c.left.redden(), c.right.left), new cljs.core.BlackNode(a, b, c.right.right, d, null), null); + if(c instanceof cljs.core.RedNode && c.right instanceof cljs.core.BlackNode) { + return new cljs.core.RedNode(c.right.key, c.right.val, cljs.core.balance_left.call(null, c.key, c.val, c.left.redden(), c.right.left), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) } - throw Error("red-black tree invariant violation"); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw Error("red-black tree invariant violation"); + } + return null }; cljs.core.tree_map_kv_reduce = function tree_map_kv_reduce(b, c, d) { - d = null != b.left ? tree_map_kv_reduce(b.left, c, d) : d; - if (cljs.core.reduced_QMARK_(d)) { - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d); + d = null != b.left ? tree_map_kv_reduce.call(null, b.left, c, d) : d; + if(cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d) } - var e = b.key, f = b.val; - d = c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(d, e, f) : c.call(null, d, e, f); - if (cljs.core.reduced_QMARK_(d)) { - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d); + d = c.call(null, d, b.key, b.val); + if(cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d) } - b = null != b.right ? tree_map_kv_reduce(b.right, c, d) : d; - return cljs.core.reduced_QMARK_(b) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b) : b; + b = null != b.right ? tree_map_kv_reduce.call(null, b.right, c, d) : d; + return cljs.core.reduced_QMARK_.call(null, b) ? cljs.core.deref.call(null, b) : b }; cljs.core.BlackNode = function(a, b, c, d, e) { this.key = a; @@ -14898,331 +10382,315 @@ cljs.core.BlackNode = function(a, b, c, d, e) { this.right = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32402207; + this.cljs$lang$protocol_mask$partition0$ = 32402207 }; -cljs.core.BlackNode.prototype.add_right = function(a) { - return a.balance_right(this); +cljs.core.BlackNode.cljs$lang$type = !0; +cljs.core.BlackNode.cljs$lang$ctorStr = "cljs.core/BlackNode"; +cljs.core.BlackNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/BlackNode") }; -cljs.core.BlackNode.prototype.redden = function() { - return new cljs.core.RedNode(this.key, this.val, this.left, this.right, null); +cljs.core.BlackNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.BlackNode.prototype.blacken = function() { - return this; +cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._nth.call(null, this, b, null) }; -cljs.core.BlackNode.prototype.add_left = function(a) { - return a.balance_left(this); +cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return cljs.core._nth.call(null, this, b, c) }; -cljs.core.BlackNode.prototype.replace = function(a, b, c, d) { - return new cljs.core.BlackNode(a, b, c, d, null); +cljs.core.BlackNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c) }; -cljs.core.BlackNode.prototype.balance_left = function(a) { - return new cljs.core.BlackNode(a.key, a.val, this, a.right, null); +cljs.core.BlackNode.prototype.call = function() { + var a = null; + return a = function(a, c, d) { + switch(arguments.length) { + case 2: + return this.cljs$core$ILookup$_lookup$arity$2(null, c); + case 3: + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + } + throw Error("Invalid arity: " + arguments.length); + } +}(); +cljs.core.BlackNode.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; -cljs.core.BlackNode.prototype.balance_right = function(a) { - return new cljs.core.BlackNode(a.key, a.val, a.left, this, null); +cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; -cljs.core.BlackNode.prototype.remove_left = function(a) { - return cljs.core.balance_left_del(this.key, this.val, a, this.right); +cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; -cljs.core.BlackNode.prototype.kv_reduce = function(a, b) { - return cljs.core.tree_map_kv_reduce(this, a, b); +cljs.core.BlackNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null) +}; +cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { + return this.key +}; +cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { + return this.val +}; +cljs.core.BlackNode.prototype.add_right = function(a) { + return a.balance_right(this) +}; +cljs.core.BlackNode.prototype.redden = function() { + return new cljs.core.RedNode(this.key, this.val, this.left, this.right, null) }; cljs.core.BlackNode.prototype.remove_right = function(a) { - return cljs.core.balance_right_del(this.key, this.val, this.left, a); + return cljs.core.balance_right_del.call(null, this.key, this.val, this.left, a) }; -cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, null); +cljs.core.BlackNode.prototype.replace = function(a, b, c, d) { + return new cljs.core.BlackNode(a, b, c, d, null) }; -cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c); +cljs.core.BlackNode.prototype.kv_reduce = function(a, b) { + return cljs.core.tree_map_kv_reduce.call(null, this, a, b) }; -cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return 0 === b ? this.key : 1 === b ? this.val : null; +cljs.core.BlackNode.prototype.remove_left = function(a) { + return cljs.core.balance_left_del.call(null, this.key, this.val, a, this.right) }; -cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 === b ? this.key : 1 === b ? this.val : c; +cljs.core.BlackNode.prototype.add_left = function(a) { + return a.balance_left(this) }; -cljs.core.BlackNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c); +cljs.core.BlackNode.prototype.balance_left = function(a) { + return new cljs.core.BlackNode(a.key, a.val, this, a.right, null) }; -cljs.core.BlackNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return null; +cljs.core.BlackNode.prototype.balance_right = function(a) { + return new cljs.core.BlackNode(a.key, a.val, a.left, this, null) }; -cljs.core.BlackNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 2; +cljs.core.BlackNode.prototype.blacken = function() { + return this }; -cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return this.key; +cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.call(null, this, b) }; -cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return this.val; +cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.call(null, this, b, c) +}; +cljs.core.BlackNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key) +}; +cljs.core.BlackNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return 2 }; cljs.core.BlackNode.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.val; + return this.val }; cljs.core.BlackNode.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null) }; -cljs.core.BlackNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +cljs.core.BlackNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c) }; cljs.core.BlackNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); + return cljs.core.equiv_sequential.call(null, this, b) +}; +cljs.core.BlackNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b) +}; +cljs.core.BlackNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return null +}; +cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + if(0 === b) { + return this.key + } + if(1 === b) { + return this.val + } + new cljs.core.Keyword(null, "else", "else", 1017020587); + return null +}; +cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null }; cljs.core.BlackNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentVector.EMPTY; + return cljs.core.PersistentVector.EMPTY }; -cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); +cljs.core.__GT_BlackNode = function(a, b, c, d, e) { + return new cljs.core.BlackNode(a, b, c, d, e) }; -cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(this, b, c); +cljs.core.RedNode = function(a, b, c, d, e) { + this.key = a; + this.val = b; + this.left = c; + this.right = d; + this.__hash = e; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32402207 }; -cljs.core.BlackNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c); +cljs.core.RedNode.cljs$lang$type = !0; +cljs.core.RedNode.cljs$lang$ctorStr = "cljs.core/RedNode"; +cljs.core.RedNode.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/RedNode") }; -cljs.core.BlackNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core._conj(cljs.core._conj(cljs.core.List.EMPTY, this.val), this.key); +cljs.core.RedNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.BlackNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b); +cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._nth.call(null, this, b, null) }; -cljs.core.BlackNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null); +cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return cljs.core._nth.call(null, this, b, c) }; -cljs.core.BlackNode.prototype.call = function() { - var a = null, a = function(a, c, d) { +cljs.core.RedNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { + return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c) +}; +cljs.core.RedNode.prototype.call = function() { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); -cljs.core.BlackNode.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); -}; -cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); +cljs.core.RedNode.prototype.apply = function(a, b) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; -cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); +cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; -cljs.core.BlackNode.cljs$lang$type = !0; -cljs.core.BlackNode.cljs$lang$ctorStr = "cljs.core/BlackNode"; -cljs.core.BlackNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/BlackNode"); +cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; -cljs.core.__GT_BlackNode = function(a, b, c, d, e) { - return new cljs.core.BlackNode(a, b, c, d, e); +cljs.core.RedNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null) }; -cljs.core.BlackNode.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.RedNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { + return this.key }; -cljs.core.RedNode = function(a, b, c, d, e) { - this.key = a; - this.val = b; - this.left = c; - this.right = d; - this.__hash = e; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32402207; +cljs.core.RedNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { + return this.val }; cljs.core.RedNode.prototype.add_right = function(a) { - return new cljs.core.RedNode(this.key, this.val, this.left, a, null); + return new cljs.core.RedNode(this.key, this.val, this.left, a, null) }; cljs.core.RedNode.prototype.redden = function() { throw Error("red-black tree invariant violation"); }; -cljs.core.RedNode.prototype.blacken = function() { - return new cljs.core.BlackNode(this.key, this.val, this.left, this.right, null); -}; -cljs.core.RedNode.prototype.add_left = function(a) { - return new cljs.core.RedNode(this.key, this.val, a, this.right, null); +cljs.core.RedNode.prototype.remove_right = function(a) { + return new cljs.core.RedNode(this.key, this.val, this.left, a, null) }; cljs.core.RedNode.prototype.replace = function(a, b, c, d) { - return new cljs.core.RedNode(a, b, c, d, null); -}; -cljs.core.RedNode.prototype.balance_left = function(a) { - return this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, this.left.blacken(), new cljs.core.BlackNode(a.key, a.val, this.right, a.right, null), null) : this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.right.key, this.right.val, new cljs.core.BlackNode(this.key, this.val, this.left, this.right.left, null), new cljs.core.BlackNode(a.key, a.val, this.right.right, a.right, null), null) : new cljs.core.BlackNode(a.key, a.val, this, a.right, null); + return new cljs.core.RedNode(a, b, c, d, null) }; -cljs.core.RedNode.prototype.balance_right = function(a) { - return this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left, null), this.right.blacken(), null) : this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.left.key, this.left.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left.left, null), new cljs.core.BlackNode(this.key, this.val, this.left.right, this.right, null), null) : new cljs.core.BlackNode(a.key, a.val, a.left, this, null); +cljs.core.RedNode.prototype.kv_reduce = function(a, b) { + return cljs.core.tree_map_kv_reduce.call(null, this, a, b) }; cljs.core.RedNode.prototype.remove_left = function(a) { - return new cljs.core.RedNode(this.key, this.val, a, this.right, null); -}; -cljs.core.RedNode.prototype.kv_reduce = function(a, b) { - return cljs.core.tree_map_kv_reduce(this, a, b); + return new cljs.core.RedNode(this.key, this.val, a, this.right, null) }; -cljs.core.RedNode.prototype.remove_right = function(a) { - return new cljs.core.RedNode(this.key, this.val, this.left, a, null); +cljs.core.RedNode.prototype.add_left = function(a) { + return new cljs.core.RedNode(this.key, this.val, a, this.right, null) }; -cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, null); +cljs.core.RedNode.prototype.balance_left = function(a) { + return this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, this.left.blacken(), new cljs.core.BlackNode(a.key, a.val, this.right, a.right, null), null) : this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.right.key, this.right.val, new cljs.core.BlackNode(this.key, this.val, this.left, this.right.left, null), new cljs.core.BlackNode(a.key, a.val, this.right.right, a.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a.key, + a.val, this, a.right, null) : null }; -cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.cljs$core$IFn$_invoke$arity$3(this, b, c); +cljs.core.RedNode.prototype.balance_right = function(a) { + return this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left, null), this.right.blacken(), null) : this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.left.key, this.left.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left.left, null), new cljs.core.BlackNode(this.key, this.val, this.left.right, this.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a.key, + a.val, a.left, this, null) : null }; -cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return 0 === b ? this.key : 1 === b ? this.val : null; +cljs.core.RedNode.prototype.blacken = function() { + return new cljs.core.BlackNode(this.key, this.val, this.left, this.right, null) }; -cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 === b ? this.key : 1 === b ? this.val : c; +cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { + return cljs.core.ci_reduce.call(null, this, b) }; -cljs.core.RedNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c); +cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { + return cljs.core.ci_reduce.call(null, this, b, c) }; -cljs.core.RedNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return null; +cljs.core.RedNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key) }; cljs.core.RedNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 2; -}; -cljs.core.RedNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return this.key; -}; -cljs.core.RedNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return this.val; + return 2 }; cljs.core.RedNode.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.val; + return this.val }; cljs.core.RedNode.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null) }; -cljs.core.RedNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); +cljs.core.RedNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { + return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c) }; cljs.core.RedNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); -}; -cljs.core.RedNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentVector.EMPTY; -}; -cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); -}; -cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$3(this, b, c); -}; -cljs.core.RedNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c); -}; -cljs.core.RedNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core._conj(cljs.core._conj(cljs.core.List.EMPTY, this.val), this.key); + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.RedNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.with_meta(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b); + return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b) }; -cljs.core.RedNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null); -}; -cljs.core.RedNode.prototype.call = function() { - var a = null, a = function(a, c, d) { - switch(arguments.length) { - case 2: - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; -}(); -cljs.core.RedNode.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); +cljs.core.RedNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return null }; -cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); +cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + if(0 === b) { + return this.key + } + if(1 === b) { + return this.val + } + new cljs.core.Keyword(null, "else", "else", 1017020587); + return null }; -cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); +cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null }; -cljs.core.RedNode.cljs$lang$type = !0; -cljs.core.RedNode.cljs$lang$ctorStr = "cljs.core/RedNode"; -cljs.core.RedNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/RedNode"); +cljs.core.RedNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.PersistentVector.EMPTY }; cljs.core.__GT_RedNode = function(a, b, c, d, e) { - return new cljs.core.RedNode(a, b, c, d, e); -}; -cljs.core.RedNode.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.RedNode(a, b, c, d, e) }; cljs.core.tree_map_add = function tree_map_add(b, c, d, e, f) { - if (null == c) { - return new cljs.core.RedNode(d, e, null, null, null); - } - var g; - g = c.key; - g = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, g) : b.call(null, d, g); - if (0 === g) { - return f[0] = c, null; + if(null == c) { + return new cljs.core.RedNode(d, e, null, null, null) } - if (0 > g) { - return b = tree_map_add(b, c.left, d, e, f), null != b ? c.add_left(b) : null; - } - b = tree_map_add(b, c.right, d, e, f); - return null != b ? c.add_right(b) : null; + var g = b.call(null, d, c.key); + return 0 === g ? (f[0] = c, null) : 0 > g ? (b = tree_map_add.call(null, b, c.left, d, e, f), null != b ? c.add_left(b) : null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = tree_map_add.call(null, b, c.right, d, e, f), null != b ? c.add_right(b) : null) : null }; cljs.core.tree_map_append = function tree_map_append(b, c) { - if (null == b) { - return c; + if(null == b) { + return c } - if (null == c) { - return b; + if(null == c) { + return b } - if (b instanceof cljs.core.RedNode) { - if (c instanceof cljs.core.RedNode) { - var d = tree_map_append(b.right, c.left); - return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.RedNode(b.key, b.val, b.left, d.left, null), new cljs.core.RedNode(c.key, c.val, d.right, c.right, null), null) : new cljs.core.RedNode(b.key, b.val, b.left, new cljs.core.RedNode(c.key, c.val, d, c.right, null), null); + if(b instanceof cljs.core.RedNode) { + if(c instanceof cljs.core.RedNode) { + var d = tree_map_append.call(null, b.right, c.left); + return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.RedNode(b.key, b.val, b.left, d.left, null), new cljs.core.RedNode(c.key, c.val, d.right, c.right, null), null) : new cljs.core.RedNode(b.key, b.val, b.left, new cljs.core.RedNode(c.key, c.val, d, c.right, null), null) } - return new cljs.core.RedNode(b.key, b.val, b.left, tree_map_append(b.right, c), null); - } - if (c instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(c.key, c.val, tree_map_append(b, c.left), c.right, null); + return new cljs.core.RedNode(b.key, b.val, b.left, tree_map_append.call(null, b.right, c), null) } - d = tree_map_append(b.right, c.left); - return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(b.key, b.val, b.left, d.left, null), new cljs.core.BlackNode(c.key, c.val, d.right, c.right, null), null) : cljs.core.balance_left_del(b.key, b.val, b.left, new cljs.core.BlackNode(c.key, c.val, d, c.right, null)); + return c instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, tree_map_append.call(null, b, c.left), c.right, null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = tree_map_append.call(null, b.right, c.left), d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(b.key, b.val, b.left, d.left, null), new cljs.core.BlackNode(c.key, c.val, d.right, c.right, null), null) : cljs.core.balance_left_del.call(null, b.key, b.val, b.left, + new cljs.core.BlackNode(c.key, c.val, d, c.right, null))) : null }; cljs.core.tree_map_remove = function tree_map_remove(b, c, d, e) { - if (null != c) { - var f; - f = c.key; - f = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, f) : b.call(null, d, f); - if (0 === f) { - return e[0] = c, cljs.core.tree_map_append(c.left, c.right); + if(null != c) { + var f = b.call(null, d, c.key); + if(0 === f) { + return e[0] = c, cljs.core.tree_map_append.call(null, c.left, c.right) + } + if(0 > f) { + return b = tree_map_remove.call(null, b, c.left, d, e), null != b || null != e[0] ? c.left instanceof cljs.core.BlackNode ? cljs.core.balance_left_del.call(null, c.key, c.val, b, c.right) : new cljs.core.RedNode(c.key, c.val, b, c.right, null) : null } - if (0 > f) { - return b = tree_map_remove(b, c.left, d, e), null != b || null != e[0] ? c.left instanceof cljs.core.BlackNode ? cljs.core.balance_left_del(c.key, c.val, b, c.right) : new cljs.core.RedNode(c.key, c.val, b, c.right, null) : null; + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + return b = tree_map_remove.call(null, b, c.right, d, e), null != b || null != e[0] ? c.right instanceof cljs.core.BlackNode ? cljs.core.balance_right_del.call(null, c.key, c.val, c.left, b) : new cljs.core.RedNode(c.key, c.val, c.left, b, null) : null } - b = tree_map_remove(b, c.right, d, e); - return null != b || null != e[0] ? c.right instanceof cljs.core.BlackNode ? cljs.core.balance_right_del(c.key, c.val, c.left, b) : new cljs.core.RedNode(c.key, c.val, c.left, b, null) : null; } - return null; + return null }; cljs.core.tree_map_replace = function tree_map_replace(b, c, d, e) { - var f = c.key, g; - g = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, f) : b.call(null, d, f); - return 0 === g ? c.replace(f, e, c.left, c.right) : 0 > g ? c.replace(f, c.val, tree_map_replace(b, c.left, d, e), c.right) : c.replace(f, c.val, c.left, tree_map_replace(b, c.right, d, e)); + var f = c.key, g = b.call(null, d, f); + return 0 === g ? c.replace(f, e, c.left, c.right) : 0 > g ? c.replace(f, c.val, tree_map_replace.call(null, b, c.left, d, e), c.right) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c.replace(f, c.val, c.left, tree_map_replace.call(null, b, c.right, d, e)) : null }; cljs.core.PersistentTreeMap = function(a, b, c, d, e) { this.comp = a; @@ -15230,531 +10698,432 @@ cljs.core.PersistentTreeMap = function(a, b, c, d, e) { this.cnt = c; this.meta = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition0$ = 418776847; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.PersistentTreeMap.prototype.forEach = function(a) { - for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { - if (e < d) { - var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); - a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); - e += 1; - } else { - if (b = cljs.core.seq(b)) { - cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; - } else { - return null; - } - } - } -}; -cljs.core.PersistentTreeMap.prototype.get = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); -}; -cljs.core.PersistentTreeMap.prototype.entries = function() { - return cljs.core.es6_entries_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentTreeMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentTreeMap.prototype.keys = function() { - return cljs.core.es6_iterator(cljs.core.keys.cljs$core$IFn$_invoke$arity$1 ? cljs.core.keys.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.keys.call(null, this)); -}; -cljs.core.PersistentTreeMap.prototype.values = function() { - return cljs.core.es6_iterator(cljs.core.vals.cljs$core$IFn$_invoke$arity$1 ? cljs.core.vals.cljs$core$IFn$_invoke$arity$1(this) : cljs.core.vals.call(null, this)); -}; -cljs.core.PersistentTreeMap.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 418776847 }; -cljs.core.PersistentTreeMap.prototype.entry_at = function(a) { - for (var b = this.tree;;) { - if (null != b) { - var c; - c = a; - var d = b.key; - c = this.comp.cljs$core$IFn$_invoke$arity$2 ? this.comp.cljs$core$IFn$_invoke$arity$2(c, d) : this.comp.call(null, c, d); - if (0 === c) { - return b; - } - b = 0 > c ? b.left : b.right; - } else { - return null; - } - } +cljs.core.PersistentTreeMap.cljs$lang$type = !0; +cljs.core.PersistentTreeMap.cljs$lang$ctorStr = "cljs.core/PersistentTreeMap"; +cljs.core.PersistentTreeMap.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMap") }; -cljs.core.PersistentTreeMap.prototype.has = function(a) { - return cljs.core.contains_QMARK_(this, a); +cljs.core.PersistentTreeMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) }; cljs.core.PersistentTreeMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); + return cljs.core._lookup.call(null, this, b, null) }; cljs.core.PersistentTreeMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { a = this.entry_at(b); - return null != a ? a.val : c; -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - return null != this.tree ? cljs.core.tree_map_kv_reduce(this.tree, b, c) : c; -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, this.meta, this.__hash); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt; -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq(this.tree, !1, this.cnt) : null; -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map(this, b); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, 0); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - var c = [null], d = cljs.core.tree_map_remove(this.comp, this.tree, b, c); - return null == d ? null == cljs.core.nth.cljs$core$IFn$_invoke$arity$2(c, 0) ? this : new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, null) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt - 1, this.meta, null); + return null != a ? a.val : c }; cljs.core.PersistentTreeMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { a = [null]; - var d = cljs.core.tree_map_add(this.comp, this.tree, b, c, a); - return null == d ? (a = cljs.core.nth.cljs$core$IFn$_invoke$arity$2(a, 0), cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, a.val) ? this : new cljs.core.PersistentTreeMap(this.comp, cljs.core.tree_map_replace(this.comp, this.tree, b, c), this.cnt, this.meta, null)) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt + 1, this.meta, null); + var d = cljs.core.tree_map_add.call(null, this.comp, this.tree, b, c, a); + return null == d ? (a = cljs.core.nth.call(null, a, 0), cljs.core._EQ_.call(null, c, a.val) ? this : new cljs.core.PersistentTreeMap(this.comp, cljs.core.tree_map_replace.call(null, this.comp, this.tree, b, c), this.cnt, this.meta, null)) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt + 1, this.meta, null) }; cljs.core.PersistentTreeMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return null != this.entry_at(b); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq(this.tree, !0, this.cnt) : null; -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, b, this.__hash); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - if (cljs.core.vector_QMARK_(b)) { - return cljs.core._assoc(this, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, 1)); - } - for (var c = this, d = cljs.core.seq(b);;) { - if (null == d) { - return c; - } - var e = cljs.core.first(d); - if (cljs.core.vector_QMARK_(e)) { - c = cljs.core._assoc(c, cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 0), cljs.core._nth.cljs$core$IFn$_invoke$arity$2(e, 1)), d = cljs.core.next(d); - } else { - throw Error("conj on a map takes map entries or seqables of map entries"); - } - } + return null != this.entry_at(b) }; cljs.core.PersistentTreeMap.prototype.call = function() { - var a = null, a = function(a, c, d) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); cljs.core.PersistentTreeMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.PersistentTreeMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; cljs.core.PersistentTreeMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { + return null != this.tree ? cljs.core.tree_map_kv_reduce.call(null, this.tree, b, c) : c +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !1, this.cnt) : null +}; +cljs.core.PersistentTreeMap.prototype.entry_at = function(a) { + for(var b = this.tree;;) { + if(null != b) { + var c = this.comp.call(null, a, b.key); + if(0 === c) { + return b + } + if(0 > c) { + b = b.left + }else { + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + b = b.right + }else { + return null + } + } + }else { + return null + } + } }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_sorted_seq$arity$2 = function(a, b) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq(this.tree, b, this.cnt) : null; + return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, b, this.cnt) : null }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = function(a, b, c) { - if (0 < this.cnt) { + if(0 < this.cnt) { a = null; - for (var d = this.tree;;) { - if (null != d) { - var e; - e = b; - var f = d.key; - e = this.comp.cljs$core$IFn$_invoke$arity$2 ? this.comp.cljs$core$IFn$_invoke$arity$2(e, f) : this.comp.call(null, e, f); - if (0 === e) { - return new cljs.core.PersistentTreeMapSeq(null, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d), c, -1, null); + for(var d = this.tree;;) { + if(null != d) { + var e = this.comp.call(null, b, d.key); + if(0 === e) { + return new cljs.core.PersistentTreeMapSeq(null, cljs.core.conj.call(null, a, d), c, -1, null) + } + if(cljs.core.truth_(c)) { + 0 > e ? (a = cljs.core.conj.call(null, a, d), d = d.left) : d = d.right + }else { + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + 0 < e ? (a = cljs.core.conj.call(null, a, d), d = d.right) : d = d.left + }else { + return null + } } - cljs.core.truth_(c) ? 0 > e ? (a = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d), d = d.left) : d = d.right : 0 < e ? (a = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d), d = d.right) : d = d.left; - } else { - return null == a ? null : new cljs.core.PersistentTreeMapSeq(null, a, c, -1, null); + }else { + return null == a ? null : new cljs.core.PersistentTreeMapSeq(null, a, c, -1, null) } } - } else { - return null; + }else { + return null } }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_entry_key$arity$2 = function(a, b) { - return cljs.core.key.cljs$core$IFn$_invoke$arity$1 ? cljs.core.key.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.key.call(null, b); + return cljs.core.key.call(null, b) }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_comparator$arity$1 = function(a) { - return this.comp; + return this.comp }; -cljs.core.PersistentTreeMap.cljs$lang$type = !0; -cljs.core.PersistentTreeMap.cljs$lang$ctorStr = "cljs.core/PersistentTreeMap"; -cljs.core.PersistentTreeMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentTreeMap"); +cljs.core.PersistentTreeMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !0, this.cnt) : null }; -cljs.core.__GT_PersistentTreeMap = function(a, b, c, d, e) { - return new cljs.core.PersistentTreeMap(a, b, c, d, e); +cljs.core.PersistentTreeMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return this.cnt +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_map.call(null, this, b) +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, b, this.__hash) +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.PersistentTreeMap.EMPTY, this.meta) +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { + var c = [null], d = cljs.core.tree_map_remove.call(null, this.comp, this.tree, b, c); + return null == d ? null == cljs.core.nth.call(null, c, 0) ? this : new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, null) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt - 1, this.meta, null) }; -cljs.core.PersistentTreeMap.EMPTY = new cljs.core.PersistentTreeMap(cljs.core.compare, null, 0, null, cljs.core.empty_unordered_hash); -cljs.core.PersistentTreeMap.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.__GT_PersistentTreeMap = function(a, b, c, d, e) { + return new cljs.core.PersistentTreeMap(a, b, c, d, e) }; +cljs.core.PersistentTreeMap.EMPTY = new cljs.core.PersistentTreeMap(cljs.core.compare, null, 0, null, 0); cljs.core.hash_map = function() { var a = function(a) { - a = cljs.core.seq(a); - for (var b = cljs.core.transient$(cljs.core.PersistentHashMap.EMPTY);;) { - if (a) { - var e = cljs.core.nnext(a), b = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(a), cljs.core.second(a)); - a = e; - } else { - return cljs.core.persistent_BANG_(b); + a = cljs.core.seq.call(null, a); + for(var b = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { + if(a) { + var e = cljs.core.nnext.call(null, a), b = cljs.core.assoc_BANG_.call(null, b, cljs.core.first.call(null, a), cljs.core.second.call(null, a)); + a = e + }else { + return cljs.core.persistent_BANG_.call(null, b) } } }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.array_map = function() { var a = function(a) { - return cljs.core.PersistentArrayMap.fromArray(cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.array, a), !0, !1); + return new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, cljs.core.count.call(null, a), 2), cljs.core.apply.call(null, cljs.core.array, a), null) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.obj_map = function() { var a = function(a) { var b = [], e; e = {}; - for (a = cljs.core.seq(a);;) { - if (a) { - b.push(cljs.core.first(a)), e[cljs.core.first(a)] = cljs.core.second(a), a = cljs.core.nnext(a); - } else { - return cljs.core.ObjMap.fromObject(b, e); + for(a = cljs.core.seq.call(null, a);;) { + if(a) { + b.push(cljs.core.first.call(null, a)), e[cljs.core.first.call(null, a)] = cljs.core.second.call(null, a), a = cljs.core.nnext.call(null, a) + }else { + return cljs.core.ObjMap.fromObject.call(null, b, e) } } }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.sorted_map = function() { var a = function(a) { - a = cljs.core.seq(a); - for (var b = cljs.core.PersistentTreeMap.EMPTY;;) { - if (a) { - var e = cljs.core.nnext(a), b = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(a), cljs.core.second(a)); - a = e; - } else { - return b; + a = cljs.core.seq.call(null, a); + for(var b = cljs.core.PersistentTreeMap.EMPTY;;) { + if(a) { + var e = cljs.core.nnext.call(null, a), b = cljs.core.assoc.call(null, b, cljs.core.first.call(null, a), cljs.core.second.call(null, a)); + a = e + }else { + return b } } }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.sorted_map_by = function() { var a = function(a, b) { - for (var e = cljs.core.seq(b), f = new cljs.core.PersistentTreeMap(cljs.core.fn__GT_comparator(a), null, 0, null, 0);;) { - if (e) { - var g = cljs.core.nnext(e), f = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(f, cljs.core.first(e), cljs.core.second(e)), e = g - } else { - return f; + for(var e = cljs.core.seq.call(null, b), f = new cljs.core.PersistentTreeMap(cljs.core.fn__GT_comparator.call(null, a), null, 0, null, 0);;) { + if(e) { + var g = cljs.core.nnext.call(null, e), f = cljs.core.assoc.call(null, f, cljs.core.first.call(null, e), cljs.core.second.call(null, e)), e = g + }else { + return f } } }, b = function(b, d) { var e = null; - if (1 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { - f[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b); + return a(d, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.KeySeq = function(a, b) { this.mseq = a; this._meta = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988; + this.cljs$lang$protocol_mask$partition0$ = 32374988 }; -cljs.core.KeySeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.KeySeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.KeySeq.cljs$lang$type = !0; +cljs.core.KeySeq.cljs$lang$ctorStr = "cljs.core/KeySeq"; +cljs.core.KeySeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/KeySeq") }; -cljs.core.KeySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta; +cljs.core.KeySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_coll.call(null, this) }; cljs.core.KeySeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); - return null == a ? null : new cljs.core.KeySeq(a, this._meta); -}; -cljs.core.KeySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_ordered_coll(this); + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); + return null == a ? null : new cljs.core.KeySeq(a, this._meta) }; -cljs.core.KeySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.KeySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.KeySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this._meta); +cljs.core.KeySeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.KeySeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.KeySeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.KeySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.KeySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.mseq.cljs$core$ISeq$_first$arity$1(null).cljs$core$IMapEntry$_key$arity$1(null); + a = cljs.core._first.call(null, this.mseq); + return cljs.core._key.call(null, a) }; cljs.core.KeySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); - return null != a ? new cljs.core.KeySeq(a, this._meta) : cljs.core.List.EMPTY; + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); + return null != a ? new cljs.core.KeySeq(a, this._meta) : cljs.core.List.EMPTY }; -cljs.core.KeySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.KeySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.KeySeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.KeySeq(this.mseq, b); + return new cljs.core.KeySeq(this.mseq, b) }; -cljs.core.KeySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.KeySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta }; -cljs.core.KeySeq.cljs$lang$type = !0; -cljs.core.KeySeq.cljs$lang$ctorStr = "cljs.core/KeySeq"; -cljs.core.KeySeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/KeySeq"); +cljs.core.KeySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) }; cljs.core.__GT_KeySeq = function(a, b) { - return new cljs.core.KeySeq(a, b); -}; -cljs.core.KeySeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.KeySeq(a, b) }; cljs.core.keys = function(a) { - return(a = cljs.core.seq(a)) ? new cljs.core.KeySeq(a, null) : null; + return(a = cljs.core.seq.call(null, a)) ? new cljs.core.KeySeq(a, null) : null }; cljs.core.key = function(a) { - return cljs.core._key(a); + return cljs.core._key.call(null, a) }; cljs.core.ValSeq = function(a, b) { this.mseq = a; this._meta = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988; + this.cljs$lang$protocol_mask$partition0$ = 32374988 }; -cljs.core.ValSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.ValSeq.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); +cljs.core.ValSeq.cljs$lang$type = !0; +cljs.core.ValSeq.cljs$lang$ctorStr = "cljs.core/ValSeq"; +cljs.core.ValSeq.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/ValSeq") }; -cljs.core.ValSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta; +cljs.core.ValSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return cljs.core.hash_coll.call(null, this) }; cljs.core.ValSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); - return null == a ? null : new cljs.core.ValSeq(a, this._meta); -}; -cljs.core.ValSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_ordered_coll(this); + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); + return null == a ? null : new cljs.core.ValSeq(a, this._meta) }; -cljs.core.ValSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.ValSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) }; -cljs.core.ValSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this._meta); +cljs.core.ValSeq.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.ValSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$2(b, this); + return cljs.core.seq_reduce.call(null, b, this) }; cljs.core.ValSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3(b, c, this); + return cljs.core.seq_reduce.call(null, b, c, this) +}; +cljs.core.ValSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return this }; cljs.core.ValSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.mseq.cljs$core$ISeq$_first$arity$1(null).cljs$core$IMapEntry$_val$arity$1(null); + a = cljs.core._first.call(null, this.mseq); + return cljs.core._val.call(null, a) }; cljs.core.ValSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.INext, a)) ? this.mseq.cljs$core$INext$_next$arity$1(null) : cljs.core.next(this.mseq); - return null != a ? new cljs.core.ValSeq(a, this._meta) : cljs.core.List.EMPTY; + a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); + return null != a ? new cljs.core.ValSeq(a, this._meta) : cljs.core.List.EMPTY }; -cljs.core.ValSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this; +cljs.core.ValSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.ValSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ValSeq(this.mseq, b); + return new cljs.core.ValSeq(this.mseq, b) }; -cljs.core.ValSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.ValSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this._meta }; -cljs.core.ValSeq.cljs$lang$type = !0; -cljs.core.ValSeq.cljs$lang$ctorStr = "cljs.core/ValSeq"; -cljs.core.ValSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ValSeq"); +cljs.core.ValSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) }; cljs.core.__GT_ValSeq = function(a, b) { - return new cljs.core.ValSeq(a, b); -}; -cljs.core.ValSeq.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); + return new cljs.core.ValSeq(a, b) }; cljs.core.vals = function(a) { - return(a = cljs.core.seq(a)) ? new cljs.core.ValSeq(a, null) : null; + return(a = cljs.core.seq.call(null, a)) ? new cljs.core.ValSeq(a, null) : null }; cljs.core.val = function(a) { - return cljs.core._val(a); + return cljs.core._val.call(null, a) }; cljs.core.merge = function() { var a = function(a) { - return cljs.core.truth_(cljs.core.some(cljs.core.identity, a)) ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$2(function(a, b) { - return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.truth_(a) ? a : cljs.core.PersistentArrayMap.EMPTY, b); - }, a) : null; + return cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, a)) ? cljs.core.reduce.call(null, function(a, b) { + return cljs.core.conj.call(null, cljs.core.truth_(a) ? a : cljs.core.PersistentArrayMap.EMPTY, b) + }, a) : null }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.merge_with = function() { var a = function(a, b) { - if (cljs.core.truth_(cljs.core.some(cljs.core.identity, b))) { + if(cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, b))) { var e = function(a) { return function(b, c) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(a, cljs.core.truth_(b) ? b : cljs.core.PersistentArrayMap.EMPTY, cljs.core.seq(c)); - }; + return cljs.core.reduce.call(null, a, cljs.core.truth_(b) ? b : cljs.core.PersistentArrayMap.EMPTY, cljs.core.seq.call(null, c)) + } }(function(b, d) { - var e = cljs.core.first(d), k = cljs.core.second(d); - return cljs.core.contains_QMARK_(b, e) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, function() { - var d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b, e); - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(d, k) : a.call(null, d, k); - }()) : cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, e, k); + var e = cljs.core.first.call(null, d), k = cljs.core.second.call(null, d); + return cljs.core.contains_QMARK_.call(null, b, e) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), k)) : cljs.core.assoc.call(null, b, e, k) }); - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$2(e, b); + return cljs.core.reduce.call(null, e, b) } - return null; + return null }, b = function(b, d) { var e = null; - if (1 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { - f[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b); + return a(d, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.select_keys = function(a, b) { - for (var c = cljs.core.PersistentArrayMap.EMPTY, d = cljs.core.seq(b);;) { - if (d) { - var e = cljs.core.first(d), f = cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, e, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", -1572889185)), c = cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(f, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", -1572889185)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(c, e, f) : c, d = cljs.core.next(d) - } else { - return cljs.core.with_meta(c, cljs.core.meta(a)); + for(var c = cljs.core.PersistentArrayMap.EMPTY, d = cljs.core.seq.call(null, b);;) { + if(d) { + var e = cljs.core.first.call(null, d), f = cljs.core.get.call(null, a, e, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", 4155500789)), c = cljs.core.not_EQ_.call(null, f, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", 4155500789)) ? cljs.core.assoc.call(null, c, e, f) : c, d = cljs.core.next.call(null, d) + }else { + return c } } }; @@ -15762,410 +11131,312 @@ cljs.core.PersistentHashSet = function(a, b, c) { this.meta = a; this.hash_map = b; this.__hash = c; - this.cljs$lang$protocol_mask$partition0$ = 15077647; - this.cljs$lang$protocol_mask$partition1$ = 8196; -}; -cljs.core.PersistentHashSet.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentHashSet.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.PersistentHashSet.prototype.keys = function() { - return cljs.core.es6_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentHashSet.prototype.entries = function() { - return cljs.core.es6_set_entries_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentHashSet.prototype.values = function() { - return cljs.core.es6_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentHashSet.prototype.has = function(a) { - return cljs.core.contains_QMARK_(this, a); -}; -cljs.core.PersistentHashSet.prototype.forEach = function(a) { - for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { - if (e < d) { - var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); - a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); - e += 1; - } else { - if (b = cljs.core.seq(b)) { - cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; - } else { - return null; - } - } - } -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._contains_key_QMARK_(this.hash_map, b) ? b : c; -}; -cljs.core.PersistentHashSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentHashSet(this.meta, this.hash_map, this.__hash); -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core._count(this.hash_map); -}; -cljs.core.PersistentHashSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); + this.cljs$lang$protocol_mask$partition1$ = 4; + this.cljs$lang$protocol_mask$partition0$ = 15077647 }; -cljs.core.PersistentHashSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.set_QMARK_(b) && cljs.core.count(this) === cljs.core.count(b) && cljs.core.every_QMARK_(function(a) { - return function(b) { - return cljs.core.contains_QMARK_(a, b); - }; - }(this), b); +cljs.core.PersistentHashSet.cljs$lang$type = !0; +cljs.core.PersistentHashSet.cljs$lang$ctorStr = "cljs.core/PersistentHashSet"; +cljs.core.PersistentHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentHashSet") }; cljs.core.PersistentHashSet.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientHashSet(cljs.core._as_transient(this.hash_map)); -}; -cljs.core.PersistentHashSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.PersistentHashSet.EMPTY, this.meta); -}; -cljs.core.PersistentHashSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(this.meta, cljs.core._dissoc(this.hash_map, b), null); + return new cljs.core.TransientHashSet(cljs.core._as_transient.call(null, this.hash_map)) }; -cljs.core.PersistentHashSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.keys(this.hash_map); +cljs.core.PersistentHashSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + a = this.__hash; + return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this) }; -cljs.core.PersistentHashSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(b, this.hash_map, this.__hash); +cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.call(null, this, b, null) }; -cljs.core.PersistentHashSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(this.meta, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.hash_map, b, null), null); +cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + return cljs.core._contains_key_QMARK_.call(null, this.hash_map, b) ? b : c }; cljs.core.PersistentHashSet.prototype.call = function() { - var a = null, a = function(a, c, d) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); cljs.core.PersistentHashSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.PersistentHashSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; cljs.core.PersistentHashSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) }; -cljs.core.PersistentHashSet.cljs$lang$type = !0; -cljs.core.PersistentHashSet.cljs$lang$ctorStr = "cljs.core/PersistentHashSet"; -cljs.core.PersistentHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentHashSet"); +cljs.core.PersistentHashSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentHashSet(this.meta, cljs.core.assoc.call(null, this.hash_map, b, null), null) +}; +cljs.core.PersistentHashSet.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.keys.call(null, this.hash_map) +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { + return new cljs.core.PersistentHashSet(this.meta, cljs.core._dissoc.call(null, this.hash_map, b), null) +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return cljs.core._count.call(null, this.hash_map) +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + var c = this; + return cljs.core.set_QMARK_.call(null, b) && cljs.core.count.call(null, c) === cljs.core.count.call(null, b) && cljs.core.every_QMARK_.call(null, function(a) { + return cljs.core.contains_QMARK_.call(null, c, a) + }, b) +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentHashSet(b, this.hash_map, this.__hash) +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta +}; +cljs.core.PersistentHashSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.PersistentHashSet.EMPTY, this.meta) }; cljs.core.__GT_PersistentHashSet = function(a, b, c) { - return new cljs.core.PersistentHashSet(a, b, c); + return new cljs.core.PersistentHashSet(a, b, c) }; -cljs.core.PersistentHashSet.EMPTY = new cljs.core.PersistentHashSet(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.empty_unordered_hash); +cljs.core.PersistentHashSet.EMPTY = new cljs.core.PersistentHashSet(null, cljs.core.PersistentArrayMap.EMPTY, 0); cljs.core.PersistentHashSet.fromArray = function(a, b) { var c = a.length; - if (c <= cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD) { - b || cljs.core.aclone(a); - for (var d = 0, e = cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY);;) { - if (d < c) { - var f = d + 1, e = cljs.core._assoc_BANG_(e, a[d], null), d = f - } else { - return new cljs.core.PersistentHashSet(null, cljs.core._persistent_BANG_(e), null); + if(c <= cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD) { + b || cljs.core.aclone.call(null, a); + for(var d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { + if(d < c) { + var f = d + 1, e = cljs.core._assoc_BANG_.call(null, e, a[d], null), d = f + }else { + return new cljs.core.PersistentHashSet(null, cljs.core._persistent_BANG_.call(null, e), null) } } - } else { - for (d = 0, e = cljs.core.transient$(cljs.core.PersistentHashSet.EMPTY);;) { - if (d < c) { - f = d + 1, e = cljs.core._conj_BANG_(e, a[d]), d = f; - } else { - return cljs.core._persistent_BANG_(e); + }else { + for(d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashSet.EMPTY);;) { + if(d < c) { + f = d + 2, e = cljs.core._conj_BANG_.call(null, e, a[d]), d = f + }else { + return cljs.core._persistent_BANG_.call(null, e) } } } }; -cljs.core.PersistentHashSet.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; cljs.core.TransientHashSet = function(a) { this.transient_map = a; this.cljs$lang$protocol_mask$partition0$ = 259; - this.cljs$lang$protocol_mask$partition1$ = 136; + this.cljs$lang$protocol_mask$partition1$ = 136 +}; +cljs.core.TransientHashSet.cljs$lang$type = !0; +cljs.core.TransientHashSet.cljs$lang$ctorStr = "cljs.core/TransientHashSet"; +cljs.core.TransientHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/TransientHashSet") }; cljs.core.TransientHashSet.prototype.call = function() { - var a = null, b = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : b; - }, c = function(a, b, c) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b; - }, a = function(a, e, f) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: - return b.call(this, a, e); + var e; + e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : c; + return e; case 3: - return c.call(this, a, e, f); + return e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? d : c, e } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = b; - a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + } }(); cljs.core.TransientHashSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.TransientHashSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : a; + return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : a }; cljs.core.TransientHashSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? b : a; + return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? b : a }; cljs.core.TransientHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); + return cljs.core._lookup.call(null, this, b, null) }; cljs.core.TransientHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b; + return cljs.core._lookup.call(null, this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b }; cljs.core.TransientHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.count(this.transient_map); + return cljs.core.count.call(null, this.transient_map) }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 = function(a, b) { - this.transient_map = cljs.core.dissoc_BANG_.cljs$core$IFn$_invoke$arity$2(this.transient_map, b); - return this; + this.transient_map = cljs.core.dissoc_BANG_.call(null, this.transient_map, b); + return this }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - this.transient_map = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(this.transient_map, b, null); - return this; + this.transient_map = cljs.core.assoc_BANG_.call(null, this.transient_map, b, null); + return this }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - return new cljs.core.PersistentHashSet(null, cljs.core.persistent_BANG_(this.transient_map), null); -}; -cljs.core.TransientHashSet.cljs$lang$type = !0; -cljs.core.TransientHashSet.cljs$lang$ctorStr = "cljs.core/TransientHashSet"; -cljs.core.TransientHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/TransientHashSet"); + return new cljs.core.PersistentHashSet(null, cljs.core.persistent_BANG_.call(null, this.transient_map), null) }; cljs.core.__GT_TransientHashSet = function(a) { - return new cljs.core.TransientHashSet(a); + return new cljs.core.TransientHashSet(a) }; cljs.core.PersistentTreeSet = function(a, b, c) { this.meta = a; this.tree_map = b; this.__hash = c; - this.cljs$lang$protocol_mask$partition0$ = 417730831; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.PersistentTreeSet.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.PersistentTreeSet.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.PersistentTreeSet.prototype.keys = function() { - return cljs.core.es6_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentTreeSet.prototype.entries = function() { - return cljs.core.es6_set_entries_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentTreeSet.prototype.values = function() { - return cljs.core.es6_iterator(cljs.core.seq(this)); -}; -cljs.core.PersistentTreeSet.prototype.has = function(a) { - return cljs.core.contains_QMARK_(this, a); -}; -cljs.core.PersistentTreeSet.prototype.forEach = function(a) { - for (var b = cljs.core.seq(this), c = null, d = 0, e = 0;;) { - if (e < d) { - var f = c.cljs$core$IIndexed$_nth$arity$2(null, e), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 0, null), f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(f, 1, null); - a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(f, g) : a.call(null, f, g); - e += 1; - } else { - if (b = cljs.core.seq(b)) { - cljs.core.chunked_seq_QMARK_(b) ? (c = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), g = c, d = cljs.core.count(c), c = g) : (c = cljs.core.first(b), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null), c = f = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 1, null), a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, g) : a.call(null, c, g), b = cljs.core.next(b), c = null, d = 0), e = 0; - } else { - return null; - } - } - } -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.cljs$core$IFn$_invoke$arity$3(this, b, null); -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - a = this.tree_map.entry_at(b); - return null != a ? a.key : c; -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.PersistentTreeSet(this.meta, this.tree_map, this.__hash); -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.count(this.tree_map); + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 417730831 }; -cljs.core.PersistentTreeSet.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < cljs.core.count(this.tree_map) ? cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key, cljs.core.rseq(this.tree_map)) : null; +cljs.core.PersistentTreeSet.cljs$lang$type = !0; +cljs.core.PersistentTreeSet.cljs$lang$ctorStr = "cljs.core/PersistentTreeSet"; +cljs.core.PersistentTreeSet.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/PersistentTreeSet") }; cljs.core.PersistentTreeSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_unordered_coll(this); -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.set_QMARK_(b) && cljs.core.count(this) === cljs.core.count(b) && cljs.core.every_QMARK_(function(a) { - return function(b) { - return cljs.core.contains_QMARK_(a, b); - }; - }(this), b); -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core._empty(this.tree_map), 0); + return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this) }; -cljs.core.PersistentTreeSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(this.tree_map, b), null); -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.keys(this.tree_map); -}; -cljs.core.PersistentTreeSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(b, this.tree_map, this.__hash); +cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { + return cljs.core._lookup.call(null, this, b, null) }; -cljs.core.PersistentTreeSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(this.tree_map, b, null), null); +cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { + a = this.tree_map.entry_at(b); + return null != a ? a.key : c }; cljs.core.PersistentTreeSet.prototype.call = function() { - var a = null, a = function(a, c, d) { + var a = null; + return a = function(a, c, d) { switch(arguments.length) { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) } throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return this.cljs$core$ILookup$_lookup$arity$2(null, c); - }; - a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); - }; - return a; + } }(); cljs.core.PersistentTreeSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) }; cljs.core.PersistentTreeSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a); + return this.cljs$core$ILookup$_lookup$arity$2(null, a) }; cljs.core.PersistentTreeSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeSet(this.meta, cljs.core.assoc.call(null, this.tree_map, b, null), null) +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { + return 0 < cljs.core.count.call(null, this.tree_map) ? cljs.core.map.call(null, cljs.core.key, cljs.core.rseq.call(null, this.tree_map)) : null +}; +cljs.core.PersistentTreeSet.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq$arity$2 = function(a, b) { - return cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key, cljs.core._sorted_seq(this.tree_map, b)); + return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq.call(null, this.tree_map, b)) }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = function(a, b, c) { - return cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key, cljs.core._sorted_seq_from(this.tree_map, b, c)); + return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq_from.call(null, this.tree_map, b, c)) }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_entry_key$arity$2 = function(a, b) { - return b; + return b }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_comparator$arity$1 = function(a) { - return cljs.core._comparator(this.tree_map); + return cljs.core._comparator.call(null, this.tree_map) }; -cljs.core.PersistentTreeSet.cljs$lang$type = !0; -cljs.core.PersistentTreeSet.cljs$lang$ctorStr = "cljs.core/PersistentTreeSet"; -cljs.core.PersistentTreeSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/PersistentTreeSet"); +cljs.core.PersistentTreeSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return cljs.core.keys.call(null, this.tree_map) }; -cljs.core.__GT_PersistentTreeSet = function(a, b, c) { - return new cljs.core.PersistentTreeSet(a, b, c); +cljs.core.PersistentTreeSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeSet(this.meta, cljs.core.dissoc.call(null, this.tree_map, b), null) +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return cljs.core.count.call(null, this.tree_map) +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + var c = this; + return cljs.core.set_QMARK_.call(null, b) && cljs.core.count.call(null, c) === cljs.core.count.call(null, b) && cljs.core.every_QMARK_.call(null, function(a) { + return cljs.core.contains_QMARK_.call(null, c, a) + }, b) +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { + return new cljs.core.PersistentTreeSet(b, this.tree_map, this.__hash) +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.PersistentTreeSet.EMPTY, this.meta) }; -cljs.core.PersistentTreeSet.EMPTY = new cljs.core.PersistentTreeSet(null, cljs.core.PersistentTreeMap.EMPTY, cljs.core.empty_unordered_hash); -cljs.core.PersistentTreeSet.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.__GT_PersistentTreeSet = function(a, b, c) { + return new cljs.core.PersistentTreeSet(a, b, c) }; +cljs.core.PersistentTreeSet.EMPTY = new cljs.core.PersistentTreeSet(null, cljs.core.PersistentTreeMap.EMPTY, 0); cljs.core.set_from_indexed_seq = function(a) { a = a.arr; a: { - for (var b = 0, c = cljs.core._as_transient(cljs.core.PersistentHashSet.EMPTY);;) { - if (b < a.length) { - var d = b + 1, c = c.cljs$core$ITransientCollection$_conj_BANG_$arity$2(null, a[b]), b = d - } else { + for(var b = 0, c = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { + if(b < a.length) { + var d = b + 1, c = cljs.core._conj_BANG_.call(null, c, a[b]), b = d + }else { a = c; - break a; + break a } } - a = void 0; + a = void 0 } - return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(null); + return cljs.core._persistent_BANG_.call(null, a) }; cljs.core.set = function(a) { - a = cljs.core.seq(a); - if (null == a) { - return cljs.core.PersistentHashSet.EMPTY; + a = cljs.core.seq.call(null, a); + if(null == a) { + return cljs.core.PersistentHashSet.EMPTY } - if (a instanceof cljs.core.IndexedSeq && 0 === a.i) { - return cljs.core.set_from_indexed_seq(a); + if(a instanceof cljs.core.IndexedSeq) { + return cljs.core.set_from_indexed_seq.call(null, a) } - for (var b = cljs.core._as_transient(cljs.core.PersistentHashSet.EMPTY);;) { - if (null != a) { - var c = a.cljs$core$INext$_next$arity$1(null), b = b.cljs$core$ITransientCollection$_conj_BANG_$arity$2(null, a.cljs$core$ISeq$_first$arity$1(null)); - a = c; - } else { - return b.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(null); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + for(var b = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { + if(null != a) { + var c = cljs.core._next.call(null, a), b = cljs.core._conj_BANG_.call(null, b, cljs.core._first.call(null, a)); + a = c + }else { + return cljs.core._persistent_BANG_.call(null, b) + } } + }else { + return null } }; cljs.core.hash_set = function() { var a = null, b = function() { - return cljs.core.PersistentHashSet.EMPTY; + return cljs.core.PersistentHashSet.EMPTY }, c = function() { var a = function(a) { - return cljs.core.set(a); + return cljs.core.set.call(null, a) }, b = function(b) { var c = null; - if (0 < arguments.length) { - for (var c = 0, e = Array(arguments.length - 0);c < e.length;) { - e[c] = arguments[c + 0], ++c; - } - c = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, c); + 0 < arguments.length && (c = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, c) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a) { switch(arguments.length) { case 0: return b.call(this); default: - var e = null; - if (0 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 0);e < f.length;) { - f[e] = arguments[e + 0], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(e); + return c.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)) } throw Error("Invalid arity: " + arguments.length); }; @@ -16173,193 +11444,113 @@ cljs.core.hash_set = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.sorted_set = function() { var a = function(a) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, cljs.core.PersistentTreeSet.EMPTY, a); + return cljs.core.reduce.call(null, cljs.core._conj, cljs.core.PersistentTreeSet.EMPTY, a) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.sorted_set_by = function() { var a = function(a, b) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core._conj, new cljs.core.PersistentTreeSet(null, cljs.core.sorted_map_by(a), 0), b); + return cljs.core.reduce.call(null, cljs.core._conj, new cljs.core.PersistentTreeSet(null, cljs.core.sorted_map_by.call(null, a), 0), b) }, b = function(b, d) { var e = null; - if (1 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { - f[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b); + return a(d, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; -}(); -cljs.core.replace = function() { - var a = null, b = function(a) { - return cljs.core.map.cljs$core$IFn$_invoke$arity$1(function(b) { - var c = cljs.core.find(a, b); - return cljs.core.truth_(c) ? cljs.core.val(c) : b; - }); - }, c = function(a, b) { - if (cljs.core.vector_QMARK_(b)) { - var c = cljs.core.count(b); - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b) { - return function(b, c) { - var e = cljs.core.find(a, cljs.core.nth.cljs$core$IFn$_invoke$arity$2(b, c)); - return cljs.core.truth_(e) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.second(e)) : b; - }; - }(c), b, cljs.core.take.cljs$core$IFn$_invoke$arity$2(c, cljs.core.iterate(cljs.core.inc, 0))); - } - return cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(b) { - var c = cljs.core.find(a, b); - return cljs.core.truth_(c) ? cljs.core.second(c) : b; - }, b); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.distinct = function() { - var a = null, b = function() { - return function(a) { - return function(b) { - return function() { - var c = null, g = function() { - return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); - }, h = function(b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - }, k = function(c, f) { - if (cljs.core.contains_QMARK_(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b), f)) { - return c; - } - b.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(b.cljs$core$IDeref$_deref$arity$1(null), f)); - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, f) : a.call(null, c, f); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return g.call(this); - case 1: - return h.call(this, a); - case 2: - return k.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = g; - c.cljs$core$IFn$_invoke$arity$1 = h; - c.cljs$core$IFn$_invoke$arity$2 = k; - return c; - }(); - }(cljs.core.volatile_BANG_(cljs.core.PersistentHashSet.EMPTY)); - }; - }, c = function(a) { - return function f(a, b) { - return new cljs.core.LazySeq(null, function() { - return function(a, b) { - for (;;) { - var c = a, d = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(c, 0, null); - if (c = cljs.core.seq(c)) { - if (cljs.core.contains_QMARK_(b, d)) { - d = cljs.core.rest(c), c = b, a = d, b = c; - } else { - return cljs.core.cons(d, f(cljs.core.rest(c), cljs.core.conj.cljs$core$IFn$_invoke$arity$2(b, d))); - } - } else { - return null; + return b +}(); +cljs.core.replace = function(a, b) { + if(cljs.core.vector_QMARK_.call(null, b)) { + var c = cljs.core.count.call(null, b); + return cljs.core.reduce.call(null, function(b, c) { + var f = cljs.core.find.call(null, a, cljs.core.nth.call(null, b, c)); + return cljs.core.truth_(f) ? cljs.core.assoc.call(null, b, c, cljs.core.second.call(null, f)) : b + }, b, cljs.core.take.call(null, c, cljs.core.iterate.call(null, cljs.core.inc, 0))) + } + return cljs.core.map.call(null, function(b) { + var c = cljs.core.find.call(null, a, b); + return cljs.core.truth_(c) ? cljs.core.second.call(null, c) : b + }, b) +}; +cljs.core.distinct = function(a) { + return function c(a, e) { + return new cljs.core.LazySeq(null, function() { + return function(a, d) { + for(;;) { + var e = a, k = cljs.core.nth.call(null, e, 0, null); + if(e = cljs.core.seq.call(null, e)) { + if(cljs.core.contains_QMARK_.call(null, d, k)) { + k = cljs.core.rest.call(null, e), e = d, a = k, d = e + }else { + return cljs.core.cons.call(null, k, c.call(null, cljs.core.rest.call(null, e), cljs.core.conj.call(null, d, k))) } + }else { + return null } - }.call(null, a, b); - }, null, null); - }(a, cljs.core.PersistentHashSet.EMPTY); - }, a = function(a) { - switch(arguments.length) { - case 0: - return b.call(this); - case 1: - return c.call(this, a); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$0 = b; - a.cljs$core$IFn$_invoke$arity$1 = c; - return a; -}(); + } + }.call(null, a, e) + }, null, null) + }.call(null, a, cljs.core.PersistentHashSet.EMPTY) +}; cljs.core.butlast = function(a) { - for (var b = cljs.core.PersistentVector.EMPTY;;) { - if (cljs.core.next(a)) { - b = cljs.core.conj.cljs$core$IFn$_invoke$arity$2(b, cljs.core.first(a)), a = cljs.core.next(a); - } else { - return cljs.core.seq(b); + for(var b = cljs.core.PersistentVector.EMPTY;;) { + if(cljs.core.next.call(null, a)) { + b = cljs.core.conj.call(null, b, cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a) + }else { + return cljs.core.seq.call(null, b) } } }; cljs.core.name = function(a) { - if (a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { - return a.cljs$core$INamed$_name$arity$1(null); + if(a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { + return cljs.core._name.call(null, a) } - if ("string" === typeof a) { - return a; + if("string" === typeof a) { + return a } throw Error([cljs.core.str("Doesn't support name: "), cljs.core.str(a)].join("")); }; cljs.core.zipmap = function(a, b) { - for (var c = cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY), d = cljs.core.seq(a), e = cljs.core.seq(b);;) { - if (d && e) { - c = cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(c, cljs.core.first(d), cljs.core.first(e)), d = cljs.core.next(d), e = cljs.core.next(e); - } else { - return cljs.core.persistent_BANG_(c); + for(var c = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), d = cljs.core.seq.call(null, a), e = cljs.core.seq.call(null, b);;) { + if(d && e) { + c = cljs.core.assoc_BANG_.call(null, c, cljs.core.first.call(null, d), cljs.core.first.call(null, e)), d = cljs.core.next.call(null, d), e = cljs.core.next.call(null, e) + }else { + return cljs.core.persistent_BANG_.call(null, c) } } }; cljs.core.max_key = function() { var a = null, b = function(a, b, c) { - return(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)) > (a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)) ? b : c; + return a.call(null, b) > a.call(null, c) ? b : c }, c = function() { var b = function(b, c, d, e) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(c, d) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, d); - }, a.cljs$core$IFn$_invoke$arity$3(b, c, d), e); + return cljs.core.reduce.call(null, function(c, d) { + return a.call(null, b, c, d) + }, a.call(null, b, c, d), e) }, c = function(a, c, e, k) { var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return b.call(this, a, c, e, l); + 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, c, e, l) }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -16369,10 +11560,10 @@ cljs.core.max_key = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a); + return b(c, e, k, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f, g) { switch(arguments.length) { case 2: @@ -16380,43 +11571,31 @@ cljs.core.max_key = function() { case 3: return b.call(this, a, e, f); default: - var h = null; - if (3 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { - k[h] = arguments[h + 3], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return b; + return b }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.min_key = function() { var a = null, b = function(a, b, c) { - return(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b)) < (a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c)) ? b : c; + return a.call(null, b) < a.call(null, c) ? b : c }, c = function() { var b = function(b, c, d, e) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(c, d) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, d); - }, a.cljs$core$IFn$_invoke$arity$3(b, c, d), e); + return cljs.core.reduce.call(null, function(c, d) { + return a.call(null, b, c, d) + }, a.call(null, b, c, d), e) }, c = function(a, c, e, k) { var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return b.call(this, a, c, e, l); + 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, c, e, l) }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -16426,10 +11605,10 @@ cljs.core.min_key = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a); + return b(c, e, k, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e, f, g) { switch(arguments.length) { case 2: @@ -16437,352 +11616,181 @@ cljs.core.min_key = function() { case 3: return b.call(this, a, e, f); default: - var h = null; - if (3 < arguments.length) { - for (var h = 0, k = Array(arguments.length - 3);h < k.length;) { - k[h] = arguments[h + 3], ++h; - } - h = new cljs.core.IndexedSeq(k, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, h); + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return b; + return b }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); -cljs.core.ArrayList = function(a) { - this.arr = a; -}; -cljs.core.ArrayList.prototype.add = function(a) { - return this.arr.push(a); -}; -cljs.core.ArrayList.prototype.size = function() { - return this.arr.length; -}; -cljs.core.ArrayList.prototype.clear = function() { - return this.arr = []; -}; -cljs.core.ArrayList.prototype.isEmpty = function() { - return 0 === this.arr.length; -}; -cljs.core.ArrayList.prototype.toArray = function() { - return this.arr; -}; -cljs.core.ArrayList.cljs$lang$type = !0; -cljs.core.ArrayList.cljs$lang$ctorStr = "cljs.core/ArrayList"; -cljs.core.ArrayList.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ArrayList"); -}; -cljs.core.__GT_ArrayList = function(a) { - return new cljs.core.ArrayList(a); -}; -cljs.core.array_list = function() { - return new cljs.core.ArrayList([]); -}; cljs.core.partition_all = function() { - var a = null, b = function(a) { - return function(b) { - return function(c) { - return function() { - var d = null, k = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, l = function(a) { - if (!cljs.core.truth_(c.isEmpty())) { - var d = cljs.core.vec(c.toArray()); - c.clear(); - a = cljs.core.unreduced(b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(a, d) : b.call(null, a, d)); - } - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, m = function(d, h) { - c.add(h); - if (a === c.size()) { - var k = cljs.core.vec(c.toArray()); - c.clear(); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, k) : b.call(null, d, k); - } - return d; - }, d = function(a, b) { - switch(arguments.length) { - case 0: - return k.call(this); - case 1: - return l.call(this, a); - case 2: - return m.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - d.cljs$core$IFn$_invoke$arity$0 = k; - d.cljs$core$IFn$_invoke$arity$1 = l; - d.cljs$core$IFn$_invoke$arity$2 = m; - return d; - }(); - }(cljs.core.array_list()); - }; - }, c = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, b, c); - }, d = function(b, c, d) { + var a = null, b = function(b, c) { + return a.call(null, b, b, c) + }, c = function(b, c, f) { return new cljs.core.LazySeq(null, function() { - var h = cljs.core.seq(d); - return h ? cljs.core.cons(cljs.core.take.cljs$core$IFn$_invoke$arity$2(b, h), a.cljs$core$IFn$_invoke$arity$3(b, c, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(c, h))) : null; - }, null, null); - }, a = function(a, f, g) { + var g = cljs.core.seq.call(null, f); + return g ? cljs.core.cons.call(null, cljs.core.take.call(null, b, g), a.call(null, b, c, cljs.core.drop.call(null, c, g))) : null + }, null, null) + }, a = function(a, e, f) { switch(arguments.length) { - case 1: - return b.call(this, a); case 2: - return c.call(this, a, f); + return b.call(this, a, e); case 3: - return d.call(this, a, f, g); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - return a; -}(); -cljs.core.take_while = function() { - var a = null, b = function(a) { - return function(b) { - return function() { - var c = null, g = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, h = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, k = function(c, f) { - return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(f) : a.call(null, f)) ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, f) : b.call(null, c, f) : cljs.core.reduced(c); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return g.call(this); - case 1: - return h.call(this, a); - case 2: - return k.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = g; - c.cljs$core$IFn$_invoke$arity$1 = h; - c.cljs$core$IFn$_invoke$arity$2 = k; - return c; - }(); - }; - }, c = function(b, c) { - return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c); - return f ? cljs.core.truth_(function() { - var a = cljs.core.first(f); - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }()) ? cljs.core.cons(cljs.core.first(f), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.rest(f))) : null : null; - }, null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + return a }(); +cljs.core.take_while = function take_while(b, c) { + return new cljs.core.LazySeq(null, function() { + var d = cljs.core.seq.call(null, c); + return d ? cljs.core.truth_(b.call(null, cljs.core.first.call(null, d))) ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_while.call(null, b, cljs.core.rest.call(null, d))) : null : null + }, null, null) +}; cljs.core.mk_bound_fn = function(a, b, c) { return function(d) { - var e = cljs.core._comparator(a); - d = cljs.core._entry_key(a, d); - e = e.cljs$core$IFn$_invoke$arity$2 ? e.cljs$core$IFn$_invoke$arity$2(d, c) : e.call(null, d, c); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(e, 0) : b.call(null, e, 0); - }; + var e = cljs.core._comparator.call(null, a); + return b.call(null, e.call(null, cljs.core._entry_key.call(null, a, d), c), 0) + } }; cljs.core.subseq = function() { var a = null, b = function(a, b, c) { - var g = cljs.core.mk_bound_fn(a, b, c); - return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._GT_, cljs.core._GT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from(a, c, !0), cljs.core.truth_(a) ? (b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), cljs.core.truth_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b)) ? a : cljs.core.next(a)) : null) : cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(g, cljs.core._sorted_seq(a, !0)); + var g = cljs.core.mk_bound_fn.call(null, a, b, c); + return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._GT_, cljs.core._GT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !0), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !0)) }, c = function(a, b, c, g, h) { - var k = cljs.core._sorted_seq_from(a, c, !0); - if (cljs.core.truth_(k)) { - var l = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(k, 0, null); - return cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(cljs.core.mk_bound_fn(a, g, h), cljs.core.truth_(cljs.core.mk_bound_fn(a, b, c).call(null, l)) ? k : cljs.core.next(k)); + var k = cljs.core._sorted_seq_from.call(null, a, c, !0); + if(cljs.core.truth_(k)) { + var l = cljs.core.nth.call(null, k, 0, null); + return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, g, h), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, b, c).call(null, l)) ? k : cljs.core.next.call(null, k)) } - return null; + return null }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h); + return c.call(this, a, e, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a; + return a }(); cljs.core.rsubseq = function() { var a = null, b = function(a, b, c) { - var g = cljs.core.mk_bound_fn(a, b, c); - return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._LT_, cljs.core._LT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from(a, c, !1), cljs.core.truth_(a) ? (b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(a, 0, null), cljs.core.truth_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b)) ? a : cljs.core.next(a)) : null) : cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(g, cljs.core._sorted_seq(a, !1)); + var g = cljs.core.mk_bound_fn.call(null, a, b, c); + return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._LT_, cljs.core._LT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !1), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !1)) }, c = function(a, b, c, g, h) { - var k = cljs.core._sorted_seq_from(a, h, !1); - if (cljs.core.truth_(k)) { - var l = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(k, 0, null); - return cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(cljs.core.mk_bound_fn(a, b, c), cljs.core.truth_(cljs.core.mk_bound_fn(a, g, h).call(null, l)) ? k : cljs.core.next(k)); + var k = cljs.core._sorted_seq_from.call(null, a, h, !1); + if(cljs.core.truth_(k)) { + var l = cljs.core.nth.call(null, k, 0, null); + return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, b, c), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, g, h).call(null, l)) ? k : cljs.core.next.call(null, k)) } - return null; + return null }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h); + return c.call(this, a, e, f, g, h) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a; -}(); -cljs.core.RangeIterator = function(a, b, c) { - this.i = a; - this.end = b; - this.step = c; -}; -cljs.core.RangeIterator.prototype.hasNext = function() { - return 0 < this.step ? this.i < this.end : this.i > this.end; -}; -cljs.core.RangeIterator.prototype.next = function() { - var a = this.i; - this.i += this.step; - return a; -}; -cljs.core.RangeIterator.cljs$lang$type = !0; -cljs.core.RangeIterator.cljs$lang$ctorStr = "cljs.core/RangeIterator"; -cljs.core.RangeIterator.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/RangeIterator"); -}; -cljs.core.__GT_RangeIterator = function(a, b, c) { - return new cljs.core.RangeIterator(a, b, c); -}; + return a +}(); cljs.core.Range = function(a, b, c, d, e) { this.meta = a; this.start = b; this.end = c; this.step = d; this.__hash = e; - this.cljs$lang$protocol_mask$partition0$ = 32375006; - this.cljs$lang$protocol_mask$partition1$ = 8192; -}; -cljs.core.Range.prototype.toString = function() { - return cljs.core.pr_str_STAR_(this); -}; -cljs.core.Range.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if (b < cljs.core._count(this)) { - return this.start + b * this.step; - } - if (this.start > this.end && 0 === this.step) { - return this.start; - } - throw Error("Index out of bounds"); -}; -cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return b < cljs.core._count(this) ? this.start + b * this.step : this.start > this.end && 0 === this.step ? this.start : c; -}; -cljs.core.Range.prototype.cljs$core$IIterable$ = !0; -cljs.core.Range.prototype.cljs$core$IIterable$_iterator$arity$1 = function(a) { - return new cljs.core.RangeIterator(this.start, this.end, this.step); -}; -cljs.core.Range.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta; -}; -cljs.core.Range.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { - return new cljs.core.Range(this.meta, this.start, this.end, this.step, this.__hash); -}; -cljs.core.Range.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 0 < this.step ? this.start + this.step < this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null : this.start + this.step > this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null; + this.cljs$lang$protocol_mask$partition1$ = 0; + this.cljs$lang$protocol_mask$partition0$ = 32375006 }; -cljs.core.Range.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if (cljs.core.not(cljs.core._seq(this))) { - return 0; - } - a = (this.end - this.start) / this.step; - return Math.ceil.cljs$core$IFn$_invoke$arity$1 ? Math.ceil.cljs$core$IFn$_invoke$arity$1(a) : Math.ceil.call(null, a); +cljs.core.Range.cljs$lang$type = !0; +cljs.core.Range.cljs$lang$ctorStr = "cljs.core/Range"; +cljs.core.Range.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/Range") }; cljs.core.Range.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_ordered_coll(this); + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) }; -cljs.core.Range.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential(this, b); +cljs.core.Range.prototype.cljs$core$INext$_next$arity$1 = function(a) { + return 0 < this.step ? this.start + this.step < this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null : this.start + this.step > this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null }; -cljs.core.Range.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta(cljs.core.List.EMPTY, this.meta); +cljs.core.Range.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { + return cljs.core.cons.call(null, b, this) +}; +cljs.core.Range.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this) }; cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.cljs$core$IFn$_invoke$arity$2(this, b); + return cljs.core.ci_reduce.call(null, this, b) }; cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - for (a = this.start;;) { - if (0 < this.step ? a < this.end : a > this.end) { - var d = a; - c = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d); - if (cljs.core.reduced_QMARK_(c)) { - return b = c, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); - } - a += this.step; - } else { - return c; - } - } + return cljs.core.ci_reduce.call(null, this, b, c) +}; +cljs.core.Range.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { + return 0 < this.step ? this.start < this.end ? this : null : this.start > this.end ? this : null +}; +cljs.core.Range.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { + return cljs.core.not.call(null, cljs.core._seq.call(null, this)) ? 0 : Math.ceil((this.end - this.start) / this.step) }; cljs.core.Range.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null == cljs.core._seq(this) ? null : this.start; + return this.start }; cljs.core.Range.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null != cljs.core._seq(this) ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : cljs.core.List.EMPTY; + return null != cljs.core._seq.call(null, this) ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : cljs.core.List.EMPTY }; -cljs.core.Range.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.step ? this.start < this.end ? this : null : this.start > this.end ? this : null; +cljs.core.Range.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return cljs.core.equiv_sequential.call(null, this, b) }; cljs.core.Range.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Range(b, this.start, this.end, this.step, this.__hash); + return new cljs.core.Range(b, this.start, this.end, this.step, this.__hash) }; -cljs.core.Range.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons(b, this); +cljs.core.Range.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta }; -cljs.core.Range.cljs$lang$type = !0; -cljs.core.Range.cljs$lang$ctorStr = "cljs.core/Range"; -cljs.core.Range.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Range"); +cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { + if(b < cljs.core._count.call(null, this)) { + return this.start + b * this.step + } + if(this.start > this.end && 0 === this.step) { + return this.start + } + throw Error("Index out of bounds"); }; -cljs.core.__GT_Range = function(a, b, c, d, e) { - return new cljs.core.Range(a, b, c, d, e); +cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { + return b < cljs.core._count.call(null, this) ? this.start + b * this.step : this.start > this.end && 0 === this.step ? this.start : c +}; +cljs.core.Range.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) }; -cljs.core.Range.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); +cljs.core.__GT_Range = function(a, b, c, d, e) { + return new cljs.core.Range(a, b, c, d, e) }; cljs.core.range = function() { var a = null, b = function() { - return a.cljs$core$IFn$_invoke$arity$3(0, Number.MAX_VALUE, 1); + return a.call(null, 0, Number.MAX_VALUE, 1) }, c = function(b) { - return a.cljs$core$IFn$_invoke$arity$3(0, b, 1); + return a.call(null, 0, b, 1) }, d = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, 1); + return a.call(null, b, c, 1) }, e = function(a, b, c) { - return new cljs.core.Range(null, a, b, c, null); + return new cljs.core.Range(null, a, b, c, null) }, a = function(a, g, h) { switch(arguments.length) { case 0: @@ -16792,7 +11800,7 @@ cljs.core.range = function() { case 2: return d.call(this, a, g); case 3: - return e.call(this, a, g, h); + return e.call(this, a, g, h) } throw Error("Invalid arity: " + arguments.length); }; @@ -16800,190 +11808,70 @@ cljs.core.range = function() { a.cljs$core$IFn$_invoke$arity$1 = c; a.cljs$core$IFn$_invoke$arity$2 = d; a.cljs$core$IFn$_invoke$arity$3 = e; - return a; -}(); -cljs.core.take_nth = function() { - var a = null, b = function(a) { - return function(b) { - return function(c) { - return function() { - var g = null, h = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, k = function(a) { - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, l = function(g, h) { - var k = c.cljs$core$IVolatile$_vreset_BANG_$arity$2(null, c.cljs$core$IDeref$_deref$arity$1(null) + 1); - return 0 === cljs.core.rem(k, a) ? b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, h) : b.call(null, g, h) : g; - }, g = function(a, b) { - switch(arguments.length) { - case 0: - return h.call(this); - case 1: - return k.call(this, a); - case 2: - return l.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - g.cljs$core$IFn$_invoke$arity$0 = h; - g.cljs$core$IFn$_invoke$arity$1 = k; - g.cljs$core$IFn$_invoke$arity$2 = l; - return g; - }(); - }(cljs.core.volatile_BANG_(-1)); - }; - }, c = function(b, c) { - return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c); - return f ? cljs.core.cons(cljs.core.first(f), a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.drop.cljs$core$IFn$_invoke$arity$2(b, f))) : null; - }, null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); +cljs.core.take_nth = function take_nth(b, c) { + return new cljs.core.LazySeq(null, function() { + var d = cljs.core.seq.call(null, c); + return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_nth.call(null, b, cljs.core.drop.call(null, b, d))) : null + }, null, null) +}; cljs.core.split_with = function(a, b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(a, b), cljs.core.drop_while.cljs$core$IFn$_invoke$arity$2(a, b)], null); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take_while.call(null, a, b), cljs.core.drop_while.call(null, a, b)], null) }; -cljs.core.partition_by = function() { - var a = null, b = function(a) { - return function(b) { - var c = cljs.core.array_list(), g = cljs.core.volatile_BANG_(new cljs.core.Keyword("cljs.core", "none", "cljs.core/none", 926646439)); - return function(c, f) { - return function() { - var g = null, m = function() { - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); - }, n = function(a) { - if (!cljs.core.truth_(c.isEmpty())) { - var d = cljs.core.vec(c.toArray()); - c.clear(); - a = cljs.core.unreduced(b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(a, d) : b.call(null, a, d)); - } - return b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a); - }, p = function(g, l) { - var m = cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(f) : cljs.core.deref.call(null, f), n = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(l) : a.call(null, l); - cljs.core.vreset_BANG_(f, n); - if (cljs.core.keyword_identical_QMARK_(m, new cljs.core.Keyword("cljs.core", "none", "cljs.core/none", 926646439)) || cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(n, m)) { - return c.add(l), g; - } - m = cljs.core.vec(c.toArray()); - c.clear(); - m = b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(g, m) : b.call(null, g, m); - cljs.core.reduced_QMARK_(m) || c.add(l); - return m; - }, g = function(a, b) { - switch(arguments.length) { - case 0: - return m.call(this); - case 1: - return n.call(this, a); - case 2: - return p.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - g.cljs$core$IFn$_invoke$arity$0 = m; - g.cljs$core$IFn$_invoke$arity$1 = n; - g.cljs$core$IFn$_invoke$arity$2 = p; - return g; - }(); - }(c, g); - }; - }, c = function(b, c) { - return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c); - if (f) { - var g = cljs.core.first(f), h = b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(g) : b.call(null, g), g = cljs.core.cons(g, cljs.core.take_while.cljs$core$IFn$_invoke$arity$2(function(a, c, e, f) { - return function(a) { - return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(a) : b.call(null, a)); - }; - }(g, h, f, f), cljs.core.next(f))); - return cljs.core.cons(g, a.cljs$core$IFn$_invoke$arity$2(b, cljs.core.seq(cljs.core.drop.cljs$core$IFn$_invoke$arity$2(cljs.core.count(g), f)))); - } - return null; - }, null, null); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); +cljs.core.partition_by = function partition_by(b, c) { + return new cljs.core.LazySeq(null, function() { + var d = cljs.core.seq.call(null, c); + if(d) { + var e = cljs.core.first.call(null, d), f = b.call(null, e), e = cljs.core.cons.call(null, e, cljs.core.take_while.call(null, function(c, d) { + return function(c) { + return cljs.core._EQ_.call(null, d, b.call(null, c)) + } + }(e, f), cljs.core.next.call(null, d))); + return cljs.core.cons.call(null, e, partition_by.call(null, b, cljs.core.seq.call(null, cljs.core.drop.call(null, cljs.core.count.call(null, e), d)))) } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); + return null + }, null, null) +}; cljs.core.frequencies = function(a) { - return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a, c) { - return cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(a, c, cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, c, 0) + 1); - }, cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY), a)); + return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(a, c) { + return cljs.core.assoc_BANG_.call(null, a, c, cljs.core.get.call(null, a, c, 0) + 1) + }, cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), a)) }; cljs.core.reductions = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { - var f = cljs.core.seq(c); - return f ? a.cljs$core$IFn$_invoke$arity$3(b, cljs.core.first(f), cljs.core.rest(f)) : cljs.core._conj(cljs.core.List.EMPTY, b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null)); - }, null, null); + var f = cljs.core.seq.call(null, c); + return f ? a.call(null, b, cljs.core.first.call(null, f), cljs.core.rest.call(null, f)) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b.call(null)) + }, null, null) }, c = function(b, c, f) { - return cljs.core.cons(c, new cljs.core.LazySeq(null, function() { - var g = cljs.core.seq(f); - return g ? a.cljs$core$IFn$_invoke$arity$3(b, function() { - var a = cljs.core.first(g); - return b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, a) : b.call(null, c, a); - }(), cljs.core.rest(g)) : null; - }, null, null)); + return cljs.core.cons.call(null, c, new cljs.core.LazySeq(null, function() { + var g = cljs.core.seq.call(null, f); + return g ? a.call(null, b, b.call(null, c, cljs.core.first.call(null, g)), cljs.core.rest.call(null, g)) : null + }, null, null)) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.juxt = function() { var a = null, b = function(a) { return function() { var b = null, c = function() { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null)], null); - }, d = function(b) { - var c = cljs.core.PersistentVector, d = cljs.core.PersistentVector.EMPTY_NODE; - b = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - return new c(null, 1, 5, d, [b], null); - }, e = function(b, c) { - var d = cljs.core.PersistentVector, e = cljs.core.PersistentVector.EMPTY_NODE, g; - g = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - return new d(null, 1, 5, e, [g], null); - }, m = function(b, c, d) { - var e = cljs.core.PersistentVector, g = cljs.core.PersistentVector.EMPTY_NODE; - b = a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.call(null, b, c, d); - return new e(null, 1, 5, g, [b], null); - }, n = function() { var b = function(b, c, d, e) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e)], null); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, b, c, d, e)], null) }, c = function(a, c, d, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.call(this, a, c, d, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return b.call(this, a, c, d, f) }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -16993,63 +11881,38 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, a); + return b(c, d, e, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(), b = function(a, b, f, g) { + return c + }(), b = function(b, d, e, g) { switch(arguments.length) { case 0: - return c.call(this); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null)], null); case 1: - return d.call(this, a); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b)], null); case 2: - return e.call(this, a, b); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b, d)], null); case 3: - return m.call(this, a, b, f); + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b, d, e)], null); default: - var t = null; - if (3 < arguments.length) { - for (var t = 0, u = Array(arguments.length - 3);t < u.length;) { - u[t] = arguments[t + 3], ++t; - } - t = new cljs.core.IndexedSeq(u, 0); - } - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, f, t); + return c.cljs$core$IFn$_invoke$arity$variadic(b, d, e, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = n.cljs$lang$applyTo; - b.cljs$core$IFn$_invoke$arity$0 = c; - b.cljs$core$IFn$_invoke$arity$1 = d; - b.cljs$core$IFn$_invoke$arity$2 = e; - b.cljs$core$IFn$_invoke$arity$3 = m; - b.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); + b.cljs$lang$applyTo = c.cljs$lang$applyTo; + return b + }() }, c = function(a, b) { return function() { var c = null, d = function() { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null)], null); - }, e = function(c) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c), b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(c) : b.call(null, c)], null); - }, m = function(c, d) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d), b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(c, d) : b.call(null, c, d)], null); - }, n = function(c, d, e) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e), b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(c, d, e) : b.call(null, c, d, e)], null); - }, p = function() { var c = function(c, d, e, h) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, c, d, e, h), cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, c, d, e, h)], null); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, c, d, e, h), cljs.core.apply.call(null, b, c, d, e, h)], null) }, d = function(a, b, d, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.call(this, a, b, d, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return c.call(this, a, b, d, f) }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -17059,63 +11922,38 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a); + return c(b, d, e, a) }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(), c = function(a, b, c, f) { + return d + }(), c = function(c, e, h, p) { switch(arguments.length) { case 0: - return d.call(this); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null), b.call(null)], null); case 1: - return e.call(this, a); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c), b.call(null, c)], null); case 2: - return m.call(this, a, b); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c, e), b.call(null, c, e)], null); case 3: - return n.call(this, a, b, c); + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c, e, h), b.call(null, c, e, h)], null); default: - var g = null; - if (3 < arguments.length) { - for (var g = 0, h = Array(arguments.length - 3);g < h.length;) { - h[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(h, 0); - } - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, g); + return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = p.cljs$lang$applyTo; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = e; - c.cljs$core$IFn$_invoke$arity$2 = m; - c.cljs$core$IFn$_invoke$arity$3 = n; - c.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return c; - }(); + c.cljs$lang$applyTo = d.cljs$lang$applyTo; + return c + }() }, d = function(a, b, c) { return function() { var d = null, e = function() { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null), c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null)], null); - }, m = function(d) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d), b.cljs$core$IFn$_invoke$arity$1 ? b.cljs$core$IFn$_invoke$arity$1(d) : b.call(null, d), c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(d) : c.call(null, d)], null); - }, n = function(d, e) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(d, e) : a.call(null, d, e), b.cljs$core$IFn$_invoke$arity$2 ? b.cljs$core$IFn$_invoke$arity$2(d, e) : b.call(null, d, e), c.cljs$core$IFn$_invoke$arity$2 ? c.cljs$core$IFn$_invoke$arity$2(d, e) : c.call(null, d, e)], null); - }, p = function(d, e, k) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(d, e, k) : a.call(null, d, e, k), b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(d, e, k) : b.call(null, d, e, k), c.cljs$core$IFn$_invoke$arity$3 ? c.cljs$core$IFn$_invoke$arity$3(d, e, k) : c.call(null, d, e, k)], null); - }, q = function() { var d = function(d, e, k, l) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.cljs$core$IFn$_invoke$arity$5(a, d, e, k, l), cljs.core.apply.cljs$core$IFn$_invoke$arity$5(b, d, e, k, l), cljs.core.apply.cljs$core$IFn$_invoke$arity$5(c, d, e, k, l)], null); + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, d, e, k, l), cljs.core.apply.call(null, b, d, e, k, l), cljs.core.apply.call(null, c, d, e, k, l)], null) }, e = function(a, b, c, e) { var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return d.call(this, a, b, c, f); + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return d.call(this, a, b, c, f) }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -17125,139 +11963,94 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a); + return d(b, c, e, a) }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e; - }(), d = function(a, b, c, d) { + return e + }(), d = function(d, k, p, q) { switch(arguments.length) { case 0: - return e.call(this); + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null), b.call(null), c.call(null)], null); case 1: - return m.call(this, a); + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d), b.call(null, d), c.call(null, d)], null); case 2: - return n.call(this, a, b); + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d, k), b.call(null, d, k), c.call(null, d, k)], null); case 3: - return p.call(this, a, b, c); + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d, k, p), b.call(null, d, k, p), c.call(null, d, k, p)], null); default: - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return q.cljs$core$IFn$_invoke$arity$variadic(a, b, c, f); + return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; - d.cljs$lang$applyTo = q.cljs$lang$applyTo; - d.cljs$core$IFn$_invoke$arity$0 = e; - d.cljs$core$IFn$_invoke$arity$1 = m; - d.cljs$core$IFn$_invoke$arity$2 = n; - d.cljs$core$IFn$_invoke$arity$3 = p; - d.cljs$core$IFn$_invoke$arity$variadic = q.cljs$core$IFn$_invoke$arity$variadic; - return d; - }(); + d.cljs$lang$applyTo = e.cljs$lang$applyTo; + return d + }() }, e = function() { var a = function(a, b, c, d) { - return function(a) { - return function() { - var b = null, c = function() { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { - return function(a, b) { - return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null)); - }; - }(a), cljs.core.PersistentVector.EMPTY, a); - }, d = function(b) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { - return function(a, c) { - return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(b) : c.call(null, b)); - }; - }(a), cljs.core.PersistentVector.EMPTY, a); - }, e = function(b, c) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { - return function(a, d) { - return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, d.cljs$core$IFn$_invoke$arity$2 ? d.cljs$core$IFn$_invoke$arity$2(b, c) : d.call(null, b, c)); - }; - }(a), cljs.core.PersistentVector.EMPTY, a); - }, f = function(b, c, d) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { - return function(a, e) { - return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, e.cljs$core$IFn$_invoke$arity$3 ? e.cljs$core$IFn$_invoke$arity$3(b, c, d) : e.call(null, b, c, d)); - }; - }(a), cljs.core.PersistentVector.EMPTY, a); - }, g = function() { - var b = function(b, c, d, e) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a) { - return function(a, f) { - return cljs.core.conj.cljs$core$IFn$_invoke$arity$2(a, cljs.core.apply.cljs$core$IFn$_invoke$arity$5(f, b, c, d, e)); - }; - }(a), cljs.core.PersistentVector.EMPTY, a); - }, c = function(a, c, d, e) { - var f = null; - if (3 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 3);f < g.length;) { - g[f] = arguments[f + 3], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return b.call(this, a, c, d, f); - }; - c.cljs$lang$maxFixedArity = 3; - c.cljs$lang$applyTo = function(a) { - var c = cljs.core.first(a); - a = cljs.core.next(a); - var d = cljs.core.first(a); - a = cljs.core.next(a); - var e = cljs.core.first(a); - a = cljs.core.rest(a); - return b(c, d, e, a); - }; - c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; - }(), b = function(a, b, h, k) { - switch(arguments.length) { - case 0: - return c.call(this); - case 1: - return d.call(this, a); - case 2: - return e.call(this, a, b); - case 3: - return f.call(this, a, b, h); - default: - var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return g.cljs$core$IFn$_invoke$arity$variadic(a, b, h, l); - } - throw Error("Invalid arity: " + arguments.length); + var e = cljs.core.list_STAR_.call(null, a, b, c, d); + return function() { + var a = null, b = function() { + return cljs.core.reduce.call(null, function(a, b) { + return cljs.core.conj.call(null, a, b.call(null)) + }, cljs.core.PersistentVector.EMPTY, e) + }, c = function(a) { + return cljs.core.reduce.call(null, function(b, c) { + return cljs.core.conj.call(null, b, c.call(null, a)) + }, cljs.core.PersistentVector.EMPTY, e) + }, d = function(a, b) { + return cljs.core.reduce.call(null, function(c, d) { + return cljs.core.conj.call(null, c, d.call(null, a, b)) + }, cljs.core.PersistentVector.EMPTY, e) + }, f = function(a, b, c) { + return cljs.core.reduce.call(null, function(d, e) { + return cljs.core.conj.call(null, d, e.call(null, a, b, c)) + }, cljs.core.PersistentVector.EMPTY, e) + }, g = function() { + var a = function(a, b, c, d) { + return cljs.core.reduce.call(null, function(e, f) { + return cljs.core.conj.call(null, e, cljs.core.apply.call(null, f, a, b, c, d)) + }, cljs.core.PersistentVector.EMPTY, e) + }, b = function(b, c, d, e) { + var f = null; + 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return a.call(this, b, c, d, f) }; b.cljs$lang$maxFixedArity = 3; - b.cljs$lang$applyTo = g.cljs$lang$applyTo; - b.cljs$core$IFn$_invoke$arity$0 = c; - b.cljs$core$IFn$_invoke$arity$1 = d; - b.cljs$core$IFn$_invoke$arity$2 = e; - b.cljs$core$IFn$_invoke$arity$3 = f; - b.cljs$core$IFn$_invoke$arity$variadic = g.cljs$core$IFn$_invoke$arity$variadic; - return b; - }(); - }(cljs.core.list_STAR_.cljs$core$IFn$_invoke$arity$4(a, b, c, d)); + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, e, b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b + }(), a = function(a, e, h, k) { + switch(arguments.length) { + case 0: + return b.call(this); + case 1: + return c.call(this, a); + case 2: + return d.call(this, a, e); + case 3: + return f.call(this, a, e, h); + default: + return g.cljs$core$IFn$_invoke$arity$variadic(a, e, h, cljs.core.array_seq(arguments, 3)) + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 3; + a.cljs$lang$applyTo = g.cljs$lang$applyTo; + return a + }() }, b = function(b, c, d, e) { var g = null; - if (3 < arguments.length) { - for (var g = 0, p = Array(arguments.length - 3);g < p.length;) { - p[g] = arguments[g + 3], ++g; - } - g = new cljs.core.IndexedSeq(p, 0); - } - return a.call(this, b, c, d, g); + 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); + return a.call(this, b, c, d, g) }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -17267,10 +12060,10 @@ cljs.core.juxt = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b); + return a(c, d, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -17280,14 +12073,7 @@ cljs.core.juxt = function() { case 3: return d.call(this, a, g, h); default: - var l = null; - if (3 < arguments.length) { - for (var l = 0, m = Array(arguments.length - 3);l < m.length;) { - m[l] = arguments[l + 3], ++l; - } - l = new cljs.core.IndexedSeq(m, 0); - } - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, l); + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) } throw Error("Invalid arity: " + arguments.length); }; @@ -17297,25 +12083,25 @@ cljs.core.juxt = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.dorun = function() { var a = null, b = function(a) { - for (;;) { - if (cljs.core.seq(a)) { - a = cljs.core.next(a); - } else { - return null; + for(;;) { + if(cljs.core.seq.call(null, a)) { + a = cljs.core.next.call(null, a) + }else { + return null } } }, c = function(a, b) { - for (;;) { - if (cljs.core.seq(b) && 0 < a) { - var c = a - 1, g = cljs.core.next(b); + for(;;) { + if(cljs.core.seq.call(null, b) && 0 < a) { + var c = a - 1, g = cljs.core.next.call(null, b); a = c; - b = g; - } else { - return null; + b = g + }else { + return null } } }, a = function(a, e) { @@ -17323,594 +12109,650 @@ cljs.core.dorun = function() { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.doall = function() { var a = null, b = function(a) { - cljs.core.dorun.cljs$core$IFn$_invoke$arity$1(a); - return a; + cljs.core.dorun.call(null, a); + return a }, c = function(a, b) { - cljs.core.dorun.cljs$core$IFn$_invoke$arity$2(a, b); - return b; + cljs.core.dorun.call(null, a, b); + return b }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.regexp_QMARK_ = function(a) { - return a instanceof RegExp; + return a instanceof RegExp }; cljs.core.re_matches = function(a, b) { - if ("string" === typeof b) { - var c = a.exec(b); - return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.first(c), b) ? 1 === cljs.core.count(c) ? cljs.core.first(c) : cljs.core.vec(c) : null; - } - throw new TypeError("re-matches must match against a string."); + var c = a.exec(b); + return cljs.core._EQ_.call(null, cljs.core.first.call(null, c), b) ? 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) : null }; cljs.core.re_find = function(a, b) { - if ("string" === typeof b) { - var c = a.exec(b); - return null == c ? null : 1 === cljs.core.count(c) ? cljs.core.first(c) : cljs.core.vec(c); - } - throw new TypeError("re-find must match against a string."); + var c = a.exec(b); + return null == c ? null : 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) }; cljs.core.re_seq = function re_seq(b, c) { - var d = cljs.core.re_find(b, c), e = c.search(b), f = cljs.core.coll_QMARK_(d) ? cljs.core.first(d) : d, g = cljs.core.subs.cljs$core$IFn$_invoke$arity$2(c, e + cljs.core.count(f)); - return cljs.core.truth_(d) ? new cljs.core.LazySeq(null, function(c, d, e, f) { - return function() { - return cljs.core.cons(c, cljs.core.seq(f) ? re_seq(b, f) : null); - }; - }(d, e, f, g), null, null) : null; + var d = cljs.core.re_find.call(null, b, c), e = c.search(b), f = cljs.core.coll_QMARK_.call(null, d) ? cljs.core.first.call(null, d) : d, g = cljs.core.subs.call(null, c, e + cljs.core.count.call(null, f)); + return cljs.core.truth_(d) ? new cljs.core.LazySeq(null, function() { + return cljs.core.cons.call(null, d, cljs.core.seq.call(null, g) ? re_seq.call(null, b, g) : null) + }, null, null) : null }; cljs.core.re_pattern = function(a) { - if (a instanceof RegExp) { - return a; - } - var b = cljs.core.re_find(/^(?:\(\?([idmsux]*)\))?(.*)/, a); - cljs.core.nth.cljs$core$IFn$_invoke$arity$3(b, 0, null); - a = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(b, 1, null); - b = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(b, 2, null); - return new RegExp(b, a); + var b = cljs.core.re_find.call(null, /^(?:\(\?([idmsux]*)\))?(.*)/, a); + cljs.core.nth.call(null, b, 0, null); + a = cljs.core.nth.call(null, b, 1, null); + b = cljs.core.nth.call(null, b, 2, null); + return RegExp(b, a) }; cljs.core.pr_sequential_writer = function(a, b, c, d, e, f, g) { var h = cljs.core._STAR_print_level_STAR_; - cljs.core._STAR_print_level_STAR_ = null == cljs.core._STAR_print_level_STAR_ ? null : cljs.core._STAR_print_level_STAR_ - 1; try { - if (null != cljs.core._STAR_print_level_STAR_ && 0 > cljs.core._STAR_print_level_STAR_) { - return cljs.core._write(a, "#"); - } - cljs.core._write(a, c); - if (0 === (new cljs.core.Keyword(null, "print-length", "print-length", 1931866356)).cljs$core$IFn$_invoke$arity$1(f)) { - cljs.core.seq(g) && cljs.core._write(a, function() { - var a = (new cljs.core.Keyword(null, "more-marker", "more-marker", -14717935)).cljs$core$IFn$_invoke$arity$1(f); - return cljs.core.truth_(a) ? a : "..."; - }()); - } else { - if (cljs.core.seq(g)) { - var k = cljs.core.first(g); - b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(k, a, f) : b.call(null, k, a, f); - } - for (var l = cljs.core.next(g), m = (new cljs.core.Keyword(null, "print-length", "print-length", 1931866356)).cljs$core$IFn$_invoke$arity$1(f) - 1;;) { - if (!l || null != m && 0 === m) { - cljs.core.seq(l) && 0 === m && (cljs.core._write(a, d), cljs.core._write(a, function() { - var a = (new cljs.core.Keyword(null, "more-marker", "more-marker", -14717935)).cljs$core$IFn$_invoke$arity$1(f); - return cljs.core.truth_(a) ? a : "..."; - }())); - break; - } else { - cljs.core._write(a, d); - var n = cljs.core.first(l); - c = a; - g = f; - b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(n, c, g) : b.call(null, n, c, g); - var p = cljs.core.next(l); - c = m - 1; - l = p; - m = c; - } - } - } - return cljs.core._write(a, e); - } finally { - cljs.core._STAR_print_level_STAR_ = h; + cljs.core._STAR_print_level_STAR_ = null == cljs.core._STAR_print_level_STAR_ ? null : cljs.core._STAR_print_level_STAR_ - 1; + if(null != cljs.core._STAR_print_level_STAR_ && 0 > cljs.core._STAR_print_level_STAR_) { + return cljs.core._write.call(null, a, "#") + } + cljs.core._write.call(null, a, c); + cljs.core.seq.call(null, g) && b.call(null, cljs.core.first.call(null, g), a, f); + for(var k = cljs.core.next.call(null, g), l = (new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f);k && (null == l || 0 !== l);) { + cljs.core._write.call(null, a, d); + b.call(null, cljs.core.first.call(null, k), a, f); + var m = cljs.core.next.call(null, k); + c = l - 1; + k = m; + l = c + } + cljs.core.truth_((new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f)) && (cljs.core._write.call(null, a, d), b.call(null, "...", a, f)); + return cljs.core._write.call(null, a, e) + }finally { + cljs.core._STAR_print_level_STAR_ = h } }; cljs.core.write_all = function() { var a = function(a, b) { - for (var e = cljs.core.seq(b), f = null, g = 0, h = 0;;) { - if (h < g) { - var k = f.cljs$core$IIndexed$_nth$arity$2(null, h); - cljs.core._write(a, k); - h += 1; - } else { - if (e = cljs.core.seq(e)) { - f = e, cljs.core.chunked_seq_QMARK_(f) ? (e = cljs.core.chunk_first(f), g = cljs.core.chunk_rest(f), f = e, k = cljs.core.count(e), e = g, g = k) : (k = cljs.core.first(f), cljs.core._write(a, k), e = cljs.core.next(f), f = null, g = 0), h = 0; - } else { - return null; + for(var e = cljs.core.seq.call(null, b), f = null, g = 0, h = 0;;) { + if(h < g) { + var k = cljs.core._nth.call(null, f, h); + cljs.core._write.call(null, a, k); + h += 1 + }else { + if(e = cljs.core.seq.call(null, e)) { + f = e, cljs.core.chunked_seq_QMARK_.call(null, f) ? (e = cljs.core.chunk_first.call(null, f), g = cljs.core.chunk_rest.call(null, f), f = e, k = cljs.core.count.call(null, e), e = g, g = k) : (k = cljs.core.first.call(null, f), cljs.core._write.call(null, a, k), e = cljs.core.next.call(null, f), f = null, g = 0), h = 0 + }else { + return null } } } }, b = function(b, d) { var e = null; - if (1 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { - f[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b); + return a(d, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.string_print = function(a) { - cljs.core._STAR_print_fn_STAR_.cljs$core$IFn$_invoke$arity$1 ? cljs.core._STAR_print_fn_STAR_.cljs$core$IFn$_invoke$arity$1(a) : cljs.core._STAR_print_fn_STAR_.call(null, a); - return null; + cljs.core._STAR_print_fn_STAR_.call(null, a); + return null }; cljs.core.flush = function() { - return null; + return null }; cljs.core.char_escapes = function() { - return{'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"}; + return{'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"} }(); cljs.core.quote_string = function(a) { return[cljs.core.str('"'), cljs.core.str(a.replace(RegExp('[\\\\"\b\f\n\r\t]', "g"), function(a) { - return cljs.core.char_escapes[a]; - })), cljs.core.str('"')].join(""); + return cljs.core.char_escapes[a] + })), cljs.core.str('"')].join("") }; -cljs.core.pr_writer_impl = function(a, b, c) { - if (null == a) { - return cljs.core._write(b, "nil"); +cljs.core.pr_writer = function pr_writer(b, c, d) { + if(null == b) { + return cljs.core._write.call(null, c, "nil") } - if (void 0 === a) { - return cljs.core._write(b, "#\x3cundefined\x3e"); + if(void 0 === b) { + return cljs.core._write.call(null, c, "#\x3cundefined\x3e") } - if (cljs.core.truth_(function() { - var b = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "meta", "meta", 1499536964)); - return cljs.core.truth_(b) ? (b = a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_(cljs.core.IMeta, a)) ? cljs.core.meta(a) : b : b; - }())) { - cljs.core._write(b, "^"); - var d = cljs.core.meta(a); - cljs.core.pr_writer.cljs$core$IFn$_invoke$arity$3 ? cljs.core.pr_writer.cljs$core$IFn$_invoke$arity$3(d, b, c) : cljs.core.pr_writer.call(null, d, b, c); - cljs.core._write(b, " "); - } - if (null == a) { - return cljs.core._write(b, "nil"); - } - if (a.cljs$lang$type) { - return a.cljs$lang$ctorPrWriter(a, b, c); - } - if (a && (a.cljs$lang$protocol_mask$partition0$ & 2147483648 || a.cljs$core$IPrintWithWriter$)) { - return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(null, b, c); - } - if (cljs.core.type(a) === Boolean || "number" === typeof a) { - return cljs.core._write(b, "" + cljs.core.str(a)); - } - if (cljs.core.object_QMARK_(a)) { - cljs.core._write(b, "#js "); - var d = cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.cljs$core$IFn$_invoke$arity$1(b), a[b]], null); - }, cljs.core.js_keys(a)), e = cljs.core.pr_writer; - return cljs.core.print_map.cljs$core$IFn$_invoke$arity$4 ? cljs.core.print_map.cljs$core$IFn$_invoke$arity$4(d, e, b, c) : cljs.core.print_map.call(null, d, e, b, c); - } - return a instanceof Array ? cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#js [", " ", "]", c, a) : cljs.core.truth_(goog.isString(a)) ? cljs.core.truth_((new cljs.core.Keyword(null, "readably", "readably", 1129599760)).cljs$core$IFn$_invoke$arity$1(c)) ? cljs.core._write(b, cljs.core.quote_string(a)) : cljs.core._write(b, a) : cljs.core.fn_QMARK_(a) ? cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(["#\x3c", "" + cljs.core.str(a), "\x3e"], 0)) : a instanceof - Date ? (d = function(a, b) { - for (var c = "" + cljs.core.str(a);;) { - if (cljs.core.count(c) < b) { - c = [cljs.core.str("0"), cljs.core.str(c)].join(""); - } else { - return c; - } + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + cljs.core.truth_(function() { + var c = cljs.core.get.call(null, d, new cljs.core.Keyword(null, "meta", "meta", 1017252215)); + return cljs.core.truth_(c) ? (c = b ? b.cljs$lang$protocol_mask$partition0$ & 131072 || b.cljs$core$IMeta$ ? !0 : b.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b)) ? cljs.core.meta.call(null, b) : c : c + }()) && (cljs.core._write.call(null, c, "^"), pr_writer.call(null, cljs.core.meta.call(null, b), c, d), cljs.core._write.call(null, c, " ")); + if(null == b) { + return cljs.core._write.call(null, c, "nil") } - }, cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(['#inst "', "" + cljs.core.str(a.getUTCFullYear()), "-", d(a.getUTCMonth() + 1, 2), "-", d(a.getUTCDate(), 2), "T", d(a.getUTCHours(), 2), ":", d(a.getUTCMinutes(), 2), ":", d(a.getUTCSeconds(), 2), ".", d(a.getUTCMilliseconds(), 3), "-", '00:00"'], 0))) : cljs.core.regexp_QMARK_(a) ? cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(['#"', a.source, '"'], 0)) : (a ? a.cljs$lang$protocol_mask$partition0$ & - 2147483648 || a.cljs$core$IPrintWithWriter$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IPrintWithWriter, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IPrintWithWriter, a)) ? cljs.core._pr_writer(a, b, c) : cljs.core.write_all.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq(["#\x3c", "" + cljs.core.str(a), "\x3e"], 0)); -}; -cljs.core.pr_writer = function(a, b, c) { - var d = (new cljs.core.Keyword(null, "alt-impl", "alt-impl", 670969595)).cljs$core$IFn$_invoke$arity$1(c); - return cljs.core.truth_(d) ? (c = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(c, new cljs.core.Keyword(null, "fallback-impl", "fallback-impl", -1501286995), cljs.core.pr_writer_impl), d.cljs$core$IFn$_invoke$arity$3 ? d.cljs$core$IFn$_invoke$arity$3(a, b, c) : d.call(null, a, b, c)) : cljs.core.pr_writer_impl(a, b, c); + if(b.cljs$lang$type) { + return b.cljs$lang$ctorPrWriter(b, c, d) + } + if(b && (b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$)) { + return cljs.core._pr_writer.call(null, b, c, d) + } + if(cljs.core.type.call(null, b) === Boolean || "number" === typeof b) { + return cljs.core._write.call(null, c, "" + cljs.core.str(b)) + } + if(b instanceof Array) { + return cljs.core.pr_sequential_writer.call(null, c, pr_writer, "#\x3cArray [", ", ", "]\x3e", d, b) + } + if(goog.isString(b)) { + return cljs.core.truth_((new cljs.core.Keyword(null, "readably", "readably", 4441712502)).cljs$core$IFn$_invoke$arity$1(d)) ? cljs.core._write.call(null, c, cljs.core.quote_string.call(null, b)) : cljs.core._write.call(null, c, b) + } + if(cljs.core.fn_QMARK_.call(null, b)) { + return cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") + } + if(b instanceof Date) { + var e = function(b, c) { + for(var d = "" + cljs.core.str(b);;) { + if(cljs.core.count.call(null, d) < c) { + d = [cljs.core.str("0"), cljs.core.str(d)].join("") + }else { + return d + } + } + }; + return cljs.core.write_all.call(null, c, '#inst "', "" + cljs.core.str(b.getUTCFullYear()), "-", e.call(null, b.getUTCMonth() + 1, 2), "-", e.call(null, b.getUTCDate(), 2), "T", e.call(null, b.getUTCHours(), 2), ":", e.call(null, b.getUTCMinutes(), 2), ":", e.call(null, b.getUTCSeconds(), 2), ".", e.call(null, b.getUTCMilliseconds(), 3), "-", '00:00"') + } + return cljs.core.regexp_QMARK_.call(null, b) ? cljs.core.write_all.call(null, c, '#"', b.source, '"') : (b ? b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IPrintWithWriter, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IPrintWithWriter, b)) ? cljs.core._pr_writer.call(null, b, c, d) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? + cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") : null + } + return null }; cljs.core.pr_seq_writer = function(a, b, c) { - cljs.core.pr_writer(cljs.core.first(a), b, c); - a = cljs.core.seq(cljs.core.next(a)); - for (var d = null, e = 0, f = 0;;) { - if (f < e) { - var g = d.cljs$core$IIndexed$_nth$arity$2(null, f); - cljs.core._write(b, " "); - cljs.core.pr_writer(g, b, c); - f += 1; - } else { - if (a = cljs.core.seq(a)) { - d = a, cljs.core.chunked_seq_QMARK_(d) ? (a = cljs.core.chunk_first(d), e = cljs.core.chunk_rest(d), d = a, g = cljs.core.count(a), a = e, e = g) : (g = cljs.core.first(d), cljs.core._write(b, " "), cljs.core.pr_writer(g, b, c), a = cljs.core.next(d), d = null, e = 0), f = 0; - } else { - return null; + cljs.core.pr_writer.call(null, cljs.core.first.call(null, a), b, c); + a = cljs.core.seq.call(null, cljs.core.next.call(null, a)); + for(var d = null, e = 0, f = 0;;) { + if(f < e) { + var g = cljs.core._nth.call(null, d, f); + cljs.core._write.call(null, b, " "); + cljs.core.pr_writer.call(null, g, b, c); + f += 1 + }else { + if(a = cljs.core.seq.call(null, a)) { + d = a, cljs.core.chunked_seq_QMARK_.call(null, d) ? (a = cljs.core.chunk_first.call(null, d), e = cljs.core.chunk_rest.call(null, d), d = a, g = cljs.core.count.call(null, a), a = e, e = g) : (g = cljs.core.first.call(null, d), cljs.core._write.call(null, b, " "), cljs.core.pr_writer.call(null, g, b, c), a = cljs.core.next.call(null, d), d = null, e = 0), f = 0 + }else { + return null } } } }; cljs.core.pr_sb_with_opts = function(a, b) { var c = new goog.string.StringBuffer, d = new cljs.core.StringBufferWriter(c); - cljs.core.pr_seq_writer(a, d, b); - d.cljs$core$IWriter$_flush$arity$1(null); - return c; + cljs.core.pr_seq_writer.call(null, a, d, b); + cljs.core._flush.call(null, d); + return c }; cljs.core.pr_str_with_opts = function(a, b) { - return cljs.core.empty_QMARK_(a) ? "" : "" + cljs.core.str(cljs.core.pr_sb_with_opts(a, b)); + return cljs.core.empty_QMARK_.call(null, a) ? "" : "" + cljs.core.str(cljs.core.pr_sb_with_opts.call(null, a, b)) }; cljs.core.prn_str_with_opts = function(a, b) { - if (cljs.core.empty_QMARK_(a)) { - return "\n"; + if(cljs.core.empty_QMARK_.call(null, a)) { + return"\n" } - var c = cljs.core.pr_sb_with_opts(a, b); + var c = cljs.core.pr_sb_with_opts.call(null, a, b); c.append("\n"); - return "" + cljs.core.str(c); + return"" + cljs.core.str(c) }; cljs.core.pr_with_opts = function(a, b) { - return cljs.core.string_print(cljs.core.pr_str_with_opts(a, b)); + return cljs.core.string_print.call(null, cljs.core.pr_str_with_opts.call(null, a, b)) }; cljs.core.newline = function(a) { - cljs.core.string_print("\n"); - return cljs.core.truth_(cljs.core.get.cljs$core$IFn$_invoke$arity$2(a, new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", -151457939))) ? cljs.core.flush() : null; + cljs.core.string_print.call(null, "\n"); + return cljs.core.truth_(cljs.core.get.call(null, a, new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857))) ? cljs.core.flush.call(null) : null }; cljs.core.pr_str = function() { var a = function(a) { - return cljs.core.pr_str_with_opts(a, cljs.core.pr_opts()); + return cljs.core.pr_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.prn_str = function() { var a = function(a) { - return cljs.core.prn_str_with_opts(a, cljs.core.pr_opts()); + return cljs.core.prn_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.pr = function() { var a = function(a) { - return cljs.core.pr_with_opts(a, cljs.core.pr_opts()); + return cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.print = function() { var a = function(a) { - return cljs.core.pr_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); + return cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.print_str = function() { var a = function(a) { - return cljs.core.pr_str_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); + return cljs.core.pr_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.println = function() { var a = function(a) { - cljs.core.pr_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); - return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline(cljs.core.pr_opts()) : null; + cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)); + return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.println_str = function() { var a = function(a) { - return cljs.core.prn_str_with_opts(a, cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.pr_opts(), new cljs.core.Keyword(null, "readably", "readably", 1129599760), !1)); + return cljs.core.prn_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.prn = function() { var a = function(a) { - cljs.core.pr_with_opts(a, cljs.core.pr_opts()); - return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline(cljs.core.pr_opts()) : null; + cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)); + return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null }, b = function(b) { var d = null; - if (0 < arguments.length) { - for (var d = 0, e = Array(arguments.length - 0);d < e.length;) { - e[d] = arguments[d + 0], ++d; - } - d = new cljs.core.IndexedSeq(e, 0); - } - return a.call(this, d); + 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return a.call(this, d) }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b); + return a(b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.print_map = function(a, b, c, d) { - return cljs.core.pr_sequential_writer(c, function(a, c, d) { - var h = cljs.core.key(a); - b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(h, c, d) : b.call(null, h, c, d); - cljs.core._write(c, " "); - a = cljs.core.val(a); - return b.cljs$core$IFn$_invoke$arity$3 ? b.cljs$core$IFn$_invoke$arity$3(a, c, d) : b.call(null, a, c, d); - }, "{", ", ", "}", d, cljs.core.seq(a)); -}; -cljs.core.Volatile.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Volatile.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - cljs.core._write(b, "#\x3cVolatile: "); - cljs.core.pr_writer(this.state, b, c); - return cljs.core._write(b, "\x3e"); -}; -cljs.core.Var.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Var.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - cljs.core._write(b, "#'"); - return cljs.core.pr_writer(this.sym, b, c); + return cljs.core.pr_sequential_writer.call(null, c, function(a, c, d) { + b.call(null, cljs.core.key.call(null, a), c, d); + cljs.core._write.call(null, c, " "); + return b.call(null, cljs.core.val.call(null, a), c, d) + }, "{", ", ", "}", d, cljs.core.seq.call(null, a)) +}; +cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; cljs.core.IndexedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.IndexedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) }; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) }; -cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); +cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) }; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#queue [", " ", "]", c, cljs.core.seq.call(null, this)) +}; +cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.ES6IteratorSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ES6IteratorSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; cljs.core.PersistentTreeSet.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentTreeSet.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#{", " ", "}", c, this); -}; -cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this) }; -cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map(this, cljs.core.pr_writer, b, c); +cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) }; -cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; cljs.core.PersistentHashMap.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentHashMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map(this, cljs.core.pr_writer, b, c); -}; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); -}; -cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); -}; -cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map(this, cljs.core.pr_writer, b, c); + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) }; cljs.core.PersistentHashSet.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentHashSet.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#{", " ", "}", c, this); -}; -cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); -}; -cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - cljs.core._write(b, "#\x3cAtom: "); - cljs.core.pr_writer(this.state, b, c); - return cljs.core._write(b, "\x3e"); -}; -cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); -}; -cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this) }; cljs.core.PersistentVector.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentVector.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "[", " ", "]", c, this); + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) +}; +cljs.core.List.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.List.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentQueueSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; cljs.core.EmptyList.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.EmptyList.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write(b, "()"); -}; -cljs.core.LazyTransformer.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.LazyTransformer.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); + return cljs.core._write.call(null, b, "()") }; -cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "#queue [", " ", "]", c, cljs.core.seq(this)); +cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) }; -cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map(this, cljs.core.pr_writer, b, c); +cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; cljs.core.Range.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.Range.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; -cljs.core.List.prototype.cljs$core$IPrintWithWriter$ = !0; -cljs.core.List.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); +cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) +}; +cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) +}; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; +cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) }; cljs.core.PersistentVector.prototype.cljs$core$IComparable$ = !0; cljs.core.PersistentVector.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_indexed.cljs$core$IFn$_invoke$arity$2(this, b); + return cljs.core.compare_indexed.call(null, this, b) }; cljs.core.Subvec.prototype.cljs$core$IComparable$ = !0; cljs.core.Subvec.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_indexed.cljs$core$IFn$_invoke$arity$2(this, b); + return cljs.core.compare_indexed.call(null, this, b) }; cljs.core.Keyword.prototype.cljs$core$IComparable$ = !0; cljs.core.Keyword.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_keywords(this, b); + return cljs.core.compare_symbols.call(null, this, b) }; cljs.core.Symbol.prototype.cljs$core$IComparable$ = !0; cljs.core.Symbol.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_symbols(this, b); + return cljs.core.compare_symbols.call(null, this, b) +}; +cljs.core.Atom = function(a, b, c, d) { + this.state = a; + this.meta = b; + this.validator = c; + this.watches = d; + this.cljs$lang$protocol_mask$partition0$ = 2153938944; + this.cljs$lang$protocol_mask$partition1$ = 2 +}; +cljs.core.Atom.cljs$lang$type = !0; +cljs.core.Atom.cljs$lang$ctorStr = "cljs.core/Atom"; +cljs.core.Atom.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/Atom") +}; +cljs.core.Atom.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { + return goog.getUid(this) +}; +cljs.core.Atom.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = function(a, b, c) { + a = cljs.core.seq.call(null, this.watches); + for(var d = null, e = 0, f = 0;;) { + if(f < e) { + var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); + g.call(null, h, this, b, c); + f += 1 + }else { + if(a = cljs.core.seq.call(null, a)) { + cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), h = d, e = cljs.core.count.call(null, d), d = h) : (d = cljs.core.first.call(null, a), h = cljs.core.nth.call(null, d, 0, null), g = cljs.core.nth.call(null, d, 1, null), g.call(null, h, this, b, c), a = cljs.core.next.call(null, a), d = null, e = 0), f = 0 + }else { + return null + } + } + } +}; +cljs.core.Atom.prototype.cljs$core$IWatchable$_add_watch$arity$3 = function(a, b, c) { + return this.watches = cljs.core.assoc.call(null, this.watches, b, c) +}; +cljs.core.Atom.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = function(a, b) { + return this.watches = cljs.core.dissoc.call(null, this.watches, b) +}; +cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { + cljs.core._write.call(null, b, "#\x3cAtom: "); + cljs.core.pr_writer.call(null, this.state, b, c); + return cljs.core._write.call(null, b, "\x3e") +}; +cljs.core.Atom.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { + return this.meta +}; +cljs.core.Atom.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + return this.state +}; +cljs.core.Atom.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { + return this === b +}; +cljs.core.__GT_Atom = function(a, b, c, d) { + return new cljs.core.Atom(a, b, c, d) +}; +cljs.core.atom = function() { + var a = null, b = function(a) { + return new cljs.core.Atom(a, null, null, null) + }, c = function() { + var a = function(a, b) { + var c = cljs.core.seq_QMARK_.call(null, b) ? cljs.core.apply.call(null, cljs.core.hash_map, b) : b, d = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "validator", "validator", 4199087812)), c = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "meta", "meta", 1017252215)); + return new cljs.core.Atom(a, c, d, null) + }, b = function(b, c) { + var e = null; + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) + }; + b.cljs$lang$maxFixedArity = 1; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b + }(), a = function(a, e) { + switch(arguments.length) { + case 1: + return b.call(this, a); + default: + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 1; + a.cljs$lang$applyTo = c.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$1 = b; + a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; + return a +}(); +cljs.core.reset_BANG_ = function(a, b) { + var c = a.validator; + if(null != c && !cljs.core.truth_(c.call(null, b))) { + throw Error([cljs.core.str("Assert failed: "), cljs.core.str("Validator rejected reference state"), cljs.core.str("\n"), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "validate", "validate", 1233162959, null), new cljs.core.Symbol(null, "new-value", "new-value", 972165309, null))))].join("")); + } + c = a.state; + a.state = b; + null != a.watches && cljs.core._notify_watches.call(null, a, c, b); + return b +}; +cljs.core.swap_BANG_ = function() { + var a = null, b = function(a, b) { + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state)) + }, c = function(a, b, c) { + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c)) + }, d = function(a, b, c, d) { + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d)) + }, e = function(a, b, c, d, e) { + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d, e)) + }, f = function() { + var a = function(a, b, c, d, e, f) { + return cljs.core.reset_BANG_.call(null, a, cljs.core.apply.call(null, b, a.state, c, d, e, f)) + }, b = function(b, c, d, e, f, h) { + var r = null; + 5 < arguments.length && (r = cljs.core.array_seq(Array.prototype.slice.call(arguments, 5), 0)); + return a.call(this, b, c, d, e, f, r) + }; + b.cljs$lang$maxFixedArity = 5; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var f = cljs.core.first(b); + b = cljs.core.next(b); + var h = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, e, f, h, b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b + }(), a = function(a, h, k, l, m, n) { + switch(arguments.length) { + case 2: + return b.call(this, a, h); + case 3: + return c.call(this, a, h, k); + case 4: + return d.call(this, a, h, k, l); + case 5: + return e.call(this, a, h, k, l, m); + default: + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)) + } + throw Error("Invalid arity: " + arguments.length); + }; + a.cljs$lang$maxFixedArity = 5; + a.cljs$lang$applyTo = f.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$5 = e; + a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; + return a +}(); +cljs.core.compare_and_set_BANG_ = function(a, b, c) { + return cljs.core._EQ_.call(null, a.state, b) ? (cljs.core.reset_BANG_.call(null, a, c), !0) : !1 +}; +cljs.core.deref = function(a) { + return cljs.core._deref.call(null, a) +}; +cljs.core.set_validator_BANG_ = function(a, b) { + return a.validator = b +}; +cljs.core.get_validator = function(a) { + return a.validator }; cljs.core.alter_meta_BANG_ = function() { var a = function(a, b, e) { - return a.meta = cljs.core.apply.cljs$core$IFn$_invoke$arity$3(b, a.meta, e); + return a.meta = cljs.core.apply.call(null, b, a.meta, e) }, b = function(b, d, e) { var f = null; - if (2 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 2);f < g.length;) { - g[f] = arguments[f + 2], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return a.call(this, b, d, f); + 2 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); + return a.call(this, b, d, f) }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -17918,397 +12760,238 @@ cljs.core.alter_meta_BANG_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, e, b); + return a(d, e, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.reset_meta_BANG_ = function(a, b) { - return a.meta = b; + return a.meta = b }; cljs.core.add_watch = function(a, b, c) { - cljs.core._add_watch(a, b, c); - return a; + return cljs.core._add_watch.call(null, a, b, c) }; cljs.core.remove_watch = function(a, b) { - cljs.core._remove_watch(a, b); - return a; + return cljs.core._remove_watch.call(null, a, b) }; cljs.core.gensym_counter = null; cljs.core.gensym = function() { var a = null, b = function() { - return a.cljs$core$IFn$_invoke$arity$1("G__"); + return a.call(null, "G__") }, c = function(a) { - if (null == cljs.core.gensym_counter) { - var b = cljs.core, c; - c = cljs.core.atom.cljs$core$IFn$_invoke$arity$1 ? cljs.core.atom.cljs$core$IFn$_invoke$arity$1(0) : cljs.core.atom.call(null, 0); - b.gensym_counter = c; - } - return cljs.core.symbol.cljs$core$IFn$_invoke$arity$1([cljs.core.str(a), cljs.core.str(cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(cljs.core.gensym_counter, cljs.core.inc))].join("")); + null == cljs.core.gensym_counter && (cljs.core.gensym_counter = cljs.core.atom.call(null, 0)); + return cljs.core.symbol.call(null, [cljs.core.str(a), cljs.core.str(cljs.core.swap_BANG_.call(null, cljs.core.gensym_counter, cljs.core.inc))].join("")) }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a); + return c.call(this, a) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a; + return a }(); cljs.core.fixture1 = 1; cljs.core.fixture2 = 2; cljs.core.Delay = function(a, b) { - this.f = a; - this.value = b; + this.state = a; + this.f = b; this.cljs$lang$protocol_mask$partition1$ = 1; - this.cljs$lang$protocol_mask$partition0$ = 32768; -}; -cljs.core.Delay.prototype.cljs$core$IPending$_realized_QMARK_$arity$1 = function(a) { - return cljs.core.not(this.f); -}; -cljs.core.Delay.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - cljs.core.truth_(this.f) && (this.value = this.f.cljs$core$IFn$_invoke$arity$0 ? this.f.cljs$core$IFn$_invoke$arity$0() : this.f.call(null), this.f = null); - return this.value; + this.cljs$lang$protocol_mask$partition0$ = 32768 }; cljs.core.Delay.cljs$lang$type = !0; cljs.core.Delay.cljs$lang$ctorStr = "cljs.core/Delay"; cljs.core.Delay.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Delay"); + return cljs.core._write.call(null, b, "cljs.core/Delay") +}; +cljs.core.Delay.prototype.cljs$core$IPending$_realized_QMARK_$arity$1 = function(a) { + return(new cljs.core.Keyword(null, "done", "done", 1016993524)).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null, this.state)) +}; +cljs.core.Delay.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { + var b = this; + return(new cljs.core.Keyword(null, "value", "value", 1125876963)).cljs$core$IFn$_invoke$arity$1(cljs.core.swap_BANG_.call(null, b.state, function(a) { + a = cljs.core.seq_QMARK_.call(null, a) ? cljs.core.apply.call(null, cljs.core.hash_map, a) : a; + var d = cljs.core.get.call(null, a, new cljs.core.Keyword(null, "done", "done", 1016993524)); + return cljs.core.truth_(d) ? a : new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null, "done", "done", 1016993524), !0, new cljs.core.Keyword(null, "value", "value", 1125876963), b.f.call(null)], null) + })) }; cljs.core.__GT_Delay = function(a, b) { - return new cljs.core.Delay(a, b); + return new cljs.core.Delay(a, b) }; cljs.core.delay_QMARK_ = function(a) { - return a instanceof cljs.core.Delay; + return a instanceof cljs.core.Delay }; cljs.core.force = function(a) { - return cljs.core.delay_QMARK_(a) ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a) : a; + return cljs.core.delay_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : a }; cljs.core.realized_QMARK_ = function(a) { - return cljs.core._realized_QMARK_(a); -}; -cljs.core.preserving_reduced = function(a) { - return function(b, c) { - var d; - d = a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c); - return cljs.core.reduced_QMARK_(d) ? cljs.core.reduced(d) : d; - }; -}; -cljs.core.cat = function(a) { - return function(b) { - return function() { - var c = null, d = function() { - return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); - }, e = function(b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - }, f = function(a, c) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(b, a, c); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return d.call(this); - case 1: - return e.call(this, a); - case 2: - return f.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = d; - c.cljs$core$IFn$_invoke$arity$1 = e; - c.cljs$core$IFn$_invoke$arity$2 = f; - return c; - }(); - }(cljs.core.preserving_reduced(a)); -}; -cljs.core.dedupe = function() { - var a = null, b = function() { - return function(a) { - return function(b) { - return function() { - var c = null, g = function() { - return a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null); - }, h = function(b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(b) : a.call(null, b); - }, k = function(c, f) { - var g; - g = cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); - cljs.core.vreset_BANG_(b, f); - return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(g, f) ? c : a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, f) : a.call(null, c, f); - }, c = function(a, b) { - switch(arguments.length) { - case 0: - return g.call(this); - case 1: - return h.call(this, a); - case 2: - return k.call(this, a, b); - } - throw Error("Invalid arity: " + arguments.length); - }; - c.cljs$core$IFn$_invoke$arity$0 = g; - c.cljs$core$IFn$_invoke$arity$1 = h; - c.cljs$core$IFn$_invoke$arity$2 = k; - return c; - }(); - }(cljs.core.volatile_BANG_(new cljs.core.Keyword("cljs.core", "none", "cljs.core/none", 926646439))); - }; - }, c = function(b) { - return cljs.core.sequence.cljs$core$IFn$_invoke$arity$2(a.cljs$core$IFn$_invoke$arity$0(), b); - }, a = function(a) { - switch(arguments.length) { - case 0: - return b.call(this); - case 1: - return c.call(this, a); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$0 = b; - a.cljs$core$IFn$_invoke$arity$1 = c; - return a; -}(); -cljs.core.random_sample = function() { - var a = null, b = function(a) { - return cljs.core.filter.cljs$core$IFn$_invoke$arity$1(function(b) { - return(cljs.core.rand.cljs$core$IFn$_invoke$arity$0 ? cljs.core.rand.cljs$core$IFn$_invoke$arity$0() : cljs.core.rand.call(null)) < a; - }); - }, c = function(a, b) { - return cljs.core.filter.cljs$core$IFn$_invoke$arity$2(function(b) { - return(cljs.core.rand.cljs$core$IFn$_invoke$arity$0 ? cljs.core.rand.cljs$core$IFn$_invoke$arity$0() : cljs.core.rand.call(null)) < a; - }, b); - }, a = function(a, e) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, e); - } - throw Error("Invalid arity: " + arguments.length); - }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - return a; -}(); -cljs.core.Eduction = function(a, b) { - this.xform = a; - this.coll = b; - this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2173173760; -}; -cljs.core.Eduction.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer(b, cljs.core.pr_writer, "(", " ", ")", c, this); -}; -cljs.core.Eduction.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.transduce.cljs$core$IFn$_invoke$arity$4(this.xform, b, c, this.coll); -}; -cljs.core.Eduction.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.seq(cljs.core.sequence.cljs$core$IFn$_invoke$arity$2(this.xform, this.coll)); -}; -cljs.core.Eduction.cljs$lang$type = !0; -cljs.core.Eduction.cljs$lang$ctorStr = "cljs.core/Eduction"; -cljs.core.Eduction.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/Eduction"); -}; -cljs.core.__GT_Eduction = function(a, b) { - return new cljs.core.Eduction(a, b); -}; -cljs.core.Eduction.prototype[cljs.core.ITER_SYMBOL] = function() { - return cljs.core.es6_iterator(this); -}; -cljs.core.eduction = function(a, b) { - return new cljs.core.Eduction(a, b); -}; -cljs.core.run_BANG_ = function(a, b) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, d) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - }, null, b); + return cljs.core._realized_QMARK_.call(null, a) }; cljs.core.IEncodeJS = function() { - return{}; + return{} }(); cljs.core._clj__GT_js = function(a) { - if (a ? a.cljs$core$IEncodeJS$_clj__GT_js$arity$1 : a) { - return a.cljs$core$IEncodeJS$_clj__GT_js$arity$1(a); + if(a ? a.cljs$core$IEncodeJS$_clj__GT_js$arity$1 : a) { + return a.cljs$core$IEncodeJS$_clj__GT_js$arity$1(a) } var b; - b = cljs.core._clj__GT_js; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._clj__GT_js._, !b)) { - throw cljs.core.missing_protocol("IEncodeJS.-clj-\x3ejs", a); + b = cljs.core._clj__GT_js[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._clj__GT_js._, !b)) { + throw cljs.core.missing_protocol.call(null, "IEncodeJS.-clj-\x3ejs", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._key__GT_js = function(a) { - if (a ? a.cljs$core$IEncodeJS$_key__GT_js$arity$1 : a) { - return a.cljs$core$IEncodeJS$_key__GT_js$arity$1(a); + if(a ? a.cljs$core$IEncodeJS$_key__GT_js$arity$1 : a) { + return a.cljs$core$IEncodeJS$_key__GT_js$arity$1(a) } var b; - b = cljs.core._key__GT_js; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._key__GT_js._, !b)) { - throw cljs.core.missing_protocol("IEncodeJS.-key-\x3ejs", a); + b = cljs.core._key__GT_js[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._key__GT_js._, !b)) { + throw cljs.core.missing_protocol.call(null, "IEncodeJS.-key-\x3ejs", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core.key__GT_js = function(a) { - return(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeJS$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, a)) : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, a)) ? cljs.core._clj__GT_js(a) : "string" === typeof a || "number" === typeof a || a instanceof cljs.core.Keyword || a instanceof cljs.core.Symbol ? cljs.core.clj__GT_js.cljs$core$IFn$_invoke$arity$1 ? cljs.core.clj__GT_js.cljs$core$IFn$_invoke$arity$1(a) : - cljs.core.clj__GT_js.call(null, a) : cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([a], 0)); + return(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeJS$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) ? cljs.core._clj__GT_js.call(null, a) : "string" === typeof a || "number" === typeof a || a instanceof cljs.core.Keyword || a instanceof cljs.core.Symbol ? cljs.core.clj__GT_js.call(null, a) : cljs.core.pr_str.call(null, a) }; cljs.core.clj__GT_js = function clj__GT_js(b) { - if (null == b) { - return null; + if(null == b) { + return null } - if (b ? cljs.core.truth_(cljs.core.truth_(null) ? null : b.cljs$core$IEncodeJS$) || (b.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, b)) : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeJS, b)) { - return cljs.core._clj__GT_js(b); + if(b ? cljs.core.truth_(cljs.core.truth_(null) ? null : b.cljs$core$IEncodeJS$) || (b.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) { + return cljs.core._clj__GT_js.call(null, b) } - if (b instanceof cljs.core.Keyword) { - return cljs.core.name(b); + if(b instanceof cljs.core.Keyword) { + return cljs.core.name.call(null, b) } - if (b instanceof cljs.core.Symbol) { - return "" + cljs.core.str(b); + if(b instanceof cljs.core.Symbol) { + return"" + cljs.core.str(b) } - if (cljs.core.map_QMARK_(b)) { + if(cljs.core.map_QMARK_.call(null, b)) { var c = {}; - b = cljs.core.seq(b); - for (var d = null, e = 0, f = 0;;) { - if (f < e) { - var g = d.cljs$core$IIndexed$_nth$arity$2(null, f), h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 0, null), g = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 1, null); - c[cljs.core.key__GT_js(h)] = clj__GT_js(g); - f += 1; - } else { - if (b = cljs.core.seq(b)) { - cljs.core.chunked_seq_QMARK_(b) ? (e = cljs.core.chunk_first(b), b = cljs.core.chunk_rest(b), d = e, e = cljs.core.count(e)) : (e = cljs.core.first(b), d = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(e, 0, null), e = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(e, 1, null), c[cljs.core.key__GT_js(d)] = clj__GT_js(e), b = cljs.core.next(b), d = null, e = 0), f = 0; - } else { - break; + b = cljs.core.seq.call(null, b); + for(var d = null, e = 0, f = 0;;) { + if(f < e) { + var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); + c[cljs.core.key__GT_js.call(null, h)] = clj__GT_js.call(null, g); + f += 1 + }else { + if(b = cljs.core.seq.call(null, b)) { + cljs.core.chunked_seq_QMARK_.call(null, b) ? (e = cljs.core.chunk_first.call(null, b), b = cljs.core.chunk_rest.call(null, b), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, b), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), c[cljs.core.key__GT_js.call(null, d)] = clj__GT_js.call(null, e), b = cljs.core.next.call(null, b), d = null, e = 0), f = 0 + }else { + break } } } - return c; + return c } - if (cljs.core.coll_QMARK_(b)) { + if(cljs.core.coll_QMARK_.call(null, b)) { c = []; - b = cljs.core.seq(cljs.core.map.cljs$core$IFn$_invoke$arity$2(clj__GT_js, b)); + b = cljs.core.seq.call(null, cljs.core.map.call(null, clj__GT_js, b)); d = null; - for (f = e = 0;;) { - if (f < e) { - h = d.cljs$core$IIndexed$_nth$arity$2(null, f), c.push(h), f += 1; - } else { - if (b = cljs.core.seq(b)) { - d = b, cljs.core.chunked_seq_QMARK_(d) ? (b = cljs.core.chunk_first(d), f = cljs.core.chunk_rest(d), d = b, e = cljs.core.count(b), b = f) : (b = cljs.core.first(d), c.push(b), b = cljs.core.next(d), d = null, e = 0), f = 0; - } else { - break; + for(f = e = 0;;) { + if(f < e) { + h = cljs.core._nth.call(null, d, f), c.push(h), f += 1 + }else { + if(b = cljs.core.seq.call(null, b)) { + d = b, cljs.core.chunked_seq_QMARK_.call(null, d) ? (b = cljs.core.chunk_first.call(null, d), f = cljs.core.chunk_rest.call(null, d), d = b, e = cljs.core.count.call(null, b), b = f) : (b = cljs.core.first.call(null, d), c.push(b), b = cljs.core.next.call(null, d), d = null, e = 0), f = 0 + }else { + break } } } - return c; + return c } - return b; + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null }; cljs.core.IEncodeClojure = function() { - return{}; + return{} }(); cljs.core._js__GT_clj = function(a, b) { - if (a ? a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2 : a) { - return a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2(a, b); + if(a ? a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2 : a) { + return a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2(a, b) } var c; - c = cljs.core._js__GT_clj; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._js__GT_clj._, !c)) { - throw cljs.core.missing_protocol("IEncodeClojure.-js-\x3eclj", a); + c = cljs.core._js__GT_clj[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._js__GT_clj._, !c)) { + throw cljs.core.missing_protocol.call(null, "IEncodeClojure.-js-\x3eclj", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core.js__GT_clj = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$variadic(b, cljs.core.array_seq([new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 1310784252), !1], null)], 0)); + return a.call(null, b, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672), !1], null)) }, c = function() { var a = function(a, b) { - var c = cljs.core.seq_QMARK_(b) ? cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map, b) : b, d = cljs.core.get.cljs$core$IFn$_invoke$arity$2(c, new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 1310784252)), e = cljs.core.truth_(d) ? cljs.core.keyword : cljs.core.str; - return function(a, c, d, e) { - return function s(f) { - return(f ? cljs.core.truth_(cljs.core.truth_(null) ? null : f.cljs$core$IEncodeClojure$) || (f.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeClojure, f)) : cljs.core.native_satisfies_QMARK_(cljs.core.IEncodeClojure, f)) ? cljs.core._js__GT_clj(f, cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.array_map, b)) : cljs.core.seq_QMARK_(f) ? cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map.cljs$core$IFn$_invoke$arity$2(s, f)) : - cljs.core.coll_QMARK_(f) ? cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.empty(f), cljs.core.map.cljs$core$IFn$_invoke$arity$2(s, f)) : f instanceof Array ? cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(s, f)) : cljs.core.type(f) === Object ? cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY, function() { - return function(a, b, c, d) { - return function L(e) { - return new cljs.core.LazySeq(null, function(a, b, c, d) { - return function() { - for (;;) { - var a = cljs.core.seq(e); - if (a) { - if (cljs.core.chunked_seq_QMARK_(a)) { - var b = cljs.core.chunk_first(a), c = cljs.core.count(b), g = cljs.core.chunk_buffer(c); - return function() { - for (var a = 0;;) { - if (a < c) { - var e = cljs.core._nth.cljs$core$IFn$_invoke$arity$2(b, a); - cljs.core.chunk_append(g, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [function() { - var a = e; - return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(a) : d.call(null, a); - }(), s(f[e])], null)); - a += 1; - } else { - return!0; + if(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeClojure$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) { + return cljs.core._js__GT_clj.call(null, a, cljs.core.apply.call(null, cljs.core.array_map, b)) + } + if(cljs.core.seq.call(null, b)) { + var c = cljs.core.seq_QMARK_.call(null, b) ? cljs.core.apply.call(null, cljs.core.hash_map, b) : b, d = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672)), e = cljs.core.truth_(d) ? cljs.core.keyword : cljs.core.str; + return function(a, b, c, d) { + return function s(e) { + return cljs.core.seq_QMARK_.call(null, e) ? cljs.core.doall.call(null, cljs.core.map.call(null, s, e)) : cljs.core.coll_QMARK_.call(null, e) ? cljs.core.into.call(null, cljs.core.empty.call(null, e), cljs.core.map.call(null, s, e)) : e instanceof Array ? cljs.core.vec.call(null, cljs.core.map.call(null, s, e)) : cljs.core.type.call(null, e) === Object ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, function() { + return function(a, b, c, d) { + return function R(f) { + return new cljs.core.LazySeq(null, function(a, b, c, d) { + return function() { + for(;;) { + var a = cljs.core.seq.call(null, f); + if(a) { + if(cljs.core.chunked_seq_QMARK_.call(null, a)) { + var b = cljs.core.chunk_first.call(null, a), c = cljs.core.count.call(null, b), g = cljs.core.chunk_buffer.call(null, c); + a: { + for(var h = 0;;) { + if(h < c) { + var k = cljs.core._nth.call(null, b, h); + cljs.core.chunk_append.call(null, g, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, k), s.call(null, e[k])], null)); + h += 1 + }else { + b = !0; + break a + } } + b = void 0 } - }() ? cljs.core.chunk_cons(cljs.core.chunk(g), L(cljs.core.chunk_rest(a))) : cljs.core.chunk_cons(cljs.core.chunk(g), null); + return b ? cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), R.call(null, cljs.core.chunk_rest.call(null, a))) : cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), null) + } + g = cljs.core.first.call(null, a); + return cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, g), s.call(null, e[g])], null), R.call(null, cljs.core.rest.call(null, a))) } - var h = cljs.core.first(a); - return cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [function() { - var a = h; - return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(a) : d.call(null, a); - }(), s(f[h])], null), L(cljs.core.rest(a))); + return null } - return null; } - }; - }(a, b, c, d), null, null); - }; - }(a, c, d, e)(cljs.core.js_keys(f)); - }()) : f; - }; - }(b, c, d, e)(a); + }(a, b, c, d), null, null) + } + }(a, b, c, d).call(null, cljs.core.js_keys.call(null, e)) + }()) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? e : null + } + }(b, c, d, e).call(null, a) + } + return null }, b = function(b, c) { var e = null; - if (1 < arguments.length) { - for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { - k[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(k, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, b); + return a(c, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - var f = null; - if (1 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { - g[f] = arguments[f + 1], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, f); + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) } throw Error("Invalid arity: " + arguments.length); }; @@ -18316,81 +12999,64 @@ cljs.core.js__GT_clj = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.memoize = function(a) { - return function(b) { - return function() { - var c = function(c) { - var d = cljs.core.get.cljs$core$IFn$_invoke$arity$3(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b), c, cljs.core.lookup_sentinel); - d === cljs.core.lookup_sentinel && (d = cljs.core.apply.cljs$core$IFn$_invoke$arity$2(a, c), cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(b, cljs.core.assoc, c, d)); - return d; - }, d = function(a) { - var b = null; - if (0 < arguments.length) { - for (var b = 0, d = Array(arguments.length - 0);b < d.length;) { - d[b] = arguments[b + 0], ++b; - } - b = new cljs.core.IndexedSeq(d, 0); - } - return c.call(this, b); - }; - d.cljs$lang$maxFixedArity = 0; - d.cljs$lang$applyTo = function(a) { - a = cljs.core.seq(a); - return c(a); - }; - d.cljs$core$IFn$_invoke$arity$variadic = c; - return d; - }(); - }(function() { - var a = cljs.core.PersistentArrayMap.EMPTY; - return cljs.core.atom.cljs$core$IFn$_invoke$arity$1 ? cljs.core.atom.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.atom.call(null, a); - }()); + var b = cljs.core.atom.call(null, cljs.core.PersistentArrayMap.EMPTY); + return function() { + var c = function(c) { + var d = cljs.core.get.call(null, cljs.core.deref.call(null, b), c); + if(cljs.core.truth_(d)) { + return d + } + d = cljs.core.apply.call(null, a, c); + cljs.core.swap_BANG_.call(null, b, cljs.core.assoc, c, d); + return d + }, d = function(a) { + var b = null; + 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); + return c.call(this, b) + }; + d.cljs$lang$maxFixedArity = 0; + d.cljs$lang$applyTo = function(a) { + a = cljs.core.seq(a); + return c(a) + }; + d.cljs$core$IFn$_invoke$arity$variadic = c; + return d + }() }; cljs.core.trampoline = function() { var a = null, b = function(a) { - for (;;) { - if (a = a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), !cljs.core.fn_QMARK_(a)) { - return a; + for(;;) { + if(a = a.call(null), !cljs.core.fn_QMARK_.call(null, a)) { + return a } } }, c = function() { var b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$1(function() { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$2(b, c); - }); + return a.call(null, function() { + return cljs.core.apply.call(null, b, c) + }) }, c = function(a, c) { var e = null; - if (1 < arguments.length) { - for (var e = 0, k = Array(arguments.length - 1);e < k.length;) { - k[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(k, 0); - } - return b.call(this, a, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return b.call(this, a, e) }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, a); + return b(c, a) }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c; + return c }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - var f = null; - if (1 < arguments.length) { - for (var f = 0, g = Array(arguments.length - 1);f < g.length;) { - g[f] = arguments[f + 1], ++f; - } - f = new cljs.core.IndexedSeq(g, 0); - } - return c.cljs$core$IFn$_invoke$arity$variadic(a, f); + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) } throw Error("Invalid arity: " + arguments.length); }; @@ -18398,423 +13064,385 @@ cljs.core.trampoline = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a; + return a }(); cljs.core.rand = function() { var a = null, b = function() { - return a.cljs$core$IFn$_invoke$arity$1(1); + return a.call(null, 1) }, c = function(a) { - return(Math.random.cljs$core$IFn$_invoke$arity$0 ? Math.random.cljs$core$IFn$_invoke$arity$0() : Math.random.call(null)) * a; + return Math.random.call(null) * a }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a); + return c.call(this, a) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a; + return a }(); cljs.core.rand_int = function(a) { - a *= Math.random.cljs$core$IFn$_invoke$arity$0 ? Math.random.cljs$core$IFn$_invoke$arity$0() : Math.random.call(null); - return Math.floor.cljs$core$IFn$_invoke$arity$1 ? Math.floor.cljs$core$IFn$_invoke$arity$1(a) : Math.floor.call(null, a); + return Math.floor.call(null, Math.random.call(null) * a) }; cljs.core.rand_nth = function(a) { - return cljs.core.nth.cljs$core$IFn$_invoke$arity$2(a, cljs.core.rand_int(cljs.core.count(a))); + return cljs.core.nth.call(null, a, cljs.core.rand_int.call(null, cljs.core.count.call(null, a))) }; cljs.core.group_by = function(a, b) { - return cljs.core.persistent_BANG_(cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(b, d) { - var e; - e = a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(d) : a.call(null, d); - return cljs.core.assoc_BANG_.cljs$core$IFn$_invoke$arity$3(b, e, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(b, e, cljs.core.PersistentVector.EMPTY), d)); - }, cljs.core.transient$(cljs.core.PersistentArrayMap.EMPTY), b)); + return cljs.core.reduce.call(null, function(b, d) { + var e = a.call(null, d); + return cljs.core.assoc.call(null, b, e, cljs.core.conj.call(null, cljs.core.get.call(null, b, e, cljs.core.PersistentVector.EMPTY), d)) + }, cljs.core.PersistentArrayMap.EMPTY, b) }; cljs.core.make_hierarchy = function() { - return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", -2027538891), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "descendants", "descendants", 1824886031), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424), cljs.core.PersistentArrayMap.EMPTY], null); + return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "descendants", "descendants", 768214664), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), cljs.core.PersistentArrayMap.EMPTY], null) }; cljs.core._global_hierarchy = null; cljs.core.get_global_hierarchy = function() { - if (null == cljs.core._global_hierarchy) { - var a = cljs.core, b; - b = cljs.core.make_hierarchy(); - b = cljs.core.atom.cljs$core$IFn$_invoke$arity$1 ? cljs.core.atom.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.atom.call(null, b); - a._global_hierarchy = b; - } - return cljs.core._global_hierarchy; + null == cljs.core._global_hierarchy && (cljs.core._global_hierarchy = cljs.core.atom.call(null, cljs.core.make_hierarchy.call(null))); + return cljs.core._global_hierarchy }; cljs.core.swap_global_hierarchy_BANG_ = function() { var a = function(a, b) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$4(cljs.core.swap_BANG_, cljs.core.get_global_hierarchy(), a, b); + return cljs.core.apply.call(null, cljs.core.swap_BANG_, cljs.core.get_global_hierarchy.call(null), a, b) }, b = function(b, d) { var e = null; - if (1 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { - f[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b); + return a(d, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.core.isa_QMARK_ = function() { var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(function() { - var a = cljs.core.get_global_hierarchy(); - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }(), b, c); + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b, c) }, c = function(b, c, f) { - var g = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(c, f); - if (!g && !(g = cljs.core.contains_QMARK_((new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(b).call(null, c), f)) && (g = cljs.core.vector_QMARK_(f)) && (g = cljs.core.vector_QMARK_(c))) { - if (g = cljs.core.count(f) === cljs.core.count(c)) { - for (var h = !0, k = 0;;) { - if (h && k !== cljs.core.count(f)) { - h = a.cljs$core$IFn$_invoke$arity$3(b, function() { - var a = k; - return c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(a) : c.call(null, a); - }(), function() { - var a = k; - return f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(a) : f.call(null, a); - }()), k = g = k + 1; - } else { - return h; + var g = cljs.core._EQ_.call(null, c, f); + if(!g && !(g = cljs.core.contains_QMARK_.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(b).call(null, c), f)) && (g = cljs.core.vector_QMARK_.call(null, f)) && (g = cljs.core.vector_QMARK_.call(null, c))) { + if(g = cljs.core.count.call(null, f) === cljs.core.count.call(null, c)) { + for(var g = !0, h = 0;;) { + if(g && h !== cljs.core.count.call(null, f)) { + g = a.call(null, b, c.call(null, h), f.call(null, h)), h += 1 + }else { + return g } } - } else { - return g; + }else { + return g } - } else { - return g; + }else { + return g } }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.parents = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(function() { - var a = cljs.core.get_global_hierarchy(); - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }(), b); + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) }, c = function(a, b) { - return cljs.core.not_empty(cljs.core.get.cljs$core$IFn$_invoke$arity$2((new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), b)); + return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.ancestors = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(function() { - var a = cljs.core.get_global_hierarchy(); - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }(), b); + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) }, c = function(a, b) { - return cljs.core.not_empty(cljs.core.get.cljs$core$IFn$_invoke$arity$2((new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(a), b)); + return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), b)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.descendants = function() { var a = null, b = function(b) { - return a.cljs$core$IFn$_invoke$arity$2(function() { - var a = cljs.core.get_global_hierarchy(); - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }(), b); + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) }, c = function(a, b) { - return cljs.core.not_empty(cljs.core.get.cljs$core$IFn$_invoke$arity$2((new cljs.core.Keyword(null, "descendants", "descendants", 1824886031)).cljs$core$IFn$_invoke$arity$1(a), b)); + return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), b)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); cljs.core.derive = function() { var a = null, b = function(b, c) { - if (!cljs.core.truth_(cljs.core.namespace(c))) { - throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([cljs.core.list(new cljs.core.Symbol(null, "namespace", "namespace", 1263021155, null), new cljs.core.Symbol(null, "parent", "parent", 761652748, null))], 0)))].join("")); + if(!cljs.core.truth_(cljs.core.namespace.call(null, c))) { + throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "namespace", "namespace", -388313324, null), new cljs.core.Symbol(null, "parent", "parent", 1659011683, null))))].join("")); } - cljs.core.swap_global_hierarchy_BANG_.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq([b, c], 0)); - return null; + cljs.core.swap_global_hierarchy_BANG_.call(null, a, b, c); + return null }, c = function(a, b, c) { - if (!cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(b, c)) { - throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([cljs.core.list(new cljs.core.Symbol(null, "not\x3d", "not\x3d", 1466536204, null), new cljs.core.Symbol(null, "tag", "tag", 350170304, null), new cljs.core.Symbol(null, "parent", "parent", 761652748, null))], 0)))].join("")); + if(!cljs.core.not_EQ_.call(null, b, c)) { + throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "not\x3d", "not\x3d", -1637144189, null), new cljs.core.Symbol(null, "tag", "tag", -1640416941, null), new cljs.core.Symbol(null, "parent", "parent", 1659011683, null))))].join("")); } - var g = (new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), h = (new cljs.core.Keyword(null, "descendants", "descendants", 1824886031)).cljs$core$IFn$_invoke$arity$1(a), k = (new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(a), l = function(a, b, c) { + var g = (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), h = (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), k = (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), l = function(a, b, c) { return function(d, e, f, g, h) { - return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a, b, c) { + return cljs.core.reduce.call(null, function(a, b, c) { return function(a, b) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(cljs.core.conj, cljs.core.get.cljs$core$IFn$_invoke$arity$3(h, b, cljs.core.PersistentHashSet.EMPTY), cljs.core.cons(g, h.cljs$core$IFn$_invoke$arity$1 ? h.cljs$core$IFn$_invoke$arity$1(g) : h.call(null, g)))); - }; - }(a, b, c), d, cljs.core.cons(e, f.cljs$core$IFn$_invoke$arity$1 ? f.cljs$core$IFn$_invoke$arity$1(e) : f.call(null, e))); - }; + return cljs.core.assoc.call(null, a, b, cljs.core.reduce.call(null, cljs.core.conj, cljs.core.get.call(null, h, b, cljs.core.PersistentHashSet.EMPTY), cljs.core.cons.call(null, g, h.call(null, g)))) + } + }(a, b, c), d, cljs.core.cons.call(null, e, f.call(null, e))) + } }(g, h, k); - if (cljs.core.contains_QMARK_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b), c)) { - b = null; - } else { - if (cljs.core.contains_QMARK_(k.cljs$core$IFn$_invoke$arity$1 ? k.cljs$core$IFn$_invoke$arity$1(b) : k.call(null, b), c)) { + if(cljs.core.contains_QMARK_.call(null, g.call(null, b), c)) { + b = null + }else { + if(cljs.core.contains_QMARK_.call(null, k.call(null, b), c)) { throw Error([cljs.core.str(b), cljs.core.str("already has"), cljs.core.str(c), cljs.core.str("as ancestor")].join("")); } - if (cljs.core.contains_QMARK_(k.cljs$core$IFn$_invoke$arity$1 ? k.cljs$core$IFn$_invoke$arity$1(c) : k.call(null, c), b)) { + if(cljs.core.contains_QMARK_.call(null, k.call(null, c), b)) { throw Error([cljs.core.str("Cyclic derivation:"), cljs.core.str(c), cljs.core.str("has"), cljs.core.str(b), cljs.core.str("as ancestor")].join("")); } - b = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", -2027538891), cljs.core.assoc.cljs$core$IFn$_invoke$arity$3((new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), b, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(g, b, cljs.core.PersistentHashSet.EMPTY), c)), new cljs.core.Keyword(null, "ancestors", "ancestors", -776045424), l((new cljs.core.Keyword(null, "ancestors", - "ancestors", -776045424)).cljs$core$IFn$_invoke$arity$1(a), b, h, c, k), new cljs.core.Keyword(null, "descendants", "descendants", 1824886031), l((new cljs.core.Keyword(null, "descendants", "descendants", 1824886031)).cljs$core$IFn$_invoke$arity$1(a), c, k, b, h)], null); + b = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.assoc.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b, cljs.core.conj.call(null, cljs.core.get.call(null, g, b, cljs.core.PersistentHashSet.EMPTY), c)), new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), l.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), + b, h, c, k), new cljs.core.Keyword(null, "descendants", "descendants", 768214664), l.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), c, k, b, h)], null) } - return cljs.core.truth_(b) ? b : a; + return cljs.core.truth_(b) ? b : a }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.underive = function() { var a = null, b = function(b, c) { - cljs.core.swap_global_hierarchy_BANG_.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq([b, c], 0)); - return null; + cljs.core.swap_global_hierarchy_BANG_.call(null, a, b, c); + return null }, c = function(a, b, c) { - var g = (new cljs.core.Keyword(null, "parents", "parents", -2027538891)).cljs$core$IFn$_invoke$arity$1(a), h = cljs.core.truth_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b)) ? cljs.core.disj.cljs$core$IFn$_invoke$arity$2(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b), c) : cljs.core.PersistentHashSet.EMPTY, k = cljs.core.truth_(cljs.core.not_empty(h)) ? cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(g, b, h) : cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(g, - b), l = cljs.core.flatten(cljs.core.map.cljs$core$IFn$_invoke$arity$2(function(a, b, c) { + var g = (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), h = cljs.core.truth_(g.call(null, b)) ? cljs.core.disj.call(null, g.call(null, b), c) : cljs.core.PersistentHashSet.EMPTY, k = cljs.core.truth_(cljs.core.not_empty.call(null, h)) ? cljs.core.assoc.call(null, g, b, h) : cljs.core.dissoc.call(null, g, b), h = cljs.core.flatten.call(null, cljs.core.map.call(null, function(a, b, c) { return function(a) { - return cljs.core.cons(cljs.core.first(a), cljs.core.interpose.cljs$core$IFn$_invoke$arity$2(cljs.core.first(a), cljs.core.second(a))); - }; - }(g, h, k), cljs.core.seq(k))); - return cljs.core.contains_QMARK_(g.cljs$core$IFn$_invoke$arity$1 ? g.cljs$core$IFn$_invoke$arity$1(b) : g.call(null, b), c) ? cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(a, b, c, d) { - return function(a, b) { - return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.derive, a, b); - }; - }(g, h, k, l), cljs.core.make_hierarchy(), cljs.core.partition.cljs$core$IFn$_invoke$arity$2(2, l)) : a; + return cljs.core.cons.call(null, cljs.core.first.call(null, a), cljs.core.interpose.call(null, cljs.core.first.call(null, a), cljs.core.second.call(null, a))) + } + }(g, h, k), cljs.core.seq.call(null, k))); + return cljs.core.contains_QMARK_.call(null, g.call(null, b), c) ? cljs.core.reduce.call(null, function(a, b) { + return cljs.core.apply.call(null, cljs.core.derive, a, b) + }, cljs.core.make_hierarchy.call(null), cljs.core.partition.call(null, 2, h)) : a }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.reset_cache = function(a, b, c, d) { - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(a, function(a) { - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(b) : cljs.core.deref.call(null, b); - }); - return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(c, function(a) { - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d); + cljs.core.swap_BANG_.call(null, a, function(a) { + return cljs.core.deref.call(null, b) }); + return cljs.core.swap_BANG_.call(null, c, function(a) { + return cljs.core.deref.call(null, d) + }) }; cljs.core.prefers_STAR_ = function prefers_STAR_(b, c, d) { - var e = (cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d)).call(null, b), e = cljs.core.truth_(cljs.core.truth_(e) ? e.cljs$core$IFn$_invoke$arity$1 ? e.cljs$core$IFn$_invoke$arity$1(c) : e.call(null, c) : e) ? !0 : null; - if (cljs.core.truth_(e)) { - return e; + var e = cljs.core.deref.call(null, d).call(null, b), e = cljs.core.truth_(cljs.core.truth_(e) ? e.call(null, c) : e) ? !0 : null; + if(cljs.core.truth_(e)) { + return e } e = function() { - for (var e = cljs.core.parents.cljs$core$IFn$_invoke$arity$1(c);;) { - if (0 < cljs.core.count(e)) { - cljs.core.truth_(prefers_STAR_(b, cljs.core.first(e), d)), e = cljs.core.rest(e); - } else { - return null; + for(var e = cljs.core.parents.call(null, c);;) { + if(0 < cljs.core.count.call(null, e)) { + cljs.core.truth_(prefers_STAR_.call(null, b, cljs.core.first.call(null, e), d)), e = cljs.core.rest.call(null, e) + }else { + return null } } }(); - if (cljs.core.truth_(e)) { - return e; + if(cljs.core.truth_(e)) { + return e } e = function() { - for (var e = cljs.core.parents.cljs$core$IFn$_invoke$arity$1(b);;) { - if (0 < cljs.core.count(e)) { - cljs.core.truth_(prefers_STAR_(cljs.core.first(e), c, d)), e = cljs.core.rest(e); - } else { - return null; + for(var e = cljs.core.parents.call(null, b);;) { + if(0 < cljs.core.count.call(null, e)) { + cljs.core.truth_(prefers_STAR_.call(null, cljs.core.first.call(null, e), c, d)), e = cljs.core.rest.call(null, e) + }else { + return null } } }(); - return cljs.core.truth_(e) ? e : !1; + return cljs.core.truth_(e) ? e : !1 }; cljs.core.dominates = function(a, b, c) { - c = cljs.core.prefers_STAR_(a, b, c); - return cljs.core.truth_(c) ? c : cljs.core.isa_QMARK_.cljs$core$IFn$_invoke$arity$2(a, b); + c = cljs.core.prefers_STAR_.call(null, a, b, c); + return cljs.core.truth_(c) ? c : cljs.core.isa_QMARK_.call(null, a, b) }; cljs.core.find_and_cache_best_method = function find_and_cache_best_method(b, c, d, e, f, g, h) { - var k = cljs.core.reduce.cljs$core$IFn$_invoke$arity$3(function(e, g) { - var h = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 0, null); - cljs.core.nth.cljs$core$IFn$_invoke$arity$3(g, 1, null); - if (cljs.core.isa_QMARK_.cljs$core$IFn$_invoke$arity$3(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d), c, h)) { + var k = cljs.core.reduce.call(null, function(e, g) { + var h = cljs.core.nth.call(null, g, 0, null); + cljs.core.nth.call(null, g, 1, null); + if(cljs.core.isa_QMARK_.call(null, cljs.core.deref.call(null, d), c, h)) { var k = cljs.core.truth_(function() { var b = null == e; - return b ? b : cljs.core.dominates(h, cljs.core.first(e), f); + return b ? b : cljs.core.dominates.call(null, h, cljs.core.first.call(null, e), f) }()) ? g : e; - if (!cljs.core.truth_(cljs.core.dominates(cljs.core.first(k), h, f))) { - throw Error([cljs.core.str("Multiple methods in multimethod '"), cljs.core.str(b), cljs.core.str("' match dispatch value: "), cljs.core.str(c), cljs.core.str(" -\x3e "), cljs.core.str(h), cljs.core.str(" and "), cljs.core.str(cljs.core.first(k)), cljs.core.str(", and neither is preferred")].join("")); + if(!cljs.core.truth_(cljs.core.dominates.call(null, cljs.core.first.call(null, k), h, f))) { + throw Error([cljs.core.str("Multiple methods in multimethod '"), cljs.core.str(b), cljs.core.str("' match dispatch value: "), cljs.core.str(c), cljs.core.str(" -\x3e "), cljs.core.str(h), cljs.core.str(" and "), cljs.core.str(cljs.core.first.call(null, k)), cljs.core.str(", and neither is preferred")].join("")); } - return k; + return k } - return e; - }, null, cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(e) : cljs.core.deref.call(null, e)); - if (cljs.core.truth_(k)) { - if (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(h) : cljs.core.deref.call(null, h), cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(d) : cljs.core.deref.call(null, d))) { - return cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(g, cljs.core.assoc, c, cljs.core.second(k)), cljs.core.second(k); + return e + }, null, cljs.core.deref.call(null, e)); + if(cljs.core.truth_(k)) { + if(cljs.core._EQ_.call(null, cljs.core.deref.call(null, h), cljs.core.deref.call(null, d))) { + return cljs.core.swap_BANG_.call(null, g, cljs.core.assoc, c, cljs.core.second.call(null, k)), cljs.core.second.call(null, k) } - cljs.core.reset_cache(g, e, h, d); - return find_and_cache_best_method(b, c, d, e, f, g, h); + cljs.core.reset_cache.call(null, g, e, h, d); + return find_and_cache_best_method.call(null, b, c, d, e, f, g, h) } - return null; + return null }; cljs.core.IMultiFn = function() { - return{}; + return{} }(); cljs.core._reset = function(a) { - if (a ? a.cljs$core$IMultiFn$_reset$arity$1 : a) { - return a.cljs$core$IMultiFn$_reset$arity$1(a); + if(a ? a.cljs$core$IMultiFn$_reset$arity$1 : a) { + return a.cljs$core$IMultiFn$_reset$arity$1(a) } var b; - b = cljs.core._reset; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._reset._, !b)) { - throw cljs.core.missing_protocol("IMultiFn.-reset", a); + b = cljs.core._reset[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._reset._, !b)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-reset", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._add_method = function(a, b, c) { - if (a ? a.cljs$core$IMultiFn$_add_method$arity$3 : a) { - return a.cljs$core$IMultiFn$_add_method$arity$3(a, b, c); + if(a ? a.cljs$core$IMultiFn$_add_method$arity$3 : a) { + return a.cljs$core$IMultiFn$_add_method$arity$3(a, b, c) } var d; - d = cljs.core._add_method; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._add_method._, !d)) { - throw cljs.core.missing_protocol("IMultiFn.-add-method", a); + d = cljs.core._add_method[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._add_method._, !d)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-add-method", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core._remove_method = function(a, b) { - if (a ? a.cljs$core$IMultiFn$_remove_method$arity$2 : a) { - return a.cljs$core$IMultiFn$_remove_method$arity$2(a, b); + if(a ? a.cljs$core$IMultiFn$_remove_method$arity$2 : a) { + return a.cljs$core$IMultiFn$_remove_method$arity$2(a, b) } var c; - c = cljs.core._remove_method; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._remove_method._, !c)) { - throw cljs.core.missing_protocol("IMultiFn.-remove-method", a); + c = cljs.core._remove_method[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._remove_method._, !c)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-remove-method", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._prefer_method = function(a, b, c) { - if (a ? a.cljs$core$IMultiFn$_prefer_method$arity$3 : a) { - return a.cljs$core$IMultiFn$_prefer_method$arity$3(a, b, c); + if(a ? a.cljs$core$IMultiFn$_prefer_method$arity$3 : a) { + return a.cljs$core$IMultiFn$_prefer_method$arity$3(a, b, c) } var d; - d = cljs.core._prefer_method; - var e; - e = goog.typeOf(null == a ? null : a); - d = d[e]; - if (!d && (d = cljs.core._prefer_method._, !d)) { - throw cljs.core.missing_protocol("IMultiFn.-prefer-method", a); + d = cljs.core._prefer_method[goog.typeOf(null == a ? null : a)]; + if(!d && (d = cljs.core._prefer_method._, !d)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-prefer-method", a); } - return d.call(null, a, b, c); + return d.call(null, a, b, c) }; cljs.core._get_method = function(a, b) { - if (a ? a.cljs$core$IMultiFn$_get_method$arity$2 : a) { - return a.cljs$core$IMultiFn$_get_method$arity$2(a, b); + if(a ? a.cljs$core$IMultiFn$_get_method$arity$2 : a) { + return a.cljs$core$IMultiFn$_get_method$arity$2(a, b) } var c; - c = cljs.core._get_method; - var d; - d = goog.typeOf(null == a ? null : a); - c = c[d]; - if (!c && (c = cljs.core._get_method._, !c)) { - throw cljs.core.missing_protocol("IMultiFn.-get-method", a); + c = cljs.core._get_method[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._get_method._, !c)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-get-method", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.core._methods = function(a) { - if (a ? a.cljs$core$IMultiFn$_methods$arity$1 : a) { - return a.cljs$core$IMultiFn$_methods$arity$1(a); + if(a ? a.cljs$core$IMultiFn$_methods$arity$1 : a) { + return a.cljs$core$IMultiFn$_methods$arity$1(a) } var b; - b = cljs.core._methods; - var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._methods._, !b)) { - throw cljs.core.missing_protocol("IMultiFn.-methods", a); + b = cljs.core._methods[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._methods._, !b)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-methods", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.core._prefers = function(a) { - if (a ? a.cljs$core$IMultiFn$_prefers$arity$1 : a) { - return a.cljs$core$IMultiFn$_prefers$arity$1(a); + if(a ? a.cljs$core$IMultiFn$_prefers$arity$1 : a) { + return a.cljs$core$IMultiFn$_prefers$arity$1(a) } var b; - b = cljs.core._prefers; + b = cljs.core._prefers[goog.typeOf(null == a ? null : a)]; + if(!b && (b = cljs.core._prefers._, !b)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-prefers", a); + } + return b.call(null, a) +}; +cljs.core._dispatch = function(a, b) { + if(a ? a.cljs$core$IMultiFn$_dispatch$arity$2 : a) { + return a.cljs$core$IMultiFn$_dispatch$arity$2(a, b) + } var c; - c = goog.typeOf(null == a ? null : a); - b = b[c]; - if (!b && (b = cljs.core._prefers._, !b)) { - throw cljs.core.missing_protocol("IMultiFn.-prefers", a); + c = cljs.core._dispatch[goog.typeOf(null == a ? null : a)]; + if(!c && (c = cljs.core._dispatch._, !c)) { + throw cljs.core.missing_protocol.call(null, "IMultiFn.-dispatch", a); } - return b.call(null, a); + return c.call(null, a, b) }; -cljs.core.throw_no_method_error = function(a, b) { - throw Error([cljs.core.str("No method in multimethod '"), cljs.core.str(a), cljs.core.str("' for dispatch value: "), cljs.core.str(b)].join("")); +cljs.core.do_dispatch = function(a, b, c, d) { + c = cljs.core.apply.call(null, c, d); + a = cljs.core._get_method.call(null, a, c); + if(!cljs.core.truth_(a)) { + throw Error([cljs.core.str("No method in multimethod '"), cljs.core.str(b), cljs.core.str("' for dispatch value: "), cljs.core.str(c)].join("")); + } + return cljs.core.apply.call(null, a, d) }; cljs.core.MultiFn = function(a, b, c, d, e, f, g, h) { this.name = a; @@ -18825,1083 +13453,755 @@ cljs.core.MultiFn = function(a, b, c, d, e, f, g, h) { this.prefer_table = f; this.method_cache = g; this.cached_hierarchy = h; - this.cljs$lang$protocol_mask$partition0$ = 4194305; - this.cljs$lang$protocol_mask$partition1$ = 4352; + this.cljs$lang$protocol_mask$partition0$ = 4194304; + this.cljs$lang$protocol_mask$partition1$ = 256 +}; +cljs.core.MultiFn.cljs$lang$type = !0; +cljs.core.MultiFn.cljs$lang$ctorStr = "cljs.core/MultiFn"; +cljs.core.MultiFn.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/MultiFn") }; cljs.core.MultiFn.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.getUid(this); -}; -cljs.core.MultiFn.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return cljs.core._name(this.name); -}; -cljs.core.MultiFn.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return cljs.core._namespace(this.name); + return goog.getUid(this) }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_reset$arity$1 = function(a) { - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.method_table, function(a) { - return function(a) { - return cljs.core.PersistentArrayMap.EMPTY; - }; - }(this)); - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.method_cache, function(a) { - return function(a) { - return cljs.core.PersistentArrayMap.EMPTY; - }; - }(this)); - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.prefer_table, function(a) { - return function(a) { - return cljs.core.PersistentArrayMap.EMPTY; - }; - }(this)); - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.cached_hierarchy, function(a) { - return function(a) { - return null; - }; - }(this)); - return this; + cljs.core.swap_BANG_.call(null, this.method_table, function(a) { + return cljs.core.PersistentArrayMap.EMPTY + }); + cljs.core.swap_BANG_.call(null, this.method_cache, function(a) { + return cljs.core.PersistentArrayMap.EMPTY + }); + cljs.core.swap_BANG_.call(null, this.prefer_table, function(a) { + return cljs.core.PersistentArrayMap.EMPTY + }); + cljs.core.swap_BANG_.call(null, this.cached_hierarchy, function(a) { + return null + }); + return this }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_add_method$arity$3 = function(a, b, c) { - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$4(this.method_table, cljs.core.assoc, b, c); - cljs.core.reset_cache(this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - return this; + cljs.core.swap_BANG_.call(null, this.method_table, cljs.core.assoc, b, c); + cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); + return this }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_remove_method$arity$2 = function(a, b) { - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3(this.method_table, cljs.core.dissoc, b); - cljs.core.reset_cache(this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - return this; + cljs.core.swap_BANG_.call(null, this.method_table, cljs.core.dissoc, b); + cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); + return this }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_get_method$arity$2 = function(a, b) { - var c = this; - cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(function() { - var a = c.cached_hierarchy; - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }(), function() { - var a = c.hierarchy; - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }()) || cljs.core.reset_cache(c.method_cache, c.method_table, c.cached_hierarchy, c.hierarchy); - var d = function() { - var a = c.method_cache; - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }().call(null, b); - if (cljs.core.truth_(d)) { - return d; - } - d = cljs.core.find_and_cache_best_method(c.name, b, c.hierarchy, c.method_table, c.prefer_table, c.method_cache, c.cached_hierarchy); - return cljs.core.truth_(d) ? d : function() { - var a = c.method_table; - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); - }().call(null, c.default_dispatch_val); + cljs.core._EQ_.call(null, cljs.core.deref.call(null, this.cached_hierarchy), cljs.core.deref.call(null, this.hierarchy)) || cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); + var c = cljs.core.deref.call(null, this.method_cache).call(null, b); + if(cljs.core.truth_(c)) { + return c + } + c = cljs.core.find_and_cache_best_method.call(null, this.name, b, this.hierarchy, this.method_table, this.prefer_table, this.method_cache, this.cached_hierarchy); + return cljs.core.truth_(c) ? c : cljs.core.deref.call(null, this.method_table).call(null, this.default_dispatch_val) }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_prefer_method$arity$3 = function(a, b, c) { - if (cljs.core.truth_(cljs.core.prefers_STAR_(b, c, this.prefer_table))) { + if(cljs.core.truth_(cljs.core.prefers_STAR_.call(null, b, c, this.prefer_table))) { throw Error([cljs.core.str("Preference conflict in multimethod '"), cljs.core.str(this.name), cljs.core.str("': "), cljs.core.str(c), cljs.core.str(" is already preferred to "), cljs.core.str(b)].join("")); } - cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2(this.prefer_table, function(a) { - return function(a) { - return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.conj.cljs$core$IFn$_invoke$arity$2(cljs.core.get.cljs$core$IFn$_invoke$arity$3(a, b, cljs.core.PersistentHashSet.EMPTY), c)); - }; - }(this)); - return cljs.core.reset_cache(this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); + cljs.core.swap_BANG_.call(null, this.prefer_table, function(a) { + return cljs.core.assoc.call(null, a, b, cljs.core.conj.call(null, cljs.core.get.call(null, a, b, cljs.core.PersistentHashSet.EMPTY), c)) + }); + return cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy) }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_methods$arity$1 = function(a) { - a = this.method_table; - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + return cljs.core.deref.call(null, this.method_table) }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_prefers$arity$1 = function(a) { - a = this.prefer_table; - return cljs.core.deref.cljs$core$IFn$_invoke$arity$1 ? cljs.core.deref.cljs$core$IFn$_invoke$arity$1(a) : cljs.core.deref.call(null, a); + return cljs.core.deref.call(null, this.prefer_table) +}; +cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_dispatch$arity$2 = function(a, b) { + return cljs.core.do_dispatch.call(null, this, this.name, this.dispatch_fn, b) +}; +cljs.core.__GT_MultiFn = function(a, b, c, d, e, f, g, h) { + return new cljs.core.MultiFn(a, b, c, d, e, f, g, h) }; cljs.core.MultiFn.prototype.call = function() { - var a = null, b = function(a) { - a = this; - var b = a.dispatch_fn.cljs$core$IFn$_invoke$arity$0 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$0() : a.dispatch_fn.call(null), c = this.cljs$core$IMultiFn$_get_method$arity$2(null, b); - cljs.core.truth_(c) || cljs.core.throw_no_method_error(a.name, b); - return c.cljs$core$IFn$_invoke$arity$0 ? c.cljs$core$IFn$_invoke$arity$0() : c.call(null); - }, c = function(a, b) { - a = this; - var c; - c = a.dispatch_fn.cljs$core$IFn$_invoke$arity$1 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$1(b) : a.dispatch_fn.call(null, b); - var d = this.cljs$core$IMultiFn$_get_method$arity$2(null, c); - cljs.core.truth_(d) || cljs.core.throw_no_method_error(a.name, c); - return d.cljs$core$IFn$_invoke$arity$1 ? d.cljs$core$IFn$_invoke$arity$1(b) : d.call(null, b); - }, d = function(a, b, c) { - a = this; - var d; - d = a.dispatch_fn.cljs$core$IFn$_invoke$arity$2 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$2(b, c) : a.dispatch_fn.call(null, b, c); - var e = this.cljs$core$IMultiFn$_get_method$arity$2(null, d); - cljs.core.truth_(e) || cljs.core.throw_no_method_error(a.name, d); - return e.cljs$core$IFn$_invoke$arity$2 ? e.cljs$core$IFn$_invoke$arity$2(b, c) : e.call(null, b, c); - }, e = function(a, b, c, d) { - a = this; - var e; - e = a.dispatch_fn.cljs$core$IFn$_invoke$arity$3 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$3(b, c, d) : a.dispatch_fn.call(null, b, c, d); - var f = this.cljs$core$IMultiFn$_get_method$arity$2(null, e); - cljs.core.truth_(f) || cljs.core.throw_no_method_error(a.name, e); - return f.cljs$core$IFn$_invoke$arity$3 ? f.cljs$core$IFn$_invoke$arity$3(b, c, d) : f.call(null, b, c, d); - }, f = function(a, b, c, d, e) { - a = this; - var f; - f = a.dispatch_fn.cljs$core$IFn$_invoke$arity$4 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : a.dispatch_fn.call(null, b, c, d, e); - var g = this.cljs$core$IMultiFn$_get_method$arity$2(null, f); - cljs.core.truth_(g) || cljs.core.throw_no_method_error(a.name, f); - return g.cljs$core$IFn$_invoke$arity$4 ? g.cljs$core$IFn$_invoke$arity$4(b, c, d, e) : g.call(null, b, c, d, e); - }, g = function(a, b, c, d, e, f) { - a = this; - var g; - g = a.dispatch_fn.cljs$core$IFn$_invoke$arity$5 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : a.dispatch_fn.call(null, b, c, d, e, f); - var h = this.cljs$core$IMultiFn$_get_method$arity$2(null, g); - cljs.core.truth_(h) || cljs.core.throw_no_method_error(a.name, g); - return h.cljs$core$IFn$_invoke$arity$5 ? h.cljs$core$IFn$_invoke$arity$5(b, c, d, e, f) : h.call(null, b, c, d, e, f); - }, h = function(a, b, c, d, e, f, g) { - a = this; - var h; - h = a.dispatch_fn.cljs$core$IFn$_invoke$arity$6 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$6(b, c, d, e, f, g) : a.dispatch_fn.call(null, b, c, d, e, f, g); - var k = this.cljs$core$IMultiFn$_get_method$arity$2(null, h); - cljs.core.truth_(k) || cljs.core.throw_no_method_error(a.name, h); - return k.cljs$core$IFn$_invoke$arity$6 ? k.cljs$core$IFn$_invoke$arity$6(b, c, d, e, f, g) : k.call(null, b, c, d, e, f, g); - }, k = function(a, b, c, d, e, f, g, h) { - a = this; - var k; - k = a.dispatch_fn.cljs$core$IFn$_invoke$arity$7 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$7(b, c, d, e, f, g, h) : a.dispatch_fn.call(null, b, c, d, e, f, g, h); - var l = this.cljs$core$IMultiFn$_get_method$arity$2(null, k); - cljs.core.truth_(l) || cljs.core.throw_no_method_error(a.name, k); - return l.cljs$core$IFn$_invoke$arity$7 ? l.cljs$core$IFn$_invoke$arity$7(b, c, d, e, f, g, h) : l.call(null, b, c, d, e, f, g, h); - }, l = function(a, b, c, d, e, f, g, h, k) { - a = this; - var l; - l = a.dispatch_fn.cljs$core$IFn$_invoke$arity$8 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$8(b, c, d, e, f, g, h, k) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k); - var m = this.cljs$core$IMultiFn$_get_method$arity$2(null, l); - cljs.core.truth_(m) || cljs.core.throw_no_method_error(a.name, l); - return m.cljs$core$IFn$_invoke$arity$8 ? m.cljs$core$IFn$_invoke$arity$8(b, c, d, e, f, g, h, k) : m.call(null, b, c, d, e, f, g, h, k); - }, m = function(a, b, c, d, e, f, g, h, k, l) { - a = this; - var m; - m = a.dispatch_fn.cljs$core$IFn$_invoke$arity$9 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$9(b, c, d, e, f, g, h, k, l) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l); - var n = this.cljs$core$IMultiFn$_get_method$arity$2(null, m); - cljs.core.truth_(n) || cljs.core.throw_no_method_error(a.name, m); - return n.cljs$core$IFn$_invoke$arity$9 ? n.cljs$core$IFn$_invoke$arity$9(b, c, d, e, f, g, h, k, l) : n.call(null, b, c, d, e, f, g, h, k, l); - }, n = function(a, b, c, d, e, f, g, h, k, l, m) { - a = this; - var n; - n = a.dispatch_fn.cljs$core$IFn$_invoke$arity$10 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$10(b, c, d, e, f, g, h, k, l, m) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m); - var p = this.cljs$core$IMultiFn$_get_method$arity$2(null, n); - cljs.core.truth_(p) || cljs.core.throw_no_method_error(a.name, n); - return p.cljs$core$IFn$_invoke$arity$10 ? p.cljs$core$IFn$_invoke$arity$10(b, c, d, e, f, g, h, k, l, m) : p.call(null, b, c, d, e, f, g, h, k, l, m); - }, p = function(a, b, c, d, e, f, g, h, k, l, m, n) { - a = this; - var p; - p = a.dispatch_fn.cljs$core$IFn$_invoke$arity$11 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$11(b, c, d, e, f, g, h, k, l, m, n) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n); - var q = this.cljs$core$IMultiFn$_get_method$arity$2(null, p); - cljs.core.truth_(q) || cljs.core.throw_no_method_error(a.name, p); - return q.cljs$core$IFn$_invoke$arity$11 ? q.cljs$core$IFn$_invoke$arity$11(b, c, d, e, f, g, h, k, l, m, n) : q.call(null, b, c, d, e, f, g, h, k, l, m, n); - }, q = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { - a = this; - var q; - q = a.dispatch_fn.cljs$core$IFn$_invoke$arity$12 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$12(b, c, d, e, f, g, h, k, l, m, n, p) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p); - var r = this.cljs$core$IMultiFn$_get_method$arity$2(null, q); - cljs.core.truth_(r) || cljs.core.throw_no_method_error(a.name, q); - return r.cljs$core$IFn$_invoke$arity$12 ? r.cljs$core$IFn$_invoke$arity$12(b, c, d, e, f, g, h, k, l, m, n, p) : r.call(null, b, c, d, e, f, g, h, k, l, m, n, p); - }, r = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { - a = this; - var r; - r = a.dispatch_fn.cljs$core$IFn$_invoke$arity$13 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$13(b, c, d, e, f, g, h, k, l, m, n, p, q) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q); - var s = this.cljs$core$IMultiFn$_get_method$arity$2(null, r); - cljs.core.truth_(s) || cljs.core.throw_no_method_error(a.name, r); - return s.cljs$core$IFn$_invoke$arity$13 ? s.cljs$core$IFn$_invoke$arity$13(b, c, d, e, f, g, h, k, l, m, n, p, q) : s.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q); - }, s = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { - a = this; - var s; - s = a.dispatch_fn.cljs$core$IFn$_invoke$arity$14 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$14(b, c, d, e, f, g, h, k, l, m, n, p, q, r) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r); - var t = this.cljs$core$IMultiFn$_get_method$arity$2(null, s); - cljs.core.truth_(t) || cljs.core.throw_no_method_error(a.name, s); - return t.cljs$core$IFn$_invoke$arity$14 ? t.cljs$core$IFn$_invoke$arity$14(b, c, d, e, f, g, h, k, l, m, n, p, q, r) : t.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r); - }, t = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { - a = this; - var t; - t = a.dispatch_fn.cljs$core$IFn$_invoke$arity$15 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$15(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); - var u = this.cljs$core$IMultiFn$_get_method$arity$2(null, t); - cljs.core.truth_(u) || cljs.core.throw_no_method_error(a.name, t); - return u.cljs$core$IFn$_invoke$arity$15 ? u.cljs$core$IFn$_invoke$arity$15(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : u.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); - }, u = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { - a = this; - var u; - u = a.dispatch_fn.cljs$core$IFn$_invoke$arity$16 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$16(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); - var v = this.cljs$core$IMultiFn$_get_method$arity$2(null, u); - cljs.core.truth_(v) || cljs.core.throw_no_method_error(a.name, u); - return v.cljs$core$IFn$_invoke$arity$16 ? v.cljs$core$IFn$_invoke$arity$16(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : v.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); - }, v = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { - a = this; - var v; - v = a.dispatch_fn.cljs$core$IFn$_invoke$arity$17 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$17(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); - var w = this.cljs$core$IMultiFn$_get_method$arity$2(null, v); - cljs.core.truth_(w) || cljs.core.throw_no_method_error(a.name, v); - return w.cljs$core$IFn$_invoke$arity$17 ? w.cljs$core$IFn$_invoke$arity$17(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : w.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); - }, w = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { - a = this; - var w; - w = a.dispatch_fn.cljs$core$IFn$_invoke$arity$18 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$18(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); - var y = this.cljs$core$IMultiFn$_get_method$arity$2(null, w); - cljs.core.truth_(y) || cljs.core.throw_no_method_error(a.name, w); - return y.cljs$core$IFn$_invoke$arity$18 ? y.cljs$core$IFn$_invoke$arity$18(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : y.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); - }, y = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { - a = this; - var y; - y = a.dispatch_fn.cljs$core$IFn$_invoke$arity$19 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$19(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); - var F = this.cljs$core$IMultiFn$_get_method$arity$2(null, y); - cljs.core.truth_(F) || cljs.core.throw_no_method_error(a.name, y); - return F.cljs$core$IFn$_invoke$arity$19 ? F.cljs$core$IFn$_invoke$arity$19(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : F.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); - }, F = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { - a = this; - var F; - F = a.dispatch_fn.cljs$core$IFn$_invoke$arity$20 ? a.dispatch_fn.cljs$core$IFn$_invoke$arity$20(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : a.dispatch_fn.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); - var L = this.cljs$core$IMultiFn$_get_method$arity$2(null, F); - cljs.core.truth_(L) || cljs.core.throw_no_method_error(a.name, F); - return L.cljs$core$IFn$_invoke$arity$20 ? L.cljs$core$IFn$_invoke$arity$20(b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) : L.call(null, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y); - }, L = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, F) { - a = this; - var L = cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(a.dispatch_fn, b, c, d, e, cljs.core.array_seq([f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, F], 0)), V = this.cljs$core$IMultiFn$_get_method$arity$2(null, L); - cljs.core.truth_(V) || cljs.core.throw_no_method_error(a.name, L); - return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(V, b, c, d, e, cljs.core.array_seq([f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y, F], 0)); - }, a = function(a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U) { - switch(arguments.length) { - case 1: - return b.call(this, a); - case 2: - return c.call(this, a, x); - case 3: - return d.call(this, a, x, z); - case 4: - return e.call(this, a, x, z, A); - case 5: - return f.call(this, a, x, z, A, B); - case 6: - return g.call(this, a, x, z, A, B, C); - case 7: - return h.call(this, a, x, z, A, B, C, D); - case 8: - return k.call(this, a, x, z, A, B, C, D, E); - case 9: - return l.call(this, a, x, z, A, B, C, D, E, G); - case 10: - return m.call(this, a, x, z, A, B, C, D, E, G, H); - case 11: - return n.call(this, a, x, z, A, B, C, D, E, G, H, I); - case 12: - return p.call(this, a, x, z, A, B, C, D, E, G, H, I, J); - case 13: - return q.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K); - case 14: - return r.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M); - case 15: - return s.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N); - case 16: - return t.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O); - case 17: - return u.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P); - case 18: - return v.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q); - case 19: - return w.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R); - case 20: - return y.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S); - case 21: - return F.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T); - case 22: - return L.call(this, a, x, z, A, B, C, D, E, G, H, I, J, K, M, N, O, P, Q, R, S, T, U); - } - throw Error("Invalid arity: " + arguments.length); + var a = function(a, b) { + return cljs.core._dispatch.call(null, this, b) + }, b = function(b, d) { + var e = null; + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; - a.cljs$core$IFn$_invoke$arity$1 = b; - a.cljs$core$IFn$_invoke$arity$2 = c; - a.cljs$core$IFn$_invoke$arity$3 = d; - a.cljs$core$IFn$_invoke$arity$4 = e; - a.cljs$core$IFn$_invoke$arity$5 = f; - a.cljs$core$IFn$_invoke$arity$6 = g; - a.cljs$core$IFn$_invoke$arity$7 = h; - a.cljs$core$IFn$_invoke$arity$8 = k; - a.cljs$core$IFn$_invoke$arity$9 = l; - a.cljs$core$IFn$_invoke$arity$10 = m; - a.cljs$core$IFn$_invoke$arity$11 = n; - a.cljs$core$IFn$_invoke$arity$12 = p; - a.cljs$core$IFn$_invoke$arity$13 = q; - a.cljs$core$IFn$_invoke$arity$14 = r; - a.cljs$core$IFn$_invoke$arity$15 = s; - a.cljs$core$IFn$_invoke$arity$16 = t; - a.cljs$core$IFn$_invoke$arity$17 = u; - a.cljs$core$IFn$_invoke$arity$18 = v; - a.cljs$core$IFn$_invoke$arity$19 = w; - a.cljs$core$IFn$_invoke$arity$20 = y; - a.cljs$core$IFn$_invoke$arity$21 = F; - a.cljs$core$IFn$_invoke$arity$22 = L; - return a; + b.cljs$lang$maxFixedArity = 1; + b.cljs$lang$applyTo = function(b) { + var d = cljs.core.first(b); + b = cljs.core.rest(b); + return a(d, b) + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b }(); cljs.core.MultiFn.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone(b))); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$0 = function() { - var a = this.dispatch_fn.cljs$core$IFn$_invoke$arity$0 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$0() : this.dispatch_fn.call(null), b = this.cljs$core$IMultiFn$_get_method$arity$2(null, a); - cljs.core.truth_(b) || cljs.core.throw_no_method_error(this.name, a); - return b.cljs$core$IFn$_invoke$arity$0 ? b.cljs$core$IFn$_invoke$arity$0() : b.call(null); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - var b; - b = this.dispatch_fn.cljs$core$IFn$_invoke$arity$1 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$1(a) : this.dispatch_fn.call(null, a); - var c = this.cljs$core$IMultiFn$_get_method$arity$2(null, b); - cljs.core.truth_(c) || cljs.core.throw_no_method_error(this.name, b); - return c.cljs$core$IFn$_invoke$arity$1 ? c.cljs$core$IFn$_invoke$arity$1(a) : c.call(null, a); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - var c; - c = this.dispatch_fn.cljs$core$IFn$_invoke$arity$2 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$2(a, b) : this.dispatch_fn.call(null, a, b); - var d = this.cljs$core$IMultiFn$_get_method$arity$2(null, c); - cljs.core.truth_(d) || cljs.core.throw_no_method_error(this.name, c); - return d.cljs$core$IFn$_invoke$arity$2 ? d.cljs$core$IFn$_invoke$arity$2(a, b) : d.call(null, a, b); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$3 = function(a, b, c) { - var d; - d = this.dispatch_fn.cljs$core$IFn$_invoke$arity$3 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$3(a, b, c) : this.dispatch_fn.call(null, a, b, c); - var e = this.cljs$core$IMultiFn$_get_method$arity$2(null, d); - cljs.core.truth_(e) || cljs.core.throw_no_method_error(this.name, d); - return e.cljs$core$IFn$_invoke$arity$3 ? e.cljs$core$IFn$_invoke$arity$3(a, b, c) : e.call(null, a, b, c); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$4 = function(a, b, c, d) { - var e; - e = this.dispatch_fn.cljs$core$IFn$_invoke$arity$4 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : this.dispatch_fn.call(null, a, b, c, d); - var f = this.cljs$core$IMultiFn$_get_method$arity$2(null, e); - cljs.core.truth_(f) || cljs.core.throw_no_method_error(this.name, e); - return f.cljs$core$IFn$_invoke$arity$4 ? f.cljs$core$IFn$_invoke$arity$4(a, b, c, d) : f.call(null, a, b, c, d); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$5 = function(a, b, c, d, e) { - var f; - f = this.dispatch_fn.cljs$core$IFn$_invoke$arity$5 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) : this.dispatch_fn.call(null, a, b, c, d, e); - var g = this.cljs$core$IMultiFn$_get_method$arity$2(null, f); - cljs.core.truth_(g) || cljs.core.throw_no_method_error(this.name, f); - return g.cljs$core$IFn$_invoke$arity$5 ? g.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) : g.call(null, a, b, c, d, e); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$6 = function(a, b, c, d, e, f) { - var g; - g = this.dispatch_fn.cljs$core$IFn$_invoke$arity$6 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) : this.dispatch_fn.call(null, a, b, c, d, e, f); - var h = this.cljs$core$IMultiFn$_get_method$arity$2(null, g); - cljs.core.truth_(h) || cljs.core.throw_no_method_error(this.name, g); - return h.cljs$core$IFn$_invoke$arity$6 ? h.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) : h.call(null, a, b, c, d, e, f); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$7 = function(a, b, c, d, e, f, g) { - var h; - h = this.dispatch_fn.cljs$core$IFn$_invoke$arity$7 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) : this.dispatch_fn.call(null, a, b, c, d, e, f, g); - var k = this.cljs$core$IMultiFn$_get_method$arity$2(null, h); - cljs.core.truth_(k) || cljs.core.throw_no_method_error(this.name, h); - return k.cljs$core$IFn$_invoke$arity$7 ? k.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) : k.call(null, a, b, c, d, e, f, g); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$8 = function(a, b, c, d, e, f, g, h) { - var k; - k = this.dispatch_fn.cljs$core$IFn$_invoke$arity$8 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h); - var l = this.cljs$core$IMultiFn$_get_method$arity$2(null, k); - cljs.core.truth_(l) || cljs.core.throw_no_method_error(this.name, k); - return l.cljs$core$IFn$_invoke$arity$8 ? l.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) : l.call(null, a, b, c, d, e, f, g, h); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$9 = function(a, b, c, d, e, f, g, h, k) { - var l; - l = this.dispatch_fn.cljs$core$IFn$_invoke$arity$9 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k); - var m = this.cljs$core$IMultiFn$_get_method$arity$2(null, l); - cljs.core.truth_(m) || cljs.core.throw_no_method_error(this.name, l); - return m.cljs$core$IFn$_invoke$arity$9 ? m.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) : m.call(null, a, b, c, d, e, f, g, h, k); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$10 = function(a, b, c, d, e, f, g, h, k, l) { - var m; - m = this.dispatch_fn.cljs$core$IFn$_invoke$arity$10 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l); - var n = this.cljs$core$IMultiFn$_get_method$arity$2(null, m); - cljs.core.truth_(n) || cljs.core.throw_no_method_error(this.name, m); - return n.cljs$core$IFn$_invoke$arity$10 ? n.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) : n.call(null, a, b, c, d, e, f, g, h, k, l); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$11 = function(a, b, c, d, e, f, g, h, k, l, m) { - var n; - n = this.dispatch_fn.cljs$core$IFn$_invoke$arity$11 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m); - var p = this.cljs$core$IMultiFn$_get_method$arity$2(null, n); - cljs.core.truth_(p) || cljs.core.throw_no_method_error(this.name, n); - return p.cljs$core$IFn$_invoke$arity$11 ? p.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) : p.call(null, a, b, c, d, e, f, g, h, k, l, m); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$12 = function(a, b, c, d, e, f, g, h, k, l, m, n) { - var p; - p = this.dispatch_fn.cljs$core$IFn$_invoke$arity$12 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n); - var q = this.cljs$core$IMultiFn$_get_method$arity$2(null, p); - cljs.core.truth_(q) || cljs.core.throw_no_method_error(this.name, p); - return q.cljs$core$IFn$_invoke$arity$12 ? q.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) : q.call(null, a, b, c, d, e, f, g, h, k, l, m, n); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$13 = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { - var q; - q = this.dispatch_fn.cljs$core$IFn$_invoke$arity$13 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); - var r = this.cljs$core$IMultiFn$_get_method$arity$2(null, q); - cljs.core.truth_(r) || cljs.core.throw_no_method_error(this.name, q); - return r.cljs$core$IFn$_invoke$arity$13 ? r.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) : r.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$14 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { - var r; - r = this.dispatch_fn.cljs$core$IFn$_invoke$arity$14 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); - var s = this.cljs$core$IMultiFn$_get_method$arity$2(null, r); - cljs.core.truth_(s) || cljs.core.throw_no_method_error(this.name, r); - return s.cljs$core$IFn$_invoke$arity$14 ? s.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) : s.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$15 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { - var s; - s = this.dispatch_fn.cljs$core$IFn$_invoke$arity$15 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); - var t = this.cljs$core$IMultiFn$_get_method$arity$2(null, s); - cljs.core.truth_(t) || cljs.core.throw_no_method_error(this.name, s); - return t.cljs$core$IFn$_invoke$arity$15 ? t.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) : t.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$16 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { - var t; - t = this.dispatch_fn.cljs$core$IFn$_invoke$arity$16 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); - var u = this.cljs$core$IMultiFn$_get_method$arity$2(null, t); - cljs.core.truth_(u) || cljs.core.throw_no_method_error(this.name, t); - return u.cljs$core$IFn$_invoke$arity$16 ? u.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) : u.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$17 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { - var u; - u = this.dispatch_fn.cljs$core$IFn$_invoke$arity$17 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); - var v = this.cljs$core$IMultiFn$_get_method$arity$2(null, u); - cljs.core.truth_(v) || cljs.core.throw_no_method_error(this.name, u); - return v.cljs$core$IFn$_invoke$arity$17 ? v.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) : v.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$18 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { - var v; - v = this.dispatch_fn.cljs$core$IFn$_invoke$arity$18 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); - var w = this.cljs$core$IMultiFn$_get_method$arity$2(null, v); - cljs.core.truth_(w) || cljs.core.throw_no_method_error(this.name, v); - return w.cljs$core$IFn$_invoke$arity$18 ? w.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) : w.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$19 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) { - var w; - w = this.dispatch_fn.cljs$core$IFn$_invoke$arity$19 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); - var y = this.cljs$core$IMultiFn$_get_method$arity$2(null, w); - cljs.core.truth_(y) || cljs.core.throw_no_method_error(this.name, w); - return y.cljs$core$IFn$_invoke$arity$19 ? y.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v) : y.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$20 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) { - var y; - y = this.dispatch_fn.cljs$core$IFn$_invoke$arity$20 ? this.dispatch_fn.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : this.dispatch_fn.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); - var F = this.cljs$core$IMultiFn$_get_method$arity$2(null, y); - cljs.core.truth_(F) || cljs.core.throw_no_method_error(this.name, y); - return F.cljs$core$IFn$_invoke$arity$20 ? F.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w) : F.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w); -}; -cljs.core.MultiFn.prototype.cljs$core$IFn$_invoke$arity$21 = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y) { - var F = cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(this.dispatch_fn, a, b, c, d, cljs.core.array_seq([e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y], 0)), L = this.cljs$core$IMultiFn$_get_method$arity$2(null, F); - cljs.core.truth_(L) || cljs.core.throw_no_method_error(this.name, F); - return cljs.core.apply.cljs$core$IFn$_invoke$arity$variadic(L, a, b, c, d, cljs.core.array_seq([e, f, g, h, k, l, m, n, p, q, r, s, t, u, v, w, y], 0)); -}; -cljs.core.MultiFn.cljs$lang$type = !0; -cljs.core.MultiFn.cljs$lang$ctorStr = "cljs.core/MultiFn"; -cljs.core.MultiFn.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/MultiFn"); -}; -cljs.core.__GT_MultiFn = function(a, b, c, d, e, f, g, h) { - return new cljs.core.MultiFn(a, b, c, d, e, f, g, h); + return cljs.core._dispatch.call(null, this, b) }; cljs.core.remove_all_methods = function(a) { - return cljs.core._reset(a); + return cljs.core._reset.call(null, a) }; cljs.core.remove_method = function(a, b) { - return cljs.core._remove_method(a, b); + return cljs.core._remove_method.call(null, a, b) }; cljs.core.prefer_method = function(a, b, c) { - return cljs.core._prefer_method(a, b, c); + return cljs.core._prefer_method.call(null, a, b, c) }; cljs.core.methods$ = function(a) { - return cljs.core._methods(a); + return cljs.core._methods.call(null, a) }; cljs.core.get_method = function(a, b) { - return cljs.core._get_method(a, b); + return cljs.core._get_method.call(null, a, b) }; cljs.core.prefers = function(a) { - return cljs.core._prefers(a); + return cljs.core._prefers.call(null, a) }; cljs.core.UUID = function(a) { this.uuid = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2153775104; + this.cljs$lang$protocol_mask$partition0$ = 2153775104 +}; +cljs.core.UUID.cljs$lang$type = !0; +cljs.core.UUID.cljs$lang$ctorStr = "cljs.core/UUID"; +cljs.core.UUID.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.core/UUID") }; cljs.core.UUID.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - a = cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq([this], 0)); - return goog.string.hashCode(a); + return goog.string.hashCode(cljs.core.pr_str.call(null, this)) }; cljs.core.UUID.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write(b, [cljs.core.str('#uuid "'), cljs.core.str(this.uuid), cljs.core.str('"')].join("")); + return cljs.core._write.call(null, b, [cljs.core.str('#uuid "'), cljs.core.str(this.uuid), cljs.core.str('"')].join("")) }; cljs.core.UUID.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.UUID && this.uuid === b.uuid; -}; -cljs.core.UUID.prototype.toString = function() { - return this.uuid; -}; -cljs.core.UUID.prototype.equiv = function(a) { - return this.cljs$core$IEquiv$_equiv$arity$2(null, a); -}; -cljs.core.UUID.cljs$lang$type = !0; -cljs.core.UUID.cljs$lang$ctorStr = "cljs.core/UUID"; -cljs.core.UUID.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/UUID"); + return b instanceof cljs.core.UUID && this.uuid === b.uuid }; cljs.core.__GT_UUID = function(a) { - return new cljs.core.UUID(a); + return new cljs.core.UUID(a) }; cljs.core.ExceptionInfo = function(a, b, c) { this.message = a; this.data = b; - this.cause = c; + this.cause = c }; cljs.core.ExceptionInfo.cljs$lang$type = !0; cljs.core.ExceptionInfo.cljs$lang$ctorStr = "cljs.core/ExceptionInfo"; cljs.core.ExceptionInfo.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write(b, "cljs.core/ExceptionInfo"); + return cljs.core._write.call(null, b, "cljs.core/ExceptionInfo") }; cljs.core.__GT_ExceptionInfo = function(a, b, c) { - return new cljs.core.ExceptionInfo(a, b, c); -}; -cljs.core.pr_writer_ex_info = function(a, b, c) { - cljs.core._write(b, "#ExceptionInfo{:message "); - cljs.core.pr_writer(a.message, b, c); - cljs.core.truth_(a.data) && (cljs.core._write(b, ", :data "), cljs.core.pr_writer(a.data, b, c)); - cljs.core.truth_(a.cause) && (cljs.core._write(b, ", :cause "), cljs.core.pr_writer(a.cause, b, c)); - return cljs.core._write(b, "}"); + return new cljs.core.ExceptionInfo(a, b, c) }; +cljs.core.ExceptionInfo.prototype = Error(); +cljs.core.ExceptionInfo.prototype.constructor = cljs.core.ExceptionInfo; cljs.core.ex_info = function() { - var a = null, b = function(b, c) { - return a.cljs$core$IFn$_invoke$arity$3(b, c, null); + var a = null, b = function(a, b) { + return new cljs.core.ExceptionInfo(a, b, null) }, c = function(a, b, c) { - cljs.core.ExceptionInfo.prototype = Error(a); - cljs.core.ExceptionInfo.prototype.name = "ExceptionInfo"; - cljs.core.ExceptionInfo.prototype.constructor = cljs.core.ExceptionInfo; - cljs.core.ExceptionInfo.prototype.toString = cljs.core.pr_str_STAR_; - cljs.core.ExceptionInfo.prototype.cljs$core$IPrintWithWriter$ = !0; - cljs.core.ExceptionInfo.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_writer_ex_info(this, b, c); - }; - return new cljs.core.ExceptionInfo(a, b, c); + return new cljs.core.ExceptionInfo(a, b, c) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); cljs.core.ex_data = function(a) { - return a instanceof cljs.core.ExceptionInfo ? a.data : null; + return a instanceof cljs.core.ExceptionInfo ? a.data : null }; cljs.core.ex_message = function(a) { - return a instanceof Error ? a.message : null; + return a instanceof Error ? a.message : null }; cljs.core.ex_cause = function(a) { - return a instanceof cljs.core.ExceptionInfo ? a.cause : null; + return a instanceof cljs.core.ExceptionInfo ? a.cause : null }; cljs.core.comparator = function(a) { return function(b, c) { - return cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(b, c) : a.call(null, b, c)) ? -1 : cljs.core.truth_(a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, b) : a.call(null, c, b)) ? 1 : 0; - }; + return cljs.core.truth_(a.call(null, b, c)) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null + } }; cljs.core.special_symbol_QMARK_ = function(a) { - return cljs.core.contains_QMARK_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 19, [new cljs.core.Symbol(null, "\x26", "\x26", -2144855648, null), null, new cljs.core.Symbol(null, "defrecord*", "defrecord*", -1936366207, null), null, new cljs.core.Symbol(null, "try", "try", -1273693247, null), null, new cljs.core.Symbol(null, "loop*", "loop*", 615029416, null), null, new cljs.core.Symbol(null, "do", "do", 1686842252, null), null, new cljs.core.Symbol(null, "letfn*", - "letfn*", -110097810, null), null, new cljs.core.Symbol(null, "if", "if", 1181717262, null), null, new cljs.core.Symbol(null, "new", "new", -444906321, null), null, new cljs.core.Symbol(null, "ns", "ns", 2082130287, null), null, new cljs.core.Symbol(null, "deftype*", "deftype*", 962659890, null), null, new cljs.core.Symbol(null, "let*", "let*", 1920721458, null), null, new cljs.core.Symbol(null, "js*", "js*", -1134233646, null), null, new cljs.core.Symbol(null, "fn*", "fn*", -752876845, null), - null, new cljs.core.Symbol(null, "recur", "recur", 1202958259, null), null, new cljs.core.Symbol(null, "set!", "set!", 250714521, null), null, new cljs.core.Symbol(null, ".", ".", 1975675962, null), null, new cljs.core.Symbol(null, "quote", "quote", 1377916282, null), null, new cljs.core.Symbol(null, "throw", "throw", 595905694, null), null, new cljs.core.Symbol(null, "def", "def", 597100991, null), null], null), null), a); + return cljs.core.contains_QMARK_.call(null, new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 19, [new cljs.core.Symbol(null, "deftype*", "deftype*", -978581244, null), null, new cljs.core.Symbol(null, "new", "new", -1640422567, null), null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null), null, new cljs.core.Symbol(null, "\x26", "\x26", -1640531489, null), null, new cljs.core.Symbol(null, "set!", "set!", -1637004872, null), null, new cljs.core.Symbol(null, + "recur", "recur", -1532142362, null), null, new cljs.core.Symbol(null, ".", ".", -1640531481, null), null, new cljs.core.Symbol(null, "ns", "ns", -1640528002, null), null, new cljs.core.Symbol(null, "do", "do", -1640528316, null), null, new cljs.core.Symbol(null, "fn*", "fn*", -1640430053, null), null, new cljs.core.Symbol(null, "throw", "throw", -1530191713, null), null, new cljs.core.Symbol(null, "letfn*", "letfn*", 1548249632, null), null, new cljs.core.Symbol(null, "js*", "js*", -1640426054, + null), null, new cljs.core.Symbol(null, "defrecord*", "defrecord*", 774272013, null), null, new cljs.core.Symbol(null, "let*", "let*", -1637213400, null), null, new cljs.core.Symbol(null, "loop*", "loop*", -1537374273, null), null, new cljs.core.Symbol(null, "try", "try", -1640416396, null), null, new cljs.core.Symbol(null, "if", "if", -1640528170, null), null, new cljs.core.Symbol(null, "def", "def", -1640432194, null), null], null), null), a) +}; +var clojure = {walk:{}}; +clojure.walk.walk = function(a, b, c) { + return cljs.core.seq_QMARK_.call(null, c) ? b.call(null, cljs.core.doall.call(null, cljs.core.map.call(null, a, c))) : cljs.core.coll_QMARK_.call(null, c) ? b.call(null, cljs.core.into.call(null, cljs.core.empty.call(null, c), cljs.core.map.call(null, a, c))) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b.call(null, c) : null +}; +clojure.walk.postwalk = function postwalk(b, c) { + return clojure.walk.walk.call(null, cljs.core.partial.call(null, postwalk, b), b, c) +}; +clojure.walk.prewalk = function prewalk(b, c) { + return clojure.walk.walk.call(null, cljs.core.partial.call(null, prewalk, b), cljs.core.identity, b.call(null, c)) +}; +clojure.walk.keywordize_keys = function(a) { + var b = function(a) { + var b = cljs.core.nth.call(null, a, 0, null); + a = cljs.core.nth.call(null, a, 1, null); + return"string" === typeof b ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null) + }; + return clojure.walk.postwalk.call(null, function(a) { + return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a + }, a) +}; +clojure.walk.stringify_keys = function(a) { + var b = function(a) { + var b = cljs.core.nth.call(null, a, 0, null); + a = cljs.core.nth.call(null, a, 1, null); + return b instanceof cljs.core.Keyword ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null) + }; + return clojure.walk.postwalk.call(null, function(a) { + return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a + }, a) }; -cljs.core.test = function(a) { - a = a.cljs$lang$test; - return cljs.core.truth_(a) ? (a.cljs$core$IFn$_invoke$arity$0 ? a.cljs$core$IFn$_invoke$arity$0() : a.call(null), new cljs.core.Keyword(null, "ok", "ok", 967785236)) : new cljs.core.Keyword(null, "no-test", "no-test", -1679482642); +clojure.walk.prewalk_replace = function(a, b) { + return clojure.walk.prewalk.call(null, function(b) { + return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b + }, b) +}; +clojure.walk.postwalk_replace = function(a, b) { + return clojure.walk.postwalk.call(null, function(b) { + return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b + }, b) }; -var clojure = {string:{}}; +clojure.string = {}; clojure.string.seq_reverse = function(a) { - return cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a); + return cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a) }; -clojure.string.re_surrogate_pair = RegExp("([\\uD800-\\uDBFF])([\\uDC00-\\uDFFF])", "g"); clojure.string.reverse = function(a) { - return a.replace(clojure.string.re_surrogate_pair, "$2$1").split("").reverse().join(""); + return a.split("").reverse().join("") }; clojure.string.replace = function(a, b, c) { - if ("string" === typeof b) { - return a.replace(new RegExp(goog.string.regExpEscape(b), "g"), c); + if("string" === typeof b) { + return a.replace(RegExp(goog.string.regExpEscape(b), "g"), c) + } + if(cljs.core.truth_(b.hasOwnProperty("source"))) { + return a.replace(RegExp(b.source, "g"), c) } - if (cljs.core.truth_(b.hasOwnProperty("source"))) { - return a.replace(new RegExp(b.source, "g"), c); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + throw[cljs.core.str("Invalid match arg: "), cljs.core.str(b)].join(""); } - throw[cljs.core.str("Invalid match arg: "), cljs.core.str(b)].join(""); + return null }; clojure.string.replace_first = function(a, b, c) { - return a.replace(b, c); + return a.replace(b, c) }; clojure.string.join = function() { var a = null, b = function(a) { - var b = new goog.string.StringBuffer; - for (a = cljs.core.seq.call(null, a);;) { - if (a) { - b = b.append("" + cljs.core.str(cljs.core.first.call(null, a))), a = cljs.core.next.call(null, a); - } else { - return b.toString(); - } - } + return cljs.core.apply.call(null, cljs.core.str, a) }, c = function(a, b) { - for (var c = new goog.string.StringBuffer, g = cljs.core.seq.call(null, b);;) { - if (g) { - c.append("" + cljs.core.str(cljs.core.first.call(null, g))), g = cljs.core.next.call(null, g), null != g && c.append(a); - } else { - return c.toString(); - } - } + return cljs.core.apply.call(null, cljs.core.str, cljs.core.interpose.call(null, a, b)) }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e); + return c.call(this, a, e) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a; + return a }(); clojure.string.upper_case = function(a) { - return a.toUpperCase(); + return a.toUpperCase() }; clojure.string.lower_case = function(a) { - return a.toLowerCase(); + return a.toLowerCase() }; clojure.string.capitalize = function(a) { - return 2 > cljs.core.count.call(null, a) ? clojure.string.upper_case.call(null, a) : [cljs.core.str(clojure.string.upper_case.call(null, cljs.core.subs.call(null, a, 0, 1))), cljs.core.str(clojure.string.lower_case.call(null, cljs.core.subs.call(null, a, 1)))].join(""); + return 2 > cljs.core.count.call(null, a) ? clojure.string.upper_case.call(null, a) : [cljs.core.str(clojure.string.upper_case.call(null, cljs.core.subs.call(null, a, 0, 1))), cljs.core.str(clojure.string.lower_case.call(null, cljs.core.subs.call(null, a, 1)))].join("") }; clojure.string.pop_last_while_empty = function(a) { - for (;;) { - if (cljs.core._EQ_.call(null, "", cljs.core.peek.call(null, a))) { - a = cljs.core.pop.call(null, a); - } else { - return a; + for(;;) { + if(cljs.core._EQ_.call(null, "", cljs.core.peek.call(null, a))) { + a = cljs.core.pop.call(null, a) + }else { + return a } } }; clojure.string.discard_trailing_if_needed = function(a, b) { - return cljs.core._EQ_.call(null, 0, a) ? clojure.string.pop_last_while_empty.call(null, b) : b; + return cljs.core._EQ_.call(null, 0, a) ? clojure.string.pop_last_while_empty.call(null, b) : b }; clojure.string.split_with_empty_regex = function(a, b) { - if (0 >= b || b >= 2 + cljs.core.count.call(null, a)) { - return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a)))), ""); + if(0 >= b || b >= 2 + cljs.core.count.call(null, a)) { + return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a)))), "") } var c = cljs.core._EQ_; - if (cljs.core.truth_(c.call(null, 1, b))) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a], null); + if(cljs.core.truth_(c.call(null, 1, b))) { + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a], null) } - if (cljs.core.truth_(c.call(null, 2, b))) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["", a], null); + if(cljs.core.truth_(c.call(null, 2, b))) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["", a], null) } c = b - 2; - return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.subvec.call(null, cljs.core.vec.call(null, cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a))), 0, c))), cljs.core.subs.call(null, a, c)); + return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.subvec.call(null, cljs.core.vec.call(null, cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a))), 0, c))), cljs.core.subs.call(null, a, c)) }; clojure.string.split = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, 0); + return a.call(null, b, c, 0) }, c = function(a, b, c) { return clojure.string.discard_trailing_if_needed.call(null, c, cljs.core._EQ_.call(null, "" + cljs.core.str(b), "/(?:)/") ? clojure.string.split_with_empty_regex.call(null, a, c) : 1 > c ? cljs.core.vec.call(null, ("" + cljs.core.str(a)).split(b)) : function() { - for (var g = a, h = c, k = cljs.core.PersistentVector.EMPTY;;) { - if (cljs.core._EQ_.call(null, h, 1)) { - return cljs.core.conj.call(null, k, g); + for(var g = a, h = c, k = cljs.core.PersistentVector.EMPTY;;) { + if(cljs.core._EQ_.call(null, h, 1)) { + return cljs.core.conj.call(null, k, g) } var l = cljs.core.re_find.call(null, b, g); - if (cljs.core.truth_(l)) { + if(cljs.core.truth_(l)) { var m = l, l = g.indexOf(m), m = g.substring(l + cljs.core.count.call(null, m)), h = h - 1, k = cljs.core.conj.call(null, k, g.substring(0, l)), g = m - } else { - return cljs.core.conj.call(null, k, g); + }else { + return cljs.core.conj.call(null, k, g) } } - }()); + }()) }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f); + return c.call(this, a, e, f) } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a; + return a }(); clojure.string.split_lines = function(a) { - return clojure.string.split.call(null, a, /\n|\r\n/); + return clojure.string.split.call(null, a, /\n|\r\n/) }; clojure.string.trim = function(a) { - return goog.string.trim(a); + return goog.string.trim(a) }; clojure.string.triml = function(a) { - return goog.string.trimLeft(a); + return goog.string.trimLeft(a) }; clojure.string.trimr = function(a) { - return goog.string.trimRight(a); + return goog.string.trimRight(a) }; clojure.string.trim_newline = function(a) { - for (var b = a.length;;) { - if (0 === b) { - return ""; + for(var b = a.length;;) { + if(0 === b) { + return"" } var c = cljs.core.get.call(null, a, b - 1); - if (cljs.core._EQ_.call(null, c, "\n") || cljs.core._EQ_.call(null, c, "\r")) { - b -= 1; - } else { - return a.substring(0, b); + if(cljs.core._EQ_.call(null, c, "\n") || cljs.core._EQ_.call(null, c, "\r")) { + b -= 1 + }else { + return a.substring(0, b) } } }; clojure.string.blank_QMARK_ = function(a) { - return goog.string.isEmptySafe(a); + return goog.string.isEmptySafe(a) }; clojure.string.escape = function(a, b) { - for (var c = new goog.string.StringBuffer, d = a.length, e = 0;;) { - if (cljs.core._EQ_.call(null, d, e)) { - return c.toString(); + for(var c = new goog.string.StringBuffer, d = a.length, e = 0;;) { + if(cljs.core._EQ_.call(null, d, e)) { + return c.toString() } var f = a.charAt(e), g = cljs.core.get.call(null, b, f); cljs.core.truth_(g) ? c.append("" + cljs.core.str(g)) : c.append(f); - e += 1; + e += 1 } }; cljs.reader = {}; cljs.reader.PushbackReader = function() { - return{}; + return{} }(); cljs.reader.read_char = function(a) { - if (a ? a.cljs$reader$PushbackReader$read_char$arity$1 : a) { - return a.cljs$reader$PushbackReader$read_char$arity$1(a); + if(a ? a.cljs$reader$PushbackReader$read_char$arity$1 : a) { + return a.cljs$reader$PushbackReader$read_char$arity$1(a) } var b; b = cljs.reader.read_char[goog.typeOf(null == a ? null : a)]; - if (!b && (b = cljs.reader.read_char._, !b)) { + if(!b && (b = cljs.reader.read_char._, !b)) { throw cljs.core.missing_protocol.call(null, "PushbackReader.read-char", a); } - return b.call(null, a); + return b.call(null, a) }; cljs.reader.unread = function(a, b) { - if (a ? a.cljs$reader$PushbackReader$unread$arity$2 : a) { - return a.cljs$reader$PushbackReader$unread$arity$2(a, b); + if(a ? a.cljs$reader$PushbackReader$unread$arity$2 : a) { + return a.cljs$reader$PushbackReader$unread$arity$2(a, b) } var c; c = cljs.reader.unread[goog.typeOf(null == a ? null : a)]; - if (!c && (c = cljs.reader.unread._, !c)) { + if(!c && (c = cljs.reader.unread._, !c)) { throw cljs.core.missing_protocol.call(null, "PushbackReader.unread", a); } - return c.call(null, a, b); + return c.call(null, a, b) }; cljs.reader.StringPushbackReader = function(a, b, c) { this.s = a; this.buffer = b; - this.idx = c; + this.idx = c +}; +cljs.reader.StringPushbackReader.cljs$lang$type = !0; +cljs.reader.StringPushbackReader.cljs$lang$ctorStr = "cljs.reader/StringPushbackReader"; +cljs.reader.StringPushbackReader.cljs$lang$ctorPrWriter = function(a, b, c) { + return cljs.core._write.call(null, b, "cljs.reader/StringPushbackReader") }; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$ = !0; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$read_char$arity$1 = function(a) { - return 0 === this.buffer.length ? (this.idx += 1, this.s[this.idx]) : this.buffer.pop(); + return 0 === this.buffer.length ? (this.idx += 1, this.s[this.idx]) : this.buffer.pop() }; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$unread$arity$2 = function(a, b) { - return this.buffer.push(b); -}; -cljs.reader.StringPushbackReader.cljs$lang$type = !0; -cljs.reader.StringPushbackReader.cljs$lang$ctorStr = "cljs.reader/StringPushbackReader"; -cljs.reader.StringPushbackReader.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.reader/StringPushbackReader"); + return this.buffer.push(b) }; cljs.reader.__GT_StringPushbackReader = function(a, b, c) { - return new cljs.reader.StringPushbackReader(a, b, c); + return new cljs.reader.StringPushbackReader(a, b, c) }; cljs.reader.push_back_reader = function(a) { - return new cljs.reader.StringPushbackReader(a, [], -1); + return new cljs.reader.StringPushbackReader(a, [], -1) }; cljs.reader.whitespace_QMARK_ = function(a) { var b = goog.string.isBreakingWhitespace(a); - return cljs.core.truth_(b) ? b : "," === a; + return cljs.core.truth_(b) ? b : "," === a }; cljs.reader.numeric_QMARK_ = function(a) { - return goog.string.isNumeric(a); + return goog.string.isNumeric(a) }; cljs.reader.comment_prefix_QMARK_ = function(a) { - return ";" === a; + return";" === a }; cljs.reader.number_literal_QMARK_ = function(a, b) { return cljs.reader.numeric_QMARK_.call(null, b) || ("+" === b || "-" === b) && cljs.reader.numeric_QMARK_.call(null, function() { var b = cljs.reader.read_char.call(null, a); cljs.reader.unread.call(null, a, b); - return b; - }()); + return b + }()) }; cljs.reader.reader_error = function() { var a = function(a, b) { throw Error(cljs.core.apply.call(null, cljs.core.str, b)); }, b = function(b, d) { var e = null; - if (1 < arguments.length) { - for (var e = 0, f = Array(arguments.length - 1);e < f.length;) { - f[e] = arguments[e + 1], ++e; - } - e = new cljs.core.IndexedSeq(f, 0); - } - return a.call(this, b, e); + 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); + return a.call(this, b, e) }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b); + return a(d, b) }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b; + return b }(); cljs.reader.macro_terminating_QMARK_ = function(a) { var b = "#" !== a; - return b && (b = "'" !== a) ? (b = ":" !== a) ? cljs.reader.macros.call(null, a) : b : b; + return b && (b = "'" !== a) ? (b = ":" !== a) ? cljs.reader.macros.call(null, a) : b : b }; cljs.reader.read_token = function(a, b) { - for (var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { - if (null == d || cljs.reader.whitespace_QMARK_.call(null, d) || cljs.reader.macro_terminating_QMARK_.call(null, d)) { - return cljs.reader.unread.call(null, a, d), c.toString(); + for(var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { + if(null == d || cljs.reader.whitespace_QMARK_.call(null, d) || cljs.reader.macro_terminating_QMARK_.call(null, d)) { + return cljs.reader.unread.call(null, a, d), c.toString() } c.append(d); - d = cljs.reader.read_char.call(null, a); + d = cljs.reader.read_char.call(null, a) } }; cljs.reader.skip_line = function(a, b) { - for (;;) { + for(;;) { var c = cljs.reader.read_char.call(null, a); - if ("\n" === c || "\r" === c || null == c) { - return a; + if("\n" === c || "\r" === c || null == c) { + return a } } }; -cljs.reader.int_pattern = cljs.core.re_pattern.call(null, "^([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+))(N)?$"); -cljs.reader.ratio_pattern = cljs.core.re_pattern.call(null, "^([-+]?[0-9]+)/([0-9]+)$"); -cljs.reader.float_pattern = cljs.core.re_pattern.call(null, "^([-+]?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?$"); -cljs.reader.symbol_pattern = cljs.core.re_pattern.call(null, "^[:]?([^0-9/].*/)?([^0-9/][^/]*)$"); -cljs.reader.re_matches_STAR_ = function(a, b) { +cljs.reader.int_pattern = cljs.core.re_pattern.call(null, "([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?"); +cljs.reader.ratio_pattern = cljs.core.re_pattern.call(null, "([-+]?[0-9]+)/([0-9]+)"); +cljs.reader.float_pattern = cljs.core.re_pattern.call(null, "([-+]?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+)?)(M)?"); +cljs.reader.symbol_pattern = cljs.core.re_pattern.call(null, "[:]?([^0-9/].*/)?([^0-9/][^/]*)"); +cljs.reader.re_find_STAR_ = function(a, b) { var c = a.exec(b); - return null != c && c[0] === b ? 1 === c.length ? c[0] : c : null; + return null == c ? null : 1 === c.length ? c[0] : c }; cljs.reader.match_int = function(a) { - a = cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a); - var b = a[2]; - if (null != (cljs.core._EQ_.call(null, b, "") ? null : b)) { - return 0; + var b = cljs.reader.re_find_STAR_.call(null, cljs.reader.int_pattern, a); + a = b[2]; + if(null == a || 1 > a.length) { + a = "-" === b[1] ? -1 : 1; + var c = cljs.core.truth_(b[3]) ? [b[3], 10] : cljs.core.truth_(b[4]) ? [b[4], 16] : cljs.core.truth_(b[5]) ? [b[5], 8] : cljs.core.truth_(b[7]) ? [b[7], parseInt(b[7])] : new cljs.core.Keyword(null, "default", "default", 2558708147) ? [null, null] : null, b = c[0], c = c[1]; + return null == b ? null : a * parseInt(b, c) } - var b = cljs.core.truth_(a[3]) ? [a[3], 10] : cljs.core.truth_(a[4]) ? [a[4], 16] : cljs.core.truth_(a[5]) ? [a[5], 8] : cljs.core.truth_(a[6]) ? [a[7], parseInt(a[6], 10)] : [null, null], c = b[0]; - if (null == c) { - return null; - } - b = parseInt(c, b[1]); - return "-" === a[1] ? -b : b; + return 0 }; cljs.reader.match_ratio = function(a) { - a = cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a); + a = cljs.reader.re_find_STAR_.call(null, cljs.reader.ratio_pattern, a); var b = a[2]; - return parseInt(a[1], 10) / parseInt(b, 10); + return parseInt(a[1]) / parseInt(b) }; cljs.reader.match_float = function(a) { - return parseFloat(a); + return parseFloat(a) +}; +cljs.reader.re_matches_STAR_ = function(a, b) { + var c = a.exec(b); + return null != c && c[0] === b ? 1 === c.length ? c[0] : c : null }; cljs.reader.match_number = function(a) { - return cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a)) ? cljs.reader.match_int.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a)) ? cljs.reader.match_ratio.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.float_pattern, a)) ? cljs.reader.match_float.call(null, a) : null; + return cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a)) ? cljs.reader.match_int.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a)) ? cljs.reader.match_ratio.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.float_pattern, a)) ? cljs.reader.match_float.call(null, a) : null }; cljs.reader.escape_char_map = function(a) { - return "t" === a ? "\t" : "r" === a ? "\r" : "n" === a ? "\n" : "\\" === a ? "\\" : '"' === a ? '"' : "b" === a ? "\b" : "f" === a ? "\f" : null; + if("t" === a) { + return"\t" + } + if("r" === a) { + return"\r" + } + if("n" === a) { + return"\n" + } + if("\\" === a) { + return"\\" + } + if('"' === a) { + return'"' + } + if("b" === a) { + return"\b" + } + if("f" === a) { + return"\f" + } + new cljs.core.Keyword(null, "else", "else", 1017020587); + return null }; cljs.reader.read_2_chars = function(a) { - return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString(); + return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString() }; cljs.reader.read_4_chars = function(a) { - return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString(); + return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString() }; -cljs.reader.unicode_2_pattern = cljs.core.re_pattern.call(null, "^[0-9A-Fa-f]{2}$"); -cljs.reader.unicode_4_pattern = cljs.core.re_pattern.call(null, "^[0-9A-Fa-f]{4}$"); +cljs.reader.unicode_2_pattern = cljs.core.re_pattern.call(null, "[0-9A-Fa-f]{2}"); +cljs.reader.unicode_4_pattern = cljs.core.re_pattern.call(null, "[0-9A-Fa-f]{4}"); cljs.reader.validate_unicode_escape = function(a, b, c, d) { - return cljs.core.truth_(cljs.core.re_matches.call(null, a, d)) ? d : cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c, d); + return cljs.core.truth_(cljs.core.re_matches.call(null, a, d)) ? d : cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c, d) }; cljs.reader.make_unicode_char = function(a) { a = parseInt(a, 16); - return String.fromCharCode(a); + return String.fromCharCode(a) }; cljs.reader.escape_char = function(a, b) { var c = cljs.reader.read_char.call(null, b), d = cljs.reader.escape_char_map.call(null, c); - return cljs.core.truth_(d) ? d : "x" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_2_pattern, b, c, cljs.reader.read_2_chars.call(null, b))) : "u" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_4_pattern, b, c, cljs.reader.read_4_chars.call(null, b))) : cljs.reader.numeric_QMARK_.call(null, c) ? String.fromCharCode(c) : cljs.reader.reader_error.call(null, b, - "Unexpected unicode escape \\", c); + return cljs.core.truth_(d) ? d : "x" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_2_pattern, b, c, cljs.reader.read_2_chars.call(null, b))) : "u" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_4_pattern, b, c, cljs.reader.read_4_chars.call(null, b))) : cljs.reader.numeric_QMARK_.call(null, c) ? String.fromCharCode(c) : new cljs.core.Keyword(null, "else", "else", + 1017020587) ? cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c) : null }; cljs.reader.read_past = function(a, b) { - for (var c = cljs.reader.read_char.call(null, b);;) { - if (cljs.core.truth_(a.call(null, c))) { - c = cljs.reader.read_char.call(null, b); - } else { - return c; + for(var c = cljs.reader.read_char.call(null, b);;) { + if(cljs.core.truth_(a.call(null, c))) { + c = cljs.reader.read_char.call(null, b) + }else { + return c } } }; cljs.reader.read_delimited_list = function(a, b, c) { - for (var d = cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY);;) { + for(var d = cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY);;) { var e = cljs.reader.read_past.call(null, cljs.reader.whitespace_QMARK_, b); cljs.core.truth_(e) || cljs.reader.reader_error.call(null, b, "EOF while reading"); - if (a === e) { - return cljs.core.persistent_BANG_.call(null, d); + if(a === e) { + return cljs.core.persistent_BANG_.call(null, d) } var f = cljs.reader.macros.call(null, e); cljs.core.truth_(f) ? e = f.call(null, b, e) : (cljs.reader.unread.call(null, b, e), e = cljs.reader.read.call(null, b, !0, null, c)); - d = e === b ? d : cljs.core.conj_BANG_.call(null, d, e); + d = e === b ? d : cljs.core.conj_BANG_.call(null, d, e) } }; cljs.reader.not_implemented = function(a, b) { - return cljs.reader.reader_error.call(null, a, "Reader for ", b, " not implemented yet"); + return cljs.reader.reader_error.call(null, a, "Reader for ", b, " not implemented yet") }; cljs.reader.read_dispatch = function(a, b) { var c = cljs.reader.read_char.call(null, a), d = cljs.reader.dispatch_macros.call(null, c); - if (cljs.core.truth_(d)) { - return d.call(null, a, b); + if(cljs.core.truth_(d)) { + return d.call(null, a, b) } d = cljs.reader.maybe_read_tagged_type.call(null, a, c); - return cljs.core.truth_(d) ? d : cljs.reader.reader_error.call(null, a, "No dispatch macro for ", c); + return cljs.core.truth_(d) ? d : cljs.reader.reader_error.call(null, a, "No dispatch macro for ", c) }; cljs.reader.read_unmatched_delimiter = function(a, b) { - return cljs.reader.reader_error.call(null, a, "Unmatched delimiter ", b); + return cljs.reader.reader_error.call(null, a, "Unmached delimiter ", b) }; cljs.reader.read_list = function(a, b) { - return cljs.core.apply.call(null, cljs.core.list, cljs.reader.read_delimited_list.call(null, ")", a, !0)); + return cljs.core.apply.call(null, cljs.core.list, cljs.reader.read_delimited_list.call(null, ")", a, !0)) }; cljs.reader.read_comment = cljs.reader.skip_line; cljs.reader.read_vector = function(a, b) { - return cljs.reader.read_delimited_list.call(null, "]", a, !0); + return cljs.reader.read_delimited_list.call(null, "]", a, !0) }; cljs.reader.read_map = function(a, b) { var c = cljs.reader.read_delimited_list.call(null, "}", a, !0); cljs.core.odd_QMARK_.call(null, cljs.core.count.call(null, c)) && cljs.reader.reader_error.call(null, a, "Map literal must contain an even number of forms"); - return cljs.core.apply.call(null, cljs.core.hash_map, c); + return cljs.core.apply.call(null, cljs.core.hash_map, c) }; cljs.reader.read_number = function(a, b) { - for (var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { - if (cljs.core.truth_(function() { + for(var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { + if(cljs.core.truth_(function() { var a = null == d; - return a ? a : (a = cljs.reader.whitespace_QMARK_.call(null, d)) ? a : cljs.reader.macros.call(null, d); + return a ? a : (a = cljs.reader.whitespace_QMARK_.call(null, d)) ? a : cljs.reader.macros.call(null, d) }())) { cljs.reader.unread.call(null, a, d); var e = c.toString(), c = cljs.reader.match_number.call(null, e); - return cljs.core.truth_(c) ? c : cljs.reader.reader_error.call(null, a, "Invalid number format [", e, "]"); + return cljs.core.truth_(c) ? c : cljs.reader.reader_error.call(null, a, "Invalid number format [", e, "]") } c.append(d); - d = e = cljs.reader.read_char.call(null, a); + d = e = cljs.reader.read_char.call(null, a) } }; cljs.reader.read_string_STAR_ = function(a, b) { - for (var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { - if (null == d) { - return cljs.reader.reader_error.call(null, a, "EOF while reading"); - } - if ("\\" === d) { - c.append(cljs.reader.escape_char.call(null, c, a)); - } else { - if ('"' === d) { - return c.toString(); - } - c.append(d); + for(var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { + if(null == d) { + return cljs.reader.reader_error.call(null, a, "EOF while reading") } - d = cljs.reader.read_char.call(null, a); - } -}; -cljs.reader.read_raw_string_STAR_ = function(a, b) { - for (var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { - if (null == d) { - return cljs.reader.reader_error.call(null, a, "EOF while reading"); - } - if ("\\" === d) { - c.append(d); - var e = cljs.reader.read_char.call(null, a); - if (null == e) { - return cljs.reader.reader_error.call(null, a, "EOF while reading"); + if("\\" === d) { + c.append(cljs.reader.escape_char.call(null, c, a)), d = cljs.reader.read_char.call(null, a) + }else { + if('"' === d) { + return c.toString() } - var f = function() { - var a = c; - a.append(e); - return a; - }(), g = cljs.reader.read_char.call(null, a); - } else { - if ('"' === d) { - return c.toString(); + if(new cljs.core.Keyword(null, "default", "default", 2558708147)) { + c.append(d), d = cljs.reader.read_char.call(null, a) + }else { + return null } - f = function() { - var a = c; - a.append(d); - return a; - }(); - g = cljs.reader.read_char.call(null, a); } - c = f; - d = g; } }; cljs.reader.special_symbols = function(a, b) { - return "nil" === a ? null : "true" === a ? !0 : "false" === a ? !1 : "/" === a ? new cljs.core.Symbol(null, "/", "/", -1371932971, null) : b; + return"nil" === a ? null : "true" === a ? !0 : "false" === a ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null }; cljs.reader.read_symbol = function(a, b) { var c = cljs.reader.read_token.call(null, a, b); - return cljs.core.truth_(function() { - var a = goog.string.contains(c, "/"); - return cljs.core.truth_(a) ? 1 !== c.length : a; - }()) ? cljs.core.symbol.call(null, cljs.core.subs.call(null, c, 0, c.indexOf("/")), cljs.core.subs.call(null, c, c.indexOf("/") + 1, c.length)) : cljs.reader.special_symbols.call(null, c, cljs.core.symbol.call(null, c)); + return cljs.core.truth_(goog.string.contains(c, "/")) ? cljs.core.symbol.call(null, cljs.core.subs.call(null, c, 0, c.indexOf("/")), cljs.core.subs.call(null, c, c.indexOf("/") + 1, c.length)) : cljs.reader.special_symbols.call(null, c, cljs.core.symbol.call(null, c)) }; cljs.reader.read_keyword = function(a, b) { var c = cljs.reader.read_token.call(null, a, cljs.reader.read_char.call(null, a)), d = cljs.reader.re_matches_STAR_.call(null, cljs.reader.symbol_pattern, c), c = d[0], e = d[1], d = d[2]; - return void 0 !== e && ":/" === e.substring(e.length - 2, e.length) || ":" === d[d.length - 1] || -1 !== c.indexOf("::", 1) ? cljs.reader.reader_error.call(null, a, "Invalid token: ", c) : null != e && 0 < e.length ? cljs.core.keyword.call(null, e.substring(0, e.indexOf("/")), d) : cljs.core.keyword.call(null, c); + return void 0 !== e && ":/" === e.substring(e.length - 2, e.length) || ":" === d[d.length - 1] || -1 !== c.indexOf("::", 1) ? cljs.reader.reader_error.call(null, a, "Invalid token: ", c) : null != e && 0 < e.length ? cljs.core.keyword.call(null, e.substring(0, e.indexOf("/")), d) : cljs.core.keyword.call(null, c) }; cljs.reader.desugar_meta = function(a) { - return a instanceof cljs.core.Symbol ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", -1290361223), a], null) : "string" === typeof a ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", -1290361223), a], null) : a instanceof cljs.core.Keyword ? new cljs.core.PersistentArrayMap.fromArray([a, !0], !0, !1) : a; + return a instanceof cljs.core.Symbol ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : "string" === typeof a ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : a instanceof cljs.core.Keyword ? new cljs.core.PersistentArrayMap.fromArray([a, !0], !0, !1) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null }; cljs.reader.wrapping_reader = function(a) { return function(b, c) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.reader.read.call(null, b, !0, null, !0)), a); - }; + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.reader.read.call(null, b, !0, null, !0)), a) + } }; cljs.reader.throwing_reader = function(a) { return function(b, c) { - return cljs.reader.reader_error.call(null, b, a); - }; + return cljs.reader.reader_error.call(null, b, a) + } }; cljs.reader.read_meta = function(a, b) { var c = cljs.reader.desugar_meta.call(null, cljs.reader.read.call(null, a, !0, null, !0)); cljs.core.map_QMARK_.call(null, c) || cljs.reader.reader_error.call(null, a, "Metadata must be Symbol,Keyword,String or Map"); var d = cljs.reader.read.call(null, a, !0, null, !0); - return(d ? d.cljs$lang$protocol_mask$partition0$ & 262144 || d.cljs$core$IWithMeta$ || (d.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) ? cljs.core.with_meta.call(null, d, cljs.core.merge.call(null, cljs.core.meta.call(null, d), c)) : cljs.reader.reader_error.call(null, a, "Metadata can only be applied to IWithMetas"); + return(d ? d.cljs$lang$protocol_mask$partition0$ & 262144 || d.cljs$core$IWithMeta$ || (d.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) ? cljs.core.with_meta.call(null, d, cljs.core.merge.call(null, cljs.core.meta.call(null, d), c)) : cljs.reader.reader_error.call(null, a, "Metadata can only be applied to IWithMetas") }; cljs.reader.read_set = function(a, b) { - return cljs.core.set.call(null, cljs.reader.read_delimited_list.call(null, "}", a, !0)); + return cljs.core.set.call(null, cljs.reader.read_delimited_list.call(null, "}", a, !0)) }; cljs.reader.read_regex = function(a, b) { - return cljs.core.re_pattern.call(null, cljs.reader.read_raw_string_STAR_.call(null, a, b)); + return cljs.core.re_pattern.call(null, cljs.reader.read_string_STAR_.call(null, a, b)) }; cljs.reader.read_discard = function(a, b) { cljs.reader.read.call(null, a, !0, null, !0); - return a; + return a }; cljs.reader.macros = function(a) { - return'"' === a ? cljs.reader.read_string_STAR_ : ":" === a ? cljs.reader.read_keyword : ";" === a ? cljs.reader.read_comment : "'" === a ? cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "quote", "quote", 1377916282, null)) : "@" === a ? cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "deref", "deref", 1494944732, null)) : "^" === a ? cljs.reader.read_meta : "`" === a ? cljs.reader.not_implemented : "~" === a ? cljs.reader.not_implemented : "(" === a ? cljs.reader.read_list : - ")" === a ? cljs.reader.read_unmatched_delimiter : "[" === a ? cljs.reader.read_vector : "]" === a ? cljs.reader.read_unmatched_delimiter : "{" === a ? cljs.reader.read_map : "}" === a ? cljs.reader.read_unmatched_delimiter : "\\" === a ? cljs.reader.read_char : "#" === a ? cljs.reader.read_dispatch : null; + if('"' === a) { + return cljs.reader.read_string_STAR_ + } + if(":" === a) { + return cljs.reader.read_keyword + } + if(";" === a) { + return cljs.reader.read_comment + } + if("'" === a) { + return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null)) + } + if("@" === a) { + return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "deref", "deref", -1545057749, null)) + } + if("^" === a) { + return cljs.reader.read_meta + } + if("`" === a || "~" === a) { + return cljs.reader.not_implemented + } + if("(" === a) { + return cljs.reader.read_list + } + if(")" === a) { + return cljs.reader.read_unmatched_delimiter + } + if("[" === a) { + return cljs.reader.read_vector + } + if("]" === a) { + return cljs.reader.read_unmatched_delimiter + } + if("{" === a) { + return cljs.reader.read_map + } + if("}" === a) { + return cljs.reader.read_unmatched_delimiter + } + if("\\" === a) { + return cljs.reader.read_char + } + if("#" === a) { + return cljs.reader.read_dispatch + } + new cljs.core.Keyword(null, "else", "else", 1017020587); + return null }; cljs.reader.dispatch_macros = function(a) { - return "{" === a ? cljs.reader.read_set : "\x3c" === a ? cljs.reader.throwing_reader.call(null, "Unreadable form") : '"' === a ? cljs.reader.read_regex : "!" === a ? cljs.reader.read_comment : "_" === a ? cljs.reader.read_discard : null; + if("{" === a) { + return cljs.reader.read_set + } + if("\x3c" === a) { + return cljs.reader.throwing_reader.call(null, "Unreadable form") + } + if('"' === a) { + return cljs.reader.read_regex + } + if("!" === a) { + return cljs.reader.read_comment + } + if("_" === a) { + return cljs.reader.read_discard + } + new cljs.core.Keyword(null, "else", "else", 1017020587); + return null }; cljs.reader.read = function(a, b, c, d) { - for (;;) { + for(;;) { d = cljs.reader.read_char.call(null, a); - if (null == d) { - return cljs.core.truth_(b) ? cljs.reader.reader_error.call(null, a, "EOF while reading") : c; - } - if (!cljs.reader.whitespace_QMARK_.call(null, d)) { - if (cljs.reader.comment_prefix_QMARK_.call(null, d)) { - a = cljs.reader.read_comment.call(null, a, d); - } else { - var e = cljs.reader.macros.call(null, d); - d = cljs.core.truth_(e) ? e.call(null, a, d) : cljs.reader.number_literal_QMARK_.call(null, a, d) ? cljs.reader.read_number.call(null, a, d) : cljs.reader.read_symbol.call(null, a, d); - if (d !== a) { - return d; + if(null == d) { + return cljs.core.truth_(b) ? cljs.reader.reader_error.call(null, a, "EOF while reading") : c + } + if(!cljs.reader.whitespace_QMARK_.call(null, d)) { + if(cljs.reader.comment_prefix_QMARK_.call(null, d)) { + a = cljs.reader.read_comment.call(null, a, d) + }else { + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + var e = cljs.reader.macros.call(null, d); + d = cljs.core.truth_(e) ? e.call(null, a, d) : cljs.reader.number_literal_QMARK_.call(null, a, d) ? cljs.reader.read_number.call(null, a, d) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.read_symbol.call(null, a, d) : null; + if(d !== a) { + return d + } + }else { + return null } } } @@ -19909,218 +14209,134 @@ cljs.reader.read = function(a, b, c, d) { }; cljs.reader.read_string = function(a) { a = cljs.reader.push_back_reader.call(null, a); - return cljs.reader.read.call(null, a, !1, null, !1); + return cljs.reader.read.call(null, a, !0, null, !1) }; cljs.reader.zero_fill_right_and_truncate = function(a, b) { - if (cljs.core._EQ_.call(null, b, cljs.core.count.call(null, a))) { - return a; + if(cljs.core._EQ_.call(null, b, cljs.core.count.call(null, a))) { + return a } - if (b < cljs.core.count.call(null, a)) { - return cljs.core.subs.call(null, a, 0, b); + if(b < cljs.core.count.call(null, a)) { + return cljs.core.subs.call(null, a, 0, b) } - for (var c = new goog.string.StringBuffer(a);;) { - if (c.getLength() < b) { - c = c.append("0"); - } else { - return c.toString(); + if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + for(var c = new goog.string.StringBuffer(a);;) { + if(c.getLength() < b) { + c = c.append("0") + }else { + return c.toString() + } } + }else { + return null } }; cljs.reader.divisible_QMARK_ = function(a, b) { - return 0 === cljs.core.mod.call(null, a, b); + return 0 === cljs.core.mod.call(null, a, b) }; cljs.reader.indivisible_QMARK_ = function(a, b) { - return!cljs.reader.divisible_QMARK_.call(null, a, b); + return!cljs.reader.divisible_QMARK_.call(null, a, b) }; cljs.reader.leap_year_QMARK_ = function(a) { - return cljs.reader.divisible_QMARK_.call(null, a, 4) && (cljs.reader.indivisible_QMARK_.call(null, a, 100) || cljs.reader.divisible_QMARK_.call(null, a, 400)); + return cljs.reader.divisible_QMARK_.call(null, a, 4) && (cljs.reader.indivisible_QMARK_.call(null, a, 100) || cljs.reader.divisible_QMARK_.call(null, a, 400)) }; cljs.reader.days_in_month = function() { var a = new cljs.core.PersistentVector(null, 13, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], null), b = new cljs.core.PersistentVector(null, 13, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], null); - return function(a, b) { - return function(e, f) { - return cljs.core.get.call(null, cljs.core.truth_(f) ? b : a, e); - }; - }(a, b); + return function(c, d) { + return cljs.core.get.call(null, cljs.core.truth_(d) ? b : a, c) + } }(); cljs.reader.timestamp_regex = /(\d\d\d\d)(?:-(\d\d)(?:-(\d\d)(?:[T](\d\d)(?::(\d\d)(?::(\d\d)(?:[.](\d+))?)?)?)?)?)?(?:[Z]|([-+])(\d\d):(\d\d))?/; cljs.reader.parse_int = function(a) { - a = parseInt(a, 10); - return cljs.core.not.call(null, isNaN(a)) ? a : null; + a = parseInt(a); + return cljs.core.not.call(null, isNaN(a)) ? a : null }; cljs.reader.check = function(a, b, c, d) { a <= b && b <= c || cljs.reader.reader_error.call(null, null, [cljs.core.str(d), cljs.core.str(" Failed: "), cljs.core.str(a), cljs.core.str("\x3c\x3d"), cljs.core.str(b), cljs.core.str("\x3c\x3d"), cljs.core.str(c)].join("")); - return b; + return b }; cljs.reader.parse_and_validate_timestamp = function(a) { var b = cljs.core.re_matches.call(null, cljs.reader.timestamp_regex, a); cljs.core.nth.call(null, b, 0, null); var c = cljs.core.nth.call(null, b, 1, null), d = cljs.core.nth.call(null, b, 2, null), e = cljs.core.nth.call(null, b, 3, null), f = cljs.core.nth.call(null, b, 4, null), g = cljs.core.nth.call(null, b, 5, null), h = cljs.core.nth.call(null, b, 6, null), k = cljs.core.nth.call(null, b, 7, null), l = cljs.core.nth.call(null, b, 8, null), m = cljs.core.nth.call(null, b, 9, null), n = cljs.core.nth.call(null, b, 10, null); - if (cljs.core.not.call(null, b)) { - return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")); + if(cljs.core.not.call(null, b)) { + return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")) } a = cljs.reader.parse_int.call(null, c); var b = function() { var a = cljs.reader.parse_int.call(null, d); - return cljs.core.truth_(a) ? a : 1; + return cljs.core.truth_(a) ? a : 1 }(), c = function() { var a = cljs.reader.parse_int.call(null, e); - return cljs.core.truth_(a) ? a : 1; + return cljs.core.truth_(a) ? a : 1 }(), p = function() { var a = cljs.reader.parse_int.call(null, f); - return cljs.core.truth_(a) ? a : 0; + return cljs.core.truth_(a) ? a : 0 }(), q = function() { var a = cljs.reader.parse_int.call(null, g); - return cljs.core.truth_(a) ? a : 0; + return cljs.core.truth_(a) ? a : 0 }(), r = function() { var a = cljs.reader.parse_int.call(null, h); - return cljs.core.truth_(a) ? a : 0; + return cljs.core.truth_(a) ? a : 0 }(), s = function() { var a = cljs.reader.parse_int.call(null, cljs.reader.zero_fill_right_and_truncate.call(null, k, 3)); - return cljs.core.truth_(a) ? a : 0; + return cljs.core.truth_(a) ? a : 0 }(), l = cljs.core._EQ_.call(null, l, "-") ? -1 : 1, t = function() { var a = cljs.reader.parse_int.call(null, m); - return cljs.core.truth_(a) ? a : 0; - }(), u = function() { + return cljs.core.truth_(a) ? a : 0 + }(), v = function() { var a = cljs.reader.parse_int.call(null, n); - return cljs.core.truth_(a) ? a : 0; - }(), l = l * (60 * t + u); + return cljs.core.truth_(a) ? a : 0 + }(), l = l * (60 * t + v); return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, cljs.reader.check.call(null, 1, b, 12, "timestamp month field must be in range 1..12"), cljs.reader.check.call(null, 1, c, cljs.reader.days_in_month.call(null, b, cljs.reader.leap_year_QMARK_.call(null, a)), "timestamp day field must be in range 1..last day in month"), cljs.reader.check.call(null, 0, p, 23, "timestamp hour field must be in range 0..23"), cljs.reader.check.call(null, 0, q, 59, "timestamp minute field must be in range 0..59"), - cljs.reader.check.call(null, 0, r, cljs.core._EQ_.call(null, q, 59) ? 60 : 59, "timestamp second field must be in range 0..60"), cljs.reader.check.call(null, 0, s, 999, "timestamp millisecond field must be in range 0..999"), l], null); + cljs.reader.check.call(null, 0, r, cljs.core._EQ_.call(null, q, 59) ? 60 : 59, "timestamp second field must be in range 0..60"), cljs.reader.check.call(null, 0, s, 999, "timestamp millisecond field must be in range 0..999"), l], null) }; cljs.reader.parse_timestamp = function(a) { var b = cljs.reader.parse_and_validate_timestamp.call(null, a); - if (cljs.core.truth_(b)) { + if(cljs.core.truth_(b)) { a = cljs.core.nth.call(null, b, 0, null); var c = cljs.core.nth.call(null, b, 1, null), d = cljs.core.nth.call(null, b, 2, null), e = cljs.core.nth.call(null, b, 3, null), f = cljs.core.nth.call(null, b, 4, null), g = cljs.core.nth.call(null, b, 5, null), h = cljs.core.nth.call(null, b, 6, null), b = cljs.core.nth.call(null, b, 7, null); - return new Date(Date.UTC(a, c - 1, d, e, f, g, h) - 6E4 * b); + return new Date(Date.UTC(a, c - 1, d, e, f, g, h) - 6E4 * b) } - return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")); + return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")) }; cljs.reader.read_date = function(a) { - return "string" === typeof a ? cljs.reader.parse_timestamp.call(null, a) : cljs.reader.reader_error.call(null, null, "Instance literal expects a string for its timestamp."); + return"string" === typeof a ? cljs.reader.parse_timestamp.call(null, a) : cljs.reader.reader_error.call(null, null, "Instance literal expects a string for its timestamp.") }; cljs.reader.read_queue = function(a) { - return cljs.core.vector_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentQueue.EMPTY, a) : cljs.reader.reader_error.call(null, null, "Queue literal expects a vector for its elements."); -}; -cljs.reader.read_js = function(a) { - if (cljs.core.vector_QMARK_.call(null, a)) { - var b = []; - a = cljs.core.seq.call(null, a); - for (var c = null, d = 0, e = 0;;) { - if (e < d) { - var f = cljs.core._nth.call(null, c, e); - b.push(f); - e += 1; - } else { - if (a = cljs.core.seq.call(null, a)) { - c = a, cljs.core.chunked_seq_QMARK_.call(null, c) ? (a = cljs.core.chunk_first.call(null, c), e = cljs.core.chunk_rest.call(null, c), c = a, d = cljs.core.count.call(null, a), a = e) : (a = cljs.core.first.call(null, c), b.push(a), a = cljs.core.next.call(null, c), c = null, d = 0), e = 0; - } else { - break; - } - } - } - return b; - } - if (cljs.core.map_QMARK_.call(null, a)) { - b = {}; - a = cljs.core.seq.call(null, a); - c = null; - for (e = d = 0;;) { - if (e < d) { - var g = cljs.core._nth.call(null, c, e), f = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); - b[cljs.core.name.call(null, f)] = g; - e += 1; - } else { - if (a = cljs.core.seq.call(null, a)) { - cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), c = d, d = cljs.core.count.call(null, d)) : (d = cljs.core.first.call(null, a), c = cljs.core.nth.call(null, d, 0, null), d = cljs.core.nth.call(null, d, 1, null), b[cljs.core.name.call(null, c)] = d, a = cljs.core.next.call(null, a), c = null, d = 0), e = 0; - } else { - break; - } - } - } - return b; - } - return cljs.reader.reader_error.call(null, null, [cljs.core.str("JS literal expects a vector or map containing "), cljs.core.str("only string or unqualified keyword keys")].join("")); + return cljs.core.vector_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentQueue.EMPTY, a) : cljs.reader.reader_error.call(null, null, "Queue literal expects a vector for its elements.") }; cljs.reader.read_uuid = function(a) { - return "string" === typeof a ? new cljs.core.UUID(a) : cljs.reader.reader_error.call(null, null, "UUID literal expects a string as its representation."); + return"string" === typeof a ? new cljs.core.UUID(a) : cljs.reader.reader_error.call(null, null, "UUID literal expects a string as its representation.") }; -cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null, new cljs.core.PersistentArrayMap(null, 4, ["inst", cljs.reader.read_date, "uuid", cljs.reader.read_uuid, "queue", cljs.reader.read_queue, "js", cljs.reader.read_js], null)); +cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null, new cljs.core.PersistentArrayMap(null, 3, ["inst", cljs.reader.read_date, "uuid", cljs.reader.read_uuid, "queue", cljs.reader.read_queue], null)); cljs.reader._STAR_default_data_reader_fn_STAR_ = cljs.core.atom.call(null, null); cljs.reader.maybe_read_tagged_type = function(a, b) { var c = cljs.reader.read_symbol.call(null, a, b), d = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), "" + cljs.core.str(c)), e = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); - return cljs.core.truth_(d) ? d.call(null, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.core.truth_(e) ? e.call(null, c, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.reader.reader_error.call(null, a, "Could not find tag parser for ", "" + cljs.core.str(c), " in ", cljs.core.pr_str.call(null, cljs.core.keys.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_)))); + return cljs.core.truth_(d) ? d.call(null, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.core.truth_(e) ? e.call(null, c, cljs.reader.read.call(null, a, !0, null, !1)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.reader_error.call(null, a, "Could not find tag parser for ", "" + cljs.core.str(c), " in ", cljs.core.pr_str.call(null, cljs.core.keys.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_)))) : null }; cljs.reader.register_tag_parser_BANG_ = function(a, b) { var c = "" + cljs.core.str(a), d = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), c); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_tag_table_STAR_, cljs.core.assoc, c, b); - return d; + return d }; cljs.reader.deregister_tag_parser_BANG_ = function(a) { a = "" + cljs.core.str(a); var b = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), a); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_tag_table_STAR_, cljs.core.dissoc, a); - return b; + return b }; cljs.reader.register_default_tag_parser_BANG_ = function(a) { var b = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_, function(b) { - return function(b) { - return a; - }; - }(b)); - return b; + return a + }); + return b }; cljs.reader.deregister_default_tag_parser_BANG_ = function() { var a = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_, function(a) { - return function(a) { - return null; - }; - }(a)); - return a; -}; -clojure.walk = {}; -clojure.walk.walk = function(a, b, c) { - return cljs.core.seq_QMARK_.call(null, c) ? b.call(null, cljs.core.doall.call(null, cljs.core.map.call(null, a, c))) : cljs.core.coll_QMARK_.call(null, c) ? b.call(null, cljs.core.into.call(null, cljs.core.empty.call(null, c), cljs.core.map.call(null, a, c))) : b.call(null, c); -}; -clojure.walk.postwalk = function postwalk(b, c) { - return clojure.walk.walk.call(null, cljs.core.partial.call(null, postwalk, b), b, c); -}; -clojure.walk.prewalk = function prewalk(b, c) { - return clojure.walk.walk.call(null, cljs.core.partial.call(null, prewalk, b), cljs.core.identity, b.call(null, c)); -}; -clojure.walk.keywordize_keys = function(a) { - return clojure.walk.postwalk.call(null, function(a) { - return function(c) { - return cljs.core.map_QMARK_.call(null, c) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, a, c)) : c; - }; - }(function(a) { - var c = cljs.core.nth.call(null, a, 0, null); - a = cljs.core.nth.call(null, a, 1, null); - return "string" === typeof c ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, c), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [c, a], null); - }), a); -}; -clojure.walk.stringify_keys = function(a) { - return clojure.walk.postwalk.call(null, function(a) { - return function(c) { - return cljs.core.map_QMARK_.call(null, c) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, a, c)) : c; - }; - }(function(a) { - var c = cljs.core.nth.call(null, a, 0, null); - a = cljs.core.nth.call(null, a, 1, null); - return c instanceof cljs.core.Keyword ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name.call(null, c), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [c, a], null); - }), a); -}; -clojure.walk.prewalk_replace = function(a, b) { - return clojure.walk.prewalk.call(null, function(b) { - return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b; - }, b); -}; -clojure.walk.postwalk_replace = function(a, b) { - return clojure.walk.postwalk.call(null, function(b) { - return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b; - }, b); + return null + }); + return a }; var cljsdeps = {core:{}}; diff --git a/project.clj b/project.clj index 6144df586..c26d20147 100644 --- a/project.clj +++ b/project.clj @@ -1,10 +1,10 @@ (defproject lighttable "0.8.0" :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." :url "http://www.lighttable.com/" - :dependencies [[org.clojure/clojure "1.6.0"] + :dependencies [[org.clojure/clojure "1.5.1"] [crate "0.2.5"] - [fetch "0.2.2" :exclusions [org.clojure/clojure noir]] - [org.clojure/clojurescript "0.0-2913" + [fetch "0.2.0" :exclusions [org.clojure/clojure noir]] + [org.clojure/clojurescript "0.0-2138" :exclusions [org.apache.ant/ant]] ] :jvm-opts ["-Xmx1g" "-XX:+UseConcMarkSweepGC"] ; cljsbuild eats memory @@ -15,6 +15,6 @@ :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}}]} - :plugins [[lein-cljsbuild "1.0.5"]] + :plugins [[lein-cljsbuild "1.0.1"]] :source-paths ["src/"] ) diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 8184568e4..a3ba7ed92 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.21.3", + version: "0.21.2", outputDir: "./atom-shell", rebuild: true } diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index ae4b74dfd..6f9b27ca7 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -235,12 +235,7 @@ (.addEventListener frame "contextmenu" (fn [e] (object/raise this :menu! e))) (.addEventListener frame "did-finish-load" (fn [] - (let [loc (.getUrl frame) - ;; there's a bug in atom-shell where webviews pointed at file:// urls don't - ;; correctly return their location - loc (if (= "about:blank" loc) - (.-src frame) - loc)] + (let [loc (.getUrl frame)] (devtools/clear-scripts! (:devtools-client @this)) (dom/val bar loc) (object/raise this :navigate loc)) @@ -255,8 +250,7 @@ :triggers #{:navigate} :reaction (fn [this loc] (let [title (.getTitle (to-frame this)) - title (if (and (not (empty? title)) - (not= title "about:blank")) + title (if-not (empty? title) title "browser")] (object/merge! this {:name title}) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index e8276ada8..6cd5c48c7 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -437,7 +437,7 @@ ;;********************************************************* -(behavior ::read-only-nocursor +(behavior ::read-only :triggers #{:init} :reaction (fn [obj] (set-options (:ed @obj) {:readOnly "nocursor"}))) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 10d981cdc..5896d80f5 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -15,7 +15,6 @@ [lt.objs.console :as console] [lt.util.dom :as dom] [clojure.string :as string] - [cljs.reader :as reader] [lt.objs.platform :as platform]) (:require-macros [lt.macros :refer [behavior defui]])) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 6fad06900..4c184507b 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -1,6 +1,5 @@ (ns lt.objs.langs.behaviors (:require [lt.object :as object] - [lt.objs.thread :as thread] [lt.objs.context :as ctx] [lt.objs.command :as cmd] [lt.util.dom :as dom] diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 61f63e49f..7de9fbc45 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -214,7 +214,7 @@ cache)) (defn save-cache [cache] - (files/save metadata-cache (js/JSON.stringify (clj->js cache)))) + (files/save metadata-cache (JSON/stringify (clj->js cache)))) (defn latest-metadata-sha [] (fetch/xhr [:get metadata-commits] {} @@ -250,7 +250,7 @@ (if (files/exists? metadata-cache) (-> (files/open-sync metadata-cache) (:content) - (js/JSON.parse) + (JSON/parse) (js->clj :keywordize-keys true)))) (defn search-plugins [plugins search] diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index 719640252..f16a73d39 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -1,6 +1,5 @@ (ns lt.objs.sidebar.navigate (:require [lt.object :as object] - [lt.objs.thread :as thread] [lt.objs.workspace :as workspace] [lt.objs.context :as ctx] [lt.objs.sidebar.command :as cmd] diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index a024cd352..382002e1f 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -8,6 +8,8 @@ (def ^:dynamic *force-reload* false) +(def fpath (js/require "path")) + (def separator (.-sep fpath)) (defn absolute? [path] From 96d244762894333ad0effbd78060d99231a0e260 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 21 Mar 2015 11:17:25 -0700 Subject: [PATCH 453/656] latest atom-shell fixes file:// url issues in webviews, when you move a browser tab it needs to reconncet to devtools, and we need to let people know about moves Signed-off-by: Chris Granger --- deploy/settings/default/default.behaviors | 1 + shell/Gruntfile.js | 2 +- src/lt/objs/browser.cljs | 8 ++++++++ src/lt/objs/editor.cljs | 2 +- src/lt/objs/tabs.cljs | 6 ++++-- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 76f835cc2..950d402ae 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -111,6 +111,7 @@ [:browser :lt.objs.browser/active-context] [:browser :lt.objs.browser/inactive-context] [:browser :lt.objs.browser/update-devtools-client-url] + [:browser :lt.objs.browser/reconnect-on-move] [:browser :lt.objs.menu/menu!] [:browser :lt.objs.browser/menu+] [:browser :lt.objs.browser/back!] diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index a3ba7ed92..3b7fe2dd5 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-atom-shell": { - version: "0.21.2", + version: "0.22.1", outputDir: "./atom-shell", rebuild: true } diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 6f9b27ca7..cd3680018 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -126,6 +126,14 @@ ;; Behaviors ;;********************************************************* +(behavior ::reconnect-on-move + :triggers #{:move} + :reaction (fn [this] + ;;When the tab is moved the webview is destroyed and recreated + ;;this causes devtools connections to die, so we have to + ;;tell it to reconnect + (object/raise (:devtools-client @this) :reconnect!))) + (behavior ::destroy-on-close :triggers #{:close} :reaction (fn [this] diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 6cd5c48c7..17b73f77f 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -689,7 +689,7 @@ (load/css "node_modules/codemirror/addon/fold/foldgutter.css") (load/js "core/node_modules/codemirror/keymap/sublime.js" :sync) (doseq [path (files/filter-walk #(and (= (files/ext %) "js") - (not (some (fn [m] (.contains % (str "core/node_modules/codemirror/mode/" m "/"))) + (not (some (fn [m] (> (.indexOf % (str "core/node_modules/codemirror/mode/" m "/")) -1)) mode-blacklist)) ;; Remove test files (not (.endsWith % "test.js"))) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index def841d14..53b8e074d 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -324,7 +324,8 @@ (defn move-tab-to-tabset [obj ts] (rem! obj) (add! obj ts) - (active! obj)) + (active! obj) + (object/raise obj :move)) (defn move-tab [multi elem] (let [id (dom/attr elem :obj-id) @@ -335,7 +336,8 @@ (add! obj multi) (if (> cnt 0) (update-tab-order multi (vec (concat (range idx) [cnt] (range idx cnt))))) - (active! obj))) + (active! obj) + (object/raise obj :move))) ;;********************************************************* ;; Behaviors From 5def92ddbce5264817e877c75c0b1d208d91761f Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 21 Mar 2015 11:37:49 -0700 Subject: [PATCH 454/656] fix javascript evaling the whole file everytime Signed-off-by: Chris Granger --- src/lt/objs/browser.cljs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index cd3680018..00da4fa3c 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -367,23 +367,24 @@ (handle-cb (:cb msg) :editor.eval.js.exception result))))) (object/raise this :editor.eval.js.change-live! msg))) -(defn must-eval-file? [msg] +(defn must-eval-file? [devtools msg] ;;we eval the whole file if there's no meta, or this file isn't loaded in the current page (when (-> msg :data :path) (or (not (-> msg :data :meta)) - (not (devtools/find-script devtools/local (-> msg :data :path)))))) + (not (devtools/find-script devtools (-> msg :data :path)))))) (behavior ::js-eval :triggers #{:editor.eval.js!} :reaction (fn [this msg] - (if (must-eval-file? msg) - (when-let [ed (object/by-id (:cb msg))] - (let [data (:data msg) - data (assoc data :code (str (editor/->val ed) "\n\n//# sourceURL=" (-> data :path)))] - (devtools/eval-in-webview-client (client->devtools this) data (fn [res] - (eval-js-form this msg))))) - (eval-js-form this msg)))) + (let [devtools (client->devtools this)] + (if (must-eval-file? devtools msg) + (when-let [ed (object/by-id (:cb msg))] + (let [data (:data msg) + data (assoc data :code (str (editor/->val ed) "\n\n//# sourceURL=" (-> data :path)))] + (devtools/eval-in-webview-client (client->devtools this) data (fn [res] + (eval-js-form this msg))))) + (eval-js-form this msg))))) ;;********************************************************* ;; Commands From f76f7cd1210b963933e262fdba0c3a83edd4efea Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Sat, 21 Mar 2015 12:44:55 -0700 Subject: [PATCH 455/656] add focus event, prevent navigation when files are dropped Signed-off-by: Chris Granger --- deploy/core/main.js | 11 +++++++++++ src/lt/objs/opener.cljs | 7 +------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index c0ed0d81b..f33de1ae5 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -20,16 +20,27 @@ function createWindow() { var window = new BrowserWindow(browserWindowOptions); windows[window.id] = window; window.focus(); + window.webContents.on("will-navigate", function(e) { + e.preventDefault(); + window.webContents.send("app", "will-navigate"); + }); if (process.platform == 'win32') { window.on("blur", function() { if (window.webContents) window.webContents.send("app", "blur"); }); + window.on("focus", function() { + if (window.webContents) + window.webContents.send("app", "focus"); + }); } else { window.on("blur", function() { window.webContents.send("app", "blur"); }); + window.on("focus", function() { + window.webContents.send("app", "focus"); + }); } window.on("devtools-opened", function() { window.webContents.send("devtools", "disconnect"); diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index d7314c012..ceb7503ec 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -254,10 +254,6 @@ (let [ed (pool/last-active)] (open-linked-path ed opener (get-in @ed [:info :path]) {})))}) -(set! js/window.ondragover (fn [e] - (set! (.-dataTransfer.dropEffect e) "move") - (dom/prevent e) - false)) (set! js/window.ondrop (fn [e] (try @@ -270,5 +266,4 @@ (recur (inc i))))) (catch js/Error e (println e))) - (dom/prevent e) - false)) + )) From 8e731c5b0d8d20ced051736c4b59cd0a67be3dff Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 23 Mar 2015 12:48:37 -0700 Subject: [PATCH 456/656] fix css eval in browser Signed-off-by: Chris Granger --- deploy/core/node_modules/lighttable/browserInjection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/core/node_modules/lighttable/browserInjection.js b/deploy/core/node_modules/lighttable/browserInjection.js index 8a831ae91..44d5b0a20 100644 --- a/deploy/core/node_modules/lighttable/browserInjection.js +++ b/deploy/core/node_modules/lighttable/browserInjection.js @@ -25,7 +25,7 @@ return cur.href.indexOf(args.name) > -1; }); if(link[0]) { - link[0].parentNode.removeChild(link); + link[0].parentNode.removeChild(link[0]); } } document.head.appendChild(styleElem); @@ -107,4 +107,4 @@ } -})(window); \ No newline at end of file +})(window); From 3c5cc302a46aca94ec34bdfa5e21be8059c69f84 Mon Sep 17 00:00:00 2001 From: Chris Granger Date: Mon, 23 Mar 2015 13:01:42 -0700 Subject: [PATCH 457/656] fix removing old css injections Signed-off-by: Chris Granger --- deploy/core/node_modules/lighttable/browserInjection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/node_modules/lighttable/browserInjection.js b/deploy/core/node_modules/lighttable/browserInjection.js index 44d5b0a20..78a629516 100644 --- a/deploy/core/node_modules/lighttable/browserInjection.js +++ b/deploy/core/node_modules/lighttable/browserInjection.js @@ -17,7 +17,7 @@ styleElem.type = "text/css" styleElem.id = nodeName; styleElem.innerHTML = code; - var prev = document.querySelector(nodeName); + var prev = document.getElementById(nodeName); if(prev) { prev.parentNode.removeChild(prev); } else { From 3e270f73cc8bb16e28dd80e3b59c107ef816f051 Mon Sep 17 00:00:00 2001 From: Martin Zapata Date: Thu, 23 Apr 2015 02:10:58 -0300 Subject: [PATCH 458/656] Update build scripts for atom-shell name change to electron Github has changed the name of atom-shell to electron as per https://github.com/atom/electron/pull/1389 --- script/build.sh | 2 +- shell/Gruntfile.js | 4 ++-- shell/package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/script/build.sh b/script/build.sh index 526402a45..600166c80 100755 --- a/script/build.sh +++ b/script/build.sh @@ -22,7 +22,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. pushd shell npm install grunt-cli npm install - node_modules/.bin/grunt download-atom-shell + node_modules/.bin/grunt download-electron popd # Build the core cljs diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 3b7fe2dd5..709977907 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -3,13 +3,13 @@ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), - "download-atom-shell": { + "download-electron": { version: "0.22.1", outputDir: "./atom-shell", rebuild: true } }); - grunt.loadNpmTasks('grunt-download-atom-shell'); + grunt.loadNpmTasks('grunt-download-electron'); }; diff --git a/shell/package.json b/shell/package.json index ec0e3f28c..5109e1bff 100644 --- a/shell/package.json +++ b/shell/package.json @@ -1,8 +1,8 @@ { - "name": "download-atom-shell", + "name": "download-electron", "version": "0.1.0", "devDependencies": { "grunt": "^0.4.5", - "grunt-download-atom-shell": "^0.10.0" + "grunt-download-electron": "^2.0.0" } } From 682b1da5cb9163a2b120cb416ef156e8703e852d Mon Sep 17 00:00:00 2001 From: Martin Zapata Date: Thu, 23 Apr 2015 12:57:46 -0300 Subject: [PATCH 459/656] Realised there were other references to atom-shell to update It seems though that the download-electron grunt task seems to create an Atom.app package. Was expecting it to be Electron.app and raised an issue for them here https://github.com/atom/grunt-download-electron/issues/30 NOTE: I haven't tested this on Linux or Windows --- script/build-app.sh | 13 ++++++++----- script/build.sh | 2 +- script/light.sh | 6 +++--- shell/.gitignore | 4 ++-- shell/Gruntfile.js | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 8cc0eea85..9477e4ae2 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -1,19 +1,22 @@ #!/usr/bin/env bash set -e -# Create LightTable release using our local Atom Shell installation +# Create LightTable release using our local Electron installation # (Mac, Linux, or Cygwin) # Ensure we start in project root cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. #---------------------------------------------------------------------- -# Get OS-specific Atom details +# Get OS-specific Electron details #---------------------------------------------------------------------- -ATOM_DIR="shell/atom-shell" +ELECTRON_DIR="shell/electron" # from: http://stackoverflow.com/a/17072017/142317 +# The download-electron tasks seems to still create an Atom.app executable +# so we'll have to reference that until they change it to Electron.app +# https://github.com/atom/grunt-download-electron/issues/30 if [ "$(uname)" == "Darwin" ]; then OS="mac" EXE="Atom.app/Contents/MacOS/Atom" @@ -56,12 +59,12 @@ RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" rm -rf $RELEASE_DIR $RELEASE_TARBALL #---------------------------------------------------------------------- -# Copy Atom installation and app directory into output location +# Copy Electron installation and app directory into output location #---------------------------------------------------------------------- echo "Creating $RELEASE_DIR ..." mkdir -p $RELEASE_DIR -cp -R $ATOM_DIR/* $RELEASE_DIR +cp -R $ELECTRON_DIR/* $RELEASE_DIR rm -f $RELEASE_DIR/version cp LICENSE.md $RELEASE_DIR/LICENSE diff --git a/script/build.sh b/script/build.sh index 600166c80..738626257 100755 --- a/script/build.sh +++ b/script/build.sh @@ -18,7 +18,7 @@ npm --version >/dev/null 2>&1 || { echo >&2 "Please install npm before running t # Ensure we start in project root cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. -# Ensure we have current version of atom-shell +# Ensure we have current version of electron pushd shell npm install grunt-cli npm install diff --git a/script/light.sh b/script/light.sh index c88c6eac0..67e1b87af 100755 --- a/script/light.sh +++ b/script/light.sh @@ -9,11 +9,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. DIR=$(pwd) if [ "$(uname)" == "Darwin" ]; then - CLI="${DIR}/shell/atom-shell/Atom.app/Contents/MacOS/Atom" + CLI="${DIR}/shell/electron/Atom.app/Contents/MacOS/Atom" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - CLI="${DIR}/shell/atom-shell/atom" + CLI="${DIR}/shell/electron/atom" elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then - CLI="${DIR}/shell/atom-shell/atom.exe" + CLI="${DIR}/shell/electron/atom.exe" else echo "Cannot detect a supported OS." exit 1 diff --git a/shell/.gitignore b/shell/.gitignore index 9444c6ce9..b90c01c16 100644 --- a/shell/.gitignore +++ b/shell/.gitignore @@ -1,2 +1,2 @@ -atom-shell -node_modules \ No newline at end of file +electron +node_modules diff --git a/shell/Gruntfile.js b/shell/Gruntfile.js index 709977907..3263bb31c 100644 --- a/shell/Gruntfile.js +++ b/shell/Gruntfile.js @@ -5,7 +5,7 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), "download-electron": { version: "0.22.1", - outputDir: "./atom-shell", + outputDir: "./electron", rebuild: true } }); From 4c2ce481bcafb1c711802c9b22cba85da9d9ffb9 Mon Sep 17 00:00:00 2001 From: Martin Zapata Date: Thu, 23 Apr 2015 14:05:38 -0300 Subject: [PATCH 460/656] Updated comment for future reference --- script/build-app.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 9477e4ae2..86ab8fef0 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -14,9 +14,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. ELECTRON_DIR="shell/electron" # from: http://stackoverflow.com/a/17072017/142317 -# The download-electron tasks seems to still create an Atom.app executable -# so we'll have to reference that until they change it to Electron.app -# https://github.com/atom/grunt-download-electron/issues/30 +# Will need to change Atom.app/atom/atom.exe to Electron.app/exe once we move to ^0.24.0 https://github.com/atom/grunt-download-electron/issues/30 if [ "$(uname)" == "Darwin" ]; then OS="mac" EXE="Atom.app/Contents/MacOS/Atom" From faf21eb7c3524c4a37ba8fd3e765be6dad1fa588 Mon Sep 17 00:00:00 2001 From: mira Date: Fri, 1 May 2015 20:42:50 -0700 Subject: [PATCH 461/656] Update Linux refs in build scripts for atom-shell name change --- script/build-app.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 86ab8fef0..b4f60c67c 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -24,13 +24,13 @@ if [ "$(uname)" == "Darwin" ]; then elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then OS="linux" - EXE="atom" + EXE="electron" RESOURCES="resources" PLATFORM_DIR="platform/linux" elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then OS="windows" - EXE="atom.exe" + EXE="electron.exe" RESOURCES="resources" PLATFORM_DIR="platform/win" @@ -85,7 +85,7 @@ if [ "$OS" == "mac" ]; then FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" defaults write $FULL_PLIST CFBundleShortVersionString $VERSION - mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app + mv $RELEASE_DIR/Electron.app $RELEASE_DIR/LightTable.app # Sign app to avoid endless “accept incoming connections” dialogs codesign --force --deep --sign - $RELEASE_DIR/LightTable.app From b468d5d859655cab4d40adbf10547630c2faa607 Mon Sep 17 00:00:00 2001 From: kenny-evitt Date: Sun, 14 Jun 2015 16:35:06 -0400 Subject: [PATCH 462/656] Add some sub-sections and add setup steps for Windows. --- doc/developer-install.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/developer-install.md b/doc/developer-install.md index 2ed38be07..e40041b7f 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -1,5 +1,7 @@ # Initial setup +## Install Leiningen and Node.js + First install or update [leiningen](http://leiningen.org/). 1. Download the lein script. For Windows, download lein.bat. @@ -12,6 +14,28 @@ You can also install it with your package manager but be sure to get version Then install [node and npm](http://nodejs.org/download/). +## Cygwin on Windows + +On Windows (Cygwin), you may need to change */etc/fstab* to fix a directory permission error when building: + +> ... change the following line in */etc/fstab* (path in Cygwin): +> +> ``` +> none /cygdrive cygdrive binary,posix=0,user 0 0 +> ``` +> +> Add `,noacl` to the line to result in: +> +> ``` +> none /cygdrive cygdrive binary,posix=0,user,noacl 0 0 +> ``` +> +> ... [close and re-open] Cygwin Terminal + +The issue: + + - ["mkdir: cannot create directory" error running "atom-shell" branch build on Windows 7 · Issue #1918 · LightTable/LightTable](https://github.com/LightTable/LightTable/issues/1918) + # Build To build LightTable from scratch on OSX, Windows Cygwin or Linux: From 7d53886c47d704d4f59d2c1db0093fd643b89fa4 Mon Sep 17 00:00:00 2001 From: kenny-evitt Date: Sun, 14 Jun 2015 16:37:51 -0400 Subject: [PATCH 463/656] Cleanup some text --- doc/developer-install.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index e40041b7f..ac85298d2 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -16,21 +16,19 @@ Then install [node and npm](http://nodejs.org/download/). ## Cygwin on Windows -On Windows (Cygwin), you may need to change */etc/fstab* to fix a directory permission error when building: - -> ... change the following line in */etc/fstab* (path in Cygwin): -> -> ``` -> none /cygdrive cygdrive binary,posix=0,user 0 0 -> ``` -> -> Add `,noacl` to the line to result in: -> -> ``` -> none /cygdrive cygdrive binary,posix=0,user,noacl 0 0 -> ``` -> -> ... [close and re-open] Cygwin Terminal +On Windows (Cygwin), you may need to change */etc/fstab* (path in Cygwin) to fix a directory permission error when building. Change this line: + +``` +none /cygdrive cygdrive binary,posix=0,user 0 0 +``` + +Add `,noacl` to the line: + +``` +none /cygdrive cygdrive binary,posix=0,user,noacl 0 0 +``` + +Close and re-open Cygwin Terminal. The issue: From 16958b37cfa2a3e772443f37ab40a89a3bf0fcff Mon Sep 17 00:00:00 2001 From: rundis Date: Tue, 16 Jun 2015 07:00:33 +0200 Subject: [PATCH 464/656] Fix buildscript for mac app still called Atom.app not Electron.app --- script/build-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build-app.sh b/script/build-app.sh index b4f60c67c..80597e1dd 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -85,7 +85,7 @@ if [ "$OS" == "mac" ]; then FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" defaults write $FULL_PLIST CFBundleShortVersionString $VERSION - mv $RELEASE_DIR/Electron.app $RELEASE_DIR/LightTable.app + mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app # Sign app to avoid endless “accept incoming connections” dialogs codesign --force --deep --sign - $RELEASE_DIR/LightTable.app From 29fe31c20bf505271c6457640aca23c9764d9b75 Mon Sep 17 00:00:00 2001 From: Dadie Date: Wed, 17 Jun 2015 22:25:51 +0200 Subject: [PATCH 465/656] Fix: Add missing $ in \\.jar so that only files that end with .jar are ignored Fix: Add missing $ in \\.swp so that only files that end with .swp are ignored Fix: Add missing $ in \\.pyc so that only files that end with .pyc are ignored Fix: Add ^ to target/, so that only the target directory would be ignored Removed file.ignore-pattern \\.git, \\.DS_Store, and \\.nrepl-port Changed file.ignore-pattern ~ to ~$ Removed extraneous parentheses in file.ignore-pattern (^\\..*) and reduced pattern to ^\\. --- deploy/settings/default/default.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index d96c3b2c4..ec9c3fa7a 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -52,7 +52,7 @@ [:app :lt.objs.workspace/init-workspace-cache-dir] [:app :lt.objs.metrics/init-metrics] [:app :lt.objs.keyboard/chord-timeout 1000] - [:app :lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|\\.nrepl-port"] + [:app :lt.objs.files/file.ignore-pattern "^\\.|\\.class$|^target/|svn|cvs|\\.pyc$|~$|\\.swp$|\\.jar$"] [:app :lt.objs.style/provide-skin "dark" "core/css/skins/new-dark.css"] [:app :lt.objs.style/provide-skin "light" "core/css/skins/new-dark.css"] [:app :lt.objs.style/provide-skin "new-dark" "core/css/skins/new-dark.css"] From b9807fe537c927c34715aeebb7d982b1aa22f9a6 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Tue, 23 Jun 2015 15:14:10 -0400 Subject: [PATCH 466/656] Add Git attributes file to disable auto-CRLF conversion for all text files. --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6a568b1ee --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Disable auto-CRLF for all text files to prevent files being checked-out with CRLF line endings (on Windows) +* -text From 4a711cb1d32b5cda32e5b75fb6bf96819fe40be1 Mon Sep 17 00:00:00 2001 From: rundis Date: Wed, 24 Jun 2015 07:53:39 +0200 Subject: [PATCH 467/656] Added precondition section for Linux build on atom-shell --- doc/developer-install.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/developer-install.md b/doc/developer-install.md index ac85298d2..3a47999d8 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -34,6 +34,13 @@ The issue: - ["mkdir: cannot create directory" error running "atom-shell" branch build on Windows 7 · Issue #1918 · LightTable/LightTable](https://github.com/LightTable/LightTable/issues/1918) + +## Linux preconditions +To run atom-shell/electron on Linux you need to have libgconf-2.so.4 installed. + + +Ref: [atom-shell Linux (Arch) build depends on libgconf-2.so.4](https://github.com/LightTable/LightTable/issues/1926) + # Build To build LightTable from scratch on OSX, Windows Cygwin or Linux: From 7d5084384e781dc724b393bf646924bd2d543736 Mon Sep 17 00:00:00 2001 From: Benjamin Van Ryseghem Date: Fri, 26 Jun 2015 16:15:02 +0200 Subject: [PATCH 468/656] Quotes `pwd` to support spaces in path Fix #1929 --- script/light.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/light.sh b/script/light.sh index 67e1b87af..08bcab851 100755 --- a/script/light.sh +++ b/script/light.sh @@ -19,4 +19,4 @@ else exit 1 fi -LT_DEV_CLI=true $CLI deploy "$@" +LT_DEV_CLI=true "$CLI" deploy "$@" From aa5ee4389811429a004c41167d39caecfc40e033 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Wed, 1 Jul 2015 13:51:47 +0000 Subject: [PATCH 469/656] Added Gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 214459048..c4b3312ae 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Light Table [![Build Status](https://travis-ci.org/LightTable/LightTable.svg?branch=master)](https://travis-ci.org/LightTable/LightTable) +[![Join the chat at https://gitter.im/LightTable/LightTable](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/LightTable/LightTable?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything a [Chromium browser](http://www.chromium.org/) can. ## Downloads From 77111d612497e8268cb4fd9bffe2342fdb6028a7 Mon Sep 17 00:00:00 2001 From: rundis Date: Thu, 2 Jul 2015 22:28:26 +0200 Subject: [PATCH 470/656] Handle .git suffix in plugin metadata when downloading. In addition handle download errors more gracefully --- src/lt/objs/deploy.cljs | 10 +++++++++- src/lt/objs/plugins.cljs | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index d027deb0a..e038cb77e 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -7,6 +7,7 @@ [lt.objs.notifos :as notifos] [lt.objs.platform :as platform] [lt.objs.sidebar.command :as cmd] + [lt.objs.console :as console] [lt.objs.app :as app] [lt.util.load :as load] [lt.util.js :refer [every]] @@ -74,7 +75,13 @@ out (.createWriteStream fs to)] (when-let [proxy (or js/process.env.http_proxy js/process.env.https_proxy)] (set! (.-proxy options) proxy)) - (.pipe (request options cb) out))) + + (-> (.get request options cb) + (.on "response" (fn [resp] + (when-not (= (.-statusCode resp) 200) + (notifos/done-working) + (throw (js/Error. (str "Error downloading: " from " status code: " (.-statusCode resp))))))) + (.pipe out)))) (defn download-zip [ver cb] (let [n (notifos/working (str "Downloading version " ver " .."))] @@ -89,6 +96,7 @@ (pipe (.Extract tar (js-obj "path" to))) (on "end" cb)))) + (defn move-tmp [] (let [parent-dir (first (files/full-path-ls (str home-path "/tmp/")))] (doseq [file (files/full-path-ls (str parent-dir "/deploy/"))] diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index b7cb22ffe..2acbd21bd 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -320,7 +320,8 @@ (let [[repo username] (->> (string/split (:source plugin) "/") (reverse) (filter #(not= % "")) - (take 2))] + (take 2)) + repo (.replace repo #".git" "")] (str "https://api.github.com/repos/" username "/" repo "/tarball/" (:version plugin)))) (defn fetch-and-install [url name cb] From 62a28a0bbdc4d22f39ad1cbdc132eef9d3378619 Mon Sep 17 00:00:00 2001 From: Martin Zapata Date: Wed, 8 Jul 2015 11:04:21 -0300 Subject: [PATCH 471/656] Slightly clean up developer install doc Added a prerequisite section and removed the installation instructions for Leiningen --- doc/developer-install.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index 3a47999d8..532467a84 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -1,18 +1,11 @@ # Initial setup -## Install Leiningen and Node.js +## Prerequisites -First install or update [leiningen](http://leiningen.org/). +- [Leiningen 2.x](http://leiningen.org/) +- [Node.js and npm](http://nodejs.org/download/) +- [Cygwin](https://cygwin.com/install.html) (for Windows users) -1. Download the lein script. For Windows, download lein.bat. -2. Place it on your $PATH where your shell can find it (eg. ~/bin). -3. Set it to be an executable (chmod a+x ~/bin/lein). -4. Run the Lein script (eg. "./lein" or "sh lein") without quotes. - -You can also install it with your package manager but be sure to get version -2.x. Windows users can use this [installer](https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat). - -Then install [node and npm](http://nodejs.org/download/). ## Cygwin on Windows From 33414bfbe3b6e5d3c845ed465808c6f886043e56 Mon Sep 17 00:00:00 2001 From: rundis Date: Tue, 14 Jul 2015 18:35:54 +0200 Subject: [PATCH 472/656] Fixes #1727 Invalid behaviors file --- src/lt/objs/plugins.cljs | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index b7cb22ffe..b4df0e407 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -138,24 +138,25 @@ (deploy/is-newer? (:version plugin) cached)))) (defn plugin-behaviors [plug] - (try - (let [{:keys [behaviors dir]} plug - file (files/join dir behaviors) - file (files/real-path file) - behs (settings/parse-file file) - force? (get (::force-reload @manager) file)] - (when force? - (swap! manager update-in [::force-reload] disj file)) - (when behs - (walk/prewalk (fn [x] - (when (coll? x) - (alter-meta! x assoc ::dir dir ::force-reload force?)) - x) - behs) - behs)) - (catch :default e - (console/error (str "Could not load behaviors for plugin: " (:name plug))) - {}))) + (when (seq plug) + (try + (let [{:keys [behaviors dir]} plug + file (files/join dir behaviors) + file (files/real-path file) + behs (settings/parse-file file) + force? (get (::force-reload @manager) file)] + (when force? + (swap! manager update-in [::force-reload] disj file)) + (when behs + (walk/prewalk (fn [x] + (when (coll? x) + (alter-meta! x assoc ::dir dir ::force-reload force?)) + x) + behs) + behs)) + (catch :default e + (console/error (str "Could not load behaviors for plugin: " (:name plug))) + {})))) (defn plugin-dependency-graph [plugins] (into {} From f94bf3af0d382424c69161d5b01680d0ea657a38 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 23 Aug 2015 10:56:21 -0400 Subject: [PATCH 473/656] Add fn docstrings per #1715 --- src/lt/macros.clj | 24 +++++++-- src/lt/object.cljs | 100 ++++++++++++++++++++++++++++------- src/lt/objs/command.cljs | 9 +++- src/lt/objs/editor.cljs | 35 +++++++++--- src/lt/objs/editor/pool.cljs | 12 +++-- src/lt/objs/files.cljs | 61 ++++++++++++++++----- src/lt/objs/notifos.cljs | 6 +++ 7 files changed, 200 insertions(+), 47 deletions(-) diff --git a/src/lt/macros.clj b/src/lt/macros.clj index c6f7317f2..89cfc3c5a 100644 --- a/src/lt/macros.clj +++ b/src/lt/macros.clj @@ -4,7 +4,20 @@ (defn- namify [type keyword] (symbol (str "__" type "__" (.replace (name keyword) "." "__DOT__")))) -(defmacro behavior [name & {:keys [reaction] :as r}] +(defmacro behavior + "Define a behavior with a unique namespaced keyword and multiple key value pairs. + Keys are: + + * :reaction (required) - Function to invoke when behavior is called. + First arg is object behavior is attached to + * :triggers (required) - Set of keyword triggers that trigger behavior + * :desc - Brief description of behavior + * :type - When set to :user, shows up in hints. Not enabled by default + * :params - Vector of maps describing behavior args. Each map contains required :label key + and optional keys of :type (:string, :number or :list), :items and :example + * :throttle - Number of ms to throttle reaction fn + * :debounce - Number of ms to debounce reaction fn" + [name & {:keys [reaction] :as r}] (if (and (seq? reaction) (= 'fn (first reaction))) (let [[_ args & body] reaction] `(do @@ -12,7 +25,10 @@ (lt.object/behavior* ~name ~@(apply concat (assoc r :reaction (namify "BEH" name)))))) `(lt.object/behavior* ~name ~@(apply concat r)))) -(defmacro defui [sym params hiccup & events] +(defmacro defui + "Define a UI element for given hiccup data and key-value pairs + of events for element" + [sym params hiccup & events] `(defn ~sym ~params (let [e# (crate.core/html ~hiccup)] (doseq [[ev# func#] (partition 2 ~(vec events))] @@ -68,7 +84,9 @@ `(let [~start (.getTime (js/Date.))] ~@body))) -(defmacro background [func] +(defmacro background + "Register given func to run on background thread" + [func] `(lt.objs.thread/thread* (fn ~(gensym "tfun") [] (let [orig# (js/argsArray js/arguments) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index a668df66e..21d80e868 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -9,13 +9,34 @@ [lt.util.js :refer [throttle debounce]]) (:require-macros [lt.macros :refer [behavior with-time aloop]])) -(def obj-id (atom 0)) -(def instances (atom (sorted-map))) -(def behaviors (atom {})) -(def object-defs (atom {})) -(def tags (atom {})) -(def negated-tags (atom {})) -(def ^{:dynamic true} *behavior-meta* nil) +;; HEART of BOT Architecture! +(def obj-id + "Counter to guarantee unique object ids" + (atom 0)) + +(def instances + "Map of object ids to objects created by object/create" + (atom (sorted-map))) + +(def behaviors + "Map of behavior names to behaviors created by macros/behavior" + (atom {})) + +(def object-defs + "Map of object template keys to template maps created by object/object*" + (atom {})) + +(def tags + "Map of tags to associated lists of behaviors" + (atom {})) + +(def negated-tags + "Map of tags to dissociated lists of behaviors e.g. :-behavior" + (atom {})) + +(def ^{:dynamic true} *behavior-meta* + "Metadata of current behavior set during raise and raise-reduce" + nil) (defn add [obj] (swap! object-defs assoc (::type obj) obj)) @@ -118,7 +139,9 @@ (safe-report-error e) ))))) -(defn raise [obj k & args] +(defn raise + "Invoke object's behavior fns for given trigger. Args are passed to behavior fns" + [obj k & args] (let [reactions (-> @obj :listeners k)] (raise* obj reactions args k))) @@ -158,10 +181,14 @@ (add obj) obj) -(defn instances-by-type [type] +(defn instances-by-type + "Return all objects for given type (template name)" + [type] (filter #(= type (::type (deref %))) (vals @instances))) -(defn merge! [obj m] +(defn merge! + "Merge map into object" + [obj m] (when (and m (not (map? m))) (throw (js/Error. (str "Merge requires a map: " m)))) (swap! obj merge m)) @@ -188,7 +215,18 @@ (raise inst :redef)) id)) -(defn object* [name & r] +(defn object* + "Create object template (type) given keyword name and key-value pairs. + These pairs serve as default attributes for an object. Following keys + have special meaning: + + * :behaviors - Set of object's behaviors + * :tags - Set of object's tags + * :triggers - Set of object's triggers + * :init - Init fn called when object is created. Fn's return value + is hiccup html content and saved to :content + * :listeners (internal) - Map of triggers to vectors of behaviors" + [name & r] (-> (apply make-object* name r) (store-object*) (handle-redef))) @@ -218,7 +256,10 @@ (wrap-debounce) (store-behavior*))) -(defn raise-reduce [obj k start & args] +(defn raise-reduce + "Reduce over invoked object's behavior fns for given trigger. Start + is initial value for reduce and any args are passed to behavior fn" + [obj k start & args] (let [reactions (-> @obj :listeners k)] (reduce (fn [res cur] (let [func (:reaction (->behavior cur)) @@ -237,7 +278,9 @@ (declare create) -(defn update! [obj & r] +(defn update! + "Update object with update-in with [:key], fn and args" + [obj & r] (swap! obj #(apply update-in % r))) (defn assoc-in! [obj k v] @@ -251,10 +294,15 @@ (deref? o) o :else (@instances o))) -(defn ->content [obj] +(defn ->content + "Return DOM content associated with object" + [obj] (:content @obj)) -(defn destroy! [obj] +(defn destroy! + "Destroy object by calling its :destroy trigger, removing it from + cache and removing associated DOM content" + [obj] (when-let [inst (->inst obj)] (raise inst :destroy) (swap! instances dissoc (->id inst)) @@ -266,7 +314,15 @@ (swap! instances assoc (::id @inst) inst) inst) -(defn create [obj-name & args] +(defn create + "Create object given keyword name of object template or an object template + and key-value pairs. See object* for special keys. + During object creation the following happens to object in order: + + * :init fn is called with given args + * :object.instant trigger is raised + * :init trigger is raised" + [obj-name & args] (let [obj (if (keyword? obj-name) (@object-defs obj-name) obj-name) @@ -309,11 +365,15 @@ def|name (@object-defs def|name))) -(defn by-id [id] +(defn by-id + "Find object by its unique numerical id" + [id] (when id (@instances id))) -(defn by-tag [tag] +(defn by-tag + "Find objects that have given tag" + [tag] (sort-by (comp ::id deref) (filter #(when-let [ts (:tags (deref %))] (ts tag)) @@ -344,7 +404,9 @@ (raise obj ::tags-removed ts) obj)) -(defn tag-behaviors [tag behs] +(defn tag-behaviors + "Associate behaviors to given tag and refresh objects with given tag" + [tag behs] (swap! tags update-in [tag] #(reduce conj (or % '()) behs)) diff --git a/src/lt/objs/command.cljs b/src/lt/objs/command.cljs index 358693739..60a032d9d 100644 --- a/src/lt/objs/command.cljs +++ b/src/lt/objs/command.cljs @@ -5,7 +5,14 @@ (def required-keys #{:command :desc :exec}) -(defn command [cmd] +(defn command + "Define a command given a map with the following keys: + + * :command (required) - Unique keyword name for command + * :desc (required) - Brief description of command + * :exec (required) - Function to invoke when command is called + * :hidden - When true, command is hidden from command bar. Not set by default" + [cmd] (assert (every? cmd required-keys) (str "Command doesn't have required keys: " required-keys)) (object/update! manager [:commands] assoc (:command cmd) cmd) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 8ec8a4835..450a1cd13 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -15,19 +15,26 @@ [lt.util.cljs :only [js->clj]]) (:require-macros [lt.macros :refer [behavior]])) -(defn ->cm-ed [e] +(defn ->cm-ed + "Return editor's CodeMirror object" + [e] (if (satisfies? IDeref e) (:ed @e) e)) -(defn ->elem [e] +(defn ->elem + "Return DOM element of editor's CodeMirror object" + [e] (.-parentElement (.getScrollerElement (->cm-ed e)))) (defn set-val [e v] (. (->cm-ed e) (setValue (or v ""))) e) -(defn set-options [e m] +(defn set-options + "Given a map of options, set each pair as an option on editor's + CodeMirror object" + [e m] (doseq [[k v] m] (.setOption (->cm-ed e) (name k) v)) e) @@ -82,10 +89,14 @@ (.swapDoc e (-> (:doc context) deref :doc))) e)) -(defn on [ed ev func] +(defn on + "Register event handler on editor's CodeMirror object" + [ed ev func] (.on (->cm-ed ed) (name ev) func)) -(defn off [ed ev func] +(defn off + "Remove event handler on editor's CodeMirror object" + [ed ev func] (.off (->cm-ed ed) (name ev) func)) (defn wrap-object-events [ed obj] @@ -106,7 +117,9 @@ ;; Params ;;********************************************************* -(defn ->val [e] +(defn ->val + "Return editor's CodeMirror object buffer contents" + [e] (. (->cm-ed e) (getValue))) (defn ->token [e pos] @@ -130,10 +143,14 @@ e) (defn cursor + "Return cursor of editor's CodeMirror object as js object. + Example: #js {:line 144, :ch 9}" ([e] (cursor e nil)) ([e side] (.getCursor (->cm-ed e) side))) -(defn ->cursor [e & [side]] +(defn ->cursor + "Same as cursor but returned as cljs map" + [e & [side]] (let [pos (cursor e side)] {:line (.-line pos) :ch (.-ch pos)})) @@ -150,7 +167,9 @@ (defn bookmark [e from widg] (.setBookmark (->cm-ed e) (clj->js from) (clj->js widg))) -(defn option [e o] +(defn option + "Return value for option name on editor's CodeMirror object" + [e o] (.getOption (->cm-ed e) (name o))) (defn set-mode [e m] diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index b4df13445..738dca4e6 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -44,12 +44,16 @@ (defn unsaved? [] (some #(:dirty (deref %)) (object/by-tag :editor))) -(defn by-path [path] +(defn by-path + "Return editor objects that edit given path" + [path] (when path (let [path (string/lower-case path)] (filter #(= (-> @% :info (get :path) (or "") string/lower-case) path) (object/by-tag :editor))))) -(defn containing-path [path] +(defn containing-path + "Return editor objects that edit paths containing given path string" + [path] (let [path (string/lower-case path)] (filter #(> (.indexOf (-> @% :info :path (or "") string/lower-case) path) -1) (object/by-tag :editor)))) @@ -68,7 +72,9 @@ (def pool (object/create ::pool)) -(defn last-active [] +(defn last-active + "Return current editor object (last active in pool)" + [] (let [l (:last @pool)] (when (and l @l) l))) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 292ed4072..69c64a79c 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -169,7 +169,9 @@ (let [content (.readFileSync fs path "utf-8")] (string/replace content "\uFEFF" ""))) -(defn open [path cb] +(defn open + "Open file and in callback return map with file's content in :content" + [path cb] (try (let [content (bomless-read path)] ;;TODO: error handling @@ -188,7 +190,9 @@ (when cb (cb nil e))) )) -(defn open-sync [path] +(defn open-sync + "Open file and return map with file's content in :content" + [path] (try (let [content (bomless-read path)] ;;TODO: error handling @@ -207,7 +211,9 @@ nil) )) -(defn save [path content & [cb]] +(defn save + "Save path with given content. Optional callback called after save" + [path content & [cb]] (try (.writeFileSync fs path content) (object/raise files-obj :files.save path) @@ -221,7 +227,9 @@ (when cb (cb e)) ))) -(defn append [path content & [cb]] +(defn append + "Append content to path. Optional callback called after append" + [path content & [cb]] (try (.appendFileSync fs path content) (object/raise files-obj :files.save path) @@ -238,12 +246,16 @@ (defn trash! [path] (.moveItemTotrash shell path)) -(defn delete! [path] +(defn delete! + "Delete file or directory" + [path] (if (dir? path) (.rmdirSyncRecursive wrench path) (.unlinkSync fs path))) -(defn move! [from to] +(defn move! + "Move file or directory to given path" + [from to] (if (dir? from) (do (.copyDirSyncRecursive wrench from to) @@ -252,15 +264,21 @@ (save to (:content (open-sync from))) (delete! from)))) -(defn copy [from to] +(defn copy + "Copy file or directory to given path" + [from to] (if (dir? from) (.copyDirSyncRecursive wrench from to) (save to (:content (open-sync from))))) -(defn mkdir [path] +(defn mkdir + "Make given directory" + [path] (.mkdirSync fs path)) -(defn parent [path] +(defn parent + "Return directory of path" + [path] (.dirname fpath path)) (defn next-available-name [path] @@ -276,6 +294,7 @@ (recur (inc x) (join p (str name (inc x) (when ext (str "." ext)))))))))) (defn ls + "Return directory's files" ([path] (ls path nil)) ([path cb] (try @@ -288,7 +307,12 @@ (cb nil)) nil)))) -(defn ls-sync [path opts] +(defn ls-sync + "Return directory's files applying ignore-pattern. Takes map of options with keys: + + * :files - When set only returns files + * :dirs - When set only return directories" + [path opts] (try (let [fs (remove #(re-seq ignore-pattern %) (map (partial ->file|dir path) (.readdirSync fs path)))] (cond @@ -298,7 +322,9 @@ (catch js/global.Error e nil))) -(defn full-path-ls [path] +(defn full-path-ls + "Return directory's files as full paths" + [path] (try (doall (map (partial join path) (.readdirSync fs path))) (catch js/Error e @@ -306,13 +332,16 @@ (catch js/global.Error e (js/lt.objs.console.error e)))) -(defn dirs [path] +(defn dirs + "Return directory's directories" + [path] (try (filter dir? (map (partial join path) (.readdirSync fs path))) (catch js/Error e) (catch js/global.Error e))) (defn home + "Return users' home directory (e.g. ~/) or path under it" ([] (home nil)) ([path] (let [h (if (= js/process.platform "win32") @@ -321,18 +350,24 @@ (join h (or path separator))))) (defn lt-home + "Return LT's home directory" ([] load/dir) ([path] (join (lt-home) path))) (defn lt-user-dir + "Return LT's user directory. Used for storing user-related content e.g. + settings, plugins, logs and caches" ([] (lt-user-dir "")) ([path] (if js/process.env.LT_USER_DIR (join js/process.env.LT_USER_DIR path) (join data-path path)))) -(defn walk-up-find [start find] +(defn walk-up-find + "Starting at start path, walk up parent directories and return first path + whose basename matches find" + [start find] (let [roots (get-roots)] (loop [cur start prev ""] diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 182141f80..8408e37a4 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -17,6 +17,10 @@ (declare cur-timeout) (defn set-msg! + "Display message in bottom statusbar. Takes map of options with following keys: + + * :class - css class for message. Use 'error' to display error message + * :timeout - Number of ms before message times out. Default is 10000 (10s)" ([msg] (msg* msg) (js/clearTimeout cur-timeout) @@ -28,6 +32,7 @@ standard-timeout) #(msg* ""))))) (defn working + "Display working spinner with optional statusbar message" ([] (working nil)) ([msg] (when msg @@ -35,6 +40,7 @@ (statusbar/loader-inc))) (defn done-working + "Hide working spinner with optional statusbar message" ([] (statusbar/loader-dec)) ([msg] From c247b3369ece1d0a5f8c98edf8dd93c773187209 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 24 Aug 2015 20:38:26 -0400 Subject: [PATCH 474/656] Add ns docstrings for #1715 --- src/lt/macros.clj | 1 + src/lt/object.cljs | 2 ++ src/lt/objs/animations.cljs | 1 + src/lt/objs/app.cljs | 2 ++ src/lt/objs/bottombar.cljs | 1 + src/lt/objs/browser.cljs | 1 + src/lt/objs/cache.cljs | 1 + src/lt/objs/canvas.cljs | 2 ++ src/lt/objs/cli.cljs | 2 ++ src/lt/objs/clients.cljs | 2 ++ src/lt/objs/clients/devtools.cljs | 2 ++ src/lt/objs/clients/local.cljs | 1 + src/lt/objs/clients/tcp.cljs | 1 + src/lt/objs/clients/ws.cljs | 1 + src/lt/objs/command.cljs | 1 + src/lt/objs/connector.cljs | 1 + src/lt/objs/console.cljs | 2 ++ src/lt/objs/context.cljs | 3 +++ src/lt/objs/deploy.cljs | 2 ++ src/lt/objs/dev.cljs | 1 + src/lt/objs/dialogs.cljs | 1 + src/lt/objs/docs.cljs | 1 + src/lt/objs/document.cljs | 2 ++ src/lt/objs/editor.cljs | 3 +++ src/lt/objs/editor/file.cljs | 1 + src/lt/objs/editor/pool.cljs | 1 + src/lt/objs/eval.cljs | 2 ++ src/lt/objs/files.cljs | 2 ++ src/lt/objs/find.cljs | 1 + src/lt/objs/intro.cljs | 1 + src/lt/objs/jump_stack.cljs | 1 + src/lt/objs/keyboard.cljs | 1 + src/lt/objs/langs/behaviors.cljs | 1 + src/lt/objs/langs/keymap.cljs | 1 + src/lt/objs/menu.cljs | 1 + src/lt/objs/metrics.cljs | 1 + src/lt/objs/notifos.cljs | 1 + src/lt/objs/opener.cljs | 1 + src/lt/objs/platform.cljs | 1 + src/lt/objs/plugins.cljs | 2 ++ src/lt/objs/popup.cljs | 1 + src/lt/objs/proc.cljs | 1 + src/lt/objs/search.cljs | 1 + src/lt/objs/settings.cljs | 1 + src/lt/objs/sidebar.cljs | 1 + src/lt/objs/sidebar/clients.cljs | 1 + src/lt/objs/sidebar/command.cljs | 1 + src/lt/objs/sidebar/navigate.cljs | 1 + src/lt/objs/sidebar/workspace.cljs | 1 + src/lt/objs/statusbar.cljs | 2 ++ src/lt/objs/style.cljs | 1 + src/lt/objs/tabs.cljs | 1 + src/lt/objs/thread.cljs | 3 ++- src/lt/objs/titlebar.cljs | 1 + src/lt/objs/version.cljs | 1 + src/lt/objs/workspace.cljs | 1 + src/lt/plugins/auto_complete.cljs | 1 + src/lt/plugins/auto_paren.cljs | 1 + src/lt/plugins/doc.cljs | 1 + src/lt/plugins/watches.cljs | 1 + src/lt/util/cljs.cljs | 1 + src/lt/util/dom.cljs | 1 + src/lt/util/events.cljs | 3 ++- src/lt/util/ipc.cljs | 2 +- src/lt/util/js.cljs | 3 ++- src/lt/util/kahn.cljs | 3 ++- src/lt/util/load.cljs | 1 + src/lt/util/style.cljs | 3 ++- 68 files changed, 90 insertions(+), 6 deletions(-) diff --git a/src/lt/macros.clj b/src/lt/macros.clj index 89cfc3c5a..2d165607d 100644 --- a/src/lt/macros.clj +++ b/src/lt/macros.clj @@ -1,4 +1,5 @@ (ns lt.macros + "Macros used across LT" (:require [clojure.walk :as walk])) (defn- namify [type keyword] diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 21d80e868..078f6558d 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -1,4 +1,6 @@ (ns lt.object + "Define core of BOT architecture and provide fns for manipulating objects, + behaviors and tags" (:refer-clojure :exclude [set!]) (:require [crate.core :as crate] [clojure.set :as set] diff --git a/src/lt/objs/animations.cljs b/src/lt/objs/animations.cljs index 1e855035a..0680d1464 100644 --- a/src/lt/objs/animations.cljs +++ b/src/lt/objs/animations.cljs @@ -1,4 +1,5 @@ (ns lt.objs.animations + "Manage (de)activating animations" (:require [lt.object :as object] [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior]])) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index c92950802..aaa64f64a 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -1,4 +1,6 @@ (ns lt.objs.app + "Provide app object which manages app startup, app shutdown and + window related features" (:require [lt.object :as object] [lt.objs.platform :as platform] [lt.objs.command :as cmd] diff --git a/src/lt/objs/bottombar.cljs b/src/lt/objs/bottombar.cljs index 9b61553ec..0949c3cc0 100644 --- a/src/lt/objs/bottombar.cljs +++ b/src/lt/objs/bottombar.cljs @@ -1,4 +1,5 @@ (ns lt.objs.bottombar + "Provide bottombar object and associated behaviors" (:require [lt.object :as object] [lt.objs.tabs :as tabs] [lt.objs.animations :as anim] diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 00da4fa3c..96a22aec9 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -1,4 +1,5 @@ (ns lt.objs.browser + "Provide browser object which wraps around Electron's webview" (:require [lt.object :as object] [lt.objs.tabs :as tabs] [lt.objs.command :as cmd] diff --git a/src/lt/objs/cache.cljs b/src/lt/objs/cache.cljs index 4b183d3e4..32c96536d 100644 --- a/src/lt/objs/cache.cljs +++ b/src/lt/objs/cache.cljs @@ -1,4 +1,5 @@ (ns lt.objs.cache + "Provide cache which persists to disk and thus across application reboots" (:require [lt.object :as object] [lt.objs.files :as files] [cljs.reader :as reader]) diff --git a/src/lt/objs/canvas.cljs b/src/lt/objs/canvas.cljs index 1760af21c..21f737066 100644 --- a/src/lt/objs/canvas.cljs +++ b/src/lt/objs/canvas.cljs @@ -1,4 +1,6 @@ (ns lt.objs.canvas + "Provide canvas object which contains the primary div of the UI: #canvas. + Children divs are #multi (tabs), #side, #right-bar and #bottombar" (:refer-clojure :exclude [rem]) (:require [lt.object :as object] [lt.objs.context :as ctx] diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index 61c82110e..e4c92c4e3 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -1,4 +1,6 @@ (ns lt.objs.cli + "Provide behaviors for commandline parsing and opening files from + commandline or file manager" (:require [lt.object :as object] [lt.objs.app :as app] [lt.objs.files :as files] diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index 7b40a12dc..e18e850f9 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -1,4 +1,6 @@ (ns lt.objs.clients + "Provide clients object for managing multiple types of clients e.g. browser + or Clojure and their connections" (:refer-clojure :exclude [send]) (:require [lt.object :as object] [lt.util.js :refer [wait]] diff --git a/src/lt/objs/clients/devtools.cljs b/src/lt/objs/clients/devtools.cljs index 2477be830..d30d83e50 100644 --- a/src/lt/objs/clients/devtools.cljs +++ b/src/lt/objs/clients/devtools.cljs @@ -1,4 +1,6 @@ (ns lt.objs.clients.devtools + "Provide devtools client for interacting with Chromium's remote debugging + protocol - https://developer.chrome.com/devtools/docs/debugger-protocol" (:refer-clojure :exclude [send]) (:require [cljs.reader :as reader] [lt.object :as object] diff --git a/src/lt/objs/clients/local.cljs b/src/lt/objs/clients/local.cljs index b649f8d22..045b81171 100644 --- a/src/lt/objs/clients/local.cljs +++ b/src/lt/objs/clients/local.cljs @@ -1,4 +1,5 @@ (ns lt.objs.clients.local + "Provide local client for connecting to LT" (:refer-clojure :exclude [send]) (:require [cljs.reader :as reader] [lt.object :as object] diff --git a/src/lt/objs/clients/tcp.cljs b/src/lt/objs/clients/tcp.cljs index df52f0b35..32a1d563c 100644 --- a/src/lt/objs/clients/tcp.cljs +++ b/src/lt/objs/clients/tcp.cljs @@ -1,4 +1,5 @@ (ns lt.objs.clients.tcp + "Define tcp server for use with language plugins" (:refer-clojure :exclude [send]) (:require [cljs.reader :as reader] [lt.object :as object] diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index 98bb5a29b..aebda5117 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -1,4 +1,5 @@ (ns lt.objs.clients.ws + "Define websocket server for use with language plugins e.g. JavaScript" (:refer-clojure :exclude [send]) (:require [cljs.reader :as reader] [lt.object :as object] diff --git a/src/lt/objs/command.cljs b/src/lt/objs/command.cljs index 60a032d9d..7912ee340 100644 --- a/src/lt/objs/command.cljs +++ b/src/lt/objs/command.cljs @@ -1,4 +1,5 @@ (ns lt.objs.command + "Provide command manager and command related fns" (:require [lt.object :as object])) (declare manager) diff --git a/src/lt/objs/connector.cljs b/src/lt/objs/connector.cljs index 919c4bdcd..7787b31c7 100644 --- a/src/lt/objs/connector.cljs +++ b/src/lt/objs/connector.cljs @@ -1,4 +1,5 @@ (ns lt.objs.connector + "Provide client-selector object for UI and behaviors to choosing a client" (:require [lt.object :as object] [lt.objs.canvas :as canvas] [lt.objs.popup :as popup] diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index 409153d0c..c25000838 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -1,4 +1,6 @@ (ns lt.objs.console + "Provide console object for logging to file and displaying log messages + in bottom bar" (:require [lt.object :as object] [lt.objs.app :as app] [lt.objs.files :as files] diff --git a/src/lt/objs/context.cljs b/src/lt/objs/context.cljs index 13e6f2d4f..3ef6ab741 100644 --- a/src/lt/objs/context.cljs +++ b/src/lt/objs/context.cljs @@ -1,4 +1,7 @@ (ns lt.objs.context + "Provide context object which manages temporary contexts LT can get in. + An object can be associated with a context which is useful for keeping track + of current tabset or browser" (:require [lt.object :as object]) (:require-macros [lt.macros :refer [behavior]])) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index e038cb77e..566146456 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -1,4 +1,6 @@ (ns lt.objs.deploy + "Provide behaviors to check for app updates and fns for downloading + and unpacking downloaded assets" (:require [lt.object :as object] [lt.objs.clients :as clients] [lt.objs.files :as files] diff --git a/src/lt/objs/dev.cljs b/src/lt/objs/dev.cljs index 8071d02ef..44f7f5dc0 100644 --- a/src/lt/objs/dev.cljs +++ b/src/lt/objs/dev.cljs @@ -1,4 +1,5 @@ (ns lt.objs.dev + "Provide commands for LT developer" (:require [lt.object :as object] [lt.util.js :refer [wait ]] [lt.objs.cache :as cache] diff --git a/src/lt/objs/dialogs.cljs b/src/lt/objs/dialogs.cljs index d7111dbb3..82b7df880 100644 --- a/src/lt/objs/dialogs.cljs +++ b/src/lt/objs/dialogs.cljs @@ -1,4 +1,5 @@ (ns lt.objs.dialogs + "Provide Electron-based dialogs" (:require [lt.object :as object] [lt.util.dom :as dom] [lt.objs.app :as app]) diff --git a/src/lt/objs/docs.cljs b/src/lt/objs/docs.cljs index e68344bbe..a36e9ddcb 100644 --- a/src/lt/objs/docs.cljs +++ b/src/lt/objs/docs.cljs @@ -1,4 +1,5 @@ (ns lt.objs.docs + "Provide command and behavior(s) to see LT documentation" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.tabs :as tabs]) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 56361f923..746019d81 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -1,4 +1,6 @@ (ns lt.objs.document + "Provide document object for wrapping CodeMirror documents. See + http://codemirror.org/doc/manual.html#api_doc for more" (:require [lt.object :as object] [lt.objs.files :as files] [lt.objs.popup :as popup]) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 450a1cd13..f9588ece9 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -1,4 +1,7 @@ (ns lt.objs.editor + "Provide fns and behaviors for interfacing with a CodeMirror editor + object. Also manage defining and loading CodeMirror. For more about CodeMirror + objects see http://codemirror.org/doc/manual.html#CodeMirror" (:refer-clojure :exclude [val replace range]) (:require [crate.core :as crate] [lt.objs.context :as ctx-obj] diff --git a/src/lt/objs/editor/file.cljs b/src/lt/objs/editor/file.cljs index 242f4cb02..caf5fd6f4 100644 --- a/src/lt/objs/editor/file.cljs +++ b/src/lt/objs/editor/file.cljs @@ -1,4 +1,5 @@ (ns lt.objs.editor.file + "Provide behaviors for a file-based editor object" (:require [lt.object :as object] [lt.objs.editor :as ed] [lt.objs.document :as doc] diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 738dca4e6..13d87fb70 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -1,4 +1,5 @@ (ns lt.objs.editor.pool + "Provide manager for managing a pool of editors and several misc editor commands" (:require [lt.object :as object] [lt.objs.app :as app] [lt.objs.document :as doc] diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 8858b3919..9c620a41e 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -1,4 +1,6 @@ (ns lt.objs.eval + "Provide objects for doing evals through clients and displaying inline + results from evals" (:require [lt.object :as object] [lt.objs.canvas :as canvas] [lt.objs.editor :as ed] diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 69c64a79c..b4255f51e 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -1,4 +1,6 @@ (ns lt.objs.files + "Provider fns for doing file related operations. A number of fns + use the node fs library - https://nodejs.org/api/fs.html" (:refer-clojure :exclude [open exists?]) (:require [lt.object :as object] [lt.util.load :as load] diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 6757990e1..9d8bdb41c 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -1,4 +1,5 @@ (ns lt.objs.find + "Provide find and replace functionality for current file" (:require [lt.object :as object] [lt.objs.context :as ctx] [lt.objs.statusbar :as statusbar] diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index 8c6794950..e78203f9f 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -1,4 +1,5 @@ (ns lt.objs.intro + "Provide intro panel for introducing LT to new users" (:require [lt.object :as object] [lt.objs.style :as style] [lt.objs.deploy :as deploy] diff --git a/src/lt/objs/jump_stack.cljs b/src/lt/objs/jump_stack.cljs index dbfa4ca33..db1b00d6e 100644 --- a/src/lt/objs/jump_stack.cljs +++ b/src/lt/objs/jump_stack.cljs @@ -1,4 +1,5 @@ (ns lt.objs.jump-stack + "Provide jump stack to jump to definitions and jump back" (:require [lt.object :as object] [lt.objs.editor :as editor] [lt.objs.editor.pool :as pool] diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 4bea711c6..173d7efd8 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -1,4 +1,5 @@ (ns lt.objs.keyboard + "Manage keybindings by wrapping Mousetrap" (:refer-clojure :exclude [keys meta]) (:require [clojure.string :as string] [lt.object :as object] diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 4c184507b..8f4dfa8e2 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -1,4 +1,5 @@ (ns lt.objs.langs.behaviors + "Provide hints for behaviors" (:require [lt.object :as object] [lt.objs.context :as ctx] [lt.objs.command :as cmd] diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index 9c4d28ab5..f735c38c3 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -1,4 +1,5 @@ (ns lt.objs.langs.keymap + "Provide hints for keymaps" (:require [lt.object :as object] [lt.objs.context :as ctx] [lt.objs.command :as cmd] diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 3685f7a1d..09680d167 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -1,4 +1,5 @@ (ns lt.objs.menu + "Provide Electron-based menus and associated behaviors" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.keyboard :as keyboard] diff --git a/src/lt/objs/metrics.cljs b/src/lt/objs/metrics.cljs index 0ca0ecc9d..22c667445 100644 --- a/src/lt/objs/metrics.cljs +++ b/src/lt/objs/metrics.cljs @@ -1,4 +1,5 @@ (ns lt.objs.metrics + "Define and collect usage metrics" (:refer-clojure :exclude [send flush]) (:require [lt.object :as object] [lt.objs.app :as app] diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 8408e37a4..9ebd0a829 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -1,4 +1,5 @@ (ns lt.objs.notifos + "Provide fns for displaying messages and spinner in bottom statusbar" (:require [lt.object :as object] [lt.objs.statusbar :as statusbar] [lt.objs.command :as cmd] diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index ceb7503ec..70eef959f 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -1,4 +1,5 @@ (ns lt.objs.opener + "Provide functionality around opening and saving files" (:require [lt.object :as object] [lt.objs.metrics :as metrics] [lt.objs.editor :as editor] diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index 58180fac4..4e1de5ada 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -1,4 +1,5 @@ (ns lt.objs.platform + "Provide platform-agnostic and platform related fns" (:require [lt.object :as object] [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior]])) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index eb763967a..2b9b30827 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -1,4 +1,6 @@ (ns lt.objs.plugins + "Provide plugin manager with ability to search, install (download and unpack), + remove and update plguins" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.context :as ctx] diff --git a/src/lt/objs/popup.cljs b/src/lt/objs/popup.cljs index 83a859c70..48d3aed1c 100644 --- a/src/lt/objs/popup.cljs +++ b/src/lt/objs/popup.cljs @@ -1,4 +1,5 @@ (ns lt.objs.popup + "Provide popup object for displaying popups" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.context :as ctx] diff --git a/src/lt/objs/proc.cljs b/src/lt/objs/proc.cljs index 1fe44e935..d4f167e04 100644 --- a/src/lt/objs/proc.cljs +++ b/src/lt/objs/proc.cljs @@ -1,4 +1,5 @@ (ns lt.objs.proc + "Provide fns to spawn processes and manage them. Used by language plugins" (:require [lt.object :as object] [lt.objs.clients :as clients] [lt.objs.files :as files] diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index 9da05e861..53f2bd23d 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -1,4 +1,5 @@ (ns lt.objs.search + "Provide search and replace functionality across files" (:require [lt.object :as object] [lt.objs.proc :as proc] [lt.objs.tabs :as tabs] diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 16b9efeda..b75118f9c 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -1,4 +1,5 @@ (ns lt.objs.settings + "Provide User plugin functionality - user.cljs, user.behaviors and user.keymap" (:require [lt.object :as object] [lt.objs.app :as app] [lt.objs.command :as cmd] diff --git a/src/lt/objs/sidebar.cljs b/src/lt/objs/sidebar.cljs index 6f8eb95d8..b5bf4065c 100644 --- a/src/lt/objs/sidebar.cljs +++ b/src/lt/objs/sidebar.cljs @@ -1,4 +1,5 @@ (ns lt.objs.sidebar + "Provide sidebar (left bar) and rightbar objects" (:require [lt.object :as object] [lt.objs.tabs :as tabs] [lt.objs.command :as cmd] diff --git a/src/lt/objs/sidebar/clients.cljs b/src/lt/objs/sidebar/clients.cljs index 06c1b4254..76ce8ccc0 100644 --- a/src/lt/objs/sidebar/clients.cljs +++ b/src/lt/objs/sidebar/clients.cljs @@ -1,4 +1,5 @@ (ns lt.objs.sidebar.clients + "Provide sidebar for (dis)connecting to a client" (:require [lt.object :as object] [lt.objs.clients :as clients] [lt.objs.sidebar :as sidebar] diff --git a/src/lt/objs/sidebar/command.cljs b/src/lt/objs/sidebar/command.cljs index 186dc1e8d..6fd802bbe 100644 --- a/src/lt/objs/sidebar/command.cljs +++ b/src/lt/objs/sidebar/command.cljs @@ -1,4 +1,5 @@ (ns lt.objs.sidebar.command + "Provide command sidebar for finding and executing a command" (:require [lt.object :as object] [lt.objs.context :as ctx] [lt.objs.sidebar :as sidebar] diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index f16a73d39..ddcb0a4e8 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -1,4 +1,5 @@ (ns lt.objs.sidebar.navigate + "Provide sidebar for finding and opening files" (:require [lt.object :as object] [lt.objs.workspace :as workspace] [lt.objs.context :as ctx] diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index f0995578a..9e0738bd0 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -1,4 +1,5 @@ (ns lt.objs.sidebar.workspace + "Provide sidebar for managing workspaces and files within a workspace" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.context :as ctx] diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index 0c06454fe..f78f3012b 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -1,4 +1,6 @@ (ns lt.objs.statusbar + "Provide statusbar functionality e.g. current line and column. + Statusbar is close to the bottom but above bottombar" (:require [lt.object :as object] [lt.objs.tabs :as tabs] [lt.objs.canvas :as canvas] diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index c29df9f42..f12fbae54 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -1,4 +1,5 @@ (ns lt.objs.style + "Provide styling behaviors, themes and skins" (:require [lt.object :as object] [lt.objs.sidebar.command :as cmd] [lt.objs.app :as app] diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 53b8e074d..3085b1237 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -1,4 +1,5 @@ (ns lt.objs.tabs + "Manage tabsets and tabs" (:require [lt.object :refer [object* behavior*] :as object] [lt.objs.editor :as editor] [lt.objs.canvas :as canvas] diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index ebd271087..c08ed5adf 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -1,4 +1,5 @@ (ns lt.objs.thread + "Provide worker thread for background processes" (:require [lt.object :as object] [lt.objs.files :as files] [lt.objs.platform :as platform] @@ -101,7 +102,7 @@ :obj (object/->id obj) :params (map pr-str args)})))) -;;NOTE: Because funcions are defined at load time, we need to pre-add the worker behaviors so that +;;NOTE: Because functions are defined at load time, we need to pre-add the worker behaviors so that ;; the defined functions are sent correctly (object/tag-behaviors :worker-thread [::kill! ::connect ::send! ::queue! ::try-send ::message]) diff --git a/src/lt/objs/titlebar.cljs b/src/lt/objs/titlebar.cljs index 581bd0858..51adc771b 100644 --- a/src/lt/objs/titlebar.cljs +++ b/src/lt/objs/titlebar.cljs @@ -1,4 +1,5 @@ (ns lt.objs.titlebar + "Provide titlebar (not enabled by default) and window related commands" (:require [lt.object :as object] [lt.objs.app :as app] [lt.objs.tabs :as tabs] diff --git a/src/lt/objs/version.cljs b/src/lt/objs/version.cljs index 0a94db497..3a04ee148 100644 --- a/src/lt/objs/version.cljs +++ b/src/lt/objs/version.cljs @@ -1,4 +1,5 @@ (ns lt.objs.version + "Provide LT version command" (:require [lt.object :as object] [lt.objs.sidebar.command :as cmd] [lt.objs.opener :as opener] diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 5297b045e..f917d083f 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -1,4 +1,5 @@ (ns lt.objs.workspace + "Provide workspace object and associated behaviors" (:require [lt.object :as object] [lt.objs.app :as app] [lt.objs.files :as files] diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 9e54c6155..9430f7c55 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -1,4 +1,5 @@ (ns lt.plugins.auto-complete + "Provide any auto-complete related functionality" (:require [lt.object :as object] [lt.objs.keyboard :as keyboard] [lt.objs.command :as cmd] diff --git a/src/lt/plugins/auto_paren.cljs b/src/lt/plugins/auto_paren.cljs index 3dd52a2bb..a230decbe 100644 --- a/src/lt/plugins/auto_paren.cljs +++ b/src/lt/plugins/auto_paren.cljs @@ -1,4 +1,5 @@ (ns lt.plugins.auto-paren + "Provide pair character e.g. () related commands" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.editor :as editor] diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index 81fe8f584..55dda4c78 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -1,4 +1,5 @@ (ns lt.plugins.doc + "Provide documentation sidebar for searching docs. Used by language plugins" (:require [lt.object :as object] [lt.objs.context :as ctx] [lt.objs.clients :as clients] diff --git a/src/lt/plugins/watches.cljs b/src/lt/plugins/watches.cljs index 79d41bbab..81cac8761 100644 --- a/src/lt/plugins/watches.cljs +++ b/src/lt/plugins/watches.cljs @@ -1,4 +1,5 @@ (ns lt.plugins.watches + "Provide watch related commands" (:require [lt.object :as object] [lt.objs.command :as cmd] [lt.objs.editor :as ed] diff --git a/src/lt/util/cljs.cljs b/src/lt/util/cljs.cljs index 266145011..18ffc7c89 100644 --- a/src/lt/util/cljs.cljs +++ b/src/lt/util/cljs.cljs @@ -1,4 +1,5 @@ (ns lt.util.cljs + "Set up cljs and provide a few misc util fns" (:refer-clojure :exclude [js->clj clj->js]) (:require [clojure.string :as string])) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index e9c0ba8b6..429294e5e 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -1,4 +1,5 @@ (ns lt.util.dom + "Provide DOM related fns" (:refer-clojure :exclude [parents remove next val empty])) (defn lazy-nl-via-item diff --git a/src/lt/util/events.cljs b/src/lt/util/events.cljs index fedbfed4a..42f6eecb0 100644 --- a/src/lt/util/events.cljs +++ b/src/lt/util/events.cljs @@ -1,4 +1,5 @@ -(ns lt.util.events) +(ns lt.util.events + "Provide DOM event related fns") (defn capture ([ev handler] (capture js/document ev handler)) diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs index 1256af454..a638ebad0 100644 --- a/src/lt/util/ipc.cljs +++ b/src/lt/util/ipc.cljs @@ -1,5 +1,5 @@ (ns lt.util.ipc - "Util functions for the ipc renderer - https://github.com/atom/atom-shell/blob/master/docs/api/ipc-renderer.md") + "Util functions for the ipc renderer - https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md") (def ipc (js/require "ipc")) diff --git a/src/lt/util/js.cljs b/src/lt/util/js.cljs index 708709e08..e20b5faab 100644 --- a/src/lt/util/js.cljs +++ b/src/lt/util/js.cljs @@ -1,4 +1,5 @@ -(ns lt.util.js) +(ns lt.util.js + "Provide misc js related fns") (defn every [ms func] (js/setInterval func ms)) diff --git a/src/lt/util/kahn.cljs b/src/lt/util/kahn.cljs index e126c7ed2..c8b1372e6 100644 --- a/src/lt/util/kahn.cljs +++ b/src/lt/util/kahn.cljs @@ -1,4 +1,5 @@ (ns lt.util.kahn + "Provide a Khan sort" (:require [clojure.set :as set :refer [difference union intersection]])) (defn without @@ -38,4 +39,4 @@ (let [[n s'] (take-1 s) m (g n) g' (reduce #(update-in % [n] without %2) g m)] - (recur g' (conj l n) (union s' (intersection (no-incoming g') m))))))) \ No newline at end of file + (recur g' (conj l n) (union s' (intersection (no-incoming g') m))))))) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 382002e1f..57769ba45 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -1,4 +1,5 @@ (ns lt.util.load + "Provide fns to load js, css and node module assets into LT" (:require [clojure.string :as string])) (def fpath (js/require "path")) diff --git a/src/lt/util/style.cljs b/src/lt/util/style.cljs index 2495c6ce0..5f8070584 100644 --- a/src/lt/util/style.cljs +++ b/src/lt/util/style.cljs @@ -1,4 +1,5 @@ -(ns lt.util.style) +(ns lt.util.style + "Provide style related fns") (defn ->px [s] (str (or s 0) "px")) From 033d458908e24de3bf6b0d023756b3195869f1ce Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 13 Dec 2014 19:54:55 -0500 Subject: [PATCH 475/656] Start a package.json for dependencies that are vendored 4 node packages were identified as vendored. npm install-ing them made slight changes to their package.json and comments but did not modify any runtime code. Remaining node packages were identified as forked dependencies or are not used at all. --- deploy/core/.gitignore | 1 + .../node_modules/wordwrap/package.json | 26 +++++++++++++++-- .../core/node_modules/optimist/package.json | 22 +++++++++++++-- deploy/core/node_modules/request/main.js | 4 +-- deploy/core/node_modules/request/package.json | 28 +++++++++++++++---- deploy/core/node_modules/wrench/package.json | 20 +++++++++---- deploy/core/package.json | 16 +++++++++++ doc/for-committers.md | 27 ++++++++++++------ 8 files changed, 117 insertions(+), 27 deletions(-) create mode 100644 deploy/core/package.json diff --git a/deploy/core/.gitignore b/deploy/core/.gitignore index ffed9615a..ecac4cb0c 100644 --- a/deploy/core/.gitignore +++ b/deploy/core/.gitignore @@ -4,3 +4,4 @@ node_modules/codemirror/keymap/vim.js node_modules/codemirror/theme/ node_modules/codemirror/test/ node_modules/codemirror/bin/ +node_modules/.bin diff --git a/deploy/core/node_modules/optimist/node_modules/wordwrap/package.json b/deploy/core/node_modules/optimist/node_modules/wordwrap/package.json index e923136db..ae93ca882 100644 --- a/deploy/core/node_modules/optimist/node_modules/wordwrap/package.json +++ b/deploy/core/node_modules/optimist/node_modules/wordwrap/package.json @@ -34,8 +34,28 @@ "email": "mail@substack.net", "url": "http://substack.net" }, - "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n", - "readmeFilename": "README.markdown", "_id": "wordwrap@0.0.2", - "_from": "wordwrap@~0.0.2" + "dependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.0.10", + "_nodeVersion": "v0.5.0-pre", + "_defaultsLoaded": true, + "dist": { + "shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", + "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", + "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "_from": "wordwrap@>=0.0.2 <0.1.0", + "bugs": { + "url": "https://github.com/substack/node-wordwrap/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/substack/node-wordwrap" } diff --git a/deploy/core/node_modules/optimist/package.json b/deploy/core/node_modules/optimist/package.json index 6fe778437..de0429c87 100644 --- a/deploy/core/node_modules/optimist/package.json +++ b/deploy/core/node_modules/optimist/package.json @@ -35,8 +35,24 @@ "engine": { "node": ">=0.4" }, - "readme": "optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n![This one's optimistic.](http://substack.net/images/optimistic.png)\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\nshort numbers\n-------------\n\nShort numeric `head -n5` style argument work too:\n\n $ node reflect.js -n123 -m456\n { '3': true,\n '6': true,\n _: [],\n '$0': 'node ./reflect.js',\n n: 123,\n m: 456 }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n", - "readmeFilename": "readme.markdown", "_id": "optimist@0.5.2", - "_from": "optimist@" + "dist": { + "shasum": "85c8c1454b3315e4a78947e857b1df033450bfbc", + "tarball": "http://registry.npmjs.org/optimist/-/optimist-0.5.2.tgz" + }, + "_from": "optimist@0.5.2", + "_npmVersion": "1.2.2", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_shasum": "85c8c1454b3315e4a78947e857b1df033450bfbc", + "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.5.2.tgz" } diff --git a/deploy/core/node_modules/request/main.js b/deploy/core/node_modules/request/main.js index fe8a0d2f9..5ee2cfa41 100644 --- a/deploy/core/node_modules/request/main.js +++ b/deploy/core/node_modules/request/main.js @@ -171,8 +171,8 @@ Request.prototype.init = function (options) { var message = 'Invalid URI "' + faultyUri + '"' if (Object.keys(options).length === 0) { // No option ? This can be the sign of a redirect - // As this is a case where the user cannot do anything (they didn't call request directly with this URL) - // they should be warned that it can be caused by a redirection (can save some hair) + // As this is a case where the user cannot do anything (he didn't call request directly with this URL) + // he should be warned that it can be caused by a redirection (can save some hair) message += '. This can be caused by a crappy redirection.' } self.emit('error', new Error(message)) diff --git a/deploy/core/node_modules/request/package.json b/deploy/core/node_modules/request/package.json index b912dbb4b..971aa0566 100644 --- a/deploy/core/node_modules/request/package.json +++ b/deploy/core/node_modules/request/package.json @@ -14,7 +14,7 @@ }, "repository": { "type": "git", - "url": "http://github.com/mikeal/request.git" + "url": "git://github.com/mikeal/request.git" }, "bugs": { "url": "http://github.com/mikeal/request/issues" @@ -34,11 +34,29 @@ "scripts": { "test": "node tests/run.js" }, - "readme": "# Request -- Simplified HTTP request method\n\n## Install\n\n

\n  npm install request\n
\n\nOr from source:\n\n
\n  git clone git://github.com/mikeal/request.git \n  cd request\n  npm link\n
\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let's get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n } \n }\n})\n```\n\nYou can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nUrl encoded forms are simple\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.auth('username', 'password', false).get('http://some.server.com/');\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to true, which will cause a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Assume by some stretch of magic you aquired the verifier\n var access_token = qs.parse(body)\n , oauth = \n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: VERIFIER\n , token_secret: access_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth = \n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1/users/show.json?'\n , params = \n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n\n\n### request(options, callback)\n\nThe first argument can be either a url or an options object. The only required option is uri, all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()\n* `qs` - object containing querystring values to be appended to the uri\n* `method` - http method, defaults to GET\n* `headers` - http headers, defaults to {}\n* `body` - entity body for POST and PUT requests. Must be buffer or string.\n* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.\n* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.\n* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.\n* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\t\n* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.\n* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.\n* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.\n* `jar` - Set to `false` if you don't want cookies to be remembered for future use or define your custom cookie jar (see examples section)\n* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)\n\n\nThe callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second in an http.ClientResponse object. The third is the response body String or Buffer.\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options) \n \nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as request() but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.post\n\nSame as request() but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as request() but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nAlias to normal request method for uniformity.\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart: \n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ] \n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\nCookies are enabled by default (so they can be used in subsequent requests). To disable cookies set jar to false (either in defaults or in the options sent).\n\n```javascript\nvar request = request.defaults({jar: false})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nIf you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n request('http://images.google.com')\n})\n```\n", - "readmeFilename": "README.md", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, "_id": "request@2.14.0", + "devDependencies": {}, + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.24", + "_nodeVersion": "v0.8.1", + "_defaultsLoaded": true, "dist": { - "shasum": "0d8acbb0b14c1ab82e000b7d381fa8c80d1a7d88" + "shasum": "0d8acbb0b14c1ab82e000b7d381fa8c80d1a7d88", + "tarball": "http://registry.npmjs.org/request/-/request-2.14.0.tgz" }, - "_from": "request" + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + } + ], + "directories": {}, + "_shasum": "0d8acbb0b14c1ab82e000b7d381fa8c80d1a7d88", + "_resolved": "https://registry.npmjs.org/request/-/request-2.14.0.tgz", + "_from": "request@2.14.0" } diff --git a/deploy/core/node_modules/wrench/package.json b/deploy/core/node_modules/wrench/package.json index 55c367efe..c0cc6d2ed 100644 --- a/deploy/core/node_modules/wrench/package.json +++ b/deploy/core/node_modules/wrench/package.json @@ -33,13 +33,23 @@ "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" } ], - "readme": "wrench.js - Recursive file operations in Node.js\n----------------------------------------------------------------------------\nWhile I love Node.js, I've found myself missing some functions. Things like\nrecursively deleting/chmodding a directory (or even deep copying a directory),\nor even a basic line reader, shouldn't need to be re-invented time and time again.\n\nThat said, here's my attempt at a re-usable solution, at least until something\nmore formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple\nto use - check out the documentation/examples below:\n\nPossibly Breaking Change in v1.5.0\n-----------------------------------------------------------------------------\nIn previous versions of Wrench, we went against the OS-default behavior of not\ndeleting a directory unless the operation is forced. In 1.5.0, this has been\nchanged to be the behavior people expect there to be - if you try to copy over\na directory that already exists, you'll get an Error returned or thrown stating\nthat you need to force it.\n\nSomething like this will do the trick:\n\n``` javascript\nwrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', {\n forceDelete: true\n});\n```\n\nIf you desire the older behavior of Wrench... hit up your package.json. If you\nhappen to find bugs in the 1.5.0 release please feel free to file them on the \nGitHub issues tracker for this project, or send me a pull request and I'll get to\nit as fast as I can. Thanks!\n\n**If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.**\n\nInstallation\n-----------------------------------------------------------------------------\n\n npm install wrench\n\nUsage\n-----------------------------------------------------------------------------\n``` javascript\nvar wrench = require('wrench'),\n\tutil = require('util');\n```\n\n### Synchronous operations\n``` javascript\n// Recursively create directories, sub-trees and all.\nwrench.mkdirSyncRecursive(dir, 0777);\n\n// Recursively delete the entire sub-tree of a directory, then kill the directory\nwrench.rmdirSyncRecursive('my_directory_name', failSilently);\n\n// Recursively read directories contents.\nwrench.readdirSyncRecursive('my_directory_name');\n\n// Recursively chmod the entire sub-tree of a directory\nwrench.chmodSyncRecursive('my_directory_name', 0755);\n\n// Recursively chown the entire sub-tree of a directory\nwrench.chownSyncRecursive(\"directory\", uid, gid);\n\n// Deep-copy an existing directory\nwrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', {\n forceDelete: bool, // Whether to overwrite existing directory or not\n excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .)\n preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing\n inflateSymlinks: bool, // Whether to follow symlinks or not when copying files\n filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude).\n whitelist: bool, // if true every file or directory which doesn't match filter will be ignored\n include: regexpOrFunction, // An include filter (either a regexp or a function)\n exclude: regexpOrFunction // An exclude filter (either a regexp or a function)\n});\n\n// Note: If a RegExp is provided then then it will be matched against the filename. If a function is\n// provided then the signature should be the following:\n// function(filename, dir) { return result; }\n\n// Read lines in from a file until you hit the end\nvar f = new wrench.LineReader('x.txt');\nwhile(f.hasNextLine()) {\n\tutil.puts(f.getNextLine());\n}\n\n// Note: You will need to close that above line reader at some point, otherwise\n// you will run into a \"too many open files\" error. f.close() or fs.closeSync(f.fd) are\n// your friends, as only you know when it is safe to close.\n```\n\n### Asynchronous operations\n``` javascript\n// Recursively read directories contents\nvar files = [];\nwrench.readdirRecursive('my_directory_name', function(error, curFiles) {\n // curFiles is what you want\n});\n\n// If you're feeling somewhat masochistic\nwrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn);\n```\n\nQuestions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath)\n", - "readmeFilename": "readme.md", - "homepage": "https://github.com/ryanmcgrath/wrench-js", "_id": "wrench@1.5.6", "dist": { - "shasum": "437b1a15b042162db51dfcf6df1c1ba5f32cb472" + "shasum": "247b7dfe5d7d4374d5e449761fba634190d9b871", + "tarball": "http://registry.npmjs.org/wrench/-/wrench-1.5.6.tgz" }, - "_from": "wrench@", + "_from": "wrench@1.5.6", + "_npmVersion": "1.2.25", + "_npmUser": { + "name": "ryanmcgrath", + "email": "ryan@venodesigns.net" + }, + "maintainers": [ + { + "name": "ryanmcgrath", + "email": "ryan@venodesigns.net" + } + ], + "_shasum": "247b7dfe5d7d4374d5e449761fba634190d9b871", "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.6.tgz" } diff --git a/deploy/core/package.json b/deploy/core/package.json new file mode 100644 index 000000000..411342eac --- /dev/null +++ b/deploy/core/package.json @@ -0,0 +1,16 @@ +{ + "name": "LightTablePackages", + "description": "Vendored node dependencies for Light Table", + "dependencies": { + "codemirror": "^4.7.0", + "optimist": "^0.5.2", + "request": "^2.14.0", + "wrench": "^1.5.6" + }, + "forkedDependencies": { + "replace": "^0.2.7", + "socket.io": "^0.9.13", + "shelljs": "^0.1.4", + "tar": "^0.1.19" + } +} diff --git a/doc/for-committers.md b/doc/for-committers.md index c9d224b90..baa3c7bcb 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -1,15 +1,24 @@ ## Dependencies -### Node packages -Node dependencies live in deploy/core/node_modules/. To update an individual dependency: `cd deploy/core && npm -install NAME@VERSION` e.g. `npm install codemirror@4.8.0`. Following packages are known to be -vendored: +### ClojureScript + +Current ClojureScript version and libraries we use are in [project.clj](https://github.com/LightTable/LightTable/blob/master/project.clj). -* codemirror - Provides all codemirror files except for themes +### Node packages -Following packages are specific to Light Table i.e. _not_ vendored: +Node dependencies are at deploy/core/node\_modules/. This directory is currently a mix of vendored +dependencies, forked dependencies and Light Table specific libraries: -* clojurescript - Provides cljsDeps.js -* codemirror_addons - Provides codemirror addons -* lighttable - Main lighttable js libs +* Vendored dependencies are `"dependencies"` in [package.json](https://github.com/LightTable/LightTable/blob/master/deploy/core/package.json) + * These are dependencies that should _not_ be modified and should be updated with upstream versions. + * To update an individual dependency: `cd deploy/core && npm install NAME@VERSION` e.g. `npm install codemirror@4.8.0`. + * To see outdated dependencies: `npm outdated`. + * Dependencies should _not_ be updated without good QA and checking the dependency's changelog. +* Forked dependencies are `"forkedDependencies"` in [package.json](https://github.com/LightTable/LightTable/blob/master/deploy/core/package.json) + * These packages have had custom commits that should get sent upstream. These should eventually become vendored dependencies. + * Some of them differ slightly from the original e.g. shelljs while others vary much more e.g. socket.io. +* Light Table specific libraries + * clojurescript - Provides cljsDeps.js + * codemirror\_addons - Provides codemirror addons + * lighttable - Mostly lighttable js libs _except for_ lighttable/util/{keyevents.js,throttle.js} which should be moved to vendored dependencies. From cfcd94dff11b889803d9b0025733f4c950bf8079 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 25 Aug 2015 01:34:52 -0400 Subject: [PATCH 476/656] Remove unused node packages * marked - removed from use on d1f15bc661d15ae450fe3f35bc2f0c278d0669bf * source-map - never used * walkdir - removed from use on 3fd56c9b010935ee3b379d9b1766c2210fc07978 * watchr - removed from use on 17eb38c06fdc0497279c8a42bb04b3f3fc723d76 * acorn.js - JS plugin ships with its own acorn.js now --- deploy/core/node_modules/acorn.js | 1719 ----------------- deploy/core/node_modules/marked/.npmignore | 2 - deploy/core/node_modules/marked/LICENSE | 19 - deploy/core/node_modules/marked/Makefile | 9 - deploy/core/node_modules/marked/README.md | 125 -- deploy/core/node_modules/marked/bin/marked | 127 -- deploy/core/node_modules/marked/index.js | 1 - deploy/core/node_modules/marked/lib/marked.js | 781 -------- deploy/core/node_modules/marked/man/marked.1 | 49 - deploy/core/node_modules/marked/package.json | 45 - .../core/node_modules/source-map/.npmignore | 2 - .../core/node_modules/source-map/.travis.yml | 4 - .../core/node_modules/source-map/CHANGELOG.md | 104 - deploy/core/node_modules/source-map/LICENSE | 28 - .../source-map/Makefile.dryice.js | 166 -- deploy/core/node_modules/source-map/README.md | 434 ----- .../source-map/build/assert-shim.js | 56 - .../source-map/build/mini-require.js | 152 -- .../source-map/build/prefix-source-map.jsm | 20 - .../source-map/build/prefix-utils.jsm | 18 - .../source-map/build/suffix-browser.js | 8 - .../source-map/build/suffix-source-map.jsm | 6 - .../source-map/build/suffix-utils.jsm | 21 - .../source-map/build/test-prefix.js | 8 - .../source-map/build/test-suffix.js | 3 - .../node_modules/source-map/lib/source-map.js | 8 - .../source-map/lib/source-map/array-set.js | 97 - .../source-map/lib/source-map/base64-vlq.js | 144 -- .../source-map/lib/source-map/base64.js | 42 - .../lib/source-map/binary-search.js | 81 - .../lib/source-map/source-map-consumer.js | 441 ----- .../lib/source-map/source-map-generator.js | 380 ---- .../source-map/lib/source-map/source-node.js | 371 ---- .../source-map/lib/source-map/util.js | 205 -- .../source-map/node_modules/amdefine/LICENSE | 58 - .../node_modules/amdefine/README.md | 119 -- .../node_modules/amdefine/amdefine.js | 299 --- .../node_modules/amdefine/package.json | 37 - .../core/node_modules/source-map/package.json | 107 - .../node_modules/source-map/test/run-tests.js | 71 - .../source-map/test/source-map/test-api.js | 26 - .../test/source-map/test-array-set.js | 104 - .../test/source-map/test-base64-vlq.js | 24 - .../source-map/test/source-map/test-base64.js | 35 - .../test/source-map/test-binary-search.js | 54 - .../test/source-map/test-dog-fooding.js | 72 - .../source-map/test-source-map-consumer.js | 451 ----- .../source-map/test-source-map-generator.js | 417 ---- .../test/source-map/test-source-node.js | 365 ---- .../source-map/test/source-map/util.js | 161 -- .../core/node_modules/walkdir/.jshintignore | 3 - deploy/core/node_modules/walkdir/.npmignore | 2 - deploy/core/node_modules/walkdir/.travis.yml | 3 - deploy/core/node_modules/walkdir/license | 10 - deploy/core/node_modules/walkdir/package.json | 49 - deploy/core/node_modules/walkdir/readme.md | 160 -- deploy/core/node_modules/walkdir/test.sh | 20 - .../core/node_modules/walkdir/test/async.js | 62 - .../walkdir/test/comparison/find.js | 33 - .../walkdir/test/comparison/find.py | 26 - .../walkdir/test/comparison/finditsynctest.js | 15 - .../walkdir/test/comparison/findittest.js | 14 - .../walkdir/test/comparison/fstream.js | 24 - .../test/comparison/install_test_deps.sh | 3 - .../walkdir/test/comparison/lsr.js | 18 - .../walkdir/test/comparison/package.json | 10 - .../node_modules/walkdir/test/dir/foo/a/b/c/w | 0 .../node_modules/walkdir/test/dir/foo/a/b/z | 0 .../node_modules/walkdir/test/dir/foo/a/y | 0 .../core/node_modules/walkdir/test/dir/foo/x | 0 .../walkdir/test/dir/symlinks/dir1/file1 | 0 .../walkdir/test/dir/symlinks/dir2/file2 | 0 .../walkdir/test/dir/symlinks/file | 0 .../node_modules/walkdir/test/endearly.js | 19 - .../node_modules/walkdir/test/max_depth.js | 27 - .../node_modules/walkdir/test/no_recurse.js | 25 - .../walkdir/test/nofailemptydir.js | 34 - .../node_modules/walkdir/test/pauseresume.js | 36 - .../core/node_modules/walkdir/test/symlink.js | 37 - deploy/core/node_modules/walkdir/test/sync.js | 50 - deploy/core/node_modules/walkdir/walkdir.js | 232 --- deploy/core/node_modules/watchr/.npmignore | 9 - deploy/core/node_modules/watchr/Cakefile | 132 -- deploy/core/node_modules/watchr/README.md | 112 -- deploy/core/node_modules/watchr/bin/watchr | 43 - .../watchr/node_modules/bal-util/.npmignore | 8 - .../watchr/node_modules/bal-util/LICENSE.md | 9 - .../watchr/node_modules/bal-util/README.md | 50 - .../bal-util/node_modules/ambi/.npmignore | 8 - .../bal-util/node_modules/ambi/LICENSE.md | 10 - .../bal-util/node_modules/ambi/README.md | 75 - .../node_modules/ambi/out/lib/ambi.js | 57 - .../bal-util/node_modules/ambi/package.json | 62 - .../node_modules/bal-util/out/lib/balutil.js | 6 - .../node_modules/bal-util/out/lib/compare.js | 141 -- .../node_modules/bal-util/out/lib/events.js | 314 --- .../node_modules/bal-util/out/lib/flow.js | 119 -- .../node_modules/bal-util/out/lib/html.js | 94 - .../node_modules/bal-util/out/lib/modules.js | 518 ----- .../node_modules/bal-util/out/lib/paths.js | 729 ------- .../watchr/node_modules/bal-util/package.json | 86 - .../watchr/node_modules/eachr/.npmignore | 8 - .../watchr/node_modules/eachr/LICENSE.md | 10 - .../watchr/node_modules/eachr/README.md | 56 - .../watchr/node_modules/eachr/example.js | 23 - .../node_modules/eachr/out/lib/eachr.js | 29 - .../watchr/node_modules/eachr/package.json | 59 - .../watchr/node_modules/extendr/.npmignore | 8 - .../watchr/node_modules/extendr/LICENSE.md | 10 - .../watchr/node_modules/extendr/README.md | 71 - .../node_modules/extendr/out/lib/extendr.js | 123 -- .../watchr/node_modules/extendr/package.json | 62 - .../watchr/node_modules/safefs/.npmignore | 8 - .../watchr/node_modules/safefs/LICENSE.md | 10 - .../watchr/node_modules/safefs/README.md | 60 - .../node_modules/safefs/out/lib/safefs.js | 195 -- .../watchr/node_modules/safefs/package.json | 62 - .../watchr/node_modules/taskgroup/.npmignore | 8 - .../watchr/node_modules/taskgroup/LICENSE.md | 10 - .../watchr/node_modules/taskgroup/README.md | 156 -- .../watchr/node_modules/taskgroup/example.js | 61 - .../taskgroup/node_modules/ambi/.npmignore | 8 - .../taskgroup/node_modules/ambi/LICENSE.md | 10 - .../taskgroup/node_modules/ambi/README.md | 75 - .../node_modules/ambi/out/lib/ambi.js | 57 - .../taskgroup/node_modules/ambi/package.json | 62 - .../node_modules/eventemitter2/README.md | 212 -- .../node_modules/eventemitter2/index.js | 1 - .../eventemitter2/lib/eventemitter2.js | 561 ------ .../node_modules/eventemitter2/package.json | 62 - .../taskgroup/out/lib/taskgroup.js | 410 ---- .../node_modules/taskgroup/package.json | 65 - .../node_modules/typechecker/.npmignore | 8 - .../node_modules/typechecker/LICENSE.md | 10 - .../watchr/node_modules/typechecker/README.md | 56 - .../typechecker/out/lib/typechecker.js | 83 - .../node_modules/typechecker/package.json | 56 - .../node_modules/watchr/out/lib/watchr.js | 809 -------- deploy/core/node_modules/watchr/package.json | 82 - 139 files changed, 15226 deletions(-) delete mode 100644 deploy/core/node_modules/acorn.js delete mode 100644 deploy/core/node_modules/marked/.npmignore delete mode 100644 deploy/core/node_modules/marked/LICENSE delete mode 100644 deploy/core/node_modules/marked/Makefile delete mode 100644 deploy/core/node_modules/marked/README.md delete mode 100755 deploy/core/node_modules/marked/bin/marked delete mode 100644 deploy/core/node_modules/marked/index.js delete mode 100644 deploy/core/node_modules/marked/lib/marked.js delete mode 100644 deploy/core/node_modules/marked/man/marked.1 delete mode 100644 deploy/core/node_modules/marked/package.json delete mode 100644 deploy/core/node_modules/source-map/.npmignore delete mode 100644 deploy/core/node_modules/source-map/.travis.yml delete mode 100644 deploy/core/node_modules/source-map/CHANGELOG.md delete mode 100644 deploy/core/node_modules/source-map/LICENSE delete mode 100644 deploy/core/node_modules/source-map/Makefile.dryice.js delete mode 100644 deploy/core/node_modules/source-map/README.md delete mode 100644 deploy/core/node_modules/source-map/build/assert-shim.js delete mode 100644 deploy/core/node_modules/source-map/build/mini-require.js delete mode 100644 deploy/core/node_modules/source-map/build/prefix-source-map.jsm delete mode 100644 deploy/core/node_modules/source-map/build/prefix-utils.jsm delete mode 100644 deploy/core/node_modules/source-map/build/suffix-browser.js delete mode 100644 deploy/core/node_modules/source-map/build/suffix-source-map.jsm delete mode 100644 deploy/core/node_modules/source-map/build/suffix-utils.jsm delete mode 100644 deploy/core/node_modules/source-map/build/test-prefix.js delete mode 100644 deploy/core/node_modules/source-map/build/test-suffix.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/array-set.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/base64-vlq.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/base64.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/binary-search.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/source-map-consumer.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/source-map-generator.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/source-node.js delete mode 100644 deploy/core/node_modules/source-map/lib/source-map/util.js delete mode 100644 deploy/core/node_modules/source-map/node_modules/amdefine/LICENSE delete mode 100644 deploy/core/node_modules/source-map/node_modules/amdefine/README.md delete mode 100644 deploy/core/node_modules/source-map/node_modules/amdefine/amdefine.js delete mode 100644 deploy/core/node_modules/source-map/node_modules/amdefine/package.json delete mode 100644 deploy/core/node_modules/source-map/package.json delete mode 100644 deploy/core/node_modules/source-map/test/run-tests.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-api.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-array-set.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-base64-vlq.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-base64.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-binary-search.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-dog-fooding.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-source-map-consumer.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-source-map-generator.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/test-source-node.js delete mode 100644 deploy/core/node_modules/source-map/test/source-map/util.js delete mode 100644 deploy/core/node_modules/walkdir/.jshintignore delete mode 100644 deploy/core/node_modules/walkdir/.npmignore delete mode 100644 deploy/core/node_modules/walkdir/.travis.yml delete mode 100644 deploy/core/node_modules/walkdir/license delete mode 100644 deploy/core/node_modules/walkdir/package.json delete mode 100644 deploy/core/node_modules/walkdir/readme.md delete mode 100755 deploy/core/node_modules/walkdir/test.sh delete mode 100644 deploy/core/node_modules/walkdir/test/async.js delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/find.js delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/find.py delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/finditsynctest.js delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/findittest.js delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/fstream.js delete mode 100755 deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/lsr.js delete mode 100644 deploy/core/node_modules/walkdir/test/comparison/package.json delete mode 100644 deploy/core/node_modules/walkdir/test/dir/foo/a/b/c/w delete mode 100644 deploy/core/node_modules/walkdir/test/dir/foo/a/b/z delete mode 100644 deploy/core/node_modules/walkdir/test/dir/foo/a/y delete mode 100644 deploy/core/node_modules/walkdir/test/dir/foo/x delete mode 100644 deploy/core/node_modules/walkdir/test/dir/symlinks/dir1/file1 delete mode 100644 deploy/core/node_modules/walkdir/test/dir/symlinks/dir2/file2 delete mode 100644 deploy/core/node_modules/walkdir/test/dir/symlinks/file delete mode 100644 deploy/core/node_modules/walkdir/test/endearly.js delete mode 100644 deploy/core/node_modules/walkdir/test/max_depth.js delete mode 100644 deploy/core/node_modules/walkdir/test/no_recurse.js delete mode 100644 deploy/core/node_modules/walkdir/test/nofailemptydir.js delete mode 100644 deploy/core/node_modules/walkdir/test/pauseresume.js delete mode 100644 deploy/core/node_modules/walkdir/test/symlink.js delete mode 100644 deploy/core/node_modules/walkdir/test/sync.js delete mode 100644 deploy/core/node_modules/walkdir/walkdir.js delete mode 100755 deploy/core/node_modules/watchr/.npmignore delete mode 100644 deploy/core/node_modules/watchr/Cakefile delete mode 100644 deploy/core/node_modules/watchr/README.md delete mode 100755 deploy/core/node_modules/watchr/bin/watchr delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/README.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/out/lib/ambi.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/package.json delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/balutil.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/compare.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/events.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/flow.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/html.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/modules.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/paths.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/bal-util/package.json delete mode 100755 deploy/core/node_modules/watchr/node_modules/eachr/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/eachr/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/eachr/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/eachr/example.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/eachr/out/lib/eachr.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/eachr/package.json delete mode 100755 deploy/core/node_modules/watchr/node_modules/extendr/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/extendr/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/extendr/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/extendr/out/lib/extendr.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/extendr/package.json delete mode 100755 deploy/core/node_modules/watchr/node_modules/safefs/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/safefs/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/safefs/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/safefs/out/lib/safefs.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/safefs/package.json delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/example.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/out/lib/ambi.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/package.json delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/index.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/lib/eventemitter2.js delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/package.json delete mode 100644 deploy/core/node_modules/watchr/node_modules/taskgroup/out/lib/taskgroup.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/taskgroup/package.json delete mode 100755 deploy/core/node_modules/watchr/node_modules/typechecker/.npmignore delete mode 100755 deploy/core/node_modules/watchr/node_modules/typechecker/LICENSE.md delete mode 100755 deploy/core/node_modules/watchr/node_modules/typechecker/README.md delete mode 100644 deploy/core/node_modules/watchr/node_modules/typechecker/out/lib/typechecker.js delete mode 100755 deploy/core/node_modules/watchr/node_modules/typechecker/package.json delete mode 100644 deploy/core/node_modules/watchr/out/lib/watchr.js delete mode 100644 deploy/core/node_modules/watchr/package.json diff --git a/deploy/core/node_modules/acorn.js b/deploy/core/node_modules/acorn.js deleted file mode 100644 index 8bb4cb812..000000000 --- a/deploy/core/node_modules/acorn.js +++ /dev/null @@ -1,1719 +0,0 @@ -// Acorn is a tiny, fast JavaScript parser written in JavaScript. -// -// Acorn was written by Marijn Haverbeke and released under an MIT -// license. The Unicode regexps (for identifiers and whitespace) were -// taken from [Esprima](http://esprima.org) by Ariya Hidayat. -// -// Git repositories for Acorn are available at -// -// http://marijnhaverbeke.nl/git/acorn -// https://github.com/marijnh/acorn.git -// -// Please use the [github bug tracker][ghbt] to report issues. -// -// [ghbt]: https://github.com/marijnh/acorn/issues -// -// This file defines the main parser interface. The library also comes -// with a [error-tolerant parser][dammit] and an -// [abstract syntax tree walker][walk], defined in other files. -// -// [dammit]: acorn_loose.js -// [walk]: util/walk.js - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS - if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD - mod(self.acorn || (self.acorn = {})); // Plain browser env -})(function(exports) { - "use strict"; - - exports.version = "0.1.01"; - - // The main exported interface (under `self.acorn` when in the - // browser) is a `parse` function that takes a code string and - // returns an abstract syntax tree as specified by [Mozilla parser - // API][api], with the caveat that the SpiderMonkey-specific syntax - // (`let`, `yield`, inline XML, etc) is not recognized. - // - // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - - var options, input, inputLen, sourceFile; - - exports.parse = function(inpt, opts) { - input = String(inpt); inputLen = input.length; - setOptions(opts); - initTokenState(); - return parseTopLevel(options.program); - }; - - // A second optional argument can be given to further configure - // the parser process. These options are recognized: - - var defaultOptions = exports.defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3 or 5. This - // influences support for strict mode, the set of reserved words, and - // support for getters and setter. - ecmaVersion: 5, - // Turn on `strictSemicolons` to prevent the parser from doing - // automatic semicolon insertion. - strictSemicolons: false, - // When `allowTrailingCommas` is false, the parser will not allow - // trailing commas in array and object literals. - allowTrailingCommas: true, - // By default, reserved words are not enforced. Enable - // `forbidReserved` to enforce them. - forbidReserved: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // A function can be passed as `onComment` option, which will - // cause Acorn to call that function with `(block, text, start, - // end)` parameters whenever a comment is skipped. `block` is a - // boolean indicating whether this is a block (`/* */`) comment, - // `text` is the content of the comment, and `start` and `end` are - // character offsets that denote the start and end of the comment. - // When the `locations` option is on, two more parameters are - // passed, the full `{line, column}` locations of the start and - // end of the comments. - onComment: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `location` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null - }; - - function setOptions(opts) { - options = opts || {}; - for (var opt in defaultOptions) if (!options.hasOwnProperty(opt)) - options[opt] = defaultOptions[opt]; - sourceFile = options.sourceFile || null; - } - - // 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. - - var getLineInfo = exports.getLineInfo = function(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreak.lastIndex = cur; - var match = lineBreak.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else break; - } - return {line: line, column: offset - cur}; - }; - - // Acorn is organized as a tokenizer and a recursive-descent parser. - // The `tokenize` export provides an interface to the tokenizer. - // Because the tokenizer is optimized for being efficiently used by - // the Acorn parser itself, this interface is somewhat crude and not - // very modular. Performing another parse or call to `tokenize` will - // reset the internal state, and invalidate existing tokenizers. - - exports.tokenize = function(inpt, opts) { - input = String(inpt); inputLen = input.length; - setOptions(opts); - initTokenState(); - - var t = {}; - function getToken(forceRegexp) { - readToken(forceRegexp); - t.start = tokStart; t.end = tokEnd; - t.startLoc = tokStartLoc; t.endLoc = tokEndLoc; - t.type = tokType; t.value = tokVal; - return t; - } - getToken.jumpTo = function(pos, reAllowed) { - tokPos = pos; - if (options.locations) { - tokCurLine = tokLineStart = lineBreak.lastIndex = 0; - var match; - while ((match = lineBreak.exec(input)) && match.index < pos) { - ++tokCurLine; - tokLineStart = match.index + match[0].length; - } - } - var ch = input.charAt(pos - 1); - tokRegexpAllowed = reAllowed; - skipSpace(); - }; - return getToken; - }; - - // State is kept in (closure-)global variables. We already saw the - // `options`, `input`, and `inputLen` variables above. - - // The current position of the tokenizer in the input. - - var tokPos; - - // The start and end offsets of the current token. - - var tokStart, tokEnd; - - // When `options.locations` is true, these hold objects - // containing the tokens start and end line/column pairs. - - var tokStartLoc, tokEndLoc; - - // The type and value of the current token. Token types are objects, - // named by variables against which they can be compared, and - // holding properties that describe them (indicating, for example, - // the precedence of an infix operator, and the original name of a - // keyword token). The kind of value that's held in `tokVal` depends - // on the type of the token. For literals, it is the literal value, - // for operators, the operator name, and so on. - - var tokType, tokVal; - - // Interal state for the tokenizer. To distinguish between division - // operators and regular expressions, it remembers whether the last - // token was one that is allowed to be followed by an expression. - // (If it is, a slash is probably a regexp, if it isn't it's a - // division operator. See the `parseStatement` function for a - // caveat.) - - var tokRegexpAllowed; - - // When `options.locations` is true, these are used to keep - // track of the current line, and know when a new line has been - // entered. - - var tokCurLine, tokLineStart; - - // These store the position of the previous token, which is useful - // when finishing a node and assigning its `end` position. - - var lastStart, lastEnd, lastEndLoc; - - // This is the parser's state. `inFunction` is used to reject - // `return` statements outside of functions, `labels` to verify that - // `break` and `continue` have somewhere to jump to, and `strict` - // indicates whether strict mode is on. - - var inFunction, labels, strict; - - // This function is used to raise exceptions on parse errors. It - // takes an offset integer (into the current `input`) to indicate - // the location of the error, attaches the position to the end - // of the error message, and then raises a `SyntaxError` with that - // message. - - function raise(pos, message) { - var loc = getLineInfo(input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos; err.loc = loc; err.raisedAt = tokPos; - throw err; - } - - // ## 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. - - // These are the general types. The `type` property is only used to - // make them recognizeable when debugging. - - var _num = {type: "num"}, _regexp = {type: "regexp"}, _string = {type: "string"}; - var _name = {type: "name"}, _eof = {type: "eof"}; - - // Keyword tokens. The `keyword` property (also used in keyword-like - // operators) indicates that the token originated from an - // identifier-like word, which is used when parsing property names. - // - // 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 _break = {keyword: "break"}, _case = {keyword: "case", beforeExpr: true}, _catch = {keyword: "catch"}; - var _continue = {keyword: "continue"}, _debugger = {keyword: "debugger"}, _default = {keyword: "default"}; - var _do = {keyword: "do", isLoop: true}, _else = {keyword: "else", beforeExpr: true}; - var _finally = {keyword: "finally"}, _for = {keyword: "for", isLoop: true}, _function = {keyword: "function"}; - var _if = {keyword: "if"}, _return = {keyword: "return", beforeExpr: true}, _switch = {keyword: "switch"}; - var _throw = {keyword: "throw", beforeExpr: true}, _try = {keyword: "try"}, _var = {keyword: "var"}; - var _while = {keyword: "while", isLoop: true}, _with = {keyword: "with"}, _new = {keyword: "new", beforeExpr: true}; - var _this = {keyword: "this"}; - - // The keywords that denote values. - - var _null = {keyword: "null", atomValue: null}, _true = {keyword: "true", atomValue: true}; - var _false = {keyword: "false", atomValue: false}; - - // Some keywords are treated as regular operators. `in` sometimes - // (when parsing `for`) needs to be tested against specifically, so - // we assign a variable name to it for quick comparing. - - var _in = {keyword: "in", binop: 7, beforeExpr: true}; - - // Map keyword names to token types. - - var keywordTypes = {"break": _break, "case": _case, "catch": _catch, - "continue": _continue, "debugger": _debugger, "default": _default, - "do": _do, "else": _else, "finally": _finally, "for": _for, - "function": _function, "if": _if, "return": _return, "switch": _switch, - "throw": _throw, "try": _try, "var": _var, "while": _while, "with": _with, - "null": _null, "true": _true, "false": _false, "new": _new, "in": _in, - "instanceof": {keyword: "instanceof", binop: 7, beforeExpr: true}, "this": _this, - "typeof": {keyword: "typeof", prefix: true, beforeExpr: true}, - "void": {keyword: "void", prefix: true, beforeExpr: true}, - "delete": {keyword: "delete", prefix: true, beforeExpr: true}}; - - // Punctuation token types. Again, the `type` property is purely for debugging. - - var _bracketL = {type: "[", beforeExpr: true}, _bracketR = {type: "]"}, _braceL = {type: "{", beforeExpr: true}; - var _braceR = {type: "}"}, _parenL = {type: "(", beforeExpr: true}, _parenR = {type: ")"}; - var _comma = {type: ",", beforeExpr: true}, _semi = {type: ";", beforeExpr: true}; - var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _question = {type: "?", beforeExpr: true}; - - // 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. `isUpdate` specifies that the node produced by - // the operator should be of type UpdateExpression rather than - // simply UnaryExpression (`++` and `--`). - // - // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as - // binary operators with a very low precedence, that should result - // in AssignmentExpression nodes. - - var _slash = {binop: 10, beforeExpr: true}, _eq = {isAssign: true, beforeExpr: true}; - var _assign = {isAssign: true, beforeExpr: true}, _plusmin = {binop: 9, prefix: true, beforeExpr: true}; - var _incdec = {postfix: true, prefix: true, isUpdate: true}, _prefix = {prefix: true, beforeExpr: true}; - var _bin1 = {binop: 1, beforeExpr: true}, _bin2 = {binop: 2, beforeExpr: true}; - var _bin3 = {binop: 3, beforeExpr: true}, _bin4 = {binop: 4, beforeExpr: true}; - var _bin5 = {binop: 5, beforeExpr: true}, _bin6 = {binop: 6, beforeExpr: true}; - var _bin7 = {binop: 7, beforeExpr: true}, _bin8 = {binop: 8, beforeExpr: true}; - var _bin10 = {binop: 10, beforeExpr: true}; - - // Provide access to the token types for external users of the - // tokenizer. - - exports.tokTypes = {bracketL: _bracketL, bracketR: _bracketR, braceL: _braceL, braceR: _braceR, - parenL: _parenL, parenR: _parenR, comma: _comma, semi: _semi, colon: _colon, - dot: _dot, question: _question, slash: _slash, eq: _eq, name: _name, eof: _eof, - num: _num, regexp: _regexp, string: _string}; - for (var kw in keywordTypes) exports.tokTypes[kw] = keywordTypes[kw]; - - // 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(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([words[i]]); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; - f += "return true}return false;"; - } - - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - - if (cats.length > 3) { - cats.sort(function(a, b) {return b.length - a.length;}); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - - // Otherwise, simply generate a flat `switch` statement. - - } else { - compareTo(words); - } - return new Function("str", f); - } - - // The ECMAScript 3 reserved word list. - - var isReservedWord3 = makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"); - - // ECMAScript 5 reserved words. - - var isReservedWord5 = makePredicate("class enum extends super const export import"); - - // The additional reserved words in strict mode. - - var isStrictReservedWord = makePredicate("implements interface let package private protected public static yield"); - - // The forbidden variable names in strict mode. - - var isStrictBadIdWord = 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"); - - // ## 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. - - var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/; - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; - var nonASCIIidentifierChars = "\u0371-\u0374\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - - // Whether a single character denotes a newline. - - var newline = /[\n\r\u2028\u2029]/; - - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. - - var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; - - // 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; - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - // 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; - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - // ## Tokenizer - - // These are used when `options.locations` is on, for the - // `tokStartLoc` and `tokEndLoc` properties. - - function line_loc_t() { - this.line = tokCurLine; - this.column = tokPos - tokLineStart; - } - - // Reset the token state. Used at the start of a parse. - - function initTokenState() { - tokCurLine = 1; - tokPos = tokLineStart = 0; - tokRegexpAllowed = true; - skipSpace(); - } - - // Called at the end of every token. Sets `tokEnd`, `tokVal`, and - // `tokRegexpAllowed`, and skips the space after the token, so that - // the next one's `tokStart` will point at the right position. - - function finishToken(type, val) { - tokEnd = tokPos; - if (options.locations) tokEndLoc = new line_loc_t; - tokType = type; - skipSpace(); - tokVal = val; - tokRegexpAllowed = type.beforeExpr; - } - - function skipBlockComment() { - var startLoc = options.onComment && options.locations && new line_loc_t; - var start = tokPos, end = input.indexOf("*/", tokPos += 2); - if (end === -1) raise(tokPos - 2, "Unterminated comment"); - tokPos = end + 2; - if (options.locations) { - lineBreak.lastIndex = start; - var match; - while ((match = lineBreak.exec(input)) && match.index < tokPos) { - ++tokCurLine; - tokLineStart = match.index + match[0].length; - } - } - if (options.onComment) - options.onComment(true, input.slice(start + 2, end), start, tokPos, - startLoc, options.locations && new line_loc_t); - } - - function skipLineComment() { - var start = tokPos; - var startLoc = options.onComment && options.locations && new line_loc_t; - var ch = input.charCodeAt(tokPos+=2); - while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8329) { - ++tokPos; - ch = input.charCodeAt(tokPos); - } - if (options.onComment) - options.onComment(false, input.slice(start + 2, tokPos), start, tokPos, - startLoc, options.locations && new line_loc_t); - } - - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. - - function skipSpace() { - while (tokPos < inputLen) { - var ch = input.charCodeAt(tokPos); - if (ch === 32) { // ' ' - ++tokPos; - } else if(ch === 13) { - ++tokPos; - var next = input.charCodeAt(tokPos); - if(next === 10) { - ++tokPos; - } - if(options.locations) { - ++tokCurLine; - tokLineStart = tokPos; - } - } else if (ch === 10) { - ++tokPos; - ++tokCurLine; - tokLineStart = tokPos; - } else if(ch < 14 && ch > 8) { - ++tokPos; - } else if (ch === 47) { // '/' - var next = input.charCodeAt(tokPos+1); - if (next === 42) { // '*' - skipBlockComment(); - } else if (next === 47) { // '/' - skipLineComment(); - } else break; - } else if ((ch < 14 && ch > 8) || ch === 32 || ch === 160) { // ' ', '\xa0' - ++tokPos; - } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++tokPos; - } else { - break; - } - } - } - - // ### 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. - // - // The `forceRegexp` parameter is used in the one case where the - // `tokRegexpAllowed` trick does not work. See `parseStatement`. - - function readToken_dot() { - var next = input.charCodeAt(tokPos+1); - if (next >= 48 && next <= 57) return readNumber(true); - ++tokPos; - return finishToken(_dot); - } - - function readToken_slash() { // '/' - var next = input.charCodeAt(tokPos+1); - if (tokRegexpAllowed) {++tokPos; return readRegexp();} - if (next === 61) return finishOp(_assign, 2); - return finishOp(_slash, 1); - } - - function readToken_mult_modulo() { // '%*' - var next = input.charCodeAt(tokPos+1); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bin10, 1); - } - - function readToken_pipe_amp(code) { // '|&' - var next = input.charCodeAt(tokPos+1); - if (next === code) return finishOp(code === 124 ? _bin1 : _bin2, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(code === 124 ? _bin3 : _bin5, 1); - } - - function readToken_caret() { // '^' - var next = input.charCodeAt(tokPos+1); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_bin4, 1); - } - - function readToken_plus_min(code) { // '+-' - var next = input.charCodeAt(tokPos+1); - if (next === code) return finishOp(_incdec, 2); - if (next === 61) return finishOp(_assign, 2); - return finishOp(_plusmin, 1); - } - - function readToken_lt_gt(code) { // '<>' - var next = input.charCodeAt(tokPos+1); - var size = 1; - if (next === code) { - size = code === 62 && input.charCodeAt(tokPos+2) === 62 ? 3 : 2; - if (input.charCodeAt(tokPos + size) === 61) return finishOp(_assign, size + 1); - return finishOp(_bin8, size); - } - if (next === 61) - size = input.charCodeAt(tokPos+2) === 61 ? 3 : 2; - return finishOp(_bin7, size); - } - - function readToken_eq_excl(code) { // '=!' - var next = input.charCodeAt(tokPos+1); - if (next === 61) return finishOp(_bin6, input.charCodeAt(tokPos+2) === 61 ? 3 : 2); - return finishOp(code === 61 ? _eq : _prefix, 1); - } - - function getTokenFromCode(code) { - switch(code) { - // The interpretation of a dot depends on whether it is followed - // by a digit. - case 46: // '.' - return readToken_dot(); - - // Punctuation tokens. - case 40: ++tokPos; return finishToken(_parenL); - case 41: ++tokPos; return finishToken(_parenR); - case 59: ++tokPos; return finishToken(_semi); - case 44: ++tokPos; return finishToken(_comma); - case 91: ++tokPos; return finishToken(_bracketL); - case 93: ++tokPos; return finishToken(_bracketR); - case 123: ++tokPos; return finishToken(_braceL); - case 125: ++tokPos; return finishToken(_braceR); - case 58: ++tokPos; return finishToken(_colon); - case 63: ++tokPos; return finishToken(_question); - - // '0x' is a hexadecimal number. - case 48: // '0' - var next = input.charCodeAt(tokPos+1); - if (next === 120 || next === 88) return readHexNumber(); - // 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 readNumber(false); - - // Quotes produce strings. - case 34: case 39: // '"', "'" - return 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 readToken_slash(code); - - case 37: case 42: // '%*' - return readToken_mult_modulo(); - - case 124: case 38: // '|&' - return readToken_pipe_amp(code); - - case 94: // '^' - return readToken_caret(); - - case 43: case 45: // '+-' - return readToken_plus_min(code); - - case 60: case 62: // '<>' - return readToken_lt_gt(code); - - case 61: case 33: // '=!' - return readToken_eq_excl(code); - - case 126: // '~' - return finishOp(_prefix, 1); - } - - return false; - } - - function readToken(forceRegexp) { - if (!forceRegexp) tokStart = tokPos; - else tokPos = tokStart + 1; - if (options.locations) tokStartLoc = new line_loc_t; - if (forceRegexp) return readRegexp(); - if (tokPos >= inputLen) return finishToken(_eof); - - var code = input.charCodeAt(tokPos); - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code) || code === 92 /* '\' */) return readWord(); - - var tok = getTokenFromCode(code); - - if (tok === false) { - // If we are here, we either found a non-ASCII identifier - // character, or something that's entirely disallowed. - var ch = String.fromCharCode(code); - if (ch === "\\" || nonASCIIidentifierStart.test(ch)) return readWord(); - raise(tokPos, "Unexpected character '" + ch + "'"); - } - return tok; - } - - function finishOp(type, size) { - var str = input.slice(tokPos, tokPos + size); - tokPos += size; - finishToken(type, str); - } - - // Parse a regular expression. Some context-awareness is necessary, - // since a '/' inside a '[]' set does not end the expression. - - function readRegexp() { - var content = "", escaped, inClass, start = tokPos; - for (;;) { - if (tokPos >= inputLen) raise(start, "Unterminated regular expression"); - var ch = input.charAt(tokPos); - if (newline.test(ch)) raise(start, "Unterminated regular expression"); - if (!escaped) { - if (ch === "[") inClass = true; - else if (ch === "]" && inClass) inClass = false; - else if (ch === "/" && !inClass) break; - escaped = ch === "\\"; - } else escaped = false; - ++tokPos; - } - var content = input.slice(start, tokPos); - ++tokPos; - // Need to use `readWord1` because '\uXXXX' sequences are allowed - // here (don't ask). - var mods = readWord1(); - if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, "Invalid regexp flag"); - return finishToken(_regexp, new RegExp(content, 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. - - function readInt(radix, len) { - var start = tokPos, total = 0; - for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) { - var code = input.charCodeAt(tokPos), val; - 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; - ++tokPos; - total = total * radix + val; - } - if (tokPos === start || len != null && tokPos - start !== len) return null; - - return total; - } - - function readHexNumber() { - tokPos += 2; // 0x - var val = readInt(16); - if (val == null) raise(tokStart + 2, "Expected hexadecimal number"); - if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); - return finishToken(_num, val); - } - - // Read an integer, octal integer, or floating-point number. - - function readNumber(startsWithDot) { - var start = tokPos, isFloat = false, octal = input.charCodeAt(tokPos) === 48; - if (!startsWithDot && readInt(10) === null) raise(start, "Invalid number"); - if (input.charCodeAt(tokPos) === 46) { - ++tokPos; - readInt(10); - isFloat = true; - } - var next = input.charCodeAt(tokPos); - if (next === 69 || next === 101) { // 'eE' - next = input.charCodeAt(++tokPos); - if (next === 43 || next === 45) ++tokPos; // '+-' - if (readInt(10) === null) raise(start, "Invalid number") - isFloat = true; - } - if (isIdentifierStart(input.charCodeAt(tokPos))) raise(tokPos, "Identifier directly after number"); - - var str = input.slice(start, tokPos), val; - if (isFloat) val = parseFloat(str); - else if (!octal || str.length === 1) val = parseInt(str, 10); - else if (/[89]/.test(str) || strict) raise(start, "Invalid number"); - else val = parseInt(str, 8); - return finishToken(_num, val); - } - - // Read a string value, interpreting backslash-escapes. - - function readString(quote) { - tokPos++; - var out = ""; - for (;;) { - if (tokPos >= inputLen) raise(tokStart, "Unterminated string constant"); - var ch = input.charCodeAt(tokPos); - if (ch === quote) { - ++tokPos; - return finishToken(_string, out); - } - if (ch === 92) { // '\' - ch = input.charCodeAt(++tokPos); - var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3)); - if (octal) octal = octal[0]; - while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, octal.length - 1); - if (octal === "0") octal = null; - ++tokPos; - if (octal) { - if (strict) raise(tokPos - 2, "Octal literal in strict mode"); - out += String.fromCharCode(parseInt(octal, 8)); - tokPos += octal.length - 1; - } else { - switch (ch) { - case 110: out += "\n"; break; // 'n' -> '\n' - case 114: out += "\r"; break; // 'r' -> '\r' - case 120: out += String.fromCharCode(readHexChar(2)); break; // 'x' - case 117: out += String.fromCharCode(readHexChar(4)); break; // 'u' - case 85: out += String.fromCharCode(readHexChar(8)); break; // 'U' - case 116: out += "\t"; break; // 't' -> '\t' - case 98: out += "\b"; break; // 'b' -> '\b' - case 118: out += "\u000b"; break; // 'v' -> '\u000b' - case 102: out += "\f"; break; // 'f' -> '\f' - case 48: out += "\0"; break; // 0 -> '\0' - case 13: if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\r\n' - case 10: // ' \n' - if (options.locations) { tokLineStart = tokPos; ++tokCurLine; } - break; - default: out += String.fromCharCode(ch); break; - } - } - } else { - if (ch === 13 || ch === 10 || ch === 8232 || ch === 8329) raise(tokStart, "Unterminated string constant"); - out += String.fromCharCode(ch); // '\' - ++tokPos; - } - } - } - - // Used to read character escape sequences ('\x', '\u', '\U'). - - function readHexChar(len) { - var n = readInt(16, len); - if (n === null) raise(tokStart, "Bad character escape sequence"); - return n; - } - - // 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. - - var containsEsc; - - // Read an identifier, and return it as a string. Sets `containsEsc` - // to whether the word contained a '\u' escape. - // - // Only builds up the word character-by-character when it actually - // containeds an escape, as a micro-optimization. - - function readWord1() { - containsEsc = false; - var word, first = true, start = tokPos; - for (;;) { - var ch = input.charCodeAt(tokPos); - if (isIdentifierChar(ch)) { - if (containsEsc) word += input.charAt(tokPos); - ++tokPos; - } else if (ch === 92) { // "\" - if (!containsEsc) word = input.slice(start, tokPos); - containsEsc = true; - if (input.charCodeAt(++tokPos) != 117) // "u" - raise(tokPos, "Expecting Unicode escape sequence \\uXXXX"); - ++tokPos; - var esc = readHexChar(4); - var escStr = String.fromCharCode(esc); - if (!escStr) raise(tokPos - 1, "Invalid Unicode escape"); - if (!(first ? isIdentifierStart(esc) : isIdentifierChar(esc))) - raise(tokPos - 4, "Invalid Unicode escape"); - word += escStr; - } else { - break; - } - first = false; - } - return containsEsc ? word : input.slice(start, tokPos); - } - - // Read an identifier or keyword token. Will check for reserved - // words when necessary. - - function readWord() { - var word = readWord1(); - var type = _name; - if (!containsEsc) { - if (isKeyword(word)) type = keywordTypes[word]; - else if (options.forbidReserved && - (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(word) || - strict && isStrictReservedWord(word)) - raise(tokStart, "The keyword '" + word + "' is reserved"); - } - return finishToken(type, word); - } - - // ## Parser - - // 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 - - // ### Parser utilities - - // Continue to the next token. - - function next() { - lastStart = tokStart; - lastEnd = tokEnd; - lastEndLoc = tokEndLoc; - readToken(); - } - - // Enter strict mode. Re-reads the next token to please pedantic - // tests ("use strict"; 010; -- should fail). - - function setStrict(strct) { - strict = strct; - tokPos = lastEnd; - while (tokPos < tokLineStart) { - tokLineStart = input.lastIndexOf("\n", tokLineStart - 2) + 1; - --tokCurLine; - } - skipSpace(); - readToken(); - } - - // Start an AST node, attaching a start offset. - - function node_t() { - this.type = null; - this.start = tokStart; - this.end = null; - } - - function node_loc_t() { - this.start = tokStartLoc; - this.end = null; - if (sourceFile !== null) this.source = sourceFile; - } - - function startNode() { - var node = new node_t(); - if (options.locations) - node.loc = new node_loc_t(); - if (options.ranges) - node.range = [tokStart, 0]; - return node; - } - - // Start a node whose start offset information should be based on - // the start of another node. For example, a binary operator node is - // only started after its left-hand side has already been parsed. - - function startNodeFrom(other) { - var node = new node_t(); - node.start = other.start; - if (options.locations) { - node.loc = new node_loc_t(); - node.loc.start = other.loc.start; - } - if (options.ranges) - node.range = [other.range[0], 0]; - - return node; - } - - // Finish an AST node, adding `type` and `end` properties. - - function finishNode(node, type) { - node.type = type; - node.end = lastEnd; - if (options.locations) - node.loc.end = lastEndLoc; - if (options.ranges) - node.range[1] = lastEnd; - return node; - } - - // Test whether a statement node is the string literal `"use strict"`. - - function isUseStrict(stmt) { - return options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && - stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; - } - - // Predicate that tests whether the next token is of the given - // type, and if yes, consumes it as a side effect. - - function eat(type) { - if (tokType === type) { - next(); - return true; - } - } - - // Test whether a semicolon can be inserted at the current position. - - function canInsertSemicolon() { - return !options.strictSemicolons && - (tokType === _eof || tokType === _braceR || newline.test(input.slice(lastEnd, tokStart))); - } - - // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. - - function semicolon() { - if (!eat(_semi) && !canInsertSemicolon()) unexpected(); - } - - // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error. - - function expect(type) { - if (tokType === type) next(); - else unexpected(); - } - - // Raise an unexpected token error. - - function unexpected() { - raise(tokStart, "Unexpected token"); - } - - // Verify that a node is an lval — something that can be assigned - // to. - - function checkLVal(expr) { - if (expr.type !== "Identifier" && expr.type !== "MemberExpression") - raise(expr.start, "Assigning to rvalue"); - if (strict && expr.type === "Identifier" && isStrictBadIdWord(expr.name)) - raise(expr.start, "Assigning to " + expr.name + " in strict mode"); - } - - // ### 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. - - function parseTopLevel(program) { - lastStart = lastEnd = tokPos; - if (options.locations) lastEndLoc = new line_loc_t; - inFunction = strict = null; - labels = []; - readToken(); - - var node = program || startNode(), first = true; - if (!program) node.body = []; - while (tokType !== _eof) { - var stmt = parseStatement(); - node.body.push(stmt); - if (first && isUseStrict(stmt)) setStrict(true); - first = false; - } - return finishNode(node, "Program"); - } - - var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; - - // 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. - - function parseStatement() { - if (tokType === _slash) - readToken(true); - - var starttype = tokType, node = 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 _break: case _continue: - next(); - var isBreak = starttype === _break; - if (eat(_semi) || canInsertSemicolon()) node.label = null; - else if (tokType !== _name) unexpected(); - else { - node.label = parseIdent(); - semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - for (var i = 0; i < labels.length; ++i) { - var lab = 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 === labels.length) raise(node.start, "Unsyntactic " + starttype.keyword); - return finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - - case _debugger: - next(); - semicolon(); - return finishNode(node, "DebuggerStatement"); - - case _do: - next(); - labels.push(loopLabel); - node.body = parseStatement(); - labels.pop(); - expect(_while); - node.test = parseParenExpression(); - semicolon(); - return finishNode(node, "DoWhileStatement"); - - // Disambiguating between a `for` and a `for`/`in` 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`. When there is no init part - // (semicolon immediately after the opening parenthesis), it is - // a regular `for` loop. - - case _for: - next(); - labels.push(loopLabel); - expect(_parenL); - if (tokType === _semi) return parseFor(node, null); - if (tokType === _var) { - var init = startNode(); - next(); - parseVar(init, true); - if (init.declarations.length === 1 && eat(_in)) - return parseForIn(node, init); - return parseFor(node, init); - } - var init = parseExpression(false, true); - if (eat(_in)) {checkLVal(init); return parseForIn(node, init);} - return parseFor(node, init); - - case _function: - next(); - return parseFunction(node, true); - - case _if: - next(); - node.test = parseParenExpression(); - node.consequent = parseStatement(); - node.alternate = eat(_else) ? parseStatement() : null; - return finishNode(node, "IfStatement"); - - case _return: - if (!inFunction) raise(tokStart, "'return' outside of function"); - next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (eat(_semi) || canInsertSemicolon()) node.argument = null; - else { node.argument = parseExpression(); semicolon(); } - return finishNode(node, "ReturnStatement"); - - case _switch: - next(); - node.discriminant = parseParenExpression(); - node.cases = []; - expect(_braceL); - 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. - - for (var cur, sawDefault; tokType != _braceR;) { - if (tokType === _case || tokType === _default) { - var isCase = tokType === _case; - if (cur) finishNode(cur, "SwitchCase"); - node.cases.push(cur = startNode()); - cur.consequent = []; - next(); - if (isCase) cur.test = parseExpression(); - else { - if (sawDefault) raise(lastStart, "Multiple default clauses"); sawDefault = true; - cur.test = null; - } - expect(_colon); - } else { - if (!cur) unexpected(); - cur.consequent.push(parseStatement()); - } - } - if (cur) finishNode(cur, "SwitchCase"); - next(); // Closing brace - labels.pop(); - return finishNode(node, "SwitchStatement"); - - case _throw: - next(); - if (newline.test(input.slice(lastEnd, tokStart))) - raise(lastEnd, "Illegal newline after throw"); - node.argument = parseExpression(); - semicolon(); - return finishNode(node, "ThrowStatement"); - - case _try: - next(); - node.block = parseBlock(); - node.handler = null; - if (tokType === _catch) { - var clause = startNode(); - next(); - expect(_parenL); - clause.param = parseIdent(); - if (strict && isStrictBadIdWord(clause.param.name)) - raise(clause.param.start, "Binding " + clause.param.name + " in strict mode"); - expect(_parenR); - clause.guard = null; - clause.body = parseBlock(); - node.handler = finishNode(clause, "CatchClause"); - } - node.finalizer = eat(_finally) ? parseBlock() : null; - if (!node.handler && !node.finalizer) - raise(node.start, "Missing catch or finally clause"); - return finishNode(node, "TryStatement"); - - case _var: - next(); - node = parseVar(node); - semicolon(); - return node; - - case _while: - next(); - node.test = parseParenExpression(); - labels.push(loopLabel); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "WhileStatement"); - - case _with: - if (strict) raise(tokStart, "'with' in strict mode"); - next(); - node.object = parseParenExpression(); - node.body = parseStatement(); - return finishNode(node, "WithStatement"); - - case _braceL: - return parseBlock(); - - case _semi: - next(); - return finishNode(node, "EmptyStatement"); - - // 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. - - default: - var maybeName = tokVal, expr = parseExpression(); - if (starttype === _name && expr.type === "Identifier" && eat(_colon)) { - for (var i = 0; i < labels.length; ++i) - if (labels[i].name === maybeName) raise(expr.start, "Label '" + maybeName + "' is already declared"); - var kind = tokType.isLoop ? "loop" : tokType === _switch ? "switch" : null; - labels.push({name: maybeName, kind: kind}); - node.body = parseStatement(); - labels.pop(); - node.label = expr; - return finishNode(node, "LabeledStatement"); - } else { - node.expression = expr; - semicolon(); - return finishNode(node, "ExpressionStatement"); - } - } - } - - // Used for constructs like `switch` and `if` that insist on - // parentheses around their expression. - - function parseParenExpression() { - expect(_parenL); - var val = parseExpression(); - expect(_parenR); - return val; - } - - // Parse a semicolon-enclosed block of statements, handling `"use - // strict"` declarations when `allowStrict` is true (used for - // function bodies). - - function parseBlock(allowStrict) { - var node = startNode(), first = true, strict = false, oldStrict; - node.body = []; - expect(_braceL); - while (!eat(_braceR)) { - var stmt = parseStatement(); - node.body.push(stmt); - if (first && isUseStrict(stmt)) { - oldStrict = strict; - setStrict(strict = true); - } - first = false - } - if (strict && !oldStrict) setStrict(false); - return finishNode(node, "BlockStatement"); - } - - // Parse a regular `for` loop. The disambiguation code in - // `parseStatement` will already have parsed the init statement or - // expression. - - function parseFor(node, init) { - node.init = init; - expect(_semi); - node.test = tokType === _semi ? null : parseExpression(); - expect(_semi); - node.update = tokType === _parenR ? null : parseExpression(); - expect(_parenR); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "ForStatement"); - } - - // Parse a `for`/`in` loop. - - function parseForIn(node, init) { - node.left = init; - node.right = parseExpression(); - expect(_parenR); - node.body = parseStatement(); - labels.pop(); - return finishNode(node, "ForInStatement"); - } - - // Parse a list of variable declarations. - - function parseVar(node, noIn) { - node.declarations = []; - node.kind = "var"; - for (;;) { - var decl = startNode(); - decl.id = parseIdent(); - if (strict && isStrictBadIdWord(decl.id.name)) - raise(decl.id.start, "Binding " + decl.id.name + " in strict mode"); - decl.init = eat(_eq) ? parseExpression(true, noIn) : null; - node.declarations.push(finishNode(decl, "VariableDeclarator")); - if (!eat(_comma)) break; - } - return finishNode(node, "VariableDeclaration"); - } - - // ### 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 arguments are used to forbid comma - // sequences (in argument lists, array literals, or object literals) - // or the `in` operator (in for loops initalization expressions). - - function parseExpression(noComma, noIn) { - var expr = parseMaybeAssign(noIn); - if (!noComma && tokType === _comma) { - var node = startNodeFrom(expr); - node.expressions = [expr]; - while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn)); - return finishNode(node, "SequenceExpression"); - } - return expr; - } - - // Parse an assignment expression. This includes applications of - // operators like `+=`. - - function parseMaybeAssign(noIn) { - var left = parseMaybeConditional(noIn); - if (tokType.isAssign) { - var node = startNodeFrom(left); - node.operator = tokVal; - node.left = left; - next(); - node.right = parseMaybeAssign(noIn); - checkLVal(left); - return finishNode(node, "AssignmentExpression"); - } - return left; - } - - // Parse a ternary conditional (`?:`) operator. - - function parseMaybeConditional(noIn) { - var expr = parseExprOps(noIn); - if (eat(_question)) { - var node = startNodeFrom(expr); - node.test = expr; - node.consequent = parseExpression(true); - expect(_colon); - node.alternate = parseExpression(true, noIn); - return finishNode(node, "ConditionalExpression"); - } - return expr; - } - - // Start the precedence parser. - - function parseExprOps(noIn) { - return parseExprOp(parseMaybeUnary(noIn), -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. - - function parseExprOp(left, minPrec, noIn) { - var prec = tokType.binop; - if (prec != null && (!noIn || tokType !== _in)) { - if (prec > minPrec) { - var node = startNodeFrom(left); - node.left = left; - node.operator = tokVal; - next(); - node.right = parseExprOp(parseMaybeUnary(noIn), prec, noIn); - var node = finishNode(node, /&&|\|\|/.test(node.operator) ? "LogicalExpression" : "BinaryExpression"); - return parseExprOp(node, minPrec, noIn); - } - } - return left; - } - - // Parse unary operators, both prefix and postfix. - - function parseMaybeUnary(noIn) { - if (tokType.prefix) { - var node = startNode(), update = tokType.isUpdate; - node.operator = tokVal; - node.prefix = true; - next(); - node.argument = parseMaybeUnary(noIn); - if (update) checkLVal(node.argument); - else if (strict && node.operator === "delete" && - node.argument.type === "Identifier") - raise(node.start, "Deleting local variable in strict mode"); - return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - var expr = parseExprSubscripts(); - while (tokType.postfix && !canInsertSemicolon()) { - var node = startNodeFrom(expr); - node.operator = tokVal; - node.prefix = false; - node.argument = expr; - checkLVal(expr); - next(); - expr = finishNode(node, "UpdateExpression"); - } - return expr; - } - - // Parse call, dot, and `[]`-subscript expressions. - - function parseExprSubscripts() { - return parseSubscripts(parseExprAtom()); - } - - function parseSubscripts(base, noCalls) { - if (eat(_dot)) { - var node = startNodeFrom(base); - node.object = base; - node.property = parseIdent(true); - node.computed = false; - return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); - } else if (eat(_bracketL)) { - var node = startNodeFrom(base); - node.object = base; - node.property = parseExpression(); - node.computed = true; - expect(_bracketR); - return parseSubscripts(finishNode(node, "MemberExpression"), noCalls); - } else if (!noCalls && eat(_parenL)) { - var node = startNodeFrom(base); - node.callee = base; - node.arguments = parseExprList(_parenR, false); - return parseSubscripts(finishNode(node, "CallExpression"), noCalls); - } else return base; - } - - // 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 `{}`. - - function parseExprAtom() { - switch (tokType) { - case _this: - var node = startNode(); - next(); - return finishNode(node, "ThisExpression"); - case _name: - return parseIdent(); - case _num: case _string: case _regexp: - var node = startNode(); - node.value = tokVal; - node.raw = input.slice(tokStart, tokEnd); - next(); - return finishNode(node, "Literal"); - - case _null: case _true: case _false: - var node = startNode(); - node.value = tokType.atomValue; - node.raw = tokType.keyword - next(); - return finishNode(node, "Literal"); - - case _parenL: - var tokStartLoc1 = tokStartLoc, tokStart1 = tokStart; - next(); - var val = parseExpression(); - val.start = tokStart1; - val.end = tokEnd; - if (options.locations) { - val.loc.start = tokStartLoc1; - val.loc.end = tokEndLoc; - } - if (options.ranges) - val.range = [tokStart1, tokEnd]; - expect(_parenR); - return val; - - case _bracketL: - var node = startNode(); - next(); - node.elements = parseExprList(_bracketR, true, true); - return finishNode(node, "ArrayExpression"); - - case _braceL: - return parseObj(); - - case _function: - var node = startNode(); - next(); - return parseFunction(node, false); - - case _new: - return parseNew(); - - default: - unexpected(); - } - } - - // New's precedence is slightly tricky. It must allow its argument - // to be a `[]` or dot subscript expression, but not a call — at - // least, not without wrapping it in parentheses. Thus, it uses the - - function parseNew() { - var node = startNode(); - next(); - node.callee = parseSubscripts(parseExprAtom(), true); - if (eat(_parenL)) node.arguments = parseExprList(_parenR, false); - else node.arguments = []; - return finishNode(node, "NewExpression"); - } - - // Parse an object literal. - - function parseObj() { - var node = startNode(), first = true, sawGetSet = false; - node.properties = []; - next(); - while (!eat(_braceR)) { - if (!first) { - expect(_comma); - if (options.allowTrailingCommas && eat(_braceR)) break; - } else first = false; - - var prop = {key: parsePropertyName()}, isGetSet = false, kind; - if (eat(_colon)) { - prop.value = parseExpression(true); - kind = prop.kind = "init"; - } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set")) { - isGetSet = sawGetSet = true; - kind = prop.kind = prop.key.name; - prop.key = parsePropertyName(); - if (tokType !== _parenL) unexpected(); - prop.value = parseFunction(startNode(), false); - } else unexpected(); - - // 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. - - if (prop.key.type === "Identifier" && (strict || sawGetSet)) { - for (var i = 0; i < node.properties.length; ++i) { - var other = node.properties[i]; - if (other.key.name === prop.key.name) { - var conflict = kind == other.kind || isGetSet && other.kind === "init" || - kind === "init" && (other.kind === "get" || other.kind === "set"); - if (conflict && !strict && kind === "init" && other.kind === "init") conflict = false; - if (conflict) raise(prop.key.start, "Redefinition of property"); - } - } - } - node.properties.push(prop); - } - return finishNode(node, "ObjectExpression"); - } - - function parsePropertyName() { - if (tokType === _num || tokType === _string) return parseExprAtom(); - return parseIdent(true); - } - - // Parse a function declaration or literal (depending on the - // `isStatement` parameter). - - function parseFunction(node, isStatement) { - if (tokType === _name) node.id = parseIdent(); - else if (isStatement) unexpected(); - else node.id = null; - node.params = []; - var first = true; - expect(_parenL); - while (!eat(_parenR)) { - if (!first) expect(_comma); else first = false; - node.params.push(parseIdent()); - } - - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldInFunc = inFunction, oldLabels = labels; - inFunction = true; labels = []; - node.body = parseBlock(true); - inFunction = oldInFunc; labels = oldLabels; - - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (strict || node.body.body.length && isUseStrict(node.body.body[0])) { - for (var i = node.id ? -1 : 0; i < node.params.length; ++i) { - var id = i < 0 ? node.id : node.params[i]; - if (isStrictReservedWord(id.name) || isStrictBadIdWord(id.name)) - raise(id.start, "Defining '" + id.name + "' in strict mode"); - if (i >= 0) for (var j = 0; j < i; ++j) if (id.name === node.params[j].name) - raise(id.start, "Argument name clash in strict mode"); - } - } - - return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - } - - // Parses a comma-separated list of expressions, and returns them as - // an array. `close` is the token type that ends the list, and - // `allowEmpty` can be turned on to allow subsequent commas with - // nothing in between them to be parsed as `null` (which is needed - // for array literals). - - function parseExprList(close, allowTrailingComma, allowEmpty) { - var elts = [], first = true; - while (!eat(close)) { - if (!first) { - expect(_comma); - if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break; - } else first = false; - - if (allowEmpty && tokType === _comma) elts.push(null); - else elts.push(parseExpression(true)); - } - return elts; - } - - // Parse the next token as an identifier. If `liberal` is true (used - // when parsing properties), it will also convert keywords into - // identifiers. - - function parseIdent(liberal) { - var node = startNode(); - node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected(); - next(); - return finishNode(node, "Identifier"); - } - -}); \ No newline at end of file diff --git a/deploy/core/node_modules/marked/.npmignore b/deploy/core/node_modules/marked/.npmignore deleted file mode 100644 index 3fb773c03..000000000 --- a/deploy/core/node_modules/marked/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.git* -test/ diff --git a/deploy/core/node_modules/marked/LICENSE b/deploy/core/node_modules/marked/LICENSE deleted file mode 100644 index 40597477c..000000000 --- a/deploy/core/node_modules/marked/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2012, Christopher Jeffrey (https://github.com/chjj/) - -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 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. diff --git a/deploy/core/node_modules/marked/Makefile b/deploy/core/node_modules/marked/Makefile deleted file mode 100644 index 76904000b..000000000 --- a/deploy/core/node_modules/marked/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -all: - @cp lib/marked.js marked.js - @uglifyjs -o marked.min.js marked.js - -clean: - @rm marked.js - @rm marked.min.js - -.PHONY: clean all diff --git a/deploy/core/node_modules/marked/README.md b/deploy/core/node_modules/marked/README.md deleted file mode 100644 index c10495ae6..000000000 --- a/deploy/core/node_modules/marked/README.md +++ /dev/null @@ -1,125 +0,0 @@ -# marked - -A full-featured markdown parser and compiler, written in javascript. -Built for speed. - -## Benchmarks - -node v0.4.x - -``` bash -$ node test --bench -marked completed in 12071ms. -showdown (reuse converter) completed in 27387ms. -showdown (new converter) completed in 75617ms. -markdown-js completed in 70069ms. -``` - -node v0.6.x - -``` bash -$ node test --bench -marked completed in 6448ms. -marked (gfm) completed in 7357ms. -marked (pedantic) completed in 6092ms. -discount completed in 7314ms. -showdown (reuse converter) completed in 16018ms. -showdown (new converter) completed in 18234ms. -markdown-js completed in 24270ms. -``` - -__Marked is now faster than Discount, which is written in C.__ - -For those feeling skeptical: These benchmarks run the entire markdown test suite -1000 times. The test suite tests every feature. It doesn't cater to specific -aspects. - -## Install - -``` bash -$ npm install marked -``` - -## Another Javascript Markdown Parser - -The point of marked was to create a markdown compiler where it was possible to -frequently parse huge chunks of markdown without having to worry about -caching the compiled output somehow...or blocking for an unnecesarily long time. - -marked is very concise and still implements all markdown features. It is also -now fully compatible with the client-side. - -marked more or less passes the official markdown test suite in its -entirety. This is important because a surprising number of markdown compilers -cannot pass more than a few tests. It was very difficult to get marked as -compliant as it is. It could have cut corners in several areas for the sake -of performance, but did not in order to be exactly what you expect in terms -of a markdown rendering. In fact, this is why marked could be considered at a -disadvantage in the benchmarks above. - -Along with implementing every markdown feature, marked also implements -[GFM features](http://github.github.com/github-flavored-markdown/). - -## Options - -marked has 4 different switches which change behavior. - -- __pedantic__: Conform to obscure parts of `markdown.pl` as much as possible. - Don't fix any of the original markdown bugs or poor behavior. -- __gfm__: Enable github flavored markdown (enabled by default). -- __sanitize__: Sanitize the output. Ignore any HTML that has been input. -- __highlight__: A callback to highlight code blocks. - -None of the above are mutually exclusive/inclusive. - -## Usage - -``` js -// Set default options -marked.setOptions({ - gfm: true, - pedantic: false, - sanitize: true, - // callback for code highlighter - highlight: function(code, lang) { - if (lang === 'js') { - return javascriptHighlighter(code); - } - return code; - } -}); -console.log(marked('i am using __markdown__.')); -``` - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text); -console.log(marked.parser(tokens)); -``` - -``` bash -$ node -> require('marked').lexer('> i am using marked.') -[ { type: 'blockquote_start' }, - { type: 'paragraph', - text: 'i am using marked.' }, - { type: 'blockquote_end' }, - links: {} ] -``` - -## CLI - -``` bash -$ marked -o hello.html -hello world -^D -$ cat hello.html -

hello world

-``` - -## License - -Copyright (c) 2011-2012, Christopher Jeffrey. (MIT License) - -See LICENSE for more info. diff --git a/deploy/core/node_modules/marked/bin/marked b/deploy/core/node_modules/marked/bin/marked deleted file mode 100755 index c27b9e261..000000000 --- a/deploy/core/node_modules/marked/bin/marked +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env node - -/** - * Marked CLI - * Copyright (c) 2011-2012, Christopher Jeffrey (MIT License) - */ - -var fs = require('fs') - , util = require('util') - , marked = require('../'); - -/** - * Man Page - */ - -var help = function() { - var spawn = require('child_process').spawn; - - var options = { - cwd: process.cwd(), - env: process.env, - setsid: false, - customFds: [0, 1, 2] - }; - - spawn('man', - [__dirname + '/../man/marked.1'], - options); -}; - -/** - * Main - */ - -var main = function(argv) { - var files = [] - , options = {} - , data = '' - , input - , output - , arg - , tokens; - - var getarg = function() { - var arg = argv.shift(); - arg = arg.split('='); - if (arg.length > 1) { - argv.unshift(arg.slice(1).join('=')); - } - return arg[0]; - }; - - while (argv.length) { - arg = getarg(); - switch (arg) { - case '-o': - case '--output': - output = argv.shift(); - break; - case '-i': - case '--input': - input = argv.shift(); - break; - case '-t': - case '--tokens': - tokens = true; - break; - case '--gfm': - options.gfm = true; - break; - case '--sanitize': - options.sanitize = true; - break; - case '--pedantic': - options.pedantic = true; - break; - case '-h': - case '--help': - return help(); - default: - files.push(arg); - break; - } - } - - if (!input) { - if (files.length <= 2) { - var stdin = process.stdin; - - stdin.setEncoding('utf8'); - stdin.resume(); - - stdin.on('data', function(text) { - data += text; - }); - - stdin.on('end', write); - - return; - } - input = files.pop(); - } - - data = fs.readFileSync(input, 'utf8'); - write(); - - function write() { - marked.setOptions(options); - - data = tokens - ? JSON.stringify(marked.lexer(data), null, 2) - : marked(data); - - if (!output) { - process.stdout.write(data + '\n'); - } else { - fs.writeFileSync(output, data); - } - } -}; - -if (!module.parent) { - process.title = 'marked'; - main(process.argv.slice()); -} else { - module.exports = main; -} diff --git a/deploy/core/node_modules/marked/index.js b/deploy/core/node_modules/marked/index.js deleted file mode 100644 index a12f90569..000000000 --- a/deploy/core/node_modules/marked/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/marked'); diff --git a/deploy/core/node_modules/marked/lib/marked.js b/deploy/core/node_modules/marked/lib/marked.js deleted file mode 100644 index 19ad02e90..000000000 --- a/deploy/core/node_modules/marked/lib/marked.js +++ /dev/null @@ -1,781 +0,0 @@ -/** - * marked - A markdown parser (https://github.com/chjj/marked) - * Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed) - */ - -;(function() { - -/** - * Block-Level Grammar - */ - -var block = { - newline: /^\n+/, - code: /^( {4}[^\n]+\n*)+/, - fences: noop, - hr: /^( *[-*_]){3,} *(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, - lheading: /^([^\n]+)\n *(=|-){3,} *\n*/, - blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/, - list: /^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, - def: /^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - paragraph: /^([^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+\n*/, - text: /^[^\n]+/ -}; - -block.bullet = /(?:[*+-]|\d+\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = replace(block.item, 'gm') - (/bull/g, block.bullet) - (); - -block.list = replace(block.list) - (/bull/g, block.bullet) - ('hr', /\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/) - (); - -block.html = replace(block.html) - ('comment', //) - ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /])*?>/) - (/tag/g, tag()) - (); - -block.paragraph = replace(block.paragraph) - ('hr', block.hr) - ('heading', block.heading) - ('lheading', block.lheading) - ('blockquote', block.blockquote) - ('tag', '<' + tag()) - ('def', block.def) - (); - -block.normal = { - fences: block.fences, - paragraph: block.paragraph -}; - -block.gfm = { - fences: /^ *(```|~~~) *(\w+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, - paragraph: /^/ -}; - -block.gfm.paragraph = replace(block.paragraph) - ('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|') - (); - -/** - * Block Lexer - */ - -block.lexer = function(src) { - var tokens = []; - - tokens.links = {}; - - src = src - .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' '); - - return block.token(src, tokens, true); -}; - -block.token = function(src, tokens, top) { - var src = src.replace(/^ +$/gm, '') - , next - , loose - , cap - , item - , space - , i - , l; - - while (src) { - // newline - if (cap = block.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - tokens.push({ - type: 'space' - }); - } - } - - // code - if (cap = block.code.exec(src)) { - src = src.substring(cap[0].length); - cap = cap[0].replace(/^ {4}/gm, ''); - tokens.push({ - type: 'code', - text: !options.pedantic - ? cap.replace(/\n+$/, '') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = block.fences.exec(src)) { - src = src.substring(cap[0].length); - tokens.push({ - type: 'code', - lang: cap[2], - text: cap[3] - }); - continue; - } - - // heading - if (cap = block.heading.exec(src)) { - src = src.substring(cap[0].length); - tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }); - continue; - } - - // lheading - if (cap = block.lheading.exec(src)) { - src = src.substring(cap[0].length); - tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - - // hr - if (cap = block.hr.exec(src)) { - src = src.substring(cap[0].length); - tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = block.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - block.token(cap, tokens, top); - - tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - if (cap = block.list.exec(src)) { - src = src.substring(cap[0].length); - - tokens.push({ - type: 'list_start', - ordered: isFinite(cap[2]) - }); - - // Get each top-level item. - cap = cap[0].match(block.item); - - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item[item.length-1] === '\n'; - if (!loose) loose = next; - } - - tokens.push({ - type: loose - ? 'loose_item_start' - : 'list_item_start' - }); - - // Recurse. - block.token(item, tokens); - - tokens.push({ - type: 'list_item_end' - }); - } - - tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - if (cap = block.html.exec(src)) { - src = src.substring(cap[0].length); - tokens.push({ - type: options.sanitize - ? 'paragraph' - : 'html', - pre: cap[1] === 'pre', - text: cap[0] - }); - continue; - } - - // def - if (top && (cap = block.def.exec(src))) { - src = src.substring(cap[0].length); - tokens.links[cap[1].toLowerCase()] = { - href: cap[2], - title: cap[3] - }; - continue; - } - - // top-level paragraph - if (top && (cap = block.paragraph.exec(src))) { - src = src.substring(cap[0].length); - tokens.push({ - type: 'paragraph', - text: cap[0] - }); - continue; - } - - // text - if (cap = block.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - } - - return tokens; -}; - -/** - * Inline Processing - */ - -var inline = { - escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, - url: noop, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, - link: /^!?\[(inside)\]\(href\)/, - reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)([\s\S]*?[^`])\1(?!`)/, - br: /^ {2,}\n(?!\s*$)/, - text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; - -inline.link = replace(inline.link) - ('inside', inline._linkInside) - ('href', inline._linkHref) - (); - -inline.reflink = replace(inline.reflink) - ('inside', inline._linkInside) - (); - -inline.normal = { - url: inline.url, - strong: inline.strong, - em: inline.em, - text: inline.text -}; - -inline.pedantic = { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ -}; - -inline.gfm = { - url: /^(https?:\/\/[^\s]+[^.,:;"')\]\s])/, - text: /^[\s\S]+?(?=[\\' - + text - + '
'; - continue; - } - - // url (gfm) - if (cap = inline.url.exec(src)) { - src = src.substring(cap[0].length); - text = escape(cap[1]); - href = text; - out += '' - + text - + ''; - continue; - } - - // tag - if (cap = inline.tag.exec(src)) { - src = src.substring(cap[0].length); - out += options.sanitize - ? escape(cap[0]) - : cap[0]; - continue; - } - - // link - if (cap = inline.link.exec(src)) { - src = src.substring(cap[0].length); - out += outputLink(cap, { - href: cap[2], - title: cap[3] - }); - continue; - } - - // reflink, nolink - if ((cap = inline.reflink.exec(src)) - || (cap = inline.nolink.exec(src))) { - src = src.substring(cap[0].length); - link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; - if (!link || !link.href) { - out += cap[0][0]; - src = cap[0].substring(1) + src; - continue; - } - out += outputLink(cap, link); - continue; - } - - // strong - if (cap = inline.strong.exec(src)) { - src = src.substring(cap[0].length); - out += '' - + inline.lexer(cap[2] || cap[1]) - + ''; - continue; - } - - // em - if (cap = inline.em.exec(src)) { - src = src.substring(cap[0].length); - out += '' - + inline.lexer(cap[2] || cap[1]) - + ''; - continue; - } - - // code - if (cap = inline.code.exec(src)) { - src = src.substring(cap[0].length); - out += '' - + escape(cap[2], true) - + ''; - continue; - } - - // br - if (cap = inline.br.exec(src)) { - src = src.substring(cap[0].length); - out += '
'; - continue; - } - - // text - if (cap = inline.text.exec(src)) { - src = src.substring(cap[0].length); - out += escape(cap[0]); - continue; - } - } - - return out; -}; - -function outputLink(cap, link) { - if (cap[0][0] !== '!') { - return '' - + inline.lexer(cap[1]) - + ''; - } else { - return ''
-      + escape(cap[1])
-      + ''; - } -} - -/** - * Parsing - */ - -var tokens - , token; - -function next() { - return token = tokens.pop(); -} - -function tok() { - switch (token.type) { - case 'space': { - return ''; - } - case 'hr': { - return '
\n'; - } - case 'heading': { - return '' - + inline.lexer(token.text) - + '\n'; - } - case 'code': { - if (options.highlight) { - token.code = options.highlight(token.text, token.lang); - if (token.code != null && token.code !== token.text) { - token.escaped = true; - token.text = token.code; - } - } - - if (!token.escaped) { - token.text = escape(token.text, true); - } - - return '
'
-        + token.text
-        + '
\n'; - } - case 'blockquote_start': { - var body = ''; - - while (next().type !== 'blockquote_end') { - body += tok(); - } - - return '
\n' - + body - + '
\n'; - } - case 'list_start': { - var type = token.ordered ? 'ol' : 'ul' - , body = ''; - - while (next().type !== 'list_end') { - body += tok(); - } - - return '<' - + type - + '>\n' - + body - + '\n'; - } - case 'list_item_start': { - var body = ''; - - while (next().type !== 'list_item_end') { - body += token.type === 'text' - ? parseText() - : tok(); - } - - return '
  • ' - + body - + '
  • \n'; - } - case 'loose_item_start': { - var body = ''; - - while (next().type !== 'list_item_end') { - body += tok(); - } - - return '
  • ' - + body - + '
  • \n'; - } - case 'html': { - return !token.pre && !options.pedantic - ? inline.lexer(token.text) - : token.text; - } - case 'paragraph': { - return '

    ' - + inline.lexer(token.text) - + '

    \n'; - } - case 'text': { - return '

    ' - + parseText() - + '

    \n'; - } - } -} - -function parseText() { - var body = token.text - , top; - - while ((top = tokens[tokens.length-1]) - && top.type === 'text') { - body += '\n' + next().text; - } - - return inline.lexer(body); -} - -function parse(src) { - tokens = src.reverse(); - - var out = ''; - while (next()) { - out += tok(); - } - - tokens = null; - token = null; - - return out; -} - -/** - * Helpers - */ - -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - -function mangle(text) { - var out = '' - , l = text.length - , i = 0 - , ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -} - -function tag() { - var tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b'; - - return tag; -} - -function replace(regex, opt) { - regex = regex.source; - opt = opt || ''; - return function self(name, val) { - if (!name) return new RegExp(regex, opt); - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return self; - }; -} - -function noop() {} -noop.exec = noop; - -/** - * Marked - */ - -function marked(src, opt) { - setOptions(opt); - return parse(block.lexer(src)); -} - -/** - * Options - */ - -var options - , defaults; - -function setOptions(opt) { - if (!opt) opt = defaults; - if (options === opt) return; - options = opt; - - if (options.gfm) { - block.fences = block.gfm.fences; - block.paragraph = block.gfm.paragraph; - inline.text = inline.gfm.text; - inline.url = inline.gfm.url; - } else { - block.fences = block.normal.fences; - block.paragraph = block.normal.paragraph; - inline.text = inline.normal.text; - inline.url = inline.normal.url; - } - - if (options.pedantic) { - inline.em = inline.pedantic.em; - inline.strong = inline.pedantic.strong; - } else { - inline.em = inline.normal.em; - inline.strong = inline.normal.strong; - } -} - -marked.options = -marked.setOptions = function(opt) { - defaults = opt; - setOptions(opt); - return marked; -}; - -marked.setOptions({ - gfm: true, - pedantic: false, - sanitize: false, - highlight: null -}); - -/** - * Expose - */ - -marked.parser = function(src, opt) { - setOptions(opt); - return parse(src); -}; - -marked.lexer = function(src, opt) { - setOptions(opt); - return block.lexer(src); -}; - -marked.parse = marked; - -if (typeof module !== 'undefined') { - module.exports = marked; -} else { - this.marked = marked; -} - -}).call(function() { - return this || (typeof window !== 'undefined' ? window : global); -}()); diff --git a/deploy/core/node_modules/marked/man/marked.1 b/deploy/core/node_modules/marked/man/marked.1 deleted file mode 100644 index 672e336e8..000000000 --- a/deploy/core/node_modules/marked/man/marked.1 +++ /dev/null @@ -1,49 +0,0 @@ -.ds q \N'34' -.TH marked 1 -.SH NAME -marked \- a javascript markdown parser -.SH SYNOPSIS -.nf -.B marked [\-o output] [\-i input] [\-th] -.fi -.SH DESCRIPTION -.B marked -is a full-featured javascript markdown parser, built for speed. It also includes -multiple GFM features. -.SH OPTIONS -.TP -.BI \-o,\ \-\-output\ [output] -Specify file output. If none is specified, write to stdout. -.TP -.BI \-i,\ \-\-input\ [input] -Specify file input, otherwise use last argument as input file. If no input file -is specified, read from stdin. -.TP -.BI \-t,\ \-\-tokens -Output a token stream instead of html. -.TP -.BI \-\-pedantic -Conform to obscure parts of markdown.pl as much as possible. Don't fix original -markdown bugs. -.TP -.BI \-\-gfm -Enable github flavored markdown. -.TP -.BI \-\-sanitize -Sanitize output. Ignore any HTML input. -.TP -.BI \-h,\ \-\-help -Display help information. -.SH EXAMPLES -.TP -cat in.md | marked > out.html -.TP -echo "hello *world*" | marked -.TP -marked -o out.html in.md -.TP -marked --output="hello world.html" -i in.md -.SH BUGS -Please report any bugs to https://github.com/chjj/marked. -.SH LICENSE -Copyright (c) 2011-2012, Christopher Jeffrey (MIT License) diff --git a/deploy/core/node_modules/marked/package.json b/deploy/core/node_modules/marked/package.json deleted file mode 100644 index 38124ce78..000000000 --- a/deploy/core/node_modules/marked/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "marked", - "description": "A markdown parser built for speed", - "author": { - "name": "Christopher Jeffrey" - }, - "version": "0.2.6", - "main": "./lib/marked.js", - "bin": { - "marked": "./bin/marked" - }, - "man": [ - "./man/marked.1" - ], - "preferGlobal": false, - "repository": { - "type": "git", - "url": "git://github.com/chjj/marked.git" - }, - "homepage": "https://github.com/chjj/marked", - "bugs": { - "url": "http://github.com/chjj/marked/issues" - }, - "keywords": [ - "markdown", - "markup", - "html" - ], - "tags": [ - "markdown", - "markup", - "html" - ], - "scripts": { - "test": "node test", - "bench": "node test --bench" - }, - "readme": "# marked\n\nA full-featured markdown parser and compiler, written in javascript.\nBuilt for speed.\n\n## Benchmarks\n\nnode v0.4.x\n\n``` bash\n$ node test --bench\nmarked completed in 12071ms.\nshowdown (reuse converter) completed in 27387ms.\nshowdown (new converter) completed in 75617ms.\nmarkdown-js completed in 70069ms.\n```\n\nnode v0.6.x\n\n``` bash\n$ node test --bench\nmarked completed in 6448ms.\nmarked (gfm) completed in 7357ms.\nmarked (pedantic) completed in 6092ms.\ndiscount completed in 7314ms.\nshowdown (reuse converter) completed in 16018ms.\nshowdown (new converter) completed in 18234ms.\nmarkdown-js completed in 24270ms.\n```\n\n__Marked is now faster than Discount, which is written in C.__\n\nFor those feeling skeptical: These benchmarks run the entire markdown test suite\n1000 times. The test suite tests every feature. It doesn't cater to specific\naspects.\n\n## Install\n\n``` bash\n$ npm install marked\n```\n\n## Another Javascript Markdown Parser\n\nThe point of marked was to create a markdown compiler where it was possible to\nfrequently parse huge chunks of markdown without having to worry about\ncaching the compiled output somehow...or blocking for an unnecesarily long time.\n\nmarked is very concise and still implements all markdown features. It is also\nnow fully compatible with the client-side.\n\nmarked more or less passes the official markdown test suite in its\nentirety. This is important because a surprising number of markdown compilers\ncannot pass more than a few tests. It was very difficult to get marked as\ncompliant as it is. It could have cut corners in several areas for the sake\nof performance, but did not in order to be exactly what you expect in terms\nof a markdown rendering. In fact, this is why marked could be considered at a\ndisadvantage in the benchmarks above.\n\nAlong with implementing every markdown feature, marked also implements\n[GFM features](http://github.github.com/github-flavored-markdown/).\n\n## Options\n\nmarked has 4 different switches which change behavior.\n\n- __pedantic__: Conform to obscure parts of `markdown.pl` as much as possible.\n Don't fix any of the original markdown bugs or poor behavior.\n- __gfm__: Enable github flavored markdown (enabled by default).\n- __sanitize__: Sanitize the output. Ignore any HTML that has been input.\n- __highlight__: A callback to highlight code blocks.\n\nNone of the above are mutually exclusive/inclusive.\n\n## Usage\n\n``` js\n// Set default options\nmarked.setOptions({\n gfm: true,\n pedantic: false,\n sanitize: true,\n // callback for code highlighter\n highlight: function(code, lang) {\n if (lang === 'js') {\n return javascriptHighlighter(code);\n }\n return code;\n }\n});\nconsole.log(marked('i am using __markdown__.'));\n```\n\nYou also have direct access to the lexer and parser if you so desire.\n\n``` js\nvar tokens = marked.lexer(text);\nconsole.log(marked.parser(tokens));\n```\n\n``` bash\n$ node\n> require('marked').lexer('> i am using marked.')\n[ { type: 'blockquote_start' },\n { type: 'paragraph',\n text: 'i am using marked.' },\n { type: 'blockquote_end' },\n links: {} ]\n```\n\n## CLI\n\n``` bash\n$ marked -o hello.html\nhello world\n^D\n$ cat hello.html\n

    hello world

    \n```\n\n## License\n\nCopyright (c) 2011-2012, Christopher Jeffrey. (MIT License)\n\nSee LICENSE for more info.\n", - "readmeFilename": "README.md", - "_id": "marked@0.2.6", - "dist": { - "shasum": "6726d24e911610fb7ea7f9f3b11abd343e415a29" - }, - "_from": "marked" -} diff --git a/deploy/core/node_modules/source-map/.npmignore b/deploy/core/node_modules/source-map/.npmignore deleted file mode 100644 index 3dddf3f67..000000000 --- a/deploy/core/node_modules/source-map/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/* -node_modules/* diff --git a/deploy/core/node_modules/source-map/.travis.yml b/deploy/core/node_modules/source-map/.travis.yml deleted file mode 100644 index ddc9c4f98..000000000 --- a/deploy/core/node_modules/source-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" \ No newline at end of file diff --git a/deploy/core/node_modules/source-map/CHANGELOG.md b/deploy/core/node_modules/source-map/CHANGELOG.md deleted file mode 100644 index 94429f43e..000000000 --- a/deploy/core/node_modules/source-map/CHANGELOG.md +++ /dev/null @@ -1,104 +0,0 @@ -# Change Log - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github isse 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. - diff --git a/deploy/core/node_modules/source-map/LICENSE b/deploy/core/node_modules/source-map/LICENSE deleted file mode 100644 index ed1b7cf27..000000000 --- a/deploy/core/node_modules/source-map/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -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. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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. diff --git a/deploy/core/node_modules/source-map/Makefile.dryice.js b/deploy/core/node_modules/source-map/Makefile.dryice.js deleted file mode 100644 index d6fc26a79..000000000 --- a/deploy/core/node_modules/source-map/Makefile.dryice.js +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -var path = require('path'); -var fs = require('fs'); -var copy = require('dryice').copy; - -function removeAmdefine(src) { - src = String(src).replace( - /if\s*\(typeof\s*define\s*!==\s*'function'\)\s*{\s*var\s*define\s*=\s*require\('amdefine'\)\(module,\s*require\);\s*}\s*/g, - ''); - src = src.replace( - /\b(define\(.*)('amdefine',?)/gm, - '$1'); - return src; -} -removeAmdefine.onRead = true; - -function makeNonRelative(src) { - return src - .replace(/require\('.\//g, 'require(\'source-map/') - .replace(/\.\.\/\.\.\/lib\//g, ''); -} -makeNonRelative.onRead = true; - -function buildBrowser() { - console.log('\nCreating dist/source-map.js'); - - var project = copy.createCommonJsProject({ - roots: [ path.join(__dirname, 'lib') ] - }); - - copy({ - source: [ - 'build/mini-require.js', - { - project: project, - require: [ 'source-map/source-map-generator', - 'source-map/source-map-consumer', - 'source-map/source-node'] - }, - 'build/suffix-browser.js' - ], - filter: [ - copy.filter.moduleDefines, - removeAmdefine - ], - dest: 'dist/source-map.js' - }); -} - -function buildBrowserMin() { - console.log('\nCreating dist/source-map.min.js'); - - copy({ - source: 'dist/source-map.js', - filter: copy.filter.uglifyjs, - dest: 'dist/source-map.min.js' - }); -} - -function buildFirefox() { - console.log('\nCreating dist/SourceMap.jsm'); - - var project = copy.createCommonJsProject({ - roots: [ path.join(__dirname, 'lib') ] - }); - - copy({ - source: [ - 'build/prefix-source-map.jsm', - { - project: project, - require: [ 'source-map/source-map-consumer', - 'source-map/source-map-generator', - 'source-map/source-node' ] - }, - 'build/suffix-source-map.jsm' - ], - filter: [ - copy.filter.moduleDefines, - removeAmdefine, - makeNonRelative - ], - dest: 'dist/SourceMap.jsm' - }); - - // Create dist/test/Utils.jsm - console.log('\nCreating dist/test/Utils.jsm'); - - project = copy.createCommonJsProject({ - roots: [ __dirname, path.join(__dirname, 'lib') ] - }); - - copy({ - source: [ - 'build/prefix-utils.jsm', - 'build/assert-shim.js', - { - project: project, - require: [ 'test/source-map/util' ] - }, - 'build/suffix-utils.jsm' - ], - filter: [ - copy.filter.moduleDefines, - removeAmdefine, - makeNonRelative - ], - dest: 'dist/test/Utils.jsm' - }); - - function isTestFile(f) { - return /^test\-.*?\.js/.test(f); - } - - var testFiles = fs.readdirSync(path.join(__dirname, 'test', 'source-map')).filter(isTestFile); - - testFiles.forEach(function (testFile) { - console.log('\nCreating', path.join('dist', 'test', testFile.replace(/\-/g, '_'))); - - copy({ - source: [ - 'build/test-prefix.js', - path.join('test', 'source-map', testFile), - 'build/test-suffix.js' - ], - filter: [ - removeAmdefine, - makeNonRelative, - function (input, source) { - return input.replace('define(', - 'define("' - + path.join('test', 'source-map', testFile.replace(/\.js$/, '')) - + '", ["require", "exports", "module"], '); - }, - function (input, source) { - return input.replace('{THIS_MODULE}', function () { - return "test/source-map/" + testFile.replace(/\.js$/, ''); - }); - } - ], - dest: path.join('dist', 'test', testFile.replace(/\-/g, '_')) - }); - }); -} - -function ensureDir(name) { - var dirExists = false; - try { - dirExists = fs.statSync(name).isDirectory(); - } catch (err) {} - - if (!dirExists) { - fs.mkdirSync(name, 0777); - } -} - -ensureDir("dist"); -ensureDir("dist/test"); -buildFirefox(); -buildBrowser(); -buildBrowserMin(); diff --git a/deploy/core/node_modules/source-map/README.md b/deploy/core/node_modules/source-map/README.md deleted file mode 100644 index c20437bc6..000000000 --- a/deploy/core/node_modules/source-map/README.md +++ /dev/null @@ -1,434 +0,0 @@ -# Source Map - -This is a library to generate and consume the source map format -[described here][format]. - -This library is written in the Asynchronous Module Definition format, and works -in the following environments: - -* Modern Browsers supporting ECMAScript 5 (either after the build, or with an - AMD loader such as RequireJS) - -* Inside Firefox (as a JSM file, after the build) - -* With NodeJS versions 0.8.X and higher - -## Node - - $ npm install source-map - -## Building from Source (for everywhere else) - -Install Node and then run - - $ git clone https://fitzgen@github.com/mozilla/source-map.git - $ cd source-map - $ npm link . - -Next, run - - $ node Makefile.dryice.js - -This should spew a bunch of stuff to stdout, and create the following files: - -* `dist/source-map.js` - The unminified browser version. - -* `dist/source-map.min.js` - The minified browser version. - -* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source. - -## Examples - -### Consuming a source map - - var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; - - var smc = new SourceMapConsumer(rawSourceMap); - - console.log(smc.sources); - // [ 'http://example.com/www/js/one.js', - // 'http://example.com/www/js/two.js' ] - - console.log(smc.originalPositionFor({ - line: 2, - column: 28 - })); - // { source: 'http://example.com/www/js/two.js', - // line: 2, - // column: 10, - // name: 'n' } - - console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 - })); - // { line: 2, column: 28 } - - smc.eachMapping(function (m) { - // ... - }); - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - - function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } - } - - var ast = parse("40 + 2", "add.js"); - console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' - })); - // { code: '40 + 2', - // map: [object SourceMapGenerator] } - -#### With SourceMapGenerator (low level API) - - var map = new SourceMapGenerator({ - file: "source-mapped.js" - }); - - map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" - }); - - console.log(map.toString()); - // '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' - -## API - -Get a reference to the module: - - // NodeJS - var sourceMap = require('source-map'); - - // Browser builds - var sourceMap = window.sourceMap; - - // Inside Firefox - let sourceMap = {}; - Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referrenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: The generated filename this source map is associated with. - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. - -* `column`: The column number in the generated source. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. - -* `column`: The column number in the original source, or null or null if this - information is not available. - -* `name`: The original identifier, or null if this information is not available. - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. - -* `column`: The column number in the original source. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. - -* `column`: The column number in the generated source, or null. - -#### SourceMapConsumer.prototype.sourceContentFor(source) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator(startOfSourceMap) - -To create a new one, you must pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: An optional root for all relative URLs in this source map. - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new SourceMapGenerator based on a SourceMapConsumer - -* `sourceMapConsumer` The SourceMap. - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimium of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used. - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode(line, column, source[, chunk[, name]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. - -* `source`: The original source's filename. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming whitespace from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -### SourceNode.prototype.toStringWithSourceMap(startOfSourceMap) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -## Tests - -[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) - -Install NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`. - -To add new tests, create a new file named `test/test-.js` -and export your test functions with names that start with "test", for example - - exports["test doing the foo bar"] = function (assert, util) { - ... - }; - -The new test will be located automatically when you run the suite. - -The `util` argument is the test utility module located at `test/source-map/util`. - -The `assert` argument is a cut down version of node's assert module. You have -access to the following assertion functions: - -* `doesNotThrow` - -* `equal` - -* `ok` - -* `strictEqual` - -* `throws` - -(The reason for the restricted set of test functions is because we need the -tests to run inside Firefox's test suite as well and so the assert module is -shimmed in that environment. See `build/assert-shim.js`.) - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit -[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap -[Dryice]: https://github.com/mozilla/dryice diff --git a/deploy/core/node_modules/source-map/build/assert-shim.js b/deploy/core/node_modules/source-map/build/assert-shim.js deleted file mode 100644 index daa1a623c..000000000 --- a/deploy/core/node_modules/source-map/build/assert-shim.js +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -define('test/source-map/assert', ['exports'], function (exports) { - - let do_throw = function (msg) { - throw new Error(msg); - }; - - exports.init = function (throw_fn) { - do_throw = throw_fn; - }; - - exports.doesNotThrow = function (fn) { - try { - fn(); - } - catch (e) { - do_throw(e.message); - } - }; - - exports.equal = function (actual, expected, msg) { - msg = msg || String(actual) + ' != ' + String(expected); - if (actual != expected) { - do_throw(msg); - } - }; - - exports.ok = function (val, msg) { - msg = msg || String(val) + ' is falsey'; - if (!Boolean(val)) { - do_throw(msg); - } - }; - - exports.strictEqual = function (actual, expected, msg) { - msg = msg || String(actual) + ' !== ' + String(expected); - if (actual !== expected) { - do_throw(msg); - } - }; - - exports.throws = function (fn) { - try { - fn(); - do_throw('Expected an error to be thrown, but it wasn\'t.'); - } - catch (e) { - } - }; - -}); diff --git a/deploy/core/node_modules/source-map/build/mini-require.js b/deploy/core/node_modules/source-map/build/mini-require.js deleted file mode 100644 index 0daf45377..000000000 --- a/deploy/core/node_modules/source-map/build/mini-require.js +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * Define a module along with a payload. - * @param {string} moduleName Name for the payload - * @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec - * @param {function} payload Function with (require, exports, module) params - */ -function define(moduleName, deps, payload) { - if (typeof moduleName != "string") { - throw new TypeError('Expected string, got: ' + moduleName); - } - - if (arguments.length == 2) { - payload = deps; - } - - if (moduleName in define.modules) { - throw new Error("Module already defined: " + moduleName); - } - define.modules[moduleName] = payload; -}; - -/** - * The global store of un-instantiated modules - */ -define.modules = {}; - - -/** - * We invoke require() in the context of a Domain so we can have multiple - * sets of modules running separate from each other. - * This contrasts with JSMs which are singletons, Domains allows us to - * optionally load a CommonJS module twice with separate data each time. - * Perhaps you want 2 command lines with a different set of commands in each, - * for example. - */ -function Domain() { - this.modules = {}; - this._currentModule = null; -} - -(function () { - - /** - * Lookup module names and resolve them by calling the definition function if - * needed. - * There are 2 ways to call this, either with an array of dependencies and a - * callback to call when the dependencies are found (which can happen - * asynchronously in an in-page context) or with a single string an no callback - * where the dependency is resolved synchronously and returned. - * The API is designed to be compatible with the CommonJS AMD spec and - * RequireJS. - * @param {string[]|string} deps A name, or names for the payload - * @param {function|undefined} callback Function to call when the dependencies - * are resolved - * @return {undefined|object} The module required or undefined for - * array/callback method - */ - Domain.prototype.require = function(deps, callback) { - if (Array.isArray(deps)) { - var params = deps.map(function(dep) { - return this.lookup(dep); - }, this); - if (callback) { - callback.apply(null, params); - } - return undefined; - } - else { - return this.lookup(deps); - } - }; - - function normalize(path) { - var bits = path.split('/'); - var i = 1; - while (i < bits.length) { - if (bits[i] === '..') { - bits.splice(i-1, 1); - } else if (bits[i] === '.') { - bits.splice(i, 1); - } else { - i++; - } - } - return bits.join('/'); - } - - function join(a, b) { - a = a.trim(); - b = b.trim(); - if (/^\//.test(b)) { - return b; - } else { - return a.replace(/\/*$/, '/') + b; - } - } - - function dirname(path) { - var bits = path.split('/'); - bits.pop(); - return bits.join('/'); - } - - /** - * Lookup module names and resolve them by calling the definition function if - * needed. - * @param {string} moduleName A name for the payload to lookup - * @return {object} The module specified by aModuleName or null if not found. - */ - Domain.prototype.lookup = function(moduleName) { - if (/^\./.test(moduleName)) { - moduleName = normalize(join(dirname(this._currentModule), moduleName)); - } - - if (moduleName in this.modules) { - var module = this.modules[moduleName]; - return module; - } - - if (!(moduleName in define.modules)) { - throw new Error("Module not defined: " + moduleName); - } - - var module = define.modules[moduleName]; - - if (typeof module == "function") { - var exports = {}; - var previousModule = this._currentModule; - this._currentModule = moduleName; - module(this.require.bind(this), exports, { id: moduleName, uri: "" }); - this._currentModule = previousModule; - module = exports; - } - - // cache the resulting module object for next time - this.modules[moduleName] = module; - - return module; - }; - -}()); - -define.Domain = Domain; -define.globalDomain = new Domain(); -var require = define.globalDomain.require.bind(define.globalDomain); diff --git a/deploy/core/node_modules/source-map/build/prefix-source-map.jsm b/deploy/core/node_modules/source-map/build/prefix-source-map.jsm deleted file mode 100644 index ee2539d81..000000000 --- a/deploy/core/node_modules/source-map/build/prefix-source-map.jsm +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/* - * WARNING! - * - * Do not edit this file directly, it is built from the sources at - * https://github.com/mozilla/source-map/ - */ - -/////////////////////////////////////////////////////////////////////////////// - - -this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; - -Components.utils.import('resource://gre/modules/devtools/Require.jsm'); diff --git a/deploy/core/node_modules/source-map/build/prefix-utils.jsm b/deploy/core/node_modules/source-map/build/prefix-utils.jsm deleted file mode 100644 index 80341d452..000000000 --- a/deploy/core/node_modules/source-map/build/prefix-utils.jsm +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/* - * WARNING! - * - * Do not edit this file directly, it is built from the sources at - * https://github.com/mozilla/source-map/ - */ - -Components.utils.import('resource://gre/modules/devtools/Require.jsm'); -Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); - -this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; diff --git a/deploy/core/node_modules/source-map/build/suffix-browser.js b/deploy/core/node_modules/source-map/build/suffix-browser.js deleted file mode 100644 index fb29ff5fd..000000000 --- a/deploy/core/node_modules/source-map/build/suffix-browser.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/////////////////////////////////////////////////////////////////////////////// - -this.sourceMap = { - SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer, - SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator, - SourceNode: require('source-map/source-node').SourceNode -}; diff --git a/deploy/core/node_modules/source-map/build/suffix-source-map.jsm b/deploy/core/node_modules/source-map/build/suffix-source-map.jsm deleted file mode 100644 index cf3c2d8d3..000000000 --- a/deploy/core/node_modules/source-map/build/suffix-source-map.jsm +++ /dev/null @@ -1,6 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/////////////////////////////////////////////////////////////////////////////// - -this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; -this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; -this.SourceNode = require('source-map/source-node').SourceNode; diff --git a/deploy/core/node_modules/source-map/build/suffix-utils.jsm b/deploy/core/node_modules/source-map/build/suffix-utils.jsm deleted file mode 100644 index b31b84cb6..000000000 --- a/deploy/core/node_modules/source-map/build/suffix-utils.jsm +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -function runSourceMapTests(modName, do_throw) { - let mod = require(modName); - let assert = require('test/source-map/assert'); - let util = require('test/source-map/util'); - - assert.init(do_throw); - - for (let k in mod) { - if (/^test/.test(k)) { - mod[k](assert, util); - } - } - -} -this.runSourceMapTests = runSourceMapTests; diff --git a/deploy/core/node_modules/source-map/build/test-prefix.js b/deploy/core/node_modules/source-map/build/test-prefix.js deleted file mode 100644 index 1b13f300e..000000000 --- a/deploy/core/node_modules/source-map/build/test-prefix.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * WARNING! - * - * Do not edit this file directly, it is built from the sources at - * https://github.com/mozilla/source-map/ - */ - -Components.utils.import('resource://test/Utils.jsm'); diff --git a/deploy/core/node_modules/source-map/build/test-suffix.js b/deploy/core/node_modules/source-map/build/test-suffix.js deleted file mode 100644 index bec2de3f2..000000000 --- a/deploy/core/node_modules/source-map/build/test-suffix.js +++ /dev/null @@ -1,3 +0,0 @@ -function run_test() { - runSourceMapTests('{THIS_MODULE}', do_throw); -} diff --git a/deploy/core/node_modules/source-map/lib/source-map.js b/deploy/core/node_modules/source-map/lib/source-map.js deleted file mode 100644 index 121ad2416..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./source-map/source-node').SourceNode; diff --git a/deploy/core/node_modules/source-map/lib/source-map/array-set.js b/deploy/core/node_modules/source-map/lib/source-map/array-set.js deleted file mode 100644 index 40f9a18b1..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/array-set.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('./util'); - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = {}; - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var isDuplicate = this.has(aStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - this._set[util.toSetString(aStr)] = idx; - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - return Object.prototype.hasOwnProperty.call(this._set, - util.toSetString(aStr)); - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (this.has(aStr)) { - return this._set[util.toSetString(aStr)]; - } - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/base64-vlq.js b/deploy/core/node_modules/source-map/lib/source-map/base64-vlq.js deleted file mode 100644 index 1b67bb375..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/base64-vlq.js +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 THE COPYRIGHT - * OWNER OR CONTRIBUTORS 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. - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64 = require('./base64'); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string. - */ - exports.decode = function base64VLQ_decode(aStr) { - var i = 0; - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (i >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - digit = base64.decode(aStr.charAt(i++)); - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - return { - value: fromVLQSigned(result), - rest: aStr.slice(i) - }; - }; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/base64.js b/deploy/core/node_modules/source-map/lib/source-map/base64.js deleted file mode 100644 index 863cc4650..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/base64.js +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var charToIntMap = {}; - var intToCharMap = {}; - - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - .split('') - .forEach(function (ch, index) { - charToIntMap[ch] = index; - intToCharMap[index] = ch; - }); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function base64_encode(aNumber) { - if (aNumber in intToCharMap) { - return intToCharMap[aNumber]; - } - throw new TypeError("Must be between 0 and 63: " + aNumber); - }; - - /** - * Decode a single base 64 digit to an integer. - */ - exports.decode = function base64_decode(aChar) { - if (aChar in charToIntMap) { - return charToIntMap[aChar]; - } - throw new TypeError("Not a valid base 64 digit: " + aChar); - }; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/binary-search.js b/deploy/core/node_modules/source-map/lib/source-map/binary-search.js deleted file mode 100644 index ff347c68b..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/binary-search.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the next - // closest element that is less than that element. - // - // 3. We did not find the exact element, and there is no next-closest - // element which is less than the one we are searching for, so we - // return null. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return aHaystack[mid]; - } - else if (cmp > 0) { - // aHaystack[mid] is greater than our needle. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); - } - // We did not find an exact match, return the next closest one - // (termination case 2). - return aHaystack[mid]; - } - else { - // aHaystack[mid] is less than our needle. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); - } - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 - ? null - : aHaystack[aLow]; - } - } - - /** - * This is an implementation of binary search which will always try and return - * the next lowest value checked if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - */ - exports.search = function search(aNeedle, aHaystack, aCompare) { - return aHaystack.length > 0 - ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) - : null; - }; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/source-map-consumer.js b/deploy/core/node_modules/source-map/lib/source-map/source-map-consumer.js deleted file mode 100644 index 8f0d9fed2..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/source-map-consumer.js +++ /dev/null @@ -1,441 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('./util'); - var binarySearch = require('./binary-search'); - var ArraySet = require('./array-set').ArraySet; - var base64VLQ = require('./base64-vlq'); - - /** - * A SourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The only parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function SourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - var names = util.getArg(sourceMap, 'names'); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - if (version !== this._version) { - throw new Error('Unsupported version: ' + version); - } - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names, true); - this._sources = ArraySet.fromArray(sources, true); - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this.file = file; - - // `this._generatedMappings` and `this._originalMappings` hold the parsed - // mapping coordinates from the source map's "mappings" attribute. Each - // object in the array is of the form - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `this._generatedMappings` is ordered by the generated positions. - // - // `this._originalMappings` is ordered by the original positions. - this._generatedMappings = []; - this._originalMappings = []; - this._parseMappings(mappings, sourceRoot); - } - - /** - * Create a SourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @returns SourceMapConsumer - */ - SourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap) { - var smc = Object.create(SourceMapConsumer.prototype); - - smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - - smc._generatedMappings = aSourceMap._mappings.slice() - .sort(util.compareByGeneratedPositions); - smc._originalMappings = aSourceMap._mappings.slice() - .sort(util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(SourceMapConsumer.prototype, 'sources', { - get: function () { - return this._sources.toArray().map(function (s) { - return this.sourceRoot ? util.join(this.sourceRoot, s) : s; - }, this); - } - }); - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (an ordered list in this._generatedMappings). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var mappingSeparator = /^[,;]/; - var str = aStr; - var mapping; - var temp; - - while (str.length > 0) { - if (str.charAt(0) === ';') { - generatedLine++; - str = str.slice(1); - previousGeneratedColumn = 0; - } - else if (str.charAt(0) === ',') { - str = str.slice(1); - } - else { - mapping = {}; - mapping.generatedLine = generatedLine; - - // Generated column. - temp = base64VLQ.decode(str); - mapping.generatedColumn = previousGeneratedColumn + temp.value; - previousGeneratedColumn = mapping.generatedColumn; - str = temp.rest; - - if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { - // Original source. - temp = base64VLQ.decode(str); - mapping.source = this._sources.at(previousSource + temp.value); - previousSource += temp.value; - str = temp.rest; - if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { - throw new Error('Found a source, but no line and column'); - } - - // Original line. - temp = base64VLQ.decode(str); - mapping.originalLine = previousOriginalLine + temp.value; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - str = temp.rest; - if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { - throw new Error('Found a source and line, but no column'); - } - - // Original column. - temp = base64VLQ.decode(str); - mapping.originalColumn = previousOriginalColumn + temp.value; - previousOriginalColumn = mapping.originalColumn; - str = temp.rest; - - if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { - // Original name. - temp = base64VLQ.decode(str); - mapping.name = this._names.at(previousName + temp.value); - previousName += temp.value; - str = temp.rest; - } - } - - this._generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - this._originalMappings.push(mapping); - } - } - } - - this._originalMappings.sort(util.compareByOriginalPositions); - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - SourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator); - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ - SourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var mapping = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositions); - - if (mapping) { - var source = util.getArg(mapping, 'source', null); - if (source && this.sourceRoot) { - source = util.join(this.sourceRoot, source); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * availible. - */ - SourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource) { - if (!this.sourcesContent) { - return null; - } - - if (this.sourceRoot) { - aSource = util.relative(this.sourceRoot, aSource); - } - - if (this._sources.has(aSource)) { - return this.sourcesContent[this._sources.indexOf(aSource)]; - } - - var url; - if (this.sourceRoot - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + aSource)) { - return this.sourcesContent[this._sources.indexOf("/" + aSource)]; - } - } - - throw new Error('"' + aSource + '" is not in the SourceMap.'); - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - SourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - if (this.sourceRoot) { - needle.source = util.relative(this.sourceRoot, needle.source); - } - - var mapping = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); - - if (mapping) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null) - }; - } - - return { - line: null, - column: null - }; - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source; - if (source && sourceRoot) { - source = util.join(sourceRoot, source); - } - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name - }; - }).forEach(aCallback, context); - }; - - exports.SourceMapConsumer = SourceMapConsumer; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/source-map-generator.js b/deploy/core/node_modules/source-map/lib/source-map/source-map-generator.js deleted file mode 100644 index 48ead7ddc..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/source-map-generator.js +++ /dev/null @@ -1,380 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64VLQ = require('./base64-vlq'); - var util = require('./util'); - var ArraySet = require('./array-set').ArraySet; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. To create a new one, you must pass an object - * with the following properties: - * - * - file: The filename of the generated source. - * - sourceRoot: An optional root for all URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - this._file = util.getArg(aArgs, 'file'); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = []; - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source) { - newMapping.source = mapping.source; - if (sourceRoot) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - this._validateMapping(generated, original, source, name); - - if (source && !this._sources.has(source)) { - this._sources.add(source); - } - - if (name && !this._names.has(name)) { - this._names.add(name); - } - - this._mappings.push({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent !== null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = {}; - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) { - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (!aSourceFile) { - aSourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "aSourceFile" relative if an absolute Url is passed. - if (sourceRoot) { - aSourceFile = util.relative(sourceRoot, aSourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "aSourceFile" - this._mappings.forEach(function (mapping) { - if (mapping.source === aSourceFile && mapping.originalLine) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source !== null) { - // Copy mapping - if (sourceRoot) { - mapping.source = util.relative(sourceRoot, original.source); - } else { - mapping.source = original.source; - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name !== null && mapping.name !== null) { - // Only use the identifier name if it's an identifier - // in both SourceMaps - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - if (sourceRoot) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - orginal: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var mapping; - - // The mappings must be guaranteed to be in sorted order before we start - // serializing them or else the generated line numbers (which are defined - // via the ';' separators) will be all messed up. Note: it might be more - // performant to maintain the sorting as we insert them, rather than as we - // serialize them, but the big O is the same either way. - this._mappings.sort(util.compareByGeneratedPositions); - - for (var i = 0, len = this._mappings.length; i < len; i++) { - mapping = this._mappings[i]; - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - result += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { - continue; - } - result += ','; - } - } - - result += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source) { - result += base64VLQ.encode(this._sources.indexOf(mapping.source) - - previousSource); - previousSource = this._sources.indexOf(mapping.source); - - // lines are stored 0-based in SourceMap spec version 3 - result += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - result += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name) { - result += base64VLQ.encode(this._names.indexOf(mapping.name) - - previousName); - previousName = this._names.indexOf(mapping.name); - } - } - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, - key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - file: this._file, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._sourceRoot) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/source-node.js b/deploy/core/node_modules/source-map/lib/source-map/source-node.js deleted file mode 100644 index 626cb6574..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/source-node.js +++ /dev/null @@ -1,371 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; - var util = require('./util'); - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine === undefined ? null : aLine; - this.column = aColumn === undefined ? null : aColumn; - this.source = aSource === undefined ? null : aSource; - this.name = aName === undefined ? null : aName; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // The generated code - // Processed fragments are removed from this array. - var remainingLines = aGeneratedCode.split('\n'); - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping === null) { - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(remainingLines.shift() + "\n"); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - } else { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - var code = ""; - // Associate full lines with "lastMapping" - do { - code += remainingLines.shift() + "\n"; - lastGeneratedLine++; - lastGeneratedColumn = 0; - } while (lastGeneratedLine < mapping.generatedLine); - // When we reached the correct line, we add code until we - // reach the correct column too. - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - code += nextLine.substr(0, mapping.generatedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - // Create the SourceNode. - addMappingWithCode(lastMapping, code); - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[0]; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - } - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - // Associate the remaining code in the current line with "lastMapping" - // and add the remaining lines without any mapping - addMappingWithCode(lastMapping, remainingLines.join("\n")); - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - mapping.source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk instanceof SourceNode) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild instanceof SourceNode) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i] instanceof SourceNode) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - chunk.split('').forEach(function (ch) { - if (ch === '\n') { - generated.line++; - generated.column = 0; - } else { - generated.column++; - } - }); - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - -}); diff --git a/deploy/core/node_modules/source-map/lib/source-map/util.js b/deploy/core/node_modules/source-map/lib/source-map/util.js deleted file mode 100644 index 87946d3f7..000000000 --- a/deploy/core/node_modules/source-map/lib/source-map/util.js +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; - var dataUrlRegexp = /^data:.+\,.+/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[3], - host: match[4], - port: match[6], - path: match[7] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = aParsedUrl.scheme + "://"; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + "@" - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - function join(aRoot, aPath) { - var url; - - if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) { - return aPath; - } - - if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { - url.path = aPath; - return urlGenerate(url); - } - - return aRoot.replace(/\/$/, '') + '/' + aPath; - } - exports.join = join; - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - return '$' + aStr; - } - exports.toSetString = toSetString; - - function fromSetString(aStr) { - return aStr.substr(1); - } - exports.fromSetString = fromSetString; - - function relative(aRoot, aPath) { - aRoot = aRoot.replace(/\/$/, ''); - - var url = urlParse(aRoot); - if (aPath.charAt(0) == "/" && url && url.path == "/") { - return aPath.slice(1); - } - - return aPath.indexOf(aRoot + '/') === 0 - ? aPath.substr(aRoot.length + 1) - : aPath; - } - exports.relative = relative; - - function strcmp(aStr1, aStr2) { - var s1 = aStr1 || ""; - var s2 = aStr2 || ""; - return (s1 > s2) - (s1 < s2); - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp; - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp || onlyCompareOriginal) { - return cmp; - } - - cmp = strcmp(mappingA.name, mappingB.name); - if (cmp) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp) { - return cmp; - } - - return mappingA.generatedColumn - mappingB.generatedColumn; - }; - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings where the generated positions are - * compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) { - var cmp; - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - }; - exports.compareByGeneratedPositions = compareByGeneratedPositions; - -}); diff --git a/deploy/core/node_modules/source-map/node_modules/amdefine/LICENSE b/deploy/core/node_modules/source-map/node_modules/amdefine/LICENSE deleted file mode 100644 index f33d665de..000000000 --- a/deploy/core/node_modules/source-map/node_modules/amdefine/LICENSE +++ /dev/null @@ -1,58 +0,0 @@ -amdefine is released under two licenses: new BSD, and MIT. You may pick the -license that best suits your development needs. The text of both licenses are -provided below. - - -The "New" BSD License: ----------------------- - -Copyright (c) 2011, The Dojo Foundation -All rights reserved. - -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. - * Neither the name of the Dojo Foundation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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. - - - -MIT License ------------ - -Copyright (c) 2011, The Dojo Foundation - -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 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. diff --git a/deploy/core/node_modules/source-map/node_modules/amdefine/README.md b/deploy/core/node_modules/source-map/node_modules/amdefine/README.md deleted file mode 100644 index 44748fca1..000000000 --- a/deploy/core/node_modules/source-map/node_modules/amdefine/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# amdefine - -A module that can be used to implement AMD's define() in Node. This allows you -to code to the AMD API and have the module work in node programs without -requiring those other programs to use AMD. - -## Usage - -**1)** Update your package.json to indicate amdefine as a dependency: - -```javascript - "dependencies": { - "amdefine": ">=0.0.8" - } -``` - -Then run `npm install` to get amdefine into your project. - -**2)** At the top of each module that uses define(), place this code: - -```javascript -if (typeof define !== 'function') { var define = require('amdefine')(module) } -``` - -**Only use these snippets** when loading amdefine. If you preserve the basic structure, -with the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer). - -You can add spaces, line breaks and even require amdefine with a local path, but -keep the rest of the structure to get the stripping behavior. - -As you may know, because `if` statements in JavaScript don't have their own scope, the var -declaration in the above snippet is made whether the `if` expression is truthy or not. If -RequireJS is loaded then the declaration is superfluous because `define` is already already -declared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var` -declarations of the same variable in the same scope gracefully. - -If you want to deliver amdefine.js with your code rather than specifying it as a dependency -with npm, then just download the latest release and refer to it using a relative path: - -[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js) - -## define() usage - -It is best if you use the anonymous forms of define() in your module: - -```javascript -define(function (require) { - var dependency = require('dependency'); -}); -``` - -or - -```javascript -define(['dependency'], function (dependency) { - -}); -``` - -## RequireJS optimizer integration. - -Version 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html) -will have support for stripping the `if (typeof define !== 'function')` check -mentioned above, so you can include this snippet for code that runs in the -browser, but avoid taking the cost of the if() statement once the code is -optimized for deployment. - -## Node 0.4 Support - -If you want to support Node 0.4, then add `require` as the second parameter to amdefine: - -```javascript -//Only if you want Node 0.4. If using 0.5 or later, use the above snippet. -if (typeof define !== 'function') { var define = require('amdefine')(module, require) } -``` - -## Limitations - -### Synchronous vs Asynchronous - -amdefine creates a define() function that is callable by your code. It will -execute and trace dependencies and call the factory function *synchronously*, -to keep the behavior in line with Node's synchronous dependency tracing. - -The exception: calling AMD's callback-style require() from inside a factory -function. The require callback is called on process.nextTick(): - -```javascript -define(function (require) { - require(['a'], function(a) { - //'a' is loaded synchronously, but - //this callback is called on process.nextTick(). - }); -}); -``` - -### Loader Plugins - -Loader plugins are supported as long as they call their load() callbacks -synchronously. So ones that do network requests will not work. However plugins -like [text](http://requirejs.org/docs/api.html#text) can load text files locally. - -The plugin API's `load.fromText()` is **not supported** in amdefine, so this means -transpiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs) -will not work. This may be fixable, but it is a bit complex, and I do not have -enough node-fu to figure it out yet. See the source for amdefine.js if you want -to get an idea of the issues involved. - -## Tests - -To run the tests, cd to **tests** and run: - -``` -node all.js -``` - -## License - -New BSD and MIT. Check the LICENSE file for all the details. diff --git a/deploy/core/node_modules/source-map/node_modules/amdefine/amdefine.js b/deploy/core/node_modules/source-map/node_modules/amdefine/amdefine.js deleted file mode 100644 index a84776fe8..000000000 --- a/deploy/core/node_modules/source-map/node_modules/amdefine/amdefine.js +++ /dev/null @@ -1,299 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license amdefine 0.0.8 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/amdefine for details - */ - -/*jslint node: true */ -/*global module, process */ -'use strict'; - -/** - * Creates a define for node. - * @param {Object} module the "module" object that is defined by Node for the - * current module. - * @param {Function} [requireFn]. Node's require function for the current module. - * It only needs to be passed in Node versions before 0.5, when module.require - * did not exist. - * @returns {Function} a define function that is usable for the current node - * module. - */ -function amdefine(module, requireFn) { - 'use strict'; - var defineCache = {}, - loaderCache = {}, - alreadyCalled = false, - path = require('path'), - makeRequire, stringRequire; - - /** - * Trims the . and .. from an array of path segments. - * It will keep a leading path segment if a .. will become - * the first path segment, to help with module name lookups, - * which act like paths, but can be remapped. But the end result, - * all paths that use this function should look normalized. - * NOTE: this method MODIFIES the input array. - * @param {Array} ary the array of path segments. - */ - function trimDots(ary) { - var i, part; - for (i = 0; ary[i]; i+= 1) { - part = ary[i]; - if (part === '.') { - ary.splice(i, 1); - i -= 1; - } else if (part === '..') { - if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { - //End of the line. Keep at least one non-dot - //path segment at the front so it can be mapped - //correctly to disk. Otherwise, there is likely - //no path mapping for a path starting with '..'. - //This can still fail, but catches the most reasonable - //uses of .. - break; - } else if (i > 0) { - ary.splice(i - 1, 2); - i -= 2; - } - } - } - } - - function normalize(name, baseName) { - var baseParts; - - //Adjust any relative paths. - if (name && name.charAt(0) === '.') { - //If have a base name, try to normalize against it, - //otherwise, assume it is a top-level require that will - //be relative to baseUrl in the end. - if (baseName) { - baseParts = baseName.split('/'); - baseParts = baseParts.slice(0, baseParts.length - 1); - baseParts = baseParts.concat(name.split('/')); - trimDots(baseParts); - name = baseParts.join('/'); - } - } - - return name; - } - - /** - * Create the normalize() function passed to a loader plugin's - * normalize method. - */ - function makeNormalize(relName) { - return function (name) { - return normalize(name, relName); - }; - } - - function makeLoad(id) { - function load(value) { - loaderCache[id] = value; - } - - load.fromText = function (id, text) { - //This one is difficult because the text can/probably uses - //define, and any relative paths and requires should be relative - //to that id was it would be found on disk. But this would require - //bootstrapping a module/require fairly deeply from node core. - //Not sure how best to go about that yet. - throw new Error('amdefine does not implement load.fromText'); - }; - - return load; - } - - makeRequire = function (systemRequire, exports, module, relId) { - function amdRequire(deps, callback) { - if (typeof deps === 'string') { - //Synchronous, single module require('') - return stringRequire(systemRequire, exports, module, deps, relId); - } else { - //Array of dependencies with a callback. - - //Convert the dependencies to modules. - deps = deps.map(function (depName) { - return stringRequire(systemRequire, exports, module, depName, relId); - }); - - //Wait for next tick to call back the require call. - process.nextTick(function () { - callback.apply(null, deps); - }); - } - } - - amdRequire.toUrl = function (filePath) { - if (filePath.indexOf('.') === 0) { - return normalize(filePath, path.dirname(module.filename)); - } else { - return filePath; - } - }; - - return amdRequire; - }; - - //Favor explicit value, passed in if the module wants to support Node 0.4. - requireFn = requireFn || function req() { - return module.require.apply(module, arguments); - }; - - function runFactory(id, deps, factory) { - var r, e, m, result; - - if (id) { - e = loaderCache[id] = {}; - m = { - id: id, - uri: __filename, - exports: e - }; - r = makeRequire(requireFn, e, m, id); - } else { - //Only support one define call per file - if (alreadyCalled) { - throw new Error('amdefine with no module ID cannot be called more than once per file.'); - } - alreadyCalled = true; - - //Use the real variables from node - //Use module.exports for exports, since - //the exports in here is amdefine exports. - e = module.exports; - m = module; - r = makeRequire(requireFn, e, m, module.id); - } - - //If there are dependencies, they are strings, so need - //to convert them to dependency values. - if (deps) { - deps = deps.map(function (depName) { - return r(depName); - }); - } - - //Call the factory with the right dependencies. - if (typeof factory === 'function') { - result = factory.apply(m.exports, deps); - } else { - result = factory; - } - - if (result !== undefined) { - m.exports = result; - if (id) { - loaderCache[id] = m.exports; - } - } - } - - stringRequire = function (systemRequire, exports, module, id, relId) { - //Split the ID by a ! so that - var index = id.indexOf('!'), - originalId = id, - prefix, plugin; - - if (index === -1) { - id = normalize(id, relId); - - //Straight module lookup. If it is one of the special dependencies, - //deal with it, otherwise, delegate to node. - if (id === 'require') { - return makeRequire(systemRequire, exports, module, relId); - } else if (id === 'exports') { - return exports; - } else if (id === 'module') { - return module; - } else if (loaderCache.hasOwnProperty(id)) { - return loaderCache[id]; - } else if (defineCache[id]) { - runFactory.apply(null, defineCache[id]); - return loaderCache[id]; - } else { - if(systemRequire) { - return systemRequire(originalId); - } else { - throw new Error('No module with ID: ' + id); - } - } - } else { - //There is a plugin in play. - prefix = id.substring(0, index); - id = id.substring(index + 1, id.length); - - plugin = stringRequire(systemRequire, exports, module, prefix, relId); - - if (plugin.normalize) { - id = plugin.normalize(id, makeNormalize(relId)); - } else { - //Normalize the ID normally. - id = normalize(id, relId); - } - - if (loaderCache[id]) { - return loaderCache[id]; - } else { - plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {}); - - return loaderCache[id]; - } - } - }; - - //Create a define function specific to the module asking for amdefine. - function define(id, deps, factory) { - if (Array.isArray(id)) { - factory = deps; - deps = id; - id = undefined; - } else if (typeof id !== 'string') { - factory = id; - id = deps = undefined; - } - - if (deps && !Array.isArray(deps)) { - factory = deps; - deps = undefined; - } - - if (!deps) { - deps = ['require', 'exports', 'module']; - } - - //Set up properties for this module. If an ID, then use - //internal cache. If no ID, then use the external variables - //for this node module. - if (id) { - //Put the module in deep freeze until there is a - //require call for it. - defineCache[id] = [id, deps, factory]; - } else { - runFactory(id, deps, factory); - } - } - - //define.require, which has access to all the values in the - //cache. Useful for AMD modules that all have IDs in the file, - //but need to finally export a value to node based on one of those - //IDs. - define.require = function (id) { - if (loaderCache[id]) { - return loaderCache[id]; - } - - if (defineCache[id]) { - runFactory.apply(null, defineCache[id]); - return loaderCache[id]; - } - }; - - define.amd = {}; - - return define; -} - -module.exports = amdefine; diff --git a/deploy/core/node_modules/source-map/node_modules/amdefine/package.json b/deploy/core/node_modules/source-map/node_modules/amdefine/package.json deleted file mode 100644 index 7a2699406..000000000 --- a/deploy/core/node_modules/source-map/node_modules/amdefine/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "amdefine", - "description": "Provide AMD's define() API for declaring modules in the AMD format", - "version": "0.0.8", - "homepage": "http://github.com/jrburke/amdefine", - "author": { - "name": "James Burke", - "email": "jrburke@gmail.com", - "url": "http://github.com/jrburke" - }, - "licenses": [ - { - "type": "BSD", - "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE" - }, - { - "type": "MIT", - "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/jrburke/amdefine.git" - }, - "main": "./amdefine.js", - "engines": { - "node": ">=0.4.2" - }, - "readme": "# amdefine\n\nA module that can be used to implement AMD's define() in Node. This allows you\nto code to the AMD API and have the module work in node programs without\nrequiring those other programs to use AMD.\n\n## Usage\n\n**1)** Update your package.json to indicate amdefine as a dependency:\n\n```javascript\n \"dependencies\": {\n \"amdefine\": \">=0.0.8\"\n }\n```\n\nThen run `npm install` to get amdefine into your project.\n\n**2)** At the top of each module that uses define(), place this code:\n\n```javascript\nif (typeof define !== 'function') { var define = require('amdefine')(module) }\n```\n\n**Only use these snippets** when loading amdefine. If you preserve the basic structure,\nwith the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).\n\nYou can add spaces, line breaks and even require amdefine with a local path, but\nkeep the rest of the structure to get the stripping behavior.\n\nAs you may know, because `if` statements in JavaScript don't have their own scope, the var\ndeclaration in the above snippet is made whether the `if` expression is truthy or not. If\nRequireJS is loaded then the declaration is superfluous because `define` is already already\ndeclared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`\ndeclarations of the same variable in the same scope gracefully.\n\nIf you want to deliver amdefine.js with your code rather than specifying it as a dependency\nwith npm, then just download the latest release and refer to it using a relative path:\n\n[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)\n\n## define() usage\n\nIt is best if you use the anonymous forms of define() in your module:\n\n```javascript\ndefine(function (require) {\n var dependency = require('dependency');\n});\n```\n\nor\n\n```javascript\ndefine(['dependency'], function (dependency) {\n\n});\n```\n\n## RequireJS optimizer integration. \n\nVersion 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)\nwill have support for stripping the `if (typeof define !== 'function')` check\nmentioned above, so you can include this snippet for code that runs in the\nbrowser, but avoid taking the cost of the if() statement once the code is\noptimized for deployment.\n\n## Node 0.4 Support\n\nIf you want to support Node 0.4, then add `require` as the second parameter to amdefine:\n\n```javascript\n//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.\nif (typeof define !== 'function') { var define = require('amdefine')(module, require) }\n```\n\n## Limitations\n\n### Synchronous vs Asynchronous\n\namdefine creates a define() function that is callable by your code. It will\nexecute and trace dependencies and call the factory function *synchronously*,\nto keep the behavior in line with Node's synchronous dependency tracing.\n\nThe exception: calling AMD's callback-style require() from inside a factory\nfunction. The require callback is called on process.nextTick():\n\n```javascript\ndefine(function (require) {\n require(['a'], function(a) {\n //'a' is loaded synchronously, but\n //this callback is called on process.nextTick().\n });\n});\n```\n\n### Loader Plugins\n\nLoader plugins are supported as long as they call their load() callbacks\nsynchronously. So ones that do network requests will not work. However plugins\nlike [text](http://requirejs.org/docs/api.html#text) can load text files locally.\n\nThe plugin API's `load.fromText()` is **not supported** in amdefine, so this means\ntranspiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)\nwill not work. This may be fixable, but it is a bit complex, and I do not have\nenough node-fu to figure it out yet. See the source for amdefine.js if you want\nto get an idea of the issues involved.\n\n## Tests\n\nTo run the tests, cd to **tests** and run:\n\n```\nnode all.js\n```\n\n## License\n\nNew BSD and MIT. Check the LICENSE file for all the details.\n", - "readmeFilename": "README.md", - "_id": "amdefine@0.0.8", - "dist": { - "shasum": "f7bd04194c0982006ab80b260a5abe92d99ac424" - }, - "_from": "amdefine@>=0.0.4", - "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.0.8.tgz" -} diff --git a/deploy/core/node_modules/source-map/package.json b/deploy/core/node_modules/source-map/package.json deleted file mode 100644 index 088a745e9..000000000 --- a/deploy/core/node_modules/source-map/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "source-map", - "description": "Generates and consumes source maps", - "version": "0.1.30", - "homepage": "https://github.com/mozilla/source-map", - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/mozilla/source-map.git" - }, - "directories": { - "lib": "./lib" - }, - "main": "./lib/source-map.js", - "engines": { - "node": ">=0.8.0" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://opensource.org/licenses/BSD-3-Clause" - } - ], - "dependencies": { - "amdefine": ">=0.0.4" - }, - "devDependencies": { - "dryice": ">=0.4.8" - }, - "scripts": { - "test": "node test/run-tests.js", - "build": "node Makefile.dryice.js" - }, - "readme": "# Source Map\n\nThis is a library to generate and consume the source map format\n[described here][format].\n\nThis library is written in the Asynchronous Module Definition format, and works\nin the following environments:\n\n* Modern Browsers supporting ECMAScript 5 (either after the build, or with an\n AMD loader such as RequireJS)\n\n* Inside Firefox (as a JSM file, after the build)\n\n* With NodeJS versions 0.8.X and higher\n\n## Node\n\n $ npm install source-map\n\n## Building from Source (for everywhere else)\n\nInstall Node and then run\n\n $ git clone https://fitzgen@github.com/mozilla/source-map.git\n $ cd source-map\n $ npm link .\n\nNext, run\n\n $ node Makefile.dryice.js\n\nThis should spew a bunch of stuff to stdout, and create the following files:\n\n* `dist/source-map.js` - The unminified browser version.\n\n* `dist/source-map.min.js` - The minified browser version.\n\n* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.\n\n## Examples\n\n### Consuming a source map\n\n var rawSourceMap = {\n version: 3,\n file: 'min.js',\n names: ['bar', 'baz', 'n'],\n sources: ['one.js', 'two.js'],\n sourceRoot: 'http://example.com/www/js/',\n mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'\n };\n\n var smc = new SourceMapConsumer(rawSourceMap);\n\n console.log(smc.sources);\n // [ 'http://example.com/www/js/one.js',\n // 'http://example.com/www/js/two.js' ]\n\n console.log(smc.originalPositionFor({\n line: 2,\n column: 28\n }));\n // { source: 'http://example.com/www/js/two.js',\n // line: 2,\n // column: 10,\n // name: 'n' }\n\n console.log(smc.generatedPositionFor({\n source: 'http://example.com/www/js/two.js',\n line: 2,\n column: 10\n }));\n // { line: 2, column: 28 }\n\n smc.eachMapping(function (m) {\n // ...\n });\n\n### Generating a source map\n\nIn depth guide:\n[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)\n\n#### With SourceNode (high level API)\n\n function compile(ast) {\n switch (ast.type) {\n case 'BinaryExpression':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n [compile(ast.left), \" + \", compile(ast.right)]\n );\n case 'Literal':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n String(ast.value)\n );\n // ...\n default:\n throw new Error(\"Bad AST\");\n }\n }\n\n var ast = parse(\"40 + 2\", \"add.js\");\n console.log(compile(ast).toStringWithSourceMap({\n file: 'add.js'\n }));\n // { code: '40 + 2',\n // map: [object SourceMapGenerator] }\n\n#### With SourceMapGenerator (low level API)\n\n var map = new SourceMapGenerator({\n file: \"source-mapped.js\"\n });\n\n map.addMapping({\n generated: {\n line: 10,\n column: 35\n },\n source: \"foo.js\",\n original: {\n line: 33,\n column: 2\n },\n name: \"christopher\"\n });\n\n console.log(map.toString());\n // '{\"version\":3,\"file\":\"source-mapped.js\",\"sources\":[\"foo.js\"],\"names\":[\"christopher\"],\"mappings\":\";;;;;;;;;mCAgCEA\"}'\n\n## API\n\nGet a reference to the module:\n\n // NodeJS\n var sourceMap = require('source-map');\n\n // Browser builds\n var sourceMap = window.sourceMap;\n\n // Inside Firefox\n let sourceMap = {};\n Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);\n\n### SourceMapConsumer\n\nA SourceMapConsumer instance represents a parsed source map which we can query\nfor information about the original file positions by giving it a file position\nin the generated source.\n\n#### new SourceMapConsumer(rawSourceMap)\n\nThe only parameter is the raw source map (either as a string which can be\n`JSON.parse`'d, or an object). According to the spec, source maps have the\nfollowing attributes:\n\n* `version`: Which version of the source map spec this map is following.\n\n* `sources`: An array of URLs to the original source files.\n\n* `names`: An array of identifiers which can be referrenced by individual\n mappings.\n\n* `sourceRoot`: Optional. The URL root from which all sources are relative.\n\n* `sourcesContent`: Optional. An array of contents of the original source files.\n\n* `mappings`: A string of base64 VLQs which contain the actual mappings.\n\n* `file`: The generated filename this source map is associated with.\n\n#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)\n\nReturns the original source, line, and column information for the generated\nsource's line and column positions provided. The only argument is an object with\nthe following properties:\n\n* `line`: The line number in the generated source.\n\n* `column`: The column number in the generated source.\n\nand an object is returned with the following properties:\n\n* `source`: The original source file, or null if this information is not\n available.\n\n* `line`: The line number in the original source, or null if this information is\n not available.\n\n* `column`: The column number in the original source, or null or null if this\n information is not available.\n\n* `name`: The original identifier, or null if this information is not available.\n\n#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)\n\nReturns the generated line and column information for the original source,\nline, and column positions provided. The only argument is an object with\nthe following properties:\n\n* `source`: The filename of the original source.\n\n* `line`: The line number in the original source.\n\n* `column`: The column number in the original source.\n\nand an object is returned with the following properties:\n\n* `line`: The line number in the generated source, or null.\n\n* `column`: The column number in the generated source, or null.\n\n#### SourceMapConsumer.prototype.sourceContentFor(source)\n\nReturns the original source content for the source provided. The only\nargument is the URL of the original source file.\n\n#### SourceMapConsumer.prototype.eachMapping(callback, context, order)\n\nIterate over each mapping between an original source/line/column and a\ngenerated line/column in this source map.\n\n* `callback`: The function that is called with each mapping. Mappings have the\n form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,\n name }`\n\n* `context`: Optional. If specified, this object will be the value of `this`\n every time that `callback` is called.\n\n* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or\n `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over\n the mappings sorted by the generated file's line/column order or the\n original's source/line/column order, respectively. Defaults to\n `SourceMapConsumer.GENERATED_ORDER`.\n\n### SourceMapGenerator\n\nAn instance of the SourceMapGenerator represents a source map which is being\nbuilt incrementally.\n\n#### new SourceMapGenerator(startOfSourceMap)\n\nTo create a new one, you must pass an object with the following properties:\n\n* `file`: The filename of the generated source that this source map is\n associated with.\n\n* `sourceRoot`: An optional root for all relative URLs in this source map.\n\n#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)\n\nCreates a new SourceMapGenerator based on a SourceMapConsumer\n\n* `sourceMapConsumer` The SourceMap.\n\n#### SourceMapGenerator.prototype.addMapping(mapping)\n\nAdd a single mapping from original source line and column to the generated\nsource's line and column for this source map being created. The mapping object\nshould have the following properties:\n\n* `generated`: An object with the generated line and column positions.\n\n* `original`: An object with the original line and column positions.\n\n* `source`: The original source file (relative to the sourceRoot).\n\n* `name`: An optional original token name for this mapping.\n\n#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for an original source file.\n\n* `sourceFile` the URL of the original source file.\n\n* `sourceContent` the content of the source file.\n\n#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile])\n\nApplies a SourceMap for a source file to the SourceMap.\nEach mapping to the supplied source file is rewritten using the\nsupplied SourceMap. Note: The resolution for the resulting mappings\nis the minimium of this map and the supplied map.\n\n* `sourceMapConsumer`: The SourceMap to be applied.\n\n* `sourceFile`: Optional. The filename of the source file.\n If omitted, sourceMapConsumer.file will be used.\n\n#### SourceMapGenerator.prototype.toString()\n\nRenders the source map being generated to a string.\n\n### SourceNode\n\nSourceNodes provide a way to abstract over interpolating and/or concatenating\nsnippets of generated JavaScript source code, while maintaining the line and\ncolumn information associated between those snippets and the original source\ncode. This is useful as the final intermediate representation a compiler might\nuse before outputting the generated JS and source map.\n\n#### new SourceNode(line, column, source[, chunk[, name]])\n\n* `line`: The original line number associated with this source node, or null if\n it isn't associated with an original line.\n\n* `column`: The original column number associated with this source node, or null\n if it isn't associated with an original column.\n\n* `source`: The original source's filename.\n\n* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see\n below.\n\n* `name`: Optional. The original identifier.\n\n#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer)\n\nCreates a SourceNode from generated code and a SourceMapConsumer.\n\n* `code`: The generated code\n\n* `sourceMapConsumer` The SourceMap for the generated code\n\n#### SourceNode.prototype.add(chunk)\n\nAdd a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.prepend(chunk)\n\nPrepend a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for a source file. This will be added to the\n`SourceMap` in the `sourcesContent` field.\n\n* `sourceFile`: The filename of the source file\n\n* `sourceContent`: The content of the source file\n\n#### SourceNode.prototype.walk(fn)\n\nWalk over the tree of JS snippets in this node and its children. The walking\nfunction is called once for each snippet of JS and is passed that snippet and\nthe its original associated source's line/column location.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.walkSourceContents(fn)\n\nWalk over the tree of SourceNodes. The walking function is called for each\nsource file content and is passed the filename and source content.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.join(sep)\n\nLike `Array.prototype.join` except for SourceNodes. Inserts the separator\nbetween each of this source node's children.\n\n* `sep`: The separator.\n\n#### SourceNode.prototype.replaceRight(pattern, replacement)\n\nCall `String.prototype.replace` on the very right-most source snippet. Useful\nfor trimming whitespace from the end of a source node, etc.\n\n* `pattern`: The pattern to replace.\n\n* `replacement`: The thing to replace the pattern with.\n\n#### SourceNode.prototype.toString()\n\nReturn the string representation of this source node. Walks over the tree and\nconcatenates all the various snippets together to one string.\n\n### SourceNode.prototype.toStringWithSourceMap(startOfSourceMap)\n\nReturns the string representation of this tree of source nodes, plus a\nSourceMapGenerator which contains all the mappings between the generated and\noriginal sources.\n\nThe arguments are the same as those to `new SourceMapGenerator`.\n\n## Tests\n\n[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map)\n\nInstall NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.\n\nTo add new tests, create a new file named `test/test-.js`\nand export your test functions with names that start with \"test\", for example\n\n exports[\"test doing the foo bar\"] = function (assert, util) {\n ...\n };\n\nThe new test will be located automatically when you run the suite.\n\nThe `util` argument is the test utility module located at `test/source-map/util`.\n\nThe `assert` argument is a cut down version of node's assert module. You have\naccess to the following assertion functions:\n\n* `doesNotThrow`\n\n* `equal`\n\n* `ok`\n\n* `strictEqual`\n\n* `throws`\n\n(The reason for the restricted set of test functions is because we need the\ntests to run inside Firefox's test suite as well and so the assert module is\nshimmed in that environment. See `build/assert-shim.js`.)\n\n[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\n[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap\n[Dryice]: https://github.com/mozilla/dryice\n", - "readmeFilename": "README.md", - "_id": "source-map@0.1.30", - "dist": { - "shasum": "64b1c9c6502459a44f3b9b66850f8c7499afcdae" - }, - "_from": "source-map@", - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.30.tgz" -} diff --git a/deploy/core/node_modules/source-map/test/run-tests.js b/deploy/core/node_modules/source-map/test/run-tests.js deleted file mode 100644 index 626c53f70..000000000 --- a/deploy/core/node_modules/source-map/test/run-tests.js +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env node -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); -var util = require('./source-map/util'); - -function run(tests) { - var failures = []; - var total = 0; - var passed = 0; - - for (var i = 0; i < tests.length; i++) { - for (var k in tests[i].testCase) { - if (/^test/.test(k)) { - total++; - try { - tests[i].testCase[k](assert, util); - passed++; - } - catch (e) { - console.log('FAILED ' + tests[i].name + ': ' + k + '!'); - console.log(e.stack); - } - } - } - } - - console.log(""); - console.log(passed + ' / ' + total + ' tests passed.'); - console.log(""); - - failures.forEach(function (f) { - }); - - return failures.length; -} - -var code; - -process.stdout.on('close', function () { - process.exit(code); -}); - -function isTestFile(f) { - var testToRun = process.argv[2]; - return testToRun - ? path.basename(testToRun) === f - : /^test\-.*?\.js/.test(f); -} - -function toModule(f) { - return './source-map/' + f.replace(/\.js$/, ''); -} - -var requires = fs.readdirSync(path.join(__dirname, 'source-map')) - .filter(isTestFile) - .map(toModule); - -code = run(requires.map(require).map(function (mod, i) { - return { - name: requires[i], - testCase: mod - }; -})); -process.exit(code); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-api.js b/deploy/core/node_modules/source-map/test/source-map/test-api.js deleted file mode 100644 index 3801233c0..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-api.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2012 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var sourceMap; - try { - sourceMap = require('../../lib/source-map'); - } catch (e) { - sourceMap = {}; - Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); - } - - exports['test that the api is properly exposed in the top level'] = function (assert, util) { - assert.equal(typeof sourceMap.SourceMapGenerator, "function"); - assert.equal(typeof sourceMap.SourceMapConsumer, "function"); - assert.equal(typeof sourceMap.SourceNode, "function"); - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-array-set.js b/deploy/core/node_modules/source-map/test/source-map/test-array-set.js deleted file mode 100644 index b5797edd5..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-array-set.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var ArraySet = require('../../lib/source-map/array-set').ArraySet; - - function makeTestSet() { - var set = new ArraySet(); - for (var i = 0; i < 100; i++) { - set.add(String(i)); - } - return set; - } - - exports['test .has() membership'] = function (assert, util) { - var set = makeTestSet(); - for (var i = 0; i < 100; i++) { - assert.ok(set.has(String(i))); - } - }; - - exports['test .indexOf() elements'] = function (assert, util) { - var set = makeTestSet(); - for (var i = 0; i < 100; i++) { - assert.strictEqual(set.indexOf(String(i)), i); - } - }; - - exports['test .at() indexing'] = function (assert, util) { - var set = makeTestSet(); - for (var i = 0; i < 100; i++) { - assert.strictEqual(set.at(i), String(i)); - } - }; - - exports['test creating from an array'] = function (assert, util) { - var set = ArraySet.fromArray(['foo', 'bar', 'baz', 'quux', 'hasOwnProperty']); - - assert.ok(set.has('foo')); - assert.ok(set.has('bar')); - assert.ok(set.has('baz')); - assert.ok(set.has('quux')); - assert.ok(set.has('hasOwnProperty')); - - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.indexOf('bar'), 1); - assert.strictEqual(set.indexOf('baz'), 2); - assert.strictEqual(set.indexOf('quux'), 3); - - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.at(1), 'bar'); - assert.strictEqual(set.at(2), 'baz'); - assert.strictEqual(set.at(3), 'quux'); - }; - - exports['test that you can add __proto__; see github issue #30'] = function (assert, util) { - var set = new ArraySet(); - set.add('__proto__'); - assert.ok(set.has('__proto__')); - assert.strictEqual(set.at(0), '__proto__'); - assert.strictEqual(set.indexOf('__proto__'), 0); - }; - - exports['test .fromArray() with duplicates'] = function (assert, util) { - var set = ArraySet.fromArray(['foo', 'foo']); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 1); - - set = ArraySet.fromArray(['foo', 'foo'], true); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.at(1), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 2); - }; - - exports['test .add() with duplicates'] = function (assert, util) { - var set = new ArraySet(); - set.add('foo'); - - set.add('foo'); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 1); - - set.add('foo', true); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.at(1), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 2); - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-base64-vlq.js b/deploy/core/node_modules/source-map/test/source-map/test-base64-vlq.js deleted file mode 100644 index 653a874e9..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-base64-vlq.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64VLQ = require('../../lib/source-map/base64-vlq'); - - exports['test normal encoding and decoding'] = function (assert, util) { - var result; - for (var i = -255; i < 256; i++) { - result = base64VLQ.decode(base64VLQ.encode(i)); - assert.ok(result); - assert.equal(result.value, i); - assert.equal(result.rest, ""); - } - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-base64.js b/deploy/core/node_modules/source-map/test/source-map/test-base64.js deleted file mode 100644 index ff3a24456..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-base64.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64 = require('../../lib/source-map/base64'); - - exports['test out of range encoding'] = function (assert, util) { - assert.throws(function () { - base64.encode(-1); - }); - assert.throws(function () { - base64.encode(64); - }); - }; - - exports['test out of range decoding'] = function (assert, util) { - assert.throws(function () { - base64.decode('='); - }); - }; - - exports['test normal encoding and decoding'] = function (assert, util) { - for (var i = 0; i < 64; i++) { - assert.equal(base64.decode(base64.encode(i)), i); - } - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-binary-search.js b/deploy/core/node_modules/source-map/test/source-map/test-binary-search.js deleted file mode 100644 index ee306830d..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-binary-search.js +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var binarySearch = require('../../lib/source-map/binary-search'); - - function numberCompare(a, b) { - return a - b; - } - - exports['test too high'] = function (assert, util) { - var needle = 30; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.doesNotThrow(function () { - binarySearch.search(needle, haystack, numberCompare); - }); - - assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); - }; - - exports['test too low'] = function (assert, util) { - var needle = 1; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.doesNotThrow(function () { - binarySearch.search(needle, haystack, numberCompare); - }); - - assert.equal(binarySearch.search(needle, haystack, numberCompare), null); - }; - - exports['test exact search'] = function (assert, util) { - var needle = 4; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); - }; - - exports['test fuzzy search'] = function (assert, util) { - var needle = 19; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-dog-fooding.js b/deploy/core/node_modules/source-map/test/source-map/test-dog-fooding.js deleted file mode 100644 index d831b9262..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-dog-fooding.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - - exports['test eating our own dog food'] = function (assert, util) { - var smg = new SourceMapGenerator({ - file: 'testing.js', - sourceRoot: '/wu/tang' - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 1, column: 0 }, - generated: { line: 2, column: 2 } - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 2, column: 0 }, - generated: { line: 3, column: 2 } - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 3, column: 0 }, - generated: { line: 4, column: 2 } - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 4, column: 0 }, - generated: { line: 5, column: 2 } - }); - - var smc = new SourceMapConsumer(smg.toString()); - - // Exact - util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 0, null, smc, assert); - util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 0, null, smc, assert); - util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 0, null, smc, assert); - util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 0, null, smc, assert); - - // Fuzzy - - // Original to generated - util.assertMapping(2, 0, null, null, null, null, smc, assert, true); - util.assertMapping(2, 9, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true); - util.assertMapping(3, 0, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true); - util.assertMapping(3, 9, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true); - util.assertMapping(4, 0, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true); - util.assertMapping(4, 9, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true); - util.assertMapping(5, 0, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true); - util.assertMapping(5, 9, '/wu/tang/gza.coffee', 4, 0, null, smc, assert, true); - - // Generated to original - util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 1, null, smc, assert, null, true); - util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 3, null, smc, assert, null, true); - util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 6, null, smc, assert, null, true); - util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 9, null, smc, assert, null, true); - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-source-map-consumer.js b/deploy/core/node_modules/source-map/test/source-map/test-source-map-consumer.js deleted file mode 100644 index f2c65a7f0..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ /dev/null @@ -1,451 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - - exports['test that we can instantiate with a string or an objects'] = function (assert, util) { - assert.doesNotThrow(function () { - var map = new SourceMapConsumer(util.testMap); - }); - assert.doesNotThrow(function () { - var map = new SourceMapConsumer(JSON.stringify(util.testMap)); - }); - }; - - exports['test that the `sources` field has the original sources'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var sources = map.sources; - - assert.equal(sources[0], '/the/root/one.js'); - assert.equal(sources[1], '/the/root/two.js'); - assert.equal(sources.length, 2); - }; - - exports['test that the source root is reflected in a mapping\'s source field'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var mapping; - - mapping = map.originalPositionFor({ - line: 2, - column: 1 - }); - assert.equal(mapping.source, '/the/root/two.js'); - - mapping = map.originalPositionFor({ - line: 1, - column: 1 - }); - assert.equal(mapping.source, '/the/root/one.js'); - }; - - exports['test mapping tokens back exactly'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - - util.assertMapping(1, 1, '/the/root/one.js', 1, 1, null, map, assert); - util.assertMapping(1, 5, '/the/root/one.js', 1, 5, null, map, assert); - util.assertMapping(1, 9, '/the/root/one.js', 1, 11, null, map, assert); - util.assertMapping(1, 18, '/the/root/one.js', 1, 21, 'bar', map, assert); - util.assertMapping(1, 21, '/the/root/one.js', 2, 3, null, map, assert); - util.assertMapping(1, 28, '/the/root/one.js', 2, 10, 'baz', map, assert); - util.assertMapping(1, 32, '/the/root/one.js', 2, 14, 'bar', map, assert); - - util.assertMapping(2, 1, '/the/root/two.js', 1, 1, null, map, assert); - util.assertMapping(2, 5, '/the/root/two.js', 1, 5, null, map, assert); - util.assertMapping(2, 9, '/the/root/two.js', 1, 11, null, map, assert); - util.assertMapping(2, 18, '/the/root/two.js', 1, 21, 'n', map, assert); - util.assertMapping(2, 21, '/the/root/two.js', 2, 3, null, map, assert); - util.assertMapping(2, 28, '/the/root/two.js', 2, 10, 'n', map, assert); - }; - - exports['test mapping tokens fuzzy'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - - // Finding original positions - util.assertMapping(1, 20, '/the/root/one.js', 1, 21, 'bar', map, assert, true); - util.assertMapping(1, 30, '/the/root/one.js', 2, 10, 'baz', map, assert, true); - util.assertMapping(2, 12, '/the/root/two.js', 1, 11, null, map, assert, true); - - // Finding generated positions - util.assertMapping(1, 18, '/the/root/one.js', 1, 22, 'bar', map, assert, null, true); - util.assertMapping(1, 28, '/the/root/one.js', 2, 13, 'baz', map, assert, null, true); - util.assertMapping(2, 9, '/the/root/two.js', 1, 16, null, map, assert, null, true); - }; - - exports['test creating source map consumers with )]}\' prefix'] = function (assert, util) { - assert.doesNotThrow(function () { - var map = new SourceMapConsumer(")]}'" + JSON.stringify(util.testMap)); - }); - }; - - exports['test eachMapping'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var previousLine = -Infinity; - var previousColumn = -Infinity; - map.eachMapping(function (mapping) { - assert.ok(mapping.generatedLine >= previousLine); - - if (mapping.source) { - assert.equal(mapping.source.indexOf(util.testMap.sourceRoot), 0); - } - - if (mapping.generatedLine === previousLine) { - assert.ok(mapping.generatedColumn >= previousColumn); - previousColumn = mapping.generatedColumn; - } - else { - previousLine = mapping.generatedLine; - previousColumn = -Infinity; - } - }); - }; - - exports['test iterating over mappings in a different order'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var previousLine = -Infinity; - var previousColumn = -Infinity; - var previousSource = ""; - map.eachMapping(function (mapping) { - assert.ok(mapping.source >= previousSource); - - if (mapping.source === previousSource) { - assert.ok(mapping.originalLine >= previousLine); - - if (mapping.originalLine === previousLine) { - assert.ok(mapping.originalColumn >= previousColumn); - previousColumn = mapping.originalColumn; - } - else { - previousLine = mapping.originalLine; - previousColumn = -Infinity; - } - } - else { - previousSource = mapping.source; - previousLine = -Infinity; - previousColumn = -Infinity; - } - }, null, SourceMapConsumer.ORIGINAL_ORDER); - }; - - exports['test that we can set the context for `this` in eachMapping'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var context = {}; - map.eachMapping(function () { - assert.equal(this, context); - }, context); - }; - - exports['test that the `sourcesContent` field has the original sources'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMapWithSourcesContent); - var sourcesContent = map.sourcesContent; - - assert.equal(sourcesContent[0], ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(sourcesContent[1], ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.equal(sourcesContent.length, 2); - }; - - exports['test that we can get the original sources for the sources'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMapWithSourcesContent); - var sources = map.sources; - - assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.throws(function () { - map.sourceContentFor(""); - }, Error); - assert.throws(function () { - map.sourceContentFor("/the/root/three.js"); - }, Error); - assert.throws(function () { - map.sourceContentFor("three.js"); - }, Error); - }; - - exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'foo/bar', - file: 'baz.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bang.coffee' - }); - map.addMapping({ - original: { line: 5, column: 5 }, - generated: { line: 6, column: 6 }, - source: 'bang.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - // Should handle without sourceRoot. - var pos = map.generatedPositionFor({ - line: 1, - column: 1, - source: 'bang.coffee' - }); - - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - - // Should handle with sourceRoot. - var pos = map.generatedPositionFor({ - line: 1, - column: 1, - source: 'foo/bar/bang.coffee' - }); - - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - }; - - exports['test sourceRoot + originalPositionFor'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'foo/bar', - file: 'baz.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bang.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - var pos = map.originalPositionFor({ - line: 2, - column: 2, - }); - - // Should always have the prepended source root - assert.equal(pos.source, 'foo/bar/bang.coffee'); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - }; - - exports['test github issue #56'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'http://', - file: 'www.example.com/foo.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'www.example.com/original.js' - }); - map = new SourceMapConsumer(map.toString()); - - var sources = map.sources; - assert.equal(sources.length, 1); - assert.equal(sources[0], 'http://www.example.com/original.js'); - }; - - exports['test github issue #43'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'http://example.com', - file: 'foo.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'http://cdn.example.com/original.js' - }); - map = new SourceMapConsumer(map.toString()); - - var sources = map.sources; - assert.equal(sources.length, 1, - 'Should only be one source.'); - assert.equal(sources[0], 'http://cdn.example.com/original.js', - 'Should not be joined with the sourceRoot.'); - }; - - exports['test absolute path, but same host sources'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'http://example.com/foo/bar', - file: 'foo.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: '/original.js' - }); - map = new SourceMapConsumer(map.toString()); - - var sources = map.sources; - assert.equal(sources.length, 1, - 'Should only be one source.'); - assert.equal(sources[0], 'http://example.com/original.js', - 'Source should be relative the host of the source root.'); - }; - - exports['test github issue #64'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sourceRoot": "http://example.com/", - "sources": ["/a"], - "names": [], - "mappings": "AACA", - "sourcesContent": ["foo"] - }); - - assert.equal(map.sourceContentFor("a"), "foo"); - assert.equal(map.sourceContentFor("/a"), "foo"); - }; - - exports['test bug 885597'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sourceRoot": "file:///Users/AlGore/Invented/The/Internet/", - "sources": ["/a"], - "names": [], - "mappings": "AACA", - "sourcesContent": ["foo"] - }); - - var s = map.sources[0]; - assert.equal(map.sourceContentFor(s), "foo"); - }; - - exports['test github issue #72, duplicate sources'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sources": ["source1.js", "source1.js", "source3.js"], - "names": [], - "mappings": ";EAAC;;IAEE;;MEEE", - "sourceRoot": "http://example.com" - }); - - var pos = map.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(pos.source, 'http://example.com/source1.js'); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - - var pos = map.originalPositionFor({ - line: 4, - column: 4 - }); - assert.equal(pos.source, 'http://example.com/source1.js'); - assert.equal(pos.line, 3); - assert.equal(pos.column, 3); - - var pos = map.originalPositionFor({ - line: 6, - column: 6 - }); - assert.equal(pos.source, 'http://example.com/source3.js'); - assert.equal(pos.line, 5); - assert.equal(pos.column, 5); - }; - - exports['test github issue #72, duplicate names'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sources": ["source.js"], - "names": ["name1", "name1", "name3"], - "mappings": ";EAACA;;IAEEA;;MAEEE", - "sourceRoot": "http://example.com" - }); - - var pos = map.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(pos.name, 'name1'); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - - var pos = map.originalPositionFor({ - line: 4, - column: 4 - }); - assert.equal(pos.name, 'name1'); - assert.equal(pos.line, 3); - assert.equal(pos.column, 3); - - var pos = map.originalPositionFor({ - line: 6, - column: 6 - }); - assert.equal(pos.name, 'name3'); - assert.equal(pos.line, 5); - assert.equal(pos.column, 5); - }; - - exports['test SourceMapConsumer.fromSourceMap'] = function (assert, util) { - var smg = new SourceMapGenerator({ - sourceRoot: 'http://example.com/', - file: 'foo.js' - }); - smg.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bar.js' - }); - smg.addMapping({ - original: { line: 2, column: 2 }, - generated: { line: 4, column: 4 }, - source: 'baz.js', - name: 'dirtMcGirt' - }); - smg.setSourceContent('baz.js', 'baz.js content'); - - var smc = SourceMapConsumer.fromSourceMap(smg); - assert.equal(smc.file, 'foo.js'); - assert.equal(smc.sourceRoot, 'http://example.com/'); - assert.equal(smc.sources.length, 2); - assert.equal(smc.sources[0], 'http://example.com/bar.js'); - assert.equal(smc.sources[1], 'http://example.com/baz.js'); - assert.equal(smc.sourceContentFor('baz.js'), 'baz.js content'); - - var pos = smc.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - assert.equal(pos.source, 'http://example.com/bar.js'); - assert.equal(pos.name, null); - - pos = smc.generatedPositionFor({ - line: 1, - column: 1, - source: 'http://example.com/bar.js' - }); - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - - pos = smc.originalPositionFor({ - line: 4, - column: 4 - }); - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - assert.equal(pos.source, 'http://example.com/baz.js'); - assert.equal(pos.name, 'dirtMcGirt'); - - pos = smc.generatedPositionFor({ - line: 2, - column: 2, - source: 'http://example.com/baz.js' - }); - assert.equal(pos.line, 4); - assert.equal(pos.column, 4); - }; -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-source-map-generator.js b/deploy/core/node_modules/source-map/test/source-map/test-source-map-generator.js deleted file mode 100644 index ba292f548..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-source-map-generator.js +++ /dev/null @@ -1,417 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceNode = require('../../lib/source-map/source-node').SourceNode; - var util = require('./util'); - - exports['test some simple stuff'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'foo.js', - sourceRoot: '.' - }); - assert.ok(true); - }; - - exports['test JSON serialization'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'foo.js', - sourceRoot: '.' - }); - assert.equal(map.toString(), JSON.stringify(map)); - }; - - exports['test adding mappings (case 1)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 } - }); - }); - }; - - exports['test adding mappings (case 2)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - source: 'bar.js', - original: { line: 1, column: 1 } - }); - }); - }; - - exports['test adding mappings (case 3)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - source: 'bar.js', - original: { line: 1, column: 1 }, - name: 'someToken' - }); - }); - }; - - exports['test adding mappings (invalid)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - // Not enough info. - assert.throws(function () { - map.addMapping({}); - }); - - // Original file position, but no source. - assert.throws(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 } - }); - }); - }; - - exports['test that the correct mappings are being generated'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'min.js', - sourceRoot: '/the/root' - }); - - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 5 }, - original: { line: 1, column: 5 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 9 }, - original: { line: 1, column: 11 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 18 }, - original: { line: 1, column: 21 }, - source: 'one.js', - name: 'bar' - }); - map.addMapping({ - generated: { line: 1, column: 21 }, - original: { line: 2, column: 3 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 28 }, - original: { line: 2, column: 10 }, - source: 'one.js', - name: 'baz' - }); - map.addMapping({ - generated: { line: 1, column: 32 }, - original: { line: 2, column: 14 }, - source: 'one.js', - name: 'bar' - }); - - map.addMapping({ - generated: { line: 2, column: 1 }, - original: { line: 1, column: 1 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 5 }, - original: { line: 1, column: 5 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 9 }, - original: { line: 1, column: 11 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 18 }, - original: { line: 1, column: 21 }, - source: 'two.js', - name: 'n' - }); - map.addMapping({ - generated: { line: 2, column: 21 }, - original: { line: 2, column: 3 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 28 }, - original: { line: 2, column: 10 }, - source: 'two.js', - name: 'n' - }); - - map = JSON.parse(map.toString()); - - util.assertEqualMaps(assert, map, util.testMap); - }; - - exports['test that source content can be set'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'min.js', - sourceRoot: '/the/root' - }); - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 2, column: 1 }, - original: { line: 1, column: 1 }, - source: 'two.js' - }); - map.setSourceContent('one.js', 'one file content'); - - map = JSON.parse(map.toString()); - assert.equal(map.sources[0], 'one.js'); - assert.equal(map.sources[1], 'two.js'); - assert.equal(map.sourcesContent[0], 'one file content'); - assert.equal(map.sourcesContent[1], null); - }; - - exports['test .fromSourceMap'] = function (assert, util) { - var map = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(util.testMap)); - util.assertEqualMaps(assert, map.toJSON(), util.testMap); - }; - - exports['test .fromSourceMap with sourcesContent'] = function (assert, util) { - var map = SourceMapGenerator.fromSourceMap( - new SourceMapConsumer(util.testMapWithSourcesContent)); - util.assertEqualMaps(assert, map.toJSON(), util.testMapWithSourcesContent); - }; - - exports['test applySourceMap'] = function (assert, util) { - var node = new SourceNode(null, null, null, [ - new SourceNode(2, 0, 'fileX', 'lineX2\n'), - 'genA1\n', - new SourceNode(2, 0, 'fileY', 'lineY2\n'), - 'genA2\n', - new SourceNode(1, 0, 'fileX', 'lineX1\n'), - 'genA3\n', - new SourceNode(1, 0, 'fileY', 'lineY1\n') - ]); - var mapStep1 = node.toStringWithSourceMap({ - file: 'fileA' - }).map; - mapStep1.setSourceContent('fileX', 'lineX1\nlineX2\n'); - mapStep1 = mapStep1.toJSON(); - - node = new SourceNode(null, null, null, [ - 'gen1\n', - new SourceNode(1, 0, 'fileA', 'lineA1\n'), - new SourceNode(2, 0, 'fileA', 'lineA2\n'), - new SourceNode(3, 0, 'fileA', 'lineA3\n'), - new SourceNode(4, 0, 'fileA', 'lineA4\n'), - new SourceNode(1, 0, 'fileB', 'lineB1\n'), - new SourceNode(2, 0, 'fileB', 'lineB2\n'), - 'gen2\n' - ]); - var mapStep2 = node.toStringWithSourceMap({ - file: 'fileGen' - }).map; - mapStep2.setSourceContent('fileB', 'lineB1\nlineB2\n'); - mapStep2 = mapStep2.toJSON(); - - node = new SourceNode(null, null, null, [ - 'gen1\n', - new SourceNode(2, 0, 'fileX', 'lineA1\n'), - new SourceNode(2, 0, 'fileA', 'lineA2\n'), - new SourceNode(2, 0, 'fileY', 'lineA3\n'), - new SourceNode(4, 0, 'fileA', 'lineA4\n'), - new SourceNode(1, 0, 'fileB', 'lineB1\n'), - new SourceNode(2, 0, 'fileB', 'lineB2\n'), - 'gen2\n' - ]); - var expectedMap = node.toStringWithSourceMap({ - file: 'fileGen' - }).map; - expectedMap.setSourceContent('fileX', 'lineX1\nlineX2\n'); - expectedMap.setSourceContent('fileB', 'lineB1\nlineB2\n'); - expectedMap = expectedMap.toJSON(); - - // apply source map "mapStep1" to "mapStep2" - var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(mapStep2)); - generator.applySourceMap(new SourceMapConsumer(mapStep1)); - var actualMap = generator.toJSON(); - - util.assertEqualMaps(assert, actualMap, expectedMap); - }; - - exports['test sorting with duplicate generated mappings'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'test.js' - }); - map.addMapping({ - generated: { line: 3, column: 0 }, - original: { line: 2, column: 0 }, - source: 'a.js' - }); - map.addMapping({ - generated: { line: 2, column: 0 } - }); - map.addMapping({ - generated: { line: 2, column: 0 } - }); - map.addMapping({ - generated: { line: 1, column: 0 }, - original: { line: 1, column: 0 }, - source: 'a.js' - }); - - util.assertEqualMaps(assert, map.toJSON(), { - version: 3, - file: 'test.js', - sources: ['a.js'], - names: [], - mappings: 'AAAA;A;AACA' - }); - }; - - exports['test ignore duplicate mappings.'] = function (assert, util) { - var init = { file: 'min.js', sourceRoot: '/the/root' }; - var map1, map2; - - // null original source location - var nullMapping1 = { - generated: { line: 1, column: 0 } - }; - var nullMapping2 = { - generated: { line: 2, column: 2 } - }; - - map1 = new SourceMapGenerator(init); - map2 = new SourceMapGenerator(init); - - map1.addMapping(nullMapping1); - map1.addMapping(nullMapping1); - - map2.addMapping(nullMapping1); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - map1.addMapping(nullMapping2); - map1.addMapping(nullMapping1); - - map2.addMapping(nullMapping2); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - // original source location - var srcMapping1 = { - generated: { line: 1, column: 0 }, - original: { line: 11, column: 0 }, - source: 'srcMapping1.js' - }; - var srcMapping2 = { - generated: { line: 2, column: 2 }, - original: { line: 11, column: 0 }, - source: 'srcMapping2.js' - }; - - map1 = new SourceMapGenerator(init); - map2 = new SourceMapGenerator(init); - - map1.addMapping(srcMapping1); - map1.addMapping(srcMapping1); - - map2.addMapping(srcMapping1); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - map1.addMapping(srcMapping2); - map1.addMapping(srcMapping1); - - map2.addMapping(srcMapping2); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - // full original source and name information - var fullMapping1 = { - generated: { line: 1, column: 0 }, - original: { line: 11, column: 0 }, - source: 'fullMapping1.js', - name: 'fullMapping1' - }; - var fullMapping2 = { - generated: { line: 2, column: 2 }, - original: { line: 11, column: 0 }, - source: 'fullMapping2.js', - name: 'fullMapping2' - }; - - map1 = new SourceMapGenerator(init); - map2 = new SourceMapGenerator(init); - - map1.addMapping(fullMapping1); - map1.addMapping(fullMapping1); - - map2.addMapping(fullMapping1); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - map1.addMapping(fullMapping2); - map1.addMapping(fullMapping1); - - map2.addMapping(fullMapping2); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - }; - - exports['test github issue #72, check for duplicate names or sources'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'test.js' - }); - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 2, column: 2 }, - source: 'a.js', - name: 'foo' - }); - map.addMapping({ - generated: { line: 3, column: 3 }, - original: { line: 4, column: 4 }, - source: 'a.js', - name: 'foo' - }); - util.assertEqualMaps(assert, map.toJSON(), { - version: 3, - file: 'test.js', - sources: ['a.js'], - names: ['foo'], - mappings: 'CACEA;;GAEEA' - }); - }; - -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/test-source-node.js b/deploy/core/node_modules/source-map/test/source-map/test-source-node.js deleted file mode 100644 index 6e0eca82d..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/test-source-node.js +++ /dev/null @@ -1,365 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceNode = require('../../lib/source-map/source-node').SourceNode; - - exports['test .add()'] = function (assert, util) { - var node = new SourceNode(null, null, null); - - // Adding a string works. - node.add('function noop() {}'); - - // Adding another source node works. - node.add(new SourceNode(null, null, null)); - - // Adding an array works. - node.add(['function foo() {', - new SourceNode(null, null, null, - 'return 10;'), - '}']); - - // Adding other stuff doesn't. - assert.throws(function () { - node.add({}); - }); - assert.throws(function () { - node.add(function () {}); - }); - }; - - exports['test .prepend()'] = function (assert, util) { - var node = new SourceNode(null, null, null); - - // Prepending a string works. - node.prepend('function noop() {}'); - assert.equal(node.children[0], 'function noop() {}'); - assert.equal(node.children.length, 1); - - // Prepending another source node works. - node.prepend(new SourceNode(null, null, null)); - assert.equal(node.children[0], ''); - assert.equal(node.children[1], 'function noop() {}'); - assert.equal(node.children.length, 2); - - // Prepending an array works. - node.prepend(['function foo() {', - new SourceNode(null, null, null, - 'return 10;'), - '}']); - assert.equal(node.children[0], 'function foo() {'); - assert.equal(node.children[1], 'return 10;'); - assert.equal(node.children[2], '}'); - assert.equal(node.children[3], ''); - assert.equal(node.children[4], 'function noop() {}'); - assert.equal(node.children.length, 5); - - // Prepending other stuff doesn't. - assert.throws(function () { - node.prepend({}); - }); - assert.throws(function () { - node.prepend(function () {}); - }); - }; - - exports['test .toString()'] = function (assert, util) { - assert.equal((new SourceNode(null, null, null, - ['function foo() {', - new SourceNode(null, null, null, 'return 10;'), - '}'])).toString(), - 'function foo() {return 10;}'); - }; - - exports['test .join()'] = function (assert, util) { - assert.equal((new SourceNode(null, null, null, - ['a', 'b', 'c', 'd'])).join(', ').toString(), - 'a, b, c, d'); - }; - - exports['test .walk()'] = function (assert, util) { - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n', - ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n', - '}());']); - var expected = [ - { str: '(function () {\n', source: null, line: null, column: null }, - { str: ' ', source: null, line: null, column: null }, - { str: 'someCall()', source: 'a.js', line: 1, column: 0 }, - { str: ';\n', source: null, line: null, column: null }, - { str: ' ', source: null, line: null, column: null }, - { str: 'if (foo) bar()', source: 'b.js', line: 2, column: 0 }, - { str: ';\n', source: null, line: null, column: null }, - { str: '}());', source: null, line: null, column: null }, - ]; - var i = 0; - node.walk(function (chunk, loc) { - assert.equal(expected[i].str, chunk); - assert.equal(expected[i].source, loc.source); - assert.equal(expected[i].line, loc.line); - assert.equal(expected[i].column, loc.column); - i++; - }); - }; - - exports['test .replaceRight'] = function (assert, util) { - var node; - - // Not nested - node = new SourceNode(null, null, null, 'hello world'); - node.replaceRight(/world/, 'universe'); - assert.equal(node.toString(), 'hello universe'); - - // Nested - node = new SourceNode(null, null, null, - [new SourceNode(null, null, null, 'hey sexy mama, '), - new SourceNode(null, null, null, 'want to kill all humans?')]); - node.replaceRight(/kill all humans/, 'watch Futurama'); - assert.equal(node.toString(), 'hey sexy mama, want to watch Futurama?'); - }; - - exports['test .toStringWithSourceMap()'] = function (assert, util) { - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', - new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'), - new SourceNode(1, 8, 'a.js', '()'), - ';\n', - ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n', - '}());']); - var map = node.toStringWithSourceMap({ - file: 'foo.js' - }).map; - - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = new SourceMapConsumer(map.toString()); - - var actual; - - actual = map.originalPositionFor({ - line: 1, - column: 4 - }); - assert.equal(actual.source, null); - assert.equal(actual.line, null); - assert.equal(actual.column, null); - - actual = map.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(actual.source, 'a.js'); - assert.equal(actual.line, 1); - assert.equal(actual.column, 0); - assert.equal(actual.name, 'originalCall'); - - actual = map.originalPositionFor({ - line: 3, - column: 2 - }); - assert.equal(actual.source, 'b.js'); - assert.equal(actual.line, 2); - assert.equal(actual.column, 0); - - actual = map.originalPositionFor({ - line: 3, - column: 16 - }); - assert.equal(actual.source, null); - assert.equal(actual.line, null); - assert.equal(actual.column, null); - - actual = map.originalPositionFor({ - line: 4, - column: 2 - }); - assert.equal(actual.source, null); - assert.equal(actual.line, null); - assert.equal(actual.column, null); - }; - - exports['test .fromStringWithSourceMap()'] = function (assert, util) { - var node = SourceNode.fromStringWithSourceMap( - util.testGeneratedCode, - new SourceMapConsumer(util.testMap)); - - var result = node.toStringWithSourceMap({ - file: 'min.js' - }); - var map = result.map; - var code = result.code; - - assert.equal(code, util.testGeneratedCode); - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = map.toJSON(); - assert.equal(map.version, util.testMap.version); - assert.equal(map.file, util.testMap.file); - assert.equal(map.mappings, util.testMap.mappings); - }; - - exports['test .fromStringWithSourceMap() empty map'] = function (assert, util) { - var node = SourceNode.fromStringWithSourceMap( - util.testGeneratedCode, - new SourceMapConsumer(util.emptyMap)); - var result = node.toStringWithSourceMap({ - file: 'min.js' - }); - var map = result.map; - var code = result.code; - - assert.equal(code, util.testGeneratedCode); - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = map.toJSON(); - assert.equal(map.version, util.emptyMap.version); - assert.equal(map.file, util.emptyMap.file); - assert.equal(map.mappings.length, util.emptyMap.mappings.length); - assert.equal(map.mappings, util.emptyMap.mappings); - }; - - exports['test .fromStringWithSourceMap() complex version'] = function (assert, util) { - var input = new SourceNode(null, null, null, [ - "(function() {\n", - " var Test = {};\n", - " ", new SourceNode(1, 0, "a.js", "Test.A = { value: 1234 };\n"), - " ", new SourceNode(2, 0, "a.js", "Test.A.x = 'xyz';"), "\n", - "}());\n", - "/* Generated Source */"]); - input = input.toStringWithSourceMap({ - file: 'foo.js' - }); - - var node = SourceNode.fromStringWithSourceMap( - input.code, - new SourceMapConsumer(input.map.toString())); - - var result = node.toStringWithSourceMap({ - file: 'foo.js' - }); - var map = result.map; - var code = result.code; - - assert.equal(code, input.code); - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = map.toJSON(); - var inputMap = input.map.toJSON(); - util.assertEqualMaps(assert, map, inputMap); - }; - - exports['test .fromStringWithSourceMap() merging duplicate mappings'] = function (assert, util) { - var input = new SourceNode(null, null, null, [ - new SourceNode(1, 0, "a.js", "(function"), - new SourceNode(1, 0, "a.js", "() {\n"), - " ", - new SourceNode(1, 0, "a.js", "var Test = "), - new SourceNode(1, 0, "b.js", "{};\n"), - new SourceNode(2, 0, "b.js", "Test"), - new SourceNode(2, 0, "b.js", ".A", "A"), - new SourceNode(2, 20, "b.js", " = { value: 1234 };\n", "A"), - "}());\n", - "/* Generated Source */" - ]); - input = input.toStringWithSourceMap({ - file: 'foo.js' - }); - - var correctMap = new SourceMapGenerator({ - file: 'foo.js' - }); - correctMap.addMapping({ - generated: { line: 1, column: 0 }, - source: 'a.js', - original: { line: 1, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 2, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 2, column: 2 }, - source: 'a.js', - original: { line: 1, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 2, column: 13 }, - source: 'b.js', - original: { line: 1, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 3, column: 0 }, - source: 'b.js', - original: { line: 2, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 3, column: 4 }, - source: 'b.js', - name: 'A', - original: { line: 2, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 3, column: 6 }, - source: 'b.js', - name: 'A', - original: { line: 2, column: 20 } - }); - correctMap.addMapping({ - generated: { line: 4, column: 0 } - }); - - var inputMap = input.map.toJSON(); - correctMap = correctMap.toJSON(); - util.assertEqualMaps(assert, correctMap, inputMap); - }; - - exports['test setSourceContent with toStringWithSourceMap'] = function (assert, util) { - var aNode = new SourceNode(1, 1, 'a.js', 'a'); - aNode.setSourceContent('a.js', 'someContent'); - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', aNode, - ' ', new SourceNode(1, 1, 'b.js', 'b'), - '}());']); - node.setSourceContent('b.js', 'otherContent'); - var map = node.toStringWithSourceMap({ - file: 'foo.js' - }).map; - - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = new SourceMapConsumer(map.toString()); - - assert.equal(map.sources.length, 2); - assert.equal(map.sources[0], 'a.js'); - assert.equal(map.sources[1], 'b.js'); - assert.equal(map.sourcesContent.length, 2); - assert.equal(map.sourcesContent[0], 'someContent'); - assert.equal(map.sourcesContent[1], 'otherContent'); - }; - - exports['test walkSourceContents'] = function (assert, util) { - var aNode = new SourceNode(1, 1, 'a.js', 'a'); - aNode.setSourceContent('a.js', 'someContent'); - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', aNode, - ' ', new SourceNode(1, 1, 'b.js', 'b'), - '}());']); - node.setSourceContent('b.js', 'otherContent'); - var results = []; - node.walkSourceContents(function (sourceFile, sourceContent) { - results.push([sourceFile, sourceContent]); - }); - assert.equal(results.length, 2); - assert.equal(results[0][0], 'a.js'); - assert.equal(results[0][1], 'someContent'); - assert.equal(results[1][0], 'b.js'); - assert.equal(results[1][1], 'otherContent'); - }; -}); diff --git a/deploy/core/node_modules/source-map/test/source-map/util.js b/deploy/core/node_modules/source-map/test/source-map/util.js deleted file mode 100644 index 288046bfa..000000000 --- a/deploy/core/node_modules/source-map/test/source-map/util.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('../../lib/source-map/util'); - - // This is a test mapping which maps functions from two different files - // (one.js and two.js) to a minified generated source. - // - // Here is one.js: - // - // ONE.foo = function (bar) { - // return baz(bar); - // }; - // - // Here is two.js: - // - // TWO.inc = function (n) { - // return n + 1; - // }; - // - // And here is the generated code (min.js): - // - // ONE.foo=function(a){return baz(a);}; - // TWO.inc=function(a){return a+1;}; - exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+ - " TWO.inc=function(a){return a+1;};"; - exports.testMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: '/the/root', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; - exports.testMapWithSourcesContent = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourcesContent: [ - ' ONE.foo = function (bar) {\n' + - ' return baz(bar);\n' + - ' };', - ' TWO.inc = function (n) {\n' + - ' return n + 1;\n' + - ' };' - ], - sourceRoot: '/the/root', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; - exports.emptyMap = { - version: 3, - file: 'min.js', - names: [], - sources: [], - mappings: '' - }; - - - function assertMapping(generatedLine, generatedColumn, originalSource, - originalLine, originalColumn, name, map, assert, - dontTestGenerated, dontTestOriginal) { - if (!dontTestOriginal) { - var origMapping = map.originalPositionFor({ - line: generatedLine, - column: generatedColumn - }); - assert.equal(origMapping.name, name, - 'Incorrect name, expected ' + JSON.stringify(name) - + ', got ' + JSON.stringify(origMapping.name)); - assert.equal(origMapping.line, originalLine, - 'Incorrect line, expected ' + JSON.stringify(originalLine) - + ', got ' + JSON.stringify(origMapping.line)); - assert.equal(origMapping.column, originalColumn, - 'Incorrect column, expected ' + JSON.stringify(originalColumn) - + ', got ' + JSON.stringify(origMapping.column)); - - var expectedSource; - - if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) { - expectedSource = originalSource; - } else if (originalSource) { - expectedSource = map.sourceRoot - ? util.join(map.sourceRoot, originalSource) - : originalSource; - } else { - expectedSource = null; - } - - assert.equal(origMapping.source, expectedSource, - 'Incorrect source, expected ' + JSON.stringify(expectedSource) - + ', got ' + JSON.stringify(origMapping.source)); - } - - if (!dontTestGenerated) { - var genMapping = map.generatedPositionFor({ - source: originalSource, - line: originalLine, - column: originalColumn - }); - assert.equal(genMapping.line, generatedLine, - 'Incorrect line, expected ' + JSON.stringify(generatedLine) - + ', got ' + JSON.stringify(genMapping.line)); - assert.equal(genMapping.column, generatedColumn, - 'Incorrect column, expected ' + JSON.stringify(generatedColumn) - + ', got ' + JSON.stringify(genMapping.column)); - } - } - exports.assertMapping = assertMapping; - - function assertEqualMaps(assert, actualMap, expectedMap) { - assert.equal(actualMap.version, expectedMap.version, "version mismatch"); - assert.equal(actualMap.file, expectedMap.file, "file mismatch"); - assert.equal(actualMap.names.length, - expectedMap.names.length, - "names length mismatch: " + - actualMap.names.join(", ") + " != " + expectedMap.names.join(", ")); - for (var i = 0; i < actualMap.names.length; i++) { - assert.equal(actualMap.names[i], - expectedMap.names[i], - "names[" + i + "] mismatch: " + - actualMap.names.join(", ") + " != " + expectedMap.names.join(", ")); - } - assert.equal(actualMap.sources.length, - expectedMap.sources.length, - "sources length mismatch: " + - actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", ")); - for (var i = 0; i < actualMap.sources.length; i++) { - assert.equal(actualMap.sources[i], - expectedMap.sources[i], - "sources[" + i + "] length mismatch: " + - actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", ")); - } - assert.equal(actualMap.sourceRoot, - expectedMap.sourceRoot, - "sourceRoot mismatch: " + - actualMap.sourceRoot + " != " + expectedMap.sourceRoot); - assert.equal(actualMap.mappings, expectedMap.mappings, - "mappings mismatch:\nActual: " + actualMap.mappings + "\nExpected: " + expectedMap.mappings); - if (actualMap.sourcesContent) { - assert.equal(actualMap.sourcesContent.length, - expectedMap.sourcesContent.length, - "sourcesContent length mismatch"); - for (var i = 0; i < actualMap.sourcesContent.length; i++) { - assert.equal(actualMap.sourcesContent[i], - expectedMap.sourcesContent[i], - "sourcesContent[" + i + "] mismatch"); - } - } - } - exports.assertEqualMaps = assertEqualMaps; - -}); diff --git a/deploy/core/node_modules/walkdir/.jshintignore b/deploy/core/node_modules/walkdir/.jshintignore deleted file mode 100644 index aa916f8ab..000000000 --- a/deploy/core/node_modules/walkdir/.jshintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -test/dir -test/comparison diff --git a/deploy/core/node_modules/walkdir/.npmignore b/deploy/core/node_modules/walkdir/.npmignore deleted file mode 100644 index 042ccf271..000000000 --- a/deploy/core/node_modules/walkdir/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -*~ diff --git a/deploy/core/node_modules/walkdir/.travis.yml b/deploy/core/node_modules/walkdir/.travis.yml deleted file mode 100644 index 2d26206d5..000000000 --- a/deploy/core/node_modules/walkdir/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/deploy/core/node_modules/walkdir/license b/deploy/core/node_modules/walkdir/license deleted file mode 100644 index 4e2b3b933..000000000 --- a/deploy/core/node_modules/walkdir/license +++ /dev/null @@ -1,10 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Ryan Day - -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 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. - diff --git a/deploy/core/node_modules/walkdir/package.json b/deploy/core/node_modules/walkdir/package.json deleted file mode 100644 index c644e7d9e..000000000 --- a/deploy/core/node_modules/walkdir/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "walkdir", - "description": "Find files simply. Walks a directory tree emitting events based on what it finds. Presents a familliar callback/emitter/a+sync interface. Walk a tree of any depth.", - "version": "0.0.5", - "author": { - "name": "Ryan Day", - "email": "soldair@gmail.com" - }, - "keywords": [ - "find", - "walk", - "tree", - "files", - "fs" - ], - "main": "./walkdir.js", - "homepage": "http://github.com/soldair/node-walkdir", - "repository": { - "type": "git", - "url": "git://github.com/soldair/node-walkdir.git" - }, - "scripts": { - "test": "./test.sh" - }, - "devDependencies": { - "tap": "*", - "jshint": "0.5.x" - }, - "engines": { - "node": ">=0.6.0" - }, - "license": "MIT/X11", - "contributors": [ - { - "name": "tjfontaine" - } - ], - "_id": "walkdir@0.0.5", - "dependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.8.3", - "_defaultsLoaded": true, - "dist": { - "shasum": "8dc177b33f8dd198aeda66c553cb1843919ba892" - }, - "_from": "walkdir" -} diff --git a/deploy/core/node_modules/walkdir/readme.md b/deploy/core/node_modules/walkdir/readme.md deleted file mode 100644 index cb3bc201d..000000000 --- a/deploy/core/node_modules/walkdir/readme.md +++ /dev/null @@ -1,160 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/soldair/node-walkdir.png)](http://travis-ci.org/soldair/node-walkdir) - -## walkdir - -Find files. Walks a directory tree emitting events based on what it finds. Presents a familliar callback/emitter/sync interface. Walk a tree of any depth. This is a performant option any pull requests to make it more so will be talken into consderation.. - -## Example - -```js - -var walk = require('walkdir'); - -//async with path callback - -walk('../',function(path,stat){ - console.log('found: ',path); -}); - -//use async emitter to capture more events - -var emitter = walk('../'); - -emitter.on('file',function(filename,stat){ - console.log('file from emitter: ', filename); -}); - - -//sync with callback - -walk.sync('../',function(path,stat){ - console.log('found sync:',path); -}); - -//sync just need paths - -var paths = walk.sync('../'); -console.log('found paths sync: ',paths); - -``` - - -## install - - npm install walkdir - -## arguments - -walkdir(path, [options], [callback]) -walkdir.sync(path, [options], [callback]); - -- path - - the starting point of your directory walk - -- options. supported options are - - general - - ```js - { - "follow_symlinks":false, // default is off - "no_recurse":false, // only recurse one level deep - "max_depth":undefined // only recurse down to max_depth. if you need more than no_recurse - } - ``` - - - sync only - - ```js - { - "return_object":false, // if true the sync return will be in {path:stat} format instead of [path,path,...] - "no_return":false, // if true null will be returned and no array or object will be created with found paths. useful for large listings - } - ``` - -- callback - - this is bound to the path event of the emitter. its optional in all cases. - - ```js - callback(path,stat) - ``` - -## events - -non error type events are emitted with (path,stat). stat is an instanceof fs.Stats - -###path -fired for everything - -###file -fired only for regular files - -###directory -fired only for directories - -###link -fired when a symbolic link is found - -###end -fired when the entire tree has been read and emitted. - -###socket -fired when a socket descriptor is found - -###fifo -fired when a fifo is found - -###characterdevice -fired when a character device is found - -###blockdevice -fired when a block device is found - -###targetdirectory -fired for the stat of the path you provided as the first argument. is is only fired if it is a directory. - -###empty -fired for empty directory - -## error events -error type events are emitted with (path,error). error being the error object returned from an fs call or other opperation. - -###error -if the target path cannot be read an error event is emitted. this is the only failure case. - -###fail -when stat or read fails on a path somewhere in the walk and it is not your target path you get a fail event instead of error. -This is handy if you want to find places you dont have access too. - -## notes -the async emitter returned supports 3 methods - -###end - stop a walk in progress - -###pause - pause the walk. no more events will be emitted until resume - -###resume - resume the walk - -### cancel a walk in progress - ```js - //cancel a walk in progress within callback. - - var walk = require('walkdir'); - walk('../',function(path,stat){ - this.end(); - }); - - //cancel a walk in progress with emitter handle - var walk = require('walkdir'); - var emitter = walk('../'); - - doSomethingAsync(function(){ - emitter.end(); - }) - ``` - -## thanks -thanks to substack. the interface for this module is based off of node-findit - diff --git a/deploy/core/node_modules/walkdir/test.sh b/deploy/core/node_modules/walkdir/test.sh deleted file mode 100755 index 15d21849a..000000000 --- a/deploy/core/node_modules/walkdir/test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -./node_modules/jshint/bin/hint ./* -hint=$? -if [ $hint != 0 ]; then - echo "< script runner stopped jshint failed >"; - exit $hint -else - echo "< jshint passed >"; -fi - -./node_modules/tap/bin/tap.js ./test/*.js -unit=$? -if [ $unit != 0 ]; then - echo "< script runner stopped unit tests failed >"; - exit $unit -else - echo "< unit tests passed >"; -fi - diff --git a/deploy/core/node_modules/walkdir/test/async.js b/deploy/core/node_modules/walkdir/test/async.js deleted file mode 100644 index 74c753397..000000000 --- a/deploy/core/node_modules/walkdir/test/async.js +++ /dev/null @@ -1,62 +0,0 @@ -var test = require('tap').test, -walkdir = require('../walkdir.js'); - -var expectedPaths = { -'dir/foo/x':'file', -'dir/foo/a':'dir', -'dir/foo/a/y':'file', -'dir/foo/a/b':'dir', -'dir/foo/a/b/z':'file', -'dir/foo/a/b/c':'dir', -'dir/foo/a/b/c/w':'file' -}; - -test('async events',function(t){ - var paths = [], - files = [], - dirs = []; - - - var emitter = walkdir(__dirname+'/dir/foo',function(path){ - //console.log('path: ',path); - paths.push(path.replace(__dirname+'/','')); - }); - - emitter.on('directory',function(path,stat){ - dirs.push(path.replace(__dirname+'/','')); - }); - - emitter.on('file',function(path,stat){ - //console.log('file: ',path); - files.push(path.replace(__dirname+'/','')); - }); - - emitter.on('end',function(){ - - files.forEach(function(v,k){ - t.equals(expectedPaths[v],'file','path from file event should be file'); - }); - - Object.keys(expectedPaths).forEach(function(v,k){ - if(expectedPaths[v] == 'file') { - t.ok(files.indexOf(v) > -1,'should have file in files array'); - } - }); - - dirs.forEach(function(v,k){ - t.equals(expectedPaths[v],'dir','path from dir event should be dir '+v); - }); - - Object.keys(expectedPaths).forEach(function(v,k){ - if(expectedPaths[v] == 'dir') { - t.ok(dirs.indexOf(v) > -1,'should have dir in dirs array'); - } - }); - - Object.keys(expectedPaths).forEach(function(v,k){ - t.ok(paths.indexOf(v) !== -1,'should have found all expected paths '+v); - }); - - t.end(); - }); -}); diff --git a/deploy/core/node_modules/walkdir/test/comparison/find.js b/deploy/core/node_modules/walkdir/test/comparison/find.js deleted file mode 100644 index 98e852d13..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/find.js +++ /dev/null @@ -1,33 +0,0 @@ -var spawn = require('child_process').spawn; - -var find = spawn('find',[process.argv[2]||'./']); - -var fs = require('fs'); - -var buf = '',count = 0; - -handleBuf = function(data){ - - buf += data; - - if(buf.length >= 1024) { - var lines = buf.split("\n"); - buf = lines.pop();//last line my not be complete - count += lines.length; - process.stdout.write(lines.join("\n")+"\n"); - } -}; - -find.stdout.on('data',function(data){ - //buf += data.toString(); - handleBuf(data) - //process.stdout.write(data.toString()); -}); - -find.on('end',function(){ - handleBuf("\n"); - console.log('found '+count+' files'); - console.log('ended'); -}); - -find.stdin.end(); diff --git a/deploy/core/node_modules/walkdir/test/comparison/find.py b/deploy/core/node_modules/walkdir/test/comparison/find.py deleted file mode 100644 index 526d6941f..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/find.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -import sys - -rootdir = sys.argv[1] -ino = {} -buf = [] -for root, subFolders, files in os.walk(rootdir): - - for filename in files: - filePath = os.path.join(root, filename) - try: - stat = os.lstat(filePath) - except OSError: - pass - - inostr = stat.st_ino - - if inostr not in ino: - ino[stat.st_ino] = 1 - buf.append(filePath); - buf.append("\n"); - if len(buf) >= 1024: - sys.stdout.write(''.join(buf)) - buf = [] - -sys.stdout.write(''.join(buf)); diff --git a/deploy/core/node_modules/walkdir/test/comparison/finditsynctest.js b/deploy/core/node_modules/walkdir/test/comparison/finditsynctest.js deleted file mode 100644 index b3af43e92..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/finditsynctest.js +++ /dev/null @@ -1,15 +0,0 @@ -var findit = require('findit'); - -var files = findit.findSync(process.argv[2]||'./'); - -var count = files.length; - -console.log(files); - -files = files.join("\n"); - -process.stdout.write(files+"\n"); - -console.log('found '+count+' files'); - - diff --git a/deploy/core/node_modules/walkdir/test/comparison/findittest.js b/deploy/core/node_modules/walkdir/test/comparison/findittest.js deleted file mode 100644 index d018bf27b..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/findittest.js +++ /dev/null @@ -1,14 +0,0 @@ -var findit = require('findit'); - -var find = findit.find(process.argv[2]||'./'); - -var count = 0; - -find.on('file',function(path,stat){ - count++; - process.stdout.write(path+"\n"); -}); - -find.on('end',function(){ - console.log('found '+count+' regular files'); -}); diff --git a/deploy/core/node_modules/walkdir/test/comparison/fstream.js b/deploy/core/node_modules/walkdir/test/comparison/fstream.js deleted file mode 100644 index 1451b4caf..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/fstream.js +++ /dev/null @@ -1,24 +0,0 @@ -var fstream = require('fstream'); - -var pipe = fstream.Reader(process.argv[2]||"../"); - -var count = 0,errorHandler; - -pipe.on('entry',function fn(entry){ - if(entry.type == "Directory"){ - entry.on('entry',fn); - } else if(entry.type == "File") { - count++; - } - entry.on('error',errorHandler); -}); - -pipe.on('error',(errorHandler = function(error){ - console.log('error event ',error); -})); - -pipe.on('end',function(){ - console.log('end! '+count); -}); - -//this is pretty slow diff --git a/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh b/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh deleted file mode 100755 index 0861c853a..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/install_test_deps.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -npm install diff --git a/deploy/core/node_modules/walkdir/test/comparison/lsr.js b/deploy/core/node_modules/walkdir/test/comparison/lsr.js deleted file mode 100644 index 590f9d1be..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/lsr.js +++ /dev/null @@ -1,18 +0,0 @@ -var lsr = require('ls-r'); - -lsr(process.argv[2]||'./',{maxDepth:500000,recursive:true},function(err,origPath,args){ - if(err) { - console.log('eww an error! ',err); - return; - } -//console.log('hit'); - var c = 0; - args.forEach(function(stat){ - if(stat.isFile()){ - console.log(stat.path); - c++; - } - }); - - console.log('found '+args.length+" regular files"); -}); diff --git a/deploy/core/node_modules/walkdir/test/comparison/package.json b/deploy/core/node_modules/walkdir/test/comparison/package.json deleted file mode 100644 index 1faeff31e..000000000 --- a/deploy/core/node_modules/walkdir/test/comparison/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name":"recursedir-comparisons", - "version": "0.0.0", - "author": "Ryan Day ", - "devDependencies": { - "findit": "*", - "ls-r":"*", - "fstream":"*" - } -} diff --git a/deploy/core/node_modules/walkdir/test/dir/foo/a/b/c/w b/deploy/core/node_modules/walkdir/test/dir/foo/a/b/c/w deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/dir/foo/a/b/z b/deploy/core/node_modules/walkdir/test/dir/foo/a/b/z deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/dir/foo/a/y b/deploy/core/node_modules/walkdir/test/dir/foo/a/y deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/dir/foo/x b/deploy/core/node_modules/walkdir/test/dir/foo/x deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/dir/symlinks/dir1/file1 b/deploy/core/node_modules/walkdir/test/dir/symlinks/dir1/file1 deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/dir/symlinks/dir2/file2 b/deploy/core/node_modules/walkdir/test/dir/symlinks/dir2/file2 deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/dir/symlinks/file b/deploy/core/node_modules/walkdir/test/dir/symlinks/file deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/walkdir/test/endearly.js b/deploy/core/node_modules/walkdir/test/endearly.js deleted file mode 100644 index e1346fab3..000000000 --- a/deploy/core/node_modules/walkdir/test/endearly.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tap').test, -walk = require('../walkdir.js'); - -test('should be able to end walk after first path',function(t){ - - var paths = []; - - var em = walk('../',function(path){ - paths.push(path); - this.end(); - }); - - em.on('end',function(){ - t.equals(paths.length,1,'should have only found one path'); - t.end(); - }); - -}); - diff --git a/deploy/core/node_modules/walkdir/test/max_depth.js b/deploy/core/node_modules/walkdir/test/max_depth.js deleted file mode 100644 index ecc9a4941..000000000 --- a/deploy/core/node_modules/walkdir/test/max_depth.js +++ /dev/null @@ -1,27 +0,0 @@ -var test = require('tap').test, -walkdir = require('../walkdir.js'); - -var expectedPaths = { -'dir/foo/x':'file', -'dir/foo/a':'dir', -'dir/foo/a/y':'file', -'dir/foo/a/b':'dir' -}; - -test('no_recurse option',function(t){ - var paths = []; - - var emitter = walkdir(__dirname+'/dir/foo',{max_depth:2},function(path,stat,depth){ - paths.push(path.replace(__dirname+'/','')); - t.ok(depth < 3,' all paths emitted should have a depth less than 3'); - }); - - emitter.on('end',function(){ - var expected = Object.keys(expectedPaths); - paths.forEach(function(v){ - t.ok(expected.indexOf(v) > -1,'paths should not have any unexpected files'); - }); - - t.end(); - }); -}); diff --git a/deploy/core/node_modules/walkdir/test/no_recurse.js b/deploy/core/node_modules/walkdir/test/no_recurse.js deleted file mode 100644 index df2e4ed31..000000000 --- a/deploy/core/node_modules/walkdir/test/no_recurse.js +++ /dev/null @@ -1,25 +0,0 @@ -var test = require('tap').test, -walkdir = require('../walkdir.js'); - -var expectedPaths = { -'dir/foo/x':'file', -'dir/foo/a':'dir' -}; - -test('no_recurse option',function(t){ - var paths = []; - - var emitter = walkdir(__dirname+'/dir/foo',{no_recurse:true},function(path,stat,depth){ - paths.push(path.replace(__dirname+'/','')); - t.ok(depth === 1,' all paths emitted should have a depth of 1'); - }); - - emitter.on('end',function(){ - var expected = Object.keys(expectedPaths); - paths.forEach(function(v){ - t.ok(expected.indexOf(v) > -1,'all expected files should be in paths'); - }); - - t.end(); - }); -}); diff --git a/deploy/core/node_modules/walkdir/test/nofailemptydir.js b/deploy/core/node_modules/walkdir/test/nofailemptydir.js deleted file mode 100644 index 13ba6e4e4..000000000 --- a/deploy/core/node_modules/walkdir/test/nofailemptydir.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tap').test, -fs = require('fs'), -path = require('path'), -walk = require('../walkdir.js'); - -test('should not emit fail events for empty dirs',function(t){ - fs.mkdir('./empty',function(err,data){ - if(err) { - t.equals(err.code,'EEXIST','if error code on mkdir for fixture it should only be because it exists already'); - } - - var paths = []; - var dirs = []; - var emptys = []; - var fails = []; - - var em = walk('./'); - - em.on('fail',function(path,err){ - fails.push(path); - }); - - em.on('empty',function(path,err){ - emptys.push(path); - }); - - em.on('end',function(){ - t.equals(fails.length,0,'should not have any fails'); - t.equals(path.basename(emptys[0]),'empty','should find empty dir'); - t.end(); - }); - }); -}); - diff --git a/deploy/core/node_modules/walkdir/test/pauseresume.js b/deploy/core/node_modules/walkdir/test/pauseresume.js deleted file mode 100644 index e8d5fb12a..000000000 --- a/deploy/core/node_modules/walkdir/test/pauseresume.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tap').test, -walk = require('../walkdir.js'); - -test('should be able to pause walk',function(t){ - - var paths = []; - var paused = false; - var em = walk('./',function(path){ - if(!paused){ - em.pause(); - paused = 1; - setTimeout(function(){ - t.equals(paths.length,1,'while paused should not emit any more paths'); - em.resume(); - },300); - } else if(paused == 1){ - em.pause(); - paused = 2; - setTimeout(function(){ - t.equals(paths.length,2,'while paused should not emit any more paths'); - em.resume(); - },300); - } - - paths.push(path); - - }); - - em.on('end',function(){ - console.log('end, and i found ',paths.length,'paths'); - t.ok(paths.length > 1,'should have more paths before end'); - t.end(); - }); - -}); - diff --git a/deploy/core/node_modules/walkdir/test/symlink.js b/deploy/core/node_modules/walkdir/test/symlink.js deleted file mode 100644 index 2ccde9a42..000000000 --- a/deploy/core/node_modules/walkdir/test/symlink.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tap').test, -walkdir = require('../walkdir.js'); - - -test('follow symlinks',function(t){ - - var links = [],paths = [],failures = [],errors = []; - - var emitter = walkdir(__dirname+'/dir/symlinks/dir2',{follow_symlinks:true}); - - emitter.on('path',function(path,stat){ - paths.push(path); - }); - - emitter.on('link',function(path,stat){ - links.push(path); - }); - - emitter.on('error',function(path,err){ - console.log('error!!', arguments); - errors.push(arguments); - }); - - emitter.on('fail',function(path,err){ - failures.push(path); - }); - - emitter.on('end',function(){ - - t.equal(errors.length,0,'should have no errors'); - t.equal(failures.length,1,'should have a failure'); - t.ok(paths.indexOf(__dirname+'/dir/symlinks/dir1/file1') !== -1,'if follow symlinks works i would have found dir1 file1'); - t.equal(require('path').basename(failures[0]),'does-not-exist','should have fail resolviong does-not-exist which dangling-symlink points to'); - t.end(); - - }); -}); diff --git a/deploy/core/node_modules/walkdir/test/sync.js b/deploy/core/node_modules/walkdir/test/sync.js deleted file mode 100644 index 1243ab58b..000000000 --- a/deploy/core/node_modules/walkdir/test/sync.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tap').test, -walkdir = require('../walkdir.js'); - -var expectedPaths = { -'dir/foo/x':'file', -'dir/foo/a':'dir', -'dir/foo/a/y':'file', -'dir/foo/a/b':'dir', -'dir/foo/a/b/z':'file', -'dir/foo/a/b/c':'dir', -'dir/foo/a/b/c/w':'file' -}; - -test('sync',function(t){ - var paths = [], - files = [], - dirs = []; - - var pathResult = walkdir.sync(__dirname+'/dir/foo',function(path){ - //console.log('path: ',path); - paths.push(path); - }); - - t.ok(pathResult instanceof Array,'if return object is not specified should be an array'); - - t.equals(Object.keys(expectedPaths).length,paths.length,'should have found the same number of paths as expected'); - - Object.keys(expectedPaths).forEach(function(v,k){ - t.ok(paths.indexOf(__dirname+'/'+v) > -1,v+' should be found'); - }); - - t.equivalent(paths,pathResult,'paths should be equal to pathResult'); - - t.end(); -}); - -test('sync return object',function(t){ - - var pathResult = walkdir.sync(__dirname+'/dir/foo',{return_object:true}); - - t.ok(!(pathResult instanceof Array),'if return object is not specified should be an array'); - - t.equals(Object.keys(expectedPaths).length,Object.keys(pathResult).length,'should find the same number of paths as expected'); - - Object.keys(expectedPaths).forEach(function(v,k){ - t.ok(pathResult[__dirname+'/'+v],'should find path in result object'); - }); - - t.end(); -}); diff --git a/deploy/core/node_modules/walkdir/walkdir.js b/deploy/core/node_modules/walkdir/walkdir.js deleted file mode 100644 index c8400faa1..000000000 --- a/deploy/core/node_modules/walkdir/walkdir.js +++ /dev/null @@ -1,232 +0,0 @@ -var EventEmitter = require('events').EventEmitter, -fs = require('fs'), -_path = require('path'); - -module.exports = walkdir; - -walkdir.find = walkdir.walk = walkdir; - -walkdir.sync = function(file,options){ - options = options || {}; - options.sync = true; - return walkdir(file,options); - -}; - -function walkdir(path,options,cb){ - - if(typeof options == 'function') cb = options; - - options = options || {}; - - var emitter = new EventEmitter(), - allPaths = (options.return_object?{}:[]), - resolved = false, - inos = {}, - stop = 0, - pause = null, - ended = 0, - jobs=0, - job = function(value) { - jobs += value; - if(value < 1 && !tick) { - tick = 1; - process.nextTick(function(){ - tick = 0; - if(jobs <= 0 && !ended) { - ended = 1; - emitter.emit('end'); - } - }); - } - }, tick = 0; - - //mapping is stat functions to event names. - var statIs = [['isFile','file'],['isDirectory','directory'],['isSymbolicLink','link'],['isSocket','socket'],['isFIFO','fifo'],['isBlockDevice','blockdevice'],['isCharacterDevice','characterdevice']]; - - var statter = function (path,first,depth) { - job(1); - var statAction = function fn(err,stat,data) { - - job(-1); - if(stop) return; - - // in sync mode i found that node will sometimes return a null stat and no error =( - // this is reproduceable in file descriptors that no longer exist from this process - // after a readdir on /proc/3321/task/3321/ for example. Where 3321 is this pid - // node @ v0.6.10 - if(err || !stat) { - emitter.emit('fail',path,err); - return; - } - - - //if i have evented this inode already dont again. - if(inos[stat.dev+'-'+stat.ino] && stat.ino) return; - inos[stat.dev+'-'+stat.ino] = 1; - - if (first && stat.isDirectory()) { - emitter.emit('targetdirectory',path,stat,depth); - return; - } - - emitter.emit('path', path, stat,depth); - - var i,name; - - for(var j=0,k=statIs.length;j= options.max_depth){ - emitter.emit('maxdepth',path,stat,depth); - return; - } - - job(1); - var readdirAction = function(err,files) { - job(-1); - if (err || !files) { - //permissions error or invalid files - emitter.emit('fail',path,err); - return; - } - - if(!files.length) { - // empty directory event. - emitter.emit('empty',path,stat,depth); - return; - } - - if(path == '/') path=''; - for(var i=0,j=files.length;i (http://balupton.com) -# and is currently licensed under the Creative Commons Zero (http://creativecommons.org/publicdomain/zero/1.0/) -# making it public domain so you can do whatever you wish with it without worry (you can even remove this notice!) -# -# If you change something here, be sure to reflect the changes in: -# - the scripts section of the package.json file -# - the .travis.yml file - - -# ----------------- -# Variables - -WINDOWS = process.platform.indexOf('win') is 0 -NODE = process.execPath -NPM = if WINDOWS then process.execPath.replace('node.exe','npm.cmd') else 'npm' -EXT = (if WINDOWS then '.cmd' else '') -APP = process.cwd() -BIN = "#{APP}/node_modules/.bin" -CAKE = "#{BIN}/cake#{EXT}" -COFFEE = "#{BIN}/coffee#{EXT}" -OUT = "#{APP}/out" -SRC = "#{APP}/src" - - -# ----------------- -# Requires - -pathUtil = require('path') -{exec,spawn} = require('child_process') -safe = (next,fn) -> - return (err) -> - return next(err) if err - return fn() - - -# ----------------- -# Actions - -clean = (opts,next) -> - (next = opts; opts = {}) unless next? - args = [ - '-Rf' - OUT - pathUtil.join(APP,'node_modules') - pathUtil.join(APP,'*out') - pathUtil.join(APP,'*log') - ] - spawn('rm', args, {stdio:'inherit',cwd:APP}).on('exit',next) - -compile = (opts,next) -> - (next = opts; opts = {}) unless next? - spawn(COFFEE, ['-bco', OUT, SRC], {stdio:'inherit',cwd:APP}).on('exit',next) - -example = (opts,next) -> - (next = opts; opts = {}) unless next? - compile opts, safe next, -> - command = pathUtil.resolve("#{__dirname}/bin/watchr") - spawn(command, [], {stdio:'inherit',cwd:APP,env:process.env}).on('exit',next) - -watch = (opts,next) -> - (next = opts; opts = {}) unless next? - spawn(COFFEE, ['-bwco', OUT, SRC], {stdio:'inherit',cwd:APP}).on('exit',next) - -install = (opts,next) -> - (next = opts; opts = {}) unless next? - spawn(NPM, ['install'], {stdio:'inherit',cwd:APP}).on('exit',next) - -reset = (opts,next) -> - (next = opts; opts = {}) unless next? - clean opts, safe next, -> - install opts, safe next, -> - compile opts, next - -setup = (opts,next) -> - (next = opts; opts = {}) unless next? - install opts, safe next, -> - compile opts, next - -test = (opts,next) -> - (next = opts; opts = {}) unless next? - spawn(NPM, ['test'], {stdio:'inherit',cwd:APP}).on('exit',next) - -finish = (err) -> - throw err if err - console.log('OK') - - -# ----------------- -# Commands - -# clean -task 'clean', 'clean up instance', -> - clean finish - -# compile -task 'compile', 'compile our files', -> - compile finish - -# dev/watch -task 'dev', 'watch and recompile our files', -> - watch finish -task 'watch', 'watch and recompile our files', -> - watch finish - -# example -task 'example', 'run the example file', -> - example finish - -# install -task 'install', 'install dependencies', -> - install finish - -# reset -task 'reset', 'reset instance', -> - reset finish - -# setup -task 'setup', 'setup for development', -> - setup finish - -# test -task 'test', 'run our tests', -> - test finish - -# test-debug -task 'test-debug', 'run our tests in debug mode', -> - test {debug:true}, finish - -# test-prepare -task 'test-prepare', 'prepare out tests', -> - setup finish - diff --git a/deploy/core/node_modules/watchr/README.md b/deploy/core/node_modules/watchr/README.md deleted file mode 100644 index 7ca579339..000000000 --- a/deploy/core/node_modules/watchr/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# Watchr — better file system watching for Node.js - -[![Build Status](https://secure.travis-ci.org/bevry/watchr.png?branch=master)](http://travis-ci.org/bevry/watchr) -[![NPM version](https://badge.fury.io/js/watchr.png)](https://npmjs.org/package/watchr) -[![Flattr this project](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr) - -Watchr provides a normalised API the file watching APIs of different node versions, nested/recursive file and directory watching, and accurate detailed events for file/directory creations, updates, and deletions. - -You install it via `npm install watchr` and use it via `require('watchr').watch(config)`. Available configuration options are: - -- `path` a single path to watch -- `paths` an array of paths to watch -- `listener` a single change listener to fire when a change occurs -- `listeners` an array of listeners to fire when a change occurs, overloaded to accept the following values: - - `changeListener` a single change listener - - `[changeListener]` an array of change listeners - - `{eventName:eventListener}` an object keyed with the event names and valued with a single event listener - - `{eventName:[eventListener]}` an object keyed with the event names and valued with an array of event listeners -- `next` (optional, defaults to `null`) a completion callback to fire once the watchers have been setup, arguments are: - - when using the `path` configuration option: `err, watcherInstance` - - when using the `paths` configuration option: `err, [watcherInstance,...]` -- `stat` (optional, defaults to `null`) a file stat object to use for the path, instead of fetching a new one -- `interval` (optional, defaults to `5007`) for systems that poll to detect file changes, how often should it poll in millseconds -- `persistent` (optional, defaults to `true`) whether or not we should keep the node process alive for as long as files are still being watched -- `duplicateDelay` (optional, defaults to `1000`) sometimes events will fire really fast, this delay is set in place so we don't fire the same event within the timespan. Set to falsey to perform no duplicate detection. -- `preferredMethods` (optional, defaults to `['watch','watchFile']`) which order should we prefer our watching methods to be tried? -- `ignorePaths` (optional, defaults to `false`) an array of full paths to ignore -- `ignoreHiddenFiles` (optional, defaults to `false`) whether or not to ignored files which filename starts with a `.` -- `ignoreCommonPatterns` (optional, defaults to `true`) whether or not to ignore common undesirable file patterns (e.g. `.svn`, `.git`, `.DS_Store`, `thumbs.db`, etc) -- `ignoreCustomPatterns` (optional, defaults to `null`) any custom ignore patterns that you would also like to ignore along with the common patterns - -The following events are available to your via the listeners: - -- `log` for debugging, receives the arguments `logLevel ,args...` -- `error` for gracefully listening to error events, receives the arguments `err` -- `watching` for when watching of the path has completed, receives the arguments `err, isWatching` -- `change` for listening to change events, receives the arguments `changeType, fullPath, currentStat, previousStat`, received arguments will be: - - for updated files: `'update', fullPath, currentStat, previousStat` - - for created files: `'create', fullPath, currentStat, null` - - for deleted files: `'delete', fullPath, null, previousStat` - - -To wrap it all together, it would look like this: - -``` javascript -// Require -var watchr = require('watchr'); - -// Watch a directory or file -console.log('Watch our paths'); -watchr.watch({ - paths: ['path1','path2','path3'], - listeners: { - log: function(logLevel){ - console.log('a log message occured:', arguments); - }, - error: function(err){ - console.log('an error occured:', err); - }, - watching: function(err,watcherInstance,isWatching){ - if (err) { - console.log("watching the path " + watcherInstance.path + " failed with error", err); - } else { - console.log("watching the path " + watcherInstance.path + " completed"); - } - }, - change: function(changeType,filePath,fileCurrentStat,filePreviousStat){ - console.log('a change event occured:',arguments); - } - }, - next: function(err,watchers){ - if (err) { - return console.log("watching everything failed with error", err); - } else { - console.log('watching everything completed', watchers); - } - - // Close watchers after 60 seconds - setTimeout(function(){ - var i; - console.log('Stop watching our paths'); - for ( i=0; iCopyright © 2012+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011 [Benjamin Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/bin/watchr b/deploy/core/node_modules/watchr/bin/watchr deleted file mode 100755 index f248487f3..000000000 --- a/deploy/core/node_modules/watchr/bin/watchr +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env node -// Require -var watchr = require(__dirname+'/../out/lib/watchr'); - -// Watch a directory or file -console.log('Watch our paths'); -watchr.watch({ - paths: [process.cwd()], - listeners: { - log: function(logLevel){ - console.log('a log message occured:', arguments); - }, - error: function(err){ - console.log('an error occured:', err); - }, - watching: function(err,watcherInstance,isWatching){ - if (err) { - console.log("watching the path " + watcherInstance.path + " failed with error", err); - } else { - console.log("watching the path " + watcherInstance.path + " completed"); - } - }, - change: function(changeType,filePath,fileCurrentStat,filePreviousStat){ - console.log('a change event occured:',arguments); - } - }, - next: function(err,watchers){ - if (err) { - return console.log("watching everything failed with error", err); - } else { - console.log('watching everything completed', watchers); - } - - // Close watchers after 60 seconds - setTimeout(function(){ - var i; - console.log('Stop watching our paths'); - for ( i=0; i - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/README.md b/deploy/core/node_modules/watchr/node_modules/bal-util/README.md deleted file mode 100755 index 14d59f2da..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Benjamin Lupton's Utility Functions - -[![Build Status](https://secure.travis-ci.org/balupton/bal-util.png?branch=master)](http://travis-ci.org/balupton/bal-util) -[![NPM version](https://badge.fury.io/js/bal-util.png)](https://npmjs.org/package/bal-util) -[![Flattr this project](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr) - -Common utility functions for Node.js used and maintained by Benjamin Lupton - - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save bal-util` - -### Frontend - -1. [See Browserify](http://browserify.org/) - - - -## Usage -Best off looking at source, it's well documented, and there are plenty of tests - - - -## Future -We're in the process of abstracting the pieces of bal-util out into their own modules. So far, we've done the following: - -- [ambi](https://github.com/bevry/ambi) < `balUtilFlow.fireWithOptionalCallback` -- [eachr](https://github.com/bevry/eachr) < `balUtilFlow.each` -- [extendr](https://github.com/bevry/extendr) < `balUtilFlow.(extend|clone|etc)` -- [getsetdeep](https://github.com/bevry/getsetdeep) < `balUtilFlow.(get|set)Deep` -- [safeCallback](https://github.com/bevry/safecallback) < `balUtilFlow.safeCallback` -- [safefs](https://github.com/bevry/safefs) < `balUtilPaths.(openFile|closeFile|etc)` -- [TaskGroup](https://github.com/bevry/taskgroup) < `balUtilFlow.Group` -- [typeChecker](https://github.com/bevry/typechecker) < `balUtilTypes` - - - -## History -You can discover the history inside the [History.md](https://github.com/balupton/bal-util/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2011+ [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/.npmignore b/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/LICENSE.md deleted file mode 100755 index 49d7c05dc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/README.md b/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/README.md deleted file mode 100755 index 35e5219a0..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Ambi [![Build Status](https://secure.travis-ci.org/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi) -Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). -Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically). - - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save ambi` - -### Frontend - -1. [See Browserify](http://browserify.org) - - - -## Usage - -``` javascript -// Import -var ambi = require('ambi') -var result - -// Sample methods -var syncMethod = function(x,y){ - return x*y -} -var asyncMethod = function(x,y,next){ - return setTimeout(function(){ - next(null,x*y) - },0) -} - -// Call the synchronous function asynchronously -result = ambi(syncMethod, 5, 2, function(err,result){ // ambi adds support for this asynchronous callback automatically - console.log(err, result) // null, 10 -}) -console.log(result) // 10 - just like normal - -// Call the asynchronous function asynchronously -result = ambi(asyncMethod, 5, 2, function(err,result){ // ambi doesn't do anything special here - console.log(err, result) // null, 10 -}) -console.log(result) // setTimeout - just like normal -``` - - - -## Process - -- Ambi accepts the arguments `(method, args...)` - - `method` is the function to execute - - `args...` is the arguments to send to the method - - the last argument is expected to be the completion callback - - the completion callback is optional, but if defined, is expected to have the signature of `(err, results...)` -- If the method has the same amount of arguments as those ambi received, then we assume it is an asynchronous method and let it handle calling of the completion callback itself -- If the method does not have the same amount of arguments as those ambi received, then we assume it is a synchronous method and we'll call the completion callback ourselves - - If the synchronous method throws an error or returns an error, we'll try to call the completion callback with a single `err` argument - - If the synchronous method executes without error, we'll try to call the completion callback with a `err` argument equal to null, and a `result` argument equal to the returned result of the synchronous method -- Ambi can also introspect a different method than the one it fires, by passing `[methodToFire, methodToIntrospect]` as the `method` argument - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/ambi/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/out/lib/ambi.js b/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/out/lib/ambi.js deleted file mode 100644 index 25da1c05d..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/out/lib/ambi.js +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var ambi, typeChecker, - __slice = [].slice; - -typeChecker = require('typechecker'); - -ambi = function() { - var args, callback, caughtError, err, fireMethod, introspectMethod, method, result; - - method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - callback = args[args.length - 1]; - result = null; - err = null; - if (typeChecker.isArray(method)) { - fireMethod = method[0], introspectMethod = method[1]; - } else { - fireMethod = introspectMethod = method; - } - if (introspectMethod.length === args.length) { - try { - result = fireMethod.apply(null, args); - if (typeChecker.isError(result)) { - err = result; - } - } catch (_error) { - caughtError = _error; - err = caughtError; - } - if (err) { - if (typeof callback === "function") { - callback(err); - } - } - } else { - try { - result = fireMethod.apply(null, args); - if (typeChecker.isError(result)) { - err = result; - } - } catch (_error) { - caughtError = _error; - err = caughtError; - } - if (err) { - if (typeof callback === "function") { - callback(err); - } - } else { - if (typeof callback === "function") { - callback(null, result); - } - } - } - return err || result; -}; - -module.exports = ambi; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/package.json b/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/package.json deleted file mode 100755 index 8721d316f..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/node_modules/ambi/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "ambi", - "version": "2.0.0", - "description": "Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).", - "homepage": "https://github.com/bevry/ambi", - "keywords": [ - "sync", - "async", - "fire", - "exec", - "execute", - "ambidextrous" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/ambi/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/ambi.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "typechecker": "~2.0.1" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.1.2", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/ambi-test.js" - }, - "main": "./out/lib/ambi.js", - "readme": "# Ambi [![Build Status](https://secure.travis-ci.org/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi)\nExecute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions).\nUseful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).\n\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save ambi`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org)\n\n\n\n## Usage\n\n``` javascript\n// Import\nvar ambi = require('ambi')\nvar result\n\n// Sample methods\nvar syncMethod = function(x,y){\n\treturn x*y\n}\nvar asyncMethod = function(x,y,next){\n\treturn setTimeout(function(){\n\t\tnext(null,x*y)\n\t},0)\n}\n\n// Call the synchronous function asynchronously\nresult = ambi(syncMethod, 5, 2, function(err,result){ // ambi adds support for this asynchronous callback automatically\n\tconsole.log(err, result) // null, 10\n})\nconsole.log(result) // 10 - just like normal\n\n// Call the asynchronous function asynchronously\nresult = ambi(asyncMethod, 5, 2, function(err,result){ // ambi doesn't do anything special here\n\tconsole.log(err, result) // null, 10\n})\nconsole.log(result) // setTimeout - just like normal\n```\n\n\n\n## Process\n\n- Ambi accepts the arguments `(method, args...)`\n\t- `method` is the function to execute\n\t- `args...` is the arguments to send to the method\n\t\t- the last argument is expected to be the completion callback\n\t\t- the completion callback is optional, but if defined, is expected to have the signature of `(err, results...)`\n- If the method has the same amount of arguments as those ambi received, then we assume it is an asynchronous method and let it handle calling of the completion callback itself\n- If the method does not have the same amount of arguments as those ambi received, then we assume it is a synchronous method and we'll call the completion callback ourselves\n\t- If the synchronous method throws an error or returns an error, we'll try to call the completion callback with a single `err` argument\n\t- If the synchronous method executes without error, we'll try to call the completion callback with a `err` argument equal to null, and a `result` argument equal to the returned result of the synchronous method\n- Ambi can also introspect a different method than the one it fires, by passing `[methodToFire, methodToIntrospect]` as the `method` argument\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/ambi/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "ambi@2.0.0", - "_from": "ambi@~2.0.0" -} diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/balutil.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/balutil.js deleted file mode 100644 index b330a5eb2..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/balutil.js +++ /dev/null @@ -1,6 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var balUtil; - -balUtil = require('extendr').extend({}, require('./compare'), require('./events'), require('./flow'), require('./html'), require('./modules'), require('./paths')); - -module.exports = balUtil; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/compare.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/compare.js deleted file mode 100644 index 5ea7a5acc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/compare.js +++ /dev/null @@ -1,141 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var balUtilCompare, balUtilPaths; - -balUtilCompare = null; - -balUtilPaths = require('./paths'); - -balUtilCompare = { - versionCompare: function(v1, operator, v2) { - var compare, i, numVersion, prepVersion, result, vm, x, _i; - - i = x = compare = 0; - vm = { - 'dev': -6, - 'alpha': -5, - 'a': -5, - 'beta': -4, - 'b': -4, - 'RC': -3, - 'rc': -3, - '#': -2, - 'p': -1, - 'pl': -1 - }; - prepVersion = function(v) { - v = ('' + v).replace(/[_\-+]/g, '.'); - v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); - if (!v.length) { - return [-8]; - } else { - return v.split('.'); - } - }; - numVersion = function(v) { - if (!v) { - return 0; - } else { - if (isNaN(v)) { - return vm[v] || -7; - } else { - return parseInt(v, 10); - } - } - }; - v1 = prepVersion(v1); - v2 = prepVersion(v2); - x = Math.max(v1.length, v2.length); - for (i = _i = 0; 0 <= x ? _i <= x : _i >= x; i = 0 <= x ? ++_i : --_i) { - if (v1[i] === v2[i]) { - continue; - } - v1[i] = numVersion(v1[i]); - v2[i] = numVersion(v2[i]); - if (v1[i] < v2[i]) { - compare = -1; - break; - } else if (v1[i] > v2[i]) { - compare = 1; - break; - } - } - if (!operator) { - return compare; - } - result = (function() { - switch (operator) { - case '>': - case 'gt': - return compare > 0; - case '>=': - case 'ge': - return compare >= 0; - case '<=': - case 'le': - return compare <= 0; - case '==': - case '=': - case 'eq': - case 'is': - return compare === 0; - case '<>': - case '!=': - case 'ne': - case 'isnt': - return compare !== 0; - case '': - case '<': - case 'lt': - return compare < 0; - default: - return null; - } - })(); - return result; - }, - packageCompare: function(_arg) { - var details, errorCallback, local, newVersionCallback, oldVersionCallback, remote, runCompare, sameVersionCallback; - - local = _arg.local, remote = _arg.remote, newVersionCallback = _arg.newVersionCallback, sameVersionCallback = _arg.sameVersionCallback, oldVersionCallback = _arg.oldVersionCallback, errorCallback = _arg.errorCallback; - details = {}; - runCompare = function() { - if (balUtilCompare.versionCompare(details.local.version, '<', details.remote.version)) { - return typeof newVersionCallback === "function" ? newVersionCallback(details) : void 0; - } else if (balUtilCompare.versionCompare(details.local.version, '==', details.remote.version)) { - return typeof sameVersionCallback === "function" ? sameVersionCallback(details) : void 0; - } else if (balUtilCompare.versionCompare(details.local.version, '>', details.remote.version)) { - return typeof oldVersionCallback === "function" ? oldVersionCallback(details) : void 0; - } - }; - balUtilPaths.readPath(local, function(err, data) { - var dataStr; - - if (err) { - return typeof errorCallback === "function" ? errorCallback(err, data) : void 0; - } - try { - dataStr = data.toString(); - details.local = JSON.parse(dataStr); - } catch (_error) { - err = _error; - return typeof errorCallback === "function" ? errorCallback(err, data) : void 0; - } - return balUtilPaths.readPath(remote, function(err, data) { - if (err) { - return typeof errorCallback === "function" ? errorCallback(err, data) : void 0; - } - try { - dataStr = data.toString(); - details.remote = JSON.parse(dataStr); - } catch (_error) { - err = _error; - return typeof errorCallback === "function" ? errorCallback(err, data) : void 0; - } - return runCompare(); - }); - }); - return this; - } -}; - -module.exports = balUtilCompare; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/events.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/events.js deleted file mode 100644 index 9b500011a..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/events.js +++ /dev/null @@ -1,314 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var Event, EventEmitter, EventEmitterEnhanced, EventSystem, TaskGroup, ambi, typeChecker, _ref, _ref1, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __slice = [].slice; - -EventEmitter = require('events').EventEmitter; - -ambi = require('ambi'); - -TaskGroup = require('taskgroup').TaskGroup; - -typeChecker = require('typechecker'); - -EventEmitterEnhanced = (function(_super) { - __extends(EventEmitterEnhanced, _super); - - function EventEmitterEnhanced() { - _ref = EventEmitterEnhanced.__super__.constructor.apply(this, arguments); - return _ref; - } - - EventEmitterEnhanced.prototype.getListenerGroup = function(eventName, data, next) { - var listeners, me, tasks; - - me = this; - listeners = this.listeners(eventName); - tasks = new TaskGroup().once('complete', next); - listeners.forEach(function(listener) { - if (listener.listener) { - listener = [listener.bind(me), listener.listener]; - } else { - listener = listener.bind(me); - } - return tasks.addTask(function(complete) { - return ambi(listener, data, complete); - }); - }); - return tasks; - }; - - EventEmitterEnhanced.prototype.emitSync = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.emitSerial.apply(this, args); - }; - - EventEmitterEnhanced.prototype.emitSerial = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.getListenerGroup.apply(this, args).run(); - }; - - EventEmitterEnhanced.prototype.emitAsync = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.emitParallel.apply(this, args); - }; - - EventEmitterEnhanced.prototype.emitParallel = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.getListenerGroup.apply(this, args).setConfig({ - concurrency: 0 - }).run(); - }; - - return EventEmitterEnhanced; - -})(EventEmitter); - -Event = (function() { - Event.prototype.name = null; - - Event.prototype.locked = false; - - Event.prototype.finished = false; - - function Event(_arg) { - this.name = _arg.name; - } - - return Event; - -})(); - -EventSystem = (function(_super) { - __extends(EventSystem, _super); - - function EventSystem() { - _ref1 = EventSystem.__super__.constructor.apply(this, arguments); - return _ref1; - } - - EventSystem.prototype._eventSystemEvents = null; - - EventSystem.prototype.event = function(eventName) { - var _base; - - this._eventSystemEvents || (this._eventSystemEvents = {}); - return (_base = this._eventSystemEvents)[eventName] || (_base[eventName] = new Event(eventName)); - }; - - EventSystem.prototype.lock = function(eventName, next) { - var err, event, - _this = this; - - event = this.event(eventName); - if (event.locked === false) { - event.locked = true; - try { - this.emit(eventName + ':locked'); - } catch (_error) { - err = _error; - next(err); - return this; - } finally { - next(); - } - } else { - this.onceUnlocked(eventName, function(err) { - if (err) { - return next(err); - } - return _this.lock(eventName, next); - }); - } - return this; - }; - - EventSystem.prototype.unlock = function(eventName, next) { - var err, event; - - event = this.event(eventName); - event.locked = false; - try { - this.emit(eventName + ':unlocked'); - } catch (_error) { - err = _error; - next(err); - return this; - } finally { - next(); - } - return this; - }; - - EventSystem.prototype.start = function(eventName, next) { - var _this = this; - - this.lock(eventName, function(err) { - var event; - - if (err) { - return next(err); - } - event = _this.event(eventName); - event.finished = false; - try { - return _this.emit(eventName + ':started'); - } catch (_error) { - err = _error; - next(err); - return _this; - } finally { - next(); - } - }); - return this; - }; - - EventSystem.prototype.finish = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.finished.apply(this, args); - }; - - EventSystem.prototype.finished = function(eventName, next) { - var event, - _this = this; - - event = this.event(eventName); - event.finished = true; - this.unlock(eventName, function(err) { - if (err) { - return next(err); - } - try { - return _this.emit(eventName + ':finished'); - } catch (_error) { - err = _error; - next(err); - return _this; - } finally { - next(); - } - }); - return this; - }; - - EventSystem.prototype.onceUnlocked = function(eventName, next) { - var event; - - event = this.event(eventName); - if (event.locked) { - this.once(eventName + ':unlocked', next); - } else { - next(); - } - return this; - }; - - EventSystem.prototype.onceFinished = function(eventName, next) { - var event; - - event = this.event(eventName); - if (event.finished) { - next(); - } else { - this.once(eventName + ':finished', next); - } - return this; - }; - - EventSystem.prototype.whenFinished = function(eventName, next) { - var event; - - event = this.event(eventName); - if (event.finished) { - next(); - } - this.on(eventName + ':finished', next); - return this; - }; - - EventSystem.prototype.when = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.on.apply(this, args); - }; - - EventSystem.prototype.block = function(eventNames, next) { - var done, err, eventName, total, _i, _len; - - if (!typeChecker.isArray(eventNames)) { - if (typeChecker.isString(eventNames)) { - eventNames = eventNames.split(/[,\s]+/g); - } else { - err = new Error('Unknown eventNames type'); - return next(err); - } - } - total = eventNames.length; - done = 0; - for (_i = 0, _len = eventNames.length; _i < _len; _i++) { - eventName = eventNames[_i]; - this.lock(eventName, function(err) { - if (err) { - done = total; - return next(err); - } - done++; - if (done === total) { - return next(); - } - }); - } - return this; - }; - - EventSystem.prototype.unblock = function(eventNames, next) { - var done, err, eventName, total, _i, _len; - - if (!typeChecker.isArray(eventNames)) { - if (typeChecker.isString(eventNames)) { - eventNames = eventNames.split(/[,\s]+/g); - } else { - err = new Error('Unknown eventNames type'); - return next(err); - } - } - total = eventNames.length; - done = 0; - for (_i = 0, _len = eventNames.length; _i < _len; _i++) { - eventName = eventNames[_i]; - this.unlock(eventName, function(err) { - if (err) { - done = total; - return next(err); - } - done++; - if (done === total) { - return next(); - } - }); - } - return this; - }; - - return EventSystem; - -})(EventEmitterEnhanced); - -module.exports = { - EventEmitterEnhanced: EventEmitterEnhanced, - Event: Event, - EventSystem: EventSystem -}; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/flow.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/flow.js deleted file mode 100644 index 83640bf59..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/flow.js +++ /dev/null @@ -1,119 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var TaskGroup, balUtilFlow, eachr, typeChecker, - __slice = [].slice; - -TaskGroup = require('taskgroup').TaskGroup; - -typeChecker = require('typechecker'); - -eachr = require('eachr'); - -balUtilFlow = { - wait: function(delay, fn) { - return setTimeout(fn, delay); - }, - extractOptsAndCallback: function(opts, next, config) { - var completionCallbackName, _i, _len, _ref, _ref1; - - if (config == null) { - config = {}; - } - if ((_ref = config.completionCallbackNames) == null) { - config.completionCallbackNames = ['next']; - } - if (typeChecker.isFunction(opts) && (next != null) === false) { - next = opts; - opts = {}; - } else { - opts || (opts = {}); - } - if (!next) { - _ref1 = config.completionCallbackNames; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - completionCallbackName = _ref1[_i]; - next = opts[completionCallbackName]; - if (next) { - break; - } - } - } - next || (next = null); - return [opts, next]; - }, - flow: function() { - var action, actions, args, next, object, tasks, _ref, _ref1, _ref2; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (args.length === 1) { - _ref = args[0], object = _ref.object, actions = _ref.actions, action = _ref.action, args = _ref.args, tasks = _ref.tasks, next = _ref.next; - } else if (args.length === 4) { - _ref1 = args, object = _ref1[0], action = _ref1[1], args = _ref1[2], next = _ref1[3]; - } else if (args.length === 3) { - _ref2 = args, actions = _ref2[0], args = _ref2[1], next = _ref2[2]; - } - if ((action != null) === false && (actions != null) === false) { - throw new Error('balUtilFlow.flow called without any action'); - } - if (actions == null) { - actions = action.split(/[,\s]+/g); - } - if (object == null) { - object = null; - } - tasks || (tasks = new TaskGroup().once('complete', next)); - actions.forEach(function(action) { - return tasks.addTask(function(complete) { - var argsClone, fn; - - argsClone = (args || []).slice(); - argsClone.push(complete); - fn = typeChecker.isFunction(action) ? action : object[action]; - return fn.apply(object, argsClone); - }); - }); - tasks.run(); - return this; - }, - createSnore: function(message, opts) { - var snore, _ref; - - opts || (opts = {}); - if ((_ref = opts.delay) == null) { - opts.delay = 5000; - } - snore = { - snoring: false, - timer: setTimeout(function() { - snore.clear(); - snore.snoring = true; - return typeof message === "function" ? message() : void 0; - }, opts.delay), - clear: function() { - if (snore.timer) { - clearTimeout(snore.timer); - return snore.timer = false; - } - } - }; - return snore; - }, - suffixArray: function() { - var arg, args, item, result, suffix, _i, _j, _len, _len1; - - suffix = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - result = []; - for (_i = 0, _len = args.length; _i < _len; _i++) { - arg = args[_i]; - if (!typeChecker.isArray(arg)) { - arg = [arg]; - } - for (_j = 0, _len1 = arg.length; _j < _len1; _j++) { - item = arg[_j]; - result.push(item + suffix); - } - } - return result; - } -}; - -module.exports = balUtilFlow; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/html.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/html.js deleted file mode 100644 index 1939845bd..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/html.js +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var TaskGroup, balUtilHTML, - __slice = [].slice; - -TaskGroup = require('taskgroup').TaskGroup; - -balUtilHTML = { - getAttribute: function(attributes, attribute) { - var match, regex, value; - - regex = new RegExp("(" + attribute + ")\\s*=\\s*('[^']+'|\\\"[^\\\"]+\\\"|[^'\\\"\\s]\\S*)", 'ig'); - value = null; - while (match = regex.exec(attributes)) { - value = match[2].trim().replace(/(^['"]\s*|\s*['"]$)/g, ''); - } - return value; - }, - detectIndentation: function(source) { - var indentation, result; - - result = /\n([ \t]*)\S/m.exec(source); - indentation = (result != null ? result[1] : void 0) || ''; - return indentation; - }, - removeIndentation: function(source) { - var indentation, regex, regexString, result; - - indentation = balUtilHTML.detectIndentation(source); - regexString = indentation.replace(/\t/g, '\\t'); - regex = new RegExp("^" + regexString, 'gm'); - result = source.replace(regex, '').trim(); - return result; - }, - replaceElement: function() { - var args, element, html, regex, removeIndentation, replace, result, _ref; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (args.length === 1) { - _ref = args[0], html = _ref.html, element = _ref.element, removeIndentation = _ref.removeIndentation, replace = _ref.replace; - } else { - html = args[0], element = args[1], replace = args[2]; - } - regex = new RegExp("<(" + element + "(?:\\:[-:_a-z0-9]+)?)(\\s+[^>]+)?>([\\s\\S]+?)<\\/\\1>", 'ig'); - result = html.replace(regex, function(outerHTML, element, attributes, innerHTML) { - if (removeIndentation !== false) { - innerHTML = balUtilHTML.removeIndentation(innerHTML); - } - return replace(outerHTML, element, attributes, innerHTML); - }); - return result; - }, - replaceElementAsync: function() { - var args, element, html, next, removeIndentation, replace, result, tasks, _ref; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (args.length === 1) { - _ref = args[0], html = _ref.html, element = _ref.element, removeIndentation = _ref.removeIndentation, replace = _ref.replace, next = _ref.next; - } else { - html = args[0], element = args[1], replace = args[2], next = args[3]; - } - tasks = new TaskGroup().setConfig({ - concurrency: 0 - }).once('complete', function(err) { - if (err) { - return next(err); - } - return next(null, result); - }); - result = balUtilHTML.replaceElement({ - html: html, - element: element, - removeIndentation: removeIndentation, - replace: function(outerHTML, element, attributes, innerHTML) { - var random; - - random = Math.random(); - tasks.addTask(function(complete) { - return replace(outerHTML, element, attributes, innerHTML, function(err, replaceElementResult) { - if (err) { - return complete(err); - } - result = result.replace(random, replaceElementResult); - return complete(); - }); - }); - return random; - } - }); - tasks.run(); - return this; - } -}; - -module.exports = balUtilHTML; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/modules.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/modules.js deleted file mode 100644 index fd03e45bf..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/modules.js +++ /dev/null @@ -1,518 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var TaskGroup, balUtilFlow, balUtilModules, isWindows, safefs, typeChecker, _base, _ref, _ref1, _ref2, _ref3, - __slice = [].slice; - -balUtilModules = null; - -TaskGroup = require('taskgroup').TaskGroup; - -typeChecker = require('typechecker'); - -safefs = require('safefs'); - -balUtilFlow = require('./flow'); - -isWindows = (typeof process !== "undefined" && process !== null ? (_ref = process.platform) != null ? _ref.indexOf('win') : void 0 : void 0) === 0; - -if ((_ref1 = global.safepsGlobal) == null) { - global.safepsGlobal = {}; -} - -if ((_ref2 = (_base = global.safepsGlobal).pool) == null) { - _base.pool = new TaskGroup().setConfig({ - concurrency: (_ref3 = process.env.NODE_MAX_OPEN_PROCESSES) != null ? _ref3 : 100, - pauseOnError: false - }).run(); -} - -balUtilModules = { - openProcess: function(fn) { - global.safepsGlobal.pool.addTask(fn); - return balUtilModules; - }, - closeFile: function() { - console.log('safeps.closeFile has been deprecated, please use the safeps.openFile completion callback to close files'); - return balUtilModules; - }, - requireFresh: function(path) { - var result; - - path = require('path').resolve(path); - delete require.cache[path]; - result = require(path); - delete require.cache[path]; - return result; - }, - isWindows: function() { - return isWindows; - }, - getLocaleCode: function(lang) { - var localeCode; - - if (lang == null) { - lang = null; - } - if (lang == null) { - lang = process.env.LANG || ''; - } - localeCode = lang.replace(/\..+/, '').replace('-', '_').toLowerCase() || null; - return localeCode; - }, - getLanguageCode: function(localeCode) { - var languageCode; - - if (localeCode == null) { - localeCode = null; - } - localeCode = balUtilModules.getLocaleCode(localeCode) || ''; - languageCode = localeCode.replace(/^([a-z]+)[_-]([a-z]+)$/i, '$1').toLowerCase() || null; - return languageCode; - }, - getCountryCode: function(localeCode) { - var countryCode; - - if (localeCode == null) { - localeCode = null; - } - localeCode = balUtilModules.getLocaleCode(localeCode) || ''; - countryCode = localeCode.replace(/^([a-z]+)[_-]([a-z]+)$/i, '$2').toLowerCase() || null; - return countryCode; - }, - spawn: function(command, opts, next) { - balUtilModules.openProcess(function(closeProcess) { - var err, pid, spawn, stderr, stdout, _ref4; - - spawn = require('child_process').spawn; - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - pid = null; - err = null; - stdout = ''; - stderr = ''; - if (typeChecker.isString(command)) { - command = command.split(' '); - } - if (typeChecker.isArray(command)) { - command = { - command: command[0], - args: command.slice(1), - options: opts - }; - } - pid = spawn(command.command, command.args || [], command.options || opts); - pid.stdout.on('data', function(data) { - if (opts.output) { - process.stdout.write(data); - } - return stdout += data.toString(); - }); - pid.stderr.on('data', function(data) { - if (opts.output) { - process.stderr.write(data); - } - return stderr += data.toString(); - }); - pid.on('exit', function(code, signal) { - err = null; - if (code !== 0) { - err = new Error(stderr || 'exited with a non-zero status code'); - } - closeProcess(); - return next(err, stdout, stderr, code, signal); - }); - if (opts.stdin) { - pid.stdin.write(opts.stdin); - return pid.stdin.end(); - } - }); - return this; - }, - spawnMultiple: function(commands, opts, next) { - var concurrency, results, tasks, _ref4; - - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - opts.tasksMode || (opts.tasksMode = 'serial'); - results = []; - concurrency = opts.tasksMode === 'serial' ? 1 : 0; - tasks = new TaskGroup().setConfig({ - concurrency: concurrency - }).once('complete', function(err) { - return next(err, results); - }); - if (!typeChecker.isArray(commands)) { - commands = [commands]; - } - commands.forEach(function(command) { - return tasks.addTask(function(complete) { - return balUtilModules.spawn(command, opts, function() { - var args, err; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - err = args[0] || null; - results.push(args); - return complete(err); - }); - }); - }); - tasks.run(); - return this; - }, - spawnCommand: function(command, args, opts, next) { - if (args == null) { - args = []; - } - balUtilModules.getExecPath(command, function(err, execPath) { - var pieces; - - if (err) { - return next(err); - } - pieces = [execPath].concat(args); - return balUtilModules.spawn(pieces, opts, next); - }); - return this; - }, - spawnCommands: function(command, multiArgs, opts, next) { - if (multiArgs == null) { - multiArgs = []; - } - balUtilModules.getExecPath(command, function(err, execPath) { - var args, pieces, _i, _len; - - if (err) { - return next(err); - } - pieces = []; - for (_i = 0, _len = multiArgs.length; _i < _len; _i++) { - args = multiArgs[_i]; - pieces.push([execPath].concat(args)); - } - return balUtilModules.spawnMultiple(pieces, opts, next); - }); - return this; - }, - exec: function(command, opts, next) { - balUtilModules.openProcess(function(closeProcess) { - var exec, _ref4; - - exec = require('child_process').exec; - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - if (opts.output) { - opts.stdio = 'inherit'; - delete opts.output; - } - return exec(command, opts, function(err, stdout, stderr) { - closeProcess(); - return next(err, stdout, stderr); - }); - }); - return this; - }, - execMultiple: function(commands, opts, next) { - var concurrency, results, tasks, _ref4; - - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - opts.tasksMode || (opts.tasksMode = 'serial'); - results = []; - concurrency = opts.tasksMode === 'serial' ? 1 : 0; - tasks = new TaskGroup().setConfig({ - concurrency: concurrency - }).once('complete', function(err) { - return next(err, results); - }); - if (!typeChecker.isArray(commands)) { - commands = [commands]; - } - commands.forEach(function(command) { - return tasks.addTask(function(complete) { - return balUtilModules.exec(this.command, opts, function() { - var args, err; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - err = args[0] || null; - results.push(args); - return complete(err); - }); - }); - }); - tasks.run(); - return this; - }, - determineExecPath: function(possibleExecPaths, next) { - var execPath, pathUtil, tasks; - - pathUtil = require('path'); - execPath = null; - tasks = new TaskGroup().once('complete', function(err) { - return next(err, execPath); - }); - possibleExecPaths.forEach(function(possibleExecPath) { - if (!possibleExecPath) { - return; - } - return tasks.addTask(function(complete) { - if (execPath) { - return complete(); - } - possibleExecPath = pathUtil.resolve(possibleExecPath); - return safefs.exists(possibleExecPath, function(exists) { - if (!exists) { - return complete(); - } - return balUtilModules.spawn([possibleExecPath, '--version'], { - env: process.env - }, function(err, stdout, stderr, code, signal) { - if (err) { - return complete(); - } - execPath = possibleExecPath; - return complete(); - }); - }); - }); - }); - tasks.run(); - return this; - }, - getEnvironmentPaths: function() { - var environmentPaths; - - if (balUtilModules.isWindows()) { - environmentPaths = process.env.PATH.split(/;/g); - } else { - environmentPaths = process.env.PATH.split(/:/g); - } - return environmentPaths; - }, - getStandardExecPaths: function(execName) { - var index, possibleExecPaths, value, _i, _len; - - possibleExecPaths = [process.cwd()].concat(balUtilModules.getEnvironmentPaths()); - for (index = _i = 0, _len = possibleExecPaths.length; _i < _len; index = ++_i) { - value = possibleExecPaths[index]; - possibleExecPaths[index] = value.replace(/\/$/, ''); - } - if (execName) { - possibleExecPaths = balUtilFlow.suffixArray("/" + execName, possibleExecPaths); - } - return possibleExecPaths; - }, - getExecPath: function(execName, next) { - var execNameCapitalized, getExecMethodName, possibleExecPaths; - - execNameCapitalized = execName[0].toUpperCase() + execName.substr(1); - getExecMethodName = 'get' + execNameCapitalized + 'Path'; - if (balUtilModules[getExecMethodName] != null) { - balUtilModules[getExecMethodName](next); - } else { - if (isWindows && execName.indexOf('.') === -1) { - possibleExecPaths = balUtilModules.getStandardExecPaths(execName + '.exe').concat(balUtilModules.getStandardExecPaths(execName)); - } else { - possibleExecPaths = balUtilModules.getStandardExecPaths(execName); - } - balUtilModules.determineExecPath(possibleExecPaths, next); - } - return this; - }, - getHomePath: function(next) { - var homePath; - - if (balUtilModules.cachedHomePath != null) { - next(null, balUtilModules.cachedHomePath); - return this; - } - homePath = process.env.USERPROFILE || process.env.HOME; - homePath || (homePath = null); - balUtilModules.cachedHomePath = homePath; - next(null, homePath); - return this; - }, - getTmpPath: function(next) { - var pathUtil, tmpDirName, tmpPath; - - if (balUtilModules.cachedTmpPath != null) { - next(null, balUtilModules.cachedTmpPath); - return this; - } - pathUtil = require('path'); - tmpDirName = isWindows ? 'temp' : 'tmp'; - tmpPath = process.env.TMPDIR || process.env.TMP || process.env.TEMP; - if (!tmpPath) { - balUtilModules.getHomePath(function(err, homePath) { - if (err) { - return next(err); - } - tmpPath = pathUtil.resolve(homePath, tmpDirName); - if (!tmpPath) { - return tmpPath = isWindows ? pathUtil.resolve(process.env.windir || 'C:\\Windows', tmpDirName) : '/tmp'; - } - }); - } - tmpPath || (tmpPath = null); - balUtilModules.cachedTmpPath = tmpPath; - next(null, tmpPath); - return this; - }, - getGitPath: function(next) { - var execName, possibleExecPaths; - - if (balUtilModules.cachedGitPath != null) { - next(null, balUtilModules.cachedGitPath); - return this; - } - execName = isWindows ? 'git.exe' : 'git'; - possibleExecPaths = [process.env.GIT_PATH, process.env.GITPATH].concat(balUtilModules.getStandardExecPaths(execName)).concat(isWindows ? ["/Program Files (x64)/Git/bin/" + execName, "/Program Files (x86)/Git/bin/" + execName, "/Program Files/Git/bin/" + execName] : ["/usr/local/bin/" + execName, "/usr/bin/" + execName, "~/bin/" + execName]); - balUtilModules.determineExecPath(possibleExecPaths, function(err, execPath) { - balUtilModules.cachedGitPath = execPath; - if (err) { - return next(err); - } - if (!execPath) { - return next(new Error('Could not locate git binary')); - } - return next(null, execPath); - }); - return this; - }, - getNodePath: function(next) { - var execName, possibleExecPaths; - - if (balUtilModules.cachedNodePath != null) { - next(null, balUtilModules.cachedNodePath); - return this; - } - execName = isWindows ? 'node.exe' : 'node'; - possibleExecPaths = [process.env.NODE_PATH, process.env.NODEPATH, (/node(.exe)?$/.test(process.execPath) ? process.execPath : '')].concat(balUtilModules.getStandardExecPaths(execName)).concat(isWindows ? ["/Program Files (x64)/nodejs/" + execName, "/Program Files (x86)/nodejs/" + execName, "/Program Files/nodejs/" + execName] : ["/usr/local/bin/" + execName, "/usr/bin/" + execName, "~/bin/" + execName]); - balUtilModules.determineExecPath(possibleExecPaths, function(err, execPath) { - balUtilModules.cachedNodePath = execPath; - if (err) { - return next(err); - } - if (!execPath) { - return next(new Error('Could not locate node binary')); - } - return next(null, execPath); - }); - return this; - }, - getNpmPath: function(next) { - var execName, possibleExecPaths; - - if (balUtilModules.cachedNpmPath != null) { - next(null, balUtilModules.cachedNpmPath); - return this; - } - execName = isWindows ? 'npm.cmd' : 'npm'; - possibleExecPaths = [process.env.NPM_PATH, process.env.NPMPATH, (/node(.exe)?$/.test(process.execPath) ? process.execPath.replace(/node(.exe)?$/, execName) : '')].concat(balUtilModules.getStandardExecPaths(execName)).concat(isWindows ? ["/Program Files (x64)/nodejs/" + execName, "/Program Files (x86)/nodejs/" + execName, "/Program Files/nodejs/" + execName] : ["/usr/local/bin/" + execName, "/usr/bin/" + execName, "~/node_modules/.bin/" + execName]); - balUtilModules.determineExecPath(possibleExecPaths, function(err, execPath) { - balUtilModules.cachedNpmPath = execPath; - if (err) { - return next(err); - } - if (!execPath) { - return next(new Error('Could not locate npm binary')); - } - return next(null, execPath); - }); - return this; - }, - initGitRepo: function(opts, next) { - var branch, commands, log, output, path, remote, url, _ref4; - - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - path = opts.path, remote = opts.remote, url = opts.url, branch = opts.branch, log = opts.log, output = opts.output; - remote || (remote = 'origin'); - branch || (branch = 'master'); - commands = [['init'], ['remote', 'add', remote, url], ['fetch', remote], ['pull', remote, branch], ['submodule', 'init'], ['submodule', 'update', '--recursive']]; - if (typeof log === "function") { - log('debug', "Initializing git repo with url [" + url + "] on directory [" + path + "]"); - } - balUtilModules.spawnCommands('git', commands, { - cwd: path, - output: output - }, function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (args[0] != null) { - return next.apply(null, args); - } - if (typeof log === "function") { - log('debug', "Initialized git repo with url [" + url + "] on directory [" + path + "]"); - } - return next.apply(null, args); - }); - return this; - }, - initOrPullGitRepo: function(opts, next) { - var branch, path, remote, _ref4, - _this = this; - - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - path = opts.path, remote = opts.remote, branch = opts.branch; - remote || (remote = 'origin'); - branch || (branch = 'master'); - safefs.ensurePath(path, function(err, exists) { - if (err) { - return complete(err); - } - if (exists) { - opts.cwd = path; - return balUtilModules.spawnCommand('git', ['pull', remote, branch], opts, next); - } else { - return balUtilModules.initGitRepo(opts, next); - } - }); - return this; - }, - initNodeModules: function(opts, next) { - var force, log, nodeModulesPath, packageJsonPath, partTwo, path, pathUtil, _ref4; - - pathUtil = require('path'); - _ref4 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref4[0], next = _ref4[1]; - path = opts.path, log = opts.log, force = opts.force; - opts.cwd = path; - packageJsonPath = pathUtil.join(path, 'package.json'); - nodeModulesPath = pathUtil.join(path, 'node_modules'); - partTwo = function() { - return safefs.exists(packageJsonPath, function(exists) { - var command; - - if (!exists) { - return next(); - } - command = ['install']; - if (force) { - command.push('--force'); - } - if (typeof log === "function") { - log('debug', "Initializing node modules\non: " + dirPath + "\nwith:", command); - } - return balUtilModules.spawnCommand('npm', command, opts, function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (args[0] != null) { - return next.apply(null, args); - } - if (typeof log === "function") { - log('debug', "Initialized node modules\non: " + dirPath + "\nwith:", command); - } - return next.apply(null, args); - }); - }); - }; - if (force === false) { - safefs.exists(nodeModulesPath, function(exists) { - if (exists) { - return next(); - } - return partTwo(); - }); - } else { - partTwo(); - } - return this; - } -}; - -module.exports = balUtilModules; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/paths.js b/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/paths.js deleted file mode 100644 index 6b86de26e..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/out/lib/paths.js +++ /dev/null @@ -1,729 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var TaskGroup, balUtilFlow, balUtilPaths, eachr, extendr, pathUtil, safefs, typeChecker, _ref, _ref1, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice, - __hasProp = {}.hasOwnProperty; - -pathUtil = require('path'); - -eachr = require('eachr'); - -typeChecker = require('typechecker'); - -extendr = require('extendr'); - -safefs = require('safefs'); - -TaskGroup = require('taskgroup').TaskGroup; - -balUtilFlow = require('./flow'); - -balUtilPaths = { - ignoreCommonPatterns: (_ref = process.env.NODE_IGNORE_COMMON_PATTERNS) != null ? _ref : /^((~|\.\#).*|.*(\.swp)|\.(svn|git|hg|DS_Store)|node_modules|CVS|thumbs\.db|desktop\.ini)$/i, - ignoreCustomPatterns: (_ref1 = process.env.NODE_IGNORE_CUSTOM_PATTERNS) != null ? _ref1 : null, - textExtensions: ['c', 'coffee', 'coffeekup', 'cson', 'css', 'eco', 'haml', 'hbs', 'htaccess', 'htm', 'html', 'jade', 'js', 'json', 'less', 'md', 'php', 'phtml', 'py', 'rb', 'rtf', 'sass', 'scss', 'styl', 'stylus', 'text', 'txt', 'xml', 'yaml'].concat((process.env.TEXT_EXTENSIONS || '').split(/[\s,]+/)), - binaryExtensions: ['dds', 'eot', 'gif', 'ico', 'jar', 'jpeg', 'jpg', 'pdf', 'png', 'swf', 'tga', 'ttf', 'zip'].concat((process.env.BINARY_EXTENSIONS || '').split(/[\s,]+/)), - isTextSync: function(filename, buffer) { - var extension, isText, _i, _len; - - isText = null; - if (filename) { - filename = pathUtil.basename(filename).split('.'); - for (_i = 0, _len = filename.length; _i < _len; _i++) { - extension = filename[_i]; - if (__indexOf.call(balUtilPaths.textExtensions, extension) >= 0) { - isText = true; - break; - } - if (__indexOf.call(balUtilPaths.binaryExtensions, extension) >= 0) { - isText = false; - break; - } - } - } - if (buffer && isText === null) { - isText = balUtilPaths.getEncodingSync(buffer) === 'utf8'; - } - return isText; - }, - isText: function(filename, buffer, next) { - var result; - - result = this.isTextSync(filename, buffer); - if (result instanceof Error) { - next(err); - } else { - next(null, result); - } - return this; - }, - getEncodingSync: function(buffer, opts) { - var binaryEncoding, charCode, chunkBegin, chunkEnd, chunkLength, contentChunkUTF8, encoding, i, textEncoding, _i, _ref2; - - textEncoding = 'utf8'; - binaryEncoding = 'binary'; - if (opts == null) { - chunkLength = 24; - encoding = balUtilPaths.getEncodingSync(buffer, { - chunkLength: chunkLength, - chunkBegin: chunkBegin - }); - if (encoding === textEncoding) { - chunkBegin = Math.max(0, Math.floor(buffer.length / 2) - chunkLength); - encoding = balUtilPaths.getEncodingSync(buffer, { - chunkLength: chunkLength, - chunkBegin: chunkBegin - }); - if (encoding === textEncoding) { - chunkBegin = Math.max(0, buffer.length - chunkLength); - encoding = balUtilPaths.getEncodingSync(buffer, { - chunkLength: chunkLength, - chunkBegin: chunkBegin - }); - } - } - } else { - chunkLength = opts.chunkLength, chunkBegin = opts.chunkBegin; - if (chunkLength == null) { - chunkLength = 24; - } - if (chunkBegin == null) { - chunkBegin = 0; - } - chunkEnd = Math.min(buffer.length, chunkBegin + chunkLength); - contentChunkUTF8 = buffer.toString(textEncoding, chunkBegin, chunkEnd); - encoding = textEncoding; - for (i = _i = 0, _ref2 = contentChunkUTF8.length; 0 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 0 <= _ref2 ? ++_i : --_i) { - charCode = contentChunkUTF8.charCodeAt(i); - if (charCode === 65533 || charCode <= 8) { - encoding = binaryEncoding; - break; - } - } - } - return encoding; - }, - getEncoding: function(buffer, opts, next) { - var result; - - result = this.getEncodingSync(buffer, opts); - if (result instanceof Error) { - next(err); - } else { - next(null, result); - } - return this; - }, - cp: function(src, dst, next) { - safefs.readFile(src, 'binary', function(err, data) { - if (err) { - return next(err); - } - return safefs.writeFile(dst, data, 'binary', function(err) { - return next(err); - }); - }); - return this; - }, - prefixPathSync: function(path, parentPath) { - path = path.replace(/[\/\\]$/, ''); - if (/^([a-zA-Z]\:|\/)/.test(path) === false) { - path = pathUtil.join(parentPath, path); - } - return path; - }, - isDirectory: function(path, next) { - if ((path != null ? path.isDirectory : void 0) != null) { - return next(null, path.isDirectory(), path); - } else { - safefs.stat(path, function(err, stat) { - if (err) { - return next(err); - } - return next(null, stat.isDirectory(), stat); - }); - } - return this; - }, - generateSlugSync: function(path) { - var result; - - result = path.replace(/[^a-zA-Z0-9]/g, '-').replace(/^-/, '').replace(/-+/, '-'); - return result; - }, - scanlist: function(path, next) { - balUtilPaths.scandir({ - path: path, - readFiles: true, - ignoreHiddenFiles: true, - next: function(err, list) { - return next(err, list); - } - }); - return this; - }, - scantree: function(path, next) { - balUtilPaths.scandir({ - path: path, - readFiles: true, - ignoreHiddenFiles: true, - next: function(err, list, tree) { - return next(err, tree); - } - }); - return this; - }, - testIgnorePatterns: function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.isIgnoredPath.apply(this, args); - }, - isIgnoredPath: function(path, opts) { - var basename, ignorePath, result, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6; - - if (opts == null) { - opts = {}; - } - result = false; - basename = pathUtil.basename(path); - if ((_ref2 = opts.ignorePaths) == null) { - opts.ignorePaths = false; - } - if ((_ref3 = opts.ignoreHiddenFiles) == null) { - opts.ignoreHiddenFiles = false; - } - if ((_ref4 = opts.ignoreCommonPatterns) == null) { - opts.ignoreCommonPatterns = true; - } - if ((_ref5 = opts.ignoreCustomPatterns) == null) { - opts.ignoreCustomPatterns = false; - } - if (opts.ignoreCommonPatterns === true) { - opts.ignoreCommonPatterns = balUtilPaths.ignoreCommonPatterns; - } - if (opts.ignorePaths) { - _ref6 = opts.ignorePaths; - for (_i = 0, _len = _ref6.length; _i < _len; _i++) { - ignorePath = _ref6[_i]; - if (path.indexOf(ignorePath) === 0) { - result = true; - break; - } - } - } - result = result || (opts.ignoreHiddenFiles && /^\./.test(basename)) || (opts.ignoreCommonPatterns && opts.ignoreCommonPatterns.test(basename)) || (opts.ignoreCustomPatterns && opts.ignoreCustomPatterns.test(basename)) || false; - return result; - }, - scandir: function() { - var args, err, list, next, opts, tree, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - list = {}; - tree = {}; - if (args.length === 1) { - opts = args[0]; - } else if (args.length >= 4) { - opts = { - path: args[0], - fileAction: args[1] || null, - dirAction: args[2] || null, - next: args[3] || null - }; - } else { - err = new Error('balUtilPaths.scandir: unsupported arguments'); - throw err; - } - if ((_ref2 = opts.recurse) == null) { - opts.recurse = true; - } - if ((_ref3 = opts.readFiles) == null) { - opts.readFiles = false; - } - if ((_ref4 = opts.ignorePaths) == null) { - opts.ignorePaths = false; - } - if ((_ref5 = opts.ignoreHiddenFiles) == null) { - opts.ignoreHiddenFiles = false; - } - if ((_ref6 = opts.ignoreCommonPatterns) == null) { - opts.ignoreCommonPatterns = false; - } - if ((_ref7 = opts.next) == null) { - opts.next = function(err) { - if (err) { - throw err; - } - }; - } - next = opts.next; - if (opts.action != null) { - if ((_ref8 = opts.fileAction) == null) { - opts.fileAction = opts.action; - } - if ((_ref9 = opts.dirAction) == null) { - opts.dirAction = opts.action; - } - } - if (opts.parentPath && !opts.path) { - opts.path = opts.parentPath; - } - if (!opts.path) { - err = new Error('balUtilPaths.scandir: path is needed'); - return next(err); - } - safefs.readdir(opts.path, function(err, files) { - var tasks; - - if (err) { - return next(err); - } - if (files.length === 0) { - return next(null, list, tree); - } - tasks = new TaskGroup().setConfig({ - concurrency: 0 - }).once('complete', function(err) { - return opts.next(err, list, tree); - }); - files.forEach(function(file) { - return tasks.addTask(function(complete) { - var fileFullPath, fileRelativePath, isIgnoredFile; - - fileFullPath = pathUtil.join(opts.path, file); - fileRelativePath = opts.relativePath ? pathUtil.join(opts.relativePath, file) : file; - isIgnoredFile = balUtilPaths.isIgnoredPath(fileFullPath, { - ignorePaths: opts.ignorePaths, - ignoreHiddenFiles: opts.ignoreHiddenFiles, - ignoreCommonPatterns: opts.ignoreCommonPatterns, - ignoreCustomPatterns: opts.ignoreCustomPatterns - }); - if (isIgnoredFile) { - return complete(); - } - return balUtilPaths.isDirectory(fileFullPath, function(err, isDirectory, fileStat) { - var handle; - - if (err) { - return complete(err); - } - if (tasks.paused) { - return complete(); - } - if (isDirectory) { - handle = function(err, skip, subtreeCallback) { - if (err) { - return complete(err); - } - if (tasks.paused) { - return complete(); - } - if (skip) { - return complete(); - } - list[fileRelativePath] = 'dir'; - tree[file] = {}; - if (!opts.recurse) { - return complete(); - } - return balUtilPaths.scandir({ - path: fileFullPath, - relativePath: fileRelativePath, - fileAction: opts.fileAction, - dirAction: opts.dirAction, - readFiles: opts.readFiles, - ignorePaths: opts.ignorePaths, - ignoreHiddenFiles: opts.ignoreHiddenFiles, - ignoreCommonPatterns: opts.ignoreCommonPatterns, - ignoreCustomPatterns: opts.ignoreCustomPatterns, - recurse: opts.recurse, - stat: opts.fileStat, - next: function(err, _list, _tree) { - var filePath, fileType; - - tree[file] = _tree; - for (filePath in _list) { - if (!__hasProp.call(_list, filePath)) continue; - fileType = _list[filePath]; - list[filePath] = fileType; - } - if (err) { - return complete(err); - } - if (tasks.paused) { - return complete(); - } - if (subtreeCallback) { - return subtreeCallback(complete); - } - return complete(); - } - }); - }; - if (opts.dirAction) { - return opts.dirAction(fileFullPath, fileRelativePath, handle, fileStat); - } else if (opts.dirAction === false) { - return handle(err, true); - } else { - return handle(err, false); - } - } else { - handle = function(err, skip) { - if (err) { - return complete(err); - } - if (tasks.paused) { - return complete(); - } - if (skip) { - return complete(); - } - if (opts.readFiles) { - return safefs.readFile(fileFullPath, function(err, data) { - var dataString; - - if (err) { - return complete(err); - } - dataString = data.toString(); - list[fileRelativePath] = dataString; - tree[file] = dataString; - return complete(); - }); - } else { - list[fileRelativePath] = 'file'; - tree[file] = true; - return complete(); - } - }; - if (opts.fileAction) { - return opts.fileAction(fileFullPath, fileRelativePath, handle, fileStat); - } else if (opts.fileAction === false) { - return handle(err, true); - } else { - return handle(err, false); - } - } - }); - }); - }); - return tasks.run(); - }); - return this; - }, - cpdir: function() { - var args, err, next, opt, opts, outPath, scandirOpts, srcPath, _i, _len, _ref2; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - opts = {}; - if (args.length === 1) { - opts = args[0]; - } else if (args.length >= 3) { - srcPath = args[0], outPath = args[1], next = args[2]; - opts = { - srcPath: srcPath, - outPath: outPath, - next: next - }; - } else { - err = new Error('balUtilPaths.cpdir: unknown arguments'); - if (next) { - return next(err); - } else { - throw err; - } - } - scandirOpts = { - path: opts.srcPath, - fileAction: function(fileSrcPath, fileRelativePath, next) { - var fileOutPath; - - fileOutPath = pathUtil.join(opts.outPath, fileRelativePath); - return safefs.ensurePath(pathUtil.dirname(fileOutPath), function(err) { - if (err) { - return next(err); - } - return balUtilPaths.cp(fileSrcPath, fileOutPath, function(err) { - return next(err); - }); - }); - }, - next: opts.next - }; - _ref2 = ['ignorePaths', 'ignoreHiddenFiles', 'ignoreCommonPatterns', 'ignoreCustomPatterns']; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - opt = _ref2[_i]; - scandirOpts[opt] = opts[opt]; - } - balUtilPaths.scandir(scandirOpts); - return this; - }, - rpdir: function() { - var args, err, next, opt, opts, outPath, scandirOpts, srcPath, _i, _len, _ref2; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - opts = {}; - if (args.length === 1) { - opts = args[0]; - } else if (args.length >= 3) { - srcPath = args[0], outPath = args[1], next = args[2]; - opts = { - srcPath: srcPath, - outPath: outPath, - next: next - }; - } else { - err = new Error('balUtilPaths.cpdir: unknown arguments'); - if (next) { - return next(err); - } else { - throw err; - } - } - scandirOpts = { - path: opts.srcPath, - fileAction: function(fileSrcPath, fileRelativePath, next) { - var fileOutPath; - - fileOutPath = pathUtil.join(opts.outPath, fileRelativePath); - return safefs.ensurePath(pathUtil.dirname(fileOutPath), function(err) { - if (err) { - return next(err); - } - return balUtilPaths.isPathOlderThan(fileOutPath, fileSrcPath, function(err, older) { - if (older === true || older === null) { - return balUtilPaths.cp(fileSrcPath, fileOutPath, function(err) { - return next(err); - }); - } else { - return next(); - } - }); - }); - }, - next: opts.next - }; - _ref2 = ['ignorePaths', 'ignoreHiddenFiles', 'ignoreCommonPatterns', 'ignoreCustomPatterns']; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - opt = _ref2[_i]; - scandirOpts[opt] = opts[opt]; - } - balUtilPaths.scandir(scandirOpts); - return this; - }, - rmdirDeep: function(parentPath, next) { - safefs.exists(parentPath, function(exists) { - if (!exists) { - return next(); - } - return balUtilPaths.scandir(parentPath, function(fileFullPath, fileRelativePath, next) { - return safefs.unlink(fileFullPath, function(err) { - return next(err); - }); - }, function(fileFullPath, fileRelativePath, next) { - return next(null, false, function(next) { - return balUtilPaths.rmdirDeep(fileFullPath, function(err) { - return next(err); - }); - }); - }, function(err, list, tree) { - if (err) { - return next(err, list, tree); - } - return safefs.rmdir(parentPath, function(err) { - return next(err, list, tree); - }); - }); - }); - return this; - }, - writetree: function(dstPath, tree, next) { - safefs.ensurePath(dstPath, function(err) { - var tasks; - - if (err) { - return next(err); - } - tasks = new TaskGroup().setConfig({ - concurrency: 0 - }).once('complete', next); - eachr(tree, function(value, fileRelativePath) { - return tasks.addTask(function(complete) { - var fileFullPath; - - fileFullPath = pathUtil.join(dstPath, fileRelativePath.replace(/^\/+/, '')); - if (typeChecker.isObject(value)) { - return balUtilPaths.writetree(fileFullPath, value, complete); - } else { - return safefs.writeFile(fileFullPath, value, complete); - } - }); - }); - return tasks.run(); - }); - return this; - }, - readPath: function(filePath, opts, next) { - var data, err, http, req, requestOpts, tasks, zlib, _base, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; - - _ref2 = balUtilFlow.extractOptsAndCallback(opts, next), opts = _ref2[0], next = _ref2[1]; - if (/^http/.test(filePath)) { - data = ''; - tasks = new TaskGroup().once('complete', function(err) { - if (err) { - return next(err); - } - return next(null, data); - }); - requestOpts = require('url').parse(filePath); - if ((_ref3 = requestOpts.path) == null) { - requestOpts.path = requestOpts.pathname; - } - if ((_ref4 = requestOpts.method) == null) { - requestOpts.method = 'GET'; - } - if ((_ref5 = requestOpts.headers) == null) { - requestOpts.headers = {}; - } - if ((_ref6 = (_base = requestOpts.headers)['user-agent']) == null) { - _base['user-agent'] = 'Wget/1.14 (linux-gnu)'; - } - http = requestOpts.protocol === 'https:' ? require('https') : require('http'); - zlib = null; - try { - zlib = require('zlib'); - } catch (_error) { - err = _error; - } - req = http.request(requestOpts, function(res) { - res.on('data', function(chunk) { - return tasks.addTask(function(complete) { - if (res.headers['content-encoding'] === 'gzip' && Buffer.isBuffer(chunk)) { - if (zlib === null) { - err = new Error('Gzip encoding not supported on this environment'); - return complete(err); - } - return zlib.unzip(chunk, function(err, chunk) { - if (err) { - return complete(err); - } - data += chunk; - return complete(); - }); - } else { - data += chunk; - return complete(); - } - }); - }); - return res.on('end', function() { - var locationHeader, _ref7; - - locationHeader = ((_ref7 = res.headers) != null ? _ref7.location : void 0) || null; - if (locationHeader && locationHeader !== requestOpts.href) { - return balUtilPaths.readPath(locationHeader, function(err, _data) { - if (err) { - return tasks.exit(err); - } - data = _data; - return tasks.exit(); - }); - } else { - return tasks.run(); - } - }); - }); - if ((_ref7 = req.setTimeout) == null) { - req.setTimeout = function(delay) { - return setTimeout(function() { - req.abort(); - err = new Error('Request timed out'); - return tasks.exit(err); - }, delay); - }; - } - req.setTimeout((_ref8 = opts.timeout) != null ? _ref8 : 10 * 1000); - req.on('error', function(err) { - return tasks.exit(err); - }).on('timeout', function() { - return req.abort(); - }); - req.end(); - } else { - safefs.readFile(filePath, function(err, data) { - if (err) { - return next(err); - } - return next(null, data); - }); - } - return this; - }, - empty: function(filePath, next) { - safefs.exists(filePath, function(exists) { - if (!exists) { - return next(null, true); - } - return safefs.stat(filePath, function(err, stat) { - if (err) { - return next(err); - } - return next(null, stat.size === 0); - }); - }); - return this; - }, - isPathOlderThan: function(aPath, bInput, next) { - var bMtime, bPath, mode; - - bMtime = null; - if (typeChecker.isNumber(bInput)) { - mode = 'time'; - bMtime = new Date(new Date() - bInput); - } else { - mode = 'path'; - bPath = bInput; - } - balUtilPaths.empty(aPath, function(err, empty) { - if (empty || err) { - return next(err, null); - } - return safefs.stat(aPath, function(err, aStat) { - var compare; - - if (err) { - return next(err); - } - compare = function() { - var older; - - if (aStat.mtime < bMtime) { - older = true; - } else { - older = false; - } - return next(null, older); - }; - if (mode === 'path') { - return balUtilPaths.empty(bPath, function(err, empty) { - if (empty || err) { - return next(err, null); - } - return safefs.stat(bPath, function(err, bStat) { - if (err) { - return next(err); - } - bMtime = bStat.mtime; - return compare(); - }); - }); - } else { - return compare(); - } - }); - }); - return this; - } -}; - -module.exports = balUtilPaths; diff --git a/deploy/core/node_modules/watchr/node_modules/bal-util/package.json b/deploy/core/node_modules/watchr/node_modules/bal-util/package.json deleted file mode 100755 index 18279509d..000000000 --- a/deploy/core/node_modules/watchr/node_modules/bal-util/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "bal-util", - "version": "2.0.5", - "description": "Common utility functions for Node.js used and maintained by Benjamin Lupton", - "homepage": "https://github.com/balupton/bal-util", - "keywords": [ - "javascript", - "flow", - "control", - "async", - "sync", - "tasks", - "batch", - "utility", - "util", - "utilities", - "paths", - "path", - "events", - "event", - "module", - "modules", - "compare", - "comparison", - "html" - ], - "author": { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "http://balupton.com" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - }, - { - "name": "Sean Fridman", - "email": "fridman@mail.sfsu.edu", - "url": "https://github.com/sfrdmn" - } - ], - "bugs": { - "url": "https://github.com/balupton/bal-util/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/balupton/bal-util.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "ambi": "~2.0.0", - "eachr": "~2.0.2", - "extendr": "~2.0.1", - "safefs": "~3.0.1", - "taskgroup": "~3.1.1", - "typechecker": "~2.0.1" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.2.0", - "joe-reporter-console": "~1.2.0", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/everything-test.js" - }, - "main": "./out/lib/balutil", - "readme": "# Benjamin Lupton's Utility Functions\n\n[![Build Status](https://secure.travis-ci.org/balupton/bal-util.png?branch=master)](http://travis-ci.org/balupton/bal-util)\n[![NPM version](https://badge.fury.io/js/bal-util.png)](https://npmjs.org/package/bal-util)\n[![Flattr this project](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr)\n\nCommon utility functions for Node.js used and maintained by Benjamin Lupton\n\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save bal-util`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org/)\n\n\n\n## Usage\nBest off looking at source, it's well documented, and there are plenty of tests\n\n\n\n## Future\nWe're in the process of abstracting the pieces of bal-util out into their own modules. So far, we've done the following:\n\n- [ambi](https://github.com/bevry/ambi) < `balUtilFlow.fireWithOptionalCallback`\n- [eachr](https://github.com/bevry/eachr) < `balUtilFlow.each`\n- [extendr](https://github.com/bevry/extendr) < `balUtilFlow.(extend|clone|etc)`\n- [getsetdeep](https://github.com/bevry/getsetdeep) < `balUtilFlow.(get|set)Deep`\n- [safeCallback](https://github.com/bevry/safecallback) < `balUtilFlow.safeCallback`\n- [safefs](https://github.com/bevry/safefs) < `balUtilPaths.(openFile|closeFile|etc)`\n- [TaskGroup](https://github.com/bevry/taskgroup) < `balUtilFlow.Group`\n- [typeChecker](https://github.com/bevry/typechecker) < `balUtilTypes`\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/balupton/bal-util/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2011+ [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "bal-util@2.0.5", - "_from": "bal-util@~2.0.0" -} diff --git a/deploy/core/node_modules/watchr/node_modules/eachr/.npmignore b/deploy/core/node_modules/watchr/node_modules/eachr/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/eachr/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/eachr/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/eachr/LICENSE.md deleted file mode 100755 index 49d7c05dc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/eachr/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/eachr/README.md b/deploy/core/node_modules/watchr/node_modules/eachr/README.md deleted file mode 100755 index 53d16e6af..000000000 --- a/deploy/core/node_modules/watchr/node_modules/eachr/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Eachr [![Build Status](https://secure.travis-ci.org/bevry/eachr.png?branch=master)](http://travis-ci.org/bevry/eachr) -Give eachr an array or object, and the iterator, in return eachr will give the iterator the value and key of each item, and will stop if the iterator returned false. - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save eachr` - -### Frontend - -1. [See Browserify](http://browserify.org) - - - -## Usage - -``` javascript -// Prepare -var each = require("."); -var arr = ["first", "second", "third"]; -var obj = {a:"first", b:"second", c:"third"}; -var iterator = function(value,key){ - console.log({value:value, key:key}); - if ( value === "second" ) { - console.log("break"); - return false; - } -}; - -// Cycle Array -each(arr, iterator); -// {"value":"first", "key":0} -// {"value":"second", "key":1} -// break - -// Cycle Object -each(obj, iterator); -// {"value":"first", "key":"a"} -// {"value":"second", "key":"b"} -// break -``` - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/eachr/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/eachr/example.js b/deploy/core/node_modules/watchr/node_modules/eachr/example.js deleted file mode 100644 index 2e1081928..000000000 --- a/deploy/core/node_modules/watchr/node_modules/eachr/example.js +++ /dev/null @@ -1,23 +0,0 @@ -// Prepare -var each = require("./"); -var arr = ["first", "second", "third"]; -var obj = {a:"first", b:"second", c:"third"}; -var iterator = function(value,key){ - console.log({value:value, key:key}); - if ( value === "second" ) { - console.log("break"); - return false; - } -}; - -// Cycle Array -each(arr, iterator); -// {"value":"first", "key":0} -// {"value":"second", "key":1} -// break - -// Cycle Object -each(obj, iterator); -// {"value":"first", "key":"a"} -// {"value":"second", "key":"b"} -// break \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/eachr/out/lib/eachr.js b/deploy/core/node_modules/watchr/node_modules/eachr/out/lib/eachr.js deleted file mode 100644 index 7b448074e..000000000 --- a/deploy/core/node_modules/watchr/node_modules/eachr/out/lib/eachr.js +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var eachr, typeChecker, - __hasProp = {}.hasOwnProperty; - -typeChecker = require('typechecker'); - -eachr = function(subject, callback, context) { - var key, value, _i, _len; - - if (typeChecker.isArray(subject)) { - for (key = _i = 0, _len = subject.length; _i < _len; key = ++_i) { - value = subject[key]; - if (callback.apply(subject, [value, key, subject]) === false) { - break; - } - } - } else { - for (key in subject) { - if (!__hasProp.call(subject, key)) continue; - value = subject[key]; - if (callback.apply(subject, [value, key, subject]) === false) { - break; - } - } - } - return subject; -}; - -module.exports = eachr; diff --git a/deploy/core/node_modules/watchr/node_modules/eachr/package.json b/deploy/core/node_modules/watchr/node_modules/eachr/package.json deleted file mode 100755 index 5b0b4e081..000000000 --- a/deploy/core/node_modules/watchr/node_modules/eachr/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "eachr", - "version": "2.0.2", - "description": "Give eachr an array or object, and the iterator, in return eachr will give the iterator the value and key of each item, and will stop if the iterator returned false.", - "homepage": "https://github.com/bevry/eachr", - "keywords": [ - "flow", - "each", - "cycle" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/eachr/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/eachr.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "typechecker": "~2.0.1" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.1.2", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/eachr-test.js" - }, - "main": "./out/lib/eachr.js", - "readme": "# Eachr [![Build Status](https://secure.travis-ci.org/bevry/eachr.png?branch=master)](http://travis-ci.org/bevry/eachr)\nGive eachr an array or object, and the iterator, in return eachr will give the iterator the value and key of each item, and will stop if the iterator returned false.\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save eachr`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org)\n\n\n\n## Usage\n\n``` javascript\n// Prepare\nvar each = require(\".\");\nvar arr = [\"first\", \"second\", \"third\"];\nvar obj = {a:\"first\", b:\"second\", c:\"third\"};\nvar iterator = function(value,key){\n\tconsole.log({value:value, key:key});\n\tif ( value === \"second\" ) {\n\t\tconsole.log(\"break\");\n\t\treturn false;\n\t}\n};\n\n// Cycle Array\neach(arr, iterator);\n// {\"value\":\"first\", \"key\":0}\n// {\"value\":\"second\", \"key\":1}\n// break\n\n// Cycle Object\neach(obj, iterator);\n// {\"value\":\"first\", \"key\":\"a\"}\n// {\"value\":\"second\", \"key\":\"b\"}\n// break\n```\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/eachr/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "eachr@2.0.2", - "_from": "eachr@~2.0.2" -} diff --git a/deploy/core/node_modules/watchr/node_modules/extendr/.npmignore b/deploy/core/node_modules/watchr/node_modules/extendr/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/extendr/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/extendr/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/extendr/LICENSE.md deleted file mode 100755 index 49d7c05dc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/extendr/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/extendr/README.md b/deploy/core/node_modules/watchr/node_modules/extendr/README.md deleted file mode 100755 index e4f8b0dca..000000000 --- a/deploy/core/node_modules/watchr/node_modules/extendr/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Extendr [![Build Status](https://secure.travis-ci.org/bevry/extendr.png?branch=master)](http://travis-ci.org/bevry/extendr) -Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save extendr` - -### Frontend - -1. [See Browserify](http://browserify.org) - - - -## Usage - -### Example - -``` javascript -// Shallow Clone -(function(){ - var a = {a:1}, b = {b:2} - var c = require('extendr').clone(a,b) - console.log(a) // {a:1} - console.log(b) // {b:2} - console.log(c) // {a:1,b:2} -})() - -// Shallow Extend -(function(){ - var a = {a:1}, b = {b:2} - var c = require('extendr').extend(a,b) - console.log(a) // {a:1,b:2} - console.log(b) // {b:2} - console.log(c) // {a:1,b:2} -})() -``` - -### Methods - -- `clone(args...)` - shallow extend the arguments into a new object, same as `extend({},args...)` -- `deepClone(args...)` - deep extend the arguments into a new object, same as `deepExtend({},args...)` -- `dereference(obj)` - return a copy of the object with all references destroyed, same as serializing then deserializing the object -- `extend(args...)` - alias for `shallowExtendPlainObjects` -- `deepExtend(args...)` - alias for `deepExtendPlainObjects` -- `shallowExtendPlainObjects(target, args...)` - shallow extend the arguments into the target -- `deepExtendPlainObjects(target, args...)` - deep extend the arguments into the target -- `safeShallowExtendPlainObjects(target, objs...)` - shallow extend defined values from the arguments into the target -- `safeDeepExtendPlainObjects(target, args...)` - deep extend defined values from the arguments into the target - -### Explanation - -- Use the clone methods when you don't want to modify your first object -- Use the extend methods when you want to modify the first argument -- Use the dereference method when you want to make sure that nothing has any references to the old object -- Use the safe methods when you don't want `null` and `undefined` values to overwrite a defined values - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/extendr/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/extendr/out/lib/extendr.js b/deploy/core/node_modules/watchr/node_modules/extendr/out/lib/extendr.js deleted file mode 100644 index 61c7e22e7..000000000 --- a/deploy/core/node_modules/watchr/node_modules/extendr/out/lib/extendr.js +++ /dev/null @@ -1,123 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var extendr, typeChecker, - __slice = [].slice, - __hasProp = {}.hasOwnProperty; - -typeChecker = require('typechecker'); - -extendr = { - clone: function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - args.unshift({}); - return this.shallowExtendPlainObjects.apply(this, args); - }, - deepClone: function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - args.unshift({}); - return this.deepExtendPlainObjects.apply(this, args); - }, - extend: function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.shallowExtendPlainObjects.apply(this, args); - }, - deepExtend: function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return this.deepExtendPlainObjects.apply(this, args); - }, - shallowExtendPlainObjects: function() { - var key, obj, objs, target, value, _i, _len; - - target = arguments[0], objs = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - for (_i = 0, _len = objs.length; _i < _len; _i++) { - obj = objs[_i]; - obj || (obj = {}); - for (key in obj) { - if (!__hasProp.call(obj, key)) continue; - value = obj[key]; - target[key] = value; - } - } - return target; - }, - safeShallowExtendPlainObjects: function() { - var key, obj, objs, target, value, _i, _len; - - target = arguments[0], objs = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - for (_i = 0, _len = objs.length; _i < _len; _i++) { - obj = objs[_i]; - obj || (obj = {}); - for (key in obj) { - if (!__hasProp.call(obj, key)) continue; - value = obj[key]; - if (value == null) { - continue; - } - target[key] = value; - } - } - return target; - }, - deepExtendPlainObjects: function() { - var key, obj, objs, target, value, _i, _len; - - target = arguments[0], objs = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - for (_i = 0, _len = objs.length; _i < _len; _i++) { - obj = objs[_i]; - obj || (obj = {}); - for (key in obj) { - if (!__hasProp.call(obj, key)) continue; - value = obj[key]; - if (typeChecker.isPlainObject(value)) { - if (!typeChecker.isPlainObject(target[key])) { - target[key] = {}; - } - this.deepExtendPlainObjects(target[key], value); - } else { - target[key] = value; - } - } - } - return target; - }, - safeDeepExtendPlainObjects: function() { - var key, obj, objs, target, value, _i, _len; - - target = arguments[0], objs = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - for (_i = 0, _len = objs.length; _i < _len; _i++) { - obj = objs[_i]; - obj || (obj = {}); - for (key in obj) { - if (!__hasProp.call(obj, key)) continue; - value = obj[key]; - if (value == null) { - continue; - } - if (typeChecker.isPlainObject(value)) { - if (!typeChecker.isPlainObject(target[key])) { - target[key] = {}; - } - this.safeDeepExtendPlainObjects(target[key], value); - } else { - target[key] = value; - } - } - } - return target; - }, - dereference: function(source) { - var target; - - target = JSON.parse(JSON.stringify(source)); - return target; - } -}; - -module.exports = extendr; diff --git a/deploy/core/node_modules/watchr/node_modules/extendr/package.json b/deploy/core/node_modules/watchr/node_modules/extendr/package.json deleted file mode 100755 index 902af34e9..000000000 --- a/deploy/core/node_modules/watchr/node_modules/extendr/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "extendr", - "version": "2.0.1", - "description": "Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways", - "homepage": "https://github.com/bevry/extendr", - "keywords": [ - "extend", - "deepExtend", - "shallowExtend", - "safeExtend", - "clone", - "deepClone", - "dereference" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/extendr/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/extendr.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "typechecker": "~2.0.1" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.1.2" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/extendr-test.js" - }, - "main": "./out/lib/extendr.js", - "readme": "# Extendr [![Build Status](https://secure.travis-ci.org/bevry/extendr.png?branch=master)](http://travis-ci.org/bevry/extendr)\nUtilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save extendr`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org)\n\n\n\n## Usage\n\n### Example\n\n``` javascript\n// Shallow Clone\n(function(){\n\tvar a = {a:1}, b = {b:2}\n\tvar c = require('extendr').clone(a,b)\n\tconsole.log(a) // {a:1}\n\tconsole.log(b) // {b:2}\n\tconsole.log(c) // {a:1,b:2}\n})()\n\n// Shallow Extend\n(function(){\n\tvar a = {a:1}, b = {b:2}\n\tvar c = require('extendr').extend(a,b)\n\tconsole.log(a) // {a:1,b:2}\n\tconsole.log(b) // {b:2}\n\tconsole.log(c) // {a:1,b:2}\n})()\n```\n\n### Methods\n\n- `clone(args...)` - shallow extend the arguments into a new object, same as `extend({},args...)`\n- `deepClone(args...)` - deep extend the arguments into a new object, same as `deepExtend({},args...)`\n- `dereference(obj)` - return a copy of the object with all references destroyed, same as serializing then deserializing the object\n- `extend(args...)` - alias for `shallowExtendPlainObjects`\n- `deepExtend(args...)` - alias for `deepExtendPlainObjects`\n- `shallowExtendPlainObjects(target, args...)` - shallow extend the arguments into the target\n- `deepExtendPlainObjects(target, args...)` - deep extend the arguments into the target\n- `safeShallowExtendPlainObjects(target, objs...)` - shallow extend defined values from the arguments into the target\n- `safeDeepExtendPlainObjects(target, args...)` - deep extend defined values from the arguments into the target\n\n### Explanation\n\n- Use the clone methods when you don't want to modify your first object\n- Use the extend methods when you want to modify the first argument\n- Use the dereference method when you want to make sure that nothing has any references to the old object\n- Use the safe methods when you don't want `null` and `undefined` values to overwrite a defined values\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/extendr/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "extendr@2.0.1", - "_from": "extendr@~2.0.1" -} diff --git a/deploy/core/node_modules/watchr/node_modules/safefs/.npmignore b/deploy/core/node_modules/watchr/node_modules/safefs/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/safefs/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/safefs/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/safefs/LICENSE.md deleted file mode 100755 index 49d7c05dc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/safefs/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/safefs/README.md b/deploy/core/node_modules/watchr/node_modules/safefs/README.md deleted file mode 100755 index 26f756bd5..000000000 --- a/deploy/core/node_modules/watchr/node_modules/safefs/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Safe FS - -[![Build Status](https://secure.travis-ci.org/bevry/safefs.png?branch=master)](http://travis-ci.org/bevry/safefs) -[![NPM version](https://badge.fury.io/js/safefs.png)](https://npmjs.org/package/safefs) - -Stop getting EMFILE errors! Open only as many files as the operating system supports. - - - -## Install - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save safefs` - - - -## Usage - -``` javascript -var safefs = require('safefs'); -``` - -The following [file system](http://nodejs.org/docs/latest/api/all.html#all_file_system) methods are available (but wrapped in safe way to prevent EMFILE errors): - -- `readFile(path, options?, next)` -- `writeFile(path, data, options?, next)` - will also attempt to ensure the path exists -- `appendFile(path, data, options?, next)` - will also attempt to ensure the path exists -- `mkdir(path, mode?, next)` - mode defaults to `0o777 & (~process.umask())` -- `stat(path, next)` -- `readdir(path, next)` -- `unlink(path, next)` -- `rmdir(path, next)` -- `exists(path, next)` - -For other file system interaction, you can do the following: - -``` javascript -// get a slot in the file system queue -require('safefs').openFile(function(closeFile){ - // do our file system interaction - require('fs').someOtherMethod(a,b,c,function(err,a,b,c){ - // close the slot we are using in the file system queue - closeFile(); - }); -}); -``` - -To make this possible we define a global variable called `safefsGlobal` that manages the available slots for interacting with the file system. - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/safefs/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/safefs/out/lib/safefs.js b/deploy/core/node_modules/watchr/node_modules/safefs/out/lib/safefs.js deleted file mode 100644 index 72b7fb0ae..000000000 --- a/deploy/core/node_modules/watchr/node_modules/safefs/out/lib/safefs.js +++ /dev/null @@ -1,195 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var TaskGroup, fsUtil, pathUtil, safefs, _base, _ref, _ref1, _ref2; - -fsUtil = require('fs'); - -pathUtil = require('path'); - -TaskGroup = require('taskgroup').TaskGroup; - -if ((_ref = global.safefsGlobal) == null) { - global.safefsGlobal = {}; -} - -if ((_ref1 = (_base = global.safefsGlobal).pool) == null) { - _base.pool = new TaskGroup().setConfig({ - concurrency: (_ref2 = process.env.NODE_MAX_OPEN_FILES) != null ? _ref2 : 100, - pauseOnError: false - }).run(); -} - -safefs = { - openFile: function(fn) { - global.safefsGlobal.pool.addTask(fn); - return safefs; - }, - closeFile: function() { - console.log('safefs.closeFile has been deprecated, please use the safefs.openFile completion callback to close files'); - return safefs; - }, - getParentPathSync: function(p) { - var parentPath; - - parentPath = p.replace(/[\/\\]$/, '').replace(/[\/\\][^\/\\]+$/, ''); - return parentPath; - }, - ensurePath: function(path, options, next) { - var _ref3; - - if (next == null) { - next = options; - options = null; - } - if (options == null) { - options = {}; - } - if ((_ref3 = options.mode) == null) { - options.mode = null; - } - safefs.exists(path, function(exists) { - var parentPath; - - if (exists) { - return next(null, true); - } - parentPath = safefs.getParentPathSync(path); - return safefs.ensurePath(parentPath, options, function(err) { - if (err) { - return next(err, false); - } - return safefs.mkdir(path, options.mode, function(err) { - return safefs.exists(path, function(exists) { - if (!exists) { - err = new Error("Failed to create the directory: " + path); - return next(err, false); - } - return next(null, false); - }); - }); - }); - }); - return safefs; - }, - readFile: function(path, options, next) { - if (next == null) { - next = options; - options = null; - } - safefs.openFile(function(closeFile) { - return fsUtil.readFile(path, options, function(err, data) { - closeFile(); - return next(err, data); - }); - }); - return safefs; - }, - writeFile: function(path, data, options, next) { - if (next == null) { - next = options; - options = null; - } - safefs.ensurePath(pathUtil.dirname(path), options, function(err) { - if (err) { - return next(err); - } - return safefs.openFile(function(closeFile) { - return fsUtil.writeFile(path, data, options, function(err) { - closeFile(); - return next(err); - }); - }); - }); - return safefs; - }, - appendFile: function(path, data, options, next) { - if (next == null) { - next = options; - options = null; - } - safefs.ensurePath(pathUtil.dirname(path), options, function(err) { - if (err) { - return next(err); - } - return safefs.openFile(function(closeFile) { - return fsUtil.appendFile(path, data, options, function(err) { - closeFile(); - return next(err); - }); - }); - }); - return safefs; - }, - mkdir: function(path, mode, next) { - if (next == null) { - next = mode; - mode = null; - } - if (mode == null) { - mode = 0x1ff & (~process.umask()); - } - safefs.openFile(function(closeFile) { - return fsUtil.mkdir(path, mode, function(err) { - closeFile(); - return next(err); - }); - }); - return safefs; - }, - stat: function(path, next) { - safefs.openFile(function(closeFile) { - return fsUtil.stat(path, function(err, stat) { - closeFile(); - return next(err, stat); - }); - }); - return safefs; - }, - readdir: function(path, next) { - safefs.openFile(function(closeFile) { - return fsUtil.readdir(path, function(err, files) { - closeFile(); - return next(err, files); - }); - }); - return safefs; - }, - unlink: function(path, next) { - safefs.openFile(function(closeFile) { - return fsUtil.unlink(path, function(err) { - closeFile(); - return next(err); - }); - }); - return safefs; - }, - rmdir: function(path, next) { - safefs.openFile(function(closeFile) { - return fsUtil.rmdir(path, function(err) { - closeFile(); - return next(err); - }); - }); - return safefs; - }, - exists: function(path, next) { - var exists; - - exists = fsUtil.exists || pathUtil.exists; - safefs.openFile(function(closeFile) { - return exists(path, function(exists) { - closeFile(); - return next(exists); - }); - }); - return safefs; - }, - existsSync: function(path) { - var existsSync, result; - - existsSync = fsUtil.existsSync || pathUtil.existsSync; - result = existsSync(path); - return result; - } -}; - -module.exports = safefs; diff --git a/deploy/core/node_modules/watchr/node_modules/safefs/package.json b/deploy/core/node_modules/watchr/node_modules/safefs/package.json deleted file mode 100755 index 95adcdefc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/safefs/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "safefs", - "version": "3.0.1", - "description": "Stop getting EMFILE errors! Open only as many files as the operating system supports.", - "homepage": "https://github.com/bevry/safefs", - "keywords": [ - "fs", - "path", - "openFile", - "closeFile", - "emfile" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/safefs/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/safefs.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "taskgroup": ">=3 <3.2" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.2.0", - "joe-reporter-console": "~1.2.1", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/safefs-test.js" - }, - "main": "./out/lib/safefs.js", - "readme": "# Safe FS\n\n[![Build Status](https://secure.travis-ci.org/bevry/safefs.png?branch=master)](http://travis-ci.org/bevry/safefs)\n[![NPM version](https://badge.fury.io/js/safefs.png)](https://npmjs.org/package/safefs)\n\nStop getting EMFILE errors! Open only as many files as the operating system supports.\n\n\n\n## Install\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save safefs`\n\n\n\n## Usage\n\n``` javascript\nvar safefs = require('safefs');\n```\n\nThe following [file system](http://nodejs.org/docs/latest/api/all.html#all_file_system) methods are available (but wrapped in safe way to prevent EMFILE errors):\n\n- `readFile(path, options?, next)`\n- `writeFile(path, data, options?, next)` - will also attempt to ensure the path exists\n- `appendFile(path, data, options?, next)` - will also attempt to ensure the path exists\n- `mkdir(path, mode?, next)` - mode defaults to `0o777 & (~process.umask())`\n- `stat(path, next)`\n- `readdir(path, next)`\n- `unlink(path, next)`\n- `rmdir(path, next)`\n- `exists(path, next)`\n\nFor other file system interaction, you can do the following:\n\n``` javascript\n// get a slot in the file system queue\nrequire('safefs').openFile(function(closeFile){\n\t// do our file system interaction\n\trequire('fs').someOtherMethod(a,b,c,function(err,a,b,c){\n\t\t// close the slot we are using in the file system queue\n\t\tcloseFile();\n\t});\n});\n```\n\nTo make this possible we define a global variable called `safefsGlobal` that manages the available slots for interacting with the file system.\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/safefs/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "safefs@3.0.1", - "_from": "safefs@~3.0.1" -} diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/.npmignore b/deploy/core/node_modules/watchr/node_modules/taskgroup/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/taskgroup/LICENSE.md deleted file mode 100755 index 49d7c05dc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/README.md b/deploy/core/node_modules/watchr/node_modules/taskgroup/README.md deleted file mode 100755 index 2d5ae0d8f..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/README.md +++ /dev/null @@ -1,156 +0,0 @@ -# Task Group - -[![Build Status](https://secure.travis-ci.org/bevry/taskgroup.png?branch=master)](http://travis-ci.org/bevry/taskgroup) -[![NPM version](https://badge.fury.io/js/taskgroup.png)](https://npmjs.org/package/taskgroup) - -Group together synchronous and asynchronous tasks and execute them with support for concurrency, naming, and nesting. - - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save taskgroup` - -### Frontend - -1. [See Browserify](http://browserify.org/) - - - -## Usage - -### Example - -``` javascript -// Import -var TaskGroup = require('taskgroup').TaskGroup; - -// Create our new group -var group = new TaskGroup(); - -// Define what should happen once the group has completed -group.once('complete', function(err,results){ - // Log the error that has occured - console.log(err); - // => null - - // Log the results that our group received from the executing items - console.log(JSON.stringify(results)); - /* => - [ - [null, 'first', 'task'], - [null, 'second task'], - [null, [ - [null, 'sub second task'], - [null, 'sub first', 'task'] - ]] - ] - */ -}); - -// Add an asynchronous task that gives the result to the completion callback -group.addTask(function(complete){ - setTimeout(function(){ - complete(null, 'first', 'task'); - },500); -}); - -// Add a synchronous task that returns the result -// Errors should be returned, though if an error is thrown we will catch it -group.addTask(function(){ - return 'second task'; -}); - -// Add a sub-group to our exiting group -group.addGroup(function(addGroup,addTask){ - // Tell this sub-group to execute in parallel (all at once) by setting its concurrency to unlimited - // by default the concurrency for all groups is set to 1 - // which means that they execute in serial fashion (one after the other, instead of all at once) - this.setConfig({concurrency:0}); - - // Add an asynchronous task that gives its result to the completion callback - addTask(function(complete){ - setTimeout(function(){ - complete(null, 'sub first', 'task'); - },500); - }); - - // Add a synchronous task that returns its result - addTask(function(){ - return 'sub second task'; - }); -}); - -// Execute our group -group.run(); -``` - -### TaskGroup API - -``` javascript -new require('taskgroup').TaskGroup() -``` - -- Available methods: - - `constructor(name?,fn?)` - create our new group, the arguments `name` and `fn` are optional, refer to their entries in configuration - - `setConfig(config)` - set the configuration for the group, returns chain - - `addTask(args...)` - create a new task item with the arguments and adds it to the group, returns the new task item - - `addGroup(args...)` - create a new group item with the arguments and adds it to the group, returns the new group item - - `getTotals()` - returns counts for the following `{running,remaining,completed,total}` - - `clear()` - remove the remaining items to be executed - - `pause()` - pause the execution of the items - - `stop()` - clear and pause - - `exit(err)` - stop and complete, `err` if specified is sent to the completion event when fired - - `complete()` - will fire the completion event if we are already complete, useful if you're binding your listeners after run - - `run()` - start/resume executing the items, returns chain - - All those of [EventEmitter2](https://github.com/hij1nx/EventEmitter2) -- Available configuration: - - `name`, no default - allows us to assign a name to the group, useful for debugging - - `fn(addGroup,addTask,complete?)`, no default - allows us to use an inline and self-executing style for defining groups, useful for nesting - - `concurrency`, defaults to `1` - how many items shall we allow to be run at the same time, set to `0` to allow unlimited - - `pauseOnError`, defaults to `true` - if an error occurs in one of our items, should we stop executing any remaining items? - - setting to `false` will continue with execution with the other items even if an item experiences an error -- Available events: - - `run()` - fired just before we execute the items - - `complete(err, results)` - fired when all our items have completed - - `task.run(task)` - fired just before a task item executes - - `task.complete(task, err, args...)` - fired when a task item has completed - - `group.run(group)` - fired just before a group item executes - - `group.complete(group, err, results)` - fired when a group item has completed - - `item.run(item)` - fired just before an item executes (fired for both sub-tasks and sub-groups) - - `item.complete(item, err, args...)` - fired when an item has completed (fired for both sub-task and sub-groups) - - -### Task API - -``` javascript -new require('taskgroup').Task() -``` - -- Available methods: - - `constructor(name?,fn?)` - create our new task, the arguments `name` and `fn` are optional though `fn` must be set at some point, refer to their entries in configuration - - `setConfig(config)` - set the configuration for the group, returns chain - - `complete()` - will fire the completion event if we are already complete, useful if you're binding your listeners after run - - `run()` - execute the task -- Available configuration: - - `name`, no default - allows us to assign a name to the group, useful for debugging - - `fn(complete?)`, no default - must be set at some point, it is the function to execute for the task, if it is asynchronous it should use the completion callback provided - - `args`, no default - an array of arguments that you would like to precede the completion callback when executing `fn` -- Available events: - - `run()` - fired just before we execute the task - - `complete(err, args...)` - fired when the task has completed - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/taskgroup/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/example.js b/deploy/core/node_modules/watchr/node_modules/taskgroup/example.js deleted file mode 100644 index 3262b369c..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/example.js +++ /dev/null @@ -1,61 +0,0 @@ -// Import -var TaskGroup = require('./').TaskGroup; - -// Create our new group -var group = new TaskGroup(); - -// Define what should happen once the group has completed -group.once('complete', function(err,results){ - // Log the error that has occured - console.log(err); - // => null - - // Log the results that our group received from the executing items - console.log(JSON.stringify(results)); - /* => - [ - [null, 'first', 'task'], - [null, 'second task'], - [null, [ - [null, 'sub second task'], - [null, 'sub first', 'task'] - ]] - ] - */ -}); - -// Add an asynchronous task that gives the result to the completion callback -group.addTask(function(complete){ - setTimeout(function(){ - complete(null, 'first', 'task'); - },500); -}); - -// Add a synchronous task that returns the result -// Errors should be returned, though if an error is thrown we will catch it -group.addTask(function(){ - return 'second task'; -}); - -// Add a sub-group to our exiting group -group.addGroup(function(addGroup,addTask){ - // Tell this sub-group to execute in parallel (all at once) by setting its concurrency to unlimited - // by default the concurrency for all groups is set to 1 - // which means that they execute in serial fashion (one after the other, instead of all at once) - this.setConfig({concurrency:0}); - - // Add an asynchronous task that gives its result to the completion callback - addTask(function(complete){ - setTimeout(function(){ - complete(null, 'sub first', 'task'); - },500); - }); - - // Add a synchronous task that returns its result - addTask(function(){ - return 'sub second task'; - }); -}); - -// Execute our group -group.run(); \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/.npmignore b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/LICENSE.md deleted file mode 100755 index 49d7c05dc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/README.md b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/README.md deleted file mode 100755 index 35e5219a0..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Ambi [![Build Status](https://secure.travis-ci.org/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi) -Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). -Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically). - - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save ambi` - -### Frontend - -1. [See Browserify](http://browserify.org) - - - -## Usage - -``` javascript -// Import -var ambi = require('ambi') -var result - -// Sample methods -var syncMethod = function(x,y){ - return x*y -} -var asyncMethod = function(x,y,next){ - return setTimeout(function(){ - next(null,x*y) - },0) -} - -// Call the synchronous function asynchronously -result = ambi(syncMethod, 5, 2, function(err,result){ // ambi adds support for this asynchronous callback automatically - console.log(err, result) // null, 10 -}) -console.log(result) // 10 - just like normal - -// Call the asynchronous function asynchronously -result = ambi(asyncMethod, 5, 2, function(err,result){ // ambi doesn't do anything special here - console.log(err, result) // null, 10 -}) -console.log(result) // setTimeout - just like normal -``` - - - -## Process - -- Ambi accepts the arguments `(method, args...)` - - `method` is the function to execute - - `args...` is the arguments to send to the method - - the last argument is expected to be the completion callback - - the completion callback is optional, but if defined, is expected to have the signature of `(err, results...)` -- If the method has the same amount of arguments as those ambi received, then we assume it is an asynchronous method and let it handle calling of the completion callback itself -- If the method does not have the same amount of arguments as those ambi received, then we assume it is a synchronous method and we'll call the completion callback ourselves - - If the synchronous method throws an error or returns an error, we'll try to call the completion callback with a single `err` argument - - If the synchronous method executes without error, we'll try to call the completion callback with a `err` argument equal to null, and a `result` argument equal to the returned result of the synchronous method -- Ambi can also introspect a different method than the one it fires, by passing `[methodToFire, methodToIntrospect]` as the `method` argument - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/ambi/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/out/lib/ambi.js b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/out/lib/ambi.js deleted file mode 100644 index 25da1c05d..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/out/lib/ambi.js +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var ambi, typeChecker, - __slice = [].slice; - -typeChecker = require('typechecker'); - -ambi = function() { - var args, callback, caughtError, err, fireMethod, introspectMethod, method, result; - - method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - callback = args[args.length - 1]; - result = null; - err = null; - if (typeChecker.isArray(method)) { - fireMethod = method[0], introspectMethod = method[1]; - } else { - fireMethod = introspectMethod = method; - } - if (introspectMethod.length === args.length) { - try { - result = fireMethod.apply(null, args); - if (typeChecker.isError(result)) { - err = result; - } - } catch (_error) { - caughtError = _error; - err = caughtError; - } - if (err) { - if (typeof callback === "function") { - callback(err); - } - } - } else { - try { - result = fireMethod.apply(null, args); - if (typeChecker.isError(result)) { - err = result; - } - } catch (_error) { - caughtError = _error; - err = caughtError; - } - if (err) { - if (typeof callback === "function") { - callback(err); - } - } else { - if (typeof callback === "function") { - callback(null, result); - } - } - } - return err || result; -}; - -module.exports = ambi; diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/package.json b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/package.json deleted file mode 100755 index 8721d316f..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/ambi/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "ambi", - "version": "2.0.0", - "description": "Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).", - "homepage": "https://github.com/bevry/ambi", - "keywords": [ - "sync", - "async", - "fire", - "exec", - "execute", - "ambidextrous" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/ambi/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/ambi.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "typechecker": "~2.0.1" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.1.2", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/ambi-test.js" - }, - "main": "./out/lib/ambi.js", - "readme": "# Ambi [![Build Status](https://secure.travis-ci.org/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi)\nExecute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions).\nUseful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).\n\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save ambi`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org)\n\n\n\n## Usage\n\n``` javascript\n// Import\nvar ambi = require('ambi')\nvar result\n\n// Sample methods\nvar syncMethod = function(x,y){\n\treturn x*y\n}\nvar asyncMethod = function(x,y,next){\n\treturn setTimeout(function(){\n\t\tnext(null,x*y)\n\t},0)\n}\n\n// Call the synchronous function asynchronously\nresult = ambi(syncMethod, 5, 2, function(err,result){ // ambi adds support for this asynchronous callback automatically\n\tconsole.log(err, result) // null, 10\n})\nconsole.log(result) // 10 - just like normal\n\n// Call the asynchronous function asynchronously\nresult = ambi(asyncMethod, 5, 2, function(err,result){ // ambi doesn't do anything special here\n\tconsole.log(err, result) // null, 10\n})\nconsole.log(result) // setTimeout - just like normal\n```\n\n\n\n## Process\n\n- Ambi accepts the arguments `(method, args...)`\n\t- `method` is the function to execute\n\t- `args...` is the arguments to send to the method\n\t\t- the last argument is expected to be the completion callback\n\t\t- the completion callback is optional, but if defined, is expected to have the signature of `(err, results...)`\n- If the method has the same amount of arguments as those ambi received, then we assume it is an asynchronous method and let it handle calling of the completion callback itself\n- If the method does not have the same amount of arguments as those ambi received, then we assume it is a synchronous method and we'll call the completion callback ourselves\n\t- If the synchronous method throws an error or returns an error, we'll try to call the completion callback with a single `err` argument\n\t- If the synchronous method executes without error, we'll try to call the completion callback with a `err` argument equal to null, and a `result` argument equal to the returned result of the synchronous method\n- Ambi can also introspect a different method than the one it fires, by passing `[methodToFire, methodToIntrospect]` as the `method` argument\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/ambi/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "ambi@2.0.0", - "_from": "ambi@~2.0.0" -} diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/README.md b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/README.md deleted file mode 100644 index 9501fa3f3..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# EventEmitter2 - -EventEmitter2 is an implementation of the EventEmitter found in Node.js - -## Features - - - Namespaces/Wildcards. - - Times To Listen (TTL), extends the `once` concept with `many`. - - Browser environment compatibility. - - Demonstrates good performance in benchmarks - -``` -EventEmitterHeatUp x 3,728,965 ops/sec \302\2610.68% (60 runs sampled) -EventEmitter x 2,822,904 ops/sec \302\2610.74% (63 runs sampled) -EventEmitter2 x 7,251,227 ops/sec \302\2610.55% (58 runs sampled) -EventEmitter2 (wild) x 3,220,268 ops/sec \302\2610.44% (65 runs sampled) -Fastest is EventEmitter2 -``` - -## Differences (Non breaking, compatible with existing EventEmitter) - - - The constructor takes a configuration object. - -```javascript - var EventEmitter2 = require('eventemitter2').EventEmitter2; - var server = new EventEmitter2({ - wildcard: true, // should the event emitter use wildcards. - delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`. - newListener: false, // if you want to emit the newListener event set to true. - maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10. - }); -``` - - - Getting the actual event that fired. - -```javascript - server.on('foo.*', function(value1, value2) { - console.log(this.event, value1, value2); - }); -``` - - - Fire an event N times and then remove it, an extension of the `once` concept. - -```javascript - server.many('foo', 4, function() { - console.log('hello'); - }); -``` - - - Pass in a namespaced event as an array rather than a delimited string. - -```javascript - server.many(['foo', 'bar', 'bazz'], function() { - console.log('hello'); - }); -``` - - -## API - -When an `EventEmitter` instance experiences an error, the typical action is -to emit an `error` event. Error events are treated as a special case. -If there is no listener for it, then the default action is to print a stack -trace and exit the program. - -All EventEmitters emit the event `newListener` when new listeners are -added. - - -**Namespaces** with **Wildcards** -To use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor. -When namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated -by a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a -constructor option. - -An event name passed to any event emitter method can contain a wild card (the `*` character). -If the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, -the wildcard may appear as `['foo', '*']`. - -If either of the above described events were passed to the `on` method, subsequent emits such -as the following would be observed... - -```javascript - emitter.emit('foo.bazz'); - emitter.emit(['foo', 'bar']); -``` - - -#### emitter.addListener(event, listener) -#### emitter.on(event, listener) - -Adds a listener to the end of the listeners array for the specified event. - -```javascript - server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) { - console.log('The event was raised!'); - }); -``` - -```javascript - server.on('data', function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.onAny(listener) - -Adds a listener that will be fired when any event is emitted. - -```javascript - server.onAny(function(value) { - console.log('All events trigger this.'); - }); -``` - -#### emitter.offAny(listener) - -Removes the listener that will be fired when any event is emitted. - -```javascript - server.offAny(function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.once(event, listener) - -Adds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.once('get', function (value) { - console.log('Ah, we have our first value!'); - }); -``` - -#### emitter.many(event, timesToListen, listener) - -Adds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.many('get', 4, function (value) { - console.log('This event will be listened to exactly four times.'); - }); -``` - - -#### emitter.removeListener(event, listener) -#### emitter.off(event, listener) - -Remove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener. - -```javascript - var callback = function(value) { - console.log('someone connected!'); - }; - server.on('get', callback); - // ... - server.removeListener('get', callback); -``` - - -#### emitter.removeAllListeners([event]) - -Removes all listeners, or those of the specified event. - - -#### emitter.setMaxListeners(n) - -By default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. - - -#### emitter.listeners(event) - -Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.on('get', function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listeners('get')); // [ [Function] ] -``` - -#### emitter.listenersAny() - -Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.onAny(function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected! -``` - -#### emitter.emit(event, [arg1], [arg2], [...]) - -Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. - -## Test coverage - -There is a test suite that tries to cover each use case, it can be found
    here. - -## Licence - -(The MIT License) - -Copyright (c) 2011 hij1nx - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/index.js b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/index.js deleted file mode 100644 index 6f583b5f6..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/eventemitter2'); diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/lib/eventemitter2.js b/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/lib/eventemitter2.js deleted file mode 100644 index dc9849ec5..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/node_modules/eventemitter2/lib/eventemitter2.js +++ /dev/null @@ -1,561 +0,0 @@ -;!function(exports, undefined) { - - var isArray = Array.isArray ? Array.isArray : function _isArray(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - var defaultMaxListeners = 10; - - function init() { - this._events = {}; - if (this._conf) { - configure.call(this, this._conf); - } - } - - function configure(conf) { - if (conf) { - - this._conf = conf; - - conf.delimiter && (this.delimiter = conf.delimiter); - conf.maxListeners && (this._events.maxListeners = conf.maxListeners); - conf.wildcard && (this.wildcard = conf.wildcard); - conf.newListener && (this.newListener = conf.newListener); - - if (this.wildcard) { - this.listenerTree = {}; - } - } - } - - function EventEmitter(conf) { - this._events = {}; - this.newListener = false; - configure.call(this, conf); - } - - // - // Attention, function return type now is array, always ! - // It has zero elements if no any matches found and one or more - // elements (leafs) if there are matches - // - function searchListenerTree(handlers, type, tree, i) { - if (!tree) { - return []; - } - var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached, - typeLength = type.length, currentType = type[i], nextType = type[i+1]; - if (i === typeLength && tree._listeners) { - // - // If at the end of the event(s) list and the tree has listeners - // invoke those listeners. - // - if (typeof tree._listeners === 'function') { - handlers && handlers.push(tree._listeners); - return [tree]; - } else { - for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) { - handlers && handlers.push(tree._listeners[leaf]); - } - return [tree]; - } - } - - if ((currentType === '*' || currentType === '**') || tree[currentType]) { - // - // If the event emitted is '*' at this part - // or there is a concrete match at this patch - // - if (currentType === '*') { - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1)); - } - } - return listeners; - } else if(currentType === '**') { - endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*')); - if(endReached && tree._listeners) { - // The next element has a _listeners, add it to the handlers. - listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength)); - } - - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - if(branch === '*' || branch === '**') { - if(tree[branch]._listeners && !endReached) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength)); - } - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } else if(branch === nextType) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2)); - } else { - // No match on this one, shift into the tree but not in the type array. - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } - } - } - return listeners; - } - - listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1)); - } - - xTree = tree['*']; - if (xTree) { - // - // If the listener tree will allow any match for this part, - // then recursively explore all branches of the tree - // - searchListenerTree(handlers, type, xTree, i+1); - } - - xxTree = tree['**']; - if(xxTree) { - if(i < typeLength) { - if(xxTree._listeners) { - // If we have a listener on a '**', it will catch all, so add its handler. - searchListenerTree(handlers, type, xxTree, typeLength); - } - - // Build arrays of matching next branches and others. - for(branch in xxTree) { - if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) { - if(branch === nextType) { - // We know the next element will match, so jump twice. - searchListenerTree(handlers, type, xxTree[branch], i+2); - } else if(branch === currentType) { - // Current node matches, move into the tree. - searchListenerTree(handlers, type, xxTree[branch], i+1); - } else { - isolatedBranch = {}; - isolatedBranch[branch] = xxTree[branch]; - searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1); - } - } - } - } else if(xxTree._listeners) { - // We have reached the end and still on a '**' - searchListenerTree(handlers, type, xxTree, typeLength); - } else if(xxTree['*'] && xxTree['*']._listeners) { - searchListenerTree(handlers, type, xxTree['*'], typeLength); - } - } - - return listeners; - } - - function growListenerTree(type, listener) { - - type = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - - // - // Looks for two consecutive '**', if so, don't add the event at all. - // - for(var i = 0, len = type.length; i+1 < len; i++) { - if(type[i] === '**' && type[i+1] === '**') { - return; - } - } - - var tree = this.listenerTree; - var name = type.shift(); - - while (name) { - - if (!tree[name]) { - tree[name] = {}; - } - - tree = tree[name]; - - if (type.length === 0) { - - if (!tree._listeners) { - tree._listeners = listener; - } - else if(typeof tree._listeners === 'function') { - tree._listeners = [tree._listeners, listener]; - } - else if (isArray(tree._listeners)) { - - tree._listeners.push(listener); - - if (!tree._listeners.warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && tree._listeners.length > m) { - - tree._listeners.warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - tree._listeners.length); - console.trace(); - } - } - } - return true; - } - name = type.shift(); - } - return true; - } - - // By default EventEmitters will print a warning if more than - // 10 listeners are added to it. This is a useful default which - // helps finding memory leaks. - // - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - - EventEmitter.prototype.delimiter = '.'; - - EventEmitter.prototype.setMaxListeners = function(n) { - this._events || init.call(this); - this._events.maxListeners = n; - if (!this._conf) this._conf = {}; - this._conf.maxListeners = n; - }; - - EventEmitter.prototype.event = ''; - - EventEmitter.prototype.once = function(event, fn) { - this.many(event, 1, fn); - return this; - }; - - EventEmitter.prototype.many = function(event, ttl, fn) { - var self = this; - - if (typeof fn !== 'function') { - throw new Error('many only accepts instances of Function'); - } - - function listener() { - if (--ttl === 0) { - self.off(event, listener); - } - fn.apply(this, arguments); - } - - listener._origin = fn; - - this.on(event, listener); - - return self; - }; - - EventEmitter.prototype.emit = function() { - - this._events || init.call(this); - - var type = arguments[0]; - - if (type === 'newListener' && !this.newListener) { - if (!this._events.newListener) { return false; } - } - - // Loop through the *_all* functions and invoke them. - if (this._all) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - for (i = 0, l = this._all.length; i < l; i++) { - this.event = type; - this._all[i].apply(this, args); - } - } - - // If there is no 'error' event listener then throw. - if (type === 'error') { - - if (!this._all && - !this._events.error && - !(this.wildcard && this.listenerTree.error)) { - - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - var handler; - - if(this.wildcard) { - handler = []; - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - searchListenerTree.call(this, handler, ns, this.listenerTree, 0); - } - else { - handler = this._events[type]; - } - - if (typeof handler === 'function') { - this.event = type; - if (arguments.length === 1) { - handler.call(this); - } - else if (arguments.length > 1) - switch (arguments.length) { - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - handler.apply(this, args); - } - return true; - } - else if (handler) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - this.event = type; - listeners[i].apply(this, args); - } - return (listeners.length > 0) || this._all; - } - else { - return this._all; - } - - }; - - EventEmitter.prototype.on = function(type, listener) { - - if (typeof type === 'function') { - this.onAny(type); - return this; - } - - if (typeof listener !== 'function') { - throw new Error('on only accepts instances of Function'); - } - this._events || init.call(this); - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if(this.wildcard) { - growListenerTree.call(this, type, listener); - return this; - } - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } - else if(typeof this._events[type] === 'function') { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - else if (isArray(this._events[type])) { - // If we've already got an array, just append. - this._events[type].push(listener); - - // Check for listener leak - if (!this._events[type].warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && this._events[type].length > m) { - - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - } - return this; - }; - - EventEmitter.prototype.onAny = function(fn) { - - if(!this._all) { - this._all = []; - } - - if (typeof fn !== 'function') { - throw new Error('onAny only accepts instances of Function'); - } - - // Add the function to the event listener collection. - this._all.push(fn); - return this; - }; - - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - EventEmitter.prototype.off = function(type, listener) { - if (typeof listener !== 'function') { - throw new Error('removeListener only takes instances of Function'); - } - - var handlers,leafs=[]; - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - } - else { - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events[type]) return this; - handlers = this._events[type]; - leafs.push({_listeners:handlers}); - } - - for (var iLeaf=0; iLeaf 0) { - fns = this._all; - for(i = 0, l = fns.length; i < l; i++) { - if(fn === fns[i]) { - fns.splice(i, 1); - return this; - } - } - } else { - this._all = []; - } - return this; - }; - - EventEmitter.prototype.removeListener = EventEmitter.prototype.off; - - EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - !this._events || init.call(this); - return this; - } - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - var leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - - for (var iLeaf=0; iLeaf= 0.2.2" - }, - "main": "./lib/eventemitter2.js", - "scripts": { - "test": "nodeunit test/simple/ && nodeunit test/wildcardEvents/", - "benchmark": "node test/perf/benchmark.js" - }, - "files": [ - "lib/eventemitter2.js", - "index.js" - ], - "readme": "# EventEmitter2\n\nEventEmitter2 is an implementation of the EventEmitter found in Node.js\n\n## Features\n\n - Namespaces/Wildcards.\n - Times To Listen (TTL), extends the `once` concept with `many`.\n - Browser environment compatibility.\n - Demonstrates good performance in benchmarks\n\n```\nEventEmitterHeatUp x 3,728,965 ops/sec \\302\\2610.68% (60 runs sampled)\nEventEmitter x 2,822,904 ops/sec \\302\\2610.74% (63 runs sampled)\nEventEmitter2 x 7,251,227 ops/sec \\302\\2610.55% (58 runs sampled)\nEventEmitter2 (wild) x 3,220,268 ops/sec \\302\\2610.44% (65 runs sampled)\nFastest is EventEmitter2\n```\n\n## Differences (Non breaking, compatible with existing EventEmitter)\n\n - The constructor takes a configuration object.\n \n```javascript\n var EventEmitter2 = require('eventemitter2').EventEmitter2;\n var server = new EventEmitter2({\n wildcard: true, // should the event emitter use wildcards.\n delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`.\n newListener: false, // if you want to emit the newListener event set to true.\n maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10.\n });\n```\n\n - Getting the actual event that fired.\n\n```javascript\n server.on('foo.*', function(value1, value2) {\n console.log(this.event, value1, value2);\n });\n```\n\n - Fire an event N times and then remove it, an extension of the `once` concept.\n\n```javascript\n server.many('foo', 4, function() {\n console.log('hello');\n });\n```\n\n - Pass in a namespaced event as an array rather than a delimited string.\n\n```javascript\n server.many(['foo', 'bar', 'bazz'], function() {\n console.log('hello');\n });\n```\n\n\n## API\n\nWhen an `EventEmitter` instance experiences an error, the typical action is\nto emit an `error` event. Error events are treated as a special case.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters emit the event `newListener` when new listeners are\nadded.\n\n\n**Namespaces** with **Wildcards**\nTo use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor.\nWhen namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated\nby a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a \nconstructor option.\n\nAn event name passed to any event emitter method can contain a wild card (the `*` character).\nIf the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, \nthe wildcard may appear as `['foo', '*']`.\n\nIf either of the above described events were passed to the `on` method, subsequent emits such \nas the following would be observed...\n\n```javascript\n emitter.emit('foo.bazz');\n emitter.emit(['foo', 'bar']);\n```\n\n\n#### emitter.addListener(event, listener)\n#### emitter.on(event, listener)\n\nAdds a listener to the end of the listeners array for the specified event.\n\n```javascript\n server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) {\n console.log('The event was raised!');\n });\n```\n\n```javascript\n server.on('data', function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.onAny(listener)\n\nAdds a listener that will be fired when any event is emitted.\n\n```javascript\n server.onAny(function(value) {\n console.log('All events trigger this.');\n });\n```\n\n#### emitter.offAny(listener)\n\nRemoves the listener that will be fired when any event is emitted.\n\n```javascript\n server.offAny(function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.once(event, listener)\n\nAdds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.once('get', function (value) {\n console.log('Ah, we have our first value!');\n });\n```\n\n#### emitter.many(event, timesToListen, listener)\n\nAdds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.many('get', 4, function (value) {\n console.log('This event will be listened to exactly four times.');\n });\n```\n\n\n#### emitter.removeListener(event, listener)\n#### emitter.off(event, listener)\n\nRemove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener.\n\n```javascript\n var callback = function(value) {\n console.log('someone connected!');\n };\n server.on('get', callback);\n // ...\n server.removeListener('get', callback);\n```\n\n\n#### emitter.removeAllListeners([event])\n\nRemoves all listeners, or those of the specified event.\n\n\n#### emitter.setMaxListeners(n)\n\nBy default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited.\n\n\n#### emitter.listeners(event)\n\nReturns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.on('get', function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listeners('get')); // [ [Function] ]\n```\n\n#### emitter.listenersAny()\n\nReturns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.onAny(function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected!\n```\n\n#### emitter.emit(event, [arg1], [arg2], [...])\n\nExecute each of the listeners that may be listening for the specified event name in order with the list of arguments.\n\n## Test coverage\n\nThere is a test suite that tries to cover each use case, it can be found here.\n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2011 hij1nx \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "_id": "eventemitter2@0.4.13", - "dist": { - "shasum": "e062a06ace5e9600553cfdce8aa3f2e346d062aa" - }, - "_from": "eventemitter2@~0.4.11", - "_resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.13.tgz" -} diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/out/lib/taskgroup.js b/deploy/core/node_modules/watchr/node_modules/taskgroup/out/lib/taskgroup.js deleted file mode 100644 index 8197015bc..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/out/lib/taskgroup.js +++ /dev/null @@ -1,410 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var EventEmitter, Task, TaskGroup, ambi, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __slice = [].slice; - -ambi = require('ambi'); - -EventEmitter = require('eventemitter2').EventEmitter2; - -Task = (function(_super) { - __extends(Task, _super); - - Task.prototype.type = 'task'; - - Task.prototype.result = null; - - Task.prototype.running = false; - - Task.prototype.parent = null; - - Task.prototype.name = null; - - Task.prototype.fn = null; - - Task.prototype.args = null; - - function Task() { - var args, fn, name; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - this.setConfig = __bind(this.setConfig, this); - Task.__super__.constructor.apply(this, arguments); - name = fn = null; - if (args.length) { - if (args.length === 2) { - name = args[0], fn = args[1]; - } else if (args.length === 1) { - fn = args[0]; - } - } - this.setConfig({ - name: name, - fn: fn - }); - this; - } - - Task.prototype.setConfig = function(opts) { - var key, value; - - if (opts == null) { - opts = {}; - } - for (key in opts) { - if (!__hasProp.call(opts, key)) continue; - value = opts[key]; - this[key] = value; - } - return this; - }; - - Task.prototype.run = function() { - var complete, - _this = this; - - complete = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - _this.running = false; - _this.result = args; - return _this.complete(); - }; - this.running = true; - this.emit('run'); - process.nextTick(function() { - var args; - - args = (_this.args || []).concat([complete]); - return ambi.apply(null, [_this.fn.bind(_this)].concat(__slice.call(args))); - }); - return this; - }; - - Task.prototype.complete = function() { - var completed; - - completed = (this.result != null) && this.running === false; - if (completed) { - this.emit.apply(this, ['complete'].concat(__slice.call(this.result))); - } - return completed; - }; - - return Task; - -})(EventEmitter); - -TaskGroup = (function(_super) { - __extends(TaskGroup, _super); - - TaskGroup.prototype.type = 'taskgroup'; - - TaskGroup.prototype.running = 0; - - TaskGroup.prototype.remaining = null; - - TaskGroup.prototype.err = null; - - TaskGroup.prototype.results = null; - - TaskGroup.prototype.parent = null; - - TaskGroup.prototype.paused = true; - - TaskGroup.prototype.name = null; - - TaskGroup.prototype.fn = null; - - TaskGroup.prototype.concurrency = 1; - - TaskGroup.prototype.pauseOnError = true; - - function TaskGroup() { - var args, fn, name, - _this = this; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - this.run = __bind(this.run, this); - this.pause = __bind(this.pause, this); - this.exit = __bind(this.exit, this); - this.stop = __bind(this.stop, this); - this.clear = __bind(this.clear, this); - this.complete = __bind(this.complete, this); - this.nextItem = __bind(this.nextItem, this); - this.nextItems = __bind(this.nextItems, this); - this.isReady = __bind(this.isReady, this); - this.hasItems = __bind(this.hasItems, this); - this.addGroup = __bind(this.addGroup, this); - this.createGroup = __bind(this.createGroup, this); - this.addTask = __bind(this.addTask, this); - this.createTask = __bind(this.createTask, this); - this.addItem = __bind(this.addItem, this); - this.setConfig = __bind(this.setConfig, this); - TaskGroup.__super__.constructor.apply(this, arguments); - this.err = null; - this.results = []; - this.remaining = []; - name = fn = null; - if (args.length) { - if (args.length === 2) { - name = args[0], fn = args[1]; - } else if (args.length === 1) { - fn = args[0]; - } - } - this.setConfig({ - name: name, - fn: fn - }); - process.nextTick(function() { - if (_this.fn) { - args = [_this.addGroup, _this.addTask]; - _this.addTask(_this.fn.bind(_this)).setConfig({ - args: args, - includeInResults: false - }); - if (!_this.parent) { - return _this.run(); - } - } - }); - this.on('item.complete', function() { - var args, item; - - item = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - if (item.includeInResults !== false) { - _this.results.push(args); - } - if (args[0]) { - _this.err = args[0]; - } - if (_this.running > 0) { - --_this.running; - } - if (_this.paused) { - return; - } - if (!_this.complete()) { - return _this.nextItems(); - } - }); - this; - } - - TaskGroup.prototype.setConfig = function(opts) { - var key, value; - - if (opts == null) { - opts = {}; - } - for (key in opts) { - if (!__hasProp.call(opts, key)) continue; - value = opts[key]; - this[key] = value; - } - return this; - }; - - TaskGroup.prototype.getTotals = function() { - var completed, remaining, running, total; - - running = this.running; - remaining = this.remaining.length; - completed = this.results.length; - total = running + remaining + completed; - return { - running: running, - remaining: remaining, - completed: completed, - total: total - }; - }; - - TaskGroup.prototype.addItem = function(item) { - var me; - - me = this; - item.onAny(function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return me.emit.apply(me, ["item." + this.event, item].concat(__slice.call(args))); - }); - this.emit('add', item); - this.remaining.push(item); - if (!this.paused) { - this.nextItems(); - } - return item; - }; - - TaskGroup.prototype.createTask = function() { - var args, task; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - task = (function(func, args, ctor) { - ctor.prototype = func.prototype; - var child = new ctor, result = func.apply(child, args); - return Object(result) === result ? result : child; - })(Task, args, function(){}); - return task; - }; - - TaskGroup.prototype.addTask = function() { - var args, me, task; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - me = this; - task = this.createTask.apply(this, args).setConfig({ - parent: this - }); - task.onAny(function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return me.emit.apply(me, ["task." + this.event, task].concat(__slice.call(args))); - }); - return this.addItem(task); - }; - - TaskGroup.prototype.createGroup = function() { - var args, group; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - group = (function(func, args, ctor) { - ctor.prototype = func.prototype; - var child = new ctor, result = func.apply(child, args); - return Object(result) === result ? result : child; - })(TaskGroup, args, function(){}); - return group; - }; - - TaskGroup.prototype.addGroup = function() { - var args, group, me; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - me = this; - group = this.createGroup.apply(this, args).setConfig({ - concurrency: this.concurrency, - parent: this - }); - group.onAny(function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return me.emit.apply(me, ["group." + this.event, group].concat(__slice.call(args))); - }); - return this.addItem(group); - }; - - TaskGroup.prototype.hasItems = function() { - return this.remaining.length !== 0; - }; - - TaskGroup.prototype.isReady = function() { - return !this.concurrency || this.running < this.concurrency; - }; - - TaskGroup.prototype.nextItems = function() { - var item, items; - - items = []; - while (true) { - item = this.nextItem(); - if (item) { - items.push(item); - } else { - break; - } - } - if (items.length) { - return items; - } else { - return false; - } - }; - - TaskGroup.prototype.nextItem = function() { - var nextItem; - - if (this.hasItems()) { - if (this.isReady()) { - nextItem = this.remaining.shift(); - ++this.running; - nextItem.run(); - return nextItem; - } - } - return false; - }; - - TaskGroup.prototype.complete = function() { - var completed, empty, pause; - - pause = this.pauseOnError && this.err; - empty = this.hasItems() === false && this.running === 0; - completed = pause || empty; - if (completed) { - if (pause) { - this.pause(); - } - this.emit('complete', this.err, this.results); - this.err = null; - this.results = []; - } - return completed; - }; - - TaskGroup.prototype.clear = function() { - this.remaining.splice(0); - return this; - }; - - TaskGroup.prototype.stop = function() { - this.pause(); - this.clear(); - return this; - }; - - TaskGroup.prototype.exit = function(err) { - if (err) { - this.err = err; - } - this.stop(); - this.running = 0; - this.complete(); - return this; - }; - - TaskGroup.prototype.pause = function() { - this.paused = true; - return this; - }; - - TaskGroup.prototype.run = function() { - var args, - _this = this; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - this.paused = false; - this.emit('run'); - process.nextTick(function() { - if (!_this.complete()) { - return _this.nextItems(); - } - }); - return this; - }; - - return TaskGroup; - -})(EventEmitter); - -module.exports = { - Task: Task, - TaskGroup: TaskGroup -}; diff --git a/deploy/core/node_modules/watchr/node_modules/taskgroup/package.json b/deploy/core/node_modules/watchr/node_modules/taskgroup/package.json deleted file mode 100755 index 3e49cb895..000000000 --- a/deploy/core/node_modules/watchr/node_modules/taskgroup/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "taskgroup", - "version": "3.1.2", - "description": "Group together synchronous and asynchronous tasks and execute them with support for concurrency, naming, and nesting.", - "homepage": "https://github.com/bevry/taskgroup", - "keywords": [ - "flow", - "control", - "async", - "sync", - "tasks", - "batch", - "concurrency" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/taskgroup/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/taskgroup.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "ambi": "~2.0.0", - "eventemitter2": "~0.4.11" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.2.0", - "joe-reporter-console": "~1.2.1", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/taskgroup-test.js" - }, - "main": "./out/lib/taskgroup.js", - "readme": "# Task Group\n\n[![Build Status](https://secure.travis-ci.org/bevry/taskgroup.png?branch=master)](http://travis-ci.org/bevry/taskgroup)\n[![NPM version](https://badge.fury.io/js/taskgroup.png)](https://npmjs.org/package/taskgroup)\n\nGroup together synchronous and asynchronous tasks and execute them with support for concurrency, naming, and nesting.\n\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save taskgroup`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org/)\n\n\n\n## Usage\n\n### Example\n\n``` javascript\n// Import\nvar TaskGroup = require('taskgroup').TaskGroup;\n\n// Create our new group\nvar group = new TaskGroup();\n\n// Define what should happen once the group has completed\ngroup.once('complete', function(err,results){\n\t// Log the error that has occured\n\tconsole.log(err);\n\t// => null\n\n\t// Log the results that our group received from the executing items\n\tconsole.log(JSON.stringify(results));\n\t/*\t=>\n\t\t[\n\t\t\t[null, 'first', 'task'],\n\t\t\t[null, 'second task'],\n\t\t\t[null, [\n\t\t\t\t[null, 'sub second task'],\n\t\t\t\t[null, 'sub first', 'task']\n\t\t\t]]\n\t\t]\n\t*/\n});\n\n// Add an asynchronous task that gives the result to the completion callback\ngroup.addTask(function(complete){\n\tsetTimeout(function(){\n\t\tcomplete(null, 'first', 'task');\n\t},500);\n});\n\n// Add a synchronous task that returns the result\n// Errors should be returned, though if an error is thrown we will catch it\ngroup.addTask(function(){\n\treturn 'second task';\n});\n\n// Add a sub-group to our exiting group\ngroup.addGroup(function(addGroup,addTask){\n\t// Tell this sub-group to execute in parallel (all at once) by setting its concurrency to unlimited\n\t// by default the concurrency for all groups is set to 1\n\t// which means that they execute in serial fashion (one after the other, instead of all at once)\n\tthis.setConfig({concurrency:0});\n\n\t// Add an asynchronous task that gives its result to the completion callback\n\taddTask(function(complete){\n\t\tsetTimeout(function(){\n\t\t\tcomplete(null, 'sub first', 'task');\n\t\t},500);\n\t});\n\n\t// Add a synchronous task that returns its result\n\taddTask(function(){\n\t\treturn 'sub second task';\n\t});\n});\n\n// Execute our group\ngroup.run();\n```\n\n### TaskGroup API\n\n``` javascript\nnew require('taskgroup').TaskGroup()\n```\n\n- Available methods:\n\t- `constructor(name?,fn?)` - create our new group, the arguments `name` and `fn` are optional, refer to their entries in configuration\n\t- `setConfig(config)` - set the configuration for the group, returns chain\n\t- `addTask(args...)` - create a new task item with the arguments and adds it to the group, returns the new task item\n\t- `addGroup(args...)` - create a new group item with the arguments and adds it to the group, returns the new group item\n\t- `getTotals()` - returns counts for the following `{running,remaining,completed,total}`\n\t- `clear()` - remove the remaining items to be executed\n\t- `pause()` - pause the execution of the items\n\t- `stop()` - clear and pause\n\t- `exit(err)` - stop and complete, `err` if specified is sent to the completion event when fired\n\t- `complete()` - will fire the completion event if we are already complete, useful if you're binding your listeners after run\n\t- `run()` - start/resume executing the items, returns chain\n\t- All those of [EventEmitter2](https://github.com/hij1nx/EventEmitter2)\n- Available configuration:\n\t- `name`, no default - allows us to assign a name to the group, useful for debugging\n\t- `fn(addGroup,addTask,complete?)`, no default - allows us to use an inline and self-executing style for defining groups, useful for nesting\n\t- `concurrency`, defaults to `1` - how many items shall we allow to be run at the same time, set to `0` to allow unlimited\n\t- `pauseOnError`, defaults to `true` - if an error occurs in one of our items, should we stop executing any remaining items?\n\t\t- setting to `false` will continue with execution with the other items even if an item experiences an error\n- Available events:\n\t- `run()` - fired just before we execute the items\n\t- `complete(err, results)` - fired when all our items have completed\n\t- `task.run(task)` - fired just before a task item executes\n\t- `task.complete(task, err, args...)` - fired when a task item has completed\n\t- `group.run(group)` - fired just before a group item executes\n\t- `group.complete(group, err, results)` - fired when a group item has completed\n\t- `item.run(item)` - fired just before an item executes (fired for both sub-tasks and sub-groups)\n\t- `item.complete(item, err, args...)` - fired when an item has completed (fired for both sub-task and sub-groups)\n\n\n### Task API\n\n``` javascript\nnew require('taskgroup').Task()\n```\n\n- Available methods:\n\t- `constructor(name?,fn?)` - create our new task, the arguments `name` and `fn` are optional though `fn` must be set at some point, refer to their entries in configuration\n\t- `setConfig(config)` - set the configuration for the group, returns chain\n\t- `complete()` - will fire the completion event if we are already complete, useful if you're binding your listeners after run\n\t- `run()` - execute the task\n- Available configuration:\n\t- `name`, no default - allows us to assign a name to the group, useful for debugging\n\t- `fn(complete?)`, no default - must be set at some point, it is the function to execute for the task, if it is asynchronous it should use the completion callback provided\n\t- `args`, no default - an array of arguments that you would like to precede the completion callback when executing `fn`\n- Available events:\n\t- `run()` - fired just before we execute the task\n\t- `complete(err, args...)` - fired when the task has completed\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/taskgroup/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "taskgroup@3.1.2", - "_from": "taskgroup@~3.1.1" -} diff --git a/deploy/core/node_modules/watchr/node_modules/typechecker/.npmignore b/deploy/core/node_modules/watchr/node_modules/typechecker/.npmignore deleted file mode 100755 index 82dc91461..000000000 --- a/deploy/core/node_modules/watchr/node_modules/typechecker/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.travis* -Cakefile -Makefile -History.md - -src/ -out/test/ -test/ \ No newline at end of file diff --git a/deploy/core/node_modules/watchr/node_modules/typechecker/LICENSE.md b/deploy/core/node_modules/watchr/node_modules/typechecker/LICENSE.md deleted file mode 100755 index 65b66a055..000000000 --- a/deploy/core/node_modules/watchr/node_modules/typechecker/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -(The MIT License) - -Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -Copyright © 2011-2012 Benjamin Lupton - -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 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. diff --git a/deploy/core/node_modules/watchr/node_modules/typechecker/README.md b/deploy/core/node_modules/watchr/node_modules/typechecker/README.md deleted file mode 100755 index 9364099b4..000000000 --- a/deploy/core/node_modules/watchr/node_modules/typechecker/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# TypeChecker [![Build Status](https://secure.travis-ci.org/bevry/typechecker.png?branch=master)](http://travis-ci.org/bevry/typechecker) -Utilities to get and check variable types (isString, isPlainObject, isRegExp, etc) - - - -## Install - -### Backend - -1. [Install Node.js](http://bevry.me/node/install) -2. `npm install --save typechecker` - -### Frontend - -1. [See Browserify](http://browserify.org/) - - - -## Usage - -### Example - -``` javascript -require('typechecker').isRegExp(/^a/) -``` - -### Available Methods - -- `getObjectType` (e.g. `[object RegExp]`) -- `getType` (e.g. `regexp`) -- `isPlainObject` (checks for no custom prototype) -- `isError` -- `isDate` -- `isArguments` -- `isFunction` -- `isRegExp` -- `isArray` -- `isNumber` -- `isString` -- `isBoolean` -- `isNull` -- `isUndefined` -- `isEmpty` (checks for `null` or `undefined`) -- `isEmptyObject` (checks for no keys that are its own) - - - -## History -You can discover the history inside the [History.md](https://github.com/bevry/typechecker/blob/master/History.md#files) file - - - -## License -Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) -
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) -
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) diff --git a/deploy/core/node_modules/watchr/node_modules/typechecker/out/lib/typechecker.js b/deploy/core/node_modules/watchr/node_modules/typechecker/out/lib/typechecker.js deleted file mode 100644 index e956c8d36..000000000 --- a/deploy/core/node_modules/watchr/node_modules/typechecker/out/lib/typechecker.js +++ /dev/null @@ -1,83 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var typeChecker, - __hasProp = {}.hasOwnProperty; - -typeChecker = { - getObjectType: function(value) { - return Object.prototype.toString.call(value); - }, - getType: function(value) { - var result, type, _i, _len, _ref; - - result = 'object'; - _ref = ['Array', 'RegExp', 'Date', 'Function', 'Boolean', 'Number', 'Error', 'String', 'Null', 'Undefined']; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; - if (typeChecker['is' + type](value)) { - result = type.toLowerCase(); - break; - } - } - return result; - }, - isPlainObject: function(value) { - return typeChecker.isObject(value) && value.__proto__ === Object.prototype; - }, - isObject: function(value) { - return value && typeof value === 'object'; - }, - isError: function(value) { - return value instanceof Error; - }, - isDate: function(value) { - return typeChecker.getObjectType(value) === '[object Date]'; - }, - isArguments: function(value) { - return typeChecker.getObjectType(value) === '[object Arguments]'; - }, - isFunction: function(value) { - return typeChecker.getObjectType(value) === '[object Function]'; - }, - isRegExp: function(value) { - return typeChecker.getObjectType(value) === '[object RegExp]'; - }, - isArray: function(value) { - var _ref; - - return (_ref = typeof Array.isArray === "function" ? Array.isArray(value) : void 0) != null ? _ref : typeChecker.getObjectType(value) === '[object Array]'; - }, - isNumber: function(value) { - return typeof value === 'number' || typeChecker.getObjectType(value) === '[object Number]'; - }, - isString: function(value) { - return typeof value === 'string' || typeChecker.getObjectType(value) === '[object String]'; - }, - isBoolean: function(value) { - return value === true || value === false || typeChecker.getObjectType(value) === '[object Boolean]'; - }, - isNull: function(value) { - return value === null; - }, - isUndefined: function(value) { - return typeof value === 'undefined'; - }, - isEmpty: function(value) { - return value != null; - }, - isEmptyObject: function(value) { - var empty, key; - - empty = true; - if (value != null) { - for (key in value) { - if (!__hasProp.call(value, key)) continue; - value = value[key]; - empty = false; - break; - } - } - return empty; - } -}; - -module.exports = typeChecker; diff --git a/deploy/core/node_modules/watchr/node_modules/typechecker/package.json b/deploy/core/node_modules/watchr/node_modules/typechecker/package.json deleted file mode 100755 index 64af246ac..000000000 --- a/deploy/core/node_modules/watchr/node_modules/typechecker/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "typechecker", - "version": "2.0.1", - "description": "Utilities to get and check variable types (isString, isPlainObject, isRegExp, etc)", - "homepage": "https://github.com/bevry/typechecker", - "keywords": [ - "types", - "type" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "https://github.com/balupton" - } - ], - "bugs": { - "url": "https://github.com/bevry/typechecker/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/typechecker.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": {}, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.1.2", - "chai": "~1.5.0" - }, - "directories": { - "lib": "./out/lib" - }, - "scripts": { - "test": "node ./out/test/typechecker-test.js --joe-reporter=list" - }, - "main": "./out/lib/typechecker.js", - "readme": "# TypeChecker [![Build Status](https://secure.travis-ci.org/bevry/typechecker.png?branch=master)](http://travis-ci.org/bevry/typechecker)\nUtilities to get and check variable types (isString, isPlainObject, isRegExp, etc)\n\n\n\n## Install\n\n### Backend\n\n1. [Install Node.js](http://bevry.me/node/install)\n2. `npm install --save typechecker`\n\n### Frontend\n\n1. [See Browserify](http://browserify.org/)\n\n\n\n## Usage\n\n### Example\n\n``` javascript\nrequire('typechecker').isRegExp(/^a/)\n```\n\n### Available Methods\n\n- `getObjectType` (e.g. `[object RegExp]`)\n- `getType` (e.g. `regexp`)\n- `isPlainObject` (checks for no custom prototype)\n- `isError`\n- `isDate`\n- `isArguments`\n- `isFunction`\n- `isRegExp`\n- `isArray`\n- `isNumber`\n- `isString`\n- `isBoolean`\n- `isNull`\n- `isUndefined`\n- `isEmpty` (checks for `null` or `undefined`)\n- `isEmptyObject` (checks for no keys that are its own)\n\n\n\n## History\nYou can discover the history inside the [History.md](https://github.com/bevry/typechecker/blob/master/History.md#files) file\n\n\n\n## License\nLicensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)\n
    Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "typechecker@2.0.1", - "_from": "typechecker@~2.0.1" -} diff --git a/deploy/core/node_modules/watchr/out/lib/watchr.js b/deploy/core/node_modules/watchr/out/lib/watchr.js deleted file mode 100644 index f714ce7cb..000000000 --- a/deploy/core/node_modules/watchr/out/lib/watchr.js +++ /dev/null @@ -1,809 +0,0 @@ -// Generated by CoffeeScript 1.6.2 -var EventEmitter, TaskGroup, Watcher, balUtil, createWatcher, eachr, extendr, fsUtil, pathUtil, safefs, typeChecker, watch, watchers, watchersTotal, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __slice = [].slice, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - -pathUtil = require('path'); - -fsUtil = require('fs'); - -balUtil = require('bal-util'); - -safefs = require('safefs'); - -extendr = require('extendr'); - -eachr = require('eachr'); - -typeChecker = require('typechecker'); - -TaskGroup = require('taskgroup').TaskGroup; - -EventEmitter = require('events').EventEmitter; - -/* -Now to make watching files more convient and managed, we'll create a class which we can use to attach to each file. -It'll provide us with the API and abstraction we need to accomplish difficult things like recursion. -We'll also store a global store of all the watchers and their paths so we don't have multiple watchers going at the same time -for the same file - as that would be quite ineffecient. -Events: -- `log` for debugging, receives the arguments `logLevel ,args...` -- `error` for gracefully listening to error events, receives the arguments `err` -- `watching` for when watching of the path has completed, receives the arguments `err, watcherInstance, isWatching` -- `change` for listening to change events, receives the arguments `changeType, fullPath, currentStat, previousStat` -*/ - - -watchersTotal = 0; - -watchers = {}; - -Watcher = (function(_super) { - __extends(_Class, _super); - - _Class.prototype.path = null; - - _Class.prototype.isDirectory = null; - - _Class.prototype.stat = null; - - _Class.prototype.fswatcher = null; - - _Class.prototype.children = null; - - _Class.prototype.state = 'pending'; - - _Class.prototype.method = null; - - _Class.prototype.config = { - path: null, - listener: null, - listeners: null, - stat: null, - outputLog: false, - interval: 5007, - persistent: true, - duplicateDelay: 1 * 1000, - preferredMethods: null, - ignorePaths: false, - ignoreHiddenFiles: false, - ignoreCommonPatterns: true, - ignoreCustomPatterns: null - }; - - function _Class(config, next) { - this.listener = __bind(this.listener, this); - this.bubbler = __bind(this.bubbler, this); - this.bubble = __bind(this.bubble, this); - this.isIgnoredPath = __bind(this.isIgnoredPath, this); - this.log = __bind(this.log, this); this.children = {}; - this.config = extendr.extend({}, this.config); - this.config.preferredMethods = ['watch', 'watchFile']; - if (config.next != null) { - if (next == null) { - next = config.next; - } - delete config.next; - } - if (config) { - this.setup(config); - } - if (next) { - this.watch(next); - } - this; - } - - _Class.prototype.log = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (this.config.outputLog) { - console.log.apply(console, args); - } - this.emit.apply(this, ['log'].concat(__slice.call(args))); - return this; - }; - - _Class.prototype.isIgnoredPath = function(path, opts) { - var ignore, _ref, _ref1, _ref2, _ref3; - - if (opts == null) { - opts = {}; - } - ignore = balUtil.isIgnoredPath(path, { - ignorePaths: (_ref = opts.ignorePaths) != null ? _ref : this.config.ignorePaths, - ignoreHiddenFiles: (_ref1 = opts.ignoreHiddenFiles) != null ? _ref1 : this.config.ignoreHiddenFiles, - ignoreCommonPatterns: (_ref2 = opts.ignoreCommonPatterns) != null ? _ref2 : this.config.ignoreCommonPatterns, - ignoreCustomPatterns: (_ref3 = opts.ignoreCustomPatterns) != null ? _ref3 : this.config.ignoreCustomPatterns - }); - this.log('debug', "ignore: " + path + " " + (ignore ? 'yes' : 'no')); - return ignore; - }; - - /* - Setup our Instance - */ - - - _Class.prototype.setup = function(config) { - extendr.extend(this.config, config); - this.path = this.config.path; - if (this.config.stat) { - this.stat = this.config.stat; - this.isDirectory = this.stat.isDirectory(); - delete this.config.stat; - } - if (this.config.listener || this.config.listeners) { - this.removeAllListeners(); - if (this.config.listener) { - this.listen(this.config.listener); - delete this.config.listener; - } - if (this.config.listeners) { - this.listen(this.config.listeners); - delete this.config.listeners; - } - } - return this; - }; - - _Class.prototype.bubble = function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - this.emit.apply(this, args); - return this; - }; - - _Class.prototype.bubbler = function(eventName) { - var _this = this; - - return function() { - var args; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return _this.bubble.apply(_this, [eventName].concat(__slice.call(args))); - }; - }; - - /* - Listen - Add listeners to our watcher instance. - Overloaded to also accept the following: - - `changeListener` a single change listener - - `[changeListener]` an array of change listeners - - `{eventName:eventListener}` an object keyed with the event names and valued with a single event listener - - `{eventName:[eventListener]}` an object keyed with the event names and valued with an array of event listeners - */ - - - _Class.prototype.listen = function(eventName, listener) { - var listenerArray, listeners, _i, _j, _len, _len1; - - if (listener == null) { - listeners = eventName; - if (typeChecker.isArray(listeners)) { - for (_i = 0, _len = listeners.length; _i < _len; _i++) { - listener = listeners[_i]; - this.listen('change', listener); - } - } else if (typeChecker.isPlainObject(listeners)) { - for (eventName in listeners) { - if (!__hasProp.call(listeners, eventName)) continue; - listenerArray = listeners[eventName]; - if (typeChecker.isArray(listenerArray)) { - for (_j = 0, _len1 = listenerArray.length; _j < _len1; _j++) { - listener = listenerArray[_j]; - this.listen(eventName, listener); - } - } else { - this.listen(eventName, listenerArray); - } - } - } else { - this.listen('change', listeners); - } - } else { - this.removeListener(eventName, listener); - this.on(eventName, listener); - this.log('debug', "added a listener: on " + this.path + " for event " + eventName); - } - return this; - }; - - /* - Emit Safe - Sometimes events can fire incredibly quickly in which case we'll determine multiple events - This alias for emit('change',...) will check to see if the event has already been fired recently - and if it has, then ignore it - */ - - - _Class.prototype.cacheTimeout = null; - - _Class.prototype.cachedEvents = null; - - _Class.prototype.emitSafe = function() { - var args, config, me, thisEvent, _ref; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - me = this; - config = this.config; - if (config.duplicateDelay) { - if (this.cacheTimeout != null) { - clearTimeout(this.cacheTimeout); - } - this.cacheTimeout = setTimeout(function() { - me.cachedEvents = []; - return me.cacheTimeout = null; - }, config.duplicateDelay); - if ((_ref = this.cachedEvents) == null) { - this.cachedEvents = []; - } - thisEvent = JSON.stringify(args); - if (__indexOf.call(this.cachedEvents, thisEvent) >= 0) { - this.log('debug', "event ignored on " + this.path + " due to duplicate:", args); - return this; - } - this.cachedEvents.push(thisEvent); - } - this.emit.apply(this, args); - return this; - }; - - /* - Listener - A change event has fired - - Things to note: - - watchFile: - - currentStat still exists even for deleted/renamed files - - for deleted and updated files, it will fire on the file - - for created files, it will fire on the directory - - fsWatcher: - - eventName is either 'change' or 'rename', this value cannot be trusted - - currentStat still exists even for deleted/renamed files - - previousStat is accurate, however we already have this - - for deleted and changed files, it will fire on the file - - for new files, it will fire on the directory - - Arguments for our change listener will be: - - for updated files the arguments will be: `'update', fullPath, currentStat, previousStat` - - for created files the arguments will be: `'create', fullPath, currentStat, null` - - for deleted files the arguments will be: `'delete', fullPath, null, previousStat` - - In the future we will add: - - for renamed files: 'rename', fullPath, currentStat, previousStat, newFullPath - - rename is possible as the stat.ino is the same for the delete and create - */ - - - _Class.prototype.listener = function() { - var args, currentStat, determineTheChange, fileExists, fileFullPath, isTheSame, me, previousStat, - _this = this; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - me = this; - fileFullPath = this.path; - currentStat = null; - previousStat = this.stat; - fileExists = null; - this.log('debug', "watch event triggered on " + this.path + ":", args); - if (args[0] === 'change' && this.children[args[1]]) { - return (function() { - var childFileRelativePath, childFileWatcher; - - childFileRelativePath = args[1]; - childFileWatcher = _this.children[args[1]]; - _this.log('debug', 'forwarding initial change detection to child:', childFileRelativePath, 'via:', fileFullPath); - return childFileWatcher.listener('change', '.'); - })(); - } - isTheSame = function() { - if ((currentStat != null) && (previousStat != null)) { - if (currentStat.size === previousStat.size && currentStat.mtime.toString() === previousStat.mtime.toString()) { - return true; - } - } - return false; - }; - determineTheChange = function() { - if (!fileExists) { - _this.log('debug', 'determined delete:', fileFullPath); - return _this.close('deleted'); - } else { - if (isTheSame()) { - return _this.log('debug', "determined same:", fileFullPath); - } else { - if (_this.isDirectory) { - if (isTheSame() === false) { - return safefs.readdir(fileFullPath, function(err, newFileRelativePaths) { - if (err) { - return _this.emit('error', err); - } - if (typeChecker.isString(args[0]) && args[1] === null) { - eachr(_this.children, function(childFileWatcher, childFileRelativePath) { - if (__indexOf.call(newFileRelativePaths, childFileRelativePath) < 0) { - return; - } - if (!childFileWatcher) { - return; - } - _this.log('debug', 'forwarding extensive change detection to child:', childFileRelativePath, 'via:', fileFullPath); - childFileWatcher.listener('change', '.'); - }); - } - eachr(_this.children, function(childFileWatcher, childFileRelativePath) { - var childFileFullPath; - - if (__indexOf.call(newFileRelativePaths, childFileRelativePath) >= 0) { - return; - } - childFileFullPath = pathUtil.join(fileFullPath, childFileRelativePath); - if (_this.isIgnoredPath(childFileFullPath)) { - _this.log('debug', 'ignored delete:', childFileFullPath, 'via:', fileFullPath); - return; - } - _this.log('debug', 'determined delete:', childFileFullPath, 'via:', fileFullPath); - _this.closeChild(childFileRelativePath, 'deleted'); - }); - return eachr(newFileRelativePaths, function(childFileRelativePath) { - var childFileFullPath; - - if (_this.children[childFileRelativePath] != null) { - return; - } - _this.children[childFileRelativePath] = false; - childFileFullPath = pathUtil.join(fileFullPath, childFileRelativePath); - if (_this.isIgnoredPath(childFileFullPath)) { - _this.log('debug', 'ignored create:', childFileFullPath, 'via:', fileFullPath); - return; - } - return safefs.stat(childFileFullPath, function(err, childFileStat) { - if (err) { - return; - } - _this.log('debug', 'determined create:', childFileFullPath, 'via:', fileFullPath); - _this.emitSafe('change', 'create', childFileFullPath, childFileStat, null); - _this.watchChild({ - fullPath: childFileFullPath, - relativePath: childFileRelativePath, - stat: childFileStat - }); - }); - }); - }); - } - } else { - _this.log('debug', 'determined update:', fileFullPath); - return _this.emitSafe('change', 'update', fileFullPath, currentStat, previousStat); - } - } - } - }; - safefs.exists(fileFullPath, function(exists) { - fileExists = exists; - if (fileExists) { - return safefs.stat(fileFullPath, function(err, stat) { - if (err) { - return _this.emit('error', err); - } - currentStat = stat; - _this.stat = currentStat; - return determineTheChange(); - }); - } else { - return determineTheChange(); - } - }); - return this; - }; - - /* - Close - We will need something to close our listener for removed or renamed files - As renamed files are a bit difficult we will want to close and delete all the watchers for all our children too - Essentially it is a self-destruct - */ - - - _Class.prototype.close = function(reason) { - var childRelativePath, _ref; - - if (this.state !== 'active') { - return this; - } - this.log('debug', "close: " + this.path); - _ref = this.children; - for (childRelativePath in _ref) { - if (!__hasProp.call(_ref, childRelativePath)) continue; - this.closeChild(childRelativePath, reason); - } - if (this.method === 'watchFile') { - fsUtil.unwatchFile(this.path); - } - if (this.fswatcher != null) { - this.fswatcher.close(); - this.fswatcher = null; - } - if (reason === 'deleted') { - this.state = 'deleted'; - this.emitSafe('change', 'delete', this.path, null, this.stat); - } else if (reason === 'failure') { - this.state = 'closed'; - this.log('warn', "Failed to watch the path " + this.path); - } else { - this.state = 'closed'; - } - if (watchers[this.path] != null) { - delete watchers[this.path]; - watchersTotal--; - } - return this; - }; - - _Class.prototype.closeChild = function(fileRelativePath, reason) { - var watcher; - - if (this.children[fileRelativePath] != null) { - watcher = this.children[fileRelativePath]; - if (watcher) { - watcher.close(reason); - } - delete this.children[fileRelativePath]; - } - return this; - }; - - /* - Watch Child - Setup watching for a child - Bubble events of the child into our instance - Also instantiate the child with our instance's configuration where applicable - next(err,watcher) - */ - - - _Class.prototype.watchChild = function(opts, next) { - var config, me, _base, _name; - - me = this; - config = this.config; - (_base = me.children)[_name = opts.relativePath] || (_base[_name] = watch({ - path: opts.fullPath, - stat: opts.stat, - listeners: { - 'log': me.bubbler('log'), - 'change': function() { - var args, changeType, path; - - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - changeType = args[0], path = args[1]; - if (changeType === 'delete' && path === opts.fullPath) { - me.closeChild(opts.relativePath, 'deleted'); - } - return me.bubble.apply(me, ['change'].concat(__slice.call(args))); - }, - 'error': me.bubbler('error') - }, - next: next, - outputLog: config.outputLog, - interval: config.interval, - persistent: config.persistent, - duplicateDelay: config.duplicateDelay, - preferredMethods: config.preferredMethods, - ignorePaths: config.ignorePaths, - ignoreHiddenFiles: config.ignoreHiddenFiles, - ignoreCommonPatterns: config.ignoreCommonPatterns, - ignoreCustomPatterns: config.ignoreCustomPatterns - })); - return me.children[opts.relativePath]; - }; - - /* - Watch Children - next(err,watching) - */ - - - _Class.prototype.watchChildren = function(next) { - var config, me; - - me = this; - config = this.config; - if (this.isDirectory) { - balUtil.scandir({ - path: this.path, - ignorePaths: config.ignorePaths, - ignoreHiddenFiles: config.ignoreHiddenFiles, - ignoreCommonPatterns: config.ignoreCommonPatterns, - ignoreCustomPatterns: config.ignoreCustomPatterns, - recurse: false, - next: function(err) { - var watching; - - watching = !err; - return next(err, watching); - }, - action: function(fullPath, relativePath, nextFile, stat) { - if (me.state !== 'active') { - return nextFile(null, true); - } - return me.watchChild({ - fullPath: fullPath, - relativePath: relativePath, - stat: stat - }, function(err, watcher) { - return nextFile(err); - }); - } - }); - } else { - next(null, true); - } - return this; - }; - - /* - Watch Self - */ - - - _Class.prototype.watchSelf = function(next) { - var complete, config, me, methodOne, methodTwo, methods; - - me = this; - config = this.config; - this.method = null; - methods = { - watch: function(next) { - var err; - - if (fsUtil.watch == null) { - return next(null, false); - } - try { - me.fswatcher = fsUtil.watch(me.path, me.listener); - } catch (_error) { - err = _error; - return next(err, false); - } - me.method = 'watch'; - return next(null, true); - }, - watchFile: function(next) { - var err, watchFileOpts; - - if (fsUtil.watchFile == null) { - return next(null, false); - } - watchFileOpts = { - persistent: config.persistent, - interval: config.interval - }; - try { - fsUtil.watchFile(me.path, watchFileOpts, me.listener); - } catch (_error) { - err = _error; - return next(err, false); - } - me.method = 'watchFile'; - return next(null, true); - } - }; - complete = function(watching) { - if (!watching) { - me.close('failure'); - return next(null, false); - } - me.state = 'active'; - return next(null, true); - }; - methodOne = me.config.preferredMethods[0]; - methodTwo = me.config.preferredMethods[1]; - methods[methodOne](function(err1, watching) { - if (watching) { - return complete(watching); - } - return methods[methodTwo](function(err2, watching) { - if (watching) { - return complete(watching); - } - if (err1) { - me.emit('error', err1); - } - if (err2) { - me.emit('error', err2); - } - return complete(false); - }); - }); - return this; - }; - - /* - Watch - Setup the native watching handlers for our path so we can receive updates on when things happen - If the next argument has been received, then add it is a once listener for the watching event - If we are already watching this path then let's start again (call close) - If we are a directory, let's recurse - If we are deleted, then don't error but return the isWatching argument of our completion callback as false - Once watching has completed for this directory and all children, then emit the watching event - next(err,watcherInstance,success) - */ - - - _Class.prototype.watch = function(next) { - var complete, config, me, - _this = this; - - me = this; - config = this.config; - if ((this.stat != null) === false) { - safefs.stat(config.path, function(err, stat) { - if (err) { - return _this.emit('error', err); - } - _this.stat = stat; - _this.isDirectory = stat.isDirectory(); - return _this.watch(next); - }); - return this; - } - if (next != null) { - this.listen('watching', next); - } - this.close(); - this.log('debug', "watch: " + this.path); - complete = function(err, result) { - if (err == null) { - err = null; - } - if (result == null) { - result = true; - } - if (err || !result) { - me.close(); - return me.emit('watching', err, me, false); - } else { - return me.emit('watching', null, me, true); - } - }; - safefs.exists(this.path, function(exists) { - if (!exists) { - return complete(null, false); - } - return me.watchSelf(function(err, watching) { - if (err || !watching) { - return complete(err, watching); - } - return me.watchChildren(function(err, watching) { - return complete(err, watching); - }); - }); - }); - return this; - }; - - return _Class; - -})(EventEmitter); - -/* -Create Watcher -Checks to see if the path actually exists, if it doesn't then exit gracefully -If it does exist, then lets check our cache for an already existing watcher instance -If we have an already existing watching instance, then just add our listeners to that -If we don't, then create a watching instance -Fire the next callback once done -next(err,watcherInstance) -*/ - - -createWatcher = function(opts, next) { - var attempt, listener, listeners, path, watcher; - - path = opts.path, listener = opts.listener, listeners = opts.listeners; - if (opts.next != null) { - if (next == null) { - next = opts.next; - } - delete opts.next; - } - if (!safefs.existsSync(path)) { - if (typeof next === "function") { - next(null, null); - } - return; - } - if (watchers[path] != null) { - watcher = watchers[path]; - if (listener) { - watcher.listen(listener); - } - if (listeners) { - watcher.listen(listeners); - } - if (typeof next === "function") { - next(null, watcher); - } - } else { - attempt = 0; - watcher = new Watcher(opts, function(err) { - if (!err || attempt !== 0) { - return typeof next === "function" ? next(err, watcher) : void 0; - } - ++attempt; - watcher.log('debug', "Preferred method failed, trying methods in reverse order", err); - return watcher.setup({ - preferredMethods: watcher.config.preferredMethods.reverse() - }).watch(); - }); - watchers[path] = watcher; - ++watchersTotal; - } - return watcher; -}; - -/* -Watch -Provides an abstracted API that supports multiple paths -If you are passing in multiple paths then do not rely on the return result containing all of the watchers -you must rely on the result inside the completion callback instead -If you used the paths option, then your results will be an array of watcher instances, otherwise they will be a single watcher instance -next(err,results) -*/ - - -watch = function(opts, next) { - var paths, result, tasks; - - result = []; - if (opts.next != null) { - if (next == null) { - next = opts.next; - } - delete opts.next; - } - if (opts.paths) { - paths = opts.paths; - delete opts.paths; - if (typeChecker.isArray(paths)) { - tasks = new TaskGroup().setConfig({ - concurrency: 0 - }).on('complete', function(err) { - return typeof next === "function" ? next(err, result) : void 0; - }); - paths.forEach(function(path) { - return tasks.addTask(function(complete) { - var localOpts, watcher; - - localOpts = extendr.extend({}, opts); - localOpts.path = path; - watcher = createWatcher(localOpts, complete); - if (watcher) { - return result.push(watcher); - } - }); - }); - tasks.run(); - } else { - opts.path = paths; - result.push(createWatcher(opts, function(err) { - return typeof next === "function" ? next(err, result) : void 0; - })); - } - } else { - result = createWatcher(opts, next); - } - return result; -}; - -module.exports = { - watch: watch, - Watcher: Watcher -}; diff --git a/deploy/core/node_modules/watchr/package.json b/deploy/core/node_modules/watchr/package.json deleted file mode 100644 index 8eacd0da4..000000000 --- a/deploy/core/node_modules/watchr/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "watchr", - "version": "2.4.3", - "description": "Better file system watching for Node.js", - "homepage": "https://github.com/bevry/watchr", - "keywords": [ - "watching", - "watch", - "fswatcher", - "watchfile", - "fs" - ], - "author": { - "name": "Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "http://balupton.com" - } - ], - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "http://balupton.com" - }, - { - "name": "Casey Foster", - "url": "https://github.com/caseywebdev" - }, - { - "name": "Robson Roberto Souza Peixoto", - "email": "robsonpeixoto@gmail.com", - "url": "https://github.com/robsonpeixoto" - } - ], - "bugs": { - "url": "https://github.com/bevry/watchr/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/bevry/watchr.git" - }, - "engines": { - "node": ">=0.4" - }, - "dependencies": { - "bal-util": "~2.0.0", - "typechecker": "~2.0.1", - "extendr": "~2.0.1", - "eachr": "~2.0.2", - "safefs": "~3.0.1", - "taskgroup": "~3.1.1" - }, - "devDependencies": { - "coffee-script": "~1.6.2", - "joe": "~1.2.0", - "joe-reporter-console": "~1.2.1" - }, - "directories": { - "lib": "./out/lib" - }, - "bin": { - "watchr": "./bin/watchr" - }, - "scripts": { - "test": "node ./out/test/everything.test.js" - }, - "main": "./out/lib/watchr.js", - "readme": "# Watchr — better file system watching for Node.js\n\n[![Build Status](https://secure.travis-ci.org/bevry/watchr.png?branch=master)](http://travis-ci.org/bevry/watchr)\n[![NPM version](https://badge.fury.io/js/watchr.png)](https://npmjs.org/package/watchr)\n[![Flattr this project](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr)\n\nWatchr provides a normalised API the file watching APIs of different node versions, nested/recursive file and directory watching, and accurate detailed events for file/directory creations, updates, and deletions.\n\nYou install it via `npm install watchr` and use it via `require('watchr').watch(config)`. Available configuration options are:\n\n- `path` a single path to watch\n- `paths` an array of paths to watch\n- `listener` a single change listener to fire when a change occurs\n- `listeners` an array of listeners to fire when a change occurs, overloaded to accept the following values:\n\t- `changeListener` a single change listener\n\t- `[changeListener]` an array of change listeners\n\t- `{eventName:eventListener}` an object keyed with the event names and valued with a single event listener\n\t- `{eventName:[eventListener]}` an object keyed with the event names and valued with an array of event listeners\n- `next` (optional, defaults to `null`) a completion callback to fire once the watchers have been setup, arguments are:\n\t- when using the `path` configuration option: `err, watcherInstance`\n\t- when using the `paths` configuration option: `err, [watcherInstance,...]` \n- `stat` (optional, defaults to `null`) a file stat object to use for the path, instead of fetching a new one\n- `interval` (optional, defaults to `5007`) for systems that poll to detect file changes, how often should it poll in millseconds\n- `persistent` (optional, defaults to `true`) whether or not we should keep the node process alive for as long as files are still being watched\n- `duplicateDelay` (optional, defaults to `1000`) sometimes events will fire really fast, this delay is set in place so we don't fire the same event within the timespan. Set to falsey to perform no duplicate detection.\n- `preferredMethods` (optional, defaults to `['watch','watchFile']`) which order should we prefer our watching methods to be tried?\n- `ignorePaths` (optional, defaults to `false`) an array of full paths to ignore\n- `ignoreHiddenFiles` (optional, defaults to `false`) whether or not to ignored files which filename starts with a `.`\n- `ignoreCommonPatterns` (optional, defaults to `true`) whether or not to ignore common undesirable file patterns (e.g. `.svn`, `.git`, `.DS_Store`, `thumbs.db`, etc)\n- `ignoreCustomPatterns` (optional, defaults to `null`) any custom ignore patterns that you would also like to ignore along with the common patterns\n\nThe following events are available to your via the listeners:\n\n- `log` for debugging, receives the arguments `logLevel ,args...`\n- `error` for gracefully listening to error events, receives the arguments `err`\n- `watching` for when watching of the path has completed, receives the arguments `err, isWatching`\n- `change` for listening to change events, receives the arguments `changeType, fullPath, currentStat, previousStat`, received arguments will be:\n\t- for updated files: `'update', fullPath, currentStat, previousStat`\n\t- for created files: `'create', fullPath, currentStat, null`\n\t- for deleted files: `'delete', fullPath, null, previousStat`\n\n\nTo wrap it all together, it would look like this:\n\n``` javascript\n// Require\nvar watchr = require('watchr');\n\n// Watch a directory or file\nconsole.log('Watch our paths');\nwatchr.watch({\n\tpaths: ['path1','path2','path3'],\n\tlisteners: {\n\t\tlog: function(logLevel){\n\t\t\tconsole.log('a log message occured:', arguments);\n\t\t},\n\t\terror: function(err){\n\t\t\tconsole.log('an error occured:', err);\n\t\t},\n\t\twatching: function(err,watcherInstance,isWatching){\n\t\t\tif (err) {\n\t\t\t\tconsole.log(\"watching the path \" + watcherInstance.path + \" failed with error\", err);\n\t\t\t} else {\n\t\t\t\tconsole.log(\"watching the path \" + watcherInstance.path + \" completed\");\n\t\t\t}\n\t\t},\n\t\tchange: function(changeType,filePath,fileCurrentStat,filePreviousStat){\n\t\t\tconsole.log('a change event occured:',arguments);\n\t\t}\n\t},\n\tnext: function(err,watchers){\n\t\tif (err) {\n\t\t\treturn console.log(\"watching everything failed with error\", err);\n\t\t} else {\n\t\t\tconsole.log('watching everything completed', watchers);\n\t\t}\n\n\t\t// Close watchers after 60 seconds\n\t\tsetTimeout(function(){\n\t\t\tvar i;\n\t\t\tconsole.log('Stop watching our paths');\n\t\t\tfor ( i=0; iCopyright © 2012+ [Bevry Pty Ltd](http://bevry.me)\n
    Copyright © 2011 [Benjamin Lupton](http://balupton.com)\n", - "readmeFilename": "README.md", - "_id": "watchr@2.4.3", - "_from": "watchr@2.4.3", - "dist": { - "shasum": "b7e32fc1cc7a730043a73b3fc6559ad2283af79e" - }, - "_resolved": "https://registry.npmjs.org/watchr/-/watchr-2.4.3.tgz" -} From 2442cab9c43a2822d34c0050be740a6a08f43035 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 25 Aug 2015 01:50:15 -0400 Subject: [PATCH 477/656] Add code reading and node versions to doc --- doc/for-committers.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index baa3c7bcb..822ab76e3 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -7,6 +7,8 @@ Current ClojureScript version and libraries we use are in [project.clj](https:// ### Node packages +Node package installs last done with node v0.12.7 and npm v2.12.1. + Node dependencies are at deploy/core/node\_modules/. This directory is currently a mix of vendored dependencies, forked dependencies and Light Table specific libraries: @@ -22,3 +24,11 @@ dependencies, forked dependencies and Light Table specific libraries: * clojurescript - Provides cljsDeps.js * codemirror\_addons - Provides codemirror addons * lighttable - Mostly lighttable js libs _except for_ lighttable/util/{keyevents.js,throttle.js} which should be moved to vendored dependencies. + +### Code Reading + +When reading LT's source you may come across a fn that doesn't have an obvious use and may appear to +be unused. Some tips to confirm how it is/was used: + +* Do a LightTable user search for the given fn. For example, to see where [proc/exec is used](https://github.com/search?utf8=%E2%9C%93&q=proc%2Fexec+user%3ALightTable&type=Code&ref=searchresults) +* `git log -u -S WORD` will do a code history for WORD From a14f6aa81af993daa0a88a66d52af5479c5e09c3 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 26 Aug 2015 01:26:16 -0400 Subject: [PATCH 478/656] Change atom-shell references to electron --- deploy/core/main.js | 2 +- deploy/core/version.json | 2 +- src/lt/objs/deploy.cljs | 9 +++++---- src/lt/objs/platform.cljs | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index f33de1ae5..b9cce09a8 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -102,7 +102,7 @@ function start() { app.commandLine.appendSwitch('remote-debugging-port', '8315'); app.commandLine.appendSwitch('js-flags', '--harmony'); - // This method will be called when atom-shell has done everything + // This method will be called when electron has done everything // initialization and ready for creating browser windows. app.on('ready', onReady); diff --git a/deploy/core/version.json b/deploy/core/version.json index af9dbabd8..8625c2af3 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.7.2","atom-shell":"0.19.5"} +{"version":"0.7.2","electron":"0.19.5"} diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 566146456..9d0d05f04 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -154,9 +154,10 @@ (notifos/set-msg! (str "At latest version: " (:version version)))))))))) (defn binary-version - "Binary/atom-shell version. The two versions are in sync since binaries updates - only occur with atom-shell updates." + "Binary/electron version. The two versions are in sync since binaries updates + only occur with electron updates." [] + ;; Still identifies as old electron name until we use a recent electron version (aget js/process.versions "atom-shell")) (defui button [label & [cb]] @@ -181,8 +182,8 @@ (behavior ::check-deploy :triggers #{:deploy} :reaction (fn [this] - ;; Latest :atom-shell version changes after LT auto-updates and user restarts - (when (is-newer? (binary-version) (:atom-shell version)) + ;; Latest :electron version changes after LT auto-updates and user restarts + (when (is-newer? (binary-version) (:electron version)) (alert-binary-update)))) (behavior ::check-version diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index 4e1de5ada..a9cd4328c 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -4,7 +4,7 @@ [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior]])) -(def atom-shell true) +(def electron true) (def fs (js/require "fs")) (def clipboard (js/require "clipboard")) From 7626ab8406aa2d0817d45e8e61f2523de91a4c90 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 26 Aug 2015 01:27:18 -0400 Subject: [PATCH 479/656] Few more atom-shell renames and organize OS prereqs for install --- doc/developer-install.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index 532467a84..5a2a0f042 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -1,15 +1,21 @@ # Initial setup -## Prerequisites +## Prerequisites - [Leiningen 2.x](http://leiningen.org/) - [Node.js and npm](http://nodejs.org/download/) -- [Cygwin](https://cygwin.com/install.html) (for Windows users) +## OS Specific Prerequisites -## Cygwin on Windows +### OSX -On Windows (Cygwin), you may need to change */etc/fstab* (path in Cygwin) to fix a directory permission error when building. Change this line: +None. Skip to [Build](#build). + +### Windows + +Download [Cygwin](https://cygwin.com/install.html). + +You may need to change */etc/fstab* (path in Cygwin) to fix a directory permission error when building. Change this line: ``` none /cygdrive cygdrive binary,posix=0,user 0 0 @@ -25,14 +31,15 @@ Close and re-open Cygwin Terminal. The issue: - - ["mkdir: cannot create directory" error running "atom-shell" branch build on Windows 7 · Issue #1918 · LightTable/LightTable](https://github.com/LightTable/LightTable/issues/1918) + - ["mkdir: cannot create directory" error running branch build on Windows 7 · Issue #1918 · LightTable/LightTable](https://github.com/LightTable/LightTable/issues/1918) + +### Linux -## Linux preconditions -To run atom-shell/electron on Linux you need to have libgconf-2.so.4 installed. +To run electron on Linux you need to have libgconf-2.so.4 installed. -Ref: [atom-shell Linux (Arch) build depends on libgconf-2.so.4](https://github.com/LightTable/LightTable/issues/1926) +Ref: [Linux (Arch) build depends on libgconf-2.so.4](https://github.com/LightTable/LightTable/issues/1926) # Build @@ -45,10 +52,10 @@ $ cd LightTable $ script/build.sh ``` -This will take a few minutes the first time as atom-shell and plugins are downloaded. Subsequent invocations are faster. +This will take a few minutes the first time as electron and plugins are downloaded. Subsequent invocations are faster. To override the output directory, specify `$VERSION` e.g. `VERSION=0.8.1-pre script/build.sh`. -On subsequent builds, use `script/build-app.sh` for quicker builds that don't require updating plugins or atom-shell. +On subsequent builds, use `script/build-app.sh` for quicker builds that don't require updating plugins or electron. If any ClojureScript files change, you must run `lein cljsbuild once`. On Windows, you may need to comment out the :source-map line before compiling ClojureScript to get around [issue 1025](https://github.com/LightTable/LightTable/issues/1025). From 0d4f56cbe8d00918cf6e3813222b2fab65520911 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 27 Aug 2015 23:10:39 -0400 Subject: [PATCH 480/656] Add Electron guide --- doc/electron-guide.md | 50 +++++++++++++++++++++++++++++++++++++++++++ doc/for-committers.md | 8 ++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 doc/electron-guide.md diff --git a/doc/electron-guide.md b/doc/electron-guide.md new file mode 100644 index 000000000..5514e9019 --- /dev/null +++ b/doc/electron-guide.md @@ -0,0 +1,50 @@ +## Intro + +Please read [Electron's Quick start](https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md). The rest of this document assumes you've read it. + +## Electron App Layout + +A normal Electron app has this structure: + +``` +electron-app/ +├── package.json +├── main.js +├── index.html +├── node_modules/ +└── src/ +``` + +Light Table is structured with most files nested in core/ for historical reasons: + + +``` +deploy/ +├── package.json +├── core/main.js +├── core/LightTable.html +├── core/node_modules/ +└── ../src/ +``` + +Description of each file/directory: + +* [package.json](package.json) - This is a manifest file that sets the name, version and the js file to start the main process. To learn more about how Electron uses it [read the source](https://github.com/atom/electron/blob/c441dd143690aab71a925f0b941a6d9760768fa5/atom/browser/lib/init.coffee#L62). + * Our package.json has an additional 'browserWindowOptions' key. This key is used by the main process to set [BrowserWindow](https://github.com/atom/electron/blob/master/docs/api/browser-window.md) options. This is placed in package.json because it is a declaration of an Electron app, like the rest of the file. +* [core/main.js](core/main.js) - This is the heart of the main process. _All_ GUI interactions run through this file. This also handles the CLI. Recommend understanding this file. +* [LightTable.html](LightTable.html) - This is the web page we see as our editor. It lives in the renderer process. +* [core/node\_modules](core/node_modules) - These are node packages used by the renderer process. These are described in [this doc](../doc/for-committers.md#node-packages) +* [../src/](../src) - This is the ClojureScript code that is run in the renderer process. It is [loaded by LightTable.html](https://github.com/LightTable/LightTable/blob/8e8d20a5da5d2ee42db4ff761eb2cd15a2c178b2/deploy/core/LightTable.html#L24-L40). + +## Miscellaneous Pointers + +* Communication between `main.js` (main process) and ClojureScript code (renderer process) happens through [ipc messages](https://github.com/atom/electron/blob/master/docs/api/ipc-main-process.md) and [remote objects](https://github.com/atom/electron/blob/master/docs/api/remote.md). + * For example, when a window [receives a focus event](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/main.js#L33-L36), the main process sends an ipc message on the "app" channel to the renderer process. The renderer process [receives that message](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/src/lt/objs/app.cljs#L228) and invokes a :focus trigger on the app object. +* We use [webview](https://github.com/atom/electron/blob/master/docs/api/web-view-tag.md) for our browser. +* We use [remote-debugging-port](https://github.com/atom/electron/blob/1bc49487add140f22ea4e454dcb0050e08679b4b/docs/api/chrome-command-line-switches.md#--remote-debugging-portport) to do browser eval. + +## Additional Links + +* [Electron docs](https://github.com/atom/electron/tree/master/docs) - Modules to know: browser-window, app, dialog, ipc, remote +* [Mature ClojureScript Electron app](https://github.com/oakmac/cuttle) +* [Our ipc util fns](https://github.com/LightTable/LightTable/blob/master/src/lt/util/ipc.cljs) diff --git a/doc/for-committers.md b/doc/for-committers.md index 822ab76e3..795e2ca77 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -25,10 +25,16 @@ dependencies, forked dependencies and Light Table specific libraries: * codemirror\_addons - Provides codemirror addons * lighttable - Mostly lighttable js libs _except for_ lighttable/util/{keyevents.js,throttle.js} which should be moved to vendored dependencies. +### Electron + +See [Electron guide](electron-guide.md) + +## Other + ### Code Reading When reading LT's source you may come across a fn that doesn't have an obvious use and may appear to be unused. Some tips to confirm how it is/was used: * Do a LightTable user search for the given fn. For example, to see where [proc/exec is used](https://github.com/search?utf8=%E2%9C%93&q=proc%2Fexec+user%3ALightTable&type=Code&ref=searchresults) -* `git log -u -S WORD` will do a code history for WORD +* `git log -u -S WORD` will do a code history search for WORD From 637d56e394ab7351df42c19d6cc0e2db3b741c8b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 28 Aug 2015 01:08:29 -0400 Subject: [PATCH 481/656] Mention more deps and a note about vendored deps --- CONTRIBUTING.md | 2 +- doc/for-committers.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c17f9059..3d5339170 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,4 +36,4 @@ When contributing: * For any other contributions, please discuss with us as early as possible. We want your hard work to count. * Please add docstrings to non-trivial functions that are added. Most existing code doesn't have this but we'd like to improve this. * We are not currently seeking refactoring contributions or code convention tweaks e.g. whitespace. This may change at a later point when we have automated tests and an explicit code convention. - +* For contributions to a [vendored dependency](doc/for-committers.md#node-packages), they must be sent upstream and then we can update to the new version. diff --git a/doc/for-committers.md b/doc/for-committers.md index 795e2ca77..7ec2349cd 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -5,6 +5,12 @@ Current ClojureScript version and libraries we use are in [project.clj](https://github.com/LightTable/LightTable/blob/master/project.clj). +### Notable JS dependencies + +* [CodeMirror](http://codemirror.org/) for the editor +* [Mousetrap](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/node_modules/lighttable/util/keyevents.js) for handling keyboard shortcuts +* [jQuery throttle/debounce plugin](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/node_modules/lighttable/util/throttle.js) + ### Node packages Node package installs last done with node v0.12.7 and npm v2.12.1. @@ -27,7 +33,7 @@ dependencies, forked dependencies and Light Table specific libraries: ### Electron -See [Electron guide](electron-guide.md) +Allows us to build cross platfrom desktop apps. See [Electron guide](electron-guide.md) ## Other From ccead16658e3bed4f96d85a60e5a1169b22e01bc Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 28 Aug 2015 01:45:52 -0400 Subject: [PATCH 482/656] Move shell/ and platform/ to more sensible location They were at the top-level for historical reasons. Doesn't make sense anymore. shell was also historical and renamed to electron to make sense --- {shell => deploy/electron}/.gitignore | 0 {shell => deploy/electron}/Gruntfile.js | 0 {shell => deploy/electron}/package.json | 0 {platform => deploy/platform}/linux/light | 0 {platform => deploy/platform}/mac/Info.plist | 0 {platform => deploy/platform}/mac/light | 0 {platform => deploy/platform}/win/.gitignore | 0 script/build-app.sh | 8 ++++---- script/build.sh | 2 +- script/light.sh | 6 +++--- 10 files changed, 8 insertions(+), 8 deletions(-) rename {shell => deploy/electron}/.gitignore (100%) rename {shell => deploy/electron}/Gruntfile.js (100%) rename {shell => deploy/electron}/package.json (100%) rename {platform => deploy/platform}/linux/light (100%) rename {platform => deploy/platform}/mac/Info.plist (100%) rename {platform => deploy/platform}/mac/light (100%) rename {platform => deploy/platform}/win/.gitignore (100%) diff --git a/shell/.gitignore b/deploy/electron/.gitignore similarity index 100% rename from shell/.gitignore rename to deploy/electron/.gitignore diff --git a/shell/Gruntfile.js b/deploy/electron/Gruntfile.js similarity index 100% rename from shell/Gruntfile.js rename to deploy/electron/Gruntfile.js diff --git a/shell/package.json b/deploy/electron/package.json similarity index 100% rename from shell/package.json rename to deploy/electron/package.json diff --git a/platform/linux/light b/deploy/platform/linux/light similarity index 100% rename from platform/linux/light rename to deploy/platform/linux/light diff --git a/platform/mac/Info.plist b/deploy/platform/mac/Info.plist similarity index 100% rename from platform/mac/Info.plist rename to deploy/platform/mac/Info.plist diff --git a/platform/mac/light b/deploy/platform/mac/light similarity index 100% rename from platform/mac/light rename to deploy/platform/mac/light diff --git a/platform/win/.gitignore b/deploy/platform/win/.gitignore similarity index 100% rename from platform/win/.gitignore rename to deploy/platform/win/.gitignore diff --git a/script/build-app.sh b/script/build-app.sh index 80597e1dd..a5c8ff3a4 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -11,7 +11,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. # Get OS-specific Electron details #---------------------------------------------------------------------- -ELECTRON_DIR="shell/electron" +ELECTRON_DIR="deploy/electron/electron" # from: http://stackoverflow.com/a/17072017/142317 # Will need to change Atom.app/atom/atom.exe to Electron.app/exe once we move to ^0.24.0 https://github.com/atom/grunt-download-electron/issues/30 @@ -20,19 +20,19 @@ if [ "$(uname)" == "Darwin" ]; then EXE="Atom.app/Contents/MacOS/Atom" PLIST="Atom.app/Contents/Info.plist" RESOURCES="Atom.app/Contents/Resources" - PLATFORM_DIR="platform/mac" + PLATFORM_DIR="deploy/platform/mac" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then OS="linux" EXE="electron" RESOURCES="resources" - PLATFORM_DIR="platform/linux" + PLATFORM_DIR="deploy/platform/linux" elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then OS="windows" EXE="electron.exe" RESOURCES="resources" - PLATFORM_DIR="platform/win" + PLATFORM_DIR="deploy/platform/win" else echo "Cannot detect a supported OS." diff --git a/script/build.sh b/script/build.sh index 738626257..6672a4e7f 100755 --- a/script/build.sh +++ b/script/build.sh @@ -19,7 +19,7 @@ npm --version >/dev/null 2>&1 || { echo >&2 "Please install npm before running t cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. # Ensure we have current version of electron -pushd shell +pushd deploy/electron npm install grunt-cli npm install node_modules/.bin/grunt download-electron diff --git a/script/light.sh b/script/light.sh index 08bcab851..59886bb51 100755 --- a/script/light.sh +++ b/script/light.sh @@ -9,11 +9,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. DIR=$(pwd) if [ "$(uname)" == "Darwin" ]; then - CLI="${DIR}/shell/electron/Atom.app/Contents/MacOS/Atom" + CLI="${DIR}/deploy/electron/electron/Atom.app/Contents/MacOS/Atom" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - CLI="${DIR}/shell/electron/atom" + CLI="${DIR}/deploy/electron/electron/atom" elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then - CLI="${DIR}/shell/electron/atom.exe" + CLI="${DIR}/deploy/electron/electron/atom.exe" else echo "Cannot detect a supported OS." exit 1 From 6b7845a9cd3af258baf8a43b17f314f8581a638c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 28 Aug 2015 03:11:44 -0400 Subject: [PATCH 483/656] Clean up disjointed Electron app Electron app had two package.jsons and had parts of the app in deploy and the rest in deploy/core. This cleans that up and will be easier to understand --- deploy/core/main.js | 2 +- deploy/core/package.json | 18 ++++++++++++++++-- deploy/package.json | 17 ----------------- doc/electron-guide.md | 30 +++++++++--------------------- script/build-app.sh | 5 ++++- script/light.sh | 2 +- 6 files changed, 31 insertions(+), 43 deletions(-) delete mode 100644 deploy/package.json diff --git a/deploy/core/main.js b/deploy/core/main.js index b9cce09a8..8565292ed 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -12,7 +12,7 @@ var app = require('app'), // Module to control application life. var windows = {}; global.browserOpenFiles = []; // Track files for open-file event -var packageJSON = require(__dirname + '/../package.json'); +var packageJSON = require(__dirname + '/package.json'); function createWindow() { var browserWindowOptions = packageJSON.browserWindowOptions; diff --git a/deploy/core/package.json b/deploy/core/package.json index 411342eac..aac8b795c 100644 --- a/deploy/core/package.json +++ b/deploy/core/package.json @@ -1,6 +1,20 @@ { - "name": "LightTablePackages", - "description": "Vendored node dependencies for Light Table", + "name": "LightTable", + "description": "LightTable Electron App", + "version": "0.8.0", + "main": "main.js", + "browserWindowOptions": { + "icon": "img/lticon.png", + "width": 1024, + "height": 700, + "min-width": 400, + "min-height": 400, + "web-preferences": { + "webgl": true, + "webaudio": true, + "plugins": true + } + }, "dependencies": { "codemirror": "^4.7.0", "optimist": "^0.5.2", diff --git a/deploy/package.json b/deploy/package.json deleted file mode 100644 index 192ca0587..000000000 --- a/deploy/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "LightTable", - "version": "0.8.0", - "main": "core/main.js", - "browserWindowOptions": { - "icon": "img/lticon.png", - "width": 1024, - "height": 700, - "min-width": 400, - "min-height": 400, - "web-preferences": { - "webgl": true, - "webaudio": true, - "plugins": true - } - } -} diff --git a/doc/electron-guide.md b/doc/electron-guide.md index 5514e9019..68f3f0e03 100644 --- a/doc/electron-guide.md +++ b/doc/electron-guide.md @@ -4,37 +4,25 @@ Please read [Electron's Quick start](https://github.com/atom/electron/blob/maste ## Electron App Layout -A normal Electron app has this structure: +Light Table's Electron app has the following layout: ``` -electron-app/ +deploy/core/ ├── package.json ├── main.js -├── index.html +├── LightTable.html ├── node_modules/ -└── src/ -``` - -Light Table is structured with most files nested in core/ for historical reasons: - - -``` -deploy/ -├── package.json -├── core/main.js -├── core/LightTable.html -├── core/node_modules/ -└── ../src/ +└── ../../src/ ``` Description of each file/directory: -* [package.json](package.json) - This is a manifest file that sets the name, version and the js file to start the main process. To learn more about how Electron uses it [read the source](https://github.com/atom/electron/blob/c441dd143690aab71a925f0b941a6d9760768fa5/atom/browser/lib/init.coffee#L62). +* [package.json](../deploy/core/package.json) - This is a manifest file that sets the name, version and the js file to start the main process. To learn more about how Electron uses it [read the source](https://github.com/atom/electron/blob/c441dd143690aab71a925f0b941a6d9760768fa5/atom/browser/lib/init.coffee#L62). * Our package.json has an additional 'browserWindowOptions' key. This key is used by the main process to set [BrowserWindow](https://github.com/atom/electron/blob/master/docs/api/browser-window.md) options. This is placed in package.json because it is a declaration of an Electron app, like the rest of the file. -* [core/main.js](core/main.js) - This is the heart of the main process. _All_ GUI interactions run through this file. This also handles the CLI. Recommend understanding this file. -* [LightTable.html](LightTable.html) - This is the web page we see as our editor. It lives in the renderer process. -* [core/node\_modules](core/node_modules) - These are node packages used by the renderer process. These are described in [this doc](../doc/for-committers.md#node-packages) -* [../src/](../src) - This is the ClojureScript code that is run in the renderer process. It is [loaded by LightTable.html](https://github.com/LightTable/LightTable/blob/8e8d20a5da5d2ee42db4ff761eb2cd15a2c178b2/deploy/core/LightTable.html#L24-L40). +* [main.js](../deploy/core/main.js) - This is the heart of the main process. _All_ GUI interactions run through this file. This also handles the CLI. Recommend understanding this file. +* [LightTable.html](../deploy/core/LightTable.html) - This is the web page we see as our editor. It lives in the renderer process. +* [node\_modules](../deploy/core/node_modules) - These are node packages used by the renderer process. These are described in [this doc](../doc/for-committers.md#node-packages) +* [../../src/](../src) - This is the ClojureScript code that is run in the renderer process. It is [loaded by LightTable.html](https://github.com/LightTable/LightTable/blob/8e8d20a5da5d2ee42db4ff761eb2cd15a2c178b2/deploy/core/LightTable.html#L24-L40). ## Miscellaneous Pointers diff --git a/script/build-app.sh b/script/build-app.sh index a5c8ff3a4..8b18faba7 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -68,7 +68,10 @@ cp LICENSE.md $RELEASE_DIR/LICENSE mkdir $RELEASE_RSRC/app cp -R deploy/core $RELEASE_RSRC/app/ -cp deploy/package.json $RELEASE_RSRC/app/ +cp deploy/core/package.json $RELEASE_RSRC/app/ +# sed -i with arg is only cross platform way. -i '' doesn't work across platforms +sed -i.bak 's/"main.js"/"core\/main.js"/' $RELEASE_RSRC/app/package.json +rm $RELEASE_RSRC/app/package.json.bak cp -R deploy/settings $RELEASE_RSRC/app/ cp -R deploy/plugins "${RELEASE_RSRC}"/app/ rm -rf "${RELEASE_RSRC}"/app/plugins/*/.git diff --git a/script/light.sh b/script/light.sh index 59886bb51..ac6b197ad 100755 --- a/script/light.sh +++ b/script/light.sh @@ -19,4 +19,4 @@ else exit 1 fi -LT_DEV_CLI=true "$CLI" deploy "$@" +LT_DEV_CLI=true "$CLI" deploy/core "$@" From 71f81b425618b1cb905e6ec92734f54e8d88fb94 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 28 Aug 2015 03:16:20 -0400 Subject: [PATCH 484/656] Remove unused requires in main process --- deploy/core/main.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 8565292ed..b99065b06 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -2,9 +2,7 @@ var app = require('app'), // Module to control application life. BrowserWindow = require('browser-window'), // Module to create native browser window. - dialog = require("dialog"), ipc = require("ipc"), - fs = require('fs'), optimist = require('optimist'); // Keep a global reference of the window object, if you don't, the window will From 84b79288b1c2c8626f471d35d1fdc66e6fa87ee6 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 30 Aug 2015 16:10:09 -0400 Subject: [PATCH 485/656] Update electron to version that others can download - close #1958 This required script changes because executables and some directories were renamed from Atom to Electron. Also removed $EXE which wasn't used --- deploy/electron/Gruntfile.js | 2 +- deploy/platform/mac/Info.plist | 2 +- deploy/platform/mac/light | 2 +- script/build-app.sh | 14 +++++--------- script/light.sh | 6 +++--- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/deploy/electron/Gruntfile.js b/deploy/electron/Gruntfile.js index 3263bb31c..446d2db0d 100644 --- a/deploy/electron/Gruntfile.js +++ b/deploy/electron/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-electron": { - version: "0.22.1", + version: "0.31.1", outputDir: "./electron", rebuild: true } diff --git a/deploy/platform/mac/Info.plist b/deploy/platform/mac/Info.plist index efc0afb02..058a44636 100644 --- a/deploy/platform/mac/Info.plist +++ b/deploy/platform/mac/Info.plist @@ -153,7 +153,7 @@ CFBundleExecutable - Atom + Electron CFBundleIconFile app/core/img/app.icns CFBundleIdentifier diff --git a/deploy/platform/mac/light b/deploy/platform/mac/light index fc32f4aca..daf11bfcd 100755 --- a/deploy/platform/mac/light +++ b/deploy/platform/mac/light @@ -19,4 +19,4 @@ then exit 1 fi -LTCLI=true "${APP_DIR}/LightTable.app/Contents/MacOS/Atom" "$@" & +LTCLI=true "${APP_DIR}/LightTable.app/Contents/MacOS/Electron" "$@" & diff --git a/script/build-app.sh b/script/build-app.sh index 8b18faba7..d642fd5c6 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -14,23 +14,19 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. ELECTRON_DIR="deploy/electron/electron" # from: http://stackoverflow.com/a/17072017/142317 -# Will need to change Atom.app/atom/atom.exe to Electron.app/exe once we move to ^0.24.0 https://github.com/atom/grunt-download-electron/issues/30 if [ "$(uname)" == "Darwin" ]; then OS="mac" - EXE="Atom.app/Contents/MacOS/Atom" - PLIST="Atom.app/Contents/Info.plist" - RESOURCES="Atom.app/Contents/Resources" + PLIST="Electron.app/Contents/Info.plist" + RESOURCES="Electron.app/Contents/Resources" PLATFORM_DIR="deploy/platform/mac" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then OS="linux" - EXE="electron" RESOURCES="resources" PLATFORM_DIR="deploy/platform/linux" elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then OS="windows" - EXE="electron.exe" RESOURCES="resources" PLATFORM_DIR="deploy/platform/win" @@ -88,7 +84,7 @@ if [ "$OS" == "mac" ]; then FULL_PLIST="$(pwd)/$RELEASE_DIR/$PLIST" defaults write $FULL_PLIST CFBundleShortVersionString $VERSION - mv $RELEASE_DIR/Atom.app $RELEASE_DIR/LightTable.app + mv $RELEASE_DIR/Electron.app $RELEASE_DIR/LightTable.app # Sign app to avoid endless “accept incoming connections” dialogs codesign --force --deep --sign - $RELEASE_DIR/LightTable.app @@ -97,11 +93,11 @@ elif [ "$OS" == "linux" ]; then cp $PLATFORM_DIR/light $RELEASE_DIR/ - mv $RELEASE_DIR/atom $RELEASE_DIR/LightTable + mv $RELEASE_DIR/electron $RELEASE_DIR/LightTable elif [ "$OS" == "windows" ]; then - mv $RELEASE_DIR/atom.exe $RELEASE_DIR/LightTable.exe + mv $RELEASE_DIR/electron.exe $RELEASE_DIR/LightTable.exe fi diff --git a/script/light.sh b/script/light.sh index ac6b197ad..5e28ba78c 100755 --- a/script/light.sh +++ b/script/light.sh @@ -9,11 +9,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. DIR=$(pwd) if [ "$(uname)" == "Darwin" ]; then - CLI="${DIR}/deploy/electron/electron/Atom.app/Contents/MacOS/Atom" + CLI="${DIR}/deploy/electron/electron/Electron.app/Contents/MacOS/Electron" elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - CLI="${DIR}/deploy/electron/electron/atom" + CLI="${DIR}/deploy/electron/electron/electron" elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then - CLI="${DIR}/deploy/electron/electron/atom.exe" + CLI="${DIR}/deploy/electron/electron/electron.exe" else echo "Cannot detect a supported OS." exit 1 From ed8ffd2b657e3022b74249c793f0ff6f8f07c472 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 31 Aug 2015 18:07:09 -0400 Subject: [PATCH 486/656] Add $IPC_DEBUG for debugging ipc message interactions --- deploy/core/main.js | 21 +++++++++++++++++++++ doc/electron-guide.md | 1 + src/lt/util/ipc.cljs | 12 ++++++++++++ 3 files changed, 34 insertions(+) diff --git a/deploy/core/main.js b/deploy/core/main.js index b99065b06..8b65d974c 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -12,6 +12,7 @@ global.browserOpenFiles = []; // Track files for open-file event var packageJSON = require(__dirname + '/package.json'); +// Returns Window object function createWindow() { var browserWindowOptions = packageJSON.browserWindowOptions; browserWindowOptions.icon = __dirname + '/' + browserWindowOptions.icon; @@ -126,4 +127,24 @@ function start() { parseArgs(); }; +// Set $IPC_DEBUG to debug incoming and outgoing ipc messages for the main process +if (process.env["IPC_DEBUG"]) { + var oldOn = ipc.on; + ipc.on = function (channel, cb) { + oldOn.call(ipc, channel, function() { + console.log("\t\t\t\t\t->MAIN", channel, Array.prototype.slice.call(arguments).join(', ')); + cb.apply(null, arguments); + }); + }; + var logSend = function (window) { + var oldSend = window.webContents.send; + window.webContents.send = function () { + console.log("\t\t\t\t\tMAIN->", Array.prototype.slice.call(arguments).join(', ')); + oldSend.apply(window.webContents, arguments); + }; + }; + var oldCreateWindow = createWindow; + var createWindow = function() { logSend(oldCreateWindow()); }; +} + start(); diff --git a/doc/electron-guide.md b/doc/electron-guide.md index 68f3f0e03..72e6c7cda 100644 --- a/doc/electron-guide.md +++ b/doc/electron-guide.md @@ -28,6 +28,7 @@ Description of each file/directory: * Communication between `main.js` (main process) and ClojureScript code (renderer process) happens through [ipc messages](https://github.com/atom/electron/blob/master/docs/api/ipc-main-process.md) and [remote objects](https://github.com/atom/electron/blob/master/docs/api/remote.md). * For example, when a window [receives a focus event](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/main.js#L33-L36), the main process sends an ipc message on the "app" channel to the renderer process. The renderer process [receives that message](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/src/lt/objs/app.cljs#L228) and invokes a :focus trigger on the app object. + * IPC messages between the main and renderer process can be logged in the terminal with $IPC\_DEBUG e.g. `IPC_DEBUG=1 script/light.sh`. * We use [webview](https://github.com/atom/electron/blob/master/docs/api/web-view-tag.md) for our browser. * We use [remote-debugging-port](https://github.com/atom/electron/blob/1bc49487add140f22ea4e454dcb0050e08679b4b/docs/api/chrome-command-line-switches.md#--remote-debugging-portport) to do browser eval. diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs index a638ebad0..df1691b51 100644 --- a/src/lt/util/ipc.cljs +++ b/src/lt/util/ipc.cljs @@ -12,3 +12,15 @@ "Delegates to ipc.on which defines a callback to fire for the given channel." [channel cb] (.on ipc channel cb)) + +;; Set $IPC_DEBUG to debug incoming and outgoing ipc messages for the renderer process +(when (aget js/process.env "IPC_DEBUG") + (let [old-send send + old-on on] + (def send (fn [& args] + (prn "RENDERER->" args) + (apply old-send args))) + (def on (fn [channel cb] + (old-on channel (fn [& args] + (prn "->RENDERER" channel args) + (apply cb args))))))) From b46051532cbb33fcfafc08bb48d912b0cabfce36 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 31 Aug 2015 23:26:32 -0400 Subject: [PATCH 487/656] Use io.js for dev. We already use it with electron --- doc/developer-install.md | 2 +- doc/for-committers.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index 5a2a0f042..58a1fbd67 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -3,7 +3,7 @@ ## Prerequisites - [Leiningen 2.x](http://leiningen.org/) -- [Node.js and npm](http://nodejs.org/download/) +- [io.js and npm](https://iojs.org/). To avoid clobbering an existing node install, [use nvm](https://github.com/creationix/nvm). ## OS Specific Prerequisites diff --git a/doc/for-committers.md b/doc/for-committers.md index 7ec2349cd..7c7cf8e58 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -13,7 +13,7 @@ Current ClojureScript version and libraries we use are in [project.clj](https:// ### Node packages -Node package installs last done with node v0.12.7 and npm v2.12.1. +Node package installs last done with io.js v2.5.0 and npm v2.13.2. Node dependencies are at deploy/core/node\_modules/. This directory is currently a mix of vendored dependencies, forked dependencies and Light Table specific libraries: From 780cecdb6d5574896d80088168ede81264a3f016 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 31 Aug 2015 23:40:09 -0400 Subject: [PATCH 488/656] grunt-cli should be tracked like any other node dep --- deploy/electron/package.json | 1 + script/build.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/electron/package.json b/deploy/electron/package.json index 5109e1bff..0b786a657 100644 --- a/deploy/electron/package.json +++ b/deploy/electron/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "devDependencies": { "grunt": "^0.4.5", + "grunt-cli": "^0.1.13", "grunt-download-electron": "^2.0.0" } } diff --git a/script/build.sh b/script/build.sh index 6672a4e7f..4ec45f067 100755 --- a/script/build.sh +++ b/script/build.sh @@ -20,7 +20,6 @@ cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. # Ensure we have current version of electron pushd deploy/electron - npm install grunt-cli npm install node_modules/.bin/grunt download-electron popd From a0802cf07b1029f42f9ba05b381616a429bc7dc6 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 3 Sep 2015 01:04:02 -0400 Subject: [PATCH 489/656] Update electron version to match current version --- deploy/core/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/version.json b/deploy/core/version.json index 8625c2af3..5fc368011 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.7.2","electron":"0.19.5"} +{"version":"0.7.2","electron":"0.31.1"} From fcfe6f06f904d21e09ce6acdb5e80951b3039e59 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 7 Sep 2015 22:14:40 -0400 Subject: [PATCH 490/656] Forgot to update process.versions when updating to newer electron --- src/lt/objs/deploy.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 9d0d05f04..58cf07a75 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -157,8 +157,7 @@ "Binary/electron version. The two versions are in sync since binaries updates only occur with electron updates." [] - ;; Still identifies as old electron name until we use a recent electron version - (aget js/process.versions "atom-shell")) + (aget js/process.versions "electron")) (defui button [label & [cb]] [:div.button.right label] From e567412386a2127a70577b01701cf0a426010c08 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Wed, 9 Sep 2015 18:28:24 -0400 Subject: [PATCH 491/656] Optionally zip release files after app build (for Windows). --- script/build-app.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 80597e1dd..7906f17ae 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -52,9 +52,10 @@ BUILDS=builds RELEASE="$NAME-$VERSION-$OS" RELEASE_DIR="$BUILDS/$RELEASE" RELEASE_TARBALL="$BUILDS/${RELEASE}.tar.gz" +RELEASE_ZIP="${RELEASE}.zip" RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" -rm -rf $RELEASE_DIR $RELEASE_TARBALL +rm -rf $RELEASE_DIR $RELEASE_TARBALL $RELEASE_ZIP #---------------------------------------------------------------------- # Copy Electron installation and app directory into output location @@ -103,11 +104,18 @@ elif [ "$OS" == "windows" ]; then fi #---------------------------------------------------------------------- -# Create tarball +# Create tarball or zip file #---------------------------------------------------------------------- if [ "$1" == "--tarball" ]; then tar -zcvf $RELEASE_TARBALL $RELEASE_DIR fi +# Create zip file for Cygwin (Windows) using 7-Zip +if [ "$1" == "--zip" ]; then + pushd "$BUILDS" + "/cygdrive/c/Program Files/7-Zip/7z.exe" a $RELEASE_ZIP "$RELEASE/*" + popd +fi + echo DONE! From 87f7503d6b532c5910e7a9726ef1dd41b042bf16 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Thu, 10 Sep 2015 21:13:39 -0400 Subject: [PATCH 492/656] Remove extraneous 'builds' directory in tarball contents. --- script/build-app.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index fb831e20e..33a214bf6 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -47,11 +47,12 @@ DEFAULT_VERSION=`echo $META | cut -d' ' -f3 | tr -d '"'` BUILDS=builds RELEASE="$NAME-$VERSION-$OS" RELEASE_DIR="$BUILDS/$RELEASE" -RELEASE_TARBALL="$BUILDS/${RELEASE}.tar.gz" +RELEASE_TARBALL="${RELEASE}.tar.gz" RELEASE_ZIP="${RELEASE}.zip" RELEASE_RSRC="$RELEASE_DIR/$RESOURCES" rm -rf $RELEASE_DIR $RELEASE_TARBALL $RELEASE_ZIP +rm -rf $RELEASE_DIR "$BUILDS/$RELEASE_TARBALL" "$BUILDS/$RELEASE_ZIP" #---------------------------------------------------------------------- # Copy Electron installation and app directory into output location @@ -107,7 +108,9 @@ fi #---------------------------------------------------------------------- if [ "$1" == "--tarball" ]; then - tar -zcvf $RELEASE_TARBALL $RELEASE_DIR + pushd $BUILDS + tar -zcvf $RELEASE_TARBALL $RELEASE/* + popd fi # Create zip file for Cygwin (Windows) using 7-Zip From c1d5e4ada2e4bbe960d32c87721b0e38552e0d02 Mon Sep 17 00:00:00 2001 From: rundis Date: Wed, 2 Sep 2015 00:13:05 +0200 Subject: [PATCH 493/656] Ensure that clean-up behaviors are raised on close and prompts for unsaved are handled #1961 --- deploy/core/main.js | 6 ++++++ src/lt/objs/app.cljs | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/deploy/core/main.js b/deploy/core/main.js index 8b65d974c..b05b0997f 100644 --- a/deploy/core/main.js +++ b/deploy/core/main.js @@ -51,6 +51,12 @@ function createWindow() { // and load the index.html of the app. window.loadUrl('file://' + __dirname + '/LightTable.html?id=' + window.id); + // Notify LT that the user requested to close the window/app + window.on("close", function(evt) { + window.webContents.send("app", "close!"); + evt.preventDefault(); + }); + // Emitted when the window is closed. window.on('closed', function() { windows[window.id] = null; diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index aaa64f64a..4ce73ee91 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -34,10 +34,12 @@ (defn close ([] (close false)) ([force?] - (when force? - (object/raise app :closing) - (object/raise app :closed)) - (.close win))) + (if force? + (do + (object/raise app :closing) + (object/raise app :closed) + (.destroy win)) + (.close win)))) (defn refresh [] (js/window.location.reload true)) @@ -227,8 +229,6 @@ ;; Handles events e.g. focus, blur and close (ipc/on "app" #(object/raise app (keyword %))) -(set! (.-onbeforeunload js/window) (fn [] - "This will navigate the main LT window and all work will be lost, are you sure you want to do this?")) ;;********************************************************* ;; Commands From d0b17cf0a323c79bd551c4d0308831031add9d35 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 14 Sep 2015 01:53:56 -0400 Subject: [PATCH 494/656] Destroy devtools-client along with parent browser - close #1975 When a browser tab was closed, it left behind its devtools-client object. This caused a bug with the :clear-console command which would find these dangling objects with a closed socket and raise an exception when trying to send a message to it --- src/lt/objs/browser.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index 96a22aec9..ccf902145 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -139,6 +139,7 @@ :triggers #{:close} :reaction (fn [this] (object/raise this :inactive) + (object/destroy! (:devtools-client @this)) (object/destroy! this))) (behavior ::rem-client From 91041f0a81883826b965d56bbccb197c6a83add9 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Tue, 1 Sep 2015 17:45:22 -0400 Subject: [PATCH 495/656] Bump version of JavaScript default plugin to latest. --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 4ec45f067..5240210d6 100755 --- a/script/build.sh +++ b/script/build.sh @@ -33,7 +33,7 @@ fi lein cljsbuild clean && lein cljsbuild once # Fetch plugins -PLUGINS=("Clojure,0.1.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.2" +PLUGINS=("Clojure,0.1.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.3" "Paredit,0.0.4" "Python,0.0.5" "Rainbow,0.0.8") # Plugins cache From 56ea370419ca7184148b234228f9c737d133f9c5 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Wed, 16 Sep 2015 17:32:08 -0400 Subject: [PATCH 496/656] Bump Clojure and Python plugins to the latest versions. --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build.sh b/script/build.sh index 5240210d6..93c41b722 100755 --- a/script/build.sh +++ b/script/build.sh @@ -33,8 +33,8 @@ fi lein cljsbuild clean && lein cljsbuild once # Fetch plugins -PLUGINS=("Clojure,0.1.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.3" - "Paredit,0.0.4" "Python,0.0.5" "Rainbow,0.0.8") +PLUGINS=("Clojure,0.1.3" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.3" + "Paredit,0.0.4" "Python,0.0.7" "Rainbow,0.0.8") # Plugins cache mkdir -p deploy/plugins From baf319e9d3159dad13f2c7dc6fad3569a18a7e55 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 20 Sep 2015 12:51:46 -0400 Subject: [PATCH 497/656] Workspace behaviors no longer triggers incorrect dialogs Dialogs were being incorrectly triggered by :path. Opening a workspace behavior with `Settings: Workspace behaviors` triggered a confusing dialog: "File deleted: workspace.behaviors This file seems to have been deleted and we've marked it as unsaved. Saving workspace behaviors also triggered a dialog to save to disk which is invalid since these behaviors don't persist to a file. --- src/lt/objs/settings.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index b75118f9c..ec16ca70a 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -382,8 +382,7 @@ (cmd/command {:command :behaviors.modify-workspace :desc "Settings: Workspace behaviors" :exec (fn [] - (cmd/exec! :opener.open-info {:path "workspace.behaviors" - :mime "text/x-clojure" + (cmd/exec! :opener.open-info {:mime "text/x-clojure" :name "workspace.behaviors" :tags [:editor.behaviors :editor.behaviors.workspace] :content (:ws-behaviors @workspace/current-ws "")}))}) From 44a0da1ab41abd5de0fa3ea071d35eae611a3984 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 20 Sep 2015 13:18:20 -0400 Subject: [PATCH 498/656] workspace.behaviors should support the new flat format Flat behaviors/keymaps was introduced in 0.7.0. Not supporting it in workspace.behaviors is confusing and inconsistent --- src/lt/objs/settings.cljs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index ec16ca70a..bfa015141 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -106,14 +106,17 @@ (sort-by first) (vec)))) -(defn parse-file [file] - (let [behs (-> (files/open-sync file) - :content - (safe-read file))] - (cond +(defn parse-behaviors [behs file] + (cond (map? behs) behs (vector? behs) (flat-behaviors->map behs) - :else (console/error (str "Invalid behaviors file: " file ". Behaviors must be either a vector or a map."))))) + :else (console/error (str "Invalid behaviors file: " file ". Behaviors must be either a vector or a map.")))) + +(defn parse-file [file] + (parse-behaviors (-> (files/open-sync file) + :content + (safe-read file)) + file)) (defn pprint-flat-behaviors [flat] (-> (reduce (fn [result cur] @@ -145,7 +148,9 @@ )) ws-diff (:ws-behaviors @workspace/current-ws) final (if (and ws-diff (not (empty? ws-diff))) - (behavior-diff (safe-read ws-diff "workspace.behaviors") final) + (behavior-diff (parse-behaviors (safe-read ws-diff "workspace.behaviors") + "workspace.behaviors") + final) final)] (reset! object/negated-tags (or (:- final) {})) (reset! object/tags (or (:+ final) {})))) @@ -279,10 +284,10 @@ :reaction (fn [workspace old] (let [old (:ws-behaviors old) old (when-not (empty? old) - (reader/read-string old)) + (parse-behaviors (reader/read-string old) "workspace.behaviors")) neue (:ws-behaviors @workspace) neue (when-not (empty? neue) - (reader/read-string neue))] + (parse-behaviors (reader/read-string neue) "workspace.behaviors"))] (when old (apply-diff (reverse-diff old)) (refresh-diffed old)) From f92132d841846c82990c9bb5acfe7748602bdce8 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 21 Sep 2015 01:50:26 -0400 Subject: [PATCH 499/656] Fix installing a plugin doesn't load new behavior- close #1970 Order of the refresh! and behaviors.reload matters because refresh! adds the new plugins to ::plugins and behaviors.reload depends on ::plugins. Also updated update as it has the stale ::plugins issue as install --- src/lt/objs/plugins.cljs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 2b9b30827..daa128668 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -492,8 +492,8 @@ (dom/prevent e) (dom/stop-propagation e) (discover-deps plugin (fn [] - (cmd/exec! :behaviors.reload) - (object/raise manager :refresh!))))) + (object/raise manager :refresh!) + (cmd/exec! :behaviors.reload))))) (defui install-button [plugin] [:span.install] @@ -501,8 +501,8 @@ (this-as me (discover-deps plugin (fn [] (dom/remove (dom/parent me)) - (cmd/exec! :behaviors.reload) - (object/raise manager :refresh!)))) + (object/raise manager :refresh!) + (cmd/exec! :behaviors.reload)))) (dom/prevent e) (dom/stop-propagation e))) From 1135d2f19c8810d4b14063f71723c89cbc8ed004 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 22 Sep 2015 00:56:09 -0400 Subject: [PATCH 500/656] Fix uninstall popping up erroneous messages - close #1944 Fixed by explicitly turnining off missing checks with :ignore-missing. While this already existed on one of the :refresh! behaviors, it needed to exist on the other :refresh! behavior --- src/lt/objs/plugins.cljs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index daa128668..d23e95777 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -446,7 +446,8 @@ (defn uninstall [plugin] (when (:dir plugin) (files/delete! (:dir plugin)) - (object/raise manager :refresh!))) + ;; :ignore-missing b/c uninstalled shows up missing + (object/raise manager :refresh! :ignore-missing true))) ;;********************************************************* ;; Manager ui @@ -644,16 +645,15 @@ (behavior ::save-user-plugin-dependencies :triggers #{:refresh!} :desc "Saves dependencies to user's plugin.edn" - :reaction (fn [this] + :reaction (fn [this & opts] ;; Use available-plugins b/c ::plugins aren't always up to date e.g. uninstall - ;; :ignore-missing to avoid missing popup on uninstall (save-plugins (available-plugins :ignore-missing true)))) (behavior ::render-installed-plugins :triggers #{:refresh!} :desc "Plugin Manager: refresh installed plugins" - :reaction (fn [this plugins] - (object/merge! app/app {::plugins (available-plugins)}) + :reaction (fn [this & opts] + (object/merge! app/app {::plugins (apply available-plugins opts)}) (let [ul (dom/$ :.plugins (object/->content this))] (dom/empty ul) (dom/append ul (dom/fragment (map installed-plugin-ui (->> @app/app ::plugins vals (sort-by #(.toUpperCase (:name %)))))))))) From 37a07cb03b282ff9b7a4635223579e967f89abcf Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 22 Sep 2015 01:12:05 -0400 Subject: [PATCH 501/656] Split up available-plugins monolithic fn available-plugins was returning a useful plugins map and checking missing plugins. By splitting up this fn, save-user-plugin-dependencies is finally able to use just part of the fn that it needs and remove an akward use of options --- src/lt/objs/plugins.cljs | 65 ++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index d23e95777..61a830ff6 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -411,37 +411,41 @@ (doseq [dep missing] (discover-deps dep count-down)))) +(defn check-missing + "Check a plugins map for outdated or missing :dependencies and prompt + to install missing ones" + [deps] + (when-let [missing? (missing-deps deps)] + (popup/popup! {:header "Some plugin dependencies are missing." + :body [:div + [:span "We found that the following plugin dependencies are missing: "] + (for [{:keys [name version]} missing?] + [:div name " " version " "]) + [:span "Would you like us to install them?"]] + :buttons [{:label "Cancel"} + {:label "Install all" + :action (fn [] + (install-missing missing?))}]}))) + (defn available-plugins - [& {:keys [ignore-missing]}] + "Return a map of plugins by plugin name based on what's read from filesystem" + [] (let [ds (concat (files/dirs user-plugins-dir) (files/dirs plugins-dir) [settings/user-plugin-dir]) plugins (->> ds (map plugin-info) - (filterv identity)) - final (-> (reduce (fn [final p] - (if-let [cur (get final (:name p))] - ;;check if it's newer - (if (deploy/is-newer? (:version cur) (:version p)) - (assoc! final (:name p) p) - final) - (assoc! final (:name p) p))) - (transient {}) - plugins) - (persistent!)) - missing? (missing-deps final)] - (when (and missing? (not ignore-missing)) - (popup/popup! {:header "Some plugin dependencies are missing." - :body [:div - [:span "We found that the following plugin dependencies are missing: "] - (for [{:keys [name version]} missing?] - [:div name " " version " "]) - [:span "Would you like us to install them?"]] - :buttons [{:label "Cancel"} - {:label "Install all" - :action (fn [] - (install-missing missing?))}]})) - final)) + (filterv identity))] + (-> (reduce (fn [final p] + (if-let [cur (get final (:name p))] + ;;check if it's newer + (if (deploy/is-newer? (:version cur) (:version p)) + (assoc! final (:name p) p) + final) + (assoc! final (:name p) p))) + (transient {}) + plugins) + (persistent!)))) (defn uninstall [plugin] (when (:dir plugin) @@ -647,13 +651,15 @@ :desc "Saves dependencies to user's plugin.edn" :reaction (fn [this & opts] ;; Use available-plugins b/c ::plugins aren't always up to date e.g. uninstall - (save-plugins (available-plugins :ignore-missing true)))) + (save-plugins (available-plugins)))) (behavior ::render-installed-plugins :triggers #{:refresh!} :desc "Plugin Manager: refresh installed plugins" - :reaction (fn [this & opts] - (object/merge! app/app {::plugins (apply available-plugins opts)}) + :reaction (fn [this & {:keys [ignore-missing]}] + (object/merge! app/app {::plugins (available-plugins)}) + (when-not ignore-missing + (check-missing (::plugins @app/app))) (let [ul (dom/$ :.plugins (object/->content this))] (dom/empty ul) (dom/append ul (dom/fragment (map installed-plugin-ui (->> @app/app ::plugins vals (sort-by #(.toUpperCase (:name %)))))))))) @@ -721,7 +727,8 @@ (object/raise app/app :create-user-plugin) (object/raise app/app :flatten-map-settings) ;;load enabled plugins - (object/merge! app/app {::plugins (available-plugins)}))) + (object/merge! app/app {::plugins (available-plugins)}) + (check-missing (::plugins @app/app)))) (behavior ::behaviors.refreshed-load-keys :triggers #{:behaviors.refreshed} From 958c592f9951c9b92a8a8774183bf1cdf7af4a1f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 22 Sep 2015 09:00:23 -0400 Subject: [PATCH 502/656] Remove redundant comment per feedback --- src/lt/objs/plugins.cljs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 61a830ff6..500248ca1 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -121,7 +121,6 @@ (-> (reduce (fn [final [name version]] (let [name (cljs.core/name name)] (if-let [cur (or (get all name) (get final name))] - ;;check if it's newer (if (deploy/is-newer? (:version cur) version) (assoc! final name {:name name :version version}) From d550129b565d80941f9c2e9d362e07f2aced1634 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 23 Sep 2015 00:24:10 -0400 Subject: [PATCH 503/656] Rely on clj->js + js->clj that comes with ClojureScript --- src/lt/objs/cli.cljs | 1 - src/lt/objs/clients/devtools.cljs | 1 - src/lt/objs/clients/tcp.cljs | 3 +- src/lt/objs/clients/ws.cljs | 1 - src/lt/objs/editor.cljs | 3 +- src/lt/objs/langs/behaviors.cljs | 3 +- src/lt/objs/langs/keymap.cljs | 3 +- src/lt/objs/sidebar/navigate.cljs | 3 +- src/lt/objs/workspace.cljs | 2 +- src/lt/util/cljs.cljs | 59 ++----------------------------- 10 files changed, 9 insertions(+), 70 deletions(-) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index e4c92c4e3..4f45363d8 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -6,7 +6,6 @@ [lt.objs.files :as files] [lt.objs.workspace :as workspace] [lt.objs.command :as cmd] - [lt.util.cljs :refer [js->clj]] [clojure.string :as string] [lt.util.ipc :as ipc] [lt.objs.opener :as opener]) diff --git a/src/lt/objs/clients/devtools.cljs b/src/lt/objs/clients/devtools.cljs index d30d83e50..f58201d1f 100644 --- a/src/lt/objs/clients/devtools.cljs +++ b/src/lt/objs/clients/devtools.cljs @@ -12,7 +12,6 @@ [crate.core :as crate] [lt.util.dom :as dom] [lt.util.js :refer [every wait ->clj]] - [lt.util.cljs :refer [js->clj]] [lt.util.ipc :as ipc] [crate.binding :refer [bound subatom]] [clojure.string :as string]) diff --git a/src/lt/objs/clients/tcp.cljs b/src/lt/objs/clients/tcp.cljs index 32a1d563c..98fd77568 100644 --- a/src/lt/objs/clients/tcp.cljs +++ b/src/lt/objs/clients/tcp.cljs @@ -5,8 +5,7 @@ [lt.object :as object] [lt.objs.clients :as clients] [lt.objs.console :as console] - [clojure.string :as string] - [lt.util.cljs :refer [js->clj]]) + [clojure.string :as string]) (:require-macros [lt.macros :refer [behavior]])) (def port 0) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index aebda5117..09b1f3a4f 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -6,7 +6,6 @@ [lt.objs.files :as files] [lt.objs.clients :as clients] [lt.util.load :as load] - [lt.util.cljs :refer [js->clj]] [clojure.string :as string]) (:use [lt.util.js :only [wait ->clj]]) (:require-macros [lt.macros :refer [behavior]])) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index f9588ece9..f2f86ced5 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -14,8 +14,7 @@ [lt.util.load :as load] [lt.objs.platform :as platform]) (:use [lt.util.dom :only [remove-class add-class]] - [lt.object :only [object* behavior*]] - [lt.util.cljs :only [js->clj]]) + [lt.object :only [object* behavior*]]) (:require-macros [lt.macros :refer [behavior]])) (defn ->cm-ed diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 8f4dfa8e2..559f2bafb 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -6,8 +6,7 @@ [lt.util.dom :as dom] [lt.objs.editor :as editor] [clojure.string :as string] - [lt.util.js :refer [wait]] - [lt.util.cljs :refer [js->clj]]) + [lt.util.js :refer [wait]]) (:require-macros [lt.macros :refer [behavior background defui]])) (def flat-parser (background (fn [obj-id contents] diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index f735c38c3..31cb878db 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -6,8 +6,7 @@ [lt.util.dom :as dom] [lt.objs.langs.behaviors :as beh] [lt.objs.editor :as editor] - [clojure.string :as string] - [lt.util.cljs :refer [js->clj]]) + [clojure.string :as string]) (:require-macros [lt.macros :refer [behavior background defui]])) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index ddcb0a4e8..3a257f0be 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -11,7 +11,6 @@ [lt.objs.sidebar :as sidebar] [lt.util.dom :as dom] [lt.util.load :as load] - [lt.util.cljs :as cljs-util] [crate.core :as crate] [crate.binding :refer [bound subatom]]) (:require-macros [lt.macros :refer [behavior defui background]])) @@ -42,7 +41,7 @@ (behavior ::workspace-files :triggers #{:workspace-files} :reaction (fn [this files] - (object/merge! this {:files (cljs-util/js->clj files :keywordize-keys true)}) + (object/merge! this {:files (js->clj files :keywordize-keys true)}) (object/raise (:filter-list @this) :refresh!) )) diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index f917d083f..59d97777e 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -9,7 +9,7 @@ [cljs.reader :as reader] [lt.util.load :as load] [lt.util.js :refer [now]] - [lt.util.cljs :refer [->dottedkw js->clj]]) + [lt.util.cljs :refer [->dottedkw]]) (:require-macros [lt.macros :refer [behavior]])) ;;********************************************************* diff --git a/src/lt/util/cljs.cljs b/src/lt/util/cljs.cljs index 18ffc7c89..a516e3d09 100644 --- a/src/lt/util/cljs.cljs +++ b/src/lt/util/cljs.cljs @@ -51,62 +51,9 @@ (defn ->dottedkw [& args] (keyword (string/join "." (map name (filter identity args))))) -(defn js->clj - "Recursively transforms JavaScript arrays into ClojureScript - vectors, and JavaScript objects into ClojureScript maps. With - option ':keywordize-keys true' will convert object fields from - strings to keywords." - ([x] (js->clj x {:keywordize-keys false})) - ([x & opts] - (cond - (satisfies? IEncodeClojure x) - (-js->clj x (apply array-map opts)) - - (seq opts) - (let [{:keys [keywordize-keys force-obj]} opts - keyfn (if keywordize-keys keyword str) - f (fn thisfn [x] - (cond - (seq? x) - (doall (map thisfn x)) - - (coll? x) - (into (empty x) (map thisfn x)) - - (keyword? x) - x - - (or (array? x) - (identical? (type x) js/global.Array)) - (vec (map thisfn x)) - - (or force-obj - (identical? x (js/Object x)) - (identical? (type x) js/Object) - (identical? (type x) js/global.Object)) - (into {} (for [k (js-keys x)] - [(keyfn k) (thisfn (aget x k))])) - - :else x))] - (f x))))) - -(defn clj->js - "Recursively transforms ClojureScript values to JavaScript. -sets/vectors/lists become Arrays, Keywords and Symbol become Strings, -Maps become Objects. Arbitrary keys are encoded to by key->js." - [x] - (when-not (nil? x) - (if (satisfies? IEncodeJS x) - (-clj->js x) - (cond - (keyword? x) (name x) - (symbol? x) (str x) - (map? x) (let [m (js-obj)] - (doseq [[k v] x] - (aset m (key->js k) (clj->js v))) - m) - (coll? x) (apply array (map clj->js x)) - :else x)))) +;; TODO: Remove once remove these references from Clojure, Python and JS plugins +(defn js->clj [& args] + (apply cljs.core/js->clj args)) (defn str-contains? [str x] (> (.indexOf str x) -1)) From d7ff12b082354a1ee22356839e80d7bd173fb1df Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 23 Sep 2015 01:03:14 -0400 Subject: [PATCH 504/656] JSON should be prefixed with js/ --- src/lt/objs/plugins.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 500248ca1..2bc2e632d 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -216,7 +216,7 @@ cache)) (defn save-cache [cache] - (files/save metadata-cache (JSON/stringify (clj->js cache)))) + (files/save metadata-cache (js/JSON.stringify (clj->js cache)))) (defn latest-metadata-sha [] (fetch/xhr [:get metadata-commits] {} @@ -252,7 +252,7 @@ (if (files/exists? metadata-cache) (-> (files/open-sync metadata-cache) (:content) - (JSON/parse) + (js/JSON.parse) (js->clj :keywordize-keys true)))) (defn search-plugins [plugins search] From 12a7ffd27dbd1cce400d1dd63dad699c7493be9b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 23 Sep 2015 01:23:12 -0400 Subject: [PATCH 505/656] Fix remaining compilation warnings in 1.7.48 * read-only behavior is defined twice * missing require * fpath is defined twice * Outdated extend-type method shape --- src/lt/objs/editor.cljs | 5 ----- src/lt/objs/eval.cljs | 1 + src/lt/util/dom.cljs | 18 ++++++++++-------- src/lt/util/load.cljs | 2 -- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index f2f86ced5..25362d7a0 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -458,11 +458,6 @@ ;;********************************************************* -(behavior ::read-only - :triggers #{:init} - :reaction (fn [obj] - (set-options (:ed @obj) {:readOnly "nocursor"}))) - (behavior ::wrap :triggers #{:object.instant :lt.object/tags-removed} :desc "Editor: Wrap lines" diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 9c620a41e..93de00429 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -17,6 +17,7 @@ [lt.objs.console :as console] [lt.util.dom :as dom] [clojure.string :as string] + [cljs.reader :as reader] [lt.objs.platform :as platform]) (:require-macros [lt.macros :refer [behavior defui]])) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index 429294e5e..d0148a0f7 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -17,10 +17,11 @@ (-count [this] (.-length this)) IIndexed - (-nth [this n] - (.item this n)) - (-nth [this n not-found] - (or (.item this n) not-found))) + (-nth + ([this n] + (.item this n)) + ([this n not-found] + (or (.item this n) not-found)))) (extend-type js/NodeList ISeqable @@ -30,10 +31,11 @@ (-count [this] (.-length this)) IIndexed - (-nth [this n] - (.item this n)) - (-nth [this n not-found] - (or (.item this n) not-found))) + (-nth + ([this n] + (.item this n)) + ([this n not-found] + (or (.item this n) not-found)))) (defn text-node [text] (js/document.createTextNode text)) diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index 57769ba45..f204be6b8 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -9,8 +9,6 @@ (def ^:dynamic *force-reload* false) -(def fpath (js/require "path")) - (def separator (.-sep fpath)) (defn absolute? [path] From 6c591fc3f7b82f70400a0c343dd4bfd819fa9014 Mon Sep 17 00:00:00 2001 From: Benjamin Van Ryseghem Date: Sun, 23 Aug 2015 14:31:12 +0200 Subject: [PATCH 506/656] Compile automatically `cljsDeps.js` --- cljsdeps/core.cljs | 4 ++++ project.clj | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 cljsdeps/core.cljs diff --git a/cljsdeps/core.cljs b/cljsdeps/core.cljs new file mode 100644 index 000000000..24bac2c3e --- /dev/null +++ b/cljsdeps/core.cljs @@ -0,0 +1,4 @@ +(ns cljsdeps.core + (:require [clojure.string :as string] + [clojure.walk :as walk] + [cljs.reader :as reader])) diff --git a/project.clj b/project.clj index c26d20147..3863c72fc 100644 --- a/project.clj +++ b/project.clj @@ -14,7 +14,12 @@ :source-map "deploy/core/node_modules/lighttable/bootstrap.js.map" :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" - :pretty-print true}}]} + :pretty-print true}} + {:source-paths ["cljsdeps"] + :compiler {:optimizations :simple + :output-to "deploy/core/node_modules/clojurescript/cljsDeps.js" + :output-dir "deploy/core/node_modules/clojurescript/cljsDeps/" + :pretty-print true }}]} :plugins [[lein-cljsbuild "1.0.1"]] :source-paths ["src/"] ) From 0b410e0ec220663485812281c54106668af625da Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 23 Sep 2015 01:53:04 -0400 Subject: [PATCH 507/656] Organize+move cljsdeps and add cljsbuild target ids Verified generated cljsdeps still works fine --- .gitignore | 1 + cljsdeps/core.cljs | 4 - .../node_modules/clojurescript/cljsDeps.js | 9370 +++++++++-------- project.clj | 6 +- src-cljsdeps/core.cljs | 7 + 5 files changed, 4788 insertions(+), 4600 deletions(-) delete mode 100644 cljsdeps/core.cljs create mode 100644 src-cljsdeps/core.cljs diff --git a/.gitignore b/.gitignore index 3a36a8926..d7faae6b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /deploy/core/node_modules/lighttable/cljs/ +/deploy/core/node_modules/clojurescript/cljsDeps/ /target/ /deploy/plugins/ .DS_Store diff --git a/cljsdeps/core.cljs b/cljsdeps/core.cljs deleted file mode 100644 index 24bac2c3e..000000000 --- a/cljsdeps/core.cljs +++ /dev/null @@ -1,4 +0,0 @@ -(ns cljsdeps.core - (:require [clojure.string :as string] - [clojure.walk :as walk] - [cljs.reader :as reader])) diff --git a/deploy/core/node_modules/clojurescript/cljsDeps.js b/deploy/core/node_modules/clojurescript/cljsDeps.js index 51fd9126c..4b582cf28 100644 --- a/deploy/core/node_modules/clojurescript/cljsDeps.js +++ b/deploy/core/node_modules/clojurescript/cljsDeps.js @@ -4,70 +4,70 @@ goog.DEBUG = !0; goog.LOCALE = "en"; goog.TRUSTED_SITE = !0; goog.provide = function(a) { - if(!COMPILED) { - if(goog.isProvided_(a)) { + if (!COMPILED) { + if (goog.isProvided_(a)) { throw Error('Namespace "' + a + '" already declared.'); } delete goog.implicitNamespaces_[a]; - for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { - goog.implicitNamespaces_[b] = !0 + for (var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) { + goog.implicitNamespaces_[b] = !0; } } - goog.exportPath_(a) + goog.exportPath_(a); }; goog.setTestOnly = function(a) { - if(COMPILED && !goog.DEBUG) { + if (COMPILED && !goog.DEBUG) { throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); } }; COMPILED || (goog.isProvided_ = function(a) { - return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a) + return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a); }, goog.implicitNamespaces_ = {}); goog.exportPath_ = function(a, b, c) { a = a.split("."); c = c || goog.global; a[0] in c || !c.execScript || c.execScript("var " + a[0]); - for(var d;a.length && (d = a.shift());) { - !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {} + for (var d;a.length && (d = a.shift());) { + !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {}; } }; goog.getObjectByName = function(a, b) { - for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) { - if(goog.isDefAndNotNull(d[e])) { - d = d[e] - }else { - return null + for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) { + if (goog.isDefAndNotNull(d[e])) { + d = d[e]; + } else { + return null; } } - return d + return d; }; goog.globalize = function(a, b) { var c = b || goog.global, d; - for(d in a) { - c[d] = a[d] + for (d in a) { + c[d] = a[d]; } }; goog.addDependency = function(a, b, c) { - if(!COMPILED) { + if (!COMPILED) { var d; a = a.replace(/\\/g, "/"); - for(var e = goog.dependencies_, f = 0;d = b[f];f++) { - e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0 + for (var e = goog.dependencies_, f = 0;d = b[f];f++) { + e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0; } - for(d = 0;b = c[d];d++) { - a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0 + for (d = 0;b = c[d];d++) { + a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0; } } }; goog.ENABLE_DEBUG_LOADER = !0; goog.require = function(a) { - if(!COMPILED && !goog.isProvided_(a)) { - if(goog.ENABLE_DEBUG_LOADER) { + if (!COMPILED && !goog.isProvided_(a)) { + if (goog.ENABLE_DEBUG_LOADER) { var b = goog.getPathFromDeps_(a); - if(b) { + if (b) { goog.included_[b] = !0; goog.writeScripts_(); - return + return; } } a = "goog.require could not find: " + a; @@ -79,158 +79,158 @@ goog.basePath = ""; goog.nullFunction = function() { }; goog.identityFunction = function(a, b) { - return a + return a; }; goog.abstractMethod = function() { throw Error("unimplemented abstract method"); }; goog.addSingletonGetter = function(a) { a.getInstance = function() { - if(a.instance_) { - return a.instance_ + if (a.instance_) { + return a.instance_; } goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); - return a.instance_ = new a - } + return a.instance_ = new a; + }; }; goog.instantiatedSingletons_ = []; !COMPILED && goog.ENABLE_DEBUG_LOADER && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() { var a = goog.global.document; - return"undefined" != typeof a && "write" in a + return "undefined" != typeof a && "write" in a; }, goog.findBasePath_ = function() { - if(goog.global.CLOSURE_BASE_PATH) { - goog.basePath = goog.global.CLOSURE_BASE_PATH - }else { - if(goog.inHtmlDocument_()) { - for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { + if (goog.global.CLOSURE_BASE_PATH) { + goog.basePath = goog.global.CLOSURE_BASE_PATH; + } else { + if (goog.inHtmlDocument_()) { + for (var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; - if("base.js" == c.substr(d - 7, 7)) { + if ("base.js" == c.substr(d - 7, 7)) { goog.basePath = c.substr(0, d - 7); - break + break; } } } } }, goog.importScript_ = function(a) { var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; - !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) + !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0); }, goog.writeScriptTag_ = function(a) { - if(goog.inHtmlDocument_()) { + if (goog.inHtmlDocument_()) { var b = goog.global.document; - if("complete" == b.readyState) { - if(/\bdeps.js$/.test(a)) { - return!1 + if ("complete" == b.readyState) { + if (/\bdeps.js$/.test(a)) { + return!1; } throw Error('Cannot write "' + a + '" after document load'); } b.write('\x3cscript type\x3d"text/javascript" src\x3d"' + a + '"\x3e\x3c/script\x3e'); - return!0 + return!0; } - return!1 + return!1; }, goog.writeScripts_ = function() { function a(e) { - if(!(e in d.written)) { - if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { - for(var g in d.requires[e]) { - if(!goog.isProvided_(g)) { - if(g in d.nameToPath) { - a(d.nameToPath[g]) - }else { + if (!(e in d.written)) { + if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { + for (var g in d.requires[e]) { + if (!goog.isProvided_(g)) { + if (g in d.nameToPath) { + a(d.nameToPath[g]); + } else { throw Error("Undefined nameToPath for " + g); } } } } - e in c || (c[e] = !0, b.push(e)) + e in c || (c[e] = !0, b.push(e)); } } var b = [], c = {}, d = goog.dependencies_, e; - for(e in goog.included_) { - d.written[e] || a(e) + for (e in goog.included_) { + d.written[e] || a(e); } - for(e = 0;e < b.length;e++) { - if(b[e]) { - goog.importScript_(goog.basePath + b[e]) - }else { + for (e = 0;e < b.length;e++) { + if (b[e]) { + goog.importScript_(goog.basePath + b[e]); + } else { throw Error("Undefined script input"); } } }, goog.getPathFromDeps_ = function(a) { - return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null + return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null; }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js")); goog.typeOf = function(a) { var b = typeof a; - if("object" == b) { - if(a) { - if(a instanceof Array) { - return"array" + if ("object" == b) { + if (a) { + if (a instanceof Array) { + return "array"; } - if(a instanceof Object) { - return b + if (a instanceof Object) { + return b; } var c = Object.prototype.toString.call(a); - if("[object Window]" == c) { - return"object" + if ("[object Window]" == c) { + return "object"; } - if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { - return"array" + if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { + return "array"; } - if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { - return"function" + if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { + return "function"; } - }else { - return"null" + } else { + return "null"; } - }else { - if("function" == b && "undefined" == typeof a.call) { - return"object" + } else { + if ("function" == b && "undefined" == typeof a.call) { + return "object"; } } - return b + return b; }; goog.isDef = function(a) { - return void 0 !== a + return void 0 !== a; }; goog.isNull = function(a) { - return null === a + return null === a; }; goog.isDefAndNotNull = function(a) { - return null != a + return null != a; }; goog.isArray = function(a) { - return"array" == goog.typeOf(a) + return "array" == goog.typeOf(a); }; goog.isArrayLike = function(a) { var b = goog.typeOf(a); - return"array" == b || "object" == b && "number" == typeof a.length + return "array" == b || "object" == b && "number" == typeof a.length; }; goog.isDateLike = function(a) { - return goog.isObject(a) && "function" == typeof a.getFullYear + return goog.isObject(a) && "function" == typeof a.getFullYear; }; goog.isString = function(a) { - return"string" == typeof a + return "string" == typeof a; }; goog.isBoolean = function(a) { - return"boolean" == typeof a + return "boolean" == typeof a; }; goog.isNumber = function(a) { - return"number" == typeof a + return "number" == typeof a; }; goog.isFunction = function(a) { - return"function" == goog.typeOf(a) + return "function" == goog.typeOf(a); }; goog.isObject = function(a) { var b = typeof a; - return"object" == b && null != a || "function" == b + return "object" == b && null != a || "function" == b; }; goog.getUid = function(a) { - return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_) + return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_); }; goog.removeUid = function(a) { "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); try { - delete a[goog.UID_PROPERTY_] - }catch(b) { + delete a[goog.UID_PROPERTY_]; + } catch (b) { } }; goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); @@ -239,73 +239,73 @@ goog.getHashCode = goog.getUid; goog.removeHashCode = goog.removeUid; goog.cloneObject = function(a) { var b = goog.typeOf(a); - if("object" == b || "array" == b) { - if(a.clone) { - return a.clone() + if ("object" == b || "array" == b) { + if (a.clone) { + return a.clone(); } var b = "array" == b ? [] : {}, c; - for(c in a) { - b[c] = goog.cloneObject(a[c]) + for (c in a) { + b[c] = goog.cloneObject(a[c]); } - return b + return b; } - return a + return a; }; goog.bindNative_ = function(a, b, c) { - return a.call.apply(a.bind, arguments) + return a.call.apply(a.bind, arguments); }; goog.bindJs_ = function(a, b, c) { - if(!a) { + if (!a) { throw Error(); } - if(2 < arguments.length) { + if (2 < arguments.length) { var d = Array.prototype.slice.call(arguments, 2); return function() { var c = Array.prototype.slice.call(arguments); Array.prototype.unshift.apply(c, d); - return a.apply(b, c) - } + return a.apply(b, c); + }; } return function() { - return a.apply(b, arguments) - } + return a.apply(b, arguments); + }; }; goog.bind = function(a, b, c) { Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; - return goog.bind.apply(null, arguments) + return goog.bind.apply(null, arguments); }; goog.partial = function(a, b) { var c = Array.prototype.slice.call(arguments, 1); return function() { var b = Array.prototype.slice.call(arguments); b.unshift.apply(b, c); - return a.apply(this, b) - } + return a.apply(this, b); + }; }; goog.mixin = function(a, b) { - for(var c in b) { - a[c] = b[c] + for (var c in b) { + a[c] = b[c]; } }; goog.now = goog.TRUSTED_SITE && Date.now || function() { - return+new Date + return+new Date; }; goog.globalEval = function(a) { - if(goog.global.execScript) { - goog.global.execScript(a, "JavaScript") - }else { - if(goog.global.eval) { - if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ \x3d 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { - goog.global.eval(a) - }else { + if (goog.global.execScript) { + goog.global.execScript(a, "JavaScript"); + } else { + if (goog.global.eval) { + if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ \x3d 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { + goog.global.eval(a); + } else { var b = goog.global.document, c = b.createElement("script"); c.type = "text/javascript"; c.defer = !1; c.appendChild(b.createTextNode(a)); b.body.appendChild(c); - b.body.removeChild(c) + b.body.removeChild(c); } - }else { + } else { throw Error("goog.globalEval not available"); } } @@ -313,39 +313,39 @@ goog.globalEval = function(a) { goog.evalWorksForGlobals_ = null; goog.getCssName = function(a, b) { var c = function(a) { - return goog.cssNameMapping_[a] || a + return goog.cssNameMapping_[a] || a; }, d = function(a) { a = a.split("-"); - for(var b = [], d = 0;d < a.length;d++) { - b.push(c(a[d])) + for (var b = [], d = 0;d < a.length;d++) { + b.push(c(a[d])); } - return b.join("-") + return b.join("-"); }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) { - return a + return a; }; - return b ? a + "-" + d(b) : d(a) + return b ? a + "-" + d(b) : d(a); }; goog.setCssNameMapping = function(a, b) { goog.cssNameMapping_ = a; - goog.cssNameMappingStyle_ = b + goog.cssNameMappingStyle_ = b; }; !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); goog.getMsg = function(a, b) { var c = b || {}, d; - for(d in c) { + for (d in c) { var e = ("" + c[d]).replace(/\$/g, "$$$$"); - a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e) + a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e); } - return a + return a; }; goog.getMsgWithFallback = function(a, b) { - return a + return a; }; goog.exportSymbol = function(a, b, c) { - goog.exportPath_(a, b, c) + goog.exportPath_(a, b, c); }; goog.exportProperty = function(a, b, c) { - a[b] = c + a[b] = c; }; goog.inherits = function(a, b) { function c() { @@ -353,147 +353,147 @@ goog.inherits = function(a, b) { c.prototype = b.prototype; a.superClass_ = b.prototype; a.prototype = new c; - a.prototype.constructor = a + a.prototype.constructor = a; }; goog.base = function(a, b, c) { var d = arguments.callee.caller; - if(d.superClass_) { - return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)) + if (d.superClass_) { + return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1)); } - for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { - if(g.prototype[b] === d) { - f = !0 - }else { - if(f) { - return g.prototype[b].apply(a, e) + for (var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { + if (g.prototype[b] === d) { + f = !0; + } else { + if (f) { + return g.prototype[b].apply(a, e); } } } - if(a[b] === d) { - return a.constructor.prototype[b].apply(a, e) + if (a[b] === d) { + return a.constructor.prototype[b].apply(a, e); } throw Error("goog.base called from a method of one name to a method of a different name"); }; goog.scope = function(a) { - a.call(goog.global) + a.call(goog.global); }; goog.string = {}; goog.string.Unicode = {NBSP:"\u00a0"}; goog.string.startsWith = function(a, b) { - return 0 == a.lastIndexOf(b, 0) + return 0 == a.lastIndexOf(b, 0); }; goog.string.endsWith = function(a, b) { var c = a.length - b.length; - return 0 <= c && a.indexOf(b, c) == c + return 0 <= c && a.indexOf(b, c) == c; }; goog.string.caseInsensitiveStartsWith = function(a, b) { - return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)) + return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)); }; goog.string.caseInsensitiveEndsWith = function(a, b) { - return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)) + return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)); }; goog.string.subs = function(a, b) { - for(var c = 1;c < arguments.length;c++) { + for (var c = 1;c < arguments.length;c++) { var d = String(arguments[c]).replace(/\$/g, "$$$$"); - a = a.replace(/\%s/, d) + a = a.replace(/\%s/, d); } - return a + return a; }; goog.string.collapseWhitespace = function(a) { - return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, "") + return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, ""); }; goog.string.isEmpty = function(a) { - return/^[\s\xa0]*$/.test(a) + return/^[\s\xa0]*$/.test(a); }; goog.string.isEmptySafe = function(a) { - return goog.string.isEmpty(goog.string.makeSafe(a)) + return goog.string.isEmpty(goog.string.makeSafe(a)); }; goog.string.isBreakingWhitespace = function(a) { - return!/[^\t\n\r ]/.test(a) + return!/[^\t\n\r ]/.test(a); }; goog.string.isAlpha = function(a) { - return!/[^a-zA-Z]/.test(a) + return!/[^a-zA-Z]/.test(a); }; goog.string.isNumeric = function(a) { - return!/[^0-9]/.test(a) + return!/[^0-9]/.test(a); }; goog.string.isAlphaNumeric = function(a) { - return!/[^a-zA-Z0-9]/.test(a) + return!/[^a-zA-Z0-9]/.test(a); }; goog.string.isSpace = function(a) { - return" " == a + return " " == a; }; goog.string.isUnicodeChar = function(a) { - return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a + return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a; }; goog.string.stripNewlines = function(a) { - return a.replace(/(\r\n|\r|\n)+/g, " ") + return a.replace(/(\r\n|\r|\n)+/g, " "); }; goog.string.canonicalizeNewlines = function(a) { - return a.replace(/(\r\n|\r|\n)/g, "\n") + return a.replace(/(\r\n|\r|\n)/g, "\n"); }; goog.string.normalizeWhitespace = function(a) { - return a.replace(/\xa0|\s/g, " ") + return a.replace(/\xa0|\s/g, " "); }; goog.string.normalizeSpaces = function(a) { - return a.replace(/\xa0|[ \t]+/g, " ") + return a.replace(/\xa0|[ \t]+/g, " "); }; goog.string.collapseBreakingSpaces = function(a) { - return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "") + return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ""); }; goog.string.trim = function(a) { - return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "") + return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, ""); }; goog.string.trimLeft = function(a) { - return a.replace(/^[\s\xa0]+/, "") + return a.replace(/^[\s\xa0]+/, ""); }; goog.string.trimRight = function(a) { - return a.replace(/[\s\xa0]+$/, "") + return a.replace(/[\s\xa0]+$/, ""); }; goog.string.caseInsensitiveCompare = function(a, b) { var c = String(a).toLowerCase(), d = String(b).toLowerCase(); - return c < d ? -1 : c == d ? 0 : 1 + return c < d ? -1 : c == d ? 0 : 1; }; goog.string.numerateCompareRegExp_ = /(\.\d+)|(\d+)|(\D+)/g; goog.string.numerateCompare = function(a, b) { - if(a == b) { - return 0 + if (a == b) { + return 0; } - if(!a) { - return-1 + if (!a) { + return-1; } - if(!b) { - return 1 + if (!b) { + return 1; } - for(var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { + for (var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { var g = c[f], h = d[f]; - if(g != h) { - return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1 + if (g != h) { + return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1; } } - return c.length != d.length ? c.length - d.length : a < b ? -1 : 1 + return c.length != d.length ? c.length - d.length : a < b ? -1 : 1; }; goog.string.urlEncode = function(a) { - return encodeURIComponent(String(a)) + return encodeURIComponent(String(a)); }; goog.string.urlDecode = function(a) { - return decodeURIComponent(a.replace(/\+/g, " ")) + return decodeURIComponent(a.replace(/\+/g, " ")); }; goog.string.newLineToBr = function(a, b) { - return a.replace(/(\r\n|\r|\n)/g, b ? "\x3cbr /\x3e" : "\x3cbr\x3e") + return a.replace(/(\r\n|\r|\n)/g, b ? "\x3cbr /\x3e" : "\x3cbr\x3e"); }; goog.string.htmlEscape = function(a, b) { - if(b) { - return a.replace(goog.string.amperRe_, "\x26amp;").replace(goog.string.ltRe_, "\x26lt;").replace(goog.string.gtRe_, "\x26gt;").replace(goog.string.quotRe_, "\x26quot;") + if (b) { + return a.replace(goog.string.amperRe_, "\x26amp;").replace(goog.string.ltRe_, "\x26lt;").replace(goog.string.gtRe_, "\x26gt;").replace(goog.string.quotRe_, "\x26quot;"); } - if(!goog.string.allRe_.test(a)) { - return a + if (!goog.string.allRe_.test(a)) { + return a; } -1 != a.indexOf("\x26") && (a = a.replace(goog.string.amperRe_, "\x26amp;")); -1 != a.indexOf("\x3c") && (a = a.replace(goog.string.ltRe_, "\x26lt;")); -1 != a.indexOf("\x3e") && (a = a.replace(goog.string.gtRe_, "\x26gt;")); -1 != a.indexOf('"') && (a = a.replace(goog.string.quotRe_, "\x26quot;")); - return a + return a; }; goog.string.amperRe_ = /&/g; goog.string.ltRe_ = //g; goog.string.quotRe_ = /\"/g; goog.string.allRe_ = /[&<>\"]/; goog.string.unescapeEntities = function(a) { - return goog.string.contains(a, "\x26") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a + return goog.string.contains(a, "\x26") ? "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a; }; goog.string.unescapeEntitiesUsingDom_ = function(a) { var b = {"\x26amp;":"\x26", "\x26lt;":"\x3c", "\x26gt;":"\x3e", "\x26quot;":'"'}, c = document.createElement("div"); return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, e) { var f = b[a]; - if(f) { - return f + if (f) { + return f; } - if("#" == e.charAt(0)) { + if ("#" == e.charAt(0)) { var g = Number("0" + e.substr(1)); - isNaN(g) || (f = String.fromCharCode(g)) + isNaN(g) || (f = String.fromCharCode(g)); } f || (c.innerHTML = a + " ", f = c.firstChild.nodeValue.slice(0, -1)); - return b[a] = f - }) + return b[a] = f; + }); }; goog.string.unescapePureXmlEntities_ = function(a) { return a.replace(/&([^;]+);/g, function(a, c) { switch(c) { case "amp": - return"\x26"; + return "\x26"; case "lt": - return"\x3c"; + return "\x3c"; case "gt": - return"\x3e"; + return "\x3e"; case "quot": return'"'; default: - if("#" == c.charAt(0)) { + if ("#" == c.charAt(0)) { var d = Number("0" + c.substr(1)); - if(!isNaN(d)) { - return String.fromCharCode(d) + if (!isNaN(d)) { + return String.fromCharCode(d); } } - return a + return a; } - }) + }); }; goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; goog.string.whitespaceEscape = function(a, b) { - return goog.string.newLineToBr(a.replace(/ /g, " \x26#160;"), b) + return goog.string.newLineToBr(a.replace(/ /g, " \x26#160;"), b); }; goog.string.stripQuotes = function(a, b) { - for(var c = b.length, d = 0;d < c;d++) { + for (var c = b.length, d = 0;d < c;d++) { var e = 1 == c ? b : b.charAt(d); - if(a.charAt(0) == e && a.charAt(a.length - 1) == e) { - return a.substring(1, a.length - 1) + if (a.charAt(0) == e && a.charAt(a.length - 1) == e) { + return a.substring(1, a.length - 1); } } - return a + return a; }; goog.string.truncate = function(a, b, c) { c && (a = goog.string.unescapeEntities(a)); a.length > b && (a = a.substring(0, b - 3) + "..."); c && (a = goog.string.htmlEscape(a)); - return a + return a; }; goog.string.truncateMiddle = function(a, b, c, d) { c && (a = goog.string.unescapeEntities(a)); - if(d && a.length > b) { + if (d && a.length > b) { d > b && (d = b); var e = a.length - d; - a = a.substring(0, b - d) + "..." + a.substring(e) - }else { - a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)) + a = a.substring(0, b - d) + "..." + a.substring(e); + } else { + a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)); } c && (a = goog.string.htmlEscape(a)); - return a + return a; }; goog.string.specialEscapeChars_ = {"\x00":"\\0", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\"}; goog.string.jsEscapeCache_ = {"'":"\\'"}; goog.string.quote = function(a) { a = String(a); - if(a.quote) { - return a.quote() + if (a.quote) { + return a.quote(); } - for(var b = ['"'], c = 0;c < a.length;c++) { + for (var b = ['"'], c = 0;c < a.length;c++) { var d = a.charAt(c), e = d.charCodeAt(0); - b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)) + b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)); } b.push('"'); - return b.join("") + return b.join(""); }; goog.string.escapeString = function(a) { - for(var b = [], c = 0;c < a.length;c++) { - b[c] = goog.string.escapeChar(a.charAt(c)) + for (var b = [], c = 0;c < a.length;c++) { + b[c] = goog.string.escapeChar(a.charAt(c)); } - return b.join("") + return b.join(""); }; goog.string.escapeChar = function(a) { - if(a in goog.string.jsEscapeCache_) { - return goog.string.jsEscapeCache_[a] + if (a in goog.string.jsEscapeCache_) { + return goog.string.jsEscapeCache_[a]; } - if(a in goog.string.specialEscapeChars_) { - return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a] + if (a in goog.string.specialEscapeChars_) { + return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a]; } var b = a, c = a.charCodeAt(0); - if(31 < c && 127 > c) { - b = a - }else { - if(256 > c) { - if(b = "\\x", 16 > c || 256 < c) { - b += "0" + if (31 < c && 127 > c) { + b = a; + } else { + if (256 > c) { + if (b = "\\x", 16 > c || 256 < c) { + b += "0"; } - }else { - b = "\\u", 4096 > c && (b += "0") + } else { + b = "\\u", 4096 > c && (b += "0"); } - b += c.toString(16).toUpperCase() + b += c.toString(16).toUpperCase(); } - return goog.string.jsEscapeCache_[a] = b + return goog.string.jsEscapeCache_[a] = b; }; goog.string.toMap = function(a) { - for(var b = {}, c = 0;c < a.length;c++) { - b[a.charAt(c)] = !0 + for (var b = {}, c = 0;c < a.length;c++) { + b[a.charAt(c)] = !0; } - return b + return b; }; goog.string.contains = function(a, b) { - return-1 != a.indexOf(b) + return-1 != a.indexOf(b); }; goog.string.countOf = function(a, b) { - return a && b ? a.split(b).length - 1 : 0 + return a && b ? a.split(b).length - 1 : 0; }; goog.string.removeAt = function(a, b, c) { var d = a; - 0 <= b && (b < a.length && 0 < c) && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); - return d + 0 <= b && b < a.length && 0 < c && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); + return d; }; goog.string.remove = function(a, b) { var c = RegExp(goog.string.regExpEscape(b), ""); - return a.replace(c, "") + return a.replace(c, ""); }; goog.string.removeAll = function(a, b) { var c = RegExp(goog.string.regExpEscape(b), "g"); - return a.replace(c, "") + return a.replace(c, ""); }; goog.string.regExpEscape = function(a) { - return String(a).replace(/([-()\[\]{}+?*.$\^|,:# b ? 1 : 0 + return a < b ? -1 : a > b ? 1 : 0; }; goog.string.HASHCODE_MAX_ = 4294967296; goog.string.hashCode = function(a) { - for(var b = 0, c = 0;c < a.length;++c) { - b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_ + for (var b = 0, c = 0;c < a.length;++c) { + b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_; } - return b + return b; }; goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0; goog.string.createUniqueString = function() { - return"goog_" + goog.string.uniqueStringCounter_++ + return "goog_" + goog.string.uniqueStringCounter_++; }; goog.string.toNumber = function(a) { var b = Number(a); - return 0 == b && goog.string.isEmpty(a) ? NaN : b + return 0 == b && goog.string.isEmpty(a) ? NaN : b; }; goog.string.toCamelCase = function(a) { return String(a).replace(/\-([a-z])/g, function(a, c) { - return c.toUpperCase() - }) + return c.toUpperCase(); + }); }; goog.string.toSelectorCase = function(a) { - return String(a).replace(/([A-Z])/g, "-$1").toLowerCase() + return String(a).replace(/([A-Z])/g, "-$1").toLowerCase(); }; goog.string.toTitleCase = function(a, b) { var c = goog.isString(b) ? goog.string.regExpEscape(b) : "\\s"; return a.replace(RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) { - return b + c.toUpperCase() - }) + return b + c.toUpperCase(); + }); }; goog.string.parseInt = function(a) { isFinite(a) && (a = String(a)); - return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN + return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN; }; goog.debug = {}; goog.debug.Error = function(a) { Error.captureStackTrace ? Error.captureStackTrace(this, goog.debug.Error) : this.stack = Error().stack || ""; - a && (this.message = String(a)) + a && (this.message = String(a)); }; goog.inherits(goog.debug.Error, Error); goog.debug.Error.prototype.name = "CustomError"; @@ -721,673 +721,674 @@ goog.asserts.AssertionError = function(a, b) { b.unshift(a); goog.debug.Error.call(this, goog.string.subs.apply(null, b)); b.shift(); - this.messagePattern = a + this.messagePattern = a; }; goog.inherits(goog.asserts.AssertionError, goog.debug.Error); goog.asserts.AssertionError.prototype.name = "AssertionError"; goog.asserts.doAssertFailure_ = function(a, b, c, d) { var e = "Assertion failed"; - if(c) { + if (c) { var e = e + (": " + c), f = d - }else { - a && (e += ": " + a, f = b) + } else { + a && (e += ": " + a, f = b); } throw new goog.asserts.AssertionError("" + e, f || []); }; goog.asserts.assert = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !a && goog.asserts.doAssertFailure_("", null, b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.fail = function(a, b) { - if(goog.asserts.ENABLE_ASSERTS) { + if (goog.asserts.ENABLE_ASSERTS) { throw new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1)); } }; goog.asserts.assertNumber = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isNumber(a) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertString = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isString(a) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertFunction = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isFunction(a) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertObject = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isObject(a) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertArray = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isArray(a) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertBoolean = function(a, b, c) { goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(a) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); - return a + return a; }; goog.asserts.assertInstanceof = function(a, b, c, d) { !goog.asserts.ENABLE_ASSERTS || a instanceof b || goog.asserts.doAssertFailure_("instanceof check failed.", null, c, Array.prototype.slice.call(arguments, 3)); - return a + return a; }; goog.array = {}; goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE; goog.array.peek = function(a) { - return a[a.length - 1] + return a[a.length - 1]; }; goog.array.ARRAY_PROTOTYPE_ = Array.prototype; goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.indexOf ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c); } : function(a, b, c) { c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c; - if(goog.isString(a)) { - return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1 + if (goog.isString(a)) { + return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1; } - for(;c < a.length;c++) { - if(c in a && a[c] === b) { - return c + for (;c < a.length;c++) { + if (c in a && a[c] === b) { + return c; } } - return-1 + return-1; }; goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.lastIndexOf ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c) + return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c); } : function(a, b, c) { c = null == c ? a.length - 1 : c; 0 > c && (c = Math.max(0, a.length + c)); - if(goog.isString(a)) { - return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1 + if (goog.isString(a)) { + return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1; } - for(;0 <= c;c--) { - if(c in a && a[c] === b) { - return c + for (;0 <= c;c--) { + if (c in a && a[c] === b) { + return c; } } - return-1 + return-1; }; goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.forEach ? function(a, b, c) { goog.asserts.assert(null != a.length); - goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c) + goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - f in e && b.call(c, e[f], f, a) + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + f in e && b.call(c, e[f], f, a); } }; goog.array.forEachRight = function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { - d in e && b.call(c, e[d], d, a) + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { + d in e && b.call(c, e[d], d, a); } }; goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.filter ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { - if(h in g) { + for (var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { + if (h in g) { var k = g[h]; - b.call(c, k, h, a) && (e[f++] = k) + b.call(c, k, h, a) && (e[f++] = k); } } - return e + return e; }; goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.map ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { - g in f && (e[g] = b.call(c, f[g], g, a)) + for (var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { + g in f && (e[g] = b.call(c, f[g], g, a)); } - return e + return e; }; goog.array.reduce = function(a, b, c, d) { - if(a.reduce) { - return d ? a.reduce(goog.bind(b, d), c) : a.reduce(b, c) + if (a.reduce) { + return d ? a.reduce(goog.bind(b, d), c) : a.reduce(b, c); } var e = c; goog.array.forEach(a, function(c, g) { - e = b.call(d, e, c, g, a) + e = b.call(d, e, c, g, a); }); - return e + return e; }; goog.array.reduceRight = function(a, b, c, d) { - if(a.reduceRight) { - return d ? a.reduceRight(goog.bind(b, d), c) : a.reduceRight(b, c) + if (a.reduceRight) { + return d ? a.reduceRight(goog.bind(b, d), c) : a.reduceRight(b, c); } var e = c; goog.array.forEachRight(a, function(c, g) { - e = b.call(d, e, c, g, a) + e = b.call(d, e, c, g, a); }); - return e + return e; }; goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.some ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if(f in e && b.call(c, e[f], f, a)) { - return!0 + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if (f in e && b.call(c, e[f], f, a)) { + return!0; } } - return!1 + return!1; }; goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && goog.array.ARRAY_PROTOTYPE_.every ? function(a, b, c) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c) + return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c); } : function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if(f in e && !b.call(c, e[f], f, a)) { - return!1 + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if (f in e && !b.call(c, e[f], f, a)) { + return!1; } } - return!0 + return!0; }; goog.array.count = function(a, b, c) { var d = 0; goog.array.forEach(a, function(a, f, g) { - b.call(c, a, f, g) && ++d + b.call(c, a, f, g) && ++d; }, c); - return d + return d; }; goog.array.find = function(a, b, c) { b = goog.array.findIndex(a, b, c); - return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b] + return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; }; goog.array.findIndex = function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { - if(f in e && b.call(c, e[f], f, a)) { - return f + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { + if (f in e && b.call(c, e[f], f, a)) { + return f; } } - return-1 + return-1; }; goog.array.findRight = function(a, b, c) { b = goog.array.findIndexRight(a, b, c); - return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b] + return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; }; goog.array.findIndexRight = function(a, b, c) { - for(var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { - if(d in e && b.call(c, e[d], d, a)) { - return d + for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { + if (d in e && b.call(c, e[d], d, a)) { + return d; } } - return-1 + return-1; }; goog.array.contains = function(a, b) { - return 0 <= goog.array.indexOf(a, b) + return 0 <= goog.array.indexOf(a, b); }; goog.array.isEmpty = function(a) { - return 0 == a.length + return 0 == a.length; }; goog.array.clear = function(a) { - if(!goog.isArray(a)) { - for(var b = a.length - 1;0 <= b;b--) { - delete a[b] + if (!goog.isArray(a)) { + for (var b = a.length - 1;0 <= b;b--) { + delete a[b]; } } - a.length = 0 + a.length = 0; }; goog.array.insert = function(a, b) { - goog.array.contains(a, b) || a.push(b) + goog.array.contains(a, b) || a.push(b); }; goog.array.insertAt = function(a, b, c) { - goog.array.splice(a, c, 0, b) + goog.array.splice(a, c, 0, b); }; goog.array.insertArrayAt = function(a, b, c) { - goog.partial(goog.array.splice, a, c, 0).apply(null, b) + goog.partial(goog.array.splice, a, c, 0).apply(null, b); }; goog.array.insertBefore = function(a, b, c) { var d; - 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d) + 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d); }; goog.array.remove = function(a, b) { var c = goog.array.indexOf(a, b), d; (d = 0 <= c) && goog.array.removeAt(a, c); - return d + return d; }; goog.array.removeAt = function(a, b) { goog.asserts.assert(null != a.length); - return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length + return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length; }; goog.array.removeIf = function(a, b, c) { b = goog.array.findIndex(a, b, c); - return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1 + return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1; }; goog.array.concat = function(a) { - return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments) + return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); }; goog.array.toArray = function(a) { var b = a.length; - if(0 < b) { - for(var c = Array(b), d = 0;d < b;d++) { - c[d] = a[d] + if (0 < b) { + for (var c = Array(b), d = 0;d < b;d++) { + c[d] = a[d]; } - return c + return c; } - return[] + return[]; }; goog.array.clone = goog.array.toArray; goog.array.extend = function(a, b) { - for(var c = 1;c < arguments.length;c++) { + for (var c = 1;c < arguments.length;c++) { var d = arguments[c], e; - if(goog.isArray(d) || (e = goog.isArrayLike(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) { - a.push.apply(a, d) - }else { - if(e) { - for(var f = a.length, g = d.length, h = 0;h < g;h++) { - a[f + h] = d[h] + if (goog.isArray(d) || (e = goog.isArrayLike(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) { + a.push.apply(a, d); + } else { + if (e) { + for (var f = a.length, g = d.length, h = 0;h < g;h++) { + a[f + h] = d[h]; } - }else { - a.push(d) + } else { + a.push(d); } } } }; goog.array.splice = function(a, b, c, d) { goog.asserts.assert(null != a.length); - return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)) + return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)); }; goog.array.slice = function(a, b, c) { goog.asserts.assert(null != a.length); - return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c) + return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c); }; goog.array.removeDuplicates = function(a, b) { - for(var c = b || a, d = {}, e = 0, f = 0;f < a.length;) { + for (var c = b || a, d = {}, e = 0, f = 0;f < a.length;) { var g = a[f++], h = goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g; - Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, c[e++] = g) + Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, c[e++] = g); } - c.length = e + c.length = e; }; goog.array.binarySearch = function(a, b, c) { - return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b) + return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b); }; goog.array.binarySelect = function(a, b, c) { - return goog.array.binarySearch_(a, b, !0, void 0, c) + return goog.array.binarySearch_(a, b, !0, void 0, c); }; goog.array.binarySearch_ = function(a, b, c, d, e) { - for(var f = 0, g = a.length, h;f < g;) { + for (var f = 0, g = a.length, h;f < g;) { var k = f + g >> 1, l; l = c ? b.call(e, a[k], k, a) : b(d, a[k]); - 0 < l ? f = k + 1 : (g = k, h = !l) + 0 < l ? f = k + 1 : (g = k, h = !l); } - return h ? f : ~f + return h ? f : ~f; }; goog.array.sort = function(a, b) { goog.asserts.assert(null != a.length); - goog.array.ARRAY_PROTOTYPE_.sort.call(a, b || goog.array.defaultCompare) + goog.array.ARRAY_PROTOTYPE_.sort.call(a, b || goog.array.defaultCompare); }; goog.array.stableSort = function(a, b) { - for(var c = 0;c < a.length;c++) { - a[c] = {index:c, value:a[c]} + for (var c = 0;c < a.length;c++) { + a[c] = {index:c, value:a[c]}; } var d = b || goog.array.defaultCompare; goog.array.sort(a, function(a, b) { - return d(a.value, b.value) || a.index - b.index + return d(a.value, b.value) || a.index - b.index; }); - for(c = 0;c < a.length;c++) { - a[c] = a[c].value + for (c = 0;c < a.length;c++) { + a[c] = a[c].value; } }; goog.array.sortObjectsByKey = function(a, b, c) { var d = c || goog.array.defaultCompare; goog.array.sort(a, function(a, c) { - return d(a[b], c[b]) - }) + return d(a[b], c[b]); + }); }; goog.array.isSorted = function(a, b, c) { b = b || goog.array.defaultCompare; - for(var d = 1;d < a.length;d++) { + for (var d = 1;d < a.length;d++) { var e = b(a[d - 1], a[d]); - if(0 < e || 0 == e && c) { - return!1 + if (0 < e || 0 == e && c) { + return!1; } } - return!0 + return!0; }; goog.array.equals = function(a, b, c) { - if(!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { - return!1 + if (!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { + return!1; } var d = a.length; c = c || goog.array.defaultCompareEquality; - for(var e = 0;e < d;e++) { - if(!c(a[e], b[e])) { - return!1 + for (var e = 0;e < d;e++) { + if (!c(a[e], b[e])) { + return!1; } } - return!0 + return!0; }; goog.array.compare = function(a, b, c) { - return goog.array.equals(a, b, c) + return goog.array.equals(a, b, c); }; goog.array.compare3 = function(a, b, c) { c = c || goog.array.defaultCompare; - for(var d = Math.min(a.length, b.length), e = 0;e < d;e++) { + for (var d = Math.min(a.length, b.length), e = 0;e < d;e++) { var f = c(a[e], b[e]); - if(0 != f) { - return f + if (0 != f) { + return f; } } - return goog.array.defaultCompare(a.length, b.length) + return goog.array.defaultCompare(a.length, b.length); }; goog.array.defaultCompare = function(a, b) { - return a > b ? 1 : a < b ? -1 : 0 + return a > b ? 1 : a < b ? -1 : 0; }; goog.array.defaultCompareEquality = function(a, b) { - return a === b + return a === b; }; goog.array.binaryInsert = function(a, b, c) { c = goog.array.binarySearch(a, b, c); - return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1 + return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1; }; goog.array.binaryRemove = function(a, b, c) { b = goog.array.binarySearch(a, b, c); - return 0 <= b ? goog.array.removeAt(a, b) : !1 + return 0 <= b ? goog.array.removeAt(a, b) : !1; }; goog.array.bucket = function(a, b) { - for(var c = {}, d = 0;d < a.length;d++) { + for (var c = {}, d = 0;d < a.length;d++) { var e = a[d], f = b(e, d, a); - goog.isDef(f) && (c[f] || (c[f] = [])).push(e) + goog.isDef(f) && (c[f] || (c[f] = [])).push(e); } - return c + return c; }; goog.array.toObject = function(a, b, c) { var d = {}; goog.array.forEach(a, function(e, f) { - d[b.call(c, e, f, a)] = e + d[b.call(c, e, f, a)] = e; }); - return d + return d; }; goog.array.range = function(a, b, c) { var d = [], e = 0, f = a; c = c || 1; void 0 !== b && (e = a, f = b); - if(0 > c * (f - e)) { - return[] + if (0 > c * (f - e)) { + return[]; } - if(0 < c) { - for(a = e;a < f;a += c) { - d.push(a) + if (0 < c) { + for (a = e;a < f;a += c) { + d.push(a); } - }else { - for(a = e;a > f;a += c) { - d.push(a) + } else { + for (a = e;a > f;a += c) { + d.push(a); } } - return d + return d; }; goog.array.repeat = function(a, b) { - for(var c = [], d = 0;d < b;d++) { - c[d] = a + for (var c = [], d = 0;d < b;d++) { + c[d] = a; } - return c + return c; }; goog.array.flatten = function(a) { - for(var b = [], c = 0;c < arguments.length;c++) { + for (var b = [], c = 0;c < arguments.length;c++) { var d = arguments[c]; - goog.isArray(d) ? b.push.apply(b, goog.array.flatten.apply(null, d)) : b.push(d) + goog.isArray(d) ? b.push.apply(b, goog.array.flatten.apply(null, d)) : b.push(d); } - return b + return b; }; goog.array.rotate = function(a, b) { goog.asserts.assert(null != a.length); a.length && (b %= a.length, 0 < b ? goog.array.ARRAY_PROTOTYPE_.unshift.apply(a, a.splice(-b, b)) : 0 > b && goog.array.ARRAY_PROTOTYPE_.push.apply(a, a.splice(0, -b))); - return a + return a; }; goog.array.zip = function(a) { - if(!arguments.length) { - return[] + if (!arguments.length) { + return[]; } - for(var b = [], c = 0;;c++) { - for(var d = [], e = 0;e < arguments.length;e++) { + for (var b = [], c = 0;;c++) { + for (var d = [], e = 0;e < arguments.length;e++) { var f = arguments[e]; - if(c >= f.length) { - return b + if (c >= f.length) { + return b; } - d.push(f[c]) + d.push(f[c]); } - b.push(d) + b.push(d); } }; goog.array.shuffle = function(a, b) { - for(var c = b || Math.random, d = a.length - 1;0 < d;d--) { + for (var c = b || Math.random, d = a.length - 1;0 < d;d--) { var e = Math.floor(c() * (d + 1)), f = a[d]; a[d] = a[e]; - a[e] = f + a[e] = f; } }; goog.object = {}; goog.object.forEach = function(a, b, c) { - for(var d in a) { - b.call(c, a[d], d, a) + for (var d in a) { + b.call(c, a[d], d, a); } }; goog.object.filter = function(a, b, c) { var d = {}, e; - for(e in a) { - b.call(c, a[e], e, a) && (d[e] = a[e]) + for (e in a) { + b.call(c, a[e], e, a) && (d[e] = a[e]); } - return d + return d; }; goog.object.map = function(a, b, c) { var d = {}, e; - for(e in a) { - d[e] = b.call(c, a[e], e, a) + for (e in a) { + d[e] = b.call(c, a[e], e, a); } - return d + return d; }; goog.object.some = function(a, b, c) { - for(var d in a) { - if(b.call(c, a[d], d, a)) { - return!0 + for (var d in a) { + if (b.call(c, a[d], d, a)) { + return!0; } } - return!1 + return!1; }; goog.object.every = function(a, b, c) { - for(var d in a) { - if(!b.call(c, a[d], d, a)) { - return!1 + for (var d in a) { + if (!b.call(c, a[d], d, a)) { + return!1; } } - return!0 + return!0; }; goog.object.getCount = function(a) { var b = 0, c; - for(c in a) { - b++ + for (c in a) { + b++; } - return b + return b; }; goog.object.getAnyKey = function(a) { - for(var b in a) { - return b + for (var b in a) { + return b; } }; goog.object.getAnyValue = function(a) { - for(var b in a) { - return a[b] + for (var b in a) { + return a[b]; } }; goog.object.contains = function(a, b) { - return goog.object.containsValue(a, b) + return goog.object.containsValue(a, b); }; goog.object.getValues = function(a) { var b = [], c = 0, d; - for(d in a) { - b[c++] = a[d] + for (d in a) { + b[c++] = a[d]; } - return b + return b; }; goog.object.getKeys = function(a) { var b = [], c = 0, d; - for(d in a) { - b[c++] = d + for (d in a) { + b[c++] = d; } - return b + return b; }; goog.object.getValueByKeys = function(a, b) { - for(var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { + for (var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { } - return a + return a; }; goog.object.containsKey = function(a, b) { - return b in a + return b in a; }; goog.object.containsValue = function(a, b) { - for(var c in a) { - if(a[c] == b) { - return!0 + for (var c in a) { + if (a[c] == b) { + return!0; } } - return!1 + return!1; }; goog.object.findKey = function(a, b, c) { - for(var d in a) { - if(b.call(c, a[d], d, a)) { - return d + for (var d in a) { + if (b.call(c, a[d], d, a)) { + return d; } } }; goog.object.findValue = function(a, b, c) { - return(b = goog.object.findKey(a, b, c)) && a[b] + return(b = goog.object.findKey(a, b, c)) && a[b]; }; goog.object.isEmpty = function(a) { - for(var b in a) { - return!1 + for (var b in a) { + return!1; } - return!0 + return!0; }; goog.object.clear = function(a) { - for(var b in a) { - delete a[b] + for (var b in a) { + delete a[b]; } }; goog.object.remove = function(a, b) { var c; (c = b in a) && delete a[b]; - return c + return c; }; goog.object.add = function(a, b, c) { - if(b in a) { + if (b in a) { throw Error('The object already contains the key "' + b + '"'); } - goog.object.set(a, b, c) + goog.object.set(a, b, c); }; goog.object.get = function(a, b, c) { - return b in a ? a[b] : c + return b in a ? a[b] : c; }; goog.object.set = function(a, b, c) { - a[b] = c + a[b] = c; }; goog.object.setIfUndefined = function(a, b, c) { - return b in a ? a[b] : a[b] = c + return b in a ? a[b] : a[b] = c; }; goog.object.clone = function(a) { var b = {}, c; - for(c in a) { - b[c] = a[c] + for (c in a) { + b[c] = a[c]; } - return b + return b; }; goog.object.unsafeClone = function(a) { var b = goog.typeOf(a); - if("object" == b || "array" == b) { - if(a.clone) { - return a.clone() + if ("object" == b || "array" == b) { + if (a.clone) { + return a.clone(); } var b = "array" == b ? [] : {}, c; - for(c in a) { - b[c] = goog.object.unsafeClone(a[c]) + for (c in a) { + b[c] = goog.object.unsafeClone(a[c]); } - return b + return b; } - return a + return a; }; goog.object.transpose = function(a) { var b = {}, c; - for(c in a) { - b[a[c]] = c + for (c in a) { + b[a[c]] = c; } - return b + return b; }; goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); goog.object.extend = function(a, b) { - for(var c, d, e = 1;e < arguments.length;e++) { + for (var c, d, e = 1;e < arguments.length;e++) { d = arguments[e]; - for(c in d) { - a[c] = d[c] + for (c in d) { + a[c] = d[c]; } - for(var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { - c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]) + for (var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { + c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]); } } }; goog.object.create = function(a) { var b = arguments.length; - if(1 == b && goog.isArray(arguments[0])) { - return goog.object.create.apply(null, arguments[0]) + if (1 == b && goog.isArray(arguments[0])) { + return goog.object.create.apply(null, arguments[0]); } - if(b % 2) { + if (b % 2) { throw Error("Uneven number of arguments"); } - for(var c = {}, d = 0;d < b;d += 2) { - c[arguments[d]] = arguments[d + 1] + for (var c = {}, d = 0;d < b;d += 2) { + c[arguments[d]] = arguments[d + 1]; } - return c + return c; }; goog.object.createSet = function(a) { var b = arguments.length; - if(1 == b && goog.isArray(arguments[0])) { - return goog.object.createSet.apply(null, arguments[0]) + if (1 == b && goog.isArray(arguments[0])) { + return goog.object.createSet.apply(null, arguments[0]); } - for(var c = {}, d = 0;d < b;d++) { - c[arguments[d]] = !0 + for (var c = {}, d = 0;d < b;d++) { + c[arguments[d]] = !0; } - return c + return c; }; goog.object.createImmutableView = function(a) { var b = a; Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b)); - return b + return b; }; goog.object.isImmutableView = function(a) { - return!!Object.isFrozen && Object.isFrozen(a) + return!!Object.isFrozen && Object.isFrozen(a); }; goog.string.StringBuffer = function(a, b) { - null != a && this.append.apply(this, arguments) + null != a && this.append.apply(this, arguments); }; goog.string.StringBuffer.prototype.buffer_ = ""; goog.string.StringBuffer.prototype.set = function(a) { - this.buffer_ = "" + a + this.buffer_ = "" + a; }; goog.string.StringBuffer.prototype.append = function(a, b, c) { this.buffer_ += a; - if(null != b) { - for(var d = 1;d < arguments.length;d++) { - this.buffer_ += arguments[d] + if (null != b) { + for (var d = 1;d < arguments.length;d++) { + this.buffer_ += arguments[d]; } } - return this + return this; }; goog.string.StringBuffer.prototype.clear = function() { - this.buffer_ = "" + this.buffer_ = ""; }; goog.string.StringBuffer.prototype.getLength = function() { - return this.buffer_.length + return this.buffer_.length; }; goog.string.StringBuffer.prototype.toString = function() { - return this.buffer_ + return this.buffer_; }; var cljs = {core:{}}; +cljs.core._STAR_clojurescript_version_STAR_ = "0.0-2138"; cljs.core._STAR_unchecked_if_STAR_ = !1; cljs.core._STAR_print_fn_STAR_ = function(a) { throw Error("No *print-fn* fn set for evaluation environment"); }; cljs.core.set_print_fn_BANG_ = function(a) { - return cljs.core._STAR_print_fn_STAR_ = a + return cljs.core._STAR_print_fn_STAR_ = a; }; cljs.core._STAR_flush_on_newline_STAR_ = !0; cljs.core._STAR_print_newline_STAR_ = !0; @@ -1398,106 +1399,109 @@ cljs.core._STAR_print_length_STAR_ = null; cljs.core._STAR_print_level_STAR_ = null; cljs.core.pr_opts = function() { return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857), cljs.core._STAR_flush_on_newline_STAR_, new cljs.core.Keyword(null, "readably", "readably", 4441712502), cljs.core._STAR_print_readably_STAR_, new cljs.core.Keyword(null, "meta", "meta", 1017252215), cljs.core._STAR_print_meta_STAR_, new cljs.core.Keyword(null, "dup", "dup", 1014004081), cljs.core._STAR_print_dup_STAR_, new cljs.core.Keyword(null, "print-length", "print-length", - 3960797560), cljs.core._STAR_print_length_STAR_], null) + 3960797560), cljs.core._STAR_print_length_STAR_], null); }; cljs.core.enable_console_print_BANG_ = function() { cljs.core._STAR_print_newline_STAR_ = !1; return cljs.core._STAR_print_fn_STAR_ = function() { var a = function(a) { - return console.log.apply(console, cljs.core.into_array.call(null, a)) + return console.log.apply(console, cljs.core.into_array.call(null, a)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }() + return b; + }(); }; cljs.core.truth_ = function(a) { - return null != a && !1 !== a + return null != a && !1 !== a; }; cljs.core.not_native = null; cljs.core.identical_QMARK_ = function(a, b) { - return a === b + return a === b; }; cljs.core.nil_QMARK_ = function(a) { - return null == a + return null == a; }; cljs.core.array_QMARK_ = function(a) { - return a instanceof Array + return a instanceof Array; }; cljs.core.number_QMARK_ = function(a) { - return"number" === typeof a + return "number" === typeof a; }; cljs.core.not = function(a) { - return cljs.core.truth_(a) ? !1 : !0 + return cljs.core.truth_(a) ? !1 : !0; +}; +cljs.core.object_QMARK_ = function(a) { + return null != a ? a.constructor === Object : !1; }; cljs.core.string_QMARK_ = function(a) { - return goog.isString(a) + return goog.isString(a); }; cljs.core.native_satisfies_QMARK_ = function(a, b) { - return a[goog.typeOf(null == b ? null : b)] ? !0 : a._ ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null + return a[goog.typeOf(null == b ? null : b)] ? !0 : a._ ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null; }; cljs.core.is_proto_ = function(a) { - return a.constructor.prototype === a + return a.constructor.prototype === a; }; cljs.core._STAR_main_cli_fn_STAR_ = null; cljs.core.type = function(a) { - return null == a ? null : a.constructor + return null == a ? null : a.constructor; }; cljs.core.missing_protocol = function(a, b) { var c = cljs.core.type.call(null, b), c = cljs.core.truth_(cljs.core.truth_(c) ? c.cljs$lang$type : c) ? c.cljs$lang$ctorStr : goog.typeOf(b); - return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")) + return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")); }; cljs.core.type__GT_str = function(a) { var b = a.cljs$lang$ctorStr; - return cljs.core.truth_(b) ? b : "" + cljs.core.str(a) + return cljs.core.truth_(b) ? b : "" + cljs.core.str(a); }; cljs.core.make_array = function() { var a = null, b = function(b, d) { - return a.call(null, d) + return a.call(null, d); }, a = function(a, d) { switch(arguments.length) { case 1: return Array(a); case 2: - return b.call(this, a, d) + return b.call(this, a, d); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return Array(a) + return Array(a); }; a.cljs$core$IFn$_invoke$arity$2 = b; - return a + return a; }(); cljs.core.aclone = function(a) { - for(var b = a.length, c = Array(b), d = 0;;) { - if(d < b) { - c[d] = a[d], d += 1 - }else { - break + for (var b = a.length, c = Array(b), d = 0;;) { + if (d < b) { + c[d] = a[d], d += 1; + } else { + break; } } - return c + return c; }; cljs.core.array = function(a) { - return Array.prototype.slice.call(arguments) + return Array.prototype.slice.call(arguments); }; cljs.core.aget = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.apply.call(null, a, a.call(null, b, c), d) + return cljs.core.apply.call(null, a, a.call(null, b, c), d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -1505,35 +1509,35 @@ cljs.core.aget = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 2: return a[d]; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a[b] + return a[b]; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.aset = function() { var a = null, b = function() { var b = function(b, c, d, h) { - return cljs.core.apply.call(null, a, b[c], d, h) + return cljs.core.apply.call(null, a, b[c], d, h); }, d = function(a, d, g, h) { var k = null; 3 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, d, g, k) + return b.call(this, a, d, g, k); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -1543,268 +1547,268 @@ cljs.core.aset = function() { a = cljs.core.next(a); var h = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, h, a) + return b(d, g, h, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e, f) { switch(arguments.length) { case 3: return a[d] = e; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, e, cljs.core.array_seq(arguments, 3)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, e, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$3 = function(a, b, e) { - return a[b] = e + return a[b] = e; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.alength = function(a) { - return a.length + return a.length; }; cljs.core.into_array = function() { var a = null, b = function(b) { - return a.call(null, null, b) + return a.call(null, null, b); }, c = function(a, b) { return cljs.core.reduce.call(null, function(a, b) { a.push(b); - return a - }, [], b) + return a; + }, [], b); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.Fn = function() { - return{} + return{}; }(); cljs.core.IFn = function() { - return{} + return{}; }(); cljs.core._invoke = function() { var a = null, b = function(a) { - if(a ? a.cljs$core$IFn$_invoke$arity$1 : a) { - return a.cljs$core$IFn$_invoke$arity$1(a) + if (a ? a.cljs$core$IFn$_invoke$arity$1 : a) { + return a.cljs$core$IFn$_invoke$arity$1(a); } var b; b = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._invoke._, !b)) { + if (!b && (b = cljs.core._invoke._, !b)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return b.call(null, a) + return b.call(null, a); }, c = function(a, b) { - if(a ? a.cljs$core$IFn$_invoke$arity$2 : a) { - return a.cljs$core$IFn$_invoke$arity$2(a, b) + if (a ? a.cljs$core$IFn$_invoke$arity$2 : a) { + return a.cljs$core$IFn$_invoke$arity$2(a, b); } var c; c = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._invoke._, !c)) { + if (!c && (c = cljs.core._invoke._, !c)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, d = function(a, b, c) { - if(a ? a.cljs$core$IFn$_invoke$arity$3 : a) { - return a.cljs$core$IFn$_invoke$arity$3(a, b, c) + if (a ? a.cljs$core$IFn$_invoke$arity$3 : a) { + return a.cljs$core$IFn$_invoke$arity$3(a, b, c); } var d; d = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._invoke._, !d)) { + if (!d && (d = cljs.core._invoke._, !d)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }, e = function(a, b, c, d) { - if(a ? a.cljs$core$IFn$_invoke$arity$4 : a) { - return a.cljs$core$IFn$_invoke$arity$4(a, b, c, d) + if (a ? a.cljs$core$IFn$_invoke$arity$4 : a) { + return a.cljs$core$IFn$_invoke$arity$4(a, b, c, d); } var e; e = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!e && (e = cljs.core._invoke._, !e)) { + if (!e && (e = cljs.core._invoke._, !e)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return e.call(null, a, b, c, d) + return e.call(null, a, b, c, d); }, f = function(a, b, c, d, e) { - if(a ? a.cljs$core$IFn$_invoke$arity$5 : a) { - return a.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e) + if (a ? a.cljs$core$IFn$_invoke$arity$5 : a) { + return a.cljs$core$IFn$_invoke$arity$5(a, b, c, d, e); } var f; f = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!f && (f = cljs.core._invoke._, !f)) { + if (!f && (f = cljs.core._invoke._, !f)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return f.call(null, a, b, c, d, e) + return f.call(null, a, b, c, d, e); }, g = function(a, b, c, d, e, f) { - if(a ? a.cljs$core$IFn$_invoke$arity$6 : a) { - return a.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f) + if (a ? a.cljs$core$IFn$_invoke$arity$6 : a) { + return a.cljs$core$IFn$_invoke$arity$6(a, b, c, d, e, f); } var g; g = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._invoke._, !g)) { + if (!g && (g = cljs.core._invoke._, !g)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return g.call(null, a, b, c, d, e, f) + return g.call(null, a, b, c, d, e, f); }, h = function(a, b, c, d, e, f, g) { - if(a ? a.cljs$core$IFn$_invoke$arity$7 : a) { - return a.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g) + if (a ? a.cljs$core$IFn$_invoke$arity$7 : a) { + return a.cljs$core$IFn$_invoke$arity$7(a, b, c, d, e, f, g); } var h; h = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!h && (h = cljs.core._invoke._, !h)) { + if (!h && (h = cljs.core._invoke._, !h)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return h.call(null, a, b, c, d, e, f, g) + return h.call(null, a, b, c, d, e, f, g); }, k = function(a, b, c, d, e, f, g, h) { - if(a ? a.cljs$core$IFn$_invoke$arity$8 : a) { - return a.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h) + if (a ? a.cljs$core$IFn$_invoke$arity$8 : a) { + return a.cljs$core$IFn$_invoke$arity$8(a, b, c, d, e, f, g, h); } var k; k = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!k && (k = cljs.core._invoke._, !k)) { + if (!k && (k = cljs.core._invoke._, !k)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return k.call(null, a, b, c, d, e, f, g, h) + return k.call(null, a, b, c, d, e, f, g, h); }, l = function(a, b, c, d, e, f, g, h, k) { - if(a ? a.cljs$core$IFn$_invoke$arity$9 : a) { - return a.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k) + if (a ? a.cljs$core$IFn$_invoke$arity$9 : a) { + return a.cljs$core$IFn$_invoke$arity$9(a, b, c, d, e, f, g, h, k); } var l; l = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!l && (l = cljs.core._invoke._, !l)) { + if (!l && (l = cljs.core._invoke._, !l)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return l.call(null, a, b, c, d, e, f, g, h, k) + return l.call(null, a, b, c, d, e, f, g, h, k); }, m = function(a, b, c, d, e, f, g, h, k, l) { - if(a ? a.cljs$core$IFn$_invoke$arity$10 : a) { - return a.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l) + if (a ? a.cljs$core$IFn$_invoke$arity$10 : a) { + return a.cljs$core$IFn$_invoke$arity$10(a, b, c, d, e, f, g, h, k, l); } var m; m = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!m && (m = cljs.core._invoke._, !m)) { + if (!m && (m = cljs.core._invoke._, !m)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return m.call(null, a, b, c, d, e, f, g, h, k, l) + return m.call(null, a, b, c, d, e, f, g, h, k, l); }, n = function(a, b, c, d, e, f, g, h, k, l, m) { - if(a ? a.cljs$core$IFn$_invoke$arity$11 : a) { - return a.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m) + if (a ? a.cljs$core$IFn$_invoke$arity$11 : a) { + return a.cljs$core$IFn$_invoke$arity$11(a, b, c, d, e, f, g, h, k, l, m); } var n; n = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!n && (n = cljs.core._invoke._, !n)) { + if (!n && (n = cljs.core._invoke._, !n)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return n.call(null, a, b, c, d, e, f, g, h, k, l, m) + return n.call(null, a, b, c, d, e, f, g, h, k, l, m); }, p = function(a, b, c, d, e, f, g, h, k, l, m, n) { - if(a ? a.cljs$core$IFn$_invoke$arity$12 : a) { - return a.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n) + if (a ? a.cljs$core$IFn$_invoke$arity$12 : a) { + return a.cljs$core$IFn$_invoke$arity$12(a, b, c, d, e, f, g, h, k, l, m, n); } var p; p = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!p && (p = cljs.core._invoke._, !p)) { + if (!p && (p = cljs.core._invoke._, !p)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return p.call(null, a, b, c, d, e, f, g, h, k, l, m, n) + return p.call(null, a, b, c, d, e, f, g, h, k, l, m, n); }, q = function(a, b, c, d, e, f, g, h, k, l, m, n, p) { - if(a ? a.cljs$core$IFn$_invoke$arity$13 : a) { - return a.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p) + if (a ? a.cljs$core$IFn$_invoke$arity$13 : a) { + return a.cljs$core$IFn$_invoke$arity$13(a, b, c, d, e, f, g, h, k, l, m, n, p); } var q; q = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!q && (q = cljs.core._invoke._, !q)) { + if (!q && (q = cljs.core._invoke._, !q)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return q.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p) + return q.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p); }, r = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q) { - if(a ? a.cljs$core$IFn$_invoke$arity$14 : a) { - return a.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q) + if (a ? a.cljs$core$IFn$_invoke$arity$14 : a) { + return a.cljs$core$IFn$_invoke$arity$14(a, b, c, d, e, f, g, h, k, l, m, n, p, q); } var r; r = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!r && (r = cljs.core._invoke._, !r)) { + if (!r && (r = cljs.core._invoke._, !r)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return r.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q) + return r.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q); }, s = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) { - if(a ? a.cljs$core$IFn$_invoke$arity$15 : a) { - return a.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) + if (a ? a.cljs$core$IFn$_invoke$arity$15 : a) { + return a.cljs$core$IFn$_invoke$arity$15(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); } var s; s = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!s && (s = cljs.core._invoke._, !s)) { + if (!s && (s = cljs.core._invoke._, !s)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return s.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r) + return s.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r); }, t = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) { - if(a ? a.cljs$core$IFn$_invoke$arity$16 : a) { - return a.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) + if (a ? a.cljs$core$IFn$_invoke$arity$16 : a) { + return a.cljs$core$IFn$_invoke$arity$16(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); } var t; t = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!t && (t = cljs.core._invoke._, !t)) { + if (!t && (t = cljs.core._invoke._, !t)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return t.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s) + return t.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s); }, v = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) { - if(a ? a.cljs$core$IFn$_invoke$arity$17 : a) { - return a.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) + if (a ? a.cljs$core$IFn$_invoke$arity$17 : a) { + return a.cljs$core$IFn$_invoke$arity$17(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); } var u; u = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!u && (u = cljs.core._invoke._, !u)) { + if (!u && (u = cljs.core._invoke._, !u)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return u.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t) + return u.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t); }, u = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) { - if(a ? a.cljs$core$IFn$_invoke$arity$18 : a) { - return a.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) + if (a ? a.cljs$core$IFn$_invoke$arity$18 : a) { + return a.cljs$core$IFn$_invoke$arity$18(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); } var w; w = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!w && (w = cljs.core._invoke._, !w)) { + if (!w && (w = cljs.core._invoke._, !w)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return w.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u) + return w.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u); }, w = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) { - if(a ? a.cljs$core$IFn$_invoke$arity$19 : a) { - return a.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) + if (a ? a.cljs$core$IFn$_invoke$arity$19 : a) { + return a.cljs$core$IFn$_invoke$arity$19(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w); } var v; v = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!v && (v = cljs.core._invoke._, !v)) { + if (!v && (v = cljs.core._invoke._, !v)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return v.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w) + return v.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w); }, B = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) { - if(a ? a.cljs$core$IFn$_invoke$arity$20 : a) { - return a.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) + if (a ? a.cljs$core$IFn$_invoke$arity$20 : a) { + return a.cljs$core$IFn$_invoke$arity$20(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v); } var B; B = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!B && (B = cljs.core._invoke._, !B)) { + if (!B && (B = cljs.core._invoke._, !B)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return B.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v) + return B.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v); }, I = function(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) { - if(a ? a.cljs$core$IFn$_invoke$arity$21 : a) { - return a.cljs$core$IFn$_invoke$arity$21(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) + if (a ? a.cljs$core$IFn$_invoke$arity$21 : a) { + return a.cljs$core$IFn$_invoke$arity$21(a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B); } var I; I = cljs.core._invoke[goog.typeOf(null == a ? null : a)]; - if(!I && (I = cljs.core._invoke._, !I)) { + if (!I && (I = cljs.core._invoke._, !I)) { throw cljs.core.missing_protocol.call(null, "IFn.-invoke", a); } - return I.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B) + return I.call(null, a, b, c, d, e, f, g, h, k, l, m, n, p, q, r, s, t, u, w, v, B); }, a = function(a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T) { switch(arguments.length) { case 1: @@ -1848,7 +1852,7 @@ cljs.core._invoke = function() { case 20: return B.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S); case 21: - return I.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T) + return I.call(this, a, x, y, z, A, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, S, T); } throw Error("Invalid arity: " + arguments.length); }; @@ -1873,841 +1877,855 @@ cljs.core._invoke = function() { a.cljs$core$IFn$_invoke$arity$19 = w; a.cljs$core$IFn$_invoke$arity$20 = B; a.cljs$core$IFn$_invoke$arity$21 = I; - return a + return a; +}(); +cljs.core.ICloneable = function() { + return{}; }(); +cljs.core._clone = function(a) { + if (a ? a.cljs$core$ICloneable$_clone$arity$1 : a) { + return a.cljs$core$ICloneable$_clone$arity$1(a); + } + var b; + b = cljs.core._clone[goog.typeOf(null == a ? null : a)]; + if (!b && (b = cljs.core._clone._, !b)) { + throw cljs.core.missing_protocol.call(null, "ICloneable.-clone", a); + } + return b.call(null, a); +}; cljs.core.ICounted = function() { - return{} + return{}; }(); cljs.core._count = function(a) { - if(a ? a.cljs$core$ICounted$_count$arity$1 : a) { - return a.cljs$core$ICounted$_count$arity$1(a) + if (a ? a.cljs$core$ICounted$_count$arity$1 : a) { + return a.cljs$core$ICounted$_count$arity$1(a); } var b; b = cljs.core._count[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._count._, !b)) { + if (!b && (b = cljs.core._count._, !b)) { throw cljs.core.missing_protocol.call(null, "ICounted.-count", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IEmptyableCollection = function() { - return{} + return{}; }(); cljs.core._empty = function(a) { - if(a ? a.cljs$core$IEmptyableCollection$_empty$arity$1 : a) { - return a.cljs$core$IEmptyableCollection$_empty$arity$1(a) + if (a ? a.cljs$core$IEmptyableCollection$_empty$arity$1 : a) { + return a.cljs$core$IEmptyableCollection$_empty$arity$1(a); } var b; b = cljs.core._empty[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._empty._, !b)) { + if (!b && (b = cljs.core._empty._, !b)) { throw cljs.core.missing_protocol.call(null, "IEmptyableCollection.-empty", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ICollection = function() { - return{} + return{}; }(); cljs.core._conj = function(a, b) { - if(a ? a.cljs$core$ICollection$_conj$arity$2 : a) { - return a.cljs$core$ICollection$_conj$arity$2(a, b) + if (a ? a.cljs$core$ICollection$_conj$arity$2 : a) { + return a.cljs$core$ICollection$_conj$arity$2(a, b); } var c; c = cljs.core._conj[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._conj._, !c)) { + if (!c && (c = cljs.core._conj._, !c)) { throw cljs.core.missing_protocol.call(null, "ICollection.-conj", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IIndexed = function() { - return{} + return{}; }(); cljs.core._nth = function() { var a = null, b = function(a, b) { - if(a ? a.cljs$core$IIndexed$_nth$arity$2 : a) { - return a.cljs$core$IIndexed$_nth$arity$2(a, b) + if (a ? a.cljs$core$IIndexed$_nth$arity$2 : a) { + return a.cljs$core$IIndexed$_nth$arity$2(a, b); } var c; c = cljs.core._nth[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._nth._, !c)) { + if (!c && (c = cljs.core._nth._, !c)) { throw cljs.core.missing_protocol.call(null, "IIndexed.-nth", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, c = function(a, b, c) { - if(a ? a.cljs$core$IIndexed$_nth$arity$3 : a) { - return a.cljs$core$IIndexed$_nth$arity$3(a, b, c) + if (a ? a.cljs$core$IIndexed$_nth$arity$3 : a) { + return a.cljs$core$IIndexed$_nth$arity$3(a, b, c); } var g; g = cljs.core._nth[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._nth._, !g)) { + if (!g && (g = cljs.core._nth._, !g)) { throw cljs.core.missing_protocol.call(null, "IIndexed.-nth", a); } - return g.call(null, a, b, c) + return g.call(null, a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.ASeq = function() { - return{} + return{}; }(); cljs.core.ISeq = function() { - return{} + return{}; }(); cljs.core._first = function(a) { - if(a ? a.cljs$core$ISeq$_first$arity$1 : a) { - return a.cljs$core$ISeq$_first$arity$1(a) + if (a ? a.cljs$core$ISeq$_first$arity$1 : a) { + return a.cljs$core$ISeq$_first$arity$1(a); } var b; b = cljs.core._first[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._first._, !b)) { + if (!b && (b = cljs.core._first._, !b)) { throw cljs.core.missing_protocol.call(null, "ISeq.-first", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._rest = function(a) { - if(a ? a.cljs$core$ISeq$_rest$arity$1 : a) { - return a.cljs$core$ISeq$_rest$arity$1(a) + if (a ? a.cljs$core$ISeq$_rest$arity$1 : a) { + return a.cljs$core$ISeq$_rest$arity$1(a); } var b; b = cljs.core._rest[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._rest._, !b)) { + if (!b && (b = cljs.core._rest._, !b)) { throw cljs.core.missing_protocol.call(null, "ISeq.-rest", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.INext = function() { - return{} + return{}; }(); cljs.core._next = function(a) { - if(a ? a.cljs$core$INext$_next$arity$1 : a) { - return a.cljs$core$INext$_next$arity$1(a) + if (a ? a.cljs$core$INext$_next$arity$1 : a) { + return a.cljs$core$INext$_next$arity$1(a); } var b; b = cljs.core._next[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._next._, !b)) { + if (!b && (b = cljs.core._next._, !b)) { throw cljs.core.missing_protocol.call(null, "INext.-next", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ILookup = function() { - return{} + return{}; }(); cljs.core._lookup = function() { var a = null, b = function(a, b) { - if(a ? a.cljs$core$ILookup$_lookup$arity$2 : a) { - return a.cljs$core$ILookup$_lookup$arity$2(a, b) + if (a ? a.cljs$core$ILookup$_lookup$arity$2 : a) { + return a.cljs$core$ILookup$_lookup$arity$2(a, b); } var c; c = cljs.core._lookup[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._lookup._, !c)) { + if (!c && (c = cljs.core._lookup._, !c)) { throw cljs.core.missing_protocol.call(null, "ILookup.-lookup", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, c = function(a, b, c) { - if(a ? a.cljs$core$ILookup$_lookup$arity$3 : a) { - return a.cljs$core$ILookup$_lookup$arity$3(a, b, c) + if (a ? a.cljs$core$ILookup$_lookup$arity$3 : a) { + return a.cljs$core$ILookup$_lookup$arity$3(a, b, c); } var g; g = cljs.core._lookup[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._lookup._, !g)) { + if (!g && (g = cljs.core._lookup._, !g)) { throw cljs.core.missing_protocol.call(null, "ILookup.-lookup", a); } - return g.call(null, a, b, c) + return g.call(null, a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.IAssociative = function() { - return{} + return{}; }(); cljs.core._contains_key_QMARK_ = function(a, b) { - if(a ? a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 : a) { - return a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2(a, b) + if (a ? a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 : a) { + return a.cljs$core$IAssociative$_contains_key_QMARK_$arity$2(a, b); } var c; c = cljs.core._contains_key_QMARK_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._contains_key_QMARK_._, !c)) { + if (!c && (c = cljs.core._contains_key_QMARK_._, !c)) { throw cljs.core.missing_protocol.call(null, "IAssociative.-contains-key?", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._assoc = function(a, b, c) { - if(a ? a.cljs$core$IAssociative$_assoc$arity$3 : a) { - return a.cljs$core$IAssociative$_assoc$arity$3(a, b, c) + if (a ? a.cljs$core$IAssociative$_assoc$arity$3 : a) { + return a.cljs$core$IAssociative$_assoc$arity$3(a, b, c); } var d; d = cljs.core._assoc[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc._, !d)) { + if (!d && (d = cljs.core._assoc._, !d)) { throw cljs.core.missing_protocol.call(null, "IAssociative.-assoc", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IMap = function() { - return{} + return{}; }(); cljs.core._dissoc = function(a, b) { - if(a ? a.cljs$core$IMap$_dissoc$arity$2 : a) { - return a.cljs$core$IMap$_dissoc$arity$2(a, b) + if (a ? a.cljs$core$IMap$_dissoc$arity$2 : a) { + return a.cljs$core$IMap$_dissoc$arity$2(a, b); } var c; c = cljs.core._dissoc[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._dissoc._, !c)) { + if (!c && (c = cljs.core._dissoc._, !c)) { throw cljs.core.missing_protocol.call(null, "IMap.-dissoc", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IMapEntry = function() { - return{} + return{}; }(); cljs.core._key = function(a) { - if(a ? a.cljs$core$IMapEntry$_key$arity$1 : a) { - return a.cljs$core$IMapEntry$_key$arity$1(a) + if (a ? a.cljs$core$IMapEntry$_key$arity$1 : a) { + return a.cljs$core$IMapEntry$_key$arity$1(a); } var b; b = cljs.core._key[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._key._, !b)) { + if (!b && (b = cljs.core._key._, !b)) { throw cljs.core.missing_protocol.call(null, "IMapEntry.-key", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._val = function(a) { - if(a ? a.cljs$core$IMapEntry$_val$arity$1 : a) { - return a.cljs$core$IMapEntry$_val$arity$1(a) + if (a ? a.cljs$core$IMapEntry$_val$arity$1 : a) { + return a.cljs$core$IMapEntry$_val$arity$1(a); } var b; b = cljs.core._val[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._val._, !b)) { + if (!b && (b = cljs.core._val._, !b)) { throw cljs.core.missing_protocol.call(null, "IMapEntry.-val", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISet = function() { - return{} + return{}; }(); cljs.core._disjoin = function(a, b) { - if(a ? a.cljs$core$ISet$_disjoin$arity$2 : a) { - return a.cljs$core$ISet$_disjoin$arity$2(a, b) + if (a ? a.cljs$core$ISet$_disjoin$arity$2 : a) { + return a.cljs$core$ISet$_disjoin$arity$2(a, b); } var c; c = cljs.core._disjoin[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._disjoin._, !c)) { + if (!c && (c = cljs.core._disjoin._, !c)) { throw cljs.core.missing_protocol.call(null, "ISet.-disjoin", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IStack = function() { - return{} + return{}; }(); cljs.core._peek = function(a) { - if(a ? a.cljs$core$IStack$_peek$arity$1 : a) { - return a.cljs$core$IStack$_peek$arity$1(a) + if (a ? a.cljs$core$IStack$_peek$arity$1 : a) { + return a.cljs$core$IStack$_peek$arity$1(a); } var b; b = cljs.core._peek[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._peek._, !b)) { + if (!b && (b = cljs.core._peek._, !b)) { throw cljs.core.missing_protocol.call(null, "IStack.-peek", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._pop = function(a) { - if(a ? a.cljs$core$IStack$_pop$arity$1 : a) { - return a.cljs$core$IStack$_pop$arity$1(a) + if (a ? a.cljs$core$IStack$_pop$arity$1 : a) { + return a.cljs$core$IStack$_pop$arity$1(a); } var b; b = cljs.core._pop[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._pop._, !b)) { + if (!b && (b = cljs.core._pop._, !b)) { throw cljs.core.missing_protocol.call(null, "IStack.-pop", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IVector = function() { - return{} + return{}; }(); cljs.core._assoc_n = function(a, b, c) { - if(a ? a.cljs$core$IVector$_assoc_n$arity$3 : a) { - return a.cljs$core$IVector$_assoc_n$arity$3(a, b, c) + if (a ? a.cljs$core$IVector$_assoc_n$arity$3 : a) { + return a.cljs$core$IVector$_assoc_n$arity$3(a, b, c); } var d; d = cljs.core._assoc_n[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc_n._, !d)) { + if (!d && (d = cljs.core._assoc_n._, !d)) { throw cljs.core.missing_protocol.call(null, "IVector.-assoc-n", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IDeref = function() { - return{} + return{}; }(); cljs.core._deref = function(a) { - if(a ? a.cljs$core$IDeref$_deref$arity$1 : a) { - return a.cljs$core$IDeref$_deref$arity$1(a) + if (a ? a.cljs$core$IDeref$_deref$arity$1 : a) { + return a.cljs$core$IDeref$_deref$arity$1(a); } var b; b = cljs.core._deref[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._deref._, !b)) { + if (!b && (b = cljs.core._deref._, !b)) { throw cljs.core.missing_protocol.call(null, "IDeref.-deref", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IDerefWithTimeout = function() { - return{} + return{}; }(); cljs.core._deref_with_timeout = function(a, b, c) { - if(a ? a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3 : a) { - return a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3(a, b, c) + if (a ? a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3 : a) { + return a.cljs$core$IDerefWithTimeout$_deref_with_timeout$arity$3(a, b, c); } var d; d = cljs.core._deref_with_timeout[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._deref_with_timeout._, !d)) { + if (!d && (d = cljs.core._deref_with_timeout._, !d)) { throw cljs.core.missing_protocol.call(null, "IDerefWithTimeout.-deref-with-timeout", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IMeta = function() { - return{} + return{}; }(); cljs.core._meta = function(a) { - if(a ? a.cljs$core$IMeta$_meta$arity$1 : a) { - return a.cljs$core$IMeta$_meta$arity$1(a) + if (a ? a.cljs$core$IMeta$_meta$arity$1 : a) { + return a.cljs$core$IMeta$_meta$arity$1(a); } var b; b = cljs.core._meta[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._meta._, !b)) { + if (!b && (b = cljs.core._meta._, !b)) { throw cljs.core.missing_protocol.call(null, "IMeta.-meta", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IWithMeta = function() { - return{} + return{}; }(); cljs.core._with_meta = function(a, b) { - if(a ? a.cljs$core$IWithMeta$_with_meta$arity$2 : a) { - return a.cljs$core$IWithMeta$_with_meta$arity$2(a, b) + if (a ? a.cljs$core$IWithMeta$_with_meta$arity$2 : a) { + return a.cljs$core$IWithMeta$_with_meta$arity$2(a, b); } var c; c = cljs.core._with_meta[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._with_meta._, !c)) { + if (!c && (c = cljs.core._with_meta._, !c)) { throw cljs.core.missing_protocol.call(null, "IWithMeta.-with-meta", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IReduce = function() { - return{} + return{}; }(); cljs.core._reduce = function() { var a = null, b = function(a, b) { - if(a ? a.cljs$core$IReduce$_reduce$arity$2 : a) { - return a.cljs$core$IReduce$_reduce$arity$2(a, b) + if (a ? a.cljs$core$IReduce$_reduce$arity$2 : a) { + return a.cljs$core$IReduce$_reduce$arity$2(a, b); } var c; c = cljs.core._reduce[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._reduce._, !c)) { + if (!c && (c = cljs.core._reduce._, !c)) { throw cljs.core.missing_protocol.call(null, "IReduce.-reduce", a); } - return c.call(null, a, b) + return c.call(null, a, b); }, c = function(a, b, c) { - if(a ? a.cljs$core$IReduce$_reduce$arity$3 : a) { - return a.cljs$core$IReduce$_reduce$arity$3(a, b, c) + if (a ? a.cljs$core$IReduce$_reduce$arity$3 : a) { + return a.cljs$core$IReduce$_reduce$arity$3(a, b, c); } var g; g = cljs.core._reduce[goog.typeOf(null == a ? null : a)]; - if(!g && (g = cljs.core._reduce._, !g)) { + if (!g && (g = cljs.core._reduce._, !g)) { throw cljs.core.missing_protocol.call(null, "IReduce.-reduce", a); } - return g.call(null, a, b, c) + return g.call(null, a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.IKVReduce = function() { - return{} + return{}; }(); cljs.core._kv_reduce = function(a, b, c) { - if(a ? a.cljs$core$IKVReduce$_kv_reduce$arity$3 : a) { - return a.cljs$core$IKVReduce$_kv_reduce$arity$3(a, b, c) + if (a ? a.cljs$core$IKVReduce$_kv_reduce$arity$3 : a) { + return a.cljs$core$IKVReduce$_kv_reduce$arity$3(a, b, c); } var d; d = cljs.core._kv_reduce[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._kv_reduce._, !d)) { + if (!d && (d = cljs.core._kv_reduce._, !d)) { throw cljs.core.missing_protocol.call(null, "IKVReduce.-kv-reduce", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IEquiv = function() { - return{} + return{}; }(); cljs.core._equiv = function(a, b) { - if(a ? a.cljs$core$IEquiv$_equiv$arity$2 : a) { - return a.cljs$core$IEquiv$_equiv$arity$2(a, b) + if (a ? a.cljs$core$IEquiv$_equiv$arity$2 : a) { + return a.cljs$core$IEquiv$_equiv$arity$2(a, b); } var c; c = cljs.core._equiv[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._equiv._, !c)) { + if (!c && (c = cljs.core._equiv._, !c)) { throw cljs.core.missing_protocol.call(null, "IEquiv.-equiv", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IHash = function() { - return{} + return{}; }(); cljs.core._hash = function(a) { - if(a ? a.cljs$core$IHash$_hash$arity$1 : a) { - return a.cljs$core$IHash$_hash$arity$1(a) + if (a ? a.cljs$core$IHash$_hash$arity$1 : a) { + return a.cljs$core$IHash$_hash$arity$1(a); } var b; b = cljs.core._hash[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._hash._, !b)) { + if (!b && (b = cljs.core._hash._, !b)) { throw cljs.core.missing_protocol.call(null, "IHash.-hash", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISeqable = function() { - return{} + return{}; }(); cljs.core._seq = function(a) { - if(a ? a.cljs$core$ISeqable$_seq$arity$1 : a) { - return a.cljs$core$ISeqable$_seq$arity$1(a) + if (a ? a.cljs$core$ISeqable$_seq$arity$1 : a) { + return a.cljs$core$ISeqable$_seq$arity$1(a); } var b; b = cljs.core._seq[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._seq._, !b)) { + if (!b && (b = cljs.core._seq._, !b)) { throw cljs.core.missing_protocol.call(null, "ISeqable.-seq", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISequential = function() { - return{} + return{}; }(); cljs.core.IList = function() { - return{} + return{}; }(); cljs.core.IRecord = function() { - return{} + return{}; }(); cljs.core.IReversible = function() { - return{} + return{}; }(); cljs.core._rseq = function(a) { - if(a ? a.cljs$core$IReversible$_rseq$arity$1 : a) { - return a.cljs$core$IReversible$_rseq$arity$1(a) + if (a ? a.cljs$core$IReversible$_rseq$arity$1 : a) { + return a.cljs$core$IReversible$_rseq$arity$1(a); } var b; b = cljs.core._rseq[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._rseq._, !b)) { + if (!b && (b = cljs.core._rseq._, !b)) { throw cljs.core.missing_protocol.call(null, "IReversible.-rseq", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ISorted = function() { - return{} + return{}; }(); cljs.core._sorted_seq = function(a, b) { - if(a ? a.cljs$core$ISorted$_sorted_seq$arity$2 : a) { - return a.cljs$core$ISorted$_sorted_seq$arity$2(a, b) + if (a ? a.cljs$core$ISorted$_sorted_seq$arity$2 : a) { + return a.cljs$core$ISorted$_sorted_seq$arity$2(a, b); } var c; c = cljs.core._sorted_seq[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._sorted_seq._, !c)) { + if (!c && (c = cljs.core._sorted_seq._, !c)) { throw cljs.core.missing_protocol.call(null, "ISorted.-sorted-seq", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._sorted_seq_from = function(a, b, c) { - if(a ? a.cljs$core$ISorted$_sorted_seq_from$arity$3 : a) { - return a.cljs$core$ISorted$_sorted_seq_from$arity$3(a, b, c) + if (a ? a.cljs$core$ISorted$_sorted_seq_from$arity$3 : a) { + return a.cljs$core$ISorted$_sorted_seq_from$arity$3(a, b, c); } var d; d = cljs.core._sorted_seq_from[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._sorted_seq_from._, !d)) { + if (!d && (d = cljs.core._sorted_seq_from._, !d)) { throw cljs.core.missing_protocol.call(null, "ISorted.-sorted-seq-from", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._entry_key = function(a, b) { - if(a ? a.cljs$core$ISorted$_entry_key$arity$2 : a) { - return a.cljs$core$ISorted$_entry_key$arity$2(a, b) + if (a ? a.cljs$core$ISorted$_entry_key$arity$2 : a) { + return a.cljs$core$ISorted$_entry_key$arity$2(a, b); } var c; c = cljs.core._entry_key[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._entry_key._, !c)) { + if (!c && (c = cljs.core._entry_key._, !c)) { throw cljs.core.missing_protocol.call(null, "ISorted.-entry-key", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._comparator = function(a) { - if(a ? a.cljs$core$ISorted$_comparator$arity$1 : a) { - return a.cljs$core$ISorted$_comparator$arity$1(a) + if (a ? a.cljs$core$ISorted$_comparator$arity$1 : a) { + return a.cljs$core$ISorted$_comparator$arity$1(a); } var b; b = cljs.core._comparator[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._comparator._, !b)) { + if (!b && (b = cljs.core._comparator._, !b)) { throw cljs.core.missing_protocol.call(null, "ISorted.-comparator", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IWriter = function() { - return{} + return{}; }(); cljs.core._write = function(a, b) { - if(a ? a.cljs$core$IWriter$_write$arity$2 : a) { - return a.cljs$core$IWriter$_write$arity$2(a, b) + if (a ? a.cljs$core$IWriter$_write$arity$2 : a) { + return a.cljs$core$IWriter$_write$arity$2(a, b); } var c; c = cljs.core._write[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._write._, !c)) { + if (!c && (c = cljs.core._write._, !c)) { throw cljs.core.missing_protocol.call(null, "IWriter.-write", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._flush = function(a) { - if(a ? a.cljs$core$IWriter$_flush$arity$1 : a) { - return a.cljs$core$IWriter$_flush$arity$1(a) + if (a ? a.cljs$core$IWriter$_flush$arity$1 : a) { + return a.cljs$core$IWriter$_flush$arity$1(a); } var b; b = cljs.core._flush[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._flush._, !b)) { + if (!b && (b = cljs.core._flush._, !b)) { throw cljs.core.missing_protocol.call(null, "IWriter.-flush", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IPrintWithWriter = function() { - return{} + return{}; }(); cljs.core._pr_writer = function(a, b, c) { - if(a ? a.cljs$core$IPrintWithWriter$_pr_writer$arity$3 : a) { - return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(a, b, c) + if (a ? a.cljs$core$IPrintWithWriter$_pr_writer$arity$3 : a) { + return a.cljs$core$IPrintWithWriter$_pr_writer$arity$3(a, b, c); } var d; d = cljs.core._pr_writer[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._pr_writer._, !d)) { + if (!d && (d = cljs.core._pr_writer._, !d)) { throw cljs.core.missing_protocol.call(null, "IPrintWithWriter.-pr-writer", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.IPending = function() { - return{} + return{}; }(); cljs.core._realized_QMARK_ = function(a) { - if(a ? a.cljs$core$IPending$_realized_QMARK_$arity$1 : a) { - return a.cljs$core$IPending$_realized_QMARK_$arity$1(a) + if (a ? a.cljs$core$IPending$_realized_QMARK_$arity$1 : a) { + return a.cljs$core$IPending$_realized_QMARK_$arity$1(a); } var b; b = cljs.core._realized_QMARK_[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._realized_QMARK_._, !b)) { + if (!b && (b = cljs.core._realized_QMARK_._, !b)) { throw cljs.core.missing_protocol.call(null, "IPending.-realized?", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IWatchable = function() { - return{} + return{}; }(); cljs.core._notify_watches = function(a, b, c) { - if(a ? a.cljs$core$IWatchable$_notify_watches$arity$3 : a) { - return a.cljs$core$IWatchable$_notify_watches$arity$3(a, b, c) + if (a ? a.cljs$core$IWatchable$_notify_watches$arity$3 : a) { + return a.cljs$core$IWatchable$_notify_watches$arity$3(a, b, c); } var d; d = cljs.core._notify_watches[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._notify_watches._, !d)) { + if (!d && (d = cljs.core._notify_watches._, !d)) { throw cljs.core.missing_protocol.call(null, "IWatchable.-notify-watches", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._add_watch = function(a, b, c) { - if(a ? a.cljs$core$IWatchable$_add_watch$arity$3 : a) { - return a.cljs$core$IWatchable$_add_watch$arity$3(a, b, c) + if (a ? a.cljs$core$IWatchable$_add_watch$arity$3 : a) { + return a.cljs$core$IWatchable$_add_watch$arity$3(a, b, c); } var d; d = cljs.core._add_watch[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._add_watch._, !d)) { + if (!d && (d = cljs.core._add_watch._, !d)) { throw cljs.core.missing_protocol.call(null, "IWatchable.-add-watch", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._remove_watch = function(a, b) { - if(a ? a.cljs$core$IWatchable$_remove_watch$arity$2 : a) { - return a.cljs$core$IWatchable$_remove_watch$arity$2(a, b) + if (a ? a.cljs$core$IWatchable$_remove_watch$arity$2 : a) { + return a.cljs$core$IWatchable$_remove_watch$arity$2(a, b); } var c; c = cljs.core._remove_watch[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._remove_watch._, !c)) { + if (!c && (c = cljs.core._remove_watch._, !c)) { throw cljs.core.missing_protocol.call(null, "IWatchable.-remove-watch", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IEditableCollection = function() { - return{} + return{}; }(); cljs.core._as_transient = function(a) { - if(a ? a.cljs$core$IEditableCollection$_as_transient$arity$1 : a) { - return a.cljs$core$IEditableCollection$_as_transient$arity$1(a) + if (a ? a.cljs$core$IEditableCollection$_as_transient$arity$1 : a) { + return a.cljs$core$IEditableCollection$_as_transient$arity$1(a); } var b; b = cljs.core._as_transient[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._as_transient._, !b)) { + if (!b && (b = cljs.core._as_transient._, !b)) { throw cljs.core.missing_protocol.call(null, "IEditableCollection.-as-transient", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ITransientCollection = function() { - return{} + return{}; }(); cljs.core._conj_BANG_ = function(a, b) { - if(a ? a.cljs$core$ITransientCollection$_conj_BANG_$arity$2 : a) { - return a.cljs$core$ITransientCollection$_conj_BANG_$arity$2(a, b) + if (a ? a.cljs$core$ITransientCollection$_conj_BANG_$arity$2 : a) { + return a.cljs$core$ITransientCollection$_conj_BANG_$arity$2(a, b); } var c; c = cljs.core._conj_BANG_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._conj_BANG_._, !c)) { + if (!c && (c = cljs.core._conj_BANG_._, !c)) { throw cljs.core.missing_protocol.call(null, "ITransientCollection.-conj!", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._persistent_BANG_ = function(a) { - if(a ? a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 : a) { - return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(a) + if (a ? a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 : a) { + return a.cljs$core$ITransientCollection$_persistent_BANG_$arity$1(a); } var b; b = cljs.core._persistent_BANG_[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._persistent_BANG_._, !b)) { + if (!b && (b = cljs.core._persistent_BANG_._, !b)) { throw cljs.core.missing_protocol.call(null, "ITransientCollection.-persistent!", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ITransientAssociative = function() { - return{} + return{}; }(); cljs.core._assoc_BANG_ = function(a, b, c) { - if(a ? a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 : a) { - return a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(a, b, c) + if (a ? a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 : a) { + return a.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3(a, b, c); } var d; d = cljs.core._assoc_BANG_[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc_BANG_._, !d)) { + if (!d && (d = cljs.core._assoc_BANG_._, !d)) { throw cljs.core.missing_protocol.call(null, "ITransientAssociative.-assoc!", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core.ITransientMap = function() { - return{} + return{}; }(); cljs.core._dissoc_BANG_ = function(a, b) { - if(a ? a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 : a) { - return a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2(a, b) + if (a ? a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 : a) { + return a.cljs$core$ITransientMap$_dissoc_BANG_$arity$2(a, b); } var c; c = cljs.core._dissoc_BANG_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._dissoc_BANG_._, !c)) { + if (!c && (c = cljs.core._dissoc_BANG_._, !c)) { throw cljs.core.missing_protocol.call(null, "ITransientMap.-dissoc!", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.ITransientVector = function() { - return{} + return{}; }(); cljs.core._assoc_n_BANG_ = function(a, b, c) { - if(a ? a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 : a) { - return a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3(a, b, c) + if (a ? a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 : a) { + return a.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3(a, b, c); } var d; d = cljs.core._assoc_n_BANG_[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._assoc_n_BANG_._, !d)) { + if (!d && (d = cljs.core._assoc_n_BANG_._, !d)) { throw cljs.core.missing_protocol.call(null, "ITransientVector.-assoc-n!", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._pop_BANG_ = function(a) { - if(a ? a.cljs$core$ITransientVector$_pop_BANG_$arity$1 : a) { - return a.cljs$core$ITransientVector$_pop_BANG_$arity$1(a) + if (a ? a.cljs$core$ITransientVector$_pop_BANG_$arity$1 : a) { + return a.cljs$core$ITransientVector$_pop_BANG_$arity$1(a); } var b; b = cljs.core._pop_BANG_[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._pop_BANG_._, !b)) { + if (!b && (b = cljs.core._pop_BANG_._, !b)) { throw cljs.core.missing_protocol.call(null, "ITransientVector.-pop!", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.ITransientSet = function() { - return{} + return{}; }(); cljs.core._disjoin_BANG_ = function(a, b) { - if(a ? a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 : a) { - return a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2(a, b) + if (a ? a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 : a) { + return a.cljs$core$ITransientSet$_disjoin_BANG_$arity$2(a, b); } var c; c = cljs.core._disjoin_BANG_[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._disjoin_BANG_._, !c)) { + if (!c && (c = cljs.core._disjoin_BANG_._, !c)) { throw cljs.core.missing_protocol.call(null, "ITransientSet.-disjoin!", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IComparable = function() { - return{} + return{}; }(); cljs.core._compare = function(a, b) { - if(a ? a.cljs$core$IComparable$_compare$arity$2 : a) { - return a.cljs$core$IComparable$_compare$arity$2(a, b) + if (a ? a.cljs$core$IComparable$_compare$arity$2 : a) { + return a.cljs$core$IComparable$_compare$arity$2(a, b); } var c; c = cljs.core._compare[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._compare._, !c)) { + if (!c && (c = cljs.core._compare._, !c)) { throw cljs.core.missing_protocol.call(null, "IComparable.-compare", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.IChunk = function() { - return{} + return{}; }(); cljs.core._drop_first = function(a) { - if(a ? a.cljs$core$IChunk$_drop_first$arity$1 : a) { - return a.cljs$core$IChunk$_drop_first$arity$1(a) + if (a ? a.cljs$core$IChunk$_drop_first$arity$1 : a) { + return a.cljs$core$IChunk$_drop_first$arity$1(a); } var b; b = cljs.core._drop_first[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._drop_first._, !b)) { + if (!b && (b = cljs.core._drop_first._, !b)) { throw cljs.core.missing_protocol.call(null, "IChunk.-drop-first", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IChunkedSeq = function() { - return{} + return{}; }(); cljs.core._chunked_first = function(a) { - if(a ? a.cljs$core$IChunkedSeq$_chunked_first$arity$1 : a) { - return a.cljs$core$IChunkedSeq$_chunked_first$arity$1(a) + if (a ? a.cljs$core$IChunkedSeq$_chunked_first$arity$1 : a) { + return a.cljs$core$IChunkedSeq$_chunked_first$arity$1(a); } var b; b = cljs.core._chunked_first[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._chunked_first._, !b)) { + if (!b && (b = cljs.core._chunked_first._, !b)) { throw cljs.core.missing_protocol.call(null, "IChunkedSeq.-chunked-first", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._chunked_rest = function(a) { - if(a ? a.cljs$core$IChunkedSeq$_chunked_rest$arity$1 : a) { - return a.cljs$core$IChunkedSeq$_chunked_rest$arity$1(a) + if (a ? a.cljs$core$IChunkedSeq$_chunked_rest$arity$1 : a) { + return a.cljs$core$IChunkedSeq$_chunked_rest$arity$1(a); } var b; b = cljs.core._chunked_rest[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._chunked_rest._, !b)) { + if (!b && (b = cljs.core._chunked_rest._, !b)) { throw cljs.core.missing_protocol.call(null, "IChunkedSeq.-chunked-rest", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.IChunkedNext = function() { - return{} + return{}; }(); cljs.core._chunked_next = function(a) { - if(a ? a.cljs$core$IChunkedNext$_chunked_next$arity$1 : a) { - return a.cljs$core$IChunkedNext$_chunked_next$arity$1(a) + if (a ? a.cljs$core$IChunkedNext$_chunked_next$arity$1 : a) { + return a.cljs$core$IChunkedNext$_chunked_next$arity$1(a); } var b; b = cljs.core._chunked_next[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._chunked_next._, !b)) { + if (!b && (b = cljs.core._chunked_next._, !b)) { throw cljs.core.missing_protocol.call(null, "IChunkedNext.-chunked-next", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.INamed = function() { - return{} + return{}; }(); cljs.core._name = function(a) { - if(a ? a.cljs$core$INamed$_name$arity$1 : a) { - return a.cljs$core$INamed$_name$arity$1(a) + if (a ? a.cljs$core$INamed$_name$arity$1 : a) { + return a.cljs$core$INamed$_name$arity$1(a); } var b; b = cljs.core._name[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._name._, !b)) { + if (!b && (b = cljs.core._name._, !b)) { throw cljs.core.missing_protocol.call(null, "INamed.-name", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._namespace = function(a) { - if(a ? a.cljs$core$INamed$_namespace$arity$1 : a) { - return a.cljs$core$INamed$_namespace$arity$1(a) + if (a ? a.cljs$core$INamed$_namespace$arity$1 : a) { + return a.cljs$core$INamed$_namespace$arity$1(a); } var b; b = cljs.core._namespace[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._namespace._, !b)) { + if (!b && (b = cljs.core._namespace._, !b)) { throw cljs.core.missing_protocol.call(null, "INamed.-namespace", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.StringBufferWriter = function(a) { this.sb = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 1073741824 + this.cljs$lang$protocol_mask$partition0$ = 1073741824; }; cljs.core.StringBufferWriter.cljs$lang$type = !0; cljs.core.StringBufferWriter.cljs$lang$ctorStr = "cljs.core/StringBufferWriter"; cljs.core.StringBufferWriter.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/StringBufferWriter") + return cljs.core._write.call(null, b, "cljs.core/StringBufferWriter"); }; cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_write$arity$2 = function(a, b) { - return this.sb.append(b) + return this.sb.append(b); }; cljs.core.StringBufferWriter.prototype.cljs$core$IWriter$_flush$arity$1 = function(a) { - return null + return null; }; cljs.core.__GT_StringBufferWriter = function(a) { - return new cljs.core.StringBufferWriter(a) + return new cljs.core.StringBufferWriter(a); }; cljs.core.pr_str_STAR_ = function(a) { var b = new goog.string.StringBuffer, c = new cljs.core.StringBufferWriter(b); cljs.core._pr_writer.call(null, a, c, cljs.core.pr_opts.call(null)); cljs.core._flush.call(null, c); - return"" + cljs.core.str(b) + return "" + cljs.core.str(b); }; cljs.core.instance_QMARK_ = function(a, b) { - return b instanceof a + return b instanceof a; }; cljs.core.symbol_QMARK_ = function(a) { - return a instanceof cljs.core.Symbol + return a instanceof cljs.core.Symbol; }; cljs.core.hash_symbol = function(a) { - return cljs.core.hash_combine.call(null, cljs.core.hash.call(null, a.ns), cljs.core.hash.call(null, a.name)) + return cljs.core.hash_combine.call(null, cljs.core.hash.call(null, a.ns), cljs.core.hash.call(null, a.name)); }; cljs.core.compare_symbols = function(a, b) { - if(cljs.core.truth_(cljs.core._EQ_.call(null, a, b))) { - return 0 + if (cljs.core.truth_(cljs.core._EQ_.call(null, a, b))) { + return 0; } - if(cljs.core.truth_(function() { + if (cljs.core.truth_(function() { var c = cljs.core.not.call(null, a.ns); - return c ? b.ns : c + return c ? b.ns : c; }())) { - return-1 + return-1; } - if(cljs.core.truth_(a.ns)) { - if(cljs.core.not.call(null, b.ns)) { - return 1 + if (cljs.core.truth_(a.ns)) { + if (cljs.core.not.call(null, b.ns)) { + return 1; } var c = cljs.core.compare.call(null, a.ns, b.ns); - return 0 === c ? cljs.core.compare.call(null, a.name, b.name) : c + return 0 === c ? cljs.core.compare.call(null, a.name, b.name) : c; } - return new cljs.core.Keyword(null, "default", "default", 2558708147) ? cljs.core.compare.call(null, a.name, b.name) : null + return new cljs.core.Keyword(null, "default", "default", 2558708147) ? cljs.core.compare.call(null, a.name, b.name) : null; }; cljs.core.Symbol = function(a, b, c, d, e) { this.ns = a; @@ -2716,31 +2734,31 @@ cljs.core.Symbol = function(a, b, c, d, e) { this._hash = d; this._meta = e; this.cljs$lang$protocol_mask$partition0$ = 2154168321; - this.cljs$lang$protocol_mask$partition1$ = 4096 + this.cljs$lang$protocol_mask$partition1$ = 4096; }; cljs.core.Symbol.cljs$lang$type = !0; cljs.core.Symbol.cljs$lang$ctorStr = "cljs.core/Symbol"; cljs.core.Symbol.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Symbol") + return cljs.core._write.call(null, b, "cljs.core/Symbol"); }; cljs.core.Symbol.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, this.str) + return cljs.core._write.call(null, b, this.str); }; cljs.core.Symbol.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return this.name + return this.name; }; cljs.core.Symbol.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return this.ns + return this.ns; }; cljs.core.Symbol.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this._hash; - return null != a ? a : this._hash = a = cljs.core.hash_symbol.call(null, this) + return null != a ? a : this._hash = a = cljs.core.hash_symbol.call(null, this); }; cljs.core.Symbol.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, b) + return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, b); }; cljs.core.Symbol.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta + return this._meta; }; cljs.core.Symbol.prototype.call = function() { var a = null; @@ -2749,102 +2767,109 @@ cljs.core.Symbol.prototype.call = function() { case 2: return cljs.core._lookup.call(null, c, this, null); case 3: - return cljs.core._lookup.call(null, c, this, d) + return cljs.core._lookup.call(null, c, this, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.Symbol.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.Symbol.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core._lookup.call(null, a, this, null) + return cljs.core._lookup.call(null, a, this, null); }; cljs.core.Symbol.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, a, this, b) + return cljs.core._lookup.call(null, a, this, b); }; cljs.core.Symbol.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.Symbol ? this.str === b.str : !1 + return b instanceof cljs.core.Symbol ? this.str === b.str : !1; +}; +cljs.core.Symbol.prototype.cljs$core$ICloneable$ = !0; +cljs.core.Symbol.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Symbol(this.ns, this.name, this.str, this._hash, this._meta); }; cljs.core.Symbol.prototype.toString = function() { - return this.str + return this.str; }; cljs.core.__GT_Symbol = function(a, b, c, d, e) { - return new cljs.core.Symbol(a, b, c, d, e) + return new cljs.core.Symbol(a, b, c, d, e); }; cljs.core.symbol = function() { var a = null, b = function(b) { - return b instanceof cljs.core.Symbol ? b : a.call(null, null, b) + return b instanceof cljs.core.Symbol ? b : a.call(null, null, b); }, c = function(a, b) { var c = null != a ? [cljs.core.str(a), cljs.core.str("/"), cljs.core.str(b)].join("") : b; - return new cljs.core.Symbol(a, b, c, null, null) + return new cljs.core.Symbol(a, b, c, null, null); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); +cljs.core.clone = function(a) { + return cljs.core._clone.call(null, a); +}; cljs.core.seq = function(a) { - if(null == a) { - return null + if (null == a) { + return null; } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$)) { - return cljs.core._seq.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$)) { + return cljs.core._seq.call(null, a); } - if(a instanceof Array || "string" === typeof a) { - return 0 === a.length ? null : new cljs.core.IndexedSeq(a, 0) + if (a instanceof Array || "string" === typeof a) { + return 0 === a.length ? null : new cljs.core.IndexedSeq(a, 0); } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a)) { - return cljs.core._seq.call(null, a) + if (cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a)) { + return cljs.core._seq.call(null, a); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error([cljs.core.str(a), cljs.core.str("is not ISeqable")].join("")); } - return null + return null; }; cljs.core.first = function(a) { - if(null == a) { - return null + if (null == a) { + return null; } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$)) { - return cljs.core._first.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$)) { + return cljs.core._first.call(null, a); } a = cljs.core.seq.call(null, a); - return null == a ? null : cljs.core._first.call(null, a) + return null == a ? null : cljs.core._first.call(null, a); }; cljs.core.rest = function(a) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$) ? cljs.core._rest.call(null, a) : (a = cljs.core.seq.call(null, a)) ? cljs.core._rest.call(null, a) : cljs.core.List.EMPTY : cljs.core.List.EMPTY + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$) ? cljs.core._rest.call(null, a) : (a = cljs.core.seq.call(null, a)) ? cljs.core._rest.call(null, a) : cljs.core.List.EMPTY : cljs.core.List.EMPTY; }; cljs.core.next = function(a) { - return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$) ? cljs.core._next.call(null, a) : cljs.core.seq.call(null, cljs.core.rest.call(null, a)) + return null == a ? null : a && (a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$) ? cljs.core._next.call(null, a) : cljs.core.seq.call(null, cljs.core.rest.call(null, a)); }; cljs.core._EQ_ = function() { var a = null, b = function(a, b) { - return null == a ? null == b : a === b || cljs.core._equiv.call(null, a, b) + return null == a ? null == b : a === b || cljs.core._equiv.call(null, a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(a.call(null, b, c)) { - if(cljs.core.next.call(null, d)) { - b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return a.call(null, c, cljs.core.first.call(null, d)) + for (;;) { + if (a.call(null, b, c)) { + if (cljs.core.next.call(null, d)) { + b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d); + } else { + return a.call(null, c, cljs.core.first.call(null, d)); } - }else { - return!1 + } else { + return!1; } } }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -2852,10 +2877,10 @@ cljs.core._EQ_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -2863,104 +2888,104 @@ cljs.core._EQ_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.ICounted["null"] = !0; cljs.core._count["null"] = function(a) { - return 0 + return 0; }; Date.prototype.cljs$core$IEquiv$ = !0; Date.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof Date && this.toString() === b.toString() + return b instanceof Date && this.toString() === b.toString(); }; cljs.core.IEquiv.number = !0; cljs.core._equiv.number = function(a, b) { - return a === b + return a === b; }; cljs.core.IMeta["function"] = !0; cljs.core._meta["function"] = function(a) { - return null + return null; }; cljs.core.Fn["function"] = !0; cljs.core.IHash._ = !0; cljs.core._hash._ = function(a) { - return goog.getUid(a) + return goog.getUid(a); }; cljs.core.inc = function(a) { - return a + 1 + return a + 1; }; cljs.core.Reduced = function(a) { this.val = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32768 + this.cljs$lang$protocol_mask$partition0$ = 32768; }; cljs.core.Reduced.cljs$lang$type = !0; cljs.core.Reduced.cljs$lang$ctorStr = "cljs.core/Reduced"; cljs.core.Reduced.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Reduced") + return cljs.core._write.call(null, b, "cljs.core/Reduced"); }; cljs.core.Reduced.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.__GT_Reduced = function(a) { - return new cljs.core.Reduced(a) + return new cljs.core.Reduced(a); }; cljs.core.reduced = function(a) { - return new cljs.core.Reduced(a) + return new cljs.core.Reduced(a); }; cljs.core.reduced_QMARK_ = function(a) { - return a instanceof cljs.core.Reduced + return a instanceof cljs.core.Reduced; }; cljs.core.ci_reduce = function() { var a = null, b = function(a, b) { var c = cljs.core._count.call(null, a); - if(0 === c) { - return b.call(null) + if (0 === c) { + return b.call(null); } - for(var d = cljs.core._nth.call(null, a, 0), k = 1;;) { - if(k < c) { + for (var d = cljs.core._nth.call(null, a, 0), k = 1;;) { + if (k < c) { d = b.call(null, d, cljs.core._nth.call(null, a, k)); - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d); } - k += 1 - }else { - return d + k += 1; + } else { + return d; } } }, c = function(a, b, c) { - for(var d = cljs.core._count.call(null, a), k = 0;;) { - if(k < d) { + for (var d = cljs.core._count.call(null, a), k = 0;;) { + if (k < d) { c = b.call(null, c, cljs.core._nth.call(null, a, k)); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - k += 1 - }else { - return c + k += 1; + } else { + return c; } } }, d = function(a, b, c, d) { - for(var k = cljs.core._count.call(null, a);;) { - if(d < k) { + for (var k = cljs.core._count.call(null, a);;) { + if (d < k) { c = b.call(null, c, cljs.core._nth.call(null, a, d)); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - d += 1 - }else { - return c + d += 1; + } else { + return c; } } }, a = function(a, f, g, h) { @@ -2970,54 +2995,54 @@ cljs.core.ci_reduce = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.array_reduce = function() { var a = null, b = function(a, b) { var c = a.length; - if(0 === a.length) { - return b.call(null) + if (0 === a.length) { + return b.call(null); } - for(var d = a[0], k = 1;;) { - if(k < c) { + for (var d = a[0], k = 1;;) { + if (k < c) { d = b.call(null, d, a[k]); - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d); } - k += 1 - }else { - return d + k += 1; + } else { + return d; } } }, c = function(a, b, c) { - for(var d = a.length, k = 0;;) { - if(k < d) { + for (var d = a.length, k = 0;;) { + if (k < d) { c = b.call(null, c, a[k]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - k += 1 - }else { - return c + k += 1; + } else { + return c; } } }, d = function(a, b, c, d) { - for(var k = a.length;;) { - if(d < k) { + for (var k = a.length;;) { + if (d < k) { c = b.call(null, c, a[d]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - d += 1 - }else { - return c + d += 1; + } else { + return c; } } }, a = function(a, f, g, h) { @@ -3027,218 +3052,226 @@ cljs.core.array_reduce = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.counted_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a); }; cljs.core.indexed_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a); }; cljs.core.IndexedSeq = function(a, b) { this.arr = a; this.i = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 166199550 + this.cljs$lang$protocol_mask$partition0$ = 166199550; }; cljs.core.IndexedSeq.cljs$lang$type = !0; cljs.core.IndexedSeq.cljs$lang$ctorStr = "cljs.core/IndexedSeq"; cljs.core.IndexedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/IndexedSeq") + return cljs.core._write.call(null, b, "cljs.core/IndexedSeq"); }; cljs.core.IndexedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) + return cljs.core.hash_coll.call(null, this); }; cljs.core.IndexedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : null + return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : null; }; cljs.core.IndexedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.IndexedSeq.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { a = cljs.core._count.call(null, this); - return 0 < a ? new cljs.core.RSeq(this, a - 1, null) : null + return 0 < a ? new cljs.core.RSeq(this, a - 1, null) : null; }; cljs.core.IndexedSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.i], this.i + 1) + return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.i], this.i + 1); }; cljs.core.IndexedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.array_reduce.call(null, this.arr, b, c, this.i) + return cljs.core.array_reduce.call(null, this.arr, b, c, this.i); }; cljs.core.IndexedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.IndexedSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.arr.length - this.i + return this.arr.length - this.i; }; cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.arr[this.i] + return this.arr[this.i]; }; cljs.core.IndexedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : cljs.core.List.EMPTY + return this.i + 1 < this.arr.length ? new cljs.core.IndexedSeq(this.arr, this.i + 1) : cljs.core.List.EMPTY; }; cljs.core.IndexedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); +}; +cljs.core.IndexedSeq.prototype.cljs$core$ICloneable$ = !0; +cljs.core.IndexedSeq.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.IndexedSeq(this.arr, this.i); }; cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { var c = b + this.i; - return c < this.arr.length ? this.arr[c] : null + return c < this.arr.length ? this.arr[c] : null; }; cljs.core.IndexedSeq.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { a = b + this.i; - return a < this.arr.length ? this.arr[a] : c + return a < this.arr.length ? this.arr[a] : c; }; cljs.core.IndexedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.List.EMPTY + return cljs.core.List.EMPTY; }; cljs.core.__GT_IndexedSeq = function(a, b) { - return new cljs.core.IndexedSeq(a, b) + return new cljs.core.IndexedSeq(a, b); }; cljs.core.prim_seq = function() { var a = null, b = function(b) { - return a.call(null, b, 0) + return a.call(null, b, 0); }, c = function(a, b) { - return b < a.length ? new cljs.core.IndexedSeq(a, b) : null + return b < a.length ? new cljs.core.IndexedSeq(a, b) : null; }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.array_seq = function() { var a = null, b = function(a) { - return cljs.core.prim_seq.call(null, a, 0) + return cljs.core.prim_seq.call(null, a, 0); }, c = function(a, b) { - return cljs.core.prim_seq.call(null, a, b) + return cljs.core.prim_seq.call(null, a, b); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.RSeq = function(a, b, c) { this.ci = a; this.i = b; this.meta = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374862 + this.cljs$lang$protocol_mask$partition0$ = 32374862; }; cljs.core.RSeq.cljs$lang$type = !0; cljs.core.RSeq.cljs$lang$ctorStr = "cljs.core/RSeq"; cljs.core.RSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/RSeq") + return cljs.core._write.call(null, b, "cljs.core/RSeq"); }; cljs.core.RSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) + return cljs.core.hash_coll.call(null, this); }; cljs.core.RSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.RSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.RSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.RSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.RSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.RSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.i + 1 + return this.i + 1; }; cljs.core.RSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core._nth.call(null, this.ci, this.i) + return cljs.core._nth.call(null, this.ci, this.i); }; cljs.core.RSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : null + return 0 < this.i ? new cljs.core.RSeq(this.ci, this.i - 1, null) : null; }; cljs.core.RSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.RSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.RSeq(this.ci, this.i, b) + return new cljs.core.RSeq(this.ci, this.i, b); +}; +cljs.core.RSeq.prototype.cljs$core$ICloneable$ = !0; +cljs.core.RSeq.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.RSeq(this.ci, this.i, this.meta); }; cljs.core.RSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.RSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_RSeq = function(a, b, c) { - return new cljs.core.RSeq(a, b, c) + return new cljs.core.RSeq(a, b, c); }; cljs.core.second = function(a) { - return cljs.core.first.call(null, cljs.core.next.call(null, a)) + return cljs.core.first.call(null, cljs.core.next.call(null, a)); }; cljs.core.ffirst = function(a) { - return cljs.core.first.call(null, cljs.core.first.call(null, a)) + return cljs.core.first.call(null, cljs.core.first.call(null, a)); }; cljs.core.nfirst = function(a) { - return cljs.core.next.call(null, cljs.core.first.call(null, a)) + return cljs.core.next.call(null, cljs.core.first.call(null, a)); }; cljs.core.fnext = function(a) { - return cljs.core.first.call(null, cljs.core.next.call(null, a)) + return cljs.core.first.call(null, cljs.core.next.call(null, a)); }; cljs.core.nnext = function(a) { - return cljs.core.next.call(null, cljs.core.next.call(null, a)) + return cljs.core.next.call(null, cljs.core.next.call(null, a)); }; cljs.core.last = function(a) { - for(;;) { + for (;;) { var b = cljs.core.next.call(null, a); - if(null != b) { - a = b - }else { - return cljs.core.first.call(null, a) + if (null != b) { + a = b; + } else { + return cljs.core.first.call(null, a); } } }; cljs.core.IEquiv._ = !0; cljs.core._equiv._ = function(a, b) { - return a === b + return a === b; }; cljs.core.conj = function() { var a = null, b = function(a, b) { - return null != a ? cljs.core._conj.call(null, a, b) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b) + return null != a ? cljs.core._conj.call(null, a, b) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(cljs.core.truth_(d)) { - b = a.call(null, b, c), c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return a.call(null, b, c) + for (;;) { + if (cljs.core.truth_(d)) { + b = a.call(null, b, c), c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d); + } else { + return a.call(null, b, c); } } }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -3246,16 +3279,16 @@ cljs.core.conj = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; @@ -3263,65 +3296,65 @@ cljs.core.conj = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.empty = function(a) { - return null == a ? null : cljs.core._empty.call(null, a) + return null == a ? null : cljs.core._empty.call(null, a); }; cljs.core.accumulating_seq_count = function(a) { a = cljs.core.seq.call(null, a); - for(var b = 0;;) { - if(cljs.core.counted_QMARK_.call(null, a)) { - return b + cljs.core._count.call(null, a) + for (var b = 0;;) { + if (cljs.core.counted_QMARK_.call(null, a)) { + return b + cljs.core._count.call(null, a); } a = cljs.core.next.call(null, a); - b += 1 + b += 1; } }; cljs.core.count = function(a) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$) ? cljs.core._count.call(null, a) : a instanceof Array ? a.length : "string" === typeof a ? a.length : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) ? cljs.core._count.call(null, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.accumulating_seq_count.call(null, a) : null : 0 + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 2 || a.cljs$core$ICounted$) ? cljs.core._count.call(null, a) : a instanceof Array ? a.length : "string" === typeof a ? a.length : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICounted, a) ? cljs.core._count.call(null, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.accumulating_seq_count.call(null, a) : null : 0; }; cljs.core.linear_traversal_nth = function() { var a = null, b = function(a, b) { - for(;;) { - if(null == a) { + for (;;) { + if (null == a) { throw Error("Index out of bounds"); } - if(0 === b) { - if(cljs.core.seq.call(null, a)) { - return cljs.core.first.call(null, a) + if (0 === b) { + if (cljs.core.seq.call(null, a)) { + return cljs.core.first.call(null, a); } throw Error("Index out of bounds"); } - if(cljs.core.indexed_QMARK_.call(null, a)) { - return cljs.core._nth.call(null, a, b) + if (cljs.core.indexed_QMARK_.call(null, a)) { + return cljs.core._nth.call(null, a, b); } - if(cljs.core.seq.call(null, a)) { + if (cljs.core.seq.call(null, a)) { var c = cljs.core.next.call(null, a), g = b - 1; a = c; - b = g - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + b = g; + } else { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error("Index out of bounds"); } - return null + return null; } } }, c = function(a, b, c) { - for(;;) { - if(null == a) { - return c + for (;;) { + if (null == a) { + return c; } - if(0 === b) { - return cljs.core.seq.call(null, a) ? cljs.core.first.call(null, a) : c + if (0 === b) { + return cljs.core.seq.call(null, a) ? cljs.core.first.call(null, a) : c; } - if(cljs.core.indexed_QMARK_.call(null, a)) { - return cljs.core._nth.call(null, a, b, c) + if (cljs.core.indexed_QMARK_.call(null, a)) { + return cljs.core._nth.call(null, a, b, c); } - if(cljs.core.seq.call(null, a)) { - a = cljs.core.next.call(null, a), b -= 1 - }else { - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null + if (cljs.core.seq.call(null, a)) { + a = cljs.core.next.call(null, a), b -= 1; + } else { + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null; } } }, a = function(a, e, f) { @@ -3329,115 +3362,115 @@ cljs.core.linear_traversal_nth = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.nth = function() { var a = null, b = function(a, b) { - if(null == a) { - return null + if (null == a) { + return null; } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { - return cljs.core._nth.call(null, a, b) + if (a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { + return cljs.core._nth.call(null, a, b); } - if(a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : null + if (a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : null; } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { - return cljs.core._nth.call(null, a, b) + if (cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { + return cljs.core._nth.call(null, a, b); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - if(a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { - return cljs.core.linear_traversal_nth.call(null, a, b) + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { + return cljs.core.linear_traversal_nth.call(null, a, b); } throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str.call(null, cljs.core.type.call(null, a)))].join("")); } - return null + return null; }, c = function(a, b, c) { - if(null != a) { - if(a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { - return cljs.core._nth.call(null, a, b, c) + if (null != a) { + if (a && (a.cljs$lang$protocol_mask$partition0$ & 16 || a.cljs$core$IIndexed$)) { + return cljs.core._nth.call(null, a, b, c); } - if(a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : c + if (a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : c; } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { - return cljs.core._nth.call(null, a, b) + if (cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IIndexed, a)) { + return cljs.core._nth.call(null, a, b); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - if(a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { - return cljs.core.linear_traversal_nth.call(null, a, b, c) + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a)) { + return cljs.core.linear_traversal_nth.call(null, a, b, c); } throw Error([cljs.core.str("nth not supported on this type "), cljs.core.str(cljs.core.type__GT_str.call(null, cljs.core.type.call(null, a)))].join("")); } - return null + return null; } - return c + return c; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.get = function() { var a = null, b = function(a, b) { - if(null == a) { - return null + if (null == a) { + return null; } - if(a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$)) { - return cljs.core._lookup.call(null, a, b) + if (a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$)) { + return cljs.core._lookup.call(null, a, b); } - if(a instanceof Array || "string" === typeof a) { - return b < a.length ? a[b] : null + if (a instanceof Array || "string" === typeof a) { + return b < a.length ? a[b] : null; } - if(cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a)) { - return cljs.core._lookup.call(null, a, b) + if (cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a)) { + return cljs.core._lookup.call(null, a, b); } new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null; }, c = function(a, b, c) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? cljs.core._lookup.call(null, a, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a) ? cljs.core._lookup.call(null, a, b, c) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null : c + return null != a ? a && (a.cljs$lang$protocol_mask$partition0$ & 256 || a.cljs$core$ILookup$) ? cljs.core._lookup.call(null, a, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, a) ? cljs.core._lookup.call(null, a, b, c) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null : c; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.assoc = function() { var a = null, b = function(a, b, c) { - return null != a ? cljs.core._assoc.call(null, a, b, c) : cljs.core.PersistentHashMap.fromArrays.call(null, [b], [c]) + return null != a ? cljs.core._assoc.call(null, a, b, c) : cljs.core.PersistentHashMap.fromArrays.call(null, [b], [c]); }, c = function() { var b = function(b, c, d, e) { - for(;;) { - if(b = a.call(null, b, c, d), cljs.core.truth_(e)) { - c = cljs.core.first.call(null, e), d = cljs.core.second.call(null, e), e = cljs.core.nnext.call(null, e) - }else { - return b + for (;;) { + if (b = a.call(null, b, c, d), cljs.core.truth_(e)) { + c = cljs.core.first.call(null, e), d = cljs.core.second.call(null, e), e = cljs.core.nnext.call(null, e); + } else { + return b; } } }, c = function(a, c, e, k) { var l = null; 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, e, l) + return b.call(this, a, c, e, l); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -3447,16 +3480,16 @@ cljs.core.assoc = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a) + return b(c, e, k, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f, g) { switch(arguments.length) { case 3: return b.call(this, a, e, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; @@ -3464,28 +3497,28 @@ cljs.core.assoc = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.dissoc = function() { var a = null, b = function(a, b) { - return cljs.core._dissoc.call(null, a, b) + return null == a ? null : cljs.core._dissoc.call(null, a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(null == b) { - return null + for (;;) { + if (null == b) { + return null; } b = a.call(null, b, c); - if(cljs.core.truth_(d)) { - c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return b + if (cljs.core.truth_(d)) { + c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d); + } else { + return b; } } }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -3493,10 +3526,10 @@ cljs.core.dissoc = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3504,109 +3537,109 @@ cljs.core.dissoc = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.fn_QMARK_ = function(a) { var b = goog.isFunction(a); - return b ? b : a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$Fn$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) + return b ? b : a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$Fn$) ? !0 : a.cljs$lang$protocol_mask$partition$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.Fn, a); }; cljs.core.with_meta = function with_meta(b, c) { return cljs.core.fn_QMARK_.call(null, b) && !(b ? b.cljs$lang$protocol_mask$partition0$ & 262144 || b.cljs$core$IWithMeta$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, b)) ? with_meta.call(null, function() { - "undefined" === typeof cljs.core.t6140 && (cljs.core.t6140 = function(b, c, f, g) { + "undefined" === typeof cljs.core.t16981 && (cljs.core.t16981 = function(b, c, f, g) { this.meta = b; this.o = c; this.with_meta = f; - this.meta6141 = g; + this.meta16982 = g; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 393217 - }, cljs.core.t6140.cljs$lang$type = !0, cljs.core.t6140.cljs$lang$ctorStr = "cljs.core/t6140", cljs.core.t6140.cljs$lang$ctorPrWriter = function(b, c, f) { - return cljs.core._write.call(null, c, "cljs.core/t6140") - }, cljs.core.t6140.prototype.call = function() { + this.cljs$lang$protocol_mask$partition0$ = 393217; + }, cljs.core.t16981.cljs$lang$type = !0, cljs.core.t16981.cljs$lang$ctorStr = "cljs.core/t16981", cljs.core.t16981.cljs$lang$ctorPrWriter = function(b, c, f) { + return cljs.core._write.call(null, c, "cljs.core/t16981"); + }, cljs.core.t16981.prototype.call = function() { var b = function(b, c) { - return cljs.core.apply.call(null, b.o, c) + return cljs.core.apply.call(null, b.o, c); }, c = function(c, e) { c = this; var h = null; 1 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return b.call(this, c, h) + return b.call(this, c, h); }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(c) { var e = cljs.core.first(c); c = cljs.core.rest(c); - return b(e, c) + return b(e, c); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), cljs.core.t6140.prototype.apply = function(b, c) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, c))) - }, cljs.core.t6140.prototype.cljs$core$IFn$_invoke$arity$2 = function() { + return c; + }(), cljs.core.t16981.prototype.apply = function(b, c) { + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, c))); + }, cljs.core.t16981.prototype.cljs$core$IFn$_invoke$arity$2 = function() { var b = function(b) { - return cljs.core.apply.call(null, self__.o, b) + return cljs.core.apply.call(null, self__.o, b); }, c = function(c) { var e = null; 0 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return b.call(this, e) + return b.call(this, e); }; c.cljs$lang$maxFixedArity = 0; c.cljs$lang$applyTo = function(c) { c = cljs.core.seq(c); - return b(c) + return b(c); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c - }(), cljs.core.t6140.prototype.cljs$core$Fn$ = !0, cljs.core.t6140.prototype.cljs$core$IMeta$_meta$arity$1 = function(b) { - return this.meta6141 - }, cljs.core.t6140.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(b, c) { - return new cljs.core.t6140(this.meta, this.o, this.with_meta, c) - }, cljs.core.__GT_t6140 = function(b, c, f, g) { - return new cljs.core.t6140(b, c, f, g) + return c; + }(), cljs.core.t16981.prototype.cljs$core$Fn$ = !0, cljs.core.t16981.prototype.cljs$core$IMeta$_meta$arity$1 = function(b) { + return this.meta16982; + }, cljs.core.t16981.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(b, c) { + return new cljs.core.t16981(this.meta, this.o, this.with_meta, c); + }, cljs.core.__GT_t16981 = function(b, c, f, g) { + return new cljs.core.t16981(b, c, f, g); }); - return new cljs.core.t6140(c, b, with_meta, null) - }(), c) : null == b ? null : cljs.core._with_meta.call(null, b, c) + return new cljs.core.t16981(c, b, with_meta, null); + }(), c) : null == b ? null : cljs.core._with_meta.call(null, b, c); }; cljs.core.meta = function(a) { var b; b = (b = null != a) ? a ? a.cljs$lang$protocol_mask$partition0$ & 131072 || a.cljs$core$IMeta$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, a) : b; - return b ? cljs.core._meta.call(null, a) : null + return b ? cljs.core._meta.call(null, a) : null; }; cljs.core.peek = function(a) { - return null == a ? null : cljs.core._peek.call(null, a) + return null == a ? null : cljs.core._peek.call(null, a); }; cljs.core.pop = function(a) { - return null == a ? null : cljs.core._pop.call(null, a) + return null == a ? null : cljs.core._pop.call(null, a); }; cljs.core.disj = function() { var a = null, b = function(a, b) { - return cljs.core._disjoin.call(null, a, b) + return null == a ? null : cljs.core._disjoin.call(null, a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(null == b) { - return null + for (;;) { + if (null == b) { + return null; } b = a.call(null, b, c); - if(cljs.core.truth_(d)) { - c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return b + if (cljs.core.truth_(d)) { + c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d); + } else { + return b; } } }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -3614,10 +3647,10 @@ cljs.core.disj = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3625,193 +3658,193 @@ cljs.core.disj = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.string_hash_cache = function() { - return{} + return{}; }(); cljs.core.string_hash_cache_count = 0; cljs.core.add_to_string_hash_cache = function(a) { var b = goog.string.hashCode(a); cljs.core.string_hash_cache[a] = b; cljs.core.string_hash_cache_count += 1; - return b + return b; }; cljs.core.check_string_hash_cache = function(a) { 255 < cljs.core.string_hash_cache_count && (cljs.core.string_hash_cache = {}, cljs.core.string_hash_cache_count = 0); var b = cljs.core.string_hash_cache[a]; - return"number" === typeof b ? b : cljs.core.add_to_string_hash_cache.call(null, a) + return "number" === typeof b ? b : cljs.core.add_to_string_hash_cache.call(null, a); }; cljs.core.hash = function(a) { - return a && (a.cljs$lang$protocol_mask$partition0$ & 4194304 || a.cljs$core$IHash$) ? cljs.core._hash.call(null, a) : "number" === typeof a ? Math.floor(a) % 2147483647 : !0 === a ? 1 : !1 === a ? 0 : "string" === typeof a ? cljs.core.check_string_hash_cache.call(null, a) : null == a ? 0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._hash.call(null, a) : null + return a && (a.cljs$lang$protocol_mask$partition0$ & 4194304 || a.cljs$core$IHash$) ? cljs.core._hash.call(null, a) : "number" === typeof a ? Math.floor(a) % 2147483647 : !0 === a ? 1 : !1 === a ? 0 : "string" === typeof a ? cljs.core.check_string_hash_cache.call(null, a) : null == a ? 0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._hash.call(null, a) : null; }; cljs.core.empty_QMARK_ = function(a) { - return null == a || cljs.core.not.call(null, cljs.core.seq.call(null, a)) + return null == a || cljs.core.not.call(null, cljs.core.seq.call(null, a)); }; cljs.core.coll_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 8 || a.cljs$core$ICollection$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 8 || a.cljs$core$ICollection$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ICollection, a); }; cljs.core.set_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 4096 || a.cljs$core$ISet$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 4096 || a.cljs$core$ISet$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISet, a); }; cljs.core.associative_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 512 || a.cljs$core$IAssociative$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 512 || a.cljs$core$IAssociative$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IAssociative, a); }; cljs.core.sequential_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16777216 || a.cljs$core$ISequential$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 16777216 || a.cljs$core$ISequential$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISequential, a); }; cljs.core.sorted_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 268435456 || a.cljs$core$ISorted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 268435456 || a.cljs$core$ISorted$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISorted, a); }; cljs.core.reduceable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 524288 || a.cljs$core$IReduce$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 524288 || a.cljs$core$IReduce$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, a); }; cljs.core.map_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 1024 || a.cljs$core$IMap$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 1024 || a.cljs$core$IMap$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMap, a); }; cljs.core.vector_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 16384 || a.cljs$core$IVector$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 16384 || a.cljs$core$IVector$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IVector, a); }; cljs.core.chunked_seq_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition1$ & 512 || a.cljs$core$IChunkedSeq$ ? !0 : !1 : !1 + return a ? a.cljs$lang$protocol_mask$partition1$ & 512 || a.cljs$core$IChunkedSeq$ ? !0 : !1 : !1; }; cljs.core.js_obj = function() { var a = null, b = function() { var a = function(a) { - return cljs.core.apply.call(null, goog.object.create, a) + return cljs.core.apply.call(null, goog.object.create, a); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a) { switch(arguments.length) { case 0: return{}; default: - return b.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)) + return b.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 0; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return{} + return{}; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.js_keys = function(a) { var b = []; goog.object.forEach(a, function(a, d, e) { - return b.push(d) + return b.push(d); }); - return b + return b; }; cljs.core.js_delete = function(a, b) { - return delete a[b] + return delete a[b]; }; cljs.core.array_copy = function(a, b, c, d, e) { - for(;;) { - if(0 === e) { - return c + for (;;) { + if (0 === e) { + return c; } c[d] = a[b]; d += 1; e -= 1; - b += 1 + b += 1; } }; cljs.core.array_copy_downward = function(a, b, c, d, e) { b += e - 1; - for(d += e - 1;;) { - if(0 === e) { - return c + for (d += e - 1;;) { + if (0 === e) { + return c; } c[d] = a[b]; d -= 1; e -= 1; - b -= 1 + b -= 1; } }; cljs.core.lookup_sentinel = function() { - return{} + return{}; }(); cljs.core.false_QMARK_ = function(a) { - return!1 === a + return!1 === a; }; cljs.core.true_QMARK_ = function(a) { - return!0 === a + return!0 === a; }; cljs.core.undefined_QMARK_ = function(a) { - return void 0 === a + return void 0 === a; }; cljs.core.seq_QMARK_ = function(a) { - return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) + return null == a ? !1 : a ? a.cljs$lang$protocol_mask$partition0$ & 64 || a.cljs$core$ISeq$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeq, a); }; cljs.core.seqable_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 8388608 || a.cljs$core$ISeqable$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ISeqable, a); }; cljs.core.boolean$ = function(a) { - return cljs.core.truth_(a) ? !0 : !1 + return cljs.core.truth_(a) ? !0 : !1; }; cljs.core.ifn_QMARK_ = function(a) { var b = cljs.core.fn_QMARK_.call(null, a); - return b ? b : a ? a.cljs$lang$protocol_mask$partition0$ & 1 || a.cljs$core$IFn$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) + return b ? b : a ? a.cljs$lang$protocol_mask$partition0$ & 1 || a.cljs$core$IFn$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IFn, a); }; cljs.core.integer_QMARK_ = function(a) { - return"number" === typeof a && !isNaN(a) && Infinity !== a && parseFloat(a) === parseInt(a, 10) + return "number" === typeof a && !isNaN(a) && Infinity !== a && parseFloat(a) === parseInt(a, 10); }; cljs.core.contains_QMARK_ = function(a, b) { - return cljs.core.get.call(null, a, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? !1 : !0 + return cljs.core.get.call(null, a, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? !1 : !0; }; cljs.core.find = function(a, b) { - return null != a && cljs.core.associative_QMARK_.call(null, a) && cljs.core.contains_QMARK_.call(null, a, b) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, cljs.core.get.call(null, a, b)], null) : null + return null != a && cljs.core.associative_QMARK_.call(null, a) && cljs.core.contains_QMARK_.call(null, a, b) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, cljs.core.get.call(null, a, b)], null) : null; }; cljs.core.distinct_QMARK_ = function() { var a = null, b = function(a, b) { - return!cljs.core._EQ_.call(null, a, b) + return!cljs.core._EQ_.call(null, a, b); }, c = function() { var a = function(a, b, c) { - if(cljs.core._EQ_.call(null, a, b)) { - return!1 + if (cljs.core._EQ_.call(null, a, b)) { + return!1; } a = cljs.core.PersistentHashSet.fromArray([b, a], !0); - for(b = c;;) { + for (b = c;;) { var d = cljs.core.first.call(null, b); c = cljs.core.next.call(null, b); - if(cljs.core.truth_(b)) { - if(cljs.core.contains_QMARK_.call(null, a, d)) { - return!1 + if (cljs.core.truth_(b)) { + if (cljs.core.contains_QMARK_.call(null, a, d)) { + return!1; } a = cljs.core.conj.call(null, a, d); - b = c - }else { - return!0 + b = c; + } else { + return!0; } } }, b = function(b, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, c, k) + return a.call(this, b, c, k); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -3819,10 +3852,10 @@ cljs.core.distinct_QMARK_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b) + return a(c, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -3830,51 +3863,51 @@ cljs.core.distinct_QMARK_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.sequence = function(a) { - return cljs.core.seq_QMARK_.call(null, a) ? a : (a = cljs.core.seq.call(null, a)) ? a : cljs.core.List.EMPTY + return cljs.core.seq_QMARK_.call(null, a) ? a : (a = cljs.core.seq.call(null, a)) ? a : cljs.core.List.EMPTY; }; cljs.core.compare = function(a, b) { - if(a === b) { - return 0 + if (a === b) { + return 0; } - if(null == a) { - return-1 + if (null == a) { + return-1; } - if(null == b) { - return 1 + if (null == b) { + return 1; } - if(cljs.core.type.call(null, a) === cljs.core.type.call(null, b)) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 2048 || a.cljs$core$IComparable$) ? cljs.core._compare.call(null, a, b) : goog.array.defaultCompare(a, b) + if (cljs.core.type.call(null, a) === cljs.core.type.call(null, b)) { + return a && (a.cljs$lang$protocol_mask$partition1$ & 2048 || a.cljs$core$IComparable$) ? cljs.core._compare.call(null, a, b) : goog.array.defaultCompare(a, b); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error("compare on non-nil objects of different types"); } - return null + return null; }; cljs.core.compare_indexed = function() { var a = null, b = function(b, c) { var f = cljs.core.count.call(null, b), g = cljs.core.count.call(null, c); - return f < g ? -1 : f > g ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a.call(null, b, c, f, 0) : null + return f < g ? -1 : f > g ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a.call(null, b, c, f, 0) : null; }, c = function(a, b, c, g) { - for(;;) { + for (;;) { var h = cljs.core.compare.call(null, cljs.core.nth.call(null, a, g), cljs.core.nth.call(null, b, g)); - if(0 === h && g + 1 < c) { - g += 1 - }else { - return h + if (0 === h && g + 1 < c) { + g += 1; + } else { + return h; } } }, a = function(a, e, f, g) { @@ -3882,77 +3915,77 @@ cljs.core.compare_indexed = function() { case 2: return b.call(this, a, e); case 4: - return c.call(this, a, e, f, g) + return c.call(this, a, e, f, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$4 = c; - return a + return a; }(); cljs.core.fn__GT_comparator = function(a) { return cljs.core._EQ_.call(null, a, cljs.core.compare) ? cljs.core.compare : function(b, c) { var d = a.call(null, b, c); - return"number" === typeof d ? d : cljs.core.truth_(d) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : 0 - } + return "number" === typeof d ? d : cljs.core.truth_(d) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : 0; + }; }; cljs.core.sort = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.compare, b) + return a.call(null, cljs.core.compare, b); }, c = function(a, b) { - if(cljs.core.seq.call(null, b)) { + if (cljs.core.seq.call(null, b)) { var c = cljs.core.to_array.call(null, b); goog.array.stableSort(c, cljs.core.fn__GT_comparator.call(null, a)); - return cljs.core.seq.call(null, c) + return cljs.core.seq.call(null, c); } - return cljs.core.List.EMPTY + return cljs.core.List.EMPTY; }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.sort_by = function() { var a = null, b = function(b, c) { - return a.call(null, b, cljs.core.compare, c) + return a.call(null, b, cljs.core.compare, c); }, c = function(a, b, c) { return cljs.core.sort.call(null, function(c, f) { - return cljs.core.fn__GT_comparator.call(null, b).call(null, a.call(null, c), a.call(null, f)) - }, c) + return cljs.core.fn__GT_comparator.call(null, b).call(null, a.call(null, c), a.call(null, f)); + }, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.seq_reduce = function() { var a = null, b = function(a, b) { var c = cljs.core.seq.call(null, b); - return c ? cljs.core.reduce.call(null, a, cljs.core.first.call(null, c), cljs.core.next.call(null, c)) : a.call(null) + return c ? cljs.core.reduce.call(null, a, cljs.core.first.call(null, c), cljs.core.next.call(null, c)) : a.call(null); }, c = function(a, b, c) { - for(c = cljs.core.seq.call(null, c);;) { - if(c) { + for (c = cljs.core.seq.call(null, c);;) { + if (c) { b = a.call(null, b, cljs.core.first.call(null, c)); - if(cljs.core.reduced_QMARK_.call(null, b)) { - return cljs.core.deref.call(null, b) + if (cljs.core.reduced_QMARK_.call(null, b)) { + return cljs.core.deref.call(null, b); } - c = cljs.core.next.call(null, c) - }else { - return b + c = cljs.core.next.call(null, c); + } else { + return b; } } }, a = function(a, e, f) { @@ -3960,48 +3993,48 @@ cljs.core.seq_reduce = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.shuffle = function(a) { a = cljs.core.to_array.call(null, a); goog.array.shuffle(a); - return cljs.core.vec.call(null, a) + return cljs.core.vec.call(null, a); }; cljs.core.reduce = function() { var a = null, b = function(a, b) { - return b && (b.cljs$lang$protocol_mask$partition0$ & 524288 || b.cljs$core$IReduce$) ? cljs.core._reduce.call(null, b, a) : b instanceof Array ? cljs.core.array_reduce.call(null, b, a) : "string" === typeof b ? cljs.core.array_reduce.call(null, b, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, b) ? cljs.core._reduce.call(null, b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b) : null + return b && (b.cljs$lang$protocol_mask$partition0$ & 524288 || b.cljs$core$IReduce$) ? cljs.core._reduce.call(null, b, a) : b instanceof Array ? cljs.core.array_reduce.call(null, b, a) : "string" === typeof b ? cljs.core.array_reduce.call(null, b, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, b) ? cljs.core._reduce.call(null, b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b) : null; }, c = function(a, b, c) { - return c && (c.cljs$lang$protocol_mask$partition0$ & 524288 || c.cljs$core$IReduce$) ? cljs.core._reduce.call(null, c, a, b) : c instanceof Array ? cljs.core.array_reduce.call(null, c, a, b) : "string" === typeof c ? cljs.core.array_reduce.call(null, c, a, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, c) ? cljs.core._reduce.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b, c) : null + return c && (c.cljs$lang$protocol_mask$partition0$ & 524288 || c.cljs$core$IReduce$) ? cljs.core._reduce.call(null, c, a, b) : c instanceof Array ? cljs.core.array_reduce.call(null, c, a, b) : "string" === typeof c ? cljs.core.array_reduce.call(null, c, a, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReduce, c) ? cljs.core._reduce.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.seq_reduce.call(null, a, b, c) : null; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.reduce_kv = function(a, b, c) { - return null != c ? cljs.core._kv_reduce.call(null, c, a, b) : b + return null != c ? cljs.core._kv_reduce.call(null, c, a, b) : b; }; cljs.core._PLUS_ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b + c, d) + return cljs.core.reduce.call(null, a, b + c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4009,10 +4042,10 @@ cljs.core._PLUS_ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4022,32 +4055,32 @@ cljs.core._PLUS_ = function() { case 2: return a + d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0 + return 0; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b + return a + b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b - c, d) + return cljs.core.reduce.call(null, a, b - c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4055,10 +4088,10 @@ cljs.core._ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4066,29 +4099,29 @@ cljs.core._ = function() { case 2: return a - d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a + return-a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b + return a - b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._STAR_ = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b * c, d) + return cljs.core.reduce.call(null, a, b * c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4096,10 +4129,10 @@ cljs.core._STAR_ = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4109,34 +4142,34 @@ cljs.core._STAR_ = function() { case 2: return a * d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1 + return 1; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b + return a * b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._SLASH_ = function() { var a = null, b = function(b) { - return a.call(null, 1, b) + return a.call(null, 1, b); }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, a.call(null, b, c), d) + return cljs.core.reduce.call(null, a, a.call(null, b, c), d); }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4144,10 +4177,10 @@ cljs.core._SLASH_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4155,7 +4188,7 @@ cljs.core._SLASH_ = function() { case 2: return a / e; default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; @@ -4163,29 +4196,29 @@ cljs.core._SLASH_ = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a / b + return a / b; }; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._LT_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a < b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b < cljs.core.first.call(null, c) + for (;;) { + if (a < b) { + if (cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c); + } else { + return b < cljs.core.first.call(null, c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4193,10 +4226,10 @@ cljs.core._LT_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4204,39 +4237,39 @@ cljs.core._LT_ = function() { case 2: return a < d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a < b + return a < b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._LT__EQ_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a <= b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b <= cljs.core.first.call(null, c) + for (;;) { + if (a <= b) { + if (cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c); + } else { + return b <= cljs.core.first.call(null, c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4244,10 +4277,10 @@ cljs.core._LT__EQ_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4255,39 +4288,39 @@ cljs.core._LT__EQ_ = function() { case 2: return a <= d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a <= b + return a <= b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._GT_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a > b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b > cljs.core.first.call(null, c) + for (;;) { + if (a > b) { + if (cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c); + } else { + return b > cljs.core.first.call(null, c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4295,10 +4328,10 @@ cljs.core._GT_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4306,39 +4339,39 @@ cljs.core._GT_ = function() { case 2: return a > d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a > b + return a > b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core._GT__EQ_ = function() { var a = null, b = function() { var a = function(a, b, c) { - for(;;) { - if(a >= b) { - if(cljs.core.next.call(null, c)) { - a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c) - }else { - return b >= cljs.core.first.call(null, c) + for (;;) { + if (a >= b) { + if (cljs.core.next.call(null, c)) { + a = b, b = cljs.core.first.call(null, c), c = cljs.core.next.call(null, c); + } else { + return b >= cljs.core.first.call(null, c); } - }else { - return!1 + } else { + return!1; } } }, b = function(b, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, h) + return a.call(this, b, d, h); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -4346,10 +4379,10 @@ cljs.core._GT__EQ_ = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, g, b) + return a(d, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4357,34 +4390,34 @@ cljs.core._GT__EQ_ = function() { case 2: return a >= d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a >= b + return a >= b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.dec = function(a) { - return a - 1 + return a - 1; }; cljs.core.max = function() { var a = null, b = function(a, b) { - return a > b ? a : b + return a > b ? a : b; }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b > c ? b : c, d) + return cljs.core.reduce.call(null, a, b > c ? b : c, d); }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4392,10 +4425,10 @@ cljs.core.max = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4403,29 +4436,29 @@ cljs.core.max = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.min = function() { var a = null, b = function(a, b) { - return a < b ? a : b + return a < b ? a : b; }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b < c ? b : c, d) + return cljs.core.reduce.call(null, a, b < c ? b : c, d); }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4433,10 +4466,10 @@ cljs.core.min = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4444,66 +4477,66 @@ cljs.core.min = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.byte$ = function(a) { - return a + return a; }; cljs.core.char$ = function(a) { - if("number" === typeof a) { - return String.fromCharCode(a) + if ("number" === typeof a) { + return String.fromCharCode(a); } - if("string" === typeof a && 1 === a.length) { - return a + if ("string" === typeof a && 1 === a.length) { + return a; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error("Argument to char must be a character or number"); } - return null + return null; }; cljs.core.short$ = function(a) { - return a + return a; }; cljs.core.float$ = function(a) { - return a + return a; }; cljs.core.double$ = function(a) { - return a + return a; }; cljs.core.unchecked_byte = function(a) { - return a + return a; }; cljs.core.unchecked_char = function(a) { - return a + return a; }; cljs.core.unchecked_short = function(a) { - return a + return a; }; cljs.core.unchecked_float = function(a) { - return a + return a; }; cljs.core.unchecked_double = function(a) { - return a + return a; }; cljs.core.unchecked_add = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b + c, d) + return cljs.core.reduce.call(null, a, b + c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4511,10 +4544,10 @@ cljs.core.unchecked_add = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4524,32 +4557,32 @@ cljs.core.unchecked_add = function() { case 2: return a + d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0 + return 0; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b + return a + b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_add_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b + c, d) + return cljs.core.reduce.call(null, a, b + c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4557,10 +4590,10 @@ cljs.core.unchecked_add_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4570,40 +4603,40 @@ cljs.core.unchecked_add_int = function() { case 2: return a + d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 0 + return 0; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a + b + return a + b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_dec = function(a) { - return a - 1 + return a - 1; }; cljs.core.unchecked_dec_int = function(a) { - return a - 1 + return a - 1; }; cljs.core.unchecked_divide_int = function() { var a = null, b = function(b) { - return a.call(null, 1, b) + return a.call(null, 1, b); }, c = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, a.call(null, b, c), d) + return cljs.core.reduce.call(null, a, a.call(null, b, c), d); }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4611,10 +4644,10 @@ cljs.core.unchecked_divide_int = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4622,7 +4655,7 @@ cljs.core.unchecked_divide_int = function() { case 2: return a / e; default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; @@ -4630,25 +4663,25 @@ cljs.core.unchecked_divide_int = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a / b + return a / b; }; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_inc = function(a) { - return a + 1 + return a + 1; }; cljs.core.unchecked_inc_int = function(a) { - return a + 1 + return a + 1; }; cljs.core.unchecked_multiply = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b * c, d) + return cljs.core.reduce.call(null, a, b * c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4656,10 +4689,10 @@ cljs.core.unchecked_multiply = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4669,32 +4702,32 @@ cljs.core.unchecked_multiply = function() { case 2: return a * d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1 + return 1; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b + return a * b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_multiply_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b * c, d) + return cljs.core.reduce.call(null, a, b * c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4702,10 +4735,10 @@ cljs.core.unchecked_multiply_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 0: @@ -4715,41 +4748,41 @@ cljs.core.unchecked_multiply_int = function() { case 2: return a * d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return 1 + return 1; }; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a * b + return a * b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_negate = function(a) { - return-a + return-a; }; cljs.core.unchecked_negate_int = function(a) { - return-a + return-a; }; cljs.core.unchecked_remainder_int = function(a, b) { - return cljs.core.mod.call(null, a, b) + return cljs.core.mod.call(null, a, b); }; cljs.core.unchecked_substract = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b - c, d) + return cljs.core.reduce.call(null, a, b - c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4757,10 +4790,10 @@ cljs.core.unchecked_substract = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4768,29 +4801,29 @@ cljs.core.unchecked_substract = function() { case 2: return a - d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a + return-a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b + return a - b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.unchecked_substract_int = function() { var a = null, b = function() { var b = function(b, c, d) { - return cljs.core.reduce.call(null, a, b - c, d) + return cljs.core.reduce.call(null, a, b - c, d); }, d = function(a, d, g) { var h = null; 2 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, d, h) + return b.call(this, a, d, h); }; d.cljs$lang$maxFixedArity = 2; d.cljs$lang$applyTo = function(a) { @@ -4798,10 +4831,10 @@ cljs.core.unchecked_substract_int = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(d, g, a) + return b(d, g, a); }; d.cljs$core$IFn$_invoke$arity$variadic = b; - return d + return d; }(), a = function(a, d, e) { switch(arguments.length) { case 1: @@ -4809,158 +4842,158 @@ cljs.core.unchecked_substract_int = function() { case 2: return a - d; default: - return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)) + return b.cljs$core$IFn$_invoke$arity$variadic(a, d, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = b.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return-a + return-a; }; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return a - b + return a - b; }; a.cljs$core$IFn$_invoke$arity$variadic = b.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.fix = function(a) { - return 0 <= a ? Math.floor.call(null, a) : Math.ceil.call(null, a) + return 0 <= a ? Math.floor.call(null, a) : Math.ceil.call(null, a); }; cljs.core.int$ = function(a) { - return a | 0 + return a | 0; }; cljs.core.unchecked_int = function(a) { - return cljs.core.fix.call(null, a) + return cljs.core.fix.call(null, a); }; cljs.core.long$ = function(a) { - return cljs.core.fix.call(null, a) + return cljs.core.fix.call(null, a); }; cljs.core.unchecked_long = function(a) { - return cljs.core.fix.call(null, a) + return cljs.core.fix.call(null, a); }; cljs.core.booleans = function(a) { - return a + return a; }; cljs.core.bytes = function(a) { - return a + return a; }; cljs.core.chars = function(a) { - return a + return a; }; cljs.core.shorts = function(a) { - return a + return a; }; cljs.core.ints = function(a) { - return a + return a; }; cljs.core.floats = function(a) { - return a + return a; }; cljs.core.doubles = function(a) { - return a + return a; }; cljs.core.longs = function(a) { - return a + return a; }; cljs.core.js_mod = function(a, b) { - return a % b + return a % b; }; cljs.core.mod = function(a, b) { - return(a % b + b) % b + return(a % b + b) % b; }; cljs.core.quot = function(a, b) { - return cljs.core.fix.call(null, (a - a % b) / b) + return cljs.core.fix.call(null, (a - a % b) / b); }; cljs.core.rem = function(a, b) { var c = cljs.core.quot.call(null, a, b); - return a - b * c + return a - b * c; }; cljs.core.rand = function() { var a = null, b = function() { - return Math.random.call(null) + return Math.random.call(null); }, c = function(b) { - return b * a.call(null) + return b * a.call(null); }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a) + return c.call(this, a); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a + return a; }(); cljs.core.rand_int = function(a) { - return cljs.core.fix.call(null, cljs.core.rand.call(null, a)) + return cljs.core.fix.call(null, cljs.core.rand.call(null, a)); }; cljs.core.bit_xor = function(a, b) { - return a ^ b + return a ^ b; }; cljs.core.bit_and = function(a, b) { - return a & b + return a & b; }; cljs.core.bit_or = function(a, b) { - return a | b + return a | b; }; cljs.core.bit_and_not = function(a, b) { - return a & ~b + return a & ~b; }; cljs.core.bit_clear = function(a, b) { - return a & ~(1 << b) + return a & ~(1 << b); }; cljs.core.bit_flip = function(a, b) { - return a ^ 1 << b + return a ^ 1 << b; }; cljs.core.bit_not = function(a) { - return~a + return~a; }; cljs.core.bit_set = function(a, b) { - return a | 1 << b + return a | 1 << b; }; cljs.core.bit_test = function(a, b) { - return 0 != (a & 1 << b) + return 0 != (a & 1 << b); }; cljs.core.bit_shift_left = function(a, b) { - return a << b + return a << b; }; cljs.core.bit_shift_right = function(a, b) { - return a >> b + return a >> b; }; cljs.core.bit_shift_right_zero_fill = function(a, b) { - return a >>> b + return a >>> b; }; cljs.core.unsigned_bit_shift_right = function(a, b) { - return a >>> b + return a >>> b; }; cljs.core.bit_count = function(a) { a -= a >> 1 & 1431655765; a = (a & 858993459) + (a >> 2 & 858993459); - return 16843009 * (a + (a >> 4) & 252645135) >> 24 + return 16843009 * (a + (a >> 4) & 252645135) >> 24; }; cljs.core._EQ__EQ_ = function() { var a = null, b = function(a, b) { - return cljs.core._equiv.call(null, a, b) + return cljs.core._equiv.call(null, a, b); }, c = function() { var b = function(b, c, d) { - for(;;) { - if(a.call(null, b, c)) { - if(cljs.core.next.call(null, d)) { - b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d) - }else { - return a.call(null, c, cljs.core.first.call(null, d)) + for (;;) { + if (a.call(null, b, c)) { + if (cljs.core.next.call(null, d)) { + b = c, c = cljs.core.first.call(null, d), d = cljs.core.next.call(null, d); + } else { + return a.call(null, c, cljs.core.first.call(null, d)); } - }else { - return!1 + } else { + return!1; } } }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -4968,10 +5001,10 @@ cljs.core._EQ__EQ_ = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -4979,81 +5012,81 @@ cljs.core._EQ__EQ_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.pos_QMARK_ = function(a) { - return 0 < a + return 0 < a; }; cljs.core.zero_QMARK_ = function(a) { - return 0 === a + return 0 === a; }; cljs.core.neg_QMARK_ = function(a) { - return 0 > a + return 0 > a; }; cljs.core.nthnext = function(a, b) { - for(var c = b, d = cljs.core.seq.call(null, a);;) { - if(d && 0 < c) { - c -= 1, d = cljs.core.next.call(null, d) - }else { - return d + for (var c = b, d = cljs.core.seq.call(null, a);;) { + if (d && 0 < c) { + c -= 1, d = cljs.core.next.call(null, d); + } else { + return d; } } }; cljs.core.str = function() { var a = null, b = function(a) { - return null == a ? "" : a.toString() + return null == a ? "" : a.toString(); }, c = function() { var b = function(b, c) { - for(var d = new goog.string.StringBuffer(a.call(null, b)), e = c;;) { - if(cljs.core.truth_(e)) { - d = d.append(a.call(null, cljs.core.first.call(null, e))), e = cljs.core.next.call(null, e) - }else { - return d.toString() + for (var d = new goog.string.StringBuffer(a.call(null, b)), e = c;;) { + if (cljs.core.truth_(e)) { + d = d.append(a.call(null, cljs.core.first.call(null, e))), e = cljs.core.next.call(null, e); + } else { + return d.toString(); } } }, c = function(a, c) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return b.call(this, a, e) + return b.call(this, a, e); }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, a) + return b(c, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e) { switch(arguments.length) { case 0: - return""; + return ""; case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 1; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return"" + return ""; }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.subs = function() { var a = null, a = function(a, c, d) { @@ -5061,89 +5094,89 @@ cljs.core.subs = function() { case 2: return a.substring(c); case 3: - return a.substring(c, d) + return a.substring(c, d); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = function(a, c) { - return a.substring(c) + return a.substring(c); }; a.cljs$core$IFn$_invoke$arity$3 = function(a, c, d) { - return a.substring(c, d) + return a.substring(c, d); }; - return a + return a; }(); cljs.core.equiv_sequential = function(a, b) { return cljs.core.boolean$.call(null, cljs.core.sequential_QMARK_.call(null, b) ? function() { - for(var c = cljs.core.seq.call(null, a), d = cljs.core.seq.call(null, b);;) { - if(null == c) { - return null == d + for (var c = cljs.core.seq.call(null, a), d = cljs.core.seq.call(null, b);;) { + if (null == c) { + return null == d; } - if(null == d) { - return!1 + if (null == d) { + return!1; } - if(cljs.core._EQ_.call(null, cljs.core.first.call(null, c), cljs.core.first.call(null, d))) { - c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d) - }else { - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null + if (cljs.core._EQ_.call(null, cljs.core.first.call(null, c), cljs.core.first.call(null, d))) { + c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d); + } else { + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null; } } - }() : null) + }() : null); }; cljs.core.hash_combine = function(a, b) { - return a ^ b + 2654435769 + (a << 6) + (a >> 2) + return a ^ b + 2654435769 + (a << 6) + (a >> 2); }; cljs.core.hash_coll = function(a) { - if(cljs.core.seq.call(null, a)) { + if (cljs.core.seq.call(null, a)) { var b = cljs.core.hash.call(null, cljs.core.first.call(null, a)); - for(a = cljs.core.next.call(null, a);;) { - if(null == a) { - return b + for (a = cljs.core.next.call(null, a);;) { + if (null == a) { + return b; } b = cljs.core.hash_combine.call(null, b, cljs.core.hash.call(null, cljs.core.first.call(null, a))); - a = cljs.core.next.call(null, a) + a = cljs.core.next.call(null, a); } - }else { - return 0 + } else { + return 0; } }; cljs.core.hash_imap = function(a) { var b = 0; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { + for (a = cljs.core.seq.call(null, a);;) { + if (a) { var c = cljs.core.first.call(null, a), b = (b + (cljs.core.hash.call(null, cljs.core.key.call(null, c)) ^ cljs.core.hash.call(null, cljs.core.val.call(null, c)))) % 4503599627370496; - a = cljs.core.next.call(null, a) - }else { - return b + a = cljs.core.next.call(null, a); + } else { + return b; } } }; cljs.core.hash_iset = function(a) { var b = 0; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { + for (a = cljs.core.seq.call(null, a);;) { + if (a) { var c = cljs.core.first.call(null, a), b = (b + cljs.core.hash.call(null, c)) % 4503599627370496; - a = cljs.core.next.call(null, a) - }else { - return b + a = cljs.core.next.call(null, a); + } else { + return b; } } }; cljs.core.extend_object_BANG_ = function(a, b) { - for(var c = cljs.core.seq.call(null, b), d = null, e = 0, f = 0;;) { - if(f < e) { + for (var c = cljs.core.seq.call(null, b), d = null, e = 0, f = 0;;) { + if (f < e) { var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null), h = cljs.core.name.call(null, h); a[h] = g; - f += 1 - }else { - if(c = cljs.core.seq.call(null, c)) { - cljs.core.chunked_seq_QMARK_.call(null, c) ? (e = cljs.core.chunk_first.call(null, c), c = cljs.core.chunk_rest.call(null, c), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, c), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), d = cljs.core.name.call(null, d), a[d] = e, c = cljs.core.next.call(null, c), d = null, e = 0), f = 0 - }else { - break + f += 1; + } else { + if (c = cljs.core.seq.call(null, c)) { + cljs.core.chunked_seq_QMARK_.call(null, c) ? (e = cljs.core.chunk_first.call(null, c), c = cljs.core.chunk_rest.call(null, c), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, c), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), d = cljs.core.name.call(null, d), a[d] = e, c = cljs.core.next.call(null, c), d = null, e = 0), f = 0; + } else { + break; } } } - return a + return a; }; cljs.core.List = function(a, b, c, d, e) { this.meta = a; @@ -5152,174 +5185,182 @@ cljs.core.List = function(a, b, c, d, e) { this.count = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 65937646 + this.cljs$lang$protocol_mask$partition0$ = 65937646; }; cljs.core.List.cljs$lang$type = !0; cljs.core.List.cljs$lang$ctorStr = "cljs.core/List"; cljs.core.List.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/List") + return cljs.core._write.call(null, b, "cljs.core/List"); }; cljs.core.List.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.List.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 1 === this.count ? null : this.rest + return 1 === this.count ? null : this.rest; }; cljs.core.List.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.List(this.meta, b, this, this.count + 1, null) + return new cljs.core.List(this.meta, b, this, this.count + 1, null); }; cljs.core.List.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.List.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.List.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.List.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.count + return this.count; }; cljs.core.List.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.first + return this.first; }; cljs.core.List.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return cljs.core._rest.call(null, this) + return cljs.core._rest.call(null, this); }; cljs.core.List.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.first + return this.first; }; cljs.core.List.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 1 === this.count ? cljs.core.List.EMPTY : this.rest + return 1 === this.count ? cljs.core.List.EMPTY : this.rest; }; cljs.core.List.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.List.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.List(b, this.first, this.rest, this.count, this.__hash) + return new cljs.core.List(b, this.first, this.rest, this.count, this.__hash); +}; +cljs.core.List.prototype.cljs$core$ICloneable$ = !0; +cljs.core.List.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.List(this.meta, this.first, this.rest, this.count, this.__hash); }; cljs.core.List.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.List.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.List.EMPTY + return cljs.core.List.EMPTY; }; cljs.core.__GT_List = function(a, b, c, d, e) { - return new cljs.core.List(a, b, c, d, e) + return new cljs.core.List(a, b, c, d, e); }; cljs.core.EmptyList = function(a) { this.meta = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 65937614 + this.cljs$lang$protocol_mask$partition0$ = 65937614; }; cljs.core.EmptyList.cljs$lang$type = !0; cljs.core.EmptyList.cljs$lang$ctorStr = "cljs.core/EmptyList"; cljs.core.EmptyList.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/EmptyList") + return cljs.core._write.call(null, b, "cljs.core/EmptyList"); }; cljs.core.EmptyList.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return 0 + return 0; }; cljs.core.EmptyList.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return null + return null; }; cljs.core.EmptyList.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.List(this.meta, b, null, 1, null) + return new cljs.core.List(this.meta, b, null, 1, null); }; cljs.core.EmptyList.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.EmptyList.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.EmptyList.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return null + return null; }; cljs.core.EmptyList.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 0 + return 0; }; cljs.core.EmptyList.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return null + return null; }; cljs.core.EmptyList.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { throw Error("Can't pop empty list"); }; cljs.core.EmptyList.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null + return null; }; cljs.core.EmptyList.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.List.EMPTY + return cljs.core.List.EMPTY; }; cljs.core.EmptyList.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.EmptyList.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.EmptyList(b) + return new cljs.core.EmptyList(b); +}; +cljs.core.EmptyList.prototype.cljs$core$ICloneable$ = !0; +cljs.core.EmptyList.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.EmptyList(this.meta); }; cljs.core.EmptyList.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.EmptyList.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return this + return this; }; cljs.core.__GT_EmptyList = function(a) { - return new cljs.core.EmptyList(a) + return new cljs.core.EmptyList(a); }; cljs.core.List.EMPTY = new cljs.core.EmptyList(null); cljs.core.reversible_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 134217728 || a.cljs$core$IReversible$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 134217728 || a.cljs$core$IReversible$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IReversible, a); }; cljs.core.rseq = function(a) { - return cljs.core._rseq.call(null, a) + return cljs.core._rseq.call(null, a); }; cljs.core.reverse = function(a) { - return cljs.core.reversible_QMARK_.call(null, a) ? cljs.core.rseq.call(null, a) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a) + return cljs.core.reversible_QMARK_.call(null, a) ? cljs.core.rseq.call(null, a) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a); }; cljs.core.list = function() { var a = function(a) { var b; - if(a instanceof cljs.core.IndexedSeq) { - b = a.arr - }else { + if (a instanceof cljs.core.IndexedSeq && 0 === a.i) { + b = a.arr; + } else { a: { - for(b = [];;) { - if(null != a) { - b.push(cljs.core._first.call(null, a)), a = cljs.core._next.call(null, a) - }else { - break a + for (b = [];;) { + if (null != a) { + b.push(cljs.core._first.call(null, a)), a = cljs.core._next.call(null, a); + } else { + break a; } } - b = void 0 + b = void 0; } } a = b.length; - for(var e = cljs.core.List.EMPTY;;) { - if(0 < a) { + for (var e = cljs.core.List.EMPTY;;) { + if (0 < a) { var f = a - 1, e = cljs.core._conj.call(null, e, b[a - 1]); - a = f - }else { - return e + a = f; + } else { + return e; } } }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.Cons = function(a, b, c, d) { this.meta = a; @@ -5327,63 +5368,67 @@ cljs.core.Cons = function(a, b, c, d) { this.rest = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 65929452 + this.cljs$lang$protocol_mask$partition0$ = 65929452; }; cljs.core.Cons.cljs$lang$type = !0; cljs.core.Cons.cljs$lang$ctorStr = "cljs.core/Cons"; cljs.core.Cons.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Cons") + return cljs.core._write.call(null, b, "cljs.core/Cons"); }; cljs.core.Cons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.Cons.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return null == this.rest ? null : cljs.core.seq.call(null, this.rest) + return null == this.rest ? null : cljs.core.seq.call(null, this.rest); }; cljs.core.Cons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.Cons(null, b, this, this.__hash) + return new cljs.core.Cons(null, b, this, this.__hash); }; cljs.core.Cons.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.Cons.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.Cons.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.Cons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.Cons.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.first + return this.first; }; cljs.core.Cons.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null == this.rest ? cljs.core.List.EMPTY : this.rest + return null == this.rest ? cljs.core.List.EMPTY : this.rest; }; cljs.core.Cons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.Cons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Cons(b, this.first, this.rest, this.__hash) + return new cljs.core.Cons(b, this.first, this.rest, this.__hash); +}; +cljs.core.Cons.prototype.cljs$core$ICloneable$ = !0; +cljs.core.Cons.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Cons(this.meta, this.first, this.rest, this.__hash); }; cljs.core.Cons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.Cons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_Cons = function(a, b, c, d) { - return new cljs.core.Cons(a, b, c, d) + return new cljs.core.Cons(a, b, c, d); }; cljs.core.cons = function(a, b) { var c; c = (c = null == b) ? c : b ? b.cljs$lang$protocol_mask$partition0$ & 64 || b.cljs$core$ISeq$ ? !0 : !1 : !1; - return c ? new cljs.core.Cons(null, a, b, null) : new cljs.core.Cons(null, a, cljs.core.seq.call(null, b), null) + return c ? new cljs.core.Cons(null, a, b, null) : new cljs.core.Cons(null, a, cljs.core.seq.call(null, b), null); }; cljs.core.list_QMARK_ = function(a) { - return a ? a.cljs$lang$protocol_mask$partition0$ & 33554432 || a.cljs$core$IList$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) + return a ? a.cljs$lang$protocol_mask$partition0$ & 33554432 || a.cljs$core$IList$ ? !0 : a.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IList, a); }; cljs.core.Keyword = function(a, b, c, d) { this.ns = a; @@ -5391,25 +5436,25 @@ cljs.core.Keyword = function(a, b, c, d) { this.fqn = c; this._hash = d; this.cljs$lang$protocol_mask$partition0$ = 2153775105; - this.cljs$lang$protocol_mask$partition1$ = 4096 + this.cljs$lang$protocol_mask$partition1$ = 4096; }; cljs.core.Keyword.cljs$lang$type = !0; cljs.core.Keyword.cljs$lang$ctorStr = "cljs.core/Keyword"; cljs.core.Keyword.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Keyword") + return cljs.core._write.call(null, b, "cljs.core/Keyword"); }; cljs.core.Keyword.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, [cljs.core.str(":"), cljs.core.str(this.fqn)].join("")) + return cljs.core._write.call(null, b, [cljs.core.str(":"), cljs.core.str(this.fqn)].join("")); }; cljs.core.Keyword.prototype.cljs$core$INamed$_name$arity$1 = function(a) { - return this.name + return this.name; }; cljs.core.Keyword.prototype.cljs$core$INamed$_namespace$arity$1 = function(a) { - return this.ns + return this.ns; }; cljs.core.Keyword.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { null == this._hash && (this._hash = cljs.core.hash_combine.call(null, cljs.core.hash.call(null, this.ns), cljs.core.hash.call(null, this.name)) + 2654435769); - return this._hash + return this._hash; }; cljs.core.Keyword.prototype.call = function() { var a = null; @@ -5418,68 +5463,72 @@ cljs.core.Keyword.prototype.call = function() { case 2: return cljs.core.get.call(null, c, this); case 3: - return cljs.core.get.call(null, c, this, d) + return cljs.core.get.call(null, c, this, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.Keyword.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.Keyword.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core.get.call(null, a, this) + return cljs.core.get.call(null, a, this); }; cljs.core.Keyword.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core.get.call(null, a, this, b) + return cljs.core.get.call(null, a, this, b); }; cljs.core.Keyword.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.Keyword ? this.fqn === b.fqn : !1 + return b instanceof cljs.core.Keyword ? this.fqn === b.fqn : !1; +}; +cljs.core.Keyword.prototype.cljs$core$ICloneable$ = !0; +cljs.core.Keyword.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Keyword(this.ns, this.name, this.fqn, this._hash); }; cljs.core.Keyword.prototype.toString = function() { - return[cljs.core.str(":"), cljs.core.str(this.fqn)].join("") + return[cljs.core.str(":"), cljs.core.str(this.fqn)].join(""); }; cljs.core.__GT_Keyword = function(a, b, c, d) { - return new cljs.core.Keyword(a, b, c, d) + return new cljs.core.Keyword(a, b, c, d); }; cljs.core.keyword_QMARK_ = function(a) { - return a instanceof cljs.core.Keyword + return a instanceof cljs.core.Keyword; }; cljs.core.keyword_identical_QMARK_ = function(a, b) { - return a === b ? !0 : a instanceof cljs.core.Keyword && b instanceof cljs.core.Keyword ? a.fqn === b.fqn : !1 + return a === b ? !0 : a instanceof cljs.core.Keyword && b instanceof cljs.core.Keyword ? a.fqn === b.fqn : !1; }; cljs.core.namespace = function(a) { - if(a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { - return cljs.core._namespace.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { + return cljs.core._namespace.call(null, a); } throw Error([cljs.core.str("Doesn't support namespace: "), cljs.core.str(a)].join("")); }; cljs.core.keyword = function() { var a = null, b = function(a) { - if(a instanceof cljs.core.Keyword) { - return a + if (a instanceof cljs.core.Keyword) { + return a; } - if(a instanceof cljs.core.Symbol) { - return new cljs.core.Keyword(cljs.core.namespace.call(null, a), cljs.core.name.call(null, a), a.str, null) + if (a instanceof cljs.core.Symbol) { + return new cljs.core.Keyword(cljs.core.namespace.call(null, a), cljs.core.name.call(null, a), a.str, null); } - if("string" === typeof a) { + if ("string" === typeof a) { var b = a.split("/"); - return 2 === b.length ? new cljs.core.Keyword(b[0], b[1], a, null) : new cljs.core.Keyword(null, b[0], a, null) + return 2 === b.length ? new cljs.core.Keyword(b[0], b[1], a, null) : new cljs.core.Keyword(null, b[0], a, null); } - return null + return null; }, c = function(a, b) { - return new cljs.core.Keyword(a, b, [cljs.core.str(cljs.core.truth_(a) ? [cljs.core.str(a), cljs.core.str("/")].join("") : null), cljs.core.str(b)].join(""), null) + return new cljs.core.Keyword(a, b, [cljs.core.str(cljs.core.truth_(a) ? [cljs.core.str(a), cljs.core.str("/")].join("") : null), cljs.core.str(b)].join(""), null); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.LazySeq = function(a, b, c, d) { this.meta = a; @@ -5487,146 +5536,146 @@ cljs.core.LazySeq = function(a, b, c, d) { this.s = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988 + this.cljs$lang$protocol_mask$partition0$ = 32374988; }; cljs.core.LazySeq.cljs$lang$type = !0; cljs.core.LazySeq.cljs$lang$ctorStr = "cljs.core/LazySeq"; cljs.core.LazySeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/LazySeq") + return cljs.core._write.call(null, b, "cljs.core/LazySeq"); }; cljs.core.LazySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.LazySeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { cljs.core._seq.call(null, this); - return null == this.s ? null : cljs.core.next.call(null, this.s) + return null == this.s ? null : cljs.core.next.call(null, this.s); }; cljs.core.LazySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.LazySeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.LazySeq.prototype.sval = function() { null != this.fn && (this.s = this.fn.call(null), this.fn = null); - return this.s + return this.s; }; cljs.core.LazySeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.LazySeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.LazySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { this.sval(); - if(null == this.s) { - return null + if (null == this.s) { + return null; } - for(a = this.s;;) { - if(a instanceof cljs.core.LazySeq) { - a = a.sval() - }else { - return this.s = a, cljs.core.seq.call(null, this.s) + for (a = this.s;;) { + if (a instanceof cljs.core.LazySeq) { + a = a.sval(); + } else { + return this.s = a, cljs.core.seq.call(null, this.s); } } }; cljs.core.LazySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { cljs.core._seq.call(null, this); - return null == this.s ? null : cljs.core.first.call(null, this.s) + return null == this.s ? null : cljs.core.first.call(null, this.s); }; cljs.core.LazySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { cljs.core._seq.call(null, this); - return null != this.s ? cljs.core.rest.call(null, this.s) : cljs.core.List.EMPTY + return null != this.s ? cljs.core.rest.call(null, this.s) : cljs.core.List.EMPTY; }; cljs.core.LazySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.LazySeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.LazySeq(b, this.fn, this.s, this.__hash) + return new cljs.core.LazySeq(b, this.fn, this.s, this.__hash); }; cljs.core.LazySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.LazySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_LazySeq = function(a, b, c, d) { - return new cljs.core.LazySeq(a, b, c, d) + return new cljs.core.LazySeq(a, b, c, d); }; cljs.core.ChunkBuffer = function(a, b) { this.buf = a; this.end = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2 + this.cljs$lang$protocol_mask$partition0$ = 2; }; cljs.core.ChunkBuffer.cljs$lang$type = !0; cljs.core.ChunkBuffer.cljs$lang$ctorStr = "cljs.core/ChunkBuffer"; cljs.core.ChunkBuffer.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ChunkBuffer") + return cljs.core._write.call(null, b, "cljs.core/ChunkBuffer"); }; cljs.core.ChunkBuffer.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end + return this.end; }; cljs.core.ChunkBuffer.prototype.add = function(a) { this.buf[this.end] = a; - return this.end += 1 + return this.end += 1; }; cljs.core.ChunkBuffer.prototype.chunk = function(a) { a = new cljs.core.ArrayChunk(this.buf, 0, this.end); this.buf = null; - return a + return a; }; cljs.core.__GT_ChunkBuffer = function(a, b) { - return new cljs.core.ChunkBuffer(a, b) + return new cljs.core.ChunkBuffer(a, b); }; cljs.core.chunk_buffer = function(a) { - return new cljs.core.ChunkBuffer(Array(a), 0) + return new cljs.core.ChunkBuffer(Array(a), 0); }; cljs.core.ArrayChunk = function(a, b, c) { this.arr = a; this.off = b; this.end = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 524306 + this.cljs$lang$protocol_mask$partition0$ = 524306; }; cljs.core.ArrayChunk.cljs$lang$type = !0; cljs.core.ArrayChunk.cljs$lang$ctorStr = "cljs.core/ArrayChunk"; cljs.core.ArrayChunk.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ArrayChunk") + return cljs.core._write.call(null, b, "cljs.core/ArrayChunk"); }; cljs.core.ArrayChunk.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.off], this.off + 1) + return cljs.core.array_reduce.call(null, this.arr, b, this.arr[this.off], this.off + 1); }; cljs.core.ArrayChunk.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.array_reduce.call(null, this.arr, b, c, this.off) + return cljs.core.array_reduce.call(null, this.arr, b, c, this.off); }; cljs.core.ArrayChunk.prototype.cljs$core$IChunk$ = !0; cljs.core.ArrayChunk.prototype.cljs$core$IChunk$_drop_first$arity$1 = function(a) { - if(this.off === this.end) { + if (this.off === this.end) { throw Error("-drop-first of empty chunk"); } - return new cljs.core.ArrayChunk(this.arr, this.off + 1, this.end) + return new cljs.core.ArrayChunk(this.arr, this.off + 1, this.end); }; cljs.core.ArrayChunk.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return this.arr[this.off + b] + return this.arr[this.off + b]; }; cljs.core.ArrayChunk.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.end - this.off ? this.arr[this.off + b] : c + return 0 <= b && b < this.end - this.off ? this.arr[this.off + b] : c; }; cljs.core.ArrayChunk.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end - this.off + return this.end - this.off; }; cljs.core.__GT_ArrayChunk = function(a, b, c) { - return new cljs.core.ArrayChunk(a, b, c) + return new cljs.core.ArrayChunk(a, b, c); }; cljs.core.array_chunk = function() { var a = null, b = function(a) { - return new cljs.core.ArrayChunk(a, 0, a.length) + return new cljs.core.ArrayChunk(a, 0, a.length); }, c = function(a, b) { - return new cljs.core.ArrayChunk(a, b, a.length) + return new cljs.core.ArrayChunk(a, b, a.length); }, d = function(a, b, c) { - return new cljs.core.ArrayChunk(a, b, c) + return new cljs.core.ArrayChunk(a, b, c); }, a = function(a, f, g) { switch(arguments.length) { case 1: @@ -5634,14 +5683,14 @@ cljs.core.array_chunk = function() { case 2: return c.call(this, a, f); case 3: - return d.call(this, a, f, g) + return d.call(this, a, f, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; - return a + return a; }(); cljs.core.ChunkedCons = function(a, b, c, d) { this.chunk = a; @@ -5649,286 +5698,286 @@ cljs.core.ChunkedCons = function(a, b, c, d) { this.meta = c; this.__hash = d; this.cljs$lang$protocol_mask$partition0$ = 31850732; - this.cljs$lang$protocol_mask$partition1$ = 1536 + this.cljs$lang$protocol_mask$partition1$ = 1536; }; cljs.core.ChunkedCons.cljs$lang$type = !0; cljs.core.ChunkedCons.cljs$lang$ctorStr = "cljs.core/ChunkedCons"; cljs.core.ChunkedCons.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ChunkedCons") + return cljs.core._write.call(null, b, "cljs.core/ChunkedCons"); }; cljs.core.ChunkedCons.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.ChunkedCons.prototype.cljs$core$INext$_next$arity$1 = function(a) { - if(1 < cljs.core._count.call(null, this.chunk)) { - return new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) + if (1 < cljs.core._count.call(null, this.chunk)) { + return new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null); } a = cljs.core._seq.call(null, this.more); - return null == a ? null : a + return null == a ? null : a; }; cljs.core.ChunkedCons.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.ChunkedCons.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.ChunkedCons.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.ChunkedCons.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core._nth.call(null, this.chunk, 0) + return cljs.core._nth.call(null, this.chunk, 0); }; cljs.core.ChunkedCons.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return 1 < cljs.core._count.call(null, this.chunk) ? new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) : null == this.more ? cljs.core.List.EMPTY : this.more + return 1 < cljs.core._count.call(null, this.chunk) ? new cljs.core.ChunkedCons(cljs.core._drop_first.call(null, this.chunk), this.more, this.meta, null) : null == this.more ? cljs.core.List.EMPTY : this.more; }; cljs.core.ChunkedCons.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { - return null == this.more ? null : this.more + return null == this.more ? null : this.more; }; cljs.core.ChunkedCons.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.ChunkedCons.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ChunkedCons(this.chunk, this.more, b, this.__hash) + return new cljs.core.ChunkedCons(this.chunk, this.more, b, this.__hash); }; cljs.core.ChunkedCons.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.ChunkedCons.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { - return this.chunk + return this.chunk; }; cljs.core.ChunkedCons.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { - return null == this.more ? cljs.core.List.EMPTY : this.more + return null == this.more ? cljs.core.List.EMPTY : this.more; }; cljs.core.__GT_ChunkedCons = function(a, b, c, d) { - return new cljs.core.ChunkedCons(a, b, c, d) + return new cljs.core.ChunkedCons(a, b, c, d); }; cljs.core.chunk_cons = function(a, b) { - return 0 === cljs.core._count.call(null, a) ? b : new cljs.core.ChunkedCons(a, b, null, null) + return 0 === cljs.core._count.call(null, a) ? b : new cljs.core.ChunkedCons(a, b, null, null); }; cljs.core.chunk_append = function(a, b) { - return a.add(b) + return a.add(b); }; cljs.core.chunk = function(a) { - return a.chunk() + return a.chunk(); }; cljs.core.chunk_first = function(a) { - return cljs.core._chunked_first.call(null, a) + return cljs.core._chunked_first.call(null, a); }; cljs.core.chunk_rest = function(a) { - return cljs.core._chunked_rest.call(null, a) + return cljs.core._chunked_rest.call(null, a); }; cljs.core.chunk_next = function(a) { - return a && (a.cljs$lang$protocol_mask$partition1$ & 1024 || a.cljs$core$IChunkedNext$) ? cljs.core._chunked_next.call(null, a) : cljs.core.seq.call(null, cljs.core._chunked_rest.call(null, a)) + return a && (a.cljs$lang$protocol_mask$partition1$ & 1024 || a.cljs$core$IChunkedNext$) ? cljs.core._chunked_next.call(null, a) : cljs.core.seq.call(null, cljs.core._chunked_rest.call(null, a)); }; cljs.core.to_array = function(a) { - for(var b = [];;) { - if(cljs.core.seq.call(null, a)) { - b.push(cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a) - }else { - return b + for (var b = [];;) { + if (cljs.core.seq.call(null, a)) { + b.push(cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a); + } else { + return b; } } }; cljs.core.to_array_2d = function(a) { var b = Array(cljs.core.count.call(null, a)), c = 0; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { - b[c] = cljs.core.to_array.call(null, cljs.core.first.call(null, a)), c += 1, a = cljs.core.next.call(null, a) - }else { - break + for (a = cljs.core.seq.call(null, a);;) { + if (a) { + b[c] = cljs.core.to_array.call(null, cljs.core.first.call(null, a)), c += 1, a = cljs.core.next.call(null, a); + } else { + break; } } - return b + return b; }; cljs.core.int_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_.call(null, b)) { + for (var g = 0, h = cljs.core.seq.call(null, b);;) { + if (h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.long_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_.call(null, b)) { + for (var g = 0, h = cljs.core.seq.call(null, b);;) { + if (h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.double_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_.call(null, b)) { + for (var g = 0, h = cljs.core.seq.call(null, b);;) { + if (h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.object_array = function() { var a = null, b = function(b) { - return"number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b) + return "number" === typeof b ? a.call(null, b, null) : cljs.core.into_array.call(null, b); }, c = function(a, b) { var c = Array(a); - if(cljs.core.seq_QMARK_.call(null, b)) { - for(var g = 0, h = cljs.core.seq.call(null, b);;) { - if(h && g < a) { - c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h) - }else { - return c + if (cljs.core.seq_QMARK_.call(null, b)) { + for (var g = 0, h = cljs.core.seq.call(null, b);;) { + if (h && g < a) { + c[g] = cljs.core.first.call(null, h), g += 1, h = cljs.core.next.call(null, h); + } else { + return c; } } - }else { - for(g = 0;;) { - if(g < a) { - c[g] = b, g += 1 - }else { - break + } else { + for (g = 0;;) { + if (g < a) { + c[g] = b, g += 1; + } else { + break; } } - return c + return c; } }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.bounded_count = function(a, b) { - if(cljs.core.counted_QMARK_.call(null, a)) { - return cljs.core.count.call(null, a) + if (cljs.core.counted_QMARK_.call(null, a)) { + return cljs.core.count.call(null, a); } - for(var c = a, d = b, e = 0;;) { - if(0 < d && cljs.core.seq.call(null, c)) { - c = cljs.core.next.call(null, c), d -= 1, e += 1 - }else { - return e + for (var c = a, d = b, e = 0;;) { + if (0 < d && cljs.core.seq.call(null, c)) { + c = cljs.core.next.call(null, c), d -= 1, e += 1; + } else { + return e; } } }; cljs.core.spread = function spread(b) { - return null == b ? null : null == cljs.core.next.call(null, b) ? cljs.core.seq.call(null, cljs.core.first.call(null, b)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.cons.call(null, cljs.core.first.call(null, b), spread.call(null, cljs.core.next.call(null, b))) : null + return null == b ? null : null == cljs.core.next.call(null, b) ? cljs.core.seq.call(null, cljs.core.first.call(null, b)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.cons.call(null, cljs.core.first.call(null, b), spread.call(null, cljs.core.next.call(null, b))) : null; }; cljs.core.concat = function() { var a = null, b = function() { return new cljs.core.LazySeq(null, function() { - return null - }, null, null) + return null; + }, null, null); }, c = function(a) { return new cljs.core.LazySeq(null, function() { - return a - }, null, null) + return a; + }, null, null); }, d = function(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, b); - return d ? cljs.core.chunked_seq_QMARK_.call(null, d) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, d), a.call(null, cljs.core.chunk_rest.call(null, d), c)) : cljs.core.cons.call(null, cljs.core.first.call(null, d), a.call(null, cljs.core.rest.call(null, d), c)) : c - }, null, null) + return d ? cljs.core.chunked_seq_QMARK_.call(null, d) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, d), a.call(null, cljs.core.chunk_rest.call(null, d), c)) : cljs.core.cons.call(null, cljs.core.first.call(null, d), a.call(null, cljs.core.rest.call(null, d), c)) : c; + }, null, null); }, e = function() { var b = function(b, c, d) { return function n(a, b) { return new cljs.core.LazySeq(null, function() { var c = cljs.core.seq.call(null, a); - return c ? cljs.core.chunked_seq_QMARK_.call(null, c) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, c), n.call(null, cljs.core.chunk_rest.call(null, c), b)) : cljs.core.cons.call(null, cljs.core.first.call(null, c), n.call(null, cljs.core.rest.call(null, c), b)) : cljs.core.truth_(b) ? n.call(null, cljs.core.first.call(null, b), cljs.core.next.call(null, b)) : null - }, null, null) - }.call(null, a.call(null, b, c), d) + return c ? cljs.core.chunked_seq_QMARK_.call(null, c) ? cljs.core.chunk_cons.call(null, cljs.core.chunk_first.call(null, c), n.call(null, cljs.core.chunk_rest.call(null, c), b)) : cljs.core.cons.call(null, cljs.core.first.call(null, c), n.call(null, cljs.core.rest.call(null, c), b)) : cljs.core.truth_(b) ? n.call(null, cljs.core.first.call(null, b), cljs.core.next.call(null, b)) : null; + }, null, null); + }.call(null, a.call(null, b, c), d); }, c = function(a, c, d) { var e = null; 2 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, e) + return b.call(this, a, c, e); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -5936,10 +5985,10 @@ cljs.core.concat = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, a) + return b(c, d, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, g, h) { switch(arguments.length) { case 0: @@ -5949,7 +5998,7 @@ cljs.core.concat = function() { case 2: return d.call(this, a, g); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, cljs.core.array_seq(arguments, 2)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; @@ -5959,24 +6008,24 @@ cljs.core.concat = function() { a.cljs$core$IFn$_invoke$arity$1 = c; a.cljs$core$IFn$_invoke$arity$2 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.list_STAR_ = function() { var a = null, b = function(a) { - return cljs.core.seq.call(null, a) + return cljs.core.seq.call(null, a); }, c = function(a, b) { - return cljs.core.cons.call(null, a, b) + return cljs.core.cons.call(null, a, b); }, d = function(a, b, c) { - return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, c)) + return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, c)); }, e = function(a, b, c, d) { - return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, d))) + return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, d))); }, f = function() { var a = function(a, b, c, d, e) { - return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.spread.call(null, e))))) + return cljs.core.cons.call(null, a, cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.spread.call(null, e))))); }, b = function(b, c, d, e, f) { var h = null; 4 < arguments.length && (h = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return a.call(this, b, c, d, e, h) + return a.call(this, b, c, d, e, h); }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -5988,10 +6037,10 @@ cljs.core.list_STAR_ = function() { b = cljs.core.next(b); var f = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, f, b) + return a(c, d, e, f, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, h, k, l, m) { switch(arguments.length) { case 1: @@ -6003,7 +6052,7 @@ cljs.core.list_STAR_ = function() { case 4: return e.call(this, a, h, k, l); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, cljs.core.array_seq(arguments, 4)) + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, cljs.core.array_seq(arguments, 4)); } throw Error("Invalid arity: " + arguments.length); }; @@ -6014,154 +6063,154 @@ cljs.core.list_STAR_ = function() { a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$4 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.transient$ = function(a) { - return cljs.core._as_transient.call(null, a) + return cljs.core._as_transient.call(null, a); }; cljs.core.persistent_BANG_ = function(a) { - return cljs.core._persistent_BANG_.call(null, a) + return cljs.core._persistent_BANG_.call(null, a); }; cljs.core.conj_BANG_ = function(a, b) { - return cljs.core._conj_BANG_.call(null, a, b) + return cljs.core._conj_BANG_.call(null, a, b); }; cljs.core.assoc_BANG_ = function(a, b, c) { - return cljs.core._assoc_BANG_.call(null, a, b, c) + return cljs.core._assoc_BANG_.call(null, a, b, c); }; cljs.core.dissoc_BANG_ = function(a, b) { - return cljs.core._dissoc_BANG_.call(null, a, b) + return cljs.core._dissoc_BANG_.call(null, a, b); }; cljs.core.pop_BANG_ = function(a) { - return cljs.core._pop_BANG_.call(null, a) + return cljs.core._pop_BANG_.call(null, a); }; cljs.core.disj_BANG_ = function(a, b) { - return cljs.core._disjoin_BANG_.call(null, a, b) + return cljs.core._disjoin_BANG_.call(null, a, b); }; cljs.core.apply_to = function(a, b, c) { var d = cljs.core.seq.call(null, c); - if(0 === b) { - return a.call(null) + if (0 === b) { + return a.call(null); } c = cljs.core._first.call(null, d); var e = cljs.core._rest.call(null, d); - if(1 === b) { - return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c) + if (1 === b) { + return a.cljs$core$IFn$_invoke$arity$1 ? a.cljs$core$IFn$_invoke$arity$1(c) : a.call(null, c); } var d = cljs.core._first.call(null, e), f = cljs.core._rest.call(null, e); - if(2 === b) { - return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d) + if (2 === b) { + return a.cljs$core$IFn$_invoke$arity$2 ? a.cljs$core$IFn$_invoke$arity$2(c, d) : a.call(null, c, d); } var e = cljs.core._first.call(null, f), g = cljs.core._rest.call(null, f); - if(3 === b) { - return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e) + if (3 === b) { + return a.cljs$core$IFn$_invoke$arity$3 ? a.cljs$core$IFn$_invoke$arity$3(c, d, e) : a.call(null, c, d, e); } var f = cljs.core._first.call(null, g), h = cljs.core._rest.call(null, g); - if(4 === b) { - return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.call(null, c, d, e, f) + if (4 === b) { + return a.cljs$core$IFn$_invoke$arity$4 ? a.cljs$core$IFn$_invoke$arity$4(c, d, e, f) : a.call(null, c, d, e, f); } g = cljs.core._first.call(null, h); h = cljs.core._rest.call(null, h); - if(5 === b) { - return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.call(null, c, d, e, f, g) + if (5 === b) { + return a.cljs$core$IFn$_invoke$arity$5 ? a.cljs$core$IFn$_invoke$arity$5(c, d, e, f, g) : a.call(null, c, d, e, f, g); } a = cljs.core._first.call(null, h); var k = cljs.core._rest.call(null, h); - if(6 === b) { - return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, a) : a.call(null, c, d, e, f, g, a) + if (6 === b) { + return a.cljs$core$IFn$_invoke$arity$6 ? a.cljs$core$IFn$_invoke$arity$6(c, d, e, f, g, a) : a.call(null, c, d, e, f, g, a); } var h = cljs.core._first.call(null, k), l = cljs.core._rest.call(null, k); - if(7 === b) { - return a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, a, h) : a.call(null, c, d, e, f, g, a, h) + if (7 === b) { + return a.cljs$core$IFn$_invoke$arity$7 ? a.cljs$core$IFn$_invoke$arity$7(c, d, e, f, g, a, h) : a.call(null, c, d, e, f, g, a, h); } var k = cljs.core._first.call(null, l), m = cljs.core._rest.call(null, l); - if(8 === b) { - return a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, a, h, k) : a.call(null, c, d, e, f, g, a, h, k) + if (8 === b) { + return a.cljs$core$IFn$_invoke$arity$8 ? a.cljs$core$IFn$_invoke$arity$8(c, d, e, f, g, a, h, k) : a.call(null, c, d, e, f, g, a, h, k); } var l = cljs.core._first.call(null, m), n = cljs.core._rest.call(null, m); - if(9 === b) { - return a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, a, h, k, l) : a.call(null, c, d, e, f, g, a, h, k, l) + if (9 === b) { + return a.cljs$core$IFn$_invoke$arity$9 ? a.cljs$core$IFn$_invoke$arity$9(c, d, e, f, g, a, h, k, l) : a.call(null, c, d, e, f, g, a, h, k, l); } var m = cljs.core._first.call(null, n), p = cljs.core._rest.call(null, n); - if(10 === b) { - return a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, a, h, k, l, m) : a.call(null, c, d, e, f, g, a, h, k, l, m) + if (10 === b) { + return a.cljs$core$IFn$_invoke$arity$10 ? a.cljs$core$IFn$_invoke$arity$10(c, d, e, f, g, a, h, k, l, m) : a.call(null, c, d, e, f, g, a, h, k, l, m); } var n = cljs.core._first.call(null, p), q = cljs.core._rest.call(null, p); - if(11 === b) { - return a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, a, h, k, l, m, n) : a.call(null, c, d, e, f, g, a, h, k, l, m, n) + if (11 === b) { + return a.cljs$core$IFn$_invoke$arity$11 ? a.cljs$core$IFn$_invoke$arity$11(c, d, e, f, g, a, h, k, l, m, n) : a.call(null, c, d, e, f, g, a, h, k, l, m, n); } var p = cljs.core._first.call(null, q), r = cljs.core._rest.call(null, q); - if(12 === b) { - return a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, a, h, k, l, m, n, p) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p) + if (12 === b) { + return a.cljs$core$IFn$_invoke$arity$12 ? a.cljs$core$IFn$_invoke$arity$12(c, d, e, f, g, a, h, k, l, m, n, p) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p); } var q = cljs.core._first.call(null, r), s = cljs.core._rest.call(null, r); - if(13 === b) { - return a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, a, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q) + if (13 === b) { + return a.cljs$core$IFn$_invoke$arity$13 ? a.cljs$core$IFn$_invoke$arity$13(c, d, e, f, g, a, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q); } var r = cljs.core._first.call(null, s), t = cljs.core._rest.call(null, s); - if(14 === b) { - return a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, a, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r) + if (14 === b) { + return a.cljs$core$IFn$_invoke$arity$14 ? a.cljs$core$IFn$_invoke$arity$14(c, d, e, f, g, a, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r); } var s = cljs.core._first.call(null, t), v = cljs.core._rest.call(null, t); - if(15 === b) { - return a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) + if (15 === b) { + return a.cljs$core$IFn$_invoke$arity$15 ? a.cljs$core$IFn$_invoke$arity$15(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s); } var t = cljs.core._first.call(null, v), u = cljs.core._rest.call(null, v); - if(16 === b) { - return a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) + if (16 === b) { + return a.cljs$core$IFn$_invoke$arity$16 ? a.cljs$core$IFn$_invoke$arity$16(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t); } var v = cljs.core._first.call(null, u), w = cljs.core._rest.call(null, u); - if(17 === b) { - return a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) + if (17 === b) { + return a.cljs$core$IFn$_invoke$arity$17 ? a.cljs$core$IFn$_invoke$arity$17(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v); } var u = cljs.core._first.call(null, w), B = cljs.core._rest.call(null, w); - if(18 === b) { - return a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) + if (18 === b) { + return a.cljs$core$IFn$_invoke$arity$18 ? a.cljs$core$IFn$_invoke$arity$18(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u); } w = cljs.core._first.call(null, B); B = cljs.core._rest.call(null, B); - if(19 === b) { - return a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) + if (19 === b) { + return a.cljs$core$IFn$_invoke$arity$19 ? a.cljs$core$IFn$_invoke$arity$19(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w); } var I = cljs.core._first.call(null, B); cljs.core._rest.call(null, B); - if(20 === b) { - return a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) + if (20 === b) { + return a.cljs$core$IFn$_invoke$arity$20 ? a.cljs$core$IFn$_invoke$arity$20(c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I) : a.call(null, c, d, e, f, g, a, h, k, l, m, n, p, q, r, s, t, v, u, w, I); } throw Error("Only up to 20 arguments supported on functions"); }; cljs.core.apply = function() { var a = null, b = function(a, b) { var c = a.cljs$lang$maxFixedArity; - if(a.cljs$lang$applyTo) { + if (a.cljs$lang$applyTo) { var d = cljs.core.bounded_count.call(null, b, c + 1); - return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b) + return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b); } - return a.apply(a, cljs.core.to_array.call(null, b)) + return a.apply(a, cljs.core.to_array.call(null, b)); }, c = function(a, b, c) { b = cljs.core.list_STAR_.call(null, b, c); c = a.cljs$lang$maxFixedArity; - if(a.cljs$lang$applyTo) { + if (a.cljs$lang$applyTo) { var d = cljs.core.bounded_count.call(null, b, c + 1); - return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b) + return d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b); } - return a.apply(a, cljs.core.to_array.call(null, b)) + return a.apply(a, cljs.core.to_array.call(null, b)); }, d = function(a, b, c, d) { b = cljs.core.list_STAR_.call(null, b, c, d); c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)); }, e = function(a, b, c, d, e) { b = cljs.core.list_STAR_.call(null, b, c, d, e); c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)); }, f = function() { var a = function(a, b, c, d, e, f) { b = cljs.core.cons.call(null, b, cljs.core.cons.call(null, c, cljs.core.cons.call(null, d, cljs.core.cons.call(null, e, cljs.core.spread.call(null, f))))); c = a.cljs$lang$maxFixedArity; - return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)) + return a.cljs$lang$applyTo ? (d = cljs.core.bounded_count.call(null, b, c + 1), d <= c ? cljs.core.apply_to.call(null, a, d, b) : a.cljs$lang$applyTo(b)) : a.apply(a, cljs.core.to_array.call(null, b)); }, b = function(b, c, d, e, f, h) { var r = null; 5 < arguments.length && (r = cljs.core.array_seq(Array.prototype.slice.call(arguments, 5), 0)); - return a.call(this, b, c, d, e, f, r) + return a.call(this, b, c, d, e, f, r); }; b.cljs$lang$maxFixedArity = 5; b.cljs$lang$applyTo = function(b) { @@ -6175,10 +6224,10 @@ cljs.core.apply = function() { b = cljs.core.next(b); var h = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, f, h, b) + return a(c, d, e, f, h, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, h, k, l, m, n) { switch(arguments.length) { case 2: @@ -6190,7 +6239,7 @@ cljs.core.apply = function() { case 5: return e.call(this, a, h, k, l, m); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)) + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)); } throw Error("Invalid arity: " + arguments.length); }; @@ -6201,37 +6250,82 @@ cljs.core.apply = function() { a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$5 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.vary_meta = function() { - var a = function(a, b, e) { - return cljs.core.with_meta.call(null, a, cljs.core.apply.call(null, b, cljs.core.meta.call(null, a), e)) - }, b = function(b, d, e) { - var f = null; - 2 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, f) - }; - b.cljs$lang$maxFixedArity = 2; - b.cljs$lang$applyTo = function(b) { - var d = cljs.core.first(b); - b = cljs.core.next(b); - var e = cljs.core.first(b); - b = cljs.core.rest(b); - return a(d, e, b) + var a = null, b = function(a, b) { + return cljs.core.with_meta.call(null, a, b.call(null, cljs.core.meta.call(null, a))); + }, c = function(a, b, c) { + return cljs.core.with_meta.call(null, a, b.call(null, cljs.core.meta.call(null, a), c)); + }, d = function(a, b, c, d) { + return cljs.core.with_meta.call(null, a, b.call(null, cljs.core.meta.call(null, a), c, d)); + }, e = function(a, b, c, d, e) { + return cljs.core.with_meta.call(null, a, b.call(null, cljs.core.meta.call(null, a), c, d, e)); + }, f = function(a, b, c, d, e, f) { + return cljs.core.with_meta.call(null, a, b.call(null, cljs.core.meta.call(null, a), c, d, e, f)); + }, g = function() { + var a = function(a, b, c, d, e, f, g) { + return cljs.core.with_meta.call(null, a, cljs.core.apply.call(null, b, cljs.core.meta.call(null, a), c, d, e, f, g)); + }, b = function(b, c, d, e, f, g, k) { + var t = null; + 6 < arguments.length && (t = cljs.core.array_seq(Array.prototype.slice.call(arguments, 6), 0)); + return a.call(this, b, c, d, e, f, g, t); + }; + b.cljs$lang$maxFixedArity = 6; + b.cljs$lang$applyTo = function(b) { + var c = cljs.core.first(b); + b = cljs.core.next(b); + var d = cljs.core.first(b); + b = cljs.core.next(b); + var e = cljs.core.first(b); + b = cljs.core.next(b); + var f = cljs.core.first(b); + b = cljs.core.next(b); + var g = cljs.core.first(b); + b = cljs.core.next(b); + var k = cljs.core.first(b); + b = cljs.core.rest(b); + return a(c, d, e, f, g, k, b); + }; + b.cljs$core$IFn$_invoke$arity$variadic = a; + return b; + }(), a = function(a, k, l, m, n, p, q) { + switch(arguments.length) { + case 2: + return b.call(this, a, k); + case 3: + return c.call(this, a, k, l); + case 4: + return d.call(this, a, k, l, m); + case 5: + return e.call(this, a, k, l, m, n); + case 6: + return f.call(this, a, k, l, m, n, p); + default: + return g.cljs$core$IFn$_invoke$arity$variadic(a, k, l, m, n, p, cljs.core.array_seq(arguments, 6)); + } + throw Error("Invalid arity: " + arguments.length); }; - b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + a.cljs$lang$maxFixedArity = 6; + a.cljs$lang$applyTo = g.cljs$lang$applyTo; + a.cljs$core$IFn$_invoke$arity$2 = b; + a.cljs$core$IFn$_invoke$arity$3 = c; + a.cljs$core$IFn$_invoke$arity$4 = d; + a.cljs$core$IFn$_invoke$arity$5 = e; + a.cljs$core$IFn$_invoke$arity$6 = f; + a.cljs$core$IFn$_invoke$arity$variadic = g.cljs$core$IFn$_invoke$arity$variadic; + return a; }(); cljs.core.not_EQ_ = function() { var a = null, b = function(a, b) { - return!cljs.core._EQ_.call(null, a, b) + return!cljs.core._EQ_.call(null, a, b); }, c = function() { var a = function(a, b, c) { - return cljs.core.not.call(null, cljs.core.apply.call(null, cljs.core._EQ_, a, b, c)) + return cljs.core.not.call(null, cljs.core.apply.call(null, cljs.core._EQ_, a, b, c)); }, b = function(b, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, c, k) + return a.call(this, b, c, k); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -6239,10 +6333,10 @@ cljs.core.not_EQ_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b) + return a(c, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e, f) { switch(arguments.length) { case 1: @@ -6250,78 +6344,78 @@ cljs.core.not_EQ_ = function() { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 2; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return!1 + return!1; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.not_empty = function(a) { - return cljs.core.seq.call(null, a) ? a : null + return cljs.core.seq.call(null, a) ? a : null; }; cljs.core.every_QMARK_ = function(a, b) { - for(;;) { - if(null == cljs.core.seq.call(null, b)) { - return!0 + for (;;) { + if (null == cljs.core.seq.call(null, b)) { + return!0; } - if(cljs.core.truth_(a.call(null, cljs.core.first.call(null, b)))) { + if (cljs.core.truth_(a.call(null, cljs.core.first.call(null, b)))) { var c = a, d = cljs.core.next.call(null, b); a = c; - b = d - }else { - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null + b = d; + } else { + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? !1 : null; } } }; cljs.core.not_every_QMARK_ = function(a, b) { - return!cljs.core.every_QMARK_.call(null, a, b) + return!cljs.core.every_QMARK_.call(null, a, b); }; cljs.core.some = function(a, b) { - for(;;) { - if(cljs.core.seq.call(null, b)) { + for (;;) { + if (cljs.core.seq.call(null, b)) { var c = a.call(null, cljs.core.first.call(null, b)); - if(cljs.core.truth_(c)) { - return c + if (cljs.core.truth_(c)) { + return c; } var c = a, d = cljs.core.next.call(null, b); a = c; - b = d - }else { - return null + b = d; + } else { + return null; } } }; cljs.core.not_any_QMARK_ = function(a, b) { - return cljs.core.not.call(null, cljs.core.some.call(null, a, b)) + return cljs.core.not.call(null, cljs.core.some.call(null, a, b)); }; cljs.core.even_QMARK_ = function(a) { - if(cljs.core.integer_QMARK_.call(null, a)) { - return 0 === (a & 1) + if (cljs.core.integer_QMARK_.call(null, a)) { + return 0 === (a & 1); } throw Error([cljs.core.str("Argument must be an integer: "), cljs.core.str(a)].join("")); }; cljs.core.odd_QMARK_ = function(a) { - return!cljs.core.even_QMARK_.call(null, a) + return!cljs.core.even_QMARK_.call(null, a); }; cljs.core.identity = function(a) { - return a + return a; }; cljs.core.complement = function(a) { return function() { var b = null, c = function() { var b = function(b, c, d) { - return cljs.core.not.call(null, cljs.core.apply.call(null, a, b, c, d)) + return cljs.core.not.call(null, cljs.core.apply.call(null, a, b, c, d)); }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -6329,10 +6423,10 @@ cljs.core.complement = function(a) { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), b = function(b, e, f) { switch(arguments.length) { case 0: @@ -6342,44 +6436,44 @@ cljs.core.complement = function(a) { case 2: return cljs.core.not.call(null, a.call(null, b, e)); default: - return c.cljs$core$IFn$_invoke$arity$variadic(b, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(b, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = c.cljs$lang$applyTo; - return b - }() + return b; + }(); }; cljs.core.constantly = function(a) { return function() { var b = function(b) { 0 < arguments.length && cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0); - return a + return a; }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { cljs.core.seq(b); - return a + return a; }; b.cljs$core$IFn$_invoke$arity$variadic = function(b) { - return a + return a; }; - return b - }() + return b; + }(); }; cljs.core.comp = function() { var a = null, b = function() { - return cljs.core.identity + return cljs.core.identity; }, c = function(a, b) { return function() { var c = null, d = function() { var c = function(c, d, e, h) { - return a.call(null, cljs.core.apply.call(null, b, c, d, e, h)) + return a.call(null, cljs.core.apply.call(null, b, c, d, e, h)); }, d = function(a, b, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -6389,10 +6483,10 @@ cljs.core.comp = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), c = function(c, e, h, p) { switch(arguments.length) { case 0: @@ -6404,23 +6498,23 @@ cljs.core.comp = function() { case 3: return a.call(null, b.call(null, c, e, h)); default: - return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)) + return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = d.cljs$lang$applyTo; - return c - }() + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function() { var d = function(d, e, k, l) { - return a.call(null, b.call(null, cljs.core.apply.call(null, c, d, e, k, l))) + return a.call(null, b.call(null, cljs.core.apply.call(null, c, d, e, k, l))); }, e = function(a, b, c, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -6430,10 +6524,10 @@ cljs.core.comp = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e + return e; }(), d = function(d, k, p, q) { switch(arguments.length) { case 0: @@ -6445,44 +6539,44 @@ cljs.core.comp = function() { case 3: return a.call(null, b.call(null, c.call(null, d, k, p))); default: - return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)) + return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = e.cljs$lang$applyTo; - return d - }() + return d; + }(); }, e = function() { var a = function(a, b, c, d) { var e = cljs.core.reverse.call(null, cljs.core.list_STAR_.call(null, a, b, c, d)); return function() { var a = function(a) { a = cljs.core.apply.call(null, cljs.core.first.call(null, e), a); - for(var b = cljs.core.next.call(null, e);;) { - if(b) { - a = cljs.core.first.call(null, b).call(null, a), b = cljs.core.next.call(null, b) - }else { - return a + for (var b = cljs.core.next.call(null, e);;) { + if (b) { + a = cljs.core.first.call(null, b).call(null, a), b = cljs.core.next.call(null, b); + } else { + return a; } } }, b = function(b) { var c = null; 0 < arguments.length && (c = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, c) + return a.call(this, c); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b - }() + return b; + }(); }, b = function(b, c, d, e) { var g = null; 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -6492,10 +6586,10 @@ cljs.core.comp = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 0: @@ -6507,7 +6601,7 @@ cljs.core.comp = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; @@ -6515,87 +6609,87 @@ cljs.core.comp = function() { a.cljs$lang$applyTo = e.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.partial = function() { var a = null, b = function(a, b) { return function() { var c = function(c) { - return cljs.core.apply.call(null, a, b, c) + return cljs.core.apply.call(null, a, b, c); }, d = function(a) { var b = null; 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return c.call(this, b) + return c.call(this, b); }; d.cljs$lang$maxFixedArity = 0; d.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return c(a) + return c(a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }() + return d; + }(); }, c = function(a, b, c) { return function() { var d = function(d) { - return cljs.core.apply.call(null, a, b, c, d) + return cljs.core.apply.call(null, a, b, c, d); }, e = function(a) { var b = null; 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return d.call(this, b) + return d.call(this, b); }; e.cljs$lang$maxFixedArity = 0; e.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return d(a) + return d(a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e - }() + return e; + }(); }, d = function(a, b, c, d) { return function() { var e = function(e) { - return cljs.core.apply.call(null, a, b, c, d, e) + return cljs.core.apply.call(null, a, b, c, d, e); }, m = function(a) { var b = null; 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return e.call(this, b) + return e.call(this, b); }; m.cljs$lang$maxFixedArity = 0; m.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return e(a) + return e(a); }; m.cljs$core$IFn$_invoke$arity$variadic = e; - return m - }() + return m; + }(); }, e = function() { var a = function(a, b, c, d, e) { return function() { var f = function(f) { - return cljs.core.apply.call(null, a, b, c, d, cljs.core.concat.call(null, e, f)) + return cljs.core.apply.call(null, a, b, c, d, cljs.core.concat.call(null, e, f)); }, g = function(a) { var b = null; 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return f.call(this, b) + return f.call(this, b); }; g.cljs$lang$maxFixedArity = 0; g.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return f(a) + return f(a); }; g.cljs$core$IFn$_invoke$arity$variadic = f; - return g - }() + return g; + }(); }, b = function(b, c, d, e, g) { var p = null; 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return a.call(this, b, c, d, e, p) + return a.call(this, b, c, d, e, p); }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -6607,10 +6701,10 @@ cljs.core.partial = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, g, b) + return a(c, d, e, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 1: @@ -6622,31 +6716,31 @@ cljs.core.partial = function() { case 4: return d.call(this, a, g, h, k); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 4; a.cljs$lang$applyTo = e.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = function(a) { - return a + return a; }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.fnil = function() { var a = null, b = function(a, b) { return function() { var c = null, d = function() { var c = function(c, d, g, h) { - return cljs.core.apply.call(null, a, null == c ? b : c, d, g, h) + return cljs.core.apply.call(null, a, null == c ? b : c, d, g, h); }, d = function(a, b, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -6656,10 +6750,10 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), c = function(c, g, m, n) { switch(arguments.length) { case 1: @@ -6669,23 +6763,23 @@ cljs.core.fnil = function() { case 3: return a.call(null, null == c ? b : c, g, m); default: - return d.cljs$core$IFn$_invoke$arity$variadic(c, g, m, cljs.core.array_seq(arguments, 3)) + return d.cljs$core$IFn$_invoke$arity$variadic(c, g, m, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = d.cljs$lang$applyTo; - return c - }() + return c; + }(); }, c = function(a, b, c) { return function() { var d = null, k = function() { var d = function(d, h, k, l) { - return cljs.core.apply.call(null, a, null == d ? b : d, null == h ? c : h, k, l) + return cljs.core.apply.call(null, a, null == d ? b : d, null == h ? c : h, k, l); }, h = function(a, b, c, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + return d.call(this, a, b, c, f); }; h.cljs$lang$maxFixedArity = 3; h.cljs$lang$applyTo = function(a) { @@ -6695,10 +6789,10 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; h.cljs$core$IFn$_invoke$arity$variadic = d; - return h + return h; }(), d = function(d, h, n, p) { switch(arguments.length) { case 2: @@ -6706,23 +6800,23 @@ cljs.core.fnil = function() { case 3: return a.call(null, null == d ? b : d, null == h ? c : h, n); default: - return k.cljs$core$IFn$_invoke$arity$variadic(d, h, n, cljs.core.array_seq(arguments, 3)) + return k.cljs$core$IFn$_invoke$arity$variadic(d, h, n, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = k.cljs$lang$applyTo; - return d - }() + return d; + }(); }, d = function(a, b, c, d) { return function() { var k = null, l = function() { var k = function(k, l, m, n) { - return cljs.core.apply.call(null, a, null == k ? b : k, null == l ? c : l, null == m ? d : m, n) + return cljs.core.apply.call(null, a, null == k ? b : k, null == l ? c : l, null == m ? d : m, n); }, l = function(a, b, c, d) { var e = null; 3 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return k.call(this, a, b, c, e) + return k.call(this, a, b, c, e); }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -6732,10 +6826,10 @@ cljs.core.fnil = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return k(b, c, d, a) + return k(b, c, d, a); }; l.cljs$core$IFn$_invoke$arity$variadic = k; - return l + return l; }(), k = function(k, n, p, q) { switch(arguments.length) { case 2: @@ -6743,14 +6837,14 @@ cljs.core.fnil = function() { case 3: return a.call(null, null == k ? b : k, null == n ? c : n, null == p ? d : p); default: - return l.cljs$core$IFn$_invoke$arity$variadic(k, n, p, cljs.core.array_seq(arguments, 3)) + return l.cljs$core$IFn$_invoke$arity$variadic(k, n, p, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; k.cljs$lang$maxFixedArity = 3; k.cljs$lang$applyTo = l.cljs$lang$applyTo; - return k - }() + return k; + }(); }, a = function(a, f, g, h) { switch(arguments.length) { case 2: @@ -6758,104 +6852,104 @@ cljs.core.fnil = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.map_indexed = function(a, b) { return function d(b, f) { return new cljs.core.LazySeq(null, function() { var g = cljs.core.seq.call(null, f); - if(g) { - if(cljs.core.chunked_seq_QMARK_.call(null, g)) { - for(var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { - if(m < k) { - cljs.core.chunk_append.call(null, l, a.call(null, b + m, cljs.core._nth.call(null, h, m))), m += 1 - }else { - break + if (g) { + if (cljs.core.chunked_seq_QMARK_.call(null, g)) { + for (var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { + if (m < k) { + cljs.core.chunk_append.call(null, l, a.call(null, b + m, cljs.core._nth.call(null, h, m))), m += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))) + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))); } - return cljs.core.cons.call(null, a.call(null, b, cljs.core.first.call(null, g)), d.call(null, b + 1, cljs.core.rest.call(null, g))) + return cljs.core.cons.call(null, a.call(null, b, cljs.core.first.call(null, g)), d.call(null, b + 1, cljs.core.rest.call(null, g))); } - return null - }, null, null) - }.call(null, 0, b) + return null; + }, null, null); + }.call(null, 0, b); }; cljs.core.keep = function keep(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, c); - if(d) { - if(cljs.core.chunked_seq_QMARK_.call(null, d)) { - for(var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { - if(h < f) { + if (d) { + if (cljs.core.chunked_seq_QMARK_.call(null, d)) { + for (var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { + if (h < f) { var k = b.call(null, cljs.core._nth.call(null, e, h)); null != k && cljs.core.chunk_append.call(null, g, k); - h += 1 - }else { - break + h += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), keep.call(null, b, cljs.core.chunk_rest.call(null, d))) + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), keep.call(null, b, cljs.core.chunk_rest.call(null, d))); } e = b.call(null, cljs.core.first.call(null, d)); - return null == e ? keep.call(null, b, cljs.core.rest.call(null, d)) : cljs.core.cons.call(null, e, keep.call(null, b, cljs.core.rest.call(null, d))) + return null == e ? keep.call(null, b, cljs.core.rest.call(null, d)) : cljs.core.cons.call(null, e, keep.call(null, b, cljs.core.rest.call(null, d))); } - return null - }, null, null) + return null; + }, null, null); }; cljs.core.keep_indexed = function(a, b) { return function d(b, f) { return new cljs.core.LazySeq(null, function() { var g = cljs.core.seq.call(null, f); - if(g) { - if(cljs.core.chunked_seq_QMARK_.call(null, g)) { - for(var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { - if(m < k) { + if (g) { + if (cljs.core.chunked_seq_QMARK_.call(null, g)) { + for (var h = cljs.core.chunk_first.call(null, g), k = cljs.core.count.call(null, h), l = cljs.core.chunk_buffer.call(null, k), m = 0;;) { + if (m < k) { var n = a.call(null, b + m, cljs.core._nth.call(null, h, m)); null != n && cljs.core.chunk_append.call(null, l, n); - m += 1 - }else { - break + m += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))) + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, l), d.call(null, b + k, cljs.core.chunk_rest.call(null, g))); } h = a.call(null, b, cljs.core.first.call(null, g)); - return null == h ? d.call(null, b + 1, cljs.core.rest.call(null, g)) : cljs.core.cons.call(null, h, d.call(null, b + 1, cljs.core.rest.call(null, g))) + return null == h ? d.call(null, b + 1, cljs.core.rest.call(null, g)) : cljs.core.cons.call(null, h, d.call(null, b + 1, cljs.core.rest.call(null, g))); } - return null - }, null, null) - }.call(null, 0, b) + return null; + }, null, null); + }.call(null, 0, b); }; cljs.core.every_pred = function() { var a = null, b = function(a) { return function() { var b = null, c = function(b) { - return cljs.core.boolean$.call(null, a.call(null, b)) + return cljs.core.boolean$.call(null, a.call(null, b)); }, d = function(b, c) { return cljs.core.boolean$.call(null, function() { var d = a.call(null, b); - return cljs.core.truth_(d) ? a.call(null, c) : d - }()) + return cljs.core.truth_(d) ? a.call(null, c) : d; + }()); }, e = function(b, c, d) { return cljs.core.boolean$.call(null, function() { var e = a.call(null, b); - return cljs.core.truth_(e) ? (e = a.call(null, c), cljs.core.truth_(e) ? a.call(null, d) : e) : e - }()) + return cljs.core.truth_(e) ? (e = a.call(null, c), cljs.core.truth_(e) ? a.call(null, d) : e) : e; + }()); }, m = function() { var c = function(c, d, e, h) { - return cljs.core.boolean$.call(null, b.call(null, c, d, e) && cljs.core.every_QMARK_.call(null, a, h)) + return cljs.core.boolean$.call(null, b.call(null, c, d, e) && cljs.core.every_QMARK_.call(null, a, h)); }, d = function(a, b, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -6865,10 +6959,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: @@ -6880,48 +6974,48 @@ cljs.core.every_pred = function() { case 3: return e.call(this, a, b, f); default: - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)) + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = m.cljs$lang$applyTo; b.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; b.cljs$core$IFn$_invoke$arity$1 = c; b.cljs$core$IFn$_invoke$arity$2 = d; b.cljs$core$IFn$_invoke$arity$3 = e; b.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return b - }() + return b; + }(); }, c = function(a, b) { return function() { var c = null, d = function(c) { return cljs.core.boolean$.call(null, function() { var d = a.call(null, c); - return cljs.core.truth_(d) ? b.call(null, c) : d - }()) + return cljs.core.truth_(d) ? b.call(null, c) : d; + }()); }, e = function(c, d) { return cljs.core.boolean$.call(null, function() { var e = a.call(null, c); - return cljs.core.truth_(e) && (e = a.call(null, d), cljs.core.truth_(e)) ? (e = b.call(null, c), cljs.core.truth_(e) ? b.call(null, d) : e) : e - }()) + return cljs.core.truth_(e) && (e = a.call(null, d), cljs.core.truth_(e)) ? (e = b.call(null, c), cljs.core.truth_(e) ? b.call(null, d) : e) : e; + }()); }, m = function(c, d, e) { return cljs.core.boolean$.call(null, function() { var h = a.call(null, c); - return cljs.core.truth_(h) && (h = a.call(null, d), cljs.core.truth_(h) && (h = a.call(null, e), cljs.core.truth_(h) && (h = b.call(null, c), cljs.core.truth_(h)))) ? (h = b.call(null, d), cljs.core.truth_(h) ? b.call(null, e) : h) : h - }()) + return cljs.core.truth_(h) && (h = a.call(null, d), cljs.core.truth_(h) && (h = a.call(null, e), cljs.core.truth_(h) && (h = b.call(null, c), cljs.core.truth_(h)))) ? (h = b.call(null, d), cljs.core.truth_(h) ? b.call(null, e) : h) : h; + }()); }, n = function() { var d = function(d, e, k, l) { return cljs.core.boolean$.call(null, c.call(null, d, e, k) && cljs.core.every_QMARK_.call(null, function(c) { var d = a.call(null, c); - return cljs.core.truth_(d) ? b.call(null, c) : d - }, l)) + return cljs.core.truth_(d) ? b.call(null, c) : d; + }, l)); }, e = function(a, b, c, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -6931,10 +7025,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e + return e; }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: @@ -6946,48 +7040,48 @@ cljs.core.every_pred = function() { case 3: return m.call(this, a, b, c); default: - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = n.cljs$lang$applyTo; c.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; c.cljs$core$IFn$_invoke$arity$1 = d; c.cljs$core$IFn$_invoke$arity$2 = e; c.cljs$core$IFn$_invoke$arity$3 = m; c.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return c - }() + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function(d) { return cljs.core.boolean$.call(null, function() { var e = a.call(null, d); - return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e - }()) + return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e; + }()); }, m = function(d, e) { return cljs.core.boolean$.call(null, function() { var k = a.call(null, d); - return cljs.core.truth_(k) && (k = b.call(null, d), cljs.core.truth_(k) && (k = c.call(null, d), cljs.core.truth_(k) && (k = a.call(null, e), cljs.core.truth_(k)))) ? (k = b.call(null, e), cljs.core.truth_(k) ? c.call(null, e) : k) : k - }()) + return cljs.core.truth_(k) && (k = b.call(null, d), cljs.core.truth_(k) && (k = c.call(null, d), cljs.core.truth_(k) && (k = a.call(null, e), cljs.core.truth_(k)))) ? (k = b.call(null, e), cljs.core.truth_(k) ? c.call(null, e) : k) : k; + }()); }, n = function(d, e, k) { return cljs.core.boolean$.call(null, function() { var l = a.call(null, d); - return cljs.core.truth_(l) && (l = b.call(null, d), cljs.core.truth_(l) && (l = c.call(null, d), cljs.core.truth_(l) && (l = a.call(null, e), cljs.core.truth_(l) && (l = b.call(null, e), cljs.core.truth_(l) && (l = c.call(null, e), cljs.core.truth_(l) && (l = a.call(null, k), cljs.core.truth_(l))))))) ? (l = b.call(null, k), cljs.core.truth_(l) ? c.call(null, k) : l) : l - }()) + return cljs.core.truth_(l) && (l = b.call(null, d), cljs.core.truth_(l) && (l = c.call(null, d), cljs.core.truth_(l) && (l = a.call(null, e), cljs.core.truth_(l) && (l = b.call(null, e), cljs.core.truth_(l) && (l = c.call(null, e), cljs.core.truth_(l) && (l = a.call(null, k), cljs.core.truth_(l))))))) ? (l = b.call(null, k), cljs.core.truth_(l) ? c.call(null, k) : l) : l; + }()); }, p = function() { var e = function(e, l, m, n) { return cljs.core.boolean$.call(null, d.call(null, e, l, m) && cljs.core.every_QMARK_.call(null, function(d) { var e = a.call(null, d); - return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e - }, n)) + return cljs.core.truth_(e) ? (e = b.call(null, d), cljs.core.truth_(e) ? c.call(null, d) : e) : e; + }, n)); }, l = function(a, b, c, d) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return e.call(this, a, b, c, f) + return e.call(this, a, b, c, f); }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -6997,10 +7091,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return e(b, c, d, a) + return e(b, c, d, a); }; l.cljs$core$IFn$_invoke$arity$variadic = e; - return l + return l; }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: @@ -7012,48 +7106,48 @@ cljs.core.every_pred = function() { case 3: return n.call(this, a, b, c); default: - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = p.cljs$lang$applyTo; d.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; d.cljs$core$IFn$_invoke$arity$1 = e; d.cljs$core$IFn$_invoke$arity$2 = m; d.cljs$core$IFn$_invoke$arity$3 = n; d.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return d - }() + return d; + }(); }, e = function() { var a = function(a, b, c, d) { var e = cljs.core.list_STAR_.call(null, a, b, c, d); return function() { var a = null, b = function(a) { return cljs.core.every_QMARK_.call(null, function(b) { - return b.call(null, a) - }, e) + return b.call(null, a); + }, e); }, c = function(a, b) { return cljs.core.every_QMARK_.call(null, function(c) { var d = c.call(null, a); - return cljs.core.truth_(d) ? c.call(null, b) : d - }, e) + return cljs.core.truth_(d) ? c.call(null, b) : d; + }, e); }, d = function(a, b, c) { return cljs.core.every_QMARK_.call(null, function(d) { var e = d.call(null, a); - return cljs.core.truth_(e) ? (e = d.call(null, b), cljs.core.truth_(e) ? d.call(null, c) : e) : e - }, e) + return cljs.core.truth_(e) ? (e = d.call(null, b), cljs.core.truth_(e) ? d.call(null, c) : e) : e; + }, e); }, f = function() { var b = function(b, c, d, f) { return cljs.core.boolean$.call(null, a.call(null, b, c, d) && cljs.core.every_QMARK_.call(null, function(a) { - return cljs.core.every_QMARK_.call(null, a, f) - }, e)) + return cljs.core.every_QMARK_.call(null, a, f); + }, e)); }, c = function(a, c, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, d, f) + return b.call(this, a, c, d, f); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -7063,10 +7157,10 @@ cljs.core.every_pred = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, a) + return b(c, d, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, g, h) { switch(arguments.length) { case 0: @@ -7078,25 +7172,25 @@ cljs.core.every_pred = function() { case 3: return d.call(this, a, e, g); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)) + return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = f.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return!0 + return!0; }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a - }() + return a; + }(); }, b = function(b, c, d, e) { var g = null; 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -7106,10 +7200,10 @@ cljs.core.every_pred = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -7119,7 +7213,7 @@ cljs.core.every_pred = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; @@ -7129,31 +7223,31 @@ cljs.core.every_pred = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.some_fn = function() { var a = null, b = function(a) { return function() { var b = null, c = function(b) { - return a.call(null, b) + return a.call(null, b); }, d = function(b, c) { var d = a.call(null, b); - return cljs.core.truth_(d) ? d : a.call(null, c) + return cljs.core.truth_(d) ? d : a.call(null, c); }, e = function(b, c, d) { b = a.call(null, b); - if(cljs.core.truth_(b)) { - return b + if (cljs.core.truth_(b)) { + return b; } c = a.call(null, c); - return cljs.core.truth_(c) ? c : a.call(null, d) + return cljs.core.truth_(c) ? c : a.call(null, d); }, m = function() { var c = function(c, d, e, h) { c = b.call(null, c, d, e); - return cljs.core.truth_(c) ? c : cljs.core.some.call(null, a, h) + return cljs.core.truth_(c) ? c : cljs.core.some.call(null, a, h); }, d = function(a, b, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -7163,10 +7257,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), b = function(a, b, f, g) { switch(arguments.length) { case 0: @@ -7178,67 +7272,67 @@ cljs.core.some_fn = function() { case 3: return e.call(this, a, b, f); default: - return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)) + return m.cljs$core$IFn$_invoke$arity$variadic(a, b, f, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = m.cljs$lang$applyTo; b.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; b.cljs$core$IFn$_invoke$arity$1 = c; b.cljs$core$IFn$_invoke$arity$2 = d; b.cljs$core$IFn$_invoke$arity$3 = e; b.cljs$core$IFn$_invoke$arity$variadic = m.cljs$core$IFn$_invoke$arity$variadic; - return b - }() + return b; + }(); }, c = function(a, b) { return function() { var c = null, d = function(c) { var d = a.call(null, c); - return cljs.core.truth_(d) ? d : b.call(null, c) + return cljs.core.truth_(d) ? d : b.call(null, c); }, e = function(c, d) { var e = a.call(null, c); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = a.call(null, d); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = b.call(null, c); - return cljs.core.truth_(e) ? e : b.call(null, d) + return cljs.core.truth_(e) ? e : b.call(null, d); }, m = function(c, d, e) { var h = a.call(null, c); - if(cljs.core.truth_(h)) { - return h + if (cljs.core.truth_(h)) { + return h; } h = a.call(null, d); - if(cljs.core.truth_(h)) { - return h + if (cljs.core.truth_(h)) { + return h; } h = a.call(null, e); - if(cljs.core.truth_(h)) { - return h + if (cljs.core.truth_(h)) { + return h; } c = b.call(null, c); - if(cljs.core.truth_(c)) { - return c + if (cljs.core.truth_(c)) { + return c; } d = b.call(null, d); - return cljs.core.truth_(d) ? d : b.call(null, e) + return cljs.core.truth_(d) ? d : b.call(null, e); }, n = function() { var d = function(d, e, k, l) { d = c.call(null, d, e, k); return cljs.core.truth_(d) ? d : cljs.core.some.call(null, function(c) { var d = a.call(null, c); - return cljs.core.truth_(d) ? d : b.call(null, c) - }, l) + return cljs.core.truth_(d) ? d : b.call(null, c); + }, l); }, e = function(a, b, c, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -7248,10 +7342,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e + return e; }(), c = function(a, b, c, f) { switch(arguments.length) { case 0: @@ -7263,95 +7357,95 @@ cljs.core.some_fn = function() { case 3: return m.call(this, a, b, c); default: - return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + return n.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = n.cljs$lang$applyTo; c.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; c.cljs$core$IFn$_invoke$arity$1 = d; c.cljs$core$IFn$_invoke$arity$2 = e; c.cljs$core$IFn$_invoke$arity$3 = m; c.cljs$core$IFn$_invoke$arity$variadic = n.cljs$core$IFn$_invoke$arity$variadic; - return c - }() + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function(d) { var e = a.call(null, d); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = b.call(null, d); - return cljs.core.truth_(e) ? e : c.call(null, d) + return cljs.core.truth_(e) ? e : c.call(null, d); }, m = function(d, e) { var k = a.call(null, d); - if(cljs.core.truth_(k)) { - return k + if (cljs.core.truth_(k)) { + return k; } k = b.call(null, d); - if(cljs.core.truth_(k)) { - return k + if (cljs.core.truth_(k)) { + return k; } k = c.call(null, d); - if(cljs.core.truth_(k)) { - return k + if (cljs.core.truth_(k)) { + return k; } k = a.call(null, e); - if(cljs.core.truth_(k)) { - return k + if (cljs.core.truth_(k)) { + return k; } k = b.call(null, e); - return cljs.core.truth_(k) ? k : c.call(null, e) + return cljs.core.truth_(k) ? k : c.call(null, e); }, n = function(d, e, k) { var l = a.call(null, d); - if(cljs.core.truth_(l)) { - return l + if (cljs.core.truth_(l)) { + return l; } l = b.call(null, d); - if(cljs.core.truth_(l)) { - return l + if (cljs.core.truth_(l)) { + return l; } d = c.call(null, d); - if(cljs.core.truth_(d)) { - return d + if (cljs.core.truth_(d)) { + return d; } d = a.call(null, e); - if(cljs.core.truth_(d)) { - return d + if (cljs.core.truth_(d)) { + return d; } d = b.call(null, e); - if(cljs.core.truth_(d)) { - return d + if (cljs.core.truth_(d)) { + return d; } e = c.call(null, e); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = a.call(null, k); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = b.call(null, k); - return cljs.core.truth_(e) ? e : c.call(null, k) + return cljs.core.truth_(e) ? e : c.call(null, k); }, p = function() { var e = function(e, l, m, n) { e = d.call(null, e, l, m); return cljs.core.truth_(e) ? e : cljs.core.some.call(null, function(d) { var e = a.call(null, d); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = b.call(null, d); - return cljs.core.truth_(e) ? e : c.call(null, d) - }, n) + return cljs.core.truth_(e) ? e : c.call(null, d); + }, n); }, l = function(a, b, c, d) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return e.call(this, a, b, c, f) + return e.call(this, a, b, c, f); }; l.cljs$lang$maxFixedArity = 3; l.cljs$lang$applyTo = function(a) { @@ -7361,10 +7455,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var d = cljs.core.first(a); a = cljs.core.rest(a); - return e(b, c, d, a) + return e(b, c, d, a); }; l.cljs$core$IFn$_invoke$arity$variadic = e; - return l + return l; }(), d = function(a, b, c, d) { switch(arguments.length) { case 0: @@ -7376,53 +7470,53 @@ cljs.core.some_fn = function() { case 3: return n.call(this, a, b, c); default: - return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)) + return p.cljs$core$IFn$_invoke$arity$variadic(a, b, c, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = p.cljs$lang$applyTo; d.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; d.cljs$core$IFn$_invoke$arity$1 = e; d.cljs$core$IFn$_invoke$arity$2 = m; d.cljs$core$IFn$_invoke$arity$3 = n; d.cljs$core$IFn$_invoke$arity$variadic = p.cljs$core$IFn$_invoke$arity$variadic; - return d - }() + return d; + }(); }, e = function() { var a = function(a, b, c, d) { var e = cljs.core.list_STAR_.call(null, a, b, c, d); return function() { var a = null, b = function(a) { return cljs.core.some.call(null, function(b) { - return b.call(null, a) - }, e) + return b.call(null, a); + }, e); }, c = function(a, b) { return cljs.core.some.call(null, function(c) { var d = c.call(null, a); - return cljs.core.truth_(d) ? d : c.call(null, b) - }, e) + return cljs.core.truth_(d) ? d : c.call(null, b); + }, e); }, d = function(a, b, c) { return cljs.core.some.call(null, function(d) { var e = d.call(null, a); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = d.call(null, b); - return cljs.core.truth_(e) ? e : d.call(null, c) - }, e) + return cljs.core.truth_(e) ? e : d.call(null, c); + }, e); }, f = function() { var b = function(b, c, d, f) { b = a.call(null, b, c, d); return cljs.core.truth_(b) ? b : cljs.core.some.call(null, function(a) { - return cljs.core.some.call(null, a, f) - }, e) + return cljs.core.some.call(null, a, f); + }, e); }, c = function(a, c, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, d, f) + return b.call(this, a, c, d, f); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -7432,10 +7526,10 @@ cljs.core.some_fn = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, a) + return b(c, d, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, g, h) { switch(arguments.length) { case 0: @@ -7447,25 +7541,25 @@ cljs.core.some_fn = function() { case 3: return d.call(this, a, e, g); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)) + return f.cljs$core$IFn$_invoke$arity$variadic(a, e, g, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = f.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = function() { - return null + return null; }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a - }() + return a; + }(); }, b = function(b, c, d, e) { var g = null; 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -7475,10 +7569,10 @@ cljs.core.some_fn = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -7488,7 +7582,7 @@ cljs.core.some_fn = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; @@ -7498,51 +7592,51 @@ cljs.core.some_fn = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.map = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, c); - if(d) { - if(cljs.core.chunked_seq_QMARK_.call(null, d)) { - for(var e = cljs.core.chunk_first.call(null, d), l = cljs.core.count.call(null, e), m = cljs.core.chunk_buffer.call(null, l), n = 0;;) { - if(n < l) { - cljs.core.chunk_append.call(null, m, b.call(null, cljs.core._nth.call(null, e, n))), n += 1 - }else { - break + if (d) { + if (cljs.core.chunked_seq_QMARK_.call(null, d)) { + for (var e = cljs.core.chunk_first.call(null, d), l = cljs.core.count.call(null, e), m = cljs.core.chunk_buffer.call(null, l), n = 0;;) { + if (n < l) { + cljs.core.chunk_append.call(null, m, b.call(null, cljs.core._nth.call(null, e, n))), n += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, m), a.call(null, b, cljs.core.chunk_rest.call(null, d))) + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, m), a.call(null, b, cljs.core.chunk_rest.call(null, d))); } - return cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, d)), a.call(null, b, cljs.core.rest.call(null, d))) + return cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, d)), a.call(null, b, cljs.core.rest.call(null, d))); } - return null - }, null, null) + return null; + }, null, null); }, c = function(b, c, d) { return new cljs.core.LazySeq(null, function() { var e = cljs.core.seq.call(null, c), l = cljs.core.seq.call(null, d); - return e && l ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, e), cljs.core.first.call(null, l)), a.call(null, b, cljs.core.rest.call(null, e), cljs.core.rest.call(null, l))) : null - }, null, null) + return e && l ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, e), cljs.core.first.call(null, l)), a.call(null, b, cljs.core.rest.call(null, e), cljs.core.rest.call(null, l))) : null; + }, null, null); }, d = function(b, c, d, e) { return new cljs.core.LazySeq(null, function() { var l = cljs.core.seq.call(null, c), m = cljs.core.seq.call(null, d), n = cljs.core.seq.call(null, e); - return l && m && n ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, l), cljs.core.first.call(null, m), cljs.core.first.call(null, n)), a.call(null, b, cljs.core.rest.call(null, l), cljs.core.rest.call(null, m), cljs.core.rest.call(null, n))) : null - }, null, null) + return l && m && n ? cljs.core.cons.call(null, b.call(null, cljs.core.first.call(null, l), cljs.core.first.call(null, m), cljs.core.first.call(null, n)), a.call(null, b, cljs.core.rest.call(null, l), cljs.core.rest.call(null, m), cljs.core.rest.call(null, n))) : null; + }, null, null); }, e = function() { var b = function(b, c, d, e, f) { return a.call(null, function(a) { - return cljs.core.apply.call(null, b, a) + return cljs.core.apply.call(null, b, a); }, function q(b) { return new cljs.core.LazySeq(null, function() { var c = a.call(null, cljs.core.seq, b); - return cljs.core.every_QMARK_.call(null, cljs.core.identity, c) ? cljs.core.cons.call(null, a.call(null, cljs.core.first, c), q.call(null, a.call(null, cljs.core.rest, c))) : null - }, null, null) - }.call(null, cljs.core.conj.call(null, f, e, d, c))) + return cljs.core.every_QMARK_.call(null, cljs.core.identity, c) ? cljs.core.cons.call(null, a.call(null, cljs.core.first, c), q.call(null, a.call(null, cljs.core.rest, c))) : null; + }, null, null); + }.call(null, cljs.core.conj.call(null, f, e, d, c))); }, c = function(a, c, d, e, g) { var p = null; 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return b.call(this, a, c, d, e, p) + return b.call(this, a, c, d, e, p); }; c.cljs$lang$maxFixedArity = 4; c.cljs$lang$applyTo = function(a) { @@ -7554,10 +7648,10 @@ cljs.core.map = function() { a = cljs.core.next(a); var g = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, g, a) + return b(c, d, e, g, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 2: @@ -7567,7 +7661,7 @@ cljs.core.map = function() { case 4: return d.call(this, a, g, h, k); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)); } throw Error("Invalid arity: " + arguments.length); }; @@ -7577,156 +7671,156 @@ cljs.core.map = function() { a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.take = function take(b, c) { return new cljs.core.LazySeq(null, function() { - if(0 < b) { + if (0 < b) { var d = cljs.core.seq.call(null, c); - return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take.call(null, b - 1, cljs.core.rest.call(null, d))) : null + return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take.call(null, b - 1, cljs.core.rest.call(null, d))) : null; } - return null - }, null, null) + return null; + }, null, null); }; cljs.core.drop = function(a, b) { var c = function(a, b) { - for(;;) { + for (;;) { var c = cljs.core.seq.call(null, b); - if(0 < a && c) { + if (0 < a && c) { var g = a - 1, c = cljs.core.rest.call(null, c); a = g; - b = c - }else { - return c + b = c; + } else { + return c; } } }; return new cljs.core.LazySeq(null, function() { - return c.call(null, a, b) - }, null, null) + return c.call(null, a, b); + }, null, null); }; cljs.core.drop_last = function() { var a = null, b = function(b) { - return a.call(null, 1, b) + return a.call(null, 1, b); }, c = function(a, b) { return cljs.core.map.call(null, function(a, b) { - return a - }, b, cljs.core.drop.call(null, a, b)) + return a; + }, b, cljs.core.drop.call(null, a, b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.take_last = function(a, b) { - for(var c = cljs.core.seq.call(null, b), d = cljs.core.seq.call(null, cljs.core.drop.call(null, a, b));;) { - if(d) { - c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d) - }else { - return c + for (var c = cljs.core.seq.call(null, b), d = cljs.core.seq.call(null, cljs.core.drop.call(null, a, b));;) { + if (d) { + c = cljs.core.next.call(null, c), d = cljs.core.next.call(null, d); + } else { + return c; } } }; cljs.core.drop_while = function(a, b) { var c = function(a, b) { - for(;;) { + for (;;) { var c = cljs.core.seq.call(null, b); - if(cljs.core.truth_(function() { + if (cljs.core.truth_(function() { var b = c; - return b ? a.call(null, cljs.core.first.call(null, c)) : b + return b ? a.call(null, cljs.core.first.call(null, c)) : b; }())) { var g = a, h = cljs.core.rest.call(null, c); a = g; - b = h - }else { - return c + b = h; + } else { + return c; } } }; return new cljs.core.LazySeq(null, function() { - return c.call(null, a, b) - }, null, null) + return c.call(null, a, b); + }, null, null); }; cljs.core.cycle = function cycle(b) { return new cljs.core.LazySeq(null, function() { var c = cljs.core.seq.call(null, b); - return c ? cljs.core.concat.call(null, c, cycle.call(null, c)) : null - }, null, null) + return c ? cljs.core.concat.call(null, c, cycle.call(null, c)) : null; + }, null, null); }; cljs.core.split_at = function(a, b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take.call(null, a, b), cljs.core.drop.call(null, a, b)], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take.call(null, a, b), cljs.core.drop.call(null, a, b)], null); }; cljs.core.repeat = function() { var a = null, b = function(b) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, b, a.call(null, b)) - }, null, null) + return cljs.core.cons.call(null, b, a.call(null, b)); + }, null, null); }, c = function(b, c) { - return cljs.core.take.call(null, b, a.call(null, c)) + return cljs.core.take.call(null, b, a.call(null, c)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.replicate = function(a, b) { - return cljs.core.take.call(null, a, cljs.core.repeat.call(null, b)) + return cljs.core.take.call(null, a, cljs.core.repeat.call(null, b)); }; cljs.core.repeatedly = function() { var a = null, b = function(b) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, b.call(null), a.call(null, b)) - }, null, null) + return cljs.core.cons.call(null, b.call(null), a.call(null, b)); + }, null, null); }, c = function(b, c) { - return cljs.core.take.call(null, b, a.call(null, c)) + return cljs.core.take.call(null, b, a.call(null, c)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.iterate = function iterate(b, c) { return cljs.core.cons.call(null, c, new cljs.core.LazySeq(null, function() { - return iterate.call(null, b, b.call(null, c)) - }, null, null)) + return iterate.call(null, b, b.call(null, c)); + }, null, null)); }; cljs.core.interleave = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { var f = cljs.core.seq.call(null, b), g = cljs.core.seq.call(null, c); - return f && g ? cljs.core.cons.call(null, cljs.core.first.call(null, f), cljs.core.cons.call(null, cljs.core.first.call(null, g), a.call(null, cljs.core.rest.call(null, f), cljs.core.rest.call(null, g)))) : null - }, null, null) + return f && g ? cljs.core.cons.call(null, cljs.core.first.call(null, f), cljs.core.cons.call(null, cljs.core.first.call(null, g), a.call(null, cljs.core.rest.call(null, f), cljs.core.rest.call(null, g)))) : null; + }, null, null); }, c = function() { var b = function(b, c, d) { return new cljs.core.LazySeq(null, function() { var e = cljs.core.map.call(null, cljs.core.seq, cljs.core.conj.call(null, d, c, b)); - return cljs.core.every_QMARK_.call(null, cljs.core.identity, e) ? cljs.core.concat.call(null, cljs.core.map.call(null, cljs.core.first, e), cljs.core.apply.call(null, a, cljs.core.map.call(null, cljs.core.rest, e))) : null - }, null, null) + return cljs.core.every_QMARK_.call(null, cljs.core.identity, e) ? cljs.core.concat.call(null, cljs.core.map.call(null, cljs.core.first, e), cljs.core.apply.call(null, a, cljs.core.map.call(null, cljs.core.rest, e))) : null; + }, null, null); }, c = function(a, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return b.call(this, a, c, k) + return b.call(this, a, c, k); }; c.cljs$lang$maxFixedArity = 2; c.cljs$lang$applyTo = function(a) { @@ -7734,16 +7828,16 @@ cljs.core.interleave = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, a) + return b(c, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; @@ -7751,29 +7845,29 @@ cljs.core.interleave = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.interpose = function(a, b) { - return cljs.core.drop.call(null, 1, cljs.core.interleave.call(null, cljs.core.repeat.call(null, a), b)) + return cljs.core.drop.call(null, 1, cljs.core.interleave.call(null, cljs.core.repeat.call(null, a), b)); }; cljs.core.flatten1 = function(a) { return function c(a, e) { return new cljs.core.LazySeq(null, function() { var f = cljs.core.seq.call(null, a); - return f ? cljs.core.cons.call(null, cljs.core.first.call(null, f), c.call(null, cljs.core.rest.call(null, f), e)) : cljs.core.seq.call(null, e) ? c.call(null, cljs.core.first.call(null, e), cljs.core.rest.call(null, e)) : null - }, null, null) - }.call(null, null, a) + return f ? cljs.core.cons.call(null, cljs.core.first.call(null, f), c.call(null, cljs.core.rest.call(null, f), e)) : cljs.core.seq.call(null, e) ? c.call(null, cljs.core.first.call(null, e), cljs.core.rest.call(null, e)) : null; + }, null, null); + }.call(null, null, a); }; cljs.core.mapcat = function() { var a = null, b = function(a, b) { - return cljs.core.flatten1.call(null, cljs.core.map.call(null, a, b)) + return cljs.core.flatten1.call(null, cljs.core.map.call(null, a, b)); }, c = function() { var a = function(a, b, c) { - return cljs.core.flatten1.call(null, cljs.core.apply.call(null, cljs.core.map, a, b, c)) + return cljs.core.flatten1.call(null, cljs.core.apply.call(null, cljs.core.map, a, b, c)); }, b = function(b, c, e) { var k = null; 2 < arguments.length && (k = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, c, k) + return a.call(this, b, c, k); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -7781,16 +7875,16 @@ cljs.core.mapcat = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, e, b) + return a(c, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, cljs.core.array_seq(arguments, 2)); } throw Error("Invalid arity: " + arguments.length); }; @@ -7798,63 +7892,63 @@ cljs.core.mapcat = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.filter = function filter(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, c); - if(d) { - if(cljs.core.chunked_seq_QMARK_.call(null, d)) { - for(var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { - if(h < f) { - cljs.core.truth_(b.call(null, cljs.core._nth.call(null, e, h))) && cljs.core.chunk_append.call(null, g, cljs.core._nth.call(null, e, h)), h += 1 - }else { - break + if (d) { + if (cljs.core.chunked_seq_QMARK_.call(null, d)) { + for (var e = cljs.core.chunk_first.call(null, d), f = cljs.core.count.call(null, e), g = cljs.core.chunk_buffer.call(null, f), h = 0;;) { + if (h < f) { + cljs.core.truth_(b.call(null, cljs.core._nth.call(null, e, h))) && cljs.core.chunk_append.call(null, g, cljs.core._nth.call(null, e, h)), h += 1; + } else { + break; } } - return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), filter.call(null, b, cljs.core.chunk_rest.call(null, d))) + return cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), filter.call(null, b, cljs.core.chunk_rest.call(null, d))); } e = cljs.core.first.call(null, d); d = cljs.core.rest.call(null, d); - return cljs.core.truth_(b.call(null, e)) ? cljs.core.cons.call(null, e, filter.call(null, b, d)) : filter.call(null, b, d) + return cljs.core.truth_(b.call(null, e)) ? cljs.core.cons.call(null, e, filter.call(null, b, d)) : filter.call(null, b, d); } - return null - }, null, null) + return null; + }, null, null); }; cljs.core.remove = function(a, b) { - return cljs.core.filter.call(null, cljs.core.complement.call(null, a), b) + return cljs.core.filter.call(null, cljs.core.complement.call(null, a), b); }; cljs.core.tree_seq = function(a, b, c) { return function e(c) { return new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, c, cljs.core.truth_(a.call(null, c)) ? cljs.core.mapcat.call(null, e, b.call(null, c)) : null) - }, null, null) - }.call(null, c) + return cljs.core.cons.call(null, c, cljs.core.truth_(a.call(null, c)) ? cljs.core.mapcat.call(null, e, b.call(null, c)) : null); + }, null, null); + }.call(null, c); }; cljs.core.flatten = function(a) { return cljs.core.filter.call(null, function(a) { - return!cljs.core.sequential_QMARK_.call(null, a) - }, cljs.core.rest.call(null, cljs.core.tree_seq.call(null, cljs.core.sequential_QMARK_, cljs.core.seq, a))) + return!cljs.core.sequential_QMARK_.call(null, a); + }, cljs.core.rest.call(null, cljs.core.tree_seq.call(null, cljs.core.sequential_QMARK_, cljs.core.seq, a))); }; cljs.core.into = function(a, b) { - return null != a ? a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core.transient$.call(null, a), b)) : cljs.core.reduce.call(null, cljs.core._conj, a, b) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, b) + return null != a ? a && (a.cljs$lang$protocol_mask$partition1$ & 4 || a.cljs$core$IEditableCollection$) ? cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core.transient$.call(null, a), b)) : cljs.core.reduce.call(null, cljs.core._conj, a, b) : cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, b); }; cljs.core.mapv = function() { var a = null, b = function(a, b) { return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(b, c) { - return cljs.core.conj_BANG_.call(null, b, a.call(null, c)) - }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)) + return cljs.core.conj_BANG_.call(null, b, a.call(null, c)); + }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)); }, c = function(a, b, c) { - return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c)) + return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c)); }, d = function(a, b, c, d) { - return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c, d)) + return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.map.call(null, a, b, c, d)); }, e = function() { var a = function(a, b, c, d, e) { - return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.apply.call(null, cljs.core.map, a, b, c, d, e)) + return cljs.core.into.call(null, cljs.core.PersistentVector.EMPTY, cljs.core.apply.call(null, cljs.core.map, a, b, c, d, e)); }, b = function(b, c, d, e, g) { var p = null; 4 < arguments.length && (p = cljs.core.array_seq(Array.prototype.slice.call(arguments, 4), 0)); - return a.call(this, b, c, d, e, p) + return a.call(this, b, c, d, e, p); }; b.cljs$lang$maxFixedArity = 4; b.cljs$lang$applyTo = function(b) { @@ -7866,10 +7960,10 @@ cljs.core.mapv = function() { b = cljs.core.next(b); var g = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, g, b) + return a(c, d, e, g, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k, l) { switch(arguments.length) { case 2: @@ -7879,7 +7973,7 @@ cljs.core.mapv = function() { case 4: return d.call(this, a, g, h, k); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, k, cljs.core.array_seq(arguments, 4)); } throw Error("Invalid arity: " + arguments.length); }; @@ -7889,34 +7983,34 @@ cljs.core.mapv = function() { a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.filterv = function(a, b) { return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(b, d) { - return cljs.core.truth_(a.call(null, d)) ? cljs.core.conj_BANG_.call(null, b, d) : b - }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)) + return cljs.core.truth_(a.call(null, d)) ? cljs.core.conj_BANG_.call(null, b, d) : b; + }, cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY), b)); }; cljs.core.partition = function() { var a = null, b = function(b, c) { - return a.call(null, b, b, c) + return a.call(null, b, b, c); }, c = function(b, c, d) { return new cljs.core.LazySeq(null, function() { var h = cljs.core.seq.call(null, d); - if(h) { + if (h) { var k = cljs.core.take.call(null, b, h); - return b === cljs.core.count.call(null, k) ? cljs.core.cons.call(null, k, a.call(null, b, c, cljs.core.drop.call(null, c, h))) : null + return b === cljs.core.count.call(null, k) ? cljs.core.cons.call(null, k, a.call(null, b, c, cljs.core.drop.call(null, c, h))) : null; } - return null - }, null, null) + return null; + }, null, null); }, d = function(b, c, d, h) { return new cljs.core.LazySeq(null, function() { var k = cljs.core.seq.call(null, h); - if(k) { + if (k) { var l = cljs.core.take.call(null, b, k); - return b === cljs.core.count.call(null, l) ? cljs.core.cons.call(null, l, a.call(null, b, c, d, cljs.core.drop.call(null, c, k))) : cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.core.take.call(null, b, cljs.core.concat.call(null, l, d))) + return b === cljs.core.count.call(null, l) ? cljs.core.cons.call(null, l, a.call(null, b, c, d, cljs.core.drop.call(null, c, k))) : cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.core.take.call(null, b, cljs.core.concat.call(null, l, d))); } - return null - }, null, null) + return null; + }, null, null); }, a = function(a, f, g, h) { switch(arguments.length) { case 2: @@ -7924,34 +8018,34 @@ cljs.core.partition = function() { case 3: return c.call(this, a, f, g); case 4: - return d.call(this, a, f, g, h) + return d.call(this, a, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; a.cljs$core$IFn$_invoke$arity$4 = d; - return a + return a; }(); cljs.core.get_in = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, null) + return a.call(null, b, c, null); }, c = function(a, b, c) { var g = cljs.core.lookup_sentinel; - for(b = cljs.core.seq.call(null, b);;) { - if(b) { + for (b = cljs.core.seq.call(null, b);;) { + if (b) { var h = a; - if(h ? h.cljs$lang$protocol_mask$partition0$ & 256 || h.cljs$core$ILookup$ || (h.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) { + if (h ? h.cljs$lang$protocol_mask$partition0$ & 256 || h.cljs$core$ILookup$ || (h.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.ILookup, h)) { a = cljs.core.get.call(null, a, cljs.core.first.call(null, b), g); - if(g === a) { - return c + if (g === a) { + return c; } - b = cljs.core.next.call(null, b) - }else { - return c + b = cljs.core.next.call(null, b); + } else { + return c; } - }else { - return a + } else { + return a; } } }, a = function(a, e, f) { @@ -7959,39 +8053,39 @@ cljs.core.get_in = function() { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.assoc_in = function assoc_in(b, c, d) { var e = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, assoc_in.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d) + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, assoc_in.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d); }; cljs.core.update_in = function() { var a = null, b = function(b, c, d) { var e = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d.call(null, cljs.core.get.call(null, b, e))) + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), c, d)) : cljs.core.assoc.call(null, b, e, d.call(null, cljs.core.get.call(null, b, e))); }, c = function(b, c, d, e) { var f = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, f, a.call(null, cljs.core.get.call(null, b, f), c, d, e)) : cljs.core.assoc.call(null, b, f, d.call(null, cljs.core.get.call(null, b, f), e)) + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, f, a.call(null, cljs.core.get.call(null, b, f), c, d, e)) : cljs.core.assoc.call(null, b, f, d.call(null, cljs.core.get.call(null, b, f), e)); }, d = function(b, c, d, e, f) { var n = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, n, a.call(null, cljs.core.get.call(null, b, n), c, d, e, f)) : cljs.core.assoc.call(null, b, n, d.call(null, cljs.core.get.call(null, b, n), e, f)) + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, n, a.call(null, cljs.core.get.call(null, b, n), c, d, e, f)) : cljs.core.assoc.call(null, b, n, d.call(null, cljs.core.get.call(null, b, n), e, f)); }, e = function(b, c, d, e, f, n) { var p = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, p, a.call(null, cljs.core.get.call(null, b, p), c, d, e, f, n)) : cljs.core.assoc.call(null, b, p, d.call(null, cljs.core.get.call(null, b, p), e, f, n)) + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, p, a.call(null, cljs.core.get.call(null, b, p), c, d, e, f, n)) : cljs.core.assoc.call(null, b, p, d.call(null, cljs.core.get.call(null, b, p), e, f, n)); }, f = function() { var b = function(b, c, d, e, f, g, h) { var s = cljs.core.nth.call(null, c, 0, null); - return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, a, cljs.core.get.call(null, b, s), c, d, e, f, g, h)) : cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, d, cljs.core.get.call(null, b, s), e, f, g, h)) + return(c = cljs.core.nthnext.call(null, c, 1)) ? cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, a, cljs.core.get.call(null, b, s), c, d, e, f, g, h)) : cljs.core.assoc.call(null, b, s, cljs.core.apply.call(null, d, cljs.core.get.call(null, b, s), e, f, g, h)); }, c = function(a, c, d, e, f, h, r) { var s = null; 6 < arguments.length && (s = cljs.core.array_seq(Array.prototype.slice.call(arguments, 6), 0)); - return b.call(this, a, c, d, e, f, h, s) + return b.call(this, a, c, d, e, f, h, s); }; c.cljs$lang$maxFixedArity = 6; c.cljs$lang$applyTo = function(a) { @@ -8007,10 +8101,10 @@ cljs.core.update_in = function() { a = cljs.core.next(a); var r = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, f, h, r, a) + return b(c, d, e, f, h, r, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, h, k, l, m, n, p) { switch(arguments.length) { case 3: @@ -8022,7 +8116,7 @@ cljs.core.update_in = function() { case 6: return e.call(this, a, h, k, l, m, n); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, cljs.core.array_seq(arguments, 6)) + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, n, cljs.core.array_seq(arguments, 6)); } throw Error("Invalid arity: " + arguments.length); }; @@ -8033,93 +8127,93 @@ cljs.core.update_in = function() { a.cljs$core$IFn$_invoke$arity$5 = d; a.cljs$core$IFn$_invoke$arity$6 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.VectorNode = function(a, b) { this.edit = a; - this.arr = b + this.arr = b; }; cljs.core.VectorNode.cljs$lang$type = !0; cljs.core.VectorNode.cljs$lang$ctorStr = "cljs.core/VectorNode"; cljs.core.VectorNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/VectorNode") + return cljs.core._write.call(null, b, "cljs.core/VectorNode"); }; cljs.core.__GT_VectorNode = function(a, b) { - return new cljs.core.VectorNode(a, b) + return new cljs.core.VectorNode(a, b); }; cljs.core.pv_fresh_node = function(a) { - return new cljs.core.VectorNode(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]) + return new cljs.core.VectorNode(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); }; cljs.core.pv_aget = function(a, b) { - return a.arr[b] + return a.arr[b]; }; cljs.core.pv_aset = function(a, b, c) { - return a.arr[b] = c + return a.arr[b] = c; }; cljs.core.pv_clone_node = function(a) { - return new cljs.core.VectorNode(a.edit, cljs.core.aclone.call(null, a.arr)) + return new cljs.core.VectorNode(a.edit, cljs.core.aclone.call(null, a.arr)); }; cljs.core.tail_off = function(a) { a = a.cnt; - return 32 > a ? 0 : a - 1 >>> 5 << 5 + return 32 > a ? 0 : a - 1 >>> 5 << 5; }; cljs.core.new_path = function(a, b, c) { - for(;;) { - if(0 === b) { - return c + for (;;) { + if (0 === b) { + return c; } var d = cljs.core.pv_fresh_node.call(null, a); cljs.core.pv_aset.call(null, d, 0, c); c = d; - b -= 5 + b -= 5; } }; cljs.core.push_tail = function push_tail(b, c, d, e) { var f = cljs.core.pv_clone_node.call(null, d), g = b.cnt - 1 >>> c & 31; 5 === c ? cljs.core.pv_aset.call(null, f, g, e) : (d = cljs.core.pv_aget.call(null, d, g), b = null != d ? push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, null, c - 5, e), cljs.core.pv_aset.call(null, f, g, b)); - return f + return f; }; cljs.core.vector_index_out_of_bounds = function(a, b) { throw Error([cljs.core.str("No item "), cljs.core.str(a), cljs.core.str(" in vector of length "), cljs.core.str(b)].join("")); }; cljs.core.array_for = function(a, b) { - if(0 <= b && b < a.cnt) { - if(b >= cljs.core.tail_off.call(null, a)) { - return a.tail + if (0 <= b && b < a.cnt) { + if (b >= cljs.core.tail_off.call(null, a)) { + return a.tail; } - for(var c = a.root, d = a.shift;;) { - if(0 < d) { - c = cljs.core.pv_aget.call(null, c, b >>> d & 31), d -= 5 - }else { - return c.arr + for (var c = a.root, d = a.shift;;) { + if (0 < d) { + c = cljs.core.pv_aget.call(null, c, b >>> d & 31), d -= 5; + } else { + return c.arr; } } - }else { - return cljs.core.vector_index_out_of_bounds.call(null, b, a.cnt) + } else { + return cljs.core.vector_index_out_of_bounds.call(null, b, a.cnt); } }; cljs.core.do_assoc = function do_assoc(b, c, d, e, f) { var g = cljs.core.pv_clone_node.call(null, d); - if(0 === c) { - cljs.core.pv_aset.call(null, g, e & 31, f) - }else { + if (0 === c) { + cljs.core.pv_aset.call(null, g, e & 31, f); + } else { var h = e >>> c & 31; - cljs.core.pv_aset.call(null, g, h, do_assoc.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, h), e, f)) + cljs.core.pv_aset.call(null, g, h, do_assoc.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, h), e, f)); } - return g + return g; }; cljs.core.pop_tail = function pop_tail(b, c, d) { var e = b.cnt - 2 >>> c & 31; - if(5 < c) { + if (5 < c) { b = pop_tail.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, e)); - if(null == b && 0 === e) { - return null + if (null == b && 0 === e) { + return null; } d = cljs.core.pv_clone_node.call(null, d); cljs.core.pv_aset.call(null, d, e, b); - return d + return d; } - return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = cljs.core.pv_clone_node.call(null, d), cljs.core.pv_aset.call(null, d, e, null), d) : null + return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = cljs.core.pv_clone_node.call(null, d), cljs.core.pv_aset.call(null, d, e, null), d) : null; }; cljs.core.PersistentVector = function(a, b, c, d, e, f) { this.meta = a; @@ -8129,37 +8223,37 @@ cljs.core.PersistentVector = function(a, b, c, d, e, f) { this.tail = e; this.__hash = f; this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 167668511 + this.cljs$lang$protocol_mask$partition0$ = 167668511; }; cljs.core.PersistentVector.cljs$lang$type = !0; cljs.core.PersistentVector.cljs$lang$ctorStr = "cljs.core/PersistentVector"; cljs.core.PersistentVector.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentVector") + return cljs.core._write.call(null, b, "cljs.core/PersistentVector"); }; cljs.core.PersistentVector.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientVector(this.cnt, this.shift, cljs.core.tv_editable_root.call(null, this.root), cljs.core.tv_editable_tail.call(null, this.tail)) + return new cljs.core.TransientVector(this.cnt, this.shift, cljs.core.tv_editable_root.call(null, this.root), cljs.core.tv_editable_tail.call(null, this.tail)); }; cljs.core.PersistentVector.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.PersistentVector.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._nth.call(null, this, b, null); }; cljs.core.PersistentVector.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) + return cljs.core._nth.call(null, this, b, c); }; cljs.core.PersistentVector.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if(0 <= b && b < this.cnt) { - return cljs.core.tail_off.call(null, this) <= b ? (a = cljs.core.aclone.call(null, this.tail), a[b & 31] = c, new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, a, null)) : new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, cljs.core.do_assoc.call(null, this, this.shift, this.root, b, c), this.tail, null) + if (0 <= b && b < this.cnt) { + return cljs.core.tail_off.call(null, this) <= b ? (a = cljs.core.aclone.call(null, this.tail), a[b & 31] = c, new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, a, null)) : new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, cljs.core.do_assoc.call(null, this, this.shift, this.root, b, c), this.tail, null); } - if(b === this.cnt) { - return cljs.core._conj.call(null, this, c) + if (b === this.cnt) { + return cljs.core._conj.call(null, this, c); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds [0,"), cljs.core.str(this.cnt), cljs.core.str("]")].join("")); } - return null + return null; }; cljs.core.PersistentVector.prototype.call = function() { var a = null; @@ -8168,168 +8262,172 @@ cljs.core.PersistentVector.prototype.call = function() { case 2: return this.cljs$core$IIndexed$_nth$arity$2(null, c); case 3: - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d) + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.PersistentVector.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$IIndexed$_nth$arity$2(null, a) + return this.cljs$core$IIndexed$_nth$arity$2(null, a); }; cljs.core.PersistentVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$IIndexed$_nth$arity$3(null, a, b) + return this.cljs$core$IIndexed$_nth$arity$3(null, a, b); }; cljs.core.PersistentVector.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { a = [0, c]; - for(c = 0;;) { - if(c < this.cnt) { + for (c = 0;;) { + if (c < this.cnt) { var d = cljs.core.array_for.call(null, this, c), e = d.length; a: { - for(var f = 0, g = a[1];;) { - if(f < e) { - if(g = b.call(null, g, f + c, d[f]), cljs.core.reduced_QMARK_.call(null, g)) { + for (var f = 0, g = a[1];;) { + if (f < e) { + if (g = b.call(null, g, f + c, d[f]), cljs.core.reduced_QMARK_.call(null, g)) { d = g; - break a - }else { - f += 1 + break a; + } else { + f += 1; } - }else { + } else { a[0] = e; d = a[1] = g; - break a + break a; } } - d = void 0 + d = void 0; } - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d); } - c += a[0] - }else { - return a[1] + c += a[0]; + } else { + return a[1]; } } }; cljs.core.PersistentVector.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - if(32 > this.cnt - cljs.core.tail_off.call(null, this)) { - for(var c = this.tail.length, d = Array(c + 1), e = 0;;) { - if(e < c) { - d[e] = this.tail[e], e += 1 - }else { - break + if (32 > this.cnt - cljs.core.tail_off.call(null, this)) { + for (var c = this.tail.length, d = Array(c + 1), e = 0;;) { + if (e < c) { + d[e] = this.tail[e], e += 1; + } else { + break; } } d[c] = b; - return new cljs.core.PersistentVector(this.meta, this.cnt + 1, this.shift, this.root, d, null) + return new cljs.core.PersistentVector(this.meta, this.cnt + 1, this.shift, this.root, d, null); } c = (d = this.cnt >>> 5 > 1 << this.shift) ? this.shift + 5 : this.shift; d ? (d = cljs.core.pv_fresh_node.call(null, null), cljs.core.pv_aset.call(null, d, 0, this.root), cljs.core.pv_aset.call(null, d, 1, cljs.core.new_path.call(null, null, this.shift, new cljs.core.VectorNode(null, this.tail)))) : d = cljs.core.push_tail.call(null, this, this.shift, this.root, new cljs.core.VectorNode(null, this.tail)); - return new cljs.core.PersistentVector(this.meta, this.cnt + 1, c, d, [b], null) + return new cljs.core.PersistentVector(this.meta, this.cnt + 1, c, d, [b], null); }; cljs.core.PersistentVector.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < this.cnt ? new cljs.core.RSeq(this, this.cnt - 1, null) : null + return 0 < this.cnt ? new cljs.core.RSeq(this, this.cnt - 1, null) : null; }; cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return cljs.core._nth.call(null, this, 0) + return cljs.core._nth.call(null, this, 0); }; cljs.core.PersistentVector.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return cljs.core._nth.call(null, this, 1) + return cljs.core._nth.call(null, this, 1); }; cljs.core.PersistentVector.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) + return cljs.core.ci_reduce.call(null, this, b); }; cljs.core.PersistentVector.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) + return cljs.core.ci_reduce.call(null, this, b, c); }; cljs.core.PersistentVector.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 === this.cnt ? null : 32 > this.cnt ? cljs.core.array_seq.call(null, this.tail) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.chunked_seq.call(null, this, 0, 0) : null + return 0 === this.cnt ? null : 32 > this.cnt ? cljs.core.array_seq.call(null, this.tail) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.chunked_seq.call(null, this, 0, 0) : null; }; cljs.core.PersistentVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt + return this.cnt; }; cljs.core.PersistentVector.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core._nth.call(null, this, this.cnt - 1) : null + return 0 < this.cnt ? cljs.core._nth.call(null, this, this.cnt - 1) : null; }; cljs.core.PersistentVector.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - if(0 === this.cnt) { + if (0 === this.cnt) { throw Error("Can't pop empty vector"); } - if(1 === this.cnt) { - return cljs.core._with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) + if (1 === this.cnt) { + return cljs.core._with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta); } - if(1 < this.cnt - cljs.core.tail_off.call(null, this)) { - return new cljs.core.PersistentVector(this.meta, this.cnt - 1, this.shift, this.root, this.tail.slice(0, -1), null) + if (1 < this.cnt - cljs.core.tail_off.call(null, this)) { + return new cljs.core.PersistentVector(this.meta, this.cnt - 1, this.shift, this.root, this.tail.slice(0, -1), null); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { a = cljs.core.array_for.call(null, this, this.cnt - 2); var b = cljs.core.pop_tail.call(null, this, this.shift, this.root), b = null == b ? cljs.core.PersistentVector.EMPTY_NODE : b, c = this.cnt - 1; - return 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? new cljs.core.PersistentVector(this.meta, c, this.shift - 5, cljs.core.pv_aget.call(null, b, 0), a, null) : new cljs.core.PersistentVector(this.meta, c, this.shift, b, a, null) + return 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? new cljs.core.PersistentVector(this.meta, c, this.shift - 5, cljs.core.pv_aget.call(null, b, 0), a, null) : new cljs.core.PersistentVector(this.meta, c, this.shift, b, a, null); } - return null + return null; }; cljs.core.PersistentVector.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return cljs.core._assoc.call(null, this, b, c) + return cljs.core._assoc.call(null, this, b, c); }; cljs.core.PersistentVector.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.PersistentVector.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(b, this.cnt, this.shift, this.root, this.tail, this.__hash) + return new cljs.core.PersistentVector(b, this.cnt, this.shift, this.root, this.tail, this.__hash); +}; +cljs.core.PersistentVector.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentVector.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentVector(this.meta, this.cnt, this.shift, this.root, this.tail, this.__hash); }; cljs.core.PersistentVector.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return cljs.core.array_for.call(null, this, b)[b & 31] + return cljs.core.array_for.call(null, this, b)[b & 31]; }; cljs.core.PersistentVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c + return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c; }; cljs.core.PersistentVector.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta); }; cljs.core.__GT_PersistentVector = function(a, b, c, d, e, f) { - return new cljs.core.PersistentVector(a, b, c, d, e, f) + return new cljs.core.PersistentVector(a, b, c, d, e, f); }; cljs.core.PersistentVector.EMPTY_NODE = new cljs.core.VectorNode(null, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); cljs.core.PersistentVector.EMPTY = new cljs.core.PersistentVector(null, 0, 5, cljs.core.PersistentVector.EMPTY_NODE, [], 0); cljs.core.PersistentVector.fromArray = function(a, b) { var c = a.length, d = b ? a : cljs.core.aclone.call(null, a); - if(32 > c) { - return new cljs.core.PersistentVector(null, c, 5, cljs.core.PersistentVector.EMPTY_NODE, d, null) + if (32 > c) { + return new cljs.core.PersistentVector(null, c, 5, cljs.core.PersistentVector.EMPTY_NODE, d, null); } - for(var e = d.slice(0, 32), f = new cljs.core.PersistentVector(null, 32, 5, cljs.core.PersistentVector.EMPTY_NODE, e, null), e = 32, g = cljs.core._as_transient.call(null, f);;) { - if(e < c) { - f = e + 1, g = cljs.core.conj_BANG_.call(null, g, d[e]), e = f - }else { - return cljs.core.persistent_BANG_.call(null, g) + for (var e = d.slice(0, 32), f = new cljs.core.PersistentVector(null, 32, 5, cljs.core.PersistentVector.EMPTY_NODE, e, null), e = 32, g = cljs.core._as_transient.call(null, f);;) { + if (e < c) { + f = e + 1, g = cljs.core.conj_BANG_.call(null, g, d[e]), e = f; + } else { + return cljs.core.persistent_BANG_.call(null, g); } } }; cljs.core.vec = function(a) { - return cljs.core._persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core._as_transient.call(null, cljs.core.PersistentVector.EMPTY), a)) + return cljs.core._persistent_BANG_.call(null, cljs.core.reduce.call(null, cljs.core._conj_BANG_, cljs.core._as_transient.call(null, cljs.core.PersistentVector.EMPTY), a)); }; cljs.core.vector = function() { var a = function(a) { - return a instanceof cljs.core.IndexedSeq ? cljs.core.PersistentVector.fromArray.call(null, a.arr, !0) : cljs.core.vec.call(null, a) + return a instanceof cljs.core.IndexedSeq && 0 === a.i ? cljs.core.PersistentVector.fromArray.call(null, a.arr, !0) : cljs.core.vec.call(null, a); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.ChunkedSeq = function(a, b, c, d, e, f) { this.vec = a; @@ -8339,76 +8437,76 @@ cljs.core.ChunkedSeq = function(a, b, c, d, e, f) { this.meta = e; this.__hash = f; this.cljs$lang$protocol_mask$partition0$ = 32243948; - this.cljs$lang$protocol_mask$partition1$ = 1536 + this.cljs$lang$protocol_mask$partition1$ = 1536; }; cljs.core.ChunkedSeq.cljs$lang$type = !0; cljs.core.ChunkedSeq.cljs$lang$ctorStr = "cljs.core/ChunkedSeq"; cljs.core.ChunkedSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ChunkedSeq") + return cljs.core._write.call(null, b, "cljs.core/ChunkedSeq"); }; cljs.core.ChunkedSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.ChunkedSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? null : a) : cljs.core._chunked_next.call(null, this) + return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? null : a) : cljs.core._chunked_next.call(null, this); }; cljs.core.ChunkedSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.ChunkedSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.ChunkedSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b) + return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b); }; cljs.core.ChunkedSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b, c) + return cljs.core.ci_reduce.call(null, cljs.core.subvec.call(null, this.vec, this.i + this.off, cljs.core.count.call(null, this.vec)), b, c); }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.node[this.off] + return this.node[this.off]; }; cljs.core.ChunkedSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? cljs.core.List.EMPTY : a) : cljs.core._chunked_rest.call(null, this) + return this.off + 1 < this.node.length ? (a = cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off + 1), null == a ? cljs.core.List.EMPTY : a) : cljs.core._chunked_rest.call(null, this); }; cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedNext$_chunked_next$arity$1 = function(a) { a = this.node.length; a = this.i + a < cljs.core._count.call(null, this.vec) ? cljs.core.chunked_seq.call(null, this.vec, this.i + a, 0) : null; - return null == a ? null : a + return null == a ? null : a; }; cljs.core.ChunkedSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off, b) + return cljs.core.chunked_seq.call(null, this.vec, this.node, this.i, this.off, b); }; cljs.core.ChunkedSeq.prototype.cljs$core$IWithMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.ChunkedSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta); }; cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_first$arity$1 = function(a) { - return cljs.core.array_chunk.call(null, this.node, this.off) + return cljs.core.array_chunk.call(null, this.node, this.off); }; cljs.core.ChunkedSeq.prototype.cljs$core$IChunkedSeq$_chunked_rest$arity$1 = function(a) { a = this.node.length; a = this.i + a < cljs.core._count.call(null, this.vec) ? cljs.core.chunked_seq.call(null, this.vec, this.i + a, 0) : null; - return null == a ? cljs.core.List.EMPTY : a + return null == a ? cljs.core.List.EMPTY : a; }; cljs.core.__GT_ChunkedSeq = function(a, b, c, d, e, f) { - return new cljs.core.ChunkedSeq(a, b, c, d, e, f) + return new cljs.core.ChunkedSeq(a, b, c, d, e, f); }; cljs.core.chunked_seq = function() { var a = null, b = function(a, b, c) { - return new cljs.core.ChunkedSeq(a, cljs.core.array_for.call(null, a, b), b, c, null, null) + return new cljs.core.ChunkedSeq(a, cljs.core.array_for.call(null, a, b), b, c, null, null); }, c = function(a, b, c, d) { - return new cljs.core.ChunkedSeq(a, b, c, d, null, null) + return new cljs.core.ChunkedSeq(a, b, c, d, null, null); }, d = function(a, b, c, d, k) { - return new cljs.core.ChunkedSeq(a, b, c, d, k, null) + return new cljs.core.ChunkedSeq(a, b, c, d, k, null); }, a = function(a, f, g, h, k) { switch(arguments.length) { case 3: @@ -8416,14 +8514,14 @@ cljs.core.chunked_seq = function() { case 4: return c.call(this, a, f, g, h); case 5: - return d.call(this, a, f, g, h, k) + return d.call(this, a, f, g, h, k); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$4 = c; a.cljs$core$IFn$_invoke$arity$5 = d; - return a + return a; }(); cljs.core.Subvec = function(a, b, c, d, e) { this.meta = a; @@ -8432,29 +8530,29 @@ cljs.core.Subvec = function(a, b, c, d, e) { this.end = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32400159 + this.cljs$lang$protocol_mask$partition0$ = 32400159; }; cljs.core.Subvec.cljs$lang$type = !0; cljs.core.Subvec.cljs$lang$ctorStr = "cljs.core/Subvec"; cljs.core.Subvec.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Subvec") + return cljs.core._write.call(null, b, "cljs.core/Subvec"); }; cljs.core.Subvec.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.Subvec.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._nth.call(null, this, b, null); }; cljs.core.Subvec.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) + return cljs.core._nth.call(null, this, b, c); }; cljs.core.Subvec.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { var d = this, e = d.start + b; return cljs.core.build_subvec.call(null, d.meta, cljs.core.assoc.call(null, d.v, e, c), d.start, function() { var a = d.end, b = e + 1; - return a > b ? a : b - }(), null) + return a > b ? a : b; + }(), null); }; cljs.core.Subvec.prototype.call = function() { var a = null; @@ -8463,152 +8561,156 @@ cljs.core.Subvec.prototype.call = function() { case 2: return this.cljs$core$IIndexed$_nth$arity$2(null, c); case 3: - return this.cljs$core$IIndexed$_nth$arity$3(null, c, d) + return this.cljs$core$IIndexed$_nth$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.Subvec.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$IIndexed$_nth$arity$2(null, a) + return this.cljs$core$IIndexed$_nth$arity$2(null, a); }; cljs.core.Subvec.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$IIndexed$_nth$arity$3(null, a, b) + return this.cljs$core$IIndexed$_nth$arity$3(null, a, b); }; cljs.core.Subvec.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.build_subvec.call(null, this.meta, cljs.core._assoc_n.call(null, this.v, this.end, b), this.start, this.end + 1, null) + return cljs.core.build_subvec.call(null, this.meta, cljs.core._assoc_n.call(null, this.v, this.end, b), this.start, this.end + 1, null); }; cljs.core.Subvec.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) + return cljs.core.ci_reduce.call(null, this, b); }; cljs.core.Subvec.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) + return cljs.core.ci_reduce.call(null, this, b, c); }; cljs.core.Subvec.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { var b = this; return function d(a) { return a === b.end ? null : cljs.core.cons.call(null, cljs.core._nth.call(null, b.v, a), new cljs.core.LazySeq(null, function() { - return d.call(null, a + 1) - }, null, null)) - }.call(null, b.start) + return d.call(null, a + 1); + }, null, null)); + }.call(null, b.start); }; cljs.core.Subvec.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.end - this.start + return this.end - this.start; }; cljs.core.Subvec.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return cljs.core._nth.call(null, this.v, this.end - 1) + return cljs.core._nth.call(null, this.v, this.end - 1); }; cljs.core.Subvec.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - if(this.start === this.end) { + if (this.start === this.end) { throw Error("Can't pop empty vector"); } - return cljs.core.build_subvec.call(null, this.meta, this.v, this.start, this.end - 1, null) + return cljs.core.build_subvec.call(null, this.meta, this.v, this.start, this.end - 1, null); }; cljs.core.Subvec.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return cljs.core._assoc.call(null, this, b, c) + return cljs.core._assoc.call(null, this, b, c); }; cljs.core.Subvec.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.Subvec.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.build_subvec.call(null, b, this.v, this.start, this.end, this.__hash) + return cljs.core.build_subvec.call(null, b, this.v, this.start, this.end, this.__hash); +}; +cljs.core.Subvec.prototype.cljs$core$ICloneable$ = !0; +cljs.core.Subvec.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Subvec(this.meta, this.v, this.start, this.end, this.__hash); }; cljs.core.Subvec.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - return 0 > b || this.end <= this.start + b ? cljs.core.vector_index_out_of_bounds.call(null, b, this.end - this.start) : cljs.core._nth.call(null, this.v, this.start + b) + return 0 > b || this.end <= this.start + b ? cljs.core.vector_index_out_of_bounds.call(null, b, this.end - this.start) : cljs.core._nth.call(null, this.v, this.start + b); }; cljs.core.Subvec.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 > b || this.end <= this.start + b ? c : cljs.core._nth.call(null, this.v, this.start + b, c) + return 0 > b || this.end <= this.start + b ? c : cljs.core._nth.call(null, this.v, this.start + b, c); }; cljs.core.Subvec.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.PersistentVector.EMPTY, this.meta); }; cljs.core.__GT_Subvec = function(a, b, c, d, e) { - return new cljs.core.Subvec(a, b, c, d, e) + return new cljs.core.Subvec(a, b, c, d, e); }; cljs.core.build_subvec = function(a, b, c, d, e) { - for(;;) { - if(b instanceof cljs.core.Subvec) { - c = b.start + c, d = b.start + d, b = b.v - }else { + for (;;) { + if (b instanceof cljs.core.Subvec) { + c = b.start + c, d = b.start + d, b = b.v; + } else { var f = cljs.core.count.call(null, b); - if(0 > c || 0 > d || c > f || d > f) { + if (0 > c || 0 > d || c > f || d > f) { throw Error("Index out of bounds"); } - return new cljs.core.Subvec(a, b, c, d, e) + return new cljs.core.Subvec(a, b, c, d, e); } } }; cljs.core.subvec = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, cljs.core.count.call(null, b)) + return a.call(null, b, c, cljs.core.count.call(null, b)); }, c = function(a, b, c) { - return cljs.core.build_subvec.call(null, null, a, b, c, null) + return cljs.core.build_subvec.call(null, null, a, b, c, null); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.tv_ensure_editable = function(a, b) { - return a === b.edit ? b : new cljs.core.VectorNode(a, cljs.core.aclone.call(null, b.arr)) + return a === b.edit ? b : new cljs.core.VectorNode(a, cljs.core.aclone.call(null, b.arr)); }; cljs.core.tv_editable_root = function(a) { - return new cljs.core.VectorNode({}, cljs.core.aclone.call(null, a.arr)) + return new cljs.core.VectorNode({}, cljs.core.aclone.call(null, a.arr)); }; cljs.core.tv_editable_tail = function(a) { var b = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; cljs.core.array_copy.call(null, a, 0, b, 0, a.length); - return b + return b; }; cljs.core.tv_push_tail = function tv_push_tail(b, c, d, e) { var f = cljs.core.tv_ensure_editable.call(null, b.root.edit, d), g = b.cnt - 1 >>> c & 31; cljs.core.pv_aset.call(null, f, g, 5 === c ? e : function() { var d = cljs.core.pv_aget.call(null, f, g); - return null != d ? tv_push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, b.root.edit, c - 5, e) + return null != d ? tv_push_tail.call(null, b, c - 5, d, e) : cljs.core.new_path.call(null, b.root.edit, c - 5, e); }()); - return f + return f; }; cljs.core.tv_pop_tail = function tv_pop_tail(b, c, d) { d = cljs.core.tv_ensure_editable.call(null, b.root.edit, d); var e = b.cnt - 2 >>> c & 31; - if(5 < c) { + if (5 < c) { b = tv_pop_tail.call(null, b, c - 5, cljs.core.pv_aget.call(null, d, e)); - if(null == b && 0 === e) { - return null + if (null == b && 0 === e) { + return null; } cljs.core.pv_aset.call(null, d, e, b); - return d + return d; } - return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (cljs.core.pv_aset.call(null, d, e, null), d) : null + return 0 === e ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (cljs.core.pv_aset.call(null, d, e, null), d) : null; }; cljs.core.editable_array_for = function(a, b) { - if(0 <= b && b < a.cnt) { - if(b >= cljs.core.tail_off.call(null, a)) { - return a.tail + if (0 <= b && b < a.cnt) { + if (b >= cljs.core.tail_off.call(null, a)) { + return a.tail; } - for(var c = a.root, d = c, e = a.shift;;) { - if(0 < e) { - d = cljs.core.tv_ensure_editable.call(null, c.edit, cljs.core.pv_aget.call(null, d, b >>> e & 31)), e -= 5 - }else { - return d.arr + for (var c = a.root, d = c, e = a.shift;;) { + if (0 < e) { + d = cljs.core.tv_ensure_editable.call(null, c.edit, cljs.core.pv_aget.call(null, d, b >>> e & 31)), e -= 5; + } else { + return d.arr; } } - }else { + } else { throw Error([cljs.core.str("No item "), cljs.core.str(b), cljs.core.str(" in transient vector of length "), cljs.core.str(a.cnt)].join("")); } }; @@ -8618,12 +8720,12 @@ cljs.core.TransientVector = function(a, b, c, d) { this.root = c; this.tail = d; this.cljs$lang$protocol_mask$partition0$ = 275; - this.cljs$lang$protocol_mask$partition1$ = 88 + this.cljs$lang$protocol_mask$partition1$ = 88; }; cljs.core.TransientVector.cljs$lang$type = !0; cljs.core.TransientVector.cljs$lang$ctorStr = "cljs.core/TransientVector"; cljs.core.TransientVector.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientVector") + return cljs.core._write.call(null, b, "cljs.core/TransientVector"); }; cljs.core.TransientVector.prototype.call = function() { var a = null; @@ -8632,78 +8734,78 @@ cljs.core.TransientVector.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.TransientVector.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.TransientVector.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.TransientVector.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.TransientVector.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._nth.call(null, this, b, null); }; cljs.core.TransientVector.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) + return cljs.core._nth.call(null, this, b, c); }; cljs.core.TransientVector.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(this.root.edit) { - return cljs.core.array_for.call(null, this, b)[b & 31] + if (this.root.edit) { + return cljs.core.array_for.call(null, this, b)[b & 31]; } throw Error("nth after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c + return 0 <= b && b < this.cnt ? cljs.core._nth.call(null, this, b) : c; }; cljs.core.TransientVector.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if(this.root.edit) { - return this.cnt + if (this.root.edit) { + return this.cnt; } throw Error("count after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_assoc_n_BANG_$arity$3 = function(a, b, c) { var d = this; - if(d.root.edit) { - if(0 <= b && b < d.cnt) { + if (d.root.edit) { + if (0 <= b && b < d.cnt) { return cljs.core.tail_off.call(null, this) <= b ? d.tail[b & 31] = c : (a = function f(a, h) { var k = cljs.core.tv_ensure_editable.call(null, d.root.edit, h); - if(0 === a) { - cljs.core.pv_aset.call(null, k, b & 31, c) - }else { + if (0 === a) { + cljs.core.pv_aset.call(null, k, b & 31, c); + } else { var l = b >>> a & 31; - cljs.core.pv_aset.call(null, k, l, f.call(null, a - 5, cljs.core.pv_aget.call(null, k, l))) + cljs.core.pv_aset.call(null, k, l, f.call(null, a - 5, cljs.core.pv_aget.call(null, k, l))); } - return k - }.call(null, d.shift, d.root), d.root = a), this + return k; + }.call(null, d.shift, d.root), d.root = a), this; } - if(b === d.cnt) { - return cljs.core._conj_BANG_.call(null, this, c) + if (b === d.cnt) { + return cljs.core._conj_BANG_.call(null, this, c); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error([cljs.core.str("Index "), cljs.core.str(b), cljs.core.str(" out of bounds for TransientVector of length"), cljs.core.str(d.cnt)].join("")); } - return null + return null; } throw Error("assoc! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_pop_BANG_$arity$1 = function(a) { - if(this.root.edit) { - if(0 === this.cnt) { + if (this.root.edit) { + if (0 === this.cnt) { throw Error("Can't pop empty vector"); } - if(1 === this.cnt) { - return this.cnt = 0, this + if (1 === this.cnt) { + return this.cnt = 0, this; } - if(0 < (this.cnt - 1 & 31)) { - return this.cnt -= 1, this + if (0 < (this.cnt - 1 & 31)) { + return this.cnt -= 1, this; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { a = cljs.core.editable_array_for.call(null, this, this.cnt - 2); var b; b = cljs.core.tv_pop_tail.call(null, this, this.shift, this.root); @@ -8711,50 +8813,50 @@ cljs.core.TransientVector.prototype.cljs$core$ITransientVector$_pop_BANG_$arity$ 5 < this.shift && null == cljs.core.pv_aget.call(null, b, 1) ? (this.root = cljs.core.tv_ensure_editable.call(null, this.root.edit, cljs.core.pv_aget.call(null, b, 0)), this.shift -= 5) : this.root = b; this.cnt -= 1; this.tail = a; - return this + return this; } - return null + return null; } throw Error("pop! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - return cljs.core._assoc_n_BANG_.call(null, this, b, c) + return cljs.core._assoc_n_BANG_.call(null, this, b, c); }; cljs.core.TransientVector.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - if(this.root.edit) { - if(32 > this.cnt - cljs.core.tail_off.call(null, this)) { - this.tail[this.cnt & 31] = b - }else { + if (this.root.edit) { + if (32 > this.cnt - cljs.core.tail_off.call(null, this)) { + this.tail[this.cnt & 31] = b; + } else { var c = new cljs.core.VectorNode(this.root.edit, this.tail), d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; d[0] = b; this.tail = d; - if(this.cnt >>> 5 > 1 << this.shift) { + if (this.cnt >>> 5 > 1 << this.shift) { var d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], e = this.shift + 5; d[0] = this.root; d[1] = cljs.core.new_path.call(null, this.root.edit, this.shift, c); this.root = new cljs.core.VectorNode(this.root.edit, d); - this.shift = e - }else { - this.root = cljs.core.tv_push_tail.call(null, this, this.shift, this.root, c) + this.shift = e; + } else { + this.root = cljs.core.tv_push_tail.call(null, this, this.shift, this.root, c); } } this.cnt += 1; - return this + return this; } throw Error("conj! after persistent!"); }; cljs.core.TransientVector.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - if(this.root.edit) { + if (this.root.edit) { this.root.edit = null; a = this.cnt - cljs.core.tail_off.call(null, this); var b = Array(a); cljs.core.array_copy.call(null, this.tail, 0, b, 0, a); - return new cljs.core.PersistentVector(null, this.cnt, this.shift, this.root, b, null) + return new cljs.core.PersistentVector(null, this.cnt, this.shift, this.root, b, null); } throw Error("persistent! called twice"); }; cljs.core.__GT_TransientVector = function(a, b, c, d) { - return new cljs.core.TransientVector(a, b, c, d) + return new cljs.core.TransientVector(a, b, c, d); }; cljs.core.PersistentQueueSeq = function(a, b, c, d) { this.meta = a; @@ -8762,46 +8864,46 @@ cljs.core.PersistentQueueSeq = function(a, b, c, d) { this.rear = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 31850572 + this.cljs$lang$protocol_mask$partition0$ = 31850572; }; cljs.core.PersistentQueueSeq.cljs$lang$type = !0; cljs.core.PersistentQueueSeq.cljs$lang$ctorStr = "cljs.core/PersistentQueueSeq"; cljs.core.PersistentQueueSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentQueueSeq") + return cljs.core._write.call(null, b, "cljs.core/PersistentQueueSeq"); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.PersistentQueueSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first.call(null, this.front) + return cljs.core.first.call(null, this.front); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return(a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueueSeq(this.meta, a, this.rear, null) : null == this.rear ? cljs.core._empty.call(null, this) : new cljs.core.PersistentQueueSeq(this.meta, this.rear, null, null) + return(a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueueSeq(this.meta, a, this.rear, null) : null == this.rear ? cljs.core._empty.call(null, this) : new cljs.core.PersistentQueueSeq(this.meta, this.rear, null, null); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentQueueSeq(b, this.front, this.rear, this.__hash) + return new cljs.core.PersistentQueueSeq(b, this.front, this.rear, this.__hash); }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentQueueSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_PersistentQueueSeq = function(a, b, c, d) { - return new cljs.core.PersistentQueueSeq(a, b, c, d) + return new cljs.core.PersistentQueueSeq(a, b, c, d); }; cljs.core.PersistentQueue = function(a, b, c, d, e) { this.meta = a; @@ -8810,126 +8912,130 @@ cljs.core.PersistentQueue = function(a, b, c, d, e) { this.rear = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 31858766 + this.cljs$lang$protocol_mask$partition0$ = 31858766; }; cljs.core.PersistentQueue.cljs$lang$type = !0; cljs.core.PersistentQueue.cljs$lang$ctorStr = "cljs.core/PersistentQueue"; cljs.core.PersistentQueue.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentQueue") + return cljs.core._write.call(null, b, "cljs.core/PersistentQueue"); }; cljs.core.PersistentQueue.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.PersistentQueue.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { var c = this; return cljs.core.truth_(c.front) ? new cljs.core.PersistentQueue(c.meta, c.count + 1, c.front, cljs.core.conj.call(null, function() { var a = c.rear; - return cljs.core.truth_(a) ? a : cljs.core.PersistentVector.EMPTY - }(), b), null) : new cljs.core.PersistentQueue(c.meta, c.count + 1, cljs.core.conj.call(null, c.front, b), cljs.core.PersistentVector.EMPTY, null) + return cljs.core.truth_(a) ? a : cljs.core.PersistentVector.EMPTY; + }(), b), null) : new cljs.core.PersistentQueue(c.meta, c.count + 1, cljs.core.conj.call(null, c.front, b), cljs.core.PersistentVector.EMPTY, null); }; cljs.core.PersistentQueue.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentQueue.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { var b = this, c = cljs.core.seq.call(null, b.rear); return cljs.core.truth_(function() { var a = b.front; - return cljs.core.truth_(a) ? a : c - }()) ? new cljs.core.PersistentQueueSeq(null, b.front, cljs.core.seq.call(null, c), null) : null + return cljs.core.truth_(a) ? a : c; + }()) ? new cljs.core.PersistentQueueSeq(null, b.front, cljs.core.seq.call(null, c), null) : null; }; cljs.core.PersistentQueue.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.count + return this.count; }; cljs.core.PersistentQueue.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return cljs.core.first.call(null, this.front) + return cljs.core.first.call(null, this.front); }; cljs.core.PersistentQueue.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return cljs.core.truth_(this.front) ? (a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueue(this.meta, this.count - 1, a, this.rear, null) : new cljs.core.PersistentQueue(this.meta, this.count - 1, cljs.core.seq.call(null, this.rear), cljs.core.PersistentVector.EMPTY, null) : this + return cljs.core.truth_(this.front) ? (a = cljs.core.next.call(null, this.front)) ? new cljs.core.PersistentQueue(this.meta, this.count - 1, a, this.rear, null) : new cljs.core.PersistentQueue(this.meta, this.count - 1, cljs.core.seq.call(null, this.rear), cljs.core.PersistentVector.EMPTY, null) : this; }; cljs.core.PersistentQueue.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first.call(null, this.front) + return cljs.core.first.call(null, this.front); }; cljs.core.PersistentQueue.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.rest.call(null, cljs.core.seq.call(null, this)) + return cljs.core.rest.call(null, cljs.core.seq.call(null, this)); }; cljs.core.PersistentQueue.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.PersistentQueue.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentQueue(b, this.count, this.front, this.rear, this.__hash) + return new cljs.core.PersistentQueue(b, this.count, this.front, this.rear, this.__hash); +}; +cljs.core.PersistentQueue.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentQueue.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentQueue(this.meta, this.count, this.front, this.rear, this.__hash); }; cljs.core.PersistentQueue.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentQueue.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentQueue.EMPTY + return cljs.core.PersistentQueue.EMPTY; }; cljs.core.__GT_PersistentQueue = function(a, b, c, d, e) { - return new cljs.core.PersistentQueue(a, b, c, d, e) + return new cljs.core.PersistentQueue(a, b, c, d, e); }; cljs.core.PersistentQueue.EMPTY = new cljs.core.PersistentQueue(null, 0, null, cljs.core.PersistentVector.EMPTY, 0); cljs.core.NeverEquiv = function() { this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2097152 + this.cljs$lang$protocol_mask$partition0$ = 2097152; }; cljs.core.NeverEquiv.cljs$lang$type = !0; cljs.core.NeverEquiv.cljs$lang$ctorStr = "cljs.core/NeverEquiv"; cljs.core.NeverEquiv.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/NeverEquiv") + return cljs.core._write.call(null, b, "cljs.core/NeverEquiv"); }; cljs.core.NeverEquiv.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return!1 + return!1; }; cljs.core.__GT_NeverEquiv = function() { - return new cljs.core.NeverEquiv + return new cljs.core.NeverEquiv; }; cljs.core.never_equiv = new cljs.core.NeverEquiv; cljs.core.equiv_map = function(a, b) { return cljs.core.boolean$.call(null, cljs.core.map_QMARK_.call(null, b) ? cljs.core.count.call(null, a) === cljs.core.count.call(null, b) ? cljs.core.every_QMARK_.call(null, cljs.core.identity, cljs.core.map.call(null, function(a) { - return cljs.core._EQ_.call(null, cljs.core.get.call(null, b, cljs.core.first.call(null, a), cljs.core.never_equiv), cljs.core.second.call(null, a)) - }, a)) : null : null) + return cljs.core._EQ_.call(null, cljs.core.get.call(null, b, cljs.core.first.call(null, a), cljs.core.never_equiv), cljs.core.second.call(null, a)); + }, a)) : null : null); }; cljs.core.scan_array = function(a, b, c) { - for(var d = c.length, e = 0;;) { - if(e < d) { - if(b === c[e]) { - return e + for (var d = c.length, e = 0;;) { + if (e < d) { + if (b === c[e]) { + return e; } - e += a - }else { - return null + e += a; + } else { + return null; } } }; cljs.core.obj_map_compare_keys = function(a, b) { var c = cljs.core.hash.call(null, a), d = cljs.core.hash.call(null, b); - return c < d ? -1 : c > d ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null + return c < d ? -1 : c > d ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null; }; cljs.core.obj_map__GT_hash_map = function(a, b, c) { var d = a.keys, e = d.length, f = a.strobj; a = cljs.core.meta.call(null, a); - for(var g = 0, h = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { - if(g < e) { + for (var g = 0, h = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { + if (g < e) { var k = d[g], g = g + 1, h = cljs.core.assoc_BANG_.call(null, h, k, f[k]) - }else { - return cljs.core.with_meta.call(null, cljs.core.persistent_BANG_.call(null, cljs.core.assoc_BANG_.call(null, h, b, c)), a) + } else { + return cljs.core.with_meta.call(null, cljs.core.persistent_BANG_.call(null, cljs.core.assoc_BANG_.call(null, h, b, c)), a); } } }; cljs.core.obj_clone = function(a, b) { var c; c = {}; - for(var d = b.length, e = 0;;) { - if(e < d) { + for (var d = b.length, e = 0;;) { + if (e < d) { var f = b[e]; c[f] = a[f]; - e += 1 - }else { - break + e += 1; + } else { + break; } } - return c + return c; }; cljs.core.ObjMap = function(a, b, c, d, e) { this.meta = a; @@ -8938,44 +9044,44 @@ cljs.core.ObjMap = function(a, b, c, d, e) { this.update_count = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 16123663 + this.cljs$lang$protocol_mask$partition0$ = 16123663; }; cljs.core.ObjMap.cljs$lang$type = !0; cljs.core.ObjMap.cljs$lang$ctorStr = "cljs.core/ObjMap"; cljs.core.ObjMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ObjMap") + return cljs.core._write.call(null, b, "cljs.core/ObjMap"); }; cljs.core.ObjMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return cljs.core.transient$.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this)) + return cljs.core.transient$.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this)); }; cljs.core.ObjMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this); }; cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.ObjMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? this.strobj[b] : c + return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? this.strobj[b] : c; }; cljs.core.ObjMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if(goog.isString(b)) { - if(this.update_count > cljs.core.ObjMap.HASHMAP_THRESHOLD || this.keys.length >= cljs.core.ObjMap.HASHMAP_THRESHOLD) { - return cljs.core.obj_map__GT_hash_map.call(null, this, b, c) + if (goog.isString(b)) { + if (this.update_count > cljs.core.ObjMap.HASHMAP_THRESHOLD || this.keys.length >= cljs.core.ObjMap.HASHMAP_THRESHOLD) { + return cljs.core.obj_map__GT_hash_map.call(null, this, b, c); } - if(null != cljs.core.scan_array.call(null, 1, b, this.keys)) { - return a = cljs.core.obj_clone.call(null, this.strobj, this.keys), a[b] = c, new cljs.core.ObjMap(this.meta, this.keys, a, this.update_count + 1, null) + if (null != cljs.core.scan_array.call(null, 1, b, this.keys)) { + return a = cljs.core.obj_clone.call(null, this.strobj, this.keys), a[b] = c, new cljs.core.ObjMap(this.meta, this.keys, a, this.update_count + 1, null); } a = cljs.core.obj_clone.call(null, this.strobj, this.keys); var d = cljs.core.aclone.call(null, this.keys); a[b] = c; d.push(b); - return new cljs.core.ObjMap(this.meta, d, a, this.update_count + 1, null) + return new cljs.core.ObjMap(this.meta, d, a, this.update_count + 1, null); } - return cljs.core.obj_map__GT_hash_map.call(null, this, b, c) + return cljs.core.obj_map__GT_hash_map.call(null, this, b, c); }; cljs.core.ObjMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? !0 : !1 + return goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys) ? !0 : !1; }; cljs.core.ObjMap.prototype.call = function() { var a = null; @@ -8984,241 +9090,241 @@ cljs.core.ObjMap.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.ObjMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.ObjMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.ObjMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.ObjMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - for(a = this.keys.sort(cljs.core.obj_map_compare_keys);;) { - if(cljs.core.seq.call(null, a)) { + for (a = this.keys.sort(cljs.core.obj_map_compare_keys);;) { + if (cljs.core.seq.call(null, a)) { var d = cljs.core.first.call(null, a); c = b.call(null, c, d, this.strobj[d]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - a = cljs.core.rest.call(null, a) - }else { - return c + a = cljs.core.rest.call(null, a); + } else { + return c; } } }; cljs.core.ObjMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b); }; cljs.core.ObjMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.ObjMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { var b = this; return 0 < b.keys.length ? cljs.core.map.call(null, function(a) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, b.strobj[a]], null) - }, b.keys.sort(cljs.core.obj_map_compare_keys)) : null + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, b.strobj[a]], null); + }, b.keys.sort(cljs.core.obj_map_compare_keys)) : null; }; cljs.core.ObjMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.keys.length + return this.keys.length; }; cljs.core.ObjMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) + return cljs.core.equiv_map.call(null, this, b); }; cljs.core.ObjMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ObjMap(b, this.keys, this.strobj, this.update_count, this.__hash) + return new cljs.core.ObjMap(b, this.keys, this.strobj, this.update_count, this.__hash); }; cljs.core.ObjMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.ObjMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.ObjMap.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.ObjMap.EMPTY, this.meta); }; cljs.core.ObjMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if(goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys)) { + if (goog.isString(b) && null != cljs.core.scan_array.call(null, 1, b, this.keys)) { var c = cljs.core.aclone.call(null, this.keys), d = cljs.core.obj_clone.call(null, this.strobj, this.keys); c.splice(cljs.core.scan_array.call(null, 1, b, c), 1); delete d[b]; - return new cljs.core.ObjMap(this.meta, c, d, this.update_count + 1, null) + return new cljs.core.ObjMap(this.meta, c, d, this.update_count + 1, null); } - return this + return this; }; cljs.core.__GT_ObjMap = function(a, b, c, d, e) { - return new cljs.core.ObjMap(a, b, c, d, e) + return new cljs.core.ObjMap(a, b, c, d, e); }; cljs.core.ObjMap.EMPTY = new cljs.core.ObjMap(null, [], function() { - return{} + return{}; }(), 0, 0); cljs.core.ObjMap.HASHMAP_THRESHOLD = 8; cljs.core.ObjMap.fromObject = function(a, b) { - return new cljs.core.ObjMap(null, a, b, 0, null) + return new cljs.core.ObjMap(null, a, b, 0, null); }; cljs.core.array_map_index_of_nil_QMARK_ = function(a, b, c) { b = a.length; - for(c = 0;;) { - if(b <= c) { - return-1 + for (c = 0;;) { + if (b <= c) { + return-1; } - if(null == a[c]) { - return c + if (null == a[c]) { + return c; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - c += 2 - }else { - return null + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + c += 2; + } else { + return null; } } }; cljs.core.array_map_index_of_keyword_QMARK_ = function(a, b, c) { b = a.length; c = c.fqn; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } var e = a[d]; - if(e instanceof cljs.core.Keyword && c === e.fqn) { - return d + if (e instanceof cljs.core.Keyword && c === e.fqn) { + return d; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2; + } else { + return null; } } }; cljs.core.array_map_index_of_symbol_QMARK_ = function(a, b, c) { b = a.length; c = c.str; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } var e = a[d]; - if(e instanceof cljs.core.Symbol && c === e.str) { - return d + if (e instanceof cljs.core.Symbol && c === e.str) { + return d; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2; + } else { + return null; } } }; cljs.core.array_map_index_of_identical_QMARK_ = function(a, b, c) { b = a.length; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } - if(c === a[d]) { - return d + if (c === a[d]) { + return d; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2; + } else { + return null; } } }; cljs.core.array_map_index_of_equiv_QMARK_ = function(a, b, c) { b = a.length; - for(var d = 0;;) { - if(b <= d) { - return-1 + for (var d = 0;;) { + if (b <= d) { + return-1; } - if(cljs.core._EQ_.call(null, c, a[d])) { - return d + if (cljs.core._EQ_.call(null, c, a[d])) { + return d; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d += 2 - }else { - return null + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d += 2; + } else { + return null; } } }; cljs.core.array_map_index_of = function(a, b) { var c = a.arr; return b instanceof cljs.core.Keyword ? cljs.core.array_map_index_of_keyword_QMARK_.call(null, c, a, b) : goog.isString(b) || "number" === typeof b ? cljs.core.array_map_index_of_identical_QMARK_.call(null, c, a, b) : b instanceof cljs.core.Symbol ? cljs.core.array_map_index_of_symbol_QMARK_.call(null, c, a, b) : null == b ? cljs.core.array_map_index_of_nil_QMARK_.call(null, c, a, b) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.array_map_index_of_equiv_QMARK_.call(null, - c, a, b) : null + c, a, b) : null; }; cljs.core.array_map_extend_kv = function(a, b, c) { a = a.arr; - for(var d = a.length, e = Array(d + 2), f = 0;;) { - if(f < d) { - e[f] = a[f], f += 1 - }else { - break + for (var d = a.length, e = Array(d + 2), f = 0;;) { + if (f < d) { + e[f] = a[f], f += 1; + } else { + break; } } e[d] = b; e[d + 1] = c; - return e + return e; }; cljs.core.PersistentArrayMapSeq = function(a, b, c) { this.arr = a; this.i = b; this._meta = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374990 + this.cljs$lang$protocol_mask$partition0$ = 32374990; }; cljs.core.PersistentArrayMapSeq.cljs$lang$type = !0; cljs.core.PersistentArrayMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentArrayMapSeq"; cljs.core.PersistentArrayMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMapSeq") + return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMapSeq"); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) + return cljs.core.hash_coll.call(null, this); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : null + return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : null; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.PersistentArrayMapSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return(this.arr.length - this.i) / 2 + return(this.arr.length - this.i) / 2; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[this.i], this.arr[this.i + 1]], null); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : cljs.core.List.EMPTY + return this.i < this.arr.length - 2 ? new cljs.core.PersistentArrayMapSeq(this.arr, this.i + 2, this._meta) : cljs.core.List.EMPTY; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentArrayMapSeq(this.arr, this.i, b) + return new cljs.core.PersistentArrayMapSeq(this.arr, this.i, b); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta + return this._meta; }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta); }; cljs.core.__GT_PersistentArrayMapSeq = function(a, b, c) { - return new cljs.core.PersistentArrayMapSeq(a, b, c) + return new cljs.core.PersistentArrayMapSeq(a, b, c); }; cljs.core.persistent_array_map_seq = function(a, b, c) { - return b <= a.length - 2 ? new cljs.core.PersistentArrayMapSeq(a, b, c) : null + return b <= a.length - 2 ? new cljs.core.PersistentArrayMapSeq(a, b, c) : null; }; cljs.core.PersistentArrayMap = function(a, b, c, d) { this.meta = a; @@ -9226,34 +9332,34 @@ cljs.core.PersistentArrayMap = function(a, b, c, d) { this.arr = c; this.__hash = d; this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 16123663 + this.cljs$lang$protocol_mask$partition0$ = 16123663; }; cljs.core.PersistentArrayMap.cljs$lang$type = !0; cljs.core.PersistentArrayMap.cljs$lang$ctorStr = "cljs.core/PersistentArrayMap"; cljs.core.PersistentArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMap") + return cljs.core._write.call(null, b, "cljs.core/PersistentArrayMap"); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientArrayMap({}, this.arr.length, cljs.core.aclone.call(null, this.arr)) + return new cljs.core.TransientArrayMap({}, this.arr.length, cljs.core.aclone.call(null, this.arr)); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this); }; cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.PersistentArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { a = cljs.core.array_map_index_of.call(null, this, b); - return-1 === a ? c : this.arr[a + 1] + return-1 === a ? c : this.arr[a + 1]; }; cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { a = cljs.core.array_map_index_of.call(null, this, b); return-1 === a ? this.cnt < cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (c = cljs.core.array_map_extend_kv.call(null, this, b, c), new cljs.core.PersistentArrayMap(this.meta, this.cnt + 1, c, null)) : cljs.core._with_meta.call(null, cljs.core._assoc.call(null, cljs.core.into.call(null, cljs.core.PersistentHashMap.EMPTY, this), b, c), this.meta) : c === this.arr[a + 1] ? this : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = cljs.core.aclone.call(null, this.arr), b[a + 1] = c, - new cljs.core.PersistentArrayMap(this.meta, this.cnt, b, null)) : null + new cljs.core.PersistentArrayMap(this.meta, this.cnt, b, null)) : null; }; cljs.core.PersistentArrayMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return-1 !== cljs.core.array_map_index_of.call(null, this, b) + return-1 !== cljs.core.array_map_index_of.call(null, this, b); }; cljs.core.PersistentArrayMap.prototype.call = function() { var a = null; @@ -9262,100 +9368,104 @@ cljs.core.PersistentArrayMap.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.PersistentArrayMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { a = this.arr.length; - for(var d = 0;;) { - if(d < a) { + for (var d = 0;;) { + if (d < a) { c = b.call(null, c, this.arr[d], this.arr[d + 1]); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - d += 2 - }else { - return c + d += 2; + } else { + return c; } } }; cljs.core.PersistentArrayMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b); }; cljs.core.PersistentArrayMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentArrayMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.persistent_array_map_seq.call(null, this.arr, 0, null) + return cljs.core.persistent_array_map_seq.call(null, this.arr, 0, null); }; cljs.core.PersistentArrayMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt + return this.cnt; }; cljs.core.PersistentArrayMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) + return cljs.core.equiv_map.call(null, this, b); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentArrayMap(b, this.cnt, this.arr, this.__hash) + return new cljs.core.PersistentArrayMap(b, this.cnt, this.arr, this.__hash); +}; +cljs.core.PersistentArrayMap.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentArrayMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentArrayMap(this.meta, this.cnt, this.arr, this.__hash); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentArrayMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta.call(null, cljs.core.PersistentArrayMap.EMPTY, this.meta) + return cljs.core._with_meta.call(null, cljs.core.PersistentArrayMap.EMPTY, this.meta); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if(0 <= cljs.core.array_map_index_of.call(null, this, b)) { + if (0 <= cljs.core.array_map_index_of.call(null, this, b)) { var c = this.arr.length, d = c - 2; - if(0 === d) { - return cljs.core._empty.call(null, this) - } - for(var d = Array(d), e = 0, f = 0;;) { - if(e >= c) { - return new cljs.core.PersistentArrayMap(this.meta, this.cnt - 1, d, null) - } - if(cljs.core._EQ_.call(null, b, this.arr[e])) { - e += 2 - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - d[f] = this.arr[e], d[f + 1] = this.arr[e + 1], f += 2, e += 2 - }else { - return null + if (0 === d) { + return cljs.core._empty.call(null, this); + } + for (var d = Array(d), e = 0, f = 0;;) { + if (e >= c) { + return new cljs.core.PersistentArrayMap(this.meta, this.cnt - 1, d, null); + } + if (cljs.core._EQ_.call(null, b, this.arr[e])) { + e += 2; + } else { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + d[f] = this.arr[e], d[f + 1] = this.arr[e + 1], f += 2, e += 2; + } else { + return null; } } } - }else { - return this + } else { + return this; } }; cljs.core.__GT_PersistentArrayMap = function(a, b, c, d) { - return new cljs.core.PersistentArrayMap(a, b, c, d) + return new cljs.core.PersistentArrayMap(a, b, c, d); }; cljs.core.PersistentArrayMap.EMPTY = new cljs.core.PersistentArrayMap(null, 0, [], null); cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD = 8; cljs.core.PersistentArrayMap.fromArray = function(a, b, c) { a = b ? a : cljs.core.aclone.call(null, a); - if(c) { - return new cljs.core.PersistentArrayMap(null, a.length / 2, a, null) + if (c) { + return new cljs.core.PersistentArrayMap(null, a.length / 2, a, null); } c = a.length; b = 0; - for(var d = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { - if(b < c) { + for (var d = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { + if (b < c) { var e = b + 2, d = cljs.core._assoc_BANG_.call(null, d, a[b], a[b + 1]); - b = e - }else { - return cljs.core._persistent_BANG_.call(null, d) + b = e; + } else { + return cljs.core._persistent_BANG_.call(null, d); } } }; @@ -9364,184 +9474,184 @@ cljs.core.TransientArrayMap = function(a, b, c) { this.len = b; this.arr = c; this.cljs$lang$protocol_mask$partition1$ = 56; - this.cljs$lang$protocol_mask$partition0$ = 258 + this.cljs$lang$protocol_mask$partition0$ = 258; }; cljs.core.TransientArrayMap.cljs$lang$type = !0; cljs.core.TransientArrayMap.cljs$lang$ctorStr = "cljs.core/TransientArrayMap"; cljs.core.TransientArrayMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientArrayMap") + return cljs.core._write.call(null, b, "cljs.core/TransientArrayMap"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 = function(a, b) { - if(cljs.core.truth_(this.editable_QMARK_)) { + if (cljs.core.truth_(this.editable_QMARK_)) { var c = cljs.core.array_map_index_of.call(null, this, b); 0 <= c && (this.arr[c] = this.arr[this.len - 2], this.arr[c + 1] = this.arr[this.len - 1], c = this.arr, c.pop(), c.pop(), this.len -= 2); - return this + return this; } throw Error("dissoc! after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - if(cljs.core.truth_(this.editable_QMARK_)) { + if (cljs.core.truth_(this.editable_QMARK_)) { a = cljs.core.array_map_index_of.call(null, this, b); - if(-1 === a) { - return this.len + 2 <= 2 * cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (this.len += 2, this.arr.push(b), this.arr.push(c), this) : cljs.core.assoc_BANG_.call(null, cljs.core.array__GT_transient_hash_map.call(null, this.len, this.arr), b, c) + if (-1 === a) { + return this.len + 2 <= 2 * cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD ? (this.len += 2, this.arr.push(b), this.arr.push(c), this) : cljs.core.assoc_BANG_.call(null, cljs.core.array__GT_transient_hash_map.call(null, this.len, this.arr), b, c); } c !== this.arr[a + 1] && (this.arr[a + 1] = c); - return this + return this; } throw Error("assoc! after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - if(cljs.core.truth_(this.editable_QMARK_)) { - if(b ? b.cljs$lang$protocol_mask$partition0$ & 2048 || b.cljs$core$IMapEntry$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) { - return cljs.core._assoc_BANG_.call(null, this, cljs.core.key.call(null, b), cljs.core.val.call(null, b)) + if (cljs.core.truth_(this.editable_QMARK_)) { + if (b ? b.cljs$lang$protocol_mask$partition0$ & 2048 || b.cljs$core$IMapEntry$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, b)) { + return cljs.core._assoc_BANG_.call(null, this, cljs.core.key.call(null, b), cljs.core.val.call(null, b)); } - for(var c = cljs.core.seq.call(null, b), d = this;;) { + for (var c = cljs.core.seq.call(null, b), d = this;;) { var e = cljs.core.first.call(null, c); - if(cljs.core.truth_(e)) { - c = cljs.core.next.call(null, c), d = cljs.core._assoc_BANG_.call(null, d, cljs.core.key.call(null, e), cljs.core.val.call(null, e)) - }else { - return d + if (cljs.core.truth_(e)) { + c = cljs.core.next.call(null, c), d = cljs.core._assoc_BANG_.call(null, d, cljs.core.key.call(null, e), cljs.core.val.call(null, e)); + } else { + return d; } } - }else { + } else { throw Error("conj! after persistent!"); } }; cljs.core.TransientArrayMap.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - if(cljs.core.truth_(this.editable_QMARK_)) { - return this.editable_QMARK_ = !1, new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, this.len, 2), this.arr, null) + if (cljs.core.truth_(this.editable_QMARK_)) { + return this.editable_QMARK_ = !1, new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, this.len, 2), this.arr, null); } throw Error("persistent! called twice"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.TransientArrayMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - if(cljs.core.truth_(this.editable_QMARK_)) { - return a = cljs.core.array_map_index_of.call(null, this, b), -1 === a ? c : this.arr[a + 1] + if (cljs.core.truth_(this.editable_QMARK_)) { + return a = cljs.core.array_map_index_of.call(null, this, b), -1 === a ? c : this.arr[a + 1]; } throw Error("lookup after persistent!"); }; cljs.core.TransientArrayMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if(cljs.core.truth_(this.editable_QMARK_)) { - return cljs.core.quot.call(null, this.len, 2) + if (cljs.core.truth_(this.editable_QMARK_)) { + return cljs.core.quot.call(null, this.len, 2); } throw Error("count after persistent!"); }; cljs.core.__GT_TransientArrayMap = function(a, b, c) { - return new cljs.core.TransientArrayMap(a, b, c) + return new cljs.core.TransientArrayMap(a, b, c); }; cljs.core.array__GT_transient_hash_map = function(a, b) { - for(var c = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY), d = 0;;) { - if(d < a) { - c = cljs.core.assoc_BANG_.call(null, c, b[d], b[d + 1]), d += 2 - }else { - return c + for (var c = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY), d = 0;;) { + if (d < a) { + c = cljs.core.assoc_BANG_.call(null, c, b[d], b[d + 1]), d += 2; + } else { + return c; } } }; cljs.core.Box = function(a) { - this.val = a + this.val = a; }; cljs.core.Box.cljs$lang$type = !0; cljs.core.Box.cljs$lang$ctorStr = "cljs.core/Box"; cljs.core.Box.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Box") + return cljs.core._write.call(null, b, "cljs.core/Box"); }; cljs.core.__GT_Box = function(a) { - return new cljs.core.Box(a) + return new cljs.core.Box(a); }; cljs.core.key_test = function(a, b) { - return a === b ? !0 : cljs.core.keyword_identical_QMARK_.call(null, a, b) ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._EQ_.call(null, a, b) : null + return a === b ? !0 : cljs.core.keyword_identical_QMARK_.call(null, a, b) ? !0 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core._EQ_.call(null, a, b) : null; }; cljs.core.mask = function(a, b) { - return a >>> b & 31 + return a >>> b & 31; }; cljs.core.clone_and_set = function() { var a = null, b = function(a, b, c) { a = cljs.core.aclone.call(null, a); a[b] = c; - return a + return a; }, c = function(a, b, c, g, h) { a = cljs.core.aclone.call(null, a); a[b] = c; a[g] = h; - return a + return a; }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h) + return c.call(this, a, e, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a + return a; }(); cljs.core.remove_pair = function(a, b) { var c = Array(a.length - 2); cljs.core.array_copy.call(null, a, 0, c, 0, 2 * b); cljs.core.array_copy.call(null, a, 2 * (b + 1), c, 2 * b, c.length - 2 * b); - return c + return c; }; cljs.core.bitmap_indexed_node_index = function(a, b) { - return cljs.core.bit_count.call(null, a & b - 1) + return cljs.core.bit_count.call(null, a & b - 1); }; cljs.core.bitpos = function(a, b) { - return 1 << (a >>> b & 31) + return 1 << (a >>> b & 31); }; cljs.core.edit_and_set = function() { var a = null, b = function(a, b, c, g) { a = a.ensure_editable(b); a.arr[c] = g; - return a + return a; }, c = function(a, b, c, g, h, k) { a = a.ensure_editable(b); a.arr[c] = g; a.arr[h] = k; - return a + return a; }, a = function(a, e, f, g, h, k) { switch(arguments.length) { case 4: return b.call(this, a, e, f, g); case 6: - return c.call(this, a, e, f, g, h, k) + return c.call(this, a, e, f, g, h, k); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$4 = b; a.cljs$core$IFn$_invoke$arity$6 = c; - return a + return a; }(); cljs.core.inode_kv_reduce = function(a, b, c) { - for(var d = a.length, e = 0;;) { - if(e < d) { + for (var d = a.length, e = 0;;) { + if (e < d) { var f = a[e]; null != f ? c = b.call(null, c, f, a[e + 1]) : (f = a[e + 1], c = null != f ? f.kv_reduce(b, c) : c); - if(cljs.core.reduced_QMARK_.call(null, c)) { - return cljs.core.deref.call(null, c) + if (cljs.core.reduced_QMARK_.call(null, c)) { + return cljs.core.deref.call(null, c); } - e += 2 - }else { - return c + e += 2; + } else { + return c; } } }; cljs.core.BitmapIndexedNode = function(a, b, c) { this.edit = a; this.bitmap = b; - this.arr = c + this.arr = c; }; cljs.core.BitmapIndexedNode.cljs$lang$type = !0; cljs.core.BitmapIndexedNode.cljs$lang$ctorStr = "cljs.core/BitmapIndexedNode"; cljs.core.BitmapIndexedNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/BitmapIndexedNode") + return cljs.core._write.call(null, b, "cljs.core/BitmapIndexedNode"); }; cljs.core.BitmapIndexedNode.prototype.edit_and_remove_pair = function(a, b, c) { - if(this.bitmap === b) { - return null + if (this.bitmap === b) { + return null; } a = this.ensure_editable(a); var d = a.arr, e = d.length; @@ -9549,87 +9659,87 @@ cljs.core.BitmapIndexedNode.prototype.edit_and_remove_pair = function(a, b, c) { cljs.core.array_copy.call(null, d, 2 * (c + 1), d, 2 * c, e - 2 * (c + 1)); d[e - 2] = null; d[e - 1] = null; - return a + return a; }; cljs.core.BitmapIndexedNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { var g = 1 << (c >>> b & 31), h = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, g); - if(0 === (this.bitmap & g)) { + if (0 === (this.bitmap & g)) { var k = cljs.core.bit_count.call(null, this.bitmap); - if(2 * k < this.arr.length) { - return a = this.ensure_editable(a), b = a.arr, f.val = !0, cljs.core.array_copy_downward.call(null, b, 2 * h, b, 2 * (h + 1), 2 * (k - h)), b[2 * h] = d, b[2 * h + 1] = e, a.bitmap |= g, a + if (2 * k < this.arr.length) { + return a = this.ensure_editable(a), b = a.arr, f.val = !0, cljs.core.array_copy_downward.call(null, b, 2 * h, b, 2 * (h + 1), 2 * (k - h)), b[2 * h] = d, b[2 * h + 1] = e, a.bitmap |= g, a; } - if(16 <= k) { + if (16 <= k) { h = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; h[c >>> b & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f); - for(e = d = 0;;) { - if(32 > d) { - 0 !== (this.bitmap >>> d & 1) && (h[d] = null != this.arr[e] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, cljs.core.hash.call(null, this.arr[e]), this.arr[e], this.arr[e + 1], f) : this.arr[e + 1], e += 2), d += 1 - }else { - break + for (e = d = 0;;) { + if (32 > d) { + 0 !== (this.bitmap >>> d & 1) && (h[d] = null != this.arr[e] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, cljs.core.hash.call(null, this.arr[e]), this.arr[e], this.arr[e + 1], f) : this.arr[e + 1], e += 2), d += 1; + } else { + break; } } - return new cljs.core.ArrayNode(a, k + 1, h) + return new cljs.core.ArrayNode(a, k + 1, h); } - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = Array(2 * (k + 4)), cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * h), b[2 * h] = d, b[2 * h + 1] = e, cljs.core.array_copy.call(null, this.arr, 2 * h, b, 2 * (h + 1), 2 * (k - h)), f.val = !0, a = this.ensure_editable(a), a.arr = b, a.bitmap |= g, a) : null + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = Array(2 * (k + 4)), cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * h), b[2 * h] = d, b[2 * h + 1] = e, cljs.core.array_copy.call(null, this.arr, 2 * h, b, 2 * (h + 1), 2 * (k - h)), f.val = !0, a = this.ensure_editable(a), a.arr = b, a.bitmap |= g, a) : null; } k = this.arr[2 * h]; g = this.arr[2 * h + 1]; - return null == k ? (k = g.inode_assoc_BANG_(a, b + 5, c, d, e, f), k === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, k)) : cljs.core.key_test.call(null, d, k) ? e === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, e) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (f.val = !0, cljs.core.edit_and_set.call(null, this, a, 2 * h, null, 2 * h + 1, cljs.core.create_node.call(null, a, b + 5, k, g, c, d, e))) : null + return null == k ? (k = g.inode_assoc_BANG_(a, b + 5, c, d, e, f), k === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, k)) : cljs.core.key_test.call(null, d, k) ? e === g ? this : cljs.core.edit_and_set.call(null, this, a, 2 * h + 1, e) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (f.val = !0, cljs.core.edit_and_set.call(null, this, a, 2 * h, null, 2 * h + 1, cljs.core.create_node.call(null, a, b + 5, k, g, c, d, e))) : null; }; cljs.core.BitmapIndexedNode.prototype.inode_seq = function() { - return cljs.core.create_inode_seq.call(null, this.arr) + return cljs.core.create_inode_seq.call(null, this.arr); }; cljs.core.BitmapIndexedNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { var f = 1 << (c >>> b & 31); - if(0 === (this.bitmap & f)) { - return this + if (0 === (this.bitmap & f)) { + return this; } var g = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, f), h = this.arr[2 * g], k = this.arr[2 * g + 1]; - return null == h ? (b = k.inode_without_BANG_(a, b + 5, c, d, e), b === k ? this : null != b ? cljs.core.edit_and_set.call(null, this, a, 2 * g + 1, b) : this.bitmap === f ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.edit_and_remove_pair(a, f, g) : null) : cljs.core.key_test.call(null, d, h) ? (e[0] = !0, this.edit_and_remove_pair(a, f, g)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null + return null == h ? (b = k.inode_without_BANG_(a, b + 5, c, d, e), b === k ? this : null != b ? cljs.core.edit_and_set.call(null, this, a, 2 * g + 1, b) : this.bitmap === f ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.edit_and_remove_pair(a, f, g) : null) : cljs.core.key_test.call(null, d, h) ? (e[0] = !0, this.edit_and_remove_pair(a, f, g)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null; }; cljs.core.BitmapIndexedNode.prototype.ensure_editable = function(a) { - if(a === this.edit) { - return this + if (a === this.edit) { + return this; } var b = cljs.core.bit_count.call(null, this.bitmap), c = Array(0 > b ? 4 : 2 * (b + 1)); cljs.core.array_copy.call(null, this.arr, 0, c, 0, 2 * b); - return new cljs.core.BitmapIndexedNode(a, this.bitmap, c) + return new cljs.core.BitmapIndexedNode(a, this.bitmap, c); }; cljs.core.BitmapIndexedNode.prototype.kv_reduce = function(a, b) { - return cljs.core.inode_kv_reduce.call(null, this.arr, a, b) + return cljs.core.inode_kv_reduce.call(null, this.arr, a, b); }; cljs.core.BitmapIndexedNode.prototype.inode_find = function(a, b, c, d) { var e = 1 << (b >>> a & 31); - if(0 === (this.bitmap & e)) { - return d + if (0 === (this.bitmap & e)) { + return d; } var f = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; - return null == e ? f.inode_find(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [e, f], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + return null == e ? f.inode_find(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [e, f], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null; }; cljs.core.BitmapIndexedNode.prototype.inode_without = function(a, b, c) { var d = 1 << (b >>> a & 31); - if(0 === (this.bitmap & d)) { - return this + if (0 === (this.bitmap & d)) { + return this; } var e = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, d), f = this.arr[2 * e], g = this.arr[2 * e + 1]; return null == f ? (a = g.inode_without(a + 5, b, c), a === g ? this : null != a ? new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * e + 1, a)) : this.bitmap === d ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair.call(null, this.arr, e)) : null) : cljs.core.key_test.call(null, c, f) ? new cljs.core.BitmapIndexedNode(null, this.bitmap ^ d, cljs.core.remove_pair.call(null, - this.arr, e)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null + this.arr, e)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this : null; }; cljs.core.BitmapIndexedNode.prototype.inode_assoc = function(a, b, c, d, e) { var f = 1 << (b >>> a & 31), g = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, f); - if(0 === (this.bitmap & f)) { + if (0 === (this.bitmap & f)) { var h = cljs.core.bit_count.call(null, this.bitmap); - if(16 <= h) { + if (16 <= h) { g = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; g[b >>> a & 31] = cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e); - for(d = c = 0;;) { - if(32 > c) { - 0 !== (this.bitmap >>> c & 1) && (g[c] = null != this.arr[d] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, cljs.core.hash.call(null, this.arr[d]), this.arr[d], this.arr[d + 1], e) : this.arr[d + 1], d += 2), c += 1 - }else { - break + for (d = c = 0;;) { + if (32 > c) { + 0 !== (this.bitmap >>> c & 1) && (g[c] = null != this.arr[d] ? cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, cljs.core.hash.call(null, this.arr[d]), this.arr[d], this.arr[d + 1], e) : this.arr[d + 1], d += 2), c += 1; + } else { + break; } } - return new cljs.core.ArrayNode(null, h + 1, g) + return new cljs.core.ArrayNode(null, h + 1, g); } a = Array(2 * (h + 1)); cljs.core.array_copy.call(null, this.arr, 0, a, 0, 2 * g); @@ -9637,125 +9747,125 @@ cljs.core.BitmapIndexedNode.prototype.inode_assoc = function(a, b, c, d, e) { a[2 * g + 1] = d; cljs.core.array_copy.call(null, this.arr, 2 * g, a, 2 * (g + 1), 2 * (h - g)); e.val = !0; - return new cljs.core.BitmapIndexedNode(null, this.bitmap | f, a) + return new cljs.core.BitmapIndexedNode(null, this.bitmap | f, a); } h = this.arr[2 * g]; f = this.arr[2 * g + 1]; return null == h ? (h = f.inode_assoc(a + 5, b, c, d, e), h === f ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * g + 1, h))) : cljs.core.key_test.call(null, c, h) ? d === f ? this : new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, this.arr, 2 * g + 1, d)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (e.val = !0, new cljs.core.BitmapIndexedNode(null, this.bitmap, cljs.core.clone_and_set.call(null, - this.arr, 2 * g, null, 2 * g + 1, cljs.core.create_node.call(null, a + 5, h, f, b, c, d)))) : null + this.arr, 2 * g, null, 2 * g + 1, cljs.core.create_node.call(null, a + 5, h, f, b, c, d)))) : null; }; cljs.core.BitmapIndexedNode.prototype.inode_lookup = function(a, b, c, d) { var e = 1 << (b >>> a & 31); - if(0 === (this.bitmap & e)) { - return d + if (0 === (this.bitmap & e)) { + return d; } var f = cljs.core.bitmap_indexed_node_index.call(null, this.bitmap, e), e = this.arr[2 * f], f = this.arr[2 * f + 1]; - return null == e ? f.inode_lookup(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? f : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + return null == e ? f.inode_lookup(a + 5, b, c, d) : cljs.core.key_test.call(null, c, e) ? f : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null; }; cljs.core.__GT_BitmapIndexedNode = function(a, b, c) { - return new cljs.core.BitmapIndexedNode(a, b, c) + return new cljs.core.BitmapIndexedNode(a, b, c); }; cljs.core.BitmapIndexedNode.EMPTY = new cljs.core.BitmapIndexedNode(null, 0, []); cljs.core.pack_array_node = function(a, b, c) { var d = a.arr; a = 2 * (a.cnt - 1); - for(var e = Array(a), f = 0, g = 1, h = 0;;) { - if(f < a) { - f !== c && null != d[f] && (e[g] = d[f], g += 2, h |= 1 << f), f += 1 - }else { - return new cljs.core.BitmapIndexedNode(b, h, e) + for (var e = Array(a), f = 0, g = 1, h = 0;;) { + if (f < a) { + f !== c && null != d[f] && (e[g] = d[f], g += 2, h |= 1 << f), f += 1; + } else { + return new cljs.core.BitmapIndexedNode(b, h, e); } } }; cljs.core.ArrayNode = function(a, b, c) { this.edit = a; this.cnt = b; - this.arr = c + this.arr = c; }; cljs.core.ArrayNode.cljs$lang$type = !0; cljs.core.ArrayNode.cljs$lang$ctorStr = "cljs.core/ArrayNode"; cljs.core.ArrayNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ArrayNode") + return cljs.core._write.call(null, b, "cljs.core/ArrayNode"); }; cljs.core.ArrayNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { var g = c >>> b & 31, h = this.arr[g]; - if(null == h) { - return a = cljs.core.edit_and_set.call(null, this, a, g, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f)), a.cnt += 1, a + if (null == h) { + return a = cljs.core.edit_and_set.call(null, this, a, g, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b + 5, c, d, e, f)), a.cnt += 1, a; } b = h.inode_assoc_BANG_(a, b + 5, c, d, e, f); - return b === h ? this : cljs.core.edit_and_set.call(null, this, a, g, b) + return b === h ? this : cljs.core.edit_and_set.call(null, this, a, g, b); }; cljs.core.ArrayNode.prototype.inode_seq = function() { - return cljs.core.create_array_node_seq.call(null, this.arr) + return cljs.core.create_array_node_seq.call(null, this.arr); }; cljs.core.ArrayNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { var f = c >>> b & 31, g = this.arr[f]; - if(null == g) { - return this + if (null == g) { + return this; } b = g.inode_without_BANG_(a, b + 5, c, d, e); - if(b === g) { - return this + if (b === g) { + return this; } - if(null == b) { - if(8 >= this.cnt) { - return cljs.core.pack_array_node.call(null, this, a, f) + if (null == b) { + if (8 >= this.cnt) { + return cljs.core.pack_array_node.call(null, this, a, f); } a = cljs.core.edit_and_set.call(null, this, a, f, b); a.cnt -= 1; - return a + return a; } - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.edit_and_set.call(null, this, a, f, b) : null + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.core.edit_and_set.call(null, this, a, f, b) : null; }; cljs.core.ArrayNode.prototype.ensure_editable = function(a) { - return a === this.edit ? this : new cljs.core.ArrayNode(a, this.cnt, cljs.core.aclone.call(null, this.arr)) + return a === this.edit ? this : new cljs.core.ArrayNode(a, this.cnt, cljs.core.aclone.call(null, this.arr)); }; cljs.core.ArrayNode.prototype.kv_reduce = function(a, b) { - for(var c = this.arr.length, d = 0, e = b;;) { - if(d < c) { + for (var c = this.arr.length, d = 0, e = b;;) { + if (d < c) { var f = this.arr[d]; - if(null != f && (e = f.kv_reduce(a, e), cljs.core.reduced_QMARK_.call(null, e))) { - return cljs.core.deref.call(null, e) + if (null != f && (e = f.kv_reduce(a, e), cljs.core.reduced_QMARK_.call(null, e))) { + return cljs.core.deref.call(null, e); } - d += 1 - }else { - return e + d += 1; + } else { + return e; } } }; cljs.core.ArrayNode.prototype.inode_find = function(a, b, c, d) { var e = this.arr[b >>> a & 31]; - return null != e ? e.inode_find(a + 5, b, c, d) : d + return null != e ? e.inode_find(a + 5, b, c, d) : d; }; cljs.core.ArrayNode.prototype.inode_without = function(a, b, c) { var d = b >>> a & 31, e = this.arr[d]; - return null != e ? (a = e.inode_without(a + 5, b, c), a === e ? this : null == a ? 8 >= this.cnt ? cljs.core.pack_array_node.call(null, this, null, d) : new cljs.core.ArrayNode(null, this.cnt - 1, cljs.core.clone_and_set.call(null, this.arr, d, a)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, d, a)) : null) : this + return null != e ? (a = e.inode_without(a + 5, b, c), a === e ? this : null == a ? 8 >= this.cnt ? cljs.core.pack_array_node.call(null, this, null, d) : new cljs.core.ArrayNode(null, this.cnt - 1, cljs.core.clone_and_set.call(null, this.arr, d, a)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, d, a)) : null) : this; }; cljs.core.ArrayNode.prototype.inode_assoc = function(a, b, c, d, e) { var f = b >>> a & 31, g = this.arr[f]; - if(null == g) { - return new cljs.core.ArrayNode(null, this.cnt + 1, cljs.core.clone_and_set.call(null, this.arr, f, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e))) + if (null == g) { + return new cljs.core.ArrayNode(null, this.cnt + 1, cljs.core.clone_and_set.call(null, this.arr, f, cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a + 5, b, c, d, e))); } a = g.inode_assoc(a + 5, b, c, d, e); - return a === g ? this : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, f, a)) + return a === g ? this : new cljs.core.ArrayNode(null, this.cnt, cljs.core.clone_and_set.call(null, this.arr, f, a)); }; cljs.core.ArrayNode.prototype.inode_lookup = function(a, b, c, d) { var e = this.arr[b >>> a & 31]; - return null != e ? e.inode_lookup(a + 5, b, c, d) : d + return null != e ? e.inode_lookup(a + 5, b, c, d) : d; }; cljs.core.__GT_ArrayNode = function(a, b, c) { - return new cljs.core.ArrayNode(a, b, c) + return new cljs.core.ArrayNode(a, b, c); }; cljs.core.hash_collision_node_find_index = function(a, b, c) { b *= 2; - for(var d = 0;;) { - if(d < b) { - if(cljs.core.key_test.call(null, c, a[d])) { - return d + for (var d = 0;;) { + if (d < b) { + if (cljs.core.key_test.call(null, c, a[d])) { + return d; } - d += 2 - }else { - return-1 + d += 2; + } else { + return-1; } } }; @@ -9763,19 +9873,19 @@ cljs.core.HashCollisionNode = function(a, b, c, d) { this.edit = a; this.collision_hash = b; this.cnt = c; - this.arr = d + this.arr = d; }; cljs.core.HashCollisionNode.cljs$lang$type = !0; cljs.core.HashCollisionNode.cljs$lang$ctorStr = "cljs.core/HashCollisionNode"; cljs.core.HashCollisionNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/HashCollisionNode") + return cljs.core._write.call(null, b, "cljs.core/HashCollisionNode"); }; cljs.core.HashCollisionNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e, f) { - if(c === this.collision_hash) { + if (c === this.collision_hash) { b = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, d); - if(-1 === b) { - if(this.arr.length > 2 * this.cnt) { - return a = cljs.core.edit_and_set.call(null, this, a, 2 * this.cnt, d, 2 * this.cnt + 1, e), f.val = !0, a.cnt += 1, a + if (-1 === b) { + if (this.arr.length > 2 * this.cnt) { + return a = cljs.core.edit_and_set.call(null, this, a, 2 * this.cnt, d, 2 * this.cnt + 1, e), f.val = !0, a.cnt += 1, a; } b = this.arr.length; c = Array(b + 2); @@ -9783,23 +9893,23 @@ cljs.core.HashCollisionNode.prototype.inode_assoc_BANG_ = function(a, b, c, d, e c[b] = d; c[b + 1] = e; f.val = !0; - return this.ensure_editable_array(a, this.cnt + 1, c) + return this.ensure_editable_array(a, this.cnt + 1, c); } - return this.arr[b + 1] === e ? this : cljs.core.edit_and_set.call(null, this, a, b + 1, e) + return this.arr[b + 1] === e ? this : cljs.core.edit_and_set.call(null, this, a, b + 1, e); } - return(new cljs.core.BitmapIndexedNode(a, 1 << (this.collision_hash >>> b & 31), [null, this, null, null])).inode_assoc_BANG_(a, b, c, d, e, f) + return(new cljs.core.BitmapIndexedNode(a, 1 << (this.collision_hash >>> b & 31), [null, this, null, null])).inode_assoc_BANG_(a, b, c, d, e, f); }; cljs.core.HashCollisionNode.prototype.inode_seq = function() { - return cljs.core.create_inode_seq.call(null, this.arr) + return cljs.core.create_inode_seq.call(null, this.arr); }; cljs.core.HashCollisionNode.prototype.inode_without_BANG_ = function(a, b, c, d, e) { b = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, d); - if(-1 === b) { - return this + if (-1 === b) { + return this; } e[0] = !0; - if(1 === this.cnt) { - return null + if (1 === this.cnt) { + return null; } a = this.ensure_editable(a); e = a.arr; @@ -9808,68 +9918,68 @@ cljs.core.HashCollisionNode.prototype.inode_without_BANG_ = function(a, b, c, d, e[2 * this.cnt - 1] = null; e[2 * this.cnt - 2] = null; a.cnt -= 1; - return a + return a; }; cljs.core.HashCollisionNode.prototype.ensure_editable = function(a) { - if(a === this.edit) { - return this + if (a === this.edit) { + return this; } var b = Array(2 * (this.cnt + 1)); cljs.core.array_copy.call(null, this.arr, 0, b, 0, 2 * this.cnt); - return new cljs.core.HashCollisionNode(a, this.collision_hash, this.cnt, b) + return new cljs.core.HashCollisionNode(a, this.collision_hash, this.cnt, b); }; cljs.core.HashCollisionNode.prototype.kv_reduce = function(a, b) { - return cljs.core.inode_kv_reduce.call(null, this.arr, a, b) + return cljs.core.inode_kv_reduce.call(null, this.arr, a, b); }; cljs.core.HashCollisionNode.prototype.inode_find = function(a, b, c, d) { a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); - return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[a], this.arr[a + 1]], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.arr[a], this.arr[a + 1]], null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null; }; cljs.core.HashCollisionNode.prototype.inode_without = function(a, b, c) { a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); - return-1 === a ? this : 1 === this.cnt ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt - 1, cljs.core.remove_pair.call(null, this.arr, cljs.core.quot.call(null, a, 2))) : null + return-1 === a ? this : 1 === this.cnt ? null : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt - 1, cljs.core.remove_pair.call(null, this.arr, cljs.core.quot.call(null, a, 2))) : null; }; cljs.core.HashCollisionNode.prototype.inode_assoc = function(a, b, c, d, e) { return b === this.collision_hash ? (a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c), -1 === a ? (a = 2 * this.cnt, b = Array(a + 2), cljs.core.array_copy.call(null, this.arr, 0, b, 0, a), b[a] = c, b[a + 1] = d, e.val = !0, new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt + 1, b)) : cljs.core._EQ_.call(null, this.arr[a], d) ? this : new cljs.core.HashCollisionNode(null, this.collision_hash, this.cnt, cljs.core.clone_and_set.call(null, this.arr, - a + 1, d))) : (new cljs.core.BitmapIndexedNode(null, 1 << (this.collision_hash >>> a & 31), [null, this])).inode_assoc(a, b, c, d, e) + a + 1, d))) : (new cljs.core.BitmapIndexedNode(null, 1 << (this.collision_hash >>> a & 31), [null, this])).inode_assoc(a, b, c, d, e); }; cljs.core.HashCollisionNode.prototype.inode_lookup = function(a, b, c, d) { a = cljs.core.hash_collision_node_find_index.call(null, this.arr, this.cnt, c); - return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? this.arr[a + 1] : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null + return 0 > a ? d : cljs.core.key_test.call(null, c, this.arr[a]) ? this.arr[a + 1] : new cljs.core.Keyword(null, "else", "else", 1017020587) ? d : null; }; cljs.core.HashCollisionNode.prototype.ensure_editable_array = function(a, b, c) { - return a === this.edit ? (this.arr = c, this.cnt = b, this) : new cljs.core.HashCollisionNode(this.edit, this.collision_hash, b, c) + return a === this.edit ? (this.arr = c, this.cnt = b, this) : new cljs.core.HashCollisionNode(this.edit, this.collision_hash, b, c); }; cljs.core.__GT_HashCollisionNode = function(a, b, c, d) { - return new cljs.core.HashCollisionNode(a, b, c, d) + return new cljs.core.HashCollisionNode(a, b, c, d); }; cljs.core.create_node = function() { var a = null, b = function(a, b, c, g, h, k) { var l = cljs.core.hash.call(null, b); - if(l === g) { - return new cljs.core.HashCollisionNode(null, l, 2, [b, c, h, k]) + if (l === g) { + return new cljs.core.HashCollisionNode(null, l, 2, [b, c, h, k]); } var m = new cljs.core.Box(!1); - return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a, l, b, c, m).inode_assoc(a, g, h, k, m) + return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc(a, l, b, c, m).inode_assoc(a, g, h, k, m); }, c = function(a, b, c, g, h, k, l) { var m = cljs.core.hash.call(null, c); - if(m === h) { - return new cljs.core.HashCollisionNode(null, m, 2, [c, g, k, l]) + if (m === h) { + return new cljs.core.HashCollisionNode(null, m, 2, [c, g, k, l]); } var n = new cljs.core.Box(!1); - return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b, m, c, g, n).inode_assoc_BANG_(a, b, h, k, l, n) + return cljs.core.BitmapIndexedNode.EMPTY.inode_assoc_BANG_(a, b, m, c, g, n).inode_assoc_BANG_(a, b, h, k, l, n); }, a = function(a, e, f, g, h, k, l) { switch(arguments.length) { case 6: return b.call(this, a, e, f, g, h, k); case 7: - return c.call(this, a, e, f, g, h, k, l) + return c.call(this, a, e, f, g, h, k, l); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$6 = b; a.cljs$core$IFn$_invoke$arity$7 = c; - return a + return a; }(); cljs.core.NodeSeq = function(a, b, c, d, e) { this.meta = a; @@ -9878,87 +9988,87 @@ cljs.core.NodeSeq = function(a, b, c, d, e) { this.s = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374860 + this.cljs$lang$protocol_mask$partition0$ = 32374860; }; cljs.core.NodeSeq.cljs$lang$type = !0; cljs.core.NodeSeq.cljs$lang$ctorStr = "cljs.core/NodeSeq"; cljs.core.NodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/NodeSeq") + return cljs.core._write.call(null, b, "cljs.core/NodeSeq"); }; cljs.core.NodeSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.NodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.NodeSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.NodeSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.NodeSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.NodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.NodeSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return null == this.s ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.nodes[this.i], this.nodes[this.i + 1]], null) : cljs.core.first.call(null, this.s) + return null == this.s ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.nodes[this.i], this.nodes[this.i + 1]], null) : cljs.core.first.call(null, this.s); }; cljs.core.NodeSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null == this.s ? cljs.core.create_inode_seq.call(null, this.nodes, this.i + 2, null) : cljs.core.create_inode_seq.call(null, this.nodes, this.i, cljs.core.next.call(null, this.s)) + return null == this.s ? cljs.core.create_inode_seq.call(null, this.nodes, this.i + 2, null) : cljs.core.create_inode_seq.call(null, this.nodes, this.i, cljs.core.next.call(null, this.s)); }; cljs.core.NodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.NodeSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.NodeSeq(b, this.nodes, this.i, this.s, this.__hash) + return new cljs.core.NodeSeq(b, this.nodes, this.i, this.s, this.__hash); }; cljs.core.NodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.NodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_NodeSeq = function(a, b, c, d, e) { - return new cljs.core.NodeSeq(a, b, c, d, e) + return new cljs.core.NodeSeq(a, b, c, d, e); }; cljs.core.create_inode_seq = function() { var a = null, b = function(b) { - return a.call(null, b, 0, null) + return a.call(null, b, 0, null); }, c = function(a, b, c) { - if(null == c) { - for(c = a.length;;) { - if(b < c) { - if(null != a[b]) { - return new cljs.core.NodeSeq(null, a, b, null, null) + if (null == c) { + for (c = a.length;;) { + if (b < c) { + if (null != a[b]) { + return new cljs.core.NodeSeq(null, a, b, null, null); } var g = a[b + 1]; - if(cljs.core.truth_(g) && (g = g.inode_seq(), cljs.core.truth_(g))) { - return new cljs.core.NodeSeq(null, a, b + 2, g, null) + if (cljs.core.truth_(g) && (g = g.inode_seq(), cljs.core.truth_(g))) { + return new cljs.core.NodeSeq(null, a, b + 2, g, null); } - b += 2 - }else { - return null + b += 2; + } else { + return null; } } - }else { - return new cljs.core.NodeSeq(null, a, b, c, null) + } else { + return new cljs.core.NodeSeq(null, a, b, c, null); } }, a = function(a, e, f) { switch(arguments.length) { case 1: return b.call(this, a); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.ArrayNodeSeq = function(a, b, c, d, e) { this.meta = a; @@ -9967,84 +10077,84 @@ cljs.core.ArrayNodeSeq = function(a, b, c, d, e) { this.s = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374860 + this.cljs$lang$protocol_mask$partition0$ = 32374860; }; cljs.core.ArrayNodeSeq.cljs$lang$type = !0; cljs.core.ArrayNodeSeq.cljs$lang$ctorStr = "cljs.core/ArrayNodeSeq"; cljs.core.ArrayNodeSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ArrayNodeSeq") + return cljs.core._write.call(null, b, "cljs.core/ArrayNodeSeq"); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.ArrayNodeSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.first.call(null, this.s) + return cljs.core.first.call(null, this.s); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return cljs.core.create_array_node_seq.call(null, null, this.nodes, this.i, cljs.core.next.call(null, this.s)) + return cljs.core.create_array_node_seq.call(null, null, this.nodes, this.i, cljs.core.next.call(null, this.s)); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ArrayNodeSeq(b, this.nodes, this.i, this.s, this.__hash) + return new cljs.core.ArrayNodeSeq(b, this.nodes, this.i, this.s, this.__hash); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_ArrayNodeSeq = function(a, b, c, d, e) { - return new cljs.core.ArrayNodeSeq(a, b, c, d, e) + return new cljs.core.ArrayNodeSeq(a, b, c, d, e); }; cljs.core.create_array_node_seq = function() { var a = null, b = function(b) { - return a.call(null, null, b, 0, null) + return a.call(null, null, b, 0, null); }, c = function(a, b, c, g) { - if(null == g) { - for(g = b.length;;) { - if(c < g) { + if (null == g) { + for (g = b.length;;) { + if (c < g) { var h = b[c]; - if(cljs.core.truth_(h) && (h = h.inode_seq(), cljs.core.truth_(h))) { - return new cljs.core.ArrayNodeSeq(a, b, c + 1, h, null) + if (cljs.core.truth_(h) && (h = h.inode_seq(), cljs.core.truth_(h))) { + return new cljs.core.ArrayNodeSeq(a, b, c + 1, h, null); } - c += 1 - }else { - return null + c += 1; + } else { + return null; } } - }else { - return new cljs.core.ArrayNodeSeq(a, b, c, g, null) + } else { + return new cljs.core.ArrayNodeSeq(a, b, c, g, null); } }, a = function(a, e, f, g) { switch(arguments.length) { case 1: return b.call(this, a); case 4: - return c.call(this, a, e, f, g) + return c.call(this, a, e, f, g); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$4 = c; - return a + return a; }(); cljs.core.PersistentHashMap = function(a, b, c, d, e, f) { this.meta = a; @@ -10054,36 +10164,36 @@ cljs.core.PersistentHashMap = function(a, b, c, d, e, f) { this.nil_val = e; this.__hash = f; this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 16123663 + this.cljs$lang$protocol_mask$partition0$ = 16123663; }; cljs.core.PersistentHashMap.cljs$lang$type = !0; cljs.core.PersistentHashMap.cljs$lang$ctorStr = "cljs.core/PersistentHashMap"; cljs.core.PersistentHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentHashMap") + return cljs.core._write.call(null, b, "cljs.core/PersistentHashMap"); }; cljs.core.PersistentHashMap.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientHashMap({}, this.root, this.cnt, this.has_nil_QMARK_, this.nil_val) + return new cljs.core.TransientHashMap({}, this.root, this.cnt, this.has_nil_QMARK_, this.nil_val); }; cljs.core.PersistentHashMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this); }; cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.PersistentHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) : null + return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) : null; }; cljs.core.PersistentHashMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - if(null == b) { - return this.has_nil_QMARK_ && c === this.nil_val ? this : new cljs.core.PersistentHashMap(this.meta, this.has_nil_QMARK_ ? this.cnt : this.cnt + 1, this.root, !0, c, null) + if (null == b) { + return this.has_nil_QMARK_ && c === this.nil_val ? this : new cljs.core.PersistentHashMap(this.meta, this.has_nil_QMARK_ ? this.cnt : this.cnt + 1, this.root, !0, c, null); } a = new cljs.core.Box(!1); b = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc(0, cljs.core.hash.call(null, b), b, c, a); - return b === this.root ? this : new cljs.core.PersistentHashMap(this.meta, a.val ? this.cnt + 1 : this.cnt, b, this.has_nil_QMARK_, this.nil_val, null) + return b === this.root ? this : new cljs.core.PersistentHashMap(this.meta, a.val ? this.cnt + 1 : this.cnt, b, this.has_nil_QMARK_, this.nil_val, null); }; cljs.core.PersistentHashMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return null == b ? this.has_nil_QMARK_ : null == this.root ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, cljs.core.lookup_sentinel) !== cljs.core.lookup_sentinel : null + return null == b ? this.has_nil_QMARK_ : null == this.root ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, cljs.core.lookup_sentinel) !== cljs.core.lookup_sentinel : null; }; cljs.core.PersistentHashMap.prototype.call = function() { var a = null; @@ -10092,71 +10202,75 @@ cljs.core.PersistentHashMap.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.PersistentHashMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.PersistentHashMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentHashMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentHashMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { a = this.has_nil_QMARK_ ? b.call(null, c, null, this.nil_val) : c; - return cljs.core.reduced_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : null != this.root ? this.root.kv_reduce(b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null + return cljs.core.reduced_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : null != this.root ? this.root.kv_reduce(b, a) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null; }; cljs.core.PersistentHashMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b); }; cljs.core.PersistentHashMap.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentHashMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.cnt ? (a = null != this.root ? this.root.inode_seq() : null, this.has_nil_QMARK_ ? cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, this.nil_val], null), a) : a) : null + return 0 < this.cnt ? (a = null != this.root ? this.root.inode_seq() : null, this.has_nil_QMARK_ ? cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, this.nil_val], null), a) : a) : null; }; cljs.core.PersistentHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt + return this.cnt; }; cljs.core.PersistentHashMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) + return cljs.core.equiv_map.call(null, this, b); }; cljs.core.PersistentHashMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentHashMap(b, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash) + return new cljs.core.PersistentHashMap(b, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash); +}; +cljs.core.PersistentHashMap.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentHashMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentHashMap(this.meta, this.cnt, this.root, this.has_nil_QMARK_, this.nil_val, this.__hash); }; cljs.core.PersistentHashMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentHashMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core._with_meta.call(null, cljs.core.PersistentHashMap.EMPTY, this.meta) + return cljs.core._with_meta.call(null, cljs.core.PersistentHashMap.EMPTY, this.meta); }; cljs.core.PersistentHashMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { - if(null == b) { - return this.has_nil_QMARK_ ? new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, this.root, !1, null, null) : this + if (null == b) { + return this.has_nil_QMARK_ ? new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, this.root, !1, null, null) : this; } - if(null == this.root) { - return this + if (null == this.root) { + return this; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { var c = this.root.inode_without(0, cljs.core.hash.call(null, b), b); - return c === this.root ? this : new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, c, this.has_nil_QMARK_, this.nil_val, null) + return c === this.root ? this : new cljs.core.PersistentHashMap(this.meta, this.cnt - 1, c, this.has_nil_QMARK_, this.nil_val, null); } - return null + return null; }; cljs.core.__GT_PersistentHashMap = function(a, b, c, d, e, f) { - return new cljs.core.PersistentHashMap(a, b, c, d, e, f) + return new cljs.core.PersistentHashMap(a, b, c, d, e, f); }; cljs.core.PersistentHashMap.EMPTY = new cljs.core.PersistentHashMap(null, 0, null, !1, null, 0); cljs.core.PersistentHashMap.fromArrays = function(a, b) { - for(var c = a.length, d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { - if(d < c) { + for (var c = a.length, d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { + if (d < c) { var f = d + 1, e = cljs.core._assoc_BANG_.call(null, e, a[d], b[d]), d = f - }else { - return cljs.core.persistent_BANG_.call(null, e) + } else { + return cljs.core.persistent_BANG_.call(null, e); } } }; @@ -10167,99 +10281,99 @@ cljs.core.TransientHashMap = function(a, b, c, d, e) { this.has_nil_QMARK_ = d; this.nil_val = e; this.cljs$lang$protocol_mask$partition1$ = 56; - this.cljs$lang$protocol_mask$partition0$ = 258 + this.cljs$lang$protocol_mask$partition0$ = 258; }; cljs.core.TransientHashMap.cljs$lang$type = !0; cljs.core.TransientHashMap.cljs$lang$ctorStr = "cljs.core/TransientHashMap"; cljs.core.TransientHashMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientHashMap") + return cljs.core._write.call(null, b, "cljs.core/TransientHashMap"); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientMap$_dissoc_BANG_$arity$2 = function(a, b) { - return this.without_BANG_(b) + return this.without_BANG_(b); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientAssociative$_assoc_BANG_$arity$3 = function(a, b, c) { - return this.assoc_BANG_(b, c) + return this.assoc_BANG_(b, c); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { - return this.conj_BANG_(b) + return this.conj_BANG_(b); }; cljs.core.TransientHashMap.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - return this.persistent_BANG_() + return this.persistent_BANG_(); }; cljs.core.TransientHashMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : null : null == this.root ? null : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b) + return null == b ? this.has_nil_QMARK_ ? this.nil_val : null : null == this.root ? null : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b); }; cljs.core.TransientHashMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c) + return null == b ? this.has_nil_QMARK_ ? this.nil_val : c : null == this.root ? c : this.root.inode_lookup(0, cljs.core.hash.call(null, b), b, c); }; cljs.core.TransientHashMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - if(this.edit) { - return this.count + if (this.edit) { + return this.count; } throw Error("count after persistent!"); }; cljs.core.TransientHashMap.prototype.conj_BANG_ = function(a) { - if(this.edit) { - if(a ? a.cljs$lang$protocol_mask$partition0$ & 2048 || a.cljs$core$IMapEntry$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) { - return this.assoc_BANG_(cljs.core.key.call(null, a), cljs.core.val.call(null, a)) + if (this.edit) { + if (a ? a.cljs$lang$protocol_mask$partition0$ & 2048 || a.cljs$core$IMapEntry$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMapEntry, a)) { + return this.assoc_BANG_(cljs.core.key.call(null, a), cljs.core.val.call(null, a)); } a = cljs.core.seq.call(null, a); - for(var b = this;;) { + for (var b = this;;) { var c = cljs.core.first.call(null, a); - if(cljs.core.truth_(c)) { - a = cljs.core.next.call(null, a), b = b.assoc_BANG_(cljs.core.key.call(null, c), cljs.core.val.call(null, c)) - }else { - return b + if (cljs.core.truth_(c)) { + a = cljs.core.next.call(null, a), b = b.assoc_BANG_(cljs.core.key.call(null, c), cljs.core.val.call(null, c)); + } else { + return b; } } - }else { + } else { throw Error("conj! after persistent"); } }; cljs.core.TransientHashMap.prototype.assoc_BANG_ = function(a, b) { - if(this.edit) { - if(null == a) { - this.nil_val !== b && (this.nil_val = b), this.has_nil_QMARK_ || (this.count += 1, this.has_nil_QMARK_ = !0) - }else { + if (this.edit) { + if (null == a) { + this.nil_val !== b && (this.nil_val = b), this.has_nil_QMARK_ || (this.count += 1, this.has_nil_QMARK_ = !0); + } else { var c = new cljs.core.Box(!1), d = (null == this.root ? cljs.core.BitmapIndexedNode.EMPTY : this.root).inode_assoc_BANG_(this.edit, 0, cljs.core.hash.call(null, a), a, b, c); d !== this.root && (this.root = d); - c.val && (this.count += 1) + c.val && (this.count += 1); } - return this + return this; } throw Error("assoc! after persistent!"); }; cljs.core.TransientHashMap.prototype.without_BANG_ = function(a) { - if(this.edit) { - if(null == a) { - this.has_nil_QMARK_ && (this.has_nil_QMARK_ = !1, this.nil_val = null, this.count -= 1) - }else { - if(null != this.root) { + if (this.edit) { + if (null == a) { + this.has_nil_QMARK_ && (this.has_nil_QMARK_ = !1, this.nil_val = null, this.count -= 1); + } else { + if (null != this.root) { var b = new cljs.core.Box(!1); a = this.root.inode_without_BANG_(this.edit, 0, cljs.core.hash.call(null, a), a, b); a !== this.root && (this.root = a); - cljs.core.truth_(b[0]) && (this.count -= 1) + cljs.core.truth_(b[0]) && (this.count -= 1); } } - return this + return this; } throw Error("dissoc! after persistent!"); }; cljs.core.TransientHashMap.prototype.persistent_BANG_ = function() { - if(this.edit) { - return this.edit = null, new cljs.core.PersistentHashMap(null, this.count, this.root, this.has_nil_QMARK_, this.nil_val, null) + if (this.edit) { + return this.edit = null, new cljs.core.PersistentHashMap(null, this.count, this.root, this.has_nil_QMARK_, this.nil_val, null); } throw Error("persistent! called twice"); }; cljs.core.__GT_TransientHashMap = function(a, b, c, d, e) { - return new cljs.core.TransientHashMap(a, b, c, d, e) + return new cljs.core.TransientHashMap(a, b, c, d, e); }; cljs.core.tree_map_seq_push = function(a, b, c) { - for(var d = b;;) { - if(null != a) { - b = c ? a.left : a.right, d = cljs.core.conj.call(null, d, a), a = b - }else { - return d + for (var d = b;;) { + if (null != a) { + b = c ? a.left : a.right, d = cljs.core.conj.call(null, d, a), a = b; + } else { + return d; } } }; @@ -10270,110 +10384,110 @@ cljs.core.PersistentTreeMapSeq = function(a, b, c, d, e) { this.cnt = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374862 + this.cljs$lang$protocol_mask$partition0$ = 32374862; }; cljs.core.PersistentTreeMapSeq.cljs$lang$type = !0; cljs.core.PersistentTreeMapSeq.cljs$lang$ctorStr = "cljs.core/PersistentTreeMapSeq"; cljs.core.PersistentTreeMapSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMapSeq") + return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMapSeq"); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.PersistentTreeMapSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 0 > this.cnt ? cljs.core.count.call(null, cljs.core.next.call(null, this)) + 1 : this.cnt + return 0 > this.cnt ? cljs.core.count.call(null, cljs.core.next.call(null, this)) + 1 : this.cnt; }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return cljs.core.peek.call(null, this.stack) + return cljs.core.peek.call(null, this.stack); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { a = cljs.core.first.call(null, this.stack); a = cljs.core.tree_map_seq_push.call(null, this.ascending_QMARK_ ? a.right : a.left, cljs.core.next.call(null, this.stack), this.ascending_QMARK_); - return null != a ? new cljs.core.PersistentTreeMapSeq(null, a, this.ascending_QMARK_, this.cnt - 1, null) : cljs.core.List.EMPTY + return null != a ? new cljs.core.PersistentTreeMapSeq(null, a, this.ascending_QMARK_, this.cnt - 1, null) : cljs.core.List.EMPTY; }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeMapSeq(b, this.stack, this.ascending_QMARK_, this.cnt, this.__hash) + return new cljs.core.PersistentTreeMapSeq(b, this.stack, this.ascending_QMARK_, this.cnt, this.__hash); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_PersistentTreeMapSeq = function(a, b, c, d, e) { - return new cljs.core.PersistentTreeMapSeq(a, b, c, d, e) + return new cljs.core.PersistentTreeMapSeq(a, b, c, d, e); }; cljs.core.create_tree_map_seq = function(a, b, c) { - return new cljs.core.PersistentTreeMapSeq(null, cljs.core.tree_map_seq_push.call(null, a, null, b), b, c, null) + return new cljs.core.PersistentTreeMapSeq(null, cljs.core.tree_map_seq_push.call(null, a, null, b), b, c, null); }; cljs.core.balance_left = function(a, b, c, d) { return c instanceof cljs.core.RedNode ? c.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, c.left.blacken(), new cljs.core.BlackNode(a, b, c.right, d, null), null) : c.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.right.key, c.right.val, new cljs.core.BlackNode(c.key, c.val, c.left, c.right.left, null), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a, b, c, d, - null) : null : new cljs.core.BlackNode(a, b, c, d, null) + null) : null : new cljs.core.BlackNode(a, b, c, d, null); }; cljs.core.balance_right = function(a, b, c, d) { return d instanceof cljs.core.RedNode ? d.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(a, b, c, d.left, null), d.right.blacken(), null) : d.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), new cljs.core.BlackNode(d.key, d.val, d.left.right, d.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a, b, c, d, null) : - null : new cljs.core.BlackNode(a, b, c, d, null) + null : new cljs.core.BlackNode(a, b, c, d, null); }; cljs.core.balance_left_del = function(a, b, c, d) { - if(c instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(a, b, c.blacken(), d, null) + if (c instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(a, b, c.blacken(), d, null); } - if(d instanceof cljs.core.BlackNode) { - return cljs.core.balance_right.call(null, a, b, c, d.redden()) + if (d instanceof cljs.core.BlackNode) { + return cljs.core.balance_right.call(null, a, b, c, d.redden()); } - if(d instanceof cljs.core.RedNode && d.left instanceof cljs.core.BlackNode) { - return new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), cljs.core.balance_right.call(null, d.key, d.val, d.left.right, d.right.redden()), null) + if (d instanceof cljs.core.RedNode && d.left instanceof cljs.core.BlackNode) { + return new cljs.core.RedNode(d.left.key, d.left.val, new cljs.core.BlackNode(a, b, c, d.left.left, null), cljs.core.balance_right.call(null, d.key, d.val, d.left.right, d.right.redden()), null); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error("red-black tree invariant violation"); } - return null + return null; }; cljs.core.balance_right_del = function(a, b, c, d) { - if(d instanceof cljs.core.RedNode) { - return new cljs.core.RedNode(a, b, c, d.blacken(), null) + if (d instanceof cljs.core.RedNode) { + return new cljs.core.RedNode(a, b, c, d.blacken(), null); } - if(c instanceof cljs.core.BlackNode) { - return cljs.core.balance_left.call(null, a, b, c.redden(), d) + if (c instanceof cljs.core.BlackNode) { + return cljs.core.balance_left.call(null, a, b, c.redden(), d); } - if(c instanceof cljs.core.RedNode && c.right instanceof cljs.core.BlackNode) { - return new cljs.core.RedNode(c.right.key, c.right.val, cljs.core.balance_left.call(null, c.key, c.val, c.left.redden(), c.right.left), new cljs.core.BlackNode(a, b, c.right.right, d, null), null) + if (c instanceof cljs.core.RedNode && c.right instanceof cljs.core.BlackNode) { + return new cljs.core.RedNode(c.right.key, c.right.val, cljs.core.balance_left.call(null, c.key, c.val, c.left.redden(), c.right.left), new cljs.core.BlackNode(a, b, c.right.right, d, null), null); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw Error("red-black tree invariant violation"); } - return null + return null; }; cljs.core.tree_map_kv_reduce = function tree_map_kv_reduce(b, c, d) { d = null != b.left ? tree_map_kv_reduce.call(null, b.left, c, d) : d; - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d); } d = c.call(null, d, b.key, b.val); - if(cljs.core.reduced_QMARK_.call(null, d)) { - return cljs.core.deref.call(null, d) + if (cljs.core.reduced_QMARK_.call(null, d)) { + return cljs.core.deref.call(null, d); } b = null != b.right ? tree_map_kv_reduce.call(null, b.right, c, d) : d; - return cljs.core.reduced_QMARK_.call(null, b) ? cljs.core.deref.call(null, b) : b + return cljs.core.reduced_QMARK_.call(null, b) ? cljs.core.deref.call(null, b) : b; }; cljs.core.BlackNode = function(a, b, c, d, e) { this.key = a; @@ -10382,25 +10496,25 @@ cljs.core.BlackNode = function(a, b, c, d, e) { this.right = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32402207 + this.cljs$lang$protocol_mask$partition0$ = 32402207; }; cljs.core.BlackNode.cljs$lang$type = !0; cljs.core.BlackNode.cljs$lang$ctorStr = "cljs.core/BlackNode"; cljs.core.BlackNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/BlackNode") + return cljs.core._write.call(null, b, "cljs.core/BlackNode"); }; cljs.core.BlackNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._nth.call(null, this, b, null); }; cljs.core.BlackNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) + return cljs.core._nth.call(null, this, b, c); }; cljs.core.BlackNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c) + return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c); }; cljs.core.BlackNode.prototype.call = function() { var a = null; @@ -10409,107 +10523,107 @@ cljs.core.BlackNode.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.BlackNode.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.BlackNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.BlackNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null) + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null); }; cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return this.key + return this.key; }; cljs.core.BlackNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.BlackNode.prototype.add_right = function(a) { - return a.balance_right(this) + return a.balance_right(this); }; cljs.core.BlackNode.prototype.redden = function() { - return new cljs.core.RedNode(this.key, this.val, this.left, this.right, null) + return new cljs.core.RedNode(this.key, this.val, this.left, this.right, null); }; cljs.core.BlackNode.prototype.remove_right = function(a) { - return cljs.core.balance_right_del.call(null, this.key, this.val, this.left, a) + return cljs.core.balance_right_del.call(null, this.key, this.val, this.left, a); }; cljs.core.BlackNode.prototype.replace = function(a, b, c, d) { - return new cljs.core.BlackNode(a, b, c, d, null) + return new cljs.core.BlackNode(a, b, c, d, null); }; cljs.core.BlackNode.prototype.kv_reduce = function(a, b) { - return cljs.core.tree_map_kv_reduce.call(null, this, a, b) + return cljs.core.tree_map_kv_reduce.call(null, this, a, b); }; cljs.core.BlackNode.prototype.remove_left = function(a) { - return cljs.core.balance_left_del.call(null, this.key, this.val, a, this.right) + return cljs.core.balance_left_del.call(null, this.key, this.val, a, this.right); }; cljs.core.BlackNode.prototype.add_left = function(a) { - return a.balance_left(this) + return a.balance_left(this); }; cljs.core.BlackNode.prototype.balance_left = function(a) { - return new cljs.core.BlackNode(a.key, a.val, this, a.right, null) + return new cljs.core.BlackNode(a.key, a.val, this, a.right, null); }; cljs.core.BlackNode.prototype.balance_right = function(a) { - return new cljs.core.BlackNode(a.key, a.val, a.left, this, null) + return new cljs.core.BlackNode(a.key, a.val, a.left, this, null); }; cljs.core.BlackNode.prototype.blacken = function() { - return this + return this; }; cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) + return cljs.core.ci_reduce.call(null, this, b); }; cljs.core.BlackNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) + return cljs.core.ci_reduce.call(null, this, b, c); }; cljs.core.BlackNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key) + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key); }; cljs.core.BlackNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 2 + return 2; }; cljs.core.BlackNode.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.BlackNode.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null) + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null); }; cljs.core.BlackNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c) + return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c); }; cljs.core.BlackNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.BlackNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b) + return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b); }; cljs.core.BlackNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return null + return null; }; cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(0 === b) { - return this.key + if (0 === b) { + return this.key; } - if(1 === b) { - return this.val + if (1 === b) { + return this.val; } new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null; }; cljs.core.BlackNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null + return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null; }; cljs.core.BlackNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentVector.EMPTY + return cljs.core.PersistentVector.EMPTY; }; cljs.core.__GT_BlackNode = function(a, b, c, d, e) { - return new cljs.core.BlackNode(a, b, c, d, e) + return new cljs.core.BlackNode(a, b, c, d, e); }; cljs.core.RedNode = function(a, b, c, d, e) { this.key = a; @@ -10518,25 +10632,25 @@ cljs.core.RedNode = function(a, b, c, d, e) { this.right = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32402207 + this.cljs$lang$protocol_mask$partition0$ = 32402207; }; cljs.core.RedNode.cljs$lang$type = !0; cljs.core.RedNode.cljs$lang$ctorStr = "cljs.core/RedNode"; cljs.core.RedNode.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/RedNode") + return cljs.core._write.call(null, b, "cljs.core/RedNode"); }; cljs.core.RedNode.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._nth.call(null, this, b, null) + return cljs.core._nth.call(null, this, b, null); }; cljs.core.RedNode.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._nth.call(null, this, b, c) + return cljs.core._nth.call(null, this, b, c); }; cljs.core.RedNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { - return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c) + return cljs.core.assoc.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b, c); }; cljs.core.RedNode.prototype.call = function() { var a = null; @@ -10545,152 +10659,152 @@ cljs.core.RedNode.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.RedNode.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.RedNode.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.RedNode.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null) + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val, b], null); }; cljs.core.RedNode.prototype.cljs$core$IMapEntry$_key$arity$1 = function(a) { - return this.key + return this.key; }; cljs.core.RedNode.prototype.cljs$core$IMapEntry$_val$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.RedNode.prototype.add_right = function(a) { - return new cljs.core.RedNode(this.key, this.val, this.left, a, null) + return new cljs.core.RedNode(this.key, this.val, this.left, a, null); }; cljs.core.RedNode.prototype.redden = function() { throw Error("red-black tree invariant violation"); }; cljs.core.RedNode.prototype.remove_right = function(a) { - return new cljs.core.RedNode(this.key, this.val, this.left, a, null) + return new cljs.core.RedNode(this.key, this.val, this.left, a, null); }; cljs.core.RedNode.prototype.replace = function(a, b, c, d) { - return new cljs.core.RedNode(a, b, c, d, null) + return new cljs.core.RedNode(a, b, c, d, null); }; cljs.core.RedNode.prototype.kv_reduce = function(a, b) { - return cljs.core.tree_map_kv_reduce.call(null, this, a, b) + return cljs.core.tree_map_kv_reduce.call(null, this, a, b); }; cljs.core.RedNode.prototype.remove_left = function(a) { - return new cljs.core.RedNode(this.key, this.val, a, this.right, null) + return new cljs.core.RedNode(this.key, this.val, a, this.right, null); }; cljs.core.RedNode.prototype.add_left = function(a) { - return new cljs.core.RedNode(this.key, this.val, a, this.right, null) + return new cljs.core.RedNode(this.key, this.val, a, this.right, null); }; cljs.core.RedNode.prototype.balance_left = function(a) { return this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, this.left.blacken(), new cljs.core.BlackNode(a.key, a.val, this.right, a.right, null), null) : this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.right.key, this.right.val, new cljs.core.BlackNode(this.key, this.val, this.left, this.right.left, null), new cljs.core.BlackNode(a.key, a.val, this.right.right, a.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a.key, - a.val, this, a.right, null) : null + a.val, this, a.right, null) : null; }; cljs.core.RedNode.prototype.balance_right = function(a) { return this.right instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.key, this.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left, null), this.right.blacken(), null) : this.left instanceof cljs.core.RedNode ? new cljs.core.RedNode(this.left.key, this.left.val, new cljs.core.BlackNode(a.key, a.val, a.left, this.left.left, null), new cljs.core.BlackNode(this.key, this.val, this.left.right, this.right, null), null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? new cljs.core.BlackNode(a.key, - a.val, a.left, this, null) : null + a.val, a.left, this, null) : null; }; cljs.core.RedNode.prototype.blacken = function() { - return new cljs.core.BlackNode(this.key, this.val, this.left, this.right, null) + return new cljs.core.BlackNode(this.key, this.val, this.left, this.right, null); }; cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) + return cljs.core.ci_reduce.call(null, this, b); }; cljs.core.RedNode.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) + return cljs.core.ci_reduce.call(null, this, b, c); }; cljs.core.RedNode.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key) + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, this.val), this.key); }; cljs.core.RedNode.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return 2 + return 2; }; cljs.core.RedNode.prototype.cljs$core$IStack$_peek$arity$1 = function(a) { - return this.val + return this.val; }; cljs.core.RedNode.prototype.cljs$core$IStack$_pop$arity$1 = function(a) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null) + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key], null); }; cljs.core.RedNode.prototype.cljs$core$IVector$_assoc_n$arity$3 = function(a, b, c) { - return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c) + return(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null)).cljs$core$IVector$_assoc_n$arity$3(null, b, c); }; cljs.core.RedNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.RedNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b) + return cljs.core.with_meta.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this.key, this.val], null), b); }; cljs.core.RedNode.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return null + return null; }; cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(0 === b) { - return this.key + if (0 === b) { + return this.key; } - if(1 === b) { - return this.val + if (1 === b) { + return this.val; } new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null; }; cljs.core.RedNode.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null + return 0 === b ? this.key : 1 === b ? this.val : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c : null; }; cljs.core.RedNode.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.PersistentVector.EMPTY + return cljs.core.PersistentVector.EMPTY; }; cljs.core.__GT_RedNode = function(a, b, c, d, e) { - return new cljs.core.RedNode(a, b, c, d, e) + return new cljs.core.RedNode(a, b, c, d, e); }; cljs.core.tree_map_add = function tree_map_add(b, c, d, e, f) { - if(null == c) { - return new cljs.core.RedNode(d, e, null, null, null) + if (null == c) { + return new cljs.core.RedNode(d, e, null, null, null); } var g = b.call(null, d, c.key); - return 0 === g ? (f[0] = c, null) : 0 > g ? (b = tree_map_add.call(null, b, c.left, d, e, f), null != b ? c.add_left(b) : null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = tree_map_add.call(null, b, c.right, d, e, f), null != b ? c.add_right(b) : null) : null + return 0 === g ? (f[0] = c, null) : 0 > g ? (b = tree_map_add.call(null, b, c.left, d, e, f), null != b ? c.add_left(b) : null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (b = tree_map_add.call(null, b, c.right, d, e, f), null != b ? c.add_right(b) : null) : null; }; cljs.core.tree_map_append = function tree_map_append(b, c) { - if(null == b) { - return c + if (null == b) { + return c; } - if(null == c) { - return b + if (null == c) { + return b; } - if(b instanceof cljs.core.RedNode) { - if(c instanceof cljs.core.RedNode) { + if (b instanceof cljs.core.RedNode) { + if (c instanceof cljs.core.RedNode) { var d = tree_map_append.call(null, b.right, c.left); - return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.RedNode(b.key, b.val, b.left, d.left, null), new cljs.core.RedNode(c.key, c.val, d.right, c.right, null), null) : new cljs.core.RedNode(b.key, b.val, b.left, new cljs.core.RedNode(c.key, c.val, d, c.right, null), null) + return d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.RedNode(b.key, b.val, b.left, d.left, null), new cljs.core.RedNode(c.key, c.val, d.right, c.right, null), null) : new cljs.core.RedNode(b.key, b.val, b.left, new cljs.core.RedNode(c.key, c.val, d, c.right, null), null); } - return new cljs.core.RedNode(b.key, b.val, b.left, tree_map_append.call(null, b.right, c), null) + return new cljs.core.RedNode(b.key, b.val, b.left, tree_map_append.call(null, b.right, c), null); } return c instanceof cljs.core.RedNode ? new cljs.core.RedNode(c.key, c.val, tree_map_append.call(null, b, c.left), c.right, null) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? (d = tree_map_append.call(null, b.right, c.left), d instanceof cljs.core.RedNode ? new cljs.core.RedNode(d.key, d.val, new cljs.core.BlackNode(b.key, b.val, b.left, d.left, null), new cljs.core.BlackNode(c.key, c.val, d.right, c.right, null), null) : cljs.core.balance_left_del.call(null, b.key, b.val, b.left, - new cljs.core.BlackNode(c.key, c.val, d, c.right, null))) : null + new cljs.core.BlackNode(c.key, c.val, d, c.right, null))) : null; }; cljs.core.tree_map_remove = function tree_map_remove(b, c, d, e) { - if(null != c) { + if (null != c) { var f = b.call(null, d, c.key); - if(0 === f) { - return e[0] = c, cljs.core.tree_map_append.call(null, c.left, c.right) + if (0 === f) { + return e[0] = c, cljs.core.tree_map_append.call(null, c.left, c.right); } - if(0 > f) { - return b = tree_map_remove.call(null, b, c.left, d, e), null != b || null != e[0] ? c.left instanceof cljs.core.BlackNode ? cljs.core.balance_left_del.call(null, c.key, c.val, b, c.right) : new cljs.core.RedNode(c.key, c.val, b, c.right, null) : null + if (0 > f) { + return b = tree_map_remove.call(null, b, c.left, d, e), null != b || null != e[0] ? c.left instanceof cljs.core.BlackNode ? cljs.core.balance_left_del.call(null, c.key, c.val, b, c.right) : new cljs.core.RedNode(c.key, c.val, b, c.right, null) : null; } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - return b = tree_map_remove.call(null, b, c.right, d, e), null != b || null != e[0] ? c.right instanceof cljs.core.BlackNode ? cljs.core.balance_right_del.call(null, c.key, c.val, c.left, b) : new cljs.core.RedNode(c.key, c.val, c.left, b, null) : null + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + return b = tree_map_remove.call(null, b, c.right, d, e), null != b || null != e[0] ? c.right instanceof cljs.core.BlackNode ? cljs.core.balance_right_del.call(null, c.key, c.val, c.left, b) : new cljs.core.RedNode(c.key, c.val, c.left, b, null) : null; } } - return null + return null; }; cljs.core.tree_map_replace = function tree_map_replace(b, c, d, e) { var f = c.key, g = b.call(null, d, f); - return 0 === g ? c.replace(f, e, c.left, c.right) : 0 > g ? c.replace(f, c.val, tree_map_replace.call(null, b, c.left, d, e), c.right) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c.replace(f, c.val, c.left, tree_map_replace.call(null, b, c.right, d, e)) : null + return 0 === g ? c.replace(f, e, c.left, c.right) : 0 > g ? c.replace(f, c.val, tree_map_replace.call(null, b, c.left, d, e), c.right) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? c.replace(f, c.val, c.left, tree_map_replace.call(null, b, c.right, d, e)) : null; }; cljs.core.PersistentTreeMap = function(a, b, c, d, e) { this.comp = a; @@ -10699,31 +10813,31 @@ cljs.core.PersistentTreeMap = function(a, b, c, d, e) { this.meta = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 418776847 + this.cljs$lang$protocol_mask$partition0$ = 418776847; }; cljs.core.PersistentTreeMap.cljs$lang$type = !0; cljs.core.PersistentTreeMap.cljs$lang$ctorStr = "cljs.core/PersistentTreeMap"; cljs.core.PersistentTreeMap.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMap") + return cljs.core._write.call(null, b, "cljs.core/PersistentTreeMap"); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_imap.call(null, this); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { a = this.entry_at(b); - return null != a ? a.val : c + return null != a ? a.val : c; }; cljs.core.PersistentTreeMap.prototype.cljs$core$IAssociative$_assoc$arity$3 = function(a, b, c) { a = [null]; var d = cljs.core.tree_map_add.call(null, this.comp, this.tree, b, c, a); - return null == d ? (a = cljs.core.nth.call(null, a, 0), cljs.core._EQ_.call(null, c, a.val) ? this : new cljs.core.PersistentTreeMap(this.comp, cljs.core.tree_map_replace.call(null, this.comp, this.tree, b, c), this.cnt, this.meta, null)) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt + 1, this.meta, null) + return null == d ? (a = cljs.core.nth.call(null, a, 0), cljs.core._EQ_.call(null, c, a.val) ? this : new cljs.core.PersistentTreeMap(this.comp, cljs.core.tree_map_replace.call(null, this.comp, this.tree, b, c), this.cnt, this.meta, null)) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt + 1, this.meta, null); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = function(a, b) { - return null != this.entry_at(b) + return null != this.entry_at(b); }; cljs.core.PersistentTreeMap.prototype.call = function() { var a = null; @@ -10732,398 +10846,405 @@ cljs.core.PersistentTreeMap.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.PersistentTreeMap.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IKVReduce$_kv_reduce$arity$3 = function(a, b, c) { - return null != this.tree ? cljs.core.tree_map_kv_reduce.call(null, this.tree, b, c) : c + return null != this.tree ? cljs.core.tree_map_kv_reduce.call(null, this.tree, b, c) : c; }; cljs.core.PersistentTreeMap.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b) + return cljs.core.vector_QMARK_.call(null, b) ? cljs.core._assoc.call(null, this, cljs.core._nth.call(null, b, 0), cljs.core._nth.call(null, b, 1)) : cljs.core.reduce.call(null, cljs.core._conj, this, b); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !1, this.cnt) : null + return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !1, this.cnt) : null; +}; +cljs.core.PersistentTreeMap.prototype.toString = function() { + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentTreeMap.prototype.entry_at = function(a) { - for(var b = this.tree;;) { - if(null != b) { + for (var b = this.tree;;) { + if (null != b) { var c = this.comp.call(null, a, b.key); - if(0 === c) { - return b - } - if(0 > c) { - b = b.left - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - b = b.right - }else { - return null + if (0 === c) { + return b; + } + if (0 > c) { + b = b.left; + } else { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + b = b.right; + } else { + return null; } } - }else { - return null + } else { + return null; } } }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_sorted_seq$arity$2 = function(a, b) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, b, this.cnt) : null + return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, b, this.cnt) : null; }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = function(a, b, c) { - if(0 < this.cnt) { + if (0 < this.cnt) { a = null; - for(var d = this.tree;;) { - if(null != d) { + for (var d = this.tree;;) { + if (null != d) { var e = this.comp.call(null, b, d.key); - if(0 === e) { - return new cljs.core.PersistentTreeMapSeq(null, cljs.core.conj.call(null, a, d), c, -1, null) + if (0 === e) { + return new cljs.core.PersistentTreeMapSeq(null, cljs.core.conj.call(null, a, d), c, -1, null); } - if(cljs.core.truth_(c)) { - 0 > e ? (a = cljs.core.conj.call(null, a, d), d = d.left) : d = d.right - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - 0 < e ? (a = cljs.core.conj.call(null, a, d), d = d.right) : d = d.left - }else { - return null + if (cljs.core.truth_(c)) { + 0 > e ? (a = cljs.core.conj.call(null, a, d), d = d.left) : d = d.right; + } else { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + 0 < e ? (a = cljs.core.conj.call(null, a, d), d = d.right) : d = d.left; + } else { + return null; } } - }else { - return null == a ? null : new cljs.core.PersistentTreeMapSeq(null, a, c, -1, null) + } else { + return null == a ? null : new cljs.core.PersistentTreeMapSeq(null, a, c, -1, null); } } - }else { - return null + } else { + return null; } }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_entry_key$arity$2 = function(a, b) { - return cljs.core.key.call(null, b) + return cljs.core.key.call(null, b); }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISorted$_comparator$arity$1 = function(a) { - return this.comp + return this.comp; }; cljs.core.PersistentTreeMap.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !0, this.cnt) : null + return 0 < this.cnt ? cljs.core.create_tree_map_seq.call(null, this.tree, !0, this.cnt) : null; }; cljs.core.PersistentTreeMap.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return this.cnt + return this.cnt; }; cljs.core.PersistentTreeMap.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_map.call(null, this, b) + return cljs.core.equiv_map.call(null, this, b); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, b, this.__hash) + return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, b, this.__hash); +}; +cljs.core.PersistentTreeMap.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentTreeMap.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentTreeMap(this.comp, this.tree, this.cnt, this.meta, this.__hash); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentTreeMap.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentTreeMap.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.PersistentTreeMap.EMPTY, this.meta); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IMap$_dissoc$arity$2 = function(a, b) { var c = [null], d = cljs.core.tree_map_remove.call(null, this.comp, this.tree, b, c); - return null == d ? null == cljs.core.nth.call(null, c, 0) ? this : new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, null) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt - 1, this.meta, null) + return null == d ? null == cljs.core.nth.call(null, c, 0) ? this : new cljs.core.PersistentTreeMap(this.comp, null, 0, this.meta, null) : new cljs.core.PersistentTreeMap(this.comp, d.blacken(), this.cnt - 1, this.meta, null); }; cljs.core.__GT_PersistentTreeMap = function(a, b, c, d, e) { - return new cljs.core.PersistentTreeMap(a, b, c, d, e) + return new cljs.core.PersistentTreeMap(a, b, c, d, e); }; cljs.core.PersistentTreeMap.EMPTY = new cljs.core.PersistentTreeMap(cljs.core.compare, null, 0, null, 0); cljs.core.hash_map = function() { var a = function(a) { a = cljs.core.seq.call(null, a); - for(var b = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { - if(a) { + for (var b = cljs.core.transient$.call(null, cljs.core.PersistentHashMap.EMPTY);;) { + if (a) { var e = cljs.core.nnext.call(null, a), b = cljs.core.assoc_BANG_.call(null, b, cljs.core.first.call(null, a), cljs.core.second.call(null, a)); - a = e - }else { - return cljs.core.persistent_BANG_.call(null, b) + a = e; + } else { + return cljs.core.persistent_BANG_.call(null, b); } } }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.array_map = function() { var a = function(a) { - return new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, cljs.core.count.call(null, a), 2), cljs.core.apply.call(null, cljs.core.array, a), null) + return new cljs.core.PersistentArrayMap(null, cljs.core.quot.call(null, cljs.core.count.call(null, a), 2), cljs.core.apply.call(null, cljs.core.array, a), null); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.obj_map = function() { var a = function(a) { var b = [], e; e = {}; - for(a = cljs.core.seq.call(null, a);;) { - if(a) { - b.push(cljs.core.first.call(null, a)), e[cljs.core.first.call(null, a)] = cljs.core.second.call(null, a), a = cljs.core.nnext.call(null, a) - }else { - return cljs.core.ObjMap.fromObject.call(null, b, e) + for (a = cljs.core.seq.call(null, a);;) { + if (a) { + b.push(cljs.core.first.call(null, a)), e[cljs.core.first.call(null, a)] = cljs.core.second.call(null, a), a = cljs.core.nnext.call(null, a); + } else { + return cljs.core.ObjMap.fromObject.call(null, b, e); } } }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.sorted_map = function() { var a = function(a) { a = cljs.core.seq.call(null, a); - for(var b = cljs.core.PersistentTreeMap.EMPTY;;) { - if(a) { + for (var b = cljs.core.PersistentTreeMap.EMPTY;;) { + if (a) { var e = cljs.core.nnext.call(null, a), b = cljs.core.assoc.call(null, b, cljs.core.first.call(null, a), cljs.core.second.call(null, a)); - a = e - }else { - return b + a = e; + } else { + return b; } } }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.sorted_map_by = function() { var a = function(a, b) { - for(var e = cljs.core.seq.call(null, b), f = new cljs.core.PersistentTreeMap(cljs.core.fn__GT_comparator.call(null, a), null, 0, null, 0);;) { - if(e) { + for (var e = cljs.core.seq.call(null, b), f = new cljs.core.PersistentTreeMap(cljs.core.fn__GT_comparator.call(null, a), null, 0, null, 0);;) { + if (e) { var g = cljs.core.nnext.call(null, e), f = cljs.core.assoc.call(null, f, cljs.core.first.call(null, e), cljs.core.second.call(null, e)), e = g - }else { - return f + } else { + return f; } } }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.KeySeq = function(a, b) { this.mseq = a; this._meta = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988 + this.cljs$lang$protocol_mask$partition0$ = 32374988; }; cljs.core.KeySeq.cljs$lang$type = !0; cljs.core.KeySeq.cljs$lang$ctorStr = "cljs.core/KeySeq"; cljs.core.KeySeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/KeySeq") + return cljs.core._write.call(null, b, "cljs.core/KeySeq"); }; cljs.core.KeySeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) + return cljs.core.hash_coll.call(null, this); }; cljs.core.KeySeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null == a ? null : new cljs.core.KeySeq(a, this._meta) + return null == a ? null : new cljs.core.KeySeq(a, this._meta); }; cljs.core.KeySeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.KeySeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.KeySeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.KeySeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.KeySeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.KeySeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { a = cljs.core._first.call(null, this.mseq); - return cljs.core._key.call(null, a) + return cljs.core._key.call(null, a); }; cljs.core.KeySeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null != a ? new cljs.core.KeySeq(a, this._meta) : cljs.core.List.EMPTY + return null != a ? new cljs.core.KeySeq(a, this._meta) : cljs.core.List.EMPTY; }; cljs.core.KeySeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.KeySeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.KeySeq(this.mseq, b) + return new cljs.core.KeySeq(this.mseq, b); }; cljs.core.KeySeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta + return this._meta; }; cljs.core.KeySeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta); }; cljs.core.__GT_KeySeq = function(a, b) { - return new cljs.core.KeySeq(a, b) + return new cljs.core.KeySeq(a, b); }; cljs.core.keys = function(a) { - return(a = cljs.core.seq.call(null, a)) ? new cljs.core.KeySeq(a, null) : null + return(a = cljs.core.seq.call(null, a)) ? new cljs.core.KeySeq(a, null) : null; }; cljs.core.key = function(a) { - return cljs.core._key.call(null, a) + return cljs.core._key.call(null, a); }; cljs.core.ValSeq = function(a, b) { this.mseq = a; this._meta = b; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32374988 + this.cljs$lang$protocol_mask$partition0$ = 32374988; }; cljs.core.ValSeq.cljs$lang$type = !0; cljs.core.ValSeq.cljs$lang$ctorStr = "cljs.core/ValSeq"; cljs.core.ValSeq.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ValSeq") + return cljs.core._write.call(null, b, "cljs.core/ValSeq"); }; cljs.core.ValSeq.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return cljs.core.hash_coll.call(null, this) + return cljs.core.hash_coll.call(null, this); }; cljs.core.ValSeq.prototype.cljs$core$INext$_next$arity$1 = function(a) { a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null == a ? null : new cljs.core.ValSeq(a, this._meta) + return null == a ? null : new cljs.core.ValSeq(a, this._meta); }; cljs.core.ValSeq.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.ValSeq.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.ValSeq.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.seq_reduce.call(null, b, this) + return cljs.core.seq_reduce.call(null, b, this); }; cljs.core.ValSeq.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.seq_reduce.call(null, b, c, this) + return cljs.core.seq_reduce.call(null, b, c, this); }; cljs.core.ValSeq.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return this + return this; }; cljs.core.ValSeq.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { a = cljs.core._first.call(null, this.mseq); - return cljs.core._val.call(null, a) + return cljs.core._val.call(null, a); }; cljs.core.ValSeq.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { a = ((a = this.mseq) ? a.cljs$lang$protocol_mask$partition0$ & 128 || a.cljs$core$INext$ || (a.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.INext, a)) ? cljs.core._next.call(null, this.mseq) : cljs.core.next.call(null, this.mseq); - return null != a ? new cljs.core.ValSeq(a, this._meta) : cljs.core.List.EMPTY + return null != a ? new cljs.core.ValSeq(a, this._meta) : cljs.core.List.EMPTY; }; cljs.core.ValSeq.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.ValSeq.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.ValSeq(this.mseq, b) + return new cljs.core.ValSeq(this.mseq, b); }; cljs.core.ValSeq.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this._meta + return this._meta; }; cljs.core.ValSeq.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this._meta); }; cljs.core.__GT_ValSeq = function(a, b) { - return new cljs.core.ValSeq(a, b) + return new cljs.core.ValSeq(a, b); }; cljs.core.vals = function(a) { - return(a = cljs.core.seq.call(null, a)) ? new cljs.core.ValSeq(a, null) : null + return(a = cljs.core.seq.call(null, a)) ? new cljs.core.ValSeq(a, null) : null; }; cljs.core.val = function(a) { - return cljs.core._val.call(null, a) + return cljs.core._val.call(null, a); }; cljs.core.merge = function() { var a = function(a) { return cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, a)) ? cljs.core.reduce.call(null, function(a, b) { - return cljs.core.conj.call(null, cljs.core.truth_(a) ? a : cljs.core.PersistentArrayMap.EMPTY, b) - }, a) : null + return cljs.core.conj.call(null, cljs.core.truth_(a) ? a : cljs.core.PersistentArrayMap.EMPTY, b); + }, a) : null; }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.merge_with = function() { var a = function(a, b) { - if(cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, b))) { + if (cljs.core.truth_(cljs.core.some.call(null, cljs.core.identity, b))) { var e = function(a) { return function(b, c) { - return cljs.core.reduce.call(null, a, cljs.core.truth_(b) ? b : cljs.core.PersistentArrayMap.EMPTY, cljs.core.seq.call(null, c)) - } + return cljs.core.reduce.call(null, a, cljs.core.truth_(b) ? b : cljs.core.PersistentArrayMap.EMPTY, cljs.core.seq.call(null, c)); + }; }(function(b, d) { var e = cljs.core.first.call(null, d), k = cljs.core.second.call(null, d); - return cljs.core.contains_QMARK_.call(null, b, e) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), k)) : cljs.core.assoc.call(null, b, e, k) + return cljs.core.contains_QMARK_.call(null, b, e) ? cljs.core.assoc.call(null, b, e, a.call(null, cljs.core.get.call(null, b, e), k)) : cljs.core.assoc.call(null, b, e, k); }); - return cljs.core.reduce.call(null, e, b) + return cljs.core.reduce.call(null, e, b); } - return null + return null; }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.select_keys = function(a, b) { - for(var c = cljs.core.PersistentArrayMap.EMPTY, d = cljs.core.seq.call(null, b);;) { - if(d) { + for (var c = cljs.core.PersistentArrayMap.EMPTY, d = cljs.core.seq.call(null, b);;) { + if (d) { var e = cljs.core.first.call(null, d), f = cljs.core.get.call(null, a, e, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", 4155500789)), c = cljs.core.not_EQ_.call(null, f, new cljs.core.Keyword("cljs.core", "not-found", "cljs.core/not-found", 4155500789)) ? cljs.core.assoc.call(null, c, e, f) : c, d = cljs.core.next.call(null, d) - }else { - return c + } else { + return c; } } }; @@ -11132,25 +11253,25 @@ cljs.core.PersistentHashSet = function(a, b, c) { this.hash_map = b; this.__hash = c; this.cljs$lang$protocol_mask$partition1$ = 4; - this.cljs$lang$protocol_mask$partition0$ = 15077647 + this.cljs$lang$protocol_mask$partition0$ = 15077647; }; cljs.core.PersistentHashSet.cljs$lang$type = !0; cljs.core.PersistentHashSet.cljs$lang$ctorStr = "cljs.core/PersistentHashSet"; cljs.core.PersistentHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentHashSet") + return cljs.core._write.call(null, b, "cljs.core/PersistentHashSet"); }; cljs.core.PersistentHashSet.prototype.cljs$core$IEditableCollection$_as_transient$arity$1 = function(a) { - return new cljs.core.TransientHashSet(cljs.core._as_transient.call(null, this.hash_map)) + return new cljs.core.TransientHashSet(cljs.core._as_transient.call(null, this.hash_map)); }; cljs.core.PersistentHashSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this); }; cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.PersistentHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._contains_key_QMARK_.call(null, this.hash_map, b) ? b : c + return cljs.core._contains_key_QMARK_.call(null, this.hash_map, b) ? b : c; }; cljs.core.PersistentHashSet.prototype.call = function() { var a = null; @@ -11159,71 +11280,75 @@ cljs.core.PersistentHashSet.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.PersistentHashSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.PersistentHashSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentHashSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentHashSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(this.meta, cljs.core.assoc.call(null, this.hash_map, b, null), null) + return new cljs.core.PersistentHashSet(this.meta, cljs.core.assoc.call(null, this.hash_map, b, null), null); }; cljs.core.PersistentHashSet.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentHashSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.keys.call(null, this.hash_map) + return cljs.core.keys.call(null, this.hash_map); }; cljs.core.PersistentHashSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(this.meta, cljs.core._dissoc.call(null, this.hash_map, b), null) + return new cljs.core.PersistentHashSet(this.meta, cljs.core._dissoc.call(null, this.hash_map, b), null); }; cljs.core.PersistentHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core._count.call(null, this.hash_map) + return cljs.core._count.call(null, this.hash_map); }; cljs.core.PersistentHashSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { var c = this; return cljs.core.set_QMARK_.call(null, b) && cljs.core.count.call(null, c) === cljs.core.count.call(null, b) && cljs.core.every_QMARK_.call(null, function(a) { - return cljs.core.contains_QMARK_.call(null, c, a) - }, b) + return cljs.core.contains_QMARK_.call(null, c, a); + }, b); }; cljs.core.PersistentHashSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentHashSet(b, this.hash_map, this.__hash) + return new cljs.core.PersistentHashSet(b, this.hash_map, this.__hash); +}; +cljs.core.PersistentHashSet.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentHashSet.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentHashSet(this.meta, this.hash_map, this.__hash); }; cljs.core.PersistentHashSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentHashSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentHashSet.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.PersistentHashSet.EMPTY, this.meta); }; cljs.core.__GT_PersistentHashSet = function(a, b, c) { - return new cljs.core.PersistentHashSet(a, b, c) + return new cljs.core.PersistentHashSet(a, b, c); }; cljs.core.PersistentHashSet.EMPTY = new cljs.core.PersistentHashSet(null, cljs.core.PersistentArrayMap.EMPTY, 0); cljs.core.PersistentHashSet.fromArray = function(a, b) { var c = a.length; - if(c <= cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD) { + if (c <= cljs.core.PersistentArrayMap.HASHMAP_THRESHOLD) { b || cljs.core.aclone.call(null, a); - for(var d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { - if(d < c) { + for (var d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY);;) { + if (d < c) { var f = d + 1, e = cljs.core._assoc_BANG_.call(null, e, a[d], null), d = f - }else { - return new cljs.core.PersistentHashSet(null, cljs.core._persistent_BANG_.call(null, e), null) + } else { + return new cljs.core.PersistentHashSet(null, cljs.core._persistent_BANG_.call(null, e), null); } } - }else { - for(d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashSet.EMPTY);;) { - if(d < c) { - f = d + 2, e = cljs.core._conj_BANG_.call(null, e, a[d]), d = f - }else { - return cljs.core._persistent_BANG_.call(null, e) + } else { + for (d = 0, e = cljs.core.transient$.call(null, cljs.core.PersistentHashSet.EMPTY);;) { + if (d < c) { + f = d + 1, e = cljs.core._conj_BANG_.call(null, e, a[d]), d = f; + } else { + return cljs.core._persistent_BANG_.call(null, e); } } } @@ -11231,12 +11356,12 @@ cljs.core.PersistentHashSet.fromArray = function(a, b) { cljs.core.TransientHashSet = function(a) { this.transient_map = a; this.cljs$lang$protocol_mask$partition0$ = 259; - this.cljs$lang$protocol_mask$partition1$ = 136 + this.cljs$lang$protocol_mask$partition1$ = 136; }; cljs.core.TransientHashSet.cljs$lang$type = !0; cljs.core.TransientHashSet.cljs$lang$ctorStr = "cljs.core/TransientHashSet"; cljs.core.TransientHashSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/TransientHashSet") + return cljs.core._write.call(null, b, "cljs.core/TransientHashSet"); }; cljs.core.TransientHashSet.prototype.call = function() { var a = null; @@ -11247,65 +11372,65 @@ cljs.core.TransientHashSet.prototype.call = function() { e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : c; return e; case 3: - return e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? d : c, e + return e = cljs.core._lookup.call(null, this.transient_map, c, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? d : c, e; } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.TransientHashSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.TransientHashSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : a + return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? null : a; }; cljs.core.TransientHashSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? b : a + return cljs.core._lookup.call(null, this.transient_map, a, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? b : a; }; cljs.core.TransientHashSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.TransientHashSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { - return cljs.core._lookup.call(null, this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b + return cljs.core._lookup.call(null, this.transient_map, b, cljs.core.lookup_sentinel) === cljs.core.lookup_sentinel ? c : b; }; cljs.core.TransientHashSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.count.call(null, this.transient_map) + return cljs.core.count.call(null, this.transient_map); }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientSet$_disjoin_BANG_$arity$2 = function(a, b) { this.transient_map = cljs.core.dissoc_BANG_.call(null, this.transient_map, b); - return this + return this; }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientCollection$_conj_BANG_$arity$2 = function(a, b) { this.transient_map = cljs.core.assoc_BANG_.call(null, this.transient_map, b, null); - return this + return this; }; cljs.core.TransientHashSet.prototype.cljs$core$ITransientCollection$_persistent_BANG_$arity$1 = function(a) { - return new cljs.core.PersistentHashSet(null, cljs.core.persistent_BANG_.call(null, this.transient_map), null) + return new cljs.core.PersistentHashSet(null, cljs.core.persistent_BANG_.call(null, this.transient_map), null); }; cljs.core.__GT_TransientHashSet = function(a) { - return new cljs.core.TransientHashSet(a) + return new cljs.core.TransientHashSet(a); }; cljs.core.PersistentTreeSet = function(a, b, c) { this.meta = a; this.tree_map = b; this.__hash = c; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 417730831 + this.cljs$lang$protocol_mask$partition0$ = 417730831; }; cljs.core.PersistentTreeSet.cljs$lang$type = !0; cljs.core.PersistentTreeSet.cljs$lang$ctorStr = "cljs.core/PersistentTreeSet"; cljs.core.PersistentTreeSet.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/PersistentTreeSet") + return cljs.core._write.call(null, b, "cljs.core/PersistentTreeSet"); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_iset.call(null, this); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$2 = function(a, b) { - return cljs.core._lookup.call(null, this, b, null) + return cljs.core._lookup.call(null, this, b, null); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ILookup$_lookup$arity$3 = function(a, b, c) { a = this.tree_map.entry_at(b); - return null != a ? a.key : c + return null != a ? a.key : c; }; cljs.core.PersistentTreeSet.prototype.call = function() { var a = null; @@ -11314,129 +11439,133 @@ cljs.core.PersistentTreeSet.prototype.call = function() { case 2: return this.cljs$core$ILookup$_lookup$arity$2(null, c); case 3: - return this.cljs$core$ILookup$_lookup$arity$3(null, c, d) + return this.cljs$core$ILookup$_lookup$arity$3(null, c, d); } throw Error("Invalid arity: " + arguments.length); - } + }; }(); cljs.core.PersistentTreeSet.prototype.apply = function(a, b) { - return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))) + return this.call.apply(this, [this].concat(cljs.core.aclone.call(null, b))); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IFn$_invoke$arity$1 = function(a) { - return this.cljs$core$ILookup$_lookup$arity$2(null, a) + return this.cljs$core$ILookup$_lookup$arity$2(null, a); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return this.cljs$core$ILookup$_lookup$arity$3(null, a, b) + return this.cljs$core$ILookup$_lookup$arity$3(null, a, b); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core.assoc.call(null, this.tree_map, b, null), null) + return new cljs.core.PersistentTreeSet(this.meta, cljs.core.assoc.call(null, this.tree_map, b, null), null); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IReversible$_rseq$arity$1 = function(a) { - return 0 < cljs.core.count.call(null, this.tree_map) ? cljs.core.map.call(null, cljs.core.key, cljs.core.rseq.call(null, this.tree_map)) : null + return 0 < cljs.core.count.call(null, this.tree_map) ? cljs.core.map.call(null, cljs.core.key, cljs.core.rseq.call(null, this.tree_map)) : null; }; cljs.core.PersistentTreeSet.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq$arity$2 = function(a, b) { - return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq.call(null, this.tree_map, b)) + return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq.call(null, this.tree_map, b)); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = function(a, b, c) { - return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq_from.call(null, this.tree_map, b, c)) + return cljs.core.map.call(null, cljs.core.key, cljs.core._sorted_seq_from.call(null, this.tree_map, b, c)); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_entry_key$arity$2 = function(a, b) { - return b + return b; }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_comparator$arity$1 = function(a) { - return cljs.core._comparator.call(null, this.tree_map) + return cljs.core._comparator.call(null, this.tree_map); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return cljs.core.keys.call(null, this.tree_map) + return cljs.core.keys.call(null, this.tree_map); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ISet$_disjoin$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(this.meta, cljs.core.dissoc.call(null, this.tree_map, b), null) + return new cljs.core.PersistentTreeSet(this.meta, cljs.core.dissoc.call(null, this.tree_map, b), null); }; cljs.core.PersistentTreeSet.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.count.call(null, this.tree_map) + return cljs.core.count.call(null, this.tree_map); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { var c = this; return cljs.core.set_QMARK_.call(null, b) && cljs.core.count.call(null, c) === cljs.core.count.call(null, b) && cljs.core.every_QMARK_.call(null, function(a) { - return cljs.core.contains_QMARK_.call(null, c, a) - }, b) + return cljs.core.contains_QMARK_.call(null, c, a); + }, b); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.PersistentTreeSet(b, this.tree_map, this.__hash) + return new cljs.core.PersistentTreeSet(b, this.tree_map, this.__hash); +}; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICloneable$ = !0; +cljs.core.PersistentTreeSet.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.PersistentTreeSet(this.meta, this.tree_map, this.__hash); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.PersistentTreeSet.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.PersistentTreeSet.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.PersistentTreeSet.EMPTY, this.meta); }; cljs.core.__GT_PersistentTreeSet = function(a, b, c) { - return new cljs.core.PersistentTreeSet(a, b, c) + return new cljs.core.PersistentTreeSet(a, b, c); }; cljs.core.PersistentTreeSet.EMPTY = new cljs.core.PersistentTreeSet(null, cljs.core.PersistentTreeMap.EMPTY, 0); cljs.core.set_from_indexed_seq = function(a) { a = a.arr; a: { - for(var b = 0, c = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { - if(b < a.length) { + for (var b = 0, c = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { + if (b < a.length) { var d = b + 1, c = cljs.core._conj_BANG_.call(null, c, a[b]), b = d - }else { + } else { a = c; - break a + break a; } } - a = void 0 + a = void 0; } - return cljs.core._persistent_BANG_.call(null, a) + return cljs.core._persistent_BANG_.call(null, a); }; cljs.core.set = function(a) { a = cljs.core.seq.call(null, a); - if(null == a) { - return cljs.core.PersistentHashSet.EMPTY + if (null == a) { + return cljs.core.PersistentHashSet.EMPTY; } - if(a instanceof cljs.core.IndexedSeq) { - return cljs.core.set_from_indexed_seq.call(null, a) + if (a instanceof cljs.core.IndexedSeq && 0 === a.i) { + return cljs.core.set_from_indexed_seq.call(null, a); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - for(var b = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { - if(null != a) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + for (var b = cljs.core._as_transient.call(null, cljs.core.PersistentHashSet.EMPTY);;) { + if (null != a) { var c = cljs.core._next.call(null, a), b = cljs.core._conj_BANG_.call(null, b, cljs.core._first.call(null, a)); - a = c - }else { - return cljs.core._persistent_BANG_.call(null, b) + a = c; + } else { + return cljs.core._persistent_BANG_.call(null, b); } } - }else { - return null + } else { + return null; } }; cljs.core.hash_set = function() { var a = null, b = function() { - return cljs.core.PersistentHashSet.EMPTY + return cljs.core.PersistentHashSet.EMPTY; }, c = function() { var a = function(a) { - return cljs.core.set.call(null, a) + return cljs.core.set.call(null, a); }, b = function(b) { var c = null; 0 < arguments.length && (c = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, c) + return a.call(this, c); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a) { switch(arguments.length) { case 0: return b.call(this); default: - return c.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)) + return c.cljs$core$IFn$_invoke$arity$variadic(cljs.core.array_seq(arguments, 0)); } throw Error("Invalid arity: " + arguments.length); }; @@ -11444,113 +11573,113 @@ cljs.core.hash_set = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.sorted_set = function() { var a = function(a) { - return cljs.core.reduce.call(null, cljs.core._conj, cljs.core.PersistentTreeSet.EMPTY, a) + return cljs.core.reduce.call(null, cljs.core._conj, cljs.core.PersistentTreeSet.EMPTY, a); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.sorted_set_by = function() { var a = function(a, b) { - return cljs.core.reduce.call(null, cljs.core._conj, new cljs.core.PersistentTreeSet(null, cljs.core.sorted_map_by.call(null, a), 0), b) + return cljs.core.reduce.call(null, cljs.core._conj, new cljs.core.PersistentTreeSet(null, cljs.core.sorted_map_by.call(null, a), 0), b); }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.replace = function(a, b) { - if(cljs.core.vector_QMARK_.call(null, b)) { + if (cljs.core.vector_QMARK_.call(null, b)) { var c = cljs.core.count.call(null, b); return cljs.core.reduce.call(null, function(b, c) { var f = cljs.core.find.call(null, a, cljs.core.nth.call(null, b, c)); - return cljs.core.truth_(f) ? cljs.core.assoc.call(null, b, c, cljs.core.second.call(null, f)) : b - }, b, cljs.core.take.call(null, c, cljs.core.iterate.call(null, cljs.core.inc, 0))) + return cljs.core.truth_(f) ? cljs.core.assoc.call(null, b, c, cljs.core.second.call(null, f)) : b; + }, b, cljs.core.take.call(null, c, cljs.core.iterate.call(null, cljs.core.inc, 0))); } return cljs.core.map.call(null, function(b) { var c = cljs.core.find.call(null, a, b); - return cljs.core.truth_(c) ? cljs.core.second.call(null, c) : b - }, b) + return cljs.core.truth_(c) ? cljs.core.second.call(null, c) : b; + }, b); }; cljs.core.distinct = function(a) { return function c(a, e) { return new cljs.core.LazySeq(null, function() { return function(a, d) { - for(;;) { + for (;;) { var e = a, k = cljs.core.nth.call(null, e, 0, null); - if(e = cljs.core.seq.call(null, e)) { - if(cljs.core.contains_QMARK_.call(null, d, k)) { - k = cljs.core.rest.call(null, e), e = d, a = k, d = e - }else { - return cljs.core.cons.call(null, k, c.call(null, cljs.core.rest.call(null, e), cljs.core.conj.call(null, d, k))) + if (e = cljs.core.seq.call(null, e)) { + if (cljs.core.contains_QMARK_.call(null, d, k)) { + k = cljs.core.rest.call(null, e), e = d, a = k, d = e; + } else { + return cljs.core.cons.call(null, k, c.call(null, cljs.core.rest.call(null, e), cljs.core.conj.call(null, d, k))); } - }else { - return null + } else { + return null; } } - }.call(null, a, e) - }, null, null) - }.call(null, a, cljs.core.PersistentHashSet.EMPTY) + }.call(null, a, e); + }, null, null); + }.call(null, a, cljs.core.PersistentHashSet.EMPTY); }; cljs.core.butlast = function(a) { - for(var b = cljs.core.PersistentVector.EMPTY;;) { - if(cljs.core.next.call(null, a)) { - b = cljs.core.conj.call(null, b, cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a) - }else { - return cljs.core.seq.call(null, b) + for (var b = cljs.core.PersistentVector.EMPTY;;) { + if (cljs.core.next.call(null, a)) { + b = cljs.core.conj.call(null, b, cljs.core.first.call(null, a)), a = cljs.core.next.call(null, a); + } else { + return cljs.core.seq.call(null, b); } } }; cljs.core.name = function(a) { - if(a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { - return cljs.core._name.call(null, a) + if (a && (a.cljs$lang$protocol_mask$partition1$ & 4096 || a.cljs$core$INamed$)) { + return cljs.core._name.call(null, a); } - if("string" === typeof a) { - return a + if ("string" === typeof a) { + return a; } throw Error([cljs.core.str("Doesn't support name: "), cljs.core.str(a)].join("")); }; cljs.core.zipmap = function(a, b) { - for(var c = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), d = cljs.core.seq.call(null, a), e = cljs.core.seq.call(null, b);;) { - if(d && e) { - c = cljs.core.assoc_BANG_.call(null, c, cljs.core.first.call(null, d), cljs.core.first.call(null, e)), d = cljs.core.next.call(null, d), e = cljs.core.next.call(null, e) - }else { - return cljs.core.persistent_BANG_.call(null, c) + for (var c = cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), d = cljs.core.seq.call(null, a), e = cljs.core.seq.call(null, b);;) { + if (d && e) { + c = cljs.core.assoc_BANG_.call(null, c, cljs.core.first.call(null, d), cljs.core.first.call(null, e)), d = cljs.core.next.call(null, d), e = cljs.core.next.call(null, e); + } else { + return cljs.core.persistent_BANG_.call(null, c); } } }; cljs.core.max_key = function() { var a = null, b = function(a, b, c) { - return a.call(null, b) > a.call(null, c) ? b : c + return a.call(null, b) > a.call(null, c) ? b : c; }, c = function() { var b = function(b, c, d, e) { return cljs.core.reduce.call(null, function(c, d) { - return a.call(null, b, c, d) - }, a.call(null, b, c, d), e) + return a.call(null, b, c, d); + }, a.call(null, b, c, d), e); }, c = function(a, c, e, k) { var l = null; 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, e, l) + return b.call(this, a, c, e, l); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -11560,10 +11689,10 @@ cljs.core.max_key = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a) + return b(c, e, k, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f, g) { switch(arguments.length) { case 2: @@ -11571,31 +11700,31 @@ cljs.core.max_key = function() { case 3: return b.call(this, a, e, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return b + return b; }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.min_key = function() { var a = null, b = function(a, b, c) { - return a.call(null, b) < a.call(null, c) ? b : c + return a.call(null, b) < a.call(null, c) ? b : c; }, c = function() { var b = function(b, c, d, e) { return cljs.core.reduce.call(null, function(c, d) { - return a.call(null, b, c, d) - }, a.call(null, b, c, d), e) + return a.call(null, b, c, d); + }, a.call(null, b, c, d), e); }, c = function(a, c, e, k) { var l = null; 3 < arguments.length && (l = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, e, l) + return b.call(this, a, c, e, l); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -11605,10 +11734,10 @@ cljs.core.min_key = function() { a = cljs.core.next(a); var k = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, e, k, a) + return b(c, e, k, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e, f, g) { switch(arguments.length) { case 2: @@ -11616,99 +11745,99 @@ cljs.core.min_key = function() { case 3: return b.call(this, a, e, f); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, e, f, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$2 = function(a, b) { - return b + return b; }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.partition_all = function() { var a = null, b = function(b, c) { - return a.call(null, b, b, c) + return a.call(null, b, b, c); }, c = function(b, c, f) { return new cljs.core.LazySeq(null, function() { var g = cljs.core.seq.call(null, f); - return g ? cljs.core.cons.call(null, cljs.core.take.call(null, b, g), a.call(null, b, c, cljs.core.drop.call(null, c, g))) : null - }, null, null) + return g ? cljs.core.cons.call(null, cljs.core.take.call(null, b, g), a.call(null, b, c, cljs.core.drop.call(null, c, g))) : null; + }, null, null); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.take_while = function take_while(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, c); - return d ? cljs.core.truth_(b.call(null, cljs.core.first.call(null, d))) ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_while.call(null, b, cljs.core.rest.call(null, d))) : null : null - }, null, null) + return d ? cljs.core.truth_(b.call(null, cljs.core.first.call(null, d))) ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_while.call(null, b, cljs.core.rest.call(null, d))) : null : null; + }, null, null); }; cljs.core.mk_bound_fn = function(a, b, c) { return function(d) { var e = cljs.core._comparator.call(null, a); - return b.call(null, e.call(null, cljs.core._entry_key.call(null, a, d), c), 0) - } + return b.call(null, e.call(null, cljs.core._entry_key.call(null, a, d), c), 0); + }; }; cljs.core.subseq = function() { var a = null, b = function(a, b, c) { var g = cljs.core.mk_bound_fn.call(null, a, b, c); - return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._GT_, cljs.core._GT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !0), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !0)) + return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._GT_, cljs.core._GT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !0), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !0)); }, c = function(a, b, c, g, h) { var k = cljs.core._sorted_seq_from.call(null, a, c, !0); - if(cljs.core.truth_(k)) { + if (cljs.core.truth_(k)) { var l = cljs.core.nth.call(null, k, 0, null); - return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, g, h), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, b, c).call(null, l)) ? k : cljs.core.next.call(null, k)) + return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, g, h), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, b, c).call(null, l)) ? k : cljs.core.next.call(null, k)); } - return null + return null; }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h) + return c.call(this, a, e, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a + return a; }(); cljs.core.rsubseq = function() { var a = null, b = function(a, b, c) { var g = cljs.core.mk_bound_fn.call(null, a, b, c); - return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._LT_, cljs.core._LT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !1), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !1)) + return cljs.core.truth_(cljs.core.PersistentHashSet.fromArray([cljs.core._LT_, cljs.core._LT__EQ_], !0).call(null, b)) ? (a = cljs.core._sorted_seq_from.call(null, a, c, !1), cljs.core.truth_(a) ? (b = cljs.core.nth.call(null, a, 0, null), cljs.core.truth_(g.call(null, b)) ? a : cljs.core.next.call(null, a)) : null) : cljs.core.take_while.call(null, g, cljs.core._sorted_seq.call(null, a, !1)); }, c = function(a, b, c, g, h) { var k = cljs.core._sorted_seq_from.call(null, a, h, !1); - if(cljs.core.truth_(k)) { + if (cljs.core.truth_(k)) { var l = cljs.core.nth.call(null, k, 0, null); - return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, b, c), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, g, h).call(null, l)) ? k : cljs.core.next.call(null, k)) + return cljs.core.take_while.call(null, cljs.core.mk_bound_fn.call(null, a, b, c), cljs.core.truth_(cljs.core.mk_bound_fn.call(null, a, g, h).call(null, l)) ? k : cljs.core.next.call(null, k)); } - return null + return null; }, a = function(a, e, f, g, h) { switch(arguments.length) { case 3: return b.call(this, a, e, f); case 5: - return c.call(this, a, e, f, g, h) + return c.call(this, a, e, f, g, h); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$3 = b; a.cljs$core$IFn$_invoke$arity$5 = c; - return a + return a; }(); cljs.core.Range = function(a, b, c, d, e) { this.meta = a; @@ -11717,80 +11846,84 @@ cljs.core.Range = function(a, b, c, d, e) { this.step = d; this.__hash = e; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 32375006 + this.cljs$lang$protocol_mask$partition0$ = 32375006; }; cljs.core.Range.cljs$lang$type = !0; cljs.core.Range.cljs$lang$ctorStr = "cljs.core/Range"; cljs.core.Range.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Range") + return cljs.core._write.call(null, b, "cljs.core/Range"); }; cljs.core.Range.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { a = this.__hash; - return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this) + return null != a ? a : this.__hash = a = cljs.core.hash_coll.call(null, this); }; cljs.core.Range.prototype.cljs$core$INext$_next$arity$1 = function(a) { - return 0 < this.step ? this.start + this.step < this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null : this.start + this.step > this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null + return 0 < this.step ? this.start + this.step < this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null : this.start + this.step > this.end ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : null; }; cljs.core.Range.prototype.cljs$core$ICollection$_conj$arity$2 = function(a, b) { - return cljs.core.cons.call(null, b, this) + return cljs.core.cons.call(null, b, this); }; cljs.core.Range.prototype.toString = function() { - return cljs.core.pr_str_STAR_.call(null, this) + return cljs.core.pr_str_STAR_.call(null, this); }; cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$2 = function(a, b) { - return cljs.core.ci_reduce.call(null, this, b) + return cljs.core.ci_reduce.call(null, this, b); }; cljs.core.Range.prototype.cljs$core$IReduce$_reduce$arity$3 = function(a, b, c) { - return cljs.core.ci_reduce.call(null, this, b, c) + return cljs.core.ci_reduce.call(null, this, b, c); }; cljs.core.Range.prototype.cljs$core$ISeqable$_seq$arity$1 = function(a) { - return 0 < this.step ? this.start < this.end ? this : null : this.start > this.end ? this : null + return 0 < this.step ? this.start < this.end ? this : null : this.start > this.end ? this : null; }; cljs.core.Range.prototype.cljs$core$ICounted$_count$arity$1 = function(a) { - return cljs.core.not.call(null, cljs.core._seq.call(null, this)) ? 0 : Math.ceil((this.end - this.start) / this.step) + return cljs.core.not.call(null, cljs.core._seq.call(null, this)) ? 0 : Math.ceil((this.end - this.start) / this.step); }; cljs.core.Range.prototype.cljs$core$ISeq$_first$arity$1 = function(a) { - return this.start + return null == cljs.core._seq.call(null, this) ? null : this.start; }; cljs.core.Range.prototype.cljs$core$ISeq$_rest$arity$1 = function(a) { - return null != cljs.core._seq.call(null, this) ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : cljs.core.List.EMPTY + return null != cljs.core._seq.call(null, this) ? new cljs.core.Range(this.meta, this.start + this.step, this.end, this.step, null) : cljs.core.List.EMPTY; }; cljs.core.Range.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return cljs.core.equiv_sequential.call(null, this, b) + return cljs.core.equiv_sequential.call(null, this, b); }; cljs.core.Range.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = function(a, b) { - return new cljs.core.Range(b, this.start, this.end, this.step, this.__hash) + return new cljs.core.Range(b, this.start, this.end, this.step, this.__hash); +}; +cljs.core.Range.prototype.cljs$core$ICloneable$ = !0; +cljs.core.Range.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.Range(this.meta, this.start, this.end, this.step, this.__hash); }; cljs.core.Range.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$2 = function(a, b) { - if(b < cljs.core._count.call(null, this)) { - return this.start + b * this.step + if (b < cljs.core._count.call(null, this)) { + return this.start + b * this.step; } - if(this.start > this.end && 0 === this.step) { - return this.start + if (this.start > this.end && 0 === this.step) { + return this.start; } throw Error("Index out of bounds"); }; cljs.core.Range.prototype.cljs$core$IIndexed$_nth$arity$3 = function(a, b, c) { - return b < cljs.core._count.call(null, this) ? this.start + b * this.step : this.start > this.end && 0 === this.step ? this.start : c + return b < cljs.core._count.call(null, this) ? this.start + b * this.step : this.start > this.end && 0 === this.step ? this.start : c; }; cljs.core.Range.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = function(a) { - return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta) + return cljs.core.with_meta.call(null, cljs.core.List.EMPTY, this.meta); }; cljs.core.__GT_Range = function(a, b, c, d, e) { - return new cljs.core.Range(a, b, c, d, e) + return new cljs.core.Range(a, b, c, d, e); }; cljs.core.range = function() { var a = null, b = function() { - return a.call(null, 0, Number.MAX_VALUE, 1) + return a.call(null, 0, Number.MAX_VALUE, 1); }, c = function(b) { - return a.call(null, 0, b, 1) + return a.call(null, 0, b, 1); }, d = function(b, c) { - return a.call(null, b, c, 1) + return a.call(null, b, c, 1); }, e = function(a, b, c) { - return new cljs.core.Range(null, a, b, c, null) + return new cljs.core.Range(null, a, b, c, null); }, a = function(a, g, h) { switch(arguments.length) { case 0: @@ -11800,7 +11933,7 @@ cljs.core.range = function() { case 2: return d.call(this, a, g); case 3: - return e.call(this, a, g, h) + return e.call(this, a, g, h); } throw Error("Invalid arity: " + arguments.length); }; @@ -11808,70 +11941,70 @@ cljs.core.range = function() { a.cljs$core$IFn$_invoke$arity$1 = c; a.cljs$core$IFn$_invoke$arity$2 = d; a.cljs$core$IFn$_invoke$arity$3 = e; - return a + return a; }(); cljs.core.take_nth = function take_nth(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, c); - return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_nth.call(null, b, cljs.core.drop.call(null, b, d))) : null - }, null, null) + return d ? cljs.core.cons.call(null, cljs.core.first.call(null, d), take_nth.call(null, b, cljs.core.drop.call(null, b, d))) : null; + }, null, null); }; cljs.core.split_with = function(a, b) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take_while.call(null, a, b), cljs.core.drop_while.call(null, a, b)], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.take_while.call(null, a, b), cljs.core.drop_while.call(null, a, b)], null); }; cljs.core.partition_by = function partition_by(b, c) { return new cljs.core.LazySeq(null, function() { var d = cljs.core.seq.call(null, c); - if(d) { + if (d) { var e = cljs.core.first.call(null, d), f = b.call(null, e), e = cljs.core.cons.call(null, e, cljs.core.take_while.call(null, function(c, d) { return function(c) { - return cljs.core._EQ_.call(null, d, b.call(null, c)) - } + return cljs.core._EQ_.call(null, d, b.call(null, c)); + }; }(e, f), cljs.core.next.call(null, d))); - return cljs.core.cons.call(null, e, partition_by.call(null, b, cljs.core.seq.call(null, cljs.core.drop.call(null, cljs.core.count.call(null, e), d)))) + return cljs.core.cons.call(null, e, partition_by.call(null, b, cljs.core.seq.call(null, cljs.core.drop.call(null, cljs.core.count.call(null, e), d)))); } - return null - }, null, null) + return null; + }, null, null); }; cljs.core.frequencies = function(a) { return cljs.core.persistent_BANG_.call(null, cljs.core.reduce.call(null, function(a, c) { - return cljs.core.assoc_BANG_.call(null, a, c, cljs.core.get.call(null, a, c, 0) + 1) - }, cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), a)) + return cljs.core.assoc_BANG_.call(null, a, c, cljs.core.get.call(null, a, c, 0) + 1); + }, cljs.core.transient$.call(null, cljs.core.PersistentArrayMap.EMPTY), a)); }; cljs.core.reductions = function() { var a = null, b = function(b, c) { return new cljs.core.LazySeq(null, function() { var f = cljs.core.seq.call(null, c); - return f ? a.call(null, b, cljs.core.first.call(null, f), cljs.core.rest.call(null, f)) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b.call(null)) - }, null, null) + return f ? a.call(null, b, cljs.core.first.call(null, f), cljs.core.rest.call(null, f)) : cljs.core._conj.call(null, cljs.core.List.EMPTY, b.call(null)); + }, null, null); }, c = function(b, c, f) { return cljs.core.cons.call(null, c, new cljs.core.LazySeq(null, function() { var g = cljs.core.seq.call(null, f); - return g ? a.call(null, b, b.call(null, c, cljs.core.first.call(null, g)), cljs.core.rest.call(null, g)) : null - }, null, null)) + return g ? a.call(null, b, b.call(null, c, cljs.core.first.call(null, g)), cljs.core.rest.call(null, g)) : null; + }, null, null)); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.juxt = function() { var a = null, b = function(a) { return function() { var b = null, c = function() { var b = function(b, c, d, e) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, b, c, d, e)], null) + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, b, c, d, e)], null); }, c = function(a, c, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return b.call(this, a, c, d, f) + return b.call(this, a, c, d, f); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = function(a) { @@ -11881,10 +12014,10 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, d, e, a) + return b(c, d, e, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), b = function(b, d, e, g) { switch(arguments.length) { case 0: @@ -11896,23 +12029,23 @@ cljs.core.juxt = function() { case 3: return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, b, d, e)], null); default: - return c.cljs$core$IFn$_invoke$arity$variadic(b, d, e, cljs.core.array_seq(arguments, 3)) + return c.cljs$core$IFn$_invoke$arity$variadic(b, d, e, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = c.cljs$lang$applyTo; - return b - }() + return b; + }(); }, c = function(a, b) { return function() { var c = null, d = function() { var c = function(c, d, e, h) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, c, d, e, h), cljs.core.apply.call(null, b, c, d, e, h)], null) + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, c, d, e, h), cljs.core.apply.call(null, b, c, d, e, h)], null); }, d = function(a, b, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return c.call(this, a, b, d, f) + return c.call(this, a, b, d, f); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = function(a) { @@ -11922,10 +12055,10 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return c(b, d, e, a) + return c(b, d, e, a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d + return d; }(), c = function(c, e, h, p) { switch(arguments.length) { case 0: @@ -11937,23 +12070,23 @@ cljs.core.juxt = function() { case 3: return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, c, e, h), b.call(null, c, e, h)], null); default: - return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)) + return d.cljs$core$IFn$_invoke$arity$variadic(c, e, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; c.cljs$lang$maxFixedArity = 3; c.cljs$lang$applyTo = d.cljs$lang$applyTo; - return c - }() + return c; + }(); }, d = function(a, b, c) { return function() { var d = null, e = function() { var d = function(d, e, k, l) { - return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, d, e, k, l), cljs.core.apply.call(null, b, d, e, k, l), cljs.core.apply.call(null, c, d, e, k, l)], null) + return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.apply.call(null, a, d, e, k, l), cljs.core.apply.call(null, b, d, e, k, l), cljs.core.apply.call(null, c, d, e, k, l)], null); }, e = function(a, b, c, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return d.call(this, a, b, c, f) + return d.call(this, a, b, c, f); }; e.cljs$lang$maxFixedArity = 3; e.cljs$lang$applyTo = function(a) { @@ -11963,10 +12096,10 @@ cljs.core.juxt = function() { a = cljs.core.next(a); var e = cljs.core.first(a); a = cljs.core.rest(a); - return d(b, c, e, a) + return d(b, c, e, a); }; e.cljs$core$IFn$_invoke$arity$variadic = d; - return e + return e; }(), d = function(d, k, p, q) { switch(arguments.length) { case 0: @@ -11978,43 +12111,43 @@ cljs.core.juxt = function() { case 3: return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a.call(null, d, k, p), b.call(null, d, k, p), c.call(null, d, k, p)], null); default: - return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)) + return e.cljs$core$IFn$_invoke$arity$variadic(d, k, p, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; d.cljs$lang$maxFixedArity = 3; d.cljs$lang$applyTo = e.cljs$lang$applyTo; - return d - }() + return d; + }(); }, e = function() { var a = function(a, b, c, d) { var e = cljs.core.list_STAR_.call(null, a, b, c, d); return function() { var a = null, b = function() { return cljs.core.reduce.call(null, function(a, b) { - return cljs.core.conj.call(null, a, b.call(null)) - }, cljs.core.PersistentVector.EMPTY, e) + return cljs.core.conj.call(null, a, b.call(null)); + }, cljs.core.PersistentVector.EMPTY, e); }, c = function(a) { return cljs.core.reduce.call(null, function(b, c) { - return cljs.core.conj.call(null, b, c.call(null, a)) - }, cljs.core.PersistentVector.EMPTY, e) + return cljs.core.conj.call(null, b, c.call(null, a)); + }, cljs.core.PersistentVector.EMPTY, e); }, d = function(a, b) { return cljs.core.reduce.call(null, function(c, d) { - return cljs.core.conj.call(null, c, d.call(null, a, b)) - }, cljs.core.PersistentVector.EMPTY, e) + return cljs.core.conj.call(null, c, d.call(null, a, b)); + }, cljs.core.PersistentVector.EMPTY, e); }, f = function(a, b, c) { return cljs.core.reduce.call(null, function(d, e) { - return cljs.core.conj.call(null, d, e.call(null, a, b, c)) - }, cljs.core.PersistentVector.EMPTY, e) + return cljs.core.conj.call(null, d, e.call(null, a, b, c)); + }, cljs.core.PersistentVector.EMPTY, e); }, g = function() { var a = function(a, b, c, d) { return cljs.core.reduce.call(null, function(e, f) { - return cljs.core.conj.call(null, e, cljs.core.apply.call(null, f, a, b, c, d)) - }, cljs.core.PersistentVector.EMPTY, e) + return cljs.core.conj.call(null, e, cljs.core.apply.call(null, f, a, b, c, d)); + }, cljs.core.PersistentVector.EMPTY, e); }, b = function(b, c, d, e) { var f = null; 3 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, f) + return a.call(this, b, c, d, f); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -12024,10 +12157,10 @@ cljs.core.juxt = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e, h, k) { switch(arguments.length) { case 0: @@ -12039,18 +12172,18 @@ cljs.core.juxt = function() { case 3: return f.call(this, a, e, h); default: - return g.cljs$core$IFn$_invoke$arity$variadic(a, e, h, cljs.core.array_seq(arguments, 3)) + return g.cljs$core$IFn$_invoke$arity$variadic(a, e, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$lang$maxFixedArity = 3; a.cljs$lang$applyTo = g.cljs$lang$applyTo; - return a - }() + return a; + }(); }, b = function(b, c, d, e) { var g = null; 3 < arguments.length && (g = cljs.core.array_seq(Array.prototype.slice.call(arguments, 3), 0)); - return a.call(this, b, c, d, g) + return a.call(this, b, c, d, g); }; b.cljs$lang$maxFixedArity = 3; b.cljs$lang$applyTo = function(b) { @@ -12060,10 +12193,10 @@ cljs.core.juxt = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, b) + return a(c, d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, g, h, k) { switch(arguments.length) { case 1: @@ -12073,7 +12206,7 @@ cljs.core.juxt = function() { case 3: return d.call(this, a, g, h); default: - return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)) + return e.cljs$core$IFn$_invoke$arity$variadic(a, g, h, cljs.core.array_seq(arguments, 3)); } throw Error("Invalid arity: " + arguments.length); }; @@ -12083,25 +12216,25 @@ cljs.core.juxt = function() { a.cljs$core$IFn$_invoke$arity$2 = c; a.cljs$core$IFn$_invoke$arity$3 = d; a.cljs$core$IFn$_invoke$arity$variadic = e.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.dorun = function() { var a = null, b = function(a) { - for(;;) { - if(cljs.core.seq.call(null, a)) { - a = cljs.core.next.call(null, a) - }else { - return null + for (;;) { + if (cljs.core.seq.call(null, a)) { + a = cljs.core.next.call(null, a); + } else { + return null; } } }, c = function(a, b) { - for(;;) { - if(cljs.core.seq.call(null, b) && 0 < a) { + for (;;) { + if (cljs.core.seq.call(null, b) && 0 < a) { var c = a - 1, g = cljs.core.next.call(null, b); a = c; - b = g - }else { - return null + b = g; + } else { + return null; } } }, a = function(a, e) { @@ -12109,189 +12242,194 @@ cljs.core.dorun = function() { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.doall = function() { var a = null, b = function(a) { cljs.core.dorun.call(null, a); - return a + return a; }, c = function(a, b) { cljs.core.dorun.call(null, a, b); - return b + return b; }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.regexp_QMARK_ = function(a) { - return a instanceof RegExp + return a instanceof RegExp; }; cljs.core.re_matches = function(a, b) { var c = a.exec(b); - return cljs.core._EQ_.call(null, cljs.core.first.call(null, c), b) ? 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) : null + return cljs.core._EQ_.call(null, cljs.core.first.call(null, c), b) ? 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) : null; }; cljs.core.re_find = function(a, b) { var c = a.exec(b); - return null == c ? null : 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c) + return null == c ? null : 1 === cljs.core.count.call(null, c) ? cljs.core.first.call(null, c) : cljs.core.vec.call(null, c); }; cljs.core.re_seq = function re_seq(b, c) { var d = cljs.core.re_find.call(null, b, c), e = c.search(b), f = cljs.core.coll_QMARK_.call(null, d) ? cljs.core.first.call(null, d) : d, g = cljs.core.subs.call(null, c, e + cljs.core.count.call(null, f)); return cljs.core.truth_(d) ? new cljs.core.LazySeq(null, function() { - return cljs.core.cons.call(null, d, cljs.core.seq.call(null, g) ? re_seq.call(null, b, g) : null) - }, null, null) : null + return cljs.core.cons.call(null, d, cljs.core.seq.call(null, g) ? re_seq.call(null, b, g) : null); + }, null, null) : null; }; cljs.core.re_pattern = function(a) { var b = cljs.core.re_find.call(null, /^(?:\(\?([idmsux]*)\))?(.*)/, a); cljs.core.nth.call(null, b, 0, null); a = cljs.core.nth.call(null, b, 1, null); b = cljs.core.nth.call(null, b, 2, null); - return RegExp(b, a) + return RegExp(b, a); }; cljs.core.pr_sequential_writer = function(a, b, c, d, e, f, g) { var h = cljs.core._STAR_print_level_STAR_; try { cljs.core._STAR_print_level_STAR_ = null == cljs.core._STAR_print_level_STAR_ ? null : cljs.core._STAR_print_level_STAR_ - 1; - if(null != cljs.core._STAR_print_level_STAR_ && 0 > cljs.core._STAR_print_level_STAR_) { - return cljs.core._write.call(null, a, "#") + if (null != cljs.core._STAR_print_level_STAR_ && 0 > cljs.core._STAR_print_level_STAR_) { + return cljs.core._write.call(null, a, "#"); } cljs.core._write.call(null, a, c); cljs.core.seq.call(null, g) && b.call(null, cljs.core.first.call(null, g), a, f); - for(var k = cljs.core.next.call(null, g), l = (new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f);k && (null == l || 0 !== l);) { + for (var k = cljs.core.next.call(null, g), l = (new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f);k && (null == l || 0 !== l);) { cljs.core._write.call(null, a, d); b.call(null, cljs.core.first.call(null, k), a, f); var m = cljs.core.next.call(null, k); c = l - 1; k = m; - l = c + l = c; } cljs.core.truth_((new cljs.core.Keyword(null, "print-length", "print-length", 3960797560)).cljs$core$IFn$_invoke$arity$1(f)) && (cljs.core._write.call(null, a, d), b.call(null, "...", a, f)); - return cljs.core._write.call(null, a, e) - }finally { - cljs.core._STAR_print_level_STAR_ = h + return cljs.core._write.call(null, a, e); + } finally { + cljs.core._STAR_print_level_STAR_ = h; } }; cljs.core.write_all = function() { var a = function(a, b) { - for(var e = cljs.core.seq.call(null, b), f = null, g = 0, h = 0;;) { - if(h < g) { + for (var e = cljs.core.seq.call(null, b), f = null, g = 0, h = 0;;) { + if (h < g) { var k = cljs.core._nth.call(null, f, h); cljs.core._write.call(null, a, k); - h += 1 - }else { - if(e = cljs.core.seq.call(null, e)) { - f = e, cljs.core.chunked_seq_QMARK_.call(null, f) ? (e = cljs.core.chunk_first.call(null, f), g = cljs.core.chunk_rest.call(null, f), f = e, k = cljs.core.count.call(null, e), e = g, g = k) : (k = cljs.core.first.call(null, f), cljs.core._write.call(null, a, k), e = cljs.core.next.call(null, f), f = null, g = 0), h = 0 - }else { - return null + h += 1; + } else { + if (e = cljs.core.seq.call(null, e)) { + f = e, cljs.core.chunked_seq_QMARK_.call(null, f) ? (e = cljs.core.chunk_first.call(null, f), g = cljs.core.chunk_rest.call(null, f), f = e, k = cljs.core.count.call(null, e), e = g, g = k) : (k = cljs.core.first.call(null, f), cljs.core._write.call(null, a, k), e = cljs.core.next.call(null, f), f = null, g = 0), h = 0; + } else { + return null; } } } }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.string_print = function(a) { cljs.core._STAR_print_fn_STAR_.call(null, a); - return null + return null; }; cljs.core.flush = function() { - return null + return null; }; cljs.core.char_escapes = function() { - return{'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"} + return{'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"}; }(); cljs.core.quote_string = function(a) { return[cljs.core.str('"'), cljs.core.str(a.replace(RegExp('[\\\\"\b\f\n\r\t]', "g"), function(a) { - return cljs.core.char_escapes[a] - })), cljs.core.str('"')].join("") + return cljs.core.char_escapes[a]; + })), cljs.core.str('"')].join(""); }; cljs.core.pr_writer = function pr_writer(b, c, d) { - if(null == b) { - return cljs.core._write.call(null, c, "nil") + if (null == b) { + return cljs.core._write.call(null, c, "nil"); } - if(void 0 === b) { - return cljs.core._write.call(null, c, "#\x3cundefined\x3e") + if (void 0 === b) { + return cljs.core._write.call(null, c, "#\x3cundefined\x3e"); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { cljs.core.truth_(function() { var c = cljs.core.get.call(null, d, new cljs.core.Keyword(null, "meta", "meta", 1017252215)); - return cljs.core.truth_(c) ? (c = b ? b.cljs$lang$protocol_mask$partition0$ & 131072 || b.cljs$core$IMeta$ ? !0 : b.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b)) ? cljs.core.meta.call(null, b) : c : c + return cljs.core.truth_(c) ? (c = b ? b.cljs$lang$protocol_mask$partition0$ & 131072 || b.cljs$core$IMeta$ ? !0 : b.cljs$lang$protocol_mask$partition0$ ? !1 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IMeta, b)) ? cljs.core.meta.call(null, b) : c : c; }()) && (cljs.core._write.call(null, c, "^"), pr_writer.call(null, cljs.core.meta.call(null, b), c, d), cljs.core._write.call(null, c, " ")); - if(null == b) { - return cljs.core._write.call(null, c, "nil") + if (null == b) { + return cljs.core._write.call(null, c, "nil"); + } + if (b.cljs$lang$type) { + return b.cljs$lang$ctorPrWriter(b, c, d); } - if(b.cljs$lang$type) { - return b.cljs$lang$ctorPrWriter(b, c, d) + if (b && (b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$)) { + return cljs.core._pr_writer.call(null, b, c, d); } - if(b && (b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$)) { - return cljs.core._pr_writer.call(null, b, c, d) + if (cljs.core.type.call(null, b) === Boolean || "number" === typeof b) { + return cljs.core._write.call(null, c, "" + cljs.core.str(b)); } - if(cljs.core.type.call(null, b) === Boolean || "number" === typeof b) { - return cljs.core._write.call(null, c, "" + cljs.core.str(b)) + if (cljs.core.object_QMARK_.call(null, b)) { + return cljs.core._write.call(null, c, "#js "), cljs.core.print_map.call(null, cljs.core.map.call(null, function(c) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, c), b[c]], null); + }, cljs.core.js_keys.call(null, b)), pr_writer, c, d); } - if(b instanceof Array) { - return cljs.core.pr_sequential_writer.call(null, c, pr_writer, "#\x3cArray [", ", ", "]\x3e", d, b) + if (b instanceof Array) { + return cljs.core.pr_sequential_writer.call(null, c, pr_writer, "#js [", " ", "]", d, b); } - if(goog.isString(b)) { - return cljs.core.truth_((new cljs.core.Keyword(null, "readably", "readably", 4441712502)).cljs$core$IFn$_invoke$arity$1(d)) ? cljs.core._write.call(null, c, cljs.core.quote_string.call(null, b)) : cljs.core._write.call(null, c, b) + if (goog.isString(b)) { + return cljs.core.truth_((new cljs.core.Keyword(null, "readably", "readably", 4441712502)).cljs$core$IFn$_invoke$arity$1(d)) ? cljs.core._write.call(null, c, cljs.core.quote_string.call(null, b)) : cljs.core._write.call(null, c, b); } - if(cljs.core.fn_QMARK_.call(null, b)) { - return cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") + if (cljs.core.fn_QMARK_.call(null, b)) { + return cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e"); } - if(b instanceof Date) { + if (b instanceof Date) { var e = function(b, c) { - for(var d = "" + cljs.core.str(b);;) { - if(cljs.core.count.call(null, d) < c) { - d = [cljs.core.str("0"), cljs.core.str(d)].join("") - }else { - return d + for (var d = "" + cljs.core.str(b);;) { + if (cljs.core.count.call(null, d) < c) { + d = [cljs.core.str("0"), cljs.core.str(d)].join(""); + } else { + return d; } } }; - return cljs.core.write_all.call(null, c, '#inst "', "" + cljs.core.str(b.getUTCFullYear()), "-", e.call(null, b.getUTCMonth() + 1, 2), "-", e.call(null, b.getUTCDate(), 2), "T", e.call(null, b.getUTCHours(), 2), ":", e.call(null, b.getUTCMinutes(), 2), ":", e.call(null, b.getUTCSeconds(), 2), ".", e.call(null, b.getUTCMilliseconds(), 3), "-", '00:00"') + return cljs.core.write_all.call(null, c, '#inst "', "" + cljs.core.str(b.getUTCFullYear()), "-", e.call(null, b.getUTCMonth() + 1, 2), "-", e.call(null, b.getUTCDate(), 2), "T", e.call(null, b.getUTCHours(), 2), ":", e.call(null, b.getUTCMinutes(), 2), ":", e.call(null, b.getUTCSeconds(), 2), ".", e.call(null, b.getUTCMilliseconds(), 3), "-", '00:00"'); } return cljs.core.regexp_QMARK_.call(null, b) ? cljs.core.write_all.call(null, c, '#"', b.source, '"') : (b ? b.cljs$lang$protocol_mask$partition0$ & 2147483648 || b.cljs$core$IPrintWithWriter$ || (b.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IPrintWithWriter, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IPrintWithWriter, b)) ? cljs.core._pr_writer.call(null, b, c, d) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? - cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") : null + cljs.core.write_all.call(null, c, "#\x3c", "" + cljs.core.str(b), "\x3e") : null; } - return null + return null; }; cljs.core.pr_seq_writer = function(a, b, c) { cljs.core.pr_writer.call(null, cljs.core.first.call(null, a), b, c); a = cljs.core.seq.call(null, cljs.core.next.call(null, a)); - for(var d = null, e = 0, f = 0;;) { - if(f < e) { + for (var d = null, e = 0, f = 0;;) { + if (f < e) { var g = cljs.core._nth.call(null, d, f); cljs.core._write.call(null, b, " "); cljs.core.pr_writer.call(null, g, b, c); - f += 1 - }else { - if(a = cljs.core.seq.call(null, a)) { - d = a, cljs.core.chunked_seq_QMARK_.call(null, d) ? (a = cljs.core.chunk_first.call(null, d), e = cljs.core.chunk_rest.call(null, d), d = a, g = cljs.core.count.call(null, a), a = e, e = g) : (g = cljs.core.first.call(null, d), cljs.core._write.call(null, b, " "), cljs.core.pr_writer.call(null, g, b, c), a = cljs.core.next.call(null, d), d = null, e = 0), f = 0 - }else { - return null + f += 1; + } else { + if (a = cljs.core.seq.call(null, a)) { + d = a, cljs.core.chunked_seq_QMARK_.call(null, d) ? (a = cljs.core.chunk_first.call(null, d), e = cljs.core.chunk_rest.call(null, d), d = a, g = cljs.core.count.call(null, a), a = e, e = g) : (g = cljs.core.first.call(null, d), cljs.core._write.call(null, b, " "), cljs.core.pr_writer.call(null, g, b, c), a = cljs.core.next.call(null, d), d = null, e = 0), f = 0; + } else { + return null; } } } @@ -12300,282 +12438,282 @@ cljs.core.pr_sb_with_opts = function(a, b) { var c = new goog.string.StringBuffer, d = new cljs.core.StringBufferWriter(c); cljs.core.pr_seq_writer.call(null, a, d, b); cljs.core._flush.call(null, d); - return c + return c; }; cljs.core.pr_str_with_opts = function(a, b) { - return cljs.core.empty_QMARK_.call(null, a) ? "" : "" + cljs.core.str(cljs.core.pr_sb_with_opts.call(null, a, b)) + return cljs.core.empty_QMARK_.call(null, a) ? "" : "" + cljs.core.str(cljs.core.pr_sb_with_opts.call(null, a, b)); }; cljs.core.prn_str_with_opts = function(a, b) { - if(cljs.core.empty_QMARK_.call(null, a)) { - return"\n" + if (cljs.core.empty_QMARK_.call(null, a)) { + return "\n"; } var c = cljs.core.pr_sb_with_opts.call(null, a, b); c.append("\n"); - return"" + cljs.core.str(c) + return "" + cljs.core.str(c); }; cljs.core.pr_with_opts = function(a, b) { - return cljs.core.string_print.call(null, cljs.core.pr_str_with_opts.call(null, a, b)) + return cljs.core.string_print.call(null, cljs.core.pr_str_with_opts.call(null, a, b)); }; cljs.core.newline = function(a) { cljs.core.string_print.call(null, "\n"); - return cljs.core.truth_(cljs.core.get.call(null, a, new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857))) ? cljs.core.flush.call(null) : null + return cljs.core.truth_(cljs.core.get.call(null, a, new cljs.core.Keyword(null, "flush-on-newline", "flush-on-newline", 4338025857))) ? cljs.core.flush.call(null) : null; }; cljs.core.pr_str = function() { var a = function(a) { - return cljs.core.pr_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)) + return cljs.core.pr_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.prn_str = function() { var a = function(a) { - return cljs.core.prn_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)) + return cljs.core.prn_str_with_opts.call(null, a, cljs.core.pr_opts.call(null)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.pr = function() { var a = function(a) { - return cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)) + return cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.print = function() { var a = function(a) { - return cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) + return cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.print_str = function() { var a = function(a) { - return cljs.core.pr_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) + return cljs.core.pr_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.println = function() { var a = function(a) { cljs.core.pr_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)); - return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null + return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null; }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.println_str = function() { var a = function(a) { - return cljs.core.prn_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)) + return cljs.core.prn_str_with_opts.call(null, a, cljs.core.assoc.call(null, cljs.core.pr_opts.call(null), new cljs.core.Keyword(null, "readably", "readably", 4441712502), !1)); }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.prn = function() { var a = function(a) { cljs.core.pr_with_opts.call(null, a, cljs.core.pr_opts.call(null)); - return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null + return cljs.core.truth_(cljs.core._STAR_print_newline_STAR_) ? cljs.core.newline.call(null, cljs.core.pr_opts.call(null)) : null; }, b = function(b) { var d = null; 0 < arguments.length && (d = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return a.call(this, d) + return a.call(this, d); }; b.cljs$lang$maxFixedArity = 0; b.cljs$lang$applyTo = function(b) { b = cljs.core.seq(b); - return a(b) + return a(b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.print_map = function(a, b, c, d) { return cljs.core.pr_sequential_writer.call(null, c, function(a, c, d) { b.call(null, cljs.core.key.call(null, a), c, d); cljs.core._write.call(null, c, " "); - return b.call(null, cljs.core.val.call(null, a), c, d) - }, "{", ", ", "}", d, cljs.core.seq.call(null, a)) + return b.call(null, cljs.core.val.call(null, a), c, d); + }, "{", ", ", "}", d, cljs.core.seq.call(null, a)); }; cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.KeySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.IndexedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.IndexedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.Subvec.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this); }; cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.ChunkedCons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentTreeMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c); }; cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentArrayMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c); }; cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentQueue.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#queue [", " ", "]", c, cljs.core.seq.call(null, this)) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#queue [", " ", "]", c, cljs.core.seq.call(null, this)); }; cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.LazySeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.RSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentTreeSet.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentTreeSet.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this); }; cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.NodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.RedNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this); }; cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.ChunkedSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentHashMap.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentHashMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c); }; cljs.core.PersistentHashSet.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentHashSet.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "#{", " ", "}", c, this); }; cljs.core.PersistentVector.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentVector.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this); }; cljs.core.List.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.List.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentArrayMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.EmptyList.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.EmptyList.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, "()") + return cljs.core._write.call(null, b, "()"); }; cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.BlackNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "[", " ", "]", c, this); }; cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.Cons.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.Range.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.Range.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.ArrayNodeSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.ValSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.ObjMap.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c) + return cljs.core.print_map.call(null, this, cljs.core.pr_writer, b, c); }; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$ = !0; cljs.core.PersistentTreeMapSeq.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this) + return cljs.core.pr_sequential_writer.call(null, b, cljs.core.pr_writer, "(", " ", ")", c, this); }; cljs.core.PersistentVector.prototype.cljs$core$IComparable$ = !0; cljs.core.PersistentVector.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_indexed.call(null, this, b) + return cljs.core.compare_indexed.call(null, this, b); }; cljs.core.Subvec.prototype.cljs$core$IComparable$ = !0; cljs.core.Subvec.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_indexed.call(null, this, b) + return cljs.core.compare_indexed.call(null, this, b); }; cljs.core.Keyword.prototype.cljs$core$IComparable$ = !0; cljs.core.Keyword.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_symbols.call(null, this, b) + return cljs.core.compare_symbols.call(null, this, b); }; cljs.core.Symbol.prototype.cljs$core$IComparable$ = !0; cljs.core.Symbol.prototype.cljs$core$IComparable$_compare$arity$2 = function(a, b) { - return cljs.core.compare_symbols.call(null, this, b) + return cljs.core.compare_symbols.call(null, this, b); }; cljs.core.Atom = function(a, b, c, d) { this.state = a; @@ -12583,81 +12721,81 @@ cljs.core.Atom = function(a, b, c, d) { this.validator = c; this.watches = d; this.cljs$lang$protocol_mask$partition0$ = 2153938944; - this.cljs$lang$protocol_mask$partition1$ = 2 + this.cljs$lang$protocol_mask$partition1$ = 2; }; cljs.core.Atom.cljs$lang$type = !0; cljs.core.Atom.cljs$lang$ctorStr = "cljs.core/Atom"; cljs.core.Atom.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Atom") + return cljs.core._write.call(null, b, "cljs.core/Atom"); }; cljs.core.Atom.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.getUid(this) + return goog.getUid(this); }; cljs.core.Atom.prototype.cljs$core$IWatchable$_notify_watches$arity$3 = function(a, b, c) { a = cljs.core.seq.call(null, this.watches); - for(var d = null, e = 0, f = 0;;) { - if(f < e) { + for (var d = null, e = 0, f = 0;;) { + if (f < e) { var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); g.call(null, h, this, b, c); - f += 1 - }else { - if(a = cljs.core.seq.call(null, a)) { - cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), h = d, e = cljs.core.count.call(null, d), d = h) : (d = cljs.core.first.call(null, a), h = cljs.core.nth.call(null, d, 0, null), g = cljs.core.nth.call(null, d, 1, null), g.call(null, h, this, b, c), a = cljs.core.next.call(null, a), d = null, e = 0), f = 0 - }else { - return null + f += 1; + } else { + if (a = cljs.core.seq.call(null, a)) { + cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), h = d, e = cljs.core.count.call(null, d), d = h) : (d = cljs.core.first.call(null, a), h = cljs.core.nth.call(null, d, 0, null), g = cljs.core.nth.call(null, d, 1, null), g.call(null, h, this, b, c), a = cljs.core.next.call(null, a), d = null, e = 0), f = 0; + } else { + return null; } } } }; cljs.core.Atom.prototype.cljs$core$IWatchable$_add_watch$arity$3 = function(a, b, c) { - return this.watches = cljs.core.assoc.call(null, this.watches, b, c) + return this.watches = cljs.core.assoc.call(null, this.watches, b, c); }; cljs.core.Atom.prototype.cljs$core$IWatchable$_remove_watch$arity$2 = function(a, b) { - return this.watches = cljs.core.dissoc.call(null, this.watches, b) + return this.watches = cljs.core.dissoc.call(null, this.watches, b); }; cljs.core.Atom.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { cljs.core._write.call(null, b, "#\x3cAtom: "); cljs.core.pr_writer.call(null, this.state, b, c); - return cljs.core._write.call(null, b, "\x3e") + return cljs.core._write.call(null, b, "\x3e"); }; cljs.core.Atom.prototype.cljs$core$IMeta$_meta$arity$1 = function(a) { - return this.meta + return this.meta; }; cljs.core.Atom.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { - return this.state + return this.state; }; cljs.core.Atom.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return this === b + return this === b; }; cljs.core.__GT_Atom = function(a, b, c, d) { - return new cljs.core.Atom(a, b, c, d) + return new cljs.core.Atom(a, b, c, d); }; cljs.core.atom = function() { var a = null, b = function(a) { - return new cljs.core.Atom(a, null, null, null) + return new cljs.core.Atom(a, null, null, null); }, c = function() { var a = function(a, b) { var c = cljs.core.seq_QMARK_.call(null, b) ? cljs.core.apply.call(null, cljs.core.hash_map, b) : b, d = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "validator", "validator", 4199087812)), c = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "meta", "meta", 1017252215)); - return new cljs.core.Atom(a, c, d, null) + return new cljs.core.Atom(a, c, d, null); }, b = function(b, c) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, b) + return a(c, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)); } throw Error("Invalid arity: " + arguments.length); }; @@ -12665,34 +12803,34 @@ cljs.core.atom = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.reset_BANG_ = function(a, b) { var c = a.validator; - if(null != c && !cljs.core.truth_(c.call(null, b))) { + if (null != c && !cljs.core.truth_(c.call(null, b))) { throw Error([cljs.core.str("Assert failed: "), cljs.core.str("Validator rejected reference state"), cljs.core.str("\n"), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "validate", "validate", 1233162959, null), new cljs.core.Symbol(null, "new-value", "new-value", 972165309, null))))].join("")); } c = a.state; a.state = b; null != a.watches && cljs.core._notify_watches.call(null, a, c, b); - return b + return b; }; cljs.core.swap_BANG_ = function() { var a = null, b = function(a, b) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state)) + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state)); }, c = function(a, b, c) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c)) + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c)); }, d = function(a, b, c, d) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d)) + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d)); }, e = function(a, b, c, d, e) { - return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d, e)) + return cljs.core.reset_BANG_.call(null, a, b.call(null, a.state, c, d, e)); }, f = function() { var a = function(a, b, c, d, e, f) { - return cljs.core.reset_BANG_.call(null, a, cljs.core.apply.call(null, b, a.state, c, d, e, f)) + return cljs.core.reset_BANG_.call(null, a, cljs.core.apply.call(null, b, a.state, c, d, e, f)); }, b = function(b, c, d, e, f, h) { var r = null; 5 < arguments.length && (r = cljs.core.array_seq(Array.prototype.slice.call(arguments, 5), 0)); - return a.call(this, b, c, d, e, f, r) + return a.call(this, b, c, d, e, f, r); }; b.cljs$lang$maxFixedArity = 5; b.cljs$lang$applyTo = function(b) { @@ -12706,10 +12844,10 @@ cljs.core.swap_BANG_ = function() { b = cljs.core.next(b); var h = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, d, e, f, h, b) + return a(c, d, e, f, h, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, h, k, l, m, n) { switch(arguments.length) { case 2: @@ -12721,7 +12859,7 @@ cljs.core.swap_BANG_ = function() { case 5: return e.call(this, a, h, k, l, m); default: - return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)) + return f.cljs$core$IFn$_invoke$arity$variadic(a, h, k, l, m, cljs.core.array_seq(arguments, 5)); } throw Error("Invalid arity: " + arguments.length); }; @@ -12732,27 +12870,27 @@ cljs.core.swap_BANG_ = function() { a.cljs$core$IFn$_invoke$arity$4 = d; a.cljs$core$IFn$_invoke$arity$5 = e; a.cljs$core$IFn$_invoke$arity$variadic = f.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.compare_and_set_BANG_ = function(a, b, c) { - return cljs.core._EQ_.call(null, a.state, b) ? (cljs.core.reset_BANG_.call(null, a, c), !0) : !1 + return cljs.core._EQ_.call(null, a.state, b) ? (cljs.core.reset_BANG_.call(null, a, c), !0) : !1; }; cljs.core.deref = function(a) { - return cljs.core._deref.call(null, a) + return cljs.core._deref.call(null, a); }; cljs.core.set_validator_BANG_ = function(a, b) { - return a.validator = b + return a.validator = b; }; cljs.core.get_validator = function(a) { - return a.validator + return a.validator; }; cljs.core.alter_meta_BANG_ = function() { var a = function(a, b, e) { - return a.meta = cljs.core.apply.call(null, b, a.meta, e) + return a.meta = cljs.core.apply.call(null, b, a.meta, e); }, b = function(b, d, e) { var f = null; 2 < arguments.length && (f = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2), 0)); - return a.call(this, b, d, f) + return a.call(this, b, d, f); }; b.cljs$lang$maxFixedArity = 2; b.cljs$lang$applyTo = function(b) { @@ -12760,39 +12898,39 @@ cljs.core.alter_meta_BANG_ = function() { b = cljs.core.next(b); var e = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, e, b) + return a(d, e, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.reset_meta_BANG_ = function(a, b) { - return a.meta = b + return a.meta = b; }; cljs.core.add_watch = function(a, b, c) { - return cljs.core._add_watch.call(null, a, b, c) + return cljs.core._add_watch.call(null, a, b, c); }; cljs.core.remove_watch = function(a, b) { - return cljs.core._remove_watch.call(null, a, b) + return cljs.core._remove_watch.call(null, a, b); }; cljs.core.gensym_counter = null; cljs.core.gensym = function() { var a = null, b = function() { - return a.call(null, "G__") + return a.call(null, "G__"); }, c = function(a) { null == cljs.core.gensym_counter && (cljs.core.gensym_counter = cljs.core.atom.call(null, 0)); - return cljs.core.symbol.call(null, [cljs.core.str(a), cljs.core.str(cljs.core.swap_BANG_.call(null, cljs.core.gensym_counter, cljs.core.inc))].join("")) + return cljs.core.symbol.call(null, [cljs.core.str(a), cljs.core.str(cljs.core.swap_BANG_.call(null, cljs.core.gensym_counter, cljs.core.inc))].join("")); }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a) + return c.call(this, a); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a + return a; }(); cljs.core.fixture1 = 1; cljs.core.fixture2 = 2; @@ -12800,137 +12938,137 @@ cljs.core.Delay = function(a, b) { this.state = a; this.f = b; this.cljs$lang$protocol_mask$partition1$ = 1; - this.cljs$lang$protocol_mask$partition0$ = 32768 + this.cljs$lang$protocol_mask$partition0$ = 32768; }; cljs.core.Delay.cljs$lang$type = !0; cljs.core.Delay.cljs$lang$ctorStr = "cljs.core/Delay"; cljs.core.Delay.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/Delay") + return cljs.core._write.call(null, b, "cljs.core/Delay"); }; cljs.core.Delay.prototype.cljs$core$IPending$_realized_QMARK_$arity$1 = function(a) { - return(new cljs.core.Keyword(null, "done", "done", 1016993524)).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null, this.state)) + return(new cljs.core.Keyword(null, "done", "done", 1016993524)).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null, this.state)); }; cljs.core.Delay.prototype.cljs$core$IDeref$_deref$arity$1 = function(a) { var b = this; return(new cljs.core.Keyword(null, "value", "value", 1125876963)).cljs$core$IFn$_invoke$arity$1(cljs.core.swap_BANG_.call(null, b.state, function(a) { a = cljs.core.seq_QMARK_.call(null, a) ? cljs.core.apply.call(null, cljs.core.hash_map, a) : a; var d = cljs.core.get.call(null, a, new cljs.core.Keyword(null, "done", "done", 1016993524)); - return cljs.core.truth_(d) ? a : new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null, "done", "done", 1016993524), !0, new cljs.core.Keyword(null, "value", "value", 1125876963), b.f.call(null)], null) - })) + return cljs.core.truth_(d) ? a : new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null, "done", "done", 1016993524), !0, new cljs.core.Keyword(null, "value", "value", 1125876963), b.f.call(null)], null); + })); }; cljs.core.__GT_Delay = function(a, b) { - return new cljs.core.Delay(a, b) + return new cljs.core.Delay(a, b); }; cljs.core.delay_QMARK_ = function(a) { - return a instanceof cljs.core.Delay + return a instanceof cljs.core.Delay; }; cljs.core.force = function(a) { - return cljs.core.delay_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : a + return cljs.core.delay_QMARK_.call(null, a) ? cljs.core.deref.call(null, a) : a; }; cljs.core.realized_QMARK_ = function(a) { - return cljs.core._realized_QMARK_.call(null, a) + return cljs.core._realized_QMARK_.call(null, a); }; cljs.core.IEncodeJS = function() { - return{} + return{}; }(); cljs.core._clj__GT_js = function(a) { - if(a ? a.cljs$core$IEncodeJS$_clj__GT_js$arity$1 : a) { - return a.cljs$core$IEncodeJS$_clj__GT_js$arity$1(a) + if (a ? a.cljs$core$IEncodeJS$_clj__GT_js$arity$1 : a) { + return a.cljs$core$IEncodeJS$_clj__GT_js$arity$1(a); } var b; b = cljs.core._clj__GT_js[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._clj__GT_js._, !b)) { + if (!b && (b = cljs.core._clj__GT_js._, !b)) { throw cljs.core.missing_protocol.call(null, "IEncodeJS.-clj-\x3ejs", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._key__GT_js = function(a) { - if(a ? a.cljs$core$IEncodeJS$_key__GT_js$arity$1 : a) { - return a.cljs$core$IEncodeJS$_key__GT_js$arity$1(a) + if (a ? a.cljs$core$IEncodeJS$_key__GT_js$arity$1 : a) { + return a.cljs$core$IEncodeJS$_key__GT_js$arity$1(a); } var b; b = cljs.core._key__GT_js[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._key__GT_js._, !b)) { + if (!b && (b = cljs.core._key__GT_js._, !b)) { throw cljs.core.missing_protocol.call(null, "IEncodeJS.-key-\x3ejs", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core.key__GT_js = function(a) { - return(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeJS$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) ? cljs.core._clj__GT_js.call(null, a) : "string" === typeof a || "number" === typeof a || a instanceof cljs.core.Keyword || a instanceof cljs.core.Symbol ? cljs.core.clj__GT_js.call(null, a) : cljs.core.pr_str.call(null, a) + return(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeJS$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, a)) ? cljs.core._clj__GT_js.call(null, a) : "string" === typeof a || "number" === typeof a || a instanceof cljs.core.Keyword || a instanceof cljs.core.Symbol ? cljs.core.clj__GT_js.call(null, a) : cljs.core.pr_str.call(null, a); }; cljs.core.clj__GT_js = function clj__GT_js(b) { - if(null == b) { - return null + if (null == b) { + return null; } - if(b ? cljs.core.truth_(cljs.core.truth_(null) ? null : b.cljs$core$IEncodeJS$) || (b.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) { - return cljs.core._clj__GT_js.call(null, b) + if (b ? cljs.core.truth_(cljs.core.truth_(null) ? null : b.cljs$core$IEncodeJS$) || (b.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeJS, b)) { + return cljs.core._clj__GT_js.call(null, b); } - if(b instanceof cljs.core.Keyword) { - return cljs.core.name.call(null, b) + if (b instanceof cljs.core.Keyword) { + return cljs.core.name.call(null, b); } - if(b instanceof cljs.core.Symbol) { - return"" + cljs.core.str(b) + if (b instanceof cljs.core.Symbol) { + return "" + cljs.core.str(b); } - if(cljs.core.map_QMARK_.call(null, b)) { + if (cljs.core.map_QMARK_.call(null, b)) { var c = {}; b = cljs.core.seq.call(null, b); - for(var d = null, e = 0, f = 0;;) { - if(f < e) { + for (var d = null, e = 0, f = 0;;) { + if (f < e) { var g = cljs.core._nth.call(null, d, f), h = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); c[cljs.core.key__GT_js.call(null, h)] = clj__GT_js.call(null, g); - f += 1 - }else { - if(b = cljs.core.seq.call(null, b)) { - cljs.core.chunked_seq_QMARK_.call(null, b) ? (e = cljs.core.chunk_first.call(null, b), b = cljs.core.chunk_rest.call(null, b), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, b), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), c[cljs.core.key__GT_js.call(null, d)] = clj__GT_js.call(null, e), b = cljs.core.next.call(null, b), d = null, e = 0), f = 0 - }else { - break + f += 1; + } else { + if (b = cljs.core.seq.call(null, b)) { + cljs.core.chunked_seq_QMARK_.call(null, b) ? (e = cljs.core.chunk_first.call(null, b), b = cljs.core.chunk_rest.call(null, b), d = e, e = cljs.core.count.call(null, e)) : (e = cljs.core.first.call(null, b), d = cljs.core.nth.call(null, e, 0, null), e = cljs.core.nth.call(null, e, 1, null), c[cljs.core.key__GT_js.call(null, d)] = clj__GT_js.call(null, e), b = cljs.core.next.call(null, b), d = null, e = 0), f = 0; + } else { + break; } } } - return c + return c; } - if(cljs.core.coll_QMARK_.call(null, b)) { + if (cljs.core.coll_QMARK_.call(null, b)) { c = []; b = cljs.core.seq.call(null, cljs.core.map.call(null, clj__GT_js, b)); d = null; - for(f = e = 0;;) { - if(f < e) { - h = cljs.core._nth.call(null, d, f), c.push(h), f += 1 - }else { - if(b = cljs.core.seq.call(null, b)) { - d = b, cljs.core.chunked_seq_QMARK_.call(null, d) ? (b = cljs.core.chunk_first.call(null, d), f = cljs.core.chunk_rest.call(null, d), d = b, e = cljs.core.count.call(null, b), b = f) : (b = cljs.core.first.call(null, d), c.push(b), b = cljs.core.next.call(null, d), d = null, e = 0), f = 0 - }else { - break + for (f = e = 0;;) { + if (f < e) { + h = cljs.core._nth.call(null, d, f), c.push(h), f += 1; + } else { + if (b = cljs.core.seq.call(null, b)) { + d = b, cljs.core.chunked_seq_QMARK_.call(null, d) ? (b = cljs.core.chunk_first.call(null, d), f = cljs.core.chunk_rest.call(null, d), d = b, e = cljs.core.count.call(null, b), b = f) : (b = cljs.core.first.call(null, d), c.push(b), b = cljs.core.next.call(null, d), d = null, e = 0), f = 0; + } else { + break; } } } - return c + return c; } - return new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null; }; cljs.core.IEncodeClojure = function() { - return{} + return{}; }(); cljs.core._js__GT_clj = function(a, b) { - if(a ? a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2 : a) { - return a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2(a, b) + if (a ? a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2 : a) { + return a.cljs$core$IEncodeClojure$_js__GT_clj$arity$2(a, b); } var c; c = cljs.core._js__GT_clj[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._js__GT_clj._, !c)) { + if (!c && (c = cljs.core._js__GT_clj._, !c)) { throw cljs.core.missing_protocol.call(null, "IEncodeClojure.-js-\x3eclj", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.js__GT_clj = function() { var a = null, b = function(b) { - return a.call(null, b, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672), !1], null)) + return a.call(null, b, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672), !1], null)); }, c = function() { var a = function(a, b) { - if(a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeClojure$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) { - return cljs.core._js__GT_clj.call(null, a, cljs.core.apply.call(null, cljs.core.array_map, b)) + if (a ? cljs.core.truth_(cljs.core.truth_(null) ? null : a.cljs$core$IEncodeClojure$) || (a.cljs$lang$protocol_mask$partition$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IEncodeClojure, a)) { + return cljs.core._js__GT_clj.call(null, a, cljs.core.apply.call(null, cljs.core.array_map, b)); } - if(cljs.core.seq.call(null, b)) { + if (cljs.core.seq.call(null, b)) { var c = cljs.core.seq_QMARK_.call(null, b) ? cljs.core.apply.call(null, cljs.core.hash_map, b) : b, d = cljs.core.get.call(null, c, new cljs.core.Keyword(null, "keywordize-keys", "keywordize-keys", 4191781672)), e = cljs.core.truth_(d) ? cljs.core.keyword : cljs.core.str; return function(a, b, c, d) { return function s(e) { @@ -12939,59 +13077,59 @@ cljs.core.js__GT_clj = function() { return function R(f) { return new cljs.core.LazySeq(null, function(a, b, c, d) { return function() { - for(;;) { + for (;;) { var a = cljs.core.seq.call(null, f); - if(a) { - if(cljs.core.chunked_seq_QMARK_.call(null, a)) { + if (a) { + if (cljs.core.chunked_seq_QMARK_.call(null, a)) { var b = cljs.core.chunk_first.call(null, a), c = cljs.core.count.call(null, b), g = cljs.core.chunk_buffer.call(null, c); a: { - for(var h = 0;;) { - if(h < c) { + for (var h = 0;;) { + if (h < c) { var k = cljs.core._nth.call(null, b, h); cljs.core.chunk_append.call(null, g, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, k), s.call(null, e[k])], null)); - h += 1 - }else { + h += 1; + } else { b = !0; - break a + break a; } } - b = void 0 + b = void 0; } - return b ? cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), R.call(null, cljs.core.chunk_rest.call(null, a))) : cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), null) + return b ? cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), R.call(null, cljs.core.chunk_rest.call(null, a))) : cljs.core.chunk_cons.call(null, cljs.core.chunk.call(null, g), null); } g = cljs.core.first.call(null, a); - return cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, g), s.call(null, e[g])], null), R.call(null, cljs.core.rest.call(null, a))) + return cljs.core.cons.call(null, new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [d.call(null, g), s.call(null, e[g])], null), R.call(null, cljs.core.rest.call(null, a))); } - return null + return null; } - } - }(a, b, c, d), null, null) - } - }(a, b, c, d).call(null, cljs.core.js_keys.call(null, e)) - }()) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? e : null - } - }(b, c, d, e).call(null, a) + }; + }(a, b, c, d), null, null); + }; + }(a, b, c, d).call(null, cljs.core.js_keys.call(null, e)); + }()) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? e : null; + }; + }(b, c, d, e).call(null, a); } - return null + return null; }, b = function(b, c) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var c = cljs.core.first(b); b = cljs.core.rest(b); - return a(c, b) + return a(c, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)); } throw Error("Invalid arity: " + arguments.length); }; @@ -12999,64 +13137,64 @@ cljs.core.js__GT_clj = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.memoize = function(a) { var b = cljs.core.atom.call(null, cljs.core.PersistentArrayMap.EMPTY); return function() { var c = function(c) { var d = cljs.core.get.call(null, cljs.core.deref.call(null, b), c); - if(cljs.core.truth_(d)) { - return d + if (cljs.core.truth_(d)) { + return d; } d = cljs.core.apply.call(null, a, c); cljs.core.swap_BANG_.call(null, b, cljs.core.assoc, c, d); - return d + return d; }, d = function(a) { var b = null; 0 < arguments.length && (b = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0), 0)); - return c.call(this, b) + return c.call(this, b); }; d.cljs$lang$maxFixedArity = 0; d.cljs$lang$applyTo = function(a) { a = cljs.core.seq(a); - return c(a) + return c(a); }; d.cljs$core$IFn$_invoke$arity$variadic = c; - return d - }() + return d; + }(); }; cljs.core.trampoline = function() { var a = null, b = function(a) { - for(;;) { - if(a = a.call(null), !cljs.core.fn_QMARK_.call(null, a)) { - return a + for (;;) { + if (a = a.call(null), !cljs.core.fn_QMARK_.call(null, a)) { + return a; } } }, c = function() { var b = function(b, c) { return a.call(null, function() { - return cljs.core.apply.call(null, b, c) - }) + return cljs.core.apply.call(null, b, c); + }); }, c = function(a, c) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return b.call(this, a, e) + return b.call(this, a, e); }; c.cljs$lang$maxFixedArity = 1; c.cljs$lang$applyTo = function(a) { var c = cljs.core.first(a); a = cljs.core.rest(a); - return b(c, a) + return b(c, a); }; c.cljs$core$IFn$_invoke$arity$variadic = b; - return c + return c; }(), a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); default: - return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)) + return c.cljs$core$IFn$_invoke$arity$variadic(a, cljs.core.array_seq(arguments, 1)); } throw Error("Invalid arity: " + arguments.length); }; @@ -13064,385 +13202,385 @@ cljs.core.trampoline = function() { a.cljs$lang$applyTo = c.cljs$lang$applyTo; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$variadic = c.cljs$core$IFn$_invoke$arity$variadic; - return a + return a; }(); cljs.core.rand = function() { var a = null, b = function() { - return a.call(null, 1) + return a.call(null, 1); }, c = function(a) { - return Math.random.call(null) * a + return Math.random.call(null) * a; }, a = function(a) { switch(arguments.length) { case 0: return b.call(this); case 1: - return c.call(this, a) + return c.call(this, a); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$0 = b; a.cljs$core$IFn$_invoke$arity$1 = c; - return a + return a; }(); cljs.core.rand_int = function(a) { - return Math.floor.call(null, Math.random.call(null) * a) + return Math.floor.call(null, Math.random.call(null) * a); }; cljs.core.rand_nth = function(a) { - return cljs.core.nth.call(null, a, cljs.core.rand_int.call(null, cljs.core.count.call(null, a))) + return cljs.core.nth.call(null, a, cljs.core.rand_int.call(null, cljs.core.count.call(null, a))); }; cljs.core.group_by = function(a, b) { return cljs.core.reduce.call(null, function(b, d) { var e = a.call(null, d); - return cljs.core.assoc.call(null, b, e, cljs.core.conj.call(null, cljs.core.get.call(null, b, e, cljs.core.PersistentVector.EMPTY), d)) - }, cljs.core.PersistentArrayMap.EMPTY, b) + return cljs.core.assoc.call(null, b, e, cljs.core.conj.call(null, cljs.core.get.call(null, b, e, cljs.core.PersistentVector.EMPTY), d)); + }, cljs.core.PersistentArrayMap.EMPTY, b); }; cljs.core.make_hierarchy = function() { - return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "descendants", "descendants", 768214664), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), cljs.core.PersistentArrayMap.EMPTY], null) + return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "descendants", "descendants", 768214664), cljs.core.PersistentArrayMap.EMPTY, new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), cljs.core.PersistentArrayMap.EMPTY], null); }; cljs.core._global_hierarchy = null; cljs.core.get_global_hierarchy = function() { null == cljs.core._global_hierarchy && (cljs.core._global_hierarchy = cljs.core.atom.call(null, cljs.core.make_hierarchy.call(null))); - return cljs.core._global_hierarchy + return cljs.core._global_hierarchy; }; cljs.core.swap_global_hierarchy_BANG_ = function() { var a = function(a, b) { - return cljs.core.apply.call(null, cljs.core.swap_BANG_, cljs.core.get_global_hierarchy.call(null), a, b) + return cljs.core.apply.call(null, cljs.core.swap_BANG_, cljs.core.get_global_hierarchy.call(null), a, b); }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.isa_QMARK_ = function() { var a = null, b = function(b, c) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b, c) + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b, c); }, c = function(b, c, f) { var g = cljs.core._EQ_.call(null, c, f); - if(!g && !(g = cljs.core.contains_QMARK_.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(b).call(null, c), f)) && (g = cljs.core.vector_QMARK_.call(null, f)) && (g = cljs.core.vector_QMARK_.call(null, c))) { - if(g = cljs.core.count.call(null, f) === cljs.core.count.call(null, c)) { - for(var g = !0, h = 0;;) { - if(g && h !== cljs.core.count.call(null, f)) { - g = a.call(null, b, c.call(null, h), f.call(null, h)), h += 1 - }else { - return g + if (!g && !(g = cljs.core.contains_QMARK_.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(b).call(null, c), f)) && (g = cljs.core.vector_QMARK_.call(null, f)) && (g = cljs.core.vector_QMARK_.call(null, c))) { + if (g = cljs.core.count.call(null, f) === cljs.core.count.call(null, c)) { + for (var g = !0, h = 0;;) { + if (g && h !== cljs.core.count.call(null, f)) { + g = a.call(null, b, c.call(null, h), f.call(null, h)), h += 1; + } else { + return g; } } - }else { - return g + } else { + return g; } - }else { - return g + } else { + return g; } }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.parents = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b); }, c = function(a, b) { - return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b)) + return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.ancestors = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b); }, c = function(a, b) { - return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), b)) + return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.descendants = function() { var a = null, b = function(b) { - return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b) + return a.call(null, cljs.core.deref.call(null, cljs.core.get_global_hierarchy.call(null)), b); }, c = function(a, b) { - return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), b)) + return cljs.core.not_empty.call(null, cljs.core.get.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); cljs.core.derive = function() { var a = null, b = function(b, c) { - if(!cljs.core.truth_(cljs.core.namespace.call(null, c))) { + if (!cljs.core.truth_(cljs.core.namespace.call(null, c))) { throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "namespace", "namespace", -388313324, null), new cljs.core.Symbol(null, "parent", "parent", 1659011683, null))))].join("")); } cljs.core.swap_global_hierarchy_BANG_.call(null, a, b, c); - return null + return null; }, c = function(a, b, c) { - if(!cljs.core.not_EQ_.call(null, b, c)) { + if (!cljs.core.not_EQ_.call(null, b, c)) { throw Error([cljs.core.str("Assert failed: "), cljs.core.str(cljs.core.pr_str.call(null, cljs.core.list(new cljs.core.Symbol(null, "not\x3d", "not\x3d", -1637144189, null), new cljs.core.Symbol(null, "tag", "tag", -1640416941, null), new cljs.core.Symbol(null, "parent", "parent", 1659011683, null))))].join("")); } var g = (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), h = (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), k = (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), l = function(a, b, c) { return function(d, e, f, g, h) { return cljs.core.reduce.call(null, function(a, b, c) { return function(a, b) { - return cljs.core.assoc.call(null, a, b, cljs.core.reduce.call(null, cljs.core.conj, cljs.core.get.call(null, h, b, cljs.core.PersistentHashSet.EMPTY), cljs.core.cons.call(null, g, h.call(null, g)))) - } - }(a, b, c), d, cljs.core.cons.call(null, e, f.call(null, e))) - } + return cljs.core.assoc.call(null, a, b, cljs.core.reduce.call(null, cljs.core.conj, cljs.core.get.call(null, h, b, cljs.core.PersistentHashSet.EMPTY), cljs.core.cons.call(null, g, h.call(null, g)))); + }; + }(a, b, c), d, cljs.core.cons.call(null, e, f.call(null, e))); + }; }(g, h, k); - if(cljs.core.contains_QMARK_.call(null, g.call(null, b), c)) { - b = null - }else { - if(cljs.core.contains_QMARK_.call(null, k.call(null, b), c)) { + if (cljs.core.contains_QMARK_.call(null, g.call(null, b), c)) { + b = null; + } else { + if (cljs.core.contains_QMARK_.call(null, k.call(null, b), c)) { throw Error([cljs.core.str(b), cljs.core.str("already has"), cljs.core.str(c), cljs.core.str("as ancestor")].join("")); } - if(cljs.core.contains_QMARK_.call(null, k.call(null, c), b)) { + if (cljs.core.contains_QMARK_.call(null, k.call(null, c), b)) { throw Error([cljs.core.str("Cyclic derivation:"), cljs.core.str(c), cljs.core.str("has"), cljs.core.str(b), cljs.core.str("as ancestor")].join("")); } b = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null, "parents", "parents", 4515496059), cljs.core.assoc.call(null, (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), b, cljs.core.conj.call(null, cljs.core.get.call(null, g, b, cljs.core.PersistentHashSet.EMPTY), c)), new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442), l.call(null, (new cljs.core.Keyword(null, "ancestors", "ancestors", 889955442)).cljs$core$IFn$_invoke$arity$1(a), - b, h, c, k), new cljs.core.Keyword(null, "descendants", "descendants", 768214664), l.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), c, k, b, h)], null) + b, h, c, k), new cljs.core.Keyword(null, "descendants", "descendants", 768214664), l.call(null, (new cljs.core.Keyword(null, "descendants", "descendants", 768214664)).cljs$core$IFn$_invoke$arity$1(a), c, k, b, h)], null); } - return cljs.core.truth_(b) ? b : a + return cljs.core.truth_(b) ? b : a; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.underive = function() { var a = null, b = function(b, c) { cljs.core.swap_global_hierarchy_BANG_.call(null, a, b, c); - return null + return null; }, c = function(a, b, c) { var g = (new cljs.core.Keyword(null, "parents", "parents", 4515496059)).cljs$core$IFn$_invoke$arity$1(a), h = cljs.core.truth_(g.call(null, b)) ? cljs.core.disj.call(null, g.call(null, b), c) : cljs.core.PersistentHashSet.EMPTY, k = cljs.core.truth_(cljs.core.not_empty.call(null, h)) ? cljs.core.assoc.call(null, g, b, h) : cljs.core.dissoc.call(null, g, b), h = cljs.core.flatten.call(null, cljs.core.map.call(null, function(a, b, c) { return function(a) { - return cljs.core.cons.call(null, cljs.core.first.call(null, a), cljs.core.interpose.call(null, cljs.core.first.call(null, a), cljs.core.second.call(null, a))) - } + return cljs.core.cons.call(null, cljs.core.first.call(null, a), cljs.core.interpose.call(null, cljs.core.first.call(null, a), cljs.core.second.call(null, a))); + }; }(g, h, k), cljs.core.seq.call(null, k))); return cljs.core.contains_QMARK_.call(null, g.call(null, b), c) ? cljs.core.reduce.call(null, function(a, b) { - return cljs.core.apply.call(null, cljs.core.derive, a, b) - }, cljs.core.make_hierarchy.call(null), cljs.core.partition.call(null, 2, h)) : a + return cljs.core.apply.call(null, cljs.core.derive, a, b); + }, cljs.core.make_hierarchy.call(null), cljs.core.partition.call(null, 2, h)) : a; }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.reset_cache = function(a, b, c, d) { cljs.core.swap_BANG_.call(null, a, function(a) { - return cljs.core.deref.call(null, b) + return cljs.core.deref.call(null, b); }); return cljs.core.swap_BANG_.call(null, c, function(a) { - return cljs.core.deref.call(null, d) - }) + return cljs.core.deref.call(null, d); + }); }; cljs.core.prefers_STAR_ = function prefers_STAR_(b, c, d) { var e = cljs.core.deref.call(null, d).call(null, b), e = cljs.core.truth_(cljs.core.truth_(e) ? e.call(null, c) : e) ? !0 : null; - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = function() { - for(var e = cljs.core.parents.call(null, c);;) { - if(0 < cljs.core.count.call(null, e)) { - cljs.core.truth_(prefers_STAR_.call(null, b, cljs.core.first.call(null, e), d)), e = cljs.core.rest.call(null, e) - }else { - return null + for (var e = cljs.core.parents.call(null, c);;) { + if (0 < cljs.core.count.call(null, e)) { + cljs.core.truth_(prefers_STAR_.call(null, b, cljs.core.first.call(null, e), d)), e = cljs.core.rest.call(null, e); + } else { + return null; } } }(); - if(cljs.core.truth_(e)) { - return e + if (cljs.core.truth_(e)) { + return e; } e = function() { - for(var e = cljs.core.parents.call(null, b);;) { - if(0 < cljs.core.count.call(null, e)) { - cljs.core.truth_(prefers_STAR_.call(null, cljs.core.first.call(null, e), c, d)), e = cljs.core.rest.call(null, e) - }else { - return null + for (var e = cljs.core.parents.call(null, b);;) { + if (0 < cljs.core.count.call(null, e)) { + cljs.core.truth_(prefers_STAR_.call(null, cljs.core.first.call(null, e), c, d)), e = cljs.core.rest.call(null, e); + } else { + return null; } } }(); - return cljs.core.truth_(e) ? e : !1 + return cljs.core.truth_(e) ? e : !1; }; cljs.core.dominates = function(a, b, c) { c = cljs.core.prefers_STAR_.call(null, a, b, c); - return cljs.core.truth_(c) ? c : cljs.core.isa_QMARK_.call(null, a, b) + return cljs.core.truth_(c) ? c : cljs.core.isa_QMARK_.call(null, a, b); }; cljs.core.find_and_cache_best_method = function find_and_cache_best_method(b, c, d, e, f, g, h) { var k = cljs.core.reduce.call(null, function(e, g) { var h = cljs.core.nth.call(null, g, 0, null); cljs.core.nth.call(null, g, 1, null); - if(cljs.core.isa_QMARK_.call(null, cljs.core.deref.call(null, d), c, h)) { + if (cljs.core.isa_QMARK_.call(null, cljs.core.deref.call(null, d), c, h)) { var k = cljs.core.truth_(function() { var b = null == e; - return b ? b : cljs.core.dominates.call(null, h, cljs.core.first.call(null, e), f) + return b ? b : cljs.core.dominates.call(null, h, cljs.core.first.call(null, e), f); }()) ? g : e; - if(!cljs.core.truth_(cljs.core.dominates.call(null, cljs.core.first.call(null, k), h, f))) { + if (!cljs.core.truth_(cljs.core.dominates.call(null, cljs.core.first.call(null, k), h, f))) { throw Error([cljs.core.str("Multiple methods in multimethod '"), cljs.core.str(b), cljs.core.str("' match dispatch value: "), cljs.core.str(c), cljs.core.str(" -\x3e "), cljs.core.str(h), cljs.core.str(" and "), cljs.core.str(cljs.core.first.call(null, k)), cljs.core.str(", and neither is preferred")].join("")); } - return k + return k; } - return e + return e; }, null, cljs.core.deref.call(null, e)); - if(cljs.core.truth_(k)) { - if(cljs.core._EQ_.call(null, cljs.core.deref.call(null, h), cljs.core.deref.call(null, d))) { - return cljs.core.swap_BANG_.call(null, g, cljs.core.assoc, c, cljs.core.second.call(null, k)), cljs.core.second.call(null, k) + if (cljs.core.truth_(k)) { + if (cljs.core._EQ_.call(null, cljs.core.deref.call(null, h), cljs.core.deref.call(null, d))) { + return cljs.core.swap_BANG_.call(null, g, cljs.core.assoc, c, cljs.core.second.call(null, k)), cljs.core.second.call(null, k); } cljs.core.reset_cache.call(null, g, e, h, d); - return find_and_cache_best_method.call(null, b, c, d, e, f, g, h) + return find_and_cache_best_method.call(null, b, c, d, e, f, g, h); } - return null + return null; }; cljs.core.IMultiFn = function() { - return{} + return{}; }(); cljs.core._reset = function(a) { - if(a ? a.cljs$core$IMultiFn$_reset$arity$1 : a) { - return a.cljs$core$IMultiFn$_reset$arity$1(a) + if (a ? a.cljs$core$IMultiFn$_reset$arity$1 : a) { + return a.cljs$core$IMultiFn$_reset$arity$1(a); } var b; b = cljs.core._reset[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._reset._, !b)) { + if (!b && (b = cljs.core._reset._, !b)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-reset", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._add_method = function(a, b, c) { - if(a ? a.cljs$core$IMultiFn$_add_method$arity$3 : a) { - return a.cljs$core$IMultiFn$_add_method$arity$3(a, b, c) + if (a ? a.cljs$core$IMultiFn$_add_method$arity$3 : a) { + return a.cljs$core$IMultiFn$_add_method$arity$3(a, b, c); } var d; d = cljs.core._add_method[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._add_method._, !d)) { + if (!d && (d = cljs.core._add_method._, !d)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-add-method", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._remove_method = function(a, b) { - if(a ? a.cljs$core$IMultiFn$_remove_method$arity$2 : a) { - return a.cljs$core$IMultiFn$_remove_method$arity$2(a, b) + if (a ? a.cljs$core$IMultiFn$_remove_method$arity$2 : a) { + return a.cljs$core$IMultiFn$_remove_method$arity$2(a, b); } var c; c = cljs.core._remove_method[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._remove_method._, !c)) { + if (!c && (c = cljs.core._remove_method._, !c)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-remove-method", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._prefer_method = function(a, b, c) { - if(a ? a.cljs$core$IMultiFn$_prefer_method$arity$3 : a) { - return a.cljs$core$IMultiFn$_prefer_method$arity$3(a, b, c) + if (a ? a.cljs$core$IMultiFn$_prefer_method$arity$3 : a) { + return a.cljs$core$IMultiFn$_prefer_method$arity$3(a, b, c); } var d; d = cljs.core._prefer_method[goog.typeOf(null == a ? null : a)]; - if(!d && (d = cljs.core._prefer_method._, !d)) { + if (!d && (d = cljs.core._prefer_method._, !d)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-prefer-method", a); } - return d.call(null, a, b, c) + return d.call(null, a, b, c); }; cljs.core._get_method = function(a, b) { - if(a ? a.cljs$core$IMultiFn$_get_method$arity$2 : a) { - return a.cljs$core$IMultiFn$_get_method$arity$2(a, b) + if (a ? a.cljs$core$IMultiFn$_get_method$arity$2 : a) { + return a.cljs$core$IMultiFn$_get_method$arity$2(a, b); } var c; c = cljs.core._get_method[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._get_method._, !c)) { + if (!c && (c = cljs.core._get_method._, !c)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-get-method", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core._methods = function(a) { - if(a ? a.cljs$core$IMultiFn$_methods$arity$1 : a) { - return a.cljs$core$IMultiFn$_methods$arity$1(a) + if (a ? a.cljs$core$IMultiFn$_methods$arity$1 : a) { + return a.cljs$core$IMultiFn$_methods$arity$1(a); } var b; b = cljs.core._methods[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._methods._, !b)) { + if (!b && (b = cljs.core._methods._, !b)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-methods", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._prefers = function(a) { - if(a ? a.cljs$core$IMultiFn$_prefers$arity$1 : a) { - return a.cljs$core$IMultiFn$_prefers$arity$1(a) + if (a ? a.cljs$core$IMultiFn$_prefers$arity$1 : a) { + return a.cljs$core$IMultiFn$_prefers$arity$1(a); } var b; b = cljs.core._prefers[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.core._prefers._, !b)) { + if (!b && (b = cljs.core._prefers._, !b)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-prefers", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.core._dispatch = function(a, b) { - if(a ? a.cljs$core$IMultiFn$_dispatch$arity$2 : a) { - return a.cljs$core$IMultiFn$_dispatch$arity$2(a, b) + if (a ? a.cljs$core$IMultiFn$_dispatch$arity$2 : a) { + return a.cljs$core$IMultiFn$_dispatch$arity$2(a, b); } var c; c = cljs.core._dispatch[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.core._dispatch._, !c)) { + if (!c && (c = cljs.core._dispatch._, !c)) { throw cljs.core.missing_protocol.call(null, "IMultiFn.-dispatch", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.core.do_dispatch = function(a, b, c, d) { c = cljs.core.apply.call(null, c, d); a = cljs.core._get_method.call(null, a, c); - if(!cljs.core.truth_(a)) { + if (!cljs.core.truth_(a)) { throw Error([cljs.core.str("No method in multimethod '"), cljs.core.str(b), cljs.core.str("' for dispatch value: "), cljs.core.str(c)].join("")); } - return cljs.core.apply.call(null, a, d) + return cljs.core.apply.call(null, a, d); }; cljs.core.MultiFn = function(a, b, c, d, e, f, g, h) { this.name = a; @@ -13454,431 +13592,435 @@ cljs.core.MultiFn = function(a, b, c, d, e, f, g, h) { this.method_cache = g; this.cached_hierarchy = h; this.cljs$lang$protocol_mask$partition0$ = 4194304; - this.cljs$lang$protocol_mask$partition1$ = 256 + this.cljs$lang$protocol_mask$partition1$ = 256; }; cljs.core.MultiFn.cljs$lang$type = !0; cljs.core.MultiFn.cljs$lang$ctorStr = "cljs.core/MultiFn"; cljs.core.MultiFn.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/MultiFn") + return cljs.core._write.call(null, b, "cljs.core/MultiFn"); }; cljs.core.MultiFn.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.getUid(this) + return goog.getUid(this); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_reset$arity$1 = function(a) { cljs.core.swap_BANG_.call(null, this.method_table, function(a) { - return cljs.core.PersistentArrayMap.EMPTY + return cljs.core.PersistentArrayMap.EMPTY; }); cljs.core.swap_BANG_.call(null, this.method_cache, function(a) { - return cljs.core.PersistentArrayMap.EMPTY + return cljs.core.PersistentArrayMap.EMPTY; }); cljs.core.swap_BANG_.call(null, this.prefer_table, function(a) { - return cljs.core.PersistentArrayMap.EMPTY + return cljs.core.PersistentArrayMap.EMPTY; }); cljs.core.swap_BANG_.call(null, this.cached_hierarchy, function(a) { - return null + return null; }); - return this + return this; }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_add_method$arity$3 = function(a, b, c) { cljs.core.swap_BANG_.call(null, this.method_table, cljs.core.assoc, b, c); cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - return this + return this; }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_remove_method$arity$2 = function(a, b) { cljs.core.swap_BANG_.call(null, this.method_table, cljs.core.dissoc, b); cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); - return this + return this; }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_get_method$arity$2 = function(a, b) { cljs.core._EQ_.call(null, cljs.core.deref.call(null, this.cached_hierarchy), cljs.core.deref.call(null, this.hierarchy)) || cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); var c = cljs.core.deref.call(null, this.method_cache).call(null, b); - if(cljs.core.truth_(c)) { - return c + if (cljs.core.truth_(c)) { + return c; } c = cljs.core.find_and_cache_best_method.call(null, this.name, b, this.hierarchy, this.method_table, this.prefer_table, this.method_cache, this.cached_hierarchy); - return cljs.core.truth_(c) ? c : cljs.core.deref.call(null, this.method_table).call(null, this.default_dispatch_val) + return cljs.core.truth_(c) ? c : cljs.core.deref.call(null, this.method_table).call(null, this.default_dispatch_val); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_prefer_method$arity$3 = function(a, b, c) { - if(cljs.core.truth_(cljs.core.prefers_STAR_.call(null, b, c, this.prefer_table))) { + if (cljs.core.truth_(cljs.core.prefers_STAR_.call(null, b, c, this.prefer_table))) { throw Error([cljs.core.str("Preference conflict in multimethod '"), cljs.core.str(this.name), cljs.core.str("': "), cljs.core.str(c), cljs.core.str(" is already preferred to "), cljs.core.str(b)].join("")); } cljs.core.swap_BANG_.call(null, this.prefer_table, function(a) { - return cljs.core.assoc.call(null, a, b, cljs.core.conj.call(null, cljs.core.get.call(null, a, b, cljs.core.PersistentHashSet.EMPTY), c)) + return cljs.core.assoc.call(null, a, b, cljs.core.conj.call(null, cljs.core.get.call(null, a, b, cljs.core.PersistentHashSet.EMPTY), c)); }); - return cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy) + return cljs.core.reset_cache.call(null, this.method_cache, this.method_table, this.cached_hierarchy, this.hierarchy); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_methods$arity$1 = function(a) { - return cljs.core.deref.call(null, this.method_table) + return cljs.core.deref.call(null, this.method_table); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_prefers$arity$1 = function(a) { - return cljs.core.deref.call(null, this.prefer_table) + return cljs.core.deref.call(null, this.prefer_table); }; cljs.core.MultiFn.prototype.cljs$core$IMultiFn$_dispatch$arity$2 = function(a, b) { - return cljs.core.do_dispatch.call(null, this, this.name, this.dispatch_fn, b) + return cljs.core.do_dispatch.call(null, this, this.name, this.dispatch_fn, b); }; cljs.core.__GT_MultiFn = function(a, b, c, d, e, f, g, h) { - return new cljs.core.MultiFn(a, b, c, d, e, f, g, h) + return new cljs.core.MultiFn(a, b, c, d, e, f, g, h); }; cljs.core.MultiFn.prototype.call = function() { var a = function(a, b) { - return cljs.core._dispatch.call(null, this, b) + return cljs.core._dispatch.call(null, this, b); }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.core.MultiFn.prototype.apply = function(a, b) { - return cljs.core._dispatch.call(null, this, b) + return cljs.core._dispatch.call(null, this, b); }; cljs.core.remove_all_methods = function(a) { - return cljs.core._reset.call(null, a) + return cljs.core._reset.call(null, a); }; cljs.core.remove_method = function(a, b) { - return cljs.core._remove_method.call(null, a, b) + return cljs.core._remove_method.call(null, a, b); }; cljs.core.prefer_method = function(a, b, c) { - return cljs.core._prefer_method.call(null, a, b, c) + return cljs.core._prefer_method.call(null, a, b, c); }; cljs.core.methods$ = function(a) { - return cljs.core._methods.call(null, a) + return cljs.core._methods.call(null, a); }; cljs.core.get_method = function(a, b) { - return cljs.core._get_method.call(null, a, b) + return cljs.core._get_method.call(null, a, b); }; cljs.core.prefers = function(a) { - return cljs.core._prefers.call(null, a) + return cljs.core._prefers.call(null, a); }; cljs.core.UUID = function(a) { this.uuid = a; this.cljs$lang$protocol_mask$partition1$ = 0; - this.cljs$lang$protocol_mask$partition0$ = 2153775104 + this.cljs$lang$protocol_mask$partition0$ = 2153775104; }; cljs.core.UUID.cljs$lang$type = !0; cljs.core.UUID.cljs$lang$ctorStr = "cljs.core/UUID"; cljs.core.UUID.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/UUID") + return cljs.core._write.call(null, b, "cljs.core/UUID"); }; cljs.core.UUID.prototype.cljs$core$IHash$_hash$arity$1 = function(a) { - return goog.string.hashCode(cljs.core.pr_str.call(null, this)) + return goog.string.hashCode(cljs.core.pr_str.call(null, this)); }; cljs.core.UUID.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = function(a, b, c) { - return cljs.core._write.call(null, b, [cljs.core.str('#uuid "'), cljs.core.str(this.uuid), cljs.core.str('"')].join("")) + return cljs.core._write.call(null, b, [cljs.core.str('#uuid "'), cljs.core.str(this.uuid), cljs.core.str('"')].join("")); }; cljs.core.UUID.prototype.cljs$core$IEquiv$_equiv$arity$2 = function(a, b) { - return b instanceof cljs.core.UUID && this.uuid === b.uuid + return b instanceof cljs.core.UUID && this.uuid === b.uuid; +}; +cljs.core.UUID.prototype.cljs$core$ICloneable$ = !0; +cljs.core.UUID.prototype.cljs$core$ICloneable$_clone$arity$1 = function(a) { + return new cljs.core.UUID(this.uuid); }; cljs.core.__GT_UUID = function(a) { - return new cljs.core.UUID(a) + return new cljs.core.UUID(a); }; cljs.core.ExceptionInfo = function(a, b, c) { this.message = a; this.data = b; - this.cause = c + this.cause = c; }; cljs.core.ExceptionInfo.cljs$lang$type = !0; cljs.core.ExceptionInfo.cljs$lang$ctorStr = "cljs.core/ExceptionInfo"; cljs.core.ExceptionInfo.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.core/ExceptionInfo") + return cljs.core._write.call(null, b, "cljs.core/ExceptionInfo"); }; cljs.core.__GT_ExceptionInfo = function(a, b, c) { - return new cljs.core.ExceptionInfo(a, b, c) + return new cljs.core.ExceptionInfo(a, b, c); }; cljs.core.ExceptionInfo.prototype = Error(); cljs.core.ExceptionInfo.prototype.constructor = cljs.core.ExceptionInfo; cljs.core.ex_info = function() { var a = null, b = function(a, b) { - return new cljs.core.ExceptionInfo(a, b, null) + return new cljs.core.ExceptionInfo(a, b, null); }, c = function(a, b, c) { - return new cljs.core.ExceptionInfo(a, b, c) + return new cljs.core.ExceptionInfo(a, b, c); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); cljs.core.ex_data = function(a) { - return a instanceof cljs.core.ExceptionInfo ? a.data : null + return a instanceof cljs.core.ExceptionInfo ? a.data : null; }; cljs.core.ex_message = function(a) { - return a instanceof Error ? a.message : null + return a instanceof Error ? a.message : null; }; cljs.core.ex_cause = function(a) { - return a instanceof cljs.core.ExceptionInfo ? a.cause : null + return a instanceof cljs.core.ExceptionInfo ? a.cause : null; }; cljs.core.comparator = function(a) { return function(b, c) { - return cljs.core.truth_(a.call(null, b, c)) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null - } + return cljs.core.truth_(a.call(null, b, c)) ? -1 : cljs.core.truth_(a.call(null, c, b)) ? 1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? 0 : null; + }; }; cljs.core.special_symbol_QMARK_ = function(a) { return cljs.core.contains_QMARK_.call(null, new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 19, [new cljs.core.Symbol(null, "deftype*", "deftype*", -978581244, null), null, new cljs.core.Symbol(null, "new", "new", -1640422567, null), null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null), null, new cljs.core.Symbol(null, "\x26", "\x26", -1640531489, null), null, new cljs.core.Symbol(null, "set!", "set!", -1637004872, null), null, new cljs.core.Symbol(null, "recur", "recur", -1532142362, null), null, new cljs.core.Symbol(null, ".", ".", -1640531481, null), null, new cljs.core.Symbol(null, "ns", "ns", -1640528002, null), null, new cljs.core.Symbol(null, "do", "do", -1640528316, null), null, new cljs.core.Symbol(null, "fn*", "fn*", -1640430053, null), null, new cljs.core.Symbol(null, "throw", "throw", -1530191713, null), null, new cljs.core.Symbol(null, "letfn*", "letfn*", 1548249632, null), null, new cljs.core.Symbol(null, "js*", "js*", -1640426054, - null), null, new cljs.core.Symbol(null, "defrecord*", "defrecord*", 774272013, null), null, new cljs.core.Symbol(null, "let*", "let*", -1637213400, null), null, new cljs.core.Symbol(null, "loop*", "loop*", -1537374273, null), null, new cljs.core.Symbol(null, "try", "try", -1640416396, null), null, new cljs.core.Symbol(null, "if", "if", -1640528170, null), null, new cljs.core.Symbol(null, "def", "def", -1640432194, null), null], null), null), a) + null), null, new cljs.core.Symbol(null, "defrecord*", "defrecord*", 774272013, null), null, new cljs.core.Symbol(null, "let*", "let*", -1637213400, null), null, new cljs.core.Symbol(null, "loop*", "loop*", -1537374273, null), null, new cljs.core.Symbol(null, "try", "try", -1640416396, null), null, new cljs.core.Symbol(null, "if", "if", -1640528170, null), null, new cljs.core.Symbol(null, "def", "def", -1640432194, null), null], null), null), a); }; var clojure = {walk:{}}; clojure.walk.walk = function(a, b, c) { - return cljs.core.seq_QMARK_.call(null, c) ? b.call(null, cljs.core.doall.call(null, cljs.core.map.call(null, a, c))) : cljs.core.coll_QMARK_.call(null, c) ? b.call(null, cljs.core.into.call(null, cljs.core.empty.call(null, c), cljs.core.map.call(null, a, c))) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b.call(null, c) : null + return cljs.core.seq_QMARK_.call(null, c) ? b.call(null, cljs.core.doall.call(null, cljs.core.map.call(null, a, c))) : cljs.core.coll_QMARK_.call(null, c) ? b.call(null, cljs.core.into.call(null, cljs.core.empty.call(null, c), cljs.core.map.call(null, a, c))) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b.call(null, c) : null; }; clojure.walk.postwalk = function postwalk(b, c) { - return clojure.walk.walk.call(null, cljs.core.partial.call(null, postwalk, b), b, c) + return clojure.walk.walk.call(null, cljs.core.partial.call(null, postwalk, b), b, c); }; clojure.walk.prewalk = function prewalk(b, c) { - return clojure.walk.walk.call(null, cljs.core.partial.call(null, prewalk, b), cljs.core.identity, b.call(null, c)) + return clojure.walk.walk.call(null, cljs.core.partial.call(null, prewalk, b), cljs.core.identity, b.call(null, c)); }; clojure.walk.keywordize_keys = function(a) { var b = function(a) { var b = cljs.core.nth.call(null, a, 0, null); a = cljs.core.nth.call(null, a, 1, null); - return"string" === typeof b ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null) + return "string" === typeof b ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.keyword.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null); }; return clojure.walk.postwalk.call(null, function(a) { - return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a - }, a) + return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a; + }, a); }; clojure.walk.stringify_keys = function(a) { var b = function(a) { var b = cljs.core.nth.call(null, a, 0, null); a = cljs.core.nth.call(null, a, 1, null); - return b instanceof cljs.core.Keyword ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null) + return b instanceof cljs.core.Keyword ? new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.name.call(null, b), a], null) : new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [b, a], null); }; return clojure.walk.postwalk.call(null, function(a) { - return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a - }, a) + return cljs.core.map_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentArrayMap.EMPTY, cljs.core.map.call(null, b, a)) : a; + }, a); }; clojure.walk.prewalk_replace = function(a, b) { return clojure.walk.prewalk.call(null, function(b) { - return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b - }, b) + return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b; + }, b); }; clojure.walk.postwalk_replace = function(a, b) { return clojure.walk.postwalk.call(null, function(b) { - return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b - }, b) + return cljs.core.contains_QMARK_.call(null, a, b) ? a.call(null, b) : b; + }, b); }; clojure.string = {}; clojure.string.seq_reverse = function(a) { - return cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a) + return cljs.core.reduce.call(null, cljs.core.conj, cljs.core.List.EMPTY, a); }; clojure.string.reverse = function(a) { - return a.split("").reverse().join("") + return a.split("").reverse().join(""); }; clojure.string.replace = function(a, b, c) { - if("string" === typeof b) { - return a.replace(RegExp(goog.string.regExpEscape(b), "g"), c) + if ("string" === typeof b) { + return a.replace(RegExp(goog.string.regExpEscape(b), "g"), c); } - if(cljs.core.truth_(b.hasOwnProperty("source"))) { - return a.replace(RegExp(b.source, "g"), c) + if (cljs.core.truth_(b.hasOwnProperty("source"))) { + return a.replace(RegExp(b.source, "g"), c); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { throw[cljs.core.str("Invalid match arg: "), cljs.core.str(b)].join(""); } - return null + return null; }; clojure.string.replace_first = function(a, b, c) { - return a.replace(b, c) + return a.replace(b, c); }; clojure.string.join = function() { var a = null, b = function(a) { - return cljs.core.apply.call(null, cljs.core.str, a) + return cljs.core.apply.call(null, cljs.core.str, a); }, c = function(a, b) { - return cljs.core.apply.call(null, cljs.core.str, cljs.core.interpose.call(null, a, b)) + return cljs.core.apply.call(null, cljs.core.str, cljs.core.interpose.call(null, a, b)); }, a = function(a, e) { switch(arguments.length) { case 1: return b.call(this, a); case 2: - return c.call(this, a, e) + return c.call(this, a, e); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$1 = b; a.cljs$core$IFn$_invoke$arity$2 = c; - return a + return a; }(); clojure.string.upper_case = function(a) { - return a.toUpperCase() + return a.toUpperCase(); }; clojure.string.lower_case = function(a) { - return a.toLowerCase() + return a.toLowerCase(); }; clojure.string.capitalize = function(a) { - return 2 > cljs.core.count.call(null, a) ? clojure.string.upper_case.call(null, a) : [cljs.core.str(clojure.string.upper_case.call(null, cljs.core.subs.call(null, a, 0, 1))), cljs.core.str(clojure.string.lower_case.call(null, cljs.core.subs.call(null, a, 1)))].join("") + return 2 > cljs.core.count.call(null, a) ? clojure.string.upper_case.call(null, a) : [cljs.core.str(clojure.string.upper_case.call(null, cljs.core.subs.call(null, a, 0, 1))), cljs.core.str(clojure.string.lower_case.call(null, cljs.core.subs.call(null, a, 1)))].join(""); }; clojure.string.pop_last_while_empty = function(a) { - for(;;) { - if(cljs.core._EQ_.call(null, "", cljs.core.peek.call(null, a))) { - a = cljs.core.pop.call(null, a) - }else { - return a + for (;;) { + if (cljs.core._EQ_.call(null, "", cljs.core.peek.call(null, a))) { + a = cljs.core.pop.call(null, a); + } else { + return a; } } }; clojure.string.discard_trailing_if_needed = function(a, b) { - return cljs.core._EQ_.call(null, 0, a) ? clojure.string.pop_last_while_empty.call(null, b) : b + return cljs.core._EQ_.call(null, 0, a) ? clojure.string.pop_last_while_empty.call(null, b) : b; }; clojure.string.split_with_empty_regex = function(a, b) { - if(0 >= b || b >= 2 + cljs.core.count.call(null, a)) { - return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a)))), "") + if (0 >= b || b >= 2 + cljs.core.count.call(null, a)) { + return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a)))), ""); } var c = cljs.core._EQ_; - if(cljs.core.truth_(c.call(null, 1, b))) { - return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a], null) + if (cljs.core.truth_(c.call(null, 1, b))) { + return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [a], null); } - if(cljs.core.truth_(c.call(null, 2, b))) { - return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["", a], null) + if (cljs.core.truth_(c.call(null, 2, b))) { + return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["", a], null); } c = b - 2; - return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.subvec.call(null, cljs.core.vec.call(null, cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a))), 0, c))), cljs.core.subs.call(null, a, c)) + return cljs.core.conj.call(null, cljs.core.vec.call(null, cljs.core.cons.call(null, "", cljs.core.subvec.call(null, cljs.core.vec.call(null, cljs.core.map.call(null, cljs.core.str, cljs.core.seq.call(null, a))), 0, c))), cljs.core.subs.call(null, a, c)); }; clojure.string.split = function() { var a = null, b = function(b, c) { - return a.call(null, b, c, 0) + return a.call(null, b, c, 0); }, c = function(a, b, c) { return clojure.string.discard_trailing_if_needed.call(null, c, cljs.core._EQ_.call(null, "" + cljs.core.str(b), "/(?:)/") ? clojure.string.split_with_empty_regex.call(null, a, c) : 1 > c ? cljs.core.vec.call(null, ("" + cljs.core.str(a)).split(b)) : function() { - for(var g = a, h = c, k = cljs.core.PersistentVector.EMPTY;;) { - if(cljs.core._EQ_.call(null, h, 1)) { - return cljs.core.conj.call(null, k, g) + for (var g = a, h = c, k = cljs.core.PersistentVector.EMPTY;;) { + if (cljs.core._EQ_.call(null, h, 1)) { + return cljs.core.conj.call(null, k, g); } var l = cljs.core.re_find.call(null, b, g); - if(cljs.core.truth_(l)) { + if (cljs.core.truth_(l)) { var m = l, l = g.indexOf(m), m = g.substring(l + cljs.core.count.call(null, m)), h = h - 1, k = cljs.core.conj.call(null, k, g.substring(0, l)), g = m - }else { - return cljs.core.conj.call(null, k, g) + } else { + return cljs.core.conj.call(null, k, g); } } - }()) + }()); }, a = function(a, e, f) { switch(arguments.length) { case 2: return b.call(this, a, e); case 3: - return c.call(this, a, e, f) + return c.call(this, a, e, f); } throw Error("Invalid arity: " + arguments.length); }; a.cljs$core$IFn$_invoke$arity$2 = b; a.cljs$core$IFn$_invoke$arity$3 = c; - return a + return a; }(); clojure.string.split_lines = function(a) { - return clojure.string.split.call(null, a, /\n|\r\n/) + return clojure.string.split.call(null, a, /\n|\r\n/); }; clojure.string.trim = function(a) { - return goog.string.trim(a) + return goog.string.trim(a); }; clojure.string.triml = function(a) { - return goog.string.trimLeft(a) + return goog.string.trimLeft(a); }; clojure.string.trimr = function(a) { - return goog.string.trimRight(a) + return goog.string.trimRight(a); }; clojure.string.trim_newline = function(a) { - for(var b = a.length;;) { - if(0 === b) { - return"" + for (var b = a.length;;) { + if (0 === b) { + return ""; } var c = cljs.core.get.call(null, a, b - 1); - if(cljs.core._EQ_.call(null, c, "\n") || cljs.core._EQ_.call(null, c, "\r")) { - b -= 1 - }else { - return a.substring(0, b) + if (cljs.core._EQ_.call(null, c, "\n") || cljs.core._EQ_.call(null, c, "\r")) { + b -= 1; + } else { + return a.substring(0, b); } } }; clojure.string.blank_QMARK_ = function(a) { - return goog.string.isEmptySafe(a) + return goog.string.isEmptySafe(a); }; clojure.string.escape = function(a, b) { - for(var c = new goog.string.StringBuffer, d = a.length, e = 0;;) { - if(cljs.core._EQ_.call(null, d, e)) { - return c.toString() + for (var c = new goog.string.StringBuffer, d = a.length, e = 0;;) { + if (cljs.core._EQ_.call(null, d, e)) { + return c.toString(); } var f = a.charAt(e), g = cljs.core.get.call(null, b, f); cljs.core.truth_(g) ? c.append("" + cljs.core.str(g)) : c.append(f); - e += 1 + e += 1; } }; cljs.reader = {}; cljs.reader.PushbackReader = function() { - return{} + return{}; }(); cljs.reader.read_char = function(a) { - if(a ? a.cljs$reader$PushbackReader$read_char$arity$1 : a) { - return a.cljs$reader$PushbackReader$read_char$arity$1(a) + if (a ? a.cljs$reader$PushbackReader$read_char$arity$1 : a) { + return a.cljs$reader$PushbackReader$read_char$arity$1(a); } var b; b = cljs.reader.read_char[goog.typeOf(null == a ? null : a)]; - if(!b && (b = cljs.reader.read_char._, !b)) { + if (!b && (b = cljs.reader.read_char._, !b)) { throw cljs.core.missing_protocol.call(null, "PushbackReader.read-char", a); } - return b.call(null, a) + return b.call(null, a); }; cljs.reader.unread = function(a, b) { - if(a ? a.cljs$reader$PushbackReader$unread$arity$2 : a) { - return a.cljs$reader$PushbackReader$unread$arity$2(a, b) + if (a ? a.cljs$reader$PushbackReader$unread$arity$2 : a) { + return a.cljs$reader$PushbackReader$unread$arity$2(a, b); } var c; c = cljs.reader.unread[goog.typeOf(null == a ? null : a)]; - if(!c && (c = cljs.reader.unread._, !c)) { + if (!c && (c = cljs.reader.unread._, !c)) { throw cljs.core.missing_protocol.call(null, "PushbackReader.unread", a); } - return c.call(null, a, b) + return c.call(null, a, b); }; cljs.reader.StringPushbackReader = function(a, b, c) { this.s = a; this.buffer = b; - this.idx = c + this.idx = c; }; cljs.reader.StringPushbackReader.cljs$lang$type = !0; cljs.reader.StringPushbackReader.cljs$lang$ctorStr = "cljs.reader/StringPushbackReader"; cljs.reader.StringPushbackReader.cljs$lang$ctorPrWriter = function(a, b, c) { - return cljs.core._write.call(null, b, "cljs.reader/StringPushbackReader") + return cljs.core._write.call(null, b, "cljs.reader/StringPushbackReader"); }; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$ = !0; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$read_char$arity$1 = function(a) { - return 0 === this.buffer.length ? (this.idx += 1, this.s[this.idx]) : this.buffer.pop() + return 0 === this.buffer.length ? (this.idx += 1, this.s[this.idx]) : this.buffer.pop(); }; cljs.reader.StringPushbackReader.prototype.cljs$reader$PushbackReader$unread$arity$2 = function(a, b) { - return this.buffer.push(b) + return this.buffer.push(b); }; cljs.reader.__GT_StringPushbackReader = function(a, b, c) { - return new cljs.reader.StringPushbackReader(a, b, c) + return new cljs.reader.StringPushbackReader(a, b, c); }; cljs.reader.push_back_reader = function(a) { - return new cljs.reader.StringPushbackReader(a, [], -1) + return new cljs.reader.StringPushbackReader(a, [], -1); }; cljs.reader.whitespace_QMARK_ = function(a) { var b = goog.string.isBreakingWhitespace(a); - return cljs.core.truth_(b) ? b : "," === a + return cljs.core.truth_(b) ? b : "," === a; }; cljs.reader.numeric_QMARK_ = function(a) { - return goog.string.isNumeric(a) + return goog.string.isNumeric(a); }; cljs.reader.comment_prefix_QMARK_ = function(a) { - return";" === a + return ";" === a; }; cljs.reader.number_literal_QMARK_ = function(a, b) { return cljs.reader.numeric_QMARK_.call(null, b) || ("+" === b || "-" === b) && cljs.reader.numeric_QMARK_.call(null, function() { var b = cljs.reader.read_char.call(null, a); cljs.reader.unread.call(null, a, b); - return b - }()) + return b; + }()); }; cljs.reader.reader_error = function() { var a = function(a, b) { @@ -13886,35 +14028,35 @@ cljs.reader.reader_error = function() { }, b = function(b, d) { var e = null; 1 < arguments.length && (e = cljs.core.array_seq(Array.prototype.slice.call(arguments, 1), 0)); - return a.call(this, b, e) + return a.call(this, b, e); }; b.cljs$lang$maxFixedArity = 1; b.cljs$lang$applyTo = function(b) { var d = cljs.core.first(b); b = cljs.core.rest(b); - return a(d, b) + return a(d, b); }; b.cljs$core$IFn$_invoke$arity$variadic = a; - return b + return b; }(); cljs.reader.macro_terminating_QMARK_ = function(a) { var b = "#" !== a; - return b && (b = "'" !== a) ? (b = ":" !== a) ? cljs.reader.macros.call(null, a) : b : b + return b && (b = "'" !== a) ? (b = ":" !== a) ? cljs.reader.macros.call(null, a) : b : b; }; cljs.reader.read_token = function(a, b) { - for(var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { - if(null == d || cljs.reader.whitespace_QMARK_.call(null, d) || cljs.reader.macro_terminating_QMARK_.call(null, d)) { - return cljs.reader.unread.call(null, a, d), c.toString() + for (var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { + if (null == d || cljs.reader.whitespace_QMARK_.call(null, d) || cljs.reader.macro_terminating_QMARK_.call(null, d)) { + return cljs.reader.unread.call(null, a, d), c.toString(); } c.append(d); - d = cljs.reader.read_char.call(null, a) + d = cljs.reader.read_char.call(null, a); } }; cljs.reader.skip_line = function(a, b) { - for(;;) { + for (;;) { var c = cljs.reader.read_char.call(null, a); - if("\n" === c || "\r" === c || null == c) { - return a + if ("\n" === c || "\r" === c || null == c) { + return a; } } }; @@ -13924,284 +14066,284 @@ cljs.reader.float_pattern = cljs.core.re_pattern.call(null, "([-+]?[0-9]+(\\.[0- cljs.reader.symbol_pattern = cljs.core.re_pattern.call(null, "[:]?([^0-9/].*/)?([^0-9/][^/]*)"); cljs.reader.re_find_STAR_ = function(a, b) { var c = a.exec(b); - return null == c ? null : 1 === c.length ? c[0] : c + return null == c ? null : 1 === c.length ? c[0] : c; }; cljs.reader.match_int = function(a) { var b = cljs.reader.re_find_STAR_.call(null, cljs.reader.int_pattern, a); a = b[2]; - if(null == a || 1 > a.length) { + if (null == a || 1 > a.length) { a = "-" === b[1] ? -1 : 1; var c = cljs.core.truth_(b[3]) ? [b[3], 10] : cljs.core.truth_(b[4]) ? [b[4], 16] : cljs.core.truth_(b[5]) ? [b[5], 8] : cljs.core.truth_(b[7]) ? [b[7], parseInt(b[7])] : new cljs.core.Keyword(null, "default", "default", 2558708147) ? [null, null] : null, b = c[0], c = c[1]; - return null == b ? null : a * parseInt(b, c) + return null == b ? null : a * parseInt(b, c); } - return 0 + return 0; }; cljs.reader.match_ratio = function(a) { a = cljs.reader.re_find_STAR_.call(null, cljs.reader.ratio_pattern, a); var b = a[2]; - return parseInt(a[1]) / parseInt(b) + return parseInt(a[1]) / parseInt(b); }; cljs.reader.match_float = function(a) { - return parseFloat(a) + return parseFloat(a); }; cljs.reader.re_matches_STAR_ = function(a, b) { var c = a.exec(b); - return null != c && c[0] === b ? 1 === c.length ? c[0] : c : null + return null != c && c[0] === b ? 1 === c.length ? c[0] : c : null; }; cljs.reader.match_number = function(a) { - return cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a)) ? cljs.reader.match_int.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a)) ? cljs.reader.match_ratio.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.float_pattern, a)) ? cljs.reader.match_float.call(null, a) : null + return cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.int_pattern, a)) ? cljs.reader.match_int.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.ratio_pattern, a)) ? cljs.reader.match_ratio.call(null, a) : cljs.core.truth_(cljs.reader.re_matches_STAR_.call(null, cljs.reader.float_pattern, a)) ? cljs.reader.match_float.call(null, a) : null; }; cljs.reader.escape_char_map = function(a) { - if("t" === a) { - return"\t" + if ("t" === a) { + return "\t"; } - if("r" === a) { - return"\r" + if ("r" === a) { + return "\r"; } - if("n" === a) { - return"\n" + if ("n" === a) { + return "\n"; } - if("\\" === a) { - return"\\" + if ("\\" === a) { + return "\\"; } - if('"' === a) { - return'"' + if ('"' === a) { + return'"'; } - if("b" === a) { - return"\b" + if ("b" === a) { + return "\b"; } - if("f" === a) { - return"\f" + if ("f" === a) { + return "\f"; } new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null; }; cljs.reader.read_2_chars = function(a) { - return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString() + return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString(); }; cljs.reader.read_4_chars = function(a) { - return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString() + return(new goog.string.StringBuffer(cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a), cljs.reader.read_char.call(null, a))).toString(); }; cljs.reader.unicode_2_pattern = cljs.core.re_pattern.call(null, "[0-9A-Fa-f]{2}"); cljs.reader.unicode_4_pattern = cljs.core.re_pattern.call(null, "[0-9A-Fa-f]{4}"); cljs.reader.validate_unicode_escape = function(a, b, c, d) { - return cljs.core.truth_(cljs.core.re_matches.call(null, a, d)) ? d : cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c, d) + return cljs.core.truth_(cljs.core.re_matches.call(null, a, d)) ? d : cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c, d); }; cljs.reader.make_unicode_char = function(a) { a = parseInt(a, 16); - return String.fromCharCode(a) + return String.fromCharCode(a); }; cljs.reader.escape_char = function(a, b) { var c = cljs.reader.read_char.call(null, b), d = cljs.reader.escape_char_map.call(null, c); return cljs.core.truth_(d) ? d : "x" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_2_pattern, b, c, cljs.reader.read_2_chars.call(null, b))) : "u" === c ? cljs.reader.make_unicode_char.call(null, cljs.reader.validate_unicode_escape.call(null, cljs.reader.unicode_4_pattern, b, c, cljs.reader.read_4_chars.call(null, b))) : cljs.reader.numeric_QMARK_.call(null, c) ? String.fromCharCode(c) : new cljs.core.Keyword(null, "else", "else", - 1017020587) ? cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c) : null + 1017020587) ? cljs.reader.reader_error.call(null, b, "Unexpected unicode escape \\", c) : null; }; cljs.reader.read_past = function(a, b) { - for(var c = cljs.reader.read_char.call(null, b);;) { - if(cljs.core.truth_(a.call(null, c))) { - c = cljs.reader.read_char.call(null, b) - }else { - return c + for (var c = cljs.reader.read_char.call(null, b);;) { + if (cljs.core.truth_(a.call(null, c))) { + c = cljs.reader.read_char.call(null, b); + } else { + return c; } } }; cljs.reader.read_delimited_list = function(a, b, c) { - for(var d = cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY);;) { + for (var d = cljs.core.transient$.call(null, cljs.core.PersistentVector.EMPTY);;) { var e = cljs.reader.read_past.call(null, cljs.reader.whitespace_QMARK_, b); cljs.core.truth_(e) || cljs.reader.reader_error.call(null, b, "EOF while reading"); - if(a === e) { - return cljs.core.persistent_BANG_.call(null, d) + if (a === e) { + return cljs.core.persistent_BANG_.call(null, d); } var f = cljs.reader.macros.call(null, e); cljs.core.truth_(f) ? e = f.call(null, b, e) : (cljs.reader.unread.call(null, b, e), e = cljs.reader.read.call(null, b, !0, null, c)); - d = e === b ? d : cljs.core.conj_BANG_.call(null, d, e) + d = e === b ? d : cljs.core.conj_BANG_.call(null, d, e); } }; cljs.reader.not_implemented = function(a, b) { - return cljs.reader.reader_error.call(null, a, "Reader for ", b, " not implemented yet") + return cljs.reader.reader_error.call(null, a, "Reader for ", b, " not implemented yet"); }; cljs.reader.read_dispatch = function(a, b) { var c = cljs.reader.read_char.call(null, a), d = cljs.reader.dispatch_macros.call(null, c); - if(cljs.core.truth_(d)) { - return d.call(null, a, b) + if (cljs.core.truth_(d)) { + return d.call(null, a, b); } d = cljs.reader.maybe_read_tagged_type.call(null, a, c); - return cljs.core.truth_(d) ? d : cljs.reader.reader_error.call(null, a, "No dispatch macro for ", c) + return cljs.core.truth_(d) ? d : cljs.reader.reader_error.call(null, a, "No dispatch macro for ", c); }; cljs.reader.read_unmatched_delimiter = function(a, b) { - return cljs.reader.reader_error.call(null, a, "Unmached delimiter ", b) + return cljs.reader.reader_error.call(null, a, "Unmached delimiter ", b); }; cljs.reader.read_list = function(a, b) { - return cljs.core.apply.call(null, cljs.core.list, cljs.reader.read_delimited_list.call(null, ")", a, !0)) + return cljs.core.apply.call(null, cljs.core.list, cljs.reader.read_delimited_list.call(null, ")", a, !0)); }; cljs.reader.read_comment = cljs.reader.skip_line; cljs.reader.read_vector = function(a, b) { - return cljs.reader.read_delimited_list.call(null, "]", a, !0) + return cljs.reader.read_delimited_list.call(null, "]", a, !0); }; cljs.reader.read_map = function(a, b) { var c = cljs.reader.read_delimited_list.call(null, "}", a, !0); cljs.core.odd_QMARK_.call(null, cljs.core.count.call(null, c)) && cljs.reader.reader_error.call(null, a, "Map literal must contain an even number of forms"); - return cljs.core.apply.call(null, cljs.core.hash_map, c) + return cljs.core.apply.call(null, cljs.core.hash_map, c); }; cljs.reader.read_number = function(a, b) { - for(var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { - if(cljs.core.truth_(function() { + for (var c = new goog.string.StringBuffer(b), d = cljs.reader.read_char.call(null, a);;) { + if (cljs.core.truth_(function() { var a = null == d; - return a ? a : (a = cljs.reader.whitespace_QMARK_.call(null, d)) ? a : cljs.reader.macros.call(null, d) + return a ? a : (a = cljs.reader.whitespace_QMARK_.call(null, d)) ? a : cljs.reader.macros.call(null, d); }())) { cljs.reader.unread.call(null, a, d); var e = c.toString(), c = cljs.reader.match_number.call(null, e); - return cljs.core.truth_(c) ? c : cljs.reader.reader_error.call(null, a, "Invalid number format [", e, "]") + return cljs.core.truth_(c) ? c : cljs.reader.reader_error.call(null, a, "Invalid number format [", e, "]"); } c.append(d); - d = e = cljs.reader.read_char.call(null, a) + d = e = cljs.reader.read_char.call(null, a); } }; cljs.reader.read_string_STAR_ = function(a, b) { - for(var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { - if(null == d) { - return cljs.reader.reader_error.call(null, a, "EOF while reading") + for (var c = new goog.string.StringBuffer, d = cljs.reader.read_char.call(null, a);;) { + if (null == d) { + return cljs.reader.reader_error.call(null, a, "EOF while reading"); } - if("\\" === d) { - c.append(cljs.reader.escape_char.call(null, c, a)), d = cljs.reader.read_char.call(null, a) - }else { - if('"' === d) { - return c.toString() + if ("\\" === d) { + c.append(cljs.reader.escape_char.call(null, c, a)), d = cljs.reader.read_char.call(null, a); + } else { + if ('"' === d) { + return c.toString(); } - if(new cljs.core.Keyword(null, "default", "default", 2558708147)) { - c.append(d), d = cljs.reader.read_char.call(null, a) - }else { - return null + if (new cljs.core.Keyword(null, "default", "default", 2558708147)) { + c.append(d), d = cljs.reader.read_char.call(null, a); + } else { + return null; } } } }; cljs.reader.special_symbols = function(a, b) { - return"nil" === a ? null : "true" === a ? !0 : "false" === a ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null + return "nil" === a ? null : "true" === a ? !0 : "false" === a ? !1 : new cljs.core.Keyword(null, "else", "else", 1017020587) ? b : null; }; cljs.reader.read_symbol = function(a, b) { var c = cljs.reader.read_token.call(null, a, b); - return cljs.core.truth_(goog.string.contains(c, "/")) ? cljs.core.symbol.call(null, cljs.core.subs.call(null, c, 0, c.indexOf("/")), cljs.core.subs.call(null, c, c.indexOf("/") + 1, c.length)) : cljs.reader.special_symbols.call(null, c, cljs.core.symbol.call(null, c)) + return cljs.core.truth_(goog.string.contains(c, "/")) ? cljs.core.symbol.call(null, cljs.core.subs.call(null, c, 0, c.indexOf("/")), cljs.core.subs.call(null, c, c.indexOf("/") + 1, c.length)) : cljs.reader.special_symbols.call(null, c, cljs.core.symbol.call(null, c)); }; cljs.reader.read_keyword = function(a, b) { var c = cljs.reader.read_token.call(null, a, cljs.reader.read_char.call(null, a)), d = cljs.reader.re_matches_STAR_.call(null, cljs.reader.symbol_pattern, c), c = d[0], e = d[1], d = d[2]; - return void 0 !== e && ":/" === e.substring(e.length - 2, e.length) || ":" === d[d.length - 1] || -1 !== c.indexOf("::", 1) ? cljs.reader.reader_error.call(null, a, "Invalid token: ", c) : null != e && 0 < e.length ? cljs.core.keyword.call(null, e.substring(0, e.indexOf("/")), d) : cljs.core.keyword.call(null, c) + return void 0 !== e && ":/" === e.substring(e.length - 2, e.length) || ":" === d[d.length - 1] || -1 !== c.indexOf("::", 1) ? cljs.reader.reader_error.call(null, a, "Invalid token: ", c) : null != e && 0 < e.length ? cljs.core.keyword.call(null, e.substring(0, e.indexOf("/")), d) : cljs.core.keyword.call(null, c); }; cljs.reader.desugar_meta = function(a) { - return a instanceof cljs.core.Symbol ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : "string" === typeof a ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : a instanceof cljs.core.Keyword ? new cljs.core.PersistentArrayMap.fromArray([a, !0], !0, !1) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null + return a instanceof cljs.core.Symbol ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : "string" === typeof a ? new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null, "tag", "tag", 1014018828), a], null) : a instanceof cljs.core.Keyword ? new cljs.core.PersistentArrayMap.fromArray([a, !0], !0, !1) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? a : null; }; cljs.reader.wrapping_reader = function(a) { return function(b, c) { - return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.reader.read.call(null, b, !0, null, !0)), a) - } + return cljs.core._conj.call(null, cljs.core._conj.call(null, cljs.core.List.EMPTY, cljs.reader.read.call(null, b, !0, null, !0)), a); + }; }; cljs.reader.throwing_reader = function(a) { return function(b, c) { - return cljs.reader.reader_error.call(null, b, a) - } + return cljs.reader.reader_error.call(null, b, a); + }; }; cljs.reader.read_meta = function(a, b) { var c = cljs.reader.desugar_meta.call(null, cljs.reader.read.call(null, a, !0, null, !0)); cljs.core.map_QMARK_.call(null, c) || cljs.reader.reader_error.call(null, a, "Metadata must be Symbol,Keyword,String or Map"); var d = cljs.reader.read.call(null, a, !0, null, !0); - return(d ? d.cljs$lang$protocol_mask$partition0$ & 262144 || d.cljs$core$IWithMeta$ || (d.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) ? cljs.core.with_meta.call(null, d, cljs.core.merge.call(null, cljs.core.meta.call(null, d), c)) : cljs.reader.reader_error.call(null, a, "Metadata can only be applied to IWithMetas") + return(d ? d.cljs$lang$protocol_mask$partition0$ & 262144 || d.cljs$core$IWithMeta$ || (d.cljs$lang$protocol_mask$partition0$ ? 0 : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) : cljs.core.native_satisfies_QMARK_.call(null, cljs.core.IWithMeta, d)) ? cljs.core.with_meta.call(null, d, cljs.core.merge.call(null, cljs.core.meta.call(null, d), c)) : cljs.reader.reader_error.call(null, a, "Metadata can only be applied to IWithMetas"); }; cljs.reader.read_set = function(a, b) { - return cljs.core.set.call(null, cljs.reader.read_delimited_list.call(null, "}", a, !0)) + return cljs.core.set.call(null, cljs.reader.read_delimited_list.call(null, "}", a, !0)); }; cljs.reader.read_regex = function(a, b) { - return cljs.core.re_pattern.call(null, cljs.reader.read_string_STAR_.call(null, a, b)) + return cljs.core.re_pattern.call(null, cljs.reader.read_string_STAR_.call(null, a, b)); }; cljs.reader.read_discard = function(a, b) { cljs.reader.read.call(null, a, !0, null, !0); - return a + return a; }; cljs.reader.macros = function(a) { - if('"' === a) { - return cljs.reader.read_string_STAR_ + if ('"' === a) { + return cljs.reader.read_string_STAR_; } - if(":" === a) { - return cljs.reader.read_keyword + if (":" === a) { + return cljs.reader.read_keyword; } - if(";" === a) { - return cljs.reader.read_comment + if (";" === a) { + return cljs.reader.read_comment; } - if("'" === a) { - return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null)) + if ("'" === a) { + return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "quote", "quote", -1532577739, null)); } - if("@" === a) { - return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "deref", "deref", -1545057749, null)) + if ("@" === a) { + return cljs.reader.wrapping_reader.call(null, new cljs.core.Symbol(null, "deref", "deref", -1545057749, null)); } - if("^" === a) { - return cljs.reader.read_meta + if ("^" === a) { + return cljs.reader.read_meta; } - if("`" === a || "~" === a) { - return cljs.reader.not_implemented + if ("`" === a || "~" === a) { + return cljs.reader.not_implemented; } - if("(" === a) { - return cljs.reader.read_list + if ("(" === a) { + return cljs.reader.read_list; } - if(")" === a) { - return cljs.reader.read_unmatched_delimiter + if (")" === a) { + return cljs.reader.read_unmatched_delimiter; } - if("[" === a) { - return cljs.reader.read_vector + if ("[" === a) { + return cljs.reader.read_vector; } - if("]" === a) { - return cljs.reader.read_unmatched_delimiter + if ("]" === a) { + return cljs.reader.read_unmatched_delimiter; } - if("{" === a) { - return cljs.reader.read_map + if ("{" === a) { + return cljs.reader.read_map; } - if("}" === a) { - return cljs.reader.read_unmatched_delimiter + if ("}" === a) { + return cljs.reader.read_unmatched_delimiter; } - if("\\" === a) { - return cljs.reader.read_char + if ("\\" === a) { + return cljs.reader.read_char; } - if("#" === a) { - return cljs.reader.read_dispatch + if ("#" === a) { + return cljs.reader.read_dispatch; } new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null; }; cljs.reader.dispatch_macros = function(a) { - if("{" === a) { - return cljs.reader.read_set + if ("{" === a) { + return cljs.reader.read_set; } - if("\x3c" === a) { - return cljs.reader.throwing_reader.call(null, "Unreadable form") + if ("\x3c" === a) { + return cljs.reader.throwing_reader.call(null, "Unreadable form"); } - if('"' === a) { - return cljs.reader.read_regex + if ('"' === a) { + return cljs.reader.read_regex; } - if("!" === a) { - return cljs.reader.read_comment + if ("!" === a) { + return cljs.reader.read_comment; } - if("_" === a) { - return cljs.reader.read_discard + if ("_" === a) { + return cljs.reader.read_discard; } new cljs.core.Keyword(null, "else", "else", 1017020587); - return null + return null; }; cljs.reader.read = function(a, b, c, d) { - for(;;) { + for (;;) { d = cljs.reader.read_char.call(null, a); - if(null == d) { - return cljs.core.truth_(b) ? cljs.reader.reader_error.call(null, a, "EOF while reading") : c - } - if(!cljs.reader.whitespace_QMARK_.call(null, d)) { - if(cljs.reader.comment_prefix_QMARK_.call(null, d)) { - a = cljs.reader.read_comment.call(null, a, d) - }else { - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { + if (null == d) { + return cljs.core.truth_(b) ? cljs.reader.reader_error.call(null, a, "EOF while reading") : c; + } + if (!cljs.reader.whitespace_QMARK_.call(null, d)) { + if (cljs.reader.comment_prefix_QMARK_.call(null, d)) { + a = cljs.reader.read_comment.call(null, a, d); + } else { + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { var e = cljs.reader.macros.call(null, d); d = cljs.core.truth_(e) ? e.call(null, a, d) : cljs.reader.number_literal_QMARK_.call(null, a, d) ? cljs.reader.read_number.call(null, a, d) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.read_symbol.call(null, a, d) : null; - if(d !== a) { - return d + if (d !== a) { + return d; } - }else { - return null + } else { + return null; } } } @@ -14209,134 +14351,174 @@ cljs.reader.read = function(a, b, c, d) { }; cljs.reader.read_string = function(a) { a = cljs.reader.push_back_reader.call(null, a); - return cljs.reader.read.call(null, a, !0, null, !1) + return cljs.reader.read.call(null, a, !0, null, !1); }; cljs.reader.zero_fill_right_and_truncate = function(a, b) { - if(cljs.core._EQ_.call(null, b, cljs.core.count.call(null, a))) { - return a + if (cljs.core._EQ_.call(null, b, cljs.core.count.call(null, a))) { + return a; } - if(b < cljs.core.count.call(null, a)) { - return cljs.core.subs.call(null, a, 0, b) + if (b < cljs.core.count.call(null, a)) { + return cljs.core.subs.call(null, a, 0, b); } - if(new cljs.core.Keyword(null, "else", "else", 1017020587)) { - for(var c = new goog.string.StringBuffer(a);;) { - if(c.getLength() < b) { - c = c.append("0") - }else { - return c.toString() + if (new cljs.core.Keyword(null, "else", "else", 1017020587)) { + for (var c = new goog.string.StringBuffer(a);;) { + if (c.getLength() < b) { + c = c.append("0"); + } else { + return c.toString(); } } - }else { - return null + } else { + return null; } }; cljs.reader.divisible_QMARK_ = function(a, b) { - return 0 === cljs.core.mod.call(null, a, b) + return 0 === cljs.core.mod.call(null, a, b); }; cljs.reader.indivisible_QMARK_ = function(a, b) { - return!cljs.reader.divisible_QMARK_.call(null, a, b) + return!cljs.reader.divisible_QMARK_.call(null, a, b); }; cljs.reader.leap_year_QMARK_ = function(a) { - return cljs.reader.divisible_QMARK_.call(null, a, 4) && (cljs.reader.indivisible_QMARK_.call(null, a, 100) || cljs.reader.divisible_QMARK_.call(null, a, 400)) + return cljs.reader.divisible_QMARK_.call(null, a, 4) && (cljs.reader.indivisible_QMARK_.call(null, a, 100) || cljs.reader.divisible_QMARK_.call(null, a, 400)); }; cljs.reader.days_in_month = function() { var a = new cljs.core.PersistentVector(null, 13, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], null), b = new cljs.core.PersistentVector(null, 13, 5, cljs.core.PersistentVector.EMPTY_NODE, [null, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], null); return function(c, d) { - return cljs.core.get.call(null, cljs.core.truth_(d) ? b : a, c) - } + return cljs.core.get.call(null, cljs.core.truth_(d) ? b : a, c); + }; }(); cljs.reader.timestamp_regex = /(\d\d\d\d)(?:-(\d\d)(?:-(\d\d)(?:[T](\d\d)(?::(\d\d)(?::(\d\d)(?:[.](\d+))?)?)?)?)?)?(?:[Z]|([-+])(\d\d):(\d\d))?/; cljs.reader.parse_int = function(a) { a = parseInt(a); - return cljs.core.not.call(null, isNaN(a)) ? a : null + return cljs.core.not.call(null, isNaN(a)) ? a : null; }; cljs.reader.check = function(a, b, c, d) { a <= b && b <= c || cljs.reader.reader_error.call(null, null, [cljs.core.str(d), cljs.core.str(" Failed: "), cljs.core.str(a), cljs.core.str("\x3c\x3d"), cljs.core.str(b), cljs.core.str("\x3c\x3d"), cljs.core.str(c)].join("")); - return b + return b; }; cljs.reader.parse_and_validate_timestamp = function(a) { var b = cljs.core.re_matches.call(null, cljs.reader.timestamp_regex, a); cljs.core.nth.call(null, b, 0, null); var c = cljs.core.nth.call(null, b, 1, null), d = cljs.core.nth.call(null, b, 2, null), e = cljs.core.nth.call(null, b, 3, null), f = cljs.core.nth.call(null, b, 4, null), g = cljs.core.nth.call(null, b, 5, null), h = cljs.core.nth.call(null, b, 6, null), k = cljs.core.nth.call(null, b, 7, null), l = cljs.core.nth.call(null, b, 8, null), m = cljs.core.nth.call(null, b, 9, null), n = cljs.core.nth.call(null, b, 10, null); - if(cljs.core.not.call(null, b)) { - return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")) + if (cljs.core.not.call(null, b)) { + return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")); } a = cljs.reader.parse_int.call(null, c); var b = function() { var a = cljs.reader.parse_int.call(null, d); - return cljs.core.truth_(a) ? a : 1 + return cljs.core.truth_(a) ? a : 1; }(), c = function() { var a = cljs.reader.parse_int.call(null, e); - return cljs.core.truth_(a) ? a : 1 + return cljs.core.truth_(a) ? a : 1; }(), p = function() { var a = cljs.reader.parse_int.call(null, f); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), q = function() { var a = cljs.reader.parse_int.call(null, g); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), r = function() { var a = cljs.reader.parse_int.call(null, h); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), s = function() { var a = cljs.reader.parse_int.call(null, cljs.reader.zero_fill_right_and_truncate.call(null, k, 3)); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), l = cljs.core._EQ_.call(null, l, "-") ? -1 : 1, t = function() { var a = cljs.reader.parse_int.call(null, m); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), v = function() { var a = cljs.reader.parse_int.call(null, n); - return cljs.core.truth_(a) ? a : 0 + return cljs.core.truth_(a) ? a : 0; }(), l = l * (60 * t + v); return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [a, cljs.reader.check.call(null, 1, b, 12, "timestamp month field must be in range 1..12"), cljs.reader.check.call(null, 1, c, cljs.reader.days_in_month.call(null, b, cljs.reader.leap_year_QMARK_.call(null, a)), "timestamp day field must be in range 1..last day in month"), cljs.reader.check.call(null, 0, p, 23, "timestamp hour field must be in range 0..23"), cljs.reader.check.call(null, 0, q, 59, "timestamp minute field must be in range 0..59"), - cljs.reader.check.call(null, 0, r, cljs.core._EQ_.call(null, q, 59) ? 60 : 59, "timestamp second field must be in range 0..60"), cljs.reader.check.call(null, 0, s, 999, "timestamp millisecond field must be in range 0..999"), l], null) + cljs.reader.check.call(null, 0, r, cljs.core._EQ_.call(null, q, 59) ? 60 : 59, "timestamp second field must be in range 0..60"), cljs.reader.check.call(null, 0, s, 999, "timestamp millisecond field must be in range 0..999"), l], null); }; cljs.reader.parse_timestamp = function(a) { var b = cljs.reader.parse_and_validate_timestamp.call(null, a); - if(cljs.core.truth_(b)) { + if (cljs.core.truth_(b)) { a = cljs.core.nth.call(null, b, 0, null); var c = cljs.core.nth.call(null, b, 1, null), d = cljs.core.nth.call(null, b, 2, null), e = cljs.core.nth.call(null, b, 3, null), f = cljs.core.nth.call(null, b, 4, null), g = cljs.core.nth.call(null, b, 5, null), h = cljs.core.nth.call(null, b, 6, null), b = cljs.core.nth.call(null, b, 7, null); - return new Date(Date.UTC(a, c - 1, d, e, f, g, h) - 6E4 * b) + return new Date(Date.UTC(a, c - 1, d, e, f, g, h) - 6E4 * b); } - return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")) + return cljs.reader.reader_error.call(null, null, [cljs.core.str("Unrecognized date/time syntax: "), cljs.core.str(a)].join("")); }; cljs.reader.read_date = function(a) { - return"string" === typeof a ? cljs.reader.parse_timestamp.call(null, a) : cljs.reader.reader_error.call(null, null, "Instance literal expects a string for its timestamp.") + return "string" === typeof a ? cljs.reader.parse_timestamp.call(null, a) : cljs.reader.reader_error.call(null, null, "Instance literal expects a string for its timestamp."); }; cljs.reader.read_queue = function(a) { - return cljs.core.vector_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentQueue.EMPTY, a) : cljs.reader.reader_error.call(null, null, "Queue literal expects a vector for its elements.") + return cljs.core.vector_QMARK_.call(null, a) ? cljs.core.into.call(null, cljs.core.PersistentQueue.EMPTY, a) : cljs.reader.reader_error.call(null, null, "Queue literal expects a vector for its elements."); +}; +cljs.reader.read_js = function(a) { + if (cljs.core.vector_QMARK_.call(null, a)) { + var b = []; + a = cljs.core.seq.call(null, a); + for (var c = null, d = 0, e = 0;;) { + if (e < d) { + var f = cljs.core._nth.call(null, c, e); + b.push(f); + e += 1; + } else { + if (a = cljs.core.seq.call(null, a)) { + c = a, cljs.core.chunked_seq_QMARK_.call(null, c) ? (a = cljs.core.chunk_first.call(null, c), e = cljs.core.chunk_rest.call(null, c), c = a, d = cljs.core.count.call(null, a), a = e) : (a = cljs.core.first.call(null, c), b.push(a), a = cljs.core.next.call(null, c), c = null, d = 0), e = 0; + } else { + break; + } + } + } + return b; + } + if (cljs.core.map_QMARK_.call(null, a)) { + b = {}; + a = cljs.core.seq.call(null, a); + c = null; + for (e = d = 0;;) { + if (e < d) { + var g = cljs.core._nth.call(null, c, e), f = cljs.core.nth.call(null, g, 0, null), g = cljs.core.nth.call(null, g, 1, null); + b[cljs.core.name.call(null, f)] = g; + e += 1; + } else { + if (a = cljs.core.seq.call(null, a)) { + cljs.core.chunked_seq_QMARK_.call(null, a) ? (d = cljs.core.chunk_first.call(null, a), a = cljs.core.chunk_rest.call(null, a), c = d, d = cljs.core.count.call(null, d)) : (d = cljs.core.first.call(null, a), c = cljs.core.nth.call(null, d, 0, null), d = cljs.core.nth.call(null, d, 1, null), b[cljs.core.name.call(null, c)] = d, a = cljs.core.next.call(null, a), c = null, d = 0), e = 0; + } else { + break; + } + } + } + return b; + } + return new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.reader_error.call(null, null, [cljs.core.str("JS literal expects a vector or map containing "), cljs.core.str("only string or unqualified keyword keys")].join("")) : null; }; cljs.reader.read_uuid = function(a) { - return"string" === typeof a ? new cljs.core.UUID(a) : cljs.reader.reader_error.call(null, null, "UUID literal expects a string as its representation.") + return "string" === typeof a ? new cljs.core.UUID(a) : cljs.reader.reader_error.call(null, null, "UUID literal expects a string as its representation."); }; -cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null, new cljs.core.PersistentArrayMap(null, 3, ["inst", cljs.reader.read_date, "uuid", cljs.reader.read_uuid, "queue", cljs.reader.read_queue], null)); +cljs.reader._STAR_tag_table_STAR_ = cljs.core.atom.call(null, new cljs.core.PersistentArrayMap(null, 4, ["inst", cljs.reader.read_date, "uuid", cljs.reader.read_uuid, "queue", cljs.reader.read_queue, "js", cljs.reader.read_js], null)); cljs.reader._STAR_default_data_reader_fn_STAR_ = cljs.core.atom.call(null, null); cljs.reader.maybe_read_tagged_type = function(a, b) { var c = cljs.reader.read_symbol.call(null, a, b), d = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), "" + cljs.core.str(c)), e = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); - return cljs.core.truth_(d) ? d.call(null, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.core.truth_(e) ? e.call(null, c, cljs.reader.read.call(null, a, !0, null, !1)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.reader_error.call(null, a, "Could not find tag parser for ", "" + cljs.core.str(c), " in ", cljs.core.pr_str.call(null, cljs.core.keys.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_)))) : null + return cljs.core.truth_(d) ? d.call(null, cljs.reader.read.call(null, a, !0, null, !1)) : cljs.core.truth_(e) ? e.call(null, c, cljs.reader.read.call(null, a, !0, null, !1)) : new cljs.core.Keyword(null, "else", "else", 1017020587) ? cljs.reader.reader_error.call(null, a, "Could not find tag parser for ", "" + cljs.core.str(c), " in ", cljs.core.pr_str.call(null, cljs.core.keys.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_)))) : null; }; cljs.reader.register_tag_parser_BANG_ = function(a, b) { var c = "" + cljs.core.str(a), d = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), c); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_tag_table_STAR_, cljs.core.assoc, c, b); - return d + return d; }; cljs.reader.deregister_tag_parser_BANG_ = function(a) { a = "" + cljs.core.str(a); var b = cljs.core.get.call(null, cljs.core.deref.call(null, cljs.reader._STAR_tag_table_STAR_), a); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_tag_table_STAR_, cljs.core.dissoc, a); - return b + return b; }; cljs.reader.register_default_tag_parser_BANG_ = function(a) { var b = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_, function(b) { - return a + return a; }); - return b + return b; }; cljs.reader.deregister_default_tag_parser_BANG_ = function() { var a = cljs.core.deref.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_); cljs.core.swap_BANG_.call(null, cljs.reader._STAR_default_data_reader_fn_STAR_, function(a) { - return null + return null; }); - return a + return a; }; var cljsdeps = {core:{}}; diff --git a/project.clj b/project.clj index 3863c72fc..93ce8087d 100644 --- a/project.clj +++ b/project.clj @@ -8,14 +8,16 @@ :exclusions [org.apache.ant/ant]] ] :jvm-opts ["-Xmx1g" "-XX:+UseConcMarkSweepGC"] ; cljsbuild eats memory - :cljsbuild {:builds [{:source-paths ["src"] + :cljsbuild {:builds [{:id "app" + :source-paths ["src"] :compiler {:optimizations :simple :externs ["externs/jquery.js" "externs/throttle.js" "externs/codemirror.js"] :source-map "deploy/core/node_modules/lighttable/bootstrap.js.map" :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}} - {:source-paths ["cljsdeps"] + {:id "cljsdeps" + :source-paths ["src-cljsdeps"] :compiler {:optimizations :simple :output-to "deploy/core/node_modules/clojurescript/cljsDeps.js" :output-dir "deploy/core/node_modules/clojurescript/cljsDeps/" diff --git a/src-cljsdeps/core.cljs b/src-cljsdeps/core.cljs new file mode 100644 index 000000000..2a8d2d09a --- /dev/null +++ b/src-cljsdeps/core.cljs @@ -0,0 +1,7 @@ +(ns cljsdeps.core + "ClojureScript used to build cljsDeps.js as describe in + https://github.com/LightTable/LightTable/commit/8e73f59891c45f73a1b985fed69795d1061a8ecf#commitcomment-10073128. + Generated javascript is used in background thread with worker-thread object." + (:require [clojure.string :as string] + [clojure.walk :as walk] + [cljs.reader :as reader])) From 326dfc22361c7e1536e4a5ab1aa6cfeb01508816 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 23 Sep 2015 02:05:59 -0400 Subject: [PATCH 508/656] Add missing thread requires necessary for app to be bootable in modern cljs --- src/lt/objs/langs/behaviors.cljs | 1 + src/lt/objs/sidebar/navigate.cljs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 559f2bafb..0f9ef1a0f 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -4,6 +4,7 @@ [lt.objs.context :as ctx] [lt.objs.command :as cmd] [lt.util.dom :as dom] + [lt.objs.thread] [lt.objs.editor :as editor] [clojure.string :as string] [lt.util.js :refer [wait]]) diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index 3a257f0be..9f63d3e59 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -10,6 +10,7 @@ [lt.objs.opener :as opener] [lt.objs.sidebar :as sidebar] [lt.util.dom :as dom] + [lt.objs.thread] [lt.util.load :as load] [crate.core :as crate] [crate.binding :refer [bound subatom]]) From 9a65d3585e04463cdca964ccab46316f1a4014fc Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Mon, 28 Sep 2015 17:52:57 -0400 Subject: [PATCH 509/656] Bump LT version to '0.8.0-alpha'. --- deploy/core/package.json | 2 +- deploy/core/version.json | 2 +- project.clj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/package.json b/deploy/core/package.json index aac8b795c..db3f5122c 100644 --- a/deploy/core/package.json +++ b/deploy/core/package.json @@ -1,7 +1,7 @@ { "name": "LightTable", "description": "LightTable Electron App", - "version": "0.8.0", + "version": "0.8.0-alpha", "main": "main.js", "browserWindowOptions": { "icon": "img/lticon.png", diff --git a/deploy/core/version.json b/deploy/core/version.json index 5fc368011..cdc8b1f4f 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.7.2","electron":"0.31.1"} +{"version":"0.8.0-alpha","electron":"0.31.1"} diff --git a/project.clj b/project.clj index c26d20147..90a778083 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject lighttable "0.8.0" +(defproject lighttable "0.8.0-alpha" :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] From 9852bae21e09c12a413055498ee6b3f0c3b0441a Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Tue, 22 Sep 2015 17:18:25 -0400 Subject: [PATCH 510/656] Bump version of Clojure plugin included by default to version 0.2.0. --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 93c41b722..77589f705 100755 --- a/script/build.sh +++ b/script/build.sh @@ -33,7 +33,7 @@ fi lein cljsbuild clean && lein cljsbuild once # Fetch plugins -PLUGINS=("Clojure,0.1.3" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.3" +PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.3" "Paredit,0.0.4" "Python,0.0.7" "Rainbow,0.0.8") # Plugins cache From ae306c0f4b14365eb7a3103ace32b7e399f0a3f3 Mon Sep 17 00:00:00 2001 From: rundis Date: Tue, 13 Oct 2015 11:42:52 +0200 Subject: [PATCH 511/656] Revert "Makes inline result address more specific to fix #1213 LightTable/Clojure#32" This reverts commit 2b0e9086927f5870966b9937efbf1c0e6ae47d95. And addresses #2004 --- src/lt/objs/eval.cljs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 9c620a41e..bcca7c0a2 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -305,14 +305,13 @@ (let [ed (:ed @this) type (or (:type opts) :inline) line (ed/line-handle ed (:line loc)) - ch (:ch loc) res-obj (object/create ::inline-result {:ed this :class (name type) :opts opts :result res :loc loc :line line})] - (when-let [prev (get (@this :widgets) [line ch type])] + (when-let [prev (get (@this :widgets) [line type])] (when (:open @prev) (object/merge! res-obj {:open true})) (object/raise prev :clear!)) @@ -320,7 +319,7 @@ (doseq [widget (map #(get (@this :widgets) [(ed/line-handle ed %) type]) (range (:start-line loc) (:line loc))) :when widget] (object/raise widget :clear!))) - (object/update! this [:widgets] assoc [line ch type] res-obj)))) + (object/update! this [:widgets] assoc [line type] res-obj)))) ;;**************************************************** ;; underline result @@ -481,10 +480,8 @@ :desc "Eval: Clear inline results" :exec (fn [] (when-let [ed (pool/last-active)] - (let [widgets (:widgets @ed)] - (object/merge! ed {:widgets {}}) - (doseq [[_ w] widgets] - (object/raise w :clear!)))))}) + (doseq [[_ w] (:widgets @ed)] + (object/raise w :clear!))))}) (cmd/command {:command :eval-editor :desc "Eval: Eval editor contents" From 7caa98e626806f7fad5c3fdd973c0121e1758d6a Mon Sep 17 00:00:00 2001 From: Dmitriy Rozhkov Date: Fri, 16 Oct 2015 01:48:37 +0200 Subject: [PATCH 512/656] Implement a hint length limit for auto-complete #1635 --- deploy/settings/default/default.behaviors | 1 + src/lt/plugins/auto_complete.cljs | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 4939198d3..8bc5e7d21 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -399,6 +399,7 @@ [:hinter :lt.plugins.auto-complete/escape!] [:hinter :lt.plugins.auto-complete/select-unknown] [:hinter :lt.plugins.auto-complete/line-change] + [:hinter :lt.plugins.auto-complete/set-hint-limit 1000] [:inline.doc :lt.plugins.doc/clear] diff --git a/src/lt/plugins/auto_complete.cljs b/src/lt/plugins/auto_complete.cljs index 9430f7c55..aff57931d 100644 --- a/src/lt/plugins/auto_complete.cljs +++ b/src/lt/plugins/auto_complete.cljs @@ -148,20 +148,33 @@ (declare hinter) +(defn remove-long-completions [hints] + (filter #(< (.-length (.-completion %)) (:hint-limit @hinter)) hints)) + (def hinter (-> (scmd/filter-list {:items (fn [] (when-let [cur (pool/last-active)] (let [token (-> @hinter :starting-token :string)] - (distinct-completions - (if token - (remove #(= token (.-completion %)) - (object/raise-reduce cur :hints+ [] token)) - (object/raise-reduce cur :hints+ [])))))) + (->> (if token + (remove #(= token (.-completion %)) + (object/raise-reduce cur :hints+ [] token)) + (object/raise-reduce cur :hints+ [])) + remove-long-completions + distinct-completions)))) :key text|completion}) (object/add-tags [:hinter]))) (defn on-line-change [line ch] (object/raise hinter :line-change line ch)) +(behavior ::set-hint-limit + :triggers #{:object.instant} + :type :user + :desc "Auto-complete: Set maximum length of an autocomplete hint" + :params [{:label "Number" + :example 1000}] + :reaction (fn [this n] + (object/merge! this {:hint-limit n}))) + (behavior ::textual-hints :triggers #{:hints+} :reaction (fn [this hints] From 3fa540163d62c7db00d08af4fb94256e19edb6ac Mon Sep 17 00:00:00 2001 From: Prof Gra Date: Sat, 24 Oct 2015 20:49:58 +0200 Subject: [PATCH 513/656] Add space before 'to get started' in landing page --- src/lt/objs/intro.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index e78203f9f..b676395da 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -47,7 +47,7 @@ [:h1 [:img {:height 40 :src (bound style/styles ->lt-image)}]] [:p "Welcome to the latest version of Light Table. To see the full list of what's been added/changed, checkout the " (changelog) ". - Some of the highlights include deeper Javascript support, inline browsers, and Python eval! If you're new, you might want to take a look at " (docs) "to get started."] + Some of the highlights include deeper Javascript support, inline browsers, and Python eval! If you're new, you might want to take a look at " (docs) " to get started."] [:p "If you run into any problems, report the issue on " (reports) "!"] ;; TODO: Added button to click for reporting issue - TWM ])) From 93b26db836e33d8aa0409f039b9d861a6123443d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 24 Oct 2015 15:04:09 -0400 Subject: [PATCH 514/656] Update intro to clarify docs are online - close #2016 --- src/lt/objs/intro.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index b676395da..ae0ac226b 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -23,7 +23,7 @@ "dark") ".png")) (defui docs [] - [:button "Light Table's docs"] + [:button "Light Table's online docs"] :click (fn [] (cmd/exec! :show-docs))) From e0da23698b92b6c0542187b1b1e42084f6f477da Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Nov 2015 18:29:39 -0500 Subject: [PATCH 515/656] Provide one command for building a release: script/build.sh --release Noticed when releasing 0.8.0-alpha that we had to do this in 2 steps --- script/build-app.sh | 24 ++++++++++++------------ script/build.sh | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/script/build-app.sh b/script/build-app.sh index 33a214bf6..d92c965b5 100755 --- a/script/build-app.sh +++ b/script/build-app.sh @@ -104,20 +104,20 @@ elif [ "$OS" == "windows" ]; then fi #---------------------------------------------------------------------- -# Create tarball or zip file +# Create release version: tarball or zip file #---------------------------------------------------------------------- -if [ "$1" == "--tarball" ]; then - pushd $BUILDS - tar -zcvf $RELEASE_TARBALL $RELEASE/* - popd -fi - -# Create zip file for Cygwin (Windows) using 7-Zip -if [ "$1" == "--zip" ]; then - pushd "$BUILDS" - "/cygdrive/c/Program Files/7-Zip/7z.exe" a $RELEASE_ZIP "$RELEASE/*" - popd +if [ "$1" == "--release" ]; then + # Create zip file for Cygwin (Windows) using 7-Zip + if [ "$OS" == "windows" ]; then + pushd "$BUILDS" + "/cygdrive/c/Program Files/7-Zip/7z.exe" a $RELEASE_ZIP "$RELEASE/*" + popd + else + pushd "$BUILDS" + tar -zcvf $RELEASE_TARBALL $RELEASE/* + popd + fi fi echo DONE! diff --git a/script/build.sh b/script/build.sh index 77589f705..37d4c449f 100755 --- a/script/build.sh +++ b/script/build.sh @@ -3,6 +3,7 @@ set -e # Build LightTable app and CLI and place in builds/. # Specify $VERSION to override default build version. +# Pass `--release` to build a release version. # This script primarily installs dependencies and sets up # the app before calling build-app.sh to build it. @@ -60,4 +61,4 @@ pushd deploy/plugins done popd -script/build-app.sh +script/build-app.sh $@ From 44da9623d575ffb9d707b8f35ecdf323f8d024b5 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Nov 2015 18:53:22 -0500 Subject: [PATCH 516/656] Add release process from #1936 with updated script command --- doc/for-committers.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index 7c7cf8e58..a8197666c 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -44,3 +44,21 @@ be unused. Some tips to confirm how it is/was used: * Do a LightTable user search for the given fn. For example, to see where [proc/exec is used](https://github.com/search?utf8=%E2%9C%93&q=proc%2Fexec+user%3ALightTable&type=Code&ref=searchresults) * `git log -u -S WORD` will do a code history search for WORD + +## Release process + +This is our release checklist which can be dropped in to an issue: + +- [ ] Release 0.X.X + - [ ] Version updates + - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj to 0.X.X + - [ ] Make sure electron version is up to date in version.json + - [ ] Make sure plugin versions in script/build-app.sh are latest versions + - [ ] Each core developer should QA at least one OS using the [QA checklist](https://github.com/LightTable/LightTable/wiki/QA-Checklist) + - [ ] When QA passes freeze master + - [ ] Add changelog to [GH release draft](https://github.com/LightTable/LightTable/releases/new) + - [ ] Upload binaries from `script/build.sh --release` to draft. Don't forget to click *Save draft*! + - [ ] Publish GH release which creates git tag and notifies users about new release + - [ ] Update download links on lighttable.com + - [ ] Mailing list announcement - [example email](https://gist.github.com/cldwalker/3d67153fe1eade2ae3cf) + - [ ] Optional blog post if a major release From a5f0a6b461766232f6cc775ccbd7f5ff61181e0f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Nov 2015 18:59:17 -0500 Subject: [PATCH 517/656] Add directions on reporting console messages --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d5339170..690070f65 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,7 @@ When filing a bug on GitHub, please help us help you by including the following: * *Steps to reproduce the bug.* * Your operating system, LT and relevant plugin versions. * Relevant configuration in your user.keymap and user.behaviors. +* Error messages you see in your console. In your menu, select`View > Commands` and then search for and execute the `Console: Open the console in a tab` command. Go to the console tab and copy and paste its errors. Note: The issue tracker is mainly for bugs. Questions should be asked on the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). From b0b06b6a135bd41142612dae8bf11dbe941060f5 Mon Sep 17 00:00:00 2001 From: rundis Date: Mon, 16 Nov 2015 06:57:00 +0100 Subject: [PATCH 518/656] Introduce block comment command and make toggle comment block aware by default --- src/lt/objs/editor.cljs | 3 +++ src/lt/objs/editor/pool.cljs | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index f9588ece9..aaec71d40 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -384,6 +384,9 @@ (defn line-comment [e from to opts] (.lineComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) +(defn block-comment [e from to opts] + (.blockComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) + (defn uncomment ([e from to] (uncomment e from to nil)) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 13d87fb70..ea8824eb5 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -274,6 +274,16 @@ (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)) (editor/line-comment cur cursor cursor (::comment-options @cur))))))}) +(cmd/command {:command :block-comment-selection + :desc "Editor: Block Comment line(s)" + :exec (fn [] + (when-let [cur (last-active)] + (let [cursor (editor/->cursor cur "start")] + (if (editor/selection? cur) + (editor/block-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)) + (editor/block-comment cur cursor cursor (::comment-options @cur))))))}) + + (cmd/command {:command :uncomment-selection :desc "Editor: Uncomment line(s)" :exec (fn [] @@ -292,7 +302,9 @@ [cursor (editor/->cursor cur "end")] [cursor cursor])] (when-not (editor/uncomment cur start end) - (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur))))))}) + (if-not (= (:line start) (:line end)) + (editor/block-comment cur cursor end (::comment-options @cur)) + (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)))))))}) (cmd/command {:command :indent-selection :desc "Editor: Indent line(s)" From 77ece1dab8b5838a3b993b147a52f8ca20ad0316 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Wed, 18 Nov 2015 15:55:35 -0500 Subject: [PATCH 519/656] Fix version sorting for building plugin cache data. Fixes #2043 --- src/lt/objs/plugins.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 500248ca1..fd0d55a99 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -197,8 +197,8 @@ (defn version-sort [a b] (cond (= a b) 0 - (deploy/is-newer? a b) 1 - :else -1)) + (deploy/is-newer? a b) -1 + :else 1)) (defn build-cache [sha] (let [items (filter files/dir? (files/full-path-ls metadata-dir)) @@ -207,7 +207,7 @@ :let [versions (->> (files/full-path-ls plugin) (filter files/dir?) (map plugin-info) - (sort-by #(version-sort % %2)) + (sort-by :version version-sort) (vec)) latest (last versions)]] [(:name latest) {:versions (into {} (map (juxt :version identity) versions)) From fd237402a479b60bce329282ce13d6f6521ed26a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 22 Nov 2015 17:15:45 -0500 Subject: [PATCH 520/656] Add settings and plugin manager to menu These are common tabs a beginner needs to interact with. It's helpful to have these discoverable via the menu and not force a beginner to learn how to use the commands pane. Settings put under File in order to have a consistent menu location across platforms --- src/lt/objs/menu.cljs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 09680d167..02c7b8dca 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -126,6 +126,9 @@ (cmd-item "Open recent workspace" :workspace.show-recents {}) (cmd-item "Save file" :save) (cmd-item "Save file as.." :save-as) + {:label "Settings" :submenu [(cmd-item "User keymap" :keymap.modify-user) + (cmd-item "User behaviors" :behaviors.modify-user) + (cmd-item "User script" :user.modify-user)]} {:type "separator"} (cmd-item "New window" :window.new) (cmd-item "Close window" :window.close) @@ -154,6 +157,7 @@ (cmd-item "Connections" :show-connect) (cmd-item "Navigator" :navigate-workspace-transient) (cmd-item "Commands" :show-commandbar-transient) + (cmd-item "Plugin Manager" :plugin-manager.show) {:type "separator"} (cmd-item "Language docs" :docs.search.show) {:type "separator"} From 8f0703c4aed98d1728ec06e9f04f55993707ca7f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 30 Nov 2015 01:27:45 -0500 Subject: [PATCH 521/656] Make user.keymap and user.behaviors more user friendly Feedback I got from non-backend users was that current comments explaining diffs and objects was confusing and didn't help with actual configuration. Created a separate doc for explanation and more configuration info --- deploy/core/User/user.behaviors | 35 ++++++++++++--- deploy/core/User/user.keymap | 26 ++++++----- doc/behavior-and-keymap-configuration.md | 57 ++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 17 deletions(-) create mode 100644 doc/behavior-and-keymap-configuration.md diff --git a/deploy/core/User/user.behaviors b/deploy/core/User/user.behaviors index 1d7c835a5..eafbfa63c 100644 --- a/deploy/core/User/user.behaviors +++ b/deploy/core/User/user.behaviors @@ -1,13 +1,22 @@ ;; User behaviors ;; ----------------------------- -;; Behaviors are stored as a set of diffs that are merged together -;; to create the final set of functionality that makes up Light Table. You can -;; modify these diffs to either add or subtract functionality. +;; Modify this file to add and subtract behaviors. Behaviors allow customization of +;; almost any aspect of LightTable e.g. show line numbers or current theme. +;; A behavior has the following format: ;; -;; Behaviors are added to tags, objects with those tags then automatically gain -;; whatever logic the behavior imparts. To see a list of user-level behaviors, -;; start typing a word related to the functionality you want in between the square -;; brackets (e.g. "theme"). +;; [:TAG :BEHAVIOR OPTIONAL_ARGUMENTS] +;; +;; * A tag indicates in what context the behavior applies. Common tags are :app and :editor which respectively +;; indicate the behavior can be used anywhere and the behavior only applies to editors. +;; +;; * Behavior is the specific LightTable behavior to configure. To search available behaviors, +;; start typing a search term after :TAG. Once you've found the desired behavior, press TAB to have autocomplete +;; fill in the behavior name. +;; +;; * Optional arguments are arguments to pass to a behavior. If a behavior has arguments they should +;; pop up in an info box after the behavior has been autocompleted. +;; +;; * For more on configuring behaviors, [see this doc](doc/behavior-and-keymap-configuration.md). [ ;; The app tag is kind of like global scope. You assign behaviors that affect @@ -27,5 +36,17 @@ ;; To subtract a behavior, prefix the name with '-' e.g. ;; [:app :-lt.objs.intro/show-intro] + + + ;; Common behaviors to consider + ;; ============================ + ;; Show line numbers + ;; [:editor :lt.objs.editor/line-numbers] + ;; Customize font + ;; [:app :lt.objs.style/font-settings "Courier New" "11"] + ;; Auto-close characters '{[("'. Currently only works in English keyboards + ;; [:app :lt.objs.settings/pair-keymap-diffs] + ;; Tab settings: Use real tabs, tab size in spaces, spaces per indent +;; [:editor :lt.objs.editor/tab-settings false 2 2] ] diff --git a/deploy/core/User/user.keymap b/deploy/core/User/user.keymap index 0dc1198d5..3bcc46697 100644 --- a/deploy/core/User/user.keymap +++ b/deploy/core/User/user.keymap @@ -1,19 +1,25 @@ ;; User keymap ;; ----------------------------- -;; Keymaps are stored as a set of diffs that are merged together to create -;; the final set of keys. You can modify these diffs to either add or -;; subtract bindings. +;; Modify this file to add and subtract keybindings (keyboard shortcuts). +;; Keybindings allow custom keys to invoke any desired LightTable functionality that is behind a command. +;; A keybinding has the following format: ;; -;; Like behaviors, keys are bound by tag. When objects with those tags are active -;; the key bindings are live. Keys can be bound to any number of Light Table commands, -;; allowing you the flexibility to execute multiple operations together. To see a list -;; of all the commands you can execute, start typing a word related to the thing you -;; want to do in between the square brackets (e.g. type "editor"). - +;; [:TAG "KEYS" :COMMAND] +;; +;; * A tag indicates in what context the keybinding applies. Common tags are :app and :editor which respectively +;; indicate the keybinding can be used anywhere and the keybinding can only be used when editing text. +;; +;; * Keys are the actual keys you type for the keybinding. Most keybindings start with modifier(s) e.g. alt or control. +;; Keybindings with modifiers have the format "modifier(s)-key". For example "alt-shift-x" means press alt, shift and x +;; at once. See [this doc](doc/behavior-and-keymap-configuration.md#keys) for more on configuring keys. +;; +;; * Command is the specific LightTable command(s) to invoke. To search available commands, +;; start typing a search term after "KEYS". Once you've found the desired command, press TAB to have autocomplete +;; fill in the command name. See [this doc](doc/behavior-and-keymap-configuration.md#commands-in-keybindings) for more on configuring commands. [ [:editor "alt-w" :editor.watch.watch-selection] [:editor "alt-shift-w" :editor.watch.unwatch] - ;; To subtract a binding, prefix the key with '-' e.g. + ;; To subtract a keybinding, prefix the key with '-' e.g. ;; [:app "-ctrl-shift-d" :docs.search.show] ] diff --git a/doc/behavior-and-keymap-configuration.md b/doc/behavior-and-keymap-configuration.md new file mode 100644 index 000000000..440ff4561 --- /dev/null +++ b/doc/behavior-and-keymap-configuration.md @@ -0,0 +1,57 @@ +This document assumes [the user.keymap +introduction](../deploy/core/User/user.keymap) and [the user.behaviors +introduction](../deploy/core/User/user.behaviors) have been read. + +## Introduction + +Keymap and behaviors files are ClojureScript data that when merged together +create LightTable's final keys and functionality. A user can add or remove any +keybinding/behavior. This is powerful as any default keybinding/behavior, +whether from LightTable or a plugin, can be removed or overridden by a user. +Next this document will cover configuring behaviors and keybindings through +tags, keys and commands. + +## Tags + +Tags allow keybindings/behaviors to apply in different contexts i.e. `enter` +means something different in a url bar vs a popup. Under the hood, objects have +tags added and removed which makes a keybinding/behavior apply or not apply to +them respectively. Tags can have optional extensions that make them apply in +different contexts. For example to have the `:editor` tag only apply to a file +for a given filetype use the format `:editor.FILETYPE` e.g. +`:editor.javascript`. Note that for the same keybinding/behavior a tag with +an extension takes precedence over one without. + +There are a number of tags that only apply in a unique UI context or widget e.g. +a browser. Here are some common ones: + +* :browser - Applies when inside a browser tab +* :editor.keys.hinting.active - Applies when hinting/autocomplete is active +* :filter-list.input - Applies when in a filter-list e.g. Commands pane or Navigator + +For more tags see the ones used by default in +[default.keymap](../deploy/settings/default/default.keymap) and +[default.beahviors](../deploy/settings/default/default.behaviors) and search +LightTable for when a context tag is added with +[ctx/in!](https://github.com/LightTable/LightTable/search?utf8=%E2%9C%93&q=%22ctx%2Fin%21%22&type=Code). + +## Keys + +LightTable uses [mousetrap](https://github.com/ccampbell/mousetrap) for keyboard +handling. Mousetrap recognizes the following modifier keys: `shift, ctrl, +alt/option and command/cmd`. LightTable also recognizes pmeta which is +command/cmd in OSX and ctrl anywhere else. To specify other special keys like +'enter' see [this Mousetrap documentation](https://craig.is/killing/mice#keys). +LightTable also supports key combinations/sequences when keys are separated by a +space. This allows plugins like Emacs to support key chords like 'ctrl-x u'. + +## Commands In Keybindings + +Keybindings can run multiple commands by appending them to the end e.g. `[:TAG +"KEYS" :COMMAND1 :COMMAND2]`. While commands are started serially, there isn't a +guarantee that one command is fully finished before the next proceeds. Any +commands that have asynchronous functionality e.g. interaction with a network or +filesystem cannot guarantee when their functionality is complete. Commands can +have arguments passed to them by wrapping them in parenthesis e.g. `(:COMMAND +ARG1 ARG2)`. For example `[:tabs "pmeta-1" (:tabs.goto 0)]` is a default +keybinding that passes `0` as an argument to the `:tabs.goto` command. From d59caffe20c89156efc386474620552c9d58cd3a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 30 Nov 2015 01:39:18 -0500 Subject: [PATCH 522/656] Use full urls in comment explanation Markdown links are invalid in this context --- deploy/core/User/user.behaviors | 2 +- deploy/core/User/user.keymap | 4 ++-- doc/behavior-and-keymap-configuration.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/core/User/user.behaviors b/deploy/core/User/user.behaviors index eafbfa63c..56c72fdab 100644 --- a/deploy/core/User/user.behaviors +++ b/deploy/core/User/user.behaviors @@ -16,7 +16,7 @@ ;; * Optional arguments are arguments to pass to a behavior. If a behavior has arguments they should ;; pop up in an info box after the behavior has been autocompleted. ;; -;; * For more on configuring behaviors, [see this doc](doc/behavior-and-keymap-configuration.md). +;; * For more on configuring behaviors see https://github.com/LightTable/LightTable/blob/master/doc/behavior-and-keymap-configuration.md. [ ;; The app tag is kind of like global scope. You assign behaviors that affect diff --git a/deploy/core/User/user.keymap b/deploy/core/User/user.keymap index 3bcc46697..939546858 100644 --- a/deploy/core/User/user.keymap +++ b/deploy/core/User/user.keymap @@ -11,11 +11,11 @@ ;; ;; * Keys are the actual keys you type for the keybinding. Most keybindings start with modifier(s) e.g. alt or control. ;; Keybindings with modifiers have the format "modifier(s)-key". For example "alt-shift-x" means press alt, shift and x -;; at once. See [this doc](doc/behavior-and-keymap-configuration.md#keys) for more on configuring keys. +;; at once. For more on configuring keys see https://github.com/LightTable/LightTable/blob/master/doc/behavior-and-keymap-configuration.md#keys. ;; ;; * Command is the specific LightTable command(s) to invoke. To search available commands, ;; start typing a search term after "KEYS". Once you've found the desired command, press TAB to have autocomplete -;; fill in the command name. See [this doc](doc/behavior-and-keymap-configuration.md#commands-in-keybindings) for more on configuring commands. +;; fill in the command name. For more on configuring commands see https://github.com/LightTable/LightTable/blob/master/doc/behavior-and-keymap-configuration.md#commands-in-keybindings. [ [:editor "alt-w" :editor.watch.watch-selection] [:editor "alt-shift-w" :editor.watch.unwatch] diff --git a/doc/behavior-and-keymap-configuration.md b/doc/behavior-and-keymap-configuration.md index 440ff4561..bd227ffa8 100644 --- a/doc/behavior-and-keymap-configuration.md +++ b/doc/behavior-and-keymap-configuration.md @@ -31,7 +31,7 @@ a browser. Here are some common ones: For more tags see the ones used by default in [default.keymap](../deploy/settings/default/default.keymap) and -[default.beahviors](../deploy/settings/default/default.behaviors) and search +[default.behaviors](../deploy/settings/default/default.behaviors) and search LightTable for when a context tag is added with [ctx/in!](https://github.com/LightTable/LightTable/search?utf8=%E2%9C%93&q=%22ctx%2Fin%21%22&type=Code). From c99c0b77240a2cfb740e518435df196eea307e1e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 1 Dec 2015 01:06:17 -0500 Subject: [PATCH 523/656] Upgrade to Electron 0.34.5 Held off on upgrading to 0.35.0 since there ipc changes to handle --- deploy/core/version.json | 2 +- deploy/electron/Gruntfile.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/core/version.json b/deploy/core/version.json index cdc8b1f4f..e2f614ba3 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.8.0-alpha","electron":"0.31.1"} +{"version":"0.8.0-alpha","electron":"0.34.5"} diff --git a/deploy/electron/Gruntfile.js b/deploy/electron/Gruntfile.js index 446d2db0d..d9e131c40 100644 --- a/deploy/electron/Gruntfile.js +++ b/deploy/electron/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), "download-electron": { - version: "0.31.1", + version: "0.34.5", outputDir: "./electron", rebuild: true } From af566085b1acc903651676744c0989631fa3c726 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 2 Dec 2015 22:08:42 -0500 Subject: [PATCH 524/656] Fix opening file from osx file manager - close #2053 --- src/lt/objs/cli.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index e4c92c4e3..e90d4d833 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -43,8 +43,11 @@ on first window since subsequent windows don't open path arguments." [] (and (app/first-window?) - (or (seq (if js/process.env.LT_DEV_CLI (subvec argv 2) (rest argv))) - (seq open-files)))) + ;; OSX adds an extra apple event argument to argv when opening a file from a + ;; file manager e.g. ["/path/to/electron" "-psn_0_12381134"]. Rather than add + ;; a brittle check to remove that argument, check open-files first + (or (seq open-files) + (seq (if js/process.env.LT_DEV_CLI (subvec argv 2) (rest argv)))))) ;;********************************************************* ;; Behaviors From 76965aac4c2aa5718cd2e0adbf7e3c7c11289b10 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 3 Dec 2015 23:33:05 -0500 Subject: [PATCH 525/656] Remove mention of io.js as electron uses a version of node.js This electron version uses node 4.1.1 and io.js and node.js merged before this version --- doc/developer-install.md | 2 +- doc/for-committers.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index 58a1fbd67..e0ae26a0c 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -3,7 +3,7 @@ ## Prerequisites - [Leiningen 2.x](http://leiningen.org/) -- [io.js and npm](https://iojs.org/). To avoid clobbering an existing node install, [use nvm](https://github.com/creationix/nvm). +- [node.js and npm](https://nodejs.org/) ## OS Specific Prerequisites diff --git a/doc/for-committers.md b/doc/for-committers.md index a8197666c..b33db889e 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -13,7 +13,7 @@ Current ClojureScript version and libraries we use are in [project.clj](https:// ### Node packages -Node package installs last done with io.js v2.5.0 and npm v2.13.2. +Node package installs last done with node.js v2.5.0 and npm v2.13.2. Node dependencies are at deploy/core/node\_modules/. This directory is currently a mix of vendored dependencies, forked dependencies and Light Table specific libraries: From a7de161f07e144398245ee9c080db9d5d777b69f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 4 Dec 2015 01:16:33 -0500 Subject: [PATCH 526/656] Fix error callback handling Also combined two catch clauses as they are no longer necessary --- src/lt/objs/clients/ws.cljs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index 5a27a8c34..ef129e785 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -60,20 +60,16 @@ (.on (.-server ws) "error" #(do (if (= (.-code %) "EADDRINUSE") (do - (.log js/console "Default socket.io port already used, retrying with a random one") + (.log js/console "Default socket.io port already used. Retrying with a random port.") (.listen (.-server ws) 0)) - (throw e)))) + (throw %)))) (.on (.-server ws) "listening" #(do - (set! port (.-port (.address (.-server ws)))) - )) + (set! port (.-port (.address (.-server ws)))))) (.add (aget ws "static") "/lighttable/ws.js" (clj->js {:file (files/lt-home "core/node_modules/lighttable/ws.js")})) (.on (.-sockets ws) "connection" on-connect) ws) - ;;TODO: warn the user that they're not connected to anything - (catch js/Error e - (.log js/console "Error starting socket.io server" e)) - (catch js/global.Error e - (.log js/console "Global Error starting socket.io server" e)))) + (catch :default e + (.log js/console "Error starting socket.io server" e)))) (behavior ::kill-on-closed :triggers #{:closed} From 8b015ddb50bce761d4dba84aad119800e55c729a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 4 Dec 2015 02:17:13 -0500 Subject: [PATCH 527/656] DRY up block-comment and toggle-comment --- src/lt/objs/editor.cljs | 12 ++++++++---- src/lt/objs/editor/pool.cljs | 37 +++++++++++------------------------- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 293c59d94..d8e6d0bd4 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -387,13 +387,17 @@ (defn uncomment [e from to opts] (.uncomment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) -(defn toggle-comment [e from to opts] - (when-not (uncomment e from to opts) - (line-comment e from to opts))) - (defn block-comment [e from to opts] (.blockComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) +(defn toggle-comment + "Toggle comment and if multiline toggle apply block comment" + [e from to opts] + (when-not (uncomment e from to opts) + (if-not (= (:line from) (:line to)) + (block-comment e from to opts) + (line-comment e from (->cursor e "end") opts)))) + (defn ->generation [e] (.changeGeneration (->cm-ed e))) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 84a19c1f9..e1616ef96 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -266,45 +266,30 @@ (object/merge! this {::comment-options options}))) (defn do-commenting [commenting-fn] - (fn [] - (when-let [cur (last-active)] - (let [from (editor/->cursor cur "start") - to (if (editor/selection? cur) - (editor/->cursor cur "end") - from) - options (::comment-options @cur)] - (commenting-fn cur from to options))))) + (when-let [cur (last-active)] + (let [from (editor/->cursor cur "start") + to (if (editor/selection? cur) + (editor/->cursor cur "end") + from) + options (::comment-options @cur)] + (commenting-fn cur from to options)))) (cmd/command {:command :comment-selection :desc "Editor: Comment line(s)" - :exec (do-commenting editor/line-comment)}) + :exec (partial do-commenting editor/line-comment)}) (cmd/command {:command :block-comment-selection :desc "Editor: Block Comment line(s)" - :exec (fn [] - (when-let [cur (last-active)] - (let [cursor (editor/->cursor cur "start")] - (if (editor/selection? cur) - (editor/block-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)) - (editor/block-comment cur cursor cursor (::comment-options @cur))))))}) + :exec (partial do-commenting editor/block-comment)}) (cmd/command {:command :uncomment-selection :desc "Editor: Uncomment line(s)" - :exec (do-commenting editor/uncomment)}) + :exec (partial do-commenting editor/uncomment)}) (cmd/command {:command :toggle-comment-selection :desc "Editor: Toggle comment line(s)" - :exec (fn [] - (when-let [cur (last-active)] - (let [cursor (editor/->cursor cur "start") - [start end] (if (editor/selection? cur) - [cursor (editor/->cursor cur "end")] - [cursor cursor])] - (when-not (editor/uncomment cur start end) - (if-not (= (:line start) (:line end)) - (editor/block-comment cur cursor end (::comment-options @cur)) - (editor/line-comment cur cursor (editor/->cursor cur "end") (::comment-options @cur)))))))}) + :exec (partial do-commenting editor/toggle-comment)}) (cmd/command {:command :indent-selection :desc "Editor: Indent line(s)" From 3386181e375ca8f7863f3bc69473b4d111cc4a18 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 5 Dec 2015 20:31:50 +0100 Subject: [PATCH 528/656] Cleanup duplicated error handling See issue https://github.com/LightTable/LightTable/issues/1966 --- src/lt/object.cljs | 9 ++------ src/lt/objs/clients/tcp.cljs | 12 +++-------- src/lt/objs/clients/ws.cljs | 3 +-- src/lt/objs/console.cljs | 4 +--- src/lt/objs/files.cljs | 41 +++++++++--------------------------- src/lt/objs/menu.cljs | 4 +--- src/lt/objs/plugins.cljs | 5 +---- src/lt/objs/settings.cljs | 9 ++------ src/lt/objs/tabs.cljs | 4 +--- 9 files changed, 22 insertions(+), 69 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 078f6558d..bf1187f33 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -132,14 +132,9 @@ (apply func obj args)) (when-not (= trigger :object.behavior.time) (raise obj :object.behavior.time r time trigger))) - (catch js/Error e + (catch :default e (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) - (safe-report-error e) - ) - (catch js/global.Error e - (safe-report-error (str "Invalid behavior: " (-> (->behavior r) :name))) - (safe-report-error e) - ))))) + (safe-report-error e)))))) (defn raise "Invoke object's behavior fns for given trigger. Args are passed to behavior fns" diff --git a/src/lt/objs/clients/tcp.cljs b/src/lt/objs/clients/tcp.cljs index 32a1d563c..1d0b6f027 100644 --- a/src/lt/objs/clients/tcp.cljs +++ b/src/lt/objs/clients/tcp.cljs @@ -46,9 +46,7 @@ next (subs buf (inc loc)) data (try (js->clj (.parse js/JSON cur) :keywordize-keys true) - (catch js/Error e - (console/error e)) - (catch js/global.Error e + (catch :default e (console/error e)))] (cb data) (recur (.indexOf next "\n") next)) @@ -74,10 +72,7 @@ (.on s "listening" #(set! port (.-port (.address s)))) s) ;;TODO: warn the user that they're not connected to anything - (catch js/Error e - ) - (catch js/global.Error e - ))) + (catch :default e))) (behavior ::send! :triggers #{:send!} @@ -90,6 +85,5 @@ :reaction (fn [app] (try (.close server) - (catch js/Error e) - (catch js/global.Error e)))) + (catch :default e)))) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index ef129e785..98ea08632 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -76,5 +76,4 @@ :reaction (fn [app] (try (.close server) - (catch js/Error e) - (catch js/global.Error e)))) + (catch :default e)))) diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index c25000838..fbedff074 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -23,9 +23,7 @@ (files/mkdir (files/lt-user-dir))) (files/mkdir logs-dir)) (.. (js/require "fs") (createWriteStream (files/join logs-dir (str "window" (app/window-number) ".log")))) - (catch js/global.Error e - (.error js/console (str "Failed to initialize the log writer: " e))) - (catch js/Error e + (catch :default e (.error js/console (str "Failed to initialize the log writer: " e))))) (defn ->ui [c] diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index b4255f51e..a94df5e3a 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -184,13 +184,9 @@ :type (or (path->mode path) e)}) (object/raise files-obj :files.open content)) )) - (catch js/Error e + (catch :default e (object/raise files-obj :files.open.error path e) - (when cb (cb nil e))) - (catch js/global.Error e - (object/raise files-obj :files.open.error path e) - (when cb (cb nil e))) - )) + (when cb (cb nil e))))) (defn open-sync "Open file and return map with file's content in :content" @@ -205,13 +201,9 @@ :line-ending (determine-line-ending content) :type (or (ext->mode (keyword e)) e)})) ) - (catch js/Error e + (catch :default e (object/raise files-obj :files.open.error path) - nil) - (catch js/global.Error e - (object/raise files-obj :files.open.error path) - nil) - )) + nil))) (defn save "Save path with given content. Optional callback called after save" @@ -220,14 +212,9 @@ (.writeFileSync fs path content) (object/raise files-obj :files.save path) (when cb (cb)) - (catch js/global.Error e - (object/raise files-obj :files.save.error path e) - (when cb (cb e)) - ) - (catch js/Error e + (catch :default e (object/raise files-obj :files.save.error path e) - (when cb (cb e)) - ))) + (when cb (cb e))))) (defn append "Append content to path. Optional callback called after append" @@ -236,14 +223,9 @@ (.appendFileSync fs path content) (object/raise files-obj :files.save path) (when cb (cb)) - (catch js/global.Error e + (catch :default e (object/raise files-obj :files.save.error path e) - (when cb (cb e)) - ) - (catch js/Error e - (object/raise files-obj :files.save.error path e) - (when cb (cb e)) - ))) + (when cb (cb e))))) (defn trash! [path] (.moveItemTotrash shell path)) @@ -329,9 +311,7 @@ [path] (try (doall (map (partial join path) (.readdirSync fs path))) - (catch js/Error e - (js/lt.objs.console.error e)) - (catch js/global.Error e + (catch :default e (js/lt.objs.console.error e)))) (defn dirs @@ -339,8 +319,7 @@ [path] (try (filter dir? (map (partial join path) (.readdirSync fs path))) - (catch js/Error e) - (catch js/global.Error e))) + (catch :default e))) (defn home "Return users' home directory (e.g. ~/) or path under it" diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 02c7b8dca..1e6d3e773 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -24,9 +24,7 @@ (try (when-let [func (:click opts)] (func)) - (catch js/Error e - (.error js/console e)) - (catch js/global.Error e + (catch :default e (.error js/console e))))) opts)] (MenuItem. (clj->js opts)))) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index fd0d55a99..26cd6184d 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -782,10 +782,7 @@ (try (load/js path true) (object/update! this [::loaded-files] #(conj (or % #{}) path)) - (catch js/Error e - (.error js/console (str "Error loading JS file: " path " : " e)) - (.error js/console (.-stack e))) - (catch js/global.Error e + (catch :default e (.error js/console (str "Error loading JS file: " path " : " e)) (.error js/console (.-stack e))))))))))) diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index bfa015141..7424626b8 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -22,10 +22,7 @@ (when s (try (reader/read-string s) - (catch js/global.Error e - (console/error (str "Invalid settings file: " file "\n" e)) - nil) - (catch js/Error e + (catch :default e (console/error (str "Invalid settings file: " file "\n" e)) nil)))) @@ -163,9 +160,7 @@ (do (try (object/refresh! (first objs)) - (catch js/global.Error e - (.error js/console e)) - (catch js/Error e + (catch :default e (.error js/console e))) (js/process.nextTick (fn [] (refresh-all (next objs))))))) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index 3085b1237..fefa32261 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -387,9 +387,7 @@ (try (let [orig (:active-obj @this)] (object/raise orig :close)) - (catch js/Error e - (js/lt.objs.console.error e)) - (catch js/global.Error e + (catch :default e (js/lt.objs.console.error e))))) (behavior ::on-destroy-objs From 6bd8ab656b4e9b5f81ff1b7f74615a8de2c52e15 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 5 Dec 2015 20:47:21 +0100 Subject: [PATCH 529/656] Replace 'catch js/global.Error' with 'catch :default' --- src/lt/objs/files.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index a94df5e3a..482386428 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -286,7 +286,7 @@ (if cb (cb fs) fs)) - (catch js/global.Error e + (catch :default e (when cb (cb nil)) nil)))) @@ -303,7 +303,7 @@ (:files opts) (filter #(file? (join path %)) fs) (:dirs opts) (filter #(dir? (join path %)) fs) :else fs)) - (catch js/global.Error e + (catch :default e nil))) (defn full-path-ls From ac6c666b55b094e53a1e70dfa3e8aad42d1ae980 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 5 Dec 2015 20:56:41 +0100 Subject: [PATCH 530/656] Replace 'catch js/Error' with 'catch :default' --- src/lt/objs/opener.cljs | 5 ++--- src/lt/objs/sidebar/workspace.cljs | 2 +- src/lt/objs/workspace.cljs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 70eef959f..0b2a2a255 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -265,6 +265,5 @@ (aget i) (.-path))) (recur (inc i))))) - (catch js/Error e - (println e))) - )) + (catch :default e + (println e))))) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 2d0cf4d49..eebbff8fd 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -169,7 +169,7 @@ (object/raise workspace/current-ws :add.folder! path) (object/raise workspace/current-ws :add.file! path))) (recur (inc i))))) - (catch js/Error e + (catch :default e (println e))))) (behavior ::on-menu diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index f917d083f..b6099faeb 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -180,7 +180,7 @@ (reconstitute ws (file->ws loc)) (save ws (:file @ws)) (files/delete! loc) - (catch js/Error e + (catch :default e )))) (defn cached [] From a0945a8a6d5ca8bf5de66bd2be69a1347c5e6ebf Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 5 Dec 2015 19:02:57 -0500 Subject: [PATCH 531/656] Add a note to contributing about not modifying codemirror files --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 690070f65..e7d29714f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,3 +38,6 @@ When contributing: * Please add docstrings to non-trivial functions that are added. Most existing code doesn't have this but we'd like to improve this. * We are not currently seeking refactoring contributions or code convention tweaks e.g. whitespace. This may change at a later point when we have automated tests and an explicit code convention. * For contributions to a [vendored dependency](doc/for-committers.md#node-packages), they must be sent upstream and then we can update to the new version. +* For plugins and files that come from CodeMirror, usually under codemirror/, we do not take pull requests. + Instead, send a pull request [to CodeMirror](https://github.com/codemirror/CodeMirror). Once they release a new version we can + upgrade it on a plugin. Thanks! From 9068c657fa01e8088c44d1d238ea66ff2880ab6d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 6 Dec 2015 11:18:00 -0500 Subject: [PATCH 532/656] Add api doc generation through codox Generate API documentation for namespaces of fns that were documented in f94bf3af0d382424c69161d5b01680d0ea657a38. Fns that are meant to be private were marked as :private. There are a number of public fns in object, files and editor namespaces that should be documented later --- project.clj | 15 +++++++++- src/lt/macros.clj | 18 +++++------ src/lt/object.cljs | 58 ++++++++++++++++++------------------ src/lt/objs/command.cljs | 8 ++--- src/lt/objs/editor.cljs | 24 +++++++-------- src/lt/objs/editor/pool.cljs | 32 ++++++++++---------- src/lt/objs/files.cljs | 44 +++++++++++++-------------- src/lt/objs/notifos.cljs | 6 ++-- 8 files changed, 109 insertions(+), 96 deletions(-) diff --git a/project.clj b/project.clj index 90a778083..8c8b9f87f 100644 --- a/project.clj +++ b/project.clj @@ -15,6 +15,19 @@ :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}}]} - :plugins [[lein-cljsbuild "1.0.1"]] + :profiles {:doc {:dependencies [[org.clojure/clojure "1.7.0"] + [org.clojure/clojurescript "1.7.145" + :exclusions [org.apache.ant/ant]]]}} + :plugins [[lein-cljsbuild "1.0.1"] + [lein-codox "0.9.0"]] + :codox {:language :clojurescript + :project {:name "LightTable"} + :output-path "codox" + :doc-paths [] ;; Disable including doc/ + :namespaces [lt.macros lt.object lt.objs.command lt.objs.editor + lt.objs.editor.pool lt.objs.files lt.objs.notifos] + ;; :source-uri version needs to be bumped per release until codox supports {version} + :source-uri "https://github.com/LightTable/LightTable/blob/0.8.0-alpha/{filepath}#L{line}" + :metadata {:doc "TODO: Add docstring"}} :source-paths ["src/"] ) diff --git a/src/lt/macros.clj b/src/lt/macros.clj index 2d165607d..46b00960f 100644 --- a/src/lt/macros.clj +++ b/src/lt/macros.clj @@ -36,7 +36,7 @@ (lt.util.dom/on e# ev# func#)) e#))) -(defmacro timed [ev & body] +(defmacro ^:private timed [ev & body] `(let [start# (lighttable.util.js/now) res# (do ~@body)] (lighttable.components.logger/log ~ev (- (lighttable.util.js/now) start#)) @@ -47,30 +47,30 @@ [(first body) (rest body)] [[] body])) -(defmacro on [name & body] +(defmacro ^:private on [name & body] `(lighttable.command/on ~name (fn ~@body))) -(defmacro in [ctx & body] +(defmacro ^:private in [ctx & body] (let [[params body] (->params body)] `(assoc ~ctx :in (fn ~params ~@body)))) -(defmacro out [ctx & body] +(defmacro ^:private out [ctx & body] (let [[params body] (->params body)] `(assoc ~ctx :out (fn ~params ~@body)))) -(defmacro defcontext [name & body] +(defmacro ^:private defcontext [name & body] `(let [ctx# {:name ~name}] (lighttable.context/add-context! (-> ctx# ~@body)))) -(defmacro extract [elem kvs & body] +(defmacro ^:private extract [elem kvs & body] (let [defs (vec (apply concat (for [[k v] (partition 2 kvs)] `[~k (lt.util.dom/$ ~v ~elem)])))] `(let ~defs ~@body))) -(defmacro foreach [xs & body] +(defmacro ^:private foreach [xs & body] `(let [xs# ~(second xs) len# (.-length xs#)] (loop [left# 0] @@ -79,7 +79,7 @@ ~@body (recur (inc left#))))))) -(defmacro with-time [& body] +(defmacro ^:private with-time [& body] (let [start (gensym "start") body (walk/postwalk-replace {'time (list '- '(.getTime (js/Date.)) start)} body)] `(let [~start (.getTime (js/Date.))] @@ -98,7 +98,7 @@ (.unshift args# (.-obj msg#)) (.apply ~func nil args#))))) -(defmacro aloop [[var arr] & body] +(defmacro ^:private aloop [[var arr] & body] `(let [arr# ~arr] (loop [~var 0] (when (< ~var (.-length arr#)) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 078f6558d..32e12b0eb 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -40,10 +40,10 @@ "Metadata of current behavior set during raise and raise-reduce" nil) -(defn add [obj] +(defn- add [obj] (swap! object-defs assoc (::type obj) obj)) -(defn add-behavior [beh] +(defn- add-behavior [beh] (swap! behaviors assoc (:name beh) beh)) (defn ->id [obj] @@ -51,22 +51,22 @@ (::id @obj) (::id obj))) -(defn ->behavior-name [beh] +(defn- ->behavior-name [beh] (if (coll? beh) (first beh) beh)) -(defn ->behavior [beh] +(defn- ->behavior [beh] (@behaviors (->behavior-name beh))) -(defn ->triggers [behs] +(defn- ->triggers [behs] (let [result (atom (transient {}))] (doseq [beh behs t (:triggers (->behavior beh))] (swap! result assoc! t (conj (or (get @result t) '[]) beh))) (persistent! @result))) -(defn specificity-sort +(defn- specificity-sort ([xs] (specificity-sort xs nil)) ([xs dir] (let [arr #js []] @@ -77,13 +77,13 @@ (aloop [i arr] (aset arr i (aget arr i 2))) arr))) -(defn ts->negations [ts] +(defn- ts->negations [ts] (let [seen (js-obj)] (doseq [beh (apply concat (map @negated-tags ts))] (aset seen (->behavior-name beh) true)) seen)) -(defn tags->behaviors [ts] +(defn- tags->behaviors [ts] (let [duped (apply concat (map @tags (specificity-sort ts))) de-duped (reduce (fn [res cur] @@ -102,10 +102,10 @@ duped)] (reverse (persistent! (:final de-duped))))) -(defn trigger->behaviors [trig ts] +(defn- trigger->behaviors [trig ts] (get (->triggers (tags->behaviors ts)) trig)) -(defn safe-report-error [e] +(defn- safe-report-error [e] (if js/lt.objs.console (js/lt.objs.console.error e) (.error js/console (if (string? e) @@ -114,7 +114,7 @@ (declare raise) -(defn raise* +(defn- raise* ([obj reactions args] (raise* obj reactions args nil)) ([obj reactions args trigger] (doseq [r reactions @@ -154,7 +154,7 @@ (assert behavior-fn) (apply behavior-fn args))) -(defn update-listeners +(defn- update-listeners ([obj] (update-listeners obj nil)) ([obj instants] (let [cur @obj @@ -174,12 +174,12 @@ ;;deref again in case :object.instant-load made any updates (assoc @obj :listeners trigs)))) -(defn make-object* [name & r] +(defn- make-object* [name & r] (let [obj (merge {:behaviors #{} :tags #{} :triggers [] :listeners {} ::type name :children {}} (apply hash-map r))] obj)) -(defn store-object* [obj] +(defn- store-object* [obj] (add obj) obj) @@ -195,7 +195,7 @@ (throw (js/Error. (str "Merge requires a map: " m)))) (swap! obj merge m)) -(defn handle-redef [odef] +(defn- handle-redef [odef] (let [id (::type odef)] (doseq [o (instances-by-type id) :let [o (deref o) @@ -233,26 +233,26 @@ (store-object*) (handle-redef))) -(defn make-behavior* [name & r] +(defn- make-behavior* [name & r] (let [be (merge {:name name} (apply hash-map r))] be)) -(defn store-behavior* [beh] +(defn- store-behavior* [beh] (add-behavior beh) (:name beh)) -(defn wrap-throttle [beh] +(defn- wrap-throttle [beh] (if-let [thr (:throttle beh)] (assoc beh :reaction (throttle thr (:reaction beh))) beh)) -(defn wrap-debounce [beh] +(defn- wrap-debounce [beh] (if-let [thr (:debounce beh)] (assoc beh :reaction (debounce thr (:reaction beh))) beh)) -(defn behavior* [name & r] +(defn- behavior* [name & r] (-> (apply make-behavior* name r) (wrap-throttle) (wrap-debounce) @@ -285,12 +285,12 @@ [obj & r] (swap! obj #(apply update-in % r))) -(defn assoc-in! [obj k v] +(defn- assoc-in! [obj k v] (when (and k (not (sequential? k))) (throw (js/Error. (str "Associate requires a sequence of keys: " k)))) (swap! obj #(assoc-in % k v))) -(defn ->inst [o] +(defn- ->inst [o] (cond (map? o) (@instances (->id o)) (deref? o) o @@ -312,7 +312,7 @@ (dom/remove (->content obj))) (reset! obj nil))) -(defn store-inst [inst] +(defn- store-inst [inst] (swap! instances assoc (::id @inst) inst) inst) @@ -349,20 +349,20 @@ (raise inst :init) inst)) -(defn refresh! [obj] +(defn- refresh! [obj] (reset! obj (update-listeners obj)) (raise* obj (trigger->behaviors :object.instant (:tags @obj)) nil) (raise obj :object.refresh)) -(defn add-behavior! [obj behavior] +(defn- add-behavior! [obj behavior] (update! obj [:behaviors] conj behavior) (reset! obj (update-listeners obj))) -(defn rem-behavior! [obj behavior] +(defn- rem-behavior! [obj behavior] (update! obj [:behaviors] #(remove #{behavior} %)) (reset! obj (update-listeners obj))) -(defn ->def [def|name] +(defn- ->def [def|name] (if (map? def|name) def|name (@object-defs def|name))) @@ -381,7 +381,7 @@ (ts tag)) (vals @instances)))) -(defn in-tag? [tag behavior] +(defn- in-tag? [tag behavior] (first (filter #{behavior} (@tags tag)))) (defn has-tag? [obj tag] @@ -416,7 +416,7 @@ (refresh! cur)) (@tags tag)) -(defn remove-tag-behaviors [tag behs] +(defn- remove-tag-behaviors [tag behs] (swap! tags update-in [tag] #(remove (set behs) (or % '()))) (doseq [cur (by-tag tag) b behs] diff --git a/src/lt/objs/command.cljs b/src/lt/objs/command.cljs index 7912ee340..10b2e5385 100644 --- a/src/lt/objs/command.cljs +++ b/src/lt/objs/command.cljs @@ -4,7 +4,7 @@ (declare manager) -(def required-keys #{:command :desc :exec}) +(def ^:private required-keys #{:command :desc :exec}) (defn command "Define a command given a map with the following keys: @@ -21,12 +21,12 @@ (object/add-tags (:options cmd) [:command.options])) (object/raise manager :added cmd)) -(defn by-id [k] +(defn- by-id [k] (-> @manager :commands (get (if (map? k) (:command k) k)))) -(defn completions [token] +(defn- completions [token] (if (and token (= (subs token 0 1) ":")) (map #(do #js {:completion (str (:command %)) :text (str (:command %))}) (vals (:commands @manager))) @@ -53,4 +53,4 @@ :tags #{:command.manager} :commands {}) -(def manager (object/create ::command.manager)) +(def ^:private manager (object/create ::command.manager)) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index d8e6d0bd4..9fdf58fc7 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -58,7 +58,7 @@ ;; commands ;;********************************************************* -(defn expand-tab [cm] +(defn- expand-tab [cm] (cond (.somethingSelected cm) (.indentSelection cm "add") (.getOption cm "indentWithTabs") (.replaceSelection cm "\t" "end" "+input") @@ -71,11 +71,11 @@ ;; Creating ;;********************************************************* -(defn headless [opts] +(defn- headless [opts] (-> (js/CodeMirror. (fn [])) (set-options opts))) -(defn make [context] +(defn- make [context] (let [e (headless {:mode (if (:mime context) (name (:mime context)) "plaintext") @@ -102,7 +102,7 @@ [ed ev func] (.off (->cm-ed ed) (name ev) func)) -(defn wrap-object-events [ed obj] +(defn- wrap-object-events [ed obj] (dom/on (->elem ed) :contextmenu #(object/raise obj :menu! %)) (on ed :dragstart #(.preventDefault %2)) (on ed :dragenter #(.preventDefault %2)) @@ -125,23 +125,23 @@ [e] (. (->cm-ed e) (getValue))) -(defn ->token [e pos] +(defn- ->token [e pos] (js->clj (.getTokenAt (->cm-ed e) (clj->js pos)) :keywordize-keys true)) -(defn ->token-js [e pos] +(defn- ->token-js [e pos] (.getTokenAt (->cm-ed e) (clj->js pos))) -(defn ->token-type [e pos] +(defn- ->token-type [e pos] (.getTokenTypeAt (->cm-ed e) (clj->js pos))) -(defn ->coords [e] +(defn- ->coords [e] (js->clj (.cursorCoords (->cm-ed e)) :keywordize-keys true :force-obj true)) -(defn +class [e klass] +(defn- +class [e klass] (add-class (->elem e) (name klass)) e) -(defn -class [e klass] +(defn- -class [e klass] (remove-class (->elem e) (name klass)) e) @@ -417,7 +417,7 @@ ([e loc] (.foldCode (->cm-ed e) (clj->js loc)))) -(defn gutter-widths [e] +(defn- gutter-widths [e] (let [gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e)) gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div) current-widths (reduce (fn [res gutter] @@ -426,7 +426,7 @@ ) {} gutter-divs)] current-widths)) -(defn update-gutters [e class-names class-widths] +(defn- update-gutters [e class-names class-widths] (let [gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e))] (operation e (fn[] (set-options e {:gutters (clj->js class-names)}) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index e1616ef96..a769c9cf4 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -15,7 +15,7 @@ [lt.util.dom :as dom]) (:require-macros [lt.macros :refer [behavior defui]])) -(defn get-all [] +(defn- get-all [] (object/by-tag :editor)) (behavior ::theme-changed @@ -58,20 +58,20 @@ (let [path (string/lower-case path)] (filter #(> (.indexOf (-> @% :info :path (or "") string/lower-case) path) -1) (object/by-tag :editor)))) -(defui button [label & [cb]] +(defui ^:private button [label & [cb]] [:div.button.right label] :click (fn [] (when cb (cb)))) -(defn unsaved-prompt [on-yes] +(defn- unsaved-prompt [on-yes] (popup/popup! {:header "You will lose changes." :body "If you close now, you'll lose any unsaved changes. Are you sure you want to do that?" :buttons [{:label "Discard changes" :action on-yes} popup/cancel-button]})) -(def pool (object/create ::pool)) +(def ^:private pool (object/create ::pool)) (defn last-active "Return current editor object (last active in pool)" @@ -80,7 +80,7 @@ (when (and l @l) l))) -(defn focus-last [] +(defn- focus-last [] (when-let [ed (last-active)] (when-let [ed (:ed @ed)] (dom/focus js/document.body) @@ -117,18 +117,18 @@ :reaction (fn [this] (focus-last))) -(defn make-transient-dirty [ed] +(defn- make-transient-dirty [ed] (object/merge! ed {:dirty true}) (object/update! ed [:info] assoc :path nil) (object/remove-tags ed [:editor.file-backed]) (object/add-tags ed [:editor.transient])) -(defn active-warn [ed popup] +(defn- active-warn [ed popup] (if-not (= (last-active) ed) (object/merge! ed {:active-warn popup}) (popup/popup! popup))) -(defn reload [ed] +(defn- reload [ed] (editor/set-val ed (:content (files/open-sync (-> @ed :info :path)))) (doc/update-stats (-> @ed :info :path)) (object/merge! ed {:dirty false})) @@ -156,7 +156,7 @@ ]}) (reload ed))))))) -(defn warn-delete [ed f] +(defn- warn-delete [ed f] (active-warn ed {:header (str "File deleted: " f) :body "This file seems to have been deleted and we've marked it as unsaved." :buttons [{:label "Save as.." @@ -164,7 +164,7 @@ (object/raise ed :save))} {:label "ok"}]})) -(defn set-syntax [ed new-syn] +(defn- set-syntax [ed new-syn] (let [prev-info (-> @ed :info)] (when prev-info (object/remove-tags ed (:tags prev-info))) @@ -172,7 +172,7 @@ (editor/set-mode ed (:mime new-syn)) (object/add-tags ed (:tags new-syn)))) -(defn set-syntax-by-path [ed path] +(defn- set-syntax-by-path [ed path] (set-syntax ed (files/path->type path))) (behavior ::watched.delete @@ -225,10 +225,10 @@ (focus-last))}) -(def syntax-selector (cmd/filter-list {:items (fn [] - (sort-by :name (-> @files/files-obj :types vals))) - :key :name - :placeholder "Syntax"})) +(def ^:private syntax-selector (cmd/filter-list {:items (fn [] + (sort-by :name (-> @files/files-obj :types vals))) + :key :name + :placeholder "Syntax"})) (behavior ::set-syntax :triggers #{:select} @@ -265,7 +265,7 @@ :reaction (fn [this options] (object/merge! this {::comment-options options}))) -(defn do-commenting [commenting-fn] +(defn- do-commenting [commenting-fn] (when-let [cur (last-active)] (let [from (editor/->cursor cur "start") to (if (editor/selection? cur) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index b4255f51e..5d27a2b6c 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -1,5 +1,5 @@ (ns lt.objs.files - "Provider fns for doing file related operations. A number of fns + "Provide fns for doing file related operations. A number of fns use the node fs library - https://nodejs.org/api/fs.html" (:refer-clojure :exclude [open exists?]) (:require [lt.object :as object] @@ -9,14 +9,14 @@ [lt.util.js :refer [now]]) (:require-macros [lt.macros :refer [behavior]])) -(def fs (js/require "fs")) -(def fpath (js/require "path")) -(def wrench (load/node-module "wrench")) -(def shell (js/require "shell")) -(def os (js/require "os")) -(def data-path (platform/get-data-path)) +(def ^:private fs (js/require "fs")) +(def ^:private fpath (js/require "path")) +(def ^:private wrench (load/node-module "wrench")) +(def ^:private shell (js/require "shell")) +(def ^:private os (js/require "os")) +(def ^:private data-path (platform/get-data-path)) -(defn typelist->index [cur types] +(defn- typelist->index [cur types] (let [full (map (juxt :name identity) types) ext (for [cur types ext (:exts cur)] @@ -24,7 +24,7 @@ {:types (into (:types cur {}) full) :exts (into (:exts cur {}) ext)})) -(defn join [& segs] +(defn- join [& segs] (apply (.-join fpath) (filter string? (map str segs)))) (def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") @@ -51,14 +51,14 @@ (set! ignore-pattern (js/RegExp. pattern)))) -(def files-obj (object/create (object/object* ::files - :tags [:files] - :exts {} - :types {}))) +(def ^:private files-obj (object/create (object/object* ::files + :tags [:files] + :exts {} + :types {}))) (def line-ending (.-EOL os)) (def separator (.-sep fpath)) -(def available-drives #{}) +(def ^:private available-drives #{}) (def cwd "Directory process is started in" (js/process.cwd)) (when (= separator "\\") @@ -78,7 +78,7 @@ available-drives #{"/"})) -(defn get-file-parts [path] +(defn- get-file-parts [path] (let [filename (basename path) file-parts (string/split filename #"\.")] (loop [parts file-parts @@ -96,7 +96,7 @@ (subs path 0 i) path))) -(defn ext->type [ext] +(defn- ext->type [ext] (let [exts (:exts @files-obj) types (:types @files-obj)] (-> exts (get ext) types))) @@ -118,7 +118,7 @@ (remove nil?) first)) -(defn determine-line-ending [text] +(defn- determine-line-ending [text] (let [text (subs text 0 1000) rn (re-seq #"\r\n" text) n (re-seq #"[^\r]\n" text)] @@ -162,12 +162,12 @@ (defn real-path [c] (.realpathSync fs c)) -(defn ->file|dir [path f] +(defn- ->file|dir [path f] (if (dir? (str path separator f)) (str f separator) (str f))) -(defn bomless-read [path] +(defn- bomless-read [path] (let [content (.readFileSync fs path "utf-8")] (string/replace content "\uFEFF" ""))) @@ -283,7 +283,7 @@ [path] (.dirname fpath path)) -(defn next-available-name [path] +(defn- next-available-name [path] (if-not (exists? path) path (let [ext (ext path) @@ -384,13 +384,13 @@ (defn relative [a b] (.relative fpath a b)) -(defn ->name|path [f & [rel]] +(defn- ->name|path [f & [rel]] (let [path (if rel (relative rel f) f)] [(.basename fpath f) path])) -(defn path-segs [path] +(defn- path-segs [path] (let [segs (.split path separator) segs (if (or (.extname fpath (last segs)) (empty? (last segs))) diff --git a/src/lt/objs/notifos.cljs b/src/lt/objs/notifos.cljs index 9ebd0a829..2eea2830a 100644 --- a/src/lt/objs/notifos.cljs +++ b/src/lt/objs/notifos.cljs @@ -7,15 +7,15 @@ [crate.binding :refer [map-bound bound deref?]]) (:require-macros [lt.macros :refer [behavior defui]])) -(def standard-timeout 10000) +(def ^:private standard-timeout 10000) -(defn msg* [m & [opts]] +(defn- msg* [m & [opts]] (let [m (if (string? m) m (pr-str m))] (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts)))) -(declare cur-timeout) +(def ^:private cur-timeout) (defn set-msg! "Display message in bottom statusbar. Takes map of options with following keys: From d1cd4b908fd7cd49261d66468e38e4e3b88b507c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 6 Dec 2015 11:45:10 -0500 Subject: [PATCH 533/656] Add more docstrings for some public fns --- src/lt/object.cljs | 18 ++++++++++++++---- src/lt/objs/editor/pool.cljs | 8 ++++++-- src/lt/objs/files.cljs | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 32e12b0eb..b02d0c486 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -46,7 +46,9 @@ (defn- add-behavior [beh] (swap! behaviors assoc (:name beh) beh)) -(defn ->id [obj] +(defn ->id + "Return id of given object" + [obj] (if (deref? obj) (::id @obj) (::id obj))) @@ -384,17 +386,25 @@ (defn- in-tag? [tag behavior] (first (filter #{behavior} (@tags tag)))) -(defn has-tag? [obj tag] +(defn has-tag? + "Return truthy if object has tag" + [obj tag] ((:tags @obj) tag)) -(defn add-tags [obj ts] +(defn add-tags + "Add tags to given object and updates effected behaviors and listeners. + ::tags-added trigger is raised on object after update" + [obj ts] (update! obj [:tags] #(reduce conj % (filter identity ts))) (reset! obj (update-listeners obj)) (raise obj ::tags-added ts) (raise* obj (trigger->behaviors :object.instant ts) nil) obj) -(defn remove-tags [obj ts] +(defn remove-tags + "Remove tags from given object and updates effected behaviors and listeners. + ::tags-removed trigger is raised on object after update" + [obj ts] (let [cur @obj behs (apply concat (map @tags ts)) cur (-> cur diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index a769c9cf4..98069a600 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -42,7 +42,9 @@ (object/object* ::pool :tags #{:editor.pool}) -(defn unsaved? [] +(defn unsaved? + "Return truthy if any editors are currently dirty/unsaved?" + [] (some #(:dirty (deref %)) (object/by-tag :editor))) (defn by-path @@ -210,7 +212,9 @@ (doc/move-doc old neue-path) ))))) -(defn create [info] +(defn create + "Create a :lt.objs.editor/editor object with given info map and add it to current pool" + [info] (let [ed (object/create :lt.objs.editor/editor info)] (object/add-tags ed (:tags info [])) (object/merge! ed {:editor.generation (editor/->generation ed)}) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 5d27a2b6c..8a9be5566 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -56,8 +56,8 @@ :exts {} :types {}))) -(def line-ending (.-EOL os)) -(def separator (.-sep fpath)) +(def line-ending "Current platform-specific line" (.-EOL os)) +(def separator "Current platform-specific file separator" (.-sep fpath)) (def ^:private available-drives #{}) (def cwd "Directory process is started in" (js/process.cwd)) From d8c34668ec1bc1dd80757e1584eddb48a07225e4 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 6 Dec 2015 11:52:42 -0500 Subject: [PATCH 534/656] Update description to match readme since it appears in api docs --- project.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 8c8b9f87f..f299c699f 100644 --- a/project.clj +++ b/project.clj @@ -1,5 +1,5 @@ (defproject lighttable "0.8.0-alpha" - :description "Light Table is a new interactive IDE that lets you modify running programs and embed anything from websites to games. It provides the real time feedback we need to not only answer questions about our code, but to understand how our programs really work." + :description "Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything a Chromium browser can." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] [crate "0.2.5"] @@ -28,6 +28,7 @@ lt.objs.editor.pool lt.objs.files lt.objs.notifos] ;; :source-uri version needs to be bumped per release until codox supports {version} :source-uri "https://github.com/LightTable/LightTable/blob/0.8.0-alpha/{filepath}#L{line}" + ;; Be explicit that undocumented public fns should be documented :metadata {:doc "TODO: Add docstring"}} :source-paths ["src/"] ) From cec152559961d893f54726a08168e9b2db9b6f3e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 6 Dec 2015 12:13:29 -0500 Subject: [PATCH 535/656] Add script and documentation for publishing api docs --- README.md | 2 ++ doc/for-committers.md | 11 +++++++++++ project.clj | 1 + script/build-api-docs.sh | 16 ++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100755 script/build-api-docs.sh diff --git a/README.md b/README.md index c4b3312ae..046c05bb1 100755 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Prebuilt binaries are available through [lighttable.com](http://lighttable.com). * See the [community wiki](https://github.com/LightTable/LightTable/wiki) which includes a [User FAQ](https://github.com/LightTable/LightTable/wiki/FAQ) and a [For Users page](https://github.com/LightTable/LightTable/wiki/For-Users) for additional links. * For a typical Light Table workflow, [read this](doc/workflow.md). * To understand how Light Table works, read about its [BOT architecture](doc/BOT.md). +* See [Light Table's API docs](http://lighttable.github.io/LightTable/api/index.html) to see what + plugin authors have access to. * If you're a user coming from vim or emacs see the [For Vim Users](https://github.com/LightTable/LightTable/wiki/For-Vim-Users) and [For Emacs Users](https://github.com/LightTable/LightTable/wiki/For-Emacs-Users) guides. ## Plugins diff --git a/doc/for-committers.md b/doc/for-committers.md index a8197666c..7573c3ddd 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -62,3 +62,14 @@ This is our release checklist which can be dropped in to an issue: - [ ] Update download links on lighttable.com - [ ] Mailing list announcement - [example email](https://gist.github.com/cldwalker/3d67153fe1eade2ae3cf) - [ ] Optional blog post if a major release + - [ ] After release, [build api documentation](#build-api-documentation) + +## Build api documentation + +To build api documentation for current LT version and publish generated docs: + +1. In project.clj make sure that `[:codox :source-uri]` points to current LT version. + This step will be removed once [there is upstream support for version in :source-uri](https://github.com/weavejester/codox/issues/107) +2. Run `script/build-api-docs.sh` on a clean git state. Make sure there are no pending git changes as this script will change git branches and push generated api docs to gh-pages. + +Expect to see a ton of warnings e.g. `WARNING: Use of undeclared Var cljs.core/seq at line 197`. This will be noise we have to live with until we upgrade ClojureScript. diff --git a/project.clj b/project.clj index f299c699f..f1962237a 100644 --- a/project.clj +++ b/project.clj @@ -15,6 +15,7 @@ :output-to "deploy/core/node_modules/lighttable/bootstrap.js" :output-dir "deploy/core/node_modules/lighttable/cljs/" :pretty-print true}}]} + ;; TODO: Remove separate :doc :dependencies after ClojureScript upgrade :profiles {:doc {:dependencies [[org.clojure/clojure "1.7.0"] [org.clojure/clojurescript "1.7.145" :exclusions [org.apache.ant/ant]]]}} diff --git a/script/build-api-docs.sh b/script/build-api-docs.sh new file mode 100755 index 000000000..db85a7be6 --- /dev/null +++ b/script/build-api-docs.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +# Build codox api docs and publish it on gh-pages branch + +lein with-profile doc codox + +git checkout gh-pages + +rm -rf api/ +mv codox api + +git add api +git commit -m "Build api docs using script/build-api-docs.sh" +git push origin gh-pages:gh-pages +git checkout - From 31c88398e30fadfde5cff14f15596056fd813e7b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 6 Dec 2015 15:26:44 -0500 Subject: [PATCH 536/656] Update public API per review * Expose object and editor fns that are used by plugins * Hide the BOT heart. Tis beautiful but not as a public interface --- src/lt/object.cljs | 24 +++++++++++++++--------- src/lt/objs/editor.cljs | 4 ++-- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index b02d0c486..e96dacff9 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -12,27 +12,27 @@ (:require-macros [lt.macros :refer [behavior with-time aloop]])) ;; HEART of BOT Architecture! -(def obj-id +(def ^:private obj-id "Counter to guarantee unique object ids" (atom 0)) -(def instances +(def ^:private instances "Map of object ids to objects created by object/create" (atom (sorted-map))) -(def behaviors +(def ^:private behaviors "Map of behavior names to behaviors created by macros/behavior" (atom {})) -(def object-defs +(def ^:private object-defs "Map of object template keys to template maps created by object/object*" (atom {})) -(def tags +(def ^:private tags "Map of tags to associated lists of behaviors" (atom {})) -(def negated-tags +(def ^:private negated-tags "Map of tags to dissociated lists of behaviors e.g. :-behavior" (atom {})) @@ -287,7 +287,9 @@ [obj & r] (swap! obj #(apply update-in % r))) -(defn- assoc-in! [obj k v] +(defn assoc-in! + "Update object with assoc-in for given key and value" + [obj k v] (when (and k (not (sequential? k))) (throw (js/Error. (str "Associate requires a sequence of keys: " k)))) (swap! obj #(assoc-in % k v))) @@ -356,11 +358,15 @@ (raise* obj (trigger->behaviors :object.instant (:tags @obj)) nil) (raise obj :object.refresh)) -(defn- add-behavior! [obj behavior] +(defn add-behavior! + "Add behavior to object and update its listeners" + [obj behavior] (update! obj [:behaviors] conj behavior) (reset! obj (update-listeners obj))) -(defn- rem-behavior! [obj behavior] +(defn rem-behavior! + "Remove behavior from object and update its listeners" + [obj behavior] (update! obj [:behaviors] #(remove #{behavior} %)) (reset! obj (update-listeners obj))) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 9fdf58fc7..63311f132 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -125,13 +125,13 @@ [e] (. (->cm-ed e) (getValue))) -(defn- ->token [e pos] +(defn ->token [e pos] (js->clj (.getTokenAt (->cm-ed e) (clj->js pos)) :keywordize-keys true)) (defn- ->token-js [e pos] (.getTokenAt (->cm-ed e) (clj->js pos))) -(defn- ->token-type [e pos] +(defn ->token-type [e pos] (.getTokenTypeAt (->cm-ed e) (clj->js pos))) (defn- ->coords [e] From b9983a951adf194ec0fb57dfd4658bd11d9332f5 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Sun, 6 Dec 2015 16:26:13 -0500 Subject: [PATCH 537/656] Bump LT version to 0.8.0. --- deploy/core/package.json | 2 +- deploy/core/version.json | 2 +- project.clj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/core/package.json b/deploy/core/package.json index db3f5122c..aac8b795c 100644 --- a/deploy/core/package.json +++ b/deploy/core/package.json @@ -1,7 +1,7 @@ { "name": "LightTable", "description": "LightTable Electron App", - "version": "0.8.0-alpha", + "version": "0.8.0", "main": "main.js", "browserWindowOptions": { "icon": "img/lticon.png", diff --git a/deploy/core/version.json b/deploy/core/version.json index e2f614ba3..aba95ce55 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.8.0-alpha","electron":"0.34.5"} +{"version":"0.8.0","electron":"0.34.5"} diff --git a/project.clj b/project.clj index f1962237a..a3d1de3c3 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject lighttable "0.8.0-alpha" +(defproject lighttable "0.8.0" :description "Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything a Chromium browser can." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] From 2e029b516b799956f578daa6cb7a5ba8ad32597c Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Sun, 6 Dec 2015 16:41:49 -0500 Subject: [PATCH 538/656] Update HTML plugin to version to 0.1.0. --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build.sh b/script/build.sh index 37d4c449f..8db2978b0 100755 --- a/script/build.sh +++ b/script/build.sh @@ -19,7 +19,7 @@ npm --version >/dev/null 2>&1 || { echo >&2 "Please install npm before running t # Ensure we start in project root cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. -# Ensure we have current version of electron +# Ensure we have current version of electron pushd deploy/electron npm install node_modules/.bin/grunt download-electron @@ -34,7 +34,7 @@ fi lein cljsbuild clean && lein cljsbuild once # Fetch plugins -PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.0.2" "Javascript,0.1.3" +PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.1.3" "Paredit,0.0.4" "Python,0.0.7" "Rainbow,0.0.8") # Plugins cache From f2b009aab0a1b2b22a45995627dc31e6a3845f6f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 8 Dec 2015 00:49:38 -0500 Subject: [PATCH 539/656] Add changelog for 0.8.0 --- deploy/core/changelog.md | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 80b99ced3..41978f1eb 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,46 @@ #Changes +## 0.8.0 + +* CHANGED: We have switched to Electron from NW.js +* CHANGED: LT's releases and self-updating processes are completely in the open on Github +* CHANGED: We no longer ship with a node binary as we're able to use Electon's node binary for background processes +* CHANGED: Proxy support has been disabled. There is an issue for re-enabling it at https://github.com/LightTable/LightTable/issues/1984. We are looking for help on how to QA this. +* CHANGED: `:lt.objs.app/set-default-zoom-level` behavior takes a value from 0 to 1. With NW.js, it could take negative numbers which no longer work and will _freeze_ LT on startup +* CHANGED: When opening a file from the commandline, each invocation opens a new LightTable app regardless of whether LightTable is already open. To optionally bring back the old behavior, see https://github.com/LightTable/LightTable/issues/2014. +* CHANGED: Provide constant port number 5678 for external browser connection +* CHANGED: Beginner friendly explanations to user.keymap and user.behaviors +* CHANGED: 32-bit linux is no longer an official download. Building from source will still be supported +* FIX: Major usability issues on >= OSX 10.10 +* FIX: Bug in :editor.force.wrap command +* FIX: Invalid behaviors warning when installing plugin +* FIX: Uninstalling plugin causes misleading missing dialog to popup +* FIX: Installing plugins, loads new behaviors immediately +* FIX: Open files from commandline that have whitespace +* FIX: Styling for folding +* FIX: Creating files under folders with '.' in name +* FIX: Quote and link styling for default theme +* FIX: Fat cursor not showing up when searching in default theme +* FIX: Uncomment command respects line-comment-options behavior +* FIX: Opening file from OSX file manager opens correct file +* FIX: Width of inputs for renaming files in workspace tree +* FIX: Detect latest plugin versions in plugin manager +* ADDED: LT can be built from source with provided scripts across supported platforms +* ADDED: Improved documentation - most core fns have docstrings, all namespaces have docstrings, [API docs](http://lighttable.github.io/LightTable/api/) and [developer docs](https://github.com/LightTable/LightTable/tree/master/doc) +* ADDED: Most of LT's node libraries are installed as npm dependencies instead of as forked libraries +* ADDED: Vector format support for workspace behaviors +* ADDED: Open to line number from commandline e.g. `light FILE:LINE ` +* ADDED: commandline comes with improved --help +* ADDED: `:lt.objs.editor/load-addon` behavior loads CodeMirror addons that [ship with LT](https://github.com/LightTable/LightTable/tree/master/deploy/core/node_modules/codemirror/addon) +* ADDED: `:lt.objs.editor/set-rulers` behavior to set CodeMirror rulers - [screenshot](https://www.dropbox.com/s/ipq7c21w1dkwmg3/Screenshot%202015-01-24%2011.50.25.png?dl=0) +* ADDED: Add file-type definitions for .feature, .rst and [many more](https://github.com/LightTable/LightTable/commit/a12dc47d78825897b9a7bdcfafa72525eb4949f7) +* ADDED: Add F-11 keybinding for fullscreen +* ADDED: Add pmeta-/ for toggle-comment +* ADDED: Better error handling for download errors +* ADDED: Block comment command +* ADDED: Max length for autocompletion is configurable +* ADDED: Plugins and settings menu items + ##0.7.2 * FIX: Behavior ordering issue that caused plugin weirdness and menus disappearing (ibdknox) From 4f21bfbd3eaebc442828a7f173a11c9eafb2ddae Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 8 Dec 2015 01:05:17 -0500 Subject: [PATCH 540/656] Doc urls will need to point to 0.8.0 --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index a3d1de3c3..616b90c1c 100644 --- a/project.clj +++ b/project.clj @@ -28,7 +28,7 @@ :namespaces [lt.macros lt.object lt.objs.command lt.objs.editor lt.objs.editor.pool lt.objs.files lt.objs.notifos] ;; :source-uri version needs to be bumped per release until codox supports {version} - :source-uri "https://github.com/LightTable/LightTable/blob/0.8.0-alpha/{filepath}#L{line}" + :source-uri "https://github.com/LightTable/LightTable/blob/0.8.0/{filepath}#L{line}" ;; Be explicit that undocumented public fns should be documented :metadata {:doc "TODO: Add docstring"}} :source-paths ["src/"] From 813528048863ad8146f7d731850d4421f0912860 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 8 Dec 2015 01:15:01 -0500 Subject: [PATCH 541/656] Add changelog task to avoid forgetting next time --- doc/for-committers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index 5d00a1f01..8c9a1b885 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -54,6 +54,7 @@ This is our release checklist which can be dropped in to an issue: - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj to 0.X.X - [ ] Make sure electron version is up to date in version.json - [ ] Make sure plugin versions in script/build-app.sh are latest versions + - [ ] Add changelog for release to CHANGELOG.md - [ ] Each core developer should QA at least one OS using the [QA checklist](https://github.com/LightTable/LightTable/wiki/QA-Checklist) - [ ] When QA passes freeze master - [ ] Add changelog to [GH release draft](https://github.com/LightTable/LightTable/releases/new) From 975862f4c17ff72b034a809b8fb5a72af153e752 Mon Sep 17 00:00:00 2001 From: kenny-evitt Date: Tue, 8 Dec 2015 06:40:06 -0500 Subject: [PATCH 542/656] Mention updating Codox `:source-uri` when bumping version --- doc/for-committers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index 8c9a1b885..e2f108cd8 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -51,7 +51,7 @@ This is our release checklist which can be dropped in to an issue: - [ ] Release 0.X.X - [ ] Version updates - - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj to 0.X.X + - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj (including the Codox `:source-uri` value) to 0.X.X - [ ] Make sure electron version is up to date in version.json - [ ] Make sure plugin versions in script/build-app.sh are latest versions - [ ] Add changelog for release to CHANGELOG.md From 7ccd9d07b60727e435e7edb22b5c836d3913b3ba Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Thu, 10 Dec 2015 17:48:17 -0500 Subject: [PATCH 543/656] Add a step to the release checklist to generate MD5 checksums for the uploaded binary package files for each platform. --- doc/for-committers.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index e2f108cd8..b498f1b07 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -59,6 +59,9 @@ This is our release checklist which can be dropped in to an issue: - [ ] When QA passes freeze master - [ ] Add changelog to [GH release draft](https://github.com/LightTable/LightTable/releases/new) - [ ] Upload binaries from `script/build.sh --release` to draft. Don't forget to click *Save draft*! + - [ ] Generate an MD5 checksum for the binary package: + - [ ] Run `certUtil -hashfile lighttable-x.y.z-windows.zip MD5` on Windows. + - [ ] Run `openssl md5 lighttable-x.y.z-mac.tar.gz` on Mac OS X or Linux. - [ ] Publish GH release which creates git tag and notifies users about new release - [ ] Update download links on lighttable.com - [ ] Mailing list announcement - [example email](https://gist.github.com/cldwalker/3d67153fe1eade2ae3cf) From 7fc63e6c141c77c282f4dbbe299c0b8b42ed8065 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 10 Dec 2015 18:13:52 -0500 Subject: [PATCH 544/656] Add install instructions for OSX --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 046c05bb1..a14b96002 100755 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ Light Table is a next generation code editor that connects you to your creation Prebuilt binaries are available through [lighttable.com](http://lighttable.com). To build and use a developer version of Light Table [see these instructions](doc/developer-install.md). +For OSX users, the install process involves the following steps until we officially sign our OSX App: + +* In Finder, Ctrl-click on LightTable.app/ and select Open. +* When you see [this prompt](https://cloud.githubusercontent.com/assets/11994/11731454/85181e90-9f69-11e5-9c65-f6aa4228005c.png) about LightTable being unidentified, click Open. +* If Ctrl-click doesn't work for you, open System Preferences > Security & Privacy > General, temporarily change "Allow apps downloaded from:" to Anywhere and double click on LightTable.app. + ## Documentation * See [docs.lighttable.com](http://docs.lighttable.com/) for official user documentation and tutorials. From b073de1ef794730481f64a46490946c416ce893e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 10 Dec 2015 19:26:17 -0500 Subject: [PATCH 545/656] Core team should be getting notifications --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0221b2eb4..fac1fc103 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,5 @@ notifications: irc: "chat.freenode.net#lighttable" email: - gabriel.horner@gmail.com - - ibdknox@gmail.com - - mike.j.innes@gmail.com - - joshuafcole@gmail.com - - jamie@scattered-thoughts.net + - kenny.evitt@gmail.com + - mrundberget@hotmail.com From 036335004ff1015ce06214bed45351a1cdf6a24a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 12 Dec 2015 11:31:53 -0500 Subject: [PATCH 546/656] Handle or remove silent caught exceptions Removed two catches on behaviors because behaviors already have a catch around them in object/raise* --- src/lt/objs/clients/tcp.cljs | 9 ++++----- src/lt/objs/clients/ws.cljs | 4 +--- src/lt/objs/eval.cljs | 2 +- src/lt/objs/files.cljs | 5 +++-- src/lt/objs/workspace.cljs | 3 ++- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/lt/objs/clients/tcp.cljs b/src/lt/objs/clients/tcp.cljs index 1d0b6f027..6ea1cf63b 100644 --- a/src/lt/objs/clients/tcp.cljs +++ b/src/lt/objs/clients/tcp.cljs @@ -71,8 +71,9 @@ (.listen s 0) (.on s "listening" #(set! port (.-port (.address s)))) s) - ;;TODO: warn the user that they're not connected to anything - (catch :default e))) + (catch :default e + (console/error "Error starting tcp server") + (console/error e)))) (behavior ::send! :triggers #{:send!} @@ -83,7 +84,5 @@ (behavior ::kill-on-closed :triggers #{:closed} :reaction (fn [app] - (try - (.close server) - (catch :default e)))) + (.close server))) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index 98ea08632..ec107d519 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -74,6 +74,4 @@ (behavior ::kill-on-closed :triggers #{:closed} :reaction (fn [app] - (try - (.close server) - (catch :default e)))) + (.close server))) diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index bcca7c0a2..292115958 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -113,7 +113,7 @@ (try (reader/read-string r) (catch :default e - r))) + (console/error e)))) (defn find-client [{:keys [origin command info key create] :as opts}] (let [[result client] (clients/discover command info) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 482386428..44ce73fb6 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -304,7 +304,7 @@ (:dirs opts) (filter #(dir? (join path %)) fs) :else fs)) (catch :default e - nil))) + (js/lt.objs.console.error e)))) (defn full-path-ls "Return directory's files as full paths" @@ -319,7 +319,8 @@ [path] (try (filter dir? (map (partial join path) (.readdirSync fs path))) - (catch :default e))) + (catch :default e + (js/lt.objs.console.error e)))) (defn home "Return users' home directory (e.g. ~/) or path under it" diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index b6099faeb..c0eb3d13d 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -6,6 +6,7 @@ [lt.objs.command :as cmd] [lt.objs.cache :as cache] [lt.objs.notifos :as notifos] + [lt.objs.console :as console] [cljs.reader :as reader] [lt.util.load :as load] [lt.util.js :refer [now]] @@ -181,7 +182,7 @@ (save ws (:file @ws)) (files/delete! loc) (catch :default e - )))) + (console/error e))))) (defn cached [] (filter #(> (.indexOf % ".clj") -1) (files/full-path-ls workspace-cache-path))) From dffe186953b6be27b7ba1ee402d8bc0a94f6626f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 12 Dec 2015 16:21:26 -0500 Subject: [PATCH 547/656] Add error handling if opening a file fails Used unused :files.open.error trigger to fix silent failures when opening files. Also fixed open-sync :files.open.error raise which wasn't passing the exception --- deploy/settings/default/default.behaviors | 1 + src/lt/objs/files.cljs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 8bc5e7d21..02eed45c8 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -266,6 +266,7 @@ [:evaler :lt.objs.eval/alert-on-no-client] + [:files :lt.objs.files/open-failed] [:files :lt.objs.opener/save-failed] [:files :lt.objs.files/file-types [{:exts [:apl :dyalog], :mime "text/apl", :tags [:editor.apl], :name "APL"} ;; No extension since .conf is an overloaded extension diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 44ce73fb6..589085953 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -50,6 +50,11 @@ :reaction (fn [this pattern] (set! ignore-pattern (js/RegExp. pattern)))) +(behavior ::open-failed + :triggers #{:files.open.error} + :reaction (fn [this path e] + ;; Do not log stacktrace because it would be too much noise if multiple file openings fail + (js/lt.objs.console.error (str "Failed to open path '" path "' with error: " e)))) (def files-obj (object/create (object/object* ::files :tags [:files] @@ -176,7 +181,6 @@ [path cb] (try (let [content (bomless-read path)] - ;;TODO: error handling (when content (let [e (ext path)] (cb {:content content @@ -193,7 +197,6 @@ [path] (try (let [content (bomless-read path)] - ;;TODO: error handling (when content (let [e (ext path)] (object/raise files-obj :files.open content) @@ -202,7 +205,7 @@ :type (or (ext->mode (keyword e)) e)})) ) (catch :default e - (object/raise files-obj :files.open.error path) + (object/raise files-obj :files.open.error path e) nil))) (defn save From 4af09ec65a5ba2407e5739d828dcf0d057a266cb Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 13 Dec 2015 11:56:18 -0500 Subject: [PATCH 548/656] Make error handling consistent with console/error @Bost pointed out a number of inconsistencies. Also started a code convention section to capture this convention. Note that catch handling was removed in on-drop behavior because behaviors are already wrapped in a catch block --- doc/for-committers.md | 7 +++++++ src/lt/object.cljs | 2 ++ src/lt/objs/clients/ws.cljs | 3 ++- src/lt/objs/menu.cljs | 2 +- src/lt/objs/opener.cljs | 5 +++-- src/lt/objs/plugins.cljs | 4 ++-- src/lt/objs/settings.cljs | 2 +- src/lt/objs/sidebar/workspace.cljs | 23 ++++++++++------------- 8 files changed, 28 insertions(+), 20 deletions(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index a8197666c..4c9e89d71 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -37,6 +37,13 @@ Allows us to build cross platfrom desktop apps. See [Electron guide](electron-gu ## Other +### Code Conventions + +* Catch blocks should catch on `:default` unless there is a specific exception to be caught. +* Catch blocks should log errors with `lt.objs.console/error`. Namespaces that the console + ns depend on cannot refer to the clojure var but can refer to the js fn e.g. + `(js/lt.objs.console.error err)`. + ### Code Reading When reading LT's source you may come across a fn that doesn't have an obvious use and may appear to diff --git a/src/lt/object.cljs b/src/lt/object.cljs index bf1187f33..bc049be11 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -106,6 +106,8 @@ (get (->triggers (tags->behaviors ts)) trig)) (defn safe-report-error [e] + ;; This check is necessary because this can be called before + ;; the console ns has been loaded (if js/lt.objs.console (js/lt.objs.console.error e) (.error js/console (if (string? e) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index ec107d519..271d2ed22 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -69,7 +69,8 @@ (.on (.-sockets ws) "connection" on-connect) ws) (catch :default e - (.log js/console "Error starting socket.io server" e)))) + (console/error "Error starting socket.io server") + (console/error e)))) (behavior ::kill-on-closed :triggers #{:closed} diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 1e6d3e773..55206cb6c 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -25,7 +25,7 @@ (when-let [func (:click opts)] (func)) (catch :default e - (.error js/console e))))) + (js/lt.objs.console.error e))))) opts)] (MenuItem. (clj->js opts)))) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 0b2a2a255..5278ed933 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -12,6 +12,7 @@ [lt.objs.popup :as popup] [lt.objs.tabs :as tabs] [lt.objs.app :as app] + [lt.objs.console :as console] [lt.objs.notifos :as notifos] [lt.objs.files :as files] [lt.util.dom :as dom] @@ -265,5 +266,5 @@ (aget i) (.-path))) (recur (inc i))))) - (catch :default e - (println e))))) + (catch :default err + (console/error err))))) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 26cd6184d..066dc5f95 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -783,8 +783,8 @@ (load/js path true) (object/update! this [::loaded-files] #(conj (or % #{}) path)) (catch :default e - (.error js/console (str "Error loading JS file: " path " : " e)) - (.error js/console (.-stack e))))))))))) + (console/error (str "Error loading JS file: " path " : " e)) + (console/error e)))))))))) (behavior ::load-css :triggers #{:object.instant} diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 7424626b8..20ee05607 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -161,7 +161,7 @@ (try (object/refresh! (first objs)) (catch :default e - (.error js/console e))) + (console/error e))) (js/process.nextTick (fn [] (refresh-all (next objs))))))) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index eebbff8fd..98176ae98 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -158,19 +158,16 @@ (behavior ::on-drop :triggers #{:drop} :reaction (fn [this e] - (try - (let [size (.-dataTransfer.files.length e)] - (loop [i 0] - (when (< i size) - (let [path (-> (.-dataTransfer.files e) - (aget i) - (.-path))] - (if (files/dir? path) - (object/raise workspace/current-ws :add.folder! path) - (object/raise workspace/current-ws :add.file! path))) - (recur (inc i))))) - (catch :default e - (println e))))) + (let [size (.-dataTransfer.files.length e)] + (loop [i 0] + (when (< i size) + (let [path (-> (.-dataTransfer.files e) + (aget i) + (.-path))] + (if (files/dir? path) + (object/raise workspace/current-ws :add.folder! path) + (object/raise workspace/current-ws :add.file! path))) + (recur (inc i))))))) (behavior ::on-menu :triggers #{:menu!} From f7f9ccd40c1b035f9b103167428b23d4d0e2e4bf Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Sun, 13 Dec 2015 12:12:30 -0500 Subject: [PATCH 549/656] Decrease new-version check frequency from every five minutes to every hour. Should help #2065 --- src/lt/objs/deploy.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index 58cf07a75..bba77279d 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -47,7 +47,7 @@ (string/split " ") (second))))) -(def version-timeout (* 5 60 1000)) +(def version-timeout (* 60 60 1000)) (def version (get-versions)) (defn str->version [s] From ae730bc4b8df1b41eddfeee2245fa49ce068f747 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 13 Dec 2015 12:24:16 -0500 Subject: [PATCH 550/656] Allow console/error to log multiple args like console.error --- src/lt/objs/clients/tcp.cljs | 3 +-- src/lt/objs/clients/ws.cljs | 3 +-- src/lt/objs/console.cljs | 18 +++++++++++------- src/lt/objs/plugins.cljs | 3 +-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/lt/objs/clients/tcp.cljs b/src/lt/objs/clients/tcp.cljs index 6ea1cf63b..711d532b8 100644 --- a/src/lt/objs/clients/tcp.cljs +++ b/src/lt/objs/clients/tcp.cljs @@ -72,8 +72,7 @@ (.on s "listening" #(set! port (.-port (.address s)))) s) (catch :default e - (console/error "Error starting tcp server") - (console/error e)))) + (console/error "Error starting tcp server" e)))) (behavior ::send! :triggers #{:send!} diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index 271d2ed22..abed1c4f9 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -69,8 +69,7 @@ (.on (.-sockets ws) "connection" on-connect) ws) (catch :default e - (console/error "Error starting socket.io server") - (console/error e)))) + (console/error "Error starting socket.io server" e)))) (behavior ::kill-on-closed :triggers #{:closed} diff --git a/src/lt/objs/console.cljs b/src/lt/objs/console.cljs index fbedff074..3618b91c5 100644 --- a/src/lt/objs/console.cljs +++ b/src/lt/objs/console.cljs @@ -65,14 +65,18 @@ (dom/scroll-top $console 10000000000) nil))))) -(defn error [e] +(defn error + "Log errors, strings or any objects as console error(s). If an error, + its stack is logged" + [& errors] (statusbar/console-class "error") - (log (str (cond - (.-stack e) (.-stack e) - (string? e) e - (not= (pr-str e) "[object Object]") (pr-str e) - :else (str e))) - "error")) + (doseq [e errors] + (log (str (cond + (.-stack e) (.-stack e) + (string? e) e + (not= (pr-str e) "[object Object]") (pr-str e) + :else (str e))) + "error"))) (.on js/process "uncaughtException" #(error %)) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 066dc5f95..aaf19cefd 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -783,8 +783,7 @@ (load/js path true) (object/update! this [::loaded-files] #(conj (or % #{}) path)) (catch :default e - (console/error (str "Error loading JS file: " path " : " e)) - (console/error e)))))))))) + (console/error (str "Error loading JS file: " path " : " e) e)))))))))) (behavior ::load-css :triggers #{:object.instant} From 3f1b10669af7a97785e358637e27c2aab64d07fd Mon Sep 17 00:00:00 2001 From: "Ryan P.C. McQuen" Date: Sun, 13 Dec 2015 18:30:22 -0800 Subject: [PATCH 551/656] use `which` for npm and lein check Signed-off-by: Ryan P.C. McQuen --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build.sh b/script/build.sh index 8db2978b0..c312d3145 100755 --- a/script/build.sh +++ b/script/build.sh @@ -8,13 +8,13 @@ set -e # the app before calling build-app.sh to build it. # Check if lein is installed -lein version >/dev/null 2>&1 || { echo >&2 "Please install leiningen before running this script."; exit 1; } +[ `which lein` ] || { echo >&2 "Please install leiningen before running this script."; exit 1; } if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; fi # Check if npm is installed -npm --version >/dev/null 2>&1 || { echo >&2 "Please install npm before running this script."; exit 1; } +[ `which npm` ] || { echo >&2 "Please install npm before running this script."; exit 1; } # Ensure we start in project root cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. From c73c3b68649d9df6c7fcd349c8a7124177c02095 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 16 Dec 2015 09:06:12 -0500 Subject: [PATCH 552/656] Update script and instructions to account for two build targets --- doc/developer-install.md | 2 +- doc/for-committers.md | 9 +++++++++ doc/workflow.md | 7 ++++++- script/build.sh | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index e0ae26a0c..6430cd5bb 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -56,7 +56,7 @@ This will take a few minutes the first time as electron and plugins are download To override the output directory, specify `$VERSION` e.g. `VERSION=0.8.1-pre script/build.sh`. On subsequent builds, use `script/build-app.sh` for quicker builds that don't require updating plugins or electron. -If any ClojureScript files change, you must run `lein cljsbuild once`. On Windows, you may need to comment out the :source-map +If any ClojureScript files change, you must run `lein cljsbuild once app`. On Windows, you may need to comment out the :source-map line before compiling ClojureScript to get around [issue 1025](https://github.com/LightTable/LightTable/issues/1025). # Usage diff --git a/doc/for-committers.md b/doc/for-committers.md index b498f1b07..41fff3abf 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -45,6 +45,15 @@ be unused. Some tips to confirm how it is/was used: * Do a LightTable user search for the given fn. For example, to see where [proc/exec is used](https://github.com/search?utf8=%E2%9C%93&q=proc%2Fexec+user%3ALightTable&type=Code&ref=searchresults) * `git log -u -S WORD` will do a code history search for WORD +### Upgrading ClojureScript + +When upgrading ClojureScript, cljsDeps.js needs to be rebuilt with `lein cljsbuild once cljsdeps`. +cljsDeps.js is used by +[threadworker.js](https://github.com/cldwalker/LightTable/blob/d79adff78557febf4a3b94691a132fa81fe3aeaa/deploy/core/node_modules/lighttable/background/threadworker.js#L29) +to run javascript in [a background +thread](https://github.com/cldwalker/LightTable/blob/d79adff78557febf4a3b94691a132fa81fe3aeaa/src/lt/objs/thread.cljs#L67). +This background thread is invoked with the `background` macro. + ## Release process This is our release checklist which can be dropped in to an issue: diff --git a/doc/workflow.md b/doc/workflow.md index 0ec254f17..200b722d4 100644 --- a/doc/workflow.md +++ b/doc/workflow.md @@ -2,7 +2,12 @@ I'll assume you already know how to eval code (Cmd/Ctrl-enter), how to open the command bar (Ctrl-space) and how to open files with the navigator (Cmd/Ctrl-o). If you don't, start with the [Light Table tutorial](http://docs.lighttable.com/tutorials/full/). -Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval (Cmd/Ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from the menu. Now you should be able to eval ClojureScript code inside your current Light Table instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval code as we write it and only compile with `lein cljsbuild once` if we need to restart Light Table. +Add `LightTable/src` to your Light Table workspace and open `src/lt/objs/jump_stack.cljs`. Hit eval +(Cmd/Ctrl-enter) somewhere in the file to start a ClojureScript compiler. When it's finished +starting up it will ask you where to send the emitted JavaScript code - choose Light Table UI from +the menu. Now you should be able to eval ClojureScript code inside your current Light Table +instance. Try something simple like `(js/alert "foo")` to make sure it works. Generally, we eval +code as we write it and only compile with `lein cljsbuild once app` if we need to restart Light Table. The new Light Table release supports auto-complete (Tab), inline docs (Ctrl-d) and jump-to-definition (Ctrl-. to jump and Ctrl-, to jump back) for ClojureScript and Clojure vars, all of which are very useful for exploring the codebase. In ClojureScript these features are only aware of vars that have been eval'd in the current compiler process, so be sure to eval the ns form at the top of the file to get the full effect. diff --git a/script/build.sh b/script/build.sh index 8db2978b0..8b3061e92 100755 --- a/script/build.sh +++ b/script/build.sh @@ -31,7 +31,7 @@ popd if [ "$(echo $(uname -s) | cut -c 1-9)" == "CYGWIN_NT" ]; then sed -i 's/:source-map/;;:source-map/' project.clj fi -lein cljsbuild clean && lein cljsbuild once +rm deploy/core/node_modules/lighttable/bootstrap.js && lein cljsbuild once app # Fetch plugins PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.1.3" From b3b7797c1a4c000993574b577c76361092f6f549 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 27 Dec 2015 17:53:46 -0500 Subject: [PATCH 553/656] Fix build script if build target doesn't exist - close #2086 Script now handles this case and also handles a failing rm correctly. '&&' caused failing rm to not exit the script --- script/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 757c12449..5476bb888 100755 --- a/script/build.sh +++ b/script/build.sh @@ -31,7 +31,8 @@ popd if [ "$(echo $(uname -s) | cut -c 1-9)" == "CYGWIN_NT" ]; then sed -i 's/:source-map/;;:source-map/' project.clj fi -rm deploy/core/node_modules/lighttable/bootstrap.js && lein cljsbuild once app +rm -f deploy/core/node_modules/lighttable/bootstrap.js +lein cljsbuild once app # Fetch plugins PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.1.3" From f28773b463f8df36553030d8f710df39b66b4954 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 31 Dec 2015 14:34:59 -0500 Subject: [PATCH 554/656] Avoid opening a nonexistent file and logging error With dffe186953b6be27b7ba1ee402d8bc0a94f6626f, we log failed file openings. When saving clojure.cljs in the Clojure plugin, I was seeing these unnecessary errors as the plugin's clojurescript was rebuilt --- src/lt/objs/plugins.cljs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index de9b673fb..7ed837ca9 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -96,21 +96,22 @@ plugin))) (defn plugin-edn [dir] - (when-let [content (files/open-sync (files/join dir "plugin.edn"))] - (try - (-> (EOF-read (:content content)) - (assoc :dir dir) - (validate "plugin.edn")) - (catch :default e - (console/error (str "FAILED to load plugin.edn: " dir)))) - )) + (let [file (files/join dir "plugin.edn")] + (when-let [content (and (files/exists? file) (files/open-sync file))] + (try + (-> (EOF-read (:content content)) + (assoc :dir dir) + (validate "plugin.edn")) + (catch :default e + (console/error (str "FAILED to load plugin.edn: " dir))))))) (defn plugin-json [dir] - (when-let [content (files/open-sync (files/join dir "plugin.json"))] - (-> (js/JSON.parse (:content content)) - (js->clj :keywordize-keys true) - (assoc :dir dir) - (validate "plugin.json")))) + (let [file (files/join dir "plugin.json")] + (when-let [content (and (files/exists? file) (files/open-sync file))] + (-> (js/JSON.parse (:content content)) + (js->clj :keywordize-keys true) + (assoc :dir dir) + (validate "plugin.json"))))) (defn plugin-info [dir] (or (plugin-json dir) (plugin-edn dir))) From fa3ea602c950ecc7bc99ea5068d7ca7abbf1cb32 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 1 Jan 2016 12:11:39 -0500 Subject: [PATCH 555/656] Display error message for invalid data from tags url - close #2026 Ideally we'd like to detect failure on the response code but fetch/xhr doesn't give us access to the response object in the callback. Changing the callback signature is a bigger change that would require planning with downstream fetch users and some more use cases --- src/lt/objs/deploy.cljs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/deploy.cljs b/src/lt/objs/deploy.cljs index bba77279d..9aaa0f817 100644 --- a/src/lt/objs/deploy.cljs +++ b/src/lt/objs/deploy.cljs @@ -131,11 +131,15 @@ (defn ->latest-version "Returns latest LT version for github api tags endpoint." [body] - (->> (js/JSON.parse body) - ;; Ensure only version tags - (keep #(when (re-find version-regex (.-name %)) (.-name %))) - sort - last)) + (when-let [parsed-body + (try (js/JSON.parse body) + (catch :default e + (console/error (str "Invalid JSON response from " tags-url ": " (pr-str body)))))] + (->> parsed-body + ;; Ensure only version tags + (keep #(when (re-find version-regex (.-name %)) (.-name %))) + sort + last))) (defn check-version [& [notify?]] (fetch/xhr tags-url {} From 07df8bab427c325abc9e3ab0dab1aea7c1aa0846 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 1 Jan 2016 12:27:36 -0500 Subject: [PATCH 556/656] Handle invalid metadata-commits same as tags response --- src/lt/objs/plugins.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 7ed837ca9..a626fdca3 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -222,10 +222,12 @@ (defn latest-metadata-sha [] (fetch/xhr [:get metadata-commits] {} (fn [data] - (let [parsed (js/JSON.parse data) - sha (-> (aget parsed 0) - (aget "sha"))] - (object/raise manager :metadata.sha sha))))) + (when-let [parsed (try (js/JSON.parse data) + (catch :default e + (console/error (str "Invalid JSON response from " metadata-commits ": " (pr-str data)))))] + (let [sha (-> (aget parsed 0) + (aget "sha"))] + (object/raise manager :metadata.sha sha)))))) (defn download-metadata [sha] (let [tmp-gz (files/lt-user-dir "metadata-temp.tar.gz") From df966c9d861ce30eb34aa1398d183cb9e926bd74 Mon Sep 17 00:00:00 2001 From: TeachMeFly Date: Sun, 3 Jan 2016 14:46:06 +0300 Subject: [PATCH 557/656] Add behaviors to enable/disable closebrackets addon. --- deploy/settings/default/default.behaviors | 1 + src/lt/objs/editor.cljs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 02eed45c8..dc051649b 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -195,6 +195,7 @@ [:editor :lt.objs.editor/hide-line-numbers] [:editor :lt.objs.editor/hide-fold-gutter] [:editor :lt.objs.editor/no-wrap] + [:editor :lt.objs.editor/disable-brackets-autoclose] [:editor :lt.objs.settings/default-keymap-diffs] [:editor :lt.objs.settings/user-keymap-diffs] [:editor :lt.objs.settings/default-behavior-diffs] diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 88614e321..920e15701 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -702,6 +702,7 @@ :triggers #{:init} :reaction (fn [this] (load/js "core/node_modules/codemirror/addon/edit/matchbrackets.js" :sync) + (load/js "core/node_modules/codemirror/addon/edit/closebrackets.js" :sync) (load/js "core/node_modules/codemirror/addon/comment/comment.js" :sync) (load/js "core/node_modules/codemirror/addon/selection/active-line.js" :sync) ;; TODO: use addon/mode/overlay.js @@ -749,3 +750,19 @@ (load/js "core/node_modules/codemirror/addon/display/rulers.js" :sync)) (let [rulers (or rulers [{:lineStyle "dashed" :color "#aff" :column 80}])] (set-options this {:rulers (clj->js rulers)})))) + +(behavior ::enable-brackets-autoclose + :triggers #{:object.instant :lt.object/tags-removed} + :desc "Editor: Enable brackets autoclose" + :exclusive [::disable-brackets-autoclose] + :type :user + :reaction (fn [this] + (set-options this {:autoCloseBrackets true}))) + +(behavior ::disable-brackets-autoclose + :triggers #{:object.instant :lt.object/tags-removed} + :desc "Editor: Disable brackets autoclose" + :exclusive [::enable-brackets-autoclose] + :type :user + :reaction (fn [this] + (set-options this {:autoCloseBrackets false}))) From 6c309c44f974403570e79d113cb6eccd2300be97 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 3 Jan 2016 01:18:41 -0500 Subject: [PATCH 558/656] Change delete behavior to be less confusing and time consuming Currently for each tab whose file is deleted, we pop up a warning modal. When switching git branches, this is confusing and time consuming to users as they may sometimes need to deal with several modals. The new behavior mimics Atom which is reasonable: delete the tab if the deleted file is unchange and leave the tab alone if the file has been modified. check-mtime was modified to allow the user to save a modified tab for a deleted file --- src/lt/objs/document.cljs | 2 +- src/lt/objs/editor/pool.cljs | 37 ++++++++++-------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 746019d81..2796b2ee4 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -166,7 +166,7 @@ (cb d)))))) (defn check-mtime [prev updated] - (if prev + (if (and prev updated) (= (.getTime (.-mtime prev)) (.getTime (.-mtime updated))) true)) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 98069a600..739da6f0d 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -119,12 +119,6 @@ :reaction (fn [this] (focus-last))) -(defn- make-transient-dirty [ed] - (object/merge! ed {:dirty true}) - (object/update! ed [:info] assoc :path nil) - (object/remove-tags ed [:editor.file-backed]) - (object/add-tags ed [:editor.transient])) - (defn- active-warn [ed popup] (if-not (= (last-active) ed) (object/merge! ed {:active-warn popup}) @@ -158,14 +152,6 @@ ]}) (reload ed))))))) -(defn- warn-delete [ed f] - (active-warn ed {:header (str "File deleted: " f) - :body "This file seems to have been deleted and we've marked it as unsaved." - :buttons [{:label "Save as.." - :action (fn [] - (object/raise ed :save))} - {:label "ok"}]})) - (defn- set-syntax [ed new-syn] (let [prev-info (-> @ed :info)] (when prev-info @@ -180,19 +166,16 @@ (behavior ::watched.delete :triggers #{:watched.delete} :reaction (fn [ws del] - (if-let [ed (first (by-path del))] - (do - (warn-delete ed del) - (make-transient-dirty ed) - (when-let [ts (:lt.objs.tabs/tabset @ed)] - (object/raise ts :tab.updated))) - (let [open (filter #(if-let [path (-> @% :info :path)] - (= 0 (.indexOf path (str del files/separator))) - false) - (object/by-tag :editor))] - (doseq [ed open] - (warn-delete ed del) - (make-transient-dirty ed)))))) + (let [editors (or (seq (by-path del)) + ;; If del is not a file, assume it's a directory + ;; and look for editors under it + (filter #(if-let [path (-> @% :info :path)] + (= 0 (.indexOf path (str del files/separator))) + false) + (object/by-tag :editor)))] + (doseq [ed editors] + (when-not (:dirty @ed) + (object/raise ed :close)))))) (behavior ::watched.rename :triggers #{:watched.rename :rename} From 863a7b289eab2a6d2539865bcad565410a15285f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 3 Jan 2016 14:46:05 -0500 Subject: [PATCH 559/656] Don't warn if file is modified externally This alert was trying to be helpful but ended up being confusing and fired multiple times, once for each modification. User will still be warned on save about file being modified outside editor. Now LightTable behaves like Atom on modification and like vim on save. --- deploy/settings/default/default.behaviors | 1 - src/lt/objs/editor/pool.cljs | 22 ++-------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 02eed45c8..b58a4a701 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -180,7 +180,6 @@ [:editor :lt.objs.editor.pool/track-active] [:editor :lt.objs.editor.pool/ed-close] [:editor :lt.objs.editor/menu!] - [:editor :lt.objs.editor.pool/warn-on-active] [:editor :lt.objs.editor/refresh!] [:editor :lt.objs.editor.pool/line-comment-options {}] [:editor :lt.plugins.auto-paren/repeat-pair] diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 739da6f0d..11cea3a1e 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -119,37 +119,19 @@ :reaction (fn [this] (focus-last))) -(defn- active-warn [ed popup] - (if-not (= (last-active) ed) - (object/merge! ed {:active-warn popup}) - (popup/popup! popup))) - (defn- reload [ed] (editor/set-val ed (:content (files/open-sync (-> @ed :info :path)))) (doc/update-stats (-> @ed :info :path)) (object/merge! ed {:dirty false})) -(behavior ::warn-on-active - :triggers #{:active} - :reaction (fn [this] - (when (:active-warn @this) - (popup/popup! (:active-warn @this)) - (object/merge! this {:active-warn nil})))) - (behavior ::watched.update :triggers #{:watched.update} :reaction (fn [ws f stat] (when (files/file? f) (when-let [ed (first (by-path f))] (when-not (doc/check-mtime (doc/->stats f) stat) - (if (:dirty @ed) - (active-warn ed {:header (str "File modified: " f) - :body "This file seems to have been modified outside of Light Table. Do you want to load the latest and lose your changes?" - :buttons [{:label "Reload from disk" - :action (fn [] - (reload ed))} - {:label "Cancel"} - ]}) + ;; If dirty no need to warn since user is warned on save + (when-not (:dirty @ed) (reload ed))))))) (defn- set-syntax [ed new-syn] From d74ea9eec20c442fffc73bbd0855ca15ae4bc4a2 Mon Sep 17 00:00:00 2001 From: TeachMeFly Date: Tue, 5 Jan 2016 07:59:27 +0300 Subject: [PATCH 560/656] Add options for "enable-brackets-autoclose" behavior. --- src/lt/objs/editor.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 920e15701..cbcc0d57d 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -756,8 +756,12 @@ :desc "Editor: Enable brackets autoclose" :exclusive [::disable-brackets-autoclose] :type :user - :reaction (fn [this] - (set-options this {:autoCloseBrackets true}))) + :params [{:label "map" + :example "{:pairs \"()[]{}''\\\"\\\"\" :explode \"[]{}\"}"}] + :reaction (fn [this opts] + (if opts + (set-options this {:autoCloseBrackets (clj->js opts)}) + (set-options this {:autoCloseBrackets true})))) (behavior ::disable-brackets-autoclose :triggers #{:object.instant :lt.object/tags-removed} From 97415735e60d473180e635b0fc9320052e571343 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 5 Jan 2016 00:48:58 -0500 Subject: [PATCH 561/656] Horizontal scroll on navigator for wide item in list - close #1891 --- deploy/core/css/structure.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 8bcc63c31..c07adca76 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -209,13 +209,14 @@ body { -webkit-user-select: none; } #right-bar .navigate { height:100%; overflow:auto; box-sizing:border-box; } #right-bar .navigate em { font-weight:normal; } -#right-bar .navigate li { border:none; padding:5px 5px; cursor:default; overflow:hidden; width:100%; box-sizing:border-box; white-space:nowrap; } +#right-bar .navigate li { border:none; padding:5px 5px; cursor:default; width:100%; box-sizing:border-box; white-space:nowrap; } #right-bar .navigate li:empty { display:none; } #right-bar .navigate p { font-size:8pt; } #right-bar .navigate h2 { font-size:11pt; } #right-bar .navigate .selected, #side .navigate li:hover { border-radius:2px} #right-bar .navigate input { border:none; margin-bottom:20px; border-radius:2px; outline:none; box-sizing:border-box; width:100%; padding:10px; font-size:11pt;} #right-bar .navigate .filter-list.empty ul:before { content: "Add some files or folders to your workspace to fill the navigator."; padding:10px 0; text-align:center; display:inline-block;} +#right-bar .navigate.active {overflow: auto;} #right-bar .clients.active {overflow:auto; height:100%; } #right-bar .clients .list > h2.add { float:none; display:block; box-sizing:border-box; text-align:left; margin-bottom:15px; } From 76d8b4d1918067f828a9cf7411a3b65413d45e3b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 6 Jan 2016 00:54:16 -0500 Subject: [PATCH 562/656] Fix editor save+ behaviors not updating tab - close #1733 Only need to update tab when updated content differs from existing content. Created set-val-and-keep-cursor since set-val/setValue is designed to move cursor - https://github.com/codemirror/CodeMirror/issues/3734. Also removed outdated TODO comment and added one for behavior that is not used --- src/lt/objs/editor.cljs | 11 ++++++++++- src/lt/objs/editor/file.cljs | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 88614e321..8c4dd8571 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -29,10 +29,19 @@ [e] (.-parentElement (.getScrollerElement (->cm-ed e)))) -(defn set-val [e v] +(defn set-val + "Set content value of editor's CodeMirror object. Cursor position is lost" + [e v] (. (->cm-ed e) (setValue (or v ""))) e) +(defn set-val-and-keep-cursor + "Same as set-val but current cursor position is kept" + [e v] + (let [cursor (.getCursor (->cm-ed e))] + (set-val e v) + (.setCursor (->cm-ed e) cursor))) + (defn set-options "Given a map of options, set each pair as an option on editor's CodeMirror object" diff --git a/src/lt/objs/editor/file.cljs b/src/lt/objs/editor/file.cljs index caf5fd6f4..9889f11f5 100644 --- a/src/lt/objs/editor/file.cljs +++ b/src/lt/objs/editor/file.cljs @@ -14,14 +14,15 @@ :reaction (fn [editor] (let [{:keys [path]} (@editor :info) final (object/raise-reduce editor :save+ (ed/->val editor))] + (when (not= final (ed/->val editor)) + (ed/set-val-and-keep-cursor editor final)) (doc/save path final (fn [] (object/merge! editor {:dirty false :editor.generation (ed/->generation editor)}) (object/raise editor :saved) - (object/raise editor :clean) - ;;TODO: saved - ))))) + ;; TODO: :clean trigger unused internally. Consider removing + (object/raise editor :clean)))))) (behavior ::dirty-on-change :throttle 100 From f4d680e28cc00e520ce18a292d3ca1b87c3736f5 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 6 Jan 2016 01:00:33 -0500 Subject: [PATCH 563/656] Fix cursor jumping when file is updated outside LT For cases where file timestamp is updated and content stays the same or is appended --- src/lt/objs/editor/pool.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/editor/pool.cljs b/src/lt/objs/editor/pool.cljs index 98069a600..1f607b7d3 100644 --- a/src/lt/objs/editor/pool.cljs +++ b/src/lt/objs/editor/pool.cljs @@ -131,7 +131,7 @@ (popup/popup! popup))) (defn- reload [ed] - (editor/set-val ed (:content (files/open-sync (-> @ed :info :path)))) + (editor/set-val-and-keep-cursor ed (:content (files/open-sync (-> @ed :info :path)))) (doc/update-stats (-> @ed :info :path)) (object/merge! ed {:dirty false})) From 15a74741cd68c464fcd44c4e9d50e48915c37ff4 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 7 Jan 2016 01:11:02 -0500 Subject: [PATCH 564/656] Give user feedback when plugin is (un)installed/updated - close #1920 Adding an arbitrary wait to display message for behaviors.reload isn't great but don't have any immediate solutions without getting into callback hell --- src/lt/objs/plugins.cljs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index a626fdca3..3831c2a04 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -13,6 +13,7 @@ [lt.objs.deploy :as deploy] [lt.objs.notifos :as notifos] [lt.objs.tabs :as tabs] + [lt.util.js :refer [wait]] [lt.objs.platform :as platform] [cljs.reader :as reader] [fetch.core :as fetch] @@ -453,7 +454,8 @@ (when (:dir plugin) (files/delete! (:dir plugin)) ;; :ignore-missing b/c uninstalled shows up missing - (object/raise manager :refresh! :ignore-missing true))) + (object/raise manager :refresh! :ignore-missing true) + (notifos/set-msg! (str "Uninstalled " (:name plugin) " " (:version plugin))))) ;;********************************************************* ;; Manager ui @@ -500,7 +502,10 @@ (dom/stop-propagation e) (discover-deps plugin (fn [] (object/raise manager :refresh!) - (cmd/exec! :behaviors.reload))))) + (cmd/exec! :behaviors.reload) + ;; Wait for behaviors.reload to write its message + (wait 1000 (fn [] + (notifos/set-msg! (str "Updated " (:name plugin) " " (:version plugin))))))))) (defui install-button [plugin] [:span.install] @@ -509,7 +514,10 @@ (discover-deps plugin (fn [] (dom/remove (dom/parent me)) (object/raise manager :refresh!) - (cmd/exec! :behaviors.reload)))) + (cmd/exec! :behaviors.reload) + ;; Wait for behaviors.reload to write its message + (wait 1000 (fn [] + (notifos/set-msg! (str "Installed " (:name plugin) " " (:version plugin)))))))) (dom/prevent e) (dom/stop-propagation e))) From 16f287091e83a06ddeef55c0c49d807796c23d06 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 8 Jan 2016 00:12:15 -0500 Subject: [PATCH 565/656] Make docs navigable by opening in a browser tab - close #1097 Docs were being opened in a separate tabset but I don't think this helps much and the tabset was buggy. If a closed the tabset and reopened the docs, they no longer opened in a separate tabset --- deploy/core/css/skins/new-dark.css | 13 ------- deploy/core/css/skins/new-dark.stylus | 5 --- deploy/core/css/structure.css | 5 --- deploy/settings/default/default.behaviors | 2 -- src/lt/objs/docs.cljs | 44 ++--------------------- 5 files changed, 3 insertions(+), 66 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index cb357b69c..167582890 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -521,19 +521,6 @@ input { background: #606970; border: 1px solid #606970; } -.docs ::-webkit-scrollbar { - background: #3b3f41 !important; -} -.docs ::-webkit-scrollbar-track { - background: #3b3f41 !important; -} -.docs ::-webkit-scrollbar-corner { - background: #3b3f41 !important; -} -.docs ::-webkit-scrollbar-thumb { - background: #606970; - border: 1px solid #606970; -} .search-results .path, .search-results .line { color: #bbb; diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index 77b4ea29e..17e9e50de 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -235,11 +235,6 @@ input { color: $highlight-fg; background:$highlight-bg; } #browser ::-webkit-scrollbar-corner { background: $bg !important; } #browser ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } -.docs ::-webkit-scrollbar { background: $bg !important; } -.docs ::-webkit-scrollbar-track { background: $bg !important; } -.docs ::-webkit-scrollbar-corner { background: $bg !important; } -.docs ::-webkit-scrollbar-thumb { background: $scrollbar; border:1px solid $scrollbar; } - .search-results .path, .search-results .line { color:$hidden-fg; } .search-results .line { color:$secondary-accent-desat-fg; } .search-results .entry { color: $placeholder-fg; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index c07adca76..0a68a28fb 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -294,11 +294,6 @@ body { -webkit-user-select: none; } #find-bar input { display:inline-block; font-size:11pt; font-family:"Inconsolata", "Ubuntu Mono", "Consolas", monospace; border-radius:0; width:50%; height:30px; box-sizing:border-box; padding:5px; padding-left:10px; outline:none; } #find-bar button { position:absolute; right:-3px; z-index: 100000; padding:6px 10px;} - -.docs { width:100%; height:100%; } -.docs iframe { width:100%; height:100%; } -.docs .frame-shade { height:100%; width:100%; background:transparent; position:absolute; display:none; } - #browser webview { position:absolute; top:0; left:0; right:0; bottom:35px; } #browser nav { position:absolute; bottom:5px; left:0; right:0; } #browser .frame-shade { height:-webkit-calc(100% - 35px); width:100%; background:transparent; position:absolute; display:none; } diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index b58a4a701..23b2fb22b 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -155,8 +155,6 @@ [:docable :lt.plugins.doc/editor.doc.show!] [:docable :lt.plugins.doc/doc-menu+] - [:docs :lt.objs.docs/on-close-destroy] - [:document :lt.objs.document/try-close-root-document] [:document :lt.objs.document/close-root-document] [:document :lt.objs.document/set-linked-doc-options {}] diff --git a/src/lt/objs/docs.cljs b/src/lt/objs/docs.cljs index a36e9ddcb..5ac4289b7 100644 --- a/src/lt/objs/docs.cljs +++ b/src/lt/objs/docs.cljs @@ -1,46 +1,8 @@ (ns lt.objs.docs - "Provide command and behavior(s) to see LT documentation" - (:require [lt.object :as object] - [lt.objs.command :as cmd] - [lt.objs.tabs :as tabs]) - (:require-macros [lt.macros :refer [behavior]])) - -;;********************************************************* -;; Object -;;********************************************************* - -(object/object* ::docs - :tags #{:docs} - :name "Docs" - :init (fn [this] - [:div.docs - [:div.frame-shade] - [:iframe {:src "http://docs.lighttable.com" :nwdisable "true" :nwfaketop "true"}]])) - -;;********************************************************* -;; Behaviors -;;********************************************************* - -(behavior ::on-close-destroy - :triggers #{:close} - :reaction (fn [this] - (when-let [ts (:lt.objs.tabs/tabset @this)] - (when (= (count (:objs @ts)) 1) - (tabs/rem-tabset ts))) - (object/raise this :destroy))) - -;;********************************************************* -;; Commands -;;********************************************************* + "Provide command to see LT documentation" + (:require [lt.objs.command :as cmd])) (cmd/command {:command :show-docs :desc "Docs: Open Light Table's documentation" :exec (fn [] - (if (empty? (object/by-tag :docs)) - (let [docs (object/create ::docs) - ts (tabs/spawn-tabset)] - (tabs/equalize-tabset-widths) - (tabs/add! docs ts) - (tabs/active! docs)) - (let [docs (first (object/by-tag :docs))] - (tabs/add-or-focus! docs))))}) + (cmd/exec! :add-browser-tab "http://docs.lighttable.com/"))}) From 2a93975c20dd3ba1e105d9b589a0c203f4c82c9c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 9 Jan 2016 00:37:24 -0500 Subject: [PATCH 566/656] Font settings is global, not editor specific - #1460 --- src/lt/objs/style.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index f12fbae54..bdde4eed2 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -54,7 +54,7 @@ )) (behavior ::font-settings - :desc "Editor: Font settings" + :desc "App: Font settings" :params [{:label "Font family" :type :string} {:label "Size (pt)" From 9765b6d12f3e83e9154bdac320dcdfa1d754c3b8 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 9 Jan 2016 01:02:51 -0500 Subject: [PATCH 567/656] Remove fake light skin - close #1403 Having a light skin that points to a dark one confused users. No reason to hold on light skin, related code or images until we actually have plans to implement one --- deploy/core/img/lighttabletextlight.png | Bin 28460 -> 0 bytes deploy/core/img/loaderlight.gif | Bin 3316 -> 0 bytes deploy/settings/default/default.behaviors | 1 - src/lt/objs/intro.cljs | 5 +---- 4 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 deploy/core/img/lighttabletextlight.png delete mode 100644 deploy/core/img/loaderlight.gif diff --git a/deploy/core/img/lighttabletextlight.png b/deploy/core/img/lighttabletextlight.png deleted file mode 100644 index 4d4dba545ae8dee9e3504357d2e1b3f513c408e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28460 zcmb@tWmsHG(MdeJ3Cld+nNIaJQ!i>n+~g=v4x@>REu$i$+e^-q6cf#)pXm42!9O0$|RSZ z%i@+CFEM=BHzMSKNhOC54_shog{5ec3s7N7<5I@6kit_`$6IP&e$%3`T*boYTBzari zo~WJDBB|lWS7YbtZPo;*7PfaZmMpj1GyM>)=j@U;(^j;o4aWP=-BH4eO}E6Caaj)exZS1SRi>_2>YO5fG zJf;cwVc~6wv9biyk&CyIn72NA<_e4NwItlh$9e!uysH08)ug!yBz+_yL8XYxY%>2{ zmcLjzmpx^mONvW?ntdcRtbg2?jZ$eA({|m9H(_@;G`1eEi@8vxgnzikv1hbSOIU3g z;)Tql;S5M*iB(+7y_9tZFW1Z0iwcA2Y{!SgFy}{ichjll_8FH?QTh5s#E&jgWor3? z@XutzTX<%z9OEsO(hS>2-E%B*I4mnS?pdKS8yn#>RDm(rj>oCj&J(UnKN*L8V@a6gIs zO45bzirDZ)p~;8&3L5_-8Z~SV?BdYp!O%)qTJg5e96l!v$y-F%teHuDf7ngb zLYYeU1+Fn1&E=Yk8hQlZu~v5ddFcq8$&WbG`*d6$tzCUFMIX9DDC3VrH=esC-Pe)r ze(Op^y!Y{+YFO!(WBHw<-}Ml#gkLK99&i-Kz}>ZX?Hm?;+Jj9}I&Z%Fx$`_ueJSR3HvX-mY21>QCg96xEh002nfYa}cPKxQ^R zcoW&Q{;cJyr6A8|>R`uWZ02BM&f;n32*w5g1U&h`mv-i^#^j!Mw)QT3o`RHrWAK5m z{{pj8lK+k3Y9mOgrJzhM?%-@r&dI{Y!cHlKNKQ^J;B02Wrz#=!Z*uTIK}suES4Tcp zRu2yk77q><2WLxGHeOy{Rv%Ekg@{qM2Cqym3I`Bcqa z9BkeG8eZMr+Es{6;BVyr1pm)$|DqCiuyb@acX0ue332|LYC{r5fn6ZW6@+W)5s{t5gyfdK1YO#BB^|CZQa-1rap{~xo>J+1#= znEhAJ|IX~cpnS^Kp60e%64rL+_J6aEhYQTS|6|WTp6~B|aR*xmXEjG-Q}e&r@t>go z#Qu98?SISz{O2_P==i_Q6*JTSR&_@=XWPFO-OQBL+}0fY$gVD6wy^!LI%sCf=i+Aa z#oW~OzXb6wrT$wSV#b!N{{RcH{_oiT*W?La^8bD7|I6C(Glg+S zLJZ+U(2NfTMy)cmq=c=_Mf6y^iSGKV*?FG1{_9#()lqc)y@7Q!3{27nKSEb1E~ePY z`19L)a>l6we9(sr>I*>&f3FN5%Y!Mw!-))z!)*G+<10^M`098P{(CeOW<>2K22;}C zF*)!f$?~|s0%t^l>k%pnG{IYCdKaJjv*mqI5EQd?9AVRKs;0rHsuB+d91O`Q7Kl3Z zksN*sQF=Iz+hD`w?IrbGPEJmjgwM6yQdV}1SyEEcN&5O)76}naOg37McnZCYY69mV zGBWm3LQ;~yzrP=?Mz8HUXFw{B>!YmvT6e(vn?nBTLc_F>?wn%9u+5WVcgM#Wudg3} z@gNg%Rry(1Sa?@z{8)Iuol_!;tP;$72*N(|GagB#AZfN;o~;&-K(#4T%xRDE{KaOE z^Q<3QNc~KC11V^gA*P4O$?hg^`l{0t8RYW`rVSeb)R>K!#<#X%+eY6@85|`cXnAH_tOnEAogZtjqax8Y*b?OH!8l+?S3@&9lg*AXSaA~P`MDc zfF^8bY1_k`mL~JVzBKie{1B9t#y?f9-;wLSHfA(c8jD7W=6+YB}6(1RqQILBY}LRL06aKx_UCy3i*jr5?YSezw-qN6*4~_5Bfdd>mzTVz+5m1?5C*Nhe0_ z+8JnbBqyHTBY)p{B^7)soUK*+z7la=*`B9Z7+@Fd8PuU62@Ma?IGX(*CQ zXGvc^9zK11e7sxKb5XE4ICTz^5(X*2;u3S7S?0KDM5LrKzhjb-Js^Gii1viLxm43z zuEAF`{yvtgVs5phZGOIpv5n!CzgzP|x5Xbm#LWXGq?CRP7TW>R0MGbhu53DgWaJZJ z8tw*ABih^T)V;k=VQl&8?!jiO@VO7&GtKHut5s53^6=q!BPX2i>$ugHobN}b*FSee zh)@raBxy$7;l%ASKU?+k?x=sf7T7=I!~PW?dl- z9G1IOxQGf`E-o%c78(oVn}bQiFx&PWF!vP~9BncoyPZ3Yrym|{K=w`IF}TdRRi91= z1_sE2#6$ZyjjnFf-O0PI7`dB8-|hnaAA5k_>HS^~cdLkYPI|n-nT)9@<(sCRc%iHGGSxbn?EuL3@}3kdO%(*%Ni9!(8T)wSaL7{hYCo&Z_$}-WieG z>*RRJ%<#?#9KpXX&E7D#ScFkcPTKL0^|<<% z-b@LtC3ANHi_neL3Z z&PeBLUSutl9ROAL-K6tionf2I{P=|aXAojfoml*+HR%eP2R(-V7a+pSVUM2 zIPJ5iuJJ*oY1vY3fdu{M?AVSrxsl=G+nPI-d+{TtJl|c0V+rOIt`fRfBV(Hv&8x?i z96uMsS;={sTusarh{J(e1CXX{r7|StrRJJYNmbkL=iDiPiVHcfO@qJv!uBr{SH**BI#$Owro`iry7dSN( zKQMGi=vF|)LNEUz?)V!a^)9py;7k2&aO@F}YmPTAQum z5~-YEnYn(Amm@i%?^TM$rxMmOYN_Ey-({g*ScYeZ$AN0klFyBe?^%K#zm-M~jTHDA z=)9KmLN3F{ar(@ukV97saYCD!dMPNQQB_Aa-$e8llqPtRhp~CROU(bE&zwO=R z3#|B}$()Qo)OGQU=-65NWM~|HLaKoa`zAHD`LucZxXLKtJdhb=&ThS9;~i;Y6d|f_ z6ZVVNuG%rVox<&jr3di{$#_eSfd`pQ(EGO4bG6xy+qmYE{EUD_j`>;Xu%?@q(WM6+ zOHBFqLw9kTZhDnPEZ-d#@toFsRP6Y*KWN+I_VuK)CR+<}U#rv8pE5Cu(m9{X4J{52 zBkd~7s~gp`27L)()?}0WSjs%GW}dA^9QAOYde?)hxqB^8kWX#z9oKuEZc9HXJ}0JH&~m^Za-!($f9N_&jV5>?jFK%)V9O) zpb4qo9q37tqXuUbf6U!n7{w2CxsrPY_Ke6?bCJIJIuiBtNz+)*+aL;{W({Y>Xt*g43*@qUsgTuihuuS zCHyKw2$sm7IV>fCy3-Iep>NsA$v5~bMb#-}m6M_#%+K`WjbgSTzdF+6h`97NJI%*g z)qi|`Icb^<5`M~#ZoxPDcGZLLlgbm0+-R(bPmiUnClSKc8DFUFDd9dF_poNG(h zkS(}-{Q!A(WAy4y5WRX0@$5{zwAfo>q?{e!*jqy{8(A2u#rV2U#t=Yz9_>#pk~V#v z(9tIrPqm*S30eB2l6~ZcK!3na3@o~1Toy8q*FoFM)A=2Ce`!>sNQbIV0Mq8nGIaT_ z=e}&7K&d@No-aOa<74;nLw7<@qb@qF9F}zF*K`5j3ChTeUifNmItbC%gjbRXxMq?b zQ|SdmR5GD8dE+mmm~KkXF@9@=4iu2&h-+|c&)sNz#}Fg&0t*rC`oN_lV7#O}bQnm(&Dqx z$9|)p8isbsk;+{2WhG?P^wPjv_|Y5D8Ij8!`c0y>NPcN5hu`7(tU*bdMZ12lphPbH z4bS|`8pdN`J7TahH7k-+q-SasPds3AcPKMx6$d<6FAHgis>mx_enaq*e5A7 zm@(AL$-uyX54n4)O82S~dEf|(V2P*}@>PUUa)UI5*T%8cSZ{4OCXMMydHcXlpz9O+ zg{EYQ!f4rS91*ur>PGXqKQSs0@?0#_Cu<|cr^MKpLiq#Qt!Rf@+k@kPL^}ue#s!T+ zCKGZ(Wd7MM`9(}~;Fqn9g=*7b&F%kYe|;- z-Rc_In)|7v{?$}b`1KaI!{b5-<}x;HCxCPazfU%oV!a|wlPBtDO^AY~nrq2U-eQIM zxH`IoAjK zAfasy(?^AOuh+X?mxGBmsN>Cg;F$8_rDP9%$RO>zc)|`98TvYH;oR4{ zb2p9z`25U->_JL8LjH%YzIW9GKS`5G9~*X217GikLJha1w6r?7UkGc}`o0IOfUY}^ z-^)iR2NH$(3;DoQNS1P#V=W;DE8l;e|Bg}9dImWqM?UDr6WyWqQP<=8=C&L6hmUGy zxc%vR*mwqvStRu&u?`XLU?Kj2q5Zssji`ti=u`!P4cGKyeY)@?!8kt}uDK+o0eyR- zOrGKVPQs@A#YIR_G$~h2YcPYk77ESaBjy_lsE!yL}M_zJv&Wd+U9r^QomFDUbqWMZBa!?x~|jlU~j} zL_W<)p|f-m(xo6hKb(5t#nv7={unkOzz1?X!o;8S5FLAGlukXsqF2RSl$kI+qETKg z@s}ea)Cp(igs7-TA&P=gTYUZT?zcayc62+;;}Lge)478DL|0#4HU@sqA6DzO{Qh}% zb|zGjg-&x{5Qu6EO%CG9&(?j<JPQhl}n6sY1%b( zCmvykA_u#b_=&`Gwad-<#&h&2S2z~!(Z01dkq*2c?gnX=Wm!2Y)X1Y_=_ zuab66jm+3k9q@8B+!1gy$=y;oAqK*Sd=uOz&^HaGugI&yz?UL2N>XOX9R_$;7Qzrr zz!)Ek5$N2@<2pcb_0;rd{%!%C<@sL?;+=l>VifaA+s!8*gHwcZ-I8GX9(cOEO+9Z; zjlx~ka|`zUg(7Y29rrI_JXyW%SDW|6&ZIkt$3B+?22lV6zko)d9h3uo3%vqg#Qg8IN5-dXemwy!!~JW_>7F3r$;aN5nbERY zx5}sa=*5=~5uj=?o`Mf_3MPkVas2G0S3^uIcuo63{i43OO9!CjPJPy(93kRZ3a!5Kljh2d` z7q@Lj0n&!%C1`U$U!m9PI~gd`DXsPE#hbNnXTgFKhB;%bcTAkltF7PWo%p7T8_5CJ zDV7!1a3qfucBLMvedFP@a$@sMp=84f<`Q=p@=YRqt3hQ4y6^>LOgOt~cO5hxWgpcZ z6Y#hlk=lCbfSC=|4;1GjW&9#l2ye!cW3Q^kk4X$%_%o3w{4VF4wgoG|npY~8gysAJ zp9(pJPaEpnXXIKOMvV_5R_}1RFLlK*v&VKb9B?Z)po|*3CCi&>{)^6=AN;>tLkzeO zGMDLju1w*0OHBa16=V&=impQb&!RpbN>Jh5b!=jW;)ou0&^Rm&x(-1>t46UUvvMzu8)%9W2=O&7gBcPj^=xOyF<)}um~Kd+bl4)49O(%h860t6i2qI7py z{Q%*M2E^0~l0MhB$8(x>Rj8ifji1}&c(6K$roAU9l=5q4tOO$GaW%!AZj9!KQ$w*X z4w36&X=ip5kyu&-IgFMU^V~Gd43cREQ`Ea9WO+3?A!Jmodln6Rn6WPQFYL}XNfDnO z0I{3Kt?6vU`y)i#!&*6xN(S-2ZSjwj}ef3lz4T#j% zVm12WN27>jE3?N0Q%Utx>QBi~uH&F0c0=0r%OcveKIu8v*q&K*;MgrgsHMqVX9K67t+K*Yl? za11_9)FB9OJc!BD3H=iV-(lRJqYU>(0-LCA0{MgJkG=3NP*CKY`74RdqH0^ge+Bn zYE$q<=!jd?UwR(w&4`nWNF1RU%PkO(i2rQI!oHAx`Ad2ow0P35#o|huhCNGBc1-SP z@H6BUB<{dDG!kIw|FlnXepyfY^0=*5Ddf{#Q++k%sO|wp=d2ejv1DGQwiv2wI6OgaiAO>u6?+t?POm3O2?rl|;EJkzzy$h+SGmQ)9j>8X!+isYNZw^J z`9XE$w6p`m7ji+tSEc+Q&fKrv6{w6q7Ctf%HH1aD z>F>#n)YB6R4Y;>aydY&UL^vl+lP5}7ghq+YgeJ#A8d;qie{t+bSyUVyTM>r*kbe#D ze-+9;BpARlM#bKwk?luDeh?(ToBkoCo*)a zp`AOi0z<2^!7 z%yNS6rr*PQ(-{Xm<+MupxaIn#gbVWbhCq*NqSV_eGFc_LXEL4~1pf4OH80fQEhi%l znQD;gwJmIi;hIEmZE%wi)KZANRU<}ettToGIl4)MU zthZ1O=8;f+dl0(I0OrvKKYrDjK1a=56`yZwEmqc6odXdN5aeoWTs|m%c%dbyGHiPk zc#@x|s2^oiPIel9O!qFoWPNnvHe2S*;dk#$r)Av{Od;y)X)TqfXQ5+?)orktGz0O% zPpj3GG6`4!qmS8Su(Aov;DN9iG{_uAH9MiK%UX)INs3Z)$YhX87q;21oWyf=&L@P| zR-L1us3o5X1DNkmq|nSGyq^4)Q`x+5aw^-gx4vnMH28>~A&^`A4xdd=fY|Wxh|2zbSQAdcWKnPZLvaM}lhdqQ?0ST3DIMsw zg^8h}Ec~jfI>J!Ag1*1k+8QFsQ>e$RJ8t4z?l8AF@%k?opKf~kZD%c^gFWYwfW7ak zU(O@2Z*~wY#gKJhfxl5Y15^VSx3dXR{@{gO}w_ z96%HaZzi6^XbLI7c9SQpT7TIMVeh360m(#wI0U!_ohS!}KnqTlEH!Xo(ncr@*&?N) zv4PMVSX8oWA8g35E5_M5TGkR81;%V%JazB|SN)BTW^7OsCE6kyuCV;~aDpE3ElKFN zi!Qe#NV$=X>O*dx^Zfs?Q*++2btBq}zKUCLIqHs?{&uQAS7%6wV22O6+6dh$0A!|y zW1El7pb#zeh#d0HmRr_4>{Pm#d{ZOyLzDhx80;4&0Gm7RBzJeFt*;7oF&__oxHA~D zc{)=7g;FP0jAihHY}`%JUXky<`wi(hRC5Ygj;v9Xq9K(^t`LH!2CcnVeO}W~A1T0< zg*>fIgAo`>O%~zM8Dh#^BjS#F-R9rj%F>BK`^i0Umwv%uUNR=lpUY$>KWXW*3wydj z+$HhwBU@P@l2d&=BL{~IPqiDcPfx9HARO|qMk@jl3zhQYHxg@SEnJ#+4}ubF!X~R2 zAqo@2&q5w!4eMP{P}fwyj4@fQ&fZVnq5UX-W8YArZX%k2@KNu9QSz=gkzql6a{rh}tq{AhVYuSti;2J5b?o{I05pW`s`9mxPLluiy$74J-J{AM-yry zFpik>q|l@1 zdoT}OFLeloKtRiuE=y4)3xPoaGjf94OULuwDL1M$+)L6nPF1SpmQ8}^{FK1WgzXtb zN1@Mf{9=>M;_shR`t8|0=HqF)m*`6Udi3Yz7Ia47=E$xJh-W0A^)|uc>rN6+ zXlz!s`hHYr>agkmTCH40HueU$XAKpR@aRWJPk)7k*0G5-76V|>X^ed77jJ0Z<#`CJ z_)=1zLNXIXAUl=#X@&#s&&EKI48%tuEsShU*Zsao`xz1X`TB_@LDHSXC4`MHRC(F- zhohhwceVM}W{^NU`Jbnv(3ub!p}-)+1m{9}GvRaF>zz*Wdk9pZA9RzPps>4(XkUX9 zym#)|?k#}*yXcrec2ICP#VfYxWfHNz(xpzbZJR;Rs5azv!X>)mqHWMJY%b{d@(!-- z2^Gs%4uZ3RW$58yGa!Ilu~&YO$ZNW*#0;TM=Ihr?K{TpYo8qfm3BiUv-K{TL{6@Iz zH#gJ5hU=YP4Q1LWvwLRJVF^5*_vfn~!&EKn3)t3rUFORM3z8_C4x~4xh>1ZzxB5Uv zN2^Xd$~J-HK03eCIODBe-{P~BR z2rZp`9xu1QX&QKi{Xu+^o1N$Zl>k`GzUtM%4^J4`0Pw37kao&(MWRC)||J8VCV9JTG z(T3op3z+oFWL2tV`F4Q5kxzKU;_o~+t=z$KE}kTxMSs2L_l;~OVo)K==|7||zc%*l z)#3$VRk~*L{1O>^B-(<_Jy8inL3)*^fw^Sc72XM*$N#kz-Xu00e^jKGI$x@gMcaWw z=!!lFB}Fzrju~VqgnH}=0T+i1&e>m&A{8eE&=ct=mT-$`yy02Hd4k^}+!H7a(5AH< zFDG$C4gd{BtOzo$UhYQlBek4`9BzU-!`swXg zw?vc;(_aj(HGw|Y<=WRSP3FTS;?9kqgWbQu{icr@^230ldSe{Mz&7Nm%DBJv;)!mr zJa-<)kEp?T9c*k({+v*YNdCr}l#DM*ICA+rhP9gq1%;K&e5lKSfpQ4H`?&shP!yIS z)!WkT*a-CBrVH43NzQ^K=9g6h$6Psp?s_7s%G$v~q9tNbH>&#hWn^Sf*nINA&SeQWlgtyU&AyJT6Hs?ODG5>zv}3gEvY*Vf*7_e|S+sqRT^<*QdJKF8sY&qOAk1PY` z`0PzMODI!)gR*EDGQpJ(xJ-O5;Ys{TLHzh>hiK6-;MJfwBZM(H0|D9ozYPga+>wd? zKTS3@!S&ct!=CtXZZH`rF>!J0tKc|tx)#Y8+{9OkKHWHSSW#Ek;@mLaF_Cg9{nDd4 zdh&4f-O$jF`p^QBA%?Cgt*xyjpVGMk>l|W%3dMk!R6VDg{)q@@mtnfgpA)miCdK(b zda_!~Mv-&yjOe~N4$izh^t``LF5OHUCgo(Uq7Y;{NQM(nO_T9h&EyO9fMQ^Bxj2k7 zoqMru!r>H?c)q@gg%Ncju5_SBcNy_Je&~{ard+>PEw86x|F1RiL?^P}g1u>fl9-+s z&@Dw~ikRb3UkuAgC-nH|v__M1lCM)d9jTe;<45_F3ZwpUrOUc|c)Rs(LH*u=i%=CZ zj4+%{t(6hiYeGu2`;E(mP*71|BdsDjaS3W973^$jq&a)J^<4P-U=wk5=?@NE#9Hz! zLWlr&z5d7PRE*LqY{D(7Jty53dqFtQs|IBAjc|bYY@m-XVk8~{oEoA9Tf`haa5u3f`-_js}Nhz#+;LMImKF$n=_KrfC%Spn(XtP^wE~y_7*_ZM0 zqNZ4SyE2M2>K`?{>{VrAJAqIVz`m(QWFhR@`;PAa28igXQa*MihvTfF7YJe5`O5z> zXTrjSb;%1+bPVg{JEg)fnaw+?4!foJs7!(BLZ&TqX8|2;KF0S{i*mpsA#!MC$56g~O2^ zw~`cG2}D0ADJeK_^Nr>Y5?Ca}KqC-ls(m4#1f*%`M?G|(NFm;C- zB*)q{fJVZRGR`Q6SpE(vytj8!5M;_~tq)Z~ z=gAJo_{+*qS5Dd}hqddhejFDXV+9uHzt*#kGN8yN-_+BN+b3ptua_6IPRKNonc##}%6z zJ6c!Z(inZ68(N*0sRDhV!>{P6b@mK5Rgg#rAgtC^Z9@jvUn7B+_RA}LM>%w{BfV`i1K=3RJuWaHjb;1 ziiKFB`TQDsom|KnelvHov!%K+qs?|-P#RNYhBRNSc%4oe4>h%9C*&uzegh!bA*3}H zSzAu0EX;vp$X_1%rAEL%vp~e>@w+o}5q?FBz5@yL?y4AM8P>DAOEl%yW;U)%H%rG6 zm3MjlmYv-#F^z9rEanJ9K-_yNSclCPRK6Xux1cJ4$d_%;sX05TIZQmShlyWdGB{@AW)mg3>H)peiL0 zDu+MxrDMKw)r8&zvF2y#b$`hOt}*Y9Nh&F%DN}hie+_u1`Gw1L&u@j-KfDv>izAtg zh0gUO$0yQn{v-l&5$XoYUL=s6Pms92Ss*8)?S_Mvz`q^G9@Zb~=`Es;KQH)oj$!Sjd)JnsMuEDlQTQMEpQcc<&|EUn`ijhB2{ zCuPoVc!Tv^X`cPqgm18ex}rHpZX!Mee##{}2?rx%rG7@vdEy0VIrh}Aww{~*b}Uo@ zu%m-vcC@r$vC_}Wd#Wzf0&}JM*0%n;wwz8=jsr_0$s5AAMyUWisDiVF1x?QtCDeBl zf3`kH2Dwt%7K>p>{Cy*+uBr&W918qEx_;Rv=e?T9S-`H5j8?BDX$#--nBg|3<6rI@ zu>!=sDIF@fD%ZVu+YuVq$m8IVLKb+BVaa09>Dl8wOE)B)Jd>cBvad%C-k$t$AKTLCqs*)KXk6(^{2lRylQV0|LOZ~E+=V_ zvI`^iHKC!QX1>a)fLb!OQn`SkVOL)JBOL73kG*;H08^dp>cFJkp6+{`5&U{mhJ7t% z8F(@w-^XKc3b+GCZg%M4@KEh=k12@s6q?Jo#q|%7L#NYSB*r0$2&v^%EQAIE8x%c) z6wYeeIdO)ja$=Ry;-8?S7^_nf?hVgfii00IO|pmI3+JPiQ>ULgbpQoGuXVqZ?}BI( z->yti(@i0zYMbFIJmHlf-5MP>-!yR9DLm=O<&iBELu->26098AY5B$IxI}RKZ}NpB zHEoKba2gC=B=Z086F^kM`_4#UqXvZFg*Vu0(deChe}mnu+p6pTGQ6#|uh9P29vPqt z(*OKRPh9G$dJsKcd!uO1j)RnMbl^=g2$R^KBAR(c>E39b!n6AM{kE(ah7r$wsp)jf zXu=;kLhbRhFN-u$usxG|tf(p;W+#|m7b)YWu`URJkfI@v=iZ(|;MnQ zqW`J$_j<<=E-r3FNPE76(FB9FRzFq0-2KI-u*6mF0h*f)&}S6s&q=ed_Avtw$lPqP8EH%K)XSwxC_a(56sNxgr2J|z*32wjX0>bFPs~i z18}Q^0z892Y~gTE{NvGYel}@YS*zGn8&i?VbrCaf_?jNd5NJUVG_@bCX2=`dDmBnp z4BM{tVOrQgXV^$zPc6E#I34Yr22E%_Woj2t3!r1*(ri}3IQ)tfej@hDb2BOB{9QLp zDi5RT%T?>U_ghEBH%s7U>+1OVXu` zmJ^A`j4MBW$mba3EKNN=ZY=!(`zZbpn*s2a zBscL9jjYfN*Go zD^=5Ano&vkIbhl&qoBS)I!?H7X}C)GQ^c+W9mJHEe*H9imz#YTp9(3VJM=bUqS4MF3a@9pBgi z0OGQa#a*jZe5gsWBBCg6PKWKSR)7s@_jG3dgl z8EPHFdic4xXXx;2ABZ$fG5Vgy6kgZ}t!;npJ59l3CvYiAJOY*;stTQtC3`# z#||mn-9){;YPjI&7CjvkViWvsM@v@bX(l8-kkMT11D^+p(AlSJNRh|i;;Jf19T=66 zyB)my(Q?U+eZ#7P?QfsZk*C%+Qmj-J0`jSa;hhDBjKQs&{uJzf$#a_u^0#G3hMm%@9ivgN?yzpwzcg`M}{Zmk(MX(2QE=J~Rb#Dfo2~ zoeeY&-mR?Zc3#*EWki&`rSNWaHt;!b;=j5Y?Ai6xPm-!pZ+n=hm4S#n{N(R1V9|A! zqnCmLIvJ93Ipul$6MCa{K@*!_hi{01u}xilS!*6g$fXl~YiA|B-aYKysW{gL4G5{D z<>PC|-^3yeQ;VL01ON=z_Wk>@++?wD*u{eYMS%MUXYFs)y5u(HOe$W8gI^1w3;Ts8 zT@A9f46#KTM!p4wuyVPdu6dcb>gi1-t*w8ygX&nKTPsA(RBVF<&+a0-~2{g4)MXWAlAk3$0el^UHZyF~=oLO$s? zdOqKu@6OK6m72IWVND4syJ^={wHNY@r;_js@KZp)nhYy&uix@|`sA_oom4^izEc8= zCtSp27PCn9OFkWJ9fMl4^-c9d}3kol{usrpG8doymz$ zjEdC!XROKU{SFoVzU1?GfUxGjGSV3!iVH&fsx}&n4@sAEvpsY8OR#g-72Hb9L4Gzxe*aPveP%o1_fv zBY22d^*AjJ3sy2N7u`1rG%o!Oub9{Aus@c{x_T-?)SzHvE3$fez0(A*KGTFvWHwn( z&5F73*_>|6260JKWngg7oSsVF40$h(=W?rUU&Ewy{>$1WCkw61s}&=m$%mjyhs|!3 z$KHd6DL%&QVX}bY0yRxjScsYNBRL?f<#j}(_M>2g9kMm}oDE4@PL3bjP_(gDyq0@@ zI#m2H`vOCF1CK2@Cy+oxOIx;!{zErt4kOIaV7wa zg)h|tHC=C{;%?iBn=C#96XoF;4<3;Cw#ro(_ePVE?(J3=C~0U)d992hG8uH9VFd@dl3wTp3&8fQR#ge8K&A^%gfEECWoQy2 zLNmdTtI?U3gM7$|S{Nnva*sPB)adrJ95(EDzWl=Z(;);Ab0Gt0g<}*MfIxtX-3@zT=f7Acw z*TqNw-Fol$y0+$SH~O(f0zN#p6$LdlH5_9N>h&C+l{8AX-oVh1Gfiy#>Wg}%MpV^L zm0d6|NE!{qb-B8Ics0X;ZE!xWR%Rce=NjtF9aQ}NgIwl^;zmz$G#tuN zkSqLS3cjeNbLWP^Df3;MFB+1?plx$D?^eJ7tQyD+*&i6GkfD%4jJoU@X=(SGghros z$%lf<)*^g5MQPO{{tlc376OJLwIv}E?r>A3cx5v_Tz}+$Had+U^{&of@B5&T%8^tc zB8iyj@NFpIb3Aq46yKR7TA0|>%Z~ZDhJRRW#_{nnmXV_%G8_Qy5fciT4MqAeSI~#G z*Rz$Iipo?V_viD^SE)@vEDdo8AQKvo-vtm47iMi^YI|d z;ri!LHc5p|L@!%@O@|q!omip@V4@oZESTox3B@720~Q8`PgL!)`Nyce#rg2)m%(s+ zu9&C?iBz|CkqF()I*m&~A2A@Cmo%z=vo4eRGTsMH_H}m!TxG)I!ve3Yt~dT2bTm}W zw^^(vV#BIQ)jLIx|BC4$p8fwcb(TSK1?$$vbr{^;-GaMIa0~A43Wo3=_-KzaEcMyQc~<9aP1k=VMoV zgbN>5|6H=gI5^Zi5SOw3@ulV>m54Nh$N8ijF@n9^mGfZ*rCrmuBqceyMJJ3x!YX9W zg(tI_7%jIEuX};IMZkX2oID-Ri1EFo1rTm`D7V_HF?q&=wt!3$Sy@J80Rlh`R+!u& z&cZuRKI1(QlA3{(&De1DgK11`ZHQ@=bCUpMImqYf{$fNig&m9Wg+aTalS#6O^n_8E zQ0;h32U6$4tV2isfSQS+tmjMPJbUvN*J0w!X7PP? z#iW#AzfZ%<)brpm!n{UnW1ofMhAe2g6>eotjA#WYR{=T4;6TzE;!FzX)>tZn@YiB) z?Ua;x^GK7XcLmiyB$5tF7TWfQfBrmFYX3AyJe^Ww5+NzIaL!1tL`DW}Au@?45ilJ) z^Px(rWp3O?%AqxK`O{dA%!73}55pYR!e=Bp`6N>g>CIv#Kb+?WG!S<**CpIx!RDrA&pL4o@U4WYXXE)3NsCuzwP~# z+59el2m*GcYbTPMWR{fT+=jd;-&iYV`@O!MuaPPW`5Ov_tDl%EQb3=P(RT^K*7a7B zTU5cqz>-1@J4j;8571HrgGz1aMZG?vxGpx7h(J_!_#nSUIfkvqAEy6}w_vV9+HQx> zn}R}Bx6Ny_g~E%1413z=G`ck;<8c9EHj|Q+wD}_f^l26>O0364%1tt&S+}_SG+9QS zT^K^hOtp1!y!dS-c&)+oJZn{t&KE+JUp}q=v&5-iEGg7c;wLI*lhISD`JT9>^~kCO zGC0{OVTK#IOmuV~Oeg9DU#Y9%q#fn^JCUh?UnWL@SzO!{fwk?Q?u0cxUFGoVY| zlHf#`Y>fqrqSV;sLBA6*2OE^L1ui$NynT$(RU4@!NiaLHdTRF9kw4`_w~+C;ss14w zv&4wjZ0pJUnPp{X_qvWsx6Ns#2Et{-y{2E{~(0)Rih z?hRTyG}xaYb<-F^!p4Qf8RWfkQHlOVOewAYH=lrwNfM$h8IQPG=9IO3jm}0%(|c{` zgiO)&hd^lkduIYMlUbZ7ZKEOx*HIPr92bLqniAv`M9OU`tAP0OcCJP~3!nW(E;Jq|Ukck;c`Nc7@dDcQEDFI`Ks0BVotkMRtwr%7bbis; z2UFtX|F8$Jzy=Nj^vFNce?;B>$Kc0u#?!Aee>h%P$Q0^FztkSYO`rrpJmQ6cJhinO zk*nOGQsjdjlZHPUO3KaIav&j?V5zd=TY7Xi>g4%WVwdBvXWRp9ZS!oN@rzm5pECs^ zce;AbB4RYlXL7;PjLpo)ejr|CT5zdWu?S3D%5^bIQNkF$-q<{li>o|wbWTZ95AOKk zY-LmaiZyF?T~Y1N31j<-TqOy=->-^?ICdV-&c;S#mO&NI?XIhgy~PBxE%ONv)WY8b ztbl)yq-KZ}!Va_R6$!tJj}d(oHHJY$R1v~o7Zbo}$4%OkCb8>_qb^0Up*hnq57yKK zCvg6%)F-u7p_#8Wqb#3>*R?B;o_`DBbeZE9d*&H~P|$Ry^4(7vaDcA?3eoi8l(m+Q zYW)2hc0N9N{d12lpF|+>%#S|Q@G8suplLpE9m@B6!_;d+Xm6i33f`A04V)0ac~ZBg z+RnVcU?_=BE*T~Ucvtxq*+zTiM*mB15TS*@{Z6h!#bpSfp4cYVK+xxGmn)SZtmK(94Ou3xgPP0>&bId@(Uk*s?gx=}#bw3;*i=*G(u{MaJ7Dr7 z5qYr2FwAZ z>gi{i^A8C7A1I6$kxE#oZJ?ftlaKEvxbR6U{jym0Lch{I;_I>LGJwH%H6Y!nXdK{C zQ&Yc*#FD^042P3;BP*CAVfDg!kUvke2`?18?c%kGAzS#Ao^CsMDeQoA){byeb~80S zOTcc5f=>8OTg}Xd)M+ua!{S4N(A~1BQXWFGxFK<2bVh(J?ESDa749)&n3DM)Y@T@n zMAB2!_H?cvphB1k2M zz#Ab%Po}geAT#qE>w64(xpU!?wgnLKf6tnxq%D+-At21=V=a#GA-2t@e#<16#rB5_ z;Kcva6r8>xKuQd}5Djv)GPgi9^|VyH&zs((^q*k~BrGDGNe`EY{OZXxkGSW21%Rp|HqA2L%rx!t=pLqK48EC%uC>zVwx*n|lfoc2A1OKVAbt^3ce6_ZMg;iU6N&^HiRl4g8V*GTq&W|XVX~Cl+Gi8$$a>SNQVu+b|q4Vh}gsP zNsOr(Dw!5gDRpYr4estzq$l2O<~a|$8{O9d{%ouP5>q5m6bm!9KJ*gSh4IlISfF_^ z@$utGNVynWEbKJ2qDc{9!GD@uL_VR~+i`f+EbCgpN`S&M0!F*lrM!+8UV5&tuaPGN zx8hvUjA>X~bR8|yQ}M14NSOUEb2T@k*bnHFx{(`9DczCU6)>w!+HSkfncR!`sy&Dm zFIWiE>0hkQ*L$)Qa}q=e;|Y*Bp&Q>FVMw#|)*aV6p93>H#WT{bSnbh_Sx`AV&t+Cx zZvqT2f0l+1d>{1xKlZAk6lR;5+~`{I?C(GSPta|(-9ev$AfC6Q@w2e(+tZCccUHZc z0JnuYi;TkK=3z{O?~d=v9`F?Bu5aWx_Ro6u?4Deg#Wjuny$?Na3uT0!^(g}Alz;dT zQxNQ`DMr5-%*m7(|0*b>dyR#(L^J()K{n`+md%njabX5kf4zvWV{}&)OFbbDWt&n4 z97Ume0CK1#WH;<5<`LKOZvW5`8uXL_uX0(npZ)yzuFHHpn=b`&X@x8P!|qp}KXfLo z+aYrB>lZI(P}nLd`X}Pk=NHYfeM* z=BXgB3l+PUb`&cLlTsYS_Q{ftCBfA*3DSwB1xy)#h%(Us}0S>-=RuGZR0SpgL8?5^{96CFJ?34A}ohH)xs+ zI;pmr4vWH?zI!$TDJQYDMh7bj1NDvskI04yKReV;nT3ZbtL5T@%I(9c)$#ry1SD~rxQ=xd6u^+?h9(Sm z_dz7ol%KFOEdE?T6gd2>O> zS~fA}!&bhkP-H=%{?u*~u44~G8%rgq_)#`baWEy=)yWwz?}`)^f@WkZ0b z4ln|S#?Q!LGNNIp0@(nz2y*{FKe$*k+QUVI`FmvxLtQrwJN&$mH{odGKB30I*-MZZ zi+UD8&ewU)dKtsLH-te44Fd@EY?`7T#Z(qIhwsiT%D<_Ak`i8+lwok;y|iN!fe6Jp zfi8wD&1cF+M)A-o&H1YAT0#MwWF z;B+A%wM2wmnEug;+c6rOm{Jp!=qr8#_H)2OfmGk8LAO5rBOikraX6w(=%CI;i~E-0 z>(kY*v)-$0IQ{DeqR;^_S)@(0fuQ%RtMT3z@hDFZ9FR5n&!dwF=Lo`5AQb(93v^pt z(Kty8&&Xa#vVF6HtVjN9ZF&Ggm>n01!B4c_nYN5CgRSGN})}2IB4nt+k@>Yl_BX`*Y$9h{^&^H%}*2auTOcw>tP1wG*7GC+tpUcI;KKRlwUt!|>|X_9x7sz7*;n zfAfE@bT$+&wZxBaU@$)COi@`m(BK`TsgvoF-O&1Q$IC}XidR^Fs)-cQI5ANbSdT@U zIBq$iGx^!IeyTx-9zEvl_k&V#c4wUx-rr#vT**-YjvY{z_kA(=tfs6?Y};DAr>N6L z=(2bH1TlM9-seIpQ4c3+XblCnY*D} z+s$i1e}#Z!4GWRwV)s6i3~1({UVr8>Kb7C*Mmz$L%bVXr{=oyDAoPMG5rG}WLkrc=1ld!Y;u_pVi~WKiTO-v z+=a_h=|Li&HuV>~93?z_2Nt~&WK7!+5uz_K-z@j?B^uDz#@uCztt>Jg3!xhC4`*Lf z3fhQ_1*;CpPTy)`2|W+&?@Y^d4|9L!A@O{Q+=k^ zw~s|Sk!67mknj-D27+2qjXt7|2So)=Ci_Lh|IebZkgor1)VRjfNX zwY)tFcraVh?xEh`9vC6`$ORkyls3v*tG~(RnQp$cP0lNR3YLD4AHII}&L$&`9kQw0 ziTXUk#&mSDuH&V>{u5-fcYVDS^z3yiAoSzM$;F$jaT&HeiPTSOAoZVDfOJ#GBKkgI z+|Ks@oy>3X>PRg~1zcMt#Kd+c%F4>5hb>qbQpa^f`=uhA(;x<5yMds4i-|=2l5^h9 zqq6w=P0S5*8DGt@w9wPoi{e{FWJQbukpsp`i8{K&tisF)iyR0i#?Y*=eAppuSRb!Y zQVXh0g1FAkrmkAwtKHhIJlo~)g376VgQ6tMddTO&!CM{Sau^kB2I94)Jz*ebtH&*nl$v$s@N$z`C*5o z&R~9hD)?}3IOp+CzU8KZ&w62i;uaPT4F&Fjlc4J>JqG8JyxCuW=O}!^Nfg_^8b2By zrGd^u3OWiD*syujNfV#+oyk%iyy$}4Q052X+p1n8pC^RFMxV9RXA|%}Iy=)I9vg?x zewVI`nlJN-s+INrWFf5qQV-`&QnNkk6E8a%pd&~=URZ^FLB^+H$)SS_PK8ge8q8Z+ z(Ko$iNiEw5p|7A3Wl~;|J|d)c%$>Fh$JYy}X}$CQftb14CxXhlG?i?WS@I+6hDN_d z_fBk;BXQ?5uQxfDnx9qetW5;ZqD+=Xm z-y`b`B28VfGt=Pp$Ry*XMk!glevmwEEK(+N%L%+02F)=_kW8=$`U0s)EIou-um>_XtW@Xv<7Gd2%%8O;d;^TLzO;MVkO1i3o-H81nL-$3ZKfI!$pJ_ z2d-NP)={xW#hZg=D-AVYo2ihCC5-HrtWb0lRW6+i4Vi!U?D?Yzfek}!@1tP_caEIF6&;q!UyBA;x5=9T$Gvlyz zfnK{ylff1L!9=&2F9tjuh=e5w+-dYAW#04yS~>;Yc$V!Ch|2hsy$@?Q|)0zBw}U z?$S4Km(_0`J;3|9+9-o#tEbKIj4e`(W>Am*aX;t}BTy_PLhdP|$I*o-qCP zUF*A3BHrkzQ+@)Md+K%Jv0EL9UMA7FOs*JewKi1IS3z@}Rk>C{b(SV}_6sYdI#j4f zMrvyKCasmgug8bItBvOzRJXM|jV6AJm>aI!go~0JoO3ady1u5Sy|LDGP;PG{#_$xp zLU_sEZ*&dVTP;=Ar1;25;oRSEka{0SOxnCxBKP_iHY$=05p@*ClZx;d5@t zwf$i{hwpE@LanL9zuulD&D1gdqVAN&RllQZ==%3qjaQ+2`idCABwX>{K4w#fs6tvi zbBv3Qd#)X2m331@jW}{@MiAmt0$l1H*?a8$fz`|7 zSWZ(|IUC{5wR-`wl+|>YZz=|K%ASJa+VUdqF_wZs@R$^$f>_E;XcJ^2-ZI9<%Q)NY zkrqv09zo(oV&b;7JmDLZY1x`B1F@zfA_L3J#j`BiP^Nq}fjfE|YirT#K~gv4h?M=( zE%@H|+~_|rT9>hT4IP-pnaFTLe>v+4Xv~4o-%Cn>+$qJ6S-gdMo1GW2ru8` zEn4*or6%s~?!rMXlfSW>^rAVakvRqBhPqogzS)7vT)AGycz(4L*KsI_>13iB-E4g8 zsLJD%OGE+{u3vGZ6S9&0sWRAX-q_GwlLOr*xOZ~WZ_a2T5=a3=F{tOYL!Z+| z9}9wK^)o7&JIcEX$IFj?WYiiz;8=Gv93uyyHqc?*qEycLBb_|j)9%Lz$Rrpe26}Rk zv1kLq$)~>Aa_#wo0NA4nX3+wf8P2Y!hWXX1DhuRq-=d&V{-GIOUah9R((4P6vzjt6 zecodMtMS@{61`%W90dW56xP{bj_t!EtAU0Q0(`;5?LC3MGe^93zqQVe2f>9x7!18V zj1pKxOT2Tu!-)K#r;Fk-V9Of#4nm8D|1sl;cf`W*qa`3N&I831x&#c~1d-tntjte! z5D~6M*sgh#9;E9&HNgfEZqSv+o~zcloXd|52`KG;EoI;ofl%4a8S;5* z^`NB3(7zaxnDQ4gk(wK-894Tqm9D!}$uN_?SntV`suUGxz}Ld+#|v4;M??tB_h>~> zx=(F8Z9Q80CI0ui2IvM|3+JYjD*6?WimT3B!~E-^3cW!B$6bJ|b`|4-PcUGl!(%5V zu%sjpey!QQlaY;06n(3gnn}`^h*pU!Hhms|=*j_%DesrC#@^e#01U=Wl;{c+K{`Yp z6wk7)6b_dQ(!|~^cgPU7V14X;fU3jSe5*KN8HWjrI&hR4l@%|j?&ta!iXP8Pm?3Wg z!4P>Rls}CK!u`se?dQFHgvJml{-4|?B2f2(E?DsFR%6(@BKe@UhCY^2(mO7Kd8N2W9h--J=oZrzsKxg*n?CpsFP%P}KuBtlT zxtHgUR+pO5O5=`h(DA4@A9yE5(HZb?sqdU)AGxR9X95Whzg@% zZml%NqtG4E)S|6fWoxr$1KiUa#^E%s0s<%TOpAWnmxx@Lwt;R_=Kdk2+C~TrgLJ|nKRu@*JfYnYJQg|pC8`F@<#Cyoy+6x$ zMw=XXFBfx7?!_BG0lyM|g{m5~`&{@iy%JWYVHmo5$TYkk4P){n(^3?{N`>o3mCNhj zL5|8f`SZOEchdvbONfBo(38@3g=6a=c39_)4ql^&jr#WBYC2jvu5Xp;=sF!9-_tt` zBn+-gx=^OiOeg*NZHH-wij5b$9L-AWuy!o2Jrf!h(T|*vDH{ljVz*3Ty8y5|PyuNjr{v}W{^)G7_TZ%C90GALq#IMFP4`{q|~S9P1WyPO$?u8$3; zS?4j<#s~aod|db= z?yy%pHQ(GgUhdA8FQ|n|E3=3R1(UctIlnGYbu|oN@-97em25AgBz<7fGs@&bqU~Ty zoACqQZEmVAP)TsNyI?siWJq~~m6rdr_n0E%Y8&{-(v3iDAh_AO>{ajAHG zPX_6xoCdAs66Ks#=2>lFqpWZ}k~(A{9=GxP)u#!}G9n5okzYoEh0=bK8=h?DqYI5} zg!8Q@#p>&MPe&nK^9Mr}gT=@Uh`H+yv0czmuM=;=&y6lM*4ztg*#r8hf0n%uN(i5T z!>L(VVWcQ-mhpaNGWY_OG%8f5L|&m&r7#{-bQF+`^A}>;;WS2j?7TS znZAo})#Xc4!cI{CyKQ#JJg*4B3mqrEVM3Y?BrqQC<_&TGBHcaqgvT@7k|Ee4_yKc4 z;EF&z>>BYB(Hqf@s@k!KB;8W=1Iu#1_S#m1F^r#$AFq~8dZOoLR0u!KI4u`?AcN)U zx7zu4Ha-##ief1NN2Tsp60cVhGxaftYTZ8M*P6l(;jf?66~t;C_AfQZgB3j>>2WSN zn0pw(Dk7#y;-QYkWVv$pDUXY`yq#qkmwVlec})Ti%lG3)ZtWNJV^pWMB+Y{bV;?Ud zfD2|R+9z-^1g@|;sA3rpsvdn*Rw*Uauj{-GlH*0QYC;g{str083P^-ka1^gJXM#qI z-yG%Do!4oRH9`oku=^nw)NJBC*pQS5uNCUdijD&Jt;qcD_i4&xE)pacq8PEjEO_AiB{1P$U6hPSSpxlKn0NQ;Y5 zQA22x-Y`+(B(1SQ%kI5}mN zOFO?-V6~`&btO8G%@nQ4^HOA|@$;E`KFY%f;`HNod_wXLY#x+bcUd!STMdRw9o__1 zKW7V)VAr`JpUIwVlQseY&A>5nQv(-ow$?8cl@h(N&jhCrFVeH)^-9-h$AR-6m4;rF zN1s;}_o(42@{qXt(^*>H61L^(QqH$NClJe6tVCJub-AVFin;^B>iPH@=4r=gAa5^m zK4d-_QD6Qc+Y$K^Blt$@^-udujY5}WQS+RFv%}Dd(JF`X5A6%G;}O*-b!VF$vFl^toWRnl+VJ

    ?WYJ`RQ$-6O&k(<24?MYFdTPFA;X zCr?!yWN>`=a`Px7gmJY$RitgfTl;NGUT))d$xWRmmml%V1mX|QeIPdcTlDGNB)(3? z+Z3@~!0f|{7fpeekXg6+VI!HGSFg6c@~0@k4W}f=C9hULOYQ{O9J@3|orgQTuQag+ zl`CQnhyGrWhES)UKas~gU=pc&lUa$@Z_^zzeHf>$;Ct1pGW)8BzeVhz%;vNml;Yt9 zpBMIc?_^R_(R%nseJdt#Y7cJ01mB|e%>NcW4!(_+mR8r&IVXF$Vdon&GxL0&*KY$c zNye#I-VPWieJ^~yXXn77R`Lmn*C+3ff*Qr02c}DRR#m3r&I@&F#jK(Hw@0!yd5T7% z>h@(uk79%Kcw@z@3H2Y4z>cFrNH4rCg5SJUOj3Oz(f+9u74iEXmmyw7wI_pZ;?U*R z({v-(dNopdmGBc;NSVHT>f$J8SNlLHVi!gjOuxacnqL+Z@3T0B5=olrx8G^NalMnB zsqc=A5ETPybh_JTg!V+?r1m;#?1yx_m%Bm>1b30k$>G}2L?6t+NTy5h5f4U#u z3zv{Y700#hq^Y!PEPKxFt|!c{H8utbFFn<>ALrAcFeP`^y?(n62PYfb7zXE}?N|eQ z==n>z%hGm!srqYBS`GS{-5zcEq7)pzeNgw{WX%Grd$7BdlpWbsODoXPsBZPTqV$P8z)bv4Xsm8Egu5iSRpI@lATAIiaIIGp)Tf^m{Ar?%3 zIQTc9pY<%S0H+WN;?*_VCDxcIxUGG65>5Zc7rA9mfV68@N4EnbaXgZkgap?0f@jV+ zkTfWyY97SC*+rSG83%4Un66V{?mCuw&vKJ$nW&)YY$0Xg^RbN% zZ%dXL)a*b6_zE0BY(yEx?qvEupuM3a5NbL3lBEWTFnCx zu{1`{)Ueo-2;K>jmMOEJJBvpc;ZEZ+0?QDG6ruO&@!>Da2&_JENQ{S5Az6RR8aDK^ z%O6wXc7l|G8O23UdvSCp)DEyB-9C5?L3zS@!omuo?!sTDBA4tuVf%MH)r=mwIjLv9 zSr7tJp&1Y9kW58%%l{CSiezeeDMXHM91uA(Ho-TS2{*NDv zY05Z9=oE;NZZs@}f`fVFjWjcIR*_X069#83PD2U&AIEdd@F^&MGYZ_*A(JwHCR%8b zKw|t8DP(D7DT+bD4;hplB3n)U#ErPRRbqa5b059shvMvaQx(ErQs6DEp%;+h~tc|YheZ+gB{uo2bPL3dWYfBuxWy?8Y)yP?XO)}yey%T`$>;-3(Jh0 z3;H+VUm2{%@mUEYaPbJ=?ogt53~)Qi7?WT%jfHay1n)b#f(BvFl#ETZ>8as}>fb9u zV=fxsiQECzm-`_J*HUiP&_7qtaoq^2qA5X0dL`>Hx~HQSW)?Zx>N8g6B|GrU*e!^v z`Hb3&*SNv1NTEu3(@)kt!mi6LyXbr4PEiw6-U_<9zh-A=ognw}y}(?v1cGCps84;Z z8Gs8rBqS>NVyl65aWHk((GpF;4sn%1OYyL>BWFlxym>Pibr$yjQRR(BuVeR odu>N+INHz}BbWr2Y2F7*L_7LGSwY1A?x%VyrzTq?Z65mn0H7Wo>i_@% diff --git a/deploy/core/img/loaderlight.gif b/deploy/core/img/loaderlight.gif deleted file mode 100644 index df8c0447f66298c472f9b468f66466e51dcd6112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3316 zcmb`Jdr*?;9>-r02>}feT{J6nEkME0G;y^AFDT-L5)raoyrfxK=D4XH+YuBKZ)x5z zvjolZMqW#;cGR@AQfu>;tF39eZJK*_*ETzcIURKK>~{9doMz&`cix%zc|Y&>`};i4 z>&|3Q?SpjzU7!m9V&%%(d&>NFW%sx;MWGy;Q@(rm4gdg?cL*Ohj-Lyi?PhIB(EzR7 zdJEBl0#JaYx>h}`3jiAKu39gw@WHu8_PlT~2dBP(DFzpN1c z&i3G`vZ715^qaDIK$+S29(4r=03aNc2fuRP4vix<7mSxB+~wlH%33&`)MJWhxJjWN z4SSkDZ#Zh+k&; zcIdwU=uZOk`+r~O=llT2Jkh;nDUS_vom#^J3 z`hLj&lEvdgSuiFjQ+qVM+Ia&TOHtB~9jR|V73#C`%dGVE409;l<2kKB1c?=T%|s%a zjfZ$P8ogcD46lM}J=D@iz{+>qkRlKUPA=G(3;r>WiB*Jo%V-mlCbE2Mz%$Hc2n{Dm zend$vlvl1BdzEjvSH__5^brs`-NTp+_fFcr?9)};aA`p=uODsWvNPCjX3_R@usVcU z?PQhhuF>rTgDY7RR<#y~avz&+6VnDM_*vQ|-*3izmyH&wtDXF2X#%Zd^H50mOEBHz zJPFQNWea5`Xc(y2mP%gbIe`u{);jqpXPi~ecy3{=JD1$ZzEMAsZ)fi;)xV9as5u99 zHBQ!XCvHg?T?*Q5zc)Fwrh-S-_hP)*>60NN&Op*^ZX#^VPlcn^k%VebWAdai^;yEk z(mTQ5izQwGsezuNh#L=BbgbtsoaeVEGO}g1=P(>$7`k^sAo9geQ482rd3$B`sDo|n zBeA5q5S`@Mc6&qg6ZD(G#4J5Swd`qp6_`}pPp44Wh%AhnjQc7qJe6=+G~G;I+Jj;! zFlp0xMV~wr;D2%3>(Lkyl|^U9$YH!XG@e#d>WP>VcW~ti5t7vttAS4Nwb z>%z3s*M|FpW5x|u9lRLaH+(_jH*$J=Q<1x{)EU)fh#@&ZD2}>*pn=z9t+oUIaw_q4 z&Vy~fT!Aad?1^^G6>I8uJx=P8TQJT@E8S3IL@7oX7Q=f?k?JSsg+Mqpd$bifdPly3h)k6)VHw??EipdV ziN^$vK6NGDYAIxQP9Nxyw)J5Kxuax+FQ6uD&O?$)vOaSuW1PaUz9B$Ga>Uf2o|z8W zjYWUU3IemQJPaLsVW0`x5r8AWo)#ZZ+;{SUJD#@FwtTSQjgda+{rrBMF1%{UVp!ks zrnI$!HoBa5r69YE%J9@)T$I-9s2@5e9Cigg6gJiJYDacgO@IV|J zExP#S^!0&T;~wrmK9@fm`K{m_)6QoT?FzQ9IZZ~QevM7M(JU@JM(9>L(tUB!JabB? zS$HVcQwt6*tS7`GM50laje)G=*V%*IrqM%y!$~G%Z5}`AkWrOmuhAM;- z&T~ILVFvkai+nR|yjIQ!mbm=Il8t)jJK42|aj0z|13jz$*HMoU!7OUuG2I1i5Fvlt zou%0nQ}GnhX#Bi?QcF>>^A;_&Y+9?1NIB+qt;M5JxbieTiPiWH?(C0S;WAuC$U^t@ zKP@sln^2mkOXTw}i1DgXtd%dZB_q!V@jOi8fOo6)0GAkXxE+aYom{sNBfbglQi~&; zRYx+%%nc`{jiAYh;BjvDvsO{D#TH28M7nGu5pP%ywxA)?c4RyvNH|ARyd%VsvM&;@ ziv+uSxn*2n$eK{Jp2c6c%y~!ZvbuX$kxpI%`zTFlE1Jx-^_ZodE!_I^&I_1< zth$o|vsAW^#PeIk(}Q1s*QVo(Nv!2rOJktsXALR?D~B3v#TP7gpH<5+`sXkslUnA- znYM&YcR712wFxKVE8~Qh0xg&Jz*_njt>-##75eJIjML#y-CX}cy_g39(Jcr_NT94< zigW})P0Ze+4VhV=k+yDsP!xTVAAW{h22;o2@ZOVkzI{XkiHf<|g$L!Ml7=zWxlef< zrqFb}npAy1MXsk~VbPx>MA~1>RQ-(5NSIWTkV_z8HP`}YK-iOa(fa1+B~OYPT*)bc M&og7-C=lTAZ~Gy{DF6Tf diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index b58a4a701..bdda0032e 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -55,7 +55,6 @@ [:app :lt.objs.keyboard/chord-timeout 1000] [:app :lt.objs.files/file.ignore-pattern "(^\\..*)|\\.class$|target/|svn|cvs|\\.git|\\.pyc|~|\\.swp|\\.jar|.DS_Store|\\.nrepl-port"] [:app :lt.objs.style/provide-skin "dark" "core/css/skins/new-dark.css"] - [:app :lt.objs.style/provide-skin "light" "core/css/skins/new-dark.css"] [:app :lt.objs.style/provide-skin "new-dark" "core/css/skins/new-dark.css"] [:app :lt.objs.style/provide-theme "3024-day" "core/css/themes/3024-day.css"] [:app :lt.objs.style/provide-theme "3024-night" "core/css/themes/3024-night.css"] diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index ae0ac226b..cea7962db 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -17,10 +17,7 @@ :reaction (fn [this] (object/raise this :destroy))) -(defn ->lt-image [stts] - (str "img/lighttabletext" (if (= (:skin stts) "light") - "light" - "dark") ".png")) +(def ->lt-image (constantly "img/lighttabletextdark.png")) (defui docs [] [:button "Light Table's online docs"] From 9bfcf65273da7515cf2e3e3b7387dc032910da41 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 9 Jan 2016 03:28:26 -0500 Subject: [PATCH 568/656] Allow case sensitive renaming - close #1352 Latest fs has a rename that is case sensitive. Exists check wasn't case sensitive on osx but able to work around that by checking if case differs --- src/lt/objs/files.cljs | 8 +------- src/lt/objs/sidebar/workspace.cljs | 6 ++++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 5e6d54409..5392526a9 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -243,13 +243,7 @@ (defn move! "Move file or directory to given path" [from to] - (if (dir? from) - (do - (.copyDirSyncRecursive wrench from to) - (.rmdirSyncRecursive wrench from)) - (do - (save to (:content (open-sync from))) - (delete! from)))) + (.renameSync fs from to)) (defn copy "Copy file or directory to given path" diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index 98176ae98..b35feccc9 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -290,7 +290,8 @@ (let [path (:path @this) neue (files/join (files/parent path) n)] (when-not (= path neue) - (if (files/exists? neue) + ;; In OSX rename is case-sensistive but exists check isn't + (if (and (not= (string/lower-case path) (string/lower-case neue)) (files/exists? neue)) (popup/popup! {:header "Folder already exists." :body (str "The folder " neue " already exists, you'll have to pick a different name.") :buttons [{:label "ok" @@ -312,7 +313,8 @@ (let [path (:path @this) neue (files/join (files/parent path) n)] (when-not (= path neue) - (if (files/exists? neue) + ;; In OSX rename is case-sensistive but exists check isn't + (if (and (not= (string/lower-case path) (string/lower-case neue)) (files/exists? neue)) (popup/popup! {:header "File already exists." :body (str "The file" neue " already exists, you'll have to pick a different name.") :buttons [{:label "ok" From 8d810afde605fd50c688955aca87975e46e0d6be Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 9 Jan 2016 15:03:11 -0500 Subject: [PATCH 569/656] Improve menu usability for linux and windows - close #1143 Add access keys and add close LT and other menu items that had only been on osx under File for windows and linux. "Close file" was moved up on File as it looked weird to have a separator just for itself --- src/lt/objs/menu.cljs | 100 ++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 55206cb6c..22a43e45a 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -116,23 +116,29 @@ {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"} {:type "separator"} (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) - {:label "File" :submenu [(cmd-item "New file" :new-file) - (cmd-item "Open file" :open-file) - {:label "Open folder" :click #(do - (cmd/exec! :workspace.show :force) - (cmd/exec! :workspace.add-folder))} - (cmd-item "Open recent workspace" :workspace.show-recents {}) - (cmd-item "Save file" :save) - (cmd-item "Save file as.." :save-as) - {:label "Settings" :submenu [(cmd-item "User keymap" :keymap.modify-user) - (cmd-item "User behaviors" :behaviors.modify-user) - (cmd-item "User script" :user.modify-user)]} - {:type "separator"} - (cmd-item "New window" :window.new) - (cmd-item "Close window" :window.close) - {:type "separator"} - (cmd-item "Close file" :tabs.close) - ]} + + {:label "&File" :submenu (into [(cmd-item "New file" :new-file) + (cmd-item "Open file" :open-file) + {:label "Open folder" :click #(do + (cmd/exec! :workspace.show :force) + (cmd/exec! :workspace.add-folder))} + (cmd-item "Open recent workspace" :workspace.show-recents {}) + (cmd-item "Save file" :save) + (cmd-item "Save file as.." :save-as) + (cmd-item "Close file" :tabs.close) + {:label "Settings" :submenu [(cmd-item "User keymap" :keymap.modify-user) + (cmd-item "User behaviors" :behaviors.modify-user) + (cmd-item "User script" :user.modify-user)]} + {:type "separator"} + (cmd-item "New window" :window.new) + (cmd-item "Close window" :window.close)] + (when-not (platform/mac?) + [{:type "separator"} + (cmd-item "About Light Table" :version) + {:label "Hide Light Table" :accelerator "Control+H" :selector "hide:"} + {:label "Hide Others" :accelerator "Control+Alt+H" :selector "hideOtherApplications:"} + (cmd-item "Quit Light Table" :quit {:accelerator "Control+Q"})]))} + (if (platform/mac?) {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:selector "undo:" :accelerator "CommandOrControl+Z"}) (cmd-item "Redo" :editor.redo {:selector "redo:" :accelerator "CommandOrControl+Shift+Z"}) @@ -140,37 +146,35 @@ (cmd-item "Cut" :editor.cut {:selector "cut:" :accelerator "CommandOrControl+X"}) (cmd-item "Copy" :editor.copy {:selector "copy:" :accelerator "CommandOrControl+C"}) (cmd-item "Paste" :editor.paste {:selector "paste:" :accelerator "CommandOrControl+V"}) - (cmd-item "Select All" :editor.select-all {:selector "selectAll:" :accelerator "CommandOrControl+A"}) - ]} - {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo) - (cmd-item "Redo" :editor.redo) - {:type "separator"} - (cmd-item "Cut" :editor.cut) - (cmd-item "Copy" :editor.copy) - (cmd-item "Paste" :editor.paste) - (cmd-item "Select All" :editor.select-all) - ]} - ) - {:label "View" :submenu [(cmd-item "Workspace" :workspace.show) - (cmd-item "Connections" :show-connect) - (cmd-item "Navigator" :navigate-workspace-transient) - (cmd-item "Commands" :show-commandbar-transient) - (cmd-item "Plugin Manager" :plugin-manager.show) - {:type "separator"} - (cmd-item "Language docs" :docs.search.show) - {:type "separator"} - (cmd-item "Console" :toggle-console) - (cmd-item "Developer Tools" :dev-inspector)]} - - {:label "Window" :submenu [(cmd-item "Minimize" :window.minimize) - (cmd-item "Maximize" :window.maximize) - (cmd-item "Fullscreen" :window.fullscreen)]} - {:label "Help" :submenu [(cmd-item "Documentation" :show-docs) - {:label "Report an Issue" :click #(do - (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))} ;; TODO: Add report an issue on GitHub menu item - TWM - (when-not (platform/mac?) - (cmd-item "About Light Table" :version))]} - ])) + (cmd-item "Select All" :editor.select-all {:selector "selectAll:" :accelerator "CommandOrControl+A"})]} + {:label "&Edit" :submenu [(cmd-item "Undo" :editor.undo) + (cmd-item "Redo" :editor.redo) + {:type "separator"} + (cmd-item "Cut" :editor.cut) + (cmd-item "Copy" :editor.copy) + (cmd-item "Paste" :editor.paste) + (cmd-item "Select All" :editor.select-all)]}) + + {:label "&View" :submenu [(cmd-item "Workspace" :workspace.show) + (cmd-item "Connections" :show-connect) + (cmd-item "Navigator" :navigate-workspace-transient) + (cmd-item "Commands" :show-commandbar-transient) + (cmd-item "Plugin Manager" :plugin-manager.show) + {:type "separator"} + (cmd-item "Language docs" :docs.search.show) + {:type "separator"} + (cmd-item "Console" :toggle-console) + (cmd-item "Developer Tools" :dev-inspector)]} + + {:label "&Window" :submenu [(cmd-item "Minimize" :window.minimize) + (cmd-item "Maximize" :window.maximize) + (cmd-item "Fullscreen" :window.fullscreen)]} + + {:label "&Help" :submenu [(cmd-item "Documentation" :show-docs) + {:label "Report an Issue" :click #(do + (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))} ;; TODO: Add report an issue on GitHub menu item - TWM + (when-not (platform/mac?) + (cmd-item "About Light Table" :version))]}])) (behavior ::create-menu :triggers #{:init} From 35a27be56cc871c22f7a61a9b708c890f3537d39 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 9 Jan 2016 15:08:42 -0500 Subject: [PATCH 570/656] Remove stale todos in menu and related locations from #1297 --- src/lt/objs/intro.cljs | 4 ++-- src/lt/objs/menu.cljs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/intro.cljs b/src/lt/objs/intro.cljs index ae0ac226b..60b82c4f4 100644 --- a/src/lt/objs/intro.cljs +++ b/src/lt/objs/intro.cljs @@ -27,7 +27,7 @@ :click (fn [] (cmd/exec! :show-docs))) -(defui reports [] ;; TODO: Added report button to click - TWM +(defui reports [] [:button "GitHub"] :click (fn [] (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))) @@ -48,7 +48,7 @@ [:img {:height 40 :src (bound style/styles ->lt-image)}]] [:p "Welcome to the latest version of Light Table. To see the full list of what's been added/changed, checkout the " (changelog) ". Some of the highlights include deeper Javascript support, inline browsers, and Python eval! If you're new, you might want to take a look at " (docs) " to get started."] - [:p "If you run into any problems, report the issue on " (reports) "!"] ;; TODO: Added button to click for reporting issue - TWM + [:p "If you run into any problems, report the issue on " (reports) "!"] ])) (behavior ::show-intro diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 22a43e45a..4654282e3 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -172,7 +172,7 @@ {:label "&Help" :submenu [(cmd-item "Documentation" :show-docs) {:label "Report an Issue" :click #(do - (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))} ;; TODO: Add report an issue on GitHub menu item - TWM + (cmd/exec! :add-browser-tab "https://github.com/LightTable/LightTable/issues?state=open"))} (when-not (platform/mac?) (cmd-item "About Light Table" :version))]}])) From 2ae0552cdb410c7ec3ef6eb6eb136627665c420c Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 9 Jan 2016 15:43:06 -0500 Subject: [PATCH 571/656] Update menu selector to role selector has been deprecated and is no longer mentioned in electron docs - https://github.com/atom/electron/blob/master/docs/api/menu-item.md#new-menuitemoptions Also removed two previously added osx menu items which didn't do anything in linux or windows --- src/lt/objs/menu.cljs | 52 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/lt/objs/menu.cljs b/src/lt/objs/menu.cljs index 4654282e3..ca9e9e3f4 100644 --- a/src/lt/objs/menu.cljs +++ b/src/lt/objs/menu.cljs @@ -80,40 +80,40 @@ ([label cmd opts] (merge {:label label - :click (when-not (:selector opts) + :click (when-not (:role opts) (fn [] (cmd/exec! cmd)))} opts (command->menu-binding cmd)))) (defn unknown-menu [] - (set-menubar [ - (when (platform/mac?) + (set-menubar [(when (platform/mac?) {:label "" :submenu [(cmd-item "About Light Table" :version) {:type "separator"} - {:label "Hide Light Table" :accelerator "Command+H" :selector "hide:"} - {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"} + {:label "Hide Light Table" :accelerator "Command+H" :role "hide"} + {:label "Hide Others" :accelerator "Command+Alt+H" :role "hideothers"} {:type "separator"} (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) - {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:selector "undo:" :accelerator "CommandOrControl+Z"}) - (cmd-item "Redo" :editor.redo {:selector "redo:" :accelerator "Command+Shift+Z"}) + + {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:role "undo" :accelerator "CommandOrControl+Z"}) + (cmd-item "Redo" :editor.redo {:role "redo" :accelerator "Command+Shift+Z"}) {:type "separator"} - (cmd-item "Cut" :editor.cut {:selector "cut:" :accelerator "CommandOrControl+X"}) - (cmd-item "Copy" :editor.copy {:selector "copy:" :accelerator "CommandOrControl+C"}) - (cmd-item "Paste" :editor.paste {:selector "paste:" :accelerator "CommandOrControl+V"}) - (cmd-item "Select All" :editor.select-all {:selector "selectAll:" :accelerator "CommandOrControl+A"}) + (cmd-item "Cut" :editor.cut {:role "cut" :accelerator "CommandOrControl+X"}) + (cmd-item "Copy" :editor.copy {:role "copy" :accelerator "CommandOrControl+C"}) + (cmd-item "Paste" :editor.paste {:role "paste" :accelerator "CommandOrControl+V"}) + (cmd-item "Select All" :editor.select-all {:role "selectall" :accelerator "CommandOrControl+A"}) ]} - {:label "Window" :submenu [(cmd-item "Minimize" :window.minimize {:selector "performMiniaturize:" :accelerator "Command+M"}) - (cmd-item "Close window" :window.close {:selector "performClose:" :accelerator "Command+W"})]} - {:label "Help" :submenu []} - ])) + + {:label "Window" :submenu [(cmd-item "Minimize" :window.minimize {:role "minimize" :accelerator "Command+M"}) + (cmd-item "Close window" :window.close {:role "close" :accelerator "Command+W"})]} + + {:label "Help" :submenu []}])) (defn main-menu [] - (set-menubar [ - (when (platform/mac?) + (set-menubar [(when (platform/mac?) {:label "" :submenu [(cmd-item "About Light Table" :version) {:type "separator"} - {:label "Hide Light Table" :accelerator "Command+H" :selector "hide:"} - {:label "Hide Others" :accelerator "Command+Alt+H" :selector "hideOtherApplications:"} + {:label "Hide Light Table" :accelerator "Command+H" :role "hide"} + {:label "Hide Others" :accelerator "Command+Alt+H" :role "hideothers"} {:type "separator"} (cmd-item "Quit Light Table" :quit {:accelerator "Command+Q"})]}) @@ -135,18 +135,16 @@ (when-not (platform/mac?) [{:type "separator"} (cmd-item "About Light Table" :version) - {:label "Hide Light Table" :accelerator "Control+H" :selector "hide:"} - {:label "Hide Others" :accelerator "Control+Alt+H" :selector "hideOtherApplications:"} (cmd-item "Quit Light Table" :quit {:accelerator "Control+Q"})]))} (if (platform/mac?) - {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:selector "undo:" :accelerator "CommandOrControl+Z"}) - (cmd-item "Redo" :editor.redo {:selector "redo:" :accelerator "CommandOrControl+Shift+Z"}) + {:label "Edit" :submenu [(cmd-item "Undo" :editor.undo {:role "undo" :accelerator "CommandOrControl+Z"}) + (cmd-item "Redo" :editor.redo {:role "redo" :accelerator "CommandOrControl+Shift+Z"}) {:type "separator"} - (cmd-item "Cut" :editor.cut {:selector "cut:" :accelerator "CommandOrControl+X"}) - (cmd-item "Copy" :editor.copy {:selector "copy:" :accelerator "CommandOrControl+C"}) - (cmd-item "Paste" :editor.paste {:selector "paste:" :accelerator "CommandOrControl+V"}) - (cmd-item "Select All" :editor.select-all {:selector "selectAll:" :accelerator "CommandOrControl+A"})]} + (cmd-item "Cut" :editor.cut {:role "cut" :accelerator "CommandOrControl+X"}) + (cmd-item "Copy" :editor.copy {:role "copy" :accelerator "CommandOrControl+C"}) + (cmd-item "Paste" :editor.paste {:role "paste" :accelerator "CommandOrControl+V"}) + (cmd-item "Select All" :editor.select-all {:role "selectall" :accelerator "CommandOrControl+A"})]} {:label "&Edit" :submenu [(cmd-item "Undo" :editor.undo) (cmd-item "Redo" :editor.redo) {:type "separator"} From 5c1ca3747e0c69c3a1f99738ad8cdcfd387b4a67 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 10 Jan 2016 01:43:08 -0500 Subject: [PATCH 572/656] Fix behavior indentation - close #1986 --- src/lt/object.cljs | 72 ++++---- src/lt/objs/animations.cljs | 22 +-- src/lt/objs/app.cljs | 64 +++---- src/lt/objs/browser.cljs | 272 +++++++++++++++--------------- src/lt/objs/canvas.cljs | 8 +- src/lt/objs/clients.cljs | 76 ++++----- src/lt/objs/clients/local.cljs | 8 +- src/lt/objs/clients/tcp.cljs | 12 +- src/lt/objs/clients/ws.cljs | 6 +- src/lt/objs/document.cljs | 48 +++--- src/lt/objs/files.cljs | 30 ++-- src/lt/objs/jump_stack.cljs | 36 ++-- src/lt/objs/keyboard.cljs | 10 +- src/lt/objs/langs/behaviors.cljs | 100 +++++------ src/lt/objs/langs/keymap.cljs | 96 +++++------ src/lt/objs/opener.cljs | 212 +++++++++++------------ src/lt/objs/proc.cljs | 64 +++---- src/lt/objs/sidebar/clients.cljs | 48 +++--- src/lt/objs/sidebar/navigate.cljs | 80 ++++----- src/lt/objs/statusbar.cljs | 6 +- src/lt/objs/style.cljs | 108 ++++++------ src/lt/objs/thread.cljs | 66 ++++---- src/lt/objs/version.cljs | 14 +- src/lt/objs/workspace.cljs | 146 ++++++++-------- 24 files changed, 802 insertions(+), 802 deletions(-) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index 0cefd7839..a5c62cc64 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -436,45 +436,45 @@ (rem-behavior! cur b))) (behavior ::add-tag - :desc "App: Add tag to object" - :params [{:label "tag"}] - :type :user - :triggers #{:object.instant} - :reaction (fn [this t] - (when t - (add-tags this (if (coll? t) - t - [t]))))) + :desc "App: Add tag to object" + :params [{:label "tag"}] + :type :user + :triggers #{:object.instant} + :reaction (fn [this t] + (when t + (add-tags this (if (coll? t) + t + [t]))))) (behavior ::remove-tag - :desc "App: Remove tag from object" - :params [{:label "tag"}] - :type :user - :triggers #{:object.instant ::tags-added} - :reaction (fn [this t] - (when (has-tag? this t) - (remove-tags this (if (coll? t) - t - [t]))))) + :desc "App: Remove tag from object" + :params [{:label "tag"}] + :type :user + :triggers #{:object.instant ::tags-added} + :reaction (fn [this t] + (when (has-tag? this t) + (remove-tags this (if (coll? t) + t + [t]))))) (behavior ::shadow-tag - :desc "App: Shadow a tag on an object" - :params [{:label "tag to shadow"} - {:label "tag to add"}] - :type :user - :triggers #{:object.instant ::tags-added ::tags-removed} - :reaction (fn [this to-shadow to-add] - (let [has-shadow? (has-tag? this to-shadow) - has-add? (has-tag? this to-add)] - (cond - (and has-shadow? (not has-add?)) (add-tags this [to-add]) - (and (not has-shadow?) has-add?) (remove-tags this [to-add]) - :else nil)))) + :desc "App: Shadow a tag on an object" + :params [{:label "tag to shadow"} + {:label "tag to add"}] + :type :user + :triggers #{:object.instant ::tags-added ::tags-removed} + :reaction (fn [this to-shadow to-add] + (let [has-shadow? (has-tag? this to-shadow) + has-add? (has-tag? this to-add)] + (cond + (and has-shadow? (not has-add?)) (add-tags this [to-add]) + (and (not has-shadow?) has-add?) (remove-tags this [to-add]) + :else nil)))) (behavior ::report-time - :triggers #{:object.behavior.time} - :reaction (fn [this beh time trigger] - (when js/lt.objs.console - (js/lt.objs.console.log (str beh " triggered by " - trigger " took " - time "ms"))))) + :triggers #{:object.behavior.time} + :reaction (fn [this beh time trigger] + (when js/lt.objs.console + (js/lt.objs.console.log (str beh " triggered by " + trigger " took " + time "ms"))))) diff --git a/src/lt/objs/animations.cljs b/src/lt/objs/animations.cljs index 0680d1464..8ee4efb67 100644 --- a/src/lt/objs/animations.cljs +++ b/src/lt/objs/animations.cljs @@ -24,16 +24,16 @@ ;;********************************************************* (behavior ::animate-on-init - :triggers #{:init} - :reaction (fn [app] - (on))) + :triggers #{:init} + :reaction (fn [app] + (on))) (behavior ::toggle-animations - :desc "App: Enable or disable UI animations" - :triggers #{:object.instant} - :type :user - :reaction (fn [this active?] - (set! force-off (not active?)) - (if active? - (on) - (off)))) + :desc "App: Enable or disable UI animations" + :triggers #{:object.instant} + :type :user + :reaction (fn [this active?] + (set! force-off (not active?)) + (if active? + (on) + (off)))) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index 4ce73ee91..dcfa565aa 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -88,20 +88,20 @@ ;;********************************************************* (behavior ::refresh - :triggers #{:refresh} - :reaction (fn [obj] - (set! closing true) - (object/raise app :reload) - (when closing - (refresh)))) + :triggers #{:refresh} + :reaction (fn [obj] + (set! closing true) + (object/raise app :reload) + (when closing + (refresh)))) (behavior ::close! - :triggers #{:close!} - :reaction (fn [this] - (set! closing true) - (object/raise this :close) - (when closing - (close true)))) + :triggers #{:close!} + :reaction (fn [this] + (set! closing true) + (object/raise this :close) + (when closing + (close true)))) (behavior ::notify-init-window :triggers #{:init} @@ -134,15 +134,15 @@ (.setPosition win (ensure-greater js/localStorage.x 0) (ensure-greater js/localStorage.y 0))))) (behavior ::on-show-bind-navigate - :triggers #{:show} - :reaction (fn [this] - (dom/on ($ :#canvas) :click (fn [e] - (when (and (= (.-target.nodeName e) "A") - (not (.-defaultPrevented e))) - (dom/prevent e) - (when-let [href (.-target.href e)] - (platform/open-url href) - (.focus win))))))) + :triggers #{:show} + :reaction (fn [this] + (dom/on ($ :#canvas) :click (fn [e] + (when (and (= (.-target.nodeName e) "A") + (not (.-defaultPrevented e))) + (dom/prevent e) + (when-let [href (.-target.href e)] + (platform/open-url href) + (.focus win))))))) (behavior ::track-focus :triggers #{:focus :show} @@ -190,13 +190,13 @@ :reaction run-commands) (behavior ::run-post-init - :triggers #{:post-init} - :desc "App: Run commands after init" - :params [{:label "commands" - :type :list - :items cmd/completions}] - :type :user - :reaction run-commands) + :triggers #{:post-init} + :desc "App: Run commands after init" + :params [{:label "commands" + :type :list + :items cmd/completions}] + :type :user + :reaction run-commands) (behavior ::set-default-zoom-level :triggers #{:init} @@ -209,10 +209,10 @@ (cmd/exec! :window.zoom-reset))) (behavior ::add-platform-class - :triggers #{:init} - :reaction (fn [this] - (dom/add-class (dom/$ :body) (name platform/platform)) - )) + :triggers #{:init} + :reaction (fn [this] + (dom/add-class (dom/$ :body) (name platform/platform)) + )) ;;********************************************************* ;; Object diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index ccf902145..c4390250e 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -136,40 +136,40 @@ (object/raise (:devtools-client @this) :reconnect!))) (behavior ::destroy-on-close - :triggers #{:close} - :reaction (fn [this] - (object/raise this :inactive) - (object/destroy! (:devtools-client @this)) - (object/destroy! this))) + :triggers #{:close} + :reaction (fn [this] + (object/raise this :inactive) + (object/destroy! (:devtools-client @this)) + (object/destroy! this))) (behavior ::rem-client - :triggers #{:destroy} - :reaction (fn [this] - (when (= (ctx/->obj :global.browser) this) - (ctx/out! :global.browser)) - (when-let [b (first (remove #{this} (object/by-tag :browser)))] - (ctx/in! :global.browser b)) - (clients/rem! (:client @this)))) + :triggers #{:destroy} + :reaction (fn [this] + (when (= (ctx/->obj :global.browser) this) + (ctx/out! :global.browser)) + (when-let [b (first (remove #{this} (object/by-tag :browser)))] + (ctx/in! :global.browser b)) + (clients/rem! (:client @this)))) (behavior ::navigate! - :triggers #{:navigate!} - :reaction (fn [this n] - (let [bar (dom/$ :input (object/->content this)) - url (check-http (or n (dom/val bar)))] - (notifos/working) - (object/merge! this {:url url :loading-counter (inc (:loading-counter @this 0))})))) + :triggers #{:navigate!} + :reaction (fn [this n] + (let [bar (dom/$ :input (object/->content this)) + url (check-http (or n (dom/val bar)))] + (notifos/working) + (object/merge! this {:url url :loading-counter (inc (:loading-counter @this 0))})))) (behavior ::url-focus! - :triggers #{:url.focus!} - :reaction (fn [this] - (let [url-input (dom/$ :input (object/->content this))] - (dom/focus url-input) - (.select url-input)))) + :triggers #{:url.focus!} + :reaction (fn [this] + (let [url-input (dom/$ :input (object/->content this))] + (dom/focus url-input) + (.select url-input)))) (behavior ::focus! - :triggers #{:focus!} - :reaction (fn [this] - (dom/focus (dom/$ :webview (object/->content this))))) + :triggers #{:focus!} + :reaction (fn [this] + (dom/focus (dom/$ :webview (object/->content this))))) (behavior ::back! :triggers #{:back!} @@ -199,34 +199,34 @@ (dom/stop-propagation e))) (behavior ::menu+ - :triggers #{:menu+} - :reaction (fn [this menu] - (conj menu - {:label "forward" - :order 0 - :click (fn [e] - (cmd/exec! :browser.forward))} - {:label "back" - :order 1 - :click (fn [e] - (cmd/exec! :browser.back))} - {:type "separator" - :order 2} - {:label "copy" - :order 3 - :click (fn [e] - (.copy (to-frame this)))} - {:label "paste" - :order 4 - :click (fn [e] - (.paste (to-frame this)) - )} - ) - - - - - )) + :triggers #{:menu+} + :reaction (fn [this menu] + (conj menu + {:label "forward" + :order 0 + :click (fn [e] + (cmd/exec! :browser.forward))} + {:label "back" + :order 1 + :click (fn [e] + (cmd/exec! :browser.back))} + {:type "separator" + :order 2} + {:label "copy" + :order 3 + :click (fn [e] + (.copy (to-frame this)))} + {:label "paste" + :order 4 + :click (fn [e] + (.paste (to-frame this)) + )} + ) + + + + + )) (behavior ::init! @@ -257,104 +257,104 @@ (dom/val (dom/$ :input (object/->content this)) (.-href info)))) (behavior ::set-client-name - :triggers #{:navigate} - :reaction (fn [this loc] - (let [title (.getTitle (to-frame this)) - title (if-not (empty? title) - title - "browser")] - (object/merge! this {:name title}) - (tabs/refresh! this) - (dotimes [x (:loading-counter @this)] - (notifos/done-working)) - (object/merge! (:client @this) {:name loc})))) + :triggers #{:navigate} + :reaction (fn [this loc] + (let [title (.getTitle (to-frame this)) + title (if-not (empty? title) + title + "browser")] + (object/merge! this {:name title}) + (tabs/refresh! this) + (dotimes [x (:loading-counter @this)] + (notifos/done-working)) + (object/merge! (:client @this) {:name loc})))) (behavior ::update-devtools-client-url - :triggers #{:navigate} - :reaction (fn [this loc] - (object/merge! (:devtools-client @this) {:url loc}))) + :triggers #{:navigate} + :reaction (fn [this loc] + (object/merge! (:devtools-client @this) {:url loc}))) (behavior ::set-active - :triggers #{:active :show} - :reaction (fn [this] - (ctx/in! :global.browser this))) + :triggers #{:active :show} + :reaction (fn [this] + (ctx/in! :global.browser this))) (behavior ::active-context - :triggers #{:active :show} - :reaction (fn [this] - (ctx/in! :browser this))) + :triggers #{:active :show} + :reaction (fn [this] + (ctx/in! :browser this))) (behavior ::focus-on-show - :triggers #{:show} - :reaction (fn [this] - (object/raise this :focus!))) + :triggers #{:show} + :reaction (fn [this] + (object/raise this :focus!))) (behavior ::inactive-context - :triggers #{:inactive} - :reaction (fn [this] - (ctx/out! :browser))) + :triggers #{:inactive} + :reaction (fn [this] + (ctx/out! :browser))) (behavior ::handle-send! - :triggers #{:send!} - :reaction (fn [this msg] - (object/raise this (keyword (str (:command msg) "!")) msg) - )) + :triggers #{:send!} + :reaction (fn [this msg] + (object/raise this (keyword (str (:command msg) "!")) msg) + )) (behavior ::handle-refresh! - :triggers #{:client.refresh!} - :reaction (fn [this] - (object/raise (:frame @this) :refresh!))) + :triggers #{:client.refresh!} + :reaction (fn [this] + (object/raise (:frame @this) :refresh!))) (behavior ::handle-close! - :triggers #{:client.close!} - :reaction (fn [this] - (object/raise (:frame @this) :close) - (clients/rem! this))) + :triggers #{:client.close!} + :reaction (fn [this] + (object/raise (:frame @this) :close) + (clients/rem! this))) (behavior ::change-live - :triggers #{:editor.eval.js.change-live!} - :reaction (fn [this msg] - (when-let [ed (clients/cb->obj (:cb msg))] - (when (-> msg :data :path) - (devtools/changelive! ed (-> msg :data :path) (js/lt.plugins.watches.watched-range ed nil nil js/lt.objs.langs.js.src->watch) - (fn [res] - ;;TODO: check for exception, otherwise, assume success - (object/raise ed :editor.eval.js.change-live.success) - ) - identity))))) + :triggers #{:editor.eval.js.change-live!} + :reaction (fn [this msg] + (when-let [ed (clients/cb->obj (:cb msg))] + (when (-> msg :data :path) + (devtools/changelive! ed (-> msg :data :path) (js/lt.plugins.watches.watched-range ed nil nil js/lt.objs.langs.js.src->watch) + (fn [res] + ;;TODO: check for exception, otherwise, assume success + (object/raise ed :editor.eval.js.change-live.success) + ) + identity))))) (behavior ::js-eval-file - :triggers #{:editor.eval.js.file!} - :reaction (fn [this msg cb] - (when-let [ed (clients/cb->obj (:cb msg))] - (let [data (:data msg) - data (assoc data :code (str (:code data) "\n\n//# sourceURL=" (:path data)))] - (devtools/eval-in-webview-client (client->devtools this) data (fn [res] - (when cb (cb)) - ;;TODO: check for exception, otherwise, assume success - (object/raise ed :editor.eval.js.file.success))))))) + :triggers #{:editor.eval.js.file!} + :reaction (fn [this msg cb] + (when-let [ed (clients/cb->obj (:cb msg))] + (let [data (:data msg) + data (assoc data :code (str (:code data) "\n\n//# sourceURL=" (:path data)))] + (devtools/eval-in-webview-client (client->devtools this) data (fn [res] + (when cb (cb)) + ;;TODO: check for exception, otherwise, assume success + (object/raise ed :editor.eval.js.file.success))))))) (behavior ::html-eval - :triggers #{:editor.eval.html!} - :reaction (fn [this msg] - (object/raise this :client.refresh!))) + :triggers #{:editor.eval.html!} + :reaction (fn [this msg] + (object/raise this :client.refresh!))) (behavior ::css-eval - :triggers #{:editor.eval.css!} - :reaction (fn [this msg] - (let [info (:data msg) - frame (to-frame (:frame @this))] - (.send frame "editor.eval.css" #js {:name (:name info) - :code (:code info)}) - ))) + :triggers #{:editor.eval.css!} + :reaction (fn [this msg] + (let [info (:data msg) + frame (to-frame (:frame @this))] + (.send frame "editor.eval.css" #js {:name (:name info) + :code (:code info)}) + ))) (behavior ::cljs-exec - :triggers #{:editor.eval.cljs.exec!} - :reaction (fn [this msg] - (let [frame (to-frame (:frame @this)) - info (:data msg)] - (.send frame "editor.eval.cljs.exec" #js {:results (clj->js (:results info)) - :client (:cb msg)})))) + :triggers #{:editor.eval.cljs.exec!} + :reaction (fn [this msg] + (let [frame (to-frame (:frame @this)) + info (:data msg)] + (.send frame "editor.eval.cljs.exec" #js {:results (clj->js (:results info)) + :client (:cb msg)})))) (defn eval-js-form [this msg] (let [data (assoc (:data msg) :code (eval/append-source-file (-> msg :data :code) (-> msg :data :path))) @@ -377,16 +377,16 @@ (behavior ::js-eval - :triggers #{:editor.eval.js!} - :reaction (fn [this msg] - (let [devtools (client->devtools this)] - (if (must-eval-file? devtools msg) - (when-let [ed (object/by-id (:cb msg))] - (let [data (:data msg) - data (assoc data :code (str (editor/->val ed) "\n\n//# sourceURL=" (-> data :path)))] - (devtools/eval-in-webview-client (client->devtools this) data (fn [res] - (eval-js-form this msg))))) - (eval-js-form this msg))))) + :triggers #{:editor.eval.js!} + :reaction (fn [this msg] + (let [devtools (client->devtools this)] + (if (must-eval-file? devtools msg) + (when-let [ed (object/by-id (:cb msg))] + (let [data (:data msg) + data (assoc data :code (str (editor/->val ed) "\n\n//# sourceURL=" (-> data :path)))] + (devtools/eval-in-webview-client (client->devtools this) data (fn [res] + (eval-js-form this msg))))) + (eval-js-form this msg))))) ;;********************************************************* ;; Commands diff --git a/src/lt/objs/canvas.cljs b/src/lt/objs/canvas.cljs index 21f737066..7055a2473 100644 --- a/src/lt/objs/canvas.cljs +++ b/src/lt/objs/canvas.cljs @@ -30,8 +30,8 @@ ;;********************************************************* (behavior ::append-canvas - :triggers #{:show} - :reaction (fn [app] - (dom/css ($ :#loader) {:opacity 0}) - (dom/css ($ :#wrapper) {:opacity 1}))) + :triggers #{:show} + :reaction (fn [app] + (dom/css ($ :#loader) {:opacity 0}) + (dom/css ($ :#wrapper) {:opacity 1}))) diff --git a/src/lt/objs/clients.cljs b/src/lt/objs/clients.cljs index e18e850f9..88e087177 100644 --- a/src/lt/objs/clients.cljs +++ b/src/lt/objs/clients.cljs @@ -172,33 +172,33 @@ (def clients (object/create ::clients)) (behavior ::close-clients-on-closed - :triggers #{:closing} - :reaction (fn [app] - (doseq [[_ c] @cs] - (close! c)))) + :triggers #{:closing} + :reaction (fn [app] + (doseq [[_ c] @cs] + (close! c)))) (behavior ::on-destroy-remove-cb - :triggers #{:destroy} - :reaction (fn [this] - (rem-cb this))) + :triggers #{:destroy} + :reaction (fn [this] + (rem-cb this))) (behavior ::raise-on-object - :triggers #{:clients.raise-on-object} - :reaction (fn [this [id command data]] - (object/raise (object/by-id id) (keyword command) data))) + :triggers #{:clients.raise-on-object} + :reaction (fn [this [id command data]] + (object/raise (object/by-id id) (keyword command) data))) (behavior ::handle-message - :triggers #{:message} - :reaction (fn [obj [cb-id command data :as msg]] - (cond - (callback? cb-id) (call cb-id (keyword command) data) - (object/by-id cb-id) (object/raise (object/by-id cb-id) (keyword command) data) - :else (object/raise clients (keyword command) data)))) + :triggers #{:message} + :reaction (fn [obj [cb-id command data :as msg]] + (cond + (callback? cb-id) (call cb-id (keyword command) data) + (object/by-id cb-id) (object/raise (object/by-id cb-id) (keyword command) data) + :else (object/raise clients (keyword command) data)))) (behavior ::notify-connect - :triggers #{:connect} - :reaction (fn [obj client] - (notifos/set-msg! (str "Connected to " (:name @client))))) + :triggers #{:connect} + :reaction (fn [obj client] + (notifos/set-msg! (str "Connected to " (:name @client))))) ;;********************************************************** ;; individual Clients @@ -221,28 +221,28 @@ :tags #{:client}) (behavior ::try-send - :triggers #{:try-send!} - :reaction (fn [this msg] - (if (:connected @this) - (object/raise this :send! msg) - (object/raise this :queue! msg)))) + :triggers #{:try-send!} + :reaction (fn [this msg] + (if (:connected @this) + (object/raise this :send! msg) + (object/raise this :queue! msg)))) (behavior ::queue! - :triggers #{:queue!} - :reaction (fn [this msg] - (object/update! this [:queue] conj msg))) + :triggers #{:queue!} + :reaction (fn [this msg] + (object/update! this [:queue] conj msg))) (behavior ::on-connect-drain - :triggers #{:connect} - :reaction (fn [this] - (object/merge! this {:connected true}) - (doseq [q (:queue @this)] - (object/raise this :send! q) - ;;Tremendous hack to sleep for a tiny bit before sending the next. - (doall (range 10000))) - (object/merge! this {:queue []}))) + :triggers #{:connect} + :reaction (fn [this] + (object/merge! this {:connected true}) + (doseq [q (:queue @this)] + (object/raise this :send! q) + ;;Tremendous hack to sleep for a tiny bit before sending the next. + (doall (range 10000))) + (object/merge! this {:queue []}))) (behavior ::remove-placeholder-on-swapped - :triggers #{:swapped} - :reaction (fn [this] - (object/destroy! this))) + :triggers #{:swapped} + :reaction (fn [this] + (object/destroy! this))) diff --git a/src/lt/objs/clients/local.cljs b/src/lt/objs/clients/local.cljs index 045b81171..f07324c27 100644 --- a/src/lt/objs/clients/local.cljs +++ b/src/lt/objs/clients/local.cljs @@ -56,10 +56,10 @@ (defmethod on-message :default []) (behavior ::send! - :triggers #{:send!} - :reaction (fn [this data] - (on-message (keyword (:command data)) (:data data) (:cb data)) - )) + :triggers #{:send!} + :reaction (fn [this data] + (on-message (keyword (:command data)) (:data data) (:cb data)) + )) (defn init [] (clients/handle-connection! {:name client-name diff --git a/src/lt/objs/clients/tcp.cljs b/src/lt/objs/clients/tcp.cljs index 382b3349d..bce54f3b2 100644 --- a/src/lt/objs/clients/tcp.cljs +++ b/src/lt/objs/clients/tcp.cljs @@ -74,13 +74,13 @@ (console/error "Error starting tcp server" e)))) (behavior ::send! - :triggers #{:send!} - :reaction (fn [this msg] - (send-to (:socket @this) (array (:cb msg) (:command msg) (-> msg :data clj->js))))) + :triggers #{:send!} + :reaction (fn [this msg] + (send-to (:socket @this) (array (:cb msg) (:command msg) (-> msg :data clj->js))))) (behavior ::kill-on-closed - :triggers #{:closed} - :reaction (fn [app] - (.close server))) + :triggers #{:closed} + :reaction (fn [app] + (.close server))) diff --git a/src/lt/objs/clients/ws.cljs b/src/lt/objs/clients/ws.cljs index 4aeee1b26..826b286d8 100644 --- a/src/lt/objs/clients/ws.cljs +++ b/src/lt/objs/clients/ws.cljs @@ -71,6 +71,6 @@ (console/error "Error starting socket.io server" e)))) (behavior ::kill-on-closed - :triggers #{:closed} - :reaction (fn [app] - (.close server))) + :triggers #{:closed} + :reaction (fn [app] + (.close server))) diff --git a/src/lt/objs/document.cljs b/src/lt/objs/document.cljs index 2796b2ee4..dd3b7d062 100644 --- a/src/lt/objs/document.cljs +++ b/src/lt/objs/document.cljs @@ -36,36 +36,36 @@ (behavior ::close-document-on-editor-close - :for #{:editor} - :triggers #{:closed} - :reaction (fn [editor] - (when-let [doc (:doc @editor)] - (object/raise doc :close.force)))) + :for #{:editor} + :triggers #{:closed} + :reaction (fn [editor] + (when-let [doc (:doc @editor)] + (object/raise doc :close.force)))) (behavior ::close-linked-document - :for #{:document} - :triggers #{:close.force} - :reaction (fn [this] - (when-let [root (:root @this)] - (.unlinkDoc (->cm-doc this) (->cm-doc root)) - (object/update! root [:sub-docs] disj this)) - (object/destroy! this))) + :for #{:document} + :triggers #{:close.force} + :reaction (fn [this] + (when-let [root (:root @this)] + (.unlinkDoc (->cm-doc this) (->cm-doc root)) + (object/update! root [:sub-docs] disj this)) + (object/destroy! this))) (behavior ::try-close-root-document - :for #{:document} - :triggers #{:try-close} - :reaction (fn [this] - (when (= #{::this} (:sub-docs @this)) - (object/raise this :close.force)))) + :for #{:document} + :triggers #{:try-close} + :reaction (fn [this] + (when (= #{::this} (:sub-docs @this)) + (object/raise this :close.force)))) (behavior ::close-root-document - :for #{:document} - :triggers #{:close.force} - :reaction (fn [this] - (if (and (= #{::this} (:sub-docs @this)) - (not (object/has-tag? this :document.linked))) - (object/destroy! this) - (object/update! this [:sub-docs] disj ::this)))) + :for #{:document} + :triggers #{:close.force} + :reaction (fn [this] + (if (and (= #{::this} (:sub-docs @this)) + (not (object/has-tag? this :document.linked))) + (object/destroy! this) + (object/update! this [:sub-docs] disj ::this)))) (def default-linked-doc-options {}) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 5392526a9..593681f90 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -32,23 +32,23 @@ (declare files-obj) (behavior ::file-types - :triggers #{:object.instant} - :type :user - :desc "Files: Associate file types" - :params [{:label "types" - :example "[{:exts [:wisp],\n :mime \"text/x-clojurescript\",\n :name \"Wisp\",\n :tags [:editor.wisp]}]"}] - :reaction (fn [this types] - (object/merge! files-obj (typelist->index @files-obj types)))) + :triggers #{:object.instant} + :type :user + :desc "Files: Associate file types" + :params [{:label "types" + :example "[{:exts [:wisp],\n :mime \"text/x-clojurescript\",\n :name \"Wisp\",\n :tags [:editor.wisp]}]"}] + :reaction (fn [this types] + (object/merge! files-obj (typelist->index @files-obj types)))) (behavior ::file.ignore-pattern - :triggers #{:object.instant} - :type :user - :exclusive true - :desc "Files: Set ignore pattern" - :params [{:label "pattern" - :example "\"\\\\.git|\\\\.pyc\""}] - :reaction (fn [this pattern] - (set! ignore-pattern (js/RegExp. pattern)))) + :triggers #{:object.instant} + :type :user + :exclusive true + :desc "Files: Set ignore pattern" + :params [{:label "pattern" + :example "\"\\\\.git|\\\\.pyc\""}] + :reaction (fn [this pattern] + (set! ignore-pattern (js/RegExp. pattern)))) (behavior ::open-failed :triggers #{:files.open.error} diff --git a/src/lt/objs/jump_stack.cljs b/src/lt/objs/jump_stack.cljs index db1b00d6e..7e7f80fe4 100644 --- a/src/lt/objs/jump_stack.cljs +++ b/src/lt/objs/jump_stack.cljs @@ -16,26 +16,26 @@ (editor/center-cursor cur))) (behavior ::jump-stack.push - :triggers #{:jump-stack.push!} - :reaction (fn [jump-stack editor file pos] - (let [old-file (:path (:info @editor)) - old-pos (editor/->cursor editor)] - (if-not (files/exists? file) - (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) - (do (jump-to file pos) - (object/update! jump-stack [:stack] conj [old-file old-pos])))))) + :triggers #{:jump-stack.push!} + :reaction (fn [jump-stack editor file pos] + (let [old-file (:path (:info @editor)) + old-pos (editor/->cursor editor)] + (if-not (files/exists? file) + (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) + (do (jump-to file pos) + (object/update! jump-stack [:stack] conj [old-file old-pos])))))) (behavior ::jump-stack.pop - :triggers #{:jump-stack.pop!} - :reaction (fn [jump-stack file pos] - (let [stack (:stack @jump-stack)] - (if (empty? stack) - (notifos/set-msg! "Nowhere left to jump" {:class "error"}) - (let [[file pos] (last stack)] - (if-not (files/exists? file) - (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) - (do (jump-to file pos) - (object/update! jump-stack [:stack] pop)))))))) + :triggers #{:jump-stack.pop!} + :reaction (fn [jump-stack file pos] + (let [stack (:stack @jump-stack)] + (if (empty? stack) + (notifos/set-msg! "Nowhere left to jump" {:class "error"}) + (let [[file pos] (last stack)] + (if-not (files/exists? file) + (notifos/set-msg! (str "Could not find file: " file) {:class "error"}) + (do (jump-to file pos) + (object/update! jump-stack [:stack] pop)))))))) (def jump-stack (object/create (object/object* ::jump-stack diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index 173d7efd8..ba4e16e74 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -156,8 +156,8 @@ (.stopPropagation ev)))) (behavior ::chord-timeout - :triggers #{:object.instant} - :desc "App: Set the timeout for chorded shortcuts" - :type :user - :reaction (fn [this timeout] - (set! chord-timeout timeout))) + :triggers #{:object.instant} + :desc "App: Set the timeout for chorded shortcuts" + :type :user + :reaction (fn [this timeout] + (set! chord-timeout timeout))) diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 0f9ef1a0f..5c9b5e669 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -94,33 +94,33 @@ (completions-set token behavior-info param-pos token)))) (behavior ::show-info-on-move - :triggers #{:move} - :debounce 200 - :reaction (fn [this] - (let [idx (->index this) - {:keys [tag behavior param-pos] :as info} (idx->entry-info idx (:entries @this)) - behavior-info (@object/behaviors behavior)] - (if (:desc behavior-info) - (object/raise helper :show! this behavior-info param-pos) - (object/raise helper :clear!)) - ))) + :triggers #{:move} + :debounce 200 + :reaction (fn [this] + (let [idx (->index this) + {:keys [tag behavior param-pos] :as info} (idx->entry-info idx (:entries @this)) + behavior-info (@object/behaviors behavior)] + (if (:desc behavior-info) + (object/raise helper :show! this behavior-info param-pos) + (object/raise helper :clear!)) + ))) (behavior ::behavior-hint-pattern - :triggers #{:object.instant} - :reaction (fn [this] - (object/merge! this {:hint-pattern #"[\w\-\>\:\*\$\?\<\!\+\.\"\/]"}))) + :triggers #{:object.instant} + :reaction (fn [this] + (object/merge! this {:hint-pattern #"[\w\-\>\:\*\$\?\<\!\+\.\"\/]"}))) (behavior ::on-changed - :triggers #{:change :create} - :debounce 100 - :reaction (fn [this] - (flat-parser this (editor/->val this)))) + :triggers #{:change :create} + :debounce 100 + :reaction (fn [this] + (flat-parser this (editor/->val this)))) (behavior ::parsed - :triggers #{:parsed} - :reaction (fn [this results] - (object/merge! this (js->clj results :keywordize-keys true)) - (object/raise this :move))) + :triggers #{:parsed} + :reaction (fn [this results] + (object/merge! this (js->clj results :keywordize-keys true)) + (object/raise this :move))) (defn inline [this ed opts] (object/create :lt.objs.eval/inline-result {:ed ed @@ -156,36 +156,36 @@ :tags #{:editor.behaviors.helper}) (behavior ::helper.clear! - :desc "Behaviors.helper: clear" - :triggers #{:clear!} - :reaction (fn [this] - (when (:mark @this) - (when (and (:ed @this) @(:ed @this)) - (editor/-line-class (:ed @this) (:line @this) :text "behavior-helper-line")) - (object/raise (:mark @this) :clear!)) - (object/merge! this {:content nil}) - (object/merge! this {:mark nil - :behavior nil - :line nil - :ed nil}))) + :desc "Behaviors.helper: clear" + :triggers #{:clear!} + :reaction (fn [this] + (when (:mark @this) + (when (and (:ed @this) @(:ed @this)) + (editor/-line-class (:ed @this) (:line @this) :text "behavior-helper-line")) + (object/raise (:mark @this) :clear!)) + (object/merge! this {:content nil}) + (object/merge! this {:mark nil + :behavior nil + :line nil + :ed nil}))) (behavior ::helper.show! - :desc "Behaviors.helper: show" - :triggers #{:show!} - :reaction (fn [this ed beh param-idx] - (let [loc (editor/->cursor ed)] - (when (or (not= beh (:behavior @this)) - (not= ed (:ed @this))) - ;;clear old - (when (:mark @this) - (editor/-line-class ed (:line @this) :text "behavior-helper-line") - (object/raise (:mark @this) :clear!)) - (editor/+line-class ed (:line loc) :text "behavior-helper-line") - (object/merge! this {:content (->helper beh)}) - (object/merge! this {:mark (inline this ed (assoc loc :prev-line (:line @this))) - :behavior beh - :line (:line loc) - :ed ed})) - (set-param this param-idx)))) + :desc "Behaviors.helper: show" + :triggers #{:show!} + :reaction (fn [this ed beh param-idx] + (let [loc (editor/->cursor ed)] + (when (or (not= beh (:behavior @this)) + (not= ed (:ed @this))) + ;;clear old + (when (:mark @this) + (editor/-line-class ed (:line @this) :text "behavior-helper-line") + (object/raise (:mark @this) :clear!)) + (editor/+line-class ed (:line loc) :text "behavior-helper-line") + (object/merge! this {:content (->helper beh)}) + (object/merge! this {:mark (inline this ed (assoc loc :prev-line (:line @this))) + :behavior beh + :line (:line loc) + :ed ed})) + (set-param this param-idx)))) (def helper (object/create ::helper)) diff --git a/src/lt/objs/langs/keymap.cljs b/src/lt/objs/langs/keymap.cljs index 31cb878db..03997e351 100644 --- a/src/lt/objs/langs/keymap.cljs +++ b/src/lt/objs/langs/keymap.cljs @@ -61,45 +61,45 @@ (declare helper) (behavior ::keymap-hints - :triggers #{:hints+} - :exclusive [:lt.plugins.auto-complete/textual-hints] - :reaction (fn [this hints token] - (let [idx (beh/->index this) - {:keys [tag key pos command-at-pos arg-pos]} (idx->entry-info idx (:entries @this)) - comps (when (or (not arg-pos) - (< arg-pos 1)) - (completions (pos->token-type pos)))] - (if-not comps - hints - (comps token))))) + :triggers #{:hints+} + :exclusive [:lt.plugins.auto-complete/textual-hints] + :reaction (fn [this hints token] + (let [idx (beh/->index this) + {:keys [tag key pos command-at-pos arg-pos]} (idx->entry-info idx (:entries @this)) + comps (when (or (not arg-pos) + (< arg-pos 1)) + (completions (pos->token-type pos)))] + (if-not comps + hints + (comps token))))) (behavior ::show-info-on-move - :triggers #{:move} - :debounce 200 - :reaction (fn [this] - (let [idx (beh/->index this) - {:keys [command-at-pos arg-pos first-command]} (idx->entry-info idx (:entries @this)) - command (get (:commands @cmd/manager) (or command-at-pos first-command))] - (if command - (object/raise helper :show! this command arg-pos) - (object/raise helper :clear! this))))) + :triggers #{:move} + :debounce 200 + :reaction (fn [this] + (let [idx (beh/->index this) + {:keys [command-at-pos arg-pos first-command]} (idx->entry-info idx (:entries @this)) + command (get (:commands @cmd/manager) (or command-at-pos first-command))] + (if command + (object/raise helper :show! this command arg-pos) + (object/raise helper :clear! this))))) (behavior ::keymap-hint-pattern - :triggers #{:object.instant} - :reaction (fn [this] - (object/merge! this {:hint-pattern #"[\w\-\>\:\*\$\?\<\!\+\.\"\/]"}))) + :triggers #{:object.instant} + :reaction (fn [this] + (object/merge! this {:hint-pattern #"[\w\-\>\:\*\$\?\<\!\+\.\"\/]"}))) (behavior ::on-changed - :triggers #{:change :create} - :debounce 50 - :reaction (fn [this] - (beh/flat-parser this (editor/->val this)))) + :triggers #{:change :create} + :debounce 50 + :reaction (fn [this] + (beh/flat-parser this (editor/->val this)))) (behavior ::parsed - :triggers #{:parsed} - :reaction (fn [this results] - (object/merge! this (js->clj results :keywordize-keys true)) - (object/raise this :move))) + :triggers #{:parsed} + :reaction (fn [this results] + (object/merge! this (js->clj results :keywordize-keys true)) + (object/raise this :move))) (defn inline [this ed opts] (object/create :lt.objs.eval/inline-result {:ed ed @@ -134,22 +134,22 @@ (behavior ::helper.show! - :desc "Keymap.helper: show" - :triggers #{:show!} - :reaction (fn [this ed keym param-idx] - (let [loc (editor/->cursor ed)] - (when (or (not= keym (:key @this)) - (not= ed (:ed @this))) - ;;clear old - (when (:mark @this) - (editor/-line-class ed (:line @this) :text "behavior-helper-line") - (object/raise (:mark @this) :clear!)) - (editor/+line-class ed (:line loc) :text "behavior-helper-line") - (object/merge! this {:content (->helper keym)}) - (object/merge! this {:mark (inline this ed (assoc loc :prev-line (:line @this))) - :key keym - :line (:line loc) - :ed ed})) - (set-param this param-idx)))) + :desc "Keymap.helper: show" + :triggers #{:show!} + :reaction (fn [this ed keym param-idx] + (let [loc (editor/->cursor ed)] + (when (or (not= keym (:key @this)) + (not= ed (:ed @this))) + ;;clear old + (when (:mark @this) + (editor/-line-class ed (:line @this) :text "behavior-helper-line") + (object/raise (:mark @this) :clear!)) + (editor/+line-class ed (:line loc) :text "behavior-helper-line") + (object/merge! this {:content (->helper keym)}) + (object/merge! this {:mark (inline this ed (assoc loc :prev-line (:line @this))) + :key keym + :line (:line loc) + :ed ed})) + (set-param this param-idx)))) (def helper (object/create ::helper)) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 5278ed933..fd89e8d35 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -33,74 +33,74 @@ (def untitled-count (atom 0)) (behavior ::open-transient-editor - :triggers #{:new!} - :reaction (fn [this path dirty?] - (let [last (pool/last-active) - info (merge {:mime "plaintext" :tags [:editor.plaintext] :name (str "untitled-" - (swap! untitled-count inc))} - (path->info path)) - ed (pool/create info)] - (object/add-tags ed [:editor.transient]) - (object/merge! ed {:dirty dirty?}) - (object/raise this :open ed) - (tabs/add! ed) - (tabs/active! ed)))) + :triggers #{:new!} + :reaction (fn [this path dirty?] + (let [last (pool/last-active) + info (merge {:mime "plaintext" :tags [:editor.plaintext] :name (str "untitled-" + (swap! untitled-count inc))} + (path->info path)) + ed (pool/create info)] + (object/add-tags ed [:editor.transient]) + (object/merge! ed {:dirty dirty?}) + (object/raise this :open ed) + (tabs/add! ed) + (tabs/active! ed)))) (behavior ::transient-save - :triggers #{:save :save-as-rename!} - :reaction (fn [this] - (let [path (or (first (:folders @workspace/current-ws)) - (files/home)) - info (:info @this) - fname (:name info) - ext (when-let [e (:exts info)] - (str "." (name (first e))))] - (dialogs/save-as this :save-as! (files/join path (str fname ext)))))) + :triggers #{:save :save-as-rename!} + :reaction (fn [this] + (let [path (or (first (:folders @workspace/current-ws)) + (files/home)) + info (:info @this) + fname (:name info) + ext (when-let [e (:exts info)] + (str "." (name (first e))))] + (dialogs/save-as this :save-as! (files/join path (str fname ext)))))) (behavior ::save-as-rename! - :triggers #{:save-as-rename!} - :reaction (fn [this] - (dialogs/save-as this :save-as! (-> @this :info :path)))) + :triggers #{:save-as-rename!} + :reaction (fn [this] + (dialogs/save-as this :save-as! (-> @this :info :path)))) (behavior ::save-as - :triggers #{:save-as!} - :reaction (fn [this path] - (when (not (empty? path)) - (let [type (files/path->type path) - prev-tags (-> @this :info :tags) - mode (files/path->mode path) - neue-doc (doc/create {:doc (editor/get-doc this) - :line-ending files/line-ending - :mtime (files/stats path) - :mime mode})] - (when (:doc @this) - (object/raise (:doc @this) :close.force)) - (doc/register-doc neue-doc path) - (object/update! this [:info] merge (path->info path)) - (object/merge! this {:dirty true - :doc neue-doc}) - (editor/set-mode this mode) - (object/remove-tags this (conj prev-tags :editor.transient)) - (object/add-tags this (conj (:tags type) :editor.file-backed)) - (object/raise this :save-as) - (object/raise this :save))))) + :triggers #{:save-as!} + :reaction (fn [this path] + (when (not (empty? path)) + (let [type (files/path->type path) + prev-tags (-> @this :info :tags) + mode (files/path->mode path) + neue-doc (doc/create {:doc (editor/get-doc this) + :line-ending files/line-ending + :mtime (files/stats path) + :mime mode})] + (when (:doc @this) + (object/raise (:doc @this) :close.force)) + (doc/register-doc neue-doc path) + (object/update! this [:info] merge (path->info path)) + (object/merge! this {:dirty true + :doc neue-doc}) + (editor/set-mode this mode) + (object/remove-tags this (conj prev-tags :editor.transient)) + (object/add-tags this (conj (:tags type) :editor.file-backed)) + (object/raise this :save-as) + (object/raise this :save))))) (behavior ::check-read-only - :desc "Opener: check if file is read only" - :triggers #{:open} - :reaction (fn [this ed] - (when-let [path (-> @ed :info :path)] - (when (files/exists? path) - (when-not (files/writable? path) - (object/add-tags ed [:editor.read-only])))))) + :desc "Opener: check if file is read only" + :triggers #{:open} + :reaction (fn [this ed] + (when-let [path (-> @ed :info :path)] + (when (files/exists? path) + (when-not (files/writable? path) + (object/add-tags ed [:editor.read-only])))))) (behavior ::open-from-info - :triggers #{:open-info!} - :reaction (fn [obj info] - (let [ed (pool/create info)] - (object/raise obj :open ed) - (tabs/add! ed) - (tabs/active! ed)))) + :triggers #{:open-info!} + :reaction (fn [obj info] + (let [ed (pool/create info)] + (object/raise obj :open ed) + (tabs/add! ed) + (tabs/active! ed)))) (defn open-path* [doc-fn obj path] @@ -135,70 +135,70 @@ (object/merge! this {:open-linked-doc bool}))) (behavior ::open-standard-editor - :triggers #{:open!} - :reaction (fn [obj path] - (if-not (files/file? path) - (if (files/dir? path) - (notifos/set-msg! (str "Cannot open a directory: " path)) - (notifos/set-msg! (str "No such file: " path))) - (if-let [ed (first (pool/by-path path))] - (if (:open-linked-doc @obj) - (open-linked-path ed obj path {}) - (tabs/active! ed)) - (open-path obj path))))) + :triggers #{:open!} + :reaction (fn [obj path] + (if-not (files/file? path) + (if (files/dir? path) + (notifos/set-msg! (str "Cannot open a directory: " path)) + (notifos/set-msg! (str "No such file: " path))) + (if-let [ed (first (pool/by-path path))] + (if (:open-linked-doc @obj) + (open-linked-path ed obj path {}) + (tabs/active! ed)) + (open-path obj path))))) (behavior ::track-open-files - :triggers #{:open} - :reaction (fn [this ed] - (when-let [path (-> @ed :info :path)] - (object/update! this [:open-files] conj path)))) + :triggers #{:open} + :reaction (fn [this ed] + (when-let [path (-> @ed :info :path)] + (object/update! this [:open-files] conj path)))) (behavior ::untrack-closed - :triggers #{:destroy} - :reaction (fn [this] - (when-let [path (-> @this :info :path)] - (object/update! opener [:open-files] disj (-> @this :info :path))))) + :triggers #{:destroy} + :reaction (fn [this] + (when-let [path (-> @this :info :path)] + (object/update! opener [:open-files] disj (-> @this :info :path))))) (behavior ::unwatch-closed - :triggers #{:close.force} - :reaction (fn [ed] - (when-let [path (-> @ed :info :path)] - (workspace/unwatch! (-> @ed :info :path))))) + :triggers #{:close.force} + :reaction (fn [ed] + (when-let [path (-> @ed :info :path)] + (workspace/unwatch! (-> @ed :info :path))))) (behavior ::watch-on-open - :triggers #{:open} - :reaction (fn [this ed] - (when-let [path (-> @ed :info :path)] - (workspace/watch! (-> @ed :info :path))))) + :triggers #{:open} + :reaction (fn [this ed] + (when-let [path (-> @ed :info :path)] + (workspace/watch! (-> @ed :info :path))))) (behavior ::watch-open-files - :triggers #{:watch-paths+} - :reaction (fn [this cur] - (concat cur (:open-files @opener)))) + :triggers #{:watch-paths+} + :reaction (fn [this cur] + (concat cur (:open-files @opener)))) (behavior ::save-on-focus-lost - :triggers #{:blur} - :desc "Editor: Save on focus lost" - :type :user - :reaction (fn [this] - (if (object/has-tag? this :editor) - (object/raise this :save) - (cmd/exec! :save)) - )) + :triggers #{:blur} + :desc "Editor: Save on focus lost" + :type :user + :reaction (fn [this] + (if (object/has-tag? this :editor) + (object/raise this :save) + (cmd/exec! :save)) + )) (behavior ::save-all-on-focus-lost - :triggers #{:blur} - :desc "Editor: Save all on focus lost" - :type :user - :reaction (fn [this] - (cmd/exec! :save-all))) + :triggers #{:blur} + :desc "Editor: Save all on focus lost" + :type :user + :reaction (fn [this] + (cmd/exec! :save-all))) (behavior ::save-failed - :triggers #{:files.save.error} - :reaction (fn [this path e] - (popup/popup! {:header (str "Failed to save: " (files/basename path)) - :body [:pre (when e (str e))] - :buttons [{:label "cancel"}]}))) + :triggers #{:files.save.error} + :reaction (fn [this path e] + (popup/popup! {:header (str "Failed to save: " (files/basename path)) + :body [:pre (when e (str e))] + :buttons [{:label "cancel"}]}))) (object/object* ::opener :tags #{:opener} diff --git a/src/lt/objs/proc.cljs b/src/lt/objs/proc.cljs index d4f167e04..0e68a6e20 100644 --- a/src/lt/objs/proc.cljs +++ b/src/lt/objs/proc.cljs @@ -79,9 +79,9 @@ nil)) (behavior ::kill-procs-on-close - :triggers #{:closed} - :reaction (fn [this] - (kill-all))) + :triggers #{:closed} + :reaction (fn [this] + (kill-all))) (object/add-behavior! app/app ::kill-procs-on-close) @@ -90,9 +90,9 @@ ;;******************************************************* (behavior ::print-all - :triggers #{:proc.error :proc.out :proc.exit} - :reaction (fn [this data] - (println "PROC: " data))) + :triggers #{:proc.error :proc.out :proc.exit} + :reaction (fn [this data] + (println "PROC: " data))) (object/object* ::test-printer :triggers [] @@ -128,36 +128,36 @@ (str "PATH=" path-str ":$PATH && ")))) (behavior ::set-path-OSX - :triggers #{:init} - :reaction (fn [app] - (when (and (platform/mac?) - (not (aget js/process.env "LTCLI"))) - (.exec (js/require "child_process") (str (etc-paths->PATH) (get-path-command)) - (fn [err out serr] - (if-not (empty? err) - (do - (notifos/set-msg! "Failed to source PATH files. See console log for details." {:class "error"}) - (.error js/console err)) - (when-not (empty? out) - (set! js/process.env.PATH out)))))))) + :triggers #{:init} + :reaction (fn [app] + (when (and (platform/mac?) + (not (aget js/process.env "LTCLI"))) + (.exec (js/require "child_process") (str (etc-paths->PATH) (get-path-command)) + (fn [err out serr] + (if-not (empty? err) + (do + (notifos/set-msg! "Failed to source PATH files. See console log for details." {:class "error"}) + (.error js/console err)) + (when-not (empty? out) + (set! js/process.env.PATH out)))))))) (behavior ::global-path - :triggers #{:object.instant} - :desc "App: set global PATH for processes" - :type :user - :params [{:label "path"}] - :exclusive true - :reaction (fn [app path] - (set! js/process.env.PATH path))) + :triggers #{:object.instant} + :desc "App: set global PATH for processes" + :type :user + :params [{:label "path"}] + :exclusive true + :reaction (fn [app path] + (set! js/process.env.PATH path))) (behavior ::global-env - :triggers #{:object.instant} - :desc "App: add to the global ENV for processes" - :params [{:label "env map"}] - :type :user - :exclusive true - :reaction (fn [app kvs] - (reset! custom-env kvs))) + :triggers #{:object.instant} + :desc "App: add to the global ENV for processes" + :params [{:label "env map"}] + :type :user + :exclusive true + :reaction (fn [app kvs] + (reset! custom-env kvs))) (defn var-caps [vs] diff --git a/src/lt/objs/sidebar/clients.cljs b/src/lt/objs/sidebar/clients.cljs index 76ce8ccc0..a5866e233 100644 --- a/src/lt/objs/sidebar/clients.cljs +++ b/src/lt/objs/sidebar/clients.cljs @@ -111,40 +111,40 @@ ) (behavior ::track-active-client - :triggers #{:active :set-client} - :reaction (fn [ed] - (object/merge! clients {:active (:client @ed)}))) + :triggers #{:active :set-client} + :reaction (fn [ed] + (object/merge! clients {:active (:client @ed)}))) (behavior ::unset-client - :triggers #{:unset!} - :reaction (fn [this cur] - (let [ed (pool/last-active) - actives (:client @ed) - found? (first (filter #(= cur (val %)) actives))] - (when found? - (object/update! ed [:client] dissoc (first found?))) - (pool/focus-last)))) + :triggers #{:unset!} + :reaction (fn [this cur] + (let [ed (pool/last-active) + actives (:client @ed) + found? (first (filter #(= cur (val %)) actives))] + (when found? + (object/update! ed [:client] dissoc (first found?))) + (pool/focus-last)))) (behavior ::selecting! - :triggers #{:selecting!} - :reaction (fn [this] - (object/merge! this {:selecting? true}) - )) + :triggers #{:selecting!} + :reaction (fn [this] + (object/merge! this {:selecting? true}) + )) (behavior ::done-selecting - :triggers #{:selected :cancel} - :reaction (fn [this] - (object/merge! this {:selecting? false}))) + :triggers #{:selected :cancel} + :reaction (fn [this] + (object/merge! this {:selecting? false}))) (behavior ::hide-on-select - :triggers #{:selected} - :reaction (fn [this] - (object/raise sidebar/rightbar :close!))) + :triggers #{:selected} + :reaction (fn [this] + (object/raise sidebar/rightbar :close!))) (behavior ::focus! - :triggers #{:focus!} - :reaction (fn [this] - (dom/focus (object/->content this)))) + :triggers #{:focus!} + :reaction (fn [this] + (dom/focus (object/->content this)))) (object/object* ::sidebar.clients :tags #{:sidebar.clients} diff --git a/src/lt/objs/sidebar/navigate.cljs b/src/lt/objs/sidebar/navigate.cljs index 9f63d3e59..4befbff6d 100644 --- a/src/lt/objs/sidebar/navigate.cljs +++ b/src/lt/objs/sidebar/navigate.cljs @@ -40,62 +40,62 @@ (declare sidebar-navigate) (behavior ::workspace-files - :triggers #{:workspace-files} - :reaction (fn [this files] - (object/merge! this {:files (js->clj files :keywordize-keys true)}) - (object/raise (:filter-list @this) :refresh!) - )) + :triggers #{:workspace-files} + :reaction (fn [this files] + (object/merge! this {:files (js->clj files :keywordize-keys true)}) + (object/raise (:filter-list @this) :refresh!) + )) (behavior ::populate-on-ws-update - :triggers #{:updated :refresh} - :debounce 150 - :reaction (fn [ws] - (populate-bg sidebar-navigate {:lim (dec (:file-limit @sidebar-navigate)) - :pattern (.-source files/ignore-pattern) - :ws (workspace/serialize @ws)}))) + :triggers #{:updated :refresh} + :debounce 150 + :reaction (fn [ws] + (populate-bg sidebar-navigate {:lim (dec (:file-limit @sidebar-navigate)) + :pattern (.-source files/ignore-pattern) + :ws (workspace/serialize @ws)}))) (behavior ::watched.create - :triggers #{:watched.create} - :reaction (fn [ws path] - (when-not (file-filters (files/basename path)) - (let [ws-parent (files/parent (first (filter #(= 0 (.indexOf path %)) (:folders @ws)))) - rel-length (inc (count ws-parent))] - (object/update! sidebar-navigate [:files] conj {:full path :rel (subs path rel-length)}) - (object/raise (:filter-list @sidebar-navigate) :refresh!))))) + :triggers #{:watched.create} + :reaction (fn [ws path] + (when-not (file-filters (files/basename path)) + (let [ws-parent (files/parent (first (filter #(= 0 (.indexOf path %)) (:folders @ws)))) + rel-length (inc (count ws-parent))] + (object/update! sidebar-navigate [:files] conj {:full path :rel (subs path rel-length)}) + (object/raise (:filter-list @sidebar-navigate) :refresh!))))) (behavior ::watched.delete - :triggers #{:watched.delete} - :reaction (fn [ws path] - ;;TODO: this is terribly inefficient - (object/update! sidebar-navigate [:files] #(remove (fn [x] (= 0 (.indexOf (:full x) path))) %)) - (object/raise (:filter-list @sidebar-navigate) :refresh!))) + :triggers #{:watched.delete} + :reaction (fn [ws path] + ;;TODO: this is terribly inefficient + (object/update! sidebar-navigate [:files] #(remove (fn [x] (= 0 (.indexOf (:full x) path))) %)) + (object/raise (:filter-list @sidebar-navigate) :refresh!))) (behavior ::focus! - :triggers #{:focus!} - :reaction (fn [this] - (object/raise (:filter-list @this) :focus!) - )) + :triggers #{:focus!} + :reaction (fn [this] + (object/raise (:filter-list @this) :focus!) + )) (behavior ::focus-on-show - :triggers #{:show} - :reaction (fn [this] - (object/raise this :focus!))) + :triggers #{:show} + :reaction (fn [this] + (object/raise this :focus!))) (behavior ::open-on-select - :triggers #{:select} - :reaction (fn [this cur] - (object/raise opener/opener :open! (:full cur)))) + :triggers #{:select} + :reaction (fn [this cur] + (object/raise opener/opener :open! (:full cur)))) (behavior ::escape! - :triggers #{:escape!} - :reaction (fn [this] - (cmd/exec! :escape-navigate) - (cmd/exec! :focus-last-editor))) + :triggers #{:escape!} + :reaction (fn [this] + (cmd/exec! :escape-navigate) + (cmd/exec! :focus-last-editor))) (behavior ::pop-transient-on-select - :triggers #{:selected} - :reaction (fn [this] - (object/raise sidebar/rightbar :close!))) + :triggers #{:selected} + :reaction (fn [this] + (object/raise sidebar/rightbar :close!))) (behavior ::set-file-limit :triggers #{:object.instant} diff --git a/src/lt/objs/statusbar.cljs b/src/lt/objs/statusbar.cljs index f78f3012b..35393c534 100644 --- a/src/lt/objs/statusbar.cljs +++ b/src/lt/objs/statusbar.cljs @@ -96,9 +96,9 @@ [:span.pos (str "" (inc (:line pos)) " / " (inc (:ch pos)))]) (behavior ::update-cursor-location - :triggers #{:update!} - :reaction (fn [this pos] - (object/merge! this {:pos pos}))) + :triggers #{:update!} + :reaction (fn [this pos] + (object/merge! this {:pos pos}))) (object/object* ::statusbar.cursor :triggers #{} diff --git a/src/lt/objs/style.cljs b/src/lt/objs/style.cljs index bdde4eed2..a985767fa 100644 --- a/src/lt/objs/style.cljs +++ b/src/lt/objs/style.cljs @@ -48,32 +48,32 @@ :theme "default")) (behavior ::style-on-init - :triggers #{:init} - :reaction (fn [app] - (dom/append (dom/$ :head) (:content @styles)) - )) + :triggers #{:init} + :reaction (fn [app] + (dom/append (dom/$ :head) (:content @styles)) + )) (behavior ::font-settings - :desc "App: Font settings" - :params [{:label "Font family" - :type :string} - {:label "Size (pt)" - :type :number} - {:label "Line height (em)" - :type :number}] - :type :user - :exclusive true - :triggers #{:object.instant} - :reaction (fn [this family size line-height] - (let [final {:font-family family} - final (if size - (assoc final :font-size size) - final) - final (if (and line-height - (> line-height 0)) - (assoc final :line-height line-height) - final)] - (object/merge! styles {:font-settings final})))) + :desc "App: Font settings" + :params [{:label "Font family" + :type :string} + {:label "Size (pt)" + :type :number} + {:label "Line height (em)" + :type :number}] + :type :user + :exclusive true + :triggers #{:object.instant} + :reaction (fn [this family size line-height] + (let [final {:font-family family} + final (if size + (assoc final :font-size size) + final) + final (if (and line-height + (> line-height 0)) + (assoc final :line-height line-height) + final)] + (object/merge! styles {:font-settings final})))) ;;********************************************************** ;; Skins @@ -101,22 +101,22 @@ #js {:text (pr-str skin) :completion (pr-str skin)}))) (behavior ::set-skin - :triggers #{:object.instant} - :desc "Style: Set Light Table skin" - :params [{:label "skin" - :type :list - :items get-skins}] - :type :user - :reaction (fn [this skin] - (inject-skin skin))) + :triggers #{:object.instant} + :desc "Style: Set Light Table skin" + :params [{:label "skin" + :type :list + :items get-skins}] + :type :user + :reaction (fn [this skin] + (inject-skin skin))) (behavior ::provide-skin - :desc "Style: Provide skin" - :triggers #{:skins+} - :type :user - :params [{:label "name"} {:label "path"}] - :reaction (fn [this skins name path] - (assoc skins name (plugins/adjust-path path)))) + :desc "Style: Provide skin" + :triggers #{:skins+} + :type :user + :params [{:label "name"} {:label "path"}] + :reaction (fn [this skins name path] + (assoc skins name (plugins/adjust-path path)))) ;;********************************************************** ;; themes @@ -144,12 +144,12 @@ (behavior ::provide-theme - :desc "Style: Provide editor theme" - :triggers #{:themes+} - :type :user - :params [{:label "name"} {:label "path"}] - :reaction (fn [this themes name path] - (assoc themes name (plugins/adjust-path path)))) + :desc "Style: Provide editor theme" + :triggers #{:themes+} + :type :user + :params [{:label "name"} {:label "path"}] + :reaction (fn [this themes name path] + (assoc themes name (plugins/adjust-path path)))) (behavior ::remove-theme :triggers #{:deactivated :destroy} @@ -160,13 +160,13 @@ (behavior ::set-theme - :triggers #{:object.instant :show} - :desc "Style: Set the editor theme" - :params [{:label "theme" - :type :list - :items get-themes}] - :type :user - :exclusive true - :reaction (fn [this sel] - (inject-theme sel) - (editor/set-options this {:theme sel}))) + :triggers #{:object.instant :show} + :desc "Style: Set the editor theme" + :params [{:label "theme" + :type :list + :items get-themes}] + :type :user + :exclusive true + :reaction (fn [this sel] + (inject-theme sel) + (editor/set-options this {:theme sel}))) diff --git a/src/lt/objs/thread.cljs b/src/lt/objs/thread.cljs index c08ed5adf..48cbd7e73 100644 --- a/src/lt/objs/thread.cljs +++ b/src/lt/objs/thread.cljs @@ -12,51 +12,51 @@ (declare worker) (behavior ::try-send - :triggers #{:try-send!} - :reaction (fn [this msg] - (if-not (:connected @this) - (object/raise this :queue! msg) - (object/raise this :send! msg)))) + :triggers #{:try-send!} + :reaction (fn [this msg] + (if-not (:connected @this) + (object/raise this :queue! msg) + (object/raise this :send! msg)))) (behavior ::queue! - :triggers #{:queue!} - :reaction (fn [this msg] - (object/update! this [:queue] conj msg))) + :triggers #{:queue!} + :reaction (fn [this msg] + (object/update! this [:queue] conj msg))) (behavior ::send! - :triggers #{:send!} - :reaction (fn [this msg] - (.send (:worker @this) (clj->js msg)))) + :triggers #{:send!} + :reaction (fn [this msg] + (.send (:worker @this) (clj->js msg)))) (behavior ::connect - :triggers #{:connect} - :reaction (fn [this] - (doseq [q (:queue @this)] - (object/raise this :send! q)) - (object/merge! this {:connected true - :queue []}))) + :triggers #{:connect} + :reaction (fn [this] + (doseq [q (:queue @this)] + (object/raise this :send! q)) + (object/merge! this {:connected true + :queue []}))) (behavior ::message - :triggers #{:message} - :reaction (fn [this m] - (when-let [obj (object/by-id (.-obj m))] - (object/raise obj - (if-not (keyword? (.-msg m)) - (keyword (.-msg m)) - (.-msg m)) - (if (= "clj" (.-format m)) - (reader/read-string (.-res m)) - (.-res m)))))) + :triggers #{:message} + :reaction (fn [this m] + (when-let [obj (object/by-id (.-obj m))] + (object/raise obj + (if-not (keyword? (.-msg m)) + (keyword (.-msg m)) + (.-msg m)) + (if (= "clj" (.-format m)) + (reader/read-string (.-res m)) + (.-res m)))))) (behavior ::kill! - :triggers #{:kill!} - :reaction (fn [this] - (.kill (:worker @this)))) + :triggers #{:kill!} + :reaction (fn [this] + (.kill (:worker @this)))) (behavior ::shutdown-worker-on-close - :triggers #{:closed} - :reaction (fn [app] - (object/raise worker :kill!))) + :triggers #{:closed} + :reaction (fn [app] + (object/raise worker :kill!))) ;; Provides a forked thread, mainly for use with background macro. Parent thread ;; sends messages to child thread. Child thread performs work and sends results diff --git a/src/lt/objs/version.cljs b/src/lt/objs/version.cljs index 3a04ee148..974473081 100644 --- a/src/lt/objs/version.cljs +++ b/src/lt/objs/version.cljs @@ -16,15 +16,15 @@ (deploy/check-version true))) (behavior ::on-show-refresh-eds - :triggers #{:show} - :reaction (fn [this] - (object/raise (:ed @this) :show) - )) + :triggers #{:show} + :reaction (fn [this] + (object/raise (:ed @this) :show) + )) (behavior ::destroy-on-close - :triggers #{:close} - :reaction (fn [this] - (object/destroy! this))) + :triggers #{:close} + :reaction (fn [this] + (object/destroy! this))) (object/object* ::version-pane :tags #{:version} diff --git a/src/lt/objs/workspace.cljs b/src/lt/objs/workspace.cljs index 6d53cec2b..466648f90 100644 --- a/src/lt/objs/workspace.cljs +++ b/src/lt/objs/workspace.cljs @@ -199,101 +199,101 @@ (seq (:folders @ws))))) (behavior ::serialize-workspace - :triggers #{:updated :serialize!} - :reaction (fn [this] - (when-not (@this :file) - (object/merge! this {:file (new-cached-file)})) - (when (and (@this :initialized?) - (not (ws-empty? this))) - (save this (:file @this))))) + :triggers #{:updated :serialize!} + :reaction (fn [this] + (when-not (@this :file) + (object/merge! this {:file (new-cached-file)})) + (when (and (@this :initialized?) + (not (ws-empty? this))) + (save this (:file @this))))) (behavior ::reconstitute-last-workspace - :triggers #{:post-init} - :reaction (fn [app] - (when (and (app/first-window?) - (not (:initialized @current-ws))) - (when-let [ws (first (all))] - (open current-ws (-> ws :path (files/basename))))) ;;for backwards compat - (object/merge! current-ws {:initialized? true}))) + :triggers #{:post-init} + :reaction (fn [app] + (when (and (app/first-window?) + (not (:initialized @current-ws))) + (when-let [ws (first (all))] + (open current-ws (-> ws :path (files/basename))))) ;;for backwards compat + (object/merge! current-ws {:initialized? true}))) (behavior ::new! - :triggers #{:new!} - :reaction (fn [this] - (object/merge! this {:file (new-cached-file)}) - (object/raise this :clear!))) + :triggers #{:new!} + :reaction (fn [this] + (object/merge! this {:file (new-cached-file)}) + (object/raise this :clear!))) (behavior ::add-file! - :triggers #{:add.file!} - :reaction (fn [this f] - (if-not (contains? (set (:files @this)) f) - (do - (add! this :files f) - (object/raise this :add f) - (object/raise this :updated)) - (notifos/set-msg! "This file is already in your workspace." {:class "error"})))) + :triggers #{:add.file!} + :reaction (fn [this f] + (if-not (contains? (set (:files @this)) f) + (do + (add! this :files f) + (object/raise this :add f) + (object/raise this :updated)) + (notifos/set-msg! "This file is already in your workspace." {:class "error"})))) (behavior ::add-folder! - :triggers #{:add.folder!} - :reaction (fn [this f] - (if-not (contains? (set (:folders @this)) f) - (do - (add! this :folders f) - (object/raise this :add f) - (object/raise this :updated)) - (notifos/set-msg! "This folder is already in your workspace." {:class "error"})))) + :triggers #{:add.folder!} + :reaction (fn [this f] + (if-not (contains? (set (:folders @this)) f) + (do + (add! this :folders f) + (object/raise this :add f) + (object/raise this :updated)) + (notifos/set-msg! "This folder is already in your workspace." {:class "error"})))) (behavior ::remove-file! - :triggers #{:remove.file!} - :reaction (fn [this f] - (remove! this :files f) - (object/raise this :remove f) - (object/raise this :updated))) + :triggers #{:remove.file!} + :reaction (fn [this f] + (remove! this :files f) + (object/raise this :remove f) + (object/raise this :updated))) (behavior ::remove-folder! - :triggers #{:remove.folder!} - :reaction (fn [this f] - (remove! this :folders f) - (object/raise this :remove f) - (object/raise this :updated))) + :triggers #{:remove.folder!} + :reaction (fn [this f] + (remove! this :folders f) + (object/raise this :remove f) + (object/raise this :updated))) (behavior ::rename! - :triggers #{:rename!} - :reaction (fn [this f neue] - (let [key (if (files/file? f) - :files - :folders)] - (remove! this key f) - (add! this key neue) - (object/raise this :rename f neue) - (object/raise this :updated)))) + :triggers #{:rename!} + :reaction (fn [this f neue] + (let [key (if (files/file? f) + :files + :folders)] + (remove! this key f) + (add! this key neue) + (object/raise this :rename f neue) + (object/raise this :updated)))) (behavior ::clear! - :triggers #{:clear!} - :reaction (fn [this] - (let [old @this] - (object/merge! this {:files [] - :folders [] - :ws-behaviors ""}) - (object/raise this :set old) - (object/raise this :updated)))) + :triggers #{:clear!} + :reaction (fn [this] + (let [old @this] + (object/merge! this {:files [] + :folders [] + :ws-behaviors ""}) + (object/raise this :set old) + (object/raise this :updated)))) (behavior ::set! - :triggers #{:set!} - :reaction (fn [this fs] - (let [old @this] - (object/merge! this fs) - (object/raise this :set old) - (object/raise this :updated)))) + :triggers #{:set!} + :reaction (fn [this fs] + (let [old @this] + (object/merge! this fs) + (object/raise this :set old) + (object/raise this :updated)))) (behavior ::watch-on-set - :triggers #{:set} - :reaction (fn [this] - (watch-workspace this))) + :triggers #{:set} + :reaction (fn [this] + (watch-workspace this))) (behavior ::stop-watch-on-close - :triggers #{:close :refresh} - :reaction (fn [app] - (stop-watching current-ws))) + :triggers #{:close :refresh} + :reaction (fn [app] + (stop-watching current-ws))) (behavior ::init-workspace-cache-dir :triggers #{:init} From 2cc52ead03561bb0f4b480aa4c6a1f64388bb78a Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sun, 10 Jan 2016 10:46:22 -0500 Subject: [PATCH 573/656] Closing characters should not be on separate lines per review There are probably more of these hanging around but at least this fixes the ones related to changes in this PR --- src/lt/objs/app.cljs | 3 +-- src/lt/objs/browser.cljs | 15 +++------------ src/lt/objs/clients/local.cljs | 3 +-- src/lt/objs/langs/behaviors.cljs | 3 +-- src/lt/objs/opener.cljs | 3 +-- 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index dcfa565aa..c78253233 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -211,8 +211,7 @@ (behavior ::add-platform-class :triggers #{:init} :reaction (fn [this] - (dom/add-class (dom/$ :body) (name platform/platform)) - )) + (dom/add-class (dom/$ :body) (name platform/platform)))) ;;********************************************************* ;; Object diff --git a/src/lt/objs/browser.cljs b/src/lt/objs/browser.cljs index c4390250e..7f1f21b40 100644 --- a/src/lt/objs/browser.cljs +++ b/src/lt/objs/browser.cljs @@ -219,14 +219,7 @@ {:label "paste" :order 4 :click (fn [e] - (.paste (to-frame this)) - )} - ) - - - - - )) + (.paste (to-frame this)))}))) (behavior ::init! @@ -297,8 +290,7 @@ (behavior ::handle-send! :triggers #{:send!} :reaction (fn [this msg] - (object/raise this (keyword (str (:command msg) "!")) msg) - )) + (object/raise this (keyword (str (:command msg) "!")) msg))) (behavior ::handle-refresh! :triggers #{:client.refresh!} @@ -345,8 +337,7 @@ (let [info (:data msg) frame (to-frame (:frame @this))] (.send frame "editor.eval.css" #js {:name (:name info) - :code (:code info)}) - ))) + :code (:code info)})))) (behavior ::cljs-exec :triggers #{:editor.eval.cljs.exec!} diff --git a/src/lt/objs/clients/local.cljs b/src/lt/objs/clients/local.cljs index f07324c27..1d6f0fe86 100644 --- a/src/lt/objs/clients/local.cljs +++ b/src/lt/objs/clients/local.cljs @@ -58,8 +58,7 @@ (behavior ::send! :triggers #{:send!} :reaction (fn [this data] - (on-message (keyword (:command data)) (:data data) (:cb data)) - )) + (on-message (keyword (:command data)) (:data data) (:cb data)))) (defn init [] (clients/handle-connection! {:name client-name diff --git a/src/lt/objs/langs/behaviors.cljs b/src/lt/objs/langs/behaviors.cljs index 5c9b5e669..240aee221 100644 --- a/src/lt/objs/langs/behaviors.cljs +++ b/src/lt/objs/langs/behaviors.cljs @@ -102,8 +102,7 @@ behavior-info (@object/behaviors behavior)] (if (:desc behavior-info) (object/raise helper :show! this behavior-info param-pos) - (object/raise helper :clear!)) - ))) + (object/raise helper :clear!))))) (behavior ::behavior-hint-pattern :triggers #{:object.instant} diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index fd89e8d35..179895315 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -183,8 +183,7 @@ :reaction (fn [this] (if (object/has-tag? this :editor) (object/raise this :save) - (cmd/exec! :save)) - )) + (cmd/exec! :save)))) (behavior ::save-all-on-focus-lost :triggers #{:blur} From e857d5cad1b969248b8e968c36ec4412323043a7 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 11 Jan 2016 00:31:56 -0500 Subject: [PATCH 574/656] open-path should open existing tab for same relative file - close #1427 --- src/lt/objs/opener.cljs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lt/objs/opener.cljs b/src/lt/objs/opener.cljs index 179895315..52e48f29d 100644 --- a/src/lt/objs/opener.cljs +++ b/src/lt/objs/opener.cljs @@ -141,11 +141,12 @@ (if (files/dir? path) (notifos/set-msg! (str "Cannot open a directory: " path)) (notifos/set-msg! (str "No such file: " path))) - (if-let [ed (first (pool/by-path path))] - (if (:open-linked-doc @obj) - (open-linked-path ed obj path {}) - (tabs/active! ed)) - (open-path obj path))))) + (let [resolved-path (files/resolve files/cwd path)] + (if-let [ed (first (pool/by-path resolved-path))] + (if (:open-linked-doc @obj) + (open-linked-path ed obj resolved-path {}) + (tabs/active! ed)) + (open-path obj resolved-path)))))) (behavior ::track-open-files :triggers #{:open} From 8d7c1209b58baa387b3a65af0652cd8f52020435 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 11 Jan 2016 18:53:42 -0500 Subject: [PATCH 575/656] Just have a toggle connect command - close #1167 :show-connect command is a toggle command. Removed :hide-connect since that command closes the connection bar correctly in the only context it's used --- deploy/settings/default/default.keymap | 2 +- src/lt/objs/sidebar/clients.cljs | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 24b889230..237dc0e0e 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -73,7 +73,7 @@ [:searcher.search "enter" :searcher.search] - [:sidebar.clients "esc" :hide-connect] + [:sidebar.clients "esc" :show-connect] [:sidebar.doc.search.input "esc" :docs.search.hide] [:sidebar.doc.search.input "enter" :docs.search.exec] diff --git a/src/lt/objs/sidebar/clients.cljs b/src/lt/objs/sidebar/clients.cljs index a5866e233..1481aa4c4 100644 --- a/src/lt/objs/sidebar/clients.cljs +++ b/src/lt/objs/sidebar/clients.cljs @@ -163,18 +163,10 @@ (object/update! clients [:connectors] assoc (:name c) c)) (cmd/command {:command :show-connect - :desc "Connect: Show connect bar" + :desc "Connect: Toggle connect bar" :exec (fn [] (object/raise sidebar/rightbar :toggle clients) - (object/raise clients :focus!) - )}) - - -(cmd/command {:command :hide-connect - :desc "Connect: hide connect bar" - :exec (fn [] - (object/raise sidebar/rightbar :close!) - )}) + (object/raise clients :focus!))}) (cmd/command {:command :show-add-connection :desc "Connect: Add Connection" From 0fcb6a4a7139a41776942e9cae105b25ac3923e5 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Mon, 11 Jan 2016 21:40:36 -0500 Subject: [PATCH 576/656] Document keybindings with multiple extensions - close #1379 --- doc/behavior-and-keymap-configuration.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/behavior-and-keymap-configuration.md b/doc/behavior-and-keymap-configuration.md index bd227ffa8..13a91bf2c 100644 --- a/doc/behavior-and-keymap-configuration.md +++ b/doc/behavior-and-keymap-configuration.md @@ -35,7 +35,9 @@ For more tags see the ones used by default in LightTable for when a context tag is added with [ctx/in!](https://github.com/LightTable/LightTable/search?utf8=%E2%9C%93&q=%22ctx%2Fin%21%22&type=Code). -## Keys +## Keybindings + +### Keys LightTable uses [mousetrap](https://github.com/ccampbell/mousetrap) for keyboard handling. Mousetrap recognizes the following modifier keys: `shift, ctrl, @@ -45,7 +47,19 @@ command/cmd in OSX and ctrl anywhere else. To specify other special keys like LightTable also supports key combinations/sequences when keys are separated by a space. This allows plugins like Emacs to support key chords like 'ctrl-x u'. -## Commands In Keybindings +### Keybindings and tags with multiple extensions + +To override a keybinding that has multiple extensions e.g. +`:editor.keys.normal`, you must specify a tag that has the same prefix and than +an additional extension e.g. `:editor.keys.normal.clojure`. As an example, let's +override the backspace key which is tagged with `:editor.keys.normal` but only +in a clojure file. In user.behaviors, create a tag when in clojure files which +will override `editor.keys.normal` with `[:editor.cljs :lt.object/add-tag :editor.keys.normal.clojure]`. +Then in user.keymap, use the tag with +`[:editor.keys.normal.clojure "backspace" :add-browser-tab]`. Backspacing in +a clojure tab should now add a browser tab - not that most useful thing ;). + +### Commands In Keybindings Keybindings can run multiple commands by appending them to the end e.g. `[:TAG "KEYS" :COMMAND1 :COMMAND2]`. While commands are started serially, there isn't a From 7fb8f98a72bfd1b04e6614094b4f407454e41344 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 14 Jan 2016 07:21:20 -0500 Subject: [PATCH 577/656] Remove jshint package as its unused and JSHint plugin already has it --- deploy/core/node_modules/jshint/.npmignore | 6 - .../core/node_modules/jshint/CONTRIBUTING.md | 102 - deploy/core/node_modules/jshint/LICENSE | 20 - deploy/core/node_modules/jshint/README.md | 90 - deploy/core/node_modules/jshint/bin/jshint | 3 - deploy/core/node_modules/jshint/demo.js | 4 - .../node_modules/jshint/dist/jshint-1.0.0.js | 238 - .../node_modules/jshint/dist/jshint-1.1.0.js | 10685 --------------- .../node_modules/jshint/dist/jshint-2.0.0.js | 10994 --------------- .../jshint/dist/jshint-rhino-1.0.0.js | 327 - .../jshint/dist/jshint-rhino-1.1.0.js | 10773 --------------- .../jshint/dist/jshint-rhino-2.0.0.js | 11082 ---------------- .../node_modules/jshint/dist/jshint-rhino.js | 324 - .../core/node_modules/jshint/dist/jshint.js | 234 - deploy/core/node_modules/jshint/jshint.json | 14 - .../jshint/node_modules/cli/README.md | 196 - .../jshint/node_modules/cli/cli.js | 1127 -- .../jshint/node_modules/cli/examples/cat.js | 17 - .../node_modules/cli/examples/command.js | 16 - .../jshint/node_modules/cli/examples/echo.js | 54 - .../jshint/node_modules/cli/examples/glob.js | 6 - .../node_modules/cli/examples/long_desc.js | 20 - .../node_modules/cli/examples/progress.js | 11 - .../jshint/node_modules/cli/examples/sort.js | 18 - .../node_modules/cli/examples/spinner.js | 9 - .../node_modules/cli/examples/static.coffee | 27 - .../node_modules/cli/examples/static.js | 25 - .../jshint/node_modules/cli/index.js | 1 - .../cli/node_modules/glob/.npmignore | 2 - .../cli/node_modules/glob/.travis.yml | 3 - .../cli/node_modules/glob/LICENSE | 27 - .../cli/node_modules/glob/README.md | 250 - .../cli/node_modules/glob/examples/g.js | 9 - .../node_modules/glob/examples/usr-local.js | 9 - .../cli/node_modules/glob/glob.js | 675 - .../glob/node_modules/graceful-fs/.npmignore | 1 - .../glob/node_modules/graceful-fs/LICENSE | 23 - .../glob/node_modules/graceful-fs/README.md | 33 - .../node_modules/graceful-fs/graceful-fs.js | 316 - .../node_modules/graceful-fs/package.json | 49 - .../node_modules/graceful-fs/test/open.js | 46 - .../glob/node_modules/inherits/README.md | 51 - .../glob/node_modules/inherits/inherits.js | 29 - .../glob/node_modules/inherits/package.json | 26 - .../cli/node_modules/glob/package.json | 36 - .../cli/node_modules/glob/test/00-setup.js | 176 - .../node_modules/glob/test/bash-comparison.js | 63 - .../node_modules/glob/test/bash-results.json | 350 - .../cli/node_modules/glob/test/cwd-test.js | 55 - .../node_modules/glob/test/globstar-match.js | 19 - .../cli/node_modules/glob/test/mark.js | 74 - .../node_modules/glob/test/nocase-nomagic.js | 113 - .../node_modules/glob/test/pause-resume.js | 73 - .../node_modules/glob/test/root-nomount.js | 39 - .../cli/node_modules/glob/test/root.js | 46 - .../cli/node_modules/glob/test/stat.js | 32 - .../cli/node_modules/glob/test/zz-cleanup.js | 11 - .../jshint/node_modules/cli/package.json | 54 - .../console-browserify/.npmignore | 14 - .../console-browserify/.testem.json | 14 - .../console-browserify/.travis.yml | 4 - .../node_modules/console-browserify/LICENCE | 19 - .../node_modules/console-browserify/README.md | 32 - .../node_modules/console-browserify/index.js | 85 - .../console-browserify/package.json | 80 - .../console-browserify/test/index.js | 67 - .../console-browserify/test/static/index.html | 12 - .../test/static/test-adapter.js | 53 - .../jshint/node_modules/minimatch/LICENSE | 23 - .../jshint/node_modules/minimatch/README.md | 218 - .../node_modules/minimatch/minimatch.js | 1079 -- .../node_modules/lru-cache/.npmignore | 1 - .../minimatch/node_modules/lru-cache/AUTHORS | 8 - .../minimatch/node_modules/lru-cache/LICENSE | 23 - .../node_modules/lru-cache/README.md | 97 - .../node_modules/lru-cache/lib/lru-cache.js | 257 - .../node_modules/lru-cache/package.json | 59 - .../minimatch/node_modules/lru-cache/s.js | 25 - .../node_modules/lru-cache/test/basic.js | 329 - .../node_modules/lru-cache/test/foreach.js | 52 - .../lru-cache/test/memory-leak.js | 50 - .../minimatch/node_modules/sigmund/LICENSE | 27 - .../minimatch/node_modules/sigmund/README.md | 53 - .../minimatch/node_modules/sigmund/bench.js | 283 - .../node_modules/sigmund/package.json | 38 - .../minimatch/node_modules/sigmund/sigmund.js | 39 - .../node_modules/sigmund/test/basic.js | 24 - .../node_modules/minimatch/package.json | 36 - .../node_modules/minimatch/test/basic.js | 399 - .../minimatch/test/brace-expand.js | 33 - .../node_modules/minimatch/test/caching.js | 14 - .../node_modules/minimatch/test/defaults.js | 274 - .../node_modules/shelljs/.documentup.json | 6 - .../jshint/node_modules/shelljs/.npmignore | 1 - .../jshint/node_modules/shelljs/.travis.yml | 5 - .../jshint/node_modules/shelljs/LICENSE | 26 - .../jshint/node_modules/shelljs/README.md | 513 - .../jshint/node_modules/shelljs/bin/shjs | 51 - .../jshint/node_modules/shelljs/global.js | 3 - .../jshint/node_modules/shelljs/jshint.json | 4 - .../jshint/node_modules/shelljs/make.js | 48 - .../jshint/node_modules/shelljs/package.json | 41 - .../node_modules/shelljs/scripts/docs.js | 15 - .../node_modules/shelljs/scripts/run-tests.js | 50 - .../jshint/node_modules/shelljs/shell.js | 1901 --- .../node_modules/shelljs/test/.npmignore | 2 - .../jshint/node_modules/shelljs/test/cat.js | 57 - .../jshint/node_modules/shelljs/test/cd.js | 64 - .../jshint/node_modules/shelljs/test/chmod.js | 81 - .../node_modules/shelljs/test/config.js | 50 - .../jshint/node_modules/shelljs/test/cp.js | 143 - .../jshint/node_modules/shelljs/test/dirs.js | 37 - .../jshint/node_modules/shelljs/test/echo.js | 50 - .../jshint/node_modules/shelljs/test/env.js | 19 - .../jshint/node_modules/shelljs/test/exec.js | 109 - .../jshint/node_modules/shelljs/test/find.js | 56 - .../jshint/node_modules/shelljs/test/grep.js | 59 - .../jshint/node_modules/shelljs/test/ls.js | 202 - .../jshint/node_modules/shelljs/test/make.js | 20 - .../jshint/node_modules/shelljs/test/mkdir.js | 79 - .../jshint/node_modules/shelljs/test/mv.js | 130 - .../jshint/node_modules/shelljs/test/popd.js | 118 - .../jshint/node_modules/shelljs/test/pushd.js | 228 - .../jshint/node_modules/shelljs/test/pwd.js | 28 - .../node_modules/shelljs/test/resources/a.txt | 11 - .../test/resources/chmod/a/b/c/.npmignore | 0 .../test/resources/chmod/b/a/b/.npmignore | 0 .../test/resources/chmod/c/a/b/.npmignore | 0 .../shelljs/test/resources/chmod/file1 | 2 - .../node_modules/shelljs/test/resources/cp/a | 1 - .../node_modules/shelljs/test/resources/cp/b | 1 - .../shelljs/test/resources/cp/dir_a/z | 1 - .../resources/cp/dir_b/dir_b_a/dir_b_a_a/z | 1 - .../test/resources/external/node_script.js | 2 - .../node_modules/shelljs/test/resources/file1 | 1 - .../shelljs/test/resources/file1.js | 1 - .../shelljs/test/resources/file1.txt | 1 - .../node_modules/shelljs/test/resources/file2 | 1 - .../shelljs/test/resources/file2.js | 1 - .../shelljs/test/resources/file2.txt | 1 - .../shelljs/test/resources/find/.hidden | 1 - .../shelljs/test/resources/find/a | 1 - .../shelljs/test/resources/find/b | 1 - .../shelljs/test/resources/find/dir1/a_dir1 | 1 - .../test/resources/find/dir1/dir11/a_dir11 | 1 - .../shelljs/test/resources/find/dir2/a_dir1 | 1 - .../shelljs/test/resources/issue44/main.js | 1 - .../test/resources/ls/.hidden_dir/nada | 1 - .../shelljs/test/resources/ls/.hidden_file | 1 - .../test/resources/ls/a_dir/.hidden_dir/nada | 1 - .../shelljs/test/resources/ls/a_dir/b_dir/z | 1 - .../shelljs/test/resources/ls/a_dir/nada | 1 - .../shelljs/test/resources/ls/file1 | 1 - .../shelljs/test/resources/ls/file1.js | 1 - .../shelljs/test/resources/ls/file2 | 1 - .../shelljs/test/resources/ls/file2.js | 1 - ...ilename(with)[chars$]^that.must+be-escaped | 1 - .../shelljs/test/resources/pushd/a/dummy | 1 - .../shelljs/test/resources/pushd/b/c/dummy | 1 - .../jshint/node_modules/shelljs/test/rm.js | 183 - .../jshint/node_modules/shelljs/test/sed.js | 58 - .../node_modules/shelljs/test/tempdir.js | 27 - .../jshint/node_modules/shelljs/test/test.js | 91 - .../jshint/node_modules/shelljs/test/to.js | 39 - .../jshint/node_modules/shelljs/test/which.js | 38 - .../jshint/node_modules/underscore/.npmignore | 4 - .../node_modules/underscore/.travis.yml | 5 - .../jshint/node_modules/underscore/CNAME | 1 - .../node_modules/underscore/CONTRIBUTING.md | 9 - .../jshint/node_modules/underscore/LICENSE | 22 - .../jshint/node_modules/underscore/README.md | 19 - .../node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes .../jshint/node_modules/underscore/index.html | 2467 ---- .../jshint/node_modules/underscore/index.js | 1 - .../node_modules/underscore/package.json | 32 - .../node_modules/underscore/underscore-min.js | 1 - .../node_modules/underscore/underscore.js | 1226 -- deploy/core/node_modules/jshint/package.json | 50 - .../core/node_modules/jshint/src/cli/cli.js | 440 - .../jshint/src/platforms/rhino.js | 86 - .../jshint/src/reporters/checkstyle.js | 107 - .../jshint/src/reporters/default.js | 34 - .../jshint/src/reporters/jslint_xml.js | 57 - .../jshint/src/reporters/non_error.js | 45 - .../jshint/src/shared/messages.js | 214 - .../node_modules/jshint/src/shared/vars.js | 552 - .../node_modules/jshint/src/stable/jshint.js | 4561 ------- .../node_modules/jshint/src/stable/lex.js | 1691 --- .../node_modules/jshint/src/stable/reg.js | 34 - .../node_modules/jshint/src/stable/state.js | 24 - .../node_modules/jshint/src/stable/style.js | 171 - 191 files changed, 69463 deletions(-) delete mode 100644 deploy/core/node_modules/jshint/.npmignore delete mode 100644 deploy/core/node_modules/jshint/CONTRIBUTING.md delete mode 100644 deploy/core/node_modules/jshint/LICENSE delete mode 100644 deploy/core/node_modules/jshint/README.md delete mode 100755 deploy/core/node_modules/jshint/bin/jshint delete mode 100644 deploy/core/node_modules/jshint/demo.js delete mode 100644 deploy/core/node_modules/jshint/dist/jshint-1.0.0.js delete mode 100644 deploy/core/node_modules/jshint/dist/jshint-1.1.0.js delete mode 100644 deploy/core/node_modules/jshint/dist/jshint-2.0.0.js delete mode 100755 deploy/core/node_modules/jshint/dist/jshint-rhino-1.0.0.js delete mode 100755 deploy/core/node_modules/jshint/dist/jshint-rhino-1.1.0.js delete mode 100755 deploy/core/node_modules/jshint/dist/jshint-rhino-2.0.0.js delete mode 100755 deploy/core/node_modules/jshint/dist/jshint-rhino.js delete mode 100644 deploy/core/node_modules/jshint/dist/jshint.js delete mode 100644 deploy/core/node_modules/jshint/jshint.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/cli.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/cat.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/command.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/echo.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/glob.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/long_desc.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/progress.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/sort.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/spinner.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/static.coffee delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/examples/static.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/index.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/cli/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/.testem.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/.travis.yml delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/LICENCE delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/index.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/test/index.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/index.html delete mode 100644 deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/minimatch.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/s.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/test/basic.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/test/brace-expand.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/test/caching.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/minimatch/test/defaults.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/.documentup.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/.travis.yml delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/README.md delete mode 100755 deploy/core/node_modules/jshint/node_modules/shelljs/bin/shjs delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/global.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/jshint.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/make.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/package.json delete mode 100755 deploy/core/node_modules/jshint/node_modules/shelljs/scripts/docs.js delete mode 100755 deploy/core/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/shell.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/cat.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/cd.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/chmod.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/config.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/cp.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/dirs.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/echo.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/env.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/exec.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/find.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/grep.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/ls.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/make.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/mkdir.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/mv.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/popd.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/pushd.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/pwd.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/a.txt delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore delete mode 100755 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/a delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/b delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z delete mode 100755 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/a delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/b delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/rm.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/sed.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/tempdir.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/test.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/to.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/shelljs/test/which.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/.npmignore delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/.travis.yml delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/CNAME delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/LICENSE delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/README.md delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/favicon.ico delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/index.html delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/index.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/package.json delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/underscore-min.js delete mode 100644 deploy/core/node_modules/jshint/node_modules/underscore/underscore.js delete mode 100644 deploy/core/node_modules/jshint/package.json delete mode 100644 deploy/core/node_modules/jshint/src/cli/cli.js delete mode 100644 deploy/core/node_modules/jshint/src/platforms/rhino.js delete mode 100644 deploy/core/node_modules/jshint/src/reporters/checkstyle.js delete mode 100644 deploy/core/node_modules/jshint/src/reporters/default.js delete mode 100644 deploy/core/node_modules/jshint/src/reporters/jslint_xml.js delete mode 100644 deploy/core/node_modules/jshint/src/reporters/non_error.js delete mode 100644 deploy/core/node_modules/jshint/src/shared/messages.js delete mode 100644 deploy/core/node_modules/jshint/src/shared/vars.js delete mode 100644 deploy/core/node_modules/jshint/src/stable/jshint.js delete mode 100644 deploy/core/node_modules/jshint/src/stable/lex.js delete mode 100644 deploy/core/node_modules/jshint/src/stable/reg.js delete mode 100644 deploy/core/node_modules/jshint/src/stable/state.js delete mode 100644 deploy/core/node_modules/jshint/src/stable/style.js diff --git a/deploy/core/node_modules/jshint/.npmignore b/deploy/core/node_modules/jshint/.npmignore deleted file mode 100644 index 38bcd8153..000000000 --- a/deploy/core/node_modules/jshint/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -examples -res -tests -.travis.yml -CONTRIBUTING.MD -make.js diff --git a/deploy/core/node_modules/jshint/CONTRIBUTING.md b/deploy/core/node_modules/jshint/CONTRIBUTING.md deleted file mode 100644 index e7e07f196..000000000 --- a/deploy/core/node_modules/jshint/CONTRIBUTING.md +++ /dev/null @@ -1,102 +0,0 @@ -How to contribute -================= - -The best way to make sure your issue is addressed is to submit a patch. We accept -patches through all mediums: pull requests, email, issue comment, tweet with a link -to a snippet, graffiti outside of Anton's apartment, etc. - -However, before sending a patch, please make sure that the following applies: - -* Your commit message links to that issue. -* Your commit message is very descriptive ([example](https://github.com/jshint/jshint/commit/5751c5ed249b7a035758a3ae876cfa1a360fd144)). -* Your patch doesn't have useless merge commits. -* Your coding style is similar to ours (see below). -* Your patch is 100% tested. We don't accept any test regressions. -* All tests and lint checks pass (`node make.js test` and `node make.js lint`). -* You understand that we're super grateful for your patch. - -Coding Style ------------- - -This section describes our coding style guide. You might not agree with it and that's -fine but if you're going to send us patches treat this guide as a law. - -### Our main rule is simple: - -> All code in any code-base should look like a single person typed it, no matter how -many people contributed. —[idiomatic.js](https://github.com/rwldrn/idiomatic.js/) - -### Whitespace: - -* We use hard tabs everywhere. -* [Smart tabs](http://www.emacswiki.org/SmartTabs) are okay. -* Use one space after `if`, `for`, `while`, etc. -* Use one space after `function` for anonymous functions but not for named functions: - -```javascript -var a = function () {}; -function a() {} -``` - -* Feel free to indent variable assignments or property definitions if it makes the code look better. But don't abuse that: - -```javascript -// Good -var next = token.peak(); -var prev = token.peak(-1); -var cur = token.current; - -var scope = { - name: "(global)", - parent: parentScope, - vars: [], - uses: [] -}; - -// Bad -var cur = token.current; -var isSemicolon = cur.isPunctuator(";"); -``` - -* Wrap multi-line comments with new lines on both sides. - -### Variables - -* Use one `var` per variable unless you don't assign any values to it (and it's short enough): - -```javascript -var token = tokens.find(index); -var scope = scopes.current; -var next, prev, cur; -``` - -* Don't be overly descriptive with your variable names but don't abuse one-letter variables either. Find a sweet spot somewhere in between. - -### Comments - -* Use `//` for all comments. -* Comment everything that is not obvious. -* If you're adding a new check, write a comment describing why this check is important and what it checks for. - -### Misc - -* Always use strict mode. -* Always use strict comparisons: `===` and `!==`. -* Use semicolons. -* Don't use comma-first notation. -* Try not to chain stuff unless it **really** helps (e.g. in tests). -* Don't short-circuit expressions if you're not assigning the result: - -```javascript -// Good -token = token || tokens.find(0); - -// Bad -token.isPunctuator(";") && report.addWarning("W001"); - -// Good -if (token.isPunctuator(";")) - report.addWarning("W001"); -``` - -Today we use JSHint's `white:true` to enforce some of these rules. Eventually we'll switch to JSHint Next style enforcing component. But it's not ready yet. diff --git a/deploy/core/node_modules/jshint/LICENSE b/deploy/core/node_modules/jshint/LICENSE deleted file mode 100644 index 0e247b19f..000000000 --- a/deploy/core/node_modules/jshint/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2012 Anton Kovalyov (http://jshint.com) - -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 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. diff --git a/deploy/core/node_modules/jshint/README.md b/deploy/core/node_modules/jshint/README.md deleted file mode 100644 index 527bfec2b..000000000 --- a/deploy/core/node_modules/jshint/README.md +++ /dev/null @@ -1,90 +0,0 @@ -JSHint, A Static Code Analysis Tool for JavaScript -================================================== -[![Build Status](https://travis-ci.org/jshint/jshint.png?branch=master)](https://travis-ci.org/jshint/jshint) -[![NPM version](https://badge.fury.io/js/jshint.png)](http://badge.fury.io/js/jshint) - -JSHint is a community-driven tool to detect errors and potential problems in -JavaScript code and to enforce your team's coding conventions. We made JSHint -very flexible so you can easily adjust it to your particular coding guidelines -and the environment you expect your code to execute in. - -Our goal is to help JavaScript developers write complex programs without -worrying about typos and language gotchas. - -We believe that static code analysis programs—as well as other code quality -tools—are important and beneficial to the JavaScript community and, thus, -should not alienate their users. - -For general usage and hacking information, visit our website: -[http://jshint.com/](http://jshint.com/). - -Bug Bounties --------------------------------- - -Some bugs are so important to us, we will pay you if you fix them! Go to -[our page on BountySource](https://www.bountysource.com/#trackers/48759-jshint) -to see which bugs have bounties behind them. - -Really want to have something fixed but don't have time? You can add your -own bounty to any JSHint bug and make it more attractive for potential -contributors! - -**Rule:** A bug is considered fixed only after it has been merged into the -master branch of the main JSHint repository. - -Reporting a bug ---------------- - -To report a bug simply create a -[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe -your problem or suggestion. We welcome all kind of feedback regarding -JSHint including but not limited to: - - * When JSHint doesn't work as expected - * When JSHint complains about valid JavaScript code that works in all browsers - * When you simply want a new option or feature - -Before reporting a bug look around to see if there are any open or closed tickets -that cover your issue. And remember the wisdom: pull request > bug report > tweet. - - -FAQ ---- - -#### How do I turn off "mixed tabs and spaces" warning? - -If you're using so-called [smart tabs](http://www.emacswiki.org/SmartTabs) -then we have an option `smarttabs` for you. Otherwise, your solution is to -run JSHint with a custom reporter that discards any warnings you don't like. -For example, this [example reporter](https://gist.github.com/3885619) -discards all warnings about mixed tabs and spaces. - -Contributing ------------- - -Look for a file named `CONTRIBUTING.md` in this repository. It contains our -contributing guidelines. We also have -[a mailing list](http://groups.google.com/group/jshint/). - -License -------- - -JSHint is distributed under the MIT License. One file and one file only -(src/stable/jshint.js) is distributed under the slightly modified MIT License. - -Attribution ------------ - -Core Team members: - - * [Anton Kovalyov](http://anton.kovalyov.net/) ([@valueof](http://twitter.com/valueof)) - * [Wolfgang Kluge](http://klugesoftware.de/) ([blog](http://gehirnwindung.de/)) - * [Josh Perez](http://www.goatslacker.com/) ([@goatslacker](http://twitter.com/goatslacker)) - * [Brent Lintner](http://brentlintner.heroku.com/) ([@brentlintner](http://twitter.com/brentlintner)) - -Maintainer: Anton Kovalyov - -Thank you! ----------- - -We really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint! diff --git a/deploy/core/node_modules/jshint/bin/jshint b/deploy/core/node_modules/jshint/bin/jshint deleted file mode 100755 index 1df41b565..000000000 --- a/deploy/core/node_modules/jshint/bin/jshint +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require("./../src/cli/cli.js").interpret(process.argv); diff --git a/deploy/core/node_modules/jshint/demo.js b/deploy/core/node_modules/jshint/demo.js deleted file mode 100644 index 24aec281d..000000000 --- a/deploy/core/node_modules/jshint/demo.js +++ /dev/null @@ -1,4 +0,0 @@ -/*jshint unused:true */ - -define(function (require, exports, module) { -}); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/dist/jshint-1.0.0.js b/deploy/core/node_modules/jshint/dist/jshint-1.0.0.js deleted file mode 100644 index 5bdaeba1c..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-1.0.0.js +++ /dev/null @@ -1,238 +0,0 @@ -// 1.0.0 -var JSHINT; -(function(){var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var cached = require.cache[resolved]; - var res = cached? cached.exports : mod(); - return res; -}; - -require.paths = []; -require.modules = {}; -require.cache = {}; -require.extensions = [".js",".coffee",".json"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - x = path.normalize(x); - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = path.normalize(x + '/package.json'); - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -(function () { - var process = {}; - var global = typeof window !== 'undefined' ? window : {}; - var definedProcess = false; - - require.define = function (filename, fn) { - if (!definedProcess && require.modules.__browserify_process) { - process = require.modules.__browserify_process(); - definedProcess = true; - } - - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - var requiredModule = require(file, dirname); - var cached = require.cache[require.resolve(file, dirname)]; - - if (cached && cached.parent === null) { - cached.parent = module_; - } - - return requiredModule; - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - require_.cache = require.cache; - var module_ = { - id : filename, - filename: filename, - exports : {}, - loaded : false, - parent: null - }; - - require.modules[filename] = function () { - require.cache[filename] = module_; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename, - process, - global - ); - module_.loaded = true; - return module_.exports; - }; - }; -})(); - - -require.define("path",Function(['require','module','exports','__dirname','__filename','process','global'],"function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path" -)); - -require.define("__browserify_process",Function(['require','module','exports','__dirname','__filename','process','global'],"var process = module.exports = {};\n\nprocess.nextTick = (function () {\n var canSetImmediate = typeof window !== 'undefined'\n && window.setImmediate;\n var canPost = typeof window !== 'undefined'\n && window.postMessage && window.addEventListener\n ;\n\n if (canSetImmediate) {\n return window.setImmediate;\n }\n\n if (canPost) {\n var queue = [];\n window.addEventListener('message', function (ev) {\n if (ev.source === window && ev.data === 'browserify-tick') {\n ev.stopPropagation();\n if (queue.length > 0) {\n var fn = queue.shift();\n fn();\n }\n }\n }, true);\n\n return function nextTick(fn) {\n queue.push(fn);\n window.postMessage('browserify-tick', '*');\n };\n }\n\n return function nextTick(fn) {\n setTimeout(fn, 0);\n };\n})();\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\n\nprocess.binding = function (name) {\n if (name === 'evals') return (require)('vm')\n else throw new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n process.cwd = function () { return cwd };\n process.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\n//@ sourceURL=__browserify_process" -)); - -require.define("/node_modules/underscore/package.json",Function(['require','module','exports','__dirname','__filename','process','global'],"module.exports = {\"main\":\"underscore.js\"}\n//@ sourceURL=/node_modules/underscore/package.json" -)); - -require.define("/node_modules/underscore/underscore.js",Function(['require','module','exports','__dirname','__filename','process','global'],"// Underscore.js 1.4.4\n// http://underscorejs.org\n// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` in the browser, or `global` on the server.\n var root = this;\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Establish the object that gets returned to break out of a loop iteration.\n var breaker = {};\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n concat = ArrayProto.concat,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var\n nativeForEach = ArrayProto.forEach,\n nativeMap = ArrayProto.map,\n nativeReduce = ArrayProto.reduce,\n nativeReduceRight = ArrayProto.reduceRight,\n nativeFilter = ArrayProto.filter,\n nativeEvery = ArrayProto.every,\n nativeSome = ArrayProto.some,\n nativeIndexOf = ArrayProto.indexOf,\n nativeLastIndexOf = ArrayProto.lastIndexOf,\n nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeBind = FuncProto.bind;\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for the old `require()` API. If we're in\n // the browser, add `_` as a global object via a string identifier,\n // for Closure Compiler \"advanced\" mode.\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root._ = _;\n }\n\n // Current version.\n _.VERSION = '1.4.4';\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles objects with the built-in `forEach`, arrays, and raw objects.\n // Delegates to **ECMAScript 5**'s native `forEach` if available.\n var each = _.each = _.forEach = function(obj, iterator, context) {\n if (obj == null) return;\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n for (var key in obj) {\n if (_.has(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) return;\n }\n }\n }\n };\n\n // Return the results of applying the iterator to each element.\n // Delegates to **ECMAScript 5**'s native `map` if available.\n _.map = _.collect = function(obj, iterator, context) {\n var results = [];\n if (obj == null) return results;\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n var reduceError = 'Reduce of empty array with no initial value';\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.\n _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (obj == null) obj = [];\n if (nativeReduce && obj.reduce === nativeReduce) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);\n }\n each(obj, function(value, index, list) {\n if (!initial) {\n memo = value;\n initial = true;\n } else {\n memo = iterator.call(context, memo, value, index, list);\n }\n });\n if (!initial) throw new TypeError(reduceError);\n return memo;\n };\n\n // The right-associative version of reduce, also known as `foldr`.\n // Delegates to **ECMAScript 5**'s native `reduceRight` if available.\n _.reduceRight = _.foldr = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (obj == null) obj = [];\n if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);\n }\n var length = obj.length;\n if (length !== +length) {\n var keys = _.keys(obj);\n length = keys.length;\n }\n each(obj, function(value, index, list) {\n index = keys ? keys[--length] : --length;\n if (!initial) {\n memo = obj[index];\n initial = true;\n } else {\n memo = iterator.call(context, memo, obj[index], index, list);\n }\n });\n if (!initial) throw new TypeError(reduceError);\n return memo;\n };\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, iterator, context) {\n var result;\n any(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) {\n result = value;\n return true;\n }\n });\n return result;\n };\n\n // Return all the elements that pass a truth test.\n // Delegates to **ECMAScript 5**'s native `filter` if available.\n // Aliased as `select`.\n _.filter = _.select = function(obj, iterator, context) {\n var results = [];\n if (obj == null) return results;\n if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);\n each(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) results[results.length] = value;\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, iterator, context) {\n return _.filter(obj, function(value, index, list) {\n return !iterator.call(context, value, index, list);\n }, context);\n };\n\n // Determine whether all of the elements match a truth test.\n // Delegates to **ECMAScript 5**'s native `every` if available.\n // Aliased as `all`.\n _.every = _.all = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = true;\n if (obj == null) return result;\n if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);\n each(obj, function(value, index, list) {\n if (!(result = result && iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Delegates to **ECMAScript 5**'s native `some` if available.\n // Aliased as `any`.\n var any = _.some = _.any = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = false;\n if (obj == null) return result;\n if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);\n each(obj, function(value, index, list) {\n if (result || (result = iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if the array or object contains a given value (using `===`).\n // Aliased as `include`.\n _.contains = _.include = function(obj, target) {\n if (obj == null) return false;\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;\n return any(obj, function(value) {\n return value === target;\n });\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = function(obj, method) {\n var args = slice.call(arguments, 2);\n var isFunc = _.isFunction(method);\n return _.map(obj, function(value) {\n return (isFunc ? method : value[method]).apply(value, args);\n });\n };\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, function(value){ return value[key]; });\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // containing specific `key:value` pairs.\n _.where = function(obj, attrs, first) {\n if (_.isEmpty(attrs)) return first ? null : [];\n return _[first ? 'find' : 'filter'](obj, function(value) {\n for (var key in attrs) {\n if (attrs[key] !== value[key]) return false;\n }\n return true;\n });\n };\n\n // Convenience version of a common use case of `find`: getting the first object\n // containing specific `key:value` pairs.\n _.findWhere = function(obj, attrs) {\n return _.where(obj, attrs, true);\n };\n\n // Return the maximum element or (element-based computation).\n // Can't optimize arrays of integers longer than 65,535 elements.\n // See: https://bugs.webkit.org/show_bug.cgi?id=80797\n _.max = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.max.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return -Infinity;\n var result = {computed : -Infinity, value: -Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed >= result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.min.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return Infinity;\n var result = {computed : Infinity, value: Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed < result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Shuffle an array.\n _.shuffle = function(obj) {\n var rand;\n var index = 0;\n var shuffled = [];\n each(obj, function(value) {\n rand = _.random(index++);\n shuffled[index - 1] = shuffled[rand];\n shuffled[rand] = value;\n });\n return shuffled;\n };\n\n // An internal function to generate lookup iterators.\n var lookupIterator = function(value) {\n return _.isFunction(value) ? value : function(obj){ return obj[value]; };\n };\n\n // Sort the object's values by a criterion produced by an iterator.\n _.sortBy = function(obj, value, context) {\n var iterator = lookupIterator(value);\n return _.pluck(_.map(obj, function(value, index, list) {\n return {\n value : value,\n index : index,\n criteria : iterator.call(context, value, index, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index < right.index ? -1 : 1;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(obj, value, context, behavior) {\n var result = {};\n var iterator = lookupIterator(value || _.identity);\n each(obj, function(value, index) {\n var key = iterator.call(context, value, index, obj);\n behavior(result, key, value);\n });\n return result;\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key, value) {\n (_.has(result, key) ? result[key] : (result[key] = [])).push(value);\n });\n };\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key) {\n if (!_.has(result, key)) result[key] = 0;\n result[key]++;\n });\n };\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iterator, context) {\n iterator = iterator == null ? _.identity : lookupIterator(iterator);\n var value = iterator.call(context, obj);\n var low = 0, high = array.length;\n while (low < high) {\n var mid = (low + high) >>> 1;\n iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;\n }\n return low;\n };\n\n // Safely convert anything iterable into a real, live array.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (_.isArray(obj)) return slice.call(obj);\n if (obj.length === +obj.length) return _.map(obj, _.identity);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n if (obj == null) return 0;\n return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;\n };\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n if (array == null) return void 0;\n return (n != null) && !guard ? slice.call(array, 0, n) : array[0];\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N. The **guard** check allows it to work with\n // `_.map`.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array. The **guard** check allows it to work with `_.map`.\n _.last = function(array, n, guard) {\n if (array == null) return void 0;\n if ((n != null) && !guard) {\n return slice.call(array, Math.max(array.length - n, 0));\n } else {\n return array[array.length - 1];\n }\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array. The **guard**\n // check allows it to work with `_.map`.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, (n == null) || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, _.identity);\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, output) {\n each(input, function(value) {\n if (_.isArray(value)) {\n shallow ? push.apply(output, value) : flatten(value, shallow, output);\n } else {\n output.push(value);\n }\n });\n return output;\n };\n\n // Return a completely flattened version of an array.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, []);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = function(array) {\n return _.difference(array, slice.call(arguments, 1));\n };\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iterator, context) {\n if (_.isFunction(isSorted)) {\n context = iterator;\n iterator = isSorted;\n isSorted = false;\n }\n var initial = iterator ? _.map(array, iterator, context) : array;\n var results = [];\n var seen = [];\n each(initial, function(value, index) {\n if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {\n seen.push(value);\n results.push(array[index]);\n }\n });\n return results;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = function() {\n return _.uniq(concat.apply(ArrayProto, arguments));\n };\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var rest = slice.call(arguments, 1);\n return _.filter(_.uniq(array), function(item) {\n return _.every(rest, function(other) {\n return _.indexOf(other, item) >= 0;\n });\n });\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = function(array) {\n var rest = concat.apply(ArrayProto, slice.call(arguments, 1));\n return _.filter(array, function(value){ return !_.contains(rest, value); });\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = function() {\n var args = slice.call(arguments);\n var length = _.max(_.pluck(args, 'length'));\n var results = new Array(length);\n for (var i = 0; i < length; i++) {\n results[i] = _.pluck(args, \"\" + i);\n }\n return results;\n };\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values.\n _.object = function(list, values) {\n if (list == null) return {};\n var result = {};\n for (var i = 0, l = list.length; i < l; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),\n // we need this function. Return the position of the first occurrence of an\n // item in an array, or -1 if the item is not included in the array.\n // Delegates to **ECMAScript 5**'s native `indexOf` if available.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = function(array, item, isSorted) {\n if (array == null) return -1;\n var i = 0, l = array.length;\n if (isSorted) {\n if (typeof isSorted == 'number') {\n i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);\n } else {\n i = _.sortedIndex(array, item);\n return array[i] === item ? i : -1;\n }\n }\n if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);\n for (; i < l; i++) if (array[i] === item) return i;\n return -1;\n };\n\n // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.\n _.lastIndexOf = function(array, item, from) {\n if (array == null) return -1;\n var hasIndex = from != null;\n if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {\n return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);\n }\n var i = (hasIndex ? from : array.length);\n while (i--) if (array[i] === item) return i;\n return -1;\n };\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (arguments.length <= 1) {\n stop = start || 0;\n start = 0;\n }\n step = arguments[2] || 1;\n\n var len = Math.max(Math.ceil((stop - start) / step), 0);\n var idx = 0;\n var range = new Array(len);\n\n while(idx < len) {\n range[idx++] = start;\n start += step;\n }\n\n return range;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n // available.\n _.bind = function(func, context) {\n if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n var args = slice.call(arguments, 2);\n return function() {\n return func.apply(context, args.concat(slice.call(arguments)));\n };\n };\n\n // Partially apply a function by creating a version that has had some of its\n // arguments pre-filled, without changing its dynamic `this` context.\n _.partial = function(func) {\n var args = slice.call(arguments, 1);\n return function() {\n return func.apply(this, args.concat(slice.call(arguments)));\n };\n };\n\n // Bind all of an object's methods to that object. Useful for ensuring that\n // all callbacks defined on an object belong to it.\n _.bindAll = function(obj) {\n var funcs = slice.call(arguments, 1);\n if (funcs.length === 0) funcs = _.functions(obj);\n each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });\n return obj;\n };\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memo = {};\n hasher || (hasher = _.identity);\n return function() {\n var key = hasher.apply(this, arguments);\n return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));\n };\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = function(func, wait) {\n var args = slice.call(arguments, 2);\n return setTimeout(function(){ return func.apply(null, args); }, wait);\n };\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = function(func) {\n return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));\n };\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time.\n _.throttle = function(func, wait) {\n var context, args, timeout, result;\n var previous = 0;\n var later = function() {\n previous = new Date;\n timeout = null;\n result = func.apply(context, args);\n };\n return function() {\n var now = new Date;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0) {\n clearTimeout(timeout);\n timeout = null;\n previous = now;\n result = func.apply(context, args);\n } else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, result;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(context, args);\n return result;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = function(func) {\n var ran = false, memo;\n return function() {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return function() {\n var args = [func];\n push.apply(args, arguments);\n return wrapper.apply(this, args);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var funcs = arguments;\n return function() {\n var args = arguments;\n for (var i = funcs.length - 1; i >= 0; i--) {\n args = [funcs[i].apply(this, args)];\n }\n return args[0];\n };\n };\n\n // Returns a function that will only be executed after being called N times.\n _.after = function(times, func) {\n if (times <= 0) return func();\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Object Functions\n // ----------------\n\n // Retrieve the names of an object's properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`\n _.keys = nativeKeys || function(obj) {\n if (obj !== Object(obj)) throw new TypeError('Invalid object');\n var keys = [];\n for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var values = [];\n for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);\n return values;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n _.pairs = function(obj) {\n var pairs = [];\n for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n if (source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n each(keys, function(key) {\n if (key in obj) copy[key] = obj[key];\n });\n return copy;\n };\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n for (var key in obj) {\n if (!_.contains(keys, key)) copy[key] = obj[key];\n }\n return copy;\n };\n\n // Fill in a given object with default properties.\n _.defaults = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n if (source) {\n for (var prop in source) {\n if (obj[prop] == null) obj[prop] = source[prop];\n }\n }\n });\n return obj;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Internal recursive comparison function for `isEqual`.\n var eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.\n if (a === b) return a !== 0 || 1 / a == 1 / b;\n // A strict comparison is necessary because `null == undefined`.\n if (a == null || b == null) return a === b;\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className != toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, dates, and booleans are compared by value.\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return a == String(b);\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for\n // other numeric values.\n return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a == +b;\n // RegExps are compared by their source patterns and flags.\n case '[object RegExp]':\n return a.source == b.source &&\n a.global == b.global &&\n a.multiline == b.multiline &&\n a.ignoreCase == b.ignoreCase;\n }\n if (typeof a != 'object' || typeof b != 'object') return false;\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] == a) return bStack[length] == b;\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n var size = 0, result = true;\n // Recursively compare objects and arrays.\n if (className == '[object Array]') {\n // Compare array lengths to determine if a deep comparison is necessary.\n size = a.length;\n result = size == b.length;\n if (result) {\n // Deep compare the contents, ignoring non-numeric properties.\n while (size--) {\n if (!(result = eq(a[size], b[size], aStack, bStack))) break;\n }\n }\n } else {\n // Objects with different constructors are not equivalent, but `Object`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&\n _.isFunction(bCtor) && (bCtor instanceof bCtor))) {\n return false;\n }\n // Deep compare objects.\n for (var key in a) {\n if (_.has(a, key)) {\n // Count the expected number of properties.\n size++;\n // Deep compare each member.\n if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;\n }\n }\n // Ensure that both objects contain the same number of properties.\n if (result) {\n for (key in b) {\n if (_.has(b, key) && !(size--)) break;\n }\n result = !size;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return result;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b, [], []);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;\n for (var key in obj) if (_.has(obj, key)) return false;\n return true;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) == '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n return obj === Object(obj);\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.\n each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) == '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return !!(obj && _.has(obj, 'callee'));\n };\n }\n\n // Optimize `isFunction` if appropriate.\n if (typeof (/./) !== 'function') {\n _.isFunction = function(obj) {\n return typeof obj === 'function';\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return isFinite(obj) && !isNaN(parseFloat(obj));\n };\n\n // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n _.isNaN = function(obj) {\n return _.isNumber(obj) && obj != +obj;\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) == '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, key) {\n return hasOwnProperty.call(obj, key);\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iterators.\n _.identity = function(value) {\n return value;\n };\n\n // Run a function **n** times.\n _.times = function(n, iterator, context) {\n var accum = Array(n);\n for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);\n return accum;\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n };\n\n // List of HTML entities for escaping.\n var entityMap = {\n escape: {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n }\n };\n entityMap.unescape = _.invert(entityMap.escape);\n\n // Regexes containing the keys and values listed immediately above.\n var entityRegexes = {\n escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),\n unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')\n };\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n _.each(['escape', 'unescape'], function(method) {\n _[method] = function(string) {\n if (string == null) return '';\n return ('' + string).replace(entityRegexes[method], function(match) {\n return entityMap[method][match];\n });\n };\n });\n\n // If the value of the named property is a function then invoke it;\n // otherwise, return it.\n _.result = function(object, property) {\n if (object == null) return null;\n var value = object[property];\n return _.isFunction(value) ? value.call(object) : value;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n each(_.functions(obj), function(name){\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return result.call(this, func.apply(_, args));\n };\n });\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate : /<%([\\s\\S]+?)%>/g,\n interpolate : /<%=([\\s\\S]+?)%>/g,\n escape : /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\t': 't',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escaper = /\\\\|'|\\r|\\n|\\t|\\u2028|\\u2029/g;\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n _.template = function(text, data, settings) {\n var render;\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = new RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset)\n .replace(escaper, function(match) { return '\\\\' + escapes[match]; });\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n }\n if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n }\n if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n index = offset + match.length;\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + \"return __p;\\n\";\n\n try {\n render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n if (data) return render(data, _);\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled function source as a convenience for precompilation.\n template.source = 'function(' + (settings.variable || 'obj') + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function, which will delegate to the wrapper.\n _.chain = function(obj) {\n return _(obj).chain();\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var result = function(obj) {\n return this._chain ? _(obj).chain() : obj;\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];\n return result.call(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return result.call(this, method.apply(this._wrapped, arguments));\n };\n });\n\n _.extend(_.prototype, {\n\n // Start chaining a wrapped Underscore object.\n chain: function() {\n this._chain = true;\n return this;\n },\n\n // Extracts the result from a wrapped and chained object.\n value: function() {\n return this._wrapped;\n }\n\n });\n\n}).call(this);\n\n//@ sourceURL=/node_modules/underscore/underscore.js" -)); - -require.define("events",Function(['require','module','exports','__dirname','__filename','process','global'],"if (!process.EventEmitter) process.EventEmitter = function () {};\n\nvar EventEmitter = exports.EventEmitter = process.EventEmitter;\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\n\n// By default EventEmitters will print a warning if more than\n// 10 listeners are added to it. This is a useful default which\n// helps finding memory leaks.\n//\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nvar defaultMaxListeners = 10;\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!this._events) this._events = {};\n this._events.maxListeners = n;\n};\n\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n\n // Check for listener leak\n if (!this._events[type].warned) {\n var m;\n if (this._events.maxListeners !== undefined) {\n m = this._events.maxListeners;\n } else {\n m = defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n console.trace();\n }\n }\n\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = list.indexOf(listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n\n//@ sourceURL=events" -)); - -require.define("/src/shared/vars.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\n// Identifiers provided by the ECMAScript standard.\n\nexports.reservedVars = {\n\targuments : false,\n\tNaN : false\n};\n\nexports.ecmaIdentifiers = {\n\tArray : false,\n\tBoolean : false,\n\tDate : false,\n\tdecodeURI : false,\n\tdecodeURIComponent : false,\n\tencodeURI : false,\n\tencodeURIComponent : false,\n\tError : false,\n\t\"eval\" : false,\n\tEvalError : false,\n\tFunction : false,\n\thasOwnProperty : false,\n\tisFinite : false,\n\tisNaN : false,\n\tJSON : false,\n\tMath : false,\n\tMap : false,\n\tNumber : false,\n\tObject : false,\n\tparseInt : false,\n\tparseFloat : false,\n\tRangeError : false,\n\tReferenceError : false,\n\tRegExp : false,\n\tSet : false,\n\tString : false,\n\tSyntaxError : false,\n\tTypeError : false,\n\tURIError : false,\n\tWeakMap : false\n};\n\n// Global variables commonly provided by a web browser environment.\n\nexports.browser = {\n\tArrayBuffer : false,\n\tArrayBufferView : false,\n\tAudio : false,\n\tBlob : false,\n\taddEventListener : false,\n\tapplicationCache : false,\n\tatob : false,\n\tblur : false,\n\tbtoa : false,\n\tclearInterval : false,\n\tclearTimeout : false,\n\tclose : false,\n\tclosed : false,\n\tDataView : false,\n\tDOMParser : false,\n\tdefaultStatus : false,\n\tdocument : false,\n\tElement : false,\n\tevent : false,\n\tFileReader : false,\n\tFloat32Array : false,\n\tFloat64Array : false,\n\tFormData : false,\n\tfocus : false,\n\tframes : false,\n\tgetComputedStyle : false,\n\tHTMLElement : false,\n\tHTMLAnchorElement : false,\n\tHTMLBaseElement : false,\n\tHTMLBlockquoteElement: false,\n\tHTMLBodyElement : false,\n\tHTMLBRElement : false,\n\tHTMLButtonElement : false,\n\tHTMLCanvasElement : false,\n\tHTMLDirectoryElement : false,\n\tHTMLDivElement : false,\n\tHTMLDListElement : false,\n\tHTMLFieldSetElement : false,\n\tHTMLFontElement : false,\n\tHTMLFormElement : false,\n\tHTMLFrameElement : false,\n\tHTMLFrameSetElement : false,\n\tHTMLHeadElement : false,\n\tHTMLHeadingElement : false,\n\tHTMLHRElement : false,\n\tHTMLHtmlElement : false,\n\tHTMLIFrameElement : false,\n\tHTMLImageElement : false,\n\tHTMLInputElement : false,\n\tHTMLIsIndexElement : false,\n\tHTMLLabelElement : false,\n\tHTMLLayerElement : false,\n\tHTMLLegendElement : false,\n\tHTMLLIElement : false,\n\tHTMLLinkElement : false,\n\tHTMLMapElement : false,\n\tHTMLMenuElement : false,\n\tHTMLMetaElement : false,\n\tHTMLModElement : false,\n\tHTMLObjectElement : false,\n\tHTMLOListElement : false,\n\tHTMLOptGroupElement : false,\n\tHTMLOptionElement : false,\n\tHTMLParagraphElement : false,\n\tHTMLParamElement : false,\n\tHTMLPreElement : false,\n\tHTMLQuoteElement : false,\n\tHTMLScriptElement : false,\n\tHTMLSelectElement : false,\n\tHTMLStyleElement : false,\n\tHTMLTableCaptionElement: false,\n\tHTMLTableCellElement : false,\n\tHTMLTableColElement : false,\n\tHTMLTableElement : false,\n\tHTMLTableRowElement : false,\n\tHTMLTableSectionElement: false,\n\tHTMLTextAreaElement : false,\n\tHTMLTitleElement : false,\n\tHTMLUListElement : false,\n\tHTMLVideoElement : false,\n\thistory : false,\n\tInt16Array : false,\n\tInt32Array : false,\n\tInt8Array : false,\n\tImage : false,\n\tlength : false,\n\tlocalStorage : false,\n\tlocation : false,\n\tMessageChannel : false,\n\tMessageEvent : false,\n\tMessagePort : false,\n\tmoveBy : false,\n\tmoveTo : false,\n\tMutationObserver : false,\n\tname : false,\n\tNode : false,\n\tNodeFilter : false,\n\tnavigator : false,\n\tonbeforeunload : true,\n\tonblur : true,\n\tonerror : true,\n\tonfocus : true,\n\tonload : true,\n\tonresize : true,\n\tonunload : true,\n\topen : false,\n\topenDatabase : false,\n\topener : false,\n\tOption : false,\n\tparent : false,\n\tprint : false,\n\tremoveEventListener : false,\n\tresizeBy : false,\n\tresizeTo : false,\n\tscreen : false,\n\tscroll : false,\n\tscrollBy : false,\n\tscrollTo : false,\n\tsessionStorage : false,\n\tsetInterval : false,\n\tsetTimeout : false,\n\tSharedWorker : false,\n\tstatus : false,\n\ttop : false,\n\tUint16Array : false,\n\tUint32Array : false,\n\tUint8Array : false,\n\tUint8ClampedArray : false,\n\tWebSocket : false,\n\twindow : false,\n\tWorker : false,\n\tXMLHttpRequest : false,\n\tXMLSerializer : false,\n\tXPathEvaluator : false,\n\tXPathException : false,\n\tXPathExpression : false,\n\tXPathNamespace : false,\n\tXPathNSResolver : false,\n\tXPathResult : false\n};\n\nexports.devel = {\n\talert : false,\n\tconfirm: false,\n\tconsole: false,\n\tDebug : false,\n\topera : false,\n\tprompt : false\n};\n\nexports.worker = {\n\timportScripts: true,\n\tpostMessage : true,\n\tself : true\n};\n\n// Widely adopted global names that are not part of ECMAScript standard\nexports.nonstandard = {\n\tescape : false,\n\tunescape: false\n};\n\n// Globals provided by popular JavaScript environments.\n\nexports.couch = {\n\t\"require\" : false,\n\trespond : false,\n\tgetRow : false,\n\temit : false,\n\tsend : false,\n\tstart : false,\n\tsum : false,\n\tlog : false,\n\texports : false,\n\tmodule : false,\n\tprovides : false\n};\n\nexports.node = {\n\t__filename : false,\n\t__dirname : false,\n\tBuffer : false,\n\tDataView : false,\n\tconsole : false,\n\texports : true, // In Node it is ok to exports = module.exports = foo();\n\tGLOBAL : false,\n\tglobal : false,\n\tmodule : false,\n\tprocess : false,\n\trequire : false,\n\tsetTimeout : false,\n\tclearTimeout : false,\n\tsetInterval : false,\n\tclearInterval: false\n};\n\nexports.phantom = {\n\tphantom : true,\n\trequire : true,\n\tWebPage : true\n};\n\nexports.rhino = {\n\tdefineClass : false,\n\tdeserialize : false,\n\tgc : false,\n\thelp : false,\n\timportPackage: false,\n\t\"java\" : false,\n\tload : false,\n\tloadClass : false,\n\tprint : false,\n\tquit : false,\n\treadFile : false,\n\treadUrl : false,\n\trunCommand : false,\n\tseal : false,\n\tserialize : false,\n\tspawn : false,\n\tsync : false,\n\ttoint32 : false,\n\tversion : false\n};\n\nexports.wsh = {\n\tActiveXObject : true,\n\tEnumerator : true,\n\tGetObject : true,\n\tScriptEngine : true,\n\tScriptEngineBuildVersion : true,\n\tScriptEngineMajorVersion : true,\n\tScriptEngineMinorVersion : true,\n\tVBArray : true,\n\tWSH : true,\n\tWScript : true,\n\tXDomainRequest : true\n};\n\n// Globals provided by popular JavaScript libraries.\n\nexports.dojo = {\n\tdojo : false,\n\tdijit : false,\n\tdojox : false,\n\tdefine\t : false,\n\t\"require\": false\n};\n\nexports.jquery = {\n\t\"$\" : false,\n\tjQuery : false\n};\n\nexports.mootools = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\tAsset : false,\n\tBrowser : false,\n\tChain : false,\n\tClass : false,\n\tColor : false,\n\tCookie : false,\n\tCore : false,\n\tDocument : false,\n\tDomReady : false,\n\tDOMEvent : false,\n\tDOMReady : false,\n\tDrag : false,\n\tElement : false,\n\tElements : false,\n\tEvent : false,\n\tEvents : false,\n\tFx : false,\n\tGroup : false,\n\tHash : false,\n\tHtmlTable : false,\n\tIframe : false,\n\tIframeShim : false,\n\tInputValidator: false,\n\tinstanceOf : false,\n\tKeyboard : false,\n\tLocale : false,\n\tMask : false,\n\tMooTools : false,\n\tNative : false,\n\tOptions : false,\n\tOverText : false,\n\tRequest : false,\n\tScroller : false,\n\tSlick : false,\n\tSlider : false,\n\tSortables : false,\n\tSpinner : false,\n\tSwiff : false,\n\tTips : false,\n\tType : false,\n\ttypeOf : false,\n\tURI : false,\n\tWindow : false\n};\n\nexports.prototypejs = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\t\"$A\" : false,\n\t\"$F\" : false,\n\t\"$H\" : false,\n\t\"$R\" : false,\n\t\"$break\" : false,\n\t\"$continue\" : false,\n\t\"$w\" : false,\n\tAbstract : false,\n\tAjax : false,\n\tClass : false,\n\tEnumerable : false,\n\tElement : false,\n\tEvent : false,\n\tField : false,\n\tForm : false,\n\tHash : false,\n\tInsertion : false,\n\tObjectRange : false,\n\tPeriodicalExecuter: false,\n\tPosition : false,\n\tPrototype : false,\n\tSelector : false,\n\tTemplate : false,\n\tToggle : false,\n\tTry : false,\n\tAutocompleter : false,\n\tBuilder : false,\n\tControl : false,\n\tDraggable : false,\n\tDraggables : false,\n\tDroppables : false,\n\tEffect : false,\n\tSortable : false,\n\tSortableObserver : false,\n\tSound : false,\n\tScriptaculous : false\n};\n\nexports.yui = {\n\tYUI : false,\n\tY : false,\n\tYUI_config: false\n};\n\n\n//@ sourceURL=/src/shared/vars.js" -)); - -require.define("/src/shared/messages.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar _ = require(\"underscore\");\n\nvar errors = {\n\t// JSHint options\n\tE001: \"Bad option: '{a}'.\",\n\tE002: \"Bad option value.\",\n\n\t// JSHint input\n\tE003: \"Expected a JSON value.\",\n\tE004: \"Input is neither a string nor an array of strings.\",\n\tE005: \"Input is empty.\",\n\tE006: \"Unexpected early end of program.\",\n\n\t// Strict mode\n\tE007: \"Missing \\\"use strict\\\" statement.\",\n\tE008: \"Strict violation.\",\n\tE009: \"Option 'validthis' can't be used in a global scope.\",\n\tE010: \"'with' is not allowed in strict mode.\",\n\n\t// Constants\n\tE011: \"const '{a}' has already been declared.\",\n\tE012: \"const '{a}' is initialized to 'undefined'.\",\n\tE013: \"Attempting to override '{a}' which is a constant.\",\n\n\t// Regular expressions\n\tE014: \"A regular expression literal can be confused with '/='.\",\n\tE015: \"Unclosed regular expression.\",\n\tE016: \"Invalid regular expression.\",\n\n\t// Tokens\n\tE017: \"Unclosed comment.\",\n\tE018: \"Unbegun comment.\",\n\tE019: \"Unmatched '{a}'.\",\n\tE020: \"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.\",\n\tE021: \"Expected '{a}' and instead saw '{b}'.\",\n\tE022: \"Line breaking error '{a}'.\",\n\tE023: \"Missing '{a}'.\",\n\tE024: \"Unexpected '{a}'.\",\n\tE025: \"Missing ':' on a case clause.\",\n\tE026: \"Missing '}' to match '{' from line {a}.\",\n\tE027: \"Missing ']' to match '[' form line {a}.\",\n\tE028: \"Illegal comma.\",\n\tE029: \"Unclosed string.\",\n\n\t// Everything else\n\tE030: \"Expected an identifier and instead saw '{a}'.\",\n\tE031: \"Bad assignment.\", // FIXME: Rephrase\n\tE032: \"Expected a small integer and instead saw '{a}'.\",\n\tE033: \"Expected an operator and instead saw '{a}'.\",\n\tE034: \"get/set are ES5 features.\",\n\tE035: \"Missing property name.\",\n\tE036: \"Expected to see a statement and instead saw a block.\",\n\tE037: \"Constant {a} was not declared correctly.\",\n\tE038: \"Variable {a} was not declared correctly.\",\n\tE039: \"Function declarations are not invocable. Wrap the whole function invocation in parens.\",\n\tE040: \"Each value should have its own case label.\",\n\tE041: \"Unrecoverable syntax error.\",\n\tE042: \"Stopping.\",\n\tE043: \"Too many errors.\"\n};\n\nvar warnings = {\n\tW001: \"'hasOwnProperty' is a really bad name.\",\n\tW002: \"Value of '{a}' may be overwritten in IE.\",\n\tW003: \"'{a}' was used before it was defined.\",\n\tW004: \"'{a}' is already defined.\",\n\tW005: \"A dot following a number can be confused with a decimal point.\",\n\tW006: \"Confusing minuses.\",\n\tW007: \"Confusing pluses.\",\n\tW008: \"A leading decimal point can be confused with a dot: '{a}'.\",\n\tW009: \"The array literal notation [] is preferrable.\",\n\tW010: \"The object literal notation {} is preferrable.\",\n\tW011: \"Unexpected space after '{a}'.\",\n\tW012: \"Unexpected space before '{a}'.\",\n\tW013: \"Missing space after '{a}'.\",\n\tW014: \"Bad line breaking before '{a}'.\",\n\tW015: \"Expected '{a}' to have an indentation at {b} instead at {c}.\",\n\tW016: \"Unexpected use of '{a}'.\",\n\tW017: \"Bad operand.\",\n\tW018: \"Confusing use of '{a}'.\",\n\tW019: \"Use the isNaN function to compare with NaN.\",\n\tW020: \"Read only.\",\n\tW021: \"'{a}' is a function.\",\n\tW022: \"Do not assign to the exception parameter.\",\n\tW023: \"Expected an identifier in an assignment and instead saw a function invocation.\",\n\tW024: \"Expected an identifier and instead saw '{a}' (a reserved word).\",\n\tW025: \"Missing name in function declaration.\",\n\tW026: \"Inner functions should be listed at the top of the outer function.\",\n\tW027: \"Unreachable '{a}' after '{b}'.\",\n\tW028: \"Label '{a}' on {b} statement.\",\n\tW029: \"Label '{a}' looks like a javascript url.\",\n\tW030: \"Expected an assignment or function call and instead saw an expression.\",\n\tW031: \"Do not use 'new' for side effects.\",\n\tW032: \"Unnecessary semicolon.\",\n\tW033: \"Missing semicolon.\",\n\tW034: \"Unnecessary directive \\\"{a}\\\".\",\n\tW035: \"Empty block.\",\n\tW036: \"Unexpected /*member '{a}'.\",\n\tW037: \"'{a}' is a statement label.\",\n\tW038: \"'{a}' used out of scope.\",\n\tW039: \"'{a}' is not allowed.\",\n\tW040: \"Possible strict violation.\",\n\tW041: \"Use '{a}' to compare with '{b}'.\",\n\tW042: \"Avoid EOL escaping.\",\n\tW043: \"Bad escaping of EOL. Use option multistr if needed.\",\n\tW044: \"Bad escaping.\",\n\tW045: \"Bad number '{a}'.\",\n\tW046: \"Don't use extra leading zeros '{a}'.\",\n\tW047: \"A trailing decimal point can be confused with a dot: '{a}'.\",\n\tW048: \"Unexpected control character in regular expression.\",\n\tW049: \"Unexpected escaped character '{a}' in regular expression.\",\n\tW050: \"JavaScript URL.\",\n\tW051: \"Variables should not be deleted.\",\n\tW052: \"Unexpected '{a}'.\",\n\tW053: \"Do not use {a} as a constructor.\",\n\tW054: \"The Function constructor is a form of eval.\",\n\tW055: \"A constructor name should start with an uppercase letter.\",\n\tW056: \"Bad constructor.\",\n\tW057: \"Weird construction. Is 'new' unnecessary?\",\n\tW058: \"Missing '()' invoking a constructor.\",\n\tW059: \"Avoid arguments.{a}.\",\n\tW060: \"document.write can be a form of eval.\",\n\tW061: \"eval can be harmful.\",\n\tW062: \"Wrap an immediate function invocation in parens \" +\n\t\t\"to assist the reader in understanding that the expression \" +\n\t\t\"is the result of a function, and not the function itself.\",\n\tW063: \"Math is not a function.\",\n\tW064: \"Missing 'new' prefix when invoking a constructor.\",\n\tW065: \"Missing radix parameter.\",\n\tW066: \"Implied eval. Consider passing a function instead of a string.\",\n\tW067: \"Bad invocation.\",\n\tW068: \"Wrapping non-IIFE function literals in parens is unnecessary.\",\n\tW069: \"['{a}'] is better written in dot notation.\",\n\tW070: \"Extra comma. (it breaks older versions of IE)\",\n\tW071: \"This function has too many statements. ({a})\",\n\tW072: \"This function has too many parameters. ({a})\",\n\tW073: \"Blocks are nested too deeply. ({a})\",\n\tW074: \"This function's cyclomatic complexity is too high. ({a})\",\n\tW075: \"Duplicate key '{a}'.\",\n\tW076: \"Unexpected parameter '{a}' in get {b} function.\",\n\tW077: \"Expected a single parameter in set {a} function.\",\n\tW078: \"Setter is defined without getter.\",\n\tW079: \"Redefinition of '{a}'.\",\n\tW080: \"It's not necessary to initialize '{a}' to 'undefined'.\",\n\tW081: \"Too many var statements.\",\n\tW082: \"Function declarations should not be placed in blocks. \" +\n\t\t\"Use a function expression or move the statement to the top of \" +\n\t\t\"the outer function.\",\n\tW083: \"Don't make functions within a loop.\",\n\tW084: \"Expected a conditional expression and instead saw an assignment.\",\n\tW085: \"Don't use 'with'.\",\n\tW086: \"Expected a 'break' statement before '{a}'.\",\n\tW087: \"Forgotten 'debugger' statement?\",\n\tW088: \"Creating global 'for' variable. Should be 'for (var {a} ...'.\",\n\tW089: \"The body of a for in should be wrapped in an if statement to filter \" +\n\t\t\"unwanted properties from the prototype.\",\n\tW090: \"'{a}' is not a statement label.\",\n\tW091: \"'{a}' is out of scope.\",\n\tW092: \"Wrap the /regexp/ literal in parens to disambiguate the slash operator.\",\n\tW093: \"Did you mean to return a conditional instead of an assignment?\",\n\tW094: \"Unexpected comma.\",\n\tW095: \"Expected a string and instead saw {a}.\",\n\tW096: \"The '{a}' key may produce unexpected results.\",\n\tW097: \"Use the function form of \\\"use strict\\\".\",\n\tW098: \"'{a}' is defined but never used.\",\n\tW099: \"Mixed spaces and tabs.\",\n\tW100: \"This character may get silently deleted by one or more browsers.\",\n\tW101: \"Line is too long.\",\n\tW102: \"Trailing whitespace.\",\n\tW103: \"The '{a}' property is deprecated.\",\n\tW104: \"'{a}' is only available in JavaScript 1.7.\",\n\tW105: \"Unexpected {a} in '{b}'.\",\n\tW106: \"Identifier '{a}' is not in camel case.\",\n\tW107: \"Script URL.\",\n\tW108: \"Strings must use doublequote.\",\n\tW109: \"Strings must use singlequote.\",\n\tW110: \"Mixed double and single quotes.\",\n\tW112: \"Unclosed string.\",\n\tW113: \"Control character in string: {a}.\",\n\tW114: \"Avoid {a}.\",\n\tW115: \"Octal literals are not allowed in strict mode.\",\n\tW116: \"Expected '{a}' and instead saw '{b}'.\",\n\tW117: \"'{a}' is not defined.\",\n};\n\nvar info = {\n\tI001: \"Comma warnings can be turned off with 'laxcomma'.\"\n};\n\nexports.errors = {};\nexports.warnings = {};\nexports.info = {};\n\n_.each(errors, function (desc, code) {\n\texports.errors[code] = { code: code, desc: desc };\n});\n\n_.each(warnings, function (desc, code) {\n\texports.warnings[code] = { code: code, desc: desc };\n});\n\n_.each(info, function (desc, code) {\n\texports.info[code] = { code: code, desc: desc };\n});\n\n//@ sourceURL=/src/shared/messages.js" -)); - -require.define("/src/stable/lex.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Lexical analysis and token construction.\n */\n\n\"use strict\";\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\n\n// Some of these token types are from JavaScript Parser API\n// while others are specific to JSHint parser.\n// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n\nvar Token = {\n\tIdentifier: 1,\n\tPunctuator: 2,\n\tNumericLiteral: 3,\n\tStringLiteral: 4,\n\tComment: 5,\n\tKeyword: 6,\n\tNullLiteral: 7,\n\tBooleanLiteral: 8,\n\tRegExp: 9\n};\n\n// This is auto generated from the unicode tables.\n// The tables are at:\n// http://www.fileformat.info/info/unicode/category/Lu/list.htm\n// http://www.fileformat.info/info/unicode/category/Ll/list.htm\n// http://www.fileformat.info/info/unicode/category/Lt/list.htm\n// http://www.fileformat.info/info/unicode/category/Lm/list.htm\n// http://www.fileformat.info/info/unicode/category/Lo/list.htm\n// http://www.fileformat.info/info/unicode/category/Nl/list.htm\n\nvar unicodeLetterTable = [\n\t170, 170, 181, 181, 186, 186, 192, 214,\n\t216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750,\n\t880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908,\n\t910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366,\n\t1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610,\n\t1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775,\n\t1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957,\n\t1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069,\n\t2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361,\n\t2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431,\n\t2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482,\n\t2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529,\n\t2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608,\n\t2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654,\n\t2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736,\n\t2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785,\n\t2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867,\n\t2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929,\n\t2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970,\n\t2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001,\n\t3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123,\n\t3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212,\n\t3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261,\n\t3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344,\n\t3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455,\n\t3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526,\n\t3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716,\n\t3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743,\n\t3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760,\n\t3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805,\n\t3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138,\n\t4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198,\n\t4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346,\n\t4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696,\n\t4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789,\n\t4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880,\n\t4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740,\n\t5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900,\n\t5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000,\n\t6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312,\n\t6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516,\n\t6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823,\n\t6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141,\n\t7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409,\n\t7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013,\n\t8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061,\n\t8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140,\n\t8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188,\n\t8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455,\n\t8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486,\n\t8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521,\n\t8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358,\n\t11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621,\n\t11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694,\n\t11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726,\n\t11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295,\n\t12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438,\n\t12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589,\n\t12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312,\n\t19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124,\n\t42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539,\n\t42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783,\n\t42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921,\n\t43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042,\n\t43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259,\n\t43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442,\n\t43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595,\n\t43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697,\n\t43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714,\n\t43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798,\n\t43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032,\n\t55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045,\n\t64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279,\n\t64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316,\n\t64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433,\n\t64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019,\n\t65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370,\n\t65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495,\n\t65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594,\n\t65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786,\n\t65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334,\n\t66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511,\n\t66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592,\n\t67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669,\n\t67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115,\n\t68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405,\n\t68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687,\n\t69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894,\n\t92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964,\n\t119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980,\n\t119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069,\n\t120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121,\n\t120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144,\n\t120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570,\n\t120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686,\n\t120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779,\n\t131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972,\n\t177984, 177984, 178205, 178205, 194560, 195101\n];\n\nvar identifierStartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierStartTable[i] =\n\t\ti === 36 || // $\n\t\ti >= 65 && i <= 90 || // A-Z\n\t\ti === 95 || // _\n\t\ti >= 97 && i <= 122; // a-z\n}\n\nvar identifierPartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierPartTable[i] =\n\t\tidentifierStartTable[i] || // $, _, A-Z, a-z\n\t\ti >= 48 && i <= 57; // 0-9\n}\n\n/*\n * Lexer for JSHint.\n *\n * This object does a char-by-char scan of the provided source code\n * and produces a sequence of tokens.\n *\n * var lex = new Lexer(\"var i = 0;\");\n * lex.start();\n * lex.token(); // returns the next token\n *\n * You have to use the token() method to move the lexer forward\n * but you don't have to use its return value to get tokens. In addition\n * to token() method returning the next token, the Lexer object also\n * emits events.\n *\n * lex.on(\"Identifier\", function (data) {\n * if (data.name.indexOf(\"_\") >= 0) {\n * // Produce a warning.\n * }\n * });\n *\n * Note that the token() method returns tokens in a JSLint-compatible\n * format while the event emitter uses a slightly modified version of\n * Mozilla's JavaScript Parser API. Eventually, we will move away from\n * JSLint format.\n */\nfunction Lexer(source) {\n\tvar lines = source;\n\n\tif (typeof lines === \"string\") {\n\t\tlines = lines\n\t\t\t.replace(/\\r\\n/g, \"\\n\")\n\t\t\t.replace(/\\r/g, \"\\n\")\n\t\t\t.split(\"\\n\");\n\t}\n\n\t// If the first line is a shebang (#!), make it a blank and move on.\n\t// Shebangs are used by Node scripts.\n\n\tif (lines[0] && lines[0].substr(0, 2) === \"#!\") {\n\t\tlines[0] = \"\";\n\t}\n\n\tthis.emitter = new events.EventEmitter();\n\tthis.source = source;\n\tthis.lines = lines;\n\tthis.prereg = true;\n\n\tthis.line = 0;\n\tthis.char = 1;\n\tthis.from = 1;\n\tthis.input = \"\";\n\n\tfor (var i = 0; i < state.option.indent; i += 1) {\n\t\tstate.tab += \" \";\n\t}\n}\n\nLexer.prototype = {\n\t_lines: [],\n\n\tget lines() {\n\t\tthis._lines = state.lines;\n\t\treturn this._lines;\n\t},\n\n\tset lines(val) {\n\t\tthis._lines = val;\n\t\tstate.lines = this._lines;\n\t},\n\n\t/*\n\t * Return the next i character without actually moving the\n\t * char pointer.\n\t */\n\tpeek: function (i) {\n\t\treturn this.input.charAt(i || 0);\n\t},\n\n\t/*\n\t * Move the char pointer forward i times.\n\t */\n\tskip: function (i) {\n\t\ti = i || 1;\n\t\tthis.char += i;\n\t\tthis.input = this.input.slice(i);\n\t},\n\n\t/*\n\t * Subscribe to a token event. The API for this method is similar\n\t * Underscore.js i.e. you can subscribe to multiple events with\n\t * one call:\n\t *\n\t * lex.on(\"Identifier Number\", function (data) {\n\t * // ...\n\t * });\n\t */\n\ton: function (names, listener) {\n\t\tnames.split(\" \").forEach(function (name) {\n\t\t\tthis.emitter.on(name, listener);\n\t\t}.bind(this));\n\t},\n\n\t/*\n\t * Trigger a token event. All arguments will be passed to each\n\t * listener.\n\t */\n\ttrigger: function () {\n\t\tthis.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments));\n\t},\n\n\t/*\n\t * Extract a punctuator out of the next sequence of characters\n\t * or return 'null' if its not possible.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanPunctuator function in the Esprima parser's source code.\n\t */\n\tscanPunctuator: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2, ch3, ch4;\n\n\t\tswitch (ch1) {\n\t\t// Most common single-character punctuators\n\t\tcase \".\":\n\t\t\tif ((/^[0-9]$/).test(this.peek(1))) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* falls through */\n\t\tcase \"(\":\n\t\tcase \")\":\n\t\tcase \";\":\n\t\tcase \",\":\n\t\tcase \"{\":\n\t\tcase \"}\":\n\t\tcase \"[\":\n\t\tcase \"]\":\n\t\tcase \":\":\n\t\tcase \"~\":\n\t\tcase \"?\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// A pound sign (for Node shebangs)\n\t\tcase \"#\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// We're at the end of input\n\t\tcase \"\":\n\t\t\treturn null;\n\t\t}\n\n\t\t// Peek more characters\n\n\t\tch2 = this.peek(1);\n\t\tch3 = this.peek(2);\n\t\tch4 = this.peek(3);\n\n\t\t// 4-character punctuator: >>>=\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\" && ch4 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>=\"\n\t\t\t};\n\t\t}\n\n\t\t// 3-character punctuators: === !== >>> <<= >>=\n\n\t\tif (ch1 === \"=\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"===\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"!\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"!==\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"<\" && ch2 === \"<\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\t// 2-character punctuators: <= >= == != ++ -- << >> && ||\n\t\t// += -= *= %= &= |= ^= (but not /=, see below)\n\t\tif (ch1 === ch2 && (\"+-<>&|\".indexOf(ch1) >= 0)) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1 + ch2\n\t\t\t};\n\t\t}\n\n\t\tif (\"<>=!+-*%&|^\".indexOf(ch1) >= 0) {\n\t\t\tif (ch2 === \"=\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: ch1 + ch2\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\t\t}\n\n\t\t// Special case: /=. We need to make sure that this is an\n\t\t// operator and not a regular expression.\n\n\t\tif (ch1 === \"/\") {\n\t\t\tif (ch2 === \"=\" && /\\/=(?!(\\S*\\/[gim]?))/.test(this.input)) {\n\t\t\t\t// /= is not a part of a regular expression, return it as a\n\t\t\t\t// punctuator.\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: \"/=\"\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"/\"\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a comment out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since comments can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * In addition to normal JavaScript comments (// and /*) this method\n\t * also recognizes JSHint- and JSLint-specific comments such as\n\t * /*jshint, /*jslint, /*globals and so on.\n\t */\n\tscanComments: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2 = this.peek(1);\n\t\tvar rest = this.input.substr(2);\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.char;\n\n\t\t// Create a comment token object and make sure it\n\t\t// has all the data JSHint needs to work with special\n\t\t// comments.\n\n\t\tfunction commentToken(label, body, opt) {\n\t\t\tvar special = [\"jshint\", \"jslint\", \"members\", \"member\", \"globals\", \"global\", \"exported\"];\n\t\t\tvar isSpecial = false;\n\t\t\tvar value = label + body;\n\t\t\tvar commentType = \"plain\";\n\t\t\topt = opt || {};\n\n\t\t\tif (opt.isMultiline) {\n\t\t\t\tvalue += \"*/\";\n\t\t\t}\n\n\t\t\tspecial.forEach(function (str) {\n\t\t\t\tif (isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (body.substr(0, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + str;\n\t\t\t\t\tbody = body.substr(str.length);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial && body.charAt(0) === \" \" && body.substr(1, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + \" \" + str;\n\t\t\t\t\tbody = body.substr(str.length + 1);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"member\":\n\t\t\t\t\tcommentType = \"members\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"global\":\n\t\t\t\t\tcommentType = \"globals\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tcommentType = str;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Comment,\n\t\t\t\tcommentType: commentType,\n\t\t\t\tvalue: value,\n\t\t\t\tbody: body,\n\t\t\t\tisSpecial: isSpecial,\n\t\t\t\tisMultiline: opt.isMultiline || false,\n\t\t\t\tisMalformed: opt.isMalformed || false\n\t\t\t};\n\t\t}\n\n\t\t// End of unbegun comment. Raise an error and skip that input.\n\t\tif (ch1 === \"*\" && ch2 === \"/\") {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E018\",\n\t\t\t\tline: startLine,\n\t\t\t\tcharacter: startChar\n\t\t\t});\n\n\t\t\tthis.skip(2);\n\t\t\treturn null;\n\t\t}\n\n\t\t// Comments must start either with // or /*\n\t\tif (ch1 !== \"/\" || (ch2 !== \"*\" && ch2 !== \"/\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// One-line comment\n\t\tif (ch2 === \"/\") {\n\t\t\tthis.skip(this.input.length); // Skip to the EOL.\n\t\t\treturn commentToken(\"//\", rest);\n\t\t}\n\n\t\tvar body = \"\";\n\n\t\t/* Multi-line comment */\n\t\tif (ch2 === \"*\") {\n\t\t\tthis.skip(2);\n\n\t\t\twhile (this.peek() !== \"*\" || this.peek(1) !== \"/\") {\n\t\t\t\tif (this.peek() === \"\") { // End of Line\n\t\t\t\t\tbody += \"\\n\";\n\n\t\t\t\t\t// If we hit EOF and our comment is still unclosed,\n\t\t\t\t\t// trigger an error and end the comment implicitly.\n\t\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\t\tcode: \"E017\",\n\t\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn commentToken(\"/*\", body, {\n\t\t\t\t\t\t\tisMultiline: true,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody += this.peek();\n\t\t\t\t\tthis.skip();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.skip(2);\n\t\t\treturn commentToken(\"/*\", body, { isMultiline: true });\n\t\t}\n\t},\n\n\t/*\n\t * Extract a keyword out of the next sequence of characters or\n\t * return 'null' if its not possible.\n\t */\n\tscanKeyword: function () {\n\t\tvar result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input);\n\t\tvar keywords = [\n\t\t\t\"if\", \"in\", \"do\", \"var\", \"for\", \"new\",\n\t\t\t\"try\", \"let\", \"this\", \"else\", \"case\",\n\t\t\t\"void\", \"with\", \"enum\", \"while\", \"break\",\n\t\t\t\"catch\", \"throw\", \"const\", \"yield\", \"class\",\n\t\t\t\"super\", \"return\", \"typeof\", \"delete\",\n\t\t\t\"switch\", \"export\", \"import\", \"default\",\n\t\t\t\"finally\", \"extends\", \"function\", \"continue\",\n\t\t\t\"debugger\", \"instanceof\"\n\t\t];\n\n\t\tif (result && keywords.indexOf(result[0]) >= 0) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Keyword,\n\t\t\t\tvalue: result[0]\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a JavaScript identifier out of the next sequence of\n\t * characters or return 'null' if its not possible. In addition,\n\t * to Identifier this method can also produce BooleanLiteral\n\t * (true/false) and NullLiteral (null).\n\t */\n\tscanIdentifier: function () {\n\t\tvar id = \"\";\n\t\tvar index = 0;\n\t\tvar type, char;\n\n\t\t// Detects any character in the Unicode categories \"Uppercase\n\t\t// letter (Lu)\", \"Lowercase letter (Ll)\", \"Titlecase letter\n\t\t// (Lt)\", \"Modifier letter (Lm)\", \"Other letter (Lo)\", or\n\t\t// \"Letter number (Nl)\".\n\t\t//\n\t\t// Both approach and unicodeLetterTable were borrowed from\n\t\t// Google's Traceur.\n\n\t\tfunction isUnicodeLetter(code) {\n\t\t\tfor (var i = 0; i < unicodeLetterTable.length;) {\n\t\t\t\tif (code < unicodeLetterTable[i++]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (code <= unicodeLetterTable[i++]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tvar readUnicodeEscapeSequence = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tindex += 1;\n\n\t\t\tif (this.peek(index) !== \"u\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar ch1 = this.peek(index + 1);\n\t\t\tvar ch2 = this.peek(index + 2);\n\t\t\tvar ch3 = this.peek(index + 3);\n\t\t\tvar ch4 = this.peek(index + 4);\n\t\t\tvar code;\n\n\t\t\tif (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {\n\t\t\t\tcode = parseInt(ch1 + ch2 + ch3 + ch4, 16);\n\n\t\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\t\tindex += 5;\n\t\t\t\t\treturn \"\\\\u\" + ch1 + ch2 + ch3 + ch4;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierStart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierStartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierPart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierPartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tchar = getIdentifierStart();\n\t\tif (char === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tid = char;\n\t\tfor (;;) {\n\t\t\tchar = getIdentifierPart();\n\n\t\t\tif (char === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tid += char;\n\t\t}\n\n\t\tswitch (id) {\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\t\ttype = Token.BooleanLiteral;\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\ttype = Token.NullLiteral;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttype = Token.Identifier;\n\t\t}\n\n\t\treturn {\n\t\t\ttype: type,\n\t\t\tvalue: id\n\t\t};\n\t},\n\n\t/*\n\t * Extract a numeric literal out of the next sequence of\n\t * characters or return 'null' if its not possible. This method\n\t * supports all numeric literals described in section 7.8.3\n\t * of the EcmaScript 5 specification.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanNumericLiteral function in the Esprima parser's source code.\n\t */\n\tscanNumericLiteral: function () {\n\t\tvar index = 0;\n\t\tvar value = \"\";\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek(index);\n\t\tvar bad;\n\n\t\tfunction isDecimalDigit(str) {\n\t\t\treturn (/^[0-9]$/).test(str);\n\t\t}\n\n\t\tfunction isOctalDigit(str) {\n\t\t\treturn (/^[0-7]$/).test(str);\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tfunction isIdentifierStart(ch) {\n\t\t\treturn (ch === \"$\") || (ch === \"_\") || (ch === \"\\\\\") ||\n\t\t\t\t(ch >= \"a\" && ch <= \"z\") || (ch >= \"A\" && ch <= \"Z\");\n\t\t}\n\n\t\t// Numbers must start either with a decimal digit or a point.\n\n\t\tif (char !== \".\" && !isDecimalDigit(char)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (char !== \".\") {\n\t\t\tvalue = this.peek(index);\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (value === \"0\") {\n\t\t\t\t// Base-16 numbers.\n\t\t\t\tif (char === \"x\" || char === \"X\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (!isHexDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value.length <= 2) { // 0x\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 16,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Base-8 numbers.\n\t\t\t\tif (isOctalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tbad = false;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\n\t\t\t\t\t\t// Numbers like '019' (note the 9) are not valid octals\n\t\t\t\t\t\t// but we still parse them and mark as malformed.\n\n\t\t\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\t\t\tbad = true;\n\t\t\t\t\t\t} else if (!isOctalDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 8,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Decimal numbers that start with '0' such as '09' are illegal\n\t\t\t\t// but we still parse them and return as malformed.\n\n\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Decimal digits.\n\n\t\tif (char === \".\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Exponent part.\n\n\t\tif (char === \"e\" || char === \"E\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (char === \"+\" || char === \"-\") {\n\t\t\t\tvalue += this.peek(index);\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tchar = this.peek(index);\n\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\n\t\t\t\twhile (index < length) {\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.NumericLiteral,\n\t\t\tvalue: value,\n\t\t\tbase: 10,\n\t\t\tisMalformed: !isFinite(value)\n\t\t};\n\t},\n\n\t/*\n\t * Extract a string out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since strings can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * This method recognizes pseudo-multiline JavaScript strings:\n\t *\n\t * var str = \"hello\\\n\t * world\";\n */\n\tscanStringLiteral: function () {\n\t\tvar quote = this.peek();\n\n\t\t// String must start with a quote.\n\t\tif (quote !== \"\\\"\" && quote !== \"'\") {\n\t\t\treturn null;\n\t\t}\n\n\t\t// In JSON strings must always use double quotes.\n\t\tif (state.jsonMode && quote !== \"\\\"\") {\n\t\t\tthis.trigger(\"warning\", {\n\t\t\t\tcode: \"W108\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char // +1?\n\t\t\t});\n\t\t}\n\n\t\tvar value = \"\";\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.char;\n\t\tvar allowNewLine = false;\n\n\t\tthis.skip();\n\n\t\twhile (this.peek() !== quote) {\n\t\t\twhile (this.peek() === \"\") { // End Of Line\n\n\t\t\t\t// If an EOL is not preceded by a backslash, show a warning\n\t\t\t\t// and proceed like it was a legit multi-line string where\n\t\t\t\t// author simply forgot to escape the newline symbol.\n\t\t\t\t//\n\t\t\t\t// Another approach is to implicitly close a string on EOL\n\t\t\t\t// but it generates too many false positives.\n\n\t\t\t\tif (!allowNewLine) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W112\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tallowNewLine = false;\n\n\t\t\t\t\t// Otherwise show a warning if multistr option was not set.\n\t\t\t\t\t// For JSON, show warning no matter what.\n\n\t\t\t\t\tif (!state.option.multistr) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W043\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W042\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we get an EOF inside of an unclosed string, show an\n\t\t\t\t// error and implicitly close it at the EOF point.\n\n\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E029\",\n\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t});\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.StringLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tisUnclosed: true,\n\t\t\t\t\t\tquote: quote\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tallowNewLine = false;\n\t\t\tvar char = this.peek();\n\t\t\tvar jump = 1; // A length of a jump, after we're done\n\t\t\t // parsing this character.\n\n\t\t\tif (char < \" \") {\n\t\t\t\t// Warn about a control character in a string.\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W113\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ \"\" ]\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Special treatment for some escaped characters.\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tthis.skip();\n\t\t\t\tchar = this.peek();\n\n\t\t\t\tswitch (char) {\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\'\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"b\":\n\t\t\t\t\tchar = \"\\b\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"f\":\n\t\t\t\t\tchar = \"\\f\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"n\":\n\t\t\t\t\tchar = \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"r\":\n\t\t\t\t\tchar = \"\\r\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"t\":\n\t\t\t\t\tchar = \"\\t\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"0\":\n\t\t\t\t\tchar = \"\\0\";\n\n\t\t\t\t\t// Octal literals fail in strict mode.\n\t\t\t\t\t// Check if the number is between 00 and 07.\n\t\t\t\t\tvar n = parseInt(this.peek(), 10);\n\t\t\t\t\tif (n >= 0 && n <= 7 && state.directive[\"use strict\"]) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"u\":\n\t\t\t\t\tchar = String.fromCharCode(parseInt(this.input.substr(1, 4), 16));\n\t\t\t\t\tjump = 5;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"v\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\v\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = \"\\v\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"x\":\n\t\t\t\t\tvar\tx = parseInt(this.input.substr(1, 2), 16);\n\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\x-\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = String.fromCharCode(x);\n\t\t\t\t\tjump = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\\\\\":\n\t\t\t\tcase \"\\\"\":\n\t\t\t\tcase \"/\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\":\n\t\t\t\t\tallowNewLine = true;\n\t\t\t\t\tchar = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"!\":\n\t\t\t\t\tif (value.slice(value.length - 2) === \"<\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t/*falls through */\n\t\t\t\tdefault:\n\t\t\t\t\t// Weird escaping.\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W044\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvalue += char;\n\t\t\tthis.skip(jump);\n\t\t}\n\n\t\tthis.skip();\n\t\treturn {\n\t\t\ttype: Token.StringLiteral,\n\t\t\tvalue: value,\n\t\t\tisUnclosed: false,\n\t\t\tquote: quote\n\t\t};\n\t},\n\n\t/*\n\t * Extract a regular expression out of the next sequence of\n\t * characters and/or lines or return 'null' if its not possible.\n\t *\n\t * This method is platform dependent: it accepts almost any\n\t * regular expression values but then tries to compile and run\n\t * them using system's RegExp object. This means that there are\n\t * rare edge cases where one JavaScript engine complains about\n\t * your regular expression while others don't.\n\t */\n\tscanRegExp: function () {\n\t\tvar index = 0;\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek();\n\t\tvar value = char;\n\t\tvar body = \"\";\n\t\tvar flags = [];\n\t\tvar malformed = false;\n\t\tvar isCharSet = false;\n\t\tvar terminated;\n\n\t\tvar scanUnexpectedChars = function () {\n\t\t\t// Unexpected control character\n\t\t\tif (char < \" \") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W048\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Unexpected escaped character\n\t\t\tif (char === \"<\") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W049\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ char ]\n\t\t\t\t});\n\t\t\t}\n\t\t}.bind(this);\n\n\t\t// Regular expressions must start with '/'\n\t\tif (!this.prereg || char !== \"/\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tindex += 1;\n\t\tterminated = false;\n\n\t\t// Try to get everything in between slashes. A couple of\n\t\t// cases aside (see scanUnexpectedChars) we don't really\n\t\t// care whether the resulting expression is valid or not.\n\t\t// We will check that later using the RegExp object.\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tvalue += char;\n\t\t\tbody += char;\n\n\t\t\tif (isCharSet) {\n\t\t\t\tif (char === \"]\") {\n\t\t\t\t\tif (this.peek(index - 1) !== \"\\\\\" || this.peek(index - 2) === \"\\\\\") {\n\t\t\t\t\t\tisCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (char === \"\\\\\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tbody += char;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\tscanUnexpectedChars();\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tindex += 1;\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tbody += char;\n\t\t\t\tvalue += char;\n\n\t\t\t\tscanUnexpectedChars();\n\n\t\t\t\tif (char === \"/\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (char === \"[\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (char === \"[\") {\n\t\t\t\tisCharSet = true;\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"/\") {\n\t\t\t\tbody = body.substr(0, body.length - 1);\n\t\t\t\tterminated = true;\n\t\t\t\tindex += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// A regular expression that was never closed is an\n\t\t// error from which we cannot recover.\n\n\t\tif (!terminated) {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E015\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.from\n\t\t\t});\n\n\t\t\treturn void this.trigger(\"fatal\", {\n\t\t\t\tline: this.line,\n\t\t\t\tfrom: this.from\n\t\t\t});\n\t\t}\n\n\t\t// Parse flags (if any).\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (!/[gim]/.test(char)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tflags.push(char);\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// Check regular expression for correctness.\n\n\t\ttry {\n\t\t\tnew RegExp(body, flags.join(\"\"));\n\t\t} catch (err) {\n\t\t\tmalformed = true;\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E016\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char,\n\t\t\t\tdata: [ err.message ] // Platform dependent!\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.RegExp,\n\t\t\tvalue: value,\n\t\t\tflags: flags,\n\t\t\tisMalformed: malformed\n\t\t};\n\t},\n\n\t/*\n\t * Scan for any occurence of mixed tabs and spaces. If smarttabs option\n\t * is on, ignore tabs followed by spaces.\n\t *\n\t * Tabs followed by one space followed by a block comment are allowed.\n\t */\n\tscanMixedSpacesAndTabs: function () {\n\t\tvar at, match;\n\n\t\tif (state.option.smarttabs) {\n\t\t\t// Negative look-behind for \"//\"\n\t\t\tmatch = this.input.match(/(\\/\\/)? \\t/);\n\t\t\tat = match && !match[1] ? 0 : -1;\n\t\t} else {\n\t\t\tat = this.input.search(/ \\t|\\t [^\\*]/);\n\t\t}\n\n\t\treturn at;\n\t},\n\n\t/*\n\t * Scan for characters that get silently deleted by one or more browsers.\n\t */\n\tscanUnsafeChars: function () {\n\t\treturn this.input.search(reg.unsafeChars);\n\t},\n\n\t/*\n\t * Produce the next raw token or return 'null' if no tokens can be matched.\n\t * This method skips over all space characters.\n\t */\n\tnext: function () {\n\t\tthis.from = this.char;\n\n\t\t// Move to the next non-space character.\n\t\tvar start;\n\t\tif (/\\s/.test(this.peek())) {\n\t\t\tstart = this.char;\n\n\t\t\twhile (/\\s/.test(this.peek())) {\n\t\t\t\tthis.from += 1;\n\t\t\t\tthis.skip();\n\t\t\t}\n\n\t\t\tif (this.peek() === \"\") { // EOL\n\t\t\t\tif (state.option.trailing) {\n\t\t\t\t\tthis.trigger(\"warning\", { code: \"W102\", line: this.line, character: start });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Methods that work with multi-line structures and move the\n\t\t// character pointer.\n\n\t\tvar match = this.scanComments() ||\n\t\t\tthis.scanStringLiteral();\n\n\t\tif (match) {\n\t\t\treturn match;\n\t\t}\n\n\t\t// Methods that don't move the character pointer.\n\n\t\tmatch =\n\t\t\tthis.scanRegExp() ||\n\t\t\tthis.scanPunctuator() ||\n\t\t\tthis.scanKeyword() ||\n\t\t\tthis.scanIdentifier() ||\n\t\t\tthis.scanNumericLiteral();\n\n\t\tif (match) {\n\t\t\tthis.skip(match.value.length);\n\t\t\treturn match;\n\t\t}\n\n\t\t// No token could be matched, give up.\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Switch to the next line and reset all char pointers. Once\n\t * switched, this method also checks for mixed spaces and tabs\n\t * and other minor warnings.\n\t */\n\tnextLine: function () {\n\t\tvar char;\n\n\t\tif (this.line >= this.lines.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.input = this.lines[this.line];\n\t\tthis.line += 1;\n\t\tthis.char = 1;\n\t\tthis.from = 1;\n\n\t\tchar = this.scanMixedSpacesAndTabs();\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W099\", line: this.line, character: char + 1 });\n\t\t}\n\n\t\tthis.input = this.input.replace(/\\t/g, state.tab);\n\t\tchar = this.scanUnsafeChars();\n\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W100\", line: this.line, character: char });\n\t\t}\n\n\t\t// If there is a limit on line length, warn when lines get too\n\t\t// long.\n\n\t\tif (state.option.maxlen && state.option.maxlen < this.input.length) {\n\t\t\tthis.trigger(\"warning\", { code: \"W101\", line: this.line, character: this.input.length });\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/*\n\t * This is simply a synonym for nextLine() method with a friendlier\n\t * public name.\n\t */\n\tstart: function () {\n\t\tthis.nextLine();\n\t},\n\n\t/*\n\t * Produce the next token. This function is called by advance() to get\n\t * the next token. It retuns a token in a JSLint-compatible format.\n\t */\n\ttoken: function () {\n\t\tvar token;\n\n\t\t// Produce a token object.\n\t\tvar create = function (type, value, isProperty) {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar obj;\n\n\t\t\tif (type !== \"(endline)\" && type !== \"(end)\") {\n\t\t\t\tthis.prereg = false;\n\t\t\t}\n\n\t\t\tif (type === \"(punctuator)\") {\n\t\t\t\tswitch (value) {\n\t\t\t\tcase \".\":\n\t\t\t\tcase \")\":\n\t\t\t\tcase \"~\":\n\t\t\t\tcase \"#\":\n\t\t\t\tcase \"]\":\n\t\t\t\t\tthis.prereg = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t}\n\n\t\t\tif (type === \"(identifier)\") {\n\t\t\t\tif (value === \"return\" || value === \"case\" || value === \"typeof\") {\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tif (_.has(state.syntax, value)) {\n\t\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!obj) {\n\t\t\t\tobj = Object.create(state.syntax[type]);\n\t\t\t}\n\n\t\t\tobj.identifier = (type === \"(identifier)\");\n\t\t\tobj.type = obj.type || type;\n\t\t\tobj.value = value;\n\t\t\tobj.line = this.line;\n\t\t\tobj.character = this.char;\n\t\t\tobj.from = this.from;\n\n\t\t\tif (isProperty && obj.identifier) {\n\t\t\t\tobj.isProperty = isProperty;\n\t\t\t}\n\n\t\t\treturn obj;\n\t\t}.bind(this);\n\n\t\tfor (;;) {\n\t\t\tif (!this.input.length) {\n\t\t\t\treturn create(this.nextLine() ? \"(endline)\" : \"(end)\", \"\");\n\t\t\t}\n\n\t\t\ttoken = this.next();\n\n\t\t\tif (!token) {\n\t\t\t\tif (this.input.length) {\n\t\t\t\t\t// Unexpected character.\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E024\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ this.peek() ]\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.input = \"\";\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (token.type) {\n\t\t\tcase Token.StringLiteral:\n\t\t\t\tthis.trigger(\"String\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.char,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tquote: token.quote\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(string)\", token.value);\n\t\t\tcase Token.Identifier:\n\t\t\t\tthis.trigger(\"Identifier\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.char,\n\t\t\t\t\tfrom: this.form,\n\t\t\t\t\tname: token.value,\n\t\t\t\t\tisProperty: state.tokens.curr.id === \".\"\n\t\t\t\t});\n\n\t\t\t\t/* falls through */\n\t\t\tcase Token.Keyword:\n\t\t\tcase Token.NullLiteral:\n\t\t\tcase Token.BooleanLiteral:\n\t\t\t\treturn create(\"(identifier)\", token.value, state.tokens.curr.id === \".\");\n\n\t\t\tcase Token.NumericLiteral:\n\t\t\t\tif (token.isMalformed) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W045\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ token.value ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.jsonMode && token.base === 16) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ \"0x-\" ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.directive[\"use strict\"] && token.base === 8) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.trigger(\"Number\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.char,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tbase: token.base,\n\t\t\t\t\tisMalformed: token.malformed\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(number)\", token.value);\n\n\t\t\tcase Token.RegExp:\n\t\t\t\treturn create(\"(regexp)\", token.value);\n\n\t\t\tcase Token.Comment:\n\t\t\t\tstate.tokens.curr.comment = true;\n\n\t\t\t\tif (token.isSpecial) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: token.value,\n\t\t\t\t\t\tbody: token.body,\n\t\t\t\t\t\ttype: token.commentType,\n\t\t\t\t\t\tisSpecial: token.isSpecial,\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tfrom: this.from\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"\":\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn create(\"(punctuator)\", token.value);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.Lexer = Lexer;\n//@ sourceURL=/src/stable/lex.js" -)); - -require.define("/src/stable/reg.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Regular expressions. Some of these are stupidly long.\n */\n\n/*jshint maxlen:1000 */\n\n\"use string\";\n\n// Unsafe comment or string (ax)\nexports.unsafeString =\n\t/@cc|<\\/?|script|\\]\\s*\\]|<\\s*!|</i;\n\n// Unsafe characters that are silently deleted by one or more browsers (cx)\nexports.unsafeChars =\n\t/[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\n// Characters in strings that need escaping (nx and nxg)\nexports.needEsc =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\nexports.needEscGlobal =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n// Star slash (lx)\nexports.starSlash = /\\*\\//;\n\n// Identifier (ix)\nexports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;\n\n// JavaScript URL (jx)\nexports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n// Catches /* falls through */ comments (ft)\nexports.fallsThrough = /^\\s*\\/\\*\\s*falls\\sthrough\\s*\\*\\/\\s*$/;\n//@ sourceURL=/src/stable/reg.js" -)); - -require.define("/src/stable/state.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar state = {\n\tsyntax: {},\n\n\treset: function () {\n\t\tthis.tokens = {\n\t\t\tprev: null,\n\t\t\tnext: null,\n\t\t\tcurr: null\n\t\t},\n\n\t\tthis.option = {};\n\t\tthis.directive = {};\n\t\tthis.jsonMode = false;\n\t\tthis.lines = [];\n\t\tthis.tab = \"\";\n\t\tthis.cache = {}; // Node.JS doesn't have Map. Sniff.\n\t}\n};\n\nexports.state = state;\n//@ sourceURL=/src/stable/state.js" -)); - -require.define("/src/stable/style.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nexports.register = function (linter) {\n\t// Check for properties named __proto__. This special property was\n\t// deprecated and then re-introduced for ES6.\n\n\tlinter.on(\"Identifier\", function style_scanProto(data) {\n\t\tif (linter.getOption(\"proto\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__proto__\") {\n\t\t\tlinter.warn(\"W103\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for properties named __iterator__. This is a special property\n\t// available only in browsers with JavaScript 1.7 implementation.\n\n\tlinter.on(\"Identifier\", function style_scanIterator(data) {\n\t\tif (linter.getOption(\"iterator\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__iterator__\") {\n\t\t\tlinter.warn(\"W104\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for dangling underscores.\n\n\tlinter.on(\"Identifier\", function style_scanDangling(data) {\n\t\tif (!linter.getOption(\"nomen\")) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Underscore.js\n\t\tif (data.name === \"_\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// In Node, __dirname and __filename should be ignored.\n\t\tif (linter.getOption(\"node\")) {\n\t\t\tif (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (/^(_+.*|.*_+)$/.test(data.name)) {\n\t\t\tlinter.warn(\"W105\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ \"dangling '_'\", data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check that all identifiers are using camelCase notation.\n\t// Exceptions: names like MY_VAR and _myVar.\n\n\tlinter.on(\"Identifier\", function style_scanCamelCase(data) {\n\t\tif (!linter.getOption(\"camelcase\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name.replace(/^_+/, \"\").indexOf(\"_\") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) {\n\t\t\tlinter.warn(\"W106\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Enforce consistency in style of quoting.\n\n\tlinter.on(\"String\", function style_scanQuotes(data) {\n\t\tvar quotmark = linter.getOption(\"quotmark\");\n\t\tvar code;\n\n\t\tif (!quotmark) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If quotmark is set to 'single' warn about all double-quotes.\n\n\t\tif (quotmark === \"single\" && data.quote !== \"'\") {\n\t\t\tcode = \"W109\";\n\t\t}\n\n\t\t// If quotmark is set to 'double' warn about all single-quotes.\n\n\t\tif (quotmark === \"double\" && data.quote !== \"\\\"\") {\n\t\t\tcode = \"W108\";\n\t\t}\n\n\t\t// If quotmark is set to true, remember the first quotation style\n\t\t// and then warn about all others.\n\n\t\tif (quotmark === true) {\n\t\t\tif (!linter.getCache(\"quotmark\")) {\n\t\t\t\tlinter.setCache(\"quotmark\", data.quote);\n\t\t\t}\n\n\t\t\tif (linter.getCache(\"quotmark\") !== data.quote) {\n\t\t\t\tcode = \"W110\";\n\t\t\t}\n\t\t}\n\n\t\tif (code) {\n\t\t\tlinter.warn(code, {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t});\n\t\t}\n\t});\n\n\tlinter.on(\"Number\", function style_scanNumbers(data) {\n\t\tif (data.value.charAt(0) === \".\") {\n\t\t\t// Warn about a leading decimal point.\n\t\t\tlinter.warn(\"W008\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (data.value.substr(data.value.length - 1) === \".\") {\n\t\t\t// Warn about a trailing decimal point.\n\t\t\tlinter.warn(\"W047\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (/^00+/.test(data.value)) {\n\t\t\t// Multiple leading zeroes.\n\t\t\tlinter.warn(\"W046\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Warn about script URLs.\n\n\tlinter.on(\"String\", function style_scanJavaScriptURLs(data) {\n\t\tvar re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n\t\tif (linter.getOption(\"scripturl\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (re.test(data.value)) {\n\t\t\tlinter.warn(\"W107\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char\n\t\t\t});\n\t\t}\n\t});\n};\n//@ sourceURL=/src/stable/style.js" -)); - -require.define("/src/stable/jshint.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*!\n * JSHint, by JSHint Community.\n *\n * This file (and this file only) is licensed under the same slightly modified\n * MIT license that JSLint is. It stops evil-doers everywhere:\n *\n *\t Copyright (c) 2002 Douglas Crockford (www.JSLint.com)\n *\n *\t Permission is hereby granted, free of charge, to any person obtaining\n *\t a copy of this software and associated documentation files (the \"Software\"),\n *\t to deal in the Software without restriction, including without limitation\n *\t the rights to use, copy, modify, merge, publish, distribute, sublicense,\n *\t and/or sell copies of the Software, and to permit persons to whom\n *\t the Software is furnished to do so, subject to the following conditions:\n *\n *\t The above copyright notice and this permission notice shall be included\n *\t in all copies or substantial portions of the Software.\n *\n *\t The Software shall be used for Good, not Evil.\n *\n *\t THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *\t IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *\t FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *\t AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *\t LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n *\t FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n *\t DEALINGS IN THE SOFTWARE.\n *\n */\n\n/*jshint quotmark:double */\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar vars = require(\"../shared/vars.js\");\nvar messages = require(\"../shared/messages.js\");\nvar Lexer = require(\"./lex.js\").Lexer;\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\nvar style = require(\"./style.js\");\n\n// We build the application inside a function so that we produce only a single\n// global variable. That function will be invoked immediately, and its return\n// value is the JSHINT function itself.\n\nvar JSHINT = (function () {\n\t\"use strict\";\n\n\tvar anonname,\t\t// The guessed name for anonymous functions.\n\n// These are operators that should not be used with the ! operator.\n\n\t\tbang = {\n\t\t\t\"<\" : true,\n\t\t\t\"<=\" : true,\n\t\t\t\"==\" : true,\n\t\t\t\"===\": true,\n\t\t\t\"!==\": true,\n\t\t\t\"!=\" : true,\n\t\t\t\">\" : true,\n\t\t\t\">=\" : true,\n\t\t\t\"+\" : true,\n\t\t\t\"-\" : true,\n\t\t\t\"*\" : true,\n\t\t\t\"/\" : true,\n\t\t\t\"%\" : true\n\t\t},\n\n\t\t// These are the JSHint boolean options.\n\t\tboolOptions = {\n\t\t\tasi : true, // if automatic semicolon insertion should be tolerated\n\t\t\tbitwise : true, // if bitwise operators should not be allowed\n\t\t\tboss : true, // if advanced usage of assignments should be allowed\n\t\t\tbrowser : true, // if the standard browser globals should be predefined\n\t\t\tcamelcase : true, // if identifiers should be required in camel case\n\t\t\tcouch : true, // if CouchDB globals should be predefined\n\t\t\tcurly : true, // if curly braces around all blocks should be required\n\t\t\tdebug : true, // if debugger statements should be allowed\n\t\t\tdevel : true, // if logging globals should be predefined (console, alert, etc.)\n\t\t\tdojo : true, // if Dojo Toolkit globals should be predefined\n\t\t\teqeqeq : true, // if === should be required\n\t\t\teqnull : true, // if == null comparisons should be tolerated\n\t\t\tes5 : true, // if ES5 syntax should be allowed\n\t\t\tesnext : true, // if es.next specific syntax should be allowed\n\t\t\tevil : true, // if eval should be allowed\n\t\t\texpr : true, // if ExpressionStatement should be allowed as Programs\n\t\t\tforin : true, // if for in statements must filter\n\t\t\tfuncscope : true, // if only function scope should be used for scope tests\n\t\t\tgcl : true, // if JSHint should be compatible with Google Closure Linter\n\t\t\tglobalstrict: true, // if global \"use strict\"; should be allowed (also enables 'strict')\n\t\t\timmed : true, // if immediate invocations must be wrapped in parens\n\t\t\titerator : true, // if the `__iterator__` property should be allowed\n\t\t\tjquery : true, // if jQuery globals should be predefined\n\t\t\tlastsemic : true, // if semicolons may be ommitted for the trailing\n\t\t\t // statements inside of a one-line blocks.\n\t\t\tlatedef : true, // if the use before definition should not be tolerated\n\t\t\tlaxbreak : true, // if line breaks should not be checked\n\t\t\tlaxcomma : true, // if line breaks should not be checked around commas\n\t\t\tloopfunc : true, // if functions should be allowed to be defined within\n\t\t\t // loops\n\t\t\tmootools : true, // if MooTools globals should be predefined\n\t\t\tmultistr : true, // allow multiline strings\n\t\t\tnewcap : true, // if constructor names must be capitalized\n\t\t\tnoarg : true, // if arguments.caller and arguments.callee should be\n\t\t\t // disallowed\n\t\t\tnode : true, // if the Node.js environment globals should be\n\t\t\t // predefined\n\t\t\tnoempty : true, // if empty blocks should be disallowed\n\t\t\tnonew : true, // if using `new` for side-effects should be disallowed\n\t\t\tnonstandard : true, // if non-standard (but widely adopted) globals should\n\t\t\t // be predefined\n\t\t\tnomen : true, // if names should be checked\n\t\t\tonevar : true, // if only one var statement per function should be\n\t\t\t // allowed\n\t\t\tpassfail : true, // if the scan should stop on first error\n\t\t\tphantom : true, // if PhantomJS symbols should be allowed\n\t\t\tplusplus : true, // if increment/decrement should not be allowed\n\t\t\tproto : true, // if the `__proto__` property should be allowed\n\t\t\tprototypejs : true, // if Prototype and Scriptaculous globals should be\n\t\t\t // predefined\n\t\t\trhino : true, // if the Rhino environment globals should be predefined\n\t\t\tundef : true, // if variables should be declared before used\n\t\t\tscripturl : true, // if script-targeted URLs should be tolerated\n\t\t\tshadow : true, // if variable shadowing should be tolerated\n\t\t\tsmarttabs : true, // if smarttabs should be tolerated\n\t\t\t // (http://www.emacswiki.org/emacs/SmartTabs)\n\t\t\tstrict : true, // require the \"use strict\"; pragma\n\t\t\tsub : true, // if all forms of subscript notation are tolerated\n\t\t\tsupernew : true, // if `new function () { ... };` and `new Object;`\n\t\t\t // should be tolerated\n\t\t\ttrailing : true, // if trailing whitespace rules apply\n\t\t\tvalidthis : true, // if 'this' inside a non-constructor function is valid.\n\t\t\t // This is a function scoped option only.\n\t\t\twithstmt : true, // if with statements should be allowed\n\t\t\twhite : true, // if strict whitespace rules apply\n\t\t\tworker : true, // if Web Worker script symbols should be allowed\n\t\t\twsh : true, // if the Windows Scripting Host environment globals\n\t\t\t // should be predefined\n\t\t\tyui : true, // YUI variables should be predefined\n\n\t\t\t// Obsolete options\n\t\t\tonecase : true, // if one case switch statements should be allowed\n\t\t\tregexp : true, // if the . should not be allowed in regexp literals\n\t\t\tregexdash : true // if unescaped first/last dash (-) inside brackets\n\t\t\t // should be tolerated\n\t\t},\n\n\t\t// These are the JSHint options that can take any value\n\t\t// (we use this object to detect invalid options)\n\t\tvalOptions = {\n\t\t\tmaxlen : false,\n\t\t\tindent : false,\n\t\t\tmaxerr : false,\n\t\t\tpredef : false,\n\t\t\tquotmark : false, //'single'|'double'|true\n\t\t\tscope : false,\n\t\t\tmaxstatements: false, // {int} max statements per function\n\t\t\tmaxdepth : false, // {int} max nested block depth per function\n\t\t\tmaxparams : false, // {int} max params per function\n\t\t\tmaxcomplexity: false, // {int} max cyclomatic complexity per function\n\t\t\tunused : true // warn if variables are unused. Available options:\n\t\t\t // false - don't check for unused variables\n\t\t\t // true - \"vars\" + check last function param\n\t\t\t // \"vars\" - skip checking unused function params\n\t\t\t // \"strict\" - \"vars\" + check all function params\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the definition in JSHint is opposite JSLint\n\t\tinvertedOptions = {\n\t\t\tbitwise : true,\n\t\t\tforin : true,\n\t\t\tnewcap : true,\n\t\t\tnomen : true,\n\t\t\tplusplus: true,\n\t\t\tregexp : true,\n\t\t\tundef : true,\n\t\t\twhite : true,\n\n\t\t\t// Inverted and renamed, use JSHint name here\n\t\t\teqeqeq : true,\n\t\t\tonevar : true\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the name has been changed but the effect is unchanged\n\t\trenamedOptions = {\n\t\t\teqeq : \"eqeqeq\",\n\t\t\tvars : \"onevar\",\n\t\t\twindows: \"wsh\"\n\t\t},\n\n\t\tdeclared, // Globals that were declared using /*global ... */ syntax.\n\t\texported, // Variables that are used outside of the current file.\n\n\t\tfunctionicity = [\n\t\t\t\"closure\", \"exception\", \"global\", \"label\",\n\t\t\t\"outer\", \"unused\", \"var\"\n\t\t],\n\n\t\tfunct, // The current function\n\t\tfunctions, // All of the functions\n\n\t\tglobal, // The global scope\n\t\tignored, // Ignored warnings\n\t\timplied, // Implied globals\n\t\tinblock,\n\t\tindent,\n\t\tlookahead,\n\t\tlex,\n\t\tmember,\n\t\tmembersOnly,\n\t\tnoreach,\n\t\tpredefined,\t\t// Global variables defined by option\n\n\t\tscope, // The current scope\n\t\tstack,\n\t\tunuseds,\n\t\turls,\n\t\tuseESNextSyntax,\n\t\twarnings,\n\n\t\textraModules = [],\n\t\temitter = new events.EventEmitter();\n\n\tfunction checkOption(name, t) {\n\t\tname = name.trim();\n\n\t\tif (/^-W\\d{3}$/g.test(name)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (valOptions[name] === undefined && boolOptions[name] === undefined) {\n\t\t\tif (t.type !== \"jslint\" || renamedOptions[name] === undefined) {\n\t\t\t\terror(\"E001\", t, name);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction isString(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object String]\";\n\t}\n\n\tfunction isIdentifier(tkn, value) {\n\t\tif (!tkn)\n\t\t\treturn false;\n\n\t\tif (!tkn.identifier || tkn.value !== value)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}\n\n\tfunction isReserved(token) {\n\t\tif (!token.reserved) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (token.meta && token.meta.isFutureReservedWord) {\n\t\t\t// ES3 FutureReservedWord in an ES5 environment.\n\t\t\tif (state.option.es5 && !token.meta.es5) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Some ES5 FutureReservedWord identifiers are active only\n\t\t\t// within a strict mode environment.\n\t\t\tif (token.meta.strictOnly) {\n\t\t\t\tif (!state.option.strict && !state.directive[\"use strict\"]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (token.isProperty) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction supplant(str, data) {\n\t\treturn str.replace(/\\{([^{}]*)\\}/g, function (a, b) {\n\t\t\tvar r = data[b];\n\t\t\treturn typeof r === \"string\" || typeof r === \"number\" ? r : a;\n\t\t});\n\t}\n\n\tfunction combine(t, o) {\n\t\tvar n;\n\t\tfor (n in o) {\n\t\t\tif (_.has(o, n) && !_.has(JSHINT.blacklist, n)) {\n\t\t\t\tt[n] = o[n];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction updatePredefined() {\n\t\tObject.keys(JSHINT.blacklist).forEach(function (key) {\n\t\t\tdelete predefined[key];\n\t\t});\n\t}\n\n\tfunction assume() {\n\t\tif (state.option.couch) {\n\t\t\tcombine(predefined, vars.couch);\n\t\t}\n\n\t\tif (state.option.rhino) {\n\t\t\tcombine(predefined, vars.rhino);\n\t\t}\n\n\t\tif (state.option.phantom) {\n\t\t\tcombine(predefined, vars.phantom);\n\t\t}\n\n\t\tif (state.option.prototypejs) {\n\t\t\tcombine(predefined, vars.prototypejs);\n\t\t}\n\n\t\tif (state.option.node) {\n\t\t\tcombine(predefined, vars.node);\n\t\t}\n\n\t\tif (state.option.devel) {\n\t\t\tcombine(predefined, vars.devel);\n\t\t}\n\n\t\tif (state.option.dojo) {\n\t\t\tcombine(predefined, vars.dojo);\n\t\t}\n\n\t\tif (state.option.browser) {\n\t\t\tcombine(predefined, vars.browser);\n\t\t}\n\n\t\tif (state.option.nonstandard) {\n\t\t\tcombine(predefined, vars.nonstandard);\n\t\t}\n\n\t\tif (state.option.jquery) {\n\t\t\tcombine(predefined, vars.jquery);\n\t\t}\n\n\t\tif (state.option.mootools) {\n\t\t\tcombine(predefined, vars.mootools);\n\t\t}\n\n\t\tif (state.option.worker) {\n\t\t\tcombine(predefined, vars.worker);\n\t\t}\n\n\t\tif (state.option.wsh) {\n\t\t\tcombine(predefined, vars.wsh);\n\t\t}\n\n\t\tif (state.option.esnext) {\n\t\t\tuseESNextSyntax();\n\t\t}\n\n\t\tif (state.option.globalstrict && state.option.strict !== false) {\n\t\t\tstate.option.strict = true;\n\t\t}\n\n\t\tif (state.option.yui) {\n\t\t\tcombine(predefined, vars.yui);\n\t\t}\n\t}\n\n\n\t// Produce an error warning.\n\tfunction quit(code, line, chr) {\n\t\tvar percentage = Math.floor((line / state.lines.length) * 100);\n\t\tvar message = messages.errors[code].desc;\n\n\t\tthrow {\n\t\t\tname: \"JSHintError\",\n\t\t\tline: line,\n\t\t\tcharacter: chr,\n\t\t\tmessage: message + \" (\" + percentage + \"% scanned).\",\n\t\t\traw: message\n\t\t};\n\t}\n\n\tfunction isundef(scope, code, token, a) {\n\t\treturn JSHINT.undefs.push([scope, code, token, a]);\n\t}\n\n\tfunction warning(code, t, a, b, c, d) {\n\t\tvar ch, l, w, msg;\n\n\t\tif (/^W\\d{3}$/.test(code)) {\n\t\t\tif (ignored[code]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmsg = messages.warnings[code];\n\t\t} else if (/E\\d{3}/.test(code)) {\n\t\t\tmsg = messages.errors[code];\n\t\t} else if (/I\\d{3}/.test(code)) {\n\t\t\tmsg = messages.info[code];\n\t\t}\n\n\t\tt = t || state.tokens.next;\n\t\tif (t.id === \"(end)\") { // `~\n\t\t\tt = state.tokens.curr;\n\t\t}\n\n\t\tl = t.line || 0;\n\t\tch = t.from || 0;\n\n\t\tw = {\n\t\t\tid: \"(error)\",\n\t\t\traw: msg.desc,\n\t\t\tcode: msg.code,\n\t\t\tevidence: state.lines[l - 1] || \"\",\n\t\t\tline: l,\n\t\t\tcharacter: ch,\n\t\t\tscope: JSHINT.scope,\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\td: d\n\t\t};\n\n\t\tw.reason = supplant(msg.desc, w);\n\t\tJSHINT.errors.push(w);\n\n\t\tif (state.option.passfail) {\n\t\t\tquit(\"E042\", l, ch);\n\t\t}\n\n\t\twarnings += 1;\n\t\tif (warnings >= state.option.maxerr) {\n\t\t\tquit(\"E043\", l, ch);\n\t\t}\n\n\t\treturn w;\n\t}\n\n\tfunction warningAt(m, l, ch, a, b, c, d) {\n\t\treturn warning(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\tfunction error(m, t, a, b, c, d) {\n\t\twarning(m, t, a, b, c, d);\n\t}\n\n\tfunction errorAt(m, l, ch, a, b, c, d) {\n\t\treturn error(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\t// Tracking of \"internal\" scripts, like eval containing a static string\n\tfunction addInternalSrc(elem, src) {\n\t\tvar i;\n\t\ti = {\n\t\t\tid: \"(internal)\",\n\t\t\telem: elem,\n\t\t\tvalue: src\n\t\t};\n\t\tJSHINT.internals.push(i);\n\t\treturn i;\n\t}\n\n\tfunction addlabel(t, type, tkn) {\n\t\t// Define t in the current function in the current scope.\n\t\tif (type === \"exception\") {\n\t\t\tif (_.has(funct[\"(context)\"], t)) {\n\t\t\t\tif (funct[t] !== true && !state.option.node) {\n\t\t\t\t\twarning(\"W002\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (_.has(funct, t) && !funct[\"(global)\"]) {\n\t\t\tif (funct[t] === true) {\n\t\t\t\tif (state.option.latedef)\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t} else {\n\t\t\t\tif (!state.option.shadow && type !== \"exception\") {\n\t\t\t\t\twarning(\"W004\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunct[t] = type;\n\n\t\tif (tkn) {\n\t\t\tfunct[\"(tokens)\"][t] = tkn;\n\t\t}\n\n\t\tif (funct[\"(global)\"]) {\n\t\t\tglobal[t] = funct;\n\t\t\tif (_.has(implied, t)) {\n\t\t\t\tif (state.option.latedef) {\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t\t}\n\n\t\t\t\tdelete implied[t];\n\t\t\t}\n\t\t} else {\n\t\t\tscope[t] = funct;\n\t\t}\n\t}\n\n\tfunction doOption() {\n\t\tvar nt = state.tokens.next;\n\t\tvar body = nt.body.split(\",\").map(function (s) { return s.trim(); });\n\t\tvar predef = {};\n\n\t\tif (nt.type === \"globals\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = g[0];\n\t\t\t\tvar val = g[1];\n\n\t\t\t\tif (key.charAt(0) === \"-\") {\n\t\t\t\t\tkey = key.slice(1);\n\t\t\t\t\tval = false;\n\n\t\t\t\t\tJSHINT.blacklist[key] = key;\n\t\t\t\t\tupdatePredefined();\n\t\t\t\t} else {\n\t\t\t\t\tpredef[key] = (val === \"true\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcombine(predefined, predef);\n\n\t\t\tfor (var key in predef) {\n\t\t\t\tif (_.has(predef, key)) {\n\t\t\t\t\tdeclared[key] = nt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (nt.type === \"exported\") {\n\t\t\tbody.forEach(function (e) {\n\t\t\t\texported[e] = true;\n\t\t\t});\n\t\t}\n\n\t\tif (nt.type === \"members\") {\n\t\t\tmembersOnly = membersOnly || {};\n\n\t\t\tbody.forEach(function (m) {\n\t\t\t\tvar ch1 = m.charAt(0);\n\t\t\t\tvar ch2 = m.charAt(m.length - 1);\n\n\t\t\t\tif (ch1 === ch2 && (ch1 === \"\\\"\" || ch1 === \"'\")) {\n\t\t\t\t\tm = m\n\t\t\t\t\t\t.substr(1, m.length - 2)\n\t\t\t\t\t\t.replace(\"\\\\b\", \"\\b\")\n\t\t\t\t\t\t.replace(\"\\\\t\", \"\\t\")\n\t\t\t\t\t\t.replace(\"\\\\n\", \"\\n\")\n\t\t\t\t\t\t.replace(\"\\\\v\", \"\\v\")\n\t\t\t\t\t\t.replace(\"\\\\f\", \"\\f\")\n\t\t\t\t\t\t.replace(\"\\\\r\", \"\\r\")\n\t\t\t\t\t\t.replace(\"\\\\\\\\\", \"\\\\\")\n\t\t\t\t\t\t.replace(\"\\\\\\\"\", \"\\\"\");\n\t\t\t\t}\n\n\t\t\t\tmembersOnly[m] = false;\n\t\t\t});\n\t\t}\n\n\t\tvar numvals = [\n\t\t\t\"maxstatements\",\n\t\t\t\"maxparams\",\n\t\t\t\"maxdepth\",\n\t\t\t\"maxcomplexity\",\n\t\t\t\"maxerr\",\n\t\t\t\"maxlen\",\n\t\t\t\"indent\"\n\t\t];\n\n\t\tif (nt.type === \"jshint\" || nt.type === \"jslint\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = (g[0] || \"\").trim();\n\t\t\t\tvar val = (g[1] || \"\").trim();\n\n\t\t\t\tif (!checkOption(key, nt)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (numvals.indexOf(key) >= 0) {\n\t\t\t\t\tval = +val;\n\n\t\t\t\t\tif (typeof val !== \"number\" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) {\n\t\t\t\t\t\terror(\"E032\", nt, g[1].trim());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"indent\") {\n\t\t\t\t\t\tstate.option[\"(explicitIndent)\"] = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.option[key] = val;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"validthis\") {\n\t\t\t\t\t// `validthis` is valid only within a function scope.\n\t\t\t\t\tif (funct[\"(global)\"]) {\n\t\t\t\t\t\terror(\"E009\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\t\t\tstate.option.validthis = (val === \"true\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"quotmark\") {\n\t\t\t\t\tswitch (val) {\n\t\t\t\t\tcase \"true\":\n\t\t\t\t\tcase \"false\":\n\t\t\t\t\t\tstate.option.quotmark = (val === \"true\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\tcase \"single\":\n\t\t\t\t\t\tstate.option.quotmark = val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"unused\") {\n\t\t\t\t\tswitch (val) {\n\t\t\t\t\tcase \"true\":\n\t\t\t\t\t\tstate.option.unused = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"false\":\n\t\t\t\t\t\tstate.option.unused = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vars\":\n\t\t\t\t\tcase \"strict\":\n\t\t\t\t\t\tstate.option.unused = val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (/^-W\\d{3}$/g.test(key)) {\n\t\t\t\t\tignored[key.slice(1)] = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tn;\n\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\tif (nt.type === \"jslint\") {\n\t\t\t\t\t\ttn = renamedOptions[key] || key;\n\t\t\t\t\t\tstate.option[tn] = (val === \"true\");\n\n\t\t\t\t\t\tif (invertedOptions[tn] !== undefined) {\n\t\t\t\t\t\t\tstate.option[tn] = !state.option[tn];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.option[key] = (val === \"true\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"newcap\") {\n\t\t\t\t\t\tstate.option[\"(explicitNewcap)\"] = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terror(\"E002\", nt);\n\t\t\t});\n\n\t\t\tassume();\n\t\t}\n\t}\n\n\t// We need a peek function. If it has an argument, it peeks that much farther\n\t// ahead. It is used to distinguish\n\t//\t for ( var i in ...\n\t// from\n\t//\t for ( var i = ...\n\n\tfunction peek(p) {\n\t\tvar i = p || 0, j = 0, t;\n\n\t\twhile (j <= i) {\n\t\t\tt = lookahead[j];\n\t\t\tif (!t) {\n\t\t\t\tt = lookahead[j] = lex.token();\n\t\t\t}\n\t\t\tj += 1;\n\t\t}\n\t\treturn t;\n\t}\n\n\t// Produce the next token. It looks for programming errors.\n\n\tfunction advance(id, t) {\n\t\tswitch (state.tokens.curr.id) {\n\t\tcase \"(number)\":\n\t\t\tif (state.tokens.next.id === \".\") {\n\t\t\t\twarning(\"W005\", state.tokens.curr);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tif (state.tokens.next.id === \"-\" || state.tokens.next.id === \"--\") {\n\t\t\t\twarning(\"W006\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"+\":\n\t\t\tif (state.tokens.next.id === \"+\" || state.tokens.next.id === \"++\") {\n\t\t\t\twarning(\"W007\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (state.tokens.curr.type === \"(string)\" || state.tokens.curr.identifier) {\n\t\t\tanonname = state.tokens.curr.value;\n\t\t}\n\n\t\tif (id && state.tokens.next.id !== id) {\n\t\t\tif (t) {\n\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\terror(\"E019\", t, t.id);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E020\", state.tokens.next, id, t.id, t.line, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t} else if (state.tokens.next.type !== \"(identifier)\" || state.tokens.next.value !== id) {\n\t\t\t\twarning(\"W116\", state.tokens.next, id, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\n\t\tstate.tokens.prev = state.tokens.curr;\n\t\tstate.tokens.curr = state.tokens.next;\n\t\tfor (;;) {\n\t\t\tstate.tokens.next = lookahead.shift() || lex.token();\n\n\t\t\tif (!state.tokens.next) { // No more tokens left, give up\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \"(end)\" || state.tokens.next.id === \"(error)\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (state.tokens.next.isSpecial) {\n\t\t\t\tdoOption();\n\t\t\t} else {\n\t\t\t\tif (state.tokens.next.id !== \"(endline)\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it\n\t// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is\n\t// like .nud except that it is only used on the first token of a statement.\n\t// Having .fud makes it much easier to define statement-oriented languages like\n\t// JavaScript. I retained Pratt's nomenclature.\n\n\t// .nud Null denotation\n\t// .fud First null denotation\n\t// .led Left denotation\n\t// lbp Left binding power\n\t// rbp Right binding power\n\n\t// They are elements of the parsing method called Top Down Operator Precedence.\n\n\tfunction expression(rbp, initial) {\n\t\tvar left, isArray = false, isObject = false;\n\n\t\tif (state.tokens.next.id === \"(end)\")\n\t\t\terror(\"E006\", state.tokens.curr);\n\n\t\tadvance();\n\n\t\tif (initial) {\n\t\t\tanonname = \"anonymous\";\n\t\t\tfunct[\"(verb)\"] = state.tokens.curr.value;\n\t\t}\n\n\t\tif (initial === true && state.tokens.curr.fud) {\n\t\t\tleft = state.tokens.curr.fud();\n\t\t} else {\n\t\t\tif (state.tokens.curr.nud) {\n\t\t\t\tleft = state.tokens.curr.nud();\n\t\t\t} else {\n\t\t\t\terror(\"E030\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t}\n\n\t\t\twhile (rbp < state.tokens.next.lbp) {\n\t\t\t\tisArray = state.tokens.curr.value === \"Array\";\n\t\t\t\tisObject = state.tokens.curr.value === \"Object\";\n\n\t\t\t\t// #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object()\n\t\t\t\t// Line breaks in IfStatement heads exist to satisfy the checkJSHint\n\t\t\t\t// \"Line too long.\" error.\n\t\t\t\tif (left && (left.value || (left.first && left.first.value))) {\n\t\t\t\t\t// If the left.value is not \"new\", or the left.first.value is a \".\"\n\t\t\t\t\t// then safely assume that this is not \"new Array()\" and possibly\n\t\t\t\t\t// not \"new Object()\"...\n\t\t\t\t\tif (left.value !== \"new\" ||\n\t\t\t\t\t (left.first && left.first.value && left.first.value === \".\")) {\n\t\t\t\t\t\tisArray = false;\n\t\t\t\t\t\t// ...In the case of Object, if the left.value and state.tokens.curr.value\n\t\t\t\t\t\t// are not equal, then safely assume that this not \"new Object()\"\n\t\t\t\t\t\tif (left.value !== state.tokens.curr.value) {\n\t\t\t\t\t\t\tisObject = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tadvance();\n\n\t\t\t\tif (isArray && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W009\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (isObject && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W010\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.led) {\n\t\t\t\t\tleft = state.tokens.curr.led(left);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E033\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn left;\n\t}\n\n\n// Functions for conformance of style.\n\n\tfunction adjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white) {\n\t\t\tif (left.character !== right.from && left.line === right.line) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W011\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreak(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && (left.character !== right.from || left.line !== right.line)) {\n\t\t\twarning(\"W012\", right, right.value);\n\t\t}\n\t}\n\n\tfunction nospace(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && !left.comment) {\n\t\t\tif (left.line === right.line) {\n\t\t\t\tadjacent(left, right);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nonadjacent(left, right) {\n\t\tif (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\n\t\t\tif (left.value === \";\" && right.value === \";\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (left.line === right.line && left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreaknonadjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (!state.option.laxbreak && left.line !== right.line) {\n\t\t\twarning(\"W014\", right, right.id);\n\t\t} else if (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\t\t\tif (left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction indentation(bias) {\n\t\tif (!state.option.white && !state.option[\"(explicitIndent)\"]) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = indent + (bias || 0);\n\t\tif (state.tokens.next.from !== i) {\n\t\t\twarning(\"W015\", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from);\n\t\t}\n\t}\n\n\tfunction nolinebreak(t) {\n\t\tt = t || state.tokens.curr;\n\t\tif (t.line !== state.tokens.next.line) {\n\t\t\twarning(\"E022\", t, t.value);\n\t\t}\n\t}\n\n\n\tfunction comma(opts) {\n\t\topts = opts || {};\n\n\t\tif (state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\tif (!state.option.laxcomma) {\n\t\t\t\tif (comma.first) {\n\t\t\t\t\twarning(\"I001\");\n\t\t\t\t\tcomma.first = false;\n\t\t\t\t}\n\t\t\t\twarning(\"W014\", state.tokens.curr, state.tokens.next.id);\n\t\t\t}\n\t\t} else if (!state.tokens.curr.comment &&\n\t\t\t\tstate.tokens.curr.character !== state.tokens.next.from && state.option.white) {\n\t\t\tstate.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from);\n\t\t\twarning(\"W011\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\n\t\tadvance(\",\");\n\n\t\t// TODO: This is a temporary solution to fight against false-positives in\n\t\t// arrays and objects with trailing commas (see GH-363). The best solution\n\t\t// would be to extract all whitespace rules out of parser.\n\n\t\tif (state.tokens.next.value !== \"]\" && state.tokens.next.value !== \"}\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\n\t\tif (state.tokens.next.identifier) {\n\t\t\t// Keywords that cannot follow a comma operator.\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"break\":\n\t\t\tcase \"case\":\n\t\t\tcase \"catch\":\n\t\t\tcase \"continue\":\n\t\t\tcase \"default\":\n\t\t\tcase \"do\":\n\t\t\tcase \"else\":\n\t\t\tcase \"finally\":\n\t\t\tcase \"for\":\n\t\t\tcase \"if\":\n\t\t\tcase \"in\":\n\t\t\tcase \"instanceof\":\n\t\t\tcase \"return\":\n\t\t\tcase \"switch\":\n\t\t\tcase \"throw\":\n\t\t\tcase \"try\":\n\t\t\tcase \"var\":\n\t\t\tcase \"while\":\n\t\t\tcase \"with\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.type === \"(punctuator)\") {\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"}\":\n\t\t\tcase \"]\":\n\t\t\tcase \",\":\n\t\t\t\tif (opts.allowTrailing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* falls through */\n\t\t\tcase \")\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Functional constructors for making the symbols that will be inherited by\n\t// tokens.\n\n\tfunction symbol(s, p) {\n\t\tvar x = state.syntax[s];\n\t\tif (!x || typeof x !== \"object\") {\n\t\t\tstate.syntax[s] = x = {\n\t\t\t\tid: s,\n\t\t\t\tlbp: p,\n\t\t\t\tvalue: s\n\t\t\t};\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction delim(s) {\n\t\treturn symbol(s, 0);\n\t}\n\n\tfunction stmt(s, f) {\n\t\tvar x = delim(s);\n\t\tx.identifier = x.reserved = true;\n\t\tx.fud = f;\n\t\treturn x;\n\t}\n\n\tfunction blockstmt(s, f) {\n\t\tvar x = stmt(s, f);\n\t\tx.block = true;\n\t\treturn x;\n\t}\n\n\tfunction reserveName(x) {\n\t\tvar c = x.id.charAt(0);\n\t\tif ((c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\")) {\n\t\t\tx.identifier = x.reserved = true;\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction prefix(s, f) {\n\t\tvar x = symbol(s, 150);\n\t\treserveName(x);\n\t\tx.nud = (typeof f === \"function\") ? f : function () {\n\t\t\tthis.right = expression(150);\n\t\t\tthis.arity = \"unary\";\n\t\t\tif (this.id === \"++\" || this.id === \"--\") {\n\t\t\t\tif (state.option.plusplus) {\n\t\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t\t} else if ((!this.right.identifier || isReserved(this.right)) &&\n\t\t\t\t\t\tthis.right.id !== \".\" && this.right.id !== \"[\") {\n\t\t\t\t\twarning(\"W017\", this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction type(s, f) {\n\t\tvar x = delim(s);\n\t\tx.type = s;\n\t\tx.nud = f;\n\t\treturn x;\n\t}\n\n\tfunction reserve(name, func) {\n\t\tvar x = type(name, func);\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\treturn x;\n\t}\n\n\tfunction FutureReservedWord(name, meta) {\n\t\tvar x = type(name, function () {\n\t\t\treturn this;\n\t\t});\n\n\t\tmeta = meta || {};\n\t\tmeta.isFutureReservedWord = true;\n\n\t\tx.value = name;\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\tx.meta = meta;\n\n\t\treturn x;\n\t}\n\n\tfunction reservevar(s, v) {\n\t\treturn reserve(s, function () {\n\t\t\tif (typeof v === \"function\") {\n\t\t\t\tv(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t}\n\n\tfunction infix(s, f, p, w) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = function (left) {\n\t\t\tif (!w) {\n\t\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t\tif (s === \"in\" && left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\t\t\tif (typeof f === \"function\") {\n\t\t\t\treturn f(left, this);\n\t\t\t} else {\n\t\t\t\tthis.left = left;\n\t\t\t\tthis.right = expression(p);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction relation(s, f) {\n\t\tvar x = symbol(s, 100);\n\n\t\tx.led = function (left) {\n\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tvar right = expression(100);\n\n\t\t\tif (isIdentifier(left, \"NaN\") || isIdentifier(right, \"NaN\")) {\n\t\t\t\twarning(\"W019\", this);\n\t\t\t} else if (f) {\n\t\t\t\tf.apply(this, [left, right]);\n\t\t\t}\n\n\t\t\tif (!left || !right) {\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\n\t\t\tif (right.id === \"!\") {\n\t\t\t\twarning(\"W018\", right, \"!\");\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction isPoorRelation(node) {\n\t\treturn node &&\n\t\t\t ((node.type === \"(number)\" && +node.value === 0) ||\n\t\t\t (node.type === \"(string)\" && node.value === \"\") ||\n\t\t\t (node.type === \"null\" && !state.option.eqnull) ||\n\t\t\t\tnode.type === \"true\" ||\n\t\t\t\tnode.type === \"false\" ||\n\t\t\t\tnode.type === \"undefined\");\n\t}\n\n\tfunction assignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\n\t\treturn infix(s, function (left, that) {\n\t\t\tthat.left = left;\n\n\t\t\tif (predefined[left.value] === false &&\n\t\t\t\t\tscope[left.value][\"(global)\"] === true) {\n\t\t\t\twarning(\"W020\", left);\n\t\t\t} else if (left[\"function\"]) {\n\t\t\t\twarning(\"W021\", left, left.value);\n\t\t\t}\n\n\t\t\tif (left) {\n\t\t\t\tif (state.option.esnext && funct[left.value] === \"const\") {\n\t\t\t\t\terror(\"E013\", left, left.value);\n\t\t\t\t}\n\n\t\t\t\tif (left.id === \".\" || left.id === \"[\") {\n\t\t\t\t\tif (!left.left || left.left.value === \"arguments\") {\n\t\t\t\t\t\twarning(\"E031\", that);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t} else if (left.identifier && !isReserved(left)) {\n\t\t\t\t\tif (funct[left.value] === \"exception\") {\n\t\t\t\t\t\twarning(\"W022\", left);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction bitwise(s, f, p) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = (typeof f === \"function\") ? f : function (left) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t}\n\t\t\tthis.left = left;\n\t\t\tthis.right = expression(p);\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\n\tfunction bitwiseassignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\t\treturn infix(s, function (left, that) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", that, that.id);\n\t\t\t}\n\t\t\tnonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tif (left) {\n\t\t\t\tif (left.id === \".\" || left.id === \"[\" ||\n\t\t\t\t\t\t(left.identifier && !isReserved(left))) {\n\t\t\t\t\texpression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t}\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction suffix(s) {\n\t\tvar x = symbol(s, 150);\n\n\t\tx.led = function (left) {\n\t\t\tif (state.option.plusplus) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t} else if ((!left.identifier || isReserved(left)) && left.id !== \".\" && left.id !== \"[\") {\n\t\t\t\twarning(\"W017\", this);\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument (see identifier())\n\t// prop means that this identifier is that of an object property\n\n\tfunction optionalidentifier(fnparam, prop) {\n\t\tif (!state.tokens.next.identifier) {\n\t\t\treturn;\n\t\t}\n\n\t\tadvance();\n\n\t\tvar curr = state.tokens.curr;\n\t\tvar meta = curr.meta || {};\n\t\tvar val = state.tokens.curr.value;\n\n\t\tif (!isReserved(curr)) {\n\t\t\treturn val;\n\t\t}\n\n\t\tif (prop) {\n\t\t\tif (state.option.es5 || meta.isFutureReservedWord) {\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\n\t\tif (fnparam && val === \"undefined\") {\n\t\t\treturn val;\n\t\t}\n\n\t\twarning(\"W024\", state.tokens.curr, state.tokens.curr.id);\n\t\treturn val;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument\n\t// prop means that this identifier is that of an object property\n\tfunction identifier(fnparam, prop) {\n\t\tvar i = optionalidentifier(fnparam, prop);\n\t\tif (i) {\n\t\t\treturn i;\n\t\t}\n\t\tif (state.tokens.curr.id === \"function\" && state.tokens.next.id === \"(\") {\n\t\t\twarning(\"W025\");\n\t\t} else {\n\t\t\terror(\"E030\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t}\n\n\n\tfunction reachable(s) {\n\t\tvar i = 0, t;\n\t\tif (state.tokens.next.id !== \";\" || noreach) {\n\t\t\treturn;\n\t\t}\n\t\tfor (;;) {\n\t\t\tt = peek(i);\n\t\t\tif (t.reach) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (t.id !== \"(endline)\") {\n\t\t\t\tif (t.id === \"function\") {\n\t\t\t\t\tif (!state.option.latedef) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\twarning(\"W026\", t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twarning(\"W027\", t, t.value, s);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti += 1;\n\t\t}\n\t}\n\n\n\tfunction statement(noindent) {\n\t\tvar i = indent, r, s = scope, t = state.tokens.next;\n\n\t\tif (t.id === \";\") {\n\t\t\tadvance(\";\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Is this a labelled statement?\n\t\tvar res = isReserved(t);\n\n\t\t// We're being more tolerant here: if someone uses\n\t\t// a FutureReservedWord as a label, we warn but proceed\n\t\t// anyway.\n\n\t\tif (res && t.meta && t.meta.isFutureReservedWord) {\n\t\t\twarning(\"W024\", t, t.id);\n\t\t\tres = false;\n\t\t}\n\n\t\tif (t.identifier && !res && peek().id === \":\") {\n\t\t\tadvance();\n\t\t\tadvance(\":\");\n\t\t\tscope = Object.create(s);\n\t\t\taddlabel(t.value, \"label\");\n\n\t\t\tif (!state.tokens.next.labelled && state.tokens.next.value !== \"{\") {\n\t\t\t\twarning(\"W028\", state.tokens.next, t.value, state.tokens.next.value);\n\t\t\t}\n\n\t\t\tif (reg.javascriptURL.test(t.value + \":\")) {\n\t\t\t\twarning(\"W029\", t, t.value);\n\t\t\t}\n\n\t\t\tstate.tokens.next.label = t.value;\n\t\t\tt = state.tokens.next;\n\t\t}\n\n\t\t// Is it a lonely block?\n\n\t\tif (t.id === \"{\") {\n\t\t\tblock(true, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse the statement.\n\n\t\tif (!noindent) {\n\t\t\tindentation();\n\t\t}\n\t\tr = expression(0, true);\n\n\t\t// Look for the final semicolon.\n\n\t\tif (!t.block) {\n\t\t\tif (!state.option.expr && (!r || !r.exps)) {\n\t\t\t\twarning(\"W030\", state.tokens.curr);\n\t\t\t} else if (state.option.nonew && r.id === \"(\" && r.left.id === \"new\") {\n\t\t\t\twarning(\"W031\", t);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\treturn comma();\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (!state.option.asi) {\n\t\t\t\t\t// If this is the last statement in a block that ends on\n\t\t\t\t\t// the same line *and* option lastsemic is on, ignore the warning.\n\t\t\t\t\t// Otherwise, complain about missing semicolon.\n\t\t\t\t\tif (!state.option.lastsemic || state.tokens.next.id !== \"}\" ||\n\t\t\t\t\t\tstate.tokens.next.line !== state.tokens.curr.line) {\n\t\t\t\t\t\twarningAt(\"W033\", state.tokens.curr.line, state.tokens.curr.character);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\";\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t}\n\n\t\t// Restore the indentation.\n\n\t\tindent = i;\n\t\tscope = s;\n\t\treturn r;\n\t}\n\n\n\tfunction statements(startLine) {\n\t\tvar a = [], p;\n\n\t\twhile (!state.tokens.next.reach && state.tokens.next.id !== \"(end)\") {\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\tp = peek();\n\n\t\t\t\tif (!p || (p.id !== \"(\" && p.id !== \"[\")) {\n\t\t\t\t\twarning(\"W032\");\n\t\t\t\t}\n\n\t\t\t\tadvance(\";\");\n\t\t\t} else {\n\t\t\t\ta.push(statement(startLine === state.tokens.next.line));\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n\n\n\t/*\n\t * read all directives\n\t * recognizes a simple form of asi, but always\n\t * warns, if it is used\n\t */\n\tfunction directives() {\n\t\tvar i, p, pn;\n\n\t\tfor (;;) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tp = peek(0);\n\t\t\t\tif (p.id === \"(endline)\") {\n\t\t\t\t\ti = 1;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tpn = peek(i);\n\t\t\t\t\t\ti = i + 1;\n\t\t\t\t\t} while (pn.id === \"(endline)\");\n\n\t\t\t\t\tif (pn.id !== \";\") {\n\t\t\t\t\t\tif (pn.id !== \"(string)\" && pn.id !== \"(number)\" &&\n\t\t\t\t\t\t\tpn.id !== \"(regexp)\" && pn.identifier !== true &&\n\t\t\t\t\t\t\tpn.id !== \"}\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twarning(\"W033\", state.tokens.next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp = pn;\n\t\t\t\t\t}\n\t\t\t\t} else if (p.id === \"}\") {\n\t\t\t\t\t// Directive with no other statements, warn about missing semicolon\n\t\t\t\t\twarning(\"W033\", p);\n\t\t\t\t} else if (p.id !== \";\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tindentation();\n\t\t\t\tadvance();\n\t\t\t\tif (state.directive[state.tokens.curr.value]) {\n\t\t\t\t\twarning(\"W034\", state.tokens.curr, state.tokens.curr.value);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.value === \"use strict\") {\n\t\t\t\t\tif (!state.option[\"(explicitNewcap)\"])\n\t\t\t\t\t\tstate.option.newcap = true;\n\t\t\t\t\tstate.option.undef = true;\n\t\t\t\t}\n\n\t\t\t\t// there's no directive negation, so always set to true\n\t\t\t\tstate.directive[state.tokens.curr.value] = true;\n\n\t\t\t\tif (p.id === \";\") {\n\t\t\t\t\tadvance(\";\");\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\t/*\n\t * Parses a single block. A block is a sequence of statements wrapped in\n\t * braces.\n\t *\n\t * ordinary - true for everything but function bodies and try blocks.\n\t * stmt\t\t- true if block can be a single statement (e.g. in if/for/while).\n\t * isfunc\t- true if block is a function body\n\t */\n\tfunction block(ordinary, stmt, isfunc) {\n\t\tvar a,\n\t\t\tb = inblock,\n\t\t\told_indent = indent,\n\t\t\tm,\n\t\t\ts = scope,\n\t\t\tt,\n\t\t\tline,\n\t\t\td;\n\n\t\tinblock = ordinary;\n\n\t\tif (!ordinary || !state.option.funcscope)\n\t\t\tscope = Object.create(scope);\n\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\n\t\tvar metrics = funct[\"(metrics)\"];\n\t\tmetrics.nestedBlockDepth += 1;\n\t\tmetrics.verifyMaxNestedBlockDepthPerFunction();\n\n\t\tif (state.tokens.next.id === \"{\") {\n\t\t\tadvance(\"{\");\n\t\t\tline = state.tokens.curr.line;\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\twhile (!ordinary && state.tokens.next.from > indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tm = {};\n\t\t\t\t\tfor (d in state.directive) {\n\t\t\t\t\t\tif (_.has(state.directive, d)) {\n\t\t\t\t\t\t\tm[d] = state.directive[d];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectives();\n\n\t\t\t\t\tif (state.option.strict && funct[\"(context)\"][\"(global)\"]) {\n\t\t\t\t\t\tif (!m[\"use strict\"] && !state.directive[\"use strict\"]) {\n\t\t\t\t\t\t\twarning(\"E007\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ta = statements(line);\n\n\t\t\t\tmetrics.statementCount += a.length;\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tstate.directive = m;\n\t\t\t\t}\n\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tif (line !== state.tokens.next.line) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\t\t\t} else if (line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", t);\n\t\t\tindent = old_indent;\n\t\t} else if (!ordinary) {\n\t\t\terror(\"E021\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t} else {\n\t\t\tif (!stmt || state.option.curly) {\n\t\t\t\twarning(\"W116\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t\t}\n\n\t\t\tnoreach = true;\n\t\t\tindent += state.option.indent;\n\t\t\t// test indentation only if statement is in new line\n\t\t\ta = [statement(state.tokens.next.line === state.tokens.curr.line)];\n\t\t\tindent -= state.option.indent;\n\t\t\tnoreach = false;\n\t\t}\n\t\tfunct[\"(verb)\"] = null;\n\t\tif (!ordinary || !state.option.funcscope) scope = s;\n\t\tinblock = b;\n\t\tif (ordinary && state.option.noempty && (!a || a.length === 0)) {\n\t\t\twarning(\"W035\");\n\t\t}\n\t\tmetrics.nestedBlockDepth -= 1;\n\t\treturn a;\n\t}\n\n\n\tfunction countMember(m) {\n\t\tif (membersOnly && typeof membersOnly[m] !== \"boolean\") {\n\t\t\twarning(\"W036\", state.tokens.curr, m);\n\t\t}\n\t\tif (typeof member[m] === \"number\") {\n\t\t\tmember[m] += 1;\n\t\t} else {\n\t\t\tmember[m] = 1;\n\t\t}\n\t}\n\n\n\tfunction note_implied(tkn) {\n\t\tvar name = tkn.value, line = tkn.line, a = implied[name];\n\t\tif (typeof a === \"function\") {\n\t\t\ta = false;\n\t\t}\n\n\t\tif (!a) {\n\t\t\ta = [line];\n\t\t\timplied[name] = a;\n\t\t} else if (a[a.length - 1] !== line) {\n\t\t\ta.push(line);\n\t\t}\n\t}\n\n\n\t// Build the syntax table by declaring the syntactic elements of the language.\n\n\ttype(\"(number)\", function () {\n\t\treturn this;\n\t});\n\n\ttype(\"(string)\", function () {\n\t\treturn this;\n\t});\n\n\tstate.syntax[\"(identifier)\"] = {\n\t\ttype: \"(identifier)\",\n\t\tlbp: 0,\n\t\tidentifier: true,\n\t\tnud: function () {\n\t\t\tvar v = this.value,\n\t\t\t\ts = scope[v],\n\t\t\t\tf;\n\n\t\t\tif (typeof s === \"function\") {\n\t\t\t\t// Protection against accidental inheritance.\n\t\t\t\ts = undefined;\n\t\t\t} else if (typeof s === \"boolean\") {\n\t\t\t\tf = funct;\n\t\t\t\tfunct = functions[0];\n\t\t\t\taddlabel(v, \"var\");\n\t\t\t\ts = funct;\n\t\t\t\tfunct = f;\n\t\t\t}\n\n\t\t\t// The name is in scope and defined in the current function.\n\t\t\tif (funct === s) {\n\t\t\t\t// Change 'unused' to 'var', and reject labels.\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[v] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"unction\":\n\t\t\t\t\tfunct[v] = \"function\";\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"function\":\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (funct[\"(global)\"]) {\n\t\t\t\t// The name is not defined in the function. If we are in the global\n\t\t\t\t// scope, then we have an undefined variable.\n\t\t\t\t//\n\t\t\t\t// Operators typeof and delete do not raise runtime errors even if\n\t\t\t\t// the base object of a reference is null so no need to display warning\n\t\t\t\t// if we're inside of typeof or delete.\n\n\t\t\t\tif (typeof predefined[v] !== \"boolean\") {\n\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t(state.tokens.next && (state.tokens.next.value === \".\" ||\n\t\t\t\t\t\t\tstate.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t} else {\n\t\t\t\t// If the name is already defined in the current\n\t\t\t\t// function, but not as outer, then there is a scope error.\n\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"closure\":\n\t\t\t\tcase \"function\":\n\t\t\t\tcase \"var\":\n\t\t\t\tcase \"unused\":\n\t\t\t\t\twarning(\"W038\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outer\":\n\t\t\t\tcase \"global\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// If the name is defined in an outer function, make an outer entry,\n\t\t\t\t\t// and if it was unused, make it var.\n\t\t\t\t\tif (s === true) {\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t} else if (s === null) {\n\t\t\t\t\t\twarning(\"W039\", state.tokens.curr, v);\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else if (typeof s !== \"object\") {\n\t\t\t\t\t\t// Operators typeof and delete do not raise runtime errors even\n\t\t\t\t\t\t// if the base object of a reference is null so no need to\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// display warning if we're inside of typeof or delete.\n\t\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t\t(state.tokens.next &&\n\t\t\t\t\t\t\t\t(state.tokens.next.value === \".\" || state.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (s[v]) {\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\tcase \"unction\":\n\t\t\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"var\":\n\t\t\t\t\t\tcase \"unused\":\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"closure\":\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"label\":\n\t\t\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tled: function () {\n\t\t\terror(\"E033\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t};\n\n\ttype(\"(regexp)\", function () {\n\t\treturn this;\n\t});\n\n\t// ECMAScript parser\n\n\tdelim(\"(endline)\");\n\tdelim(\"(begin)\");\n\tdelim(\"(end)\").reach = true;\n\tdelim(\"(error)\").reach = true;\n\tdelim(\"}\").reach = true;\n\tdelim(\")\");\n\tdelim(\"]\");\n\tdelim(\"\\\"\").reach = true;\n\tdelim(\"'\").reach = true;\n\tdelim(\";\");\n\tdelim(\":\").reach = true;\n\tdelim(\",\");\n\tdelim(\"#\");\n\n\treserve(\"else\");\n\treserve(\"case\").reach = true;\n\treserve(\"catch\");\n\treserve(\"default\").reach = true;\n\treserve(\"finally\");\n\treservevar(\"arguments\", function (x) {\n\t\tif (state.directive[\"use strict\"] && funct[\"(global)\"]) {\n\t\t\twarning(\"E008\", x);\n\t\t}\n\t});\n\treservevar(\"eval\");\n\treservevar(\"false\");\n\treservevar(\"Infinity\");\n\treservevar(\"null\");\n\treservevar(\"this\", function (x) {\n\t\tif (state.directive[\"use strict\"] && !state.option.validthis && ((funct[\"(statement)\"] &&\n\t\t\t\tfunct[\"(name)\"].charAt(0) > \"Z\") || funct[\"(global)\"])) {\n\t\t\twarning(\"W040\", x);\n\t\t}\n\t});\n\treservevar(\"true\");\n\treservevar(\"undefined\");\n\n\tassignop(\"=\", \"assign\", 20);\n\tassignop(\"+=\", \"assignadd\", 20);\n\tassignop(\"-=\", \"assignsub\", 20);\n\tassignop(\"*=\", \"assignmult\", 20);\n\tassignop(\"/=\", \"assigndiv\", 20).nud = function () {\n\t\terror(\"E014\");\n\t};\n\tassignop(\"%=\", \"assignmod\", 20);\n\n\tbitwiseassignop(\"&=\", \"assignbitand\", 20);\n\tbitwiseassignop(\"|=\", \"assignbitor\", 20);\n\tbitwiseassignop(\"^=\", \"assignbitxor\", 20);\n\tbitwiseassignop(\"<<=\", \"assignshiftleft\", 20);\n\tbitwiseassignop(\">>=\", \"assignshiftright\", 20);\n\tbitwiseassignop(\">>>=\", \"assignshiftrightunsigned\", 20);\n\tinfix(\"?\", function (left, that) {\n\t\tthat.left = left;\n\t\tthat.right = expression(10);\n\t\tadvance(\":\");\n\t\tthat[\"else\"] = expression(10);\n\t\treturn that;\n\t}, 30);\n\n\tinfix(\"||\", \"or\", 40);\n\tinfix(\"&&\", \"and\", 50);\n\tbitwise(\"|\", \"bitor\", 70);\n\tbitwise(\"^\", \"bitxor\", 80);\n\tbitwise(\"&\", \"bitand\", 90);\n\trelation(\"==\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull && (left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq)\n\t\t\twarning(\"W116\", this, \"===\", \"==\");\n\t\telse if (isPoorRelation(left))\n\t\t\twarning(\"W041\", this, \"===\", left.value);\n\t\telse if (isPoorRelation(right))\n\t\t\twarning(\"W041\", this, \"===\", right.value);\n\n\t\treturn this;\n\t});\n\trelation(\"===\");\n\trelation(\"!=\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull &&\n\t\t\t\t(left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq) {\n\t\t\twarning(\"W116\", this, \"!==\", \"!=\");\n\t\t} else if (isPoorRelation(left)) {\n\t\t\twarning(\"W041\", this, \"!==\", left.value);\n\t\t} else if (isPoorRelation(right)) {\n\t\t\twarning(\"W041\", this, \"!==\", right.value);\n\t\t}\n\t\treturn this;\n\t});\n\trelation(\"!==\");\n\trelation(\"<\");\n\trelation(\">\");\n\trelation(\"<=\");\n\trelation(\">=\");\n\tbitwise(\"<<\", \"shiftleft\", 120);\n\tbitwise(\">>\", \"shiftright\", 120);\n\tbitwise(\">>>\", \"shiftrightunsigned\", 120);\n\tinfix(\"in\", \"in\", 120);\n\tinfix(\"instanceof\", \"instanceof\", 120);\n\tinfix(\"+\", function (left, that) {\n\t\tvar right = expression(130);\n\t\tif (left && right && left.id === \"(string)\" && right.id === \"(string)\") {\n\t\t\tleft.value += right.value;\n\t\t\tleft.character = right.character;\n\t\t\tif (!state.option.scripturl && reg.javascriptURL.test(left.value)) {\n\t\t\t\twarning(\"W050\", left);\n\t\t\t}\n\t\t\treturn left;\n\t\t}\n\t\tthat.left = left;\n\t\tthat.right = right;\n\t\treturn that;\n\t}, 130);\n\tprefix(\"+\", \"num\");\n\tprefix(\"+++\", function () {\n\t\twarning(\"W007\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"+++\", function (left) {\n\t\twarning(\"W007\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"-\", \"sub\", 130);\n\tprefix(\"-\", \"neg\");\n\tprefix(\"---\", function () {\n\t\twarning(\"W006\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"---\", function (left) {\n\t\twarning(\"W006\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"*\", \"mult\", 140);\n\tinfix(\"/\", \"div\", 140);\n\tinfix(\"%\", \"mod\", 140);\n\n\tsuffix(\"++\", \"postinc\");\n\tprefix(\"++\", \"preinc\");\n\tstate.syntax[\"++\"].exps = true;\n\n\tsuffix(\"--\", \"postdec\");\n\tprefix(\"--\", \"predec\");\n\tstate.syntax[\"--\"].exps = true;\n\tprefix(\"delete\", function () {\n\t\tvar p = expression(0);\n\t\tif (!p || (p.id !== \".\" && p.id !== \"[\")) {\n\t\t\twarning(\"W051\");\n\t\t}\n\t\tthis.first = p;\n\t\treturn this;\n\t}).exps = true;\n\n\tprefix(\"~\", function () {\n\t\tif (state.option.bitwise) {\n\t\t\twarning(\"W052\", this, \"~\");\n\t\t}\n\t\texpression(150);\n\t\treturn this;\n\t});\n\n\tprefix(\"!\", function () {\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\n\t\tif (!this.right) { // '!' followed by nothing? Give up.\n\t\t\tquit(\"E041\", this.line || 0);\n\t\t}\n\n\t\tif (bang[this.right.id] === true) {\n\t\t\twarning(\"W018\", this, \"!\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"typeof\", \"typeof\");\n\tprefix(\"new\", function () {\n\t\tvar c = expression(155), i;\n\t\tif (c && c.id !== \"function\") {\n\t\t\tif (c.identifier) {\n\t\t\t\tc[\"new\"] = true;\n\t\t\t\tswitch (c.value) {\n\t\t\t\tcase \"Number\":\n\t\t\t\tcase \"String\":\n\t\t\t\tcase \"Boolean\":\n\t\t\t\tcase \"Math\":\n\t\t\t\tcase \"JSON\":\n\t\t\t\t\twarning(\"W053\", state.tokens.prev, c.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Function\":\n\t\t\t\t\tif (!state.option.evil) {\n\t\t\t\t\t\twarning(\"W054\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Date\":\n\t\t\t\tcase \"RegExp\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (c.id !== \"function\") {\n\t\t\t\t\t\ti = c.value.substr(0, 1);\n\t\t\t\t\t\tif (state.option.newcap && (i < \"A\" || i > \"Z\") && !_.has(global, c.value)) {\n\t\t\t\t\t\t\twarning(\"W055\", state.tokens.curr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (c.id !== \".\" && c.id !== \"[\" && c.id !== \"(\") {\n\t\t\t\t\twarning(\"W056\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!state.option.supernew)\n\t\t\t\twarning(\"W057\", this);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\tif (state.tokens.next.id !== \"(\" && !state.option.supernew) {\n\t\t\twarning(\"W058\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\t\tthis.first = c;\n\t\treturn this;\n\t});\n\tstate.syntax[\"new\"].exps = true;\n\n\tprefix(\"void\").exps = true;\n\n\tinfix(\".\", function (left, that) {\n\t\tadjacent(state.tokens.prev, state.tokens.curr);\n\t\tnobreak();\n\t\tvar m = identifier(false, true);\n\n\t\tif (typeof m === \"string\") {\n\t\t\tcountMember(m);\n\t\t}\n\n\t\tthat.left = left;\n\t\tthat.right = m;\n\n\t\tif (m && m === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tif (left && left.value === \"arguments\" && (m === \"callee\" || m === \"caller\")) {\n\t\t\tif (state.option.noarg)\n\t\t\t\twarning(\"W059\", left, m);\n\t\t\telse if (state.directive[\"use strict\"])\n\t\t\t\terror(\"E008\");\n\t\t} else if (!state.option.evil && left && left.value === \"document\" &&\n\t\t\t\t(m === \"write\" || m === \"writeln\")) {\n\t\t\twarning(\"W060\", left);\n\t\t}\n\n\t\tif (!state.option.evil && (m === \"eval\" || m === \"execScript\")) {\n\t\t\twarning(\"W061\");\n\t\t}\n\n\t\treturn that;\n\t}, 160, true);\n\n\tinfix(\"(\", function (left, that) {\n\t\tif (state.tokens.prev.id !== \"}\" && state.tokens.prev.id !== \")\") {\n\t\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\t}\n\n\t\tnospace();\n\t\tif (state.option.immed && !left.immed && left.id === \"function\") {\n\t\t\twarning(\"W062\");\n\t\t}\n\n\t\tvar n = 0;\n\t\tvar p = [];\n\n\t\tif (left) {\n\t\t\tif (left.type === \"(identifier)\") {\n\t\t\t\tif (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {\n\t\t\t\t\tif (\"Number String Boolean Date Object\".indexOf(left.value) === -1) {\n\t\t\t\t\t\tif (left.value === \"Math\") {\n\t\t\t\t\t\t\twarning(\"W063\", left);\n\t\t\t\t\t\t} else if (state.option.newcap) {\n\t\t\t\t\t\t\twarning(\"W064\", left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\tp[p.length] = expression(10);\n\t\t\t\tn += 1;\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\");\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\n\t\tif (typeof left === \"object\") {\n\t\t\tif (left.value === \"parseInt\" && n === 1) {\n\t\t\t\twarning(\"W065\", state.tokens.curr);\n\t\t\t}\n\t\t\tif (!state.option.evil) {\n\t\t\t\tif (left.value === \"eval\" || left.value === \"Function\" ||\n\t\t\t\t\t\tleft.value === \"execScript\") {\n\t\t\t\t\twarning(\"W061\", left);\n\n\t\t\t\t\tif (p[0] && [0].id === \"(string)\") {\n\t\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t\t}\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t (left.value === \"setTimeout\" ||\n\t\t\t\t\t\tleft.value === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\n\t\t\t\t// window.setTimeout/setInterval\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t left.value === \".\" &&\n\t\t\t\t\t left.left.value === \"window\" &&\n\t\t\t\t\t (left.right === \"setTimeout\" ||\n\t\t\t\t\t\tleft.right === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!left.identifier && left.id !== \".\" && left.id !== \"[\" &&\n\t\t\t\t\tleft.id !== \"(\" && left.id !== \"&&\" && left.id !== \"||\" &&\n\t\t\t\t\tleft.id !== \"?\") {\n\t\t\t\twarning(\"W067\", left);\n\t\t\t}\n\t\t}\n\n\t\tthat.left = left;\n\t\treturn that;\n\t}, 155, true).exps = true;\n\n\tprefix(\"(\", function () {\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \"function\") {\n\t\t\tstate.tokens.next.immed = true;\n\t\t}\n\n\t\tvar exprs = [];\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\texprs.push(expression(0));\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\", this);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tif (state.option.immed && exprs[0].id === \"function\") {\n\t\t\tif (state.tokens.next.id !== \"(\" &&\n\t\t\t (state.tokens.next.id !== \".\" || (peek().value !== \"call\" && peek().value !== \"apply\"))) {\n\t\t\t\twarning(\"W068\", this);\n\t\t\t}\n\t\t}\n\n\t\treturn exprs[0];\n\t});\n\n\tinfix(\"[\", function (left, that) {\n\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\tnospace();\n\t\tvar e = expression(0), s;\n\t\tif (e && e.type === \"(string)\") {\n\t\t\tif (!state.option.evil && (e.value === \"eval\" || e.value === \"execScript\")) {\n\t\t\t\twarning(\"W061\", that);\n\t\t\t}\n\n\t\t\tcountMember(e.value);\n\t\t\tif (!state.option.sub && reg.identifier.test(e.value)) {\n\t\t\t\ts = state.syntax[e.value];\n\t\t\t\tif (!s || !isReserved(s)) {\n\t\t\t\t\twarning(\"W069\", state.tokens.prev, e.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tadvance(\"]\", that);\n\n\t\tif (e && e.value === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tthat.left = left;\n\t\tthat.right = e;\n\t\treturn that;\n\t}, 160, true);\n\n\tprefix(\"[\", function () {\n\t\tvar b = state.tokens.curr.line !== state.tokens.next.line;\n\t\tthis.first = [];\n\t\tif (b) {\n\t\t\tindent += state.option.indent;\n\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t}\n\t\t}\n\t\twhile (state.tokens.next.id !== \"(end)\") {\n\t\t\twhile (state.tokens.next.id === \",\") {\n\t\t\t\tif (!state.option.es5)\n\t\t\t\t\twarning(\"W070\");\n\t\t\t\tadvance(\",\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id === \"]\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (b && state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tthis.first.push(expression(10));\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\tif (state.tokens.next.id === \"]\" && !state.option.es5) {\n\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (b) {\n\t\t\tindent -= state.option.indent;\n\t\t\tindentation();\n\t\t}\n\t\tadvance(\"]\", this);\n\t\treturn this;\n\t}, 160);\n\n\n\tfunction property_name() {\n\t\tvar id = optionalidentifier(false, true);\n\n\t\tif (!id) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tid = state.tokens.next.value;\n\t\t\t\tadvance();\n\t\t\t} else if (state.tokens.next.id === \"(number)\") {\n\t\t\t\tid = state.tokens.next.value.toString();\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\n\t\tif (id === \"hasOwnProperty\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\treturn id;\n\t}\n\n\n\tfunction functionparams() {\n\t\tvar next = state.tokens.next;\n\t\tvar params = [];\n\t\tvar ident;\n\n\t\tadvance(\"(\");\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \")\") {\n\t\t\tadvance(\")\");\n\t\t\treturn;\n\t\t}\n\n\t\tfor (;;) {\n\t\t\tident = identifier(true);\n\t\t\tparams.push(ident);\n\t\t\taddlabel(ident, \"unused\", state.tokens.curr);\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma();\n\t\t\t} else {\n\t\t\t\tadvance(\")\", next);\n\t\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\t\treturn params;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfunction doFunction(name, statement) {\n\t\tvar f;\n\t\tvar oldOption = state.option;\n\t\tvar oldScope = scope;\n\n\t\tstate.option = Object.create(state.option);\n\t\tscope = Object.create(scope);\n\n\t\tfunct = {\n\t\t\t\"(name)\" : name || \"\\\"\" + anonname + \"\\\"\",\n\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\"(context)\" : funct,\n\t\t\t\"(breakage)\" : 0,\n\t\t\t\"(loopage)\" : 0,\n\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\"(scope)\" : scope,\n\t\t\t\"(statement)\": statement,\n\t\t\t\"(tokens)\" : {}\n\t\t};\n\n\t\tf = funct;\n\t\tstate.tokens.curr.funct = funct;\n\n\t\tfunctions.push(funct);\n\n\t\tif (name) {\n\t\t\taddlabel(name, \"function\");\n\t\t}\n\n\t\tfunct[\"(params)\"] = functionparams();\n\t\tfunct[\"(metrics)\"].verifyMaxParametersPerFunction(funct[\"(params)\"]);\n\n\t\tblock(false, false, true);\n\n\t\tfunct[\"(metrics)\"].verifyMaxStatementsPerFunction();\n\t\tfunct[\"(metrics)\"].verifyMaxComplexityPerFunction();\n\t\tfunct[\"(unusedOption)\"] = state.option.unused;\n\n\t\tscope = oldScope;\n\t\tstate.option = oldOption;\n\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\tfunct = funct[\"(context)\"];\n\n\t\treturn f;\n\t}\n\n\tfunction createMetrics(functionStartToken) {\n\t\treturn {\n\t\t\tstatementCount: 0,\n\t\t\tnestedBlockDepth: -1,\n\t\t\tComplexityCount: 1,\n\t\t\tverifyMaxStatementsPerFunction: function () {\n\t\t\t\tif (state.option.maxstatements &&\n\t\t\t\t\tthis.statementCount > state.option.maxstatements) {\n\t\t\t\t\twarning(\"W071\", functionStartToken, this.statementCount);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxParametersPerFunction: function (params) {\n\t\t\t\tparams = params || [];\n\n\t\t\t\tif (state.option.maxparams && params.length > state.option.maxparams) {\n\t\t\t\t\twarning(\"W072\", functionStartToken, params.length);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxNestedBlockDepthPerFunction: function () {\n\t\t\t\tif (state.option.maxdepth &&\n\t\t\t\t\tthis.nestedBlockDepth > 0 &&\n\t\t\t\t\tthis.nestedBlockDepth === state.option.maxdepth + 1) {\n\t\t\t\t\twarning(\"W073\", null, this.nestedBlockDepth);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxComplexityPerFunction: function () {\n\t\t\t\tvar max = state.option.maxcomplexity;\n\t\t\t\tvar cc = this.ComplexityCount;\n\t\t\t\tif (max && cc > max) {\n\t\t\t\t\twarning(\"W074\", functionStartToken, cc);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction increaseComplexityCount() {\n\t\tfunct[\"(metrics)\"].ComplexityCount += 1;\n\t}\n\n\t// Parse assignments that were found instead of conditionals.\n\t// For example: if (a = 1) { ... }\n\n\tfunction parseCondAssignment() {\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"=\":\n\t\tcase \"+=\":\n\t\tcase \"-=\":\n\t\tcase \"*=\":\n\t\tcase \"%=\":\n\t\tcase \"&=\":\n\t\tcase \"|=\":\n\t\tcase \"^=\":\n\t\tcase \"/=\":\n\t\t\tif (!state.option.boss) {\n\t\t\t\twarning(\"W084\");\n\t\t\t}\n\n\t\t\tadvance(state.tokens.next.id);\n\t\t\texpression(20);\n\t\t}\n\t}\n\n\n\t(function (x) {\n\t\tx.nud = function () {\n\t\t\tvar b, f, i, p, t;\n\t\t\tvar props = {}; // All properties, including accessors\n\n\t\t\tfunction saveProperty(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name))\n\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\telse\n\t\t\t\t\tprops[name] = {};\n\n\t\t\t\tprops[name].basic = true;\n\t\t\t\tprops[name].basictkn = tkn;\n\t\t\t}\n\n\t\t\tfunction saveSetter(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].setter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].setter = true;\n\t\t\t\tprops[name].setterToken = tkn;\n\t\t\t}\n\n\t\t\tfunction saveGetter(name) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].getter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].getter = true;\n\t\t\t\tprops[name].getterToken = state.tokens.curr;\n\t\t\t}\n\n\t\t\tb = state.tokens.curr.line !== state.tokens.next.line;\n\t\t\tif (b) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (;;) {\n\t\t\t\tif (state.tokens.next.id === \"}\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (b) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.value === \"get\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"get\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveGetter(i);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (p) {\n\t\t\t\t\t\twarning(\"W076\", t, p[0], i);\n\t\t\t\t\t}\n\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t} else if (state.tokens.next.value === \"set\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"set\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveSetter(i, state.tokens.next);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (!p || p.length !== 1) {\n\t\t\t\t\t\twarning(\"W077\", t, i);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tsaveProperty(i, state.tokens.next);\n\n\t\t\t\t\tif (typeof i !== \"string\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\texpression(10);\n\t\t\t\t}\n\n\t\t\t\tcountMember(i);\n\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\" && !state.option.es5) {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", this);\n\n\t\t\t// Check for lonely setters if in the ES5 mode.\n\t\t\tif (state.option.es5) {\n\t\t\t\tfor (var name in props) {\n\t\t\t\t\tif (_.has(props, name) && props[name].setter && !props[name].getter) {\n\t\t\t\t\t\twarning(\"W078\", props[name].setterToken);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\tx.fud = function () {\n\t\t\terror(\"E036\", state.tokens.curr);\n\t\t};\n\t}(delim(\"{\")));\n\n\t// This Function is called when esnext option is set to true\n\t// it adds the `const` statement to JSHINT\n\n\tuseESNextSyntax = function () {\n\t\tvar conststatement = stmt(\"const\", function (prefix) {\n\t\t\tvar id, name, value;\n\n\t\t\tthis.first = [];\n\t\t\tfor (;;) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tid = identifier();\n\t\t\t\tif (funct[id] === \"const\") {\n\t\t\t\t\twarning(\"E011\", null, id);\n\t\t\t\t}\n\t\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\taddlabel(id, \"const\");\n\t\t\t\tif (prefix) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tname = state.tokens.curr;\n\t\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\t\tif (state.tokens.next.id !== \"=\") {\n\t\t\t\t\twarning(\"E012\", state.tokens.curr, id);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tadvance(\"=\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t\t}\n\t\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\t\terror(\"E037\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue = expression(0);\n\t\t\t\t\tname.first = value;\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t\tconststatement.exps = true;\n\t};\n\n\tvar varstatement = stmt(\"var\", function (prefix) {\n\t\t// JavaScript does not have block scope. It only has function scope. So,\n\t\t// declaring a variable in a block can have unexpected consequences.\n\t\tvar id, name, value;\n\n\t\tif (funct[\"(onevar)\"] && state.option.onevar) {\n\t\t\twarning(\"W081\");\n\t\t} else if (!funct[\"(global)\"]) {\n\t\t\tfunct[\"(onevar)\"] = true;\n\t\t}\n\n\t\tthis.first = [];\n\n\t\tfor (;;) {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tid = identifier();\n\n\t\t\tif (state.option.esnext && funct[id] === \"const\") {\n\t\t\t\twarning(\"E011\", null, id);\n\t\t\t}\n\n\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t}\n\n\t\t\taddlabel(id, \"unused\", state.tokens.curr);\n\n\t\t\tif (prefix) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tname = state.tokens.curr;\n\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\"=\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\terror(\"E038\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tvalue = expression(0);\n\t\t\t\tname.first = value;\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcomma();\n\t\t}\n\t\treturn this;\n\t});\n\tvarstatement.exps = true;\n\n\tblockstmt(\"function\", function () {\n\t\tif (inblock) {\n\t\t\twarning(\"W082\", state.tokens.curr);\n\n\t\t}\n\t\tvar i = identifier();\n\t\tif (state.option.esnext && funct[i] === \"const\") {\n\t\t\twarning(\"E011\", null, i);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\taddlabel(i, \"unction\", state.tokens.curr);\n\n\t\tdoFunction(i, { statement: true });\n\t\tif (state.tokens.next.id === \"(\" && state.tokens.next.line === state.tokens.curr.line) {\n\t\t\terror(\"E039\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"function\", function () {\n\t\tvar i = optionalidentifier();\n\t\tif (i || state.option.gcl) {\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t} else {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\t\tdoFunction(i);\n\t\tif (!state.option.loopfunc && funct[\"(loopage)\"]) {\n\t\t\twarning(\"W083\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"if\", function () {\n\t\tvar t = state.tokens.next;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tif (state.tokens.next.id === \"else\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"else\");\n\t\t\tif (state.tokens.next.id === \"if\" || state.tokens.next.id === \"switch\") {\n\t\t\t\tstatement(true);\n\t\t\t} else {\n\t\t\t\tblock(true, true);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"try\", function () {\n\t\tvar b;\n\n\t\tfunction doCatch() {\n\t\t\tvar oldScope = scope;\n\t\t\tvar e;\n\n\t\t\tadvance(\"catch\");\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(\");\n\n\t\t\tscope = Object.create(oldScope);\n\n\t\t\te = state.tokens.next.value;\n\t\t\tif (state.tokens.next.type !== \"(identifier)\") {\n\t\t\t\te = null;\n\t\t\t\twarning(\"E030\", state.tokens.next, e);\n\t\t\t}\n\n\t\t\tadvance();\n\t\t\tadvance(\")\");\n\n\t\t\tfunct = {\n\t\t\t\t\"(name)\" : \"(catch)\",\n\t\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\t\"(context)\" : funct,\n\t\t\t\t\"(breakage)\" : funct[\"(breakage)\"],\n\t\t\t\t\"(loopage)\" : funct[\"(loopage)\"],\n\t\t\t\t\"(scope)\" : scope,\n\t\t\t\t\"(statement)\": false,\n\t\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\t\"(catch)\" : true,\n\t\t\t\t\"(tokens)\" : {}\n\t\t\t};\n\n\t\t\tif (e) {\n\t\t\t\taddlabel(e, \"exception\");\n\t\t\t}\n\n\t\t\tstate.tokens.curr.funct = funct;\n\t\t\tfunctions.push(funct);\n\n\t\t\tblock(false);\n\n\t\t\tscope = oldScope;\n\n\t\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\t\tfunct = funct[\"(context)\"];\n\t\t}\n\n\t\tblock(false);\n\n\t\tif (state.tokens.next.id === \"catch\") {\n\t\t\tincreaseComplexityCount();\n\t\t\tdoCatch();\n\t\t\tb = true;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"finally\") {\n\t\t\tadvance(\"finally\");\n\t\t\tblock(false);\n\t\t\treturn;\n\t\t} else if (!b) {\n\t\t\terror(\"E021\", state.tokens.next, \"catch\", state.tokens.next.value);\n\t\t}\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"while\", function () {\n\t\tvar t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tfunct[\"(breakage)\"] -= 1;\n\t\tfunct[\"(loopage)\"] -= 1;\n\t\treturn this;\n\t}).labelled = true;\n\n\tblockstmt(\"with\", function () {\n\t\tvar t = state.tokens.next;\n\t\tif (state.directive[\"use strict\"]) {\n\t\t\terror(\"E010\", state.tokens.curr);\n\t\t} else if (!state.option.withstmt) {\n\t\t\twarning(\"W085\", state.tokens.curr);\n\t\t}\n\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(0);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"switch\", function () {\n\t\tvar t = state.tokens.next,\n\t\t\tg = false;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tthis.condition = expression(20);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\t\tadvance(\"{\");\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tindent += state.option.indent;\n\t\tthis.cases = [];\n\n\t\tfor (;;) {\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"case\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"case\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"switch\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// You can tell JSHint that you don't use break intentionally by\n\t\t\t\t\t// adding a comment /* falls through */ on a line just before\n\t\t\t\t\t// the next `case`.\n\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"case\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"case\");\n\t\t\t\tthis.cases.push(expression(20));\n\t\t\t\tincreaseComplexityCount();\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tfunct[\"(verb)\"] = \"case\";\n\t\t\t\tbreak;\n\t\t\tcase \"default\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Do not display a warning if 'default' is the first statement or if\n\t\t\t\t\t// there is a special /* falls through */ comment.\n\t\t\t\t\tif (this.cases.length) {\n\t\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"default\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"default\");\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tbreak;\n\t\t\tcase \"}\":\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t\tadvance(\"}\", t);\n\t\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\t\tfunct[\"(verb)\"] = undefined;\n\t\t\t\treturn;\n\t\t\tcase \"(end)\":\n\t\t\t\terror(\"E023\", state.tokens.next, \"}\");\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\tif (g) {\n\t\t\t\t\tswitch (state.tokens.curr.id) {\n\t\t\t\t\tcase \",\":\n\t\t\t\t\t\terror(\"E040\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \":\":\n\t\t\t\t\t\tg = false;\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E025\", state.tokens.curr);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (state.tokens.curr.id === \":\") {\n\t\t\t\t\t\tadvance(\":\");\n\t\t\t\t\t\terror(\"E024\", state.tokens.curr, \":\");\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(\"E021\", state.tokens.next, \"case\", state.tokens.next.value);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).labelled = true;\n\n\tstmt(\"debugger\", function () {\n\t\tif (!state.option.debug) {\n\t\t\twarning(\"W087\");\n\t\t}\n\t\treturn this;\n\t}).exps = true;\n\n\t(function () {\n\t\tvar x = stmt(\"do\", function () {\n\t\t\tfunct[\"(breakage)\"] += 1;\n\t\t\tfunct[\"(loopage)\"] += 1;\n\t\t\tincreaseComplexityCount();\n\n\t\t\tthis.first = block(true);\n\t\t\tadvance(\"while\");\n\t\t\tvar t = state.tokens.next;\n\t\t\tnonadjacent(state.tokens.curr, t);\n\t\t\tadvance(\"(\");\n\t\t\tnospace();\n\t\t\texpression(20);\n\t\t\tparseCondAssignment();\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t});\n\t\tx.labelled = true;\n\t\tx.exps = true;\n\t}());\n\n\tblockstmt(\"for\", function () {\n\t\tvar s, t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tif (peek(state.tokens.next.id === \"var\" ? 1 : 0).id === \"in\") {\n\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\tadvance(\"var\");\n\t\t\t\tvarstatement.fud.call(varstatement, true);\n\t\t\t} else {\n\t\t\t\tswitch (funct[state.tokens.next.value]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[state.tokens.next.value] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"var\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twarning(\"W088\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tadvance();\n\t\t\t}\n\t\t\tadvance(\"in\");\n\t\t\texpression(20);\n\t\t\tadvance(\")\", t);\n\t\t\ts = block(true, true);\n\t\t\tif (state.option.forin && s && (s.length > 1 || typeof s[0] !== \"object\" ||\n\t\t\t\t\ts[0].value !== \"if\")) {\n\t\t\t\twarning(\"W089\", this);\n\t\t\t}\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t} else {\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\t\tadvance(\"var\");\n\t\t\t\t\tvarstatement.fud.call(varstatement);\n\t\t\t\t} else {\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomma();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\texpression(20);\n\t\t\t\tparseCondAssignment();\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\terror(\"E021\", state.tokens.next, \")\", \";\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \")\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcomma();\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tblock(true, true);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t}\n\t}).labelled = true;\n\n\n\tstmt(\"break\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\t\treachable(\"break\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"continue\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t} else if (!funct[\"(loopage)\"]) {\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\t\t}\n\t\treachable(\"continue\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"return\", function () {\n\t\tif (this.line === state.tokens.next.line) {\n\t\t\tif (state.tokens.next.id === \"(regexp)\")\n\t\t\t\twarning(\"W092\");\n\n\t\t\tif (state.tokens.next.id !== \";\" && !state.tokens.next.reach) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tthis.first = expression(0);\n\n\t\t\t\tif (this.first.type === \"(punctuator)\" && this.first.value === \"=\" && !state.option.boss) {\n\t\t\t\t\twarningAt(\"W093\", this.first.line, this.first.character);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!state.option.asi) {\n\t\t\tnolinebreak(this); // always warn (Line breaking error)\n\t\t}\n\t\treachable(\"return\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"throw\", function () {\n\t\tnolinebreak(this);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tthis.first = expression(20);\n\t\treachable(\"throw\");\n\t\treturn this;\n\t}).exps = true;\n\n\t// Future Reserved Words\n\n\tFutureReservedWord(\"abstract\");\n\tFutureReservedWord(\"boolean\");\n\tFutureReservedWord(\"byte\");\n\tFutureReservedWord(\"char\");\n\tFutureReservedWord(\"class\", { es5: true });\n\tFutureReservedWord(\"double\");\n\tFutureReservedWord(\"enum\", { es5: true });\n\tFutureReservedWord(\"export\", { es5: true });\n\tFutureReservedWord(\"extends\", { es5: true });\n\tFutureReservedWord(\"final\");\n\tFutureReservedWord(\"float\");\n\tFutureReservedWord(\"goto\");\n\tFutureReservedWord(\"implements\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"import\", { es5: true });\n\tFutureReservedWord(\"int\");\n\tFutureReservedWord(\"interface\");\n\tFutureReservedWord(\"let\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"long\");\n\tFutureReservedWord(\"native\");\n\tFutureReservedWord(\"package\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"private\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"protected\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"public\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"short\");\n\tFutureReservedWord(\"static\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"super\", { es5: true });\n\tFutureReservedWord(\"synchronized\");\n\tFutureReservedWord(\"throws\");\n\tFutureReservedWord(\"transient\");\n\tFutureReservedWord(\"volatile\");\n\tFutureReservedWord(\"yield\", { es5: true, strictOnly: true });\n\n\t// Parse JSON\n\n\tfunction jsonValue() {\n\n\t\tfunction jsonObject() {\n\t\t\tvar o = {}, t = state.tokens.next;\n\t\t\tadvance(\"{\");\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E026\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t} else if (state.tokens.next.id !== \"(string)\") {\n\t\t\t\t\t\twarning(\"W095\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tif (o[state.tokens.next.value] === true) {\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else if ((state.tokens.next.value === \"__proto__\" &&\n\t\t\t\t\t\t!state.option.proto) || (state.tokens.next.value === \"__iterator__\" &&\n\t\t\t\t\t\t!state.option.iterator)) {\n\t\t\t\t\t\twarning(\"W096\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\to[state.tokens.next.value] = true;\n\t\t\t\t\t}\n\t\t\t\t\tadvance();\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"}\");\n\t\t}\n\n\t\tfunction jsonArray() {\n\t\t\tvar t = state.tokens.next;\n\t\t\tadvance(\"[\");\n\t\t\tif (state.tokens.next.id !== \"]\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E027\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"]\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t}\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"]\");\n\t\t}\n\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"{\":\n\t\t\tjsonObject();\n\t\t\tbreak;\n\t\tcase \"[\":\n\t\t\tjsonArray();\n\t\t\tbreak;\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\tcase \"null\":\n\t\tcase \"(number)\":\n\t\tcase \"(string)\":\n\t\t\tadvance();\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tadvance(\"-\");\n\t\t\tif (state.tokens.curr.character !== state.tokens.next.from) {\n\t\t\t\twarning(\"W011\", state.tokens.curr);\n\t\t\t}\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(number)\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\terror(\"E003\", state.tokens.next);\n\t\t}\n\t}\n\n\n\t// The actual JSHINT function itself.\n\tvar itself = function (s, o, g) {\n\t\tvar a, i, k, x;\n\t\tvar optionKeys;\n\t\tvar newOptionObj = {};\n\n\t\tstate.reset();\n\n\t\tif (o && o.scope) {\n\t\t\tJSHINT.scope = o.scope;\n\t\t} else {\n\t\t\tJSHINT.errors = [];\n\t\t\tJSHINT.undefs = [];\n\t\t\tJSHINT.internals = [];\n\t\t\tJSHINT.blacklist = {};\n\t\t\tJSHINT.scope = \"(main)\";\n\t\t}\n\n\t\tpredefined = Object.create(null);\n\t\tcombine(predefined, vars.ecmaIdentifiers);\n\t\tcombine(predefined, vars.reservedVars);\n\n\t\tcombine(predefined, g || {});\n\n\t\tdeclared = Object.create(null);\n\t\texported = Object.create(null);\n\t\tignored = Object.create(null);\n\n\t\tif (o) {\n\t\t\ta = o.predef;\n\t\t\tif (a) {\n\t\t\t\tif (!Array.isArray(a) && typeof a === \"object\") {\n\t\t\t\t\ta = Object.keys(a);\n\t\t\t\t}\n\n\t\t\t\ta.forEach(function (item) {\n\t\t\t\t\tvar slice, prop;\n\n\t\t\t\t\tif (item[0] === \"-\") {\n\t\t\t\t\t\tslice = item.slice(1);\n\t\t\t\t\t\tJSHINT.blacklist[slice] = slice;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprop = Object.getOwnPropertyDescriptor(o.predef, item);\n\t\t\t\t\t\tpredefined[item] = prop ? prop.value : false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\toptionKeys = Object.keys(o);\n\t\t\tfor (x = 0; x < optionKeys.length; x++) {\n\t\t\t\tif (/^-W\\d{3}$/g.test(optionKeys[x])) {\n\t\t\t\t\tignored[optionKeys[x].slice(1)] = true;\n\t\t\t\t} else {\n\t\t\t\t\tnewOptionObj[optionKeys[x]] = o[optionKeys[x]];\n\n\t\t\t\t\tif (optionKeys[x] === \"newcap\" && o[optionKeys[x]] === false)\n\t\t\t\t\t\tnewOptionObj[\"(explicitNewcap)\"] = true;\n\n\t\t\t\t\tif (optionKeys[x] === \"indent\")\n\t\t\t\t\t\tnewOptionObj[\"(explicitIndent)\"] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstate.option = newOptionObj;\n\n\t\tstate.option.indent = state.option.indent || 4;\n\t\tstate.option.maxerr = state.option.maxerr || 50;\n\n\t\tindent = 1;\n\t\tglobal = Object.create(predefined);\n\t\tscope = global;\n\t\tfunct = {\n\t\t\t\"(global)\": true,\n\t\t\t\"(name)\":\t \"(global)\",\n\t\t\t\"(scope)\":\t scope,\n\t\t\t\"(breakage)\": 0,\n\t\t\t\"(loopage)\": 0,\n\t\t\t\"(tokens)\": {},\n\t\t\t\"(metrics)\": createMetrics(state.tokens.next)\n\t\t};\n\t\tfunctions = [funct];\n\t\turls = [];\n\t\tstack = null;\n\t\tmember = {};\n\t\tmembersOnly = null;\n\t\timplied = {};\n\t\tinblock = false;\n\t\tlookahead = [];\n\t\twarnings = 0;\n\t\tunuseds = [];\n\n\t\tif (!isString(s) && !Array.isArray(s)) {\n\t\t\terrorAt(\"E004\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tvar api = {\n\t\t\tget isJSON() {\n\t\t\t\treturn state.jsonMode;\n\t\t\t},\n\n\t\t\tgetOption: function (name) {\n\t\t\t\treturn state.option[name] || null;\n\t\t\t},\n\n\t\t\tgetCache: function (name) {\n\t\t\t\treturn state.cache[name];\n\t\t\t},\n\n\t\t\tsetCache: function (name, value) {\n\t\t\t\tstate.cache[name] = value;\n\t\t\t},\n\n\t\t\twarn: function (code, data) {\n\t\t\t\twarningAt.apply(null, [ code, data.line, data.char ].concat(data.data));\n\t\t\t},\n\n\t\t\ton: function (names, listener) {\n\t\t\t\tnames.split(\" \").forEach(function (name) {\n\t\t\t\t\temitter.on(name, listener);\n\t\t\t\t}.bind(this));\n\t\t\t}\n\t\t};\n\n\t\temitter.removeAllListeners();\n\t\t(extraModules || []).forEach(function (func) {\n\t\t\tfunc(api);\n\t\t});\n\n\t\tstate.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax[\"(begin)\"];\n\n\t\tlex = new Lexer(s);\n\n\t\tlex.on(\"warning\", function (ev) {\n\t\t\twarningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"error\", function (ev) {\n\t\t\terrorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"fatal\", function (ev) {\n\t\t\tquit(\"E041\", ev.line, ev.from);\n\t\t});\n\n\t\tlex.on(\"Identifier\", function (ev) {\n\t\t\temitter.emit(\"Identifier\", ev);\n\t\t});\n\n\t\tlex.on(\"String\", function (ev) {\n\t\t\temitter.emit(\"String\", ev);\n\t\t});\n\n\t\tlex.on(\"Number\", function (ev) {\n\t\t\temitter.emit(\"Number\", ev);\n\t\t});\n\n\t\tlex.start();\n\n\t\t// Check options\n\t\tfor (var name in o) {\n\t\t\tif (_.has(o, name)) {\n\t\t\t\tcheckOption(name, state.tokens.curr);\n\t\t\t}\n\t\t}\n\n\t\tassume();\n\n\t\t// combine the passed globals after we've assumed all our options\n\t\tcombine(predefined, g || {});\n\n\t\t//reset values\n\t\tcomma.first = true;\n\n\t\ttry {\n\t\t\tadvance();\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"{\":\n\t\t\tcase \"[\":\n\t\t\t\tstate.option.laxbreak = true;\n\t\t\t\tstate.jsonMode = true;\n\t\t\t\tjsonValue();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdirectives();\n\n\t\t\t\tif (state.directive[\"use strict\"]) {\n\t\t\t\t\tif (!state.option.globalstrict && !state.option.node) {\n\t\t\t\t\t\twarning(\"W097\", state.tokens.prev);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstatements();\n\t\t\t}\n\t\t\tadvance((state.tokens.next && state.tokens.next.value !== \".\")\t? \"(end)\" : undefined);\n\n\t\t\tvar markDefined = function (name, context) {\n\t\t\t\tdo {\n\t\t\t\t\tif (typeof context[name] === \"string\") {\n\t\t\t\t\t\t// JSHINT marks unused variables as 'unused' and\n\t\t\t\t\t\t// unused function declaration as 'unction'. This\n\t\t\t\t\t\t// code changes such instances back 'var' and\n\t\t\t\t\t\t// 'closure' so that the code in JSHINT.data()\n\t\t\t\t\t\t// doesn't think they're unused.\n\n\t\t\t\t\t\tif (context[name] === \"unused\")\n\t\t\t\t\t\t\tcontext[name] = \"var\";\n\t\t\t\t\t\telse if (context[name] === \"unction\")\n\t\t\t\t\t\t\tcontext[name] = \"closure\";\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext = context[\"(context)\"];\n\t\t\t\t} while (context);\n\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tvar clearImplied = function (name, line) {\n\t\t\t\tif (!implied[name])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar newImplied = [];\n\t\t\t\tfor (var i = 0; i < implied[name].length; i += 1) {\n\t\t\t\t\tif (implied[name][i] !== line)\n\t\t\t\t\t\tnewImplied.push(implied[name][i]);\n\t\t\t\t}\n\n\t\t\t\tif (newImplied.length === 0)\n\t\t\t\t\tdelete implied[name];\n\t\t\t\telse\n\t\t\t\t\timplied[name] = newImplied;\n\t\t\t};\n\n\t\t\tvar warnUnused = function (name, tkn, type, unused_opt) {\n\t\t\t\tvar line = tkn.line;\n\t\t\t\tvar chr = tkn.character;\n\n\t\t\t\tif (unused_opt === undefined) {\n\t\t\t\t\tunused_opt = state.option.unused;\n\t\t\t\t}\n\n\t\t\t\tif (unused_opt === true) {\n\t\t\t\t\tunused_opt = \"last-param\";\n\t\t\t\t}\n\n\t\t\t\tvar warnable_types = {\n\t\t\t\t\t\"vars\": [\"var\"],\n\t\t\t\t\t\"last-param\": [\"var\", \"last-param\"],\n\t\t\t\t\t\"strict\": [\"var\", \"param\", \"last-param\"]\n\t\t\t\t};\n\n\t\t\t\tif (unused_opt) {\n\t\t\t\t\tif (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) {\n\t\t\t\t\t\twarningAt(\"W098\", line, chr, name);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunuseds.push({\n\t\t\t\t\tname: name,\n\t\t\t\t\tline: line,\n\t\t\t\t\tcharacter: chr\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tvar checkUnused = function (func, key) {\n\t\t\t\tvar type = func[key];\n\t\t\t\tvar tkn = func[\"(tokens)\"][key];\n\n\t\t\t\tif (key.charAt(0) === \"(\")\n\t\t\t\t\treturn;\n\n\t\t\t\tif (type !== \"unused\" && type !== \"unction\")\n\t\t\t\t\treturn;\n\n\t\t\t\t// Params are checked separately from other variables.\n\t\t\t\tif (func[\"(params)\"] && func[\"(params)\"].indexOf(key) !== -1)\n\t\t\t\t\treturn;\n\n\t\t\t\t// Variable is in global scope and defined as exported.\n\t\t\t\tif (func[\"(global)\"] && _.has(exported, key)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twarnUnused(key, tkn, \"var\");\n\t\t\t};\n\n\t\t\t// Check queued 'x is not defined' instances to see if they're still undefined.\n\t\t\tfor (i = 0; i < JSHINT.undefs.length; i += 1) {\n\t\t\t\tk = JSHINT.undefs[i].slice(0);\n\n\t\t\t\tif (markDefined(k[2].value, k[0])) {\n\t\t\t\t\tclearImplied(k[2].value, k[2].line);\n\t\t\t\t} else if (state.option.undef) {\n\t\t\t\t\twarning.apply(warning, k.slice(1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunctions.forEach(function (func) {\n\t\t\t\tif (func[\"(unusedOption)\"] === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in func) {\n\t\t\t\t\tif (_.has(func, key)) {\n\t\t\t\t\t\tcheckUnused(func, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!func[\"(params)\"])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar params = func[\"(params)\"].slice();\n\t\t\t\tvar param = params.pop();\n\t\t\t\tvar type, unused_type;\n\n\t\t\t\twhile (param) {\n\t\t\t\t\ttype = func[param];\n\t\t\t\t\tunused_type = (params.length === func[\"(params)\"].length - 1 ? \"last-param\" : \"param\");\n\n\t\t\t\t\t// 'undefined' is a special case for (function (window, undefined) { ... })();\n\t\t\t\t\t// patterns.\n\n\t\t\t\t\tif (param === \"undefined\")\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (type === \"unused\" || type === \"unction\") {\n\t\t\t\t\t\twarnUnused(param, func[\"(tokens)\"][param], unused_type, func[\"(unusedOption)\"]);\n\t\t\t\t\t}\n\n\t\t\t\t\tparam = params.pop();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfor (var key in declared) {\n\t\t\t\tif (_.has(declared, key) && !_.has(global, key)) {\n\t\t\t\t\twarnUnused(key, declared[key], \"var\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (err) {\n\t\t\tif (err && err.name === \"JSHintError\") {\n\t\t\t\tvar nt = state.tokens.next || {};\n\t\t\t\tJSHINT.errors.push({\n\t\t\t\t\tscope : \"(main)\",\n\t\t\t\t\traw : err.raw,\n\t\t\t\t\treason : err.message,\n\t\t\t\t\tline : err.line || nt.line,\n\t\t\t\t\tcharacter : err.character || nt.from\n\t\t\t\t}, null);\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\n\t\t// Loop over the listed \"internals\", and check them as well.\n\n\t\tif (JSHINT.scope === \"(main)\") {\n\t\t\to = o || {};\n\n\t\t\tfor (i = 0; i < JSHINT.internals.length; i += 1) {\n\t\t\t\tk = JSHINT.internals[i];\n\t\t\t\to.scope = k.elem;\n\t\t\t\titself(k.value, o, g);\n\t\t\t}\n\t\t}\n\n\t\treturn JSHINT.errors.length === 0;\n\t};\n\n\t// Modules.\n\titself.addModule = function (func) {\n\t\textraModules.push(func);\n\t};\n\n\titself.addModule(style.register);\n\n\t// Data summary.\n\titself.data = function () {\n\t\tvar data = {\n\t\t\tfunctions: [],\n\t\t\toptions: state.option\n\t\t};\n\t\tvar implieds = [];\n\t\tvar members = [];\n\t\tvar fu, f, i, j, n, globals;\n\n\t\tif (itself.errors.length) {\n\t\t\tdata.errors = itself.errors;\n\t\t}\n\n\t\tif (state.jsonMode) {\n\t\t\tdata.json = true;\n\t\t}\n\n\t\tfor (n in implied) {\n\t\t\tif (_.has(implied, n)) {\n\t\t\t\timplieds.push({\n\t\t\t\t\tname: n,\n\t\t\t\t\tline: implied[n]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (implieds.length > 0) {\n\t\t\tdata.implieds = implieds;\n\t\t}\n\n\t\tif (urls.length > 0) {\n\t\t\tdata.urls = urls;\n\t\t}\n\n\t\tglobals = Object.keys(scope);\n\t\tif (globals.length > 0) {\n\t\t\tdata.globals = globals;\n\t\t}\n\n\t\tfor (i = 1; i < functions.length; i += 1) {\n\t\t\tf = functions[i];\n\t\t\tfu = {};\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tfu[functionicity[j]] = [];\n\t\t\t}\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tif (fu[functionicity[j]].length === 0) {\n\t\t\t\t\tdelete fu[functionicity[j]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfu.name = f[\"(name)\"];\n\t\t\tfu.param = f[\"(params)\"];\n\t\t\tfu.line = f[\"(line)\"];\n\t\t\tfu.character = f[\"(character)\"];\n\t\t\tfu.last = f[\"(last)\"];\n\t\t\tfu.lastcharacter = f[\"(lastcharacter)\"];\n\t\t\tdata.functions.push(fu);\n\t\t}\n\n\t\tif (unuseds.length > 0) {\n\t\t\tdata.unused = unuseds;\n\t\t}\n\n\t\tmembers = [];\n\t\tfor (n in member) {\n\t\t\tif (typeof member[n] === \"number\") {\n\t\t\t\tdata.member = member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t};\n\n\titself.jshint = itself;\n\n\treturn itself;\n}());\n\n// Make JSHINT a Node module, if possible.\nif (typeof exports === \"object\" && exports) {\n\texports.JSHINT = JSHINT;\n}\n\n//@ sourceURL=/src/stable/jshint.js" -)); -require("/src/stable/jshint.js"); - -JSHINT = require('/src/stable/jshint.js').JSHINT;})(); diff --git a/deploy/core/node_modules/jshint/dist/jshint-1.1.0.js b/deploy/core/node_modules/jshint/dist/jshint-1.1.0.js deleted file mode 100644 index a62b2b126..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-1.1.0.js +++ /dev/null @@ -1,10685 +0,0 @@ -//1.1.0 -var JSHINT; -(function () { -var require; -require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -} - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],2:[function(require,module,exports){ -(function(process){if (!process.EventEmitter) process.EventEmitter = function () {}; - -var EventEmitter = exports.EventEmitter = process.EventEmitter; -var isArray = typeof Array.isArray === 'function' - ? Array.isArray - : function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]' - } -; -function indexOf (xs, x) { - if (xs.indexOf) return xs.indexOf(x); - for (var i = 0; i < xs.length; i++) { - if (x === xs[i]) return i; - } - return -1; -} - -// By default EventEmitters will print a warning if more than -// 10 listeners are added to it. This is a useful default which -// helps finding memory leaks. -// -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -var defaultMaxListeners = 10; -EventEmitter.prototype.setMaxListeners = function(n) { - if (!this._events) this._events = {}; - this._events.maxListeners = n; -}; - - -EventEmitter.prototype.emit = function(type) { - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events || !this._events.error || - (isArray(this._events.error) && !this._events.error.length)) - { - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - if (!this._events) return false; - var handler = this._events[type]; - if (!handler) return false; - - if (typeof handler == 'function') { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - return true; - - } else if (isArray(handler)) { - var args = Array.prototype.slice.call(arguments, 1); - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - return true; - - } else { - return false; - } -}; - -// EventEmitter is defined in src/node_events.cc -// EventEmitter.prototype.emit() is also defined there. -EventEmitter.prototype.addListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('addListener only takes instances of Function'); - } - - if (!this._events) this._events = {}; - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } else if (isArray(this._events[type])) { - - // Check for listener leak - if (!this._events[type].warned) { - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - - // If we've already got an array, just append. - this._events[type].push(listener); - } else { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - var self = this; - self.on(type, function g() { - self.removeListener(type, g); - listener.apply(this, arguments); - }); - - return this; -}; - -EventEmitter.prototype.removeListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('removeListener only takes instances of Function'); - } - - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events || !this._events[type]) return this; - - var list = this._events[type]; - - if (isArray(list)) { - var i = indexOf(list, listener); - if (i < 0) return this; - list.splice(i, 1); - if (list.length == 0) - delete this._events[type]; - } else if (this._events[type] === listener) { - delete this._events[type]; - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - this._events = {}; - return this; - } - - // does not use listeners(), so no side effect of creating _events[type] - if (type && this._events && this._events[type]) this._events[type] = null; - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - if (!this._events) this._events = {}; - if (!this._events[type]) this._events[type] = []; - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; -}; - -})(require("__browserify_process")) -},{"__browserify_process":1}],3:[function(require,module,exports){ -(function(){// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - DataView : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval: false -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - - -})() -},{}],4:[function(require,module,exports){ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use string"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; - -},{}],5:[function(require,module,exports){ -"use strict"; - -var state = { - syntax: {}, - - reset: function () { - this.tokens = { - prev: null, - next: null, - curr: null - }, - - this.option = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - } -}; - -exports.state = state; - -},{}],6:[function(require,module,exports){ -(function(){"use strict"; - -exports.register = function (linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for dangling underscores. - - linter.on("Identifier", function style_scanDangling(data) { - if (!linter.getOption("nomen")) { - return; - } - - // Underscore.js - if (data.name === "_") { - return; - } - - // In Node, __dirname and __filename should be ignored. - if (linter.getOption("node")) { - if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { - return; - } - } - - if (/^(_+.*|.*_+)$/.test(data.name)) { - linter.warn("W105", { - line: data.line, - char: data.from, - data: [ "dangling '_'", data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+/, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; -})() -},{}],"jshint":[function(require,module,exports){ -module.exports=require('B01lSJ'); -},{}],"B01lSJ":[function(require,module,exports){ -(function(){/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * 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. - * - */ - -/*jshint quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = require("underscore"); -var events = require("events"); -var vars = require("../shared/vars.js"); -var messages = require("../shared/messages.js"); -var Lexer = require("./lex.js").Lexer; -var reg = require("./reg.js"); -var state = require("./state.js").state; -var style = require("./style.js"); - -// We need this module here because environments such as IE and Rhino -// don't necessarilly expose the 'console' API and browserify uses -// it to log things. It's a sad state of affair, really. -var console = require("console-browserify"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - api, // Extension API - - // These are operators that should not be used with the ! operator. - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es5 : true, // if ES5 syntax should be allowed - esnext : true, // if es.next specific syntax should be allowed - moz : true, // if mozilla specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - gcl : true, // if JSHint should be compatible with Google Closure Linter - globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - passfail : true, // if the scan should stop on first error - phantom : true, // if PhantomJS symbols should be allowed - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true, // YUI variables should be predefined - - // Obsolete options - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false, // {int} max cyclomatic complexity per function - unused : true, // warn if variables are unused. Available options: - // false - don't check for unused variables - // true - "vars" + check last function param - // "vars" - skip checking unused function params - // "strict" - "vars" + check all function params - latedef : false // warn if the variable is used before its definition - // false - don't emit any warnings - // true - warn if any variable is used before its definition - // "nofunc" - warn for any variable but function declarations - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus: true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true, - strict : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows: "wsh", - sloppy : "strict" - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - ignored, // Ignored warnings - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - noreach, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - warnings, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^-W\d{3}$/g.test(name)) { - return true; - } - - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - if (t.type !== "jslint" || renamedOptions[name] === undefined) { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.es5 && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (_.has(o, n) && !_.has(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - } - - // let's assume that chronologically ES5 < ES6/ESNext < Moz - function isAfterESNext() { - return state.option.moz || state.option.esnext; - } - function isAfterES5() { - return state.option.moz || state.option.esnext || state.option.es5; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, code, token, a) { - return JSHINT.undefs.push([scope, code, token, a]); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (ignored[code]) { - return; - } - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - if (state.option.passfail) { - quit("E042", l, ch); - } - - warnings += 1; - if (warnings >= state.option.maxerr) { - quit("E043", l, ch); - } - - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - function addlabel(t, type, tkn, islet) { - // Define t in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], t)) { - if (funct[t] !== true && !state.option.node) { - warning("W002", state.tokens.next, t); - } - } - } - - if (_.has(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - } else { - if (!state.option.shadow && type !== "exception" || - (funct["(blockscope)"].getlabel(t))) { - warning("W004", state.tokens.next, t); - } - } - } - - // a double definition of a let variable in same block throws a TypeError - if (funct["(blockscope)"] && funct["(blockscope)"].current.has(t)) { - error("E044", state.tokens.next, t); - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(t, type, state.tokens.curr); - } else { - - funct[t] = type; - - if (tkn) { - funct["(tokens)"][t] = tkn; - } - - if (funct["(global)"]) { - global[t] = funct; - if (_.has(implied, t)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function (g) { - g = g.split(":"); - var key = g[0]; - var val = g[1]; - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - updatePredefined(); - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function (e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function (m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\b", "\b") - .replace("\\t", "\t") - .replace("\\n", "\n") - .replace("\\v", "\v") - .replace("\\f", "\f") - .replace("\\r", "\r") - .replace("\\\\", "\\") - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - if (key === "indent") { - state.option["(explicitIndent)"] = true; - } - - state.option[key] = val; - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - if (funct["(global)"]) { - error("E009"); - } else { - if (val === "true" || val === "false") { - state.option.validthis = (val === "true"); - } else { - error("E002", nt); - } - } - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - if (/^-W\d{3}$/g.test(key)) { - ignored[key.slice(1)] = true; - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = renamedOptions[key] || key; - state.option[tn] = (val === "true"); - - if (invertedOptions[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - assume(); - } - } - - // We need a peek function. If it has an argument, it peeks that much farther - // ahead. It is used to distinguish - // for ( var i in ... - // from - // for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (state.tokens.curr.type === "(string)" || state.tokens.curr.identifier) { - anonname = state.tokens.curr.value; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - // This is the heart of JSHINT, the Pratt parser. In addition to parsing, it - // is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is - // like .nud except that it is only used on the first token of a statement. - // Having .fud makes it much easier to define statement-oriented languages like - // JavaScript. I retained Pratt's nomenclature. - - // .nud Null denotation - // .fud First null denotation - // .led Left denotation - // lbp Left binding power - // rbp Right binding power - - // They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false, isLetExpr = false; - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.moz) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.syntax["let"].fud.call(state.syntax["let"].fud, false); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - advance(); - - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = state.tokens.curr.value; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - var end_of_expr = state.tokens.next.identifier && - !state.tokens.curr.led && - state.tokens.curr.line !== state.tokens.next.line; - while (rbp < state.tokens.next.lbp && !end_of_expr) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && (left.character !== right.from || left.line !== right.line)) { - warning("W012", right, right.value); - } - } - - function nospace(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - - if (left.value === ";" && right.value === ";") { - return; - } - - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== right.line) { - warning("W014", right, right.id); - } else if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function indentation(bias) { - if (!state.option.white && !state.option["(explicitIndent)"]) { - return; - } - - if (state.tokens.next.id === "(end)") { - return; - } - - var i = indent + (bias || 0); - if (state.tokens.next.from !== i) { - warning("W015", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== state.tokens.next.line) { - warning("E022", t, t.value); - } - } - - - function comma(opts) { - opts = opts || {}; - - if (state.tokens.curr.line !== state.tokens.next.line) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", state.tokens.curr, state.tokens.next.id); - } - } else if (!state.tokens.curr.comment && - state.tokens.curr.character !== state.tokens.next.from && state.option.white) { - state.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from); - warning("W011", state.tokens.curr, state.tokens.curr.value); - } - - advance(","); - - // TODO: This is a temporary solution to fight against false-positives in - // arrays and objects with trailing commas (see GH-363). The best solution - // would be to extract all whitespace rules out of parser. - - if (state.tokens.next.value !== "]" && state.tokens.next.value !== "}") { - nonadjacent(state.tokens.curr, state.tokens.next); - } - - if (state.tokens.next.identifier && !state.option.es5) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "yield": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - } - } - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - return symbol(s, 0); - } - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - return this; - }; - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, function () { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - return x; - } - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function (left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", right, "!"); - } - - this.left = left; - this.right = right; - return this; - }; - return x; - } - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (left) { - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left || left.left.value === "arguments") { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function (t) { - if (funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left || left.left.value === "arguments") { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - that.right = expression(19); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - nonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(19); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function (left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop) { - if (!state.tokens.next.identifier) { - return; - } - - advance(); - - var curr = state.tokens.curr; - var meta = curr.meta || {}; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.es5 || meta.isFutureReservedWord) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - // Display an info message about reserved words as properties - // and ES5 but do it only once. - if (prop && !api.getCache("displayed:I002")) { - api.setCache("displayed:I002", true); - warning("I002"); - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop); - if (i) { - return i; - } - if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { - warning("W025"); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (state.tokens.next.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!state.option.latedef) { - break; - } - - warning("W026", t); - break; - } - - warning("W027", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var values; - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord) { - warning("W024", t, t.id); - res = false; - } - - // detect a destructuring assignment - if (_.has(["[", "{"], t.value)) { - if (lookupBlockType().isDestAssign) { - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - values = destructuringExpression(); - values.forEach(function (tok) { - isundef(funct, "W117", tok.token, tok.id); - }); - advance("="); - destructuringExpressionMatch(values, expression(0, true)); - advance(";"); - return; - } - } - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - if (reg.javascriptURL.test(t.value + ":")) { - warning("W029", t, t.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - - if (state.tokens.next.id === ",") { - return comma(); - } - - if (state.tokens.next.id !== ";") { - if (!state.option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!state.option.lastsemic || state.tokens.next.id !== "}" || - state.tokens.next.line !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - adjacent(state.tokens.curr, state.tokens.next); - advance(";"); - nonadjacent(state.tokens.curr, state.tokens.next); - } - } - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement(startLine === state.tokens.next.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("W033", state.tokens.next); - } else { - p = pn; - } - } else if (p.id === "}") { - // Directive with no other statements, warn about missing semicolon - warning("W033", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) - state.option.newcap = true; - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - if (line !== state.tokens.next.line) { - indentation(); - } - } else if (line !== state.tokens.next.line) { - indentation(); - } - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - if (stmt && !state.option.moz) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - expression(0); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - noreach = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement(state.tokens.next.line === state.tokens.curr.line)]; - indent -= state.option.indent; - noreach = false; - - delete funct["(nolet)"]; - } - funct["(verb)"] = null; - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035"); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value, line = tkn.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - var block; - if (_.has(funct, "(blockscope)")) { - block = funct["(blockscope)"].getlabel(v); - } - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && (state.tokens.next.value === "." || - state.tokens.next.value === "["))) { - - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - } - } - - note_implied(state.tokens.curr); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // - // display warning if we're inside of typeof or delete. - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && - (state.tokens.next.value === "." || state.tokens.next.value === "["))) { - - isundef(funct, "W117", state.tokens.curr, v); - } - funct[v] = true; - note_implied(state.tokens.curr); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - led: function () { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (state.directive["use strict"] && !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) - warning("W116", this, "===", "=="); - else if (isPoorRelation(left)) - warning("W041", this, "===", left.value); - else if (isPoorRelation(right)) - warning("W041", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("W007"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("W006"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("W051"); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (state.option.bitwise) { - warning("W052", this, "~"); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("W053", state.tokens.prev, c.value); - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - adjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(state.tokens.prev, state.tokens.curr); - nobreak(); - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - warning("W061"); - } - - return that; - }, 160, true); - - infix("(", function (left, that) { - if (state.tokens.prev.id !== "}" && state.tokens.prev.id !== ")") { - nobreak(state.tokens.prev, state.tokens.curr); - } - - nospace(); - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - nospace(state.tokens.prev, state.tokens.curr); - - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("W067", left); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - nospace(); - - if (state.tokens.next.id === "function") { - state.tokens.next.immed = true; - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - exprs.push(expression(0)); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")", this); - nospace(state.tokens.prev, state.tokens.curr); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - (state.tokens.next.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning("W068", this); - } - } - - return exprs[0]; - }); - - infix("[", function (left, that) { - nobreak(state.tokens.prev, state.tokens.curr); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("W061", that); - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - nospace(state.tokens.prev, state.tokens.curr); - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - res.right = expression(0); - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.moz) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(0); - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(0); - advance(")"); - } - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function () { - var blocktype = lookupBlockType(true); - if (blocktype.isCompArray) { - if (!state.option.moz) { - warning("W118", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !isAfterESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== state.tokens.next.line; - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!isAfterES5()) - warning("W070"); - advance(","); - } - if (state.tokens.next.id === "]") { - break; - } - if (b && state.tokens.curr.line !== state.tokens.next.line) { - indentation(); - } - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.es5) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(false, true); - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - advance(); - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - advance(); - } - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - - function functionparams() { - var next = state.tokens.next; - var params = []; - var ident; - var tokens = []; - - advance("("); - nospace(); - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (var t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } - if (state.tokens.next.id === ",") { - comma(); - } else { - advance(")", next); - nospace(state.tokens.prev, state.tokens.curr); - return params; - } - } - } - - - function doFunction(name, statement, generator) { - var f; - var oldOption = state.option; - var oldScope = scope; - - state.option = Object.create(state.option); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : state.tokens.next.line, - "(character)" : state.tokens.next.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(state.tokens.next), - "(scope)" : scope, - "(statement)" : statement, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)" : funct["(comparray)"] - }; - - if (generator) { - funct["(generator)"] = true; - } - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(); - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, true, true); - - if (generator && funct["(generator)"] !== "yielded") { - error("E047", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function parseCondAssignment() { - switch (state.tokens.next.id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!state.option.boss) { - warning("W084"); - } - - advance(state.tokens.next.id); - expression(20); - } - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t; - var props = {}; // All properties, including accessors - - function saveProperty(name, tkn) { - if (props[name] && _.has(props, name)) - warning("W075", state.tokens.next, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basictkn = tkn; - } - - function saveSetter(name, tkn) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].setter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = tkn; - } - - function saveGetter(name) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].getter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = state.tokens.curr; - } - - b = state.tokens.curr.line !== state.tokens.next.line; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - if (b) { - indentation(); - } - - if (state.tokens.next.value === "get" && peek().id !== ":") { - advance("get"); - - if (!state.option.es5) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveGetter(i); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (p) { - warning("W076", t, p[0], i); - } - - adjacent(state.tokens.curr, state.tokens.next); - } else if (state.tokens.next.value === "set" && peek().id !== ":") { - advance("set"); - - if (!state.option.es5) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveSetter(i, state.tokens.next); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (!p || p.length !== 1) { - warning("W077", t, i); - } - } else { - i = property_name(); - saveProperty(i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - - advance(":"); - nonadjacent(state.tokens.curr, state.tokens.next); - expression(10); - } - - countMember(i); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.es5) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (state.option.es5) { - for (var name in props) { - if (_.has(props, name) && props[name].setter && !props[name].getter) { - warning("W078", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function () { - var ident; - if (_.contains(["[", "{"], state.tokens.next.value)) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (state.tokens.next.value === ",") { - identifiers.push({ id: null, token: state.tokens.curr }); - } else { - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - } - }; - if (state.tokens.next.value === "[") { - advance("["); - nextInnerDE(); - while (state.tokens.next.value !== "]") { - advance(","); - nextInnerDE(); - } - advance("]"); - } else if (state.tokens.next.value === "{") { - advance("{"); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (state.tokens.next.value !== "}") { - advance(","); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - function destructuringExpressionMatch(tokens, value) { - if (value.first) { - _.zip(tokens, value.first).forEach(function (val) { - var token = val[0]; - var value = val[1]; - if (token && value) { - token.first = value; - } else if (token && token.first && !value) { - warning("W080", token.first, token.first.value); - } /* else { - XXX value is discarded: wouldn't it need a warning ? - } */ - }); - } - } - - var conststatement = stmt("const", function (prefix) { - var tokens, value; - // state variable to know if it is a lone identifier, or a destructuring statement. - var lone; - - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "const"); - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "const"); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var tokens, lone, value; - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (isAfterESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "unused", t.token); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E038", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - var letstatement = stmt("let", function (prefix) { - var tokens, lone, value, letblock; - - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.moz) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (isAfterESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, "unused", t.token, true); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.esnext && !state.option.moz) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = identifier(); - if (funct[i] === "const") { - warning("E011", null, i); - } - adjacent(state.tokens.curr, state.tokens.next); - addlabel(i, "unction", state.tokens.curr); - - doFunction(i, { statement: true }, generator); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - if (!state.option.esnext) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - var i = optionalidentifier(); - if (i || state.option.gcl) { - adjacent(state.tokens.curr, state.tokens.next); - } else { - nonadjacent(state.tokens.curr, state.tokens.next); - } - doFunction(i, undefined, generator); - if (!state.option.loopfunc && funct["(loopage)"]) { - warning("W083"); - } - return this; - }); - - blockstmt("if", function () { - var t = state.tokens.next; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - if (state.tokens.next.id === "else") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(state.tokens.curr, state.tokens.next); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = { - "(name)" : "(catch)", - "(line)" : state.tokens.next.line, - "(character)": state.tokens.next.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(state.tokens.next), - "(catch)" : true, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)": funct["(comparray)"] - }; - - if (e) { - addlabel(e, "exception"); - } - - if (state.tokens.next.value === "if") { - if (!state.option.moz) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(false); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.moz)) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(false); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = state.tokens.next, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - advance("{"); - nonadjacent(state.tokens.curr, state.tokens.next); - indent += state.option.indent; - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - indentation(-state.option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - indentation(-state.option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= state.option.indent; - indentation(); - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!state.option.debug) { - warning("W087"); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = state.tokens.next; - nonadjacent(state.tokens.curr, t); - advance("("); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.moz) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && - nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!isAfterESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud, true); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud, true); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - if (!funct["(blockscope)"].getlabel(state.tokens.next.value)) - warning("W088", state.tokens.next, state.tokens.next.value); - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - s = block(true, true); - if (state.option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("W089", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - expression(20); - parseCondAssignment(); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - stmt("yield", function () { - if (state.option.esnext && funct["(generator)"] !== true) { - error("E046", state.tokens.curr, "yield"); - } else if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface"); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("throws"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine wether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function (notjson) { - var pn, pn1; - var i = 0; - var bracketStack = 0; - var ret = {}; - state.jsonMode = "probing"; - state.jsonWarnings = []; - if (_.contains(["[", "{"], state.tokens.curr.value)) - bracketStack += 1; - if (_.contains(["[", "{"], state.tokens.next.value)) - bracketStack += 1; - if (_.contains(["]", "}"], state.tokens.next.value)) - bracketStack -= 1; - do { - pn = peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (_.contains(["[", "{"], pn.value)) { - bracketStack += 1; - } else if (_.contains(["]", "}"], pn.value)) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (_.contains(["}", "]"], pn.value) && pn1.value === "=") { - ret.isDestAssign = true; - ret.notJson = true; - break; - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)" && i < 15); - if (!ret.notJson && !notjson) { - for (var w in state.jsonWarnings) { - w = state.jsonWarnings[w]; - warningAt(w.code, w.line, w.character, w.data && w.data[0]); - } - } - state.jsonMode = false; - delete state.jsonWarnings; - return ret; - }; - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!isAfterESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function () { - var CompArray = function () { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function (elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function (elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return {stack: function () { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function () { - _current.variables.filter(function (v) { - if (v.unused) - warning("W098", v.token, v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(_carrays[_carrays.length - 1], 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function (s) { - if (_.contains(["use", "define", "filter"], s)) - _current.mode = s; - }, - check: function (v) { - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false}); - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true}); - } - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (state.tokens.curr.character !== state.tokens.next.from) { - warning("W011", state.tokens.curr); - } - adjacent(state.tokens.curr, state.tokens.next); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function () { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function () { - _current = {}; - _variables.push(_current); - }, - - unstack: function () { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function (l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l)) { - return _variables[i]; - } - } - }, - - current: { - has: function (t) { - return _.has(_current, t); - }, - add: function (t, type, tok) { - _current[t] = { "(type)" : type, - "(token)": tok }; - } - } - }; - }; - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - ignored = Object.create(null); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - - a.forEach(function (item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - ignored[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj["(explicitIndent)"] = true; - } - } - } - - state.option = newOptionObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(state.tokens.next), - "(blockscope)": blockScope(), - "(comparray)": arrayComprehension() - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - warnings = 0; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function (name) { - return state.option[name] || null; - }, - - getCache: function (name) { - return state.cache[name]; - }, - - setCache: function (name, value) { - state.cache[name] = value; - }, - - warn: function (code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function (names, listener) { - names.split(" ").forEach(function (name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function (func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - lex = new Lexer(s); - - lex.on("warning", function (ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function (ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function (ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function (ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function (ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function (ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict && !state.option.node) { - warning("W097", state.tokens.prev); - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.character; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "last-param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - warningAt("W098", line, chr, name); - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) { - return; - } - - warnUnused(key, tkn, "var"); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_type; - - while (param) { - type = func[param]; - unused_type = (params.length === func["(params)"].length - 1 ? "last-param" : "param"); - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], unused_type, func["(unusedOption)"]); - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function (func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: state.option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} - -})() -},{"events":2,"../shared/vars.js":3,"../shared/messages.js":7,"./lex.js":8,"./reg.js":4,"./state.js":5,"./style.js":6,"underscore":9,"console-browserify":10}],9:[function(require,module,exports){ -(function(){// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); - -})() -},{}],10:[function(require,module,exports){ -(function(global){/*global window, global*/ -var util = require("util") -var assert = require("assert") - -var slice = Array.prototype.slice -var console -var times = {} - -if (typeof global !== "undefined" && global.console) { - console = global.console -} else if (typeof window !== "undefined" && window.console) { - console = window.console -} else { - console = window.console = {} -} - -var functions = [ - [log, "log"] - , [info, "info"] - , [warn, "warn"] - , [error, "error"] - , [time, "time"] - , [timeEnd, "timeEnd"] - , [trace, "trace"] - , [dir, "dir"] - , [assert, "assert"] -] - -for (var i = 0; i < functions.length; i++) { - var tuple = functions[i] - var f = tuple[0] - var name = tuple[1] - - if (!console[name]) { - console[name] = f - } -} - -module.exports = console - -function log() {} - -function info() { - console.log.apply(console, arguments) -} - -function warn() { - console.log.apply(console, arguments) -} - -function error() { - console.warn.apply(console, arguments) -} - -function time(label) { - times[label] = Date.now() -} - -function timeEnd(label) { - var time = times[label] - if (!time) { - throw new Error("No such label: " + label) - } - - var duration = Date.now() - time - console.log(label + ": " + duration + "ms") -} - -function trace() { - var err = new Error() - err.name = "Trace" - err.message = util.format.apply(null, arguments) - console.error(err.stack) -} - -function dir(object) { - console.log(util.inspect(object) + "\n") -} - -function assert(expression) { - if (!expression) { - var arr = slice.call(arguments, 1) - assert.ok(false, util.format.apply(null, arr)) - } -} - -})(window) -},{"util":11,"assert":12}],11:[function(require,module,exports){ -var events = require('events'); - -exports.isArray = isArray; -exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'}; -exports.isRegExp = function(obj){return Object.prototype.toString.call(obj) === '[object RegExp]'}; - - -exports.print = function () {}; -exports.puts = function () {}; -exports.debug = function() {}; - -exports.inspect = function(obj, showHidden, depth, colors) { - var seen = []; - - var stylize = function(str, styleType) { - // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - var styles = - { 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] }; - - var style = - { 'special': 'cyan', - 'number': 'blue', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' }[styleType]; - - if (style) { - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; - } else { - return str; - } - }; - if (! colors) { - stylize = function(str, styleType) { return str; }; - } - - function format(value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value !== exports && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return value.inspect(recurseTimes); - } - - // Primitive types cannot have properties - switch (typeof value) { - case 'undefined': - return stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return stylize(simple, 'string'); - - case 'number': - return stylize('' + value, 'number'); - - case 'boolean': - return stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return stylize('null', 'null'); - } - - // Look up the keys of the object. - var visible_keys = Object_keys(value); - var keys = showHidden ? Object_getOwnPropertyNames(value) : visible_keys; - - // Functions without properties can be shortcutted. - if (typeof value === 'function' && keys.length === 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - var name = value.name ? ': ' + value.name : ''; - return stylize('[Function' + name + ']', 'special'); - } - } - - // Dates without properties can be shortcutted - if (isDate(value) && keys.length === 0) { - return stylize(value.toUTCString(), 'date'); - } - - var base, type, braces; - // Determine the object type - if (isArray(value)) { - type = 'Array'; - braces = ['[', ']']; - } else { - type = 'Object'; - braces = ['{', '}']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; - } else { - base = ''; - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + value.toUTCString(); - } - - if (keys.length === 0) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - return stylize('[Object]', 'special'); - } - } - - seen.push(value); - - var output = keys.map(function(key) { - var name, str; - if (value.__lookupGetter__) { - if (value.__lookupGetter__(key)) { - if (value.__lookupSetter__(key)) { - str = stylize('[Getter/Setter]', 'special'); - } else { - str = stylize('[Getter]', 'special'); - } - } else { - if (value.__lookupSetter__(key)) { - str = stylize('[Setter]', 'special'); - } - } - } - if (visible_keys.indexOf(key) < 0) { - name = '[' + key + ']'; - } - if (!str) { - if (seen.indexOf(value[key]) < 0) { - if (recurseTimes === null) { - str = format(value[key]); - } else { - str = format(value[key], recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (isArray(value)) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (type === 'Array' && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = stylize(name, 'string'); - } - } - - return name + ': ' + str; - }); - - seen.pop(); - - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.length + 1; - }, 0); - - if (length > 50) { - output = braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - - } else { - output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - return output; - } - return format(obj, (typeof depth === 'undefined' ? 2 : depth)); -}; - - -function isArray(ar) { - return ar instanceof Array || - Array.isArray(ar) || - (ar && ar !== Object.prototype && isArray(ar.__proto__)); -} - - -function isRegExp(re) { - return re instanceof RegExp || - (typeof re === 'object' && Object.prototype.toString.call(re) === '[object RegExp]'); -} - - -function isDate(d) { - if (d instanceof Date) return true; - if (typeof d !== 'object') return false; - var properties = Date.prototype && Object_getOwnPropertyNames(Date.prototype); - var proto = d.__proto__ && Object_getOwnPropertyNames(d.__proto__); - return JSON.stringify(proto) === JSON.stringify(properties); -} - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - -exports.log = function (msg) {}; - -exports.pump = null; - -var Object_keys = Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; -}; - -var Object_getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) { - var res = []; - for (var key in obj) { - if (Object.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; - -var Object_create = Object.create || function (prototype, properties) { - // from es5-shim - var object; - if (prototype === null) { - object = { '__proto__' : null }; - } - else { - if (typeof prototype !== 'object') { - throw new TypeError( - 'typeof prototype[' + (typeof prototype) + '] != \'object\'' - ); - } - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (typeof properties !== 'undefined' && Object.defineProperties) { - Object.defineProperties(object, properties); - } - return object; -}; - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object_create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (typeof f !== 'string') { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(exports.inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': return JSON.stringify(args[i++]); - default: - return x; - } - }); - for(var x = args[i]; i < len; x = args[++i]){ - if (x === null || typeof x !== 'object') { - str += ' ' + x; - } else { - str += ' ' + exports.inspect(x); - } - } - return str; -}; - -},{"events":2}],12:[function(require,module,exports){ -(function(){// UTILITY -var util = require('util'); -var Buffer = require("buffer").Buffer; -var pSlice = Array.prototype.slice; - -function objectKeys(object) { - if (Object.keys) return Object.keys(object); - var result = []; - for (var name in object) { - if (Object.prototype.hasOwnProperty.call(object, name)) { - result.push(name); - } - } - return result; -} - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -util.inherits(assert.AssertionError, Error); - -function replacer(key, value) { - if (value === undefined) { - return '' + value; - } - if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) { - return value.toString(); - } - if (typeof value === 'function' || value instanceof RegExp) { - return value.toString(); - } - return value; -} - -function truncate(s, n) { - if (typeof s == 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } -} - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name + ':', this.message].join(' '); - } else { - return [ - this.name + ':', - truncate(JSON.stringify(this.actual, replacer), 128), - this.operator, - truncate(JSON.stringify(this.expected, replacer), 128) - ].join(' '); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -function ok(value, message) { - if (!!!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = objectKeys(a), - kb = objectKeys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (expected instanceof RegExp) { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail('Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail('Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -})() -},{"util":11,"buffer":13}],7:[function(require,module,exports){ -(function(){"use strict"; - -var _ = require("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' form line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: "Constant {a} was not declared correctly.", - E038: "Variable {a} was not declared correctly.", - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: "'{a}' is already defined and can't be redefined.", - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: "A generator function shall contain a yield statement.", - E048: "Let declaration not directly within block." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing pluses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", - W011: "Unexpected space after '{a}'.", - W012: "Unexpected space before '{a}'.", - W013: "Missing space after '{a}'.", - W014: "Bad line breaking before '{a}'.", - W015: "Expected '{a}' to have an indentation at {b} instead at {c}.", - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W029: "Label '{a}' looks like a javascript url.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' unnecessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate key '{a}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: "Too many var statements.", - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Expected a conditional expression and instead saw an assignment.", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: "Mixed spaces and tabs.", - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: "Trailing whitespace.", - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is only available in JavaScript 1.7.", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option)." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: "Reserved words as properties can be used under the 'es5' option." -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function (desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function (desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function (desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); - -})() -},{"underscore":9}],8:[function(require,module,exports){ -(function(){/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = require("underscore"); -var events = require("events"); -var reg = require("./reg.js"); -var state = require("./state.js").state; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9 -}; - -// This is auto generated from the unicode tables. -// The tables are at: -// http://www.fileformat.info/info/unicode/category/Lu/list.htm -// http://www.fileformat.info/info/unicode/category/Ll/list.htm -// http://www.fileformat.info/info/unicode/category/Lt/list.htm -// http://www.fileformat.info/info/unicode/category/Lm/list.htm -// http://www.fileformat.info/info/unicode/category/Lo/list.htm -// http://www.fileformat.info/info/unicode/category/Nl/list.htm - -var unicodeLetterTable = [ - 170, 170, 181, 181, 186, 186, 192, 214, - 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, - 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, - 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, - 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, - 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, - 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, - 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, - 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361, - 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, - 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, - 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, - 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, - 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, - 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, - 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, - 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, - 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, - 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, - 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, - 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, - 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, - 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, - 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, - 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, - 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, - 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, - 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, - 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, - 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, - 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, - 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, - 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346, - 4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696, - 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, - 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, - 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, - 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, - 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, - 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, - 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, - 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, - 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141, - 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, - 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, - 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, - 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, - 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, - 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, - 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, - 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, - 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, - 11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621, - 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, - 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, - 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, - 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, - 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, - 12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312, - 19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124, - 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, - 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, - 42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921, - 43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042, - 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, - 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, - 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, - 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, - 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, - 43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798, - 43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032, - 55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045, - 64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279, - 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, - 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, - 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, - 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, - 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, - 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, - 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, - 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, - 66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511, - 66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592, - 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, - 67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115, - 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, - 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, - 69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894, - 92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964, - 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, - 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, - 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, - 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, - 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, - 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, - 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, - 131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972, - 177984, 177984, 178205, 178205, 194560, 195101 -]; - -var identifierStartTable = []; - -for (var i = 0; i < 128; i++) { - identifierStartTable[i] = - i === 36 || // $ - i >= 65 && i <= 90 || // A-Z - i === 95 || // _ - i >= 97 && i <= 122; // a-z -} - -var identifierPartTable = []; - -for (var i = 0; i < 128; i++) { - identifierPartTable[i] = - identifierStartTable[i] || // $, _, A-Z, a-z - i >= 48 && i <= 57; // 0-9 -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function (data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - - if (lines[0] && lines[0].substr(0, 2) === "#!") { - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.lines = lines; - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - get lines() { - this._lines = state.lines; - return this._lines; - }, - - set lines(val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function (i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function (i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function (data) { - * // ... - * }); - */ - on: function (names, listener) { - names.split(" ").forEach(function (name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function () { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function () { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "{": - case "}": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. We need to make sure that this is an - // operator and not a regular expression. - - if (ch1 === "/") { - if (ch2 === "=" && /\/=(?!(\S*\/[gim]?))/.test(this.input)) { - // /= is not a part of a regular expression, return it as a - // punctuator. - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function () { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - special.forEach(function (str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function () { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function () { - var id = ""; - var index = 0; - var type, char; - - // Detects any character in the Unicode categories "Uppercase - // letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter - // (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or - // "Letter number (Nl)". - // - // Both approach and unicodeLetterTable were borrowed from - // Google's Traceur. - - function isUnicodeLetter(code) { - for (var i = 0; i < unicodeLetterTable.length;) { - if (code < unicodeLetterTable[i++]) { - return false; - } - - if (code <= unicodeLetterTable[i++]) { - return true; - } - } - - return false; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function () { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (isUnicodeLetter(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: id - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function () { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - index += 1; - value += char; - - while (index < length) { - char = this.peek(index); - if (!isHexDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 16, - isMalformed: false - }; - } - - // Base-8 numbers. - if (isOctalDigit(char)) { - index += 1; - value += char; - bad = false; - - while (index < length) { - char = this.peek(index); - - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - - if (isDecimalDigit(char)) { - bad = true; - } else if (!isOctalDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 8, - isMalformed: false - }; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 10, - isMalformed: !isFinite(value) - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function () { - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - if (quote !== "\"") { - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W108", - line: this.line, - character: this.char // +1? - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }); - } - } - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - if (!state.option.multistr) { - this.trigger("warning", { - code: "W043", - line: this.line, - character: this.char - }); - } else if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W042", - line: this.line, - character: this.char - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W042", - line: this.line, - character: this.char - }); - } - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - isUnclosed: true, - quote: quote - }; - } - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - - if (char === "\\") { - this.skip(); - char = this.peek(); - - switch (char) { - case "'": - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }); - } - break; - case "b": - char = "\b"; - break; - case "f": - char = "\f"; - break; - case "n": - char = "\n"; - break; - case "r": - char = "\r"; - break; - case "t": - char = "\t"; - break; - case "0": - char = "\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - if (n >= 0 && n <= 7 && state.directive["use strict"]) { - this.trigger("warning", { - code: "W115", - line: this.line, - character: this.char - }); - } - break; - case "u": - char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16)); - jump = 5; - break; - case "v": - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }); - } - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }); - } - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - case "\"": - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - case "!": - if (value.slice(value.length - 2) === "<") { - break; - } - - /*falls through */ - default: - // Weird escaping. - this.trigger("warning", { - code: "W044", - line: this.line, - character: this.char - }); - } - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function () { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function () { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurence of mixed tabs and spaces. If smarttabs option - * is on, ignore tabs followed by spaces. - * - * Tabs followed by one space followed by a block comment are allowed. - */ - scanMixedSpacesAndTabs: function () { - var at, match; - - if (state.option.smarttabs) { - // Negative look-behind for "//" - match = this.input.match(/(\/\/|^\s?\*)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = this.input.search(/ \t|\t [^\*]/); - } - - return at; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function () { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function () { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - - if (this.peek() === "") { // EOL - if (!/^\s*$/.test(this.lines[this.line - 1]) && state.option.trailing) { - this.trigger("warning", { code: "W102", line: this.line, character: start }); - } - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for mixed spaces and tabs - * and other minor warnings. - */ - nextLine: function () { - var char; - - if (this.line >= this.lines.length) { - return false; - } - - this.input = this.lines[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - char = this.scanMixedSpacesAndTabs(); - if (char >= 0) { - this.trigger("warning", { code: "W099", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function () { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It retuns a token in a JSLint-compatible format. - */ - token: function () { - var token; - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.es5 && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function (type, value, isProperty) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.trigger("String", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - quote: token.quote - }); - - return create("(string)", token.value); - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === "."); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - if (token.base === 16) { - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }); - } - } - - if (state.directive["use strict"] && token.base === 8) { - this.trigger("warning", { - code: "W115", - line: this.line, - character: this.char - }); - } - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; - -})() -},{"events":2,"./state.js":5,"./reg.js":4,"underscore":9}],14:[function(require,module,exports){ -exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) { - var e, m, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - nBits = -7, - i = isBE ? 0 : (nBytes - 1), - d = isBE ? 1 : -1, - s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity); - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); -}; - -exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) { - var e, m, c, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), - i = isBE ? (nBytes - 1) : 0, - d = isBE ? -1 : 1, - s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); - - buffer[offset + i - d] |= s * 128; -}; - -},{}],13:[function(require,module,exports){ -(function(){function SlowBuffer (size) { - this.length = size; -}; - -var assert = require('assert'); - -exports.INSPECT_MAX_BYTES = 50; - - -function toHex(n) { - if (n < 16) return '0' + n.toString(16); - return n.toString(16); -} - -function utf8ToBytes(str) { - var byteArray = []; - for (var i = 0; i < str.length; i++) - if (str.charCodeAt(i) <= 0x7F) - byteArray.push(str.charCodeAt(i)); - else { - var h = encodeURIComponent(str.charAt(i)).substr(1).split('%'); - for (var j = 0; j < h.length; j++) - byteArray.push(parseInt(h[j], 16)); - } - - return byteArray; -} - -function asciiToBytes(str) { - var byteArray = [] - for (var i = 0; i < str.length; i++ ) - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push( str.charCodeAt(i) & 0xFF ); - - return byteArray; -} - -function base64ToBytes(str) { - return require("base64-js").toByteArray(str); -} - -SlowBuffer.byteLength = function (str, encoding) { - switch (encoding || "utf8") { - case 'hex': - return str.length / 2; - - case 'utf8': - case 'utf-8': - return utf8ToBytes(str).length; - - case 'ascii': - case 'binary': - return str.length; - - case 'base64': - return base64ToBytes(str).length; - - default: - throw new Error('Unknown encoding'); - } -}; - -function blitBuffer(src, dst, offset, length) { - var pos, i = 0; - while (i < length) { - if ((i+offset >= dst.length) || (i >= src.length)) - break; - - dst[i + offset] = src[i]; - i++; - } - return i; -} - -SlowBuffer.prototype.utf8Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(utf8ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.asciiWrite = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(asciiToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.binaryWrite = SlowBuffer.prototype.asciiWrite; - -SlowBuffer.prototype.base64Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.base64Slice = function (start, end) { - var bytes = Array.prototype.slice.apply(this, arguments) - return require("base64-js").fromByteArray(bytes); -} - -function decodeUtf8Char(str) { - try { - return decodeURIComponent(str); - } catch (err) { - return String.fromCharCode(0xFFFD); // UTF 8 invalid char - } -} - -SlowBuffer.prototype.utf8Slice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var res = ""; - var tmp = ""; - var i = 0; - while (i < bytes.length) { - if (bytes[i] <= 0x7F) { - res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]); - tmp = ""; - } else - tmp += "%" + bytes[i].toString(16); - - i++; - } - - return res + decodeUtf8Char(tmp); -} - -SlowBuffer.prototype.asciiSlice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var ret = ""; - for (var i = 0; i < bytes.length; i++) - ret += String.fromCharCode(bytes[i]); - return ret; -} - -SlowBuffer.prototype.binarySlice = SlowBuffer.prototype.asciiSlice; - -SlowBuffer.prototype.inspect = function() { - var out = [], - len = this.length; - for (var i = 0; i < len; i++) { - out[i] = toHex(this[i]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - return ''; -}; - - -SlowBuffer.prototype.hexSlice = function(start, end) { - var len = this.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; i++) { - out += toHex(this[i]); - } - return out; -}; - - -SlowBuffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - start = +start || 0; - if (typeof end == 'undefined') end = this.length; - - // Fastpath empty strings - if (+end == start) { - return ''; - } - - switch (encoding) { - case 'hex': - return this.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.utf8Slice(start, end); - - case 'ascii': - return this.asciiSlice(start, end); - - case 'binary': - return this.binarySlice(start, end); - - case 'base64': - return this.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -SlowBuffer.prototype.hexWrite = function(string, offset, length) { - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2) { - throw new Error('Invalid hex string'); - } - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; i++) { - var byte = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(byte)) throw new Error('Invalid hex string'); - this[offset + i] = byte; - } - SlowBuffer._charsWritten = i * 2; - return i; -}; - - -SlowBuffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - switch (encoding) { - case 'hex': - return this.hexWrite(string, offset, length); - - case 'utf8': - case 'utf-8': - return this.utf8Write(string, offset, length); - - case 'ascii': - return this.asciiWrite(string, offset, length); - - case 'binary': - return this.binaryWrite(string, offset, length); - - case 'base64': - return this.base64Write(string, offset, length); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Write(string, offset, length); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// slice(start, end) -SlowBuffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - - if (end > this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - return new Buffer(this, end - start, +start); -}; - -SlowBuffer.prototype.copy = function(target, targetstart, sourcestart, sourceend) { - var temp = []; - for (var i=sourcestart; i this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - for (var i = start; i < end; i++) { - this[i] = value; - } -} - -function coerce(length) { - // Coerce length to a number (possibly NaN), round up - // in case it's fractional (e.g. 123.456) then do a - // double negate to coerce a NaN to 0. Easy, right? - length = ~~Math.ceil(+length); - return length < 0 ? 0 : length; -} - - -// Buffer - -function Buffer(subject, encoding, offset) { - if (!(this instanceof Buffer)) { - return new Buffer(subject, encoding, offset); - } - - var type; - - // Are we slicing? - if (typeof offset === 'number') { - this.length = coerce(encoding); - this.parent = subject; - this.offset = offset; - } else { - // Find the length - switch (type = typeof subject) { - case 'number': - this.length = coerce(subject); - break; - - case 'string': - this.length = Buffer.byteLength(subject, encoding); - break; - - case 'object': // Assume object is an array - this.length = coerce(subject.length); - break; - - default: - throw new Error('First argument needs to be a number, ' + - 'array or string.'); - } - - if (this.length > Buffer.poolSize) { - // Big buffer, just alloc one. - this.parent = new SlowBuffer(this.length); - this.offset = 0; - - } else { - // Small buffer. - if (!pool || pool.length - pool.used < this.length) allocPool(); - this.parent = pool; - this.offset = pool.used; - pool.used += this.length; - } - - // Treat array-ish objects as a byte array. - if (isArrayIsh(subject)) { - for (var i = 0; i < this.length; i++) { - if (subject instanceof Buffer) { - this.parent[i + this.offset] = subject.readUInt8(i); - } - else { - this.parent[i + this.offset] = subject[i]; - } - } - } else if (type == 'string') { - // We are a string - this.length = this.write(subject, 0, encoding); - } - } - -} - -function isArrayIsh(subject) { - return Array.isArray(subject) || Buffer.isBuffer(subject) || - subject && typeof subject === 'object' && - typeof subject.length === 'number'; -} - -exports.SlowBuffer = SlowBuffer; -exports.Buffer = Buffer; - -Buffer.poolSize = 8 * 1024; -var pool; - -function allocPool() { - pool = new SlowBuffer(Buffer.poolSize); - pool.used = 0; -} - - -// Static methods -Buffer.isBuffer = function isBuffer(b) { - return b instanceof Buffer || b instanceof SlowBuffer; -}; - -Buffer.concat = function (list, totalLength) { - if (!Array.isArray(list)) { - throw new Error("Usage: Buffer.concat(list, [totalLength])\n \ - list should be an Array."); - } - - if (list.length === 0) { - return new Buffer(0); - } else if (list.length === 1) { - return list[0]; - } - - if (typeof totalLength !== 'number') { - totalLength = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - totalLength += buf.length; - } - } - - var buffer = new Buffer(totalLength); - var pos = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer; -}; - -// Inspect -Buffer.prototype.inspect = function inspect() { - var out = [], - len = this.length; - - for (var i = 0; i < len; i++) { - out[i] = toHex(this.parent[i + this.offset]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - - return ''; -}; - - -Buffer.prototype.get = function get(i) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i]; -}; - - -Buffer.prototype.set = function set(i, v) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i] = v; -}; - - -// write(string, offset = 0, length = buffer.length-offset, encoding = 'utf8') -Buffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - var ret; - switch (encoding) { - case 'hex': - ret = this.parent.hexWrite(string, this.offset + offset, length); - break; - - case 'utf8': - case 'utf-8': - ret = this.parent.utf8Write(string, this.offset + offset, length); - break; - - case 'ascii': - ret = this.parent.asciiWrite(string, this.offset + offset, length); - break; - - case 'binary': - ret = this.parent.binaryWrite(string, this.offset + offset, length); - break; - - case 'base64': - // Warning: maxLength not taken into account in base64Write - ret = this.parent.base64Write(string, this.offset + offset, length); - break; - - case 'ucs2': - case 'ucs-2': - ret = this.parent.ucs2Write(string, this.offset + offset, length); - break; - - default: - throw new Error('Unknown encoding'); - } - - Buffer._charsWritten = SlowBuffer._charsWritten; - - return ret; -}; - - -// toString(encoding, start=0, end=buffer.length) -Buffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - - if (typeof start == 'undefined' || start < 0) { - start = 0; - } else if (start > this.length) { - start = this.length; - } - - if (typeof end == 'undefined' || end > this.length) { - end = this.length; - } else if (end < 0) { - end = 0; - } - - start = start + this.offset; - end = end + this.offset; - - switch (encoding) { - case 'hex': - return this.parent.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.parent.utf8Slice(start, end); - - case 'ascii': - return this.parent.asciiSlice(start, end); - - case 'binary': - return this.parent.binarySlice(start, end); - - case 'base64': - return this.parent.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.parent.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// byteLength -Buffer.byteLength = SlowBuffer.byteLength; - - -// fill(value, start=0, end=buffer.length) -Buffer.prototype.fill = function fill(value, start, end) { - value || (value = 0); - start || (start = 0); - end || (end = this.length); - - if (typeof value === 'string') { - value = value.charCodeAt(0); - } - if (!(typeof value === 'number') || isNaN(value)) { - throw new Error('value is not a number'); - } - - if (end < start) throw new Error('end < start'); - - // Fill 0 bytes; we're done - if (end === start) return 0; - if (this.length == 0) return 0; - - if (start < 0 || start >= this.length) { - throw new Error('start out of bounds'); - } - - if (end < 0 || end > this.length) { - throw new Error('end out of bounds'); - } - - return this.parent.fill(value, - start + this.offset, - end + this.offset); -}; - - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function(target, target_start, start, end) { - var source = this; - start || (start = 0); - end || (end = this.length); - target_start || (target_start = 0); - - if (end < start) throw new Error('sourceEnd < sourceStart'); - - // Copy 0 bytes; we're done - if (end === start) return 0; - if (target.length == 0 || source.length == 0) return 0; - - if (target_start < 0 || target_start >= target.length) { - throw new Error('targetStart out of bounds'); - } - - if (start < 0 || start >= source.length) { - throw new Error('sourceStart out of bounds'); - } - - if (end < 0 || end > source.length) { - throw new Error('sourceEnd out of bounds'); - } - - // Are we oob? - if (end > this.length) { - end = this.length; - } - - if (target.length - target_start < end - start) { - end = target.length - target_start + start; - } - - return this.parent.copy(target.parent, - target_start + target.offset, - start + this.offset, - end + this.offset); -}; - - -// slice(start, end) -Buffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - if (end > this.length) throw new Error('oob'); - if (start > end) throw new Error('oob'); - - return new Buffer(this.parent, end - start, +start + this.offset); -}; - - -// Legacy methods for backwards compatibility. - -Buffer.prototype.utf8Slice = function(start, end) { - return this.toString('utf8', start, end); -}; - -Buffer.prototype.binarySlice = function(start, end) { - return this.toString('binary', start, end); -}; - -Buffer.prototype.asciiSlice = function(start, end) { - return this.toString('ascii', start, end); -}; - -Buffer.prototype.utf8Write = function(string, offset) { - return this.write(string, offset, 'utf8'); -}; - -Buffer.prototype.binaryWrite = function(string, offset) { - return this.write(string, offset, 'binary'); -}; - -Buffer.prototype.asciiWrite = function(string, offset) { - return this.write(string, offset, 'ascii'); -}; - -Buffer.prototype.readUInt8 = function(offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - return buffer.parent[buffer.offset + offset]; -}; - -function readUInt16(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - val = buffer.parent[buffer.offset + offset] << 8; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1]; - } - } else { - val = buffer.parent[buffer.offset + offset]; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1] << 8; - } - } - - return val; -} - -Buffer.prototype.readUInt16LE = function(offset, noAssert) { - return readUInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt16BE = function(offset, noAssert) { - return readUInt16(this, offset, true, noAssert); -}; - -function readUInt32(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - if (offset + 1 < buffer.length) - val = buffer.parent[buffer.offset + offset + 1] << 16; - if (offset + 2 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 2] << 8; - if (offset + 3 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 3]; - val = val + (buffer.parent[buffer.offset + offset] << 24 >>> 0); - } else { - if (offset + 2 < buffer.length) - val = buffer.parent[buffer.offset + offset + 2] << 16; - if (offset + 1 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 1] << 8; - val |= buffer.parent[buffer.offset + offset]; - if (offset + 3 < buffer.length) - val = val + (buffer.parent[buffer.offset + offset + 3] << 24 >>> 0); - } - - return val; -} - -Buffer.prototype.readUInt32LE = function(offset, noAssert) { - return readUInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt32BE = function(offset, noAssert) { - return readUInt32(this, offset, true, noAssert); -}; - - -/* - * Signed integer types, yay team! A reminder on how two's complement actually - * works. The first bit is the signed bit, i.e. tells us whether or not the - * number should be positive or negative. If the two's complement value is - * positive, then we're done, as it's equivalent to the unsigned representation. - * - * Now if the number is positive, you're pretty much done, you can just leverage - * the unsigned translations and return those. Unfortunately, negative numbers - * aren't quite that straightforward. - * - * At first glance, one might be inclined to use the traditional formula to - * translate binary numbers between the positive and negative values in two's - * complement. (Though it doesn't quite work for the most negative value) - * Mainly: - * - invert all the bits - * - add one to the result - * - * Of course, this doesn't quite work in Javascript. Take for example the value - * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of - * course, Javascript will do the following: - * - * > ~0xff80 - * -65409 - * - * Whoh there, Javascript, that's not quite right. But wait, according to - * Javascript that's perfectly correct. When Javascript ends up seeing the - * constant 0xff80, it has no notion that it is actually a signed number. It - * assumes that we've input the unsigned value 0xff80. Thus, when it does the - * binary negation, it casts it into a signed value, (positive 0xff80). Then - * when you perform binary negation on that, it turns it into a negative number. - * - * Instead, we're going to have to use the following general formula, that works - * in a rather Javascript friendly way. I'm glad we don't support this kind of - * weird numbering scheme in the kernel. - * - * (BIT-MAX - (unsigned)val + 1) * -1 - * - * The astute observer, may think that this doesn't make sense for 8-bit numbers - * (really it isn't necessary for them). However, when you get 16-bit numbers, - * you do. Let's go back to our prior example and see how this will look: - * - * (0xffff - 0xff80 + 1) * -1 - * (0x007f + 1) * -1 - * (0x0080) * -1 - */ -Buffer.prototype.readInt8 = function(offset, noAssert) { - var buffer = this; - var neg; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - neg = buffer.parent[buffer.offset + offset] & 0x80; - if (!neg) { - return (buffer.parent[buffer.offset + offset]); - } - - return ((0xff - buffer.parent[buffer.offset + offset] + 1) * -1); -}; - -function readInt16(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt16(buffer, offset, isBigEndian, noAssert); - neg = val & 0x8000; - if (!neg) { - return val; - } - - return (0xffff - val + 1) * -1; -} - -Buffer.prototype.readInt16LE = function(offset, noAssert) { - return readInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt16BE = function(offset, noAssert) { - return readInt16(this, offset, true, noAssert); -}; - -function readInt32(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt32(buffer, offset, isBigEndian, noAssert); - neg = val & 0x80000000; - if (!neg) { - return (val); - } - - return (0xffffffff - val + 1) * -1; -} - -Buffer.prototype.readInt32LE = function(offset, noAssert) { - return readInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt32BE = function(offset, noAssert) { - return readInt32(this, offset, true, noAssert); -}; - -function readFloat(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.readFloatLE = function(offset, noAssert) { - return readFloat(this, offset, false, noAssert); -}; - -Buffer.prototype.readFloatBE = function(offset, noAssert) { - return readFloat(this, offset, true, noAssert); -}; - -function readDouble(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.readDoubleLE = function(offset, noAssert) { - return readDouble(this, offset, false, noAssert); -}; - -Buffer.prototype.readDoubleBE = function(offset, noAssert) { - return readDouble(this, offset, true, noAssert); -}; - - -/* - * We have to make sure that the value is a valid integer. This means that it is - * non-negative. It has no fractional component and that it does not exceed the - * maximum allowed value. - * - * value The number to check for validity - * - * max The maximum value - */ -function verifuint(value, max) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value >= 0, - 'specified a negative value for writing an unsigned value'); - - assert.ok(value <= max, 'value is larger than maximum value for type'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xff); - } - - if (offset < buffer.length) { - buffer.parent[buffer.offset + offset] = value; - } -}; - -function writeUInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) { - buffer.parent[buffer.offset + offset + i] = - (value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>> - (isBigEndian ? 1 - i : i) * 8; - } - -} - -Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, true, noAssert); -}; - -function writeUInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffffffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) { - buffer.parent[buffer.offset + offset + i] = - (value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff; - } -} - -Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, true, noAssert); -}; - - -/* - * We now move onto our friends in the signed number category. Unlike unsigned - * numbers, we're going to have to worry a bit more about how we put values into - * arrays. Since we are only worrying about signed 32-bit values, we're in - * slightly better shape. Unfortunately, we really can't do our favorite binary - * & in this system. It really seems to do the wrong thing. For example: - * - * > -32 & 0xff - * 224 - * - * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of - * this aren't treated as a signed number. Ultimately a bad thing. - * - * What we're going to want to do is basically create the unsigned equivalent of - * our representation and pass that off to the wuint* functions. To do that - * we're going to do the following: - * - * - if the value is positive - * we can pass it directly off to the equivalent wuint - * - if the value is negative - * we do the following computation: - * mb + val + 1, where - * mb is the maximum unsigned value in that byte size - * val is the Javascript negative integer - * - * - * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If - * you do out the computations: - * - * 0xffff - 128 + 1 - * 0xffff - 127 - * 0xff80 - * - * You can then encode this value as the signed version. This is really rather - * hacky, but it should work and get the job done which is our goal here. - */ - -/* - * A series of checks to make sure we actually have a signed 32-bit number - */ -function verifsint(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -function verifIEEE754(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); -} - -Buffer.prototype.writeInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7f, -0x80); - } - - if (value >= 0) { - buffer.writeUInt8(value, offset, noAssert); - } else { - buffer.writeUInt8(0xff + value + 1, offset, noAssert); - } -}; - -function writeInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fff, -0x8000); - } - - if (value >= 0) { - writeUInt16(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { - writeInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { - writeInt16(this, value, offset, true, noAssert); -}; - -function writeInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fffffff, -0x80000000); - } - - if (value >= 0) { - writeUInt32(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { - writeInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { - writeInt32(this, value, offset, true, noAssert); -}; - -function writeFloat(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.writeFloatLE = function(value, offset, noAssert) { - writeFloat(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeFloatBE = function(value, offset, noAssert) { - writeFloat(this, value, offset, true, noAssert); -}; - -function writeDouble(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) { - writeDouble(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) { - writeDouble(this, value, offset, true, noAssert); -}; - -SlowBuffer.prototype.readUInt8 = Buffer.prototype.readUInt8; -SlowBuffer.prototype.readUInt16LE = Buffer.prototype.readUInt16LE; -SlowBuffer.prototype.readUInt16BE = Buffer.prototype.readUInt16BE; -SlowBuffer.prototype.readUInt32LE = Buffer.prototype.readUInt32LE; -SlowBuffer.prototype.readUInt32BE = Buffer.prototype.readUInt32BE; -SlowBuffer.prototype.readInt8 = Buffer.prototype.readInt8; -SlowBuffer.prototype.readInt16LE = Buffer.prototype.readInt16LE; -SlowBuffer.prototype.readInt16BE = Buffer.prototype.readInt16BE; -SlowBuffer.prototype.readInt32LE = Buffer.prototype.readInt32LE; -SlowBuffer.prototype.readInt32BE = Buffer.prototype.readInt32BE; -SlowBuffer.prototype.readFloatLE = Buffer.prototype.readFloatLE; -SlowBuffer.prototype.readFloatBE = Buffer.prototype.readFloatBE; -SlowBuffer.prototype.readDoubleLE = Buffer.prototype.readDoubleLE; -SlowBuffer.prototype.readDoubleBE = Buffer.prototype.readDoubleBE; -SlowBuffer.prototype.writeUInt8 = Buffer.prototype.writeUInt8; -SlowBuffer.prototype.writeUInt16LE = Buffer.prototype.writeUInt16LE; -SlowBuffer.prototype.writeUInt16BE = Buffer.prototype.writeUInt16BE; -SlowBuffer.prototype.writeUInt32LE = Buffer.prototype.writeUInt32LE; -SlowBuffer.prototype.writeUInt32BE = Buffer.prototype.writeUInt32BE; -SlowBuffer.prototype.writeInt8 = Buffer.prototype.writeInt8; -SlowBuffer.prototype.writeInt16LE = Buffer.prototype.writeInt16LE; -SlowBuffer.prototype.writeInt16BE = Buffer.prototype.writeInt16BE; -SlowBuffer.prototype.writeInt32LE = Buffer.prototype.writeInt32LE; -SlowBuffer.prototype.writeInt32BE = Buffer.prototype.writeInt32BE; -SlowBuffer.prototype.writeFloatLE = Buffer.prototype.writeFloatLE; -SlowBuffer.prototype.writeFloatBE = Buffer.prototype.writeFloatBE; -SlowBuffer.prototype.writeDoubleLE = Buffer.prototype.writeDoubleLE; -SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE; - -})() -},{"assert":12,"./buffer_ieee754":14,"base64-js":15}],15:[function(require,module,exports){ -(function (exports) { - 'use strict'; - - var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - - function b64ToByteArray(b64) { - var i, j, l, tmp, placeHolders, arr; - - if (b64.length % 4 > 0) { - throw 'Invalid string. Length must be a multiple of 4'; - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64.indexOf('='); - placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? b64.length - 4 : b64.length; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]); - arr.push((tmp & 0xFF0000) >> 16); - arr.push((tmp & 0xFF00) >> 8); - arr.push(tmp & 0xFF); - } - - if (placeHolders === 2) { - tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4); - arr.push(tmp & 0xFF); - } else if (placeHolders === 1) { - tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2); - arr.push((tmp >> 8) & 0xFF); - arr.push(tmp & 0xFF); - } - - return arr; - } - - function uint8ToBase64(uint8) { - var i, - extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes - output = "", - temp, length; - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; - }; - - // go through the array every three bytes, we'll deal with trailing stuff later - for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { - temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output += tripletToBase64(temp); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - switch (extraBytes) { - case 1: - temp = uint8[uint8.length - 1]; - output += lookup[temp >> 2]; - output += lookup[(temp << 4) & 0x3F]; - output += '=='; - break; - case 2: - temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]); - output += lookup[temp >> 10]; - output += lookup[(temp >> 4) & 0x3F]; - output += lookup[(temp << 2) & 0x3F]; - output += '='; - break; - } - - return output; - } - - module.exports.toByteArray = b64ToByteArray; - module.exports.fromByteArray = uint8ToBase64; -}()); - -},{}]},{},["B01lSJ"]) -; -JSHINT = require('jshint').JSHINT; -}()); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/dist/jshint-2.0.0.js b/deploy/core/node_modules/jshint/dist/jshint-2.0.0.js deleted file mode 100644 index 26bbc43c0..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-2.0.0.js +++ /dev/null @@ -1,10994 +0,0 @@ -//2.0.0 -var JSHINT; -(function () { -var require; -require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -} - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],2:[function(require,module,exports){ -(function(process){if (!process.EventEmitter) process.EventEmitter = function () {}; - -var EventEmitter = exports.EventEmitter = process.EventEmitter; -var isArray = typeof Array.isArray === 'function' - ? Array.isArray - : function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]' - } -; -function indexOf (xs, x) { - if (xs.indexOf) return xs.indexOf(x); - for (var i = 0; i < xs.length; i++) { - if (x === xs[i]) return i; - } - return -1; -} - -// By default EventEmitters will print a warning if more than -// 10 listeners are added to it. This is a useful default which -// helps finding memory leaks. -// -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -var defaultMaxListeners = 10; -EventEmitter.prototype.setMaxListeners = function(n) { - if (!this._events) this._events = {}; - this._events.maxListeners = n; -}; - - -EventEmitter.prototype.emit = function(type) { - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events || !this._events.error || - (isArray(this._events.error) && !this._events.error.length)) - { - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - if (!this._events) return false; - var handler = this._events[type]; - if (!handler) return false; - - if (typeof handler == 'function') { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - return true; - - } else if (isArray(handler)) { - var args = Array.prototype.slice.call(arguments, 1); - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - return true; - - } else { - return false; - } -}; - -// EventEmitter is defined in src/node_events.cc -// EventEmitter.prototype.emit() is also defined there. -EventEmitter.prototype.addListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('addListener only takes instances of Function'); - } - - if (!this._events) this._events = {}; - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } else if (isArray(this._events[type])) { - - // Check for listener leak - if (!this._events[type].warned) { - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - - // If we've already got an array, just append. - this._events[type].push(listener); - } else { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - var self = this; - self.on(type, function g() { - self.removeListener(type, g); - listener.apply(this, arguments); - }); - - return this; -}; - -EventEmitter.prototype.removeListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('removeListener only takes instances of Function'); - } - - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events || !this._events[type]) return this; - - var list = this._events[type]; - - if (isArray(list)) { - var i = indexOf(list, listener); - if (i < 0) return this; - list.splice(i, 1); - if (list.length == 0) - delete this._events[type]; - } else if (this._events[type] === listener) { - delete this._events[type]; - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - this._events = {}; - return this; - } - - // does not use listeners(), so no side effect of creating _events[type] - if (type && this._events && this._events[type]) this._events[type] = null; - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - if (!this._events) this._events = {}; - if (!this._events[type]) this._events[type] = []; - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; -}; - -})(require("__browserify_process")) -},{"__browserify_process":1}],3:[function(require,module,exports){ -(function(){// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - ElementTimeControl : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - SVGAElement : false, - SVGAltGlyphDefElement: false, - SVGAltGlyphElement : false, - SVGAltGlyphItemElement: false, - SVGAngle : false, - SVGAnimateColorElement: false, - SVGAnimateElement : false, - SVGAnimateMotionElement: false, - SVGAnimateTransformElement: false, - SVGAnimatedAngle : false, - SVGAnimatedBoolean : false, - SVGAnimatedEnumeration: false, - SVGAnimatedInteger : false, - SVGAnimatedLength : false, - SVGAnimatedLengthList: false, - SVGAnimatedNumber : false, - SVGAnimatedNumberList: false, - SVGAnimatedPathData : false, - SVGAnimatedPoints : false, - SVGAnimatedPreserveAspectRatio: false, - SVGAnimatedRect : false, - SVGAnimatedString : false, - SVGAnimatedTransformList: false, - SVGAnimationElement : false, - SVGCSSRule : false, - SVGCircleElement : false, - SVGClipPathElement : false, - SVGColor : false, - SVGColorProfileElement: false, - SVGColorProfileRule : false, - SVGComponentTransferFunctionElement: false, - SVGCursorElement : false, - SVGDefsElement : false, - SVGDescElement : false, - SVGDocument : false, - SVGElement : false, - SVGElementInstance : false, - SVGElementInstanceList: false, - SVGEllipseElement : false, - SVGExternalResourcesRequired: false, - SVGFEBlendElement : false, - SVGFEColorMatrixElement: false, - SVGFEComponentTransferElement: false, - SVGFECompositeElement: false, - SVGFEConvolveMatrixElement: false, - SVGFEDiffuseLightingElement: false, - SVGFEDisplacementMapElement: false, - SVGFEDistantLightElement: false, - SVGFEFloodElement : false, - SVGFEFuncAElement : false, - SVGFEFuncBElement : false, - SVGFEFuncGElement : false, - SVGFEFuncRElement : false, - SVGFEGaussianBlurElement: false, - SVGFEImageElement : false, - SVGFEMergeElement : false, - SVGFEMergeNodeElement: false, - SVGFEMorphologyElement: false, - SVGFEOffsetElement : false, - SVGFEPointLightElement: false, - SVGFESpecularLightingElement: false, - SVGFESpotLightElement: false, - SVGFETileElement : false, - SVGFETurbulenceElement: false, - SVGFilterElement : false, - SVGFilterPrimitiveStandardAttributes: false, - SVGFitToViewBox : false, - SVGFontElement : false, - SVGFontFaceElement : false, - SVGFontFaceFormatElement: false, - SVGFontFaceNameElement: false, - SVGFontFaceSrcElement: false, - SVGFontFaceUriElement: false, - SVGForeignObjectElement: false, - SVGGElement : false, - SVGGlyphElement : false, - SVGGlyphRefElement : false, - SVGGradientElement : false, - SVGHKernElement : false, - SVGICCColor : false, - SVGImageElement : false, - SVGLangSpace : false, - SVGLength : false, - SVGLengthList : false, - SVGLineElement : false, - SVGLinearGradientElement: false, - SVGLocatable : false, - SVGMPathElement : false, - SVGMarkerElement : false, - SVGMaskElement : false, - SVGMatrix : false, - SVGMetadataElement : false, - SVGMissingGlyphElement: false, - SVGNumber : false, - SVGNumberList : false, - SVGPaint : false, - SVGPathElement : false, - SVGPathSeg : false, - SVGPathSegArcAbs : false, - SVGPathSegArcRel : false, - SVGPathSegClosePath : false, - SVGPathSegCurvetoCubicAbs: false, - SVGPathSegCurvetoCubicRel: false, - SVGPathSegCurvetoCubicSmoothAbs: false, - SVGPathSegCurvetoCubicSmoothRel: false, - SVGPathSegCurvetoQuadraticAbs: false, - SVGPathSegCurvetoQuadraticRel: false, - SVGPathSegCurvetoQuadraticSmoothAbs: false, - SVGPathSegCurvetoQuadraticSmoothRel: false, - SVGPathSegLinetoAbs : false, - SVGPathSegLinetoHorizontalAbs: false, - SVGPathSegLinetoHorizontalRel: false, - SVGPathSegLinetoRel : false, - SVGPathSegLinetoVerticalAbs: false, - SVGPathSegLinetoVerticalRel: false, - SVGPathSegList : false, - SVGPathSegMovetoAbs : false, - SVGPathSegMovetoRel : false, - SVGPatternElement : false, - SVGPoint : false, - SVGPointList : false, - SVGPolygonElement : false, - SVGPolylineElement : false, - SVGPreserveAspectRatio: false, - SVGRadialGradientElement: false, - SVGRect : false, - SVGRectElement : false, - SVGRenderingIntent : false, - SVGSVGElement : false, - SVGScriptElement : false, - SVGSetElement : false, - SVGStopElement : false, - SVGStringList : false, - SVGStylable : false, - SVGStyleElement : false, - SVGSwitchElement : false, - SVGSymbolElement : false, - SVGTRefElement : false, - SVGTSpanElement : false, - SVGTests : false, - SVGTextContentElement: false, - SVGTextElement : false, - SVGTextPathElement : false, - SVGTextPositioningElement: false, - SVGTitleElement : false, - SVGTransform : false, - SVGTransformList : false, - SVGTransformable : false, - SVGURIReference : false, - SVGUnitTypes : false, - SVGUseElement : false, - SVGVKernElement : false, - SVGViewElement : false, - SVGViewSpec : false, - SVGZoomAndPan : false, - TimeEvent : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - DataView : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval: false -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - - -})() -},{}],4:[function(require,module,exports){ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use string"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; - -},{}],5:[function(require,module,exports){ -"use strict"; - -var state = { - syntax: {}, - - reset: function () { - this.tokens = { - prev: null, - next: null, - curr: null - }, - - this.option = {}; - this.ignored = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - } -}; - -exports.state = state; - -},{}],6:[function(require,module,exports){ -(function(){"use strict"; - -exports.register = function (linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for dangling underscores. - - linter.on("Identifier", function style_scanDangling(data) { - if (!linter.getOption("nomen")) { - return; - } - - // Underscore.js - if (data.name === "_") { - return; - } - - // In Node, __dirname and __filename should be ignored. - if (linter.getOption("node")) { - if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { - return; - } - } - - if (/^(_+.*|.*_+)$/.test(data.name)) { - linter.warn("W105", { - line: data.line, - char: data.from, - data: [ "dangling '_'", data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+/, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; -})() -},{}],"jshint":[function(require,module,exports){ -module.exports=require('B01lSJ'); -},{}],"B01lSJ":[function(require,module,exports){ -(function(){/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * 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. - * - */ - -/*jshint quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = require("underscore"); -var events = require("events"); -var vars = require("../shared/vars.js"); -var messages = require("../shared/messages.js"); -var Lexer = require("./lex.js").Lexer; -var reg = require("./reg.js"); -var state = require("./state.js").state; -var style = require("./style.js"); - -// We need this module here because environments such as IE and Rhino -// don't necessarilly expose the 'console' API and browserify uses -// it to log things. It's a sad state of affair, really. -var console = require("console-browserify"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - api, // Extension API - - // These are operators that should not be used with the ! operator. - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es3 : true, // if ES3 syntax should be allowed - es5 : true, // if ES5 syntax should be allowed (is now set per default) - esnext : true, // if es.next specific syntax should be allowed - moz : true, // if mozilla specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - gcl : true, // if JSHint should be compatible with Google Closure Linter - globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - passfail : true, // if the scan should stop on first error - phantom : true, // if PhantomJS symbols should be allowed - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true, // YUI variables should be predefined - - // Obsolete options - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false, // {int} max cyclomatic complexity per function - unused : true, // warn if variables are unused. Available options: - // false - don't check for unused variables - // true - "vars" + check last function param - // "vars" - skip checking unused function params - // "strict" - "vars" + check all function params - latedef : false // warn if the variable is used before its definition - // false - don't emit any warnings - // true - warn if any variable is used before its definition - // "nofunc" - warn for any variable but function declarations - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus: true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true, - strict : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows: "wsh", - sloppy : "strict" - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - noreach, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - warnings, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^[+-]W\d{3}$/g.test(name)) { - return true; - } - - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - if (t.type !== "jslint") { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.inES5(true) && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (_.has(o, n) && !_.has(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (state.option.es5) { - warning("I003"); - } - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - - // let's assume that chronologically ES3 < ES5 < ES6/ESNext < Moz - state.option.inMoz = function (strict) { - if (strict) { - return state.option.moz && !state.option.esnext; - } - return state.option.moz; - }; - state.option.inESNext = function (strict) { - if (strict) { - return !state.option.moz && state.option.esnext; - } - return state.option.moz || state.option.esnext; - }; - state.option.inES5 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && !state.option.es3; - } - return !state.option.es3; - }; - state.option.inES3 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && state.option.es3; - } - return state.option.es3; - }; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, code, token, a) { - return JSHINT.undefs.push([scope, code, token, a]); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (state.ignored[code]) - return; - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - if (state.option.passfail) { - quit("E042", l, ch); - } - - warnings += 1; - if (warnings >= state.option.maxerr) { - quit("E043", l, ch); - } - - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - function addlabel(t, type, tkn, islet) { - // Define t in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], t)) { - if (funct[t] !== true && !state.option.node) { - warning("W002", state.tokens.next, t); - } - } - } - - if (_.has(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - } else { - if (!state.option.shadow && type !== "exception" || - (funct["(blockscope)"].getlabel(t))) { - warning("W004", state.tokens.next, t); - } - } - } - - // a double definition of a let variable in same block throws a TypeError - if (funct["(blockscope)"] && funct["(blockscope)"].current.has(t)) { - error("E044", state.tokens.next, t); - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(t, type, state.tokens.curr); - } else { - - funct[t] = type; - - if (tkn) { - funct["(tokens)"][t] = tkn; - } - - if (funct["(global)"]) { - global[t] = funct; - if (_.has(implied, t)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function (g) { - g = g.split(":"); - var key = g[0]; - var val = g[1]; - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - updatePredefined(); - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function (e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function (m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\b", "\b") - .replace("\\t", "\t") - .replace("\\n", "\n") - .replace("\\v", "\v") - .replace("\\f", "\f") - .replace("\\r", "\r") - .replace("\\\\", "\\") - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - - // GH988 - numeric options can be disabled by setting them to `false` - if (val !== "false") { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - if (key === "indent") { - state.option["(explicitIndent)"] = true; - } - state.option[key] = val; - } else { - if (key === "indent") { - state.option["(explicitIndent)"] = false; - } else { - state.option[key] = false; - } - } - - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - if (funct["(global)"]) { - error("E009"); - } else { - if (val === "true" || val === "false") { - state.option.validthis = (val === "true"); - } else { - error("E002", nt); - } - } - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - var match = /^([+-])(W\d{3})$/g.exec(key); - if (match) { - // ignore for -W..., unignore for +W... - state.ignored[match[2]] = (match[1] === "-"); - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = renamedOptions[key] || key; - state.option[tn] = (val === "true"); - - if (invertedOptions[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - assume(); - } - } - - // We need a peek function. If it has an argument, it peeks that much farther - // ahead. It is used to distinguish - // for ( var i in ... - // from - // for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (state.tokens.curr.type === "(string)" || state.tokens.curr.identifier) { - anonname = state.tokens.curr.value; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.check) { - state.tokens.next.check(); - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - // This is the heart of JSHINT, the Pratt parser. In addition to parsing, it - // is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is - // like .nud except that it is only used on the first token of a statement. - // Having .fud makes it much easier to define statement-oriented languages like - // JavaScript. I retained Pratt's nomenclature. - - // .nud Null denotation - // .fud First null denotation - // .led Left denotation - // lbp Left binding power - // rbp Right binding power - - // They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false, isLetExpr = false; - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.syntax["let"].fud.call(state.syntax["let"].fud, false); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - advance(); - - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = state.tokens.curr.value; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - var end_of_expr = state.tokens.next.identifier && - !state.tokens.curr.led && - state.tokens.curr.line !== state.tokens.next.line; - while (rbp < state.tokens.next.lbp && !end_of_expr) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && (left.character !== right.from || left.line !== right.line)) { - warning("W012", right, right.value); - } - } - - function nospace(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - - if (left.value === ";" && right.value === ";") { - return; - } - - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== right.line) { - warning("W014", right, right.id); - } else if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function indentation(bias) { - if (!state.option.white && !state.option["(explicitIndent)"]) { - return; - } - - if (state.tokens.next.id === "(end)") { - return; - } - - var i = indent + (bias || 0); - if (state.tokens.next.from !== i) { - warning("W015", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== state.tokens.next.line) { - warning("E022", t, t.value); - } - } - - - function comma(opts) { - opts = opts || {}; - - if (state.tokens.curr.line !== state.tokens.next.line) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", state.tokens.curr, state.tokens.next.id); - } - } else if (!state.tokens.curr.comment && - state.tokens.curr.character !== state.tokens.next.from && state.option.white) { - state.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from); - warning("W011", state.tokens.curr, state.tokens.curr.value); - } - - advance(","); - - // TODO: This is a temporary solution to fight against false-positives in - // arrays and objects with trailing commas (see GH-363). The best solution - // would be to extract all whitespace rules out of parser. - - if (state.tokens.next.value !== "]" && state.tokens.next.value !== "}") { - nonadjacent(state.tokens.curr, state.tokens.next); - } - - if (state.tokens.next.identifier && !state.option.inES5()) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "yield": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return true; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - return true; - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - return symbol(s, 0); - } - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - return this; - }; - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, function () { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - return x; - } - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function application(s) { - var x = symbol(s, 42); - - x.led = function (left) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "arrow function syntax (=>)"); - } - - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - - this.left = left; - this.right = doFunction(undefined, undefined, false, left); - return this; - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function (left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", right, "!"); - } - - this.left = left; - this.right = right; - return this; - }; - return x; - } - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (left) { - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - - that.right = expression(19); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function (t) { - if (funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - that.right = expression(19); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - nonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(19); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function (left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop) { - if (!state.tokens.next.identifier) { - return; - } - - advance(); - - var curr = state.tokens.curr; - var meta = curr.meta || {}; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.inES5() || meta.isFutureReservedWord) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - // Display an info message about reserved words as properties - // and ES5 but do it only once. - if (prop && !api.getCache("displayed:I002")) { - api.setCache("displayed:I002", true); - warning("I002"); - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop); - if (i) { - return i; - } - if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { - warning("W025"); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (state.tokens.next.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!state.option.latedef) { - break; - } - - warning("W026", t); - break; - } - - warning("W027", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var values; - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord) { - warning("W024", t, t.id); - res = false; - } - - // detect a destructuring assignment - if (_.has(["[", "{"], t.value)) { - if (lookupBlockType().isDestAssign) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - values = destructuringExpression(); - values.forEach(function (tok) { - isundef(funct, "W117", tok.token, tok.id); - }); - advance("="); - destructuringExpressionMatch(values, expression(0, true)); - advance(";"); - return; - } - } - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - - while (state.tokens.next.id === ",") { - if (comma()) { - r = expression(0, true); - } else { - return; - } - } - - if (state.tokens.next.id !== ";") { - if (!state.option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!state.option.lastsemic || state.tokens.next.id !== "}" || - state.tokens.next.line !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - adjacent(state.tokens.curr, state.tokens.next); - advance(";"); - nonadjacent(state.tokens.curr, state.tokens.next); - } - } - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement(startLine === state.tokens.next.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("W033", state.tokens.next); - } else { - p = pn; - } - } else if (p.id === "}") { - // Directive with no other statements, warn about missing semicolon - warning("W033", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) - state.option.newcap = true; - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc, isfatarrow) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - if (line !== state.tokens.next.line) { - indentation(); - } - } else if (line !== state.tokens.next.line) { - indentation(); - } - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - if (stmt && !isfatarrow && !state.option.inMoz(true)) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - if (!stmt) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - } - expression(0); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - noreach = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement(state.tokens.next.line === state.tokens.curr.line)]; - indent -= state.option.indent; - noreach = false; - - delete funct["(nolet)"]; - } - funct["(verb)"] = null; - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035"); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value, line = tkn.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - var block; - if (_.has(funct, "(blockscope)")) { - block = funct["(blockscope)"].getlabel(v); - } - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && (state.tokens.next.value === "." || - state.tokens.next.value === "["))) { - - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - } - } - - note_implied(state.tokens.curr); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // - // display warning if we're inside of typeof or delete. - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && - (state.tokens.next.value === "." || state.tokens.next.value === "["))) { - - isundef(funct, "W117", state.tokens.curr, v); - } - funct[v] = true; - note_implied(state.tokens.curr); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - led: function () { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (state.directive["use strict"] && !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) - warning("W116", this, "===", "=="); - else if (isPoorRelation(left)) - warning("W041", this, "===", left.value); - else if (isPoorRelation(right)) - warning("W041", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("W007"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("W006"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("W051"); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (state.option.bitwise) { - warning("W052", this, "~"); - } - expression(150); - return this; - }); - - prefix("...", function () { - if (!state.option.inESNext()) { - warning("W104", this, "spread/rest operator"); - } - if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.value); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("W053", state.tokens.prev, c.value); - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - adjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(state.tokens.prev, state.tokens.curr); - nobreak(); - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - warning("W061"); - } - - return that; - }, 160, true); - - infix("(", function (left, that) { - if (state.tokens.prev.id !== "}" && state.tokens.prev.id !== ")") { - nobreak(state.tokens.prev, state.tokens.curr); - } - - nospace(); - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - nospace(state.tokens.prev, state.tokens.curr); - - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("W067", left); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - - nospace(); - var bracket, brackets = []; - var pn, pn1, i = 0; - - do { - pn = peek(i); - i += 1; - pn1 = peek(i); - i += 1; - } while (pn.value !== ")" && pn1.value !== "=>" && pn1.value !== ";" && pn1.type !== "(end)"); - - if (state.tokens.next.id === "function") { - state.tokens.next.immed = true; - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - if (pn1.value === "=>" && state.tokens.next.value === "{") { - bracket = state.tokens.next; - bracket.left = destructuringExpression(); - brackets.push(bracket); - for (var t in bracket.left) { - exprs.push(bracket.left[t].token); - } - } else { - exprs.push(expression(0)); - } - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")", this); - nospace(state.tokens.prev, state.tokens.curr); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - (state.tokens.next.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning("W068", this); - } - } - - if (state.tokens.next.value === "=>") { - return exprs; - } - return exprs[0]; - }); - - application("=>"); - - infix("[", function (left, that) { - nobreak(state.tokens.prev, state.tokens.curr); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("W061", that); - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - nospace(state.tokens.prev, state.tokens.curr); - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - res.right = expression(0); - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(0); - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(0); - advance(")"); - } - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function () { - var blocktype = lookupBlockType(true); - if (blocktype.isCompArray) { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== state.tokens.next.line; - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!state.option.inES5()) - warning("W070"); - advance(","); - } - if (state.tokens.next.id === "]") { - break; - } - if (b && state.tokens.curr.line !== state.tokens.next.line) { - indentation(); - } - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(false, true); - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - advance(); - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - advance(); - } - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - - function functionparams(parsed) { - var curr, next; - var params = []; - var ident; - var tokens = []; - var t; - - if (parsed) { - if (parsed instanceof Array) { - for (var i in parsed) { - curr = parsed[i]; - if (_.contains(["{", "["], curr.id)) { - for (t in curr.left) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (curr.value === "...") { - if (!state.option.inESNext()) { - warning("W104", curr, "spread/rest operator"); - } - continue; - } else { - addlabel(curr.value, "unused", curr); - } - } - return params; - } else { - if (parsed.identifier === true) { - addlabel(parsed.value, "unused", parsed); - return [parsed]; - } - } - } - - next = state.tokens.next; - - advance("("); - nospace(); - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (state.tokens.next.value === "...") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "spread/rest operator"); - } - advance("..."); - nospace(); - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } else { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } - if (state.tokens.next.id === ",") { - comma(); - } else { - advance(")", next); - nospace(state.tokens.prev, state.tokens.curr); - return params; - } - } - } - - - function doFunction(name, statement, generator, fatarrowparams) { - var f; - var oldOption = state.option; - var oldIgnored = state.ignored; - var oldScope = scope; - - state.option = Object.create(state.option); - state.ignored = Object.create(state.ignored); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : state.tokens.next.line, - "(character)" : state.tokens.next.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(state.tokens.next), - "(scope)" : scope, - "(statement)" : statement, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)" : funct["(comparray)"] - }; - - if (generator) { - funct["(generator)"] = true; - } - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(fatarrowparams); - - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, true, true, fatarrowparams ? true:false); - - if (generator && funct["(generator)"] !== "yielded") { - error("E047", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - state.ignored = oldIgnored; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function parseCondAssignment() { - switch (state.tokens.next.id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!state.option.boss) { - warning("W084"); - } - - advance(state.tokens.next.id); - expression(20); - } - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t, g; - var props = {}; // All properties, including accessors - - function saveProperty(name, tkn) { - if (props[name] && _.has(props, name)) - warning("W075", state.tokens.next, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basictkn = tkn; - } - - function saveSetter(name, tkn) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].setter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = tkn; - } - - function saveGetter(name) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].getter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = state.tokens.curr; - } - - b = state.tokens.curr.line !== state.tokens.next.line; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - if (b) { - indentation(); - } - - if (state.tokens.next.value === "get" && peek().id !== ":") { - advance("get"); - - if (!state.option.inES5(true)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveGetter(i); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (p) { - warning("W076", t, p[0], i); - } - - adjacent(state.tokens.curr, state.tokens.next); - } else if (state.tokens.next.value === "set" && peek().id !== ":") { - advance("set"); - - if (!state.option.inES5(true)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveSetter(i, state.tokens.next); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (!p || p.length !== 1) { - warning("W077", t, i); - } - } else { - g = false; - if (state.tokens.next.value === "*" && state.tokens.next.type === "(punctuator)") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "generator functions"); - } - advance("*"); - g = true; - } - i = property_name(); - saveProperty(i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - - if (state.tokens.next.value === "(") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "concise methods"); - } - doFunction(i, undefined, g); - } else { - advance(":"); - nonadjacent(state.tokens.curr, state.tokens.next); - expression(10); - } - } - - countMember(i); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (state.option.inES5()) { - for (var name in props) { - if (_.has(props, name) && props[name].setter && !props[name].getter) { - warning("W078", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function () { - var ident; - if (_.contains(["[", "{"], state.tokens.next.value)) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (state.tokens.next.value === ",") { - identifiers.push({ id: null, token: state.tokens.curr }); - } else { - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - } - }; - if (state.tokens.next.value === "[") { - advance("["); - nextInnerDE(); - while (state.tokens.next.value !== "]") { - advance(","); - nextInnerDE(); - } - advance("]"); - } else if (state.tokens.next.value === "{") { - advance("{"); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (state.tokens.next.value !== "}") { - advance(","); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - function destructuringExpressionMatch(tokens, value) { - if (value.first) { - _.zip(tokens, value.first).forEach(function (val) { - var token = val[0]; - var value = val[1]; - if (token && value) { - token.first = value; - } else if (token && token.first && !value) { - warning("W080", token.first, token.first.value); - } /* else { - XXX value is discarded: wouldn't it need a warning ? - } */ - }); - } - } - - var conststatement = stmt("const", function (prefix) { - var tokens, value; - // state variable to know if it is a lone identifier, or a destructuring statement. - var lone; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "const"); - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "const"); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var tokens, lone, value; - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "unused", t.token); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E038", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - var letstatement = stmt("let", function (prefix) { - var tokens, lone, value, letblock; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, "unused", t.token, true); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.inESNext(true)) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = identifier(); - if (funct[i] === "const") { - warning("E011", null, i); - } - adjacent(state.tokens.curr, state.tokens.next); - addlabel(i, "unction", state.tokens.curr); - - doFunction(i, { statement: true }, generator); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - var i = optionalidentifier(); - if (i || state.option.gcl) { - adjacent(state.tokens.curr, state.tokens.next); - } else { - nonadjacent(state.tokens.curr, state.tokens.next); - } - doFunction(i, undefined, generator); - if (!state.option.loopfunc && funct["(loopage)"]) { - warning("W083"); - } - return this; - }); - - blockstmt("if", function () { - var t = state.tokens.next; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - if (state.tokens.next.id === "else") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(state.tokens.curr, state.tokens.next); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = { - "(name)" : "(catch)", - "(line)" : state.tokens.next.line, - "(character)": state.tokens.next.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(state.tokens.next), - "(catch)" : true, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)": funct["(comparray)"] - }; - - if (e) { - addlabel(e, "exception"); - } - - if (state.tokens.next.value === "if") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(false); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.inMoz(true))) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(false); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = state.tokens.next, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - advance("{"); - nonadjacent(state.tokens.curr, state.tokens.next); - indent += state.option.indent; - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - indentation(-state.option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - indentation(-state.option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= state.option.indent; - indentation(); - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!state.option.debug) { - warning("W087"); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = state.tokens.next; - nonadjacent(state.tokens.curr, t); - advance("("); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && - nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!state.option.inESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud, true); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud, true); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - if (!funct["(blockscope)"].getlabel(state.tokens.next.value)) - warning("W088", state.tokens.next, state.tokens.next.value); - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - s = block(true, true); - if (state.option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("W089", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - expression(20); - parseCondAssignment(); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - stmt("yield", function () { - if (state.option.inESNext(true) && funct["(generator)"] !== true) { - error("E046", state.tokens.curr, "yield"); - } else if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface"); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("throws"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine wether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function () { - var pn, pn1; - var i = 0; - var bracketStack = 0; - var ret = {}; - if (_.contains(["[", "{"], state.tokens.curr.value)) - bracketStack += 1; - if (_.contains(["[", "{"], state.tokens.next.value)) - bracketStack += 1; - if (_.contains(["]", "}"], state.tokens.next.value)) - bracketStack -= 1; - do { - pn = peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (_.contains(["[", "{"], pn.value)) { - bracketStack += 1; - } else if (_.contains(["]", "}"], pn.value)) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (_.contains(["}", "]"], pn.value) && pn1.value === "=") { - ret.isDestAssign = true; - ret.notJson = true; - break; - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)" && i < 15); - return ret; - }; - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!state.option.inESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function () { - var CompArray = function () { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function (elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function (elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return {stack: function () { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function () { - _current.variables.filter(function (v) { - if (v.unused) - warning("W098", v.token, v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(_carrays[_carrays.length - 1], 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function (s) { - if (_.contains(["use", "define", "filter"], s)) - _current.mode = s; - }, - check: function (v) { - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false}); - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true}); - } - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (state.tokens.curr.character !== state.tokens.next.from) { - warning("W011", state.tokens.curr); - } - adjacent(state.tokens.curr, state.tokens.next); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function () { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function () { - _current = {}; - _variables.push(_current); - }, - - unstack: function () { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function (l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l)) { - return _variables[i]; - } - } - }, - - current: { - has: function (t) { - return _.has(_current, t); - }, - add: function (t, type, tok) { - _current[t] = { "(type)" : type, - "(token)": tok }; - } - } - }; - }; - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - var newIgnoredObj = {}; - - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - - a.forEach(function (item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - newIgnoredObj[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj["(explicitIndent)"] = o[optionKeys[x]] === false ? false : true; - } - } - } - - state.option = newOptionObj; - state.ignored = newIgnoredObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(state.tokens.next), - "(blockscope)": blockScope(), - "(comparray)": arrayComprehension() - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - warnings = 0; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function (name) { - return state.option[name] || null; - }, - - getCache: function (name) { - return state.cache[name]; - }, - - setCache: function (name, value) { - state.cache[name] = value; - }, - - warn: function (code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function (names, listener) { - names.split(" ").forEach(function (name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function (func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - lex = new Lexer(s); - - lex.on("warning", function (ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function (ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function (ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function (ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function (ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function (ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict && !state.option.node) { - warning("W097", state.tokens.prev); - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.character; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - warningAt("W098", line, chr, name); - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) { - return; - } - - warnUnused(key, tkn, "var"); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_opt; - - while (param) { - type = func[param]; - unused_opt = func["(unusedOption)"] || state.option.unused; - unused_opt = unused_opt === true ? "last-param" : unused_opt; - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], "param", func["(unusedOption)"]); - } else if (unused_opt === "last-param") { - return; - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function (func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: state.option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} - -})() -},{"events":2,"../shared/vars.js":3,"../shared/messages.js":7,"./lex.js":8,"./reg.js":4,"./state.js":5,"./style.js":6,"console-browserify":9,"underscore":10}],9:[function(require,module,exports){ -(function(global){/*global window, global*/ -var util = require("util") -var assert = require("assert") - -var slice = Array.prototype.slice -var console -var times = {} - -if (typeof global !== "undefined" && global.console) { - console = global.console -} else if (typeof window !== "undefined" && window.console) { - console = window.console -} else { - console = window.console = {} -} - -var functions = [ - [log, "log"] - , [info, "info"] - , [warn, "warn"] - , [error, "error"] - , [time, "time"] - , [timeEnd, "timeEnd"] - , [trace, "trace"] - , [dir, "dir"] - , [assert, "assert"] -] - -for (var i = 0; i < functions.length; i++) { - var tuple = functions[i] - var f = tuple[0] - var name = tuple[1] - - if (!console[name]) { - console[name] = f - } -} - -module.exports = console - -function log() {} - -function info() { - console.log.apply(console, arguments) -} - -function warn() { - console.log.apply(console, arguments) -} - -function error() { - console.warn.apply(console, arguments) -} - -function time(label) { - times[label] = Date.now() -} - -function timeEnd(label) { - var time = times[label] - if (!time) { - throw new Error("No such label: " + label) - } - - var duration = Date.now() - time - console.log(label + ": " + duration + "ms") -} - -function trace() { - var err = new Error() - err.name = "Trace" - err.message = util.format.apply(null, arguments) - console.error(err.stack) -} - -function dir(object) { - console.log(util.inspect(object) + "\n") -} - -function assert(expression) { - if (!expression) { - var arr = slice.call(arguments, 1) - assert.ok(false, util.format.apply(null, arr)) - } -} - -})(window) -},{"util":11,"assert":12}],7:[function(require,module,exports){ -(function(){"use strict"; - -var _ = require("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' form line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer or 'false' and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: "Constant {a} was not declared correctly.", - E038: "Variable {a} was not declared correctly.", - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: "'{a}' is already defined and can't be redefined.", - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: "A generator function shall contain a yield statement.", - E048: "Let declaration not directly within block." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing pluses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", - W011: "Unexpected space after '{a}'.", - W012: "Unexpected space before '{a}'.", - W013: "Missing space after '{a}'.", - W014: "Bad line breaking before '{a}'.", - W015: "Expected '{a}' to have an indentation at {b} instead at {c}.", - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' unnecessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate key '{a}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: "Too many var statements.", - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Expected a conditional expression and instead saw an assignment.", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: "Mixed spaces and tabs.", - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: "Trailing whitespace.", - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is only available in JavaScript 1.7.", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option)." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: "Reserved words as properties can be used under the 'es5' option.", - I003: "ES5 option is now set per default" -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function (desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function (desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function (desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); - -})() -},{"underscore":10}],8:[function(require,module,exports){ -(function(){/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = require("underscore"); -var events = require("events"); -var reg = require("./reg.js"); -var state = require("./state.js").state; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9 -}; - -// This is auto generated from the unicode tables. -// The tables are at: -// http://www.fileformat.info/info/unicode/category/Lu/list.htm -// http://www.fileformat.info/info/unicode/category/Ll/list.htm -// http://www.fileformat.info/info/unicode/category/Lt/list.htm -// http://www.fileformat.info/info/unicode/category/Lm/list.htm -// http://www.fileformat.info/info/unicode/category/Lo/list.htm -// http://www.fileformat.info/info/unicode/category/Nl/list.htm - -var unicodeLetterTable = [ - 170, 170, 181, 181, 186, 186, 192, 214, - 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, - 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, - 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, - 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, - 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, - 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, - 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, - 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361, - 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, - 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, - 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, - 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, - 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, - 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, - 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, - 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, - 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, - 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, - 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, - 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, - 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, - 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, - 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, - 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, - 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, - 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, - 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, - 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, - 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, - 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, - 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, - 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346, - 4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696, - 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, - 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, - 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, - 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, - 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, - 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, - 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, - 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, - 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141, - 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, - 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, - 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, - 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, - 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, - 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, - 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, - 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, - 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, - 11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621, - 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, - 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, - 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, - 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, - 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, - 12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312, - 19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124, - 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, - 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, - 42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921, - 43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042, - 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, - 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, - 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, - 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, - 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, - 43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798, - 43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032, - 55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045, - 64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279, - 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, - 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, - 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, - 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, - 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, - 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, - 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, - 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, - 66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511, - 66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592, - 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, - 67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115, - 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, - 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, - 69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894, - 92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964, - 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, - 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, - 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, - 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, - 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, - 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, - 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, - 131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972, - 177984, 177984, 178205, 178205, 194560, 195101 -]; - -var identifierStartTable = []; - -for (var i = 0; i < 128; i++) { - identifierStartTable[i] = - i === 36 || // $ - i >= 65 && i <= 90 || // A-Z - i === 95 || // _ - i >= 97 && i <= 122; // a-z -} - -var identifierPartTable = []; - -for (var i = 0; i < 128; i++) { - identifierPartTable[i] = - identifierStartTable[i] || // $, _, A-Z, a-z - i >= 48 && i <= 57; // 0-9 -} - -// Object that handles postponed lexing verifications that checks the parsed -// environment state. - -function asyncTrigger() { - var _checks = []; - - return { - push: function (fn) { - _checks.push(fn); - }, - - check: function () { - for (var check in _checks) { - _checks[check](); - } - - _checks.splice(0, _checks.length); - } - }; -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function (data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - - if (lines[0] && lines[0].substr(0, 2) === "#!") { - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.lines = lines; - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - get lines() { - this._lines = state.lines; - return this._lines; - }, - - set lines(val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function (i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function (i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function (data) { - * // ... - * }); - */ - on: function (names, listener) { - names.split(" ").forEach(function (name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function () { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Postpone a token event. the checking condition is set as - * last parameter, and the trigger function is called in a - * stored callback. To be later called using the check() function - * by the parser. This avoids parser's peek() to give the lexer - * a false context. - */ - triggerAsync: function (type, args, checks, fn) { - checks.push(function () { - if (fn()) { - this.trigger(type, args); - } - }.bind(this)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function () { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - if (this.peek(1) === "." && this.peek(2) === ".") { - return { - type: Token.Punctuator, - value: "..." - }; - } - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "{": - case "}": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: ">>=" - }; - } - - // Fat arrow punctuator - if (ch1 === "=" && ch2 === ">") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. We need to make sure that this is an - // operator and not a regular expression. - - if (ch1 === "/") { - if (ch2 === "=" && /\/=(?!(\S*\/[gim]?))/.test(this.input)) { - // /= is not a part of a regular expression, return it as a - // punctuator. - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function () { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - special.forEach(function (str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function () { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function () { - var id = ""; - var index = 0; - var type, char; - - // Detects any character in the Unicode categories "Uppercase - // letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter - // (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or - // "Letter number (Nl)". - // - // Both approach and unicodeLetterTable were borrowed from - // Google's Traceur. - - function isUnicodeLetter(code) { - for (var i = 0; i < unicodeLetterTable.length;) { - if (code < unicodeLetterTable[i++]) { - return false; - } - - if (code <= unicodeLetterTable[i++]) { - return true; - } - } - - return false; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function () { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (isUnicodeLetter(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: id - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function () { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - index += 1; - value += char; - - while (index < length) { - char = this.peek(index); - if (!isHexDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 16, - isMalformed: false - }; - } - - // Base-8 numbers. - if (isOctalDigit(char)) { - index += 1; - value += char; - bad = false; - - while (index < length) { - char = this.peek(index); - - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - - if (isDecimalDigit(char)) { - bad = true; - } else if (!isOctalDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 8, - isMalformed: false - }; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 10, - isMalformed: !isFinite(value) - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function (checks) { - /*jshint loopfunc:true */ - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - this.triggerAsync("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }, checks, function () { return state.jsonMode && quote !== "\""; }); - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - this.triggerAsync("warning", { - code: "W043", - line: this.line, - character: this.char - }, checks, function () { return !state.option.multistr; }); - - this.triggerAsync("warning", { - code: "W042", - line: this.line, - character: this.char - }, checks, function () { return state.jsonMode && state.option.multistr; }); - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - isUnclosed: true, - quote: quote - }; - } - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - - if (char === "\\") { - this.skip(); - char = this.peek(); - - switch (char) { - case "'": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }, checks, function () {return state.jsonMode; }); - break; - case "b": - char = "\b"; - break; - case "f": - char = "\f"; - break; - case "n": - char = "\n"; - break; - case "r": - char = "\r"; - break; - case "t": - char = "\t"; - break; - case "0": - char = "\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, - function () { return n >= 0 && n <= 7 && state.directive["use strict"]; }); - break; - case "u": - char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16)); - jump = 5; - break; - case "v": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }, checks, function () { return state.jsonMode; }); - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }, checks, function () { return state.jsonMode; }); - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - case "\"": - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - case "!": - if (value.slice(value.length - 2) === "<") { - break; - } - - /*falls through */ - default: - // Weird escaping. - this.trigger("warning", { - code: "W044", - line: this.line, - character: this.char - }); - } - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function () { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function () { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurence of mixed tabs and spaces. If smarttabs option - * is on, ignore tabs followed by spaces. - * - * Tabs followed by one space followed by a block comment are allowed. - */ - scanMixedSpacesAndTabs: function () { - var at, match; - - if (state.option.smarttabs) { - // Negative look-behind for "//" - match = this.input.match(/(\/\/|^\s?\*)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = this.input.search(/ \t|\t [^\*]/); - } - - return at; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function () { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function (checks) { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - - if (this.peek() === "") { // EOL - if (!/^\s*$/.test(this.lines[this.line - 1]) && state.option.trailing) { - this.trigger("warning", { code: "W102", line: this.line, character: start }); - } - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(checks); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for mixed spaces and tabs - * and other minor warnings. - */ - nextLine: function () { - var char; - - if (this.line >= this.lines.length) { - return false; - } - - this.input = this.lines[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - char = this.scanMixedSpacesAndTabs(); - if (char >= 0) { - this.trigger("warning", { code: "W099", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function () { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It retuns a token in a JSLint-compatible format. - */ - token: function () { - /*jshint loopfunc:true */ - var checks = asyncTrigger(); - var token; - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.inES5(true) && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function (type, value, isProperty) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - obj.check = checks.check; - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(checks); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.triggerAsync("String", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - quote: token.quote - }, checks, function () { return true; }); - - return create("(string)", token.value); - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === "."); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }, checks, function () { return token.base === 16 && state.jsonMode; }); - - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, function () { - return state.directive["use strict"] && token.base === 8; - }); - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; - -})() -},{"events":2,"./reg.js":4,"./state.js":5,"underscore":10}],12:[function(require,module,exports){ -(function(){// UTILITY -var util = require('util'); -var Buffer = require("buffer").Buffer; -var pSlice = Array.prototype.slice; - -function objectKeys(object) { - if (Object.keys) return Object.keys(object); - var result = []; - for (var name in object) { - if (Object.prototype.hasOwnProperty.call(object, name)) { - result.push(name); - } - } - return result; -} - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -util.inherits(assert.AssertionError, Error); - -function replacer(key, value) { - if (value === undefined) { - return '' + value; - } - if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) { - return value.toString(); - } - if (typeof value === 'function' || value instanceof RegExp) { - return value.toString(); - } - return value; -} - -function truncate(s, n) { - if (typeof s == 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } -} - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name + ':', this.message].join(' '); - } else { - return [ - this.name + ':', - truncate(JSON.stringify(this.actual, replacer), 128), - this.operator, - truncate(JSON.stringify(this.expected, replacer), 128) - ].join(' '); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -function ok(value, message) { - if (!!!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = objectKeys(a), - kb = objectKeys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (expected instanceof RegExp) { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail('Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail('Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -})() -},{"util":11,"buffer":13}],11:[function(require,module,exports){ -var events = require('events'); - -exports.isArray = isArray; -exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'}; -exports.isRegExp = function(obj){return Object.prototype.toString.call(obj) === '[object RegExp]'}; - - -exports.print = function () {}; -exports.puts = function () {}; -exports.debug = function() {}; - -exports.inspect = function(obj, showHidden, depth, colors) { - var seen = []; - - var stylize = function(str, styleType) { - // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - var styles = - { 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] }; - - var style = - { 'special': 'cyan', - 'number': 'blue', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' }[styleType]; - - if (style) { - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; - } else { - return str; - } - }; - if (! colors) { - stylize = function(str, styleType) { return str; }; - } - - function format(value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value !== exports && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return value.inspect(recurseTimes); - } - - // Primitive types cannot have properties - switch (typeof value) { - case 'undefined': - return stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return stylize(simple, 'string'); - - case 'number': - return stylize('' + value, 'number'); - - case 'boolean': - return stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return stylize('null', 'null'); - } - - // Look up the keys of the object. - var visible_keys = Object_keys(value); - var keys = showHidden ? Object_getOwnPropertyNames(value) : visible_keys; - - // Functions without properties can be shortcutted. - if (typeof value === 'function' && keys.length === 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - var name = value.name ? ': ' + value.name : ''; - return stylize('[Function' + name + ']', 'special'); - } - } - - // Dates without properties can be shortcutted - if (isDate(value) && keys.length === 0) { - return stylize(value.toUTCString(), 'date'); - } - - var base, type, braces; - // Determine the object type - if (isArray(value)) { - type = 'Array'; - braces = ['[', ']']; - } else { - type = 'Object'; - braces = ['{', '}']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; - } else { - base = ''; - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + value.toUTCString(); - } - - if (keys.length === 0) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - return stylize('[Object]', 'special'); - } - } - - seen.push(value); - - var output = keys.map(function(key) { - var name, str; - if (value.__lookupGetter__) { - if (value.__lookupGetter__(key)) { - if (value.__lookupSetter__(key)) { - str = stylize('[Getter/Setter]', 'special'); - } else { - str = stylize('[Getter]', 'special'); - } - } else { - if (value.__lookupSetter__(key)) { - str = stylize('[Setter]', 'special'); - } - } - } - if (visible_keys.indexOf(key) < 0) { - name = '[' + key + ']'; - } - if (!str) { - if (seen.indexOf(value[key]) < 0) { - if (recurseTimes === null) { - str = format(value[key]); - } else { - str = format(value[key], recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (isArray(value)) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (type === 'Array' && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = stylize(name, 'string'); - } - } - - return name + ': ' + str; - }); - - seen.pop(); - - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.length + 1; - }, 0); - - if (length > 50) { - output = braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - - } else { - output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - return output; - } - return format(obj, (typeof depth === 'undefined' ? 2 : depth)); -}; - - -function isArray(ar) { - return ar instanceof Array || - Array.isArray(ar) || - (ar && ar !== Object.prototype && isArray(ar.__proto__)); -} - - -function isRegExp(re) { - return re instanceof RegExp || - (typeof re === 'object' && Object.prototype.toString.call(re) === '[object RegExp]'); -} - - -function isDate(d) { - if (d instanceof Date) return true; - if (typeof d !== 'object') return false; - var properties = Date.prototype && Object_getOwnPropertyNames(Date.prototype); - var proto = d.__proto__ && Object_getOwnPropertyNames(d.__proto__); - return JSON.stringify(proto) === JSON.stringify(properties); -} - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - -exports.log = function (msg) {}; - -exports.pump = null; - -var Object_keys = Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; -}; - -var Object_getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) { - var res = []; - for (var key in obj) { - if (Object.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; - -var Object_create = Object.create || function (prototype, properties) { - // from es5-shim - var object; - if (prototype === null) { - object = { '__proto__' : null }; - } - else { - if (typeof prototype !== 'object') { - throw new TypeError( - 'typeof prototype[' + (typeof prototype) + '] != \'object\'' - ); - } - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (typeof properties !== 'undefined' && Object.defineProperties) { - Object.defineProperties(object, properties); - } - return object; -}; - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object_create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (typeof f !== 'string') { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(exports.inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': return JSON.stringify(args[i++]); - default: - return x; - } - }); - for(var x = args[i]; i < len; x = args[++i]){ - if (x === null || typeof x !== 'object') { - str += ' ' + x; - } else { - str += ' ' + exports.inspect(x); - } - } - return str; -}; - -},{"events":2}],10:[function(require,module,exports){ -(function(){// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); - -})() -},{}],14:[function(require,module,exports){ -exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) { - var e, m, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - nBits = -7, - i = isBE ? 0 : (nBytes - 1), - d = isBE ? 1 : -1, - s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity); - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); -}; - -exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) { - var e, m, c, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), - i = isBE ? (nBytes - 1) : 0, - d = isBE ? -1 : 1, - s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); - - buffer[offset + i - d] |= s * 128; -}; - -},{}],13:[function(require,module,exports){ -(function(){function SlowBuffer (size) { - this.length = size; -}; - -var assert = require('assert'); - -exports.INSPECT_MAX_BYTES = 50; - - -function toHex(n) { - if (n < 16) return '0' + n.toString(16); - return n.toString(16); -} - -function utf8ToBytes(str) { - var byteArray = []; - for (var i = 0; i < str.length; i++) - if (str.charCodeAt(i) <= 0x7F) - byteArray.push(str.charCodeAt(i)); - else { - var h = encodeURIComponent(str.charAt(i)).substr(1).split('%'); - for (var j = 0; j < h.length; j++) - byteArray.push(parseInt(h[j], 16)); - } - - return byteArray; -} - -function asciiToBytes(str) { - var byteArray = [] - for (var i = 0; i < str.length; i++ ) - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push( str.charCodeAt(i) & 0xFF ); - - return byteArray; -} - -function base64ToBytes(str) { - return require("base64-js").toByteArray(str); -} - -SlowBuffer.byteLength = function (str, encoding) { - switch (encoding || "utf8") { - case 'hex': - return str.length / 2; - - case 'utf8': - case 'utf-8': - return utf8ToBytes(str).length; - - case 'ascii': - case 'binary': - return str.length; - - case 'base64': - return base64ToBytes(str).length; - - default: - throw new Error('Unknown encoding'); - } -}; - -function blitBuffer(src, dst, offset, length) { - var pos, i = 0; - while (i < length) { - if ((i+offset >= dst.length) || (i >= src.length)) - break; - - dst[i + offset] = src[i]; - i++; - } - return i; -} - -SlowBuffer.prototype.utf8Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(utf8ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.asciiWrite = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(asciiToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.binaryWrite = SlowBuffer.prototype.asciiWrite; - -SlowBuffer.prototype.base64Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.base64Slice = function (start, end) { - var bytes = Array.prototype.slice.apply(this, arguments) - return require("base64-js").fromByteArray(bytes); -} - -function decodeUtf8Char(str) { - try { - return decodeURIComponent(str); - } catch (err) { - return String.fromCharCode(0xFFFD); // UTF 8 invalid char - } -} - -SlowBuffer.prototype.utf8Slice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var res = ""; - var tmp = ""; - var i = 0; - while (i < bytes.length) { - if (bytes[i] <= 0x7F) { - res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]); - tmp = ""; - } else - tmp += "%" + bytes[i].toString(16); - - i++; - } - - return res + decodeUtf8Char(tmp); -} - -SlowBuffer.prototype.asciiSlice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var ret = ""; - for (var i = 0; i < bytes.length; i++) - ret += String.fromCharCode(bytes[i]); - return ret; -} - -SlowBuffer.prototype.binarySlice = SlowBuffer.prototype.asciiSlice; - -SlowBuffer.prototype.inspect = function() { - var out = [], - len = this.length; - for (var i = 0; i < len; i++) { - out[i] = toHex(this[i]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - return ''; -}; - - -SlowBuffer.prototype.hexSlice = function(start, end) { - var len = this.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; i++) { - out += toHex(this[i]); - } - return out; -}; - - -SlowBuffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - start = +start || 0; - if (typeof end == 'undefined') end = this.length; - - // Fastpath empty strings - if (+end == start) { - return ''; - } - - switch (encoding) { - case 'hex': - return this.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.utf8Slice(start, end); - - case 'ascii': - return this.asciiSlice(start, end); - - case 'binary': - return this.binarySlice(start, end); - - case 'base64': - return this.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -SlowBuffer.prototype.hexWrite = function(string, offset, length) { - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2) { - throw new Error('Invalid hex string'); - } - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; i++) { - var byte = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(byte)) throw new Error('Invalid hex string'); - this[offset + i] = byte; - } - SlowBuffer._charsWritten = i * 2; - return i; -}; - - -SlowBuffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - switch (encoding) { - case 'hex': - return this.hexWrite(string, offset, length); - - case 'utf8': - case 'utf-8': - return this.utf8Write(string, offset, length); - - case 'ascii': - return this.asciiWrite(string, offset, length); - - case 'binary': - return this.binaryWrite(string, offset, length); - - case 'base64': - return this.base64Write(string, offset, length); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Write(string, offset, length); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// slice(start, end) -SlowBuffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - - if (end > this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - return new Buffer(this, end - start, +start); -}; - -SlowBuffer.prototype.copy = function(target, targetstart, sourcestart, sourceend) { - var temp = []; - for (var i=sourcestart; i this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - for (var i = start; i < end; i++) { - this[i] = value; - } -} - -function coerce(length) { - // Coerce length to a number (possibly NaN), round up - // in case it's fractional (e.g. 123.456) then do a - // double negate to coerce a NaN to 0. Easy, right? - length = ~~Math.ceil(+length); - return length < 0 ? 0 : length; -} - - -// Buffer - -function Buffer(subject, encoding, offset) { - if (!(this instanceof Buffer)) { - return new Buffer(subject, encoding, offset); - } - - var type; - - // Are we slicing? - if (typeof offset === 'number') { - this.length = coerce(encoding); - this.parent = subject; - this.offset = offset; - } else { - // Find the length - switch (type = typeof subject) { - case 'number': - this.length = coerce(subject); - break; - - case 'string': - this.length = Buffer.byteLength(subject, encoding); - break; - - case 'object': // Assume object is an array - this.length = coerce(subject.length); - break; - - default: - throw new Error('First argument needs to be a number, ' + - 'array or string.'); - } - - if (this.length > Buffer.poolSize) { - // Big buffer, just alloc one. - this.parent = new SlowBuffer(this.length); - this.offset = 0; - - } else { - // Small buffer. - if (!pool || pool.length - pool.used < this.length) allocPool(); - this.parent = pool; - this.offset = pool.used; - pool.used += this.length; - } - - // Treat array-ish objects as a byte array. - if (isArrayIsh(subject)) { - for (var i = 0; i < this.length; i++) { - if (subject instanceof Buffer) { - this.parent[i + this.offset] = subject.readUInt8(i); - } - else { - this.parent[i + this.offset] = subject[i]; - } - } - } else if (type == 'string') { - // We are a string - this.length = this.write(subject, 0, encoding); - } - } - -} - -function isArrayIsh(subject) { - return Array.isArray(subject) || Buffer.isBuffer(subject) || - subject && typeof subject === 'object' && - typeof subject.length === 'number'; -} - -exports.SlowBuffer = SlowBuffer; -exports.Buffer = Buffer; - -Buffer.poolSize = 8 * 1024; -var pool; - -function allocPool() { - pool = new SlowBuffer(Buffer.poolSize); - pool.used = 0; -} - - -// Static methods -Buffer.isBuffer = function isBuffer(b) { - return b instanceof Buffer || b instanceof SlowBuffer; -}; - -Buffer.concat = function (list, totalLength) { - if (!Array.isArray(list)) { - throw new Error("Usage: Buffer.concat(list, [totalLength])\n \ - list should be an Array."); - } - - if (list.length === 0) { - return new Buffer(0); - } else if (list.length === 1) { - return list[0]; - } - - if (typeof totalLength !== 'number') { - totalLength = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - totalLength += buf.length; - } - } - - var buffer = new Buffer(totalLength); - var pos = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer; -}; - -// Inspect -Buffer.prototype.inspect = function inspect() { - var out = [], - len = this.length; - - for (var i = 0; i < len; i++) { - out[i] = toHex(this.parent[i + this.offset]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - - return ''; -}; - - -Buffer.prototype.get = function get(i) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i]; -}; - - -Buffer.prototype.set = function set(i, v) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i] = v; -}; - - -// write(string, offset = 0, length = buffer.length-offset, encoding = 'utf8') -Buffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - var ret; - switch (encoding) { - case 'hex': - ret = this.parent.hexWrite(string, this.offset + offset, length); - break; - - case 'utf8': - case 'utf-8': - ret = this.parent.utf8Write(string, this.offset + offset, length); - break; - - case 'ascii': - ret = this.parent.asciiWrite(string, this.offset + offset, length); - break; - - case 'binary': - ret = this.parent.binaryWrite(string, this.offset + offset, length); - break; - - case 'base64': - // Warning: maxLength not taken into account in base64Write - ret = this.parent.base64Write(string, this.offset + offset, length); - break; - - case 'ucs2': - case 'ucs-2': - ret = this.parent.ucs2Write(string, this.offset + offset, length); - break; - - default: - throw new Error('Unknown encoding'); - } - - Buffer._charsWritten = SlowBuffer._charsWritten; - - return ret; -}; - - -// toString(encoding, start=0, end=buffer.length) -Buffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - - if (typeof start == 'undefined' || start < 0) { - start = 0; - } else if (start > this.length) { - start = this.length; - } - - if (typeof end == 'undefined' || end > this.length) { - end = this.length; - } else if (end < 0) { - end = 0; - } - - start = start + this.offset; - end = end + this.offset; - - switch (encoding) { - case 'hex': - return this.parent.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.parent.utf8Slice(start, end); - - case 'ascii': - return this.parent.asciiSlice(start, end); - - case 'binary': - return this.parent.binarySlice(start, end); - - case 'base64': - return this.parent.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.parent.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// byteLength -Buffer.byteLength = SlowBuffer.byteLength; - - -// fill(value, start=0, end=buffer.length) -Buffer.prototype.fill = function fill(value, start, end) { - value || (value = 0); - start || (start = 0); - end || (end = this.length); - - if (typeof value === 'string') { - value = value.charCodeAt(0); - } - if (!(typeof value === 'number') || isNaN(value)) { - throw new Error('value is not a number'); - } - - if (end < start) throw new Error('end < start'); - - // Fill 0 bytes; we're done - if (end === start) return 0; - if (this.length == 0) return 0; - - if (start < 0 || start >= this.length) { - throw new Error('start out of bounds'); - } - - if (end < 0 || end > this.length) { - throw new Error('end out of bounds'); - } - - return this.parent.fill(value, - start + this.offset, - end + this.offset); -}; - - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function(target, target_start, start, end) { - var source = this; - start || (start = 0); - end || (end = this.length); - target_start || (target_start = 0); - - if (end < start) throw new Error('sourceEnd < sourceStart'); - - // Copy 0 bytes; we're done - if (end === start) return 0; - if (target.length == 0 || source.length == 0) return 0; - - if (target_start < 0 || target_start >= target.length) { - throw new Error('targetStart out of bounds'); - } - - if (start < 0 || start >= source.length) { - throw new Error('sourceStart out of bounds'); - } - - if (end < 0 || end > source.length) { - throw new Error('sourceEnd out of bounds'); - } - - // Are we oob? - if (end > this.length) { - end = this.length; - } - - if (target.length - target_start < end - start) { - end = target.length - target_start + start; - } - - return this.parent.copy(target.parent, - target_start + target.offset, - start + this.offset, - end + this.offset); -}; - - -// slice(start, end) -Buffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - if (end > this.length) throw new Error('oob'); - if (start > end) throw new Error('oob'); - - return new Buffer(this.parent, end - start, +start + this.offset); -}; - - -// Legacy methods for backwards compatibility. - -Buffer.prototype.utf8Slice = function(start, end) { - return this.toString('utf8', start, end); -}; - -Buffer.prototype.binarySlice = function(start, end) { - return this.toString('binary', start, end); -}; - -Buffer.prototype.asciiSlice = function(start, end) { - return this.toString('ascii', start, end); -}; - -Buffer.prototype.utf8Write = function(string, offset) { - return this.write(string, offset, 'utf8'); -}; - -Buffer.prototype.binaryWrite = function(string, offset) { - return this.write(string, offset, 'binary'); -}; - -Buffer.prototype.asciiWrite = function(string, offset) { - return this.write(string, offset, 'ascii'); -}; - -Buffer.prototype.readUInt8 = function(offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - return buffer.parent[buffer.offset + offset]; -}; - -function readUInt16(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - val = buffer.parent[buffer.offset + offset] << 8; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1]; - } - } else { - val = buffer.parent[buffer.offset + offset]; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1] << 8; - } - } - - return val; -} - -Buffer.prototype.readUInt16LE = function(offset, noAssert) { - return readUInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt16BE = function(offset, noAssert) { - return readUInt16(this, offset, true, noAssert); -}; - -function readUInt32(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - if (offset + 1 < buffer.length) - val = buffer.parent[buffer.offset + offset + 1] << 16; - if (offset + 2 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 2] << 8; - if (offset + 3 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 3]; - val = val + (buffer.parent[buffer.offset + offset] << 24 >>> 0); - } else { - if (offset + 2 < buffer.length) - val = buffer.parent[buffer.offset + offset + 2] << 16; - if (offset + 1 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 1] << 8; - val |= buffer.parent[buffer.offset + offset]; - if (offset + 3 < buffer.length) - val = val + (buffer.parent[buffer.offset + offset + 3] << 24 >>> 0); - } - - return val; -} - -Buffer.prototype.readUInt32LE = function(offset, noAssert) { - return readUInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt32BE = function(offset, noAssert) { - return readUInt32(this, offset, true, noAssert); -}; - - -/* - * Signed integer types, yay team! A reminder on how two's complement actually - * works. The first bit is the signed bit, i.e. tells us whether or not the - * number should be positive or negative. If the two's complement value is - * positive, then we're done, as it's equivalent to the unsigned representation. - * - * Now if the number is positive, you're pretty much done, you can just leverage - * the unsigned translations and return those. Unfortunately, negative numbers - * aren't quite that straightforward. - * - * At first glance, one might be inclined to use the traditional formula to - * translate binary numbers between the positive and negative values in two's - * complement. (Though it doesn't quite work for the most negative value) - * Mainly: - * - invert all the bits - * - add one to the result - * - * Of course, this doesn't quite work in Javascript. Take for example the value - * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of - * course, Javascript will do the following: - * - * > ~0xff80 - * -65409 - * - * Whoh there, Javascript, that's not quite right. But wait, according to - * Javascript that's perfectly correct. When Javascript ends up seeing the - * constant 0xff80, it has no notion that it is actually a signed number. It - * assumes that we've input the unsigned value 0xff80. Thus, when it does the - * binary negation, it casts it into a signed value, (positive 0xff80). Then - * when you perform binary negation on that, it turns it into a negative number. - * - * Instead, we're going to have to use the following general formula, that works - * in a rather Javascript friendly way. I'm glad we don't support this kind of - * weird numbering scheme in the kernel. - * - * (BIT-MAX - (unsigned)val + 1) * -1 - * - * The astute observer, may think that this doesn't make sense for 8-bit numbers - * (really it isn't necessary for them). However, when you get 16-bit numbers, - * you do. Let's go back to our prior example and see how this will look: - * - * (0xffff - 0xff80 + 1) * -1 - * (0x007f + 1) * -1 - * (0x0080) * -1 - */ -Buffer.prototype.readInt8 = function(offset, noAssert) { - var buffer = this; - var neg; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - neg = buffer.parent[buffer.offset + offset] & 0x80; - if (!neg) { - return (buffer.parent[buffer.offset + offset]); - } - - return ((0xff - buffer.parent[buffer.offset + offset] + 1) * -1); -}; - -function readInt16(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt16(buffer, offset, isBigEndian, noAssert); - neg = val & 0x8000; - if (!neg) { - return val; - } - - return (0xffff - val + 1) * -1; -} - -Buffer.prototype.readInt16LE = function(offset, noAssert) { - return readInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt16BE = function(offset, noAssert) { - return readInt16(this, offset, true, noAssert); -}; - -function readInt32(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt32(buffer, offset, isBigEndian, noAssert); - neg = val & 0x80000000; - if (!neg) { - return (val); - } - - return (0xffffffff - val + 1) * -1; -} - -Buffer.prototype.readInt32LE = function(offset, noAssert) { - return readInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt32BE = function(offset, noAssert) { - return readInt32(this, offset, true, noAssert); -}; - -function readFloat(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.readFloatLE = function(offset, noAssert) { - return readFloat(this, offset, false, noAssert); -}; - -Buffer.prototype.readFloatBE = function(offset, noAssert) { - return readFloat(this, offset, true, noAssert); -}; - -function readDouble(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.readDoubleLE = function(offset, noAssert) { - return readDouble(this, offset, false, noAssert); -}; - -Buffer.prototype.readDoubleBE = function(offset, noAssert) { - return readDouble(this, offset, true, noAssert); -}; - - -/* - * We have to make sure that the value is a valid integer. This means that it is - * non-negative. It has no fractional component and that it does not exceed the - * maximum allowed value. - * - * value The number to check for validity - * - * max The maximum value - */ -function verifuint(value, max) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value >= 0, - 'specified a negative value for writing an unsigned value'); - - assert.ok(value <= max, 'value is larger than maximum value for type'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xff); - } - - if (offset < buffer.length) { - buffer.parent[buffer.offset + offset] = value; - } -}; - -function writeUInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) { - buffer.parent[buffer.offset + offset + i] = - (value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>> - (isBigEndian ? 1 - i : i) * 8; - } - -} - -Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, true, noAssert); -}; - -function writeUInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffffffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) { - buffer.parent[buffer.offset + offset + i] = - (value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff; - } -} - -Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, true, noAssert); -}; - - -/* - * We now move onto our friends in the signed number category. Unlike unsigned - * numbers, we're going to have to worry a bit more about how we put values into - * arrays. Since we are only worrying about signed 32-bit values, we're in - * slightly better shape. Unfortunately, we really can't do our favorite binary - * & in this system. It really seems to do the wrong thing. For example: - * - * > -32 & 0xff - * 224 - * - * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of - * this aren't treated as a signed number. Ultimately a bad thing. - * - * What we're going to want to do is basically create the unsigned equivalent of - * our representation and pass that off to the wuint* functions. To do that - * we're going to do the following: - * - * - if the value is positive - * we can pass it directly off to the equivalent wuint - * - if the value is negative - * we do the following computation: - * mb + val + 1, where - * mb is the maximum unsigned value in that byte size - * val is the Javascript negative integer - * - * - * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If - * you do out the computations: - * - * 0xffff - 128 + 1 - * 0xffff - 127 - * 0xff80 - * - * You can then encode this value as the signed version. This is really rather - * hacky, but it should work and get the job done which is our goal here. - */ - -/* - * A series of checks to make sure we actually have a signed 32-bit number - */ -function verifsint(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -function verifIEEE754(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); -} - -Buffer.prototype.writeInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7f, -0x80); - } - - if (value >= 0) { - buffer.writeUInt8(value, offset, noAssert); - } else { - buffer.writeUInt8(0xff + value + 1, offset, noAssert); - } -}; - -function writeInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fff, -0x8000); - } - - if (value >= 0) { - writeUInt16(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { - writeInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { - writeInt16(this, value, offset, true, noAssert); -}; - -function writeInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fffffff, -0x80000000); - } - - if (value >= 0) { - writeUInt32(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { - writeInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { - writeInt32(this, value, offset, true, noAssert); -}; - -function writeFloat(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.writeFloatLE = function(value, offset, noAssert) { - writeFloat(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeFloatBE = function(value, offset, noAssert) { - writeFloat(this, value, offset, true, noAssert); -}; - -function writeDouble(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) { - writeDouble(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) { - writeDouble(this, value, offset, true, noAssert); -}; - -SlowBuffer.prototype.readUInt8 = Buffer.prototype.readUInt8; -SlowBuffer.prototype.readUInt16LE = Buffer.prototype.readUInt16LE; -SlowBuffer.prototype.readUInt16BE = Buffer.prototype.readUInt16BE; -SlowBuffer.prototype.readUInt32LE = Buffer.prototype.readUInt32LE; -SlowBuffer.prototype.readUInt32BE = Buffer.prototype.readUInt32BE; -SlowBuffer.prototype.readInt8 = Buffer.prototype.readInt8; -SlowBuffer.prototype.readInt16LE = Buffer.prototype.readInt16LE; -SlowBuffer.prototype.readInt16BE = Buffer.prototype.readInt16BE; -SlowBuffer.prototype.readInt32LE = Buffer.prototype.readInt32LE; -SlowBuffer.prototype.readInt32BE = Buffer.prototype.readInt32BE; -SlowBuffer.prototype.readFloatLE = Buffer.prototype.readFloatLE; -SlowBuffer.prototype.readFloatBE = Buffer.prototype.readFloatBE; -SlowBuffer.prototype.readDoubleLE = Buffer.prototype.readDoubleLE; -SlowBuffer.prototype.readDoubleBE = Buffer.prototype.readDoubleBE; -SlowBuffer.prototype.writeUInt8 = Buffer.prototype.writeUInt8; -SlowBuffer.prototype.writeUInt16LE = Buffer.prototype.writeUInt16LE; -SlowBuffer.prototype.writeUInt16BE = Buffer.prototype.writeUInt16BE; -SlowBuffer.prototype.writeUInt32LE = Buffer.prototype.writeUInt32LE; -SlowBuffer.prototype.writeUInt32BE = Buffer.prototype.writeUInt32BE; -SlowBuffer.prototype.writeInt8 = Buffer.prototype.writeInt8; -SlowBuffer.prototype.writeInt16LE = Buffer.prototype.writeInt16LE; -SlowBuffer.prototype.writeInt16BE = Buffer.prototype.writeInt16BE; -SlowBuffer.prototype.writeInt32LE = Buffer.prototype.writeInt32LE; -SlowBuffer.prototype.writeInt32BE = Buffer.prototype.writeInt32BE; -SlowBuffer.prototype.writeFloatLE = Buffer.prototype.writeFloatLE; -SlowBuffer.prototype.writeFloatBE = Buffer.prototype.writeFloatBE; -SlowBuffer.prototype.writeDoubleLE = Buffer.prototype.writeDoubleLE; -SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE; - -})() -},{"assert":12,"./buffer_ieee754":14,"base64-js":15}],15:[function(require,module,exports){ -(function (exports) { - 'use strict'; - - var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - - function b64ToByteArray(b64) { - var i, j, l, tmp, placeHolders, arr; - - if (b64.length % 4 > 0) { - throw 'Invalid string. Length must be a multiple of 4'; - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64.indexOf('='); - placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? b64.length - 4 : b64.length; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]); - arr.push((tmp & 0xFF0000) >> 16); - arr.push((tmp & 0xFF00) >> 8); - arr.push(tmp & 0xFF); - } - - if (placeHolders === 2) { - tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4); - arr.push(tmp & 0xFF); - } else if (placeHolders === 1) { - tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2); - arr.push((tmp >> 8) & 0xFF); - arr.push(tmp & 0xFF); - } - - return arr; - } - - function uint8ToBase64(uint8) { - var i, - extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes - output = "", - temp, length; - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; - }; - - // go through the array every three bytes, we'll deal with trailing stuff later - for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { - temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output += tripletToBase64(temp); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - switch (extraBytes) { - case 1: - temp = uint8[uint8.length - 1]; - output += lookup[temp >> 2]; - output += lookup[(temp << 4) & 0x3F]; - output += '=='; - break; - case 2: - temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]); - output += lookup[temp >> 10]; - output += lookup[(temp >> 4) & 0x3F]; - output += lookup[(temp << 2) & 0x3F]; - output += '='; - break; - } - - return output; - } - - module.exports.toByteArray = b64ToByteArray; - module.exports.fromByteArray = uint8ToBase64; -}()); - -},{}]},{},["B01lSJ"]) -; -JSHINT = require('jshint').JSHINT; -}()); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/dist/jshint-rhino-1.0.0.js b/deploy/core/node_modules/jshint/dist/jshint-rhino-1.0.0.js deleted file mode 100755 index 8e88d158f..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-rhino-1.0.0.js +++ /dev/null @@ -1,327 +0,0 @@ -#!/usr/bin/env rhino - -// 1.0.0 -var JSHINT; -(function(){var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var cached = require.cache[resolved]; - var res = cached? cached.exports : mod(); - return res; -}; - -require.paths = []; -require.modules = {}; -require.cache = {}; -require.extensions = [".js",".coffee",".json"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - x = path.normalize(x); - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = path.normalize(x + '/package.json'); - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -(function () { - var process = {}; - var global = typeof window !== 'undefined' ? window : {}; - var definedProcess = false; - - require.define = function (filename, fn) { - if (!definedProcess && require.modules.__browserify_process) { - process = require.modules.__browserify_process(); - definedProcess = true; - } - - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - var requiredModule = require(file, dirname); - var cached = require.cache[require.resolve(file, dirname)]; - - if (cached && cached.parent === null) { - cached.parent = module_; - } - - return requiredModule; - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - require_.cache = require.cache; - var module_ = { - id : filename, - filename: filename, - exports : {}, - loaded : false, - parent: null - }; - - require.modules[filename] = function () { - require.cache[filename] = module_; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename, - process, - global - ); - module_.loaded = true; - return module_.exports; - }; - }; -})(); - - -require.define("path",Function(['require','module','exports','__dirname','__filename','process','global'],"function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path" -)); - -require.define("__browserify_process",Function(['require','module','exports','__dirname','__filename','process','global'],"var process = module.exports = {};\n\nprocess.nextTick = (function () {\n var canSetImmediate = typeof window !== 'undefined'\n && window.setImmediate;\n var canPost = typeof window !== 'undefined'\n && window.postMessage && window.addEventListener\n ;\n\n if (canSetImmediate) {\n return window.setImmediate;\n }\n\n if (canPost) {\n var queue = [];\n window.addEventListener('message', function (ev) {\n if (ev.source === window && ev.data === 'browserify-tick') {\n ev.stopPropagation();\n if (queue.length > 0) {\n var fn = queue.shift();\n fn();\n }\n }\n }, true);\n\n return function nextTick(fn) {\n queue.push(fn);\n window.postMessage('browserify-tick', '*');\n };\n }\n\n return function nextTick(fn) {\n setTimeout(fn, 0);\n };\n})();\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\n\nprocess.binding = function (name) {\n if (name === 'evals') return (require)('vm')\n else throw new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n process.cwd = function () { return cwd };\n process.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\n//@ sourceURL=__browserify_process" -)); - -require.define("/node_modules/underscore/package.json",Function(['require','module','exports','__dirname','__filename','process','global'],"module.exports = {\"main\":\"underscore.js\"}\n//@ sourceURL=/node_modules/underscore/package.json" -)); - -require.define("/node_modules/underscore/underscore.js",Function(['require','module','exports','__dirname','__filename','process','global'],"// Underscore.js 1.4.4\n// http://underscorejs.org\n// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` in the browser, or `global` on the server.\n var root = this;\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Establish the object that gets returned to break out of a loop iteration.\n var breaker = {};\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n concat = ArrayProto.concat,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var\n nativeForEach = ArrayProto.forEach,\n nativeMap = ArrayProto.map,\n nativeReduce = ArrayProto.reduce,\n nativeReduceRight = ArrayProto.reduceRight,\n nativeFilter = ArrayProto.filter,\n nativeEvery = ArrayProto.every,\n nativeSome = ArrayProto.some,\n nativeIndexOf = ArrayProto.indexOf,\n nativeLastIndexOf = ArrayProto.lastIndexOf,\n nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeBind = FuncProto.bind;\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for the old `require()` API. If we're in\n // the browser, add `_` as a global object via a string identifier,\n // for Closure Compiler \"advanced\" mode.\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root._ = _;\n }\n\n // Current version.\n _.VERSION = '1.4.4';\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles objects with the built-in `forEach`, arrays, and raw objects.\n // Delegates to **ECMAScript 5**'s native `forEach` if available.\n var each = _.each = _.forEach = function(obj, iterator, context) {\n if (obj == null) return;\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n for (var key in obj) {\n if (_.has(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) return;\n }\n }\n }\n };\n\n // Return the results of applying the iterator to each element.\n // Delegates to **ECMAScript 5**'s native `map` if available.\n _.map = _.collect = function(obj, iterator, context) {\n var results = [];\n if (obj == null) return results;\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n var reduceError = 'Reduce of empty array with no initial value';\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.\n _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (obj == null) obj = [];\n if (nativeReduce && obj.reduce === nativeReduce) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);\n }\n each(obj, function(value, index, list) {\n if (!initial) {\n memo = value;\n initial = true;\n } else {\n memo = iterator.call(context, memo, value, index, list);\n }\n });\n if (!initial) throw new TypeError(reduceError);\n return memo;\n };\n\n // The right-associative version of reduce, also known as `foldr`.\n // Delegates to **ECMAScript 5**'s native `reduceRight` if available.\n _.reduceRight = _.foldr = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (obj == null) obj = [];\n if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);\n }\n var length = obj.length;\n if (length !== +length) {\n var keys = _.keys(obj);\n length = keys.length;\n }\n each(obj, function(value, index, list) {\n index = keys ? keys[--length] : --length;\n if (!initial) {\n memo = obj[index];\n initial = true;\n } else {\n memo = iterator.call(context, memo, obj[index], index, list);\n }\n });\n if (!initial) throw new TypeError(reduceError);\n return memo;\n };\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, iterator, context) {\n var result;\n any(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) {\n result = value;\n return true;\n }\n });\n return result;\n };\n\n // Return all the elements that pass a truth test.\n // Delegates to **ECMAScript 5**'s native `filter` if available.\n // Aliased as `select`.\n _.filter = _.select = function(obj, iterator, context) {\n var results = [];\n if (obj == null) return results;\n if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);\n each(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) results[results.length] = value;\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, iterator, context) {\n return _.filter(obj, function(value, index, list) {\n return !iterator.call(context, value, index, list);\n }, context);\n };\n\n // Determine whether all of the elements match a truth test.\n // Delegates to **ECMAScript 5**'s native `every` if available.\n // Aliased as `all`.\n _.every = _.all = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = true;\n if (obj == null) return result;\n if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);\n each(obj, function(value, index, list) {\n if (!(result = result && iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Delegates to **ECMAScript 5**'s native `some` if available.\n // Aliased as `any`.\n var any = _.some = _.any = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = false;\n if (obj == null) return result;\n if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);\n each(obj, function(value, index, list) {\n if (result || (result = iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if the array or object contains a given value (using `===`).\n // Aliased as `include`.\n _.contains = _.include = function(obj, target) {\n if (obj == null) return false;\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;\n return any(obj, function(value) {\n return value === target;\n });\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = function(obj, method) {\n var args = slice.call(arguments, 2);\n var isFunc = _.isFunction(method);\n return _.map(obj, function(value) {\n return (isFunc ? method : value[method]).apply(value, args);\n });\n };\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, function(value){ return value[key]; });\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // containing specific `key:value` pairs.\n _.where = function(obj, attrs, first) {\n if (_.isEmpty(attrs)) return first ? null : [];\n return _[first ? 'find' : 'filter'](obj, function(value) {\n for (var key in attrs) {\n if (attrs[key] !== value[key]) return false;\n }\n return true;\n });\n };\n\n // Convenience version of a common use case of `find`: getting the first object\n // containing specific `key:value` pairs.\n _.findWhere = function(obj, attrs) {\n return _.where(obj, attrs, true);\n };\n\n // Return the maximum element or (element-based computation).\n // Can't optimize arrays of integers longer than 65,535 elements.\n // See: https://bugs.webkit.org/show_bug.cgi?id=80797\n _.max = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.max.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return -Infinity;\n var result = {computed : -Infinity, value: -Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed >= result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.min.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return Infinity;\n var result = {computed : Infinity, value: Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed < result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Shuffle an array.\n _.shuffle = function(obj) {\n var rand;\n var index = 0;\n var shuffled = [];\n each(obj, function(value) {\n rand = _.random(index++);\n shuffled[index - 1] = shuffled[rand];\n shuffled[rand] = value;\n });\n return shuffled;\n };\n\n // An internal function to generate lookup iterators.\n var lookupIterator = function(value) {\n return _.isFunction(value) ? value : function(obj){ return obj[value]; };\n };\n\n // Sort the object's values by a criterion produced by an iterator.\n _.sortBy = function(obj, value, context) {\n var iterator = lookupIterator(value);\n return _.pluck(_.map(obj, function(value, index, list) {\n return {\n value : value,\n index : index,\n criteria : iterator.call(context, value, index, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index < right.index ? -1 : 1;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(obj, value, context, behavior) {\n var result = {};\n var iterator = lookupIterator(value || _.identity);\n each(obj, function(value, index) {\n var key = iterator.call(context, value, index, obj);\n behavior(result, key, value);\n });\n return result;\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key, value) {\n (_.has(result, key) ? result[key] : (result[key] = [])).push(value);\n });\n };\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key) {\n if (!_.has(result, key)) result[key] = 0;\n result[key]++;\n });\n };\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iterator, context) {\n iterator = iterator == null ? _.identity : lookupIterator(iterator);\n var value = iterator.call(context, obj);\n var low = 0, high = array.length;\n while (low < high) {\n var mid = (low + high) >>> 1;\n iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;\n }\n return low;\n };\n\n // Safely convert anything iterable into a real, live array.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (_.isArray(obj)) return slice.call(obj);\n if (obj.length === +obj.length) return _.map(obj, _.identity);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n if (obj == null) return 0;\n return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;\n };\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n if (array == null) return void 0;\n return (n != null) && !guard ? slice.call(array, 0, n) : array[0];\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N. The **guard** check allows it to work with\n // `_.map`.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array. The **guard** check allows it to work with `_.map`.\n _.last = function(array, n, guard) {\n if (array == null) return void 0;\n if ((n != null) && !guard) {\n return slice.call(array, Math.max(array.length - n, 0));\n } else {\n return array[array.length - 1];\n }\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array. The **guard**\n // check allows it to work with `_.map`.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, (n == null) || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, _.identity);\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, output) {\n each(input, function(value) {\n if (_.isArray(value)) {\n shallow ? push.apply(output, value) : flatten(value, shallow, output);\n } else {\n output.push(value);\n }\n });\n return output;\n };\n\n // Return a completely flattened version of an array.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, []);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = function(array) {\n return _.difference(array, slice.call(arguments, 1));\n };\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iterator, context) {\n if (_.isFunction(isSorted)) {\n context = iterator;\n iterator = isSorted;\n isSorted = false;\n }\n var initial = iterator ? _.map(array, iterator, context) : array;\n var results = [];\n var seen = [];\n each(initial, function(value, index) {\n if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {\n seen.push(value);\n results.push(array[index]);\n }\n });\n return results;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = function() {\n return _.uniq(concat.apply(ArrayProto, arguments));\n };\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var rest = slice.call(arguments, 1);\n return _.filter(_.uniq(array), function(item) {\n return _.every(rest, function(other) {\n return _.indexOf(other, item) >= 0;\n });\n });\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = function(array) {\n var rest = concat.apply(ArrayProto, slice.call(arguments, 1));\n return _.filter(array, function(value){ return !_.contains(rest, value); });\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = function() {\n var args = slice.call(arguments);\n var length = _.max(_.pluck(args, 'length'));\n var results = new Array(length);\n for (var i = 0; i < length; i++) {\n results[i] = _.pluck(args, \"\" + i);\n }\n return results;\n };\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values.\n _.object = function(list, values) {\n if (list == null) return {};\n var result = {};\n for (var i = 0, l = list.length; i < l; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),\n // we need this function. Return the position of the first occurrence of an\n // item in an array, or -1 if the item is not included in the array.\n // Delegates to **ECMAScript 5**'s native `indexOf` if available.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = function(array, item, isSorted) {\n if (array == null) return -1;\n var i = 0, l = array.length;\n if (isSorted) {\n if (typeof isSorted == 'number') {\n i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);\n } else {\n i = _.sortedIndex(array, item);\n return array[i] === item ? i : -1;\n }\n }\n if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);\n for (; i < l; i++) if (array[i] === item) return i;\n return -1;\n };\n\n // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.\n _.lastIndexOf = function(array, item, from) {\n if (array == null) return -1;\n var hasIndex = from != null;\n if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {\n return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);\n }\n var i = (hasIndex ? from : array.length);\n while (i--) if (array[i] === item) return i;\n return -1;\n };\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (arguments.length <= 1) {\n stop = start || 0;\n start = 0;\n }\n step = arguments[2] || 1;\n\n var len = Math.max(Math.ceil((stop - start) / step), 0);\n var idx = 0;\n var range = new Array(len);\n\n while(idx < len) {\n range[idx++] = start;\n start += step;\n }\n\n return range;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n // available.\n _.bind = function(func, context) {\n if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n var args = slice.call(arguments, 2);\n return function() {\n return func.apply(context, args.concat(slice.call(arguments)));\n };\n };\n\n // Partially apply a function by creating a version that has had some of its\n // arguments pre-filled, without changing its dynamic `this` context.\n _.partial = function(func) {\n var args = slice.call(arguments, 1);\n return function() {\n return func.apply(this, args.concat(slice.call(arguments)));\n };\n };\n\n // Bind all of an object's methods to that object. Useful for ensuring that\n // all callbacks defined on an object belong to it.\n _.bindAll = function(obj) {\n var funcs = slice.call(arguments, 1);\n if (funcs.length === 0) funcs = _.functions(obj);\n each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });\n return obj;\n };\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memo = {};\n hasher || (hasher = _.identity);\n return function() {\n var key = hasher.apply(this, arguments);\n return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));\n };\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = function(func, wait) {\n var args = slice.call(arguments, 2);\n return setTimeout(function(){ return func.apply(null, args); }, wait);\n };\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = function(func) {\n return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));\n };\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time.\n _.throttle = function(func, wait) {\n var context, args, timeout, result;\n var previous = 0;\n var later = function() {\n previous = new Date;\n timeout = null;\n result = func.apply(context, args);\n };\n return function() {\n var now = new Date;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0) {\n clearTimeout(timeout);\n timeout = null;\n previous = now;\n result = func.apply(context, args);\n } else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, result;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(context, args);\n return result;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = function(func) {\n var ran = false, memo;\n return function() {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return function() {\n var args = [func];\n push.apply(args, arguments);\n return wrapper.apply(this, args);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var funcs = arguments;\n return function() {\n var args = arguments;\n for (var i = funcs.length - 1; i >= 0; i--) {\n args = [funcs[i].apply(this, args)];\n }\n return args[0];\n };\n };\n\n // Returns a function that will only be executed after being called N times.\n _.after = function(times, func) {\n if (times <= 0) return func();\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Object Functions\n // ----------------\n\n // Retrieve the names of an object's properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`\n _.keys = nativeKeys || function(obj) {\n if (obj !== Object(obj)) throw new TypeError('Invalid object');\n var keys = [];\n for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var values = [];\n for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);\n return values;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n _.pairs = function(obj) {\n var pairs = [];\n for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n if (source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n each(keys, function(key) {\n if (key in obj) copy[key] = obj[key];\n });\n return copy;\n };\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n for (var key in obj) {\n if (!_.contains(keys, key)) copy[key] = obj[key];\n }\n return copy;\n };\n\n // Fill in a given object with default properties.\n _.defaults = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n if (source) {\n for (var prop in source) {\n if (obj[prop] == null) obj[prop] = source[prop];\n }\n }\n });\n return obj;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Internal recursive comparison function for `isEqual`.\n var eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.\n if (a === b) return a !== 0 || 1 / a == 1 / b;\n // A strict comparison is necessary because `null == undefined`.\n if (a == null || b == null) return a === b;\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className != toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, dates, and booleans are compared by value.\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return a == String(b);\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for\n // other numeric values.\n return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a == +b;\n // RegExps are compared by their source patterns and flags.\n case '[object RegExp]':\n return a.source == b.source &&\n a.global == b.global &&\n a.multiline == b.multiline &&\n a.ignoreCase == b.ignoreCase;\n }\n if (typeof a != 'object' || typeof b != 'object') return false;\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] == a) return bStack[length] == b;\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n var size = 0, result = true;\n // Recursively compare objects and arrays.\n if (className == '[object Array]') {\n // Compare array lengths to determine if a deep comparison is necessary.\n size = a.length;\n result = size == b.length;\n if (result) {\n // Deep compare the contents, ignoring non-numeric properties.\n while (size--) {\n if (!(result = eq(a[size], b[size], aStack, bStack))) break;\n }\n }\n } else {\n // Objects with different constructors are not equivalent, but `Object`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&\n _.isFunction(bCtor) && (bCtor instanceof bCtor))) {\n return false;\n }\n // Deep compare objects.\n for (var key in a) {\n if (_.has(a, key)) {\n // Count the expected number of properties.\n size++;\n // Deep compare each member.\n if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;\n }\n }\n // Ensure that both objects contain the same number of properties.\n if (result) {\n for (key in b) {\n if (_.has(b, key) && !(size--)) break;\n }\n result = !size;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return result;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b, [], []);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;\n for (var key in obj) if (_.has(obj, key)) return false;\n return true;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) == '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n return obj === Object(obj);\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.\n each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) == '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return !!(obj && _.has(obj, 'callee'));\n };\n }\n\n // Optimize `isFunction` if appropriate.\n if (typeof (/./) !== 'function') {\n _.isFunction = function(obj) {\n return typeof obj === 'function';\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return isFinite(obj) && !isNaN(parseFloat(obj));\n };\n\n // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n _.isNaN = function(obj) {\n return _.isNumber(obj) && obj != +obj;\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) == '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, key) {\n return hasOwnProperty.call(obj, key);\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iterators.\n _.identity = function(value) {\n return value;\n };\n\n // Run a function **n** times.\n _.times = function(n, iterator, context) {\n var accum = Array(n);\n for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);\n return accum;\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n };\n\n // List of HTML entities for escaping.\n var entityMap = {\n escape: {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n }\n };\n entityMap.unescape = _.invert(entityMap.escape);\n\n // Regexes containing the keys and values listed immediately above.\n var entityRegexes = {\n escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),\n unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')\n };\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n _.each(['escape', 'unescape'], function(method) {\n _[method] = function(string) {\n if (string == null) return '';\n return ('' + string).replace(entityRegexes[method], function(match) {\n return entityMap[method][match];\n });\n };\n });\n\n // If the value of the named property is a function then invoke it;\n // otherwise, return it.\n _.result = function(object, property) {\n if (object == null) return null;\n var value = object[property];\n return _.isFunction(value) ? value.call(object) : value;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n each(_.functions(obj), function(name){\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return result.call(this, func.apply(_, args));\n };\n });\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate : /<%([\\s\\S]+?)%>/g,\n interpolate : /<%=([\\s\\S]+?)%>/g,\n escape : /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\t': 't',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escaper = /\\\\|'|\\r|\\n|\\t|\\u2028|\\u2029/g;\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n _.template = function(text, data, settings) {\n var render;\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = new RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset)\n .replace(escaper, function(match) { return '\\\\' + escapes[match]; });\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n }\n if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n }\n if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n index = offset + match.length;\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + \"return __p;\\n\";\n\n try {\n render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n if (data) return render(data, _);\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled function source as a convenience for precompilation.\n template.source = 'function(' + (settings.variable || 'obj') + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function, which will delegate to the wrapper.\n _.chain = function(obj) {\n return _(obj).chain();\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var result = function(obj) {\n return this._chain ? _(obj).chain() : obj;\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];\n return result.call(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return result.call(this, method.apply(this._wrapped, arguments));\n };\n });\n\n _.extend(_.prototype, {\n\n // Start chaining a wrapped Underscore object.\n chain: function() {\n this._chain = true;\n return this;\n },\n\n // Extracts the result from a wrapped and chained object.\n value: function() {\n return this._wrapped;\n }\n\n });\n\n}).call(this);\n\n//@ sourceURL=/node_modules/underscore/underscore.js" -)); - -require.define("events",Function(['require','module','exports','__dirname','__filename','process','global'],"if (!process.EventEmitter) process.EventEmitter = function () {};\n\nvar EventEmitter = exports.EventEmitter = process.EventEmitter;\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\n\n// By default EventEmitters will print a warning if more than\n// 10 listeners are added to it. This is a useful default which\n// helps finding memory leaks.\n//\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nvar defaultMaxListeners = 10;\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!this._events) this._events = {};\n this._events.maxListeners = n;\n};\n\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n\n // Check for listener leak\n if (!this._events[type].warned) {\n var m;\n if (this._events.maxListeners !== undefined) {\n m = this._events.maxListeners;\n } else {\n m = defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n console.trace();\n }\n }\n\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = list.indexOf(listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n\n//@ sourceURL=events" -)); - -require.define("/src/shared/vars.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\n// Identifiers provided by the ECMAScript standard.\n\nexports.reservedVars = {\n\targuments : false,\n\tNaN : false\n};\n\nexports.ecmaIdentifiers = {\n\tArray : false,\n\tBoolean : false,\n\tDate : false,\n\tdecodeURI : false,\n\tdecodeURIComponent : false,\n\tencodeURI : false,\n\tencodeURIComponent : false,\n\tError : false,\n\t\"eval\" : false,\n\tEvalError : false,\n\tFunction : false,\n\thasOwnProperty : false,\n\tisFinite : false,\n\tisNaN : false,\n\tJSON : false,\n\tMath : false,\n\tMap : false,\n\tNumber : false,\n\tObject : false,\n\tparseInt : false,\n\tparseFloat : false,\n\tRangeError : false,\n\tReferenceError : false,\n\tRegExp : false,\n\tSet : false,\n\tString : false,\n\tSyntaxError : false,\n\tTypeError : false,\n\tURIError : false,\n\tWeakMap : false\n};\n\n// Global variables commonly provided by a web browser environment.\n\nexports.browser = {\n\tArrayBuffer : false,\n\tArrayBufferView : false,\n\tAudio : false,\n\tBlob : false,\n\taddEventListener : false,\n\tapplicationCache : false,\n\tatob : false,\n\tblur : false,\n\tbtoa : false,\n\tclearInterval : false,\n\tclearTimeout : false,\n\tclose : false,\n\tclosed : false,\n\tDataView : false,\n\tDOMParser : false,\n\tdefaultStatus : false,\n\tdocument : false,\n\tElement : false,\n\tevent : false,\n\tFileReader : false,\n\tFloat32Array : false,\n\tFloat64Array : false,\n\tFormData : false,\n\tfocus : false,\n\tframes : false,\n\tgetComputedStyle : false,\n\tHTMLElement : false,\n\tHTMLAnchorElement : false,\n\tHTMLBaseElement : false,\n\tHTMLBlockquoteElement: false,\n\tHTMLBodyElement : false,\n\tHTMLBRElement : false,\n\tHTMLButtonElement : false,\n\tHTMLCanvasElement : false,\n\tHTMLDirectoryElement : false,\n\tHTMLDivElement : false,\n\tHTMLDListElement : false,\n\tHTMLFieldSetElement : false,\n\tHTMLFontElement : false,\n\tHTMLFormElement : false,\n\tHTMLFrameElement : false,\n\tHTMLFrameSetElement : false,\n\tHTMLHeadElement : false,\n\tHTMLHeadingElement : false,\n\tHTMLHRElement : false,\n\tHTMLHtmlElement : false,\n\tHTMLIFrameElement : false,\n\tHTMLImageElement : false,\n\tHTMLInputElement : false,\n\tHTMLIsIndexElement : false,\n\tHTMLLabelElement : false,\n\tHTMLLayerElement : false,\n\tHTMLLegendElement : false,\n\tHTMLLIElement : false,\n\tHTMLLinkElement : false,\n\tHTMLMapElement : false,\n\tHTMLMenuElement : false,\n\tHTMLMetaElement : false,\n\tHTMLModElement : false,\n\tHTMLObjectElement : false,\n\tHTMLOListElement : false,\n\tHTMLOptGroupElement : false,\n\tHTMLOptionElement : false,\n\tHTMLParagraphElement : false,\n\tHTMLParamElement : false,\n\tHTMLPreElement : false,\n\tHTMLQuoteElement : false,\n\tHTMLScriptElement : false,\n\tHTMLSelectElement : false,\n\tHTMLStyleElement : false,\n\tHTMLTableCaptionElement: false,\n\tHTMLTableCellElement : false,\n\tHTMLTableColElement : false,\n\tHTMLTableElement : false,\n\tHTMLTableRowElement : false,\n\tHTMLTableSectionElement: false,\n\tHTMLTextAreaElement : false,\n\tHTMLTitleElement : false,\n\tHTMLUListElement : false,\n\tHTMLVideoElement : false,\n\thistory : false,\n\tInt16Array : false,\n\tInt32Array : false,\n\tInt8Array : false,\n\tImage : false,\n\tlength : false,\n\tlocalStorage : false,\n\tlocation : false,\n\tMessageChannel : false,\n\tMessageEvent : false,\n\tMessagePort : false,\n\tmoveBy : false,\n\tmoveTo : false,\n\tMutationObserver : false,\n\tname : false,\n\tNode : false,\n\tNodeFilter : false,\n\tnavigator : false,\n\tonbeforeunload : true,\n\tonblur : true,\n\tonerror : true,\n\tonfocus : true,\n\tonload : true,\n\tonresize : true,\n\tonunload : true,\n\topen : false,\n\topenDatabase : false,\n\topener : false,\n\tOption : false,\n\tparent : false,\n\tprint : false,\n\tremoveEventListener : false,\n\tresizeBy : false,\n\tresizeTo : false,\n\tscreen : false,\n\tscroll : false,\n\tscrollBy : false,\n\tscrollTo : false,\n\tsessionStorage : false,\n\tsetInterval : false,\n\tsetTimeout : false,\n\tSharedWorker : false,\n\tstatus : false,\n\ttop : false,\n\tUint16Array : false,\n\tUint32Array : false,\n\tUint8Array : false,\n\tUint8ClampedArray : false,\n\tWebSocket : false,\n\twindow : false,\n\tWorker : false,\n\tXMLHttpRequest : false,\n\tXMLSerializer : false,\n\tXPathEvaluator : false,\n\tXPathException : false,\n\tXPathExpression : false,\n\tXPathNamespace : false,\n\tXPathNSResolver : false,\n\tXPathResult : false\n};\n\nexports.devel = {\n\talert : false,\n\tconfirm: false,\n\tconsole: false,\n\tDebug : false,\n\topera : false,\n\tprompt : false\n};\n\nexports.worker = {\n\timportScripts: true,\n\tpostMessage : true,\n\tself : true\n};\n\n// Widely adopted global names that are not part of ECMAScript standard\nexports.nonstandard = {\n\tescape : false,\n\tunescape: false\n};\n\n// Globals provided by popular JavaScript environments.\n\nexports.couch = {\n\t\"require\" : false,\n\trespond : false,\n\tgetRow : false,\n\temit : false,\n\tsend : false,\n\tstart : false,\n\tsum : false,\n\tlog : false,\n\texports : false,\n\tmodule : false,\n\tprovides : false\n};\n\nexports.node = {\n\t__filename : false,\n\t__dirname : false,\n\tBuffer : false,\n\tDataView : false,\n\tconsole : false,\n\texports : true, // In Node it is ok to exports = module.exports = foo();\n\tGLOBAL : false,\n\tglobal : false,\n\tmodule : false,\n\tprocess : false,\n\trequire : false,\n\tsetTimeout : false,\n\tclearTimeout : false,\n\tsetInterval : false,\n\tclearInterval: false\n};\n\nexports.phantom = {\n\tphantom : true,\n\trequire : true,\n\tWebPage : true\n};\n\nexports.rhino = {\n\tdefineClass : false,\n\tdeserialize : false,\n\tgc : false,\n\thelp : false,\n\timportPackage: false,\n\t\"java\" : false,\n\tload : false,\n\tloadClass : false,\n\tprint : false,\n\tquit : false,\n\treadFile : false,\n\treadUrl : false,\n\trunCommand : false,\n\tseal : false,\n\tserialize : false,\n\tspawn : false,\n\tsync : false,\n\ttoint32 : false,\n\tversion : false\n};\n\nexports.wsh = {\n\tActiveXObject : true,\n\tEnumerator : true,\n\tGetObject : true,\n\tScriptEngine : true,\n\tScriptEngineBuildVersion : true,\n\tScriptEngineMajorVersion : true,\n\tScriptEngineMinorVersion : true,\n\tVBArray : true,\n\tWSH : true,\n\tWScript : true,\n\tXDomainRequest : true\n};\n\n// Globals provided by popular JavaScript libraries.\n\nexports.dojo = {\n\tdojo : false,\n\tdijit : false,\n\tdojox : false,\n\tdefine\t : false,\n\t\"require\": false\n};\n\nexports.jquery = {\n\t\"$\" : false,\n\tjQuery : false\n};\n\nexports.mootools = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\tAsset : false,\n\tBrowser : false,\n\tChain : false,\n\tClass : false,\n\tColor : false,\n\tCookie : false,\n\tCore : false,\n\tDocument : false,\n\tDomReady : false,\n\tDOMEvent : false,\n\tDOMReady : false,\n\tDrag : false,\n\tElement : false,\n\tElements : false,\n\tEvent : false,\n\tEvents : false,\n\tFx : false,\n\tGroup : false,\n\tHash : false,\n\tHtmlTable : false,\n\tIframe : false,\n\tIframeShim : false,\n\tInputValidator: false,\n\tinstanceOf : false,\n\tKeyboard : false,\n\tLocale : false,\n\tMask : false,\n\tMooTools : false,\n\tNative : false,\n\tOptions : false,\n\tOverText : false,\n\tRequest : false,\n\tScroller : false,\n\tSlick : false,\n\tSlider : false,\n\tSortables : false,\n\tSpinner : false,\n\tSwiff : false,\n\tTips : false,\n\tType : false,\n\ttypeOf : false,\n\tURI : false,\n\tWindow : false\n};\n\nexports.prototypejs = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\t\"$A\" : false,\n\t\"$F\" : false,\n\t\"$H\" : false,\n\t\"$R\" : false,\n\t\"$break\" : false,\n\t\"$continue\" : false,\n\t\"$w\" : false,\n\tAbstract : false,\n\tAjax : false,\n\tClass : false,\n\tEnumerable : false,\n\tElement : false,\n\tEvent : false,\n\tField : false,\n\tForm : false,\n\tHash : false,\n\tInsertion : false,\n\tObjectRange : false,\n\tPeriodicalExecuter: false,\n\tPosition : false,\n\tPrototype : false,\n\tSelector : false,\n\tTemplate : false,\n\tToggle : false,\n\tTry : false,\n\tAutocompleter : false,\n\tBuilder : false,\n\tControl : false,\n\tDraggable : false,\n\tDraggables : false,\n\tDroppables : false,\n\tEffect : false,\n\tSortable : false,\n\tSortableObserver : false,\n\tSound : false,\n\tScriptaculous : false\n};\n\nexports.yui = {\n\tYUI : false,\n\tY : false,\n\tYUI_config: false\n};\n\n\n//@ sourceURL=/src/shared/vars.js" -)); - -require.define("/src/shared/messages.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar _ = require(\"underscore\");\n\nvar errors = {\n\t// JSHint options\n\tE001: \"Bad option: '{a}'.\",\n\tE002: \"Bad option value.\",\n\n\t// JSHint input\n\tE003: \"Expected a JSON value.\",\n\tE004: \"Input is neither a string nor an array of strings.\",\n\tE005: \"Input is empty.\",\n\tE006: \"Unexpected early end of program.\",\n\n\t// Strict mode\n\tE007: \"Missing \\\"use strict\\\" statement.\",\n\tE008: \"Strict violation.\",\n\tE009: \"Option 'validthis' can't be used in a global scope.\",\n\tE010: \"'with' is not allowed in strict mode.\",\n\n\t// Constants\n\tE011: \"const '{a}' has already been declared.\",\n\tE012: \"const '{a}' is initialized to 'undefined'.\",\n\tE013: \"Attempting to override '{a}' which is a constant.\",\n\n\t// Regular expressions\n\tE014: \"A regular expression literal can be confused with '/='.\",\n\tE015: \"Unclosed regular expression.\",\n\tE016: \"Invalid regular expression.\",\n\n\t// Tokens\n\tE017: \"Unclosed comment.\",\n\tE018: \"Unbegun comment.\",\n\tE019: \"Unmatched '{a}'.\",\n\tE020: \"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.\",\n\tE021: \"Expected '{a}' and instead saw '{b}'.\",\n\tE022: \"Line breaking error '{a}'.\",\n\tE023: \"Missing '{a}'.\",\n\tE024: \"Unexpected '{a}'.\",\n\tE025: \"Missing ':' on a case clause.\",\n\tE026: \"Missing '}' to match '{' from line {a}.\",\n\tE027: \"Missing ']' to match '[' form line {a}.\",\n\tE028: \"Illegal comma.\",\n\tE029: \"Unclosed string.\",\n\n\t// Everything else\n\tE030: \"Expected an identifier and instead saw '{a}'.\",\n\tE031: \"Bad assignment.\", // FIXME: Rephrase\n\tE032: \"Expected a small integer and instead saw '{a}'.\",\n\tE033: \"Expected an operator and instead saw '{a}'.\",\n\tE034: \"get/set are ES5 features.\",\n\tE035: \"Missing property name.\",\n\tE036: \"Expected to see a statement and instead saw a block.\",\n\tE037: \"Constant {a} was not declared correctly.\",\n\tE038: \"Variable {a} was not declared correctly.\",\n\tE039: \"Function declarations are not invocable. Wrap the whole function invocation in parens.\",\n\tE040: \"Each value should have its own case label.\",\n\tE041: \"Unrecoverable syntax error.\",\n\tE042: \"Stopping.\",\n\tE043: \"Too many errors.\"\n};\n\nvar warnings = {\n\tW001: \"'hasOwnProperty' is a really bad name.\",\n\tW002: \"Value of '{a}' may be overwritten in IE.\",\n\tW003: \"'{a}' was used before it was defined.\",\n\tW004: \"'{a}' is already defined.\",\n\tW005: \"A dot following a number can be confused with a decimal point.\",\n\tW006: \"Confusing minuses.\",\n\tW007: \"Confusing pluses.\",\n\tW008: \"A leading decimal point can be confused with a dot: '{a}'.\",\n\tW009: \"The array literal notation [] is preferrable.\",\n\tW010: \"The object literal notation {} is preferrable.\",\n\tW011: \"Unexpected space after '{a}'.\",\n\tW012: \"Unexpected space before '{a}'.\",\n\tW013: \"Missing space after '{a}'.\",\n\tW014: \"Bad line breaking before '{a}'.\",\n\tW015: \"Expected '{a}' to have an indentation at {b} instead at {c}.\",\n\tW016: \"Unexpected use of '{a}'.\",\n\tW017: \"Bad operand.\",\n\tW018: \"Confusing use of '{a}'.\",\n\tW019: \"Use the isNaN function to compare with NaN.\",\n\tW020: \"Read only.\",\n\tW021: \"'{a}' is a function.\",\n\tW022: \"Do not assign to the exception parameter.\",\n\tW023: \"Expected an identifier in an assignment and instead saw a function invocation.\",\n\tW024: \"Expected an identifier and instead saw '{a}' (a reserved word).\",\n\tW025: \"Missing name in function declaration.\",\n\tW026: \"Inner functions should be listed at the top of the outer function.\",\n\tW027: \"Unreachable '{a}' after '{b}'.\",\n\tW028: \"Label '{a}' on {b} statement.\",\n\tW029: \"Label '{a}' looks like a javascript url.\",\n\tW030: \"Expected an assignment or function call and instead saw an expression.\",\n\tW031: \"Do not use 'new' for side effects.\",\n\tW032: \"Unnecessary semicolon.\",\n\tW033: \"Missing semicolon.\",\n\tW034: \"Unnecessary directive \\\"{a}\\\".\",\n\tW035: \"Empty block.\",\n\tW036: \"Unexpected /*member '{a}'.\",\n\tW037: \"'{a}' is a statement label.\",\n\tW038: \"'{a}' used out of scope.\",\n\tW039: \"'{a}' is not allowed.\",\n\tW040: \"Possible strict violation.\",\n\tW041: \"Use '{a}' to compare with '{b}'.\",\n\tW042: \"Avoid EOL escaping.\",\n\tW043: \"Bad escaping of EOL. Use option multistr if needed.\",\n\tW044: \"Bad escaping.\",\n\tW045: \"Bad number '{a}'.\",\n\tW046: \"Don't use extra leading zeros '{a}'.\",\n\tW047: \"A trailing decimal point can be confused with a dot: '{a}'.\",\n\tW048: \"Unexpected control character in regular expression.\",\n\tW049: \"Unexpected escaped character '{a}' in regular expression.\",\n\tW050: \"JavaScript URL.\",\n\tW051: \"Variables should not be deleted.\",\n\tW052: \"Unexpected '{a}'.\",\n\tW053: \"Do not use {a} as a constructor.\",\n\tW054: \"The Function constructor is a form of eval.\",\n\tW055: \"A constructor name should start with an uppercase letter.\",\n\tW056: \"Bad constructor.\",\n\tW057: \"Weird construction. Is 'new' unnecessary?\",\n\tW058: \"Missing '()' invoking a constructor.\",\n\tW059: \"Avoid arguments.{a}.\",\n\tW060: \"document.write can be a form of eval.\",\n\tW061: \"eval can be harmful.\",\n\tW062: \"Wrap an immediate function invocation in parens \" +\n\t\t\"to assist the reader in understanding that the expression \" +\n\t\t\"is the result of a function, and not the function itself.\",\n\tW063: \"Math is not a function.\",\n\tW064: \"Missing 'new' prefix when invoking a constructor.\",\n\tW065: \"Missing radix parameter.\",\n\tW066: \"Implied eval. Consider passing a function instead of a string.\",\n\tW067: \"Bad invocation.\",\n\tW068: \"Wrapping non-IIFE function literals in parens is unnecessary.\",\n\tW069: \"['{a}'] is better written in dot notation.\",\n\tW070: \"Extra comma. (it breaks older versions of IE)\",\n\tW071: \"This function has too many statements. ({a})\",\n\tW072: \"This function has too many parameters. ({a})\",\n\tW073: \"Blocks are nested too deeply. ({a})\",\n\tW074: \"This function's cyclomatic complexity is too high. ({a})\",\n\tW075: \"Duplicate key '{a}'.\",\n\tW076: \"Unexpected parameter '{a}' in get {b} function.\",\n\tW077: \"Expected a single parameter in set {a} function.\",\n\tW078: \"Setter is defined without getter.\",\n\tW079: \"Redefinition of '{a}'.\",\n\tW080: \"It's not necessary to initialize '{a}' to 'undefined'.\",\n\tW081: \"Too many var statements.\",\n\tW082: \"Function declarations should not be placed in blocks. \" +\n\t\t\"Use a function expression or move the statement to the top of \" +\n\t\t\"the outer function.\",\n\tW083: \"Don't make functions within a loop.\",\n\tW084: \"Expected a conditional expression and instead saw an assignment.\",\n\tW085: \"Don't use 'with'.\",\n\tW086: \"Expected a 'break' statement before '{a}'.\",\n\tW087: \"Forgotten 'debugger' statement?\",\n\tW088: \"Creating global 'for' variable. Should be 'for (var {a} ...'.\",\n\tW089: \"The body of a for in should be wrapped in an if statement to filter \" +\n\t\t\"unwanted properties from the prototype.\",\n\tW090: \"'{a}' is not a statement label.\",\n\tW091: \"'{a}' is out of scope.\",\n\tW092: \"Wrap the /regexp/ literal in parens to disambiguate the slash operator.\",\n\tW093: \"Did you mean to return a conditional instead of an assignment?\",\n\tW094: \"Unexpected comma.\",\n\tW095: \"Expected a string and instead saw {a}.\",\n\tW096: \"The '{a}' key may produce unexpected results.\",\n\tW097: \"Use the function form of \\\"use strict\\\".\",\n\tW098: \"'{a}' is defined but never used.\",\n\tW099: \"Mixed spaces and tabs.\",\n\tW100: \"This character may get silently deleted by one or more browsers.\",\n\tW101: \"Line is too long.\",\n\tW102: \"Trailing whitespace.\",\n\tW103: \"The '{a}' property is deprecated.\",\n\tW104: \"'{a}' is only available in JavaScript 1.7.\",\n\tW105: \"Unexpected {a} in '{b}'.\",\n\tW106: \"Identifier '{a}' is not in camel case.\",\n\tW107: \"Script URL.\",\n\tW108: \"Strings must use doublequote.\",\n\tW109: \"Strings must use singlequote.\",\n\tW110: \"Mixed double and single quotes.\",\n\tW112: \"Unclosed string.\",\n\tW113: \"Control character in string: {a}.\",\n\tW114: \"Avoid {a}.\",\n\tW115: \"Octal literals are not allowed in strict mode.\",\n\tW116: \"Expected '{a}' and instead saw '{b}'.\",\n\tW117: \"'{a}' is not defined.\",\n};\n\nvar info = {\n\tI001: \"Comma warnings can be turned off with 'laxcomma'.\"\n};\n\nexports.errors = {};\nexports.warnings = {};\nexports.info = {};\n\n_.each(errors, function (desc, code) {\n\texports.errors[code] = { code: code, desc: desc };\n});\n\n_.each(warnings, function (desc, code) {\n\texports.warnings[code] = { code: code, desc: desc };\n});\n\n_.each(info, function (desc, code) {\n\texports.info[code] = { code: code, desc: desc };\n});\n\n//@ sourceURL=/src/shared/messages.js" -)); - -require.define("/src/stable/lex.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Lexical analysis and token construction.\n */\n\n\"use strict\";\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\n\n// Some of these token types are from JavaScript Parser API\n// while others are specific to JSHint parser.\n// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n\nvar Token = {\n\tIdentifier: 1,\n\tPunctuator: 2,\n\tNumericLiteral: 3,\n\tStringLiteral: 4,\n\tComment: 5,\n\tKeyword: 6,\n\tNullLiteral: 7,\n\tBooleanLiteral: 8,\n\tRegExp: 9\n};\n\n// This is auto generated from the unicode tables.\n// The tables are at:\n// http://www.fileformat.info/info/unicode/category/Lu/list.htm\n// http://www.fileformat.info/info/unicode/category/Ll/list.htm\n// http://www.fileformat.info/info/unicode/category/Lt/list.htm\n// http://www.fileformat.info/info/unicode/category/Lm/list.htm\n// http://www.fileformat.info/info/unicode/category/Lo/list.htm\n// http://www.fileformat.info/info/unicode/category/Nl/list.htm\n\nvar unicodeLetterTable = [\n\t170, 170, 181, 181, 186, 186, 192, 214,\n\t216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750,\n\t880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908,\n\t910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366,\n\t1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610,\n\t1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775,\n\t1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957,\n\t1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069,\n\t2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361,\n\t2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431,\n\t2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482,\n\t2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529,\n\t2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608,\n\t2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654,\n\t2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736,\n\t2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785,\n\t2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867,\n\t2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929,\n\t2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970,\n\t2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001,\n\t3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123,\n\t3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212,\n\t3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261,\n\t3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344,\n\t3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455,\n\t3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526,\n\t3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716,\n\t3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743,\n\t3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760,\n\t3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805,\n\t3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138,\n\t4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198,\n\t4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346,\n\t4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696,\n\t4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789,\n\t4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880,\n\t4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740,\n\t5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900,\n\t5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000,\n\t6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312,\n\t6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516,\n\t6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823,\n\t6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141,\n\t7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409,\n\t7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013,\n\t8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061,\n\t8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140,\n\t8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188,\n\t8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455,\n\t8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486,\n\t8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521,\n\t8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358,\n\t11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621,\n\t11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694,\n\t11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726,\n\t11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295,\n\t12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438,\n\t12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589,\n\t12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312,\n\t19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124,\n\t42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539,\n\t42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783,\n\t42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921,\n\t43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042,\n\t43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259,\n\t43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442,\n\t43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595,\n\t43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697,\n\t43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714,\n\t43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798,\n\t43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032,\n\t55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045,\n\t64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279,\n\t64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316,\n\t64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433,\n\t64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019,\n\t65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370,\n\t65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495,\n\t65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594,\n\t65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786,\n\t65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334,\n\t66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511,\n\t66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592,\n\t67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669,\n\t67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115,\n\t68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405,\n\t68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687,\n\t69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894,\n\t92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964,\n\t119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980,\n\t119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069,\n\t120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121,\n\t120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144,\n\t120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570,\n\t120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686,\n\t120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779,\n\t131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972,\n\t177984, 177984, 178205, 178205, 194560, 195101\n];\n\nvar identifierStartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierStartTable[i] =\n\t\ti === 36 || // $\n\t\ti >= 65 && i <= 90 || // A-Z\n\t\ti === 95 || // _\n\t\ti >= 97 && i <= 122; // a-z\n}\n\nvar identifierPartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierPartTable[i] =\n\t\tidentifierStartTable[i] || // $, _, A-Z, a-z\n\t\ti >= 48 && i <= 57; // 0-9\n}\n\n/*\n * Lexer for JSHint.\n *\n * This object does a char-by-char scan of the provided source code\n * and produces a sequence of tokens.\n *\n * var lex = new Lexer(\"var i = 0;\");\n * lex.start();\n * lex.token(); // returns the next token\n *\n * You have to use the token() method to move the lexer forward\n * but you don't have to use its return value to get tokens. In addition\n * to token() method returning the next token, the Lexer object also\n * emits events.\n *\n * lex.on(\"Identifier\", function (data) {\n * if (data.name.indexOf(\"_\") >= 0) {\n * // Produce a warning.\n * }\n * });\n *\n * Note that the token() method returns tokens in a JSLint-compatible\n * format while the event emitter uses a slightly modified version of\n * Mozilla's JavaScript Parser API. Eventually, we will move away from\n * JSLint format.\n */\nfunction Lexer(source) {\n\tvar lines = source;\n\n\tif (typeof lines === \"string\") {\n\t\tlines = lines\n\t\t\t.replace(/\\r\\n/g, \"\\n\")\n\t\t\t.replace(/\\r/g, \"\\n\")\n\t\t\t.split(\"\\n\");\n\t}\n\n\t// If the first line is a shebang (#!), make it a blank and move on.\n\t// Shebangs are used by Node scripts.\n\n\tif (lines[0] && lines[0].substr(0, 2) === \"#!\") {\n\t\tlines[0] = \"\";\n\t}\n\n\tthis.emitter = new events.EventEmitter();\n\tthis.source = source;\n\tthis.lines = lines;\n\tthis.prereg = true;\n\n\tthis.line = 0;\n\tthis.char = 1;\n\tthis.from = 1;\n\tthis.input = \"\";\n\n\tfor (var i = 0; i < state.option.indent; i += 1) {\n\t\tstate.tab += \" \";\n\t}\n}\n\nLexer.prototype = {\n\t_lines: [],\n\n\tget lines() {\n\t\tthis._lines = state.lines;\n\t\treturn this._lines;\n\t},\n\n\tset lines(val) {\n\t\tthis._lines = val;\n\t\tstate.lines = this._lines;\n\t},\n\n\t/*\n\t * Return the next i character without actually moving the\n\t * char pointer.\n\t */\n\tpeek: function (i) {\n\t\treturn this.input.charAt(i || 0);\n\t},\n\n\t/*\n\t * Move the char pointer forward i times.\n\t */\n\tskip: function (i) {\n\t\ti = i || 1;\n\t\tthis.char += i;\n\t\tthis.input = this.input.slice(i);\n\t},\n\n\t/*\n\t * Subscribe to a token event. The API for this method is similar\n\t * Underscore.js i.e. you can subscribe to multiple events with\n\t * one call:\n\t *\n\t * lex.on(\"Identifier Number\", function (data) {\n\t * // ...\n\t * });\n\t */\n\ton: function (names, listener) {\n\t\tnames.split(\" \").forEach(function (name) {\n\t\t\tthis.emitter.on(name, listener);\n\t\t}.bind(this));\n\t},\n\n\t/*\n\t * Trigger a token event. All arguments will be passed to each\n\t * listener.\n\t */\n\ttrigger: function () {\n\t\tthis.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments));\n\t},\n\n\t/*\n\t * Extract a punctuator out of the next sequence of characters\n\t * or return 'null' if its not possible.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanPunctuator function in the Esprima parser's source code.\n\t */\n\tscanPunctuator: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2, ch3, ch4;\n\n\t\tswitch (ch1) {\n\t\t// Most common single-character punctuators\n\t\tcase \".\":\n\t\t\tif ((/^[0-9]$/).test(this.peek(1))) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* falls through */\n\t\tcase \"(\":\n\t\tcase \")\":\n\t\tcase \";\":\n\t\tcase \",\":\n\t\tcase \"{\":\n\t\tcase \"}\":\n\t\tcase \"[\":\n\t\tcase \"]\":\n\t\tcase \":\":\n\t\tcase \"~\":\n\t\tcase \"?\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// A pound sign (for Node shebangs)\n\t\tcase \"#\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// We're at the end of input\n\t\tcase \"\":\n\t\t\treturn null;\n\t\t}\n\n\t\t// Peek more characters\n\n\t\tch2 = this.peek(1);\n\t\tch3 = this.peek(2);\n\t\tch4 = this.peek(3);\n\n\t\t// 4-character punctuator: >>>=\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\" && ch4 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>=\"\n\t\t\t};\n\t\t}\n\n\t\t// 3-character punctuators: === !== >>> <<= >>=\n\n\t\tif (ch1 === \"=\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"===\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"!\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"!==\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"<\" && ch2 === \"<\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\t// 2-character punctuators: <= >= == != ++ -- << >> && ||\n\t\t// += -= *= %= &= |= ^= (but not /=, see below)\n\t\tif (ch1 === ch2 && (\"+-<>&|\".indexOf(ch1) >= 0)) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1 + ch2\n\t\t\t};\n\t\t}\n\n\t\tif (\"<>=!+-*%&|^\".indexOf(ch1) >= 0) {\n\t\t\tif (ch2 === \"=\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: ch1 + ch2\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\t\t}\n\n\t\t// Special case: /=. We need to make sure that this is an\n\t\t// operator and not a regular expression.\n\n\t\tif (ch1 === \"/\") {\n\t\t\tif (ch2 === \"=\" && /\\/=(?!(\\S*\\/[gim]?))/.test(this.input)) {\n\t\t\t\t// /= is not a part of a regular expression, return it as a\n\t\t\t\t// punctuator.\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: \"/=\"\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"/\"\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a comment out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since comments can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * In addition to normal JavaScript comments (// and /*) this method\n\t * also recognizes JSHint- and JSLint-specific comments such as\n\t * /*jshint, /*jslint, /*globals and so on.\n\t */\n\tscanComments: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2 = this.peek(1);\n\t\tvar rest = this.input.substr(2);\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.char;\n\n\t\t// Create a comment token object and make sure it\n\t\t// has all the data JSHint needs to work with special\n\t\t// comments.\n\n\t\tfunction commentToken(label, body, opt) {\n\t\t\tvar special = [\"jshint\", \"jslint\", \"members\", \"member\", \"globals\", \"global\", \"exported\"];\n\t\t\tvar isSpecial = false;\n\t\t\tvar value = label + body;\n\t\t\tvar commentType = \"plain\";\n\t\t\topt = opt || {};\n\n\t\t\tif (opt.isMultiline) {\n\t\t\t\tvalue += \"*/\";\n\t\t\t}\n\n\t\t\tspecial.forEach(function (str) {\n\t\t\t\tif (isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (body.substr(0, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + str;\n\t\t\t\t\tbody = body.substr(str.length);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial && body.charAt(0) === \" \" && body.substr(1, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + \" \" + str;\n\t\t\t\t\tbody = body.substr(str.length + 1);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"member\":\n\t\t\t\t\tcommentType = \"members\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"global\":\n\t\t\t\t\tcommentType = \"globals\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tcommentType = str;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Comment,\n\t\t\t\tcommentType: commentType,\n\t\t\t\tvalue: value,\n\t\t\t\tbody: body,\n\t\t\t\tisSpecial: isSpecial,\n\t\t\t\tisMultiline: opt.isMultiline || false,\n\t\t\t\tisMalformed: opt.isMalformed || false\n\t\t\t};\n\t\t}\n\n\t\t// End of unbegun comment. Raise an error and skip that input.\n\t\tif (ch1 === \"*\" && ch2 === \"/\") {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E018\",\n\t\t\t\tline: startLine,\n\t\t\t\tcharacter: startChar\n\t\t\t});\n\n\t\t\tthis.skip(2);\n\t\t\treturn null;\n\t\t}\n\n\t\t// Comments must start either with // or /*\n\t\tif (ch1 !== \"/\" || (ch2 !== \"*\" && ch2 !== \"/\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// One-line comment\n\t\tif (ch2 === \"/\") {\n\t\t\tthis.skip(this.input.length); // Skip to the EOL.\n\t\t\treturn commentToken(\"//\", rest);\n\t\t}\n\n\t\tvar body = \"\";\n\n\t\t/* Multi-line comment */\n\t\tif (ch2 === \"*\") {\n\t\t\tthis.skip(2);\n\n\t\t\twhile (this.peek() !== \"*\" || this.peek(1) !== \"/\") {\n\t\t\t\tif (this.peek() === \"\") { // End of Line\n\t\t\t\t\tbody += \"\\n\";\n\n\t\t\t\t\t// If we hit EOF and our comment is still unclosed,\n\t\t\t\t\t// trigger an error and end the comment implicitly.\n\t\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\t\tcode: \"E017\",\n\t\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn commentToken(\"/*\", body, {\n\t\t\t\t\t\t\tisMultiline: true,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody += this.peek();\n\t\t\t\t\tthis.skip();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.skip(2);\n\t\t\treturn commentToken(\"/*\", body, { isMultiline: true });\n\t\t}\n\t},\n\n\t/*\n\t * Extract a keyword out of the next sequence of characters or\n\t * return 'null' if its not possible.\n\t */\n\tscanKeyword: function () {\n\t\tvar result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input);\n\t\tvar keywords = [\n\t\t\t\"if\", \"in\", \"do\", \"var\", \"for\", \"new\",\n\t\t\t\"try\", \"let\", \"this\", \"else\", \"case\",\n\t\t\t\"void\", \"with\", \"enum\", \"while\", \"break\",\n\t\t\t\"catch\", \"throw\", \"const\", \"yield\", \"class\",\n\t\t\t\"super\", \"return\", \"typeof\", \"delete\",\n\t\t\t\"switch\", \"export\", \"import\", \"default\",\n\t\t\t\"finally\", \"extends\", \"function\", \"continue\",\n\t\t\t\"debugger\", \"instanceof\"\n\t\t];\n\n\t\tif (result && keywords.indexOf(result[0]) >= 0) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Keyword,\n\t\t\t\tvalue: result[0]\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a JavaScript identifier out of the next sequence of\n\t * characters or return 'null' if its not possible. In addition,\n\t * to Identifier this method can also produce BooleanLiteral\n\t * (true/false) and NullLiteral (null).\n\t */\n\tscanIdentifier: function () {\n\t\tvar id = \"\";\n\t\tvar index = 0;\n\t\tvar type, char;\n\n\t\t// Detects any character in the Unicode categories \"Uppercase\n\t\t// letter (Lu)\", \"Lowercase letter (Ll)\", \"Titlecase letter\n\t\t// (Lt)\", \"Modifier letter (Lm)\", \"Other letter (Lo)\", or\n\t\t// \"Letter number (Nl)\".\n\t\t//\n\t\t// Both approach and unicodeLetterTable were borrowed from\n\t\t// Google's Traceur.\n\n\t\tfunction isUnicodeLetter(code) {\n\t\t\tfor (var i = 0; i < unicodeLetterTable.length;) {\n\t\t\t\tif (code < unicodeLetterTable[i++]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (code <= unicodeLetterTable[i++]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tvar readUnicodeEscapeSequence = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tindex += 1;\n\n\t\t\tif (this.peek(index) !== \"u\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar ch1 = this.peek(index + 1);\n\t\t\tvar ch2 = this.peek(index + 2);\n\t\t\tvar ch3 = this.peek(index + 3);\n\t\t\tvar ch4 = this.peek(index + 4);\n\t\t\tvar code;\n\n\t\t\tif (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {\n\t\t\t\tcode = parseInt(ch1 + ch2 + ch3 + ch4, 16);\n\n\t\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\t\tindex += 5;\n\t\t\t\t\treturn \"\\\\u\" + ch1 + ch2 + ch3 + ch4;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierStart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierStartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierPart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierPartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tchar = getIdentifierStart();\n\t\tif (char === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tid = char;\n\t\tfor (;;) {\n\t\t\tchar = getIdentifierPart();\n\n\t\t\tif (char === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tid += char;\n\t\t}\n\n\t\tswitch (id) {\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\t\ttype = Token.BooleanLiteral;\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\ttype = Token.NullLiteral;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttype = Token.Identifier;\n\t\t}\n\n\t\treturn {\n\t\t\ttype: type,\n\t\t\tvalue: id\n\t\t};\n\t},\n\n\t/*\n\t * Extract a numeric literal out of the next sequence of\n\t * characters or return 'null' if its not possible. This method\n\t * supports all numeric literals described in section 7.8.3\n\t * of the EcmaScript 5 specification.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanNumericLiteral function in the Esprima parser's source code.\n\t */\n\tscanNumericLiteral: function () {\n\t\tvar index = 0;\n\t\tvar value = \"\";\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek(index);\n\t\tvar bad;\n\n\t\tfunction isDecimalDigit(str) {\n\t\t\treturn (/^[0-9]$/).test(str);\n\t\t}\n\n\t\tfunction isOctalDigit(str) {\n\t\t\treturn (/^[0-7]$/).test(str);\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tfunction isIdentifierStart(ch) {\n\t\t\treturn (ch === \"$\") || (ch === \"_\") || (ch === \"\\\\\") ||\n\t\t\t\t(ch >= \"a\" && ch <= \"z\") || (ch >= \"A\" && ch <= \"Z\");\n\t\t}\n\n\t\t// Numbers must start either with a decimal digit or a point.\n\n\t\tif (char !== \".\" && !isDecimalDigit(char)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (char !== \".\") {\n\t\t\tvalue = this.peek(index);\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (value === \"0\") {\n\t\t\t\t// Base-16 numbers.\n\t\t\t\tif (char === \"x\" || char === \"X\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (!isHexDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value.length <= 2) { // 0x\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 16,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Base-8 numbers.\n\t\t\t\tif (isOctalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tbad = false;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\n\t\t\t\t\t\t// Numbers like '019' (note the 9) are not valid octals\n\t\t\t\t\t\t// but we still parse them and mark as malformed.\n\n\t\t\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\t\t\tbad = true;\n\t\t\t\t\t\t} else if (!isOctalDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 8,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Decimal numbers that start with '0' such as '09' are illegal\n\t\t\t\t// but we still parse them and return as malformed.\n\n\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Decimal digits.\n\n\t\tif (char === \".\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Exponent part.\n\n\t\tif (char === \"e\" || char === \"E\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (char === \"+\" || char === \"-\") {\n\t\t\t\tvalue += this.peek(index);\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tchar = this.peek(index);\n\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\n\t\t\t\twhile (index < length) {\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.NumericLiteral,\n\t\t\tvalue: value,\n\t\t\tbase: 10,\n\t\t\tisMalformed: !isFinite(value)\n\t\t};\n\t},\n\n\t/*\n\t * Extract a string out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since strings can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * This method recognizes pseudo-multiline JavaScript strings:\n\t *\n\t * var str = \"hello\\\n\t * world\";\n */\n\tscanStringLiteral: function () {\n\t\tvar quote = this.peek();\n\n\t\t// String must start with a quote.\n\t\tif (quote !== \"\\\"\" && quote !== \"'\") {\n\t\t\treturn null;\n\t\t}\n\n\t\t// In JSON strings must always use double quotes.\n\t\tif (state.jsonMode && quote !== \"\\\"\") {\n\t\t\tthis.trigger(\"warning\", {\n\t\t\t\tcode: \"W108\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char // +1?\n\t\t\t});\n\t\t}\n\n\t\tvar value = \"\";\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.char;\n\t\tvar allowNewLine = false;\n\n\t\tthis.skip();\n\n\t\twhile (this.peek() !== quote) {\n\t\t\twhile (this.peek() === \"\") { // End Of Line\n\n\t\t\t\t// If an EOL is not preceded by a backslash, show a warning\n\t\t\t\t// and proceed like it was a legit multi-line string where\n\t\t\t\t// author simply forgot to escape the newline symbol.\n\t\t\t\t//\n\t\t\t\t// Another approach is to implicitly close a string on EOL\n\t\t\t\t// but it generates too many false positives.\n\n\t\t\t\tif (!allowNewLine) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W112\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tallowNewLine = false;\n\n\t\t\t\t\t// Otherwise show a warning if multistr option was not set.\n\t\t\t\t\t// For JSON, show warning no matter what.\n\n\t\t\t\t\tif (!state.option.multistr) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W043\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W042\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we get an EOF inside of an unclosed string, show an\n\t\t\t\t// error and implicitly close it at the EOF point.\n\n\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E029\",\n\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t});\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.StringLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tisUnclosed: true,\n\t\t\t\t\t\tquote: quote\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tallowNewLine = false;\n\t\t\tvar char = this.peek();\n\t\t\tvar jump = 1; // A length of a jump, after we're done\n\t\t\t // parsing this character.\n\n\t\t\tif (char < \" \") {\n\t\t\t\t// Warn about a control character in a string.\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W113\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ \"\" ]\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Special treatment for some escaped characters.\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tthis.skip();\n\t\t\t\tchar = this.peek();\n\n\t\t\t\tswitch (char) {\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\'\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"b\":\n\t\t\t\t\tchar = \"\\b\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"f\":\n\t\t\t\t\tchar = \"\\f\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"n\":\n\t\t\t\t\tchar = \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"r\":\n\t\t\t\t\tchar = \"\\r\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"t\":\n\t\t\t\t\tchar = \"\\t\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"0\":\n\t\t\t\t\tchar = \"\\0\";\n\n\t\t\t\t\t// Octal literals fail in strict mode.\n\t\t\t\t\t// Check if the number is between 00 and 07.\n\t\t\t\t\tvar n = parseInt(this.peek(), 10);\n\t\t\t\t\tif (n >= 0 && n <= 7 && state.directive[\"use strict\"]) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"u\":\n\t\t\t\t\tchar = String.fromCharCode(parseInt(this.input.substr(1, 4), 16));\n\t\t\t\t\tjump = 5;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"v\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\v\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = \"\\v\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"x\":\n\t\t\t\t\tvar\tx = parseInt(this.input.substr(1, 2), 16);\n\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\x-\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = String.fromCharCode(x);\n\t\t\t\t\tjump = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\\\\\":\n\t\t\t\tcase \"\\\"\":\n\t\t\t\tcase \"/\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\":\n\t\t\t\t\tallowNewLine = true;\n\t\t\t\t\tchar = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"!\":\n\t\t\t\t\tif (value.slice(value.length - 2) === \"<\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t/*falls through */\n\t\t\t\tdefault:\n\t\t\t\t\t// Weird escaping.\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W044\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvalue += char;\n\t\t\tthis.skip(jump);\n\t\t}\n\n\t\tthis.skip();\n\t\treturn {\n\t\t\ttype: Token.StringLiteral,\n\t\t\tvalue: value,\n\t\t\tisUnclosed: false,\n\t\t\tquote: quote\n\t\t};\n\t},\n\n\t/*\n\t * Extract a regular expression out of the next sequence of\n\t * characters and/or lines or return 'null' if its not possible.\n\t *\n\t * This method is platform dependent: it accepts almost any\n\t * regular expression values but then tries to compile and run\n\t * them using system's RegExp object. This means that there are\n\t * rare edge cases where one JavaScript engine complains about\n\t * your regular expression while others don't.\n\t */\n\tscanRegExp: function () {\n\t\tvar index = 0;\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek();\n\t\tvar value = char;\n\t\tvar body = \"\";\n\t\tvar flags = [];\n\t\tvar malformed = false;\n\t\tvar isCharSet = false;\n\t\tvar terminated;\n\n\t\tvar scanUnexpectedChars = function () {\n\t\t\t// Unexpected control character\n\t\t\tif (char < \" \") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W048\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Unexpected escaped character\n\t\t\tif (char === \"<\") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W049\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ char ]\n\t\t\t\t});\n\t\t\t}\n\t\t}.bind(this);\n\n\t\t// Regular expressions must start with '/'\n\t\tif (!this.prereg || char !== \"/\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tindex += 1;\n\t\tterminated = false;\n\n\t\t// Try to get everything in between slashes. A couple of\n\t\t// cases aside (see scanUnexpectedChars) we don't really\n\t\t// care whether the resulting expression is valid or not.\n\t\t// We will check that later using the RegExp object.\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tvalue += char;\n\t\t\tbody += char;\n\n\t\t\tif (isCharSet) {\n\t\t\t\tif (char === \"]\") {\n\t\t\t\t\tif (this.peek(index - 1) !== \"\\\\\" || this.peek(index - 2) === \"\\\\\") {\n\t\t\t\t\t\tisCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (char === \"\\\\\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tbody += char;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\tscanUnexpectedChars();\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tindex += 1;\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tbody += char;\n\t\t\t\tvalue += char;\n\n\t\t\t\tscanUnexpectedChars();\n\n\t\t\t\tif (char === \"/\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (char === \"[\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (char === \"[\") {\n\t\t\t\tisCharSet = true;\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"/\") {\n\t\t\t\tbody = body.substr(0, body.length - 1);\n\t\t\t\tterminated = true;\n\t\t\t\tindex += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// A regular expression that was never closed is an\n\t\t// error from which we cannot recover.\n\n\t\tif (!terminated) {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E015\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.from\n\t\t\t});\n\n\t\t\treturn void this.trigger(\"fatal\", {\n\t\t\t\tline: this.line,\n\t\t\t\tfrom: this.from\n\t\t\t});\n\t\t}\n\n\t\t// Parse flags (if any).\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (!/[gim]/.test(char)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tflags.push(char);\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// Check regular expression for correctness.\n\n\t\ttry {\n\t\t\tnew RegExp(body, flags.join(\"\"));\n\t\t} catch (err) {\n\t\t\tmalformed = true;\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E016\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char,\n\t\t\t\tdata: [ err.message ] // Platform dependent!\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.RegExp,\n\t\t\tvalue: value,\n\t\t\tflags: flags,\n\t\t\tisMalformed: malformed\n\t\t};\n\t},\n\n\t/*\n\t * Scan for any occurence of mixed tabs and spaces. If smarttabs option\n\t * is on, ignore tabs followed by spaces.\n\t *\n\t * Tabs followed by one space followed by a block comment are allowed.\n\t */\n\tscanMixedSpacesAndTabs: function () {\n\t\tvar at, match;\n\n\t\tif (state.option.smarttabs) {\n\t\t\t// Negative look-behind for \"//\"\n\t\t\tmatch = this.input.match(/(\\/\\/)? \\t/);\n\t\t\tat = match && !match[1] ? 0 : -1;\n\t\t} else {\n\t\t\tat = this.input.search(/ \\t|\\t [^\\*]/);\n\t\t}\n\n\t\treturn at;\n\t},\n\n\t/*\n\t * Scan for characters that get silently deleted by one or more browsers.\n\t */\n\tscanUnsafeChars: function () {\n\t\treturn this.input.search(reg.unsafeChars);\n\t},\n\n\t/*\n\t * Produce the next raw token or return 'null' if no tokens can be matched.\n\t * This method skips over all space characters.\n\t */\n\tnext: function () {\n\t\tthis.from = this.char;\n\n\t\t// Move to the next non-space character.\n\t\tvar start;\n\t\tif (/\\s/.test(this.peek())) {\n\t\t\tstart = this.char;\n\n\t\t\twhile (/\\s/.test(this.peek())) {\n\t\t\t\tthis.from += 1;\n\t\t\t\tthis.skip();\n\t\t\t}\n\n\t\t\tif (this.peek() === \"\") { // EOL\n\t\t\t\tif (state.option.trailing) {\n\t\t\t\t\tthis.trigger(\"warning\", { code: \"W102\", line: this.line, character: start });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Methods that work with multi-line structures and move the\n\t\t// character pointer.\n\n\t\tvar match = this.scanComments() ||\n\t\t\tthis.scanStringLiteral();\n\n\t\tif (match) {\n\t\t\treturn match;\n\t\t}\n\n\t\t// Methods that don't move the character pointer.\n\n\t\tmatch =\n\t\t\tthis.scanRegExp() ||\n\t\t\tthis.scanPunctuator() ||\n\t\t\tthis.scanKeyword() ||\n\t\t\tthis.scanIdentifier() ||\n\t\t\tthis.scanNumericLiteral();\n\n\t\tif (match) {\n\t\t\tthis.skip(match.value.length);\n\t\t\treturn match;\n\t\t}\n\n\t\t// No token could be matched, give up.\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Switch to the next line and reset all char pointers. Once\n\t * switched, this method also checks for mixed spaces and tabs\n\t * and other minor warnings.\n\t */\n\tnextLine: function () {\n\t\tvar char;\n\n\t\tif (this.line >= this.lines.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.input = this.lines[this.line];\n\t\tthis.line += 1;\n\t\tthis.char = 1;\n\t\tthis.from = 1;\n\n\t\tchar = this.scanMixedSpacesAndTabs();\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W099\", line: this.line, character: char + 1 });\n\t\t}\n\n\t\tthis.input = this.input.replace(/\\t/g, state.tab);\n\t\tchar = this.scanUnsafeChars();\n\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W100\", line: this.line, character: char });\n\t\t}\n\n\t\t// If there is a limit on line length, warn when lines get too\n\t\t// long.\n\n\t\tif (state.option.maxlen && state.option.maxlen < this.input.length) {\n\t\t\tthis.trigger(\"warning\", { code: \"W101\", line: this.line, character: this.input.length });\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/*\n\t * This is simply a synonym for nextLine() method with a friendlier\n\t * public name.\n\t */\n\tstart: function () {\n\t\tthis.nextLine();\n\t},\n\n\t/*\n\t * Produce the next token. This function is called by advance() to get\n\t * the next token. It retuns a token in a JSLint-compatible format.\n\t */\n\ttoken: function () {\n\t\tvar token;\n\n\t\t// Produce a token object.\n\t\tvar create = function (type, value, isProperty) {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar obj;\n\n\t\t\tif (type !== \"(endline)\" && type !== \"(end)\") {\n\t\t\t\tthis.prereg = false;\n\t\t\t}\n\n\t\t\tif (type === \"(punctuator)\") {\n\t\t\t\tswitch (value) {\n\t\t\t\tcase \".\":\n\t\t\t\tcase \")\":\n\t\t\t\tcase \"~\":\n\t\t\t\tcase \"#\":\n\t\t\t\tcase \"]\":\n\t\t\t\t\tthis.prereg = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t}\n\n\t\t\tif (type === \"(identifier)\") {\n\t\t\t\tif (value === \"return\" || value === \"case\" || value === \"typeof\") {\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tif (_.has(state.syntax, value)) {\n\t\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!obj) {\n\t\t\t\tobj = Object.create(state.syntax[type]);\n\t\t\t}\n\n\t\t\tobj.identifier = (type === \"(identifier)\");\n\t\t\tobj.type = obj.type || type;\n\t\t\tobj.value = value;\n\t\t\tobj.line = this.line;\n\t\t\tobj.character = this.char;\n\t\t\tobj.from = this.from;\n\n\t\t\tif (isProperty && obj.identifier) {\n\t\t\t\tobj.isProperty = isProperty;\n\t\t\t}\n\n\t\t\treturn obj;\n\t\t}.bind(this);\n\n\t\tfor (;;) {\n\t\t\tif (!this.input.length) {\n\t\t\t\treturn create(this.nextLine() ? \"(endline)\" : \"(end)\", \"\");\n\t\t\t}\n\n\t\t\ttoken = this.next();\n\n\t\t\tif (!token) {\n\t\t\t\tif (this.input.length) {\n\t\t\t\t\t// Unexpected character.\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E024\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ this.peek() ]\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.input = \"\";\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (token.type) {\n\t\t\tcase Token.StringLiteral:\n\t\t\t\tthis.trigger(\"String\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.char,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tquote: token.quote\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(string)\", token.value);\n\t\t\tcase Token.Identifier:\n\t\t\t\tthis.trigger(\"Identifier\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.char,\n\t\t\t\t\tfrom: this.form,\n\t\t\t\t\tname: token.value,\n\t\t\t\t\tisProperty: state.tokens.curr.id === \".\"\n\t\t\t\t});\n\n\t\t\t\t/* falls through */\n\t\t\tcase Token.Keyword:\n\t\t\tcase Token.NullLiteral:\n\t\t\tcase Token.BooleanLiteral:\n\t\t\t\treturn create(\"(identifier)\", token.value, state.tokens.curr.id === \".\");\n\n\t\t\tcase Token.NumericLiteral:\n\t\t\t\tif (token.isMalformed) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W045\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ token.value ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.jsonMode && token.base === 16) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ \"0x-\" ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.directive[\"use strict\"] && token.base === 8) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.trigger(\"Number\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.char,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tbase: token.base,\n\t\t\t\t\tisMalformed: token.malformed\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(number)\", token.value);\n\n\t\t\tcase Token.RegExp:\n\t\t\t\treturn create(\"(regexp)\", token.value);\n\n\t\t\tcase Token.Comment:\n\t\t\t\tstate.tokens.curr.comment = true;\n\n\t\t\t\tif (token.isSpecial) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: token.value,\n\t\t\t\t\t\tbody: token.body,\n\t\t\t\t\t\ttype: token.commentType,\n\t\t\t\t\t\tisSpecial: token.isSpecial,\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tfrom: this.from\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"\":\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn create(\"(punctuator)\", token.value);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.Lexer = Lexer;\n//@ sourceURL=/src/stable/lex.js" -)); - -require.define("/src/stable/reg.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Regular expressions. Some of these are stupidly long.\n */\n\n/*jshint maxlen:1000 */\n\n\"use string\";\n\n// Unsafe comment or string (ax)\nexports.unsafeString =\n\t/@cc|<\\/?|script|\\]\\s*\\]|<\\s*!|</i;\n\n// Unsafe characters that are silently deleted by one or more browsers (cx)\nexports.unsafeChars =\n\t/[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\n// Characters in strings that need escaping (nx and nxg)\nexports.needEsc =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\nexports.needEscGlobal =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n// Star slash (lx)\nexports.starSlash = /\\*\\//;\n\n// Identifier (ix)\nexports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;\n\n// JavaScript URL (jx)\nexports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n// Catches /* falls through */ comments (ft)\nexports.fallsThrough = /^\\s*\\/\\*\\s*falls\\sthrough\\s*\\*\\/\\s*$/;\n//@ sourceURL=/src/stable/reg.js" -)); - -require.define("/src/stable/state.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar state = {\n\tsyntax: {},\n\n\treset: function () {\n\t\tthis.tokens = {\n\t\t\tprev: null,\n\t\t\tnext: null,\n\t\t\tcurr: null\n\t\t},\n\n\t\tthis.option = {};\n\t\tthis.directive = {};\n\t\tthis.jsonMode = false;\n\t\tthis.lines = [];\n\t\tthis.tab = \"\";\n\t\tthis.cache = {}; // Node.JS doesn't have Map. Sniff.\n\t}\n};\n\nexports.state = state;\n//@ sourceURL=/src/stable/state.js" -)); - -require.define("/src/stable/style.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nexports.register = function (linter) {\n\t// Check for properties named __proto__. This special property was\n\t// deprecated and then re-introduced for ES6.\n\n\tlinter.on(\"Identifier\", function style_scanProto(data) {\n\t\tif (linter.getOption(\"proto\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__proto__\") {\n\t\t\tlinter.warn(\"W103\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for properties named __iterator__. This is a special property\n\t// available only in browsers with JavaScript 1.7 implementation.\n\n\tlinter.on(\"Identifier\", function style_scanIterator(data) {\n\t\tif (linter.getOption(\"iterator\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__iterator__\") {\n\t\t\tlinter.warn(\"W104\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for dangling underscores.\n\n\tlinter.on(\"Identifier\", function style_scanDangling(data) {\n\t\tif (!linter.getOption(\"nomen\")) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Underscore.js\n\t\tif (data.name === \"_\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// In Node, __dirname and __filename should be ignored.\n\t\tif (linter.getOption(\"node\")) {\n\t\t\tif (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (/^(_+.*|.*_+)$/.test(data.name)) {\n\t\t\tlinter.warn(\"W105\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ \"dangling '_'\", data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check that all identifiers are using camelCase notation.\n\t// Exceptions: names like MY_VAR and _myVar.\n\n\tlinter.on(\"Identifier\", function style_scanCamelCase(data) {\n\t\tif (!linter.getOption(\"camelcase\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name.replace(/^_+/, \"\").indexOf(\"_\") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) {\n\t\t\tlinter.warn(\"W106\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Enforce consistency in style of quoting.\n\n\tlinter.on(\"String\", function style_scanQuotes(data) {\n\t\tvar quotmark = linter.getOption(\"quotmark\");\n\t\tvar code;\n\n\t\tif (!quotmark) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If quotmark is set to 'single' warn about all double-quotes.\n\n\t\tif (quotmark === \"single\" && data.quote !== \"'\") {\n\t\t\tcode = \"W109\";\n\t\t}\n\n\t\t// If quotmark is set to 'double' warn about all single-quotes.\n\n\t\tif (quotmark === \"double\" && data.quote !== \"\\\"\") {\n\t\t\tcode = \"W108\";\n\t\t}\n\n\t\t// If quotmark is set to true, remember the first quotation style\n\t\t// and then warn about all others.\n\n\t\tif (quotmark === true) {\n\t\t\tif (!linter.getCache(\"quotmark\")) {\n\t\t\t\tlinter.setCache(\"quotmark\", data.quote);\n\t\t\t}\n\n\t\t\tif (linter.getCache(\"quotmark\") !== data.quote) {\n\t\t\t\tcode = \"W110\";\n\t\t\t}\n\t\t}\n\n\t\tif (code) {\n\t\t\tlinter.warn(code, {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t});\n\t\t}\n\t});\n\n\tlinter.on(\"Number\", function style_scanNumbers(data) {\n\t\tif (data.value.charAt(0) === \".\") {\n\t\t\t// Warn about a leading decimal point.\n\t\t\tlinter.warn(\"W008\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (data.value.substr(data.value.length - 1) === \".\") {\n\t\t\t// Warn about a trailing decimal point.\n\t\t\tlinter.warn(\"W047\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (/^00+/.test(data.value)) {\n\t\t\t// Multiple leading zeroes.\n\t\t\tlinter.warn(\"W046\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Warn about script URLs.\n\n\tlinter.on(\"String\", function style_scanJavaScriptURLs(data) {\n\t\tvar re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n\t\tif (linter.getOption(\"scripturl\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (re.test(data.value)) {\n\t\t\tlinter.warn(\"W107\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char\n\t\t\t});\n\t\t}\n\t});\n};\n//@ sourceURL=/src/stable/style.js" -)); - -require.define("/src/stable/jshint.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*!\n * JSHint, by JSHint Community.\n *\n * This file (and this file only) is licensed under the same slightly modified\n * MIT license that JSLint is. It stops evil-doers everywhere:\n *\n *\t Copyright (c) 2002 Douglas Crockford (www.JSLint.com)\n *\n *\t Permission is hereby granted, free of charge, to any person obtaining\n *\t a copy of this software and associated documentation files (the \"Software\"),\n *\t to deal in the Software without restriction, including without limitation\n *\t the rights to use, copy, modify, merge, publish, distribute, sublicense,\n *\t and/or sell copies of the Software, and to permit persons to whom\n *\t the Software is furnished to do so, subject to the following conditions:\n *\n *\t The above copyright notice and this permission notice shall be included\n *\t in all copies or substantial portions of the Software.\n *\n *\t The Software shall be used for Good, not Evil.\n *\n *\t THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *\t IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *\t FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *\t AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *\t LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n *\t FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n *\t DEALINGS IN THE SOFTWARE.\n *\n */\n\n/*jshint quotmark:double */\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar vars = require(\"../shared/vars.js\");\nvar messages = require(\"../shared/messages.js\");\nvar Lexer = require(\"./lex.js\").Lexer;\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\nvar style = require(\"./style.js\");\n\n// We build the application inside a function so that we produce only a single\n// global variable. That function will be invoked immediately, and its return\n// value is the JSHINT function itself.\n\nvar JSHINT = (function () {\n\t\"use strict\";\n\n\tvar anonname,\t\t// The guessed name for anonymous functions.\n\n// These are operators that should not be used with the ! operator.\n\n\t\tbang = {\n\t\t\t\"<\" : true,\n\t\t\t\"<=\" : true,\n\t\t\t\"==\" : true,\n\t\t\t\"===\": true,\n\t\t\t\"!==\": true,\n\t\t\t\"!=\" : true,\n\t\t\t\">\" : true,\n\t\t\t\">=\" : true,\n\t\t\t\"+\" : true,\n\t\t\t\"-\" : true,\n\t\t\t\"*\" : true,\n\t\t\t\"/\" : true,\n\t\t\t\"%\" : true\n\t\t},\n\n\t\t// These are the JSHint boolean options.\n\t\tboolOptions = {\n\t\t\tasi : true, // if automatic semicolon insertion should be tolerated\n\t\t\tbitwise : true, // if bitwise operators should not be allowed\n\t\t\tboss : true, // if advanced usage of assignments should be allowed\n\t\t\tbrowser : true, // if the standard browser globals should be predefined\n\t\t\tcamelcase : true, // if identifiers should be required in camel case\n\t\t\tcouch : true, // if CouchDB globals should be predefined\n\t\t\tcurly : true, // if curly braces around all blocks should be required\n\t\t\tdebug : true, // if debugger statements should be allowed\n\t\t\tdevel : true, // if logging globals should be predefined (console, alert, etc.)\n\t\t\tdojo : true, // if Dojo Toolkit globals should be predefined\n\t\t\teqeqeq : true, // if === should be required\n\t\t\teqnull : true, // if == null comparisons should be tolerated\n\t\t\tes5 : true, // if ES5 syntax should be allowed\n\t\t\tesnext : true, // if es.next specific syntax should be allowed\n\t\t\tevil : true, // if eval should be allowed\n\t\t\texpr : true, // if ExpressionStatement should be allowed as Programs\n\t\t\tforin : true, // if for in statements must filter\n\t\t\tfuncscope : true, // if only function scope should be used for scope tests\n\t\t\tgcl : true, // if JSHint should be compatible with Google Closure Linter\n\t\t\tglobalstrict: true, // if global \"use strict\"; should be allowed (also enables 'strict')\n\t\t\timmed : true, // if immediate invocations must be wrapped in parens\n\t\t\titerator : true, // if the `__iterator__` property should be allowed\n\t\t\tjquery : true, // if jQuery globals should be predefined\n\t\t\tlastsemic : true, // if semicolons may be ommitted for the trailing\n\t\t\t // statements inside of a one-line blocks.\n\t\t\tlatedef : true, // if the use before definition should not be tolerated\n\t\t\tlaxbreak : true, // if line breaks should not be checked\n\t\t\tlaxcomma : true, // if line breaks should not be checked around commas\n\t\t\tloopfunc : true, // if functions should be allowed to be defined within\n\t\t\t // loops\n\t\t\tmootools : true, // if MooTools globals should be predefined\n\t\t\tmultistr : true, // allow multiline strings\n\t\t\tnewcap : true, // if constructor names must be capitalized\n\t\t\tnoarg : true, // if arguments.caller and arguments.callee should be\n\t\t\t // disallowed\n\t\t\tnode : true, // if the Node.js environment globals should be\n\t\t\t // predefined\n\t\t\tnoempty : true, // if empty blocks should be disallowed\n\t\t\tnonew : true, // if using `new` for side-effects should be disallowed\n\t\t\tnonstandard : true, // if non-standard (but widely adopted) globals should\n\t\t\t // be predefined\n\t\t\tnomen : true, // if names should be checked\n\t\t\tonevar : true, // if only one var statement per function should be\n\t\t\t // allowed\n\t\t\tpassfail : true, // if the scan should stop on first error\n\t\t\tphantom : true, // if PhantomJS symbols should be allowed\n\t\t\tplusplus : true, // if increment/decrement should not be allowed\n\t\t\tproto : true, // if the `__proto__` property should be allowed\n\t\t\tprototypejs : true, // if Prototype and Scriptaculous globals should be\n\t\t\t // predefined\n\t\t\trhino : true, // if the Rhino environment globals should be predefined\n\t\t\tundef : true, // if variables should be declared before used\n\t\t\tscripturl : true, // if script-targeted URLs should be tolerated\n\t\t\tshadow : true, // if variable shadowing should be tolerated\n\t\t\tsmarttabs : true, // if smarttabs should be tolerated\n\t\t\t // (http://www.emacswiki.org/emacs/SmartTabs)\n\t\t\tstrict : true, // require the \"use strict\"; pragma\n\t\t\tsub : true, // if all forms of subscript notation are tolerated\n\t\t\tsupernew : true, // if `new function () { ... };` and `new Object;`\n\t\t\t // should be tolerated\n\t\t\ttrailing : true, // if trailing whitespace rules apply\n\t\t\tvalidthis : true, // if 'this' inside a non-constructor function is valid.\n\t\t\t // This is a function scoped option only.\n\t\t\twithstmt : true, // if with statements should be allowed\n\t\t\twhite : true, // if strict whitespace rules apply\n\t\t\tworker : true, // if Web Worker script symbols should be allowed\n\t\t\twsh : true, // if the Windows Scripting Host environment globals\n\t\t\t // should be predefined\n\t\t\tyui : true, // YUI variables should be predefined\n\n\t\t\t// Obsolete options\n\t\t\tonecase : true, // if one case switch statements should be allowed\n\t\t\tregexp : true, // if the . should not be allowed in regexp literals\n\t\t\tregexdash : true // if unescaped first/last dash (-) inside brackets\n\t\t\t // should be tolerated\n\t\t},\n\n\t\t// These are the JSHint options that can take any value\n\t\t// (we use this object to detect invalid options)\n\t\tvalOptions = {\n\t\t\tmaxlen : false,\n\t\t\tindent : false,\n\t\t\tmaxerr : false,\n\t\t\tpredef : false,\n\t\t\tquotmark : false, //'single'|'double'|true\n\t\t\tscope : false,\n\t\t\tmaxstatements: false, // {int} max statements per function\n\t\t\tmaxdepth : false, // {int} max nested block depth per function\n\t\t\tmaxparams : false, // {int} max params per function\n\t\t\tmaxcomplexity: false, // {int} max cyclomatic complexity per function\n\t\t\tunused : true // warn if variables are unused. Available options:\n\t\t\t // false - don't check for unused variables\n\t\t\t // true - \"vars\" + check last function param\n\t\t\t // \"vars\" - skip checking unused function params\n\t\t\t // \"strict\" - \"vars\" + check all function params\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the definition in JSHint is opposite JSLint\n\t\tinvertedOptions = {\n\t\t\tbitwise : true,\n\t\t\tforin : true,\n\t\t\tnewcap : true,\n\t\t\tnomen : true,\n\t\t\tplusplus: true,\n\t\t\tregexp : true,\n\t\t\tundef : true,\n\t\t\twhite : true,\n\n\t\t\t// Inverted and renamed, use JSHint name here\n\t\t\teqeqeq : true,\n\t\t\tonevar : true\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the name has been changed but the effect is unchanged\n\t\trenamedOptions = {\n\t\t\teqeq : \"eqeqeq\",\n\t\t\tvars : \"onevar\",\n\t\t\twindows: \"wsh\"\n\t\t},\n\n\t\tdeclared, // Globals that were declared using /*global ... */ syntax.\n\t\texported, // Variables that are used outside of the current file.\n\n\t\tfunctionicity = [\n\t\t\t\"closure\", \"exception\", \"global\", \"label\",\n\t\t\t\"outer\", \"unused\", \"var\"\n\t\t],\n\n\t\tfunct, // The current function\n\t\tfunctions, // All of the functions\n\n\t\tglobal, // The global scope\n\t\tignored, // Ignored warnings\n\t\timplied, // Implied globals\n\t\tinblock,\n\t\tindent,\n\t\tlookahead,\n\t\tlex,\n\t\tmember,\n\t\tmembersOnly,\n\t\tnoreach,\n\t\tpredefined,\t\t// Global variables defined by option\n\n\t\tscope, // The current scope\n\t\tstack,\n\t\tunuseds,\n\t\turls,\n\t\tuseESNextSyntax,\n\t\twarnings,\n\n\t\textraModules = [],\n\t\temitter = new events.EventEmitter();\n\n\tfunction checkOption(name, t) {\n\t\tname = name.trim();\n\n\t\tif (/^-W\\d{3}$/g.test(name)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (valOptions[name] === undefined && boolOptions[name] === undefined) {\n\t\t\tif (t.type !== \"jslint\" || renamedOptions[name] === undefined) {\n\t\t\t\terror(\"E001\", t, name);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction isString(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object String]\";\n\t}\n\n\tfunction isIdentifier(tkn, value) {\n\t\tif (!tkn)\n\t\t\treturn false;\n\n\t\tif (!tkn.identifier || tkn.value !== value)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}\n\n\tfunction isReserved(token) {\n\t\tif (!token.reserved) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (token.meta && token.meta.isFutureReservedWord) {\n\t\t\t// ES3 FutureReservedWord in an ES5 environment.\n\t\t\tif (state.option.es5 && !token.meta.es5) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Some ES5 FutureReservedWord identifiers are active only\n\t\t\t// within a strict mode environment.\n\t\t\tif (token.meta.strictOnly) {\n\t\t\t\tif (!state.option.strict && !state.directive[\"use strict\"]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (token.isProperty) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction supplant(str, data) {\n\t\treturn str.replace(/\\{([^{}]*)\\}/g, function (a, b) {\n\t\t\tvar r = data[b];\n\t\t\treturn typeof r === \"string\" || typeof r === \"number\" ? r : a;\n\t\t});\n\t}\n\n\tfunction combine(t, o) {\n\t\tvar n;\n\t\tfor (n in o) {\n\t\t\tif (_.has(o, n) && !_.has(JSHINT.blacklist, n)) {\n\t\t\t\tt[n] = o[n];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction updatePredefined() {\n\t\tObject.keys(JSHINT.blacklist).forEach(function (key) {\n\t\t\tdelete predefined[key];\n\t\t});\n\t}\n\n\tfunction assume() {\n\t\tif (state.option.couch) {\n\t\t\tcombine(predefined, vars.couch);\n\t\t}\n\n\t\tif (state.option.rhino) {\n\t\t\tcombine(predefined, vars.rhino);\n\t\t}\n\n\t\tif (state.option.phantom) {\n\t\t\tcombine(predefined, vars.phantom);\n\t\t}\n\n\t\tif (state.option.prototypejs) {\n\t\t\tcombine(predefined, vars.prototypejs);\n\t\t}\n\n\t\tif (state.option.node) {\n\t\t\tcombine(predefined, vars.node);\n\t\t}\n\n\t\tif (state.option.devel) {\n\t\t\tcombine(predefined, vars.devel);\n\t\t}\n\n\t\tif (state.option.dojo) {\n\t\t\tcombine(predefined, vars.dojo);\n\t\t}\n\n\t\tif (state.option.browser) {\n\t\t\tcombine(predefined, vars.browser);\n\t\t}\n\n\t\tif (state.option.nonstandard) {\n\t\t\tcombine(predefined, vars.nonstandard);\n\t\t}\n\n\t\tif (state.option.jquery) {\n\t\t\tcombine(predefined, vars.jquery);\n\t\t}\n\n\t\tif (state.option.mootools) {\n\t\t\tcombine(predefined, vars.mootools);\n\t\t}\n\n\t\tif (state.option.worker) {\n\t\t\tcombine(predefined, vars.worker);\n\t\t}\n\n\t\tif (state.option.wsh) {\n\t\t\tcombine(predefined, vars.wsh);\n\t\t}\n\n\t\tif (state.option.esnext) {\n\t\t\tuseESNextSyntax();\n\t\t}\n\n\t\tif (state.option.globalstrict && state.option.strict !== false) {\n\t\t\tstate.option.strict = true;\n\t\t}\n\n\t\tif (state.option.yui) {\n\t\t\tcombine(predefined, vars.yui);\n\t\t}\n\t}\n\n\n\t// Produce an error warning.\n\tfunction quit(code, line, chr) {\n\t\tvar percentage = Math.floor((line / state.lines.length) * 100);\n\t\tvar message = messages.errors[code].desc;\n\n\t\tthrow {\n\t\t\tname: \"JSHintError\",\n\t\t\tline: line,\n\t\t\tcharacter: chr,\n\t\t\tmessage: message + \" (\" + percentage + \"% scanned).\",\n\t\t\traw: message\n\t\t};\n\t}\n\n\tfunction isundef(scope, code, token, a) {\n\t\treturn JSHINT.undefs.push([scope, code, token, a]);\n\t}\n\n\tfunction warning(code, t, a, b, c, d) {\n\t\tvar ch, l, w, msg;\n\n\t\tif (/^W\\d{3}$/.test(code)) {\n\t\t\tif (ignored[code]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmsg = messages.warnings[code];\n\t\t} else if (/E\\d{3}/.test(code)) {\n\t\t\tmsg = messages.errors[code];\n\t\t} else if (/I\\d{3}/.test(code)) {\n\t\t\tmsg = messages.info[code];\n\t\t}\n\n\t\tt = t || state.tokens.next;\n\t\tif (t.id === \"(end)\") { // `~\n\t\t\tt = state.tokens.curr;\n\t\t}\n\n\t\tl = t.line || 0;\n\t\tch = t.from || 0;\n\n\t\tw = {\n\t\t\tid: \"(error)\",\n\t\t\traw: msg.desc,\n\t\t\tcode: msg.code,\n\t\t\tevidence: state.lines[l - 1] || \"\",\n\t\t\tline: l,\n\t\t\tcharacter: ch,\n\t\t\tscope: JSHINT.scope,\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\td: d\n\t\t};\n\n\t\tw.reason = supplant(msg.desc, w);\n\t\tJSHINT.errors.push(w);\n\n\t\tif (state.option.passfail) {\n\t\t\tquit(\"E042\", l, ch);\n\t\t}\n\n\t\twarnings += 1;\n\t\tif (warnings >= state.option.maxerr) {\n\t\t\tquit(\"E043\", l, ch);\n\t\t}\n\n\t\treturn w;\n\t}\n\n\tfunction warningAt(m, l, ch, a, b, c, d) {\n\t\treturn warning(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\tfunction error(m, t, a, b, c, d) {\n\t\twarning(m, t, a, b, c, d);\n\t}\n\n\tfunction errorAt(m, l, ch, a, b, c, d) {\n\t\treturn error(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\t// Tracking of \"internal\" scripts, like eval containing a static string\n\tfunction addInternalSrc(elem, src) {\n\t\tvar i;\n\t\ti = {\n\t\t\tid: \"(internal)\",\n\t\t\telem: elem,\n\t\t\tvalue: src\n\t\t};\n\t\tJSHINT.internals.push(i);\n\t\treturn i;\n\t}\n\n\tfunction addlabel(t, type, tkn) {\n\t\t// Define t in the current function in the current scope.\n\t\tif (type === \"exception\") {\n\t\t\tif (_.has(funct[\"(context)\"], t)) {\n\t\t\t\tif (funct[t] !== true && !state.option.node) {\n\t\t\t\t\twarning(\"W002\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (_.has(funct, t) && !funct[\"(global)\"]) {\n\t\t\tif (funct[t] === true) {\n\t\t\t\tif (state.option.latedef)\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t} else {\n\t\t\t\tif (!state.option.shadow && type !== \"exception\") {\n\t\t\t\t\twarning(\"W004\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunct[t] = type;\n\n\t\tif (tkn) {\n\t\t\tfunct[\"(tokens)\"][t] = tkn;\n\t\t}\n\n\t\tif (funct[\"(global)\"]) {\n\t\t\tglobal[t] = funct;\n\t\t\tif (_.has(implied, t)) {\n\t\t\t\tif (state.option.latedef) {\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t\t}\n\n\t\t\t\tdelete implied[t];\n\t\t\t}\n\t\t} else {\n\t\t\tscope[t] = funct;\n\t\t}\n\t}\n\n\tfunction doOption() {\n\t\tvar nt = state.tokens.next;\n\t\tvar body = nt.body.split(\",\").map(function (s) { return s.trim(); });\n\t\tvar predef = {};\n\n\t\tif (nt.type === \"globals\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = g[0];\n\t\t\t\tvar val = g[1];\n\n\t\t\t\tif (key.charAt(0) === \"-\") {\n\t\t\t\t\tkey = key.slice(1);\n\t\t\t\t\tval = false;\n\n\t\t\t\t\tJSHINT.blacklist[key] = key;\n\t\t\t\t\tupdatePredefined();\n\t\t\t\t} else {\n\t\t\t\t\tpredef[key] = (val === \"true\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcombine(predefined, predef);\n\n\t\t\tfor (var key in predef) {\n\t\t\t\tif (_.has(predef, key)) {\n\t\t\t\t\tdeclared[key] = nt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (nt.type === \"exported\") {\n\t\t\tbody.forEach(function (e) {\n\t\t\t\texported[e] = true;\n\t\t\t});\n\t\t}\n\n\t\tif (nt.type === \"members\") {\n\t\t\tmembersOnly = membersOnly || {};\n\n\t\t\tbody.forEach(function (m) {\n\t\t\t\tvar ch1 = m.charAt(0);\n\t\t\t\tvar ch2 = m.charAt(m.length - 1);\n\n\t\t\t\tif (ch1 === ch2 && (ch1 === \"\\\"\" || ch1 === \"'\")) {\n\t\t\t\t\tm = m\n\t\t\t\t\t\t.substr(1, m.length - 2)\n\t\t\t\t\t\t.replace(\"\\\\b\", \"\\b\")\n\t\t\t\t\t\t.replace(\"\\\\t\", \"\\t\")\n\t\t\t\t\t\t.replace(\"\\\\n\", \"\\n\")\n\t\t\t\t\t\t.replace(\"\\\\v\", \"\\v\")\n\t\t\t\t\t\t.replace(\"\\\\f\", \"\\f\")\n\t\t\t\t\t\t.replace(\"\\\\r\", \"\\r\")\n\t\t\t\t\t\t.replace(\"\\\\\\\\\", \"\\\\\")\n\t\t\t\t\t\t.replace(\"\\\\\\\"\", \"\\\"\");\n\t\t\t\t}\n\n\t\t\t\tmembersOnly[m] = false;\n\t\t\t});\n\t\t}\n\n\t\tvar numvals = [\n\t\t\t\"maxstatements\",\n\t\t\t\"maxparams\",\n\t\t\t\"maxdepth\",\n\t\t\t\"maxcomplexity\",\n\t\t\t\"maxerr\",\n\t\t\t\"maxlen\",\n\t\t\t\"indent\"\n\t\t];\n\n\t\tif (nt.type === \"jshint\" || nt.type === \"jslint\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = (g[0] || \"\").trim();\n\t\t\t\tvar val = (g[1] || \"\").trim();\n\n\t\t\t\tif (!checkOption(key, nt)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (numvals.indexOf(key) >= 0) {\n\t\t\t\t\tval = +val;\n\n\t\t\t\t\tif (typeof val !== \"number\" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) {\n\t\t\t\t\t\terror(\"E032\", nt, g[1].trim());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"indent\") {\n\t\t\t\t\t\tstate.option[\"(explicitIndent)\"] = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.option[key] = val;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"validthis\") {\n\t\t\t\t\t// `validthis` is valid only within a function scope.\n\t\t\t\t\tif (funct[\"(global)\"]) {\n\t\t\t\t\t\terror(\"E009\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\t\t\tstate.option.validthis = (val === \"true\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"quotmark\") {\n\t\t\t\t\tswitch (val) {\n\t\t\t\t\tcase \"true\":\n\t\t\t\t\tcase \"false\":\n\t\t\t\t\t\tstate.option.quotmark = (val === \"true\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\tcase \"single\":\n\t\t\t\t\t\tstate.option.quotmark = val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"unused\") {\n\t\t\t\t\tswitch (val) {\n\t\t\t\t\tcase \"true\":\n\t\t\t\t\t\tstate.option.unused = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"false\":\n\t\t\t\t\t\tstate.option.unused = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vars\":\n\t\t\t\t\tcase \"strict\":\n\t\t\t\t\t\tstate.option.unused = val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (/^-W\\d{3}$/g.test(key)) {\n\t\t\t\t\tignored[key.slice(1)] = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tn;\n\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\tif (nt.type === \"jslint\") {\n\t\t\t\t\t\ttn = renamedOptions[key] || key;\n\t\t\t\t\t\tstate.option[tn] = (val === \"true\");\n\n\t\t\t\t\t\tif (invertedOptions[tn] !== undefined) {\n\t\t\t\t\t\t\tstate.option[tn] = !state.option[tn];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.option[key] = (val === \"true\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"newcap\") {\n\t\t\t\t\t\tstate.option[\"(explicitNewcap)\"] = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terror(\"E002\", nt);\n\t\t\t});\n\n\t\t\tassume();\n\t\t}\n\t}\n\n\t// We need a peek function. If it has an argument, it peeks that much farther\n\t// ahead. It is used to distinguish\n\t//\t for ( var i in ...\n\t// from\n\t//\t for ( var i = ...\n\n\tfunction peek(p) {\n\t\tvar i = p || 0, j = 0, t;\n\n\t\twhile (j <= i) {\n\t\t\tt = lookahead[j];\n\t\t\tif (!t) {\n\t\t\t\tt = lookahead[j] = lex.token();\n\t\t\t}\n\t\t\tj += 1;\n\t\t}\n\t\treturn t;\n\t}\n\n\t// Produce the next token. It looks for programming errors.\n\n\tfunction advance(id, t) {\n\t\tswitch (state.tokens.curr.id) {\n\t\tcase \"(number)\":\n\t\t\tif (state.tokens.next.id === \".\") {\n\t\t\t\twarning(\"W005\", state.tokens.curr);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tif (state.tokens.next.id === \"-\" || state.tokens.next.id === \"--\") {\n\t\t\t\twarning(\"W006\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"+\":\n\t\t\tif (state.tokens.next.id === \"+\" || state.tokens.next.id === \"++\") {\n\t\t\t\twarning(\"W007\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (state.tokens.curr.type === \"(string)\" || state.tokens.curr.identifier) {\n\t\t\tanonname = state.tokens.curr.value;\n\t\t}\n\n\t\tif (id && state.tokens.next.id !== id) {\n\t\t\tif (t) {\n\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\terror(\"E019\", t, t.id);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E020\", state.tokens.next, id, t.id, t.line, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t} else if (state.tokens.next.type !== \"(identifier)\" || state.tokens.next.value !== id) {\n\t\t\t\twarning(\"W116\", state.tokens.next, id, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\n\t\tstate.tokens.prev = state.tokens.curr;\n\t\tstate.tokens.curr = state.tokens.next;\n\t\tfor (;;) {\n\t\t\tstate.tokens.next = lookahead.shift() || lex.token();\n\n\t\t\tif (!state.tokens.next) { // No more tokens left, give up\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \"(end)\" || state.tokens.next.id === \"(error)\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (state.tokens.next.isSpecial) {\n\t\t\t\tdoOption();\n\t\t\t} else {\n\t\t\t\tif (state.tokens.next.id !== \"(endline)\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it\n\t// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is\n\t// like .nud except that it is only used on the first token of a statement.\n\t// Having .fud makes it much easier to define statement-oriented languages like\n\t// JavaScript. I retained Pratt's nomenclature.\n\n\t// .nud Null denotation\n\t// .fud First null denotation\n\t// .led Left denotation\n\t// lbp Left binding power\n\t// rbp Right binding power\n\n\t// They are elements of the parsing method called Top Down Operator Precedence.\n\n\tfunction expression(rbp, initial) {\n\t\tvar left, isArray = false, isObject = false;\n\n\t\tif (state.tokens.next.id === \"(end)\")\n\t\t\terror(\"E006\", state.tokens.curr);\n\n\t\tadvance();\n\n\t\tif (initial) {\n\t\t\tanonname = \"anonymous\";\n\t\t\tfunct[\"(verb)\"] = state.tokens.curr.value;\n\t\t}\n\n\t\tif (initial === true && state.tokens.curr.fud) {\n\t\t\tleft = state.tokens.curr.fud();\n\t\t} else {\n\t\t\tif (state.tokens.curr.nud) {\n\t\t\t\tleft = state.tokens.curr.nud();\n\t\t\t} else {\n\t\t\t\terror(\"E030\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t}\n\n\t\t\twhile (rbp < state.tokens.next.lbp) {\n\t\t\t\tisArray = state.tokens.curr.value === \"Array\";\n\t\t\t\tisObject = state.tokens.curr.value === \"Object\";\n\n\t\t\t\t// #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object()\n\t\t\t\t// Line breaks in IfStatement heads exist to satisfy the checkJSHint\n\t\t\t\t// \"Line too long.\" error.\n\t\t\t\tif (left && (left.value || (left.first && left.first.value))) {\n\t\t\t\t\t// If the left.value is not \"new\", or the left.first.value is a \".\"\n\t\t\t\t\t// then safely assume that this is not \"new Array()\" and possibly\n\t\t\t\t\t// not \"new Object()\"...\n\t\t\t\t\tif (left.value !== \"new\" ||\n\t\t\t\t\t (left.first && left.first.value && left.first.value === \".\")) {\n\t\t\t\t\t\tisArray = false;\n\t\t\t\t\t\t// ...In the case of Object, if the left.value and state.tokens.curr.value\n\t\t\t\t\t\t// are not equal, then safely assume that this not \"new Object()\"\n\t\t\t\t\t\tif (left.value !== state.tokens.curr.value) {\n\t\t\t\t\t\t\tisObject = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tadvance();\n\n\t\t\t\tif (isArray && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W009\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (isObject && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W010\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.led) {\n\t\t\t\t\tleft = state.tokens.curr.led(left);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E033\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn left;\n\t}\n\n\n// Functions for conformance of style.\n\n\tfunction adjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white) {\n\t\t\tif (left.character !== right.from && left.line === right.line) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W011\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreak(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && (left.character !== right.from || left.line !== right.line)) {\n\t\t\twarning(\"W012\", right, right.value);\n\t\t}\n\t}\n\n\tfunction nospace(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && !left.comment) {\n\t\t\tif (left.line === right.line) {\n\t\t\t\tadjacent(left, right);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nonadjacent(left, right) {\n\t\tif (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\n\t\t\tif (left.value === \";\" && right.value === \";\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (left.line === right.line && left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreaknonadjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (!state.option.laxbreak && left.line !== right.line) {\n\t\t\twarning(\"W014\", right, right.id);\n\t\t} else if (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\t\t\tif (left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction indentation(bias) {\n\t\tif (!state.option.white && !state.option[\"(explicitIndent)\"]) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = indent + (bias || 0);\n\t\tif (state.tokens.next.from !== i) {\n\t\t\twarning(\"W015\", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from);\n\t\t}\n\t}\n\n\tfunction nolinebreak(t) {\n\t\tt = t || state.tokens.curr;\n\t\tif (t.line !== state.tokens.next.line) {\n\t\t\twarning(\"E022\", t, t.value);\n\t\t}\n\t}\n\n\n\tfunction comma(opts) {\n\t\topts = opts || {};\n\n\t\tif (state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\tif (!state.option.laxcomma) {\n\t\t\t\tif (comma.first) {\n\t\t\t\t\twarning(\"I001\");\n\t\t\t\t\tcomma.first = false;\n\t\t\t\t}\n\t\t\t\twarning(\"W014\", state.tokens.curr, state.tokens.next.id);\n\t\t\t}\n\t\t} else if (!state.tokens.curr.comment &&\n\t\t\t\tstate.tokens.curr.character !== state.tokens.next.from && state.option.white) {\n\t\t\tstate.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from);\n\t\t\twarning(\"W011\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\n\t\tadvance(\",\");\n\n\t\t// TODO: This is a temporary solution to fight against false-positives in\n\t\t// arrays and objects with trailing commas (see GH-363). The best solution\n\t\t// would be to extract all whitespace rules out of parser.\n\n\t\tif (state.tokens.next.value !== \"]\" && state.tokens.next.value !== \"}\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\n\t\tif (state.tokens.next.identifier) {\n\t\t\t// Keywords that cannot follow a comma operator.\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"break\":\n\t\t\tcase \"case\":\n\t\t\tcase \"catch\":\n\t\t\tcase \"continue\":\n\t\t\tcase \"default\":\n\t\t\tcase \"do\":\n\t\t\tcase \"else\":\n\t\t\tcase \"finally\":\n\t\t\tcase \"for\":\n\t\t\tcase \"if\":\n\t\t\tcase \"in\":\n\t\t\tcase \"instanceof\":\n\t\t\tcase \"return\":\n\t\t\tcase \"switch\":\n\t\t\tcase \"throw\":\n\t\t\tcase \"try\":\n\t\t\tcase \"var\":\n\t\t\tcase \"while\":\n\t\t\tcase \"with\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.type === \"(punctuator)\") {\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"}\":\n\t\t\tcase \"]\":\n\t\t\tcase \",\":\n\t\t\t\tif (opts.allowTrailing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* falls through */\n\t\t\tcase \")\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Functional constructors for making the symbols that will be inherited by\n\t// tokens.\n\n\tfunction symbol(s, p) {\n\t\tvar x = state.syntax[s];\n\t\tif (!x || typeof x !== \"object\") {\n\t\t\tstate.syntax[s] = x = {\n\t\t\t\tid: s,\n\t\t\t\tlbp: p,\n\t\t\t\tvalue: s\n\t\t\t};\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction delim(s) {\n\t\treturn symbol(s, 0);\n\t}\n\n\tfunction stmt(s, f) {\n\t\tvar x = delim(s);\n\t\tx.identifier = x.reserved = true;\n\t\tx.fud = f;\n\t\treturn x;\n\t}\n\n\tfunction blockstmt(s, f) {\n\t\tvar x = stmt(s, f);\n\t\tx.block = true;\n\t\treturn x;\n\t}\n\n\tfunction reserveName(x) {\n\t\tvar c = x.id.charAt(0);\n\t\tif ((c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\")) {\n\t\t\tx.identifier = x.reserved = true;\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction prefix(s, f) {\n\t\tvar x = symbol(s, 150);\n\t\treserveName(x);\n\t\tx.nud = (typeof f === \"function\") ? f : function () {\n\t\t\tthis.right = expression(150);\n\t\t\tthis.arity = \"unary\";\n\t\t\tif (this.id === \"++\" || this.id === \"--\") {\n\t\t\t\tif (state.option.plusplus) {\n\t\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t\t} else if ((!this.right.identifier || isReserved(this.right)) &&\n\t\t\t\t\t\tthis.right.id !== \".\" && this.right.id !== \"[\") {\n\t\t\t\t\twarning(\"W017\", this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction type(s, f) {\n\t\tvar x = delim(s);\n\t\tx.type = s;\n\t\tx.nud = f;\n\t\treturn x;\n\t}\n\n\tfunction reserve(name, func) {\n\t\tvar x = type(name, func);\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\treturn x;\n\t}\n\n\tfunction FutureReservedWord(name, meta) {\n\t\tvar x = type(name, function () {\n\t\t\treturn this;\n\t\t});\n\n\t\tmeta = meta || {};\n\t\tmeta.isFutureReservedWord = true;\n\n\t\tx.value = name;\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\tx.meta = meta;\n\n\t\treturn x;\n\t}\n\n\tfunction reservevar(s, v) {\n\t\treturn reserve(s, function () {\n\t\t\tif (typeof v === \"function\") {\n\t\t\t\tv(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t}\n\n\tfunction infix(s, f, p, w) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = function (left) {\n\t\t\tif (!w) {\n\t\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t\tif (s === \"in\" && left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\t\t\tif (typeof f === \"function\") {\n\t\t\t\treturn f(left, this);\n\t\t\t} else {\n\t\t\t\tthis.left = left;\n\t\t\t\tthis.right = expression(p);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction relation(s, f) {\n\t\tvar x = symbol(s, 100);\n\n\t\tx.led = function (left) {\n\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tvar right = expression(100);\n\n\t\t\tif (isIdentifier(left, \"NaN\") || isIdentifier(right, \"NaN\")) {\n\t\t\t\twarning(\"W019\", this);\n\t\t\t} else if (f) {\n\t\t\t\tf.apply(this, [left, right]);\n\t\t\t}\n\n\t\t\tif (!left || !right) {\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\n\t\t\tif (right.id === \"!\") {\n\t\t\t\twarning(\"W018\", right, \"!\");\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction isPoorRelation(node) {\n\t\treturn node &&\n\t\t\t ((node.type === \"(number)\" && +node.value === 0) ||\n\t\t\t (node.type === \"(string)\" && node.value === \"\") ||\n\t\t\t (node.type === \"null\" && !state.option.eqnull) ||\n\t\t\t\tnode.type === \"true\" ||\n\t\t\t\tnode.type === \"false\" ||\n\t\t\t\tnode.type === \"undefined\");\n\t}\n\n\tfunction assignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\n\t\treturn infix(s, function (left, that) {\n\t\t\tthat.left = left;\n\n\t\t\tif (predefined[left.value] === false &&\n\t\t\t\t\tscope[left.value][\"(global)\"] === true) {\n\t\t\t\twarning(\"W020\", left);\n\t\t\t} else if (left[\"function\"]) {\n\t\t\t\twarning(\"W021\", left, left.value);\n\t\t\t}\n\n\t\t\tif (left) {\n\t\t\t\tif (state.option.esnext && funct[left.value] === \"const\") {\n\t\t\t\t\terror(\"E013\", left, left.value);\n\t\t\t\t}\n\n\t\t\t\tif (left.id === \".\" || left.id === \"[\") {\n\t\t\t\t\tif (!left.left || left.left.value === \"arguments\") {\n\t\t\t\t\t\twarning(\"E031\", that);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t} else if (left.identifier && !isReserved(left)) {\n\t\t\t\t\tif (funct[left.value] === \"exception\") {\n\t\t\t\t\t\twarning(\"W022\", left);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction bitwise(s, f, p) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = (typeof f === \"function\") ? f : function (left) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t}\n\t\t\tthis.left = left;\n\t\t\tthis.right = expression(p);\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\n\tfunction bitwiseassignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\t\treturn infix(s, function (left, that) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", that, that.id);\n\t\t\t}\n\t\t\tnonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tif (left) {\n\t\t\t\tif (left.id === \".\" || left.id === \"[\" ||\n\t\t\t\t\t\t(left.identifier && !isReserved(left))) {\n\t\t\t\t\texpression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t}\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction suffix(s) {\n\t\tvar x = symbol(s, 150);\n\n\t\tx.led = function (left) {\n\t\t\tif (state.option.plusplus) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t} else if ((!left.identifier || isReserved(left)) && left.id !== \".\" && left.id !== \"[\") {\n\t\t\t\twarning(\"W017\", this);\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument (see identifier())\n\t// prop means that this identifier is that of an object property\n\n\tfunction optionalidentifier(fnparam, prop) {\n\t\tif (!state.tokens.next.identifier) {\n\t\t\treturn;\n\t\t}\n\n\t\tadvance();\n\n\t\tvar curr = state.tokens.curr;\n\t\tvar meta = curr.meta || {};\n\t\tvar val = state.tokens.curr.value;\n\n\t\tif (!isReserved(curr)) {\n\t\t\treturn val;\n\t\t}\n\n\t\tif (prop) {\n\t\t\tif (state.option.es5 || meta.isFutureReservedWord) {\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\n\t\tif (fnparam && val === \"undefined\") {\n\t\t\treturn val;\n\t\t}\n\n\t\twarning(\"W024\", state.tokens.curr, state.tokens.curr.id);\n\t\treturn val;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument\n\t// prop means that this identifier is that of an object property\n\tfunction identifier(fnparam, prop) {\n\t\tvar i = optionalidentifier(fnparam, prop);\n\t\tif (i) {\n\t\t\treturn i;\n\t\t}\n\t\tif (state.tokens.curr.id === \"function\" && state.tokens.next.id === \"(\") {\n\t\t\twarning(\"W025\");\n\t\t} else {\n\t\t\terror(\"E030\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t}\n\n\n\tfunction reachable(s) {\n\t\tvar i = 0, t;\n\t\tif (state.tokens.next.id !== \";\" || noreach) {\n\t\t\treturn;\n\t\t}\n\t\tfor (;;) {\n\t\t\tt = peek(i);\n\t\t\tif (t.reach) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (t.id !== \"(endline)\") {\n\t\t\t\tif (t.id === \"function\") {\n\t\t\t\t\tif (!state.option.latedef) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\twarning(\"W026\", t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twarning(\"W027\", t, t.value, s);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti += 1;\n\t\t}\n\t}\n\n\n\tfunction statement(noindent) {\n\t\tvar i = indent, r, s = scope, t = state.tokens.next;\n\n\t\tif (t.id === \";\") {\n\t\t\tadvance(\";\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Is this a labelled statement?\n\t\tvar res = isReserved(t);\n\n\t\t// We're being more tolerant here: if someone uses\n\t\t// a FutureReservedWord as a label, we warn but proceed\n\t\t// anyway.\n\n\t\tif (res && t.meta && t.meta.isFutureReservedWord) {\n\t\t\twarning(\"W024\", t, t.id);\n\t\t\tres = false;\n\t\t}\n\n\t\tif (t.identifier && !res && peek().id === \":\") {\n\t\t\tadvance();\n\t\t\tadvance(\":\");\n\t\t\tscope = Object.create(s);\n\t\t\taddlabel(t.value, \"label\");\n\n\t\t\tif (!state.tokens.next.labelled && state.tokens.next.value !== \"{\") {\n\t\t\t\twarning(\"W028\", state.tokens.next, t.value, state.tokens.next.value);\n\t\t\t}\n\n\t\t\tif (reg.javascriptURL.test(t.value + \":\")) {\n\t\t\t\twarning(\"W029\", t, t.value);\n\t\t\t}\n\n\t\t\tstate.tokens.next.label = t.value;\n\t\t\tt = state.tokens.next;\n\t\t}\n\n\t\t// Is it a lonely block?\n\n\t\tif (t.id === \"{\") {\n\t\t\tblock(true, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse the statement.\n\n\t\tif (!noindent) {\n\t\t\tindentation();\n\t\t}\n\t\tr = expression(0, true);\n\n\t\t// Look for the final semicolon.\n\n\t\tif (!t.block) {\n\t\t\tif (!state.option.expr && (!r || !r.exps)) {\n\t\t\t\twarning(\"W030\", state.tokens.curr);\n\t\t\t} else if (state.option.nonew && r.id === \"(\" && r.left.id === \"new\") {\n\t\t\t\twarning(\"W031\", t);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\treturn comma();\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (!state.option.asi) {\n\t\t\t\t\t// If this is the last statement in a block that ends on\n\t\t\t\t\t// the same line *and* option lastsemic is on, ignore the warning.\n\t\t\t\t\t// Otherwise, complain about missing semicolon.\n\t\t\t\t\tif (!state.option.lastsemic || state.tokens.next.id !== \"}\" ||\n\t\t\t\t\t\tstate.tokens.next.line !== state.tokens.curr.line) {\n\t\t\t\t\t\twarningAt(\"W033\", state.tokens.curr.line, state.tokens.curr.character);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\";\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t}\n\n\t\t// Restore the indentation.\n\n\t\tindent = i;\n\t\tscope = s;\n\t\treturn r;\n\t}\n\n\n\tfunction statements(startLine) {\n\t\tvar a = [], p;\n\n\t\twhile (!state.tokens.next.reach && state.tokens.next.id !== \"(end)\") {\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\tp = peek();\n\n\t\t\t\tif (!p || (p.id !== \"(\" && p.id !== \"[\")) {\n\t\t\t\t\twarning(\"W032\");\n\t\t\t\t}\n\n\t\t\t\tadvance(\";\");\n\t\t\t} else {\n\t\t\t\ta.push(statement(startLine === state.tokens.next.line));\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n\n\n\t/*\n\t * read all directives\n\t * recognizes a simple form of asi, but always\n\t * warns, if it is used\n\t */\n\tfunction directives() {\n\t\tvar i, p, pn;\n\n\t\tfor (;;) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tp = peek(0);\n\t\t\t\tif (p.id === \"(endline)\") {\n\t\t\t\t\ti = 1;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tpn = peek(i);\n\t\t\t\t\t\ti = i + 1;\n\t\t\t\t\t} while (pn.id === \"(endline)\");\n\n\t\t\t\t\tif (pn.id !== \";\") {\n\t\t\t\t\t\tif (pn.id !== \"(string)\" && pn.id !== \"(number)\" &&\n\t\t\t\t\t\t\tpn.id !== \"(regexp)\" && pn.identifier !== true &&\n\t\t\t\t\t\t\tpn.id !== \"}\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twarning(\"W033\", state.tokens.next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp = pn;\n\t\t\t\t\t}\n\t\t\t\t} else if (p.id === \"}\") {\n\t\t\t\t\t// Directive with no other statements, warn about missing semicolon\n\t\t\t\t\twarning(\"W033\", p);\n\t\t\t\t} else if (p.id !== \";\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tindentation();\n\t\t\t\tadvance();\n\t\t\t\tif (state.directive[state.tokens.curr.value]) {\n\t\t\t\t\twarning(\"W034\", state.tokens.curr, state.tokens.curr.value);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.value === \"use strict\") {\n\t\t\t\t\tif (!state.option[\"(explicitNewcap)\"])\n\t\t\t\t\t\tstate.option.newcap = true;\n\t\t\t\t\tstate.option.undef = true;\n\t\t\t\t}\n\n\t\t\t\t// there's no directive negation, so always set to true\n\t\t\t\tstate.directive[state.tokens.curr.value] = true;\n\n\t\t\t\tif (p.id === \";\") {\n\t\t\t\t\tadvance(\";\");\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\t/*\n\t * Parses a single block. A block is a sequence of statements wrapped in\n\t * braces.\n\t *\n\t * ordinary - true for everything but function bodies and try blocks.\n\t * stmt\t\t- true if block can be a single statement (e.g. in if/for/while).\n\t * isfunc\t- true if block is a function body\n\t */\n\tfunction block(ordinary, stmt, isfunc) {\n\t\tvar a,\n\t\t\tb = inblock,\n\t\t\told_indent = indent,\n\t\t\tm,\n\t\t\ts = scope,\n\t\t\tt,\n\t\t\tline,\n\t\t\td;\n\n\t\tinblock = ordinary;\n\n\t\tif (!ordinary || !state.option.funcscope)\n\t\t\tscope = Object.create(scope);\n\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\n\t\tvar metrics = funct[\"(metrics)\"];\n\t\tmetrics.nestedBlockDepth += 1;\n\t\tmetrics.verifyMaxNestedBlockDepthPerFunction();\n\n\t\tif (state.tokens.next.id === \"{\") {\n\t\t\tadvance(\"{\");\n\t\t\tline = state.tokens.curr.line;\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\twhile (!ordinary && state.tokens.next.from > indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tm = {};\n\t\t\t\t\tfor (d in state.directive) {\n\t\t\t\t\t\tif (_.has(state.directive, d)) {\n\t\t\t\t\t\t\tm[d] = state.directive[d];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectives();\n\n\t\t\t\t\tif (state.option.strict && funct[\"(context)\"][\"(global)\"]) {\n\t\t\t\t\t\tif (!m[\"use strict\"] && !state.directive[\"use strict\"]) {\n\t\t\t\t\t\t\twarning(\"E007\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ta = statements(line);\n\n\t\t\t\tmetrics.statementCount += a.length;\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tstate.directive = m;\n\t\t\t\t}\n\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tif (line !== state.tokens.next.line) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\t\t\t} else if (line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", t);\n\t\t\tindent = old_indent;\n\t\t} else if (!ordinary) {\n\t\t\terror(\"E021\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t} else {\n\t\t\tif (!stmt || state.option.curly) {\n\t\t\t\twarning(\"W116\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t\t}\n\n\t\t\tnoreach = true;\n\t\t\tindent += state.option.indent;\n\t\t\t// test indentation only if statement is in new line\n\t\t\ta = [statement(state.tokens.next.line === state.tokens.curr.line)];\n\t\t\tindent -= state.option.indent;\n\t\t\tnoreach = false;\n\t\t}\n\t\tfunct[\"(verb)\"] = null;\n\t\tif (!ordinary || !state.option.funcscope) scope = s;\n\t\tinblock = b;\n\t\tif (ordinary && state.option.noempty && (!a || a.length === 0)) {\n\t\t\twarning(\"W035\");\n\t\t}\n\t\tmetrics.nestedBlockDepth -= 1;\n\t\treturn a;\n\t}\n\n\n\tfunction countMember(m) {\n\t\tif (membersOnly && typeof membersOnly[m] !== \"boolean\") {\n\t\t\twarning(\"W036\", state.tokens.curr, m);\n\t\t}\n\t\tif (typeof member[m] === \"number\") {\n\t\t\tmember[m] += 1;\n\t\t} else {\n\t\t\tmember[m] = 1;\n\t\t}\n\t}\n\n\n\tfunction note_implied(tkn) {\n\t\tvar name = tkn.value, line = tkn.line, a = implied[name];\n\t\tif (typeof a === \"function\") {\n\t\t\ta = false;\n\t\t}\n\n\t\tif (!a) {\n\t\t\ta = [line];\n\t\t\timplied[name] = a;\n\t\t} else if (a[a.length - 1] !== line) {\n\t\t\ta.push(line);\n\t\t}\n\t}\n\n\n\t// Build the syntax table by declaring the syntactic elements of the language.\n\n\ttype(\"(number)\", function () {\n\t\treturn this;\n\t});\n\n\ttype(\"(string)\", function () {\n\t\treturn this;\n\t});\n\n\tstate.syntax[\"(identifier)\"] = {\n\t\ttype: \"(identifier)\",\n\t\tlbp: 0,\n\t\tidentifier: true,\n\t\tnud: function () {\n\t\t\tvar v = this.value,\n\t\t\t\ts = scope[v],\n\t\t\t\tf;\n\n\t\t\tif (typeof s === \"function\") {\n\t\t\t\t// Protection against accidental inheritance.\n\t\t\t\ts = undefined;\n\t\t\t} else if (typeof s === \"boolean\") {\n\t\t\t\tf = funct;\n\t\t\t\tfunct = functions[0];\n\t\t\t\taddlabel(v, \"var\");\n\t\t\t\ts = funct;\n\t\t\t\tfunct = f;\n\t\t\t}\n\n\t\t\t// The name is in scope and defined in the current function.\n\t\t\tif (funct === s) {\n\t\t\t\t// Change 'unused' to 'var', and reject labels.\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[v] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"unction\":\n\t\t\t\t\tfunct[v] = \"function\";\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"function\":\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (funct[\"(global)\"]) {\n\t\t\t\t// The name is not defined in the function. If we are in the global\n\t\t\t\t// scope, then we have an undefined variable.\n\t\t\t\t//\n\t\t\t\t// Operators typeof and delete do not raise runtime errors even if\n\t\t\t\t// the base object of a reference is null so no need to display warning\n\t\t\t\t// if we're inside of typeof or delete.\n\n\t\t\t\tif (typeof predefined[v] !== \"boolean\") {\n\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t(state.tokens.next && (state.tokens.next.value === \".\" ||\n\t\t\t\t\t\t\tstate.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t} else {\n\t\t\t\t// If the name is already defined in the current\n\t\t\t\t// function, but not as outer, then there is a scope error.\n\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"closure\":\n\t\t\t\tcase \"function\":\n\t\t\t\tcase \"var\":\n\t\t\t\tcase \"unused\":\n\t\t\t\t\twarning(\"W038\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outer\":\n\t\t\t\tcase \"global\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// If the name is defined in an outer function, make an outer entry,\n\t\t\t\t\t// and if it was unused, make it var.\n\t\t\t\t\tif (s === true) {\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t} else if (s === null) {\n\t\t\t\t\t\twarning(\"W039\", state.tokens.curr, v);\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else if (typeof s !== \"object\") {\n\t\t\t\t\t\t// Operators typeof and delete do not raise runtime errors even\n\t\t\t\t\t\t// if the base object of a reference is null so no need to\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// display warning if we're inside of typeof or delete.\n\t\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t\t(state.tokens.next &&\n\t\t\t\t\t\t\t\t(state.tokens.next.value === \".\" || state.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (s[v]) {\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\tcase \"unction\":\n\t\t\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"var\":\n\t\t\t\t\t\tcase \"unused\":\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"closure\":\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"label\":\n\t\t\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tled: function () {\n\t\t\terror(\"E033\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t};\n\n\ttype(\"(regexp)\", function () {\n\t\treturn this;\n\t});\n\n\t// ECMAScript parser\n\n\tdelim(\"(endline)\");\n\tdelim(\"(begin)\");\n\tdelim(\"(end)\").reach = true;\n\tdelim(\"(error)\").reach = true;\n\tdelim(\"}\").reach = true;\n\tdelim(\")\");\n\tdelim(\"]\");\n\tdelim(\"\\\"\").reach = true;\n\tdelim(\"'\").reach = true;\n\tdelim(\";\");\n\tdelim(\":\").reach = true;\n\tdelim(\",\");\n\tdelim(\"#\");\n\n\treserve(\"else\");\n\treserve(\"case\").reach = true;\n\treserve(\"catch\");\n\treserve(\"default\").reach = true;\n\treserve(\"finally\");\n\treservevar(\"arguments\", function (x) {\n\t\tif (state.directive[\"use strict\"] && funct[\"(global)\"]) {\n\t\t\twarning(\"E008\", x);\n\t\t}\n\t});\n\treservevar(\"eval\");\n\treservevar(\"false\");\n\treservevar(\"Infinity\");\n\treservevar(\"null\");\n\treservevar(\"this\", function (x) {\n\t\tif (state.directive[\"use strict\"] && !state.option.validthis && ((funct[\"(statement)\"] &&\n\t\t\t\tfunct[\"(name)\"].charAt(0) > \"Z\") || funct[\"(global)\"])) {\n\t\t\twarning(\"W040\", x);\n\t\t}\n\t});\n\treservevar(\"true\");\n\treservevar(\"undefined\");\n\n\tassignop(\"=\", \"assign\", 20);\n\tassignop(\"+=\", \"assignadd\", 20);\n\tassignop(\"-=\", \"assignsub\", 20);\n\tassignop(\"*=\", \"assignmult\", 20);\n\tassignop(\"/=\", \"assigndiv\", 20).nud = function () {\n\t\terror(\"E014\");\n\t};\n\tassignop(\"%=\", \"assignmod\", 20);\n\n\tbitwiseassignop(\"&=\", \"assignbitand\", 20);\n\tbitwiseassignop(\"|=\", \"assignbitor\", 20);\n\tbitwiseassignop(\"^=\", \"assignbitxor\", 20);\n\tbitwiseassignop(\"<<=\", \"assignshiftleft\", 20);\n\tbitwiseassignop(\">>=\", \"assignshiftright\", 20);\n\tbitwiseassignop(\">>>=\", \"assignshiftrightunsigned\", 20);\n\tinfix(\"?\", function (left, that) {\n\t\tthat.left = left;\n\t\tthat.right = expression(10);\n\t\tadvance(\":\");\n\t\tthat[\"else\"] = expression(10);\n\t\treturn that;\n\t}, 30);\n\n\tinfix(\"||\", \"or\", 40);\n\tinfix(\"&&\", \"and\", 50);\n\tbitwise(\"|\", \"bitor\", 70);\n\tbitwise(\"^\", \"bitxor\", 80);\n\tbitwise(\"&\", \"bitand\", 90);\n\trelation(\"==\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull && (left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq)\n\t\t\twarning(\"W116\", this, \"===\", \"==\");\n\t\telse if (isPoorRelation(left))\n\t\t\twarning(\"W041\", this, \"===\", left.value);\n\t\telse if (isPoorRelation(right))\n\t\t\twarning(\"W041\", this, \"===\", right.value);\n\n\t\treturn this;\n\t});\n\trelation(\"===\");\n\trelation(\"!=\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull &&\n\t\t\t\t(left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq) {\n\t\t\twarning(\"W116\", this, \"!==\", \"!=\");\n\t\t} else if (isPoorRelation(left)) {\n\t\t\twarning(\"W041\", this, \"!==\", left.value);\n\t\t} else if (isPoorRelation(right)) {\n\t\t\twarning(\"W041\", this, \"!==\", right.value);\n\t\t}\n\t\treturn this;\n\t});\n\trelation(\"!==\");\n\trelation(\"<\");\n\trelation(\">\");\n\trelation(\"<=\");\n\trelation(\">=\");\n\tbitwise(\"<<\", \"shiftleft\", 120);\n\tbitwise(\">>\", \"shiftright\", 120);\n\tbitwise(\">>>\", \"shiftrightunsigned\", 120);\n\tinfix(\"in\", \"in\", 120);\n\tinfix(\"instanceof\", \"instanceof\", 120);\n\tinfix(\"+\", function (left, that) {\n\t\tvar right = expression(130);\n\t\tif (left && right && left.id === \"(string)\" && right.id === \"(string)\") {\n\t\t\tleft.value += right.value;\n\t\t\tleft.character = right.character;\n\t\t\tif (!state.option.scripturl && reg.javascriptURL.test(left.value)) {\n\t\t\t\twarning(\"W050\", left);\n\t\t\t}\n\t\t\treturn left;\n\t\t}\n\t\tthat.left = left;\n\t\tthat.right = right;\n\t\treturn that;\n\t}, 130);\n\tprefix(\"+\", \"num\");\n\tprefix(\"+++\", function () {\n\t\twarning(\"W007\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"+++\", function (left) {\n\t\twarning(\"W007\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"-\", \"sub\", 130);\n\tprefix(\"-\", \"neg\");\n\tprefix(\"---\", function () {\n\t\twarning(\"W006\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"---\", function (left) {\n\t\twarning(\"W006\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"*\", \"mult\", 140);\n\tinfix(\"/\", \"div\", 140);\n\tinfix(\"%\", \"mod\", 140);\n\n\tsuffix(\"++\", \"postinc\");\n\tprefix(\"++\", \"preinc\");\n\tstate.syntax[\"++\"].exps = true;\n\n\tsuffix(\"--\", \"postdec\");\n\tprefix(\"--\", \"predec\");\n\tstate.syntax[\"--\"].exps = true;\n\tprefix(\"delete\", function () {\n\t\tvar p = expression(0);\n\t\tif (!p || (p.id !== \".\" && p.id !== \"[\")) {\n\t\t\twarning(\"W051\");\n\t\t}\n\t\tthis.first = p;\n\t\treturn this;\n\t}).exps = true;\n\n\tprefix(\"~\", function () {\n\t\tif (state.option.bitwise) {\n\t\t\twarning(\"W052\", this, \"~\");\n\t\t}\n\t\texpression(150);\n\t\treturn this;\n\t});\n\n\tprefix(\"!\", function () {\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\n\t\tif (!this.right) { // '!' followed by nothing? Give up.\n\t\t\tquit(\"E041\", this.line || 0);\n\t\t}\n\n\t\tif (bang[this.right.id] === true) {\n\t\t\twarning(\"W018\", this, \"!\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"typeof\", \"typeof\");\n\tprefix(\"new\", function () {\n\t\tvar c = expression(155), i;\n\t\tif (c && c.id !== \"function\") {\n\t\t\tif (c.identifier) {\n\t\t\t\tc[\"new\"] = true;\n\t\t\t\tswitch (c.value) {\n\t\t\t\tcase \"Number\":\n\t\t\t\tcase \"String\":\n\t\t\t\tcase \"Boolean\":\n\t\t\t\tcase \"Math\":\n\t\t\t\tcase \"JSON\":\n\t\t\t\t\twarning(\"W053\", state.tokens.prev, c.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Function\":\n\t\t\t\t\tif (!state.option.evil) {\n\t\t\t\t\t\twarning(\"W054\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Date\":\n\t\t\t\tcase \"RegExp\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (c.id !== \"function\") {\n\t\t\t\t\t\ti = c.value.substr(0, 1);\n\t\t\t\t\t\tif (state.option.newcap && (i < \"A\" || i > \"Z\") && !_.has(global, c.value)) {\n\t\t\t\t\t\t\twarning(\"W055\", state.tokens.curr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (c.id !== \".\" && c.id !== \"[\" && c.id !== \"(\") {\n\t\t\t\t\twarning(\"W056\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!state.option.supernew)\n\t\t\t\twarning(\"W057\", this);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\tif (state.tokens.next.id !== \"(\" && !state.option.supernew) {\n\t\t\twarning(\"W058\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\t\tthis.first = c;\n\t\treturn this;\n\t});\n\tstate.syntax[\"new\"].exps = true;\n\n\tprefix(\"void\").exps = true;\n\n\tinfix(\".\", function (left, that) {\n\t\tadjacent(state.tokens.prev, state.tokens.curr);\n\t\tnobreak();\n\t\tvar m = identifier(false, true);\n\n\t\tif (typeof m === \"string\") {\n\t\t\tcountMember(m);\n\t\t}\n\n\t\tthat.left = left;\n\t\tthat.right = m;\n\n\t\tif (m && m === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tif (left && left.value === \"arguments\" && (m === \"callee\" || m === \"caller\")) {\n\t\t\tif (state.option.noarg)\n\t\t\t\twarning(\"W059\", left, m);\n\t\t\telse if (state.directive[\"use strict\"])\n\t\t\t\terror(\"E008\");\n\t\t} else if (!state.option.evil && left && left.value === \"document\" &&\n\t\t\t\t(m === \"write\" || m === \"writeln\")) {\n\t\t\twarning(\"W060\", left);\n\t\t}\n\n\t\tif (!state.option.evil && (m === \"eval\" || m === \"execScript\")) {\n\t\t\twarning(\"W061\");\n\t\t}\n\n\t\treturn that;\n\t}, 160, true);\n\n\tinfix(\"(\", function (left, that) {\n\t\tif (state.tokens.prev.id !== \"}\" && state.tokens.prev.id !== \")\") {\n\t\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\t}\n\n\t\tnospace();\n\t\tif (state.option.immed && !left.immed && left.id === \"function\") {\n\t\t\twarning(\"W062\");\n\t\t}\n\n\t\tvar n = 0;\n\t\tvar p = [];\n\n\t\tif (left) {\n\t\t\tif (left.type === \"(identifier)\") {\n\t\t\t\tif (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {\n\t\t\t\t\tif (\"Number String Boolean Date Object\".indexOf(left.value) === -1) {\n\t\t\t\t\t\tif (left.value === \"Math\") {\n\t\t\t\t\t\t\twarning(\"W063\", left);\n\t\t\t\t\t\t} else if (state.option.newcap) {\n\t\t\t\t\t\t\twarning(\"W064\", left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\tp[p.length] = expression(10);\n\t\t\t\tn += 1;\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\");\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\n\t\tif (typeof left === \"object\") {\n\t\t\tif (left.value === \"parseInt\" && n === 1) {\n\t\t\t\twarning(\"W065\", state.tokens.curr);\n\t\t\t}\n\t\t\tif (!state.option.evil) {\n\t\t\t\tif (left.value === \"eval\" || left.value === \"Function\" ||\n\t\t\t\t\t\tleft.value === \"execScript\") {\n\t\t\t\t\twarning(\"W061\", left);\n\n\t\t\t\t\tif (p[0] && [0].id === \"(string)\") {\n\t\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t\t}\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t (left.value === \"setTimeout\" ||\n\t\t\t\t\t\tleft.value === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\n\t\t\t\t// window.setTimeout/setInterval\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t left.value === \".\" &&\n\t\t\t\t\t left.left.value === \"window\" &&\n\t\t\t\t\t (left.right === \"setTimeout\" ||\n\t\t\t\t\t\tleft.right === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!left.identifier && left.id !== \".\" && left.id !== \"[\" &&\n\t\t\t\t\tleft.id !== \"(\" && left.id !== \"&&\" && left.id !== \"||\" &&\n\t\t\t\t\tleft.id !== \"?\") {\n\t\t\t\twarning(\"W067\", left);\n\t\t\t}\n\t\t}\n\n\t\tthat.left = left;\n\t\treturn that;\n\t}, 155, true).exps = true;\n\n\tprefix(\"(\", function () {\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \"function\") {\n\t\t\tstate.tokens.next.immed = true;\n\t\t}\n\n\t\tvar exprs = [];\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\texprs.push(expression(0));\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\", this);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tif (state.option.immed && exprs[0].id === \"function\") {\n\t\t\tif (state.tokens.next.id !== \"(\" &&\n\t\t\t (state.tokens.next.id !== \".\" || (peek().value !== \"call\" && peek().value !== \"apply\"))) {\n\t\t\t\twarning(\"W068\", this);\n\t\t\t}\n\t\t}\n\n\t\treturn exprs[0];\n\t});\n\n\tinfix(\"[\", function (left, that) {\n\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\tnospace();\n\t\tvar e = expression(0), s;\n\t\tif (e && e.type === \"(string)\") {\n\t\t\tif (!state.option.evil && (e.value === \"eval\" || e.value === \"execScript\")) {\n\t\t\t\twarning(\"W061\", that);\n\t\t\t}\n\n\t\t\tcountMember(e.value);\n\t\t\tif (!state.option.sub && reg.identifier.test(e.value)) {\n\t\t\t\ts = state.syntax[e.value];\n\t\t\t\tif (!s || !isReserved(s)) {\n\t\t\t\t\twarning(\"W069\", state.tokens.prev, e.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tadvance(\"]\", that);\n\n\t\tif (e && e.value === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tthat.left = left;\n\t\tthat.right = e;\n\t\treturn that;\n\t}, 160, true);\n\n\tprefix(\"[\", function () {\n\t\tvar b = state.tokens.curr.line !== state.tokens.next.line;\n\t\tthis.first = [];\n\t\tif (b) {\n\t\t\tindent += state.option.indent;\n\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t}\n\t\t}\n\t\twhile (state.tokens.next.id !== \"(end)\") {\n\t\t\twhile (state.tokens.next.id === \",\") {\n\t\t\t\tif (!state.option.es5)\n\t\t\t\t\twarning(\"W070\");\n\t\t\t\tadvance(\",\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id === \"]\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (b && state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tthis.first.push(expression(10));\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\tif (state.tokens.next.id === \"]\" && !state.option.es5) {\n\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (b) {\n\t\t\tindent -= state.option.indent;\n\t\t\tindentation();\n\t\t}\n\t\tadvance(\"]\", this);\n\t\treturn this;\n\t}, 160);\n\n\n\tfunction property_name() {\n\t\tvar id = optionalidentifier(false, true);\n\n\t\tif (!id) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tid = state.tokens.next.value;\n\t\t\t\tadvance();\n\t\t\t} else if (state.tokens.next.id === \"(number)\") {\n\t\t\t\tid = state.tokens.next.value.toString();\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\n\t\tif (id === \"hasOwnProperty\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\treturn id;\n\t}\n\n\n\tfunction functionparams() {\n\t\tvar next = state.tokens.next;\n\t\tvar params = [];\n\t\tvar ident;\n\n\t\tadvance(\"(\");\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \")\") {\n\t\t\tadvance(\")\");\n\t\t\treturn;\n\t\t}\n\n\t\tfor (;;) {\n\t\t\tident = identifier(true);\n\t\t\tparams.push(ident);\n\t\t\taddlabel(ident, \"unused\", state.tokens.curr);\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma();\n\t\t\t} else {\n\t\t\t\tadvance(\")\", next);\n\t\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\t\treturn params;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfunction doFunction(name, statement) {\n\t\tvar f;\n\t\tvar oldOption = state.option;\n\t\tvar oldScope = scope;\n\n\t\tstate.option = Object.create(state.option);\n\t\tscope = Object.create(scope);\n\n\t\tfunct = {\n\t\t\t\"(name)\" : name || \"\\\"\" + anonname + \"\\\"\",\n\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\"(context)\" : funct,\n\t\t\t\"(breakage)\" : 0,\n\t\t\t\"(loopage)\" : 0,\n\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\"(scope)\" : scope,\n\t\t\t\"(statement)\": statement,\n\t\t\t\"(tokens)\" : {}\n\t\t};\n\n\t\tf = funct;\n\t\tstate.tokens.curr.funct = funct;\n\n\t\tfunctions.push(funct);\n\n\t\tif (name) {\n\t\t\taddlabel(name, \"function\");\n\t\t}\n\n\t\tfunct[\"(params)\"] = functionparams();\n\t\tfunct[\"(metrics)\"].verifyMaxParametersPerFunction(funct[\"(params)\"]);\n\n\t\tblock(false, false, true);\n\n\t\tfunct[\"(metrics)\"].verifyMaxStatementsPerFunction();\n\t\tfunct[\"(metrics)\"].verifyMaxComplexityPerFunction();\n\t\tfunct[\"(unusedOption)\"] = state.option.unused;\n\n\t\tscope = oldScope;\n\t\tstate.option = oldOption;\n\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\tfunct = funct[\"(context)\"];\n\n\t\treturn f;\n\t}\n\n\tfunction createMetrics(functionStartToken) {\n\t\treturn {\n\t\t\tstatementCount: 0,\n\t\t\tnestedBlockDepth: -1,\n\t\t\tComplexityCount: 1,\n\t\t\tverifyMaxStatementsPerFunction: function () {\n\t\t\t\tif (state.option.maxstatements &&\n\t\t\t\t\tthis.statementCount > state.option.maxstatements) {\n\t\t\t\t\twarning(\"W071\", functionStartToken, this.statementCount);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxParametersPerFunction: function (params) {\n\t\t\t\tparams = params || [];\n\n\t\t\t\tif (state.option.maxparams && params.length > state.option.maxparams) {\n\t\t\t\t\twarning(\"W072\", functionStartToken, params.length);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxNestedBlockDepthPerFunction: function () {\n\t\t\t\tif (state.option.maxdepth &&\n\t\t\t\t\tthis.nestedBlockDepth > 0 &&\n\t\t\t\t\tthis.nestedBlockDepth === state.option.maxdepth + 1) {\n\t\t\t\t\twarning(\"W073\", null, this.nestedBlockDepth);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxComplexityPerFunction: function () {\n\t\t\t\tvar max = state.option.maxcomplexity;\n\t\t\t\tvar cc = this.ComplexityCount;\n\t\t\t\tif (max && cc > max) {\n\t\t\t\t\twarning(\"W074\", functionStartToken, cc);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction increaseComplexityCount() {\n\t\tfunct[\"(metrics)\"].ComplexityCount += 1;\n\t}\n\n\t// Parse assignments that were found instead of conditionals.\n\t// For example: if (a = 1) { ... }\n\n\tfunction parseCondAssignment() {\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"=\":\n\t\tcase \"+=\":\n\t\tcase \"-=\":\n\t\tcase \"*=\":\n\t\tcase \"%=\":\n\t\tcase \"&=\":\n\t\tcase \"|=\":\n\t\tcase \"^=\":\n\t\tcase \"/=\":\n\t\t\tif (!state.option.boss) {\n\t\t\t\twarning(\"W084\");\n\t\t\t}\n\n\t\t\tadvance(state.tokens.next.id);\n\t\t\texpression(20);\n\t\t}\n\t}\n\n\n\t(function (x) {\n\t\tx.nud = function () {\n\t\t\tvar b, f, i, p, t;\n\t\t\tvar props = {}; // All properties, including accessors\n\n\t\t\tfunction saveProperty(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name))\n\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\telse\n\t\t\t\t\tprops[name] = {};\n\n\t\t\t\tprops[name].basic = true;\n\t\t\t\tprops[name].basictkn = tkn;\n\t\t\t}\n\n\t\t\tfunction saveSetter(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].setter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].setter = true;\n\t\t\t\tprops[name].setterToken = tkn;\n\t\t\t}\n\n\t\t\tfunction saveGetter(name) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].getter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].getter = true;\n\t\t\t\tprops[name].getterToken = state.tokens.curr;\n\t\t\t}\n\n\t\t\tb = state.tokens.curr.line !== state.tokens.next.line;\n\t\t\tif (b) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (;;) {\n\t\t\t\tif (state.tokens.next.id === \"}\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (b) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.value === \"get\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"get\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveGetter(i);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (p) {\n\t\t\t\t\t\twarning(\"W076\", t, p[0], i);\n\t\t\t\t\t}\n\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t} else if (state.tokens.next.value === \"set\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"set\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveSetter(i, state.tokens.next);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (!p || p.length !== 1) {\n\t\t\t\t\t\twarning(\"W077\", t, i);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tsaveProperty(i, state.tokens.next);\n\n\t\t\t\t\tif (typeof i !== \"string\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\texpression(10);\n\t\t\t\t}\n\n\t\t\t\tcountMember(i);\n\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\" && !state.option.es5) {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", this);\n\n\t\t\t// Check for lonely setters if in the ES5 mode.\n\t\t\tif (state.option.es5) {\n\t\t\t\tfor (var name in props) {\n\t\t\t\t\tif (_.has(props, name) && props[name].setter && !props[name].getter) {\n\t\t\t\t\t\twarning(\"W078\", props[name].setterToken);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\tx.fud = function () {\n\t\t\terror(\"E036\", state.tokens.curr);\n\t\t};\n\t}(delim(\"{\")));\n\n\t// This Function is called when esnext option is set to true\n\t// it adds the `const` statement to JSHINT\n\n\tuseESNextSyntax = function () {\n\t\tvar conststatement = stmt(\"const\", function (prefix) {\n\t\t\tvar id, name, value;\n\n\t\t\tthis.first = [];\n\t\t\tfor (;;) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tid = identifier();\n\t\t\t\tif (funct[id] === \"const\") {\n\t\t\t\t\twarning(\"E011\", null, id);\n\t\t\t\t}\n\t\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\taddlabel(id, \"const\");\n\t\t\t\tif (prefix) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tname = state.tokens.curr;\n\t\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\t\tif (state.tokens.next.id !== \"=\") {\n\t\t\t\t\twarning(\"E012\", state.tokens.curr, id);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tadvance(\"=\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t\t}\n\t\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\t\terror(\"E037\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue = expression(0);\n\t\t\t\t\tname.first = value;\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t\tconststatement.exps = true;\n\t};\n\n\tvar varstatement = stmt(\"var\", function (prefix) {\n\t\t// JavaScript does not have block scope. It only has function scope. So,\n\t\t// declaring a variable in a block can have unexpected consequences.\n\t\tvar id, name, value;\n\n\t\tif (funct[\"(onevar)\"] && state.option.onevar) {\n\t\t\twarning(\"W081\");\n\t\t} else if (!funct[\"(global)\"]) {\n\t\t\tfunct[\"(onevar)\"] = true;\n\t\t}\n\n\t\tthis.first = [];\n\n\t\tfor (;;) {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tid = identifier();\n\n\t\t\tif (state.option.esnext && funct[id] === \"const\") {\n\t\t\t\twarning(\"E011\", null, id);\n\t\t\t}\n\n\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t}\n\n\t\t\taddlabel(id, \"unused\", state.tokens.curr);\n\n\t\t\tif (prefix) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tname = state.tokens.curr;\n\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\"=\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\terror(\"E038\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tvalue = expression(0);\n\t\t\t\tname.first = value;\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcomma();\n\t\t}\n\t\treturn this;\n\t});\n\tvarstatement.exps = true;\n\n\tblockstmt(\"function\", function () {\n\t\tif (inblock) {\n\t\t\twarning(\"W082\", state.tokens.curr);\n\n\t\t}\n\t\tvar i = identifier();\n\t\tif (state.option.esnext && funct[i] === \"const\") {\n\t\t\twarning(\"E011\", null, i);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\taddlabel(i, \"unction\", state.tokens.curr);\n\n\t\tdoFunction(i, { statement: true });\n\t\tif (state.tokens.next.id === \"(\" && state.tokens.next.line === state.tokens.curr.line) {\n\t\t\terror(\"E039\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"function\", function () {\n\t\tvar i = optionalidentifier();\n\t\tif (i || state.option.gcl) {\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t} else {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\t\tdoFunction(i);\n\t\tif (!state.option.loopfunc && funct[\"(loopage)\"]) {\n\t\t\twarning(\"W083\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"if\", function () {\n\t\tvar t = state.tokens.next;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tif (state.tokens.next.id === \"else\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"else\");\n\t\t\tif (state.tokens.next.id === \"if\" || state.tokens.next.id === \"switch\") {\n\t\t\t\tstatement(true);\n\t\t\t} else {\n\t\t\t\tblock(true, true);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"try\", function () {\n\t\tvar b;\n\n\t\tfunction doCatch() {\n\t\t\tvar oldScope = scope;\n\t\t\tvar e;\n\n\t\t\tadvance(\"catch\");\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(\");\n\n\t\t\tscope = Object.create(oldScope);\n\n\t\t\te = state.tokens.next.value;\n\t\t\tif (state.tokens.next.type !== \"(identifier)\") {\n\t\t\t\te = null;\n\t\t\t\twarning(\"E030\", state.tokens.next, e);\n\t\t\t}\n\n\t\t\tadvance();\n\t\t\tadvance(\")\");\n\n\t\t\tfunct = {\n\t\t\t\t\"(name)\" : \"(catch)\",\n\t\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\t\"(context)\" : funct,\n\t\t\t\t\"(breakage)\" : funct[\"(breakage)\"],\n\t\t\t\t\"(loopage)\" : funct[\"(loopage)\"],\n\t\t\t\t\"(scope)\" : scope,\n\t\t\t\t\"(statement)\": false,\n\t\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\t\"(catch)\" : true,\n\t\t\t\t\"(tokens)\" : {}\n\t\t\t};\n\n\t\t\tif (e) {\n\t\t\t\taddlabel(e, \"exception\");\n\t\t\t}\n\n\t\t\tstate.tokens.curr.funct = funct;\n\t\t\tfunctions.push(funct);\n\n\t\t\tblock(false);\n\n\t\t\tscope = oldScope;\n\n\t\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\t\tfunct = funct[\"(context)\"];\n\t\t}\n\n\t\tblock(false);\n\n\t\tif (state.tokens.next.id === \"catch\") {\n\t\t\tincreaseComplexityCount();\n\t\t\tdoCatch();\n\t\t\tb = true;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"finally\") {\n\t\t\tadvance(\"finally\");\n\t\t\tblock(false);\n\t\t\treturn;\n\t\t} else if (!b) {\n\t\t\terror(\"E021\", state.tokens.next, \"catch\", state.tokens.next.value);\n\t\t}\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"while\", function () {\n\t\tvar t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tfunct[\"(breakage)\"] -= 1;\n\t\tfunct[\"(loopage)\"] -= 1;\n\t\treturn this;\n\t}).labelled = true;\n\n\tblockstmt(\"with\", function () {\n\t\tvar t = state.tokens.next;\n\t\tif (state.directive[\"use strict\"]) {\n\t\t\terror(\"E010\", state.tokens.curr);\n\t\t} else if (!state.option.withstmt) {\n\t\t\twarning(\"W085\", state.tokens.curr);\n\t\t}\n\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(0);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"switch\", function () {\n\t\tvar t = state.tokens.next,\n\t\t\tg = false;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tthis.condition = expression(20);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\t\tadvance(\"{\");\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tindent += state.option.indent;\n\t\tthis.cases = [];\n\n\t\tfor (;;) {\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"case\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"case\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"switch\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// You can tell JSHint that you don't use break intentionally by\n\t\t\t\t\t// adding a comment /* falls through */ on a line just before\n\t\t\t\t\t// the next `case`.\n\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"case\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"case\");\n\t\t\t\tthis.cases.push(expression(20));\n\t\t\t\tincreaseComplexityCount();\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tfunct[\"(verb)\"] = \"case\";\n\t\t\t\tbreak;\n\t\t\tcase \"default\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Do not display a warning if 'default' is the first statement or if\n\t\t\t\t\t// there is a special /* falls through */ comment.\n\t\t\t\t\tif (this.cases.length) {\n\t\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"default\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"default\");\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tbreak;\n\t\t\tcase \"}\":\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t\tadvance(\"}\", t);\n\t\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\t\tfunct[\"(verb)\"] = undefined;\n\t\t\t\treturn;\n\t\t\tcase \"(end)\":\n\t\t\t\terror(\"E023\", state.tokens.next, \"}\");\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\tif (g) {\n\t\t\t\t\tswitch (state.tokens.curr.id) {\n\t\t\t\t\tcase \",\":\n\t\t\t\t\t\terror(\"E040\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \":\":\n\t\t\t\t\t\tg = false;\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E025\", state.tokens.curr);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (state.tokens.curr.id === \":\") {\n\t\t\t\t\t\tadvance(\":\");\n\t\t\t\t\t\terror(\"E024\", state.tokens.curr, \":\");\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(\"E021\", state.tokens.next, \"case\", state.tokens.next.value);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).labelled = true;\n\n\tstmt(\"debugger\", function () {\n\t\tif (!state.option.debug) {\n\t\t\twarning(\"W087\");\n\t\t}\n\t\treturn this;\n\t}).exps = true;\n\n\t(function () {\n\t\tvar x = stmt(\"do\", function () {\n\t\t\tfunct[\"(breakage)\"] += 1;\n\t\t\tfunct[\"(loopage)\"] += 1;\n\t\t\tincreaseComplexityCount();\n\n\t\t\tthis.first = block(true);\n\t\t\tadvance(\"while\");\n\t\t\tvar t = state.tokens.next;\n\t\t\tnonadjacent(state.tokens.curr, t);\n\t\t\tadvance(\"(\");\n\t\t\tnospace();\n\t\t\texpression(20);\n\t\t\tparseCondAssignment();\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t});\n\t\tx.labelled = true;\n\t\tx.exps = true;\n\t}());\n\n\tblockstmt(\"for\", function () {\n\t\tvar s, t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tif (peek(state.tokens.next.id === \"var\" ? 1 : 0).id === \"in\") {\n\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\tadvance(\"var\");\n\t\t\t\tvarstatement.fud.call(varstatement, true);\n\t\t\t} else {\n\t\t\t\tswitch (funct[state.tokens.next.value]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[state.tokens.next.value] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"var\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twarning(\"W088\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tadvance();\n\t\t\t}\n\t\t\tadvance(\"in\");\n\t\t\texpression(20);\n\t\t\tadvance(\")\", t);\n\t\t\ts = block(true, true);\n\t\t\tif (state.option.forin && s && (s.length > 1 || typeof s[0] !== \"object\" ||\n\t\t\t\t\ts[0].value !== \"if\")) {\n\t\t\t\twarning(\"W089\", this);\n\t\t\t}\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t} else {\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\t\tadvance(\"var\");\n\t\t\t\t\tvarstatement.fud.call(varstatement);\n\t\t\t\t} else {\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomma();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\texpression(20);\n\t\t\t\tparseCondAssignment();\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\terror(\"E021\", state.tokens.next, \")\", \";\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \")\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcomma();\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tblock(true, true);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t}\n\t}).labelled = true;\n\n\n\tstmt(\"break\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\t\treachable(\"break\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"continue\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t} else if (!funct[\"(loopage)\"]) {\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\t\t}\n\t\treachable(\"continue\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"return\", function () {\n\t\tif (this.line === state.tokens.next.line) {\n\t\t\tif (state.tokens.next.id === \"(regexp)\")\n\t\t\t\twarning(\"W092\");\n\n\t\t\tif (state.tokens.next.id !== \";\" && !state.tokens.next.reach) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tthis.first = expression(0);\n\n\t\t\t\tif (this.first.type === \"(punctuator)\" && this.first.value === \"=\" && !state.option.boss) {\n\t\t\t\t\twarningAt(\"W093\", this.first.line, this.first.character);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!state.option.asi) {\n\t\t\tnolinebreak(this); // always warn (Line breaking error)\n\t\t}\n\t\treachable(\"return\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"throw\", function () {\n\t\tnolinebreak(this);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tthis.first = expression(20);\n\t\treachable(\"throw\");\n\t\treturn this;\n\t}).exps = true;\n\n\t// Future Reserved Words\n\n\tFutureReservedWord(\"abstract\");\n\tFutureReservedWord(\"boolean\");\n\tFutureReservedWord(\"byte\");\n\tFutureReservedWord(\"char\");\n\tFutureReservedWord(\"class\", { es5: true });\n\tFutureReservedWord(\"double\");\n\tFutureReservedWord(\"enum\", { es5: true });\n\tFutureReservedWord(\"export\", { es5: true });\n\tFutureReservedWord(\"extends\", { es5: true });\n\tFutureReservedWord(\"final\");\n\tFutureReservedWord(\"float\");\n\tFutureReservedWord(\"goto\");\n\tFutureReservedWord(\"implements\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"import\", { es5: true });\n\tFutureReservedWord(\"int\");\n\tFutureReservedWord(\"interface\");\n\tFutureReservedWord(\"let\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"long\");\n\tFutureReservedWord(\"native\");\n\tFutureReservedWord(\"package\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"private\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"protected\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"public\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"short\");\n\tFutureReservedWord(\"static\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"super\", { es5: true });\n\tFutureReservedWord(\"synchronized\");\n\tFutureReservedWord(\"throws\");\n\tFutureReservedWord(\"transient\");\n\tFutureReservedWord(\"volatile\");\n\tFutureReservedWord(\"yield\", { es5: true, strictOnly: true });\n\n\t// Parse JSON\n\n\tfunction jsonValue() {\n\n\t\tfunction jsonObject() {\n\t\t\tvar o = {}, t = state.tokens.next;\n\t\t\tadvance(\"{\");\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E026\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t} else if (state.tokens.next.id !== \"(string)\") {\n\t\t\t\t\t\twarning(\"W095\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tif (o[state.tokens.next.value] === true) {\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else if ((state.tokens.next.value === \"__proto__\" &&\n\t\t\t\t\t\t!state.option.proto) || (state.tokens.next.value === \"__iterator__\" &&\n\t\t\t\t\t\t!state.option.iterator)) {\n\t\t\t\t\t\twarning(\"W096\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\to[state.tokens.next.value] = true;\n\t\t\t\t\t}\n\t\t\t\t\tadvance();\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"}\");\n\t\t}\n\n\t\tfunction jsonArray() {\n\t\t\tvar t = state.tokens.next;\n\t\t\tadvance(\"[\");\n\t\t\tif (state.tokens.next.id !== \"]\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E027\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"]\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t}\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"]\");\n\t\t}\n\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"{\":\n\t\t\tjsonObject();\n\t\t\tbreak;\n\t\tcase \"[\":\n\t\t\tjsonArray();\n\t\t\tbreak;\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\tcase \"null\":\n\t\tcase \"(number)\":\n\t\tcase \"(string)\":\n\t\t\tadvance();\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tadvance(\"-\");\n\t\t\tif (state.tokens.curr.character !== state.tokens.next.from) {\n\t\t\t\twarning(\"W011\", state.tokens.curr);\n\t\t\t}\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(number)\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\terror(\"E003\", state.tokens.next);\n\t\t}\n\t}\n\n\n\t// The actual JSHINT function itself.\n\tvar itself = function (s, o, g) {\n\t\tvar a, i, k, x;\n\t\tvar optionKeys;\n\t\tvar newOptionObj = {};\n\n\t\tstate.reset();\n\n\t\tif (o && o.scope) {\n\t\t\tJSHINT.scope = o.scope;\n\t\t} else {\n\t\t\tJSHINT.errors = [];\n\t\t\tJSHINT.undefs = [];\n\t\t\tJSHINT.internals = [];\n\t\t\tJSHINT.blacklist = {};\n\t\t\tJSHINT.scope = \"(main)\";\n\t\t}\n\n\t\tpredefined = Object.create(null);\n\t\tcombine(predefined, vars.ecmaIdentifiers);\n\t\tcombine(predefined, vars.reservedVars);\n\n\t\tcombine(predefined, g || {});\n\n\t\tdeclared = Object.create(null);\n\t\texported = Object.create(null);\n\t\tignored = Object.create(null);\n\n\t\tif (o) {\n\t\t\ta = o.predef;\n\t\t\tif (a) {\n\t\t\t\tif (!Array.isArray(a) && typeof a === \"object\") {\n\t\t\t\t\ta = Object.keys(a);\n\t\t\t\t}\n\n\t\t\t\ta.forEach(function (item) {\n\t\t\t\t\tvar slice, prop;\n\n\t\t\t\t\tif (item[0] === \"-\") {\n\t\t\t\t\t\tslice = item.slice(1);\n\t\t\t\t\t\tJSHINT.blacklist[slice] = slice;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprop = Object.getOwnPropertyDescriptor(o.predef, item);\n\t\t\t\t\t\tpredefined[item] = prop ? prop.value : false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\toptionKeys = Object.keys(o);\n\t\t\tfor (x = 0; x < optionKeys.length; x++) {\n\t\t\t\tif (/^-W\\d{3}$/g.test(optionKeys[x])) {\n\t\t\t\t\tignored[optionKeys[x].slice(1)] = true;\n\t\t\t\t} else {\n\t\t\t\t\tnewOptionObj[optionKeys[x]] = o[optionKeys[x]];\n\n\t\t\t\t\tif (optionKeys[x] === \"newcap\" && o[optionKeys[x]] === false)\n\t\t\t\t\t\tnewOptionObj[\"(explicitNewcap)\"] = true;\n\n\t\t\t\t\tif (optionKeys[x] === \"indent\")\n\t\t\t\t\t\tnewOptionObj[\"(explicitIndent)\"] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstate.option = newOptionObj;\n\n\t\tstate.option.indent = state.option.indent || 4;\n\t\tstate.option.maxerr = state.option.maxerr || 50;\n\n\t\tindent = 1;\n\t\tglobal = Object.create(predefined);\n\t\tscope = global;\n\t\tfunct = {\n\t\t\t\"(global)\": true,\n\t\t\t\"(name)\":\t \"(global)\",\n\t\t\t\"(scope)\":\t scope,\n\t\t\t\"(breakage)\": 0,\n\t\t\t\"(loopage)\": 0,\n\t\t\t\"(tokens)\": {},\n\t\t\t\"(metrics)\": createMetrics(state.tokens.next)\n\t\t};\n\t\tfunctions = [funct];\n\t\turls = [];\n\t\tstack = null;\n\t\tmember = {};\n\t\tmembersOnly = null;\n\t\timplied = {};\n\t\tinblock = false;\n\t\tlookahead = [];\n\t\twarnings = 0;\n\t\tunuseds = [];\n\n\t\tif (!isString(s) && !Array.isArray(s)) {\n\t\t\terrorAt(\"E004\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tvar api = {\n\t\t\tget isJSON() {\n\t\t\t\treturn state.jsonMode;\n\t\t\t},\n\n\t\t\tgetOption: function (name) {\n\t\t\t\treturn state.option[name] || null;\n\t\t\t},\n\n\t\t\tgetCache: function (name) {\n\t\t\t\treturn state.cache[name];\n\t\t\t},\n\n\t\t\tsetCache: function (name, value) {\n\t\t\t\tstate.cache[name] = value;\n\t\t\t},\n\n\t\t\twarn: function (code, data) {\n\t\t\t\twarningAt.apply(null, [ code, data.line, data.char ].concat(data.data));\n\t\t\t},\n\n\t\t\ton: function (names, listener) {\n\t\t\t\tnames.split(\" \").forEach(function (name) {\n\t\t\t\t\temitter.on(name, listener);\n\t\t\t\t}.bind(this));\n\t\t\t}\n\t\t};\n\n\t\temitter.removeAllListeners();\n\t\t(extraModules || []).forEach(function (func) {\n\t\t\tfunc(api);\n\t\t});\n\n\t\tstate.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax[\"(begin)\"];\n\n\t\tlex = new Lexer(s);\n\n\t\tlex.on(\"warning\", function (ev) {\n\t\t\twarningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"error\", function (ev) {\n\t\t\terrorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"fatal\", function (ev) {\n\t\t\tquit(\"E041\", ev.line, ev.from);\n\t\t});\n\n\t\tlex.on(\"Identifier\", function (ev) {\n\t\t\temitter.emit(\"Identifier\", ev);\n\t\t});\n\n\t\tlex.on(\"String\", function (ev) {\n\t\t\temitter.emit(\"String\", ev);\n\t\t});\n\n\t\tlex.on(\"Number\", function (ev) {\n\t\t\temitter.emit(\"Number\", ev);\n\t\t});\n\n\t\tlex.start();\n\n\t\t// Check options\n\t\tfor (var name in o) {\n\t\t\tif (_.has(o, name)) {\n\t\t\t\tcheckOption(name, state.tokens.curr);\n\t\t\t}\n\t\t}\n\n\t\tassume();\n\n\t\t// combine the passed globals after we've assumed all our options\n\t\tcombine(predefined, g || {});\n\n\t\t//reset values\n\t\tcomma.first = true;\n\n\t\ttry {\n\t\t\tadvance();\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"{\":\n\t\t\tcase \"[\":\n\t\t\t\tstate.option.laxbreak = true;\n\t\t\t\tstate.jsonMode = true;\n\t\t\t\tjsonValue();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdirectives();\n\n\t\t\t\tif (state.directive[\"use strict\"]) {\n\t\t\t\t\tif (!state.option.globalstrict && !state.option.node) {\n\t\t\t\t\t\twarning(\"W097\", state.tokens.prev);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstatements();\n\t\t\t}\n\t\t\tadvance((state.tokens.next && state.tokens.next.value !== \".\")\t? \"(end)\" : undefined);\n\n\t\t\tvar markDefined = function (name, context) {\n\t\t\t\tdo {\n\t\t\t\t\tif (typeof context[name] === \"string\") {\n\t\t\t\t\t\t// JSHINT marks unused variables as 'unused' and\n\t\t\t\t\t\t// unused function declaration as 'unction'. This\n\t\t\t\t\t\t// code changes such instances back 'var' and\n\t\t\t\t\t\t// 'closure' so that the code in JSHINT.data()\n\t\t\t\t\t\t// doesn't think they're unused.\n\n\t\t\t\t\t\tif (context[name] === \"unused\")\n\t\t\t\t\t\t\tcontext[name] = \"var\";\n\t\t\t\t\t\telse if (context[name] === \"unction\")\n\t\t\t\t\t\t\tcontext[name] = \"closure\";\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext = context[\"(context)\"];\n\t\t\t\t} while (context);\n\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tvar clearImplied = function (name, line) {\n\t\t\t\tif (!implied[name])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar newImplied = [];\n\t\t\t\tfor (var i = 0; i < implied[name].length; i += 1) {\n\t\t\t\t\tif (implied[name][i] !== line)\n\t\t\t\t\t\tnewImplied.push(implied[name][i]);\n\t\t\t\t}\n\n\t\t\t\tif (newImplied.length === 0)\n\t\t\t\t\tdelete implied[name];\n\t\t\t\telse\n\t\t\t\t\timplied[name] = newImplied;\n\t\t\t};\n\n\t\t\tvar warnUnused = function (name, tkn, type, unused_opt) {\n\t\t\t\tvar line = tkn.line;\n\t\t\t\tvar chr = tkn.character;\n\n\t\t\t\tif (unused_opt === undefined) {\n\t\t\t\t\tunused_opt = state.option.unused;\n\t\t\t\t}\n\n\t\t\t\tif (unused_opt === true) {\n\t\t\t\t\tunused_opt = \"last-param\";\n\t\t\t\t}\n\n\t\t\t\tvar warnable_types = {\n\t\t\t\t\t\"vars\": [\"var\"],\n\t\t\t\t\t\"last-param\": [\"var\", \"last-param\"],\n\t\t\t\t\t\"strict\": [\"var\", \"param\", \"last-param\"]\n\t\t\t\t};\n\n\t\t\t\tif (unused_opt) {\n\t\t\t\t\tif (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) {\n\t\t\t\t\t\twarningAt(\"W098\", line, chr, name);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunuseds.push({\n\t\t\t\t\tname: name,\n\t\t\t\t\tline: line,\n\t\t\t\t\tcharacter: chr\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tvar checkUnused = function (func, key) {\n\t\t\t\tvar type = func[key];\n\t\t\t\tvar tkn = func[\"(tokens)\"][key];\n\n\t\t\t\tif (key.charAt(0) === \"(\")\n\t\t\t\t\treturn;\n\n\t\t\t\tif (type !== \"unused\" && type !== \"unction\")\n\t\t\t\t\treturn;\n\n\t\t\t\t// Params are checked separately from other variables.\n\t\t\t\tif (func[\"(params)\"] && func[\"(params)\"].indexOf(key) !== -1)\n\t\t\t\t\treturn;\n\n\t\t\t\t// Variable is in global scope and defined as exported.\n\t\t\t\tif (func[\"(global)\"] && _.has(exported, key)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twarnUnused(key, tkn, \"var\");\n\t\t\t};\n\n\t\t\t// Check queued 'x is not defined' instances to see if they're still undefined.\n\t\t\tfor (i = 0; i < JSHINT.undefs.length; i += 1) {\n\t\t\t\tk = JSHINT.undefs[i].slice(0);\n\n\t\t\t\tif (markDefined(k[2].value, k[0])) {\n\t\t\t\t\tclearImplied(k[2].value, k[2].line);\n\t\t\t\t} else if (state.option.undef) {\n\t\t\t\t\twarning.apply(warning, k.slice(1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunctions.forEach(function (func) {\n\t\t\t\tif (func[\"(unusedOption)\"] === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in func) {\n\t\t\t\t\tif (_.has(func, key)) {\n\t\t\t\t\t\tcheckUnused(func, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!func[\"(params)\"])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar params = func[\"(params)\"].slice();\n\t\t\t\tvar param = params.pop();\n\t\t\t\tvar type, unused_type;\n\n\t\t\t\twhile (param) {\n\t\t\t\t\ttype = func[param];\n\t\t\t\t\tunused_type = (params.length === func[\"(params)\"].length - 1 ? \"last-param\" : \"param\");\n\n\t\t\t\t\t// 'undefined' is a special case for (function (window, undefined) { ... })();\n\t\t\t\t\t// patterns.\n\n\t\t\t\t\tif (param === \"undefined\")\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (type === \"unused\" || type === \"unction\") {\n\t\t\t\t\t\twarnUnused(param, func[\"(tokens)\"][param], unused_type, func[\"(unusedOption)\"]);\n\t\t\t\t\t}\n\n\t\t\t\t\tparam = params.pop();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfor (var key in declared) {\n\t\t\t\tif (_.has(declared, key) && !_.has(global, key)) {\n\t\t\t\t\twarnUnused(key, declared[key], \"var\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (err) {\n\t\t\tif (err && err.name === \"JSHintError\") {\n\t\t\t\tvar nt = state.tokens.next || {};\n\t\t\t\tJSHINT.errors.push({\n\t\t\t\t\tscope : \"(main)\",\n\t\t\t\t\traw : err.raw,\n\t\t\t\t\treason : err.message,\n\t\t\t\t\tline : err.line || nt.line,\n\t\t\t\t\tcharacter : err.character || nt.from\n\t\t\t\t}, null);\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\n\t\t// Loop over the listed \"internals\", and check them as well.\n\n\t\tif (JSHINT.scope === \"(main)\") {\n\t\t\to = o || {};\n\n\t\t\tfor (i = 0; i < JSHINT.internals.length; i += 1) {\n\t\t\t\tk = JSHINT.internals[i];\n\t\t\t\to.scope = k.elem;\n\t\t\t\titself(k.value, o, g);\n\t\t\t}\n\t\t}\n\n\t\treturn JSHINT.errors.length === 0;\n\t};\n\n\t// Modules.\n\titself.addModule = function (func) {\n\t\textraModules.push(func);\n\t};\n\n\titself.addModule(style.register);\n\n\t// Data summary.\n\titself.data = function () {\n\t\tvar data = {\n\t\t\tfunctions: [],\n\t\t\toptions: state.option\n\t\t};\n\t\tvar implieds = [];\n\t\tvar members = [];\n\t\tvar fu, f, i, j, n, globals;\n\n\t\tif (itself.errors.length) {\n\t\t\tdata.errors = itself.errors;\n\t\t}\n\n\t\tif (state.jsonMode) {\n\t\t\tdata.json = true;\n\t\t}\n\n\t\tfor (n in implied) {\n\t\t\tif (_.has(implied, n)) {\n\t\t\t\timplieds.push({\n\t\t\t\t\tname: n,\n\t\t\t\t\tline: implied[n]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (implieds.length > 0) {\n\t\t\tdata.implieds = implieds;\n\t\t}\n\n\t\tif (urls.length > 0) {\n\t\t\tdata.urls = urls;\n\t\t}\n\n\t\tglobals = Object.keys(scope);\n\t\tif (globals.length > 0) {\n\t\t\tdata.globals = globals;\n\t\t}\n\n\t\tfor (i = 1; i < functions.length; i += 1) {\n\t\t\tf = functions[i];\n\t\t\tfu = {};\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tfu[functionicity[j]] = [];\n\t\t\t}\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tif (fu[functionicity[j]].length === 0) {\n\t\t\t\t\tdelete fu[functionicity[j]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfu.name = f[\"(name)\"];\n\t\t\tfu.param = f[\"(params)\"];\n\t\t\tfu.line = f[\"(line)\"];\n\t\t\tfu.character = f[\"(character)\"];\n\t\t\tfu.last = f[\"(last)\"];\n\t\t\tfu.lastcharacter = f[\"(lastcharacter)\"];\n\t\t\tdata.functions.push(fu);\n\t\t}\n\n\t\tif (unuseds.length > 0) {\n\t\t\tdata.unused = unuseds;\n\t\t}\n\n\t\tmembers = [];\n\t\tfor (n in member) {\n\t\t\tif (typeof member[n] === \"number\") {\n\t\t\t\tdata.member = member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t};\n\n\titself.jshint = itself;\n\n\treturn itself;\n}());\n\n// Make JSHINT a Node module, if possible.\nif (typeof exports === \"object\" && exports) {\n\texports.JSHINT = JSHINT;\n}\n\n//@ sourceURL=/src/stable/jshint.js" -)); -require("/src/stable/jshint.js"); - -JSHINT = require('/src/stable/jshint.js').JSHINT;})(); - -/*jshint boss: true, rhino: true, unused: true, undef: true, white: true, quotmark: double */ -/*global JSHINT */ - -(function (args) { - "use strict"; - - var filenames = []; - var optstr; // arg1=val1,arg2=val2,... - var predef; // global1=true,global2,global3,... - var opts = {}; - var retval = 0; - - args.forEach(function (arg) { - if (arg.indexOf("=") > -1) { - if (!optstr) { - // First time it's the options. - optstr = arg; - } else { - predef = arg; - } - - return; - } - - if (optstr) { - predef = arg; - return; - } - - filenames.push(arg); - }); - - if (filenames.length === 0) { - print("Usage: jshint.js file.js"); - quit(1); - } - - if (optstr) { - optstr.split(",").forEach(function (arg) { - var o = arg.split("="); - if (o[0] === "indent") { - opts[o[0]] = parseInt(o[1], 10); - } else { - opts[o[0]] = (function (ov) { - switch (ov) { - case "true": - return true; - case "false": - return false; - default: - return ov; - } - }(o[1])); - } - }); - } - - if (predef) { - opts.predef = {}; - - predef.split(",").forEach(function (arg) { - var global = arg.split("="); - opts.predef[global[0]] = global[1] === "true" ? true : false; - }); - } - - filenames.forEach(function (name) { - var input = readFile(name); - - if (!input) { - print("jshint: Couldn't open file " + name); - quit(1); - } - - if (!JSHINT(input, opts)) { - for (var i = 0, err; err = JSHINT.errors[i]; i += 1) { - print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")"); - print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); - print(""); - } - retval = 1; - } - }); - - quit(retval); -}(arguments)); diff --git a/deploy/core/node_modules/jshint/dist/jshint-rhino-1.1.0.js b/deploy/core/node_modules/jshint/dist/jshint-rhino-1.1.0.js deleted file mode 100755 index b082c3703..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-rhino-1.1.0.js +++ /dev/null @@ -1,10773 +0,0 @@ -#!/usr/bin/env rhino - -var window = {};//1.1.0 -var JSHINT; -(function () { -var require; -require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -} - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],2:[function(require,module,exports){ -(function(process){if (!process.EventEmitter) process.EventEmitter = function () {}; - -var EventEmitter = exports.EventEmitter = process.EventEmitter; -var isArray = typeof Array.isArray === 'function' - ? Array.isArray - : function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]' - } -; -function indexOf (xs, x) { - if (xs.indexOf) return xs.indexOf(x); - for (var i = 0; i < xs.length; i++) { - if (x === xs[i]) return i; - } - return -1; -} - -// By default EventEmitters will print a warning if more than -// 10 listeners are added to it. This is a useful default which -// helps finding memory leaks. -// -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -var defaultMaxListeners = 10; -EventEmitter.prototype.setMaxListeners = function(n) { - if (!this._events) this._events = {}; - this._events.maxListeners = n; -}; - - -EventEmitter.prototype.emit = function(type) { - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events || !this._events.error || - (isArray(this._events.error) && !this._events.error.length)) - { - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - if (!this._events) return false; - var handler = this._events[type]; - if (!handler) return false; - - if (typeof handler == 'function') { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - return true; - - } else if (isArray(handler)) { - var args = Array.prototype.slice.call(arguments, 1); - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - return true; - - } else { - return false; - } -}; - -// EventEmitter is defined in src/node_events.cc -// EventEmitter.prototype.emit() is also defined there. -EventEmitter.prototype.addListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('addListener only takes instances of Function'); - } - - if (!this._events) this._events = {}; - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } else if (isArray(this._events[type])) { - - // Check for listener leak - if (!this._events[type].warned) { - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - - // If we've already got an array, just append. - this._events[type].push(listener); - } else { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - var self = this; - self.on(type, function g() { - self.removeListener(type, g); - listener.apply(this, arguments); - }); - - return this; -}; - -EventEmitter.prototype.removeListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('removeListener only takes instances of Function'); - } - - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events || !this._events[type]) return this; - - var list = this._events[type]; - - if (isArray(list)) { - var i = indexOf(list, listener); - if (i < 0) return this; - list.splice(i, 1); - if (list.length == 0) - delete this._events[type]; - } else if (this._events[type] === listener) { - delete this._events[type]; - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - this._events = {}; - return this; - } - - // does not use listeners(), so no side effect of creating _events[type] - if (type && this._events && this._events[type]) this._events[type] = null; - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - if (!this._events) this._events = {}; - if (!this._events[type]) this._events[type] = []; - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; -}; - -})(require("__browserify_process")) -},{"__browserify_process":1}],3:[function(require,module,exports){ -(function(){// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - DataView : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval: false -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - - -})() -},{}],4:[function(require,module,exports){ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use string"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; - -},{}],5:[function(require,module,exports){ -"use strict"; - -var state = { - syntax: {}, - - reset: function () { - this.tokens = { - prev: null, - next: null, - curr: null - }, - - this.option = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - } -}; - -exports.state = state; - -},{}],6:[function(require,module,exports){ -(function(){"use strict"; - -exports.register = function (linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for dangling underscores. - - linter.on("Identifier", function style_scanDangling(data) { - if (!linter.getOption("nomen")) { - return; - } - - // Underscore.js - if (data.name === "_") { - return; - } - - // In Node, __dirname and __filename should be ignored. - if (linter.getOption("node")) { - if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { - return; - } - } - - if (/^(_+.*|.*_+)$/.test(data.name)) { - linter.warn("W105", { - line: data.line, - char: data.from, - data: [ "dangling '_'", data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+/, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; -})() -},{}],"jshint":[function(require,module,exports){ -module.exports=require('B01lSJ'); -},{}],"B01lSJ":[function(require,module,exports){ -(function(){/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * 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. - * - */ - -/*jshint quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = require("underscore"); -var events = require("events"); -var vars = require("../shared/vars.js"); -var messages = require("../shared/messages.js"); -var Lexer = require("./lex.js").Lexer; -var reg = require("./reg.js"); -var state = require("./state.js").state; -var style = require("./style.js"); - -// We need this module here because environments such as IE and Rhino -// don't necessarilly expose the 'console' API and browserify uses -// it to log things. It's a sad state of affair, really. -var console = require("console-browserify"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - api, // Extension API - - // These are operators that should not be used with the ! operator. - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es5 : true, // if ES5 syntax should be allowed - esnext : true, // if es.next specific syntax should be allowed - moz : true, // if mozilla specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - gcl : true, // if JSHint should be compatible with Google Closure Linter - globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - passfail : true, // if the scan should stop on first error - phantom : true, // if PhantomJS symbols should be allowed - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true, // YUI variables should be predefined - - // Obsolete options - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false, // {int} max cyclomatic complexity per function - unused : true, // warn if variables are unused. Available options: - // false - don't check for unused variables - // true - "vars" + check last function param - // "vars" - skip checking unused function params - // "strict" - "vars" + check all function params - latedef : false // warn if the variable is used before its definition - // false - don't emit any warnings - // true - warn if any variable is used before its definition - // "nofunc" - warn for any variable but function declarations - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus: true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true, - strict : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows: "wsh", - sloppy : "strict" - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - ignored, // Ignored warnings - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - noreach, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - warnings, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^-W\d{3}$/g.test(name)) { - return true; - } - - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - if (t.type !== "jslint" || renamedOptions[name] === undefined) { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.es5 && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (_.has(o, n) && !_.has(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - } - - // let's assume that chronologically ES5 < ES6/ESNext < Moz - function isAfterESNext() { - return state.option.moz || state.option.esnext; - } - function isAfterES5() { - return state.option.moz || state.option.esnext || state.option.es5; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, code, token, a) { - return JSHINT.undefs.push([scope, code, token, a]); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (ignored[code]) { - return; - } - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - if (state.option.passfail) { - quit("E042", l, ch); - } - - warnings += 1; - if (warnings >= state.option.maxerr) { - quit("E043", l, ch); - } - - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - function addlabel(t, type, tkn, islet) { - // Define t in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], t)) { - if (funct[t] !== true && !state.option.node) { - warning("W002", state.tokens.next, t); - } - } - } - - if (_.has(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - } else { - if (!state.option.shadow && type !== "exception" || - (funct["(blockscope)"].getlabel(t))) { - warning("W004", state.tokens.next, t); - } - } - } - - // a double definition of a let variable in same block throws a TypeError - if (funct["(blockscope)"] && funct["(blockscope)"].current.has(t)) { - error("E044", state.tokens.next, t); - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(t, type, state.tokens.curr); - } else { - - funct[t] = type; - - if (tkn) { - funct["(tokens)"][t] = tkn; - } - - if (funct["(global)"]) { - global[t] = funct; - if (_.has(implied, t)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function (g) { - g = g.split(":"); - var key = g[0]; - var val = g[1]; - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - updatePredefined(); - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function (e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function (m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\b", "\b") - .replace("\\t", "\t") - .replace("\\n", "\n") - .replace("\\v", "\v") - .replace("\\f", "\f") - .replace("\\r", "\r") - .replace("\\\\", "\\") - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - if (key === "indent") { - state.option["(explicitIndent)"] = true; - } - - state.option[key] = val; - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - if (funct["(global)"]) { - error("E009"); - } else { - if (val === "true" || val === "false") { - state.option.validthis = (val === "true"); - } else { - error("E002", nt); - } - } - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - if (/^-W\d{3}$/g.test(key)) { - ignored[key.slice(1)] = true; - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = renamedOptions[key] || key; - state.option[tn] = (val === "true"); - - if (invertedOptions[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - assume(); - } - } - - // We need a peek function. If it has an argument, it peeks that much farther - // ahead. It is used to distinguish - // for ( var i in ... - // from - // for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (state.tokens.curr.type === "(string)" || state.tokens.curr.identifier) { - anonname = state.tokens.curr.value; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - // This is the heart of JSHINT, the Pratt parser. In addition to parsing, it - // is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is - // like .nud except that it is only used on the first token of a statement. - // Having .fud makes it much easier to define statement-oriented languages like - // JavaScript. I retained Pratt's nomenclature. - - // .nud Null denotation - // .fud First null denotation - // .led Left denotation - // lbp Left binding power - // rbp Right binding power - - // They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false, isLetExpr = false; - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.moz) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.syntax["let"].fud.call(state.syntax["let"].fud, false); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - advance(); - - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = state.tokens.curr.value; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - var end_of_expr = state.tokens.next.identifier && - !state.tokens.curr.led && - state.tokens.curr.line !== state.tokens.next.line; - while (rbp < state.tokens.next.lbp && !end_of_expr) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && (left.character !== right.from || left.line !== right.line)) { - warning("W012", right, right.value); - } - } - - function nospace(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - - if (left.value === ";" && right.value === ";") { - return; - } - - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== right.line) { - warning("W014", right, right.id); - } else if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function indentation(bias) { - if (!state.option.white && !state.option["(explicitIndent)"]) { - return; - } - - if (state.tokens.next.id === "(end)") { - return; - } - - var i = indent + (bias || 0); - if (state.tokens.next.from !== i) { - warning("W015", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== state.tokens.next.line) { - warning("E022", t, t.value); - } - } - - - function comma(opts) { - opts = opts || {}; - - if (state.tokens.curr.line !== state.tokens.next.line) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", state.tokens.curr, state.tokens.next.id); - } - } else if (!state.tokens.curr.comment && - state.tokens.curr.character !== state.tokens.next.from && state.option.white) { - state.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from); - warning("W011", state.tokens.curr, state.tokens.curr.value); - } - - advance(","); - - // TODO: This is a temporary solution to fight against false-positives in - // arrays and objects with trailing commas (see GH-363). The best solution - // would be to extract all whitespace rules out of parser. - - if (state.tokens.next.value !== "]" && state.tokens.next.value !== "}") { - nonadjacent(state.tokens.curr, state.tokens.next); - } - - if (state.tokens.next.identifier && !state.option.es5) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "yield": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - } - } - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - return symbol(s, 0); - } - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - return this; - }; - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, function () { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - return x; - } - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function (left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", right, "!"); - } - - this.left = left; - this.right = right; - return this; - }; - return x; - } - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (left) { - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left || left.left.value === "arguments") { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function (t) { - if (funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left || left.left.value === "arguments") { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - that.right = expression(19); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - nonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(19); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function (left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop) { - if (!state.tokens.next.identifier) { - return; - } - - advance(); - - var curr = state.tokens.curr; - var meta = curr.meta || {}; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.es5 || meta.isFutureReservedWord) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - // Display an info message about reserved words as properties - // and ES5 but do it only once. - if (prop && !api.getCache("displayed:I002")) { - api.setCache("displayed:I002", true); - warning("I002"); - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop); - if (i) { - return i; - } - if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { - warning("W025"); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (state.tokens.next.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!state.option.latedef) { - break; - } - - warning("W026", t); - break; - } - - warning("W027", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var values; - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord) { - warning("W024", t, t.id); - res = false; - } - - // detect a destructuring assignment - if (_.has(["[", "{"], t.value)) { - if (lookupBlockType().isDestAssign) { - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - values = destructuringExpression(); - values.forEach(function (tok) { - isundef(funct, "W117", tok.token, tok.id); - }); - advance("="); - destructuringExpressionMatch(values, expression(0, true)); - advance(";"); - return; - } - } - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - if (reg.javascriptURL.test(t.value + ":")) { - warning("W029", t, t.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - - if (state.tokens.next.id === ",") { - return comma(); - } - - if (state.tokens.next.id !== ";") { - if (!state.option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!state.option.lastsemic || state.tokens.next.id !== "}" || - state.tokens.next.line !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - adjacent(state.tokens.curr, state.tokens.next); - advance(";"); - nonadjacent(state.tokens.curr, state.tokens.next); - } - } - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement(startLine === state.tokens.next.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("W033", state.tokens.next); - } else { - p = pn; - } - } else if (p.id === "}") { - // Directive with no other statements, warn about missing semicolon - warning("W033", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) - state.option.newcap = true; - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - if (line !== state.tokens.next.line) { - indentation(); - } - } else if (line !== state.tokens.next.line) { - indentation(); - } - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - if (stmt && !state.option.moz) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - expression(0); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - noreach = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement(state.tokens.next.line === state.tokens.curr.line)]; - indent -= state.option.indent; - noreach = false; - - delete funct["(nolet)"]; - } - funct["(verb)"] = null; - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035"); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value, line = tkn.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - var block; - if (_.has(funct, "(blockscope)")) { - block = funct["(blockscope)"].getlabel(v); - } - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && (state.tokens.next.value === "." || - state.tokens.next.value === "["))) { - - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - } - } - - note_implied(state.tokens.curr); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // - // display warning if we're inside of typeof or delete. - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && - (state.tokens.next.value === "." || state.tokens.next.value === "["))) { - - isundef(funct, "W117", state.tokens.curr, v); - } - funct[v] = true; - note_implied(state.tokens.curr); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - led: function () { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (state.directive["use strict"] && !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) - warning("W116", this, "===", "=="); - else if (isPoorRelation(left)) - warning("W041", this, "===", left.value); - else if (isPoorRelation(right)) - warning("W041", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("W007"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("W006"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("W051"); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (state.option.bitwise) { - warning("W052", this, "~"); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("W053", state.tokens.prev, c.value); - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - adjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(state.tokens.prev, state.tokens.curr); - nobreak(); - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - warning("W061"); - } - - return that; - }, 160, true); - - infix("(", function (left, that) { - if (state.tokens.prev.id !== "}" && state.tokens.prev.id !== ")") { - nobreak(state.tokens.prev, state.tokens.curr); - } - - nospace(); - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - nospace(state.tokens.prev, state.tokens.curr); - - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("W067", left); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - nospace(); - - if (state.tokens.next.id === "function") { - state.tokens.next.immed = true; - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - exprs.push(expression(0)); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")", this); - nospace(state.tokens.prev, state.tokens.curr); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - (state.tokens.next.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning("W068", this); - } - } - - return exprs[0]; - }); - - infix("[", function (left, that) { - nobreak(state.tokens.prev, state.tokens.curr); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("W061", that); - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - nospace(state.tokens.prev, state.tokens.curr); - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - res.right = expression(0); - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.moz) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(0); - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(0); - advance(")"); - } - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function () { - var blocktype = lookupBlockType(true); - if (blocktype.isCompArray) { - if (!state.option.moz) { - warning("W118", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !isAfterESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== state.tokens.next.line; - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!isAfterES5()) - warning("W070"); - advance(","); - } - if (state.tokens.next.id === "]") { - break; - } - if (b && state.tokens.curr.line !== state.tokens.next.line) { - indentation(); - } - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.es5) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(false, true); - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - advance(); - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - advance(); - } - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - - function functionparams() { - var next = state.tokens.next; - var params = []; - var ident; - var tokens = []; - - advance("("); - nospace(); - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (var t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } - if (state.tokens.next.id === ",") { - comma(); - } else { - advance(")", next); - nospace(state.tokens.prev, state.tokens.curr); - return params; - } - } - } - - - function doFunction(name, statement, generator) { - var f; - var oldOption = state.option; - var oldScope = scope; - - state.option = Object.create(state.option); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : state.tokens.next.line, - "(character)" : state.tokens.next.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(state.tokens.next), - "(scope)" : scope, - "(statement)" : statement, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)" : funct["(comparray)"] - }; - - if (generator) { - funct["(generator)"] = true; - } - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(); - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, true, true); - - if (generator && funct["(generator)"] !== "yielded") { - error("E047", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function parseCondAssignment() { - switch (state.tokens.next.id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!state.option.boss) { - warning("W084"); - } - - advance(state.tokens.next.id); - expression(20); - } - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t; - var props = {}; // All properties, including accessors - - function saveProperty(name, tkn) { - if (props[name] && _.has(props, name)) - warning("W075", state.tokens.next, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basictkn = tkn; - } - - function saveSetter(name, tkn) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].setter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = tkn; - } - - function saveGetter(name) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].getter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = state.tokens.curr; - } - - b = state.tokens.curr.line !== state.tokens.next.line; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - if (b) { - indentation(); - } - - if (state.tokens.next.value === "get" && peek().id !== ":") { - advance("get"); - - if (!state.option.es5) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveGetter(i); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (p) { - warning("W076", t, p[0], i); - } - - adjacent(state.tokens.curr, state.tokens.next); - } else if (state.tokens.next.value === "set" && peek().id !== ":") { - advance("set"); - - if (!state.option.es5) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveSetter(i, state.tokens.next); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (!p || p.length !== 1) { - warning("W077", t, i); - } - } else { - i = property_name(); - saveProperty(i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - - advance(":"); - nonadjacent(state.tokens.curr, state.tokens.next); - expression(10); - } - - countMember(i); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.es5) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (state.option.es5) { - for (var name in props) { - if (_.has(props, name) && props[name].setter && !props[name].getter) { - warning("W078", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function () { - var ident; - if (_.contains(["[", "{"], state.tokens.next.value)) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (state.tokens.next.value === ",") { - identifiers.push({ id: null, token: state.tokens.curr }); - } else { - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - } - }; - if (state.tokens.next.value === "[") { - advance("["); - nextInnerDE(); - while (state.tokens.next.value !== "]") { - advance(","); - nextInnerDE(); - } - advance("]"); - } else if (state.tokens.next.value === "{") { - advance("{"); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (state.tokens.next.value !== "}") { - advance(","); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - function destructuringExpressionMatch(tokens, value) { - if (value.first) { - _.zip(tokens, value.first).forEach(function (val) { - var token = val[0]; - var value = val[1]; - if (token && value) { - token.first = value; - } else if (token && token.first && !value) { - warning("W080", token.first, token.first.value); - } /* else { - XXX value is discarded: wouldn't it need a warning ? - } */ - }); - } - } - - var conststatement = stmt("const", function (prefix) { - var tokens, value; - // state variable to know if it is a lone identifier, or a destructuring statement. - var lone; - - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "const"); - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "const"); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var tokens, lone, value; - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (isAfterESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "unused", t.token); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E038", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - var letstatement = stmt("let", function (prefix) { - var tokens, lone, value, letblock; - - if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.moz) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (isAfterESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, "unused", t.token, true); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.esnext && !state.option.moz) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = identifier(); - if (funct[i] === "const") { - warning("E011", null, i); - } - adjacent(state.tokens.curr, state.tokens.next); - addlabel(i, "unction", state.tokens.curr); - - doFunction(i, { statement: true }, generator); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - if (!state.option.esnext) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - var i = optionalidentifier(); - if (i || state.option.gcl) { - adjacent(state.tokens.curr, state.tokens.next); - } else { - nonadjacent(state.tokens.curr, state.tokens.next); - } - doFunction(i, undefined, generator); - if (!state.option.loopfunc && funct["(loopage)"]) { - warning("W083"); - } - return this; - }); - - blockstmt("if", function () { - var t = state.tokens.next; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - if (state.tokens.next.id === "else") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(state.tokens.curr, state.tokens.next); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = { - "(name)" : "(catch)", - "(line)" : state.tokens.next.line, - "(character)": state.tokens.next.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(state.tokens.next), - "(catch)" : true, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)": funct["(comparray)"] - }; - - if (e) { - addlabel(e, "exception"); - } - - if (state.tokens.next.value === "if") { - if (!state.option.moz) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(false); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.moz)) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(false); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = state.tokens.next, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - advance("{"); - nonadjacent(state.tokens.curr, state.tokens.next); - indent += state.option.indent; - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - indentation(-state.option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - indentation(-state.option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= state.option.indent; - indentation(); - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!state.option.debug) { - warning("W087"); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = state.tokens.next; - nonadjacent(state.tokens.curr, t); - advance("("); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.moz) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && - nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!isAfterESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud, true); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud, true); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - if (!funct["(blockscope)"].getlabel(state.tokens.next.value)) - warning("W088", state.tokens.next, state.tokens.next.value); - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - s = block(true, true); - if (state.option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("W089", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - expression(20); - parseCondAssignment(); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - stmt("yield", function () { - if (state.option.esnext && funct["(generator)"] !== true) { - error("E046", state.tokens.curr, "yield"); - } else if (!isAfterESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface"); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("throws"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine wether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function (notjson) { - var pn, pn1; - var i = 0; - var bracketStack = 0; - var ret = {}; - state.jsonMode = "probing"; - state.jsonWarnings = []; - if (_.contains(["[", "{"], state.tokens.curr.value)) - bracketStack += 1; - if (_.contains(["[", "{"], state.tokens.next.value)) - bracketStack += 1; - if (_.contains(["]", "}"], state.tokens.next.value)) - bracketStack -= 1; - do { - pn = peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (_.contains(["[", "{"], pn.value)) { - bracketStack += 1; - } else if (_.contains(["]", "}"], pn.value)) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (_.contains(["}", "]"], pn.value) && pn1.value === "=") { - ret.isDestAssign = true; - ret.notJson = true; - break; - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)" && i < 15); - if (!ret.notJson && !notjson) { - for (var w in state.jsonWarnings) { - w = state.jsonWarnings[w]; - warningAt(w.code, w.line, w.character, w.data && w.data[0]); - } - } - state.jsonMode = false; - delete state.jsonWarnings; - return ret; - }; - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!isAfterESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function () { - var CompArray = function () { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function (elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function (elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return {stack: function () { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function () { - _current.variables.filter(function (v) { - if (v.unused) - warning("W098", v.token, v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(_carrays[_carrays.length - 1], 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function (s) { - if (_.contains(["use", "define", "filter"], s)) - _current.mode = s; - }, - check: function (v) { - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false}); - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true}); - } - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (state.tokens.curr.character !== state.tokens.next.from) { - warning("W011", state.tokens.curr); - } - adjacent(state.tokens.curr, state.tokens.next); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function () { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function () { - _current = {}; - _variables.push(_current); - }, - - unstack: function () { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function (l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l)) { - return _variables[i]; - } - } - }, - - current: { - has: function (t) { - return _.has(_current, t); - }, - add: function (t, type, tok) { - _current[t] = { "(type)" : type, - "(token)": tok }; - } - } - }; - }; - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - ignored = Object.create(null); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - - a.forEach(function (item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - ignored[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj["(explicitIndent)"] = true; - } - } - } - - state.option = newOptionObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(state.tokens.next), - "(blockscope)": blockScope(), - "(comparray)": arrayComprehension() - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - warnings = 0; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function (name) { - return state.option[name] || null; - }, - - getCache: function (name) { - return state.cache[name]; - }, - - setCache: function (name, value) { - state.cache[name] = value; - }, - - warn: function (code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function (names, listener) { - names.split(" ").forEach(function (name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function (func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - lex = new Lexer(s); - - lex.on("warning", function (ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function (ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function (ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function (ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function (ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function (ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict && !state.option.node) { - warning("W097", state.tokens.prev); - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.character; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "last-param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - warningAt("W098", line, chr, name); - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) { - return; - } - - warnUnused(key, tkn, "var"); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_type; - - while (param) { - type = func[param]; - unused_type = (params.length === func["(params)"].length - 1 ? "last-param" : "param"); - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], unused_type, func["(unusedOption)"]); - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function (func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: state.option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} - -})() -},{"events":2,"../shared/vars.js":3,"../shared/messages.js":7,"./lex.js":8,"./reg.js":4,"./state.js":5,"./style.js":6,"underscore":9,"console-browserify":10}],9:[function(require,module,exports){ -(function(){// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); - -})() -},{}],10:[function(require,module,exports){ -(function(global){/*global window, global*/ -var util = require("util") -var assert = require("assert") - -var slice = Array.prototype.slice -var console -var times = {} - -if (typeof global !== "undefined" && global.console) { - console = global.console -} else if (typeof window !== "undefined" && window.console) { - console = window.console -} else { - console = window.console = {} -} - -var functions = [ - [log, "log"] - , [info, "info"] - , [warn, "warn"] - , [error, "error"] - , [time, "time"] - , [timeEnd, "timeEnd"] - , [trace, "trace"] - , [dir, "dir"] - , [assert, "assert"] -] - -for (var i = 0; i < functions.length; i++) { - var tuple = functions[i] - var f = tuple[0] - var name = tuple[1] - - if (!console[name]) { - console[name] = f - } -} - -module.exports = console - -function log() {} - -function info() { - console.log.apply(console, arguments) -} - -function warn() { - console.log.apply(console, arguments) -} - -function error() { - console.warn.apply(console, arguments) -} - -function time(label) { - times[label] = Date.now() -} - -function timeEnd(label) { - var time = times[label] - if (!time) { - throw new Error("No such label: " + label) - } - - var duration = Date.now() - time - console.log(label + ": " + duration + "ms") -} - -function trace() { - var err = new Error() - err.name = "Trace" - err.message = util.format.apply(null, arguments) - console.error(err.stack) -} - -function dir(object) { - console.log(util.inspect(object) + "\n") -} - -function assert(expression) { - if (!expression) { - var arr = slice.call(arguments, 1) - assert.ok(false, util.format.apply(null, arr)) - } -} - -})(window) -},{"util":11,"assert":12}],11:[function(require,module,exports){ -var events = require('events'); - -exports.isArray = isArray; -exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'}; -exports.isRegExp = function(obj){return Object.prototype.toString.call(obj) === '[object RegExp]'}; - - -exports.print = function () {}; -exports.puts = function () {}; -exports.debug = function() {}; - -exports.inspect = function(obj, showHidden, depth, colors) { - var seen = []; - - var stylize = function(str, styleType) { - // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - var styles = - { 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] }; - - var style = - { 'special': 'cyan', - 'number': 'blue', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' }[styleType]; - - if (style) { - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; - } else { - return str; - } - }; - if (! colors) { - stylize = function(str, styleType) { return str; }; - } - - function format(value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value !== exports && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return value.inspect(recurseTimes); - } - - // Primitive types cannot have properties - switch (typeof value) { - case 'undefined': - return stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return stylize(simple, 'string'); - - case 'number': - return stylize('' + value, 'number'); - - case 'boolean': - return stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return stylize('null', 'null'); - } - - // Look up the keys of the object. - var visible_keys = Object_keys(value); - var keys = showHidden ? Object_getOwnPropertyNames(value) : visible_keys; - - // Functions without properties can be shortcutted. - if (typeof value === 'function' && keys.length === 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - var name = value.name ? ': ' + value.name : ''; - return stylize('[Function' + name + ']', 'special'); - } - } - - // Dates without properties can be shortcutted - if (isDate(value) && keys.length === 0) { - return stylize(value.toUTCString(), 'date'); - } - - var base, type, braces; - // Determine the object type - if (isArray(value)) { - type = 'Array'; - braces = ['[', ']']; - } else { - type = 'Object'; - braces = ['{', '}']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; - } else { - base = ''; - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + value.toUTCString(); - } - - if (keys.length === 0) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - return stylize('[Object]', 'special'); - } - } - - seen.push(value); - - var output = keys.map(function(key) { - var name, str; - if (value.__lookupGetter__) { - if (value.__lookupGetter__(key)) { - if (value.__lookupSetter__(key)) { - str = stylize('[Getter/Setter]', 'special'); - } else { - str = stylize('[Getter]', 'special'); - } - } else { - if (value.__lookupSetter__(key)) { - str = stylize('[Setter]', 'special'); - } - } - } - if (visible_keys.indexOf(key) < 0) { - name = '[' + key + ']'; - } - if (!str) { - if (seen.indexOf(value[key]) < 0) { - if (recurseTimes === null) { - str = format(value[key]); - } else { - str = format(value[key], recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (isArray(value)) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (type === 'Array' && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = stylize(name, 'string'); - } - } - - return name + ': ' + str; - }); - - seen.pop(); - - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.length + 1; - }, 0); - - if (length > 50) { - output = braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - - } else { - output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - return output; - } - return format(obj, (typeof depth === 'undefined' ? 2 : depth)); -}; - - -function isArray(ar) { - return ar instanceof Array || - Array.isArray(ar) || - (ar && ar !== Object.prototype && isArray(ar.__proto__)); -} - - -function isRegExp(re) { - return re instanceof RegExp || - (typeof re === 'object' && Object.prototype.toString.call(re) === '[object RegExp]'); -} - - -function isDate(d) { - if (d instanceof Date) return true; - if (typeof d !== 'object') return false; - var properties = Date.prototype && Object_getOwnPropertyNames(Date.prototype); - var proto = d.__proto__ && Object_getOwnPropertyNames(d.__proto__); - return JSON.stringify(proto) === JSON.stringify(properties); -} - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - -exports.log = function (msg) {}; - -exports.pump = null; - -var Object_keys = Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; -}; - -var Object_getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) { - var res = []; - for (var key in obj) { - if (Object.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; - -var Object_create = Object.create || function (prototype, properties) { - // from es5-shim - var object; - if (prototype === null) { - object = { '__proto__' : null }; - } - else { - if (typeof prototype !== 'object') { - throw new TypeError( - 'typeof prototype[' + (typeof prototype) + '] != \'object\'' - ); - } - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (typeof properties !== 'undefined' && Object.defineProperties) { - Object.defineProperties(object, properties); - } - return object; -}; - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object_create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (typeof f !== 'string') { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(exports.inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': return JSON.stringify(args[i++]); - default: - return x; - } - }); - for(var x = args[i]; i < len; x = args[++i]){ - if (x === null || typeof x !== 'object') { - str += ' ' + x; - } else { - str += ' ' + exports.inspect(x); - } - } - return str; -}; - -},{"events":2}],12:[function(require,module,exports){ -(function(){// UTILITY -var util = require('util'); -var Buffer = require("buffer").Buffer; -var pSlice = Array.prototype.slice; - -function objectKeys(object) { - if (Object.keys) return Object.keys(object); - var result = []; - for (var name in object) { - if (Object.prototype.hasOwnProperty.call(object, name)) { - result.push(name); - } - } - return result; -} - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -util.inherits(assert.AssertionError, Error); - -function replacer(key, value) { - if (value === undefined) { - return '' + value; - } - if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) { - return value.toString(); - } - if (typeof value === 'function' || value instanceof RegExp) { - return value.toString(); - } - return value; -} - -function truncate(s, n) { - if (typeof s == 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } -} - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name + ':', this.message].join(' '); - } else { - return [ - this.name + ':', - truncate(JSON.stringify(this.actual, replacer), 128), - this.operator, - truncate(JSON.stringify(this.expected, replacer), 128) - ].join(' '); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -function ok(value, message) { - if (!!!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = objectKeys(a), - kb = objectKeys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (expected instanceof RegExp) { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail('Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail('Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -})() -},{"util":11,"buffer":13}],7:[function(require,module,exports){ -(function(){"use strict"; - -var _ = require("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' form line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: "Constant {a} was not declared correctly.", - E038: "Variable {a} was not declared correctly.", - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: "'{a}' is already defined and can't be redefined.", - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: "A generator function shall contain a yield statement.", - E048: "Let declaration not directly within block." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing pluses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", - W011: "Unexpected space after '{a}'.", - W012: "Unexpected space before '{a}'.", - W013: "Missing space after '{a}'.", - W014: "Bad line breaking before '{a}'.", - W015: "Expected '{a}' to have an indentation at {b} instead at {c}.", - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W029: "Label '{a}' looks like a javascript url.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' unnecessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate key '{a}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: "Too many var statements.", - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Expected a conditional expression and instead saw an assignment.", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: "Mixed spaces and tabs.", - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: "Trailing whitespace.", - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is only available in JavaScript 1.7.", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option)." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: "Reserved words as properties can be used under the 'es5' option." -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function (desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function (desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function (desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); - -})() -},{"underscore":9}],8:[function(require,module,exports){ -(function(){/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = require("underscore"); -var events = require("events"); -var reg = require("./reg.js"); -var state = require("./state.js").state; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9 -}; - -// This is auto generated from the unicode tables. -// The tables are at: -// http://www.fileformat.info/info/unicode/category/Lu/list.htm -// http://www.fileformat.info/info/unicode/category/Ll/list.htm -// http://www.fileformat.info/info/unicode/category/Lt/list.htm -// http://www.fileformat.info/info/unicode/category/Lm/list.htm -// http://www.fileformat.info/info/unicode/category/Lo/list.htm -// http://www.fileformat.info/info/unicode/category/Nl/list.htm - -var unicodeLetterTable = [ - 170, 170, 181, 181, 186, 186, 192, 214, - 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, - 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, - 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, - 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, - 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, - 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, - 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, - 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361, - 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, - 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, - 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, - 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, - 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, - 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, - 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, - 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, - 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, - 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, - 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, - 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, - 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, - 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, - 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, - 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, - 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, - 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, - 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, - 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, - 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, - 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, - 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, - 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346, - 4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696, - 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, - 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, - 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, - 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, - 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, - 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, - 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, - 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, - 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141, - 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, - 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, - 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, - 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, - 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, - 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, - 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, - 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, - 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, - 11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621, - 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, - 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, - 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, - 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, - 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, - 12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312, - 19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124, - 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, - 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, - 42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921, - 43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042, - 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, - 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, - 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, - 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, - 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, - 43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798, - 43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032, - 55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045, - 64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279, - 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, - 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, - 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, - 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, - 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, - 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, - 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, - 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, - 66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511, - 66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592, - 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, - 67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115, - 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, - 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, - 69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894, - 92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964, - 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, - 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, - 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, - 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, - 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, - 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, - 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, - 131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972, - 177984, 177984, 178205, 178205, 194560, 195101 -]; - -var identifierStartTable = []; - -for (var i = 0; i < 128; i++) { - identifierStartTable[i] = - i === 36 || // $ - i >= 65 && i <= 90 || // A-Z - i === 95 || // _ - i >= 97 && i <= 122; // a-z -} - -var identifierPartTable = []; - -for (var i = 0; i < 128; i++) { - identifierPartTable[i] = - identifierStartTable[i] || // $, _, A-Z, a-z - i >= 48 && i <= 57; // 0-9 -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function (data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - - if (lines[0] && lines[0].substr(0, 2) === "#!") { - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.lines = lines; - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - get lines() { - this._lines = state.lines; - return this._lines; - }, - - set lines(val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function (i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function (i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function (data) { - * // ... - * }); - */ - on: function (names, listener) { - names.split(" ").forEach(function (name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function () { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function () { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "{": - case "}": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. We need to make sure that this is an - // operator and not a regular expression. - - if (ch1 === "/") { - if (ch2 === "=" && /\/=(?!(\S*\/[gim]?))/.test(this.input)) { - // /= is not a part of a regular expression, return it as a - // punctuator. - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function () { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - special.forEach(function (str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function () { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function () { - var id = ""; - var index = 0; - var type, char; - - // Detects any character in the Unicode categories "Uppercase - // letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter - // (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or - // "Letter number (Nl)". - // - // Both approach and unicodeLetterTable were borrowed from - // Google's Traceur. - - function isUnicodeLetter(code) { - for (var i = 0; i < unicodeLetterTable.length;) { - if (code < unicodeLetterTable[i++]) { - return false; - } - - if (code <= unicodeLetterTable[i++]) { - return true; - } - } - - return false; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function () { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (isUnicodeLetter(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: id - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function () { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - index += 1; - value += char; - - while (index < length) { - char = this.peek(index); - if (!isHexDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 16, - isMalformed: false - }; - } - - // Base-8 numbers. - if (isOctalDigit(char)) { - index += 1; - value += char; - bad = false; - - while (index < length) { - char = this.peek(index); - - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - - if (isDecimalDigit(char)) { - bad = true; - } else if (!isOctalDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 8, - isMalformed: false - }; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 10, - isMalformed: !isFinite(value) - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function () { - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - if (quote !== "\"") { - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W108", - line: this.line, - character: this.char // +1? - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }); - } - } - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - if (!state.option.multistr) { - this.trigger("warning", { - code: "W043", - line: this.line, - character: this.char - }); - } else if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W042", - line: this.line, - character: this.char - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W042", - line: this.line, - character: this.char - }); - } - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - isUnclosed: true, - quote: quote - }; - } - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - - if (char === "\\") { - this.skip(); - char = this.peek(); - - switch (char) { - case "'": - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }); - } - break; - case "b": - char = "\b"; - break; - case "f": - char = "\f"; - break; - case "n": - char = "\n"; - break; - case "r": - char = "\r"; - break; - case "t": - char = "\t"; - break; - case "0": - char = "\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - if (n >= 0 && n <= 7 && state.directive["use strict"]) { - this.trigger("warning", { - code: "W115", - line: this.line, - character: this.char - }); - } - break; - case "u": - char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16)); - jump = 5; - break; - case "v": - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }); - } - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }); - } - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - case "\"": - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - case "!": - if (value.slice(value.length - 2) === "<") { - break; - } - - /*falls through */ - default: - // Weird escaping. - this.trigger("warning", { - code: "W044", - line: this.line, - character: this.char - }); - } - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function () { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function () { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurence of mixed tabs and spaces. If smarttabs option - * is on, ignore tabs followed by spaces. - * - * Tabs followed by one space followed by a block comment are allowed. - */ - scanMixedSpacesAndTabs: function () { - var at, match; - - if (state.option.smarttabs) { - // Negative look-behind for "//" - match = this.input.match(/(\/\/|^\s?\*)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = this.input.search(/ \t|\t [^\*]/); - } - - return at; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function () { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function () { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - - if (this.peek() === "") { // EOL - if (!/^\s*$/.test(this.lines[this.line - 1]) && state.option.trailing) { - this.trigger("warning", { code: "W102", line: this.line, character: start }); - } - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for mixed spaces and tabs - * and other minor warnings. - */ - nextLine: function () { - var char; - - if (this.line >= this.lines.length) { - return false; - } - - this.input = this.lines[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - char = this.scanMixedSpacesAndTabs(); - if (char >= 0) { - this.trigger("warning", { code: "W099", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function () { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It retuns a token in a JSLint-compatible format. - */ - token: function () { - var token; - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.es5 && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function (type, value, isProperty) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.trigger("String", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - quote: token.quote - }); - - return create("(string)", token.value); - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === "."); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - if (token.base === 16) { - if (state.jsonMode === "probing") { - state.jsonWarnings.push({ - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }); - } else if (state.jsonMode) { - this.trigger("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }); - } - } - - if (state.directive["use strict"] && token.base === 8) { - this.trigger("warning", { - code: "W115", - line: this.line, - character: this.char - }); - } - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; - -})() -},{"events":2,"./state.js":5,"./reg.js":4,"underscore":9}],14:[function(require,module,exports){ -exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) { - var e, m, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - nBits = -7, - i = isBE ? 0 : (nBytes - 1), - d = isBE ? 1 : -1, - s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity); - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); -}; - -exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) { - var e, m, c, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), - i = isBE ? (nBytes - 1) : 0, - d = isBE ? -1 : 1, - s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); - - buffer[offset + i - d] |= s * 128; -}; - -},{}],13:[function(require,module,exports){ -(function(){function SlowBuffer (size) { - this.length = size; -}; - -var assert = require('assert'); - -exports.INSPECT_MAX_BYTES = 50; - - -function toHex(n) { - if (n < 16) return '0' + n.toString(16); - return n.toString(16); -} - -function utf8ToBytes(str) { - var byteArray = []; - for (var i = 0; i < str.length; i++) - if (str.charCodeAt(i) <= 0x7F) - byteArray.push(str.charCodeAt(i)); - else { - var h = encodeURIComponent(str.charAt(i)).substr(1).split('%'); - for (var j = 0; j < h.length; j++) - byteArray.push(parseInt(h[j], 16)); - } - - return byteArray; -} - -function asciiToBytes(str) { - var byteArray = [] - for (var i = 0; i < str.length; i++ ) - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push( str.charCodeAt(i) & 0xFF ); - - return byteArray; -} - -function base64ToBytes(str) { - return require("base64-js").toByteArray(str); -} - -SlowBuffer.byteLength = function (str, encoding) { - switch (encoding || "utf8") { - case 'hex': - return str.length / 2; - - case 'utf8': - case 'utf-8': - return utf8ToBytes(str).length; - - case 'ascii': - case 'binary': - return str.length; - - case 'base64': - return base64ToBytes(str).length; - - default: - throw new Error('Unknown encoding'); - } -}; - -function blitBuffer(src, dst, offset, length) { - var pos, i = 0; - while (i < length) { - if ((i+offset >= dst.length) || (i >= src.length)) - break; - - dst[i + offset] = src[i]; - i++; - } - return i; -} - -SlowBuffer.prototype.utf8Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(utf8ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.asciiWrite = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(asciiToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.binaryWrite = SlowBuffer.prototype.asciiWrite; - -SlowBuffer.prototype.base64Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.base64Slice = function (start, end) { - var bytes = Array.prototype.slice.apply(this, arguments) - return require("base64-js").fromByteArray(bytes); -} - -function decodeUtf8Char(str) { - try { - return decodeURIComponent(str); - } catch (err) { - return String.fromCharCode(0xFFFD); // UTF 8 invalid char - } -} - -SlowBuffer.prototype.utf8Slice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var res = ""; - var tmp = ""; - var i = 0; - while (i < bytes.length) { - if (bytes[i] <= 0x7F) { - res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]); - tmp = ""; - } else - tmp += "%" + bytes[i].toString(16); - - i++; - } - - return res + decodeUtf8Char(tmp); -} - -SlowBuffer.prototype.asciiSlice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var ret = ""; - for (var i = 0; i < bytes.length; i++) - ret += String.fromCharCode(bytes[i]); - return ret; -} - -SlowBuffer.prototype.binarySlice = SlowBuffer.prototype.asciiSlice; - -SlowBuffer.prototype.inspect = function() { - var out = [], - len = this.length; - for (var i = 0; i < len; i++) { - out[i] = toHex(this[i]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - return ''; -}; - - -SlowBuffer.prototype.hexSlice = function(start, end) { - var len = this.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; i++) { - out += toHex(this[i]); - } - return out; -}; - - -SlowBuffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - start = +start || 0; - if (typeof end == 'undefined') end = this.length; - - // Fastpath empty strings - if (+end == start) { - return ''; - } - - switch (encoding) { - case 'hex': - return this.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.utf8Slice(start, end); - - case 'ascii': - return this.asciiSlice(start, end); - - case 'binary': - return this.binarySlice(start, end); - - case 'base64': - return this.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -SlowBuffer.prototype.hexWrite = function(string, offset, length) { - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2) { - throw new Error('Invalid hex string'); - } - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; i++) { - var byte = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(byte)) throw new Error('Invalid hex string'); - this[offset + i] = byte; - } - SlowBuffer._charsWritten = i * 2; - return i; -}; - - -SlowBuffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - switch (encoding) { - case 'hex': - return this.hexWrite(string, offset, length); - - case 'utf8': - case 'utf-8': - return this.utf8Write(string, offset, length); - - case 'ascii': - return this.asciiWrite(string, offset, length); - - case 'binary': - return this.binaryWrite(string, offset, length); - - case 'base64': - return this.base64Write(string, offset, length); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Write(string, offset, length); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// slice(start, end) -SlowBuffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - - if (end > this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - return new Buffer(this, end - start, +start); -}; - -SlowBuffer.prototype.copy = function(target, targetstart, sourcestart, sourceend) { - var temp = []; - for (var i=sourcestart; i this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - for (var i = start; i < end; i++) { - this[i] = value; - } -} - -function coerce(length) { - // Coerce length to a number (possibly NaN), round up - // in case it's fractional (e.g. 123.456) then do a - // double negate to coerce a NaN to 0. Easy, right? - length = ~~Math.ceil(+length); - return length < 0 ? 0 : length; -} - - -// Buffer - -function Buffer(subject, encoding, offset) { - if (!(this instanceof Buffer)) { - return new Buffer(subject, encoding, offset); - } - - var type; - - // Are we slicing? - if (typeof offset === 'number') { - this.length = coerce(encoding); - this.parent = subject; - this.offset = offset; - } else { - // Find the length - switch (type = typeof subject) { - case 'number': - this.length = coerce(subject); - break; - - case 'string': - this.length = Buffer.byteLength(subject, encoding); - break; - - case 'object': // Assume object is an array - this.length = coerce(subject.length); - break; - - default: - throw new Error('First argument needs to be a number, ' + - 'array or string.'); - } - - if (this.length > Buffer.poolSize) { - // Big buffer, just alloc one. - this.parent = new SlowBuffer(this.length); - this.offset = 0; - - } else { - // Small buffer. - if (!pool || pool.length - pool.used < this.length) allocPool(); - this.parent = pool; - this.offset = pool.used; - pool.used += this.length; - } - - // Treat array-ish objects as a byte array. - if (isArrayIsh(subject)) { - for (var i = 0; i < this.length; i++) { - if (subject instanceof Buffer) { - this.parent[i + this.offset] = subject.readUInt8(i); - } - else { - this.parent[i + this.offset] = subject[i]; - } - } - } else if (type == 'string') { - // We are a string - this.length = this.write(subject, 0, encoding); - } - } - -} - -function isArrayIsh(subject) { - return Array.isArray(subject) || Buffer.isBuffer(subject) || - subject && typeof subject === 'object' && - typeof subject.length === 'number'; -} - -exports.SlowBuffer = SlowBuffer; -exports.Buffer = Buffer; - -Buffer.poolSize = 8 * 1024; -var pool; - -function allocPool() { - pool = new SlowBuffer(Buffer.poolSize); - pool.used = 0; -} - - -// Static methods -Buffer.isBuffer = function isBuffer(b) { - return b instanceof Buffer || b instanceof SlowBuffer; -}; - -Buffer.concat = function (list, totalLength) { - if (!Array.isArray(list)) { - throw new Error("Usage: Buffer.concat(list, [totalLength])\n \ - list should be an Array."); - } - - if (list.length === 0) { - return new Buffer(0); - } else if (list.length === 1) { - return list[0]; - } - - if (typeof totalLength !== 'number') { - totalLength = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - totalLength += buf.length; - } - } - - var buffer = new Buffer(totalLength); - var pos = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer; -}; - -// Inspect -Buffer.prototype.inspect = function inspect() { - var out = [], - len = this.length; - - for (var i = 0; i < len; i++) { - out[i] = toHex(this.parent[i + this.offset]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - - return ''; -}; - - -Buffer.prototype.get = function get(i) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i]; -}; - - -Buffer.prototype.set = function set(i, v) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i] = v; -}; - - -// write(string, offset = 0, length = buffer.length-offset, encoding = 'utf8') -Buffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - var ret; - switch (encoding) { - case 'hex': - ret = this.parent.hexWrite(string, this.offset + offset, length); - break; - - case 'utf8': - case 'utf-8': - ret = this.parent.utf8Write(string, this.offset + offset, length); - break; - - case 'ascii': - ret = this.parent.asciiWrite(string, this.offset + offset, length); - break; - - case 'binary': - ret = this.parent.binaryWrite(string, this.offset + offset, length); - break; - - case 'base64': - // Warning: maxLength not taken into account in base64Write - ret = this.parent.base64Write(string, this.offset + offset, length); - break; - - case 'ucs2': - case 'ucs-2': - ret = this.parent.ucs2Write(string, this.offset + offset, length); - break; - - default: - throw new Error('Unknown encoding'); - } - - Buffer._charsWritten = SlowBuffer._charsWritten; - - return ret; -}; - - -// toString(encoding, start=0, end=buffer.length) -Buffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - - if (typeof start == 'undefined' || start < 0) { - start = 0; - } else if (start > this.length) { - start = this.length; - } - - if (typeof end == 'undefined' || end > this.length) { - end = this.length; - } else if (end < 0) { - end = 0; - } - - start = start + this.offset; - end = end + this.offset; - - switch (encoding) { - case 'hex': - return this.parent.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.parent.utf8Slice(start, end); - - case 'ascii': - return this.parent.asciiSlice(start, end); - - case 'binary': - return this.parent.binarySlice(start, end); - - case 'base64': - return this.parent.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.parent.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// byteLength -Buffer.byteLength = SlowBuffer.byteLength; - - -// fill(value, start=0, end=buffer.length) -Buffer.prototype.fill = function fill(value, start, end) { - value || (value = 0); - start || (start = 0); - end || (end = this.length); - - if (typeof value === 'string') { - value = value.charCodeAt(0); - } - if (!(typeof value === 'number') || isNaN(value)) { - throw new Error('value is not a number'); - } - - if (end < start) throw new Error('end < start'); - - // Fill 0 bytes; we're done - if (end === start) return 0; - if (this.length == 0) return 0; - - if (start < 0 || start >= this.length) { - throw new Error('start out of bounds'); - } - - if (end < 0 || end > this.length) { - throw new Error('end out of bounds'); - } - - return this.parent.fill(value, - start + this.offset, - end + this.offset); -}; - - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function(target, target_start, start, end) { - var source = this; - start || (start = 0); - end || (end = this.length); - target_start || (target_start = 0); - - if (end < start) throw new Error('sourceEnd < sourceStart'); - - // Copy 0 bytes; we're done - if (end === start) return 0; - if (target.length == 0 || source.length == 0) return 0; - - if (target_start < 0 || target_start >= target.length) { - throw new Error('targetStart out of bounds'); - } - - if (start < 0 || start >= source.length) { - throw new Error('sourceStart out of bounds'); - } - - if (end < 0 || end > source.length) { - throw new Error('sourceEnd out of bounds'); - } - - // Are we oob? - if (end > this.length) { - end = this.length; - } - - if (target.length - target_start < end - start) { - end = target.length - target_start + start; - } - - return this.parent.copy(target.parent, - target_start + target.offset, - start + this.offset, - end + this.offset); -}; - - -// slice(start, end) -Buffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - if (end > this.length) throw new Error('oob'); - if (start > end) throw new Error('oob'); - - return new Buffer(this.parent, end - start, +start + this.offset); -}; - - -// Legacy methods for backwards compatibility. - -Buffer.prototype.utf8Slice = function(start, end) { - return this.toString('utf8', start, end); -}; - -Buffer.prototype.binarySlice = function(start, end) { - return this.toString('binary', start, end); -}; - -Buffer.prototype.asciiSlice = function(start, end) { - return this.toString('ascii', start, end); -}; - -Buffer.prototype.utf8Write = function(string, offset) { - return this.write(string, offset, 'utf8'); -}; - -Buffer.prototype.binaryWrite = function(string, offset) { - return this.write(string, offset, 'binary'); -}; - -Buffer.prototype.asciiWrite = function(string, offset) { - return this.write(string, offset, 'ascii'); -}; - -Buffer.prototype.readUInt8 = function(offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - return buffer.parent[buffer.offset + offset]; -}; - -function readUInt16(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - val = buffer.parent[buffer.offset + offset] << 8; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1]; - } - } else { - val = buffer.parent[buffer.offset + offset]; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1] << 8; - } - } - - return val; -} - -Buffer.prototype.readUInt16LE = function(offset, noAssert) { - return readUInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt16BE = function(offset, noAssert) { - return readUInt16(this, offset, true, noAssert); -}; - -function readUInt32(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - if (offset + 1 < buffer.length) - val = buffer.parent[buffer.offset + offset + 1] << 16; - if (offset + 2 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 2] << 8; - if (offset + 3 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 3]; - val = val + (buffer.parent[buffer.offset + offset] << 24 >>> 0); - } else { - if (offset + 2 < buffer.length) - val = buffer.parent[buffer.offset + offset + 2] << 16; - if (offset + 1 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 1] << 8; - val |= buffer.parent[buffer.offset + offset]; - if (offset + 3 < buffer.length) - val = val + (buffer.parent[buffer.offset + offset + 3] << 24 >>> 0); - } - - return val; -} - -Buffer.prototype.readUInt32LE = function(offset, noAssert) { - return readUInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt32BE = function(offset, noAssert) { - return readUInt32(this, offset, true, noAssert); -}; - - -/* - * Signed integer types, yay team! A reminder on how two's complement actually - * works. The first bit is the signed bit, i.e. tells us whether or not the - * number should be positive or negative. If the two's complement value is - * positive, then we're done, as it's equivalent to the unsigned representation. - * - * Now if the number is positive, you're pretty much done, you can just leverage - * the unsigned translations and return those. Unfortunately, negative numbers - * aren't quite that straightforward. - * - * At first glance, one might be inclined to use the traditional formula to - * translate binary numbers between the positive and negative values in two's - * complement. (Though it doesn't quite work for the most negative value) - * Mainly: - * - invert all the bits - * - add one to the result - * - * Of course, this doesn't quite work in Javascript. Take for example the value - * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of - * course, Javascript will do the following: - * - * > ~0xff80 - * -65409 - * - * Whoh there, Javascript, that's not quite right. But wait, according to - * Javascript that's perfectly correct. When Javascript ends up seeing the - * constant 0xff80, it has no notion that it is actually a signed number. It - * assumes that we've input the unsigned value 0xff80. Thus, when it does the - * binary negation, it casts it into a signed value, (positive 0xff80). Then - * when you perform binary negation on that, it turns it into a negative number. - * - * Instead, we're going to have to use the following general formula, that works - * in a rather Javascript friendly way. I'm glad we don't support this kind of - * weird numbering scheme in the kernel. - * - * (BIT-MAX - (unsigned)val + 1) * -1 - * - * The astute observer, may think that this doesn't make sense for 8-bit numbers - * (really it isn't necessary for them). However, when you get 16-bit numbers, - * you do. Let's go back to our prior example and see how this will look: - * - * (0xffff - 0xff80 + 1) * -1 - * (0x007f + 1) * -1 - * (0x0080) * -1 - */ -Buffer.prototype.readInt8 = function(offset, noAssert) { - var buffer = this; - var neg; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - neg = buffer.parent[buffer.offset + offset] & 0x80; - if (!neg) { - return (buffer.parent[buffer.offset + offset]); - } - - return ((0xff - buffer.parent[buffer.offset + offset] + 1) * -1); -}; - -function readInt16(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt16(buffer, offset, isBigEndian, noAssert); - neg = val & 0x8000; - if (!neg) { - return val; - } - - return (0xffff - val + 1) * -1; -} - -Buffer.prototype.readInt16LE = function(offset, noAssert) { - return readInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt16BE = function(offset, noAssert) { - return readInt16(this, offset, true, noAssert); -}; - -function readInt32(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt32(buffer, offset, isBigEndian, noAssert); - neg = val & 0x80000000; - if (!neg) { - return (val); - } - - return (0xffffffff - val + 1) * -1; -} - -Buffer.prototype.readInt32LE = function(offset, noAssert) { - return readInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt32BE = function(offset, noAssert) { - return readInt32(this, offset, true, noAssert); -}; - -function readFloat(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.readFloatLE = function(offset, noAssert) { - return readFloat(this, offset, false, noAssert); -}; - -Buffer.prototype.readFloatBE = function(offset, noAssert) { - return readFloat(this, offset, true, noAssert); -}; - -function readDouble(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.readDoubleLE = function(offset, noAssert) { - return readDouble(this, offset, false, noAssert); -}; - -Buffer.prototype.readDoubleBE = function(offset, noAssert) { - return readDouble(this, offset, true, noAssert); -}; - - -/* - * We have to make sure that the value is a valid integer. This means that it is - * non-negative. It has no fractional component and that it does not exceed the - * maximum allowed value. - * - * value The number to check for validity - * - * max The maximum value - */ -function verifuint(value, max) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value >= 0, - 'specified a negative value for writing an unsigned value'); - - assert.ok(value <= max, 'value is larger than maximum value for type'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xff); - } - - if (offset < buffer.length) { - buffer.parent[buffer.offset + offset] = value; - } -}; - -function writeUInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) { - buffer.parent[buffer.offset + offset + i] = - (value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>> - (isBigEndian ? 1 - i : i) * 8; - } - -} - -Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, true, noAssert); -}; - -function writeUInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffffffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) { - buffer.parent[buffer.offset + offset + i] = - (value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff; - } -} - -Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, true, noAssert); -}; - - -/* - * We now move onto our friends in the signed number category. Unlike unsigned - * numbers, we're going to have to worry a bit more about how we put values into - * arrays. Since we are only worrying about signed 32-bit values, we're in - * slightly better shape. Unfortunately, we really can't do our favorite binary - * & in this system. It really seems to do the wrong thing. For example: - * - * > -32 & 0xff - * 224 - * - * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of - * this aren't treated as a signed number. Ultimately a bad thing. - * - * What we're going to want to do is basically create the unsigned equivalent of - * our representation and pass that off to the wuint* functions. To do that - * we're going to do the following: - * - * - if the value is positive - * we can pass it directly off to the equivalent wuint - * - if the value is negative - * we do the following computation: - * mb + val + 1, where - * mb is the maximum unsigned value in that byte size - * val is the Javascript negative integer - * - * - * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If - * you do out the computations: - * - * 0xffff - 128 + 1 - * 0xffff - 127 - * 0xff80 - * - * You can then encode this value as the signed version. This is really rather - * hacky, but it should work and get the job done which is our goal here. - */ - -/* - * A series of checks to make sure we actually have a signed 32-bit number - */ -function verifsint(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -function verifIEEE754(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); -} - -Buffer.prototype.writeInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7f, -0x80); - } - - if (value >= 0) { - buffer.writeUInt8(value, offset, noAssert); - } else { - buffer.writeUInt8(0xff + value + 1, offset, noAssert); - } -}; - -function writeInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fff, -0x8000); - } - - if (value >= 0) { - writeUInt16(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { - writeInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { - writeInt16(this, value, offset, true, noAssert); -}; - -function writeInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fffffff, -0x80000000); - } - - if (value >= 0) { - writeUInt32(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { - writeInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { - writeInt32(this, value, offset, true, noAssert); -}; - -function writeFloat(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.writeFloatLE = function(value, offset, noAssert) { - writeFloat(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeFloatBE = function(value, offset, noAssert) { - writeFloat(this, value, offset, true, noAssert); -}; - -function writeDouble(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) { - writeDouble(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) { - writeDouble(this, value, offset, true, noAssert); -}; - -SlowBuffer.prototype.readUInt8 = Buffer.prototype.readUInt8; -SlowBuffer.prototype.readUInt16LE = Buffer.prototype.readUInt16LE; -SlowBuffer.prototype.readUInt16BE = Buffer.prototype.readUInt16BE; -SlowBuffer.prototype.readUInt32LE = Buffer.prototype.readUInt32LE; -SlowBuffer.prototype.readUInt32BE = Buffer.prototype.readUInt32BE; -SlowBuffer.prototype.readInt8 = Buffer.prototype.readInt8; -SlowBuffer.prototype.readInt16LE = Buffer.prototype.readInt16LE; -SlowBuffer.prototype.readInt16BE = Buffer.prototype.readInt16BE; -SlowBuffer.prototype.readInt32LE = Buffer.prototype.readInt32LE; -SlowBuffer.prototype.readInt32BE = Buffer.prototype.readInt32BE; -SlowBuffer.prototype.readFloatLE = Buffer.prototype.readFloatLE; -SlowBuffer.prototype.readFloatBE = Buffer.prototype.readFloatBE; -SlowBuffer.prototype.readDoubleLE = Buffer.prototype.readDoubleLE; -SlowBuffer.prototype.readDoubleBE = Buffer.prototype.readDoubleBE; -SlowBuffer.prototype.writeUInt8 = Buffer.prototype.writeUInt8; -SlowBuffer.prototype.writeUInt16LE = Buffer.prototype.writeUInt16LE; -SlowBuffer.prototype.writeUInt16BE = Buffer.prototype.writeUInt16BE; -SlowBuffer.prototype.writeUInt32LE = Buffer.prototype.writeUInt32LE; -SlowBuffer.prototype.writeUInt32BE = Buffer.prototype.writeUInt32BE; -SlowBuffer.prototype.writeInt8 = Buffer.prototype.writeInt8; -SlowBuffer.prototype.writeInt16LE = Buffer.prototype.writeInt16LE; -SlowBuffer.prototype.writeInt16BE = Buffer.prototype.writeInt16BE; -SlowBuffer.prototype.writeInt32LE = Buffer.prototype.writeInt32LE; -SlowBuffer.prototype.writeInt32BE = Buffer.prototype.writeInt32BE; -SlowBuffer.prototype.writeFloatLE = Buffer.prototype.writeFloatLE; -SlowBuffer.prototype.writeFloatBE = Buffer.prototype.writeFloatBE; -SlowBuffer.prototype.writeDoubleLE = Buffer.prototype.writeDoubleLE; -SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE; - -})() -},{"assert":12,"./buffer_ieee754":14,"base64-js":15}],15:[function(require,module,exports){ -(function (exports) { - 'use strict'; - - var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - - function b64ToByteArray(b64) { - var i, j, l, tmp, placeHolders, arr; - - if (b64.length % 4 > 0) { - throw 'Invalid string. Length must be a multiple of 4'; - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64.indexOf('='); - placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? b64.length - 4 : b64.length; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]); - arr.push((tmp & 0xFF0000) >> 16); - arr.push((tmp & 0xFF00) >> 8); - arr.push(tmp & 0xFF); - } - - if (placeHolders === 2) { - tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4); - arr.push(tmp & 0xFF); - } else if (placeHolders === 1) { - tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2); - arr.push((tmp >> 8) & 0xFF); - arr.push(tmp & 0xFF); - } - - return arr; - } - - function uint8ToBase64(uint8) { - var i, - extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes - output = "", - temp, length; - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; - }; - - // go through the array every three bytes, we'll deal with trailing stuff later - for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { - temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output += tripletToBase64(temp); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - switch (extraBytes) { - case 1: - temp = uint8[uint8.length - 1]; - output += lookup[temp >> 2]; - output += lookup[(temp << 4) & 0x3F]; - output += '=='; - break; - case 2: - temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]); - output += lookup[temp >> 10]; - output += lookup[(temp >> 4) & 0x3F]; - output += lookup[(temp << 2) & 0x3F]; - output += '='; - break; - } - - return output; - } - - module.exports.toByteArray = b64ToByteArray; - module.exports.fromByteArray = uint8ToBase64; -}()); - -},{}]},{},["B01lSJ"]) -; -JSHINT = require('jshint').JSHINT; -}()); -/*jshint boss: true, rhino: true, unused: true, undef: true, white: true, quotmark: double */ -/*global JSHINT */ - -(function (args) { - "use strict"; - - var filenames = []; - var optstr; // arg1=val1,arg2=val2,... - var predef; // global1=true,global2,global3,... - var opts = {}; - var retval = 0; - - args.forEach(function (arg) { - if (arg.indexOf("=") > -1) { - if (!optstr) { - // First time it's the options. - optstr = arg; - } else { - predef = arg; - } - - return; - } - - if (optstr) { - predef = arg; - return; - } - - filenames.push(arg); - }); - - if (filenames.length === 0) { - print("Usage: jshint.js file.js"); - quit(1); - } - - if (optstr) { - optstr.split(",").forEach(function (arg) { - var o = arg.split("="); - if (o[0] === "indent") { - opts[o[0]] = parseInt(o[1], 10); - } else { - opts[o[0]] = (function (ov) { - switch (ov) { - case "true": - return true; - case "false": - return false; - default: - return ov; - } - }(o[1])); - } - }); - } - - if (predef) { - opts.predef = {}; - - predef.split(",").forEach(function (arg) { - var global = arg.split("="); - opts.predef[global[0]] = global[1] === "true" ? true : false; - }); - } - - filenames.forEach(function (name) { - var input = readFile(name); - - if (!input) { - print("jshint: Couldn't open file " + name); - quit(1); - } - - if (!JSHINT(input, opts)) { - for (var i = 0, err; err = JSHINT.errors[i]; i += 1) { - print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")"); - print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); - print(""); - } - retval = 1; - } - }); - - quit(retval); -}(arguments)); diff --git a/deploy/core/node_modules/jshint/dist/jshint-rhino-2.0.0.js b/deploy/core/node_modules/jshint/dist/jshint-rhino-2.0.0.js deleted file mode 100755 index 4463d4e60..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-rhino-2.0.0.js +++ /dev/null @@ -1,11082 +0,0 @@ -#!/usr/bin/env rhino - -var window = {};//2.0.0 -var JSHINT; -(function () { -var require; -require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -} - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],2:[function(require,module,exports){ -(function(process){if (!process.EventEmitter) process.EventEmitter = function () {}; - -var EventEmitter = exports.EventEmitter = process.EventEmitter; -var isArray = typeof Array.isArray === 'function' - ? Array.isArray - : function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]' - } -; -function indexOf (xs, x) { - if (xs.indexOf) return xs.indexOf(x); - for (var i = 0; i < xs.length; i++) { - if (x === xs[i]) return i; - } - return -1; -} - -// By default EventEmitters will print a warning if more than -// 10 listeners are added to it. This is a useful default which -// helps finding memory leaks. -// -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -var defaultMaxListeners = 10; -EventEmitter.prototype.setMaxListeners = function(n) { - if (!this._events) this._events = {}; - this._events.maxListeners = n; -}; - - -EventEmitter.prototype.emit = function(type) { - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events || !this._events.error || - (isArray(this._events.error) && !this._events.error.length)) - { - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - if (!this._events) return false; - var handler = this._events[type]; - if (!handler) return false; - - if (typeof handler == 'function') { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - return true; - - } else if (isArray(handler)) { - var args = Array.prototype.slice.call(arguments, 1); - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - return true; - - } else { - return false; - } -}; - -// EventEmitter is defined in src/node_events.cc -// EventEmitter.prototype.emit() is also defined there. -EventEmitter.prototype.addListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('addListener only takes instances of Function'); - } - - if (!this._events) this._events = {}; - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } else if (isArray(this._events[type])) { - - // Check for listener leak - if (!this._events[type].warned) { - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - - // If we've already got an array, just append. - this._events[type].push(listener); - } else { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - var self = this; - self.on(type, function g() { - self.removeListener(type, g); - listener.apply(this, arguments); - }); - - return this; -}; - -EventEmitter.prototype.removeListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('removeListener only takes instances of Function'); - } - - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events || !this._events[type]) return this; - - var list = this._events[type]; - - if (isArray(list)) { - var i = indexOf(list, listener); - if (i < 0) return this; - list.splice(i, 1); - if (list.length == 0) - delete this._events[type]; - } else if (this._events[type] === listener) { - delete this._events[type]; - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - this._events = {}; - return this; - } - - // does not use listeners(), so no side effect of creating _events[type] - if (type && this._events && this._events[type]) this._events[type] = null; - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - if (!this._events) this._events = {}; - if (!this._events[type]) this._events[type] = []; - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; -}; - -})(require("__browserify_process")) -},{"__browserify_process":1}],3:[function(require,module,exports){ -(function(){// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - ElementTimeControl : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - SVGAElement : false, - SVGAltGlyphDefElement: false, - SVGAltGlyphElement : false, - SVGAltGlyphItemElement: false, - SVGAngle : false, - SVGAnimateColorElement: false, - SVGAnimateElement : false, - SVGAnimateMotionElement: false, - SVGAnimateTransformElement: false, - SVGAnimatedAngle : false, - SVGAnimatedBoolean : false, - SVGAnimatedEnumeration: false, - SVGAnimatedInteger : false, - SVGAnimatedLength : false, - SVGAnimatedLengthList: false, - SVGAnimatedNumber : false, - SVGAnimatedNumberList: false, - SVGAnimatedPathData : false, - SVGAnimatedPoints : false, - SVGAnimatedPreserveAspectRatio: false, - SVGAnimatedRect : false, - SVGAnimatedString : false, - SVGAnimatedTransformList: false, - SVGAnimationElement : false, - SVGCSSRule : false, - SVGCircleElement : false, - SVGClipPathElement : false, - SVGColor : false, - SVGColorProfileElement: false, - SVGColorProfileRule : false, - SVGComponentTransferFunctionElement: false, - SVGCursorElement : false, - SVGDefsElement : false, - SVGDescElement : false, - SVGDocument : false, - SVGElement : false, - SVGElementInstance : false, - SVGElementInstanceList: false, - SVGEllipseElement : false, - SVGExternalResourcesRequired: false, - SVGFEBlendElement : false, - SVGFEColorMatrixElement: false, - SVGFEComponentTransferElement: false, - SVGFECompositeElement: false, - SVGFEConvolveMatrixElement: false, - SVGFEDiffuseLightingElement: false, - SVGFEDisplacementMapElement: false, - SVGFEDistantLightElement: false, - SVGFEFloodElement : false, - SVGFEFuncAElement : false, - SVGFEFuncBElement : false, - SVGFEFuncGElement : false, - SVGFEFuncRElement : false, - SVGFEGaussianBlurElement: false, - SVGFEImageElement : false, - SVGFEMergeElement : false, - SVGFEMergeNodeElement: false, - SVGFEMorphologyElement: false, - SVGFEOffsetElement : false, - SVGFEPointLightElement: false, - SVGFESpecularLightingElement: false, - SVGFESpotLightElement: false, - SVGFETileElement : false, - SVGFETurbulenceElement: false, - SVGFilterElement : false, - SVGFilterPrimitiveStandardAttributes: false, - SVGFitToViewBox : false, - SVGFontElement : false, - SVGFontFaceElement : false, - SVGFontFaceFormatElement: false, - SVGFontFaceNameElement: false, - SVGFontFaceSrcElement: false, - SVGFontFaceUriElement: false, - SVGForeignObjectElement: false, - SVGGElement : false, - SVGGlyphElement : false, - SVGGlyphRefElement : false, - SVGGradientElement : false, - SVGHKernElement : false, - SVGICCColor : false, - SVGImageElement : false, - SVGLangSpace : false, - SVGLength : false, - SVGLengthList : false, - SVGLineElement : false, - SVGLinearGradientElement: false, - SVGLocatable : false, - SVGMPathElement : false, - SVGMarkerElement : false, - SVGMaskElement : false, - SVGMatrix : false, - SVGMetadataElement : false, - SVGMissingGlyphElement: false, - SVGNumber : false, - SVGNumberList : false, - SVGPaint : false, - SVGPathElement : false, - SVGPathSeg : false, - SVGPathSegArcAbs : false, - SVGPathSegArcRel : false, - SVGPathSegClosePath : false, - SVGPathSegCurvetoCubicAbs: false, - SVGPathSegCurvetoCubicRel: false, - SVGPathSegCurvetoCubicSmoothAbs: false, - SVGPathSegCurvetoCubicSmoothRel: false, - SVGPathSegCurvetoQuadraticAbs: false, - SVGPathSegCurvetoQuadraticRel: false, - SVGPathSegCurvetoQuadraticSmoothAbs: false, - SVGPathSegCurvetoQuadraticSmoothRel: false, - SVGPathSegLinetoAbs : false, - SVGPathSegLinetoHorizontalAbs: false, - SVGPathSegLinetoHorizontalRel: false, - SVGPathSegLinetoRel : false, - SVGPathSegLinetoVerticalAbs: false, - SVGPathSegLinetoVerticalRel: false, - SVGPathSegList : false, - SVGPathSegMovetoAbs : false, - SVGPathSegMovetoRel : false, - SVGPatternElement : false, - SVGPoint : false, - SVGPointList : false, - SVGPolygonElement : false, - SVGPolylineElement : false, - SVGPreserveAspectRatio: false, - SVGRadialGradientElement: false, - SVGRect : false, - SVGRectElement : false, - SVGRenderingIntent : false, - SVGSVGElement : false, - SVGScriptElement : false, - SVGSetElement : false, - SVGStopElement : false, - SVGStringList : false, - SVGStylable : false, - SVGStyleElement : false, - SVGSwitchElement : false, - SVGSymbolElement : false, - SVGTRefElement : false, - SVGTSpanElement : false, - SVGTests : false, - SVGTextContentElement: false, - SVGTextElement : false, - SVGTextPathElement : false, - SVGTextPositioningElement: false, - SVGTitleElement : false, - SVGTransform : false, - SVGTransformList : false, - SVGTransformable : false, - SVGURIReference : false, - SVGUnitTypes : false, - SVGUseElement : false, - SVGVKernElement : false, - SVGViewElement : false, - SVGViewSpec : false, - SVGZoomAndPan : false, - TimeEvent : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - DataView : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval: false -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - - -})() -},{}],4:[function(require,module,exports){ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use string"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; - -},{}],5:[function(require,module,exports){ -"use strict"; - -var state = { - syntax: {}, - - reset: function () { - this.tokens = { - prev: null, - next: null, - curr: null - }, - - this.option = {}; - this.ignored = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - } -}; - -exports.state = state; - -},{}],6:[function(require,module,exports){ -(function(){"use strict"; - -exports.register = function (linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for dangling underscores. - - linter.on("Identifier", function style_scanDangling(data) { - if (!linter.getOption("nomen")) { - return; - } - - // Underscore.js - if (data.name === "_") { - return; - } - - // In Node, __dirname and __filename should be ignored. - if (linter.getOption("node")) { - if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { - return; - } - } - - if (/^(_+.*|.*_+)$/.test(data.name)) { - linter.warn("W105", { - line: data.line, - char: data.from, - data: [ "dangling '_'", data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+/, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; -})() -},{}],"jshint":[function(require,module,exports){ -module.exports=require('B01lSJ'); -},{}],"B01lSJ":[function(require,module,exports){ -(function(){/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * 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. - * - */ - -/*jshint quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = require("underscore"); -var events = require("events"); -var vars = require("../shared/vars.js"); -var messages = require("../shared/messages.js"); -var Lexer = require("./lex.js").Lexer; -var reg = require("./reg.js"); -var state = require("./state.js").state; -var style = require("./style.js"); - -// We need this module here because environments such as IE and Rhino -// don't necessarilly expose the 'console' API and browserify uses -// it to log things. It's a sad state of affair, really. -var console = require("console-browserify"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - api, // Extension API - - // These are operators that should not be used with the ! operator. - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es3 : true, // if ES3 syntax should be allowed - es5 : true, // if ES5 syntax should be allowed (is now set per default) - esnext : true, // if es.next specific syntax should be allowed - moz : true, // if mozilla specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - gcl : true, // if JSHint should be compatible with Google Closure Linter - globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - passfail : true, // if the scan should stop on first error - phantom : true, // if PhantomJS symbols should be allowed - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true, // YUI variables should be predefined - - // Obsolete options - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false, // {int} max cyclomatic complexity per function - unused : true, // warn if variables are unused. Available options: - // false - don't check for unused variables - // true - "vars" + check last function param - // "vars" - skip checking unused function params - // "strict" - "vars" + check all function params - latedef : false // warn if the variable is used before its definition - // false - don't emit any warnings - // true - warn if any variable is used before its definition - // "nofunc" - warn for any variable but function declarations - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus: true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true, - strict : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows: "wsh", - sloppy : "strict" - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - noreach, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - warnings, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^[+-]W\d{3}$/g.test(name)) { - return true; - } - - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - if (t.type !== "jslint") { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.inES5(true) && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (_.has(o, n) && !_.has(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (state.option.es5) { - warning("I003"); - } - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - - // let's assume that chronologically ES3 < ES5 < ES6/ESNext < Moz - state.option.inMoz = function (strict) { - if (strict) { - return state.option.moz && !state.option.esnext; - } - return state.option.moz; - }; - state.option.inESNext = function (strict) { - if (strict) { - return !state.option.moz && state.option.esnext; - } - return state.option.moz || state.option.esnext; - }; - state.option.inES5 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && !state.option.es3; - } - return !state.option.es3; - }; - state.option.inES3 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && state.option.es3; - } - return state.option.es3; - }; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, code, token, a) { - return JSHINT.undefs.push([scope, code, token, a]); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (state.ignored[code]) - return; - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - if (state.option.passfail) { - quit("E042", l, ch); - } - - warnings += 1; - if (warnings >= state.option.maxerr) { - quit("E043", l, ch); - } - - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - function addlabel(t, type, tkn, islet) { - // Define t in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], t)) { - if (funct[t] !== true && !state.option.node) { - warning("W002", state.tokens.next, t); - } - } - } - - if (_.has(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - } else { - if (!state.option.shadow && type !== "exception" || - (funct["(blockscope)"].getlabel(t))) { - warning("W004", state.tokens.next, t); - } - } - } - - // a double definition of a let variable in same block throws a TypeError - if (funct["(blockscope)"] && funct["(blockscope)"].current.has(t)) { - error("E044", state.tokens.next, t); - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(t, type, state.tokens.curr); - } else { - - funct[t] = type; - - if (tkn) { - funct["(tokens)"][t] = tkn; - } - - if (funct["(global)"]) { - global[t] = funct; - if (_.has(implied, t)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function (g) { - g = g.split(":"); - var key = g[0]; - var val = g[1]; - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - updatePredefined(); - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function (e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function (m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\b", "\b") - .replace("\\t", "\t") - .replace("\\n", "\n") - .replace("\\v", "\v") - .replace("\\f", "\f") - .replace("\\r", "\r") - .replace("\\\\", "\\") - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - - // GH988 - numeric options can be disabled by setting them to `false` - if (val !== "false") { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - if (key === "indent") { - state.option["(explicitIndent)"] = true; - } - state.option[key] = val; - } else { - if (key === "indent") { - state.option["(explicitIndent)"] = false; - } else { - state.option[key] = false; - } - } - - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - if (funct["(global)"]) { - error("E009"); - } else { - if (val === "true" || val === "false") { - state.option.validthis = (val === "true"); - } else { - error("E002", nt); - } - } - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - var match = /^([+-])(W\d{3})$/g.exec(key); - if (match) { - // ignore for -W..., unignore for +W... - state.ignored[match[2]] = (match[1] === "-"); - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = renamedOptions[key] || key; - state.option[tn] = (val === "true"); - - if (invertedOptions[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - assume(); - } - } - - // We need a peek function. If it has an argument, it peeks that much farther - // ahead. It is used to distinguish - // for ( var i in ... - // from - // for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (state.tokens.curr.type === "(string)" || state.tokens.curr.identifier) { - anonname = state.tokens.curr.value; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.check) { - state.tokens.next.check(); - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - // This is the heart of JSHINT, the Pratt parser. In addition to parsing, it - // is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is - // like .nud except that it is only used on the first token of a statement. - // Having .fud makes it much easier to define statement-oriented languages like - // JavaScript. I retained Pratt's nomenclature. - - // .nud Null denotation - // .fud First null denotation - // .led Left denotation - // lbp Left binding power - // rbp Right binding power - - // They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false, isLetExpr = false; - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.syntax["let"].fud.call(state.syntax["let"].fud, false); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - advance(); - - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = state.tokens.curr.value; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - var end_of_expr = state.tokens.next.identifier && - !state.tokens.curr.led && - state.tokens.curr.line !== state.tokens.next.line; - while (rbp < state.tokens.next.lbp && !end_of_expr) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && (left.character !== right.from || left.line !== right.line)) { - warning("W012", right, right.value); - } - } - - function nospace(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - - if (left.value === ";" && right.value === ";") { - return; - } - - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== right.line) { - warning("W014", right, right.id); - } else if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function indentation(bias) { - if (!state.option.white && !state.option["(explicitIndent)"]) { - return; - } - - if (state.tokens.next.id === "(end)") { - return; - } - - var i = indent + (bias || 0); - if (state.tokens.next.from !== i) { - warning("W015", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== state.tokens.next.line) { - warning("E022", t, t.value); - } - } - - - function comma(opts) { - opts = opts || {}; - - if (state.tokens.curr.line !== state.tokens.next.line) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", state.tokens.curr, state.tokens.next.id); - } - } else if (!state.tokens.curr.comment && - state.tokens.curr.character !== state.tokens.next.from && state.option.white) { - state.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from); - warning("W011", state.tokens.curr, state.tokens.curr.value); - } - - advance(","); - - // TODO: This is a temporary solution to fight against false-positives in - // arrays and objects with trailing commas (see GH-363). The best solution - // would be to extract all whitespace rules out of parser. - - if (state.tokens.next.value !== "]" && state.tokens.next.value !== "}") { - nonadjacent(state.tokens.curr, state.tokens.next); - } - - if (state.tokens.next.identifier && !state.option.inES5()) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "yield": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return true; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - return true; - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - return symbol(s, 0); - } - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - return this; - }; - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, function () { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - return x; - } - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function application(s) { - var x = symbol(s, 42); - - x.led = function (left) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "arrow function syntax (=>)"); - } - - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - - this.left = left; - this.right = doFunction(undefined, undefined, false, left); - return this; - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function (left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", right, "!"); - } - - this.left = left; - this.right = right; - return this; - }; - return x; - } - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (left) { - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - - that.right = expression(19); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function (t) { - if (funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - that.right = expression(19); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - nonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(19); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function (left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop) { - if (!state.tokens.next.identifier) { - return; - } - - advance(); - - var curr = state.tokens.curr; - var meta = curr.meta || {}; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.inES5() || meta.isFutureReservedWord) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - // Display an info message about reserved words as properties - // and ES5 but do it only once. - if (prop && !api.getCache("displayed:I002")) { - api.setCache("displayed:I002", true); - warning("I002"); - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop); - if (i) { - return i; - } - if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { - warning("W025"); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (state.tokens.next.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!state.option.latedef) { - break; - } - - warning("W026", t); - break; - } - - warning("W027", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var values; - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord) { - warning("W024", t, t.id); - res = false; - } - - // detect a destructuring assignment - if (_.has(["[", "{"], t.value)) { - if (lookupBlockType().isDestAssign) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - values = destructuringExpression(); - values.forEach(function (tok) { - isundef(funct, "W117", tok.token, tok.id); - }); - advance("="); - destructuringExpressionMatch(values, expression(0, true)); - advance(";"); - return; - } - } - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - - while (state.tokens.next.id === ",") { - if (comma()) { - r = expression(0, true); - } else { - return; - } - } - - if (state.tokens.next.id !== ";") { - if (!state.option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!state.option.lastsemic || state.tokens.next.id !== "}" || - state.tokens.next.line !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - adjacent(state.tokens.curr, state.tokens.next); - advance(";"); - nonadjacent(state.tokens.curr, state.tokens.next); - } - } - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement(startLine === state.tokens.next.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("W033", state.tokens.next); - } else { - p = pn; - } - } else if (p.id === "}") { - // Directive with no other statements, warn about missing semicolon - warning("W033", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) - state.option.newcap = true; - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc, isfatarrow) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - if (line !== state.tokens.next.line) { - indentation(); - } - } else if (line !== state.tokens.next.line) { - indentation(); - } - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - if (stmt && !isfatarrow && !state.option.inMoz(true)) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - if (!stmt) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - } - expression(0); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - noreach = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement(state.tokens.next.line === state.tokens.curr.line)]; - indent -= state.option.indent; - noreach = false; - - delete funct["(nolet)"]; - } - funct["(verb)"] = null; - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035"); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value, line = tkn.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - var block; - if (_.has(funct, "(blockscope)")) { - block = funct["(blockscope)"].getlabel(v); - } - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && (state.tokens.next.value === "." || - state.tokens.next.value === "["))) { - - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - } - } - - note_implied(state.tokens.curr); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // - // display warning if we're inside of typeof or delete. - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && - (state.tokens.next.value === "." || state.tokens.next.value === "["))) { - - isundef(funct, "W117", state.tokens.curr, v); - } - funct[v] = true; - note_implied(state.tokens.curr); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - led: function () { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (state.directive["use strict"] && !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) - warning("W116", this, "===", "=="); - else if (isPoorRelation(left)) - warning("W041", this, "===", left.value); - else if (isPoorRelation(right)) - warning("W041", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("W007"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("W006"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("W051"); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (state.option.bitwise) { - warning("W052", this, "~"); - } - expression(150); - return this; - }); - - prefix("...", function () { - if (!state.option.inESNext()) { - warning("W104", this, "spread/rest operator"); - } - if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.value); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("W053", state.tokens.prev, c.value); - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - adjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(state.tokens.prev, state.tokens.curr); - nobreak(); - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - warning("W061"); - } - - return that; - }, 160, true); - - infix("(", function (left, that) { - if (state.tokens.prev.id !== "}" && state.tokens.prev.id !== ")") { - nobreak(state.tokens.prev, state.tokens.curr); - } - - nospace(); - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - nospace(state.tokens.prev, state.tokens.curr); - - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("W067", left); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - - nospace(); - var bracket, brackets = []; - var pn, pn1, i = 0; - - do { - pn = peek(i); - i += 1; - pn1 = peek(i); - i += 1; - } while (pn.value !== ")" && pn1.value !== "=>" && pn1.value !== ";" && pn1.type !== "(end)"); - - if (state.tokens.next.id === "function") { - state.tokens.next.immed = true; - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - if (pn1.value === "=>" && state.tokens.next.value === "{") { - bracket = state.tokens.next; - bracket.left = destructuringExpression(); - brackets.push(bracket); - for (var t in bracket.left) { - exprs.push(bracket.left[t].token); - } - } else { - exprs.push(expression(0)); - } - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")", this); - nospace(state.tokens.prev, state.tokens.curr); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - (state.tokens.next.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning("W068", this); - } - } - - if (state.tokens.next.value === "=>") { - return exprs; - } - return exprs[0]; - }); - - application("=>"); - - infix("[", function (left, that) { - nobreak(state.tokens.prev, state.tokens.curr); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("W061", that); - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - nospace(state.tokens.prev, state.tokens.curr); - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - res.right = expression(0); - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(0); - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(0); - advance(")"); - } - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function () { - var blocktype = lookupBlockType(true); - if (blocktype.isCompArray) { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== state.tokens.next.line; - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!state.option.inES5()) - warning("W070"); - advance(","); - } - if (state.tokens.next.id === "]") { - break; - } - if (b && state.tokens.curr.line !== state.tokens.next.line) { - indentation(); - } - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(false, true); - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - advance(); - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - advance(); - } - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - - function functionparams(parsed) { - var curr, next; - var params = []; - var ident; - var tokens = []; - var t; - - if (parsed) { - if (parsed instanceof Array) { - for (var i in parsed) { - curr = parsed[i]; - if (_.contains(["{", "["], curr.id)) { - for (t in curr.left) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (curr.value === "...") { - if (!state.option.inESNext()) { - warning("W104", curr, "spread/rest operator"); - } - continue; - } else { - addlabel(curr.value, "unused", curr); - } - } - return params; - } else { - if (parsed.identifier === true) { - addlabel(parsed.value, "unused", parsed); - return [parsed]; - } - } - } - - next = state.tokens.next; - - advance("("); - nospace(); - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (state.tokens.next.value === "...") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "spread/rest operator"); - } - advance("..."); - nospace(); - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } else { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } - if (state.tokens.next.id === ",") { - comma(); - } else { - advance(")", next); - nospace(state.tokens.prev, state.tokens.curr); - return params; - } - } - } - - - function doFunction(name, statement, generator, fatarrowparams) { - var f; - var oldOption = state.option; - var oldIgnored = state.ignored; - var oldScope = scope; - - state.option = Object.create(state.option); - state.ignored = Object.create(state.ignored); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : state.tokens.next.line, - "(character)" : state.tokens.next.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(state.tokens.next), - "(scope)" : scope, - "(statement)" : statement, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)" : funct["(comparray)"] - }; - - if (generator) { - funct["(generator)"] = true; - } - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(fatarrowparams); - - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, true, true, fatarrowparams ? true:false); - - if (generator && funct["(generator)"] !== "yielded") { - error("E047", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - state.ignored = oldIgnored; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function parseCondAssignment() { - switch (state.tokens.next.id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!state.option.boss) { - warning("W084"); - } - - advance(state.tokens.next.id); - expression(20); - } - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t, g; - var props = {}; // All properties, including accessors - - function saveProperty(name, tkn) { - if (props[name] && _.has(props, name)) - warning("W075", state.tokens.next, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basictkn = tkn; - } - - function saveSetter(name, tkn) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].setter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = tkn; - } - - function saveGetter(name) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].getter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = state.tokens.curr; - } - - b = state.tokens.curr.line !== state.tokens.next.line; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - if (b) { - indentation(); - } - - if (state.tokens.next.value === "get" && peek().id !== ":") { - advance("get"); - - if (!state.option.inES5(true)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveGetter(i); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (p) { - warning("W076", t, p[0], i); - } - - adjacent(state.tokens.curr, state.tokens.next); - } else if (state.tokens.next.value === "set" && peek().id !== ":") { - advance("set"); - - if (!state.option.inES5(true)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveSetter(i, state.tokens.next); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (!p || p.length !== 1) { - warning("W077", t, i); - } - } else { - g = false; - if (state.tokens.next.value === "*" && state.tokens.next.type === "(punctuator)") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "generator functions"); - } - advance("*"); - g = true; - } - i = property_name(); - saveProperty(i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - - if (state.tokens.next.value === "(") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "concise methods"); - } - doFunction(i, undefined, g); - } else { - advance(":"); - nonadjacent(state.tokens.curr, state.tokens.next); - expression(10); - } - } - - countMember(i); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (state.option.inES5()) { - for (var name in props) { - if (_.has(props, name) && props[name].setter && !props[name].getter) { - warning("W078", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function () { - var ident; - if (_.contains(["[", "{"], state.tokens.next.value)) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (state.tokens.next.value === ",") { - identifiers.push({ id: null, token: state.tokens.curr }); - } else { - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - } - }; - if (state.tokens.next.value === "[") { - advance("["); - nextInnerDE(); - while (state.tokens.next.value !== "]") { - advance(","); - nextInnerDE(); - } - advance("]"); - } else if (state.tokens.next.value === "{") { - advance("{"); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (state.tokens.next.value !== "}") { - advance(","); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - function destructuringExpressionMatch(tokens, value) { - if (value.first) { - _.zip(tokens, value.first).forEach(function (val) { - var token = val[0]; - var value = val[1]; - if (token && value) { - token.first = value; - } else if (token && token.first && !value) { - warning("W080", token.first, token.first.value); - } /* else { - XXX value is discarded: wouldn't it need a warning ? - } */ - }); - } - } - - var conststatement = stmt("const", function (prefix) { - var tokens, value; - // state variable to know if it is a lone identifier, or a destructuring statement. - var lone; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "const"); - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "const"); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var tokens, lone, value; - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "unused", t.token); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E038", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - var letstatement = stmt("let", function (prefix) { - var tokens, lone, value, letblock; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, "unused", t.token, true); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.inESNext(true)) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = identifier(); - if (funct[i] === "const") { - warning("E011", null, i); - } - adjacent(state.tokens.curr, state.tokens.next); - addlabel(i, "unction", state.tokens.curr); - - doFunction(i, { statement: true }, generator); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - var i = optionalidentifier(); - if (i || state.option.gcl) { - adjacent(state.tokens.curr, state.tokens.next); - } else { - nonadjacent(state.tokens.curr, state.tokens.next); - } - doFunction(i, undefined, generator); - if (!state.option.loopfunc && funct["(loopage)"]) { - warning("W083"); - } - return this; - }); - - blockstmt("if", function () { - var t = state.tokens.next; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - if (state.tokens.next.id === "else") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(state.tokens.curr, state.tokens.next); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = { - "(name)" : "(catch)", - "(line)" : state.tokens.next.line, - "(character)": state.tokens.next.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(state.tokens.next), - "(catch)" : true, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)": funct["(comparray)"] - }; - - if (e) { - addlabel(e, "exception"); - } - - if (state.tokens.next.value === "if") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(false); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.inMoz(true))) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(false); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = state.tokens.next, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - advance("{"); - nonadjacent(state.tokens.curr, state.tokens.next); - indent += state.option.indent; - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - indentation(-state.option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - indentation(-state.option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= state.option.indent; - indentation(); - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!state.option.debug) { - warning("W087"); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = state.tokens.next; - nonadjacent(state.tokens.curr, t); - advance("("); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && - nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!state.option.inESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud, true); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud, true); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - if (!funct["(blockscope)"].getlabel(state.tokens.next.value)) - warning("W088", state.tokens.next, state.tokens.next.value); - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - s = block(true, true); - if (state.option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("W089", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - expression(20); - parseCondAssignment(); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - stmt("yield", function () { - if (state.option.inESNext(true) && funct["(generator)"] !== true) { - error("E046", state.tokens.curr, "yield"); - } else if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface"); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("throws"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine wether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function () { - var pn, pn1; - var i = 0; - var bracketStack = 0; - var ret = {}; - if (_.contains(["[", "{"], state.tokens.curr.value)) - bracketStack += 1; - if (_.contains(["[", "{"], state.tokens.next.value)) - bracketStack += 1; - if (_.contains(["]", "}"], state.tokens.next.value)) - bracketStack -= 1; - do { - pn = peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (_.contains(["[", "{"], pn.value)) { - bracketStack += 1; - } else if (_.contains(["]", "}"], pn.value)) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (_.contains(["}", "]"], pn.value) && pn1.value === "=") { - ret.isDestAssign = true; - ret.notJson = true; - break; - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)" && i < 15); - return ret; - }; - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!state.option.inESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function () { - var CompArray = function () { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function (elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function (elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return {stack: function () { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function () { - _current.variables.filter(function (v) { - if (v.unused) - warning("W098", v.token, v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(_carrays[_carrays.length - 1], 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function (s) { - if (_.contains(["use", "define", "filter"], s)) - _current.mode = s; - }, - check: function (v) { - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false}); - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true}); - } - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (state.tokens.curr.character !== state.tokens.next.from) { - warning("W011", state.tokens.curr); - } - adjacent(state.tokens.curr, state.tokens.next); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function () { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function () { - _current = {}; - _variables.push(_current); - }, - - unstack: function () { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function (l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l)) { - return _variables[i]; - } - } - }, - - current: { - has: function (t) { - return _.has(_current, t); - }, - add: function (t, type, tok) { - _current[t] = { "(type)" : type, - "(token)": tok }; - } - } - }; - }; - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - var newIgnoredObj = {}; - - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - - a.forEach(function (item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - newIgnoredObj[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj["(explicitIndent)"] = o[optionKeys[x]] === false ? false : true; - } - } - } - - state.option = newOptionObj; - state.ignored = newIgnoredObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(state.tokens.next), - "(blockscope)": blockScope(), - "(comparray)": arrayComprehension() - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - warnings = 0; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function (name) { - return state.option[name] || null; - }, - - getCache: function (name) { - return state.cache[name]; - }, - - setCache: function (name, value) { - state.cache[name] = value; - }, - - warn: function (code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function (names, listener) { - names.split(" ").forEach(function (name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function (func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - lex = new Lexer(s); - - lex.on("warning", function (ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function (ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function (ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function (ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function (ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function (ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict && !state.option.node) { - warning("W097", state.tokens.prev); - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.character; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - warningAt("W098", line, chr, name); - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) { - return; - } - - warnUnused(key, tkn, "var"); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_opt; - - while (param) { - type = func[param]; - unused_opt = func["(unusedOption)"] || state.option.unused; - unused_opt = unused_opt === true ? "last-param" : unused_opt; - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], "param", func["(unusedOption)"]); - } else if (unused_opt === "last-param") { - return; - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function (func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: state.option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} - -})() -},{"events":2,"../shared/vars.js":3,"../shared/messages.js":7,"./lex.js":8,"./reg.js":4,"./state.js":5,"./style.js":6,"console-browserify":9,"underscore":10}],9:[function(require,module,exports){ -(function(global){/*global window, global*/ -var util = require("util") -var assert = require("assert") - -var slice = Array.prototype.slice -var console -var times = {} - -if (typeof global !== "undefined" && global.console) { - console = global.console -} else if (typeof window !== "undefined" && window.console) { - console = window.console -} else { - console = window.console = {} -} - -var functions = [ - [log, "log"] - , [info, "info"] - , [warn, "warn"] - , [error, "error"] - , [time, "time"] - , [timeEnd, "timeEnd"] - , [trace, "trace"] - , [dir, "dir"] - , [assert, "assert"] -] - -for (var i = 0; i < functions.length; i++) { - var tuple = functions[i] - var f = tuple[0] - var name = tuple[1] - - if (!console[name]) { - console[name] = f - } -} - -module.exports = console - -function log() {} - -function info() { - console.log.apply(console, arguments) -} - -function warn() { - console.log.apply(console, arguments) -} - -function error() { - console.warn.apply(console, arguments) -} - -function time(label) { - times[label] = Date.now() -} - -function timeEnd(label) { - var time = times[label] - if (!time) { - throw new Error("No such label: " + label) - } - - var duration = Date.now() - time - console.log(label + ": " + duration + "ms") -} - -function trace() { - var err = new Error() - err.name = "Trace" - err.message = util.format.apply(null, arguments) - console.error(err.stack) -} - -function dir(object) { - console.log(util.inspect(object) + "\n") -} - -function assert(expression) { - if (!expression) { - var arr = slice.call(arguments, 1) - assert.ok(false, util.format.apply(null, arr)) - } -} - -})(window) -},{"util":11,"assert":12}],7:[function(require,module,exports){ -(function(){"use strict"; - -var _ = require("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' form line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer or 'false' and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: "Constant {a} was not declared correctly.", - E038: "Variable {a} was not declared correctly.", - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: "'{a}' is already defined and can't be redefined.", - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: "A generator function shall contain a yield statement.", - E048: "Let declaration not directly within block." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing pluses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", - W011: "Unexpected space after '{a}'.", - W012: "Unexpected space before '{a}'.", - W013: "Missing space after '{a}'.", - W014: "Bad line breaking before '{a}'.", - W015: "Expected '{a}' to have an indentation at {b} instead at {c}.", - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' unnecessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate key '{a}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: "Too many var statements.", - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Expected a conditional expression and instead saw an assignment.", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: "Mixed spaces and tabs.", - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: "Trailing whitespace.", - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is only available in JavaScript 1.7.", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option)." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: "Reserved words as properties can be used under the 'es5' option.", - I003: "ES5 option is now set per default" -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function (desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function (desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function (desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); - -})() -},{"underscore":10}],8:[function(require,module,exports){ -(function(){/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = require("underscore"); -var events = require("events"); -var reg = require("./reg.js"); -var state = require("./state.js").state; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9 -}; - -// This is auto generated from the unicode tables. -// The tables are at: -// http://www.fileformat.info/info/unicode/category/Lu/list.htm -// http://www.fileformat.info/info/unicode/category/Ll/list.htm -// http://www.fileformat.info/info/unicode/category/Lt/list.htm -// http://www.fileformat.info/info/unicode/category/Lm/list.htm -// http://www.fileformat.info/info/unicode/category/Lo/list.htm -// http://www.fileformat.info/info/unicode/category/Nl/list.htm - -var unicodeLetterTable = [ - 170, 170, 181, 181, 186, 186, 192, 214, - 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, - 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, - 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, - 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, - 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, - 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, - 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, - 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361, - 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, - 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, - 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, - 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, - 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, - 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, - 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, - 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, - 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, - 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, - 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, - 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, - 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, - 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, - 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, - 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, - 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, - 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, - 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, - 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, - 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, - 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, - 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, - 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346, - 4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696, - 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, - 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, - 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, - 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, - 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, - 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, - 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, - 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, - 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141, - 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, - 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, - 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, - 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, - 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, - 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, - 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, - 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, - 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, - 11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621, - 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, - 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, - 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, - 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, - 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, - 12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312, - 19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124, - 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, - 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, - 42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921, - 43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042, - 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, - 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, - 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, - 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, - 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, - 43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798, - 43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032, - 55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045, - 64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279, - 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, - 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, - 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, - 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, - 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, - 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, - 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, - 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, - 66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511, - 66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592, - 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, - 67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115, - 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, - 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, - 69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894, - 92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964, - 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, - 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, - 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, - 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, - 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, - 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, - 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, - 131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972, - 177984, 177984, 178205, 178205, 194560, 195101 -]; - -var identifierStartTable = []; - -for (var i = 0; i < 128; i++) { - identifierStartTable[i] = - i === 36 || // $ - i >= 65 && i <= 90 || // A-Z - i === 95 || // _ - i >= 97 && i <= 122; // a-z -} - -var identifierPartTable = []; - -for (var i = 0; i < 128; i++) { - identifierPartTable[i] = - identifierStartTable[i] || // $, _, A-Z, a-z - i >= 48 && i <= 57; // 0-9 -} - -// Object that handles postponed lexing verifications that checks the parsed -// environment state. - -function asyncTrigger() { - var _checks = []; - - return { - push: function (fn) { - _checks.push(fn); - }, - - check: function () { - for (var check in _checks) { - _checks[check](); - } - - _checks.splice(0, _checks.length); - } - }; -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function (data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - - if (lines[0] && lines[0].substr(0, 2) === "#!") { - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.lines = lines; - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - get lines() { - this._lines = state.lines; - return this._lines; - }, - - set lines(val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function (i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function (i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function (data) { - * // ... - * }); - */ - on: function (names, listener) { - names.split(" ").forEach(function (name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function () { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Postpone a token event. the checking condition is set as - * last parameter, and the trigger function is called in a - * stored callback. To be later called using the check() function - * by the parser. This avoids parser's peek() to give the lexer - * a false context. - */ - triggerAsync: function (type, args, checks, fn) { - checks.push(function () { - if (fn()) { - this.trigger(type, args); - } - }.bind(this)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function () { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - if (this.peek(1) === "." && this.peek(2) === ".") { - return { - type: Token.Punctuator, - value: "..." - }; - } - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "{": - case "}": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: ">>=" - }; - } - - // Fat arrow punctuator - if (ch1 === "=" && ch2 === ">") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. We need to make sure that this is an - // operator and not a regular expression. - - if (ch1 === "/") { - if (ch2 === "=" && /\/=(?!(\S*\/[gim]?))/.test(this.input)) { - // /= is not a part of a regular expression, return it as a - // punctuator. - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function () { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - special.forEach(function (str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function () { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function () { - var id = ""; - var index = 0; - var type, char; - - // Detects any character in the Unicode categories "Uppercase - // letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter - // (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or - // "Letter number (Nl)". - // - // Both approach and unicodeLetterTable were borrowed from - // Google's Traceur. - - function isUnicodeLetter(code) { - for (var i = 0; i < unicodeLetterTable.length;) { - if (code < unicodeLetterTable[i++]) { - return false; - } - - if (code <= unicodeLetterTable[i++]) { - return true; - } - } - - return false; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function () { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (isUnicodeLetter(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: id - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function () { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - index += 1; - value += char; - - while (index < length) { - char = this.peek(index); - if (!isHexDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 16, - isMalformed: false - }; - } - - // Base-8 numbers. - if (isOctalDigit(char)) { - index += 1; - value += char; - bad = false; - - while (index < length) { - char = this.peek(index); - - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - - if (isDecimalDigit(char)) { - bad = true; - } else if (!isOctalDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 8, - isMalformed: false - }; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 10, - isMalformed: !isFinite(value) - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function (checks) { - /*jshint loopfunc:true */ - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - this.triggerAsync("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }, checks, function () { return state.jsonMode && quote !== "\""; }); - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - this.triggerAsync("warning", { - code: "W043", - line: this.line, - character: this.char - }, checks, function () { return !state.option.multistr; }); - - this.triggerAsync("warning", { - code: "W042", - line: this.line, - character: this.char - }, checks, function () { return state.jsonMode && state.option.multistr; }); - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - isUnclosed: true, - quote: quote - }; - } - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - - if (char === "\\") { - this.skip(); - char = this.peek(); - - switch (char) { - case "'": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }, checks, function () {return state.jsonMode; }); - break; - case "b": - char = "\b"; - break; - case "f": - char = "\f"; - break; - case "n": - char = "\n"; - break; - case "r": - char = "\r"; - break; - case "t": - char = "\t"; - break; - case "0": - char = "\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, - function () { return n >= 0 && n <= 7 && state.directive["use strict"]; }); - break; - case "u": - char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16)); - jump = 5; - break; - case "v": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }, checks, function () { return state.jsonMode; }); - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }, checks, function () { return state.jsonMode; }); - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - case "\"": - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - case "!": - if (value.slice(value.length - 2) === "<") { - break; - } - - /*falls through */ - default: - // Weird escaping. - this.trigger("warning", { - code: "W044", - line: this.line, - character: this.char - }); - } - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function () { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function () { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurence of mixed tabs and spaces. If smarttabs option - * is on, ignore tabs followed by spaces. - * - * Tabs followed by one space followed by a block comment are allowed. - */ - scanMixedSpacesAndTabs: function () { - var at, match; - - if (state.option.smarttabs) { - // Negative look-behind for "//" - match = this.input.match(/(\/\/|^\s?\*)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = this.input.search(/ \t|\t [^\*]/); - } - - return at; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function () { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function (checks) { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - - if (this.peek() === "") { // EOL - if (!/^\s*$/.test(this.lines[this.line - 1]) && state.option.trailing) { - this.trigger("warning", { code: "W102", line: this.line, character: start }); - } - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(checks); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for mixed spaces and tabs - * and other minor warnings. - */ - nextLine: function () { - var char; - - if (this.line >= this.lines.length) { - return false; - } - - this.input = this.lines[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - char = this.scanMixedSpacesAndTabs(); - if (char >= 0) { - this.trigger("warning", { code: "W099", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function () { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It retuns a token in a JSLint-compatible format. - */ - token: function () { - /*jshint loopfunc:true */ - var checks = asyncTrigger(); - var token; - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.inES5(true) && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function (type, value, isProperty) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - obj.check = checks.check; - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(checks); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.triggerAsync("String", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - quote: token.quote - }, checks, function () { return true; }); - - return create("(string)", token.value); - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === "."); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }, checks, function () { return token.base === 16 && state.jsonMode; }); - - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, function () { - return state.directive["use strict"] && token.base === 8; - }); - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; - -})() -},{"events":2,"./reg.js":4,"./state.js":5,"underscore":10}],12:[function(require,module,exports){ -(function(){// UTILITY -var util = require('util'); -var Buffer = require("buffer").Buffer; -var pSlice = Array.prototype.slice; - -function objectKeys(object) { - if (Object.keys) return Object.keys(object); - var result = []; - for (var name in object) { - if (Object.prototype.hasOwnProperty.call(object, name)) { - result.push(name); - } - } - return result; -} - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -util.inherits(assert.AssertionError, Error); - -function replacer(key, value) { - if (value === undefined) { - return '' + value; - } - if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) { - return value.toString(); - } - if (typeof value === 'function' || value instanceof RegExp) { - return value.toString(); - } - return value; -} - -function truncate(s, n) { - if (typeof s == 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } -} - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name + ':', this.message].join(' '); - } else { - return [ - this.name + ':', - truncate(JSON.stringify(this.actual, replacer), 128), - this.operator, - truncate(JSON.stringify(this.expected, replacer), 128) - ].join(' '); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -function ok(value, message) { - if (!!!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = objectKeys(a), - kb = objectKeys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (expected instanceof RegExp) { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail('Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail('Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -})() -},{"util":11,"buffer":13}],11:[function(require,module,exports){ -var events = require('events'); - -exports.isArray = isArray; -exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'}; -exports.isRegExp = function(obj){return Object.prototype.toString.call(obj) === '[object RegExp]'}; - - -exports.print = function () {}; -exports.puts = function () {}; -exports.debug = function() {}; - -exports.inspect = function(obj, showHidden, depth, colors) { - var seen = []; - - var stylize = function(str, styleType) { - // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - var styles = - { 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] }; - - var style = - { 'special': 'cyan', - 'number': 'blue', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' }[styleType]; - - if (style) { - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; - } else { - return str; - } - }; - if (! colors) { - stylize = function(str, styleType) { return str; }; - } - - function format(value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value !== exports && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return value.inspect(recurseTimes); - } - - // Primitive types cannot have properties - switch (typeof value) { - case 'undefined': - return stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return stylize(simple, 'string'); - - case 'number': - return stylize('' + value, 'number'); - - case 'boolean': - return stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return stylize('null', 'null'); - } - - // Look up the keys of the object. - var visible_keys = Object_keys(value); - var keys = showHidden ? Object_getOwnPropertyNames(value) : visible_keys; - - // Functions without properties can be shortcutted. - if (typeof value === 'function' && keys.length === 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - var name = value.name ? ': ' + value.name : ''; - return stylize('[Function' + name + ']', 'special'); - } - } - - // Dates without properties can be shortcutted - if (isDate(value) && keys.length === 0) { - return stylize(value.toUTCString(), 'date'); - } - - var base, type, braces; - // Determine the object type - if (isArray(value)) { - type = 'Array'; - braces = ['[', ']']; - } else { - type = 'Object'; - braces = ['{', '}']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; - } else { - base = ''; - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + value.toUTCString(); - } - - if (keys.length === 0) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - return stylize('[Object]', 'special'); - } - } - - seen.push(value); - - var output = keys.map(function(key) { - var name, str; - if (value.__lookupGetter__) { - if (value.__lookupGetter__(key)) { - if (value.__lookupSetter__(key)) { - str = stylize('[Getter/Setter]', 'special'); - } else { - str = stylize('[Getter]', 'special'); - } - } else { - if (value.__lookupSetter__(key)) { - str = stylize('[Setter]', 'special'); - } - } - } - if (visible_keys.indexOf(key) < 0) { - name = '[' + key + ']'; - } - if (!str) { - if (seen.indexOf(value[key]) < 0) { - if (recurseTimes === null) { - str = format(value[key]); - } else { - str = format(value[key], recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (isArray(value)) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (type === 'Array' && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = stylize(name, 'string'); - } - } - - return name + ': ' + str; - }); - - seen.pop(); - - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.length + 1; - }, 0); - - if (length > 50) { - output = braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - - } else { - output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - return output; - } - return format(obj, (typeof depth === 'undefined' ? 2 : depth)); -}; - - -function isArray(ar) { - return ar instanceof Array || - Array.isArray(ar) || - (ar && ar !== Object.prototype && isArray(ar.__proto__)); -} - - -function isRegExp(re) { - return re instanceof RegExp || - (typeof re === 'object' && Object.prototype.toString.call(re) === '[object RegExp]'); -} - - -function isDate(d) { - if (d instanceof Date) return true; - if (typeof d !== 'object') return false; - var properties = Date.prototype && Object_getOwnPropertyNames(Date.prototype); - var proto = d.__proto__ && Object_getOwnPropertyNames(d.__proto__); - return JSON.stringify(proto) === JSON.stringify(properties); -} - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - -exports.log = function (msg) {}; - -exports.pump = null; - -var Object_keys = Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; -}; - -var Object_getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) { - var res = []; - for (var key in obj) { - if (Object.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; - -var Object_create = Object.create || function (prototype, properties) { - // from es5-shim - var object; - if (prototype === null) { - object = { '__proto__' : null }; - } - else { - if (typeof prototype !== 'object') { - throw new TypeError( - 'typeof prototype[' + (typeof prototype) + '] != \'object\'' - ); - } - var Type = function () {}; - Type.prototype = prototype; - object = new Type(); - object.__proto__ = prototype; - } - if (typeof properties !== 'undefined' && Object.defineProperties) { - Object.defineProperties(object, properties); - } - return object; -}; - -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object_create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (typeof f !== 'string') { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(exports.inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': return JSON.stringify(args[i++]); - default: - return x; - } - }); - for(var x = args[i]; i < len; x = args[++i]){ - if (x === null || typeof x !== 'object') { - str += ' ' + x; - } else { - str += ' ' + exports.inspect(x); - } - } - return str; -}; - -},{"events":2}],10:[function(require,module,exports){ -(function(){// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); - -})() -},{}],14:[function(require,module,exports){ -exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) { - var e, m, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - nBits = -7, - i = isBE ? 0 : (nBytes - 1), - d = isBE ? 1 : -1, - s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity); - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); -}; - -exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) { - var e, m, c, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), - i = isBE ? (nBytes - 1) : 0, - d = isBE ? -1 : 1, - s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); - - buffer[offset + i - d] |= s * 128; -}; - -},{}],13:[function(require,module,exports){ -(function(){function SlowBuffer (size) { - this.length = size; -}; - -var assert = require('assert'); - -exports.INSPECT_MAX_BYTES = 50; - - -function toHex(n) { - if (n < 16) return '0' + n.toString(16); - return n.toString(16); -} - -function utf8ToBytes(str) { - var byteArray = []; - for (var i = 0; i < str.length; i++) - if (str.charCodeAt(i) <= 0x7F) - byteArray.push(str.charCodeAt(i)); - else { - var h = encodeURIComponent(str.charAt(i)).substr(1).split('%'); - for (var j = 0; j < h.length; j++) - byteArray.push(parseInt(h[j], 16)); - } - - return byteArray; -} - -function asciiToBytes(str) { - var byteArray = [] - for (var i = 0; i < str.length; i++ ) - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push( str.charCodeAt(i) & 0xFF ); - - return byteArray; -} - -function base64ToBytes(str) { - return require("base64-js").toByteArray(str); -} - -SlowBuffer.byteLength = function (str, encoding) { - switch (encoding || "utf8") { - case 'hex': - return str.length / 2; - - case 'utf8': - case 'utf-8': - return utf8ToBytes(str).length; - - case 'ascii': - case 'binary': - return str.length; - - case 'base64': - return base64ToBytes(str).length; - - default: - throw new Error('Unknown encoding'); - } -}; - -function blitBuffer(src, dst, offset, length) { - var pos, i = 0; - while (i < length) { - if ((i+offset >= dst.length) || (i >= src.length)) - break; - - dst[i + offset] = src[i]; - i++; - } - return i; -} - -SlowBuffer.prototype.utf8Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(utf8ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.asciiWrite = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(asciiToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.binaryWrite = SlowBuffer.prototype.asciiWrite; - -SlowBuffer.prototype.base64Write = function (string, offset, length) { - var bytes, pos; - return SlowBuffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length); -}; - -SlowBuffer.prototype.base64Slice = function (start, end) { - var bytes = Array.prototype.slice.apply(this, arguments) - return require("base64-js").fromByteArray(bytes); -} - -function decodeUtf8Char(str) { - try { - return decodeURIComponent(str); - } catch (err) { - return String.fromCharCode(0xFFFD); // UTF 8 invalid char - } -} - -SlowBuffer.prototype.utf8Slice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var res = ""; - var tmp = ""; - var i = 0; - while (i < bytes.length) { - if (bytes[i] <= 0x7F) { - res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]); - tmp = ""; - } else - tmp += "%" + bytes[i].toString(16); - - i++; - } - - return res + decodeUtf8Char(tmp); -} - -SlowBuffer.prototype.asciiSlice = function () { - var bytes = Array.prototype.slice.apply(this, arguments); - var ret = ""; - for (var i = 0; i < bytes.length; i++) - ret += String.fromCharCode(bytes[i]); - return ret; -} - -SlowBuffer.prototype.binarySlice = SlowBuffer.prototype.asciiSlice; - -SlowBuffer.prototype.inspect = function() { - var out = [], - len = this.length; - for (var i = 0; i < len; i++) { - out[i] = toHex(this[i]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - return ''; -}; - - -SlowBuffer.prototype.hexSlice = function(start, end) { - var len = this.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; i++) { - out += toHex(this[i]); - } - return out; -}; - - -SlowBuffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - start = +start || 0; - if (typeof end == 'undefined') end = this.length; - - // Fastpath empty strings - if (+end == start) { - return ''; - } - - switch (encoding) { - case 'hex': - return this.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.utf8Slice(start, end); - - case 'ascii': - return this.asciiSlice(start, end); - - case 'binary': - return this.binarySlice(start, end); - - case 'base64': - return this.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -SlowBuffer.prototype.hexWrite = function(string, offset, length) { - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2) { - throw new Error('Invalid hex string'); - } - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; i++) { - var byte = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(byte)) throw new Error('Invalid hex string'); - this[offset + i] = byte; - } - SlowBuffer._charsWritten = i * 2; - return i; -}; - - -SlowBuffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - switch (encoding) { - case 'hex': - return this.hexWrite(string, offset, length); - - case 'utf8': - case 'utf-8': - return this.utf8Write(string, offset, length); - - case 'ascii': - return this.asciiWrite(string, offset, length); - - case 'binary': - return this.binaryWrite(string, offset, length); - - case 'base64': - return this.base64Write(string, offset, length); - - case 'ucs2': - case 'ucs-2': - return this.ucs2Write(string, offset, length); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// slice(start, end) -SlowBuffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - - if (end > this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - return new Buffer(this, end - start, +start); -}; - -SlowBuffer.prototype.copy = function(target, targetstart, sourcestart, sourceend) { - var temp = []; - for (var i=sourcestart; i this.length) { - throw new Error('oob'); - } - if (start > end) { - throw new Error('oob'); - } - - for (var i = start; i < end; i++) { - this[i] = value; - } -} - -function coerce(length) { - // Coerce length to a number (possibly NaN), round up - // in case it's fractional (e.g. 123.456) then do a - // double negate to coerce a NaN to 0. Easy, right? - length = ~~Math.ceil(+length); - return length < 0 ? 0 : length; -} - - -// Buffer - -function Buffer(subject, encoding, offset) { - if (!(this instanceof Buffer)) { - return new Buffer(subject, encoding, offset); - } - - var type; - - // Are we slicing? - if (typeof offset === 'number') { - this.length = coerce(encoding); - this.parent = subject; - this.offset = offset; - } else { - // Find the length - switch (type = typeof subject) { - case 'number': - this.length = coerce(subject); - break; - - case 'string': - this.length = Buffer.byteLength(subject, encoding); - break; - - case 'object': // Assume object is an array - this.length = coerce(subject.length); - break; - - default: - throw new Error('First argument needs to be a number, ' + - 'array or string.'); - } - - if (this.length > Buffer.poolSize) { - // Big buffer, just alloc one. - this.parent = new SlowBuffer(this.length); - this.offset = 0; - - } else { - // Small buffer. - if (!pool || pool.length - pool.used < this.length) allocPool(); - this.parent = pool; - this.offset = pool.used; - pool.used += this.length; - } - - // Treat array-ish objects as a byte array. - if (isArrayIsh(subject)) { - for (var i = 0; i < this.length; i++) { - if (subject instanceof Buffer) { - this.parent[i + this.offset] = subject.readUInt8(i); - } - else { - this.parent[i + this.offset] = subject[i]; - } - } - } else if (type == 'string') { - // We are a string - this.length = this.write(subject, 0, encoding); - } - } - -} - -function isArrayIsh(subject) { - return Array.isArray(subject) || Buffer.isBuffer(subject) || - subject && typeof subject === 'object' && - typeof subject.length === 'number'; -} - -exports.SlowBuffer = SlowBuffer; -exports.Buffer = Buffer; - -Buffer.poolSize = 8 * 1024; -var pool; - -function allocPool() { - pool = new SlowBuffer(Buffer.poolSize); - pool.used = 0; -} - - -// Static methods -Buffer.isBuffer = function isBuffer(b) { - return b instanceof Buffer || b instanceof SlowBuffer; -}; - -Buffer.concat = function (list, totalLength) { - if (!Array.isArray(list)) { - throw new Error("Usage: Buffer.concat(list, [totalLength])\n \ - list should be an Array."); - } - - if (list.length === 0) { - return new Buffer(0); - } else if (list.length === 1) { - return list[0]; - } - - if (typeof totalLength !== 'number') { - totalLength = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - totalLength += buf.length; - } - } - - var buffer = new Buffer(totalLength); - var pos = 0; - for (var i = 0; i < list.length; i++) { - var buf = list[i]; - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer; -}; - -// Inspect -Buffer.prototype.inspect = function inspect() { - var out = [], - len = this.length; - - for (var i = 0; i < len; i++) { - out[i] = toHex(this.parent[i + this.offset]); - if (i == exports.INSPECT_MAX_BYTES) { - out[i + 1] = '...'; - break; - } - } - - return ''; -}; - - -Buffer.prototype.get = function get(i) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i]; -}; - - -Buffer.prototype.set = function set(i, v) { - if (i < 0 || i >= this.length) throw new Error('oob'); - return this.parent[this.offset + i] = v; -}; - - -// write(string, offset = 0, length = buffer.length-offset, encoding = 'utf8') -Buffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - var ret; - switch (encoding) { - case 'hex': - ret = this.parent.hexWrite(string, this.offset + offset, length); - break; - - case 'utf8': - case 'utf-8': - ret = this.parent.utf8Write(string, this.offset + offset, length); - break; - - case 'ascii': - ret = this.parent.asciiWrite(string, this.offset + offset, length); - break; - - case 'binary': - ret = this.parent.binaryWrite(string, this.offset + offset, length); - break; - - case 'base64': - // Warning: maxLength not taken into account in base64Write - ret = this.parent.base64Write(string, this.offset + offset, length); - break; - - case 'ucs2': - case 'ucs-2': - ret = this.parent.ucs2Write(string, this.offset + offset, length); - break; - - default: - throw new Error('Unknown encoding'); - } - - Buffer._charsWritten = SlowBuffer._charsWritten; - - return ret; -}; - - -// toString(encoding, start=0, end=buffer.length) -Buffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - - if (typeof start == 'undefined' || start < 0) { - start = 0; - } else if (start > this.length) { - start = this.length; - } - - if (typeof end == 'undefined' || end > this.length) { - end = this.length; - } else if (end < 0) { - end = 0; - } - - start = start + this.offset; - end = end + this.offset; - - switch (encoding) { - case 'hex': - return this.parent.hexSlice(start, end); - - case 'utf8': - case 'utf-8': - return this.parent.utf8Slice(start, end); - - case 'ascii': - return this.parent.asciiSlice(start, end); - - case 'binary': - return this.parent.binarySlice(start, end); - - case 'base64': - return this.parent.base64Slice(start, end); - - case 'ucs2': - case 'ucs-2': - return this.parent.ucs2Slice(start, end); - - default: - throw new Error('Unknown encoding'); - } -}; - - -// byteLength -Buffer.byteLength = SlowBuffer.byteLength; - - -// fill(value, start=0, end=buffer.length) -Buffer.prototype.fill = function fill(value, start, end) { - value || (value = 0); - start || (start = 0); - end || (end = this.length); - - if (typeof value === 'string') { - value = value.charCodeAt(0); - } - if (!(typeof value === 'number') || isNaN(value)) { - throw new Error('value is not a number'); - } - - if (end < start) throw new Error('end < start'); - - // Fill 0 bytes; we're done - if (end === start) return 0; - if (this.length == 0) return 0; - - if (start < 0 || start >= this.length) { - throw new Error('start out of bounds'); - } - - if (end < 0 || end > this.length) { - throw new Error('end out of bounds'); - } - - return this.parent.fill(value, - start + this.offset, - end + this.offset); -}; - - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function(target, target_start, start, end) { - var source = this; - start || (start = 0); - end || (end = this.length); - target_start || (target_start = 0); - - if (end < start) throw new Error('sourceEnd < sourceStart'); - - // Copy 0 bytes; we're done - if (end === start) return 0; - if (target.length == 0 || source.length == 0) return 0; - - if (target_start < 0 || target_start >= target.length) { - throw new Error('targetStart out of bounds'); - } - - if (start < 0 || start >= source.length) { - throw new Error('sourceStart out of bounds'); - } - - if (end < 0 || end > source.length) { - throw new Error('sourceEnd out of bounds'); - } - - // Are we oob? - if (end > this.length) { - end = this.length; - } - - if (target.length - target_start < end - start) { - end = target.length - target_start + start; - } - - return this.parent.copy(target.parent, - target_start + target.offset, - start + this.offset, - end + this.offset); -}; - - -// slice(start, end) -Buffer.prototype.slice = function(start, end) { - if (end === undefined) end = this.length; - if (end > this.length) throw new Error('oob'); - if (start > end) throw new Error('oob'); - - return new Buffer(this.parent, end - start, +start + this.offset); -}; - - -// Legacy methods for backwards compatibility. - -Buffer.prototype.utf8Slice = function(start, end) { - return this.toString('utf8', start, end); -}; - -Buffer.prototype.binarySlice = function(start, end) { - return this.toString('binary', start, end); -}; - -Buffer.prototype.asciiSlice = function(start, end) { - return this.toString('ascii', start, end); -}; - -Buffer.prototype.utf8Write = function(string, offset) { - return this.write(string, offset, 'utf8'); -}; - -Buffer.prototype.binaryWrite = function(string, offset) { - return this.write(string, offset, 'binary'); -}; - -Buffer.prototype.asciiWrite = function(string, offset) { - return this.write(string, offset, 'ascii'); -}; - -Buffer.prototype.readUInt8 = function(offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - return buffer.parent[buffer.offset + offset]; -}; - -function readUInt16(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - val = buffer.parent[buffer.offset + offset] << 8; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1]; - } - } else { - val = buffer.parent[buffer.offset + offset]; - if (offset + 1 < buffer.length) { - val |= buffer.parent[buffer.offset + offset + 1] << 8; - } - } - - return val; -} - -Buffer.prototype.readUInt16LE = function(offset, noAssert) { - return readUInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt16BE = function(offset, noAssert) { - return readUInt16(this, offset, true, noAssert); -}; - -function readUInt32(buffer, offset, isBigEndian, noAssert) { - var val = 0; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return 0; - - if (isBigEndian) { - if (offset + 1 < buffer.length) - val = buffer.parent[buffer.offset + offset + 1] << 16; - if (offset + 2 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 2] << 8; - if (offset + 3 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 3]; - val = val + (buffer.parent[buffer.offset + offset] << 24 >>> 0); - } else { - if (offset + 2 < buffer.length) - val = buffer.parent[buffer.offset + offset + 2] << 16; - if (offset + 1 < buffer.length) - val |= buffer.parent[buffer.offset + offset + 1] << 8; - val |= buffer.parent[buffer.offset + offset]; - if (offset + 3 < buffer.length) - val = val + (buffer.parent[buffer.offset + offset + 3] << 24 >>> 0); - } - - return val; -} - -Buffer.prototype.readUInt32LE = function(offset, noAssert) { - return readUInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readUInt32BE = function(offset, noAssert) { - return readUInt32(this, offset, true, noAssert); -}; - - -/* - * Signed integer types, yay team! A reminder on how two's complement actually - * works. The first bit is the signed bit, i.e. tells us whether or not the - * number should be positive or negative. If the two's complement value is - * positive, then we're done, as it's equivalent to the unsigned representation. - * - * Now if the number is positive, you're pretty much done, you can just leverage - * the unsigned translations and return those. Unfortunately, negative numbers - * aren't quite that straightforward. - * - * At first glance, one might be inclined to use the traditional formula to - * translate binary numbers between the positive and negative values in two's - * complement. (Though it doesn't quite work for the most negative value) - * Mainly: - * - invert all the bits - * - add one to the result - * - * Of course, this doesn't quite work in Javascript. Take for example the value - * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of - * course, Javascript will do the following: - * - * > ~0xff80 - * -65409 - * - * Whoh there, Javascript, that's not quite right. But wait, according to - * Javascript that's perfectly correct. When Javascript ends up seeing the - * constant 0xff80, it has no notion that it is actually a signed number. It - * assumes that we've input the unsigned value 0xff80. Thus, when it does the - * binary negation, it casts it into a signed value, (positive 0xff80). Then - * when you perform binary negation on that, it turns it into a negative number. - * - * Instead, we're going to have to use the following general formula, that works - * in a rather Javascript friendly way. I'm glad we don't support this kind of - * weird numbering scheme in the kernel. - * - * (BIT-MAX - (unsigned)val + 1) * -1 - * - * The astute observer, may think that this doesn't make sense for 8-bit numbers - * (really it isn't necessary for them). However, when you get 16-bit numbers, - * you do. Let's go back to our prior example and see how this will look: - * - * (0xffff - 0xff80 + 1) * -1 - * (0x007f + 1) * -1 - * (0x0080) * -1 - */ -Buffer.prototype.readInt8 = function(offset, noAssert) { - var buffer = this; - var neg; - - if (!noAssert) { - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to read beyond buffer length'); - } - - if (offset >= buffer.length) return; - - neg = buffer.parent[buffer.offset + offset] & 0x80; - if (!neg) { - return (buffer.parent[buffer.offset + offset]); - } - - return ((0xff - buffer.parent[buffer.offset + offset] + 1) * -1); -}; - -function readInt16(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt16(buffer, offset, isBigEndian, noAssert); - neg = val & 0x8000; - if (!neg) { - return val; - } - - return (0xffff - val + 1) * -1; -} - -Buffer.prototype.readInt16LE = function(offset, noAssert) { - return readInt16(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt16BE = function(offset, noAssert) { - return readInt16(this, offset, true, noAssert); -}; - -function readInt32(buffer, offset, isBigEndian, noAssert) { - var neg, val; - - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - val = readUInt32(buffer, offset, isBigEndian, noAssert); - neg = val & 0x80000000; - if (!neg) { - return (val); - } - - return (0xffffffff - val + 1) * -1; -} - -Buffer.prototype.readInt32LE = function(offset, noAssert) { - return readInt32(this, offset, false, noAssert); -}; - -Buffer.prototype.readInt32BE = function(offset, noAssert) { - return readInt32(this, offset, true, noAssert); -}; - -function readFloat(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.readFloatLE = function(offset, noAssert) { - return readFloat(this, offset, false, noAssert); -}; - -Buffer.prototype.readFloatBE = function(offset, noAssert) { - return readFloat(this, offset, true, noAssert); -}; - -function readDouble(buffer, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to read beyond buffer length'); - } - - return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.readDoubleLE = function(offset, noAssert) { - return readDouble(this, offset, false, noAssert); -}; - -Buffer.prototype.readDoubleBE = function(offset, noAssert) { - return readDouble(this, offset, true, noAssert); -}; - - -/* - * We have to make sure that the value is a valid integer. This means that it is - * non-negative. It has no fractional component and that it does not exceed the - * maximum allowed value. - * - * value The number to check for validity - * - * max The maximum value - */ -function verifuint(value, max) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value >= 0, - 'specified a negative value for writing an unsigned value'); - - assert.ok(value <= max, 'value is larger than maximum value for type'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xff); - } - - if (offset < buffer.length) { - buffer.parent[buffer.offset + offset] = value; - } -}; - -function writeUInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) { - buffer.parent[buffer.offset + offset + i] = - (value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>> - (isBigEndian ? 1 - i : i) * 8; - } - -} - -Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { - writeUInt16(this, value, offset, true, noAssert); -}; - -function writeUInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'trying to write beyond buffer length'); - - verifuint(value, 0xffffffff); - } - - for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) { - buffer.parent[buffer.offset + offset + i] = - (value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff; - } -} - -Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { - writeUInt32(this, value, offset, true, noAssert); -}; - - -/* - * We now move onto our friends in the signed number category. Unlike unsigned - * numbers, we're going to have to worry a bit more about how we put values into - * arrays. Since we are only worrying about signed 32-bit values, we're in - * slightly better shape. Unfortunately, we really can't do our favorite binary - * & in this system. It really seems to do the wrong thing. For example: - * - * > -32 & 0xff - * 224 - * - * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of - * this aren't treated as a signed number. Ultimately a bad thing. - * - * What we're going to want to do is basically create the unsigned equivalent of - * our representation and pass that off to the wuint* functions. To do that - * we're going to do the following: - * - * - if the value is positive - * we can pass it directly off to the equivalent wuint - * - if the value is negative - * we do the following computation: - * mb + val + 1, where - * mb is the maximum unsigned value in that byte size - * val is the Javascript negative integer - * - * - * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If - * you do out the computations: - * - * 0xffff - 128 + 1 - * 0xffff - 127 - * 0xff80 - * - * You can then encode this value as the signed version. This is really rather - * hacky, but it should work and get the job done which is our goal here. - */ - -/* - * A series of checks to make sure we actually have a signed 32-bit number - */ -function verifsint(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); - - assert.ok(Math.floor(value) === value, 'value has a fractional component'); -} - -function verifIEEE754(value, max, min) { - assert.ok(typeof (value) == 'number', - 'cannot write a non-number as a number'); - - assert.ok(value <= max, 'value larger than maximum allowed value'); - - assert.ok(value >= min, 'value smaller than minimum allowed value'); -} - -Buffer.prototype.writeInt8 = function(value, offset, noAssert) { - var buffer = this; - - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7f, -0x80); - } - - if (value >= 0) { - buffer.writeUInt8(value, offset, noAssert); - } else { - buffer.writeUInt8(0xff + value + 1, offset, noAssert); - } -}; - -function writeInt16(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 1 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fff, -0x8000); - } - - if (value >= 0) { - writeUInt16(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { - writeInt16(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { - writeInt16(this, value, offset, true, noAssert); -}; - -function writeInt32(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifsint(value, 0x7fffffff, -0x80000000); - } - - if (value >= 0) { - writeUInt32(buffer, value, offset, isBigEndian, noAssert); - } else { - writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert); - } -} - -Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { - writeInt32(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { - writeInt32(this, value, offset, true, noAssert); -}; - -function writeFloat(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 3 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 23, 4); -} - -Buffer.prototype.writeFloatLE = function(value, offset, noAssert) { - writeFloat(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeFloatBE = function(value, offset, noAssert) { - writeFloat(this, value, offset, true, noAssert); -}; - -function writeDouble(buffer, value, offset, isBigEndian, noAssert) { - if (!noAssert) { - assert.ok(value !== undefined && value !== null, - 'missing value'); - - assert.ok(typeof (isBigEndian) === 'boolean', - 'missing or invalid endian'); - - assert.ok(offset !== undefined && offset !== null, - 'missing offset'); - - assert.ok(offset + 7 < buffer.length, - 'Trying to write beyond buffer length'); - - verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); - } - - require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, - 52, 8); -} - -Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) { - writeDouble(this, value, offset, false, noAssert); -}; - -Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) { - writeDouble(this, value, offset, true, noAssert); -}; - -SlowBuffer.prototype.readUInt8 = Buffer.prototype.readUInt8; -SlowBuffer.prototype.readUInt16LE = Buffer.prototype.readUInt16LE; -SlowBuffer.prototype.readUInt16BE = Buffer.prototype.readUInt16BE; -SlowBuffer.prototype.readUInt32LE = Buffer.prototype.readUInt32LE; -SlowBuffer.prototype.readUInt32BE = Buffer.prototype.readUInt32BE; -SlowBuffer.prototype.readInt8 = Buffer.prototype.readInt8; -SlowBuffer.prototype.readInt16LE = Buffer.prototype.readInt16LE; -SlowBuffer.prototype.readInt16BE = Buffer.prototype.readInt16BE; -SlowBuffer.prototype.readInt32LE = Buffer.prototype.readInt32LE; -SlowBuffer.prototype.readInt32BE = Buffer.prototype.readInt32BE; -SlowBuffer.prototype.readFloatLE = Buffer.prototype.readFloatLE; -SlowBuffer.prototype.readFloatBE = Buffer.prototype.readFloatBE; -SlowBuffer.prototype.readDoubleLE = Buffer.prototype.readDoubleLE; -SlowBuffer.prototype.readDoubleBE = Buffer.prototype.readDoubleBE; -SlowBuffer.prototype.writeUInt8 = Buffer.prototype.writeUInt8; -SlowBuffer.prototype.writeUInt16LE = Buffer.prototype.writeUInt16LE; -SlowBuffer.prototype.writeUInt16BE = Buffer.prototype.writeUInt16BE; -SlowBuffer.prototype.writeUInt32LE = Buffer.prototype.writeUInt32LE; -SlowBuffer.prototype.writeUInt32BE = Buffer.prototype.writeUInt32BE; -SlowBuffer.prototype.writeInt8 = Buffer.prototype.writeInt8; -SlowBuffer.prototype.writeInt16LE = Buffer.prototype.writeInt16LE; -SlowBuffer.prototype.writeInt16BE = Buffer.prototype.writeInt16BE; -SlowBuffer.prototype.writeInt32LE = Buffer.prototype.writeInt32LE; -SlowBuffer.prototype.writeInt32BE = Buffer.prototype.writeInt32BE; -SlowBuffer.prototype.writeFloatLE = Buffer.prototype.writeFloatLE; -SlowBuffer.prototype.writeFloatBE = Buffer.prototype.writeFloatBE; -SlowBuffer.prototype.writeDoubleLE = Buffer.prototype.writeDoubleLE; -SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE; - -})() -},{"assert":12,"./buffer_ieee754":14,"base64-js":15}],15:[function(require,module,exports){ -(function (exports) { - 'use strict'; - - var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - - function b64ToByteArray(b64) { - var i, j, l, tmp, placeHolders, arr; - - if (b64.length % 4 > 0) { - throw 'Invalid string. Length must be a multiple of 4'; - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64.indexOf('='); - placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? b64.length - 4 : b64.length; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]); - arr.push((tmp & 0xFF0000) >> 16); - arr.push((tmp & 0xFF00) >> 8); - arr.push(tmp & 0xFF); - } - - if (placeHolders === 2) { - tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4); - arr.push(tmp & 0xFF); - } else if (placeHolders === 1) { - tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2); - arr.push((tmp >> 8) & 0xFF); - arr.push(tmp & 0xFF); - } - - return arr; - } - - function uint8ToBase64(uint8) { - var i, - extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes - output = "", - temp, length; - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; - }; - - // go through the array every three bytes, we'll deal with trailing stuff later - for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { - temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output += tripletToBase64(temp); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - switch (extraBytes) { - case 1: - temp = uint8[uint8.length - 1]; - output += lookup[temp >> 2]; - output += lookup[(temp << 4) & 0x3F]; - output += '=='; - break; - case 2: - temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]); - output += lookup[temp >> 10]; - output += lookup[(temp >> 4) & 0x3F]; - output += lookup[(temp << 2) & 0x3F]; - output += '='; - break; - } - - return output; - } - - module.exports.toByteArray = b64ToByteArray; - module.exports.fromByteArray = uint8ToBase64; -}()); - -},{}]},{},["B01lSJ"]) -; -JSHINT = require('jshint').JSHINT; -}()); -/*jshint boss: true, rhino: true, unused: true, undef: true, white: true, quotmark: double */ -/*global JSHINT */ - -(function (args) { - "use strict"; - - var filenames = []; - var optstr; // arg1=val1,arg2=val2,... - var predef; // global1=true,global2,global3,... - var opts = {}; - var retval = 0; - - args.forEach(function (arg) { - if (arg.indexOf("=") > -1) { - if (!optstr) { - // First time it's the options. - optstr = arg; - } else { - predef = arg; - } - - return; - } - - if (optstr) { - predef = arg; - return; - } - - filenames.push(arg); - }); - - if (filenames.length === 0) { - print("Usage: jshint.js file.js"); - quit(1); - } - - if (optstr) { - optstr.split(",").forEach(function (arg) { - var o = arg.split("="); - if (o[0] === "indent") { - opts[o[0]] = parseInt(o[1], 10); - } else { - opts[o[0]] = (function (ov) { - switch (ov) { - case "true": - return true; - case "false": - return false; - default: - return ov; - } - }(o[1])); - } - }); - } - - if (predef) { - opts.predef = {}; - - predef.split(",").forEach(function (arg) { - var global = arg.split("="); - opts.predef[global[0]] = global[1] === "true" ? true : false; - }); - } - - filenames.forEach(function (name) { - var input = readFile(name); - - if (!input) { - print("jshint: Couldn't open file " + name); - quit(1); - } - - if (!JSHINT(input, opts)) { - for (var i = 0, err; err = JSHINT.errors[i]; i += 1) { - print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")"); - print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); - print(""); - } - retval = 1; - } - }); - - quit(retval); -}(arguments)); diff --git a/deploy/core/node_modules/jshint/dist/jshint-rhino.js b/deploy/core/node_modules/jshint/dist/jshint-rhino.js deleted file mode 100755 index fcefc797b..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint-rhino.js +++ /dev/null @@ -1,324 +0,0 @@ -#!/usr/bin/env rhino - -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var cached = require.cache[resolved]; - var res = cached? cached.exports : mod(); - return res; -}; - -require.paths = []; -require.modules = {}; -require.cache = {}; -require.extensions = [".js",".coffee",".json"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - x = path.normalize(x); - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = path.normalize(x + '/package.json'); - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -(function () { - var process = {}; - var global = typeof window !== 'undefined' ? window : {}; - var definedProcess = false; - - require.define = function (filename, fn) { - if (!definedProcess && require.modules.__browserify_process) { - process = require.modules.__browserify_process(); - definedProcess = true; - } - - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - var requiredModule = require(file, dirname); - var cached = require.cache[require.resolve(file, dirname)]; - - if (cached && cached.parent === null) { - cached.parent = module_; - } - - return requiredModule; - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - require_.cache = require.cache; - var module_ = { - id : filename, - filename: filename, - exports : {}, - loaded : false, - parent: null - }; - - require.modules[filename] = function () { - require.cache[filename] = module_; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename, - process, - global - ); - module_.loaded = true; - return module_.exports; - }; - }; -})(); - - -require.define("path",Function(['require','module','exports','__dirname','__filename','process','global'],"function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path" -)); - -require.define("__browserify_process",Function(['require','module','exports','__dirname','__filename','process','global'],"var process = module.exports = {};\n\nprocess.nextTick = (function () {\n var canSetImmediate = typeof window !== 'undefined'\n && window.setImmediate;\n var canPost = typeof window !== 'undefined'\n && window.postMessage && window.addEventListener\n ;\n\n if (canSetImmediate) {\n return window.setImmediate;\n }\n\n if (canPost) {\n var queue = [];\n window.addEventListener('message', function (ev) {\n if (ev.source === window && ev.data === 'browserify-tick') {\n ev.stopPropagation();\n if (queue.length > 0) {\n var fn = queue.shift();\n fn();\n }\n }\n }, true);\n\n return function nextTick(fn) {\n queue.push(fn);\n window.postMessage('browserify-tick', '*');\n };\n }\n\n return function nextTick(fn) {\n setTimeout(fn, 0);\n };\n})();\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\n\nprocess.binding = function (name) {\n if (name === 'evals') return (require)('vm')\n else throw new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n process.cwd = function () { return cwd };\n process.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\n//@ sourceURL=__browserify_process" -)); - -require.define("/node_modules/underscore/package.json",Function(['require','module','exports','__dirname','__filename','process','global'],"module.exports = {\"main\":\"underscore.js\"}\n//@ sourceURL=/node_modules/underscore/package.json" -)); - -require.define("/node_modules/underscore/underscore.js",Function(['require','module','exports','__dirname','__filename','process','global'],"// Underscore.js 1.4.0\n// http://underscorejs.org\n// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` in the browser, or `global` on the server.\n var root = this;\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Establish the object that gets returned to break out of a loop iteration.\n var breaker = {};\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n concat = ArrayProto.concat,\n unshift = ArrayProto.unshift,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var\n nativeForEach = ArrayProto.forEach,\n nativeMap = ArrayProto.map,\n nativeReduce = ArrayProto.reduce,\n nativeReduceRight = ArrayProto.reduceRight,\n nativeFilter = ArrayProto.filter,\n nativeEvery = ArrayProto.every,\n nativeSome = ArrayProto.some,\n nativeIndexOf = ArrayProto.indexOf,\n nativeLastIndexOf = ArrayProto.lastIndexOf,\n nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeBind = FuncProto.bind;\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for the old `require()` API. If we're in\n // the browser, add `_` as a global object via a string identifier,\n // for Closure Compiler \"advanced\" mode.\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root['_'] = _;\n }\n\n // Current version.\n _.VERSION = '1.4.0';\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles objects with the built-in `forEach`, arrays, and raw objects.\n // Delegates to **ECMAScript 5**'s native `forEach` if available.\n var each = _.each = _.forEach = function(obj, iterator, context) {\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n for (var key in obj) {\n if (_.has(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) return;\n }\n }\n }\n };\n\n // Return the results of applying the iterator to each element.\n // Delegates to **ECMAScript 5**'s native `map` if available.\n _.map = _.collect = function(obj, iterator, context) {\n var results = [];\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.\n _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (nativeReduce && obj.reduce === nativeReduce) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);\n }\n each(obj, function(value, index, list) {\n if (!initial) {\n memo = value;\n initial = true;\n } else {\n memo = iterator.call(context, memo, value, index, list);\n }\n });\n if (!initial) throw new TypeError('Reduce of empty array with no initial value');\n return memo;\n };\n\n // The right-associative version of reduce, also known as `foldr`.\n // Delegates to **ECMAScript 5**'s native `reduceRight` if available.\n _.reduceRight = _.foldr = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {\n if (context) iterator = _.bind(iterator, context);\n return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);\n }\n var length = obj.length;\n if (length !== +length) {\n var keys = _.keys(obj);\n length = keys.length;\n }\n each(obj, function(value, index, list) {\n index = keys ? keys[--length] : --length;\n if (!initial) {\n memo = obj[index];\n initial = true;\n } else {\n memo = iterator.call(context, memo, obj[index], index, list);\n }\n });\n if (!initial) throw new TypeError('Reduce of empty array with no initial value');\n return memo;\n };\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, iterator, context) {\n var result;\n any(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) {\n result = value;\n return true;\n }\n });\n return result;\n };\n\n // Return all the elements that pass a truth test.\n // Delegates to **ECMAScript 5**'s native `filter` if available.\n // Aliased as `select`.\n _.filter = _.select = function(obj, iterator, context) {\n var results = [];\n if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);\n each(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) results[results.length] = value;\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, iterator, context) {\n var results = [];\n each(obj, function(value, index, list) {\n if (!iterator.call(context, value, index, list)) results[results.length] = value;\n });\n return results;\n };\n\n // Determine whether all of the elements match a truth test.\n // Delegates to **ECMAScript 5**'s native `every` if available.\n // Aliased as `all`.\n _.every = _.all = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = true;\n if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);\n each(obj, function(value, index, list) {\n if (!(result = result && iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Delegates to **ECMAScript 5**'s native `some` if available.\n // Aliased as `any`.\n var any = _.some = _.any = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = false;\n if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);\n each(obj, function(value, index, list) {\n if (result || (result = iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if the array or object contains a given value (using `===`).\n // Aliased as `include`.\n _.contains = _.include = function(obj, target) {\n var found = false;\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;\n found = any(obj, function(value) {\n return value === target;\n });\n return found;\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = function(obj, method) {\n var args = slice.call(arguments, 2);\n return _.map(obj, function(value) {\n return (_.isFunction(method) ? method : value[method]).apply(value, args);\n });\n };\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, function(value){ return value[key]; });\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // with specific `key:value` pairs.\n _.where = function(obj, attrs) {\n if (_.isEmpty(attrs)) return [];\n return _.filter(obj, function(value) {\n for (var key in attrs) {\n if (attrs[key] !== value[key]) return false;\n }\n return true;\n });\n };\n\n // Return the maximum element or (element-based computation).\n // Can't optimize arrays of integers longer than 65,535 elements.\n // See: https://bugs.webkit.org/show_bug.cgi?id=80797\n _.max = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.max.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return -Infinity;\n var result = {computed : -Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed >= result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.min.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return Infinity;\n var result = {computed : Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed < result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Shuffle an array.\n _.shuffle = function(obj) {\n var rand;\n var index = 0;\n var shuffled = [];\n each(obj, function(value) {\n rand = _.random(index++);\n shuffled[index - 1] = shuffled[rand];\n shuffled[rand] = value;\n });\n return shuffled;\n };\n\n // An internal function to generate lookup iterators.\n var lookupIterator = function(value) {\n return _.isFunction(value) ? value : function(obj){ return obj[value]; };\n };\n\n // Sort the object's values by a criterion produced by an iterator.\n _.sortBy = function(obj, value, context) {\n var iterator = lookupIterator(value);\n return _.pluck(_.map(obj, function(value, index, list) {\n return {\n value : value,\n index : index,\n criteria : iterator.call(context, value, index, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index < right.index ? -1 : 1;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(obj, value, context, behavior) {\n var result = {};\n var iterator = lookupIterator(value);\n each(obj, function(value, index) {\n var key = iterator.call(context, value, index, obj);\n behavior(result, key, value);\n });\n return result;\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key, value) {\n (_.has(result, key) ? result[key] : (result[key] = [])).push(value);\n });\n };\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key, value) {\n if (!_.has(result, key)) result[key] = 0;\n result[key]++;\n });\n };\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iterator, context) {\n iterator = iterator == null ? _.identity : lookupIterator(iterator);\n var value = iterator.call(context, obj);\n var low = 0, high = array.length;\n while (low < high) {\n var mid = (low + high) >>> 1;\n iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;\n }\n return low;\n };\n\n // Safely convert anything iterable into a real, live array.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (obj.length === +obj.length) return slice.call(obj);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;\n };\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n return (n != null) && !guard ? slice.call(array, 0, n) : array[0];\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N. The **guard** check allows it to work with\n // `_.map`.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array. The **guard** check allows it to work with `_.map`.\n _.last = function(array, n, guard) {\n if ((n != null) && !guard) {\n return slice.call(array, Math.max(array.length - n, 0));\n } else {\n return array[array.length - 1];\n }\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array. The **guard**\n // check allows it to work with `_.map`.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, (n == null) || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, function(value){ return !!value; });\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, output) {\n each(input, function(value) {\n if (_.isArray(value)) {\n shallow ? push.apply(output, value) : flatten(value, shallow, output);\n } else {\n output.push(value);\n }\n });\n return output;\n };\n\n // Return a completely flattened version of an array.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, []);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = function(array) {\n return _.difference(array, slice.call(arguments, 1));\n };\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iterator, context) {\n var initial = iterator ? _.map(array, iterator, context) : array;\n var results = [];\n var seen = [];\n each(initial, function(value, index) {\n if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {\n seen.push(value);\n results.push(array[index]);\n }\n });\n return results;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = function() {\n return _.uniq(concat.apply(ArrayProto, arguments));\n };\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var rest = slice.call(arguments, 1);\n return _.filter(_.uniq(array), function(item) {\n return _.every(rest, function(other) {\n return _.indexOf(other, item) >= 0;\n });\n });\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = function(array) {\n var rest = concat.apply(ArrayProto, slice.call(arguments, 1));\n return _.filter(array, function(value){ return !_.contains(rest, value); });\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = function() {\n var args = slice.call(arguments);\n var length = _.max(_.pluck(args, 'length'));\n var results = new Array(length);\n for (var i = 0; i < length; i++) {\n results[i] = _.pluck(args, \"\" + i);\n }\n return results;\n };\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values.\n _.object = function(list, values) {\n var result = {};\n for (var i = 0, l = list.length; i < l; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),\n // we need this function. Return the position of the first occurrence of an\n // item in an array, or -1 if the item is not included in the array.\n // Delegates to **ECMAScript 5**'s native `indexOf` if available.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = function(array, item, isSorted) {\n var i = 0, l = array.length;\n if (isSorted) {\n if (typeof isSorted == 'number') {\n i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);\n } else {\n i = _.sortedIndex(array, item);\n return array[i] === item ? i : -1;\n }\n }\n if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);\n for (; i < l; i++) if (array[i] === item) return i;\n return -1;\n };\n\n // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.\n _.lastIndexOf = function(array, item, fromIndex) {\n if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item, fromIndex);\n var i = (fromIndex != null ? fromIndex : array.length);\n while (i--) if (array[i] === item) return i;\n return -1;\n };\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (arguments.length <= 1) {\n stop = start || 0;\n start = 0;\n }\n step = arguments[2] || 1;\n\n var len = Math.max(Math.ceil((stop - start) / step), 0);\n var idx = 0;\n var range = new Array(len);\n\n while(idx < len) {\n range[idx++] = start;\n start += step;\n }\n\n return range;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Reusable constructor function for prototype setting.\n var ctor = function(){};\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Binding with arguments is also known as `curry`.\n // Delegates to **ECMAScript 5**'s native `Function.bind` if available.\n // We check for `func.bind` first, to fail fast when `func` is undefined.\n _.bind = function bind(func, context) {\n var bound, args;\n if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n if (!_.isFunction(func)) throw new TypeError;\n args = slice.call(arguments, 2);\n return bound = function() {\n if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));\n ctor.prototype = func.prototype;\n var self = new ctor;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) return result;\n return self;\n };\n };\n\n // Bind all of an object's methods to that object. Useful for ensuring that\n // all callbacks defined on an object belong to it.\n _.bindAll = function(obj) {\n var funcs = slice.call(arguments, 1);\n if (funcs.length == 0) funcs = _.functions(obj);\n each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });\n return obj;\n };\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memo = {};\n hasher || (hasher = _.identity);\n return function() {\n var key = hasher.apply(this, arguments);\n return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));\n };\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = function(func, wait) {\n var args = slice.call(arguments, 2);\n return setTimeout(function(){ return func.apply(null, args); }, wait);\n };\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = function(func) {\n return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));\n };\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time.\n _.throttle = function(func, wait) {\n var context, args, timeout, throttling, more, result;\n var whenDone = _.debounce(function(){ more = throttling = false; }, wait);\n return function() {\n context = this; args = arguments;\n var later = function() {\n timeout = null;\n if (more) {\n result = func.apply(context, args);\n }\n whenDone();\n };\n if (!timeout) timeout = setTimeout(later, wait);\n if (throttling) {\n more = true;\n } else {\n throttling = true;\n result = func.apply(context, args);\n }\n whenDone();\n return result;\n };\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, result;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(context, args);\n return result;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = function(func) {\n var ran = false, memo;\n return function() {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return function() {\n var args = [func];\n push.apply(args, arguments);\n return wrapper.apply(this, args);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var funcs = arguments;\n return function() {\n var args = arguments;\n for (var i = funcs.length - 1; i >= 0; i--) {\n args = [funcs[i].apply(this, args)];\n }\n return args[0];\n };\n };\n\n // Returns a function that will only be executed after being called N times.\n _.after = function(times, func) {\n if (times <= 0) return func();\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Object Functions\n // ----------------\n\n // Retrieve the names of an object's properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`\n _.keys = nativeKeys || function(obj) {\n if (obj !== Object(obj)) throw new TypeError('Invalid object');\n var keys = [];\n for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var values = [];\n for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);\n return values;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n _.pairs = function(obj) {\n var pairs = [];\n for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n });\n return obj;\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n each(keys, function(key) {\n if (key in obj) copy[key] = obj[key];\n });\n return copy;\n };\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n for (var key in obj) {\n if (!_.contains(keys, key)) copy[key] = obj[key];\n }\n return copy;\n };\n\n // Fill in a given object with default properties.\n _.defaults = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n if (obj[prop] == null) obj[prop] = source[prop];\n }\n });\n return obj;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Internal recursive comparison function for `isEqual`.\n var eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.\n if (a === b) return a !== 0 || 1 / a == 1 / b;\n // A strict comparison is necessary because `null == undefined`.\n if (a == null || b == null) return a === b;\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className != toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, dates, and booleans are compared by value.\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return a == String(b);\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for\n // other numeric values.\n return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a == +b;\n // RegExps are compared by their source patterns and flags.\n case '[object RegExp]':\n return a.source == b.source &&\n a.global == b.global &&\n a.multiline == b.multiline &&\n a.ignoreCase == b.ignoreCase;\n }\n if (typeof a != 'object' || typeof b != 'object') return false;\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] == a) return bStack[length] == b;\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n var size = 0, result = true;\n // Recursively compare objects and arrays.\n if (className == '[object Array]') {\n // Compare array lengths to determine if a deep comparison is necessary.\n size = a.length;\n result = size == b.length;\n if (result) {\n // Deep compare the contents, ignoring non-numeric properties.\n while (size--) {\n if (!(result = eq(a[size], b[size], aStack, bStack))) break;\n }\n }\n } else {\n // Objects with different constructors are not equivalent, but `Object`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&\n _.isFunction(bCtor) && (bCtor instanceof bCtor))) {\n return false;\n }\n // Deep compare objects.\n for (var key in a) {\n if (_.has(a, key)) {\n // Count the expected number of properties.\n size++;\n // Deep compare each member.\n if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;\n }\n }\n // Ensure that both objects contain the same number of properties.\n if (result) {\n for (key in b) {\n if (_.has(b, key) && !(size--)) break;\n }\n result = !size;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return result;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b, [], []);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;\n for (var key in obj) if (_.has(obj, key)) return false;\n return true;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) == '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n return obj === Object(obj);\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.\n each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) == '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return !!(obj && _.has(obj, 'callee'));\n };\n }\n\n // Optimize `isFunction` if appropriate.\n if (typeof (/./) !== 'function') {\n _.isFunction = function(obj) {\n return typeof obj === 'function';\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return _.isNumber(obj) && isFinite(obj);\n };\n\n // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n _.isNaN = function(obj) {\n return _.isNumber(obj) && obj != +obj;\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) == '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, key) {\n return hasOwnProperty.call(obj, key);\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iterators.\n _.identity = function(value) {\n return value;\n };\n\n // Run a function **n** times.\n _.times = function(n, iterator, context) {\n for (var i = 0; i < n; i++) iterator.call(context, i);\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + (0 | Math.random() * (max - min + 1));\n };\n\n // List of HTML entities for escaping.\n var entityMap = {\n escape: {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n }\n };\n entityMap.unescape = _.invert(entityMap.escape);\n\n // Regexes containing the keys and values listed immediately above.\n var entityRegexes = {\n escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),\n unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')\n };\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n _.each(['escape', 'unescape'], function(method) {\n _[method] = function(string) {\n if (string == null) return '';\n return ('' + string).replace(entityRegexes[method], function(match) {\n return entityMap[method][match];\n });\n };\n });\n\n // If the value of the named property is a function then invoke it;\n // otherwise, return it.\n _.result = function(object, property) {\n if (object == null) return null;\n var value = object[property];\n return _.isFunction(value) ? value.call(object) : value;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n each(_.functions(obj), function(name){\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return result.call(this, func.apply(_, args));\n };\n });\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = idCounter++;\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate : /<%([\\s\\S]+?)%>/g,\n interpolate : /<%=([\\s\\S]+?)%>/g,\n escape : /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\t': 't',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escaper = /\\\\|'|\\r|\\n|\\t|\\u2028|\\u2029/g;\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n _.template = function(text, data, settings) {\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = new RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset)\n .replace(escaper, function(match) { return '\\\\' + escapes[match]; });\n source +=\n escape ? \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\" :\n interpolate ? \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\" :\n evaluate ? \"';\\n\" + evaluate + \"\\n__p+='\" : '';\n index = offset + match.length;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + \"return __p;\\n\";\n\n try {\n var render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n if (data) return render(data, _);\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled function source as a convenience for precompilation.\n template.source = 'function(' + (settings.variable || 'obj') + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function, which will delegate to the wrapper.\n _.chain = function(obj) {\n return _(obj).chain();\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var result = function(obj) {\n return this._chain ? _(obj).chain() : obj;\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];\n return result.call(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return result.call(this, method.apply(this._wrapped, arguments));\n };\n });\n\n _.extend(_.prototype, {\n\n // Start chaining a wrapped Underscore object.\n chain: function() {\n this._chain = true;\n return this;\n },\n\n // Extracts the result from a wrapped and chained object.\n value: function() {\n return this._wrapped;\n }\n\n });\n\n}).call(this);\n\n//@ sourceURL=/node_modules/underscore/underscore.js" -)); - -require.define("events",Function(['require','module','exports','__dirname','__filename','process','global'],"if (!process.EventEmitter) process.EventEmitter = function () {};\n\nvar EventEmitter = exports.EventEmitter = process.EventEmitter;\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\n\n// By default EventEmitters will print a warning if more than\n// 10 listeners are added to it. This is a useful default which\n// helps finding memory leaks.\n//\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nvar defaultMaxListeners = 10;\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!this._events) this._events = {};\n this._events.maxListeners = n;\n};\n\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n\n // Check for listener leak\n if (!this._events[type].warned) {\n var m;\n if (this._events.maxListeners !== undefined) {\n m = this._events.maxListeners;\n } else {\n m = defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n console.trace();\n }\n }\n\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = list.indexOf(listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n\n//@ sourceURL=events" -)); - -require.define("/src/shared/vars.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\n// Identifiers provided by the ECMAScript standard.\n\nexports.reservedVars = {\n\targuments : false,\n\tNaN : false\n};\n\nexports.ecmaIdentifiers = {\n\tArray : false,\n\tBoolean : false,\n\tDate : false,\n\tdecodeURI : false,\n\tdecodeURIComponent : false,\n\tencodeURI : false,\n\tencodeURIComponent : false,\n\tError : false,\n\t\"eval\" : false,\n\tEvalError : false,\n\tFunction : false,\n\thasOwnProperty : false,\n\tisFinite : false,\n\tisNaN : false,\n\tJSON : false,\n\tMath : false,\n\tMap : false,\n\tNumber : false,\n\tObject : false,\n\tparseInt : false,\n\tparseFloat : false,\n\tRangeError : false,\n\tReferenceError : false,\n\tRegExp : false,\n\tSet : false,\n\tString : false,\n\tSyntaxError : false,\n\tTypeError : false,\n\tURIError : false,\n\tWeakMap : false\n};\n\n// Global variables commonly provided by a web browser environment.\n\nexports.browser = {\n\tArrayBuffer : false,\n\tArrayBufferView : false,\n\tAudio : false,\n\tBlob : false,\n\taddEventListener : false,\n\tapplicationCache : false,\n\tatob : false,\n\tblur : false,\n\tbtoa : false,\n\tclearInterval : false,\n\tclearTimeout : false,\n\tclose : false,\n\tclosed : false,\n\tDataView : false,\n\tDOMParser : false,\n\tdefaultStatus : false,\n\tdocument : false,\n\tElement : false,\n\tevent : false,\n\tFileReader : false,\n\tFloat32Array : false,\n\tFloat64Array : false,\n\tFormData : false,\n\tfocus : false,\n\tframes : false,\n\tgetComputedStyle : false,\n\tHTMLElement : false,\n\tHTMLAnchorElement : false,\n\tHTMLBaseElement : false,\n\tHTMLBlockquoteElement: false,\n\tHTMLBodyElement : false,\n\tHTMLBRElement : false,\n\tHTMLButtonElement : false,\n\tHTMLCanvasElement : false,\n\tHTMLDirectoryElement : false,\n\tHTMLDivElement : false,\n\tHTMLDListElement : false,\n\tHTMLFieldSetElement : false,\n\tHTMLFontElement : false,\n\tHTMLFormElement : false,\n\tHTMLFrameElement : false,\n\tHTMLFrameSetElement : false,\n\tHTMLHeadElement : false,\n\tHTMLHeadingElement : false,\n\tHTMLHRElement : false,\n\tHTMLHtmlElement : false,\n\tHTMLIFrameElement : false,\n\tHTMLImageElement : false,\n\tHTMLInputElement : false,\n\tHTMLIsIndexElement : false,\n\tHTMLLabelElement : false,\n\tHTMLLayerElement : false,\n\tHTMLLegendElement : false,\n\tHTMLLIElement : false,\n\tHTMLLinkElement : false,\n\tHTMLMapElement : false,\n\tHTMLMenuElement : false,\n\tHTMLMetaElement : false,\n\tHTMLModElement : false,\n\tHTMLObjectElement : false,\n\tHTMLOListElement : false,\n\tHTMLOptGroupElement : false,\n\tHTMLOptionElement : false,\n\tHTMLParagraphElement : false,\n\tHTMLParamElement : false,\n\tHTMLPreElement : false,\n\tHTMLQuoteElement : false,\n\tHTMLScriptElement : false,\n\tHTMLSelectElement : false,\n\tHTMLStyleElement : false,\n\tHTMLTableCaptionElement: false,\n\tHTMLTableCellElement : false,\n\tHTMLTableColElement : false,\n\tHTMLTableElement : false,\n\tHTMLTableRowElement : false,\n\tHTMLTableSectionElement: false,\n\tHTMLTextAreaElement : false,\n\tHTMLTitleElement : false,\n\tHTMLUListElement : false,\n\tHTMLVideoElement : false,\n\thistory : false,\n\tInt16Array : false,\n\tInt32Array : false,\n\tInt8Array : false,\n\tImage : false,\n\tlength : false,\n\tlocalStorage : false,\n\tlocation : false,\n\tMessageChannel : false,\n\tMessageEvent : false,\n\tMessagePort : false,\n\tmoveBy : false,\n\tmoveTo : false,\n\tMutationObserver : false,\n\tname : false,\n\tNode : false,\n\tNodeFilter : false,\n\tnavigator : false,\n\tonbeforeunload : true,\n\tonblur : true,\n\tonerror : true,\n\tonfocus : true,\n\tonload : true,\n\tonresize : true,\n\tonunload : true,\n\topen : false,\n\topenDatabase : false,\n\topener : false,\n\tOption : false,\n\tparent : false,\n\tprint : false,\n\tremoveEventListener : false,\n\tresizeBy : false,\n\tresizeTo : false,\n\tscreen : false,\n\tscroll : false,\n\tscrollBy : false,\n\tscrollTo : false,\n\tsessionStorage : false,\n\tsetInterval : false,\n\tsetTimeout : false,\n\tSharedWorker : false,\n\tstatus : false,\n\ttop : false,\n\tUint16Array : false,\n\tUint32Array : false,\n\tUint8Array : false,\n\tUint8ClampedArray : false,\n\tWebSocket : false,\n\twindow : false,\n\tWorker : false,\n\tXMLHttpRequest : false,\n\tXMLSerializer : false,\n\tXPathEvaluator : false,\n\tXPathException : false,\n\tXPathExpression : false,\n\tXPathNamespace : false,\n\tXPathNSResolver : false,\n\tXPathResult : false\n};\n\nexports.devel = {\n\talert : false,\n\tconfirm: false,\n\tconsole: false,\n\tDebug : false,\n\topera : false,\n\tprompt : false\n};\n\nexports.worker = {\n\timportScripts: true,\n\tpostMessage : true,\n\tself : true\n};\n\n// Widely adopted global names that are not part of ECMAScript standard\nexports.nonstandard = {\n\tescape : false,\n\tunescape: false\n};\n\n// Globals provided by popular JavaScript environments.\n\nexports.couch = {\n\t\"require\" : false,\n\trespond : false,\n\tgetRow : false,\n\temit : false,\n\tsend : false,\n\tstart : false,\n\tsum : false,\n\tlog : false,\n\texports : false,\n\tmodule : false,\n\tprovides : false\n};\n\nexports.node = {\n\t__filename : false,\n\t__dirname : false,\n\tBuffer : false,\n\tDataView : false,\n\tconsole : false,\n\texports : true, // In Node it is ok to exports = module.exports = foo();\n\tGLOBAL : false,\n\tglobal : false,\n\tmodule : false,\n\tprocess : false,\n\trequire : false,\n\tsetTimeout : false,\n\tclearTimeout : false,\n\tsetInterval : false,\n\tclearInterval: false\n};\n\nexports.rhino = {\n\tdefineClass : false,\n\tdeserialize : false,\n\tgc : false,\n\thelp : false,\n\timportPackage: false,\n\t\"java\" : false,\n\tload : false,\n\tloadClass : false,\n\tprint : false,\n\tquit : false,\n\treadFile : false,\n\treadUrl : false,\n\trunCommand : false,\n\tseal : false,\n\tserialize : false,\n\tspawn : false,\n\tsync : false,\n\ttoint32 : false,\n\tversion : false\n};\n\nexports.wsh = {\n\tActiveXObject : true,\n\tEnumerator : true,\n\tGetObject : true,\n\tScriptEngine : true,\n\tScriptEngineBuildVersion : true,\n\tScriptEngineMajorVersion : true,\n\tScriptEngineMinorVersion : true,\n\tVBArray : true,\n\tWSH : true,\n\tWScript : true,\n\tXDomainRequest : true\n};\n\n// Globals provided by popular JavaScript libraries.\n\nexports.dojo = {\n\tdojo : false,\n\tdijit : false,\n\tdojox : false,\n\tdefine\t : false,\n\t\"require\": false\n};\n\nexports.jquery = {\n\t\"$\" : false,\n\tjQuery : false\n};\n\nexports.mootools = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\tAsset : false,\n\tBrowser : false,\n\tChain : false,\n\tClass : false,\n\tColor : false,\n\tCookie : false,\n\tCore : false,\n\tDocument : false,\n\tDomReady : false,\n\tDOMEvent : false,\n\tDOMReady : false,\n\tDrag : false,\n\tElement : false,\n\tElements : false,\n\tEvent : false,\n\tEvents : false,\n\tFx : false,\n\tGroup : false,\n\tHash : false,\n\tHtmlTable : false,\n\tIframe : false,\n\tIframeShim : false,\n\tInputValidator: false,\n\tinstanceOf : false,\n\tKeyboard : false,\n\tLocale : false,\n\tMask : false,\n\tMooTools : false,\n\tNative : false,\n\tOptions : false,\n\tOverText : false,\n\tRequest : false,\n\tScroller : false,\n\tSlick : false,\n\tSlider : false,\n\tSortables : false,\n\tSpinner : false,\n\tSwiff : false,\n\tTips : false,\n\tType : false,\n\ttypeOf : false,\n\tURI : false,\n\tWindow : false\n};\n\nexports.prototypejs = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\t\"$A\" : false,\n\t\"$F\" : false,\n\t\"$H\" : false,\n\t\"$R\" : false,\n\t\"$break\" : false,\n\t\"$continue\" : false,\n\t\"$w\" : false,\n\tAbstract : false,\n\tAjax : false,\n\tClass : false,\n\tEnumerable : false,\n\tElement : false,\n\tEvent : false,\n\tField : false,\n\tForm : false,\n\tHash : false,\n\tInsertion : false,\n\tObjectRange : false,\n\tPeriodicalExecuter: false,\n\tPosition : false,\n\tPrototype : false,\n\tSelector : false,\n\tTemplate : false,\n\tToggle : false,\n\tTry : false,\n\tAutocompleter : false,\n\tBuilder : false,\n\tControl : false,\n\tDraggable : false,\n\tDraggables : false,\n\tDroppables : false,\n\tEffect : false,\n\tSortable : false,\n\tSortableObserver : false,\n\tSound : false,\n\tScriptaculous : false\n};\n\nexports.yui = {\n\tYUI : false,\n\tY : false,\n\tYUI_config: false\n};\n\n\n//@ sourceURL=/src/shared/vars.js" -)); - -require.define("/src/shared/messages.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar _ = require(\"underscore\");\n\nvar errors = {\n\t// JSHint options\n\tE001: \"Bad option: '{a}'.\",\n\tE002: \"Bad option value.\",\n\n\t// JSHint input\n\tE003: \"Expected a JSON value.\",\n\tE004: \"Input is neither a string nor an array of strings.\",\n\tE005: \"Input is empty.\",\n\tE006: \"Unexpected early end of program.\",\n\n\t// Strict mode\n\tE007: \"Missing \\\"use strict\\\" statement.\",\n\tE008: \"Strict violation.\",\n\tE009: \"Option 'validthis' can't be used in a global scope.\",\n\tE010: \"'with' is not allowed in strict mode.\",\n\n\t// Constants\n\tE011: \"const '{a}' has already been declared.\",\n\tE012: \"const '{a}' is initialized to 'undefined'.\",\n\tE013: \"Attempting to override '{a}' which is a constant.\",\n\n\t// Regular expressions\n\tE014: \"A regular expression literal can be confused with '/='.\",\n\tE015: \"Unclosed regular expression.\",\n\tE016: \"Invalid regular expression.\",\n\n\t// Tokens\n\tE017: \"Unclosed comment.\",\n\tE018: \"Unbegun comment.\",\n\tE019: \"Unmatched '{a}'.\",\n\tE020: \"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.\",\n\tE021: \"Expected '{a}' and instead saw '{b}'.\",\n\tE022: \"Line breaking error '{a}'.\",\n\tE023: \"Missing '{a}'.\",\n\tE024: \"Unexpected '{a}'.\",\n\tE025: \"Missing ':' on a case clause.\",\n\tE026: \"Missing '}' to match '{' from line {a}.\",\n\tE027: \"Missing ']' to match '[' form line {a}.\",\n\tE028: \"Illegal comma.\",\n\tE029: \"Unclosed string.\",\n\n\t// Everything else\n\tE030: \"Expected an identifier and instead saw '{a}'.\",\n\tE031: \"Bad assignment.\", // FIXME: Rephrase\n\tE032: \"Expected a small integer and instead saw '{a}'.\",\n\tE033: \"Expected an operator and instead saw '{a}'.\",\n\tE034: \"get/set are ES5 features.\",\n\tE035: \"Missing property name.\",\n\tE036: \"Expected to see a statement and instead saw a block.\",\n\tE037: \"Constant {a} was not declared correctly.\",\n\tE038: \"Variable {a} was not declared correctly.\",\n\tE039: \"Function declarations are not invocable. Wrap the whole function invocation in parens.\",\n\tE040: \"Each value should have its own case label.\",\n\tE041: \"Unrecoverable syntax error.\",\n\tE042: \"Stopping.\",\n\tE043: \"Too many errors.\"\n};\n\nvar warnings = {\n\tW001: \"'hasOwnProperty' is a really bad name.\",\n\tW002: \"Value of '{a}' may be overwritten in IE.\",\n\tW003: \"'{a}' was used before it was defined.\",\n\tW004: \"'{a}' is already defined.\",\n\tW005: \"A dot following a number can be confused with a decimal point.\",\n\tW006: \"Confusing minuses.\",\n\tW007: \"Confusing pluses.\",\n\tW008: \"A leading decimal point can be confused with a dot: '{a}'.\",\n\tW009: \"The array literal notation [] is preferrable.\",\n\tW010: \"The object literal notation {} is preferrable.\",\n\tW011: \"Unexpected space after '{a}'.\",\n\tW012: \"Unexpected space before '{a}'.\",\n\tW013: \"Missing space after '{a}'.\",\n\tW014: \"Bad line breaking before '{a}'.\",\n\tW015: \"Expected '{a}' to have an indentation at {b} instead at {c}.\",\n\tW016: \"Unexpected use of '{a}'.\",\n\tW017: \"Bad operand.\",\n\tW018: \"Confusing use of '{a}'.\",\n\tW019: \"Use the isNaN function to compare with NaN.\",\n\tW020: \"Read only.\",\n\tW021: \"'{a}' is a function.\",\n\tW022: \"Do not assign to the exception parameter.\",\n\tW023: \"Expected an identifier in an assignment and instead saw a function invocation.\",\n\tW024: \"Expected an identifier and instead saw '{a}' (a reserved word).\",\n\tW025: \"Missing name in function declaration.\",\n\tW026: \"Inner functions should be listed at the top of the outer function.\",\n\tW027: \"Unreachable '{a}' after '{b}'.\",\n\tW028: \"Label '{a}' on {b} statement.\",\n\tW029: \"Label '{a}' looks like a javascript url.\",\n\tW030: \"Expected an assignment or function call and instead saw an expression.\",\n\tW031: \"Do not use 'new' for side effects.\",\n\tW032: \"Unnecessary semicolon.\",\n\tW033: \"Missing semicolon.\",\n\tW034: \"Unnecessary directive \\\"{a}\\\".\",\n\tW035: \"Empty block.\",\n\tW036: \"Unexpected /*member '{a}'.\",\n\tW037: \"'{a}' is a statement label.\",\n\tW038: \"'{a}' used out of scope.\",\n\tW039: \"'{a}' is not allowed.\",\n\tW040: \"Possible strict violation.\",\n\tW041: \"Use '{a}' to compare with '{b}'.\",\n\tW042: \"Avoid EOL escaping.\",\n\tW043: \"Bad escaping of EOL. Use option multistr if needed.\",\n\tW044: \"Bad escaping.\",\n\tW045: \"Bad number '{a}'.\",\n\tW046: \"Don't use extra leading zeros '{a}'.\",\n\tW047: \"A trailing decimal point can be confused with a dot: '{a}'.\",\n\tW048: \"Unexpected control character in regular expression.\",\n\tW049: \"Unexpected escaped character '{a}' in regular expression.\",\n\tW050: \"JavaScript URL.\",\n\tW051: \"Variables should not be deleted.\",\n\tW052: \"Unexpected '{a}'.\",\n\tW053: \"Do not use {a} as a constructor.\",\n\tW054: \"The Function constructor is a form of eval.\",\n\tW055: \"A constructor name should start with an uppercase letter.\",\n\tW056: \"Bad constructor.\",\n\tW057: \"Weird construction. Is 'new' unnecessary?\",\n\tW058: \"Missing '()' invoking a constructor.\",\n\tW059: \"Avoid arguments.{a}.\",\n\tW060: \"document.write can be a form of eval.\",\n\tW061: \"eval can be harmful.\",\n\tW062: \"Wrap an immediate function invocation in parens \" +\n\t\t\"to assist the reader in understanding that the expression \" +\n\t\t\"is the result of a function, and not the function itself.\",\n\tW063: \"Math is not a function.\",\n\tW064: \"Missing 'new' prefix when invoking a constructor.\",\n\tW065: \"Missing radix parameter.\",\n\tW066: \"Implied eval. Consider passing a function instead of a string.\",\n\tW067: \"Bad invocation.\",\n\tW068: \"Wrapping non-IIFE function literals in parens is unnecessary.\",\n\tW069: \"['{a}'] is better written in dot notation.\",\n\tW070: \"Extra comma. (it breaks older versions of IE)\",\n\tW071: \"This function has too many statements. ({a})\",\n\tW072: \"This function has too many parameters. ({a})\",\n\tW073: \"Blocks are nested too deeply. ({a})\",\n\tW074: \"This function's cyclomatic complexity is too high. ({a})\",\n\tW075: \"Duplicate key '{a}'.\",\n\tW076: \"Unexpected parameter '{a}' in get {b} function.\",\n\tW077: \"Expected a single parameter in set {a} function.\",\n\tW078: \"Setter is defined without getter.\",\n\tW079: \"Redefinition of '{a}'.\",\n\tW080: \"It's not necessary to initialize '{a}' to 'undefined'.\",\n\tW081: \"Too many var statements.\",\n\tW082: \"Function declarations should not be placed in blocks. \" +\n\t\t\"Use a function expression or move the statement to the top of \" +\n\t\t\"the outer function.\",\n\tW083: \"Don't make functions within a loop.\",\n\tW084: \"Expected a conditional expression and instead saw an assignment.\",\n\tW085: \"Don't use 'with'.\",\n\tW086: \"Expected a 'break' statement before '{a}'.\",\n\tW087: \"Forgotten 'debugger' statement?\",\n\tW088: \"Creating global 'for' variable. Should be 'for (var {a} ...'.\",\n\tW089: \"The body of a for in should be wrapped in an if statement to filter \" +\n\t\t\"unwanted properties from the prototype.\",\n\tW090: \"'{a}' is not a statement label.\",\n\tW091: \"'{a}' is out of scope.\",\n\tW092: \"Wrap the /regexp/ literal in parens to disambiguate the slash operator.\",\n\tW093: \"Did you mean to return a conditional instead of an assignment?\",\n\tW094: \"Unexpected comma.\",\n\tW095: \"Expected a string and instead saw {a}.\",\n\tW096: \"The '{a}' key may produce unexpected results.\",\n\tW097: \"Use the function form of \\\"use strict\\\".\",\n\tW098: \"'{a}' is defined but never used.\",\n\tW099: \"Mixed spaces and tabs.\",\n\tW100: \"This character may get silently deleted by one or more browsers.\",\n\tW101: \"Line is too long.\",\n\tW102: \"Trailing whitespace.\",\n\tW103: \"The '{a}' property is deprecated.\",\n\tW104: \"'{a}' is only available in JavaScript 1.7.\",\n\tW105: \"Unexpected {a} in '{b}'.\",\n\tW106: \"Identifier '{a}' is not in camel case.\",\n\tW107: \"Script URL.\",\n\tW108: \"Strings must use doublequote.\",\n\tW109: \"Strings must use singlequote.\",\n\tW110: \"Mixed double and single quotes.\",\n\tW112: \"Unclosed string.\",\n\tW113: \"Control character in string: {a}.\",\n\tW114: \"Avoid {a}.\",\n\tW115: \"Octal literals are not allowed in strict mode.\",\n\tW116: \"Expected '{a}' and instead saw '{b}'.\",\n\tW117: \"'{a}' is not defined.\",\n};\n\nvar info = {\n\tI001: \"Comma warnings can be turned off with 'laxcomma'.\"\n};\n\nexports.errors = {};\nexports.warnings = {};\nexports.info = {};\n\n_.each(errors, function (desc, code) {\n\texports.errors[code] = { code: code, desc: desc };\n});\n\n_.each(warnings, function (desc, code) {\n\texports.warnings[code] = { code: code, desc: desc };\n});\n\n_.each(info, function (desc, code) {\n\texports.info[code] = { code: code, desc: desc };\n});\n\n//@ sourceURL=/src/shared/messages.js" -)); - -require.define("/src/stable/lex.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Lexical analysis and token construction.\n */\n\n\"use strict\";\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\n\n// Some of these token types are from JavaScript Parser API\n// while others are specific to JSHint parser.\n// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n\nvar Token = {\n\tIdentifier: 1,\n\tPunctuator: 2,\n\tNumericLiteral: 3,\n\tStringLiteral: 4,\n\tComment: 5,\n\tKeyword: 6,\n\tNullLiteral: 7,\n\tBooleanLiteral: 8,\n\tRegExp: 9\n};\n\n// This is auto generated from the unicode tables.\n// The tables are at:\n// http://www.fileformat.info/info/unicode/category/Lu/list.htm\n// http://www.fileformat.info/info/unicode/category/Ll/list.htm\n// http://www.fileformat.info/info/unicode/category/Lt/list.htm\n// http://www.fileformat.info/info/unicode/category/Lm/list.htm\n// http://www.fileformat.info/info/unicode/category/Lo/list.htm\n// http://www.fileformat.info/info/unicode/category/Nl/list.htm\n\nvar unicodeLetterTable = [\n\t170, 170, 181, 181, 186, 186, 192, 214,\n\t216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750,\n\t880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908,\n\t910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366,\n\t1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610,\n\t1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775,\n\t1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957,\n\t1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069,\n\t2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361,\n\t2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431,\n\t2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482,\n\t2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529,\n\t2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608,\n\t2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654,\n\t2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736,\n\t2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785,\n\t2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867,\n\t2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929,\n\t2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970,\n\t2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001,\n\t3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123,\n\t3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212,\n\t3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261,\n\t3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344,\n\t3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455,\n\t3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526,\n\t3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716,\n\t3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743,\n\t3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760,\n\t3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805,\n\t3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138,\n\t4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198,\n\t4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346,\n\t4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696,\n\t4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789,\n\t4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880,\n\t4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740,\n\t5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900,\n\t5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000,\n\t6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312,\n\t6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516,\n\t6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823,\n\t6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141,\n\t7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409,\n\t7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013,\n\t8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061,\n\t8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140,\n\t8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188,\n\t8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455,\n\t8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486,\n\t8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521,\n\t8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358,\n\t11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621,\n\t11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694,\n\t11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726,\n\t11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295,\n\t12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438,\n\t12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589,\n\t12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312,\n\t19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124,\n\t42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539,\n\t42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783,\n\t42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921,\n\t43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042,\n\t43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259,\n\t43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442,\n\t43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595,\n\t43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697,\n\t43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714,\n\t43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798,\n\t43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032,\n\t55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045,\n\t64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279,\n\t64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316,\n\t64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433,\n\t64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019,\n\t65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370,\n\t65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495,\n\t65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594,\n\t65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786,\n\t65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334,\n\t66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511,\n\t66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592,\n\t67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669,\n\t67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115,\n\t68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405,\n\t68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687,\n\t69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894,\n\t92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964,\n\t119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980,\n\t119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069,\n\t120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121,\n\t120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144,\n\t120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570,\n\t120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686,\n\t120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779,\n\t131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972,\n\t177984, 177984, 178205, 178205, 194560, 195101\n];\n\nvar identifierStartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierStartTable[i] =\n\t\ti === 36 || // $\n\t\ti >= 65 && i <= 90 || // A-Z\n\t\ti === 95 || // _\n\t\ti >= 97 && i <= 122; // a-z\n}\n\nvar identifierPartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierPartTable[i] =\n\t\tidentifierStartTable[i] || // $, _, A-Z, a-z\n\t\ti >= 48 && i <= 57; // 0-9\n}\n\n/*\n * Lexer for JSHint.\n *\n * This object does a char-by-char scan of the provided source code\n * and produces a sequence of tokens.\n *\n * var lex = new Lexer(\"var i = 0;\");\n * lex.start();\n * lex.token(); // returns the next token\n *\n * You have to use the token() method to move the lexer forward\n * but you don't have to use its return value to get tokens. In addition\n * to token() method returning the next token, the Lexer object also\n * emits events.\n *\n * lex.on(\"Identifier\", function (data) {\n * if (data.name.indexOf(\"_\") >= 0) {\n * // Produce a warning.\n * }\n * });\n *\n * Note that the token() method returns tokens in a JSLint-compatible\n * format while the event emitter uses a slightly modified version of\n * Mozilla's JavaScript Parser API. Eventually, we will move away from\n * JSLint format.\n */\nfunction Lexer(source) {\n\tvar lines = source;\n\n\tif (typeof lines === \"string\") {\n\t\tlines = lines\n\t\t\t.replace(/\\r\\n/g, \"\\n\")\n\t\t\t.replace(/\\r/g, \"\\n\")\n\t\t\t.split(\"\\n\");\n\t}\n\n\t// If the first line is a shebang (#!), make it a blank and move on.\n\t// Shebangs are used by Node scripts.\n\n\tif (lines[0] && lines[0].substr(0, 2) === \"#!\") {\n\t\tlines[0] = \"\";\n\t}\n\n\tthis.emitter = new events.EventEmitter();\n\tthis.source = source;\n\tthis.lines = lines;\n\tthis.prereg = true;\n\n\tthis.line = 0;\n\tthis.char = 1;\n\tthis.from = 1;\n\tthis.input = \"\";\n\n\tfor (var i = 0; i < state.option.indent; i += 1) {\n\t\tstate.tab += \" \";\n\t}\n}\n\nLexer.prototype = {\n\t_lines: [],\n\n\tget lines() {\n\t\tthis._lines = state.lines;\n\t\treturn this._lines;\n\t},\n\n\tset lines(val) {\n\t\tthis._lines = val;\n\t\tstate.lines = this._lines;\n\t},\n\n\t/*\n\t * Return the next i character without actually moving the\n\t * char pointer.\n\t */\n\tpeek: function (i) {\n\t\treturn this.input.charAt(i || 0);\n\t},\n\n\t/*\n\t * Move the char pointer forward i times.\n\t */\n\tskip: function (i) {\n\t\ti = i || 1;\n\t\tthis.char += i;\n\t\tthis.input = this.input.slice(i);\n\t},\n\n\t/*\n\t * Subscribe to a token event. The API for this method is similar\n\t * Underscore.js i.e. you can subscribe to multiple events with\n\t * one call:\n\t *\n\t * lex.on(\"Identifier Number\", function (data) {\n\t * // ...\n\t * });\n\t */\n\ton: function (names, listener) {\n\t\tnames.split(\" \").forEach(function (name) {\n\t\t\tthis.emitter.on(name, listener);\n\t\t}.bind(this));\n\t},\n\n\t/*\n\t * Trigger a token event. All arguments will be passed to each\n\t * listener.\n\t */\n\ttrigger: function () {\n\t\tthis.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments));\n\t},\n\n\t/*\n\t * Extract a punctuator out of the next sequence of characters\n\t * or return 'null' if its not possible.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanPunctuator function in the Esprima parser's source code.\n\t */\n\tscanPunctuator: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2, ch3, ch4;\n\n\t\tswitch (ch1) {\n\t\t// Most common single-character punctuators\n\t\tcase \".\":\n\t\t\tif ((/^[0-9]$/).test(this.peek(1))) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* falls through */\n\t\tcase \"(\":\n\t\tcase \")\":\n\t\tcase \";\":\n\t\tcase \",\":\n\t\tcase \"{\":\n\t\tcase \"}\":\n\t\tcase \"[\":\n\t\tcase \"]\":\n\t\tcase \":\":\n\t\tcase \"~\":\n\t\tcase \"?\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// A pound sign (for Node shebangs)\n\t\tcase \"#\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// We're at the end of input\n\t\tcase \"\":\n\t\t\treturn null;\n\t\t}\n\n\t\t// Peek more characters\n\n\t\tch2 = this.peek(1);\n\t\tch3 = this.peek(2);\n\t\tch4 = this.peek(3);\n\n\t\t// 4-character punctuator: >>>=\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\" && ch4 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>=\"\n\t\t\t};\n\t\t}\n\n\t\t// 3-character punctuators: === !== >>> <<= >>=\n\n\t\tif (ch1 === \"=\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"===\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"!\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"!==\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"<\" && ch2 === \"<\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\t// 2-character punctuators: <= >= == != ++ -- << >> && ||\n\t\t// += -= *= %= &= |= ^= (but not /=, see below)\n\t\tif (ch1 === ch2 && (\"+-<>&|\".indexOf(ch1) >= 0)) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1 + ch2\n\t\t\t};\n\t\t}\n\n\t\tif (\"<>=!+-*%&|^\".indexOf(ch1) >= 0) {\n\t\t\tif (ch2 === \"=\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: ch1 + ch2\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\t\t}\n\n\t\t// Special case: /=. We need to make sure that this is an\n\t\t// operator and not a regular expression.\n\n\t\tif (ch1 === \"/\") {\n\t\t\tif (ch2 === \"=\" && /\\/=(?!(\\S*\\/[gim]?))/.test(this.input)) {\n\t\t\t\t// /= is not a part of a regular expression, return it as a\n\t\t\t\t// punctuator.\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: \"/=\"\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"/\"\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a comment out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since comments can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * In addition to normal JavaScript comments (// and /*) this method\n\t * also recognizes JSHint- and JSLint-specific comments such as\n\t * /*jshint, /*jslint, /*globals and so on.\n\t */\n\tscanComments: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2 = this.peek(1);\n\t\tvar rest = this.input.substr(2);\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.character;\n\n\t\t// Create a comment token object and make sure it\n\t\t// has all the data JSHint needs to work with special\n\t\t// comments.\n\n\t\tfunction commentToken(label, body, opt) {\n\t\t\tvar special = [\"jshint\", \"jslint\", \"members\", \"member\", \"globals\", \"global\", \"exported\"];\n\t\t\tvar isSpecial = false;\n\t\t\tvar value = label + body;\n\t\t\tvar commentType = \"plain\";\n\t\t\topt = opt || {};\n\n\t\t\tif (opt.isMultiline) {\n\t\t\t\tvalue += \"*/\";\n\t\t\t}\n\n\t\t\tspecial.forEach(function (str) {\n\t\t\t\tif (isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (body.substr(0, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + str;\n\t\t\t\t\tbody = body.substr(str.length);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial && body.charAt(0) === \" \" && body.substr(1, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + \" \" + str;\n\t\t\t\t\tbody = body.substr(str.length + 1);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"member\":\n\t\t\t\t\tcommentType = \"members\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"global\":\n\t\t\t\t\tcommentType = \"globals\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tcommentType = str;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Comment,\n\t\t\t\tcommentType: commentType,\n\t\t\t\tvalue: value,\n\t\t\t\tbody: body,\n\t\t\t\tisSpecial: isSpecial,\n\t\t\t\tisMultiline: opt.isMultiline || false,\n\t\t\t\tisMalformed: opt.isMalformed || false\n\t\t\t};\n\t\t}\n\n\t\t// End of unbegun comment. Raise an error and skip that input.\n\t\tif (ch1 === \"*\" && ch2 === \"/\") {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E018\",\n\t\t\t\tline: startLine,\n\t\t\t\tcharacter: startChar\n\t\t\t});\n\n\t\t\tthis.skip(2);\n\t\t\treturn null;\n\t\t}\n\n\t\t// Comments must start either with // or /*\n\t\tif (ch1 !== \"/\" || (ch2 !== \"*\" && ch2 !== \"/\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// One-line comment\n\t\tif (ch2 === \"/\") {\n\t\t\tthis.skip(this.input.length); // Skip to the EOL.\n\t\t\treturn commentToken(\"//\", rest);\n\t\t}\n\n\t\tvar body = \"\";\n\n\t\t/* Multi-line comment */\n\t\tif (ch2 === \"*\") {\n\t\t\tthis.skip(2);\n\n\t\t\twhile (this.peek() !== \"*\" || this.peek(1) !== \"/\") {\n\t\t\t\tif (this.peek() === \"\") { // End of Line\n\t\t\t\t\tbody += \"\\n\";\n\n\t\t\t\t\t// If we hit EOF and our comment is still unclosed,\n\t\t\t\t\t// trigger an error and end the comment implicitly.\n\t\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\t\tcode: \"E017\",\n\t\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn commentToken(\"/*\", body, {\n\t\t\t\t\t\t\tisMultiline: true,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody += this.peek();\n\t\t\t\t\tthis.skip();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.skip(2);\n\t\t\treturn commentToken(\"/*\", body, { isMultiline: true });\n\t\t}\n\t},\n\n\t/*\n\t * Extract a keyword out of the next sequence of characters or\n\t * return 'null' if its not possible.\n\t */\n\tscanKeyword: function () {\n\t\tvar result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input);\n\t\tvar keywords = [\n\t\t\t\"if\", \"in\", \"do\", \"var\", \"for\", \"new\",\n\t\t\t\"try\", \"let\", \"this\", \"else\", \"case\",\n\t\t\t\"void\", \"with\", \"enum\", \"while\", \"break\",\n\t\t\t\"catch\", \"throw\", \"const\", \"yield\", \"class\",\n\t\t\t\"super\", \"return\", \"typeof\", \"delete\",\n\t\t\t\"switch\", \"export\", \"import\", \"default\",\n\t\t\t\"finally\", \"extends\", \"function\", \"continue\",\n\t\t\t\"debugger\", \"instanceof\"\n\t\t];\n\n\t\tif (result && keywords.indexOf(result[0]) >= 0) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Keyword,\n\t\t\t\tvalue: result[0]\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a JavaScript identifier out of the next sequence of\n\t * characters or return 'null' if its not possible. In addition,\n\t * to Identifier this method can also produce BooleanLiteral\n\t * (true/false) and NullLiteral (null).\n\t */\n\tscanIdentifier: function () {\n\t\tvar id = \"\";\n\t\tvar index = 0;\n\t\tvar type, char;\n\n\t\t// Detects any character in the Unicode categories \"Uppercase\n\t\t// letter (Lu)\", \"Lowercase letter (Ll)\", \"Titlecase letter\n\t\t// (Lt)\", \"Modifier letter (Lm)\", \"Other letter (Lo)\", or\n\t\t// \"Letter number (Nl)\".\n\t\t//\n\t\t// Both approach and unicodeLetterTable were borrowed from\n\t\t// Google's Traceur.\n\n\t\tfunction isUnicodeLetter(code) {\n\t\t\tfor (var i = 0; i < unicodeLetterTable.length;) {\n\t\t\t\tif (code < unicodeLetterTable[i++]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (code <= unicodeLetterTable[i++]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tvar readUnicodeEscapeSequence = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tindex += 1;\n\n\t\t\tif (this.peek(index) !== \"u\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar ch1 = this.peek(index + 1);\n\t\t\tvar ch2 = this.peek(index + 2);\n\t\t\tvar ch3 = this.peek(index + 3);\n\t\t\tvar ch4 = this.peek(index + 4);\n\t\t\tvar code;\n\n\t\t\tif (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {\n\t\t\t\tcode = parseInt(ch1 + ch2 + ch3 + ch4, 16);\n\n\t\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\t\tindex += 5;\n\t\t\t\t\treturn \"\\\\u\" + ch1 + ch2 + ch3 + ch4;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierStart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierStartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierPart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierPartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tchar = getIdentifierStart();\n\t\tif (char === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tid = char;\n\t\tfor (;;) {\n\t\t\tchar = getIdentifierPart();\n\n\t\t\tif (char === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tid += char;\n\t\t}\n\n\t\tswitch (id) {\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\t\ttype = Token.BooleanLiteral;\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\ttype = Token.NullLiteral;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttype = Token.Identifier;\n\t\t}\n\n\t\treturn {\n\t\t\ttype: type,\n\t\t\tvalue: id\n\t\t};\n\t},\n\n\t/*\n\t * Extract a numeric literal out of the next sequence of\n\t * characters or return 'null' if its not possible. This method\n\t * supports all numeric literals described in section 7.8.3\n\t * of the EcmaScript 5 specification.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanNumericLiteral function in the Esprima parser's source code.\n\t */\n\tscanNumericLiteral: function () {\n\t\tvar index = 0;\n\t\tvar value = \"\";\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek(index);\n\t\tvar bad;\n\n\t\tfunction isDecimalDigit(str) {\n\t\t\treturn (/^[0-9]$/).test(str);\n\t\t}\n\n\t\tfunction isOctalDigit(str) {\n\t\t\treturn (/^[0-7]$/).test(str);\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tfunction isIdentifierStart(ch) {\n\t\t\treturn (ch === \"$\") || (ch === \"_\") || (ch === \"\\\\\") ||\n\t\t\t\t(ch >= \"a\" && ch <= \"z\") || (ch >= \"A\" && ch <= \"Z\");\n\t\t}\n\n\t\t// Numbers must start either with a decimal digit or a point.\n\n\t\tif (char !== \".\" && !isDecimalDigit(char)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (char !== \".\") {\n\t\t\tvalue = this.peek(index);\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (value === \"0\") {\n\t\t\t\t// Base-16 numbers.\n\t\t\t\tif (char === \"x\" || char === \"X\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (!isHexDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value.length <= 2) { // 0x\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 16,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Base-8 numbers.\n\t\t\t\tif (isOctalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tbad = false;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\n\t\t\t\t\t\t// Numbers like '019' (note the 9) are not valid octals\n\t\t\t\t\t\t// but we still parse them and mark as malformed.\n\n\t\t\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\t\t\tbad = true;\n\t\t\t\t\t\t} else if (!isOctalDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 8,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Decimal numbers that start with '0' such as '09' are illegal\n\t\t\t\t// but we still parse them and return as malformed.\n\n\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Decimal digits.\n\n\t\tif (char === \".\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Exponent part.\n\n\t\tif (char === \"e\" || char === \"E\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (char === \"+\" || char === \"-\") {\n\t\t\t\tvalue += this.input(index);\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tchar = this.peek(index);\n\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\n\t\t\t\twhile (index < length) {\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.NumericLiteral,\n\t\t\tvalue: value,\n\t\t\tbase: 10,\n\t\t\tisMalformed: !isFinite(value)\n\t\t};\n\t},\n\n\t/*\n\t * Extract a string out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since strings can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * This method recognizes pseudo-multiline JavaScript strings:\n\t *\n\t * var str = \"hello\\\n\t * world\";\n */\n\tscanStringLiteral: function () {\n\t\tvar quote = this.peek();\n\n\t\t// String must start with a quote.\n\t\tif (quote !== \"\\\"\" && quote !== \"'\") {\n\t\t\treturn null;\n\t\t}\n\n\t\t// In JSON strings must always use double quotes.\n\t\tif (state.jsonMode && quote !== \"\\\"\") {\n\t\t\tthis.trigger(\"warning\", {\n\t\t\t\tcode: \"W108\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char // +1?\n\t\t\t});\n\t\t}\n\n\t\tvar value = \"\";\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.char;\n\t\tvar allowNewLine = false;\n\n\t\tthis.skip();\n\n\t\twhile (this.peek() !== quote) {\n\t\t\twhile (this.peek() === \"\") { // End Of Line\n\n\t\t\t\t// If an EOL is not preceded by a backslash, show a warning\n\t\t\t\t// and proceed like it was a legit multi-line string where\n\t\t\t\t// author simply forgot to escape the newline symbol.\n\t\t\t\t//\n\t\t\t\t// Another approach is to implicitly close a string on EOL\n\t\t\t\t// but it generates too many false positives.\n\n\t\t\t\tif (!allowNewLine) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W112\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tallowNewLine = false;\n\n\t\t\t\t\t// Otherwise show a warning if multistr option was not set.\n\t\t\t\t\t// For JSON, show warning no matter what.\n\n\t\t\t\t\tif (!state.option.multistr) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W043\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W042\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we get an EOF inside of an unclosed string, show an\n\t\t\t\t// error and implicitly close it at the EOF point.\n\n\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E029\",\n\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t});\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.StringLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tisUnclosed: true,\n\t\t\t\t\t\tquote: quote\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tallowNewLine = false;\n\t\t\tvar char = this.peek();\n\t\t\tvar jump = 1; // A length of a jump, after we're done\n\t\t\t // parsing this character.\n\n\t\t\tif (char < \" \") {\n\t\t\t\t// Warn about a control character in a string.\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W113\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ \"\" ]\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Special treatment for some escaped characters.\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tthis.skip();\n\t\t\t\tchar = this.peek();\n\n\t\t\t\tswitch (char) {\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\'\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"b\":\n\t\t\t\t\tchar = \"\\b\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"f\":\n\t\t\t\t\tchar = \"\\f\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"n\":\n\t\t\t\t\tchar = \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"r\":\n\t\t\t\t\tchar = \"\\r\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"t\":\n\t\t\t\t\tchar = \"\\t\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"0\":\n\t\t\t\t\tchar = \"\\0\";\n\n\t\t\t\t\t// Octal literals fail in strict mode.\n\t\t\t\t\t// Check if the number is between 00 and 07.\n\t\t\t\t\tvar n = parseInt(this.peek(), 10);\n\t\t\t\t\tif (n >= 0 && n <= 7 && state.directive[\"use strict\"]) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"u\":\n\t\t\t\t\tchar = String.fromCharCode(parseInt(this.input.substr(1, 4), 16));\n\t\t\t\t\tjump = 5;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"v\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\v\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = \"\\v\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"x\":\n\t\t\t\t\tvar\tx = parseInt(this.input.substr(1, 2), 16);\n\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\x-\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = String.fromCharCode(x);\n\t\t\t\t\tjump = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\\\\\":\n\t\t\t\tcase \"\\\"\":\n\t\t\t\tcase \"/\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\":\n\t\t\t\t\tallowNewLine = true;\n\t\t\t\t\tchar = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"!\":\n\t\t\t\t\tif (value.slice(value.length - 2) === \"<\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t/*falls through */\n\t\t\t\tdefault:\n\t\t\t\t\t// Weird escaping.\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W044\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvalue += char;\n\t\t\tthis.skip(jump);\n\t\t}\n\n\t\tthis.skip();\n\t\treturn {\n\t\t\ttype: Token.StringLiteral,\n\t\t\tvalue: value,\n\t\t\tisUnclosed: false,\n\t\t\tquote: quote\n\t\t};\n\t},\n\n\t/*\n\t * Extract a regular expression out of the next sequence of\n\t * characters and/or lines or return 'null' if its not possible.\n\t *\n\t * This method is platform dependent: it accepts almost any\n\t * regular expression values but then tries to compile and run\n\t * them using system's RegExp object. This means that there are\n\t * rare edge cases where one JavaScript engine complains about\n\t * your regular expression while others don't.\n\t */\n\tscanRegExp: function () {\n\t\tvar index = 0;\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek();\n\t\tvar value = char;\n\t\tvar body = \"\";\n\t\tvar flags = [];\n\t\tvar malformed = false;\n\t\tvar isCharSet = false;\n\t\tvar terminated;\n\n\t\tvar scanUnexpectedChars = function () {\n\t\t\t// Unexpected control character\n\t\t\tif (char < \" \") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W048\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Unexpected escaped character\n\t\t\tif (char === \"<\") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W049\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ char ]\n\t\t\t\t});\n\t\t\t}\n\t\t}.bind(this);\n\n\t\t// Regular expressions must start with '/'\n\t\tif (!this.prereg || char !== \"/\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tindex += 1;\n\t\tterminated = false;\n\n\t\t// Try to get everything in between slashes. A couple of\n\t\t// cases aside (see scanUnexpectedChars) we don't really\n\t\t// care whether the resulting expression is valid or not.\n\t\t// We will check that later using the RegExp object.\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tvalue += char;\n\t\t\tbody += char;\n\n\t\t\tif (isCharSet) {\n\t\t\t\tif (char === \"]\") {\n\t\t\t\t\tif (this.peek(index - 1) !== \"\\\\\" || this.peek(index - 2) === \"\\\\\") {\n\t\t\t\t\t\tisCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (char === \"\\\\\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tbody += char;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\tscanUnexpectedChars();\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tindex += 1;\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tbody += char;\n\t\t\t\tvalue += char;\n\n\t\t\t\tscanUnexpectedChars();\n\n\t\t\t\tif (char === \"/\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (char === \"[\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (char === \"[\") {\n\t\t\t\tisCharSet = true;\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"/\") {\n\t\t\t\tbody = body.substr(0, body.length - 1);\n\t\t\t\tterminated = true;\n\t\t\t\tindex += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// A regular expression that was never closed is an\n\t\t// error from which we cannot recover.\n\n\t\tif (!terminated) {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E015\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.from\n\t\t\t});\n\n\t\t\treturn void this.trigger(\"fatal\", {\n\t\t\t\tline: this.line,\n\t\t\t\tfrom: this.from\n\t\t\t});\n\t\t}\n\n\t\t// Parse flags (if any).\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (!/[gim]/.test(char)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tflags.push(char);\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// Check regular expression for correctness.\n\n\t\ttry {\n\t\t\tnew RegExp(body, flags.join(\"\"));\n\t\t} catch (err) {\n\t\t\tmalformed = true;\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E016\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char,\n\t\t\t\tdata: [ err.message ] // Platform dependent!\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.RegExp,\n\t\t\tvalue: value,\n\t\t\tflags: flags,\n\t\t\tisMalformed: malformed\n\t\t};\n\t},\n\n\t/*\n\t * Scan for any occurence of mixed tabs and spaces. If smarttabs option\n\t * is on, ignore tabs followed by spaces.\n\t *\n\t * Tabs followed by one space followed by a block comment are allowed.\n\t */\n\tscanMixedSpacesAndTabs: function () {\n\t\tvar at, match;\n\n\t\tif (state.option.smarttabs) {\n\t\t\t// Negative look-behind for \"//\"\n\t\t\tmatch = this.input.match(/(\\/\\/)? \\t/);\n\t\t\tat = match && !match[1] ? 0 : -1;\n\t\t} else {\n\t\t\tat = this.input.search(/ \\t|\\t [^\\*]/);\n\t\t}\n\n\t\treturn at;\n\t},\n\n\t/*\n\t * Scan for characters that get silently deleted by one or more browsers.\n\t */\n\tscanUnsafeChars: function () {\n\t\treturn this.input.search(reg.unsafeChars);\n\t},\n\n\t/*\n\t * Produce the next raw token or return 'null' if no tokens can be matched.\n\t * This method skips over all space characters.\n\t */\n\tnext: function () {\n\t\tthis.from = this.char;\n\n\t\t// Move to the next non-space character.\n\t\tvar start;\n\t\tif (/\\s/.test(this.peek())) {\n\t\t\tstart = this.char;\n\n\t\t\twhile (/\\s/.test(this.peek())) {\n\t\t\t\tthis.from += 1;\n\t\t\t\tthis.skip();\n\t\t\t}\n\n\t\t\tif (this.peek() === \"\") { // EOL\n\t\t\t\tif (state.option.trailing) {\n\t\t\t\t\tthis.trigger(\"warning\", { code: \"W102\", line: this.line, character: start });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Methods that work with multi-line structures and move the\n\t\t// character pointer.\n\n\t\tvar match = this.scanComments() ||\n\t\t\tthis.scanStringLiteral();\n\n\t\tif (match) {\n\t\t\treturn match;\n\t\t}\n\n\t\t// Methods that don't move the character pointer.\n\n\t\tmatch =\n\t\t\tthis.scanRegExp() ||\n\t\t\tthis.scanPunctuator() ||\n\t\t\tthis.scanKeyword() ||\n\t\t\tthis.scanIdentifier() ||\n\t\t\tthis.scanNumericLiteral();\n\n\t\tif (match) {\n\t\t\tthis.skip(match.value.length);\n\t\t\treturn match;\n\t\t}\n\n\t\t// No token could be matched, give up.\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Switch to the next line and reset all char pointers. Once\n\t * switched, this method also checks for mixed spaces and tabs\n\t * and other minor warnings.\n\t */\n\tnextLine: function () {\n\t\tvar char;\n\n\t\tif (this.line >= this.lines.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.input = this.lines[this.line];\n\t\tthis.line += 1;\n\t\tthis.char = 1;\n\t\tthis.from = 1;\n\n\t\tchar = this.scanMixedSpacesAndTabs();\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W099\", line: this.line, character: char + 1 });\n\t\t}\n\n\t\tthis.input = this.input.replace(/\\t/g, state.tab);\n\t\tchar = this.scanUnsafeChars();\n\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W100\", line: this.line, character: char });\n\t\t}\n\n\t\t// If there is a limit on line length, warn when lines get too\n\t\t// long.\n\n\t\tif (state.option.maxlen && state.option.maxlen < this.input.length) {\n\t\t\tthis.trigger(\"warning\", { code: \"W101\", line: this.line, character: this.input.length });\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/*\n\t * This is simply a synonym for nextLine() method with a friendlier\n\t * public name.\n\t */\n\tstart: function () {\n\t\tthis.nextLine();\n\t},\n\n\t/*\n\t * Produce the next token. This function is called by advance() to get\n\t * the next token. It retuns a token in a JSLint-compatible format.\n\t */\n\ttoken: function () {\n\t\tvar token;\n\n\t\t// Produce a token object.\n\t\tvar create = function (type, value, isProperty) {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar obj;\n\n\t\t\tif (type !== \"(endline)\" && type !== \"(end)\") {\n\t\t\t\tthis.prereg = false;\n\t\t\t}\n\n\t\t\tif (type === \"(punctuator)\") {\n\t\t\t\tswitch (value) {\n\t\t\t\tcase \".\":\n\t\t\t\tcase \")\":\n\t\t\t\tcase \"~\":\n\t\t\t\tcase \"#\":\n\t\t\t\tcase \"]\":\n\t\t\t\t\tthis.prereg = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t}\n\n\t\t\tif (type === \"(identifier)\") {\n\t\t\t\tif (value === \"return\" || value === \"case\" || value === \"typeof\") {\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tif (_.has(state.syntax, value)) {\n\t\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!obj) {\n\t\t\t\tobj = Object.create(state.syntax[type]);\n\t\t\t}\n\n\t\t\tobj.identifier = (type === \"(identifier)\");\n\t\t\tobj.type = obj.type || type;\n\t\t\tobj.value = value;\n\t\t\tobj.line = this.line;\n\t\t\tobj.character = this.char;\n\t\t\tobj.from = this.from;\n\n\t\t\tif (isProperty && obj.identifier) {\n\t\t\t\tobj.isProperty = isProperty;\n\t\t\t}\n\n\t\t\treturn obj;\n\t\t}.bind(this);\n\n\t\tfor (;;) {\n\t\t\tif (!this.input.length) {\n\t\t\t\treturn create(this.nextLine() ? \"(endline)\" : \"(end)\", \"\");\n\t\t\t}\n\n\t\t\ttoken = this.next();\n\n\t\t\tif (!token) {\n\t\t\t\tif (this.input.length) {\n\t\t\t\t\t// Unexpected character.\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E024\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ this.peek() ]\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.input = \"\";\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (token.type) {\n\t\t\tcase Token.StringLiteral:\n\t\t\t\tthis.trigger(\"String\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.character,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tquote: token.quote\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(string)\", token.value);\n\t\t\tcase Token.Identifier:\n\t\t\t\tthis.trigger(\"Identifier\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.character,\n\t\t\t\t\tfrom: this.form,\n\t\t\t\t\tname: token.value,\n\t\t\t\t\tisProperty: state.tokens.curr.id === \".\"\n\t\t\t\t});\n\n\t\t\t\t/* falls through */\n\t\t\tcase Token.Keyword:\n\t\t\tcase Token.NullLiteral:\n\t\t\tcase Token.BooleanLiteral:\n\t\t\t\treturn create(\"(identifier)\", token.value, state.tokens.curr.id === \".\");\n\n\t\t\tcase Token.NumericLiteral:\n\t\t\t\tif (token.isMalformed) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W045\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ token.value ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.jsonMode && token.base === 16) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ \"0x-\" ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.directive[\"use strict\"] && token.base === 8) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.trigger(\"Number\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.character,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tbase: token.base,\n\t\t\t\t\tisMalformed: token.malformed\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(number)\", token.value);\n\n\t\t\tcase Token.RegExp:\n\t\t\t\treturn create(\"(regexp)\", token.value);\n\n\t\t\tcase Token.Comment:\n\t\t\t\tstate.tokens.curr.comment = true;\n\n\t\t\t\tif (token.isSpecial) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: token.value,\n\t\t\t\t\t\tbody: token.body,\n\t\t\t\t\t\ttype: token.commentType,\n\t\t\t\t\t\tisSpecial: token.isSpecial,\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.character,\n\t\t\t\t\t\tfrom: this.from\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"\":\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn create(\"(punctuator)\", token.value);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.Lexer = Lexer;\n//@ sourceURL=/src/stable/lex.js" -)); - -require.define("/src/stable/reg.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Regular expressions. Some of these are stupidly long.\n */\n\n/*jshint maxlen:1000 */\n\n\"use string\";\n\n// Unsafe comment or string (ax)\nexports.unsafeString =\n\t/@cc|<\\/?|script|\\]\\s*\\]|<\\s*!|</i;\n\n// Unsafe characters that are silently deleted by one or more browsers (cx)\nexports.unsafeChars =\n\t/[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\n// Characters in strings that need escaping (nx and nxg)\nexports.needEsc =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\nexports.needEscGlobal =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n// Star slash (lx)\nexports.starSlash = /\\*\\//;\n\n// Identifier (ix)\nexports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;\n\n// JavaScript URL (jx)\nexports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n// Catches /* falls through */ comments (ft)\nexports.fallsThrough = /^\\s*\\/\\*\\s*falls\\sthrough\\s*\\*\\/\\s*$/;\n//@ sourceURL=/src/stable/reg.js" -)); - -require.define("/src/stable/state.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar state = {\n\tsyntax: {},\n\n\treset: function () {\n\t\tthis.tokens = {\n\t\t\tprev: null,\n\t\t\tnext: null,\n\t\t\tcurr: null\n\t\t},\n\n\t\tthis.option = {};\n\t\tthis.directive = {};\n\t\tthis.jsonMode = false;\n\t\tthis.lines = [];\n\t\tthis.tab = \"\";\n\t\tthis.cache = {}; // Node.JS doesn't have Map. Sniff.\n\t}\n};\n\nexports.state = state;\n//@ sourceURL=/src/stable/state.js" -)); - -require.define("/src/stable/style.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nexports.register = function (linter) {\n\t// Check for properties named __proto__. This special property was\n\t// deprecated and then re-introduced for ES6.\n\n\tlinter.on(\"Identifier\", function style_scanProto(data) {\n\t\tif (linter.getOption(\"proto\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__proto__\") {\n\t\t\tlinter.warn(\"W103\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for properties named __iterator__. This is a special property\n\t// available only in browsers with JavaScript 1.7 implementation.\n\n\tlinter.on(\"Identifier\", function style_scanIterator(data) {\n\t\tif (linter.getOption(\"iterator\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__iterator__\") {\n\t\t\tlinter.warn(\"W104\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for dangling underscores.\n\n\tlinter.on(\"Identifier\", function style_scanDangling(data) {\n\t\tif (!linter.getOption(\"nomen\")) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Underscore.js\n\t\tif (data.name === \"_\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// In Node, __dirname and __filename should be ignored.\n\t\tif (linter.getOption(\"node\")) {\n\t\t\tif (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (/^(_+.*|.*_+)$/.test(data.name)) {\n\t\t\tlinter.warn(\"W105\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ \"dangling '_'\", data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check that all identifiers are using camelCase notation.\n\t// Exceptions: names like MY_VAR and _myVar.\n\n\tlinter.on(\"Identifier\", function style_scanCamelCase(data) {\n\t\tif (!linter.getOption(\"camelcase\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name.replace(/^_+/, \"\").indexOf(\"_\") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) {\n\t\t\tlinter.warn(\"W106\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Enforce consistency in style of quoting.\n\n\tlinter.on(\"String\", function style_scanQuotes(data) {\n\t\tvar quotmark = linter.getOption(\"quotmark\");\n\t\tvar code;\n\n\t\tif (!quotmark) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If quotmark is set to 'single' warn about all double-quotes.\n\n\t\tif (quotmark === \"single\" && data.quote !== \"'\") {\n\t\t\tcode = \"W109\";\n\t\t}\n\n\t\t// If quotmark is set to 'double' warn about all single-quotes.\n\n\t\tif (quotmark === \"double\" && data.quote !== \"\\\"\") {\n\t\t\tcode = \"W108\";\n\t\t}\n\n\t\t// If quotmark is set to true, remember the first quotation style\n\t\t// and then warn about all others.\n\n\t\tif (quotmark === true) {\n\t\t\tif (!linter.getCache(\"quotmark\")) {\n\t\t\t\tlinter.setCache(\"quotmark\", data.quote);\n\t\t\t}\n\n\t\t\tif (linter.getCache(\"quotmark\") !== data.quote) {\n\t\t\t\tcode = \"W110\";\n\t\t\t}\n\t\t}\n\n\t\tif (code) {\n\t\t\tlinter.warn(code, {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t});\n\t\t}\n\t});\n\n\tlinter.on(\"Number\", function style_scanNumbers(data) {\n\t\tif (data.value.charAt(0) === \".\") {\n\t\t\t// Warn about a leading decimal point.\n\t\t\tlinter.warn(\"W008\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (data.value.substr(data.value.length - 1) === \".\") {\n\t\t\t// Warn about a trailing decimal point.\n\t\t\tlinter.warn(\"W047\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (/^00+/.test(data.value)) {\n\t\t\t// Multiple leading zeroes.\n\t\t\tlinter.warn(\"W046\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Warn about script URLs.\n\n\tlinter.on(\"String\", function style_scanJavaScriptURLs(data) {\n\t\tvar re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n\t\tif (linter.getOption(\"scripturl\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (re.test(data.value)) {\n\t\t\tlinter.warn(\"W107\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char\n\t\t\t});\n\t\t}\n\t});\n};\n//@ sourceURL=/src/stable/style.js" -)); - -require.define("/src/stable/jshint.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*!\n * JSHint, by JSHint Community.\n *\n * This file (and this file only) is licensed under the same slightly modified\n * MIT license that JSLint is. It stops evil-doers everywhere:\n *\n *\t Copyright (c) 2002 Douglas Crockford (www.JSLint.com)\n *\n *\t Permission is hereby granted, free of charge, to any person obtaining\n *\t a copy of this software and associated documentation files (the \"Software\"),\n *\t to deal in the Software without restriction, including without limitation\n *\t the rights to use, copy, modify, merge, publish, distribute, sublicense,\n *\t and/or sell copies of the Software, and to permit persons to whom\n *\t the Software is furnished to do so, subject to the following conditions:\n *\n *\t The above copyright notice and this permission notice shall be included\n *\t in all copies or substantial portions of the Software.\n *\n *\t The Software shall be used for Good, not Evil.\n *\n *\t THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *\t IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *\t FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *\t AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *\t LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n *\t FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n *\t DEALINGS IN THE SOFTWARE.\n *\n */\n\n/*jshint quotmark:double */\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar vars = require(\"../shared/vars.js\");\nvar messages = require(\"../shared/messages.js\");\nvar Lexer = require(\"./lex.js\").Lexer;\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\nvar style = require(\"./style.js\");\n\n// We build the application inside a function so that we produce only a single\n// global variable. That function will be invoked immediately, and its return\n// value is the JSHINT function itself.\n\nvar JSHINT = (function () {\n\t\"use strict\";\n\n\tvar anonname,\t\t// The guessed name for anonymous functions.\n\n// These are operators that should not be used with the ! operator.\n\n\t\tbang = {\n\t\t\t\"<\" : true,\n\t\t\t\"<=\" : true,\n\t\t\t\"==\" : true,\n\t\t\t\"===\": true,\n\t\t\t\"!==\": true,\n\t\t\t\"!=\" : true,\n\t\t\t\">\" : true,\n\t\t\t\">=\" : true,\n\t\t\t\"+\" : true,\n\t\t\t\"-\" : true,\n\t\t\t\"*\" : true,\n\t\t\t\"/\" : true,\n\t\t\t\"%\" : true\n\t\t},\n\n\t\t// These are the JSHint boolean options.\n\t\tboolOptions = {\n\t\t\tasi : true, // if automatic semicolon insertion should be tolerated\n\t\t\tbitwise : true, // if bitwise operators should not be allowed\n\t\t\tboss : true, // if advanced usage of assignments should be allowed\n\t\t\tbrowser : true, // if the standard browser globals should be predefined\n\t\t\tcamelcase : true, // if identifiers should be required in camel case\n\t\t\tcouch : true, // if CouchDB globals should be predefined\n\t\t\tcurly : true, // if curly braces around all blocks should be required\n\t\t\tdebug : true, // if debugger statements should be allowed\n\t\t\tdevel : true, // if logging globals should be predefined (console, alert, etc.)\n\t\t\tdojo : true, // if Dojo Toolkit globals should be predefined\n\t\t\teqeqeq : true, // if === should be required\n\t\t\teqnull : true, // if == null comparisons should be tolerated\n\t\t\tes5 : true, // if ES5 syntax should be allowed\n\t\t\tesnext : true, // if es.next specific syntax should be allowed\n\t\t\tevil : true, // if eval should be allowed\n\t\t\texpr : true, // if ExpressionStatement should be allowed as Programs\n\t\t\tforin : true, // if for in statements must filter\n\t\t\tfuncscope : true, // if only function scope should be used for scope tests\n\t\t\tglobalstrict: true, // if global \"use strict\"; should be allowed (also enables 'strict')\n\t\t\timmed : true, // if immediate invocations must be wrapped in parens\n\t\t\titerator : true, // if the `__iterator__` property should be allowed\n\t\t\tjquery : true, // if jQuery globals should be predefined\n\t\t\tlastsemic : true, // if semicolons may be ommitted for the trailing\n\t\t\t // statements inside of a one-line blocks.\n\t\t\tlatedef : true, // if the use before definition should not be tolerated\n\t\t\tlaxbreak : true, // if line breaks should not be checked\n\t\t\tlaxcomma : true, // if line breaks should not be checked around commas\n\t\t\tloopfunc : true, // if functions should be allowed to be defined within\n\t\t\t // loops\n\t\t\tmootools : true, // if MooTools globals should be predefined\n\t\t\tmultistr : true, // allow multiline strings\n\t\t\tnewcap : true, // if constructor names must be capitalized\n\t\t\tnoarg : true, // if arguments.caller and arguments.callee should be\n\t\t\t // disallowed\n\t\t\tnode : true, // if the Node.js environment globals should be\n\t\t\t // predefined\n\t\t\tnoempty : true, // if empty blocks should be disallowed\n\t\t\tnonew : true, // if using `new` for side-effects should be disallowed\n\t\t\tnonstandard : true, // if non-standard (but widely adopted) globals should\n\t\t\t // be predefined\n\t\t\tnomen : true, // if names should be checked\n\t\t\tonevar : true, // if only one var statement per function should be\n\t\t\t // allowed\n\t\t\tpassfail : true, // if the scan should stop on first error\n\t\t\tplusplus : true, // if increment/decrement should not be allowed\n\t\t\tproto : true, // if the `__proto__` property should be allowed\n\t\t\tprototypejs : true, // if Prototype and Scriptaculous globals should be\n\t\t\t // predefined\n\t\t\trhino : true, // if the Rhino environment globals should be predefined\n\t\t\tundef : true, // if variables should be declared before used\n\t\t\tunused : true, // if variables should be always used\n\t\t\tscripturl : true, // if script-targeted URLs should be tolerated\n\t\t\tshadow : true, // if variable shadowing should be tolerated\n\t\t\tsmarttabs : true, // if smarttabs should be tolerated\n\t\t\t // (http://www.emacswiki.org/emacs/SmartTabs)\n\t\t\tstrict : true, // require the \"use strict\"; pragma\n\t\t\tsub : true, // if all forms of subscript notation are tolerated\n\t\t\tsupernew : true, // if `new function () { ... };` and `new Object;`\n\t\t\t // should be tolerated\n\t\t\ttrailing : true, // if trailing whitespace rules apply\n\t\t\tvalidthis : true, // if 'this' inside a non-constructor function is valid.\n\t\t\t // This is a function scoped option only.\n\t\t\twithstmt : true, // if with statements should be allowed\n\t\t\twhite : true, // if strict whitespace rules apply\n\t\t\tworker : true, // if Web Worker script symbols should be allowed\n\t\t\twsh : true, // if the Windows Scripting Host environment globals\n\t\t\t // should be predefined\n\t\t\tyui : true, // YUI variables should be predefined\n\n\t\t\t// Obsolete options\n\t\t\tonecase : true, // if one case switch statements should be allowed\n\t\t\tregexp : true, // if the . should not be allowed in regexp literals\n\t\t\tregexdash : true // if unescaped first/last dash (-) inside brackets\n\t\t\t // should be tolerated\n\t\t},\n\n\t\t// These are the JSHint options that can take any value\n\t\t// (we use this object to detect invalid options)\n\t\tvalOptions = {\n\t\t\tmaxlen : false,\n\t\t\tindent : false,\n\t\t\tmaxerr : false,\n\t\t\tpredef : false,\n\t\t\tquotmark : false, //'single'|'double'|true\n\t\t\tscope : false,\n\t\t\tmaxstatements: false, // {int} max statements per function\n\t\t\tmaxdepth : false, // {int} max nested block depth per function\n\t\t\tmaxparams : false, // {int} max params per function\n\t\t\tmaxcomplexity: false // {int} max cyclomatic complexity per function\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the definition in JSHint is opposite JSLint\n\t\tinvertedOptions = {\n\t\t\tbitwise : true,\n\t\t\tforin : true,\n\t\t\tnewcap : true,\n\t\t\tnomen : true,\n\t\t\tplusplus: true,\n\t\t\tregexp : true,\n\t\t\tundef : true,\n\t\t\twhite : true,\n\n\t\t\t// Inverted and renamed, use JSHint name here\n\t\t\teqeqeq : true,\n\t\t\tonevar : true\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the name has been changed but the effect is unchanged\n\t\trenamedOptions = {\n\t\t\teqeq : \"eqeqeq\",\n\t\t\tvars : \"onevar\",\n\t\t\twindows: \"wsh\"\n\t\t},\n\n\t\tdeclared, // Globals that were declared using /*global ... */ syntax.\n\t\texported, // Variables that are used outside of the current file.\n\n\t\tfunctionicity = [\n\t\t\t\"closure\", \"exception\", \"global\", \"label\",\n\t\t\t\"outer\", \"unused\", \"var\"\n\t\t],\n\n\t\tfunct, // The current function\n\t\tfunctions, // All of the functions\n\n\t\tglobal, // The global scope\n\t\tignored, // Ignored warnings\n\t\timplied, // Implied globals\n\t\tinblock,\n\t\tindent,\n\t\tlookahead,\n\t\tlex,\n\t\tmember,\n\t\tmembersOnly,\n\t\tnoreach,\n\t\tpredefined,\t\t// Global variables defined by option\n\n\t\tscope, // The current scope\n\t\tstack,\n\t\tunuseds,\n\t\turls,\n\t\tuseESNextSyntax,\n\t\twarnings,\n\n\t\textraModules = [],\n\t\temitter = new events.EventEmitter();\n\n\tfunction checkOption(name, t) {\n\t\tname = name.trim();\n\n\t\tif (/^-W\\d{3}$/g.test(name)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (valOptions[name] === undefined && boolOptions[name] === undefined) {\n\t\t\tif (t.type !== \"jslint\" || renamedOptions[name] === undefined) {\n\t\t\t\terror(\"E001\", t, name);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction isString(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object String]\";\n\t}\n\n\tfunction isIdentifier(tkn, value) {\n\t\tif (!tkn)\n\t\t\treturn false;\n\n\t\tif (!tkn.identifier || tkn.value !== value)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}\n\n\tfunction isReserved(token) {\n\t\tif (!token.reserved) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (token.meta && token.meta.isFutureReservedWord) {\n\t\t\t// ES3 FutureReservedWord in an ES5 environment.\n\t\t\tif (state.option.es5 && !token.meta.es5) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Some ES5 FutureReservedWord identifiers are active only\n\t\t\t// within a strict mode environment.\n\t\t\tif (token.meta.strictOnly) {\n\t\t\t\tif (!state.option.strict && !state.directive[\"use strict\"]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (token.isProperty) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction supplant(str, data) {\n\t\treturn str.replace(/\\{([^{}]*)\\}/g, function (a, b) {\n\t\t\tvar r = data[b];\n\t\t\treturn typeof r === \"string\" || typeof r === \"number\" ? r : a;\n\t\t});\n\t}\n\n\tfunction combine(t, o) {\n\t\tvar n;\n\t\tfor (n in o) {\n\t\t\tif (_.has(o, n) && !_.has(JSHINT.blacklist, n)) {\n\t\t\t\tt[n] = o[n];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction updatePredefined() {\n\t\tObject.keys(JSHINT.blacklist).forEach(function (key) {\n\t\t\tdelete predefined[key];\n\t\t});\n\t}\n\n\tfunction assume() {\n\t\tif (state.option.couch) {\n\t\t\tcombine(predefined, vars.couch);\n\t\t}\n\n\t\tif (state.option.rhino) {\n\t\t\tcombine(predefined, vars.rhino);\n\t\t}\n\n\t\tif (state.option.prototypejs) {\n\t\t\tcombine(predefined, vars.prototypejs);\n\t\t}\n\n\t\tif (state.option.node) {\n\t\t\tcombine(predefined, vars.node);\n\t\t}\n\n\t\tif (state.option.devel) {\n\t\t\tcombine(predefined, vars.devel);\n\t\t}\n\n\t\tif (state.option.dojo) {\n\t\t\tcombine(predefined, vars.dojo);\n\t\t}\n\n\t\tif (state.option.browser) {\n\t\t\tcombine(predefined, vars.browser);\n\t\t}\n\n\t\tif (state.option.nonstandard) {\n\t\t\tcombine(predefined, vars.nonstandard);\n\t\t}\n\n\t\tif (state.option.jquery) {\n\t\t\tcombine(predefined, vars.jquery);\n\t\t}\n\n\t\tif (state.option.mootools) {\n\t\t\tcombine(predefined, vars.mootools);\n\t\t}\n\n\t\tif (state.option.worker) {\n\t\t\tcombine(predefined, vars.worker);\n\t\t}\n\n\t\tif (state.option.wsh) {\n\t\t\tcombine(predefined, vars.wsh);\n\t\t}\n\n\t\tif (state.option.esnext) {\n\t\t\tuseESNextSyntax();\n\t\t}\n\n\t\tif (state.option.globalstrict && state.option.strict !== false) {\n\t\t\tstate.option.strict = true;\n\t\t}\n\n\t\tif (state.option.yui) {\n\t\t\tcombine(predefined, vars.yui);\n\t\t}\n\t}\n\n\n\t// Produce an error warning.\n\tfunction quit(code, line, chr) {\n\t\tvar percentage = Math.floor((line / state.lines.length) * 100);\n\t\tvar message = messages.errors[code].desc;\n\n\t\tthrow {\n\t\t\tname: \"JSHintError\",\n\t\t\tline: line,\n\t\t\tcharacter: chr,\n\t\t\tmessage: message + \" (\" + percentage + \"% scanned).\",\n\t\t\traw: message\n\t\t};\n\t}\n\n\tfunction isundef(scope, code, token, a) {\n\t\treturn JSHINT.undefs.push([scope, code, token, a]);\n\t}\n\n\tfunction warning(code, t, a, b, c, d) {\n\t\tvar ch, l, w, msg;\n\n\t\tif (/^W\\d{3}$/.test(code)) {\n\t\t\tif (ignored[code]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmsg = messages.warnings[code];\n\t\t} else if (/E\\d{3}/.test(code)) {\n\t\t\tmsg = messages.errors[code];\n\t\t} else if (/I\\d{3}/.test(code)) {\n\t\t\tmsg = messages.info[code];\n\t\t}\n\n\t\tt = t || state.tokens.next;\n\t\tif (t.id === \"(end)\") { // `~\n\t\t\tt = state.tokens.curr;\n\t\t}\n\n\t\tl = t.line || 0;\n\t\tch = t.from || 0;\n\n\t\tw = {\n\t\t\tid: \"(error)\",\n\t\t\traw: msg.desc,\n\t\t\tcode: msg.code,\n\t\t\tevidence: state.lines[l - 1] || \"\",\n\t\t\tline: l,\n\t\t\tcharacter: ch,\n\t\t\tscope: JSHINT.scope,\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\td: d\n\t\t};\n\n\t\tw.reason = supplant(msg.desc, w);\n\t\tJSHINT.errors.push(w);\n\n\t\tif (state.option.passfail) {\n\t\t\tquit(\"E042\", l, ch);\n\t\t}\n\n\t\twarnings += 1;\n\t\tif (warnings >= state.option.maxerr) {\n\t\t\tquit(\"E043\", l, ch);\n\t\t}\n\n\t\treturn w;\n\t}\n\n\tfunction warningAt(m, l, ch, a, b, c, d) {\n\t\treturn warning(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\tfunction error(m, t, a, b, c, d) {\n\t\twarning(m, t, a, b, c, d);\n\t}\n\n\tfunction errorAt(m, l, ch, a, b, c, d) {\n\t\treturn error(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\t// Tracking of \"internal\" scripts, like eval containing a static string\n\tfunction addInternalSrc(elem, src) {\n\t\tvar i;\n\t\ti = {\n\t\t\tid: \"(internal)\",\n\t\t\telem: elem,\n\t\t\tvalue: src\n\t\t};\n\t\tJSHINT.internals.push(i);\n\t\treturn i;\n\t}\n\n\tfunction addlabel(t, type, tkn) {\n\t\t// Define t in the current function in the current scope.\n\t\tif (type === \"exception\") {\n\t\t\tif (_.has(funct[\"(context)\"], t)) {\n\t\t\t\tif (funct[t] !== true && !state.option.node) {\n\t\t\t\t\twarning(\"W002\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (_.has(funct, t) && !funct[\"(global)\"]) {\n\t\t\tif (funct[t] === true) {\n\t\t\t\tif (state.option.latedef)\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t} else {\n\t\t\t\tif (!state.option.shadow && type !== \"exception\") {\n\t\t\t\t\twarning(\"W004\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunct[t] = type;\n\n\t\tif (tkn) {\n\t\t\tfunct[\"(tokens)\"][t] = tkn;\n\t\t}\n\n\t\tif (funct[\"(global)\"]) {\n\t\t\tglobal[t] = funct;\n\t\t\tif (_.has(implied, t)) {\n\t\t\t\tif (state.option.latedef) {\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t\t}\n\n\t\t\t\tdelete implied[t];\n\t\t\t}\n\t\t} else {\n\t\t\tscope[t] = funct;\n\t\t}\n\t}\n\n\tfunction doOption() {\n\t\tvar nt = state.tokens.next;\n\t\tvar body = nt.body.split(\",\").map(function (s) { return s.trim(); });\n\t\tvar predef = {};\n\n\t\tif (nt.type === \"globals\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = g[0];\n\t\t\t\tvar val = g[1];\n\n\t\t\t\tif (key.charAt(0) === \"-\") {\n\t\t\t\t\tkey = key.slice(1);\n\t\t\t\t\tval = false;\n\n\t\t\t\t\tJSHINT.blacklist[key] = key;\n\t\t\t\t\tupdatePredefined();\n\t\t\t\t} else {\n\t\t\t\t\tpredef[key] = (val === \"true\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcombine(predefined, predef);\n\n\t\t\tfor (var key in predef) {\n\t\t\t\tif (_.has(predef, key)) {\n\t\t\t\t\tdeclared[key] = nt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (nt.type === \"exported\") {\n\t\t\tbody.forEach(function (e) {\n\t\t\t\texported[e] = true;\n\t\t\t});\n\t\t}\n\n\t\tif (nt.type === \"members\") {\n\t\t\tmembersOnly = membersOnly || {};\n\n\t\t\tbody.forEach(function (m) {\n\t\t\t\tvar ch1 = m.charAt(0);\n\t\t\t\tvar ch2 = m.charAt(m.length - 1);\n\n\t\t\t\tif (ch1 === ch2 && (ch1 === \"\\\"\" || ch1 === \"'\")) {\n\t\t\t\t\tm = m\n\t\t\t\t\t\t.substr(1, m.length - 2)\n\t\t\t\t\t\t.replace(\"\\\\b\", \"\\b\")\n\t\t\t\t\t\t.replace(\"\\\\t\", \"\\t\")\n\t\t\t\t\t\t.replace(\"\\\\n\", \"\\n\")\n\t\t\t\t\t\t.replace(\"\\\\v\", \"\\v\")\n\t\t\t\t\t\t.replace(\"\\\\f\", \"\\f\")\n\t\t\t\t\t\t.replace(\"\\\\r\", \"\\r\")\n\t\t\t\t\t\t.replace(\"\\\\\\\\\", \"\\\\\")\n\t\t\t\t\t\t.replace(\"\\\\\\\"\", \"\\\"\");\n\t\t\t\t}\n\n\t\t\t\tmembersOnly[m] = false;\n\t\t\t});\n\t\t}\n\n\t\tvar numvals = [\n\t\t\t\"maxstatements\",\n\t\t\t\"maxparams\",\n\t\t\t\"maxdepth\",\n\t\t\t\"maxcomplexity\",\n\t\t\t\"maxerr\",\n\t\t\t\"maxlen\",\n\t\t\t\"indent\"\n\t\t];\n\n\t\tif (nt.type === \"jshint\" || nt.type === \"jslint\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = (g[0] || \"\").trim();\n\t\t\t\tvar val = (g[1] || \"\").trim();\n\n\t\t\t\tif (!checkOption(key, nt)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (numvals.indexOf(key) >= 0) {\n\t\t\t\t\tval = +val;\n\n\t\t\t\t\tif (typeof val !== \"number\" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) {\n\t\t\t\t\t\terror(\"E032\", nt, g[1].trim());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"indent\") {\n\t\t\t\t\t\tstate.option[\"(explicitIndent)\"] = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.option[key] = val;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"validthis\") {\n\t\t\t\t\t// `validthis` is valid only within a function scope.\n\t\t\t\t\tif (funct[\"(global)\"]) {\n\t\t\t\t\t\terror(\"E009\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\t\t\tstate.option.validthis = (val === \"true\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"quotmark\") {\n\t\t\t\t\tswitch (val) {\n\t\t\t\t\tcase \"true\":\n\t\t\t\t\tcase \"false\":\n\t\t\t\t\t\tstate.option.quotmark = (val === \"true\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\tcase \"single\":\n\t\t\t\t\t\tstate.option.quotmark = val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (/^-W\\d{3}$/g.test(key)) {\n\t\t\t\t\tignored[key.slice(1)] = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tn;\n\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\tif (nt.type === \"jslint\") {\n\t\t\t\t\t\ttn = renamedOptions[key] || key;\n\t\t\t\t\t\tstate.option[tn] = (val === \"true\");\n\n\t\t\t\t\t\tif (invertedOptions[tn] !== undefined) {\n\t\t\t\t\t\t\tstate.option[tn] = !state.option[tn];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.option[key] = (val === \"true\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"newcap\") {\n\t\t\t\t\t\tstate.option[\"(explicitNewcap)\"] = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terror(\"E002\", nt);\n\t\t\t});\n\n\t\t\tassume();\n\t\t}\n\t}\n\n\t// We need a peek function. If it has an argument, it peeks that much farther\n\t// ahead. It is used to distinguish\n\t//\t for ( var i in ...\n\t// from\n\t//\t for ( var i = ...\n\n\tfunction peek(p) {\n\t\tvar i = p || 0, j = 0, t;\n\n\t\twhile (j <= i) {\n\t\t\tt = lookahead[j];\n\t\t\tif (!t) {\n\t\t\t\tt = lookahead[j] = lex.token();\n\t\t\t}\n\t\t\tj += 1;\n\t\t}\n\t\treturn t;\n\t}\n\n\t// Produce the next token. It looks for programming errors.\n\n\tfunction advance(id, t) {\n\t\tswitch (state.tokens.curr.id) {\n\t\tcase \"(number)\":\n\t\t\tif (state.tokens.next.id === \".\") {\n\t\t\t\twarning(\"W005\", state.tokens.curr);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tif (state.tokens.next.id === \"-\" || state.tokens.next.id === \"--\") {\n\t\t\t\twarning(\"W006\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"+\":\n\t\t\tif (state.tokens.next.id === \"+\" || state.tokens.next.id === \"++\") {\n\t\t\t\twarning(\"W007\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (state.tokens.curr.type === \"(string)\" || state.tokens.curr.identifier) {\n\t\t\tanonname = state.tokens.curr.value;\n\t\t}\n\n\t\tif (id && state.tokens.next.id !== id) {\n\t\t\tif (t) {\n\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\terror(\"E019\", t, t.id);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E020\", state.tokens.next, id, t.id, t.line, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t} else if (state.tokens.next.type !== \"(identifier)\" || state.tokens.next.value !== id) {\n\t\t\t\twarning(\"W116\", state.tokens.next, id, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\n\t\tstate.tokens.prev = state.tokens.curr;\n\t\tstate.tokens.curr = state.tokens.next;\n\t\tfor (;;) {\n\t\t\tstate.tokens.next = lookahead.shift() || lex.token();\n\n\t\t\tif (!state.tokens.next) { // No more tokens left, give up\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \"(end)\" || state.tokens.next.id === \"(error)\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (state.tokens.next.isSpecial) {\n\t\t\t\tdoOption();\n\t\t\t} else {\n\t\t\t\tif (state.tokens.next.id !== \"(endline)\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it\n\t// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is\n\t// like .nud except that it is only used on the first token of a statement.\n\t// Having .fud makes it much easier to define statement-oriented languages like\n\t// JavaScript. I retained Pratt's nomenclature.\n\n\t// .nud Null denotation\n\t// .fud First null denotation\n\t// .led Left denotation\n\t// lbp Left binding power\n\t// rbp Right binding power\n\n\t// They are elements of the parsing method called Top Down Operator Precedence.\n\n\tfunction expression(rbp, initial) {\n\t\tvar left, isArray = false, isObject = false;\n\n\t\tif (state.tokens.next.id === \"(end)\")\n\t\t\terror(\"E006\", state.tokens.curr);\n\n\t\tadvance();\n\n\t\tif (initial) {\n\t\t\tanonname = \"anonymous\";\n\t\t\tfunct[\"(verb)\"] = state.tokens.curr.value;\n\t\t}\n\n\t\tif (initial === true && state.tokens.curr.fud) {\n\t\t\tleft = state.tokens.curr.fud();\n\t\t} else {\n\t\t\tif (state.tokens.curr.nud) {\n\t\t\t\tleft = state.tokens.curr.nud();\n\t\t\t} else {\n\t\t\t\terror(\"E030\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t}\n\n\t\t\twhile (rbp < state.tokens.next.lbp) {\n\t\t\t\tisArray = state.tokens.curr.value === \"Array\";\n\t\t\t\tisObject = state.tokens.curr.value === \"Object\";\n\n\t\t\t\t// #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object()\n\t\t\t\t// Line breaks in IfStatement heads exist to satisfy the checkJSHint\n\t\t\t\t// \"Line too long.\" error.\n\t\t\t\tif (left && (left.value || (left.first && left.first.value))) {\n\t\t\t\t\t// If the left.value is not \"new\", or the left.first.value is a \".\"\n\t\t\t\t\t// then safely assume that this is not \"new Array()\" and possibly\n\t\t\t\t\t// not \"new Object()\"...\n\t\t\t\t\tif (left.value !== \"new\" ||\n\t\t\t\t\t (left.first && left.first.value && left.first.value === \".\")) {\n\t\t\t\t\t\tisArray = false;\n\t\t\t\t\t\t// ...In the case of Object, if the left.value and state.tokens.curr.value\n\t\t\t\t\t\t// are not equal, then safely assume that this not \"new Object()\"\n\t\t\t\t\t\tif (left.value !== state.tokens.curr.value) {\n\t\t\t\t\t\t\tisObject = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tadvance();\n\n\t\t\t\tif (isArray && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W009\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (isObject && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W010\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.led) {\n\t\t\t\t\tleft = state.tokens.curr.led(left);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E033\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn left;\n\t}\n\n\n// Functions for conformance of style.\n\n\tfunction adjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white) {\n\t\t\tif (left.character !== right.from && left.line === right.line) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W011\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreak(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && (left.character !== right.from || left.line !== right.line)) {\n\t\t\twarning(\"W012\", right, right.value);\n\t\t}\n\t}\n\n\tfunction nospace(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && !left.comment) {\n\t\t\tif (left.line === right.line) {\n\t\t\t\tadjacent(left, right);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nonadjacent(left, right) {\n\t\tif (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\n\t\t\tif (left.value === \";\" && right.value === \";\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (left.line === right.line && left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreaknonadjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (!state.option.laxbreak && left.line !== right.line) {\n\t\t\twarning(\"W014\", right, right.id);\n\t\t} else if (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\t\t\tif (left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction indentation(bias) {\n\t\tif (!state.option.white && !state.option[\"(explicitIndent)\"]) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = indent + (bias || 0);\n\t\tif (state.tokens.next.from !== i) {\n\t\t\twarning(\"W015\", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from);\n\t\t}\n\t}\n\n\tfunction nolinebreak(t) {\n\t\tt = t || state.tokens.curr;\n\t\tif (t.line !== state.tokens.next.line) {\n\t\t\twarning(\"E022\", t, t.value);\n\t\t}\n\t}\n\n\n\tfunction comma(opts) {\n\t\topts = opts || {};\n\n\t\tif (state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\tif (!state.option.laxcomma) {\n\t\t\t\tif (comma.first) {\n\t\t\t\t\twarning(\"I001\");\n\t\t\t\t\tcomma.first = false;\n\t\t\t\t}\n\t\t\t\twarning(\"W014\", state.tokens.curr, state.tokens.next.id);\n\t\t\t}\n\t\t} else if (!state.tokens.curr.comment &&\n\t\t\t\tstate.tokens.curr.character !== state.tokens.next.from && state.option.white) {\n\t\t\tstate.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from);\n\t\t\twarning(\"W011\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\n\t\tadvance(\",\");\n\n\t\t// TODO: This is a temporary solution to fight against false-positives in\n\t\t// arrays and objects with trailing commas (see GH-363). The best solution\n\t\t// would be to extract all whitespace rules out of parser.\n\n\t\tif (state.tokens.next.value !== \"]\" && state.tokens.next.value !== \"}\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\n\t\tif (state.tokens.next.identifier) {\n\t\t\t// Keywords that cannot follow a comma operator.\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"break\":\n\t\t\tcase \"case\":\n\t\t\tcase \"catch\":\n\t\t\tcase \"continue\":\n\t\t\tcase \"default\":\n\t\t\tcase \"do\":\n\t\t\tcase \"else\":\n\t\t\tcase \"finally\":\n\t\t\tcase \"for\":\n\t\t\tcase \"if\":\n\t\t\tcase \"in\":\n\t\t\tcase \"instanceof\":\n\t\t\tcase \"return\":\n\t\t\tcase \"switch\":\n\t\t\tcase \"throw\":\n\t\t\tcase \"try\":\n\t\t\tcase \"var\":\n\t\t\tcase \"while\":\n\t\t\tcase \"with\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.type === \"(punctuator)\") {\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"}\":\n\t\t\tcase \"]\":\n\t\t\tcase \",\":\n\t\t\t\tif (opts.allowTrailing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* falls through */\n\t\t\tcase \")\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Functional constructors for making the symbols that will be inherited by\n\t// tokens.\n\n\tfunction symbol(s, p) {\n\t\tvar x = state.syntax[s];\n\t\tif (!x || typeof x !== \"object\") {\n\t\t\tstate.syntax[s] = x = {\n\t\t\t\tid: s,\n\t\t\t\tlbp: p,\n\t\t\t\tvalue: s\n\t\t\t};\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction delim(s) {\n\t\treturn symbol(s, 0);\n\t}\n\n\tfunction stmt(s, f) {\n\t\tvar x = delim(s);\n\t\tx.identifier = x.reserved = true;\n\t\tx.fud = f;\n\t\treturn x;\n\t}\n\n\tfunction blockstmt(s, f) {\n\t\tvar x = stmt(s, f);\n\t\tx.block = true;\n\t\treturn x;\n\t}\n\n\tfunction reserveName(x) {\n\t\tvar c = x.id.charAt(0);\n\t\tif ((c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\")) {\n\t\t\tx.identifier = x.reserved = true;\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction prefix(s, f) {\n\t\tvar x = symbol(s, 150);\n\t\treserveName(x);\n\t\tx.nud = (typeof f === \"function\") ? f : function () {\n\t\t\tthis.right = expression(150);\n\t\t\tthis.arity = \"unary\";\n\t\t\tif (this.id === \"++\" || this.id === \"--\") {\n\t\t\t\tif (state.option.plusplus) {\n\t\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t\t} else if ((!this.right.identifier || isReserved(this.right)) &&\n\t\t\t\t\t\tthis.right.id !== \".\" && this.right.id !== \"[\") {\n\t\t\t\t\twarning(\"W017\", this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction type(s, f) {\n\t\tvar x = delim(s);\n\t\tx.type = s;\n\t\tx.nud = f;\n\t\treturn x;\n\t}\n\n\tfunction reserve(name, func) {\n\t\tvar x = type(name, func);\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\treturn x;\n\t}\n\n\tfunction FutureReservedWord(name, meta) {\n\t\tvar x = type(name, function () {\n\t\t\treturn this;\n\t\t});\n\n\t\tmeta = meta || {};\n\t\tmeta.isFutureReservedWord = true;\n\n\t\tx.value = name;\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\tx.meta = meta;\n\n\t\treturn x;\n\t}\n\n\tfunction reservevar(s, v) {\n\t\treturn reserve(s, function () {\n\t\t\tif (typeof v === \"function\") {\n\t\t\t\tv(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t}\n\n\tfunction infix(s, f, p, w) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = function (left) {\n\t\t\tif (!w) {\n\t\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t\tif (s === \"in\" && left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\t\t\tif (typeof f === \"function\") {\n\t\t\t\treturn f(left, this);\n\t\t\t} else {\n\t\t\t\tthis.left = left;\n\t\t\t\tthis.right = expression(p);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction relation(s, f) {\n\t\tvar x = symbol(s, 100);\n\n\t\tx.led = function (left) {\n\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tvar right = expression(100);\n\n\t\t\tif (isIdentifier(left, \"NaN\") || isIdentifier(right, \"NaN\")) {\n\t\t\t\twarning(\"W019\", this);\n\t\t\t} else if (f) {\n\t\t\t\tf.apply(this, [left, right]);\n\t\t\t}\n\n\t\t\tif (!left || !right) {\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\n\t\t\tif (right.id === \"!\") {\n\t\t\t\twarning(\"W018\", right, \"!\");\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction isPoorRelation(node) {\n\t\treturn node &&\n\t\t\t ((node.type === \"(number)\" && +node.value === 0) ||\n\t\t\t (node.type === \"(string)\" && node.value === \"\") ||\n\t\t\t (node.type === \"null\" && !state.option.eqnull) ||\n\t\t\t\tnode.type === \"true\" ||\n\t\t\t\tnode.type === \"false\" ||\n\t\t\t\tnode.type === \"undefined\");\n\t}\n\n\tfunction assignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\n\t\treturn infix(s, function (left, that) {\n\t\t\tthat.left = left;\n\n\t\t\tif (predefined[left.value] === false &&\n\t\t\t\t\tscope[left.value][\"(global)\"] === true) {\n\t\t\t\twarning(\"W020\", left);\n\t\t\t} else if (left[\"function\"]) {\n\t\t\t\twarning(\"W021\", left, left.value);\n\t\t\t}\n\n\t\t\tif (left) {\n\t\t\t\tif (state.option.esnext && funct[left.value] === \"const\") {\n\t\t\t\t\terror(\"E013\", left, left.value);\n\t\t\t\t}\n\n\t\t\t\tif (left.id === \".\" || left.id === \"[\") {\n\t\t\t\t\tif (!left.left || left.left.value === \"arguments\") {\n\t\t\t\t\t\twarning(\"E031\", that);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t} else if (left.identifier && !isReserved(left)) {\n\t\t\t\t\tif (funct[left.value] === \"exception\") {\n\t\t\t\t\t\twarning(\"W022\", left);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction bitwise(s, f, p) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = (typeof f === \"function\") ? f : function (left) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t}\n\t\t\tthis.left = left;\n\t\t\tthis.right = expression(p);\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\n\tfunction bitwiseassignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\t\treturn infix(s, function (left, that) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", that, that.id);\n\t\t\t}\n\t\t\tnonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tif (left) {\n\t\t\t\tif (left.id === \".\" || left.id === \"[\" ||\n\t\t\t\t\t\t(left.identifier && !isReserved(left))) {\n\t\t\t\t\texpression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t}\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction suffix(s) {\n\t\tvar x = symbol(s, 150);\n\n\t\tx.led = function (left) {\n\t\t\tif (state.option.plusplus) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t} else if ((!left.identifier || isReserved(left)) && left.id !== \".\" && left.id !== \"[\") {\n\t\t\t\twarning(\"W017\", this);\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument (see identifier())\n\t// prop means that this identifier is that of an object property\n\n\tfunction optionalidentifier(fnparam, prop) {\n\t\tif (!state.tokens.next.identifier) {\n\t\t\treturn;\n\t\t}\n\n\t\tadvance();\n\n\t\tvar curr = state.tokens.curr;\n\t\tvar meta = curr.meta || {};\n\t\tvar val = state.tokens.curr.value;\n\n\t\tif (!isReserved(curr)) {\n\t\t\treturn val;\n\t\t}\n\n\t\tif (prop) {\n\t\t\tif (state.option.es5 || meta.isFutureReservedWord) {\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\n\t\tif (fnparam && val === \"undefined\") {\n\t\t\treturn val;\n\t\t}\n\n\t\twarning(\"W024\", state.tokens.curr, state.tokens.curr.id);\n\t\treturn val;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument\n\t// prop means that this identifier is that of an object property\n\tfunction identifier(fnparam, prop) {\n\t\tvar i = optionalidentifier(fnparam, prop);\n\t\tif (i) {\n\t\t\treturn i;\n\t\t}\n\t\tif (state.tokens.curr.id === \"function\" && state.tokens.next.id === \"(\") {\n\t\t\twarning(\"W025\");\n\t\t} else {\n\t\t\terror(\"E030\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t}\n\n\n\tfunction reachable(s) {\n\t\tvar i = 0, t;\n\t\tif (state.tokens.next.id !== \";\" || noreach) {\n\t\t\treturn;\n\t\t}\n\t\tfor (;;) {\n\t\t\tt = peek(i);\n\t\t\tif (t.reach) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (t.id !== \"(endline)\") {\n\t\t\t\tif (t.id === \"function\") {\n\t\t\t\t\tif (!state.option.latedef) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\twarning(\"W026\", t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twarning(\"W027\", t, t.value, s);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti += 1;\n\t\t}\n\t}\n\n\n\tfunction statement(noindent) {\n\t\tvar i = indent, r, s = scope, t = state.tokens.next;\n\n\t\tif (t.id === \";\") {\n\t\t\tadvance(\";\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Is this a labelled statement?\n\t\tvar res = isReserved(t);\n\n\t\t// We're being more tolerant here: if someone uses\n\t\t// a FutureReservedWord as a label, we warn but proceed\n\t\t// anyway.\n\n\t\tif (res && t.meta && t.meta.isFutureReservedWord) {\n\t\t\twarning(\"W024\", t, t.id);\n\t\t\tres = false;\n\t\t}\n\n\t\tif (t.identifier && !res && peek().id === \":\") {\n\t\t\tadvance();\n\t\t\tadvance(\":\");\n\t\t\tscope = Object.create(s);\n\t\t\taddlabel(t.value, \"label\");\n\n\t\t\tif (!state.tokens.next.labelled && state.tokens.next.value !== \"{\") {\n\t\t\t\twarning(\"W028\", state.tokens.next, t.value, state.tokens.next.value);\n\t\t\t}\n\n\t\t\tif (reg.javascriptURL.test(t.value + \":\")) {\n\t\t\t\twarning(\"W029\", t, t.value);\n\t\t\t}\n\n\t\t\tstate.tokens.next.label = t.value;\n\t\t\tt = state.tokens.next;\n\t\t}\n\n\t\t// Is it a lonely block?\n\n\t\tif (t.id === \"{\") {\n\t\t\tblock(true, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse the statement.\n\n\t\tif (!noindent) {\n\t\t\tindentation();\n\t\t}\n\t\tr = expression(0, true);\n\n\t\t// Look for the final semicolon.\n\n\t\tif (!t.block) {\n\t\t\tif (!state.option.expr && (!r || !r.exps)) {\n\t\t\t\twarning(\"W030\", state.tokens.curr);\n\t\t\t} else if (state.option.nonew && r.id === \"(\" && r.left.id === \"new\") {\n\t\t\t\twarning(\"W031\", t);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\treturn comma();\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (!state.option.asi) {\n\t\t\t\t\t// If this is the last statement in a block that ends on\n\t\t\t\t\t// the same line *and* option lastsemic is on, ignore the warning.\n\t\t\t\t\t// Otherwise, complain about missing semicolon.\n\t\t\t\t\tif (!state.option.lastsemic || state.tokens.next.id !== \"}\" ||\n\t\t\t\t\t\tstate.tokens.next.line !== state.tokens.curr.line) {\n\t\t\t\t\t\twarningAt(\"W033\", state.tokens.curr.line, state.tokens.curr.character);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\";\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t}\n\n\t\t// Restore the indentation.\n\n\t\tindent = i;\n\t\tscope = s;\n\t\treturn r;\n\t}\n\n\n\tfunction statements(startLine) {\n\t\tvar a = [], p;\n\n\t\twhile (!state.tokens.next.reach && state.tokens.next.id !== \"(end)\") {\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\tp = peek();\n\n\t\t\t\tif (!p || (p.id !== \"(\" && p.id !== \"[\")) {\n\t\t\t\t\twarning(\"W032\");\n\t\t\t\t}\n\n\t\t\t\tadvance(\";\");\n\t\t\t} else {\n\t\t\t\ta.push(statement(startLine === state.tokens.next.line));\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n\n\n\t/*\n\t * read all directives\n\t * recognizes a simple form of asi, but always\n\t * warns, if it is used\n\t */\n\tfunction directives() {\n\t\tvar i, p, pn;\n\n\t\tfor (;;) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tp = peek(0);\n\t\t\t\tif (p.id === \"(endline)\") {\n\t\t\t\t\ti = 1;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tpn = peek(i);\n\t\t\t\t\t\ti = i + 1;\n\t\t\t\t\t} while (pn.id === \"(endline)\");\n\n\t\t\t\t\tif (pn.id !== \";\") {\n\t\t\t\t\t\tif (pn.id !== \"(string)\" && pn.id !== \"(number)\" &&\n\t\t\t\t\t\t\tpn.id !== \"(regexp)\" && pn.identifier !== true &&\n\t\t\t\t\t\t\tpn.id !== \"}\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twarning(\"W033\", state.tokens.next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp = pn;\n\t\t\t\t\t}\n\t\t\t\t} else if (p.id === \"}\") {\n\t\t\t\t\t// Directive with no other statements, warn about missing semicolon\n\t\t\t\t\twarning(\"W033\", p);\n\t\t\t\t} else if (p.id !== \";\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tindentation();\n\t\t\t\tadvance();\n\t\t\t\tif (state.directive[state.tokens.curr.value]) {\n\t\t\t\t\twarning(\"W034\", state.tokens.curr, state.tokens.curr.value);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.value === \"use strict\") {\n\t\t\t\t\tif (!state.option[\"(explicitNewcap)\"])\n\t\t\t\t\t\tstate.option.newcap = true;\n\t\t\t\t\tstate.option.undef = true;\n\t\t\t\t}\n\n\t\t\t\t// there's no directive negation, so always set to true\n\t\t\t\tstate.directive[state.tokens.curr.value] = true;\n\n\t\t\t\tif (p.id === \";\") {\n\t\t\t\t\tadvance(\";\");\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\t/*\n\t * Parses a single block. A block is a sequence of statements wrapped in\n\t * braces.\n\t *\n\t * ordinary - true for everything but function bodies and try blocks.\n\t * stmt\t\t- true if block can be a single statement (e.g. in if/for/while).\n\t * isfunc\t- true if block is a function body\n\t */\n\tfunction block(ordinary, stmt, isfunc) {\n\t\tvar a,\n\t\t\tb = inblock,\n\t\t\told_indent = indent,\n\t\t\tm,\n\t\t\ts = scope,\n\t\t\tt,\n\t\t\tline,\n\t\t\td;\n\n\t\tinblock = ordinary;\n\n\t\tif (!ordinary || !state.option.funcscope)\n\t\t\tscope = Object.create(scope);\n\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\n\t\tvar metrics = funct[\"(metrics)\"];\n\t\tmetrics.nestedBlockDepth += 1;\n\t\tmetrics.verifyMaxNestedBlockDepthPerFunction();\n\n\t\tif (state.tokens.next.id === \"{\") {\n\t\t\tadvance(\"{\");\n\t\t\tline = state.tokens.curr.line;\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\twhile (!ordinary && state.tokens.next.from > indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tm = {};\n\t\t\t\t\tfor (d in state.directive) {\n\t\t\t\t\t\tif (_.has(state.directive, d)) {\n\t\t\t\t\t\t\tm[d] = state.directive[d];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectives();\n\n\t\t\t\t\tif (state.option.strict && funct[\"(context)\"][\"(global)\"]) {\n\t\t\t\t\t\tif (!m[\"use strict\"] && !state.directive[\"use strict\"]) {\n\t\t\t\t\t\t\twarning(\"E007\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ta = statements(line);\n\n\t\t\t\tmetrics.statementCount += a.length;\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tstate.directive = m;\n\t\t\t\t}\n\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tif (line !== state.tokens.next.line) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\t\t\t} else if (line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", t);\n\t\t\tindent = old_indent;\n\t\t} else if (!ordinary) {\n\t\t\terror(\"E021\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t} else {\n\t\t\tif (!stmt || state.option.curly) {\n\t\t\t\twarning(\"W116\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t\t}\n\n\t\t\tnoreach = true;\n\t\t\tindent += state.option.indent;\n\t\t\t// test indentation only if statement is in new line\n\t\t\ta = [statement(state.tokens.next.line === state.tokens.curr.line)];\n\t\t\tindent -= state.option.indent;\n\t\t\tnoreach = false;\n\t\t}\n\t\tfunct[\"(verb)\"] = null;\n\t\tif (!ordinary || !state.option.funcscope) scope = s;\n\t\tinblock = b;\n\t\tif (ordinary && state.option.noempty && (!a || a.length === 0)) {\n\t\t\twarning(\"W035\");\n\t\t}\n\t\tmetrics.nestedBlockDepth -= 1;\n\t\treturn a;\n\t}\n\n\n\tfunction countMember(m) {\n\t\tif (membersOnly && typeof membersOnly[m] !== \"boolean\") {\n\t\t\twarning(\"W036\", state.tokens.curr, m);\n\t\t}\n\t\tif (typeof member[m] === \"number\") {\n\t\t\tmember[m] += 1;\n\t\t} else {\n\t\t\tmember[m] = 1;\n\t\t}\n\t}\n\n\n\tfunction note_implied(tkn) {\n\t\tvar name = tkn.value, line = tkn.line, a = implied[name];\n\t\tif (typeof a === \"function\") {\n\t\t\ta = false;\n\t\t}\n\n\t\tif (!a) {\n\t\t\ta = [line];\n\t\t\timplied[name] = a;\n\t\t} else if (a[a.length - 1] !== line) {\n\t\t\ta.push(line);\n\t\t}\n\t}\n\n\n\t// Build the syntax table by declaring the syntactic elements of the language.\n\n\ttype(\"(number)\", function () {\n\t\treturn this;\n\t});\n\n\ttype(\"(string)\", function () {\n\t\treturn this;\n\t});\n\n\tstate.syntax[\"(identifier)\"] = {\n\t\ttype: \"(identifier)\",\n\t\tlbp: 0,\n\t\tidentifier: true,\n\t\tnud: function () {\n\t\t\tvar v = this.value,\n\t\t\t\ts = scope[v],\n\t\t\t\tf;\n\n\t\t\tif (typeof s === \"function\") {\n\t\t\t\t// Protection against accidental inheritance.\n\t\t\t\ts = undefined;\n\t\t\t} else if (typeof s === \"boolean\") {\n\t\t\t\tf = funct;\n\t\t\t\tfunct = functions[0];\n\t\t\t\taddlabel(v, \"var\");\n\t\t\t\ts = funct;\n\t\t\t\tfunct = f;\n\t\t\t}\n\n\t\t\t// The name is in scope and defined in the current function.\n\t\t\tif (funct === s) {\n\t\t\t\t// Change 'unused' to 'var', and reject labels.\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[v] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"unction\":\n\t\t\t\t\tfunct[v] = \"function\";\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"function\":\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (funct[\"(global)\"]) {\n\t\t\t\t// The name is not defined in the function. If we are in the global\n\t\t\t\t// scope, then we have an undefined variable.\n\t\t\t\t//\n\t\t\t\t// Operators typeof and delete do not raise runtime errors even if\n\t\t\t\t// the base object of a reference is null so no need to display warning\n\t\t\t\t// if we're inside of typeof or delete.\n\n\t\t\t\tif (typeof predefined[v] !== \"boolean\") {\n\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t(state.tokens.next && (state.tokens.next.value === \".\" ||\n\t\t\t\t\t\t\tstate.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t} else {\n\t\t\t\t// If the name is already defined in the current\n\t\t\t\t// function, but not as outer, then there is a scope error.\n\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"closure\":\n\t\t\t\tcase \"function\":\n\t\t\t\tcase \"var\":\n\t\t\t\tcase \"unused\":\n\t\t\t\t\twarning(\"W038\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outer\":\n\t\t\t\tcase \"global\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// If the name is defined in an outer function, make an outer entry,\n\t\t\t\t\t// and if it was unused, make it var.\n\t\t\t\t\tif (s === true) {\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t} else if (s === null) {\n\t\t\t\t\t\twarning(\"W039\", state.tokens.curr, v);\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else if (typeof s !== \"object\") {\n\t\t\t\t\t\t// Operators typeof and delete do not raise runtime errors even\n\t\t\t\t\t\t// if the base object of a reference is null so no need to\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// display warning if we're inside of typeof or delete.\n\t\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t\t(state.tokens.next &&\n\t\t\t\t\t\t\t\t(state.tokens.next.value === \".\" || state.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (s[v]) {\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\tcase \"unction\":\n\t\t\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"var\":\n\t\t\t\t\t\tcase \"unused\":\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"closure\":\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"label\":\n\t\t\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tled: function () {\n\t\t\terror(\"E033\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t};\n\n\ttype(\"(regexp)\", function () {\n\t\treturn this;\n\t});\n\n\t// ECMAScript parser\n\n\tdelim(\"(endline)\");\n\tdelim(\"(begin)\");\n\tdelim(\"(end)\").reach = true;\n\tdelim(\"(error)\").reach = true;\n\tdelim(\"}\").reach = true;\n\tdelim(\")\");\n\tdelim(\"]\");\n\tdelim(\"\\\"\").reach = true;\n\tdelim(\"'\").reach = true;\n\tdelim(\";\");\n\tdelim(\":\").reach = true;\n\tdelim(\",\");\n\tdelim(\"#\");\n\n\treserve(\"else\");\n\treserve(\"case\").reach = true;\n\treserve(\"catch\");\n\treserve(\"default\").reach = true;\n\treserve(\"finally\");\n\treservevar(\"arguments\", function (x) {\n\t\tif (state.directive[\"use strict\"] && funct[\"(global)\"]) {\n\t\t\twarning(\"E008\", x);\n\t\t}\n\t});\n\treservevar(\"eval\");\n\treservevar(\"false\");\n\treservevar(\"Infinity\");\n\treservevar(\"null\");\n\treservevar(\"this\", function (x) {\n\t\tif (state.directive[\"use strict\"] && !state.option.validthis && ((funct[\"(statement)\"] &&\n\t\t\t\tfunct[\"(name)\"].charAt(0) > \"Z\") || funct[\"(global)\"])) {\n\t\t\twarning(\"W040\", x);\n\t\t}\n\t});\n\treservevar(\"true\");\n\treservevar(\"undefined\");\n\n\tassignop(\"=\", \"assign\", 20);\n\tassignop(\"+=\", \"assignadd\", 20);\n\tassignop(\"-=\", \"assignsub\", 20);\n\tassignop(\"*=\", \"assignmult\", 20);\n\tassignop(\"/=\", \"assigndiv\", 20).nud = function () {\n\t\terror(\"E014\");\n\t};\n\tassignop(\"%=\", \"assignmod\", 20);\n\n\tbitwiseassignop(\"&=\", \"assignbitand\", 20);\n\tbitwiseassignop(\"|=\", \"assignbitor\", 20);\n\tbitwiseassignop(\"^=\", \"assignbitxor\", 20);\n\tbitwiseassignop(\"<<=\", \"assignshiftleft\", 20);\n\tbitwiseassignop(\">>=\", \"assignshiftright\", 20);\n\tbitwiseassignop(\">>>=\", \"assignshiftrightunsigned\", 20);\n\tinfix(\"?\", function (left, that) {\n\t\tthat.left = left;\n\t\tthat.right = expression(10);\n\t\tadvance(\":\");\n\t\tthat[\"else\"] = expression(10);\n\t\treturn that;\n\t}, 30);\n\n\tinfix(\"||\", \"or\", 40);\n\tinfix(\"&&\", \"and\", 50);\n\tbitwise(\"|\", \"bitor\", 70);\n\tbitwise(\"^\", \"bitxor\", 80);\n\tbitwise(\"&\", \"bitand\", 90);\n\trelation(\"==\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull && (left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq)\n\t\t\twarning(\"W116\", this, \"===\", \"==\");\n\t\telse if (isPoorRelation(left))\n\t\t\twarning(\"W041\", this, \"===\", left.value);\n\t\telse if (isPoorRelation(right))\n\t\t\twarning(\"W041\", this, \"===\", right.value);\n\n\t\treturn this;\n\t});\n\trelation(\"===\");\n\trelation(\"!=\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull &&\n\t\t\t\t(left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq) {\n\t\t\twarning(\"W116\", this, \"!==\", \"!=\");\n\t\t} else if (isPoorRelation(left)) {\n\t\t\twarning(\"W041\", this, \"!==\", left.value);\n\t\t} else if (isPoorRelation(right)) {\n\t\t\twarning(\"W041\", this, \"!==\", right.value);\n\t\t}\n\t\treturn this;\n\t});\n\trelation(\"!==\");\n\trelation(\"<\");\n\trelation(\">\");\n\trelation(\"<=\");\n\trelation(\">=\");\n\tbitwise(\"<<\", \"shiftleft\", 120);\n\tbitwise(\">>\", \"shiftright\", 120);\n\tbitwise(\">>>\", \"shiftrightunsigned\", 120);\n\tinfix(\"in\", \"in\", 120);\n\tinfix(\"instanceof\", \"instanceof\", 120);\n\tinfix(\"+\", function (left, that) {\n\t\tvar right = expression(130);\n\t\tif (left && right && left.id === \"(string)\" && right.id === \"(string)\") {\n\t\t\tleft.value += right.value;\n\t\t\tleft.character = right.character;\n\t\t\tif (!state.option.scripturl && reg.javascriptURL.test(left.value)) {\n\t\t\t\twarning(\"W050\", left);\n\t\t\t}\n\t\t\treturn left;\n\t\t}\n\t\tthat.left = left;\n\t\tthat.right = right;\n\t\treturn that;\n\t}, 130);\n\tprefix(\"+\", \"num\");\n\tprefix(\"+++\", function () {\n\t\twarning(\"W007\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"+++\", function (left) {\n\t\twarning(\"W007\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"-\", \"sub\", 130);\n\tprefix(\"-\", \"neg\");\n\tprefix(\"---\", function () {\n\t\twarning(\"W006\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"---\", function (left) {\n\t\twarning(\"W006\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"*\", \"mult\", 140);\n\tinfix(\"/\", \"div\", 140);\n\tinfix(\"%\", \"mod\", 140);\n\n\tsuffix(\"++\", \"postinc\");\n\tprefix(\"++\", \"preinc\");\n\tstate.syntax[\"++\"].exps = true;\n\n\tsuffix(\"--\", \"postdec\");\n\tprefix(\"--\", \"predec\");\n\tstate.syntax[\"--\"].exps = true;\n\tprefix(\"delete\", function () {\n\t\tvar p = expression(0);\n\t\tif (!p || (p.id !== \".\" && p.id !== \"[\")) {\n\t\t\twarning(\"W051\");\n\t\t}\n\t\tthis.first = p;\n\t\treturn this;\n\t}).exps = true;\n\n\tprefix(\"~\", function () {\n\t\tif (state.option.bitwise) {\n\t\t\twarning(\"W052\", this, \"~\");\n\t\t}\n\t\texpression(150);\n\t\treturn this;\n\t});\n\n\tprefix(\"!\", function () {\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\n\t\tif (!this.right) { // '!' followed by nothing? Give up.\n\t\t\tquit(\"E041\", this.line || 0);\n\t\t}\n\n\t\tif (bang[this.right.id] === true) {\n\t\t\twarning(\"W018\", this, \"!\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"typeof\", \"typeof\");\n\tprefix(\"new\", function () {\n\t\tvar c = expression(155), i;\n\t\tif (c && c.id !== \"function\") {\n\t\t\tif (c.identifier) {\n\t\t\t\tc[\"new\"] = true;\n\t\t\t\tswitch (c.value) {\n\t\t\t\tcase \"Number\":\n\t\t\t\tcase \"String\":\n\t\t\t\tcase \"Boolean\":\n\t\t\t\tcase \"Math\":\n\t\t\t\tcase \"JSON\":\n\t\t\t\t\twarning(\"W053\", state.tokens.prev, c.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Function\":\n\t\t\t\t\tif (!state.option.evil) {\n\t\t\t\t\t\twarning(\"W054\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Date\":\n\t\t\t\tcase \"RegExp\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (c.id !== \"function\") {\n\t\t\t\t\t\ti = c.value.substr(0, 1);\n\t\t\t\t\t\tif (state.option.newcap && (i < \"A\" || i > \"Z\") && !_.has(global, c.value)) {\n\t\t\t\t\t\t\twarning(\"W055\", state.tokens.curr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (c.id !== \".\" && c.id !== \"[\" && c.id !== \"(\") {\n\t\t\t\t\twarning(\"W056\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!state.option.supernew)\n\t\t\t\twarning(\"W057\", this);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\tif (state.tokens.next.id !== \"(\" && !state.option.supernew) {\n\t\t\twarning(\"W058\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\t\tthis.first = c;\n\t\treturn this;\n\t});\n\tstate.syntax[\"new\"].exps = true;\n\n\tprefix(\"void\").exps = true;\n\n\tinfix(\".\", function (left, that) {\n\t\tadjacent(state.tokens.prev, state.tokens.curr);\n\t\tnobreak();\n\t\tvar m = identifier(false, true);\n\n\t\tif (typeof m === \"string\") {\n\t\t\tcountMember(m);\n\t\t}\n\n\t\tthat.left = left;\n\t\tthat.right = m;\n\n\t\tif (m && m === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tif (left && left.value === \"arguments\" && (m === \"callee\" || m === \"caller\")) {\n\t\t\tif (state.option.noarg)\n\t\t\t\twarning(\"W059\", left, m);\n\t\t\telse if (state.directive[\"use strict\"])\n\t\t\t\terror(\"E008\");\n\t\t} else if (!state.option.evil && left && left.value === \"document\" &&\n\t\t\t\t(m === \"write\" || m === \"writeln\")) {\n\t\t\twarning(\"W060\", left);\n\t\t}\n\n\t\tif (!state.option.evil && (m === \"eval\" || m === \"execScript\")) {\n\t\t\twarning(\"W061\");\n\t\t}\n\n\t\treturn that;\n\t}, 160, true);\n\n\tinfix(\"(\", function (left, that) {\n\t\tif (state.tokens.prev.id !== \"}\" && state.tokens.prev.id !== \")\") {\n\t\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\t}\n\n\t\tnospace();\n\t\tif (state.option.immed && !left.immed && left.id === \"function\") {\n\t\t\twarning(\"W062\");\n\t\t}\n\n\t\tvar n = 0;\n\t\tvar p = [];\n\n\t\tif (left) {\n\t\t\tif (left.type === \"(identifier)\") {\n\t\t\t\tif (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {\n\t\t\t\t\tif (\"Number String Boolean Date Object\".indexOf(left.value) === -1) {\n\t\t\t\t\t\tif (left.value === \"Math\") {\n\t\t\t\t\t\t\twarning(\"W063\", left);\n\t\t\t\t\t\t} else if (state.option.newcap) {\n\t\t\t\t\t\t\twarning(\"W064\", left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\tp[p.length] = expression(10);\n\t\t\t\tn += 1;\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\");\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\n\t\tif (typeof left === \"object\") {\n\t\t\tif (left.value === \"parseInt\" && n === 1) {\n\t\t\t\twarning(\"W065\", state.tokens.curr);\n\t\t\t}\n\t\t\tif (!state.option.evil) {\n\t\t\t\tif (left.value === \"eval\" || left.value === \"Function\" ||\n\t\t\t\t\t\tleft.value === \"execScript\") {\n\t\t\t\t\twarning(\"W061\", left);\n\n\t\t\t\t\tif (p[0] && [0].id === \"(string)\") {\n\t\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t\t}\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t (left.value === \"setTimeout\" ||\n\t\t\t\t\t\tleft.value === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\n\t\t\t\t// window.setTimeout/setInterval\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t left.value === \".\" &&\n\t\t\t\t\t left.left.value === \"window\" &&\n\t\t\t\t\t (left.right === \"setTimeout\" ||\n\t\t\t\t\t\tleft.right === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!left.identifier && left.id !== \".\" && left.id !== \"[\" &&\n\t\t\t\t\tleft.id !== \"(\" && left.id !== \"&&\" && left.id !== \"||\" &&\n\t\t\t\t\tleft.id !== \"?\") {\n\t\t\t\twarning(\"W067\", left);\n\t\t\t}\n\t\t}\n\n\t\tthat.left = left;\n\t\treturn that;\n\t}, 155, true).exps = true;\n\n\tprefix(\"(\", function () {\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \"function\") {\n\t\t\tstate.tokens.next.immed = true;\n\t\t}\n\n\t\tvar exprs = [];\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\texprs.push(expression(0));\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\", this);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tif (state.option.immed && exprs[0].id === \"function\") {\n\t\t\tif (state.tokens.next.id !== \"(\" &&\n\t\t\t (state.tokens.next.id !== \".\" || (peek().value !== \"call\" && peek().value !== \"apply\"))) {\n\t\t\t\twarning(\"W068\", this);\n\t\t\t}\n\t\t}\n\n\t\treturn exprs[0];\n\t});\n\n\tinfix(\"[\", function (left, that) {\n\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\tnospace();\n\t\tvar e = expression(0), s;\n\t\tif (e && e.type === \"(string)\") {\n\t\t\tif (!state.option.evil && (e.value === \"eval\" || e.value === \"execScript\")) {\n\t\t\t\twarning(\"W061\", that);\n\t\t\t}\n\n\t\t\tcountMember(e.value);\n\t\t\tif (!state.option.sub && reg.identifier.test(e.value)) {\n\t\t\t\ts = state.syntax[e.value];\n\t\t\t\tif (!s || !isReserved(s)) {\n\t\t\t\t\twarning(\"W069\", state.tokens.prev, e.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tadvance(\"]\", that);\n\n\t\tif (e && e.value === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tthat.left = left;\n\t\tthat.right = e;\n\t\treturn that;\n\t}, 160, true);\n\n\tprefix(\"[\", function () {\n\t\tvar b = state.tokens.curr.line !== state.tokens.next.line;\n\t\tthis.first = [];\n\t\tif (b) {\n\t\t\tindent += state.option.indent;\n\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t}\n\t\t}\n\t\twhile (state.tokens.next.id !== \"(end)\") {\n\t\t\twhile (state.tokens.next.id === \",\") {\n\t\t\t\tif (!state.option.es5)\n\t\t\t\t\twarning(\"W070\");\n\t\t\t\tadvance(\",\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id === \"]\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (b && state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tthis.first.push(expression(10));\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\tif (state.tokens.next.id === \"]\" && !state.option.es5) {\n\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (b) {\n\t\t\tindent -= state.option.indent;\n\t\t\tindentation();\n\t\t}\n\t\tadvance(\"]\", this);\n\t\treturn this;\n\t}, 160);\n\n\n\tfunction property_name() {\n\t\tvar id = optionalidentifier(false, true);\n\n\t\tif (!id) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tid = state.tokens.next.value;\n\t\t\t\tadvance();\n\t\t\t} else if (state.tokens.next.id === \"(number)\") {\n\t\t\t\tid = state.tokens.next.value.toString();\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\n\t\tif (id === \"hasOwnProperty\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\treturn id;\n\t}\n\n\n\tfunction functionparams() {\n\t\tvar next = state.tokens.next;\n\t\tvar params = [];\n\t\tvar ident;\n\n\t\tadvance(\"(\");\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \")\") {\n\t\t\tadvance(\")\");\n\t\t\treturn;\n\t\t}\n\n\t\tfor (;;) {\n\t\t\tident = identifier(true);\n\t\t\tparams.push(ident);\n\t\t\taddlabel(ident, \"unused\", state.tokens.curr);\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma();\n\t\t\t} else {\n\t\t\t\tadvance(\")\", next);\n\t\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\t\treturn params;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfunction doFunction(name, statement) {\n\t\tvar f;\n\t\tvar oldOption = state.option;\n\t\tvar oldScope = scope;\n\n\t\tstate.option = Object.create(state.option);\n\t\tscope = Object.create(scope);\n\n\t\tfunct = {\n\t\t\t\"(name)\" : name || \"\\\"\" + anonname + \"\\\"\",\n\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\"(context)\" : funct,\n\t\t\t\"(breakage)\" : 0,\n\t\t\t\"(loopage)\" : 0,\n\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\"(scope)\" : scope,\n\t\t\t\"(statement)\": statement,\n\t\t\t\"(tokens)\" : {}\n\t\t};\n\n\t\tf = funct;\n\t\tstate.tokens.curr.funct = funct;\n\n\t\tfunctions.push(funct);\n\n\t\tif (name) {\n\t\t\taddlabel(name, \"function\");\n\t\t}\n\n\t\tfunct[\"(params)\"] = functionparams();\n\t\tfunct[\"(metrics)\"].verifyMaxParametersPerFunction(funct[\"(params)\"]);\n\n\t\tblock(false, false, true);\n\n\t\tfunct[\"(metrics)\"].verifyMaxStatementsPerFunction();\n\t\tfunct[\"(metrics)\"].verifyMaxComplexityPerFunction();\n\n\t\tif (state.option.unused === false) {\n\t\t\tfunct[\"(ignoreUnused)\"] = true;\n\t\t}\n\n\t\tscope = oldScope;\n\t\tstate.option = oldOption;\n\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\tfunct = funct[\"(context)\"];\n\n\t\treturn f;\n\t}\n\n\tfunction createMetrics(functionStartToken) {\n\t\treturn {\n\t\t\tstatementCount: 0,\n\t\t\tnestedBlockDepth: -1,\n\t\t\tComplexityCount: 1,\n\t\t\tverifyMaxStatementsPerFunction: function () {\n\t\t\t\tif (state.option.maxstatements &&\n\t\t\t\t\tthis.statementCount > state.option.maxstatements) {\n\t\t\t\t\twarning(\"W071\", functionStartToken, this.statementCount);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxParametersPerFunction: function (params) {\n\t\t\t\tparams = params || [];\n\n\t\t\t\tif (state.option.maxparams && params.length > state.option.maxparams) {\n\t\t\t\t\twarning(\"W072\", functionStartToken, params.length);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxNestedBlockDepthPerFunction: function () {\n\t\t\t\tif (state.option.maxdepth &&\n\t\t\t\t\tthis.nestedBlockDepth > 0 &&\n\t\t\t\t\tthis.nestedBlockDepth === state.option.maxdepth + 1) {\n\t\t\t\t\twarning(\"W073\", null, this.nestedBlockDepth);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxComplexityPerFunction: function () {\n\t\t\t\tvar max = state.option.maxcomplexity;\n\t\t\t\tvar cc = this.ComplexityCount;\n\t\t\t\tif (max && cc > max) {\n\t\t\t\t\twarning(\"W074\", functionStartToken, cc);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction increaseComplexityCount() {\n\t\tfunct[\"(metrics)\"].ComplexityCount += 1;\n\t}\n\n\t// Parse assignments that were found instead of conditionals.\n\t// For example: if (a = 1) { ... }\n\n\tfunction parseCondAssignment() {\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"=\":\n\t\tcase \"+=\":\n\t\tcase \"-=\":\n\t\tcase \"*=\":\n\t\tcase \"%=\":\n\t\tcase \"&=\":\n\t\tcase \"|=\":\n\t\tcase \"^=\":\n\t\tcase \"/=\":\n\t\t\tif (!state.option.boss) {\n\t\t\t\twarning(\"W084\");\n\t\t\t}\n\n\t\t\tadvance(state.tokens.next.id);\n\t\t\texpression(20);\n\t\t}\n\t}\n\n\n\t(function (x) {\n\t\tx.nud = function () {\n\t\t\tvar b, f, i, p, t;\n\t\t\tvar props = {}; // All properties, including accessors\n\n\t\t\tfunction saveProperty(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name))\n\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\telse\n\t\t\t\t\tprops[name] = {};\n\n\t\t\t\tprops[name].basic = true;\n\t\t\t\tprops[name].basictkn = tkn;\n\t\t\t}\n\n\t\t\tfunction saveSetter(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].setter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].setter = true;\n\t\t\t\tprops[name].setterToken = tkn;\n\t\t\t}\n\n\t\t\tfunction saveGetter(name) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].getter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].getter = true;\n\t\t\t\tprops[name].getterToken = state.tokens.curr;\n\t\t\t}\n\n\t\t\tb = state.tokens.curr.line !== state.tokens.next.line;\n\t\t\tif (b) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (;;) {\n\t\t\t\tif (state.tokens.next.id === \"}\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (b) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.value === \"get\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"get\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveGetter(i);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (p) {\n\t\t\t\t\t\twarning(\"W076\", t, p[0], i);\n\t\t\t\t\t}\n\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t} else if (state.tokens.next.value === \"set\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"set\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveSetter(i, state.tokens.next);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (!p || p.length !== 1) {\n\t\t\t\t\t\twarning(\"W077\", t, i);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tsaveProperty(i, state.tokens.next);\n\n\t\t\t\t\tif (typeof i !== \"string\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\texpression(10);\n\t\t\t\t}\n\n\t\t\t\tcountMember(i);\n\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\" && !state.option.es5) {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", this);\n\n\t\t\t// Check for lonely setters if in the ES5 mode.\n\t\t\tif (state.option.es5) {\n\t\t\t\tfor (var name in props) {\n\t\t\t\t\tif (_.has(props, name) && props[name].setter && !props[name].getter) {\n\t\t\t\t\t\twarning(\"W078\", props[name].setterToken);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\tx.fud = function () {\n\t\t\terror(\"E036\", state.tokens.curr);\n\t\t};\n\t}(delim(\"{\")));\n\n\t// This Function is called when esnext option is set to true\n\t// it adds the `const` statement to JSHINT\n\n\tuseESNextSyntax = function () {\n\t\tvar conststatement = stmt(\"const\", function (prefix) {\n\t\t\tvar id, name, value;\n\n\t\t\tthis.first = [];\n\t\t\tfor (;;) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tid = identifier();\n\t\t\t\tif (funct[id] === \"const\") {\n\t\t\t\t\twarning(\"E011\", null, id);\n\t\t\t\t}\n\t\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\taddlabel(id, \"const\");\n\t\t\t\tif (prefix) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tname = state.tokens.curr;\n\t\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\t\tif (state.tokens.next.id !== \"=\") {\n\t\t\t\t\twarning(\"E012\", state.tokens.curr, id);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tadvance(\"=\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t\t}\n\t\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\t\terror(\"E037\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue = expression(0);\n\t\t\t\t\tname.first = value;\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t\tconststatement.exps = true;\n\t};\n\n\tvar varstatement = stmt(\"var\", function (prefix) {\n\t\t// JavaScript does not have block scope. It only has function scope. So,\n\t\t// declaring a variable in a block can have unexpected consequences.\n\t\tvar id, name, value;\n\n\t\tif (funct[\"(onevar)\"] && state.option.onevar) {\n\t\t\twarning(\"W081\");\n\t\t} else if (!funct[\"(global)\"]) {\n\t\t\tfunct[\"(onevar)\"] = true;\n\t\t}\n\n\t\tthis.first = [];\n\n\t\tfor (;;) {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tid = identifier();\n\n\t\t\tif (state.option.esnext && funct[id] === \"const\") {\n\t\t\t\twarning(\"E011\", null, id);\n\t\t\t}\n\n\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t}\n\n\t\t\taddlabel(id, \"unused\", state.tokens.curr);\n\n\t\t\tif (prefix) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tname = state.tokens.curr;\n\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\"=\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\terror(\"E038\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tvalue = expression(0);\n\t\t\t\tname.first = value;\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcomma();\n\t\t}\n\t\treturn this;\n\t});\n\tvarstatement.exps = true;\n\n\tblockstmt(\"function\", function () {\n\t\tif (inblock) {\n\t\t\twarning(\"W082\", state.tokens.curr);\n\n\t\t}\n\t\tvar i = identifier();\n\t\tif (state.option.esnext && funct[i] === \"const\") {\n\t\t\twarning(\"E011\", null, i);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\taddlabel(i, \"unction\", state.tokens.curr);\n\n\t\tdoFunction(i, { statement: true });\n\t\tif (state.tokens.next.id === \"(\" && state.tokens.next.line === state.tokens.curr.line) {\n\t\t\terror(\"E039\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"function\", function () {\n\t\tvar i = optionalidentifier();\n\t\tif (i) {\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t} else {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\t\tdoFunction(i);\n\t\tif (!state.option.loopfunc && funct[\"(loopage)\"]) {\n\t\t\twarning(\"W083\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"if\", function () {\n\t\tvar t = state.tokens.next;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tif (state.tokens.next.id === \"else\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"else\");\n\t\t\tif (state.tokens.next.id === \"if\" || state.tokens.next.id === \"switch\") {\n\t\t\t\tstatement(true);\n\t\t\t} else {\n\t\t\t\tblock(true, true);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"try\", function () {\n\t\tvar b;\n\n\t\tfunction doCatch() {\n\t\t\tvar oldScope = scope;\n\t\t\tvar e;\n\n\t\t\tadvance(\"catch\");\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(\");\n\n\t\t\tscope = Object.create(oldScope);\n\n\t\t\te = state.tokens.next.value;\n\t\t\tif (state.tokens.next.type !== \"(identifier)\") {\n\t\t\t\te = null;\n\t\t\t\twarning(\"E030\", state.tokens.next, e);\n\t\t\t}\n\n\t\t\tadvance();\n\t\t\tadvance(\")\");\n\n\t\t\tfunct = {\n\t\t\t\t\"(name)\" : \"(catch)\",\n\t\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\t\"(context)\" : funct,\n\t\t\t\t\"(breakage)\" : funct[\"(breakage)\"],\n\t\t\t\t\"(loopage)\" : funct[\"(loopage)\"],\n\t\t\t\t\"(scope)\" : scope,\n\t\t\t\t\"(statement)\": false,\n\t\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\t\"(catch)\" : true,\n\t\t\t\t\"(tokens)\" : {}\n\t\t\t};\n\n\t\t\tif (e) {\n\t\t\t\taddlabel(e, \"exception\");\n\t\t\t}\n\n\t\t\tstate.tokens.curr.funct = funct;\n\t\t\tfunctions.push(funct);\n\n\t\t\tblock(false);\n\n\t\t\tscope = oldScope;\n\n\t\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\t\tfunct = funct[\"(context)\"];\n\t\t}\n\n\t\tblock(false);\n\n\t\tif (state.tokens.next.id === \"catch\") {\n\t\t\tincreaseComplexityCount();\n\t\t\tdoCatch();\n\t\t\tb = true;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"finally\") {\n\t\t\tadvance(\"finally\");\n\t\t\tblock(false);\n\t\t\treturn;\n\t\t} else if (!b) {\n\t\t\terror(\"E021\", state.tokens.next, \"catch\", state.tokens.next.value);\n\t\t}\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"while\", function () {\n\t\tvar t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tfunct[\"(breakage)\"] -= 1;\n\t\tfunct[\"(loopage)\"] -= 1;\n\t\treturn this;\n\t}).labelled = true;\n\n\tblockstmt(\"with\", function () {\n\t\tvar t = state.tokens.next;\n\t\tif (state.directive[\"use strict\"]) {\n\t\t\terror(\"E010\", state.tokens.curr);\n\t\t} else if (!state.option.withstmt) {\n\t\t\twarning(\"W085\", state.tokens.curr);\n\t\t}\n\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(0);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"switch\", function () {\n\t\tvar t = state.tokens.next,\n\t\t\tg = false;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tthis.condition = expression(20);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\t\tadvance(\"{\");\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tindent += state.option.indent;\n\t\tthis.cases = [];\n\n\t\tfor (;;) {\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"case\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"case\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"switch\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// You can tell JSHint that you don't use break intentionally by\n\t\t\t\t\t// adding a comment /* falls through */ on a line just before\n\t\t\t\t\t// the next `case`.\n\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"case\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"case\");\n\t\t\t\tthis.cases.push(expression(20));\n\t\t\t\tincreaseComplexityCount();\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tfunct[\"(verb)\"] = \"case\";\n\t\t\t\tbreak;\n\t\t\tcase \"default\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Do not display a warning if 'default' is the first statement or if\n\t\t\t\t\t// there is a special /* falls through */ comment.\n\t\t\t\t\tif (this.cases.length) {\n\t\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"default\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"default\");\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tbreak;\n\t\t\tcase \"}\":\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t\tadvance(\"}\", t);\n\t\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\t\tfunct[\"(verb)\"] = undefined;\n\t\t\t\treturn;\n\t\t\tcase \"(end)\":\n\t\t\t\terror(\"E023\", state.tokens.next, \"}\");\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\tif (g) {\n\t\t\t\t\tswitch (state.tokens.curr.id) {\n\t\t\t\t\tcase \",\":\n\t\t\t\t\t\terror(\"E040\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \":\":\n\t\t\t\t\t\tg = false;\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E025\", state.tokens.curr);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (state.tokens.curr.id === \":\") {\n\t\t\t\t\t\tadvance(\":\");\n\t\t\t\t\t\terror(\"E024\", state.tokens.curr, \":\");\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(\"E021\", state.tokens.next, \"case\", state.tokens.next.value);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).labelled = true;\n\n\tstmt(\"debugger\", function () {\n\t\tif (!state.option.debug) {\n\t\t\twarning(\"W087\");\n\t\t}\n\t\treturn this;\n\t}).exps = true;\n\n\t(function () {\n\t\tvar x = stmt(\"do\", function () {\n\t\t\tfunct[\"(breakage)\"] += 1;\n\t\t\tfunct[\"(loopage)\"] += 1;\n\t\t\tincreaseComplexityCount();\n\n\t\t\tthis.first = block(true);\n\t\t\tadvance(\"while\");\n\t\t\tvar t = state.tokens.next;\n\t\t\tnonadjacent(state.tokens.curr, t);\n\t\t\tadvance(\"(\");\n\t\t\tnospace();\n\t\t\texpression(20);\n\t\t\tparseCondAssignment();\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t});\n\t\tx.labelled = true;\n\t\tx.exps = true;\n\t}());\n\n\tblockstmt(\"for\", function () {\n\t\tvar s, t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tif (peek(state.tokens.next.id === \"var\" ? 1 : 0).id === \"in\") {\n\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\tadvance(\"var\");\n\t\t\t\tvarstatement.fud.call(varstatement, true);\n\t\t\t} else {\n\t\t\t\tswitch (funct[state.tokens.next.value]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[state.tokens.next.value] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"var\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twarning(\"W088\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tadvance();\n\t\t\t}\n\t\t\tadvance(\"in\");\n\t\t\texpression(20);\n\t\t\tadvance(\")\", t);\n\t\t\ts = block(true, true);\n\t\t\tif (state.option.forin && s && (s.length > 1 || typeof s[0] !== \"object\" ||\n\t\t\t\t\ts[0].value !== \"if\")) {\n\t\t\t\twarning(\"W089\", this);\n\t\t\t}\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t} else {\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\t\tadvance(\"var\");\n\t\t\t\t\tvarstatement.fud.call(varstatement);\n\t\t\t\t} else {\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomma();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\texpression(20);\n\t\t\t\tparseCondAssignment();\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\terror(\"E021\", state.tokens.next, \")\", \";\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \")\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcomma();\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tblock(true, true);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t}\n\t}).labelled = true;\n\n\n\tstmt(\"break\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\t\treachable(\"break\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"continue\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t} else if (!funct[\"(loopage)\"]) {\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\t\t}\n\t\treachable(\"continue\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"return\", function () {\n\t\tif (this.line === state.tokens.next.line) {\n\t\t\tif (state.tokens.next.id === \"(regexp)\")\n\t\t\t\twarning(\"W092\");\n\n\t\t\tif (state.tokens.next.id !== \";\" && !state.tokens.next.reach) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tthis.first = expression(0);\n\n\t\t\t\tif (this.first.value === \"=\" && !state.option.boss) {\n\t\t\t\t\twarningAt(\"W093\", this.first.line, this.first.character);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!state.option.asi) {\n\t\t\tnolinebreak(this); // always warn (Line breaking error)\n\t\t}\n\t\treachable(\"return\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"throw\", function () {\n\t\tnolinebreak(this);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tthis.first = expression(20);\n\t\treachable(\"throw\");\n\t\treturn this;\n\t}).exps = true;\n\n\t// Future Reserved Words\n\n\tFutureReservedWord(\"abstract\");\n\tFutureReservedWord(\"boolean\");\n\tFutureReservedWord(\"byte\");\n\tFutureReservedWord(\"char\");\n\tFutureReservedWord(\"class\", { es5: true });\n\tFutureReservedWord(\"double\");\n\tFutureReservedWord(\"enum\", { es5: true });\n\tFutureReservedWord(\"export\", { es5: true });\n\tFutureReservedWord(\"extends\", { es5: true });\n\tFutureReservedWord(\"final\");\n\tFutureReservedWord(\"float\");\n\tFutureReservedWord(\"goto\");\n\tFutureReservedWord(\"implements\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"import\", { es5: true });\n\tFutureReservedWord(\"int\");\n\tFutureReservedWord(\"interface\");\n\tFutureReservedWord(\"let\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"long\");\n\tFutureReservedWord(\"native\");\n\tFutureReservedWord(\"package\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"private\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"protected\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"public\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"short\");\n\tFutureReservedWord(\"static\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"super\", { es5: true });\n\tFutureReservedWord(\"synchronized\");\n\tFutureReservedWord(\"throws\");\n\tFutureReservedWord(\"transient\");\n\tFutureReservedWord(\"volatile\");\n\tFutureReservedWord(\"yield\", { es5: true, strictOnly: true });\n\n\t// Parse JSON\n\n\tfunction jsonValue() {\n\n\t\tfunction jsonObject() {\n\t\t\tvar o = {}, t = state.tokens.next;\n\t\t\tadvance(\"{\");\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E026\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t} else if (state.tokens.next.id !== \"(string)\") {\n\t\t\t\t\t\twarning(\"W095\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tif (o[state.tokens.next.value] === true) {\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else if ((state.tokens.next.value === \"__proto__\" &&\n\t\t\t\t\t\t!state.option.proto) || (state.tokens.next.value === \"__iterator__\" &&\n\t\t\t\t\t\t!state.option.iterator)) {\n\t\t\t\t\t\twarning(\"W096\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\to[state.tokens.next.value] = true;\n\t\t\t\t\t}\n\t\t\t\t\tadvance();\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"}\");\n\t\t}\n\n\t\tfunction jsonArray() {\n\t\t\tvar t = state.tokens.next;\n\t\t\tadvance(\"[\");\n\t\t\tif (state.tokens.next.id !== \"]\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E027\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"]\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t}\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"]\");\n\t\t}\n\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"{\":\n\t\t\tjsonObject();\n\t\t\tbreak;\n\t\tcase \"[\":\n\t\t\tjsonArray();\n\t\t\tbreak;\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\tcase \"null\":\n\t\tcase \"(number)\":\n\t\tcase \"(string)\":\n\t\t\tadvance();\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tadvance(\"-\");\n\t\t\tif (state.tokens.curr.character !== state.tokens.next.from) {\n\t\t\t\twarning(\"W011\", state.tokens.curr);\n\t\t\t}\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(number)\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\terror(\"E003\", state.tokens.next);\n\t\t}\n\t}\n\n\n\t// The actual JSHINT function itself.\n\tvar itself = function (s, o, g) {\n\t\tvar a, i, k, x;\n\t\tvar optionKeys;\n\t\tvar newOptionObj = {};\n\n\t\tstate.reset();\n\n\t\tif (o && o.scope) {\n\t\t\tJSHINT.scope = o.scope;\n\t\t} else {\n\t\t\tJSHINT.errors = [];\n\t\t\tJSHINT.undefs = [];\n\t\t\tJSHINT.internals = [];\n\t\t\tJSHINT.blacklist = {};\n\t\t\tJSHINT.scope = \"(main)\";\n\t\t}\n\n\t\tpredefined = Object.create(null);\n\t\tcombine(predefined, vars.ecmaIdentifiers);\n\t\tcombine(predefined, vars.reservedVars);\n\n\t\tcombine(predefined, g || {});\n\n\t\tdeclared = Object.create(null);\n\t\texported = Object.create(null);\n\t\tignored = Object.create(null);\n\n\t\tif (o) {\n\t\t\ta = o.predef;\n\t\t\tif (a) {\n\t\t\t\tif (!Array.isArray(a) && typeof a === \"object\") {\n\t\t\t\t\ta = Object.keys(a);\n\t\t\t\t}\n\n\t\t\t\ta.forEach(function (item) {\n\t\t\t\t\tvar slice, prop;\n\n\t\t\t\t\tif (item[0] === \"-\") {\n\t\t\t\t\t\tslice = item.slice(1);\n\t\t\t\t\t\tJSHINT.blacklist[slice] = slice;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprop = Object.getOwnPropertyDescriptor(o.predef, item);\n\t\t\t\t\t\tpredefined[item] = prop ? prop.value : false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\toptionKeys = Object.keys(o);\n\t\t\tfor (x = 0; x < optionKeys.length; x++) {\n\t\t\t\tif (/^-W\\d{3}$/g.test(optionKeys[x])) {\n\t\t\t\t\tignored[optionKeys[x].slice(1)] = true;\n\t\t\t\t} else {\n\t\t\t\t\tnewOptionObj[optionKeys[x]] = o[optionKeys[x]];\n\n\t\t\t\t\tif (optionKeys[x] === \"newcap\" && o[optionKeys[x]] === false)\n\t\t\t\t\t\tnewOptionObj[\"(explicitNewcap)\"] = true;\n\n\t\t\t\t\tif (optionKeys[x] === \"indent\")\n\t\t\t\t\t\tnewOptionObj[\"(explicitIndent)\"] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstate.option = newOptionObj;\n\n\t\tstate.option.indent = state.option.indent || 4;\n\t\tstate.option.maxerr = state.option.maxerr || 50;\n\n\t\tindent = 1;\n\t\tglobal = Object.create(predefined);\n\t\tscope = global;\n\t\tfunct = {\n\t\t\t\"(global)\": true,\n\t\t\t\"(name)\":\t \"(global)\",\n\t\t\t\"(scope)\":\t scope,\n\t\t\t\"(breakage)\": 0,\n\t\t\t\"(loopage)\": 0,\n\t\t\t\"(tokens)\": {},\n\t\t\t\"(metrics)\": createMetrics(state.tokens.next)\n\t\t};\n\t\tfunctions = [funct];\n\t\turls = [];\n\t\tstack = null;\n\t\tmember = {};\n\t\tmembersOnly = null;\n\t\timplied = {};\n\t\tinblock = false;\n\t\tlookahead = [];\n\t\twarnings = 0;\n\t\tunuseds = [];\n\n\t\tif (!isString(s) && !Array.isArray(s)) {\n\t\t\terrorAt(\"E004\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isString(s) && /^\\s*$/g.test(s)) {\n\t\t\terrorAt(\"E005\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (s.length === 0) {\n\t\t\terrorAt(\"E005\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tvar api = {\n\t\t\tget isJSON() {\n\t\t\t\treturn state.jsonMode;\n\t\t\t},\n\n\t\t\tgetOption: function (name) {\n\t\t\t\treturn state.option[name] || null;\n\t\t\t},\n\n\t\t\tgetCache: function (name) {\n\t\t\t\treturn state.cache[name];\n\t\t\t},\n\n\t\t\tsetCache: function (name, value) {\n\t\t\t\tstate.cache[name] = value;\n\t\t\t},\n\n\t\t\twarn: function (code, data) {\n\t\t\t\twarningAt.apply(null, [ code, data.line, data.char ].concat(data.data));\n\t\t\t},\n\n\t\t\ton: function (names, listener) {\n\t\t\t\tnames.split(\" \").forEach(function (name) {\n\t\t\t\t\temitter.on(name, listener);\n\t\t\t\t}.bind(this));\n\t\t\t}\n\t\t};\n\n\t\temitter.removeAllListeners();\n\t\t(extraModules || []).forEach(function (func) {\n\t\t\tfunc(api);\n\t\t});\n\n\t\tstate.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax[\"(begin)\"];\n\n\t\tlex = new Lexer(s);\n\n\t\tlex.on(\"warning\", function (ev) {\n\t\t\twarningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"error\", function (ev) {\n\t\t\terrorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"fatal\", function (ev) {\n\t\t\tquit(\"E041\", ev.line, ev.from);\n\t\t});\n\n\t\tlex.on(\"Identifier\", function (ev) {\n\t\t\temitter.emit(\"Identifier\", ev);\n\t\t});\n\n\t\tlex.on(\"String\", function (ev) {\n\t\t\temitter.emit(\"String\", ev);\n\t\t});\n\n\t\tlex.on(\"Number\", function (ev) {\n\t\t\temitter.emit(\"Number\", ev);\n\t\t});\n\n\t\tlex.start();\n\n\t\t// Check options\n\t\tfor (var name in o) {\n\t\t\tif (_.has(o, name)) {\n\t\t\t\tcheckOption(name, state.tokens.curr);\n\t\t\t}\n\t\t}\n\n\t\tassume();\n\n\t\t// combine the passed globals after we've assumed all our options\n\t\tcombine(predefined, g || {});\n\n\t\t//reset values\n\t\tcomma.first = true;\n\n\t\ttry {\n\t\t\tadvance();\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"{\":\n\t\t\tcase \"[\":\n\t\t\t\tstate.option.laxbreak = true;\n\t\t\t\tstate.jsonMode = true;\n\t\t\t\tjsonValue();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdirectives();\n\n\t\t\t\tif (state.directive[\"use strict\"]) {\n\t\t\t\t\tif (!state.option.globalstrict && !state.option.node) {\n\t\t\t\t\t\twarning(\"W097\", state.tokens.prev);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstatements();\n\t\t\t}\n\t\t\tadvance((state.tokens.next && state.tokens.next.value !== \".\")\t? \"(end)\" : undefined);\n\n\t\t\tvar markDefined = function (name, context) {\n\t\t\t\tdo {\n\t\t\t\t\tif (typeof context[name] === \"string\") {\n\t\t\t\t\t\t// JSHINT marks unused variables as 'unused' and\n\t\t\t\t\t\t// unused function declaration as 'unction'. This\n\t\t\t\t\t\t// code changes such instances back 'var' and\n\t\t\t\t\t\t// 'closure' so that the code in JSHINT.data()\n\t\t\t\t\t\t// doesn't think they're unused.\n\n\t\t\t\t\t\tif (context[name] === \"unused\")\n\t\t\t\t\t\t\tcontext[name] = \"var\";\n\t\t\t\t\t\telse if (context[name] === \"unction\")\n\t\t\t\t\t\t\tcontext[name] = \"closure\";\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext = context[\"(context)\"];\n\t\t\t\t} while (context);\n\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tvar clearImplied = function (name, line) {\n\t\t\t\tif (!implied[name])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar newImplied = [];\n\t\t\t\tfor (var i = 0; i < implied[name].length; i += 1) {\n\t\t\t\t\tif (implied[name][i] !== line)\n\t\t\t\t\t\tnewImplied.push(implied[name][i]);\n\t\t\t\t}\n\n\t\t\t\tif (newImplied.length === 0)\n\t\t\t\t\tdelete implied[name];\n\t\t\t\telse\n\t\t\t\t\timplied[name] = newImplied;\n\t\t\t};\n\n\t\t\tvar warnUnused = function (name, tkn) {\n\t\t\t\tvar line = tkn.line;\n\t\t\t\tvar chr = tkn.character;\n\n\t\t\t\tif (state.option.unused)\n\t\t\t\t\twarningAt(\"W098\", line, chr, name);\n\n\t\t\t\tunuseds.push({\n\t\t\t\t\tname: name,\n\t\t\t\t\tline: line,\n\t\t\t\t\tcharacter: chr\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tvar checkUnused = function (func, key) {\n\t\t\t\tvar type = func[key];\n\t\t\t\tvar tkn = func[\"(tokens)\"][key];\n\n\t\t\t\tif (key.charAt(0) === \"(\")\n\t\t\t\t\treturn;\n\n\t\t\t\tif (type !== \"unused\" && type !== \"unction\")\n\t\t\t\t\treturn;\n\n\t\t\t\t// Params are checked separately from other variables.\n\t\t\t\tif (func[\"(params)\"] && func[\"(params)\"].indexOf(key) !== -1)\n\t\t\t\t\treturn;\n\n\t\t\t\t// Variable is in global scope and defined as exported.\n\t\t\t\tif (func[\"(global)\"] && _.has(exported, key)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twarnUnused(key, tkn);\n\t\t\t};\n\n\t\t\t// Check queued 'x is not defined' instances to see if they're still undefined.\n\t\t\tfor (i = 0; i < JSHINT.undefs.length; i += 1) {\n\t\t\t\tk = JSHINT.undefs[i].slice(0);\n\n\t\t\t\tif (markDefined(k[2].value, k[0])) {\n\t\t\t\t\tclearImplied(k[2].value, k[2].line);\n\t\t\t\t} else if (state.option.undef) {\n\t\t\t\t\twarning.apply(warning, k.slice(1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunctions.forEach(function (func) {\n\t\t\t\tif (func[\"(ignoreUnused)\"]) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in func) {\n\t\t\t\t\tif (_.has(func, key)) {\n\t\t\t\t\t\tcheckUnused(func, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!func[\"(params)\"])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar params = func[\"(params)\"].slice();\n\t\t\t\tvar param = params.pop();\n\t\t\t\tvar type;\n\n\t\t\t\twhile (param) {\n\t\t\t\t\ttype = func[param];\n\n\t\t\t\t\t// 'undefined' is a special case for (function (window, undefined) { ... })();\n\t\t\t\t\t// patterns.\n\n\t\t\t\t\tif (param === \"undefined\")\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (type !== \"unused\" && type !== \"unction\")\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\twarnUnused(param, func[\"(tokens)\"][param]);\n\t\t\t\t\tparam = params.pop();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfor (var key in declared) {\n\t\t\t\tif (_.has(declared, key) && !_.has(global, key)) {\n\t\t\t\t\twarnUnused(key, declared[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tif (err && err.name === \"JSHintError\") {\n\t\t\t\tvar nt = state.tokens.next || {};\n\t\t\t\tJSHINT.errors.push({\n\t\t\t\t\tscope : \"(main)\",\n\t\t\t\t\traw : err.raw,\n\t\t\t\t\treason : err.message,\n\t\t\t\t\tline : err.line || nt.line,\n\t\t\t\t\tcharacter : err.character || nt.from\n\t\t\t\t}, null);\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\n\t\t// Loop over the listed \"internals\", and check them as well.\n\n\t\tif (JSHINT.scope === \"(main)\") {\n\t\t\to = o || {};\n\n\t\t\tfor (i = 0; i < JSHINT.internals.length; i += 1) {\n\t\t\t\tk = JSHINT.internals[i];\n\t\t\t\to.scope = k.elem;\n\t\t\t\titself(k.value, o, g);\n\t\t\t}\n\t\t}\n\n\t\treturn JSHINT.errors.length === 0;\n\t};\n\n\t// Modules.\n\titself.addModule = function (func) {\n\t\textraModules.push(func);\n\t};\n\n\titself.addModule(style.register);\n\n\t// Data summary.\n\titself.data = function () {\n\t\tvar data = {\n\t\t\tfunctions: [],\n\t\t\toptions: state.option\n\t\t};\n\t\tvar implieds = [];\n\t\tvar members = [];\n\t\tvar fu, f, i, j, n, globals;\n\n\t\tif (itself.errors.length) {\n\t\t\tdata.errors = itself.errors;\n\t\t}\n\n\t\tif (state.jsonMode) {\n\t\t\tdata.json = true;\n\t\t}\n\n\t\tfor (n in implied) {\n\t\t\tif (_.has(implied, n)) {\n\t\t\t\timplieds.push({\n\t\t\t\t\tname: n,\n\t\t\t\t\tline: implied[n]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (implieds.length > 0) {\n\t\t\tdata.implieds = implieds;\n\t\t}\n\n\t\tif (urls.length > 0) {\n\t\t\tdata.urls = urls;\n\t\t}\n\n\t\tglobals = Object.keys(scope);\n\t\tif (globals.length > 0) {\n\t\t\tdata.globals = globals;\n\t\t}\n\n\t\tfor (i = 1; i < functions.length; i += 1) {\n\t\t\tf = functions[i];\n\t\t\tfu = {};\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tfu[functionicity[j]] = [];\n\t\t\t}\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tif (fu[functionicity[j]].length === 0) {\n\t\t\t\t\tdelete fu[functionicity[j]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfu.name = f[\"(name)\"];\n\t\t\tfu.param = f[\"(params)\"];\n\t\t\tfu.line = f[\"(line)\"];\n\t\t\tfu.character = f[\"(character)\"];\n\t\t\tfu.last = f[\"(last)\"];\n\t\t\tfu.lastcharacter = f[\"(lastcharacter)\"];\n\t\t\tdata.functions.push(fu);\n\t\t}\n\n\t\tif (unuseds.length > 0) {\n\t\t\tdata.unused = unuseds;\n\t\t}\n\n\t\tmembers = [];\n\t\tfor (n in member) {\n\t\t\tif (typeof member[n] === \"number\") {\n\t\t\t\tdata.member = member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t};\n\n\titself.jshint = itself;\n\n\treturn itself;\n}());\n\n// Make JSHINT a Node module, if possible.\nif (typeof exports === \"object\" && exports) {\n\texports.JSHINT = JSHINT;\n}\n\n//@ sourceURL=/src/stable/jshint.js" -)); -require("/src/stable/jshint.js"); - -/*jshint boss: true, rhino: true, unused: true, undef: true, white: true, quotmark: double */ - -(function (args) { - "use strict"; - - var JSHINT = require("/src/stable/jshint.js").JSHINT; - - var filenames = []; - var optstr; // arg1=val1,arg2=val2,... - var predef; // global1=true,global2,global3,... - var opts = {}; - var retval = 0; - - args.forEach(function (arg) { - if (arg.indexOf("=") > -1) { - if (!optstr) { - // First time it's the options. - optstr = arg; - } else { - predef = arg; - } - - return; - } - - if (optstr) { - predef = arg; - return; - } - - filenames.push(arg); - }); - - if (filenames.length === 0) { - print("Usage: jshint.js file.js"); - quit(1); - } - - if (optstr) { - optstr.split(",").forEach(function (arg) { - var o = arg.split("="); - if (o[0] === "indent") { - opts[o[0]] = parseInt(o[1], 10); - } else { - opts[o[0]] = (function (ov) { - switch (ov) { - case "true": - return true; - case "false": - return false; - default: - return ov; - } - }(o[1])); - } - }); - } - - if (predef) { - opts.predef = {}; - - predef.split(",").forEach(function (arg) { - var global = arg.split("="); - opts.predef[global[0]] = global[1] === "true" ? true : false; - }); - } - - filenames.forEach(function (name) { - var input = readFile(name); - - if (!input) { - print("jshint: Couldn't open file " + name); - quit(1); - } - - if (!JSHINT(input, opts)) { - for (var i = 0, err; err = JSHINT.errors[i]; i += 1) { - print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")"); - print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); - print(""); - } - retval = 1; - } - }); - - quit(retval); -}(arguments)); diff --git a/deploy/core/node_modules/jshint/dist/jshint.js b/deploy/core/node_modules/jshint/dist/jshint.js deleted file mode 100644 index e624c1855..000000000 --- a/deploy/core/node_modules/jshint/dist/jshint.js +++ /dev/null @@ -1,234 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var cached = require.cache[resolved]; - var res = cached? cached.exports : mod(); - return res; -}; - -require.paths = []; -require.modules = {}; -require.cache = {}; -require.extensions = [".js",".coffee",".json"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - x = path.normalize(x); - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = path.normalize(x + '/package.json'); - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key); - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -(function () { - var process = {}; - var global = typeof window !== 'undefined' ? window : {}; - var definedProcess = false; - - require.define = function (filename, fn) { - if (!definedProcess && require.modules.__browserify_process) { - process = require.modules.__browserify_process(); - definedProcess = true; - } - - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - var requiredModule = require(file, dirname); - var cached = require.cache[require.resolve(file, dirname)]; - - if (cached && cached.parent === null) { - cached.parent = module_; - } - - return requiredModule; - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - require_.cache = require.cache; - var module_ = { - id : filename, - filename: filename, - exports : {}, - loaded : false, - parent: null - }; - - require.modules[filename] = function () { - require.cache[filename] = module_; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename, - process, - global - ); - module_.loaded = true; - return module_.exports; - }; - }; -})(); - - -require.define("path",Function(['require','module','exports','__dirname','__filename','process','global'],"function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path" -)); - -require.define("__browserify_process",Function(['require','module','exports','__dirname','__filename','process','global'],"var process = module.exports = {};\n\nprocess.nextTick = (function () {\n var canSetImmediate = typeof window !== 'undefined'\n && window.setImmediate;\n var canPost = typeof window !== 'undefined'\n && window.postMessage && window.addEventListener\n ;\n\n if (canSetImmediate) {\n return window.setImmediate;\n }\n\n if (canPost) {\n var queue = [];\n window.addEventListener('message', function (ev) {\n if (ev.source === window && ev.data === 'browserify-tick') {\n ev.stopPropagation();\n if (queue.length > 0) {\n var fn = queue.shift();\n fn();\n }\n }\n }, true);\n\n return function nextTick(fn) {\n queue.push(fn);\n window.postMessage('browserify-tick', '*');\n };\n }\n\n return function nextTick(fn) {\n setTimeout(fn, 0);\n };\n})();\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\n\nprocess.binding = function (name) {\n if (name === 'evals') return (require)('vm')\n else throw new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n process.cwd = function () { return cwd };\n process.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\n//@ sourceURL=__browserify_process" -)); - -require.define("/node_modules/underscore/package.json",Function(['require','module','exports','__dirname','__filename','process','global'],"module.exports = {\"main\":\"underscore.js\"}\n//@ sourceURL=/node_modules/underscore/package.json" -)); - -require.define("/node_modules/underscore/underscore.js",Function(['require','module','exports','__dirname','__filename','process','global'],"// Underscore.js 1.4.0\n// http://underscorejs.org\n// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` in the browser, or `global` on the server.\n var root = this;\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Establish the object that gets returned to break out of a loop iteration.\n var breaker = {};\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n concat = ArrayProto.concat,\n unshift = ArrayProto.unshift,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var\n nativeForEach = ArrayProto.forEach,\n nativeMap = ArrayProto.map,\n nativeReduce = ArrayProto.reduce,\n nativeReduceRight = ArrayProto.reduceRight,\n nativeFilter = ArrayProto.filter,\n nativeEvery = ArrayProto.every,\n nativeSome = ArrayProto.some,\n nativeIndexOf = ArrayProto.indexOf,\n nativeLastIndexOf = ArrayProto.lastIndexOf,\n nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeBind = FuncProto.bind;\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for the old `require()` API. If we're in\n // the browser, add `_` as a global object via a string identifier,\n // for Closure Compiler \"advanced\" mode.\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root['_'] = _;\n }\n\n // Current version.\n _.VERSION = '1.4.0';\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles objects with the built-in `forEach`, arrays, and raw objects.\n // Delegates to **ECMAScript 5**'s native `forEach` if available.\n var each = _.each = _.forEach = function(obj, iterator, context) {\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n for (var key in obj) {\n if (_.has(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) return;\n }\n }\n }\n };\n\n // Return the results of applying the iterator to each element.\n // Delegates to **ECMAScript 5**'s native `map` if available.\n _.map = _.collect = function(obj, iterator, context) {\n var results = [];\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.\n _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (nativeReduce && obj.reduce === nativeReduce) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);\n }\n each(obj, function(value, index, list) {\n if (!initial) {\n memo = value;\n initial = true;\n } else {\n memo = iterator.call(context, memo, value, index, list);\n }\n });\n if (!initial) throw new TypeError('Reduce of empty array with no initial value');\n return memo;\n };\n\n // The right-associative version of reduce, also known as `foldr`.\n // Delegates to **ECMAScript 5**'s native `reduceRight` if available.\n _.reduceRight = _.foldr = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {\n if (context) iterator = _.bind(iterator, context);\n return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);\n }\n var length = obj.length;\n if (length !== +length) {\n var keys = _.keys(obj);\n length = keys.length;\n }\n each(obj, function(value, index, list) {\n index = keys ? keys[--length] : --length;\n if (!initial) {\n memo = obj[index];\n initial = true;\n } else {\n memo = iterator.call(context, memo, obj[index], index, list);\n }\n });\n if (!initial) throw new TypeError('Reduce of empty array with no initial value');\n return memo;\n };\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, iterator, context) {\n var result;\n any(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) {\n result = value;\n return true;\n }\n });\n return result;\n };\n\n // Return all the elements that pass a truth test.\n // Delegates to **ECMAScript 5**'s native `filter` if available.\n // Aliased as `select`.\n _.filter = _.select = function(obj, iterator, context) {\n var results = [];\n if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);\n each(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) results[results.length] = value;\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, iterator, context) {\n var results = [];\n each(obj, function(value, index, list) {\n if (!iterator.call(context, value, index, list)) results[results.length] = value;\n });\n return results;\n };\n\n // Determine whether all of the elements match a truth test.\n // Delegates to **ECMAScript 5**'s native `every` if available.\n // Aliased as `all`.\n _.every = _.all = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = true;\n if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);\n each(obj, function(value, index, list) {\n if (!(result = result && iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Delegates to **ECMAScript 5**'s native `some` if available.\n // Aliased as `any`.\n var any = _.some = _.any = function(obj, iterator, context) {\n iterator || (iterator = _.identity);\n var result = false;\n if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);\n each(obj, function(value, index, list) {\n if (result || (result = iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n };\n\n // Determine if the array or object contains a given value (using `===`).\n // Aliased as `include`.\n _.contains = _.include = function(obj, target) {\n var found = false;\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;\n found = any(obj, function(value) {\n return value === target;\n });\n return found;\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = function(obj, method) {\n var args = slice.call(arguments, 2);\n return _.map(obj, function(value) {\n return (_.isFunction(method) ? method : value[method]).apply(value, args);\n });\n };\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, function(value){ return value[key]; });\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // with specific `key:value` pairs.\n _.where = function(obj, attrs) {\n if (_.isEmpty(attrs)) return [];\n return _.filter(obj, function(value) {\n for (var key in attrs) {\n if (attrs[key] !== value[key]) return false;\n }\n return true;\n });\n };\n\n // Return the maximum element or (element-based computation).\n // Can't optimize arrays of integers longer than 65,535 elements.\n // See: https://bugs.webkit.org/show_bug.cgi?id=80797\n _.max = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.max.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return -Infinity;\n var result = {computed : -Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed >= result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iterator, context) {\n if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {\n return Math.min.apply(Math, obj);\n }\n if (!iterator && _.isEmpty(obj)) return Infinity;\n var result = {computed : Infinity};\n each(obj, function(value, index, list) {\n var computed = iterator ? iterator.call(context, value, index, list) : value;\n computed < result.computed && (result = {value : value, computed : computed});\n });\n return result.value;\n };\n\n // Shuffle an array.\n _.shuffle = function(obj) {\n var rand;\n var index = 0;\n var shuffled = [];\n each(obj, function(value) {\n rand = _.random(index++);\n shuffled[index - 1] = shuffled[rand];\n shuffled[rand] = value;\n });\n return shuffled;\n };\n\n // An internal function to generate lookup iterators.\n var lookupIterator = function(value) {\n return _.isFunction(value) ? value : function(obj){ return obj[value]; };\n };\n\n // Sort the object's values by a criterion produced by an iterator.\n _.sortBy = function(obj, value, context) {\n var iterator = lookupIterator(value);\n return _.pluck(_.map(obj, function(value, index, list) {\n return {\n value : value,\n index : index,\n criteria : iterator.call(context, value, index, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index < right.index ? -1 : 1;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(obj, value, context, behavior) {\n var result = {};\n var iterator = lookupIterator(value);\n each(obj, function(value, index) {\n var key = iterator.call(context, value, index, obj);\n behavior(result, key, value);\n });\n return result;\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key, value) {\n (_.has(result, key) ? result[key] : (result[key] = [])).push(value);\n });\n };\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = function(obj, value, context) {\n return group(obj, value, context, function(result, key, value) {\n if (!_.has(result, key)) result[key] = 0;\n result[key]++;\n });\n };\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iterator, context) {\n iterator = iterator == null ? _.identity : lookupIterator(iterator);\n var value = iterator.call(context, obj);\n var low = 0, high = array.length;\n while (low < high) {\n var mid = (low + high) >>> 1;\n iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;\n }\n return low;\n };\n\n // Safely convert anything iterable into a real, live array.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (obj.length === +obj.length) return slice.call(obj);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;\n };\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n return (n != null) && !guard ? slice.call(array, 0, n) : array[0];\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N. The **guard** check allows it to work with\n // `_.map`.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array. The **guard** check allows it to work with `_.map`.\n _.last = function(array, n, guard) {\n if ((n != null) && !guard) {\n return slice.call(array, Math.max(array.length - n, 0));\n } else {\n return array[array.length - 1];\n }\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array. The **guard**\n // check allows it to work with `_.map`.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, (n == null) || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, function(value){ return !!value; });\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, output) {\n each(input, function(value) {\n if (_.isArray(value)) {\n shallow ? push.apply(output, value) : flatten(value, shallow, output);\n } else {\n output.push(value);\n }\n });\n return output;\n };\n\n // Return a completely flattened version of an array.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, []);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = function(array) {\n return _.difference(array, slice.call(arguments, 1));\n };\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iterator, context) {\n var initial = iterator ? _.map(array, iterator, context) : array;\n var results = [];\n var seen = [];\n each(initial, function(value, index) {\n if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {\n seen.push(value);\n results.push(array[index]);\n }\n });\n return results;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = function() {\n return _.uniq(concat.apply(ArrayProto, arguments));\n };\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var rest = slice.call(arguments, 1);\n return _.filter(_.uniq(array), function(item) {\n return _.every(rest, function(other) {\n return _.indexOf(other, item) >= 0;\n });\n });\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = function(array) {\n var rest = concat.apply(ArrayProto, slice.call(arguments, 1));\n return _.filter(array, function(value){ return !_.contains(rest, value); });\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = function() {\n var args = slice.call(arguments);\n var length = _.max(_.pluck(args, 'length'));\n var results = new Array(length);\n for (var i = 0; i < length; i++) {\n results[i] = _.pluck(args, \"\" + i);\n }\n return results;\n };\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values.\n _.object = function(list, values) {\n var result = {};\n for (var i = 0, l = list.length; i < l; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),\n // we need this function. Return the position of the first occurrence of an\n // item in an array, or -1 if the item is not included in the array.\n // Delegates to **ECMAScript 5**'s native `indexOf` if available.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = function(array, item, isSorted) {\n var i = 0, l = array.length;\n if (isSorted) {\n if (typeof isSorted == 'number') {\n i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);\n } else {\n i = _.sortedIndex(array, item);\n return array[i] === item ? i : -1;\n }\n }\n if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);\n for (; i < l; i++) if (array[i] === item) return i;\n return -1;\n };\n\n // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.\n _.lastIndexOf = function(array, item, fromIndex) {\n if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item, fromIndex);\n var i = (fromIndex != null ? fromIndex : array.length);\n while (i--) if (array[i] === item) return i;\n return -1;\n };\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (arguments.length <= 1) {\n stop = start || 0;\n start = 0;\n }\n step = arguments[2] || 1;\n\n var len = Math.max(Math.ceil((stop - start) / step), 0);\n var idx = 0;\n var range = new Array(len);\n\n while(idx < len) {\n range[idx++] = start;\n start += step;\n }\n\n return range;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Reusable constructor function for prototype setting.\n var ctor = function(){};\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Binding with arguments is also known as `curry`.\n // Delegates to **ECMAScript 5**'s native `Function.bind` if available.\n // We check for `func.bind` first, to fail fast when `func` is undefined.\n _.bind = function bind(func, context) {\n var bound, args;\n if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n if (!_.isFunction(func)) throw new TypeError;\n args = slice.call(arguments, 2);\n return bound = function() {\n if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));\n ctor.prototype = func.prototype;\n var self = new ctor;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) return result;\n return self;\n };\n };\n\n // Bind all of an object's methods to that object. Useful for ensuring that\n // all callbacks defined on an object belong to it.\n _.bindAll = function(obj) {\n var funcs = slice.call(arguments, 1);\n if (funcs.length == 0) funcs = _.functions(obj);\n each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });\n return obj;\n };\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memo = {};\n hasher || (hasher = _.identity);\n return function() {\n var key = hasher.apply(this, arguments);\n return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));\n };\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = function(func, wait) {\n var args = slice.call(arguments, 2);\n return setTimeout(function(){ return func.apply(null, args); }, wait);\n };\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = function(func) {\n return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));\n };\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time.\n _.throttle = function(func, wait) {\n var context, args, timeout, throttling, more, result;\n var whenDone = _.debounce(function(){ more = throttling = false; }, wait);\n return function() {\n context = this; args = arguments;\n var later = function() {\n timeout = null;\n if (more) {\n result = func.apply(context, args);\n }\n whenDone();\n };\n if (!timeout) timeout = setTimeout(later, wait);\n if (throttling) {\n more = true;\n } else {\n throttling = true;\n result = func.apply(context, args);\n }\n whenDone();\n return result;\n };\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, result;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(context, args);\n return result;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = function(func) {\n var ran = false, memo;\n return function() {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return function() {\n var args = [func];\n push.apply(args, arguments);\n return wrapper.apply(this, args);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var funcs = arguments;\n return function() {\n var args = arguments;\n for (var i = funcs.length - 1; i >= 0; i--) {\n args = [funcs[i].apply(this, args)];\n }\n return args[0];\n };\n };\n\n // Returns a function that will only be executed after being called N times.\n _.after = function(times, func) {\n if (times <= 0) return func();\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Object Functions\n // ----------------\n\n // Retrieve the names of an object's properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`\n _.keys = nativeKeys || function(obj) {\n if (obj !== Object(obj)) throw new TypeError('Invalid object');\n var keys = [];\n for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var values = [];\n for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);\n return values;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n _.pairs = function(obj) {\n var pairs = [];\n for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n obj[prop] = source[prop];\n }\n });\n return obj;\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n each(keys, function(key) {\n if (key in obj) copy[key] = obj[key];\n });\n return copy;\n };\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = function(obj) {\n var copy = {};\n var keys = concat.apply(ArrayProto, slice.call(arguments, 1));\n for (var key in obj) {\n if (!_.contains(keys, key)) copy[key] = obj[key];\n }\n return copy;\n };\n\n // Fill in a given object with default properties.\n _.defaults = function(obj) {\n each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n if (obj[prop] == null) obj[prop] = source[prop];\n }\n });\n return obj;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Internal recursive comparison function for `isEqual`.\n var eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.\n if (a === b) return a !== 0 || 1 / a == 1 / b;\n // A strict comparison is necessary because `null == undefined`.\n if (a == null || b == null) return a === b;\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className != toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, dates, and booleans are compared by value.\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return a == String(b);\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for\n // other numeric values.\n return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a == +b;\n // RegExps are compared by their source patterns and flags.\n case '[object RegExp]':\n return a.source == b.source &&\n a.global == b.global &&\n a.multiline == b.multiline &&\n a.ignoreCase == b.ignoreCase;\n }\n if (typeof a != 'object' || typeof b != 'object') return false;\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] == a) return bStack[length] == b;\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n var size = 0, result = true;\n // Recursively compare objects and arrays.\n if (className == '[object Array]') {\n // Compare array lengths to determine if a deep comparison is necessary.\n size = a.length;\n result = size == b.length;\n if (result) {\n // Deep compare the contents, ignoring non-numeric properties.\n while (size--) {\n if (!(result = eq(a[size], b[size], aStack, bStack))) break;\n }\n }\n } else {\n // Objects with different constructors are not equivalent, but `Object`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&\n _.isFunction(bCtor) && (bCtor instanceof bCtor))) {\n return false;\n }\n // Deep compare objects.\n for (var key in a) {\n if (_.has(a, key)) {\n // Count the expected number of properties.\n size++;\n // Deep compare each member.\n if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;\n }\n }\n // Ensure that both objects contain the same number of properties.\n if (result) {\n for (key in b) {\n if (_.has(b, key) && !(size--)) break;\n }\n result = !size;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return result;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b, [], []);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;\n for (var key in obj) if (_.has(obj, key)) return false;\n return true;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) == '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n return obj === Object(obj);\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.\n each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) == '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return !!(obj && _.has(obj, 'callee'));\n };\n }\n\n // Optimize `isFunction` if appropriate.\n if (typeof (/./) !== 'function') {\n _.isFunction = function(obj) {\n return typeof obj === 'function';\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return _.isNumber(obj) && isFinite(obj);\n };\n\n // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n _.isNaN = function(obj) {\n return _.isNumber(obj) && obj != +obj;\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) == '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, key) {\n return hasOwnProperty.call(obj, key);\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iterators.\n _.identity = function(value) {\n return value;\n };\n\n // Run a function **n** times.\n _.times = function(n, iterator, context) {\n for (var i = 0; i < n; i++) iterator.call(context, i);\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + (0 | Math.random() * (max - min + 1));\n };\n\n // List of HTML entities for escaping.\n var entityMap = {\n escape: {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n }\n };\n entityMap.unescape = _.invert(entityMap.escape);\n\n // Regexes containing the keys and values listed immediately above.\n var entityRegexes = {\n escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),\n unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')\n };\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n _.each(['escape', 'unescape'], function(method) {\n _[method] = function(string) {\n if (string == null) return '';\n return ('' + string).replace(entityRegexes[method], function(match) {\n return entityMap[method][match];\n });\n };\n });\n\n // If the value of the named property is a function then invoke it;\n // otherwise, return it.\n _.result = function(object, property) {\n if (object == null) return null;\n var value = object[property];\n return _.isFunction(value) ? value.call(object) : value;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n each(_.functions(obj), function(name){\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return result.call(this, func.apply(_, args));\n };\n });\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = idCounter++;\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate : /<%([\\s\\S]+?)%>/g,\n interpolate : /<%=([\\s\\S]+?)%>/g,\n escape : /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\t': 't',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escaper = /\\\\|'|\\r|\\n|\\t|\\u2028|\\u2029/g;\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n _.template = function(text, data, settings) {\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = new RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset)\n .replace(escaper, function(match) { return '\\\\' + escapes[match]; });\n source +=\n escape ? \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\" :\n interpolate ? \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\" :\n evaluate ? \"';\\n\" + evaluate + \"\\n__p+='\" : '';\n index = offset + match.length;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + \"return __p;\\n\";\n\n try {\n var render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n if (data) return render(data, _);\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled function source as a convenience for precompilation.\n template.source = 'function(' + (settings.variable || 'obj') + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function, which will delegate to the wrapper.\n _.chain = function(obj) {\n return _(obj).chain();\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var result = function(obj) {\n return this._chain ? _(obj).chain() : obj;\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];\n return result.call(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return result.call(this, method.apply(this._wrapped, arguments));\n };\n });\n\n _.extend(_.prototype, {\n\n // Start chaining a wrapped Underscore object.\n chain: function() {\n this._chain = true;\n return this;\n },\n\n // Extracts the result from a wrapped and chained object.\n value: function() {\n return this._wrapped;\n }\n\n });\n\n}).call(this);\n\n//@ sourceURL=/node_modules/underscore/underscore.js" -)); - -require.define("events",Function(['require','module','exports','__dirname','__filename','process','global'],"if (!process.EventEmitter) process.EventEmitter = function () {};\n\nvar EventEmitter = exports.EventEmitter = process.EventEmitter;\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\n\n// By default EventEmitters will print a warning if more than\n// 10 listeners are added to it. This is a useful default which\n// helps finding memory leaks.\n//\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nvar defaultMaxListeners = 10;\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!this._events) this._events = {};\n this._events.maxListeners = n;\n};\n\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n\n // Check for listener leak\n if (!this._events[type].warned) {\n var m;\n if (this._events.maxListeners !== undefined) {\n m = this._events.maxListeners;\n } else {\n m = defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n console.trace();\n }\n }\n\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = list.indexOf(listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n\n//@ sourceURL=events" -)); - -require.define("/src/shared/vars.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\n// Identifiers provided by the ECMAScript standard.\n\nexports.reservedVars = {\n\targuments : false,\n\tNaN : false\n};\n\nexports.ecmaIdentifiers = {\n\tArray : false,\n\tBoolean : false,\n\tDate : false,\n\tdecodeURI : false,\n\tdecodeURIComponent : false,\n\tencodeURI : false,\n\tencodeURIComponent : false,\n\tError : false,\n\t\"eval\" : false,\n\tEvalError : false,\n\tFunction : false,\n\thasOwnProperty : false,\n\tisFinite : false,\n\tisNaN : false,\n\tJSON : false,\n\tMath : false,\n\tMap : false,\n\tNumber : false,\n\tObject : false,\n\tparseInt : false,\n\tparseFloat : false,\n\tRangeError : false,\n\tReferenceError : false,\n\tRegExp : false,\n\tSet : false,\n\tString : false,\n\tSyntaxError : false,\n\tTypeError : false,\n\tURIError : false,\n\tWeakMap : false\n};\n\n// Global variables commonly provided by a web browser environment.\n\nexports.browser = {\n\tArrayBuffer : false,\n\tArrayBufferView : false,\n\tAudio : false,\n\tBlob : false,\n\taddEventListener : false,\n\tapplicationCache : false,\n\tatob : false,\n\tblur : false,\n\tbtoa : false,\n\tclearInterval : false,\n\tclearTimeout : false,\n\tclose : false,\n\tclosed : false,\n\tDataView : false,\n\tDOMParser : false,\n\tdefaultStatus : false,\n\tdocument : false,\n\tElement : false,\n\tevent : false,\n\tFileReader : false,\n\tFloat32Array : false,\n\tFloat64Array : false,\n\tFormData : false,\n\tfocus : false,\n\tframes : false,\n\tgetComputedStyle : false,\n\tHTMLElement : false,\n\tHTMLAnchorElement : false,\n\tHTMLBaseElement : false,\n\tHTMLBlockquoteElement: false,\n\tHTMLBodyElement : false,\n\tHTMLBRElement : false,\n\tHTMLButtonElement : false,\n\tHTMLCanvasElement : false,\n\tHTMLDirectoryElement : false,\n\tHTMLDivElement : false,\n\tHTMLDListElement : false,\n\tHTMLFieldSetElement : false,\n\tHTMLFontElement : false,\n\tHTMLFormElement : false,\n\tHTMLFrameElement : false,\n\tHTMLFrameSetElement : false,\n\tHTMLHeadElement : false,\n\tHTMLHeadingElement : false,\n\tHTMLHRElement : false,\n\tHTMLHtmlElement : false,\n\tHTMLIFrameElement : false,\n\tHTMLImageElement : false,\n\tHTMLInputElement : false,\n\tHTMLIsIndexElement : false,\n\tHTMLLabelElement : false,\n\tHTMLLayerElement : false,\n\tHTMLLegendElement : false,\n\tHTMLLIElement : false,\n\tHTMLLinkElement : false,\n\tHTMLMapElement : false,\n\tHTMLMenuElement : false,\n\tHTMLMetaElement : false,\n\tHTMLModElement : false,\n\tHTMLObjectElement : false,\n\tHTMLOListElement : false,\n\tHTMLOptGroupElement : false,\n\tHTMLOptionElement : false,\n\tHTMLParagraphElement : false,\n\tHTMLParamElement : false,\n\tHTMLPreElement : false,\n\tHTMLQuoteElement : false,\n\tHTMLScriptElement : false,\n\tHTMLSelectElement : false,\n\tHTMLStyleElement : false,\n\tHTMLTableCaptionElement: false,\n\tHTMLTableCellElement : false,\n\tHTMLTableColElement : false,\n\tHTMLTableElement : false,\n\tHTMLTableRowElement : false,\n\tHTMLTableSectionElement: false,\n\tHTMLTextAreaElement : false,\n\tHTMLTitleElement : false,\n\tHTMLUListElement : false,\n\tHTMLVideoElement : false,\n\thistory : false,\n\tInt16Array : false,\n\tInt32Array : false,\n\tInt8Array : false,\n\tImage : false,\n\tlength : false,\n\tlocalStorage : false,\n\tlocation : false,\n\tMessageChannel : false,\n\tMessageEvent : false,\n\tMessagePort : false,\n\tmoveBy : false,\n\tmoveTo : false,\n\tMutationObserver : false,\n\tname : false,\n\tNode : false,\n\tNodeFilter : false,\n\tnavigator : false,\n\tonbeforeunload : true,\n\tonblur : true,\n\tonerror : true,\n\tonfocus : true,\n\tonload : true,\n\tonresize : true,\n\tonunload : true,\n\topen : false,\n\topenDatabase : false,\n\topener : false,\n\tOption : false,\n\tparent : false,\n\tprint : false,\n\tremoveEventListener : false,\n\tresizeBy : false,\n\tresizeTo : false,\n\tscreen : false,\n\tscroll : false,\n\tscrollBy : false,\n\tscrollTo : false,\n\tsessionStorage : false,\n\tsetInterval : false,\n\tsetTimeout : false,\n\tSharedWorker : false,\n\tstatus : false,\n\ttop : false,\n\tUint16Array : false,\n\tUint32Array : false,\n\tUint8Array : false,\n\tUint8ClampedArray : false,\n\tWebSocket : false,\n\twindow : false,\n\tWorker : false,\n\tXMLHttpRequest : false,\n\tXMLSerializer : false,\n\tXPathEvaluator : false,\n\tXPathException : false,\n\tXPathExpression : false,\n\tXPathNamespace : false,\n\tXPathNSResolver : false,\n\tXPathResult : false\n};\n\nexports.devel = {\n\talert : false,\n\tconfirm: false,\n\tconsole: false,\n\tDebug : false,\n\topera : false,\n\tprompt : false\n};\n\nexports.worker = {\n\timportScripts: true,\n\tpostMessage : true,\n\tself : true\n};\n\n// Widely adopted global names that are not part of ECMAScript standard\nexports.nonstandard = {\n\tescape : false,\n\tunescape: false\n};\n\n// Globals provided by popular JavaScript environments.\n\nexports.couch = {\n\t\"require\" : false,\n\trespond : false,\n\tgetRow : false,\n\temit : false,\n\tsend : false,\n\tstart : false,\n\tsum : false,\n\tlog : false,\n\texports : false,\n\tmodule : false,\n\tprovides : false\n};\n\nexports.node = {\n\t__filename : false,\n\t__dirname : false,\n\tBuffer : false,\n\tDataView : false,\n\tconsole : false,\n\texports : true, // In Node it is ok to exports = module.exports = foo();\n\tGLOBAL : false,\n\tglobal : false,\n\tmodule : false,\n\tprocess : false,\n\trequire : false,\n\tsetTimeout : false,\n\tclearTimeout : false,\n\tsetInterval : false,\n\tclearInterval: false\n};\n\nexports.rhino = {\n\tdefineClass : false,\n\tdeserialize : false,\n\tgc : false,\n\thelp : false,\n\timportPackage: false,\n\t\"java\" : false,\n\tload : false,\n\tloadClass : false,\n\tprint : false,\n\tquit : false,\n\treadFile : false,\n\treadUrl : false,\n\trunCommand : false,\n\tseal : false,\n\tserialize : false,\n\tspawn : false,\n\tsync : false,\n\ttoint32 : false,\n\tversion : false\n};\n\nexports.wsh = {\n\tActiveXObject : true,\n\tEnumerator : true,\n\tGetObject : true,\n\tScriptEngine : true,\n\tScriptEngineBuildVersion : true,\n\tScriptEngineMajorVersion : true,\n\tScriptEngineMinorVersion : true,\n\tVBArray : true,\n\tWSH : true,\n\tWScript : true,\n\tXDomainRequest : true\n};\n\n// Globals provided by popular JavaScript libraries.\n\nexports.dojo = {\n\tdojo : false,\n\tdijit : false,\n\tdojox : false,\n\tdefine\t : false,\n\t\"require\": false\n};\n\nexports.jquery = {\n\t\"$\" : false,\n\tjQuery : false\n};\n\nexports.mootools = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\tAsset : false,\n\tBrowser : false,\n\tChain : false,\n\tClass : false,\n\tColor : false,\n\tCookie : false,\n\tCore : false,\n\tDocument : false,\n\tDomReady : false,\n\tDOMEvent : false,\n\tDOMReady : false,\n\tDrag : false,\n\tElement : false,\n\tElements : false,\n\tEvent : false,\n\tEvents : false,\n\tFx : false,\n\tGroup : false,\n\tHash : false,\n\tHtmlTable : false,\n\tIframe : false,\n\tIframeShim : false,\n\tInputValidator: false,\n\tinstanceOf : false,\n\tKeyboard : false,\n\tLocale : false,\n\tMask : false,\n\tMooTools : false,\n\tNative : false,\n\tOptions : false,\n\tOverText : false,\n\tRequest : false,\n\tScroller : false,\n\tSlick : false,\n\tSlider : false,\n\tSortables : false,\n\tSpinner : false,\n\tSwiff : false,\n\tTips : false,\n\tType : false,\n\ttypeOf : false,\n\tURI : false,\n\tWindow : false\n};\n\nexports.prototypejs = {\n\t\"$\" : false,\n\t\"$$\" : false,\n\t\"$A\" : false,\n\t\"$F\" : false,\n\t\"$H\" : false,\n\t\"$R\" : false,\n\t\"$break\" : false,\n\t\"$continue\" : false,\n\t\"$w\" : false,\n\tAbstract : false,\n\tAjax : false,\n\tClass : false,\n\tEnumerable : false,\n\tElement : false,\n\tEvent : false,\n\tField : false,\n\tForm : false,\n\tHash : false,\n\tInsertion : false,\n\tObjectRange : false,\n\tPeriodicalExecuter: false,\n\tPosition : false,\n\tPrototype : false,\n\tSelector : false,\n\tTemplate : false,\n\tToggle : false,\n\tTry : false,\n\tAutocompleter : false,\n\tBuilder : false,\n\tControl : false,\n\tDraggable : false,\n\tDraggables : false,\n\tDroppables : false,\n\tEffect : false,\n\tSortable : false,\n\tSortableObserver : false,\n\tSound : false,\n\tScriptaculous : false\n};\n\nexports.yui = {\n\tYUI : false,\n\tY : false,\n\tYUI_config: false\n};\n\n\n//@ sourceURL=/src/shared/vars.js" -)); - -require.define("/src/shared/messages.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar _ = require(\"underscore\");\n\nvar errors = {\n\t// JSHint options\n\tE001: \"Bad option: '{a}'.\",\n\tE002: \"Bad option value.\",\n\n\t// JSHint input\n\tE003: \"Expected a JSON value.\",\n\tE004: \"Input is neither a string nor an array of strings.\",\n\tE005: \"Input is empty.\",\n\tE006: \"Unexpected early end of program.\",\n\n\t// Strict mode\n\tE007: \"Missing \\\"use strict\\\" statement.\",\n\tE008: \"Strict violation.\",\n\tE009: \"Option 'validthis' can't be used in a global scope.\",\n\tE010: \"'with' is not allowed in strict mode.\",\n\n\t// Constants\n\tE011: \"const '{a}' has already been declared.\",\n\tE012: \"const '{a}' is initialized to 'undefined'.\",\n\tE013: \"Attempting to override '{a}' which is a constant.\",\n\n\t// Regular expressions\n\tE014: \"A regular expression literal can be confused with '/='.\",\n\tE015: \"Unclosed regular expression.\",\n\tE016: \"Invalid regular expression.\",\n\n\t// Tokens\n\tE017: \"Unclosed comment.\",\n\tE018: \"Unbegun comment.\",\n\tE019: \"Unmatched '{a}'.\",\n\tE020: \"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.\",\n\tE021: \"Expected '{a}' and instead saw '{b}'.\",\n\tE022: \"Line breaking error '{a}'.\",\n\tE023: \"Missing '{a}'.\",\n\tE024: \"Unexpected '{a}'.\",\n\tE025: \"Missing ':' on a case clause.\",\n\tE026: \"Missing '}' to match '{' from line {a}.\",\n\tE027: \"Missing ']' to match '[' form line {a}.\",\n\tE028: \"Illegal comma.\",\n\tE029: \"Unclosed string.\",\n\n\t// Everything else\n\tE030: \"Expected an identifier and instead saw '{a}'.\",\n\tE031: \"Bad assignment.\", // FIXME: Rephrase\n\tE032: \"Expected a small integer and instead saw '{a}'.\",\n\tE033: \"Expected an operator and instead saw '{a}'.\",\n\tE034: \"get/set are ES5 features.\",\n\tE035: \"Missing property name.\",\n\tE036: \"Expected to see a statement and instead saw a block.\",\n\tE037: \"Constant {a} was not declared correctly.\",\n\tE038: \"Variable {a} was not declared correctly.\",\n\tE039: \"Function declarations are not invocable. Wrap the whole function invocation in parens.\",\n\tE040: \"Each value should have its own case label.\",\n\tE041: \"Unrecoverable syntax error.\",\n\tE042: \"Stopping.\",\n\tE043: \"Too many errors.\"\n};\n\nvar warnings = {\n\tW001: \"'hasOwnProperty' is a really bad name.\",\n\tW002: \"Value of '{a}' may be overwritten in IE.\",\n\tW003: \"'{a}' was used before it was defined.\",\n\tW004: \"'{a}' is already defined.\",\n\tW005: \"A dot following a number can be confused with a decimal point.\",\n\tW006: \"Confusing minuses.\",\n\tW007: \"Confusing pluses.\",\n\tW008: \"A leading decimal point can be confused with a dot: '{a}'.\",\n\tW009: \"The array literal notation [] is preferrable.\",\n\tW010: \"The object literal notation {} is preferrable.\",\n\tW011: \"Unexpected space after '{a}'.\",\n\tW012: \"Unexpected space before '{a}'.\",\n\tW013: \"Missing space after '{a}'.\",\n\tW014: \"Bad line breaking before '{a}'.\",\n\tW015: \"Expected '{a}' to have an indentation at {b} instead at {c}.\",\n\tW016: \"Unexpected use of '{a}'.\",\n\tW017: \"Bad operand.\",\n\tW018: \"Confusing use of '{a}'.\",\n\tW019: \"Use the isNaN function to compare with NaN.\",\n\tW020: \"Read only.\",\n\tW021: \"'{a}' is a function.\",\n\tW022: \"Do not assign to the exception parameter.\",\n\tW023: \"Expected an identifier in an assignment and instead saw a function invocation.\",\n\tW024: \"Expected an identifier and instead saw '{a}' (a reserved word).\",\n\tW025: \"Missing name in function declaration.\",\n\tW026: \"Inner functions should be listed at the top of the outer function.\",\n\tW027: \"Unreachable '{a}' after '{b}'.\",\n\tW028: \"Label '{a}' on {b} statement.\",\n\tW029: \"Label '{a}' looks like a javascript url.\",\n\tW030: \"Expected an assignment or function call and instead saw an expression.\",\n\tW031: \"Do not use 'new' for side effects.\",\n\tW032: \"Unnecessary semicolon.\",\n\tW033: \"Missing semicolon.\",\n\tW034: \"Unnecessary directive \\\"{a}\\\".\",\n\tW035: \"Empty block.\",\n\tW036: \"Unexpected /*member '{a}'.\",\n\tW037: \"'{a}' is a statement label.\",\n\tW038: \"'{a}' used out of scope.\",\n\tW039: \"'{a}' is not allowed.\",\n\tW040: \"Possible strict violation.\",\n\tW041: \"Use '{a}' to compare with '{b}'.\",\n\tW042: \"Avoid EOL escaping.\",\n\tW043: \"Bad escaping of EOL. Use option multistr if needed.\",\n\tW044: \"Bad escaping.\",\n\tW045: \"Bad number '{a}'.\",\n\tW046: \"Don't use extra leading zeros '{a}'.\",\n\tW047: \"A trailing decimal point can be confused with a dot: '{a}'.\",\n\tW048: \"Unexpected control character in regular expression.\",\n\tW049: \"Unexpected escaped character '{a}' in regular expression.\",\n\tW050: \"JavaScript URL.\",\n\tW051: \"Variables should not be deleted.\",\n\tW052: \"Unexpected '{a}'.\",\n\tW053: \"Do not use {a} as a constructor.\",\n\tW054: \"The Function constructor is a form of eval.\",\n\tW055: \"A constructor name should start with an uppercase letter.\",\n\tW056: \"Bad constructor.\",\n\tW057: \"Weird construction. Is 'new' unnecessary?\",\n\tW058: \"Missing '()' invoking a constructor.\",\n\tW059: \"Avoid arguments.{a}.\",\n\tW060: \"document.write can be a form of eval.\",\n\tW061: \"eval can be harmful.\",\n\tW062: \"Wrap an immediate function invocation in parens \" +\n\t\t\"to assist the reader in understanding that the expression \" +\n\t\t\"is the result of a function, and not the function itself.\",\n\tW063: \"Math is not a function.\",\n\tW064: \"Missing 'new' prefix when invoking a constructor.\",\n\tW065: \"Missing radix parameter.\",\n\tW066: \"Implied eval. Consider passing a function instead of a string.\",\n\tW067: \"Bad invocation.\",\n\tW068: \"Wrapping non-IIFE function literals in parens is unnecessary.\",\n\tW069: \"['{a}'] is better written in dot notation.\",\n\tW070: \"Extra comma. (it breaks older versions of IE)\",\n\tW071: \"This function has too many statements. ({a})\",\n\tW072: \"This function has too many parameters. ({a})\",\n\tW073: \"Blocks are nested too deeply. ({a})\",\n\tW074: \"This function's cyclomatic complexity is too high. ({a})\",\n\tW075: \"Duplicate key '{a}'.\",\n\tW076: \"Unexpected parameter '{a}' in get {b} function.\",\n\tW077: \"Expected a single parameter in set {a} function.\",\n\tW078: \"Setter is defined without getter.\",\n\tW079: \"Redefinition of '{a}'.\",\n\tW080: \"It's not necessary to initialize '{a}' to 'undefined'.\",\n\tW081: \"Too many var statements.\",\n\tW082: \"Function declarations should not be placed in blocks. \" +\n\t\t\"Use a function expression or move the statement to the top of \" +\n\t\t\"the outer function.\",\n\tW083: \"Don't make functions within a loop.\",\n\tW084: \"Expected a conditional expression and instead saw an assignment.\",\n\tW085: \"Don't use 'with'.\",\n\tW086: \"Expected a 'break' statement before '{a}'.\",\n\tW087: \"Forgotten 'debugger' statement?\",\n\tW088: \"Creating global 'for' variable. Should be 'for (var {a} ...'.\",\n\tW089: \"The body of a for in should be wrapped in an if statement to filter \" +\n\t\t\"unwanted properties from the prototype.\",\n\tW090: \"'{a}' is not a statement label.\",\n\tW091: \"'{a}' is out of scope.\",\n\tW092: \"Wrap the /regexp/ literal in parens to disambiguate the slash operator.\",\n\tW093: \"Did you mean to return a conditional instead of an assignment?\",\n\tW094: \"Unexpected comma.\",\n\tW095: \"Expected a string and instead saw {a}.\",\n\tW096: \"The '{a}' key may produce unexpected results.\",\n\tW097: \"Use the function form of \\\"use strict\\\".\",\n\tW098: \"'{a}' is defined but never used.\",\n\tW099: \"Mixed spaces and tabs.\",\n\tW100: \"This character may get silently deleted by one or more browsers.\",\n\tW101: \"Line is too long.\",\n\tW102: \"Trailing whitespace.\",\n\tW103: \"The '{a}' property is deprecated.\",\n\tW104: \"'{a}' is only available in JavaScript 1.7.\",\n\tW105: \"Unexpected {a} in '{b}'.\",\n\tW106: \"Identifier '{a}' is not in camel case.\",\n\tW107: \"Script URL.\",\n\tW108: \"Strings must use doublequote.\",\n\tW109: \"Strings must use singlequote.\",\n\tW110: \"Mixed double and single quotes.\",\n\tW112: \"Unclosed string.\",\n\tW113: \"Control character in string: {a}.\",\n\tW114: \"Avoid {a}.\",\n\tW115: \"Octal literals are not allowed in strict mode.\",\n\tW116: \"Expected '{a}' and instead saw '{b}'.\",\n\tW117: \"'{a}' is not defined.\",\n};\n\nvar info = {\n\tI001: \"Comma warnings can be turned off with 'laxcomma'.\"\n};\n\nexports.errors = {};\nexports.warnings = {};\nexports.info = {};\n\n_.each(errors, function (desc, code) {\n\texports.errors[code] = { code: code, desc: desc };\n});\n\n_.each(warnings, function (desc, code) {\n\texports.warnings[code] = { code: code, desc: desc };\n});\n\n_.each(info, function (desc, code) {\n\texports.info[code] = { code: code, desc: desc };\n});\n\n//@ sourceURL=/src/shared/messages.js" -)); - -require.define("/src/stable/lex.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Lexical analysis and token construction.\n */\n\n\"use strict\";\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\n\n// Some of these token types are from JavaScript Parser API\n// while others are specific to JSHint parser.\n// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n\nvar Token = {\n\tIdentifier: 1,\n\tPunctuator: 2,\n\tNumericLiteral: 3,\n\tStringLiteral: 4,\n\tComment: 5,\n\tKeyword: 6,\n\tNullLiteral: 7,\n\tBooleanLiteral: 8,\n\tRegExp: 9\n};\n\n// This is auto generated from the unicode tables.\n// The tables are at:\n// http://www.fileformat.info/info/unicode/category/Lu/list.htm\n// http://www.fileformat.info/info/unicode/category/Ll/list.htm\n// http://www.fileformat.info/info/unicode/category/Lt/list.htm\n// http://www.fileformat.info/info/unicode/category/Lm/list.htm\n// http://www.fileformat.info/info/unicode/category/Lo/list.htm\n// http://www.fileformat.info/info/unicode/category/Nl/list.htm\n\nvar unicodeLetterTable = [\n\t170, 170, 181, 181, 186, 186, 192, 214,\n\t216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750,\n\t880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908,\n\t910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366,\n\t1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610,\n\t1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775,\n\t1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957,\n\t1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069,\n\t2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361,\n\t2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431,\n\t2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482,\n\t2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529,\n\t2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608,\n\t2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654,\n\t2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736,\n\t2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785,\n\t2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867,\n\t2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929,\n\t2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970,\n\t2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001,\n\t3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123,\n\t3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212,\n\t3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261,\n\t3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344,\n\t3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455,\n\t3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526,\n\t3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716,\n\t3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743,\n\t3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760,\n\t3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805,\n\t3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138,\n\t4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198,\n\t4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346,\n\t4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696,\n\t4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789,\n\t4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880,\n\t4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740,\n\t5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900,\n\t5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000,\n\t6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312,\n\t6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516,\n\t6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823,\n\t6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141,\n\t7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409,\n\t7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013,\n\t8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061,\n\t8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140,\n\t8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188,\n\t8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455,\n\t8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486,\n\t8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521,\n\t8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358,\n\t11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621,\n\t11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694,\n\t11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726,\n\t11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295,\n\t12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438,\n\t12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589,\n\t12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312,\n\t19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124,\n\t42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539,\n\t42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783,\n\t42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921,\n\t43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042,\n\t43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259,\n\t43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442,\n\t43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595,\n\t43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697,\n\t43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714,\n\t43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798,\n\t43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032,\n\t55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045,\n\t64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279,\n\t64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316,\n\t64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433,\n\t64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019,\n\t65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370,\n\t65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495,\n\t65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594,\n\t65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786,\n\t65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334,\n\t66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511,\n\t66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592,\n\t67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669,\n\t67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115,\n\t68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405,\n\t68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687,\n\t69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894,\n\t92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964,\n\t119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980,\n\t119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069,\n\t120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121,\n\t120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144,\n\t120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570,\n\t120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686,\n\t120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779,\n\t131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972,\n\t177984, 177984, 178205, 178205, 194560, 195101\n];\n\nvar identifierStartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierStartTable[i] =\n\t\ti === 36 || // $\n\t\ti >= 65 && i <= 90 || // A-Z\n\t\ti === 95 || // _\n\t\ti >= 97 && i <= 122; // a-z\n}\n\nvar identifierPartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n\tidentifierPartTable[i] =\n\t\tidentifierStartTable[i] || // $, _, A-Z, a-z\n\t\ti >= 48 && i <= 57; // 0-9\n}\n\n/*\n * Lexer for JSHint.\n *\n * This object does a char-by-char scan of the provided source code\n * and produces a sequence of tokens.\n *\n * var lex = new Lexer(\"var i = 0;\");\n * lex.start();\n * lex.token(); // returns the next token\n *\n * You have to use the token() method to move the lexer forward\n * but you don't have to use its return value to get tokens. In addition\n * to token() method returning the next token, the Lexer object also\n * emits events.\n *\n * lex.on(\"Identifier\", function (data) {\n * if (data.name.indexOf(\"_\") >= 0) {\n * // Produce a warning.\n * }\n * });\n *\n * Note that the token() method returns tokens in a JSLint-compatible\n * format while the event emitter uses a slightly modified version of\n * Mozilla's JavaScript Parser API. Eventually, we will move away from\n * JSLint format.\n */\nfunction Lexer(source) {\n\tvar lines = source;\n\n\tif (typeof lines === \"string\") {\n\t\tlines = lines\n\t\t\t.replace(/\\r\\n/g, \"\\n\")\n\t\t\t.replace(/\\r/g, \"\\n\")\n\t\t\t.split(\"\\n\");\n\t}\n\n\t// If the first line is a shebang (#!), make it a blank and move on.\n\t// Shebangs are used by Node scripts.\n\n\tif (lines[0] && lines[0].substr(0, 2) === \"#!\") {\n\t\tlines[0] = \"\";\n\t}\n\n\tthis.emitter = new events.EventEmitter();\n\tthis.source = source;\n\tthis.lines = lines;\n\tthis.prereg = true;\n\n\tthis.line = 0;\n\tthis.char = 1;\n\tthis.from = 1;\n\tthis.input = \"\";\n\n\tfor (var i = 0; i < state.option.indent; i += 1) {\n\t\tstate.tab += \" \";\n\t}\n}\n\nLexer.prototype = {\n\t_lines: [],\n\n\tget lines() {\n\t\tthis._lines = state.lines;\n\t\treturn this._lines;\n\t},\n\n\tset lines(val) {\n\t\tthis._lines = val;\n\t\tstate.lines = this._lines;\n\t},\n\n\t/*\n\t * Return the next i character without actually moving the\n\t * char pointer.\n\t */\n\tpeek: function (i) {\n\t\treturn this.input.charAt(i || 0);\n\t},\n\n\t/*\n\t * Move the char pointer forward i times.\n\t */\n\tskip: function (i) {\n\t\ti = i || 1;\n\t\tthis.char += i;\n\t\tthis.input = this.input.slice(i);\n\t},\n\n\t/*\n\t * Subscribe to a token event. The API for this method is similar\n\t * Underscore.js i.e. you can subscribe to multiple events with\n\t * one call:\n\t *\n\t * lex.on(\"Identifier Number\", function (data) {\n\t * // ...\n\t * });\n\t */\n\ton: function (names, listener) {\n\t\tnames.split(\" \").forEach(function (name) {\n\t\t\tthis.emitter.on(name, listener);\n\t\t}.bind(this));\n\t},\n\n\t/*\n\t * Trigger a token event. All arguments will be passed to each\n\t * listener.\n\t */\n\ttrigger: function () {\n\t\tthis.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments));\n\t},\n\n\t/*\n\t * Extract a punctuator out of the next sequence of characters\n\t * or return 'null' if its not possible.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanPunctuator function in the Esprima parser's source code.\n\t */\n\tscanPunctuator: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2, ch3, ch4;\n\n\t\tswitch (ch1) {\n\t\t// Most common single-character punctuators\n\t\tcase \".\":\n\t\t\tif ((/^[0-9]$/).test(this.peek(1))) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t/* falls through */\n\t\tcase \"(\":\n\t\tcase \")\":\n\t\tcase \";\":\n\t\tcase \",\":\n\t\tcase \"{\":\n\t\tcase \"}\":\n\t\tcase \"[\":\n\t\tcase \"]\":\n\t\tcase \":\":\n\t\tcase \"~\":\n\t\tcase \"?\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// A pound sign (for Node shebangs)\n\t\tcase \"#\":\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\n\t\t// We're at the end of input\n\t\tcase \"\":\n\t\t\treturn null;\n\t\t}\n\n\t\t// Peek more characters\n\n\t\tch2 = this.peek(1);\n\t\tch3 = this.peek(2);\n\t\tch4 = this.peek(3);\n\n\t\t// 4-character punctuator: >>>=\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\" && ch4 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>=\"\n\t\t\t};\n\t\t}\n\n\t\t// 3-character punctuators: === !== >>> <<= >>=\n\n\t\tif (ch1 === \"=\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"===\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"!\" && ch2 === \"=\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"!==\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \">\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \">>>\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \"<\" && ch2 === \"<\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\tif (ch1 === \">\" && ch2 === \">\" && ch3 === \"=\") {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"<<=\"\n\t\t\t};\n\t\t}\n\n\t\t// 2-character punctuators: <= >= == != ++ -- << >> && ||\n\t\t// += -= *= %= &= |= ^= (but not /=, see below)\n\t\tif (ch1 === ch2 && (\"+-<>&|\".indexOf(ch1) >= 0)) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1 + ch2\n\t\t\t};\n\t\t}\n\n\t\tif (\"<>=!+-*%&|^\".indexOf(ch1) >= 0) {\n\t\t\tif (ch2 === \"=\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: ch1 + ch2\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: ch1\n\t\t\t};\n\t\t}\n\n\t\t// Special case: /=. We need to make sure that this is an\n\t\t// operator and not a regular expression.\n\n\t\tif (ch1 === \"/\") {\n\t\t\tif (ch2 === \"=\" && /\\/=(?!(\\S*\\/[gim]?))/.test(this.input)) {\n\t\t\t\t// /= is not a part of a regular expression, return it as a\n\t\t\t\t// punctuator.\n\t\t\t\treturn {\n\t\t\t\t\ttype: Token.Punctuator,\n\t\t\t\t\tvalue: \"/=\"\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Punctuator,\n\t\t\t\tvalue: \"/\"\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a comment out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since comments can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * In addition to normal JavaScript comments (// and /*) this method\n\t * also recognizes JSHint- and JSLint-specific comments such as\n\t * /*jshint, /*jslint, /*globals and so on.\n\t */\n\tscanComments: function () {\n\t\tvar ch1 = this.peek();\n\t\tvar ch2 = this.peek(1);\n\t\tvar rest = this.input.substr(2);\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.character;\n\n\t\t// Create a comment token object and make sure it\n\t\t// has all the data JSHint needs to work with special\n\t\t// comments.\n\n\t\tfunction commentToken(label, body, opt) {\n\t\t\tvar special = [\"jshint\", \"jslint\", \"members\", \"member\", \"globals\", \"global\", \"exported\"];\n\t\t\tvar isSpecial = false;\n\t\t\tvar value = label + body;\n\t\t\tvar commentType = \"plain\";\n\t\t\topt = opt || {};\n\n\t\t\tif (opt.isMultiline) {\n\t\t\t\tvalue += \"*/\";\n\t\t\t}\n\n\t\t\tspecial.forEach(function (str) {\n\t\t\t\tif (isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (body.substr(0, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + str;\n\t\t\t\t\tbody = body.substr(str.length);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial && body.charAt(0) === \" \" && body.substr(1, str.length) === str) {\n\t\t\t\t\tisSpecial = true;\n\t\t\t\t\tlabel = label + \" \" + str;\n\t\t\t\t\tbody = body.substr(str.length + 1);\n\t\t\t\t}\n\n\t\t\t\tif (!isSpecial) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswitch (str) {\n\t\t\t\tcase \"member\":\n\t\t\t\t\tcommentType = \"members\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"global\":\n\t\t\t\t\tcommentType = \"globals\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tcommentType = str;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\ttype: Token.Comment,\n\t\t\t\tcommentType: commentType,\n\t\t\t\tvalue: value,\n\t\t\t\tbody: body,\n\t\t\t\tisSpecial: isSpecial,\n\t\t\t\tisMultiline: opt.isMultiline || false,\n\t\t\t\tisMalformed: opt.isMalformed || false\n\t\t\t};\n\t\t}\n\n\t\t// End of unbegun comment. Raise an error and skip that input.\n\t\tif (ch1 === \"*\" && ch2 === \"/\") {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E018\",\n\t\t\t\tline: startLine,\n\t\t\t\tcharacter: startChar\n\t\t\t});\n\n\t\t\tthis.skip(2);\n\t\t\treturn null;\n\t\t}\n\n\t\t// Comments must start either with // or /*\n\t\tif (ch1 !== \"/\" || (ch2 !== \"*\" && ch2 !== \"/\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// One-line comment\n\t\tif (ch2 === \"/\") {\n\t\t\tthis.skip(this.input.length); // Skip to the EOL.\n\t\t\treturn commentToken(\"//\", rest);\n\t\t}\n\n\t\tvar body = \"\";\n\n\t\t/* Multi-line comment */\n\t\tif (ch2 === \"*\") {\n\t\t\tthis.skip(2);\n\n\t\t\twhile (this.peek() !== \"*\" || this.peek(1) !== \"/\") {\n\t\t\t\tif (this.peek() === \"\") { // End of Line\n\t\t\t\t\tbody += \"\\n\";\n\n\t\t\t\t\t// If we hit EOF and our comment is still unclosed,\n\t\t\t\t\t// trigger an error and end the comment implicitly.\n\t\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\t\tcode: \"E017\",\n\t\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn commentToken(\"/*\", body, {\n\t\t\t\t\t\t\tisMultiline: true,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody += this.peek();\n\t\t\t\t\tthis.skip();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.skip(2);\n\t\t\treturn commentToken(\"/*\", body, { isMultiline: true });\n\t\t}\n\t},\n\n\t/*\n\t * Extract a keyword out of the next sequence of characters or\n\t * return 'null' if its not possible.\n\t */\n\tscanKeyword: function () {\n\t\tvar result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input);\n\t\tvar keywords = [\n\t\t\t\"if\", \"in\", \"do\", \"var\", \"for\", \"new\",\n\t\t\t\"try\", \"let\", \"this\", \"else\", \"case\",\n\t\t\t\"void\", \"with\", \"enum\", \"while\", \"break\",\n\t\t\t\"catch\", \"throw\", \"const\", \"yield\", \"class\",\n\t\t\t\"super\", \"return\", \"typeof\", \"delete\",\n\t\t\t\"switch\", \"export\", \"import\", \"default\",\n\t\t\t\"finally\", \"extends\", \"function\", \"continue\",\n\t\t\t\"debugger\", \"instanceof\"\n\t\t];\n\n\t\tif (result && keywords.indexOf(result[0]) >= 0) {\n\t\t\treturn {\n\t\t\t\ttype: Token.Keyword,\n\t\t\t\tvalue: result[0]\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Extract a JavaScript identifier out of the next sequence of\n\t * characters or return 'null' if its not possible. In addition,\n\t * to Identifier this method can also produce BooleanLiteral\n\t * (true/false) and NullLiteral (null).\n\t */\n\tscanIdentifier: function () {\n\t\tvar id = \"\";\n\t\tvar index = 0;\n\t\tvar type, char;\n\n\t\t// Detects any character in the Unicode categories \"Uppercase\n\t\t// letter (Lu)\", \"Lowercase letter (Ll)\", \"Titlecase letter\n\t\t// (Lt)\", \"Modifier letter (Lm)\", \"Other letter (Lo)\", or\n\t\t// \"Letter number (Nl)\".\n\t\t//\n\t\t// Both approach and unicodeLetterTable were borrowed from\n\t\t// Google's Traceur.\n\n\t\tfunction isUnicodeLetter(code) {\n\t\t\tfor (var i = 0; i < unicodeLetterTable.length;) {\n\t\t\t\tif (code < unicodeLetterTable[i++]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (code <= unicodeLetterTable[i++]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tvar readUnicodeEscapeSequence = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tindex += 1;\n\n\t\t\tif (this.peek(index) !== \"u\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar ch1 = this.peek(index + 1);\n\t\t\tvar ch2 = this.peek(index + 2);\n\t\t\tvar ch3 = this.peek(index + 3);\n\t\t\tvar ch4 = this.peek(index + 4);\n\t\t\tvar code;\n\n\t\t\tif (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {\n\t\t\t\tcode = parseInt(ch1 + ch2 + ch3 + ch4, 16);\n\n\t\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\t\tindex += 5;\n\t\t\t\t\treturn \"\\\\u\" + ch1 + ch2 + ch3 + ch4;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierStart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierStartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tvar getIdentifierPart = function () {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar chr = this.peek(index);\n\t\t\tvar code = chr.charCodeAt(0);\n\n\t\t\tif (code === 92) {\n\t\t\t\treturn readUnicodeEscapeSequence();\n\t\t\t}\n\n\t\t\tif (code < 128) {\n\t\t\t\tif (identifierPartTable[code]) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\treturn chr;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (isUnicodeLetter(code)) {\n\t\t\t\tindex += 1;\n\t\t\t\treturn chr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}.bind(this);\n\n\t\tchar = getIdentifierStart();\n\t\tif (char === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tid = char;\n\t\tfor (;;) {\n\t\t\tchar = getIdentifierPart();\n\n\t\t\tif (char === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tid += char;\n\t\t}\n\n\t\tswitch (id) {\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\t\ttype = Token.BooleanLiteral;\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\ttype = Token.NullLiteral;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttype = Token.Identifier;\n\t\t}\n\n\t\treturn {\n\t\t\ttype: type,\n\t\t\tvalue: id\n\t\t};\n\t},\n\n\t/*\n\t * Extract a numeric literal out of the next sequence of\n\t * characters or return 'null' if its not possible. This method\n\t * supports all numeric literals described in section 7.8.3\n\t * of the EcmaScript 5 specification.\n\t *\n\t * This method's implementation was heavily influenced by the\n\t * scanNumericLiteral function in the Esprima parser's source code.\n\t */\n\tscanNumericLiteral: function () {\n\t\tvar index = 0;\n\t\tvar value = \"\";\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek(index);\n\t\tvar bad;\n\n\t\tfunction isDecimalDigit(str) {\n\t\t\treturn (/^[0-9]$/).test(str);\n\t\t}\n\n\t\tfunction isOctalDigit(str) {\n\t\t\treturn (/^[0-7]$/).test(str);\n\t\t}\n\n\t\tfunction isHexDigit(str) {\n\t\t\treturn (/^[0-9a-fA-F]$/).test(str);\n\t\t}\n\n\t\tfunction isIdentifierStart(ch) {\n\t\t\treturn (ch === \"$\") || (ch === \"_\") || (ch === \"\\\\\") ||\n\t\t\t\t(ch >= \"a\" && ch <= \"z\") || (ch >= \"A\" && ch <= \"Z\");\n\t\t}\n\n\t\t// Numbers must start either with a decimal digit or a point.\n\n\t\tif (char !== \".\" && !isDecimalDigit(char)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (char !== \".\") {\n\t\t\tvalue = this.peek(index);\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (value === \"0\") {\n\t\t\t\t// Base-16 numbers.\n\t\t\t\tif (char === \"x\" || char === \"X\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (!isHexDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value.length <= 2) { // 0x\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\t\tisMalformed: true\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 16,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Base-8 numbers.\n\t\t\t\tif (isOctalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tbad = false;\n\n\t\t\t\t\twhile (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\n\t\t\t\t\t\t// Numbers like '019' (note the 9) are not valid octals\n\t\t\t\t\t\t// but we still parse them and mark as malformed.\n\n\t\t\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\t\t\tbad = true;\n\t\t\t\t\t\t} else if (!isOctalDigit(char)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue += char;\n\t\t\t\t\t\tindex += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index < length) {\n\t\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.NumericLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tbase: 8,\n\t\t\t\t\t\tisMalformed: false\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Decimal numbers that start with '0' such as '09' are illegal\n\t\t\t\t// but we still parse them and return as malformed.\n\n\t\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tvalue += char;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Decimal digits.\n\n\t\tif (char === \".\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\n\t\t\twhile (index < length) {\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Exponent part.\n\n\t\tif (char === \"e\" || char === \"E\") {\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t\tchar = this.peek(index);\n\n\t\t\tif (char === \"+\" || char === \"-\") {\n\t\t\t\tvalue += this.input(index);\n\t\t\t\tindex += 1;\n\t\t\t}\n\n\t\t\tchar = this.peek(index);\n\t\t\tif (isDecimalDigit(char)) {\n\t\t\t\tvalue += char;\n\t\t\t\tindex += 1;\n\n\t\t\t\twhile (index < length) {\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tif (!isDecimalDigit(char)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvalue += char;\n\t\t\t\t\tindex += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (isIdentifierStart(char)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.NumericLiteral,\n\t\t\tvalue: value,\n\t\t\tbase: 10,\n\t\t\tisMalformed: !isFinite(value)\n\t\t};\n\t},\n\n\t/*\n\t * Extract a string out of the next sequence of characters and/or\n\t * lines or return 'null' if its not possible. Since strings can\n\t * span across multiple lines this method has to move the char\n\t * pointer.\n\t *\n\t * This method recognizes pseudo-multiline JavaScript strings:\n\t *\n\t * var str = \"hello\\\n\t * world\";\n */\n\tscanStringLiteral: function () {\n\t\tvar quote = this.peek();\n\n\t\t// String must start with a quote.\n\t\tif (quote !== \"\\\"\" && quote !== \"'\") {\n\t\t\treturn null;\n\t\t}\n\n\t\t// In JSON strings must always use double quotes.\n\t\tif (state.jsonMode && quote !== \"\\\"\") {\n\t\t\tthis.trigger(\"warning\", {\n\t\t\t\tcode: \"W108\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char // +1?\n\t\t\t});\n\t\t}\n\n\t\tvar value = \"\";\n\t\tvar startLine = this.line;\n\t\tvar startChar = this.char;\n\t\tvar allowNewLine = false;\n\n\t\tthis.skip();\n\n\t\twhile (this.peek() !== quote) {\n\t\t\twhile (this.peek() === \"\") { // End Of Line\n\n\t\t\t\t// If an EOL is not preceded by a backslash, show a warning\n\t\t\t\t// and proceed like it was a legit multi-line string where\n\t\t\t\t// author simply forgot to escape the newline symbol.\n\t\t\t\t//\n\t\t\t\t// Another approach is to implicitly close a string on EOL\n\t\t\t\t// but it generates too many false positives.\n\n\t\t\t\tif (!allowNewLine) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W112\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tallowNewLine = false;\n\n\t\t\t\t\t// Otherwise show a warning if multistr option was not set.\n\t\t\t\t\t// For JSON, show warning no matter what.\n\n\t\t\t\t\tif (!state.option.multistr) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W043\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W042\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we get an EOF inside of an unclosed string, show an\n\t\t\t\t// error and implicitly close it at the EOF point.\n\n\t\t\t\tif (!this.nextLine()) {\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E029\",\n\t\t\t\t\t\tline: startLine,\n\t\t\t\t\t\tcharacter: startChar\n\t\t\t\t\t});\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: Token.StringLiteral,\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tisUnclosed: true,\n\t\t\t\t\t\tquote: quote\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tallowNewLine = false;\n\t\t\tvar char = this.peek();\n\t\t\tvar jump = 1; // A length of a jump, after we're done\n\t\t\t // parsing this character.\n\n\t\t\tif (char < \" \") {\n\t\t\t\t// Warn about a control character in a string.\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W113\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ \"\" ]\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Special treatment for some escaped characters.\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tthis.skip();\n\t\t\t\tchar = this.peek();\n\n\t\t\t\tswitch (char) {\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\'\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"b\":\n\t\t\t\t\tchar = \"\\b\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"f\":\n\t\t\t\t\tchar = \"\\f\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"n\":\n\t\t\t\t\tchar = \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"r\":\n\t\t\t\t\tchar = \"\\r\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"t\":\n\t\t\t\t\tchar = \"\\t\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"0\":\n\t\t\t\t\tchar = \"\\0\";\n\n\t\t\t\t\t// Octal literals fail in strict mode.\n\t\t\t\t\t// Check if the number is between 00 and 07.\n\t\t\t\t\tvar n = parseInt(this.peek(), 10);\n\t\t\t\t\tif (n >= 0 && n <= 7 && state.directive[\"use strict\"]) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"u\":\n\t\t\t\t\tchar = String.fromCharCode(parseInt(this.input.substr(1, 4), 16));\n\t\t\t\t\tjump = 5;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"v\":\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\v\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = \"\\v\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"x\":\n\t\t\t\t\tvar\tx = parseInt(this.input.substr(1, 2), 16);\n\n\t\t\t\t\tif (state.jsonMode) {\n\t\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\t\tdata: [ \"\\\\x-\" ]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tchar = String.fromCharCode(x);\n\t\t\t\t\tjump = 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\\\\\":\n\t\t\t\tcase \"\\\"\":\n\t\t\t\tcase \"/\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\":\n\t\t\t\t\tallowNewLine = true;\n\t\t\t\t\tchar = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"!\":\n\t\t\t\t\tif (value.slice(value.length - 2) === \"<\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t/*falls through */\n\t\t\t\tdefault:\n\t\t\t\t\t// Weird escaping.\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W044\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvalue += char;\n\t\t\tthis.skip(jump);\n\t\t}\n\n\t\tthis.skip();\n\t\treturn {\n\t\t\ttype: Token.StringLiteral,\n\t\t\tvalue: value,\n\t\t\tisUnclosed: false,\n\t\t\tquote: quote\n\t\t};\n\t},\n\n\t/*\n\t * Extract a regular expression out of the next sequence of\n\t * characters and/or lines or return 'null' if its not possible.\n\t *\n\t * This method is platform dependent: it accepts almost any\n\t * regular expression values but then tries to compile and run\n\t * them using system's RegExp object. This means that there are\n\t * rare edge cases where one JavaScript engine complains about\n\t * your regular expression while others don't.\n\t */\n\tscanRegExp: function () {\n\t\tvar index = 0;\n\t\tvar length = this.input.length;\n\t\tvar char = this.peek();\n\t\tvar value = char;\n\t\tvar body = \"\";\n\t\tvar flags = [];\n\t\tvar malformed = false;\n\t\tvar isCharSet = false;\n\t\tvar terminated;\n\n\t\tvar scanUnexpectedChars = function () {\n\t\t\t// Unexpected control character\n\t\t\tif (char < \" \") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W048\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Unexpected escaped character\n\t\t\tif (char === \"<\") {\n\t\t\t\tmalformed = true;\n\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\tcode: \"W049\",\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\tdata: [ char ]\n\t\t\t\t});\n\t\t\t}\n\t\t}.bind(this);\n\n\t\t// Regular expressions must start with '/'\n\t\tif (!this.prereg || char !== \"/\") {\n\t\t\treturn null;\n\t\t}\n\n\t\tindex += 1;\n\t\tterminated = false;\n\n\t\t// Try to get everything in between slashes. A couple of\n\t\t// cases aside (see scanUnexpectedChars) we don't really\n\t\t// care whether the resulting expression is valid or not.\n\t\t// We will check that later using the RegExp object.\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tvalue += char;\n\t\t\tbody += char;\n\n\t\t\tif (isCharSet) {\n\t\t\t\tif (char === \"]\") {\n\t\t\t\t\tif (this.peek(index - 1) !== \"\\\\\" || this.peek(index - 2) === \"\\\\\") {\n\t\t\t\t\t\tisCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (char === \"\\\\\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tchar = this.peek(index);\n\t\t\t\t\tbody += char;\n\t\t\t\t\tvalue += char;\n\n\t\t\t\t\tscanUnexpectedChars();\n\t\t\t\t}\n\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"\\\\\") {\n\t\t\t\tindex += 1;\n\t\t\t\tchar = this.peek(index);\n\t\t\t\tbody += char;\n\t\t\t\tvalue += char;\n\n\t\t\t\tscanUnexpectedChars();\n\n\t\t\t\tif (char === \"/\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (char === \"[\") {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (char === \"[\") {\n\t\t\t\tisCharSet = true;\n\t\t\t\tindex += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (char === \"/\") {\n\t\t\t\tbody = body.substr(0, body.length - 1);\n\t\t\t\tterminated = true;\n\t\t\t\tindex += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// A regular expression that was never closed is an\n\t\t// error from which we cannot recover.\n\n\t\tif (!terminated) {\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E015\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.from\n\t\t\t});\n\n\t\t\treturn void this.trigger(\"fatal\", {\n\t\t\t\tline: this.line,\n\t\t\t\tfrom: this.from\n\t\t\t});\n\t\t}\n\n\t\t// Parse flags (if any).\n\n\t\twhile (index < length) {\n\t\t\tchar = this.peek(index);\n\t\t\tif (!/[gim]/.test(char)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tflags.push(char);\n\t\t\tvalue += char;\n\t\t\tindex += 1;\n\t\t}\n\n\t\t// Check regular expression for correctness.\n\n\t\ttry {\n\t\t\tnew RegExp(body, flags.join(\"\"));\n\t\t} catch (err) {\n\t\t\tmalformed = true;\n\t\t\tthis.trigger(\"error\", {\n\t\t\t\tcode: \"E016\",\n\t\t\t\tline: this.line,\n\t\t\t\tcharacter: this.char,\n\t\t\t\tdata: [ err.message ] // Platform dependent!\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\ttype: Token.RegExp,\n\t\t\tvalue: value,\n\t\t\tflags: flags,\n\t\t\tisMalformed: malformed\n\t\t};\n\t},\n\n\t/*\n\t * Scan for any occurence of mixed tabs and spaces. If smarttabs option\n\t * is on, ignore tabs followed by spaces.\n\t *\n\t * Tabs followed by one space followed by a block comment are allowed.\n\t */\n\tscanMixedSpacesAndTabs: function () {\n\t\tvar at, match;\n\n\t\tif (state.option.smarttabs) {\n\t\t\t// Negative look-behind for \"//\"\n\t\t\tmatch = this.input.match(/(\\/\\/)? \\t/);\n\t\t\tat = match && !match[1] ? 0 : -1;\n\t\t} else {\n\t\t\tat = this.input.search(/ \\t|\\t [^\\*]/);\n\t\t}\n\n\t\treturn at;\n\t},\n\n\t/*\n\t * Scan for characters that get silently deleted by one or more browsers.\n\t */\n\tscanUnsafeChars: function () {\n\t\treturn this.input.search(reg.unsafeChars);\n\t},\n\n\t/*\n\t * Produce the next raw token or return 'null' if no tokens can be matched.\n\t * This method skips over all space characters.\n\t */\n\tnext: function () {\n\t\tthis.from = this.char;\n\n\t\t// Move to the next non-space character.\n\t\tvar start;\n\t\tif (/\\s/.test(this.peek())) {\n\t\t\tstart = this.char;\n\n\t\t\twhile (/\\s/.test(this.peek())) {\n\t\t\t\tthis.from += 1;\n\t\t\t\tthis.skip();\n\t\t\t}\n\n\t\t\tif (this.peek() === \"\") { // EOL\n\t\t\t\tif (state.option.trailing) {\n\t\t\t\t\tthis.trigger(\"warning\", { code: \"W102\", line: this.line, character: start });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Methods that work with multi-line structures and move the\n\t\t// character pointer.\n\n\t\tvar match = this.scanComments() ||\n\t\t\tthis.scanStringLiteral();\n\n\t\tif (match) {\n\t\t\treturn match;\n\t\t}\n\n\t\t// Methods that don't move the character pointer.\n\n\t\tmatch =\n\t\t\tthis.scanRegExp() ||\n\t\t\tthis.scanPunctuator() ||\n\t\t\tthis.scanKeyword() ||\n\t\t\tthis.scanIdentifier() ||\n\t\t\tthis.scanNumericLiteral();\n\n\t\tif (match) {\n\t\t\tthis.skip(match.value.length);\n\t\t\treturn match;\n\t\t}\n\n\t\t// No token could be matched, give up.\n\n\t\treturn null;\n\t},\n\n\t/*\n\t * Switch to the next line and reset all char pointers. Once\n\t * switched, this method also checks for mixed spaces and tabs\n\t * and other minor warnings.\n\t */\n\tnextLine: function () {\n\t\tvar char;\n\n\t\tif (this.line >= this.lines.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.input = this.lines[this.line];\n\t\tthis.line += 1;\n\t\tthis.char = 1;\n\t\tthis.from = 1;\n\n\t\tchar = this.scanMixedSpacesAndTabs();\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W099\", line: this.line, character: char + 1 });\n\t\t}\n\n\t\tthis.input = this.input.replace(/\\t/g, state.tab);\n\t\tchar = this.scanUnsafeChars();\n\n\t\tif (char >= 0) {\n\t\t\tthis.trigger(\"warning\", { code: \"W100\", line: this.line, character: char });\n\t\t}\n\n\t\t// If there is a limit on line length, warn when lines get too\n\t\t// long.\n\n\t\tif (state.option.maxlen && state.option.maxlen < this.input.length) {\n\t\t\tthis.trigger(\"warning\", { code: \"W101\", line: this.line, character: this.input.length });\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/*\n\t * This is simply a synonym for nextLine() method with a friendlier\n\t * public name.\n\t */\n\tstart: function () {\n\t\tthis.nextLine();\n\t},\n\n\t/*\n\t * Produce the next token. This function is called by advance() to get\n\t * the next token. It retuns a token in a JSLint-compatible format.\n\t */\n\ttoken: function () {\n\t\tvar token;\n\n\t\t// Produce a token object.\n\t\tvar create = function (type, value, isProperty) {\n\t\t\t/*jshint validthis:true */\n\t\t\tvar obj;\n\n\t\t\tif (type !== \"(endline)\" && type !== \"(end)\") {\n\t\t\t\tthis.prereg = false;\n\t\t\t}\n\n\t\t\tif (type === \"(punctuator)\") {\n\t\t\t\tswitch (value) {\n\t\t\t\tcase \".\":\n\t\t\t\tcase \")\":\n\t\t\t\tcase \"~\":\n\t\t\t\tcase \"#\":\n\t\t\t\tcase \"]\":\n\t\t\t\t\tthis.prereg = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t}\n\n\t\t\tif (type === \"(identifier)\") {\n\t\t\t\tif (value === \"return\" || value === \"case\" || value === \"typeof\") {\n\t\t\t\t\tthis.prereg = true;\n\t\t\t\t}\n\n\t\t\t\tif (_.has(state.syntax, value)) {\n\t\t\t\t\tobj = Object.create(state.syntax[value] || state.syntax[\"(error)\"]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!obj) {\n\t\t\t\tobj = Object.create(state.syntax[type]);\n\t\t\t}\n\n\t\t\tobj.identifier = (type === \"(identifier)\");\n\t\t\tobj.type = obj.type || type;\n\t\t\tobj.value = value;\n\t\t\tobj.line = this.line;\n\t\t\tobj.character = this.char;\n\t\t\tobj.from = this.from;\n\n\t\t\tif (isProperty && obj.identifier) {\n\t\t\t\tobj.isProperty = isProperty;\n\t\t\t}\n\n\t\t\treturn obj;\n\t\t}.bind(this);\n\n\t\tfor (;;) {\n\t\t\tif (!this.input.length) {\n\t\t\t\treturn create(this.nextLine() ? \"(endline)\" : \"(end)\", \"\");\n\t\t\t}\n\n\t\t\ttoken = this.next();\n\n\t\t\tif (!token) {\n\t\t\t\tif (this.input.length) {\n\t\t\t\t\t// Unexpected character.\n\t\t\t\t\tthis.trigger(\"error\", {\n\t\t\t\t\t\tcode: \"E024\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ this.peek() ]\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.input = \"\";\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (token.type) {\n\t\t\tcase Token.StringLiteral:\n\t\t\t\tthis.trigger(\"String\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.character,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tquote: token.quote\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(string)\", token.value);\n\t\t\tcase Token.Identifier:\n\t\t\t\tthis.trigger(\"Identifier\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.character,\n\t\t\t\t\tfrom: this.form,\n\t\t\t\t\tname: token.value,\n\t\t\t\t\tisProperty: state.tokens.curr.id === \".\"\n\t\t\t\t});\n\n\t\t\t\t/* falls through */\n\t\t\tcase Token.Keyword:\n\t\t\tcase Token.NullLiteral:\n\t\t\tcase Token.BooleanLiteral:\n\t\t\t\treturn create(\"(identifier)\", token.value, state.tokens.curr.id === \".\");\n\n\t\t\tcase Token.NumericLiteral:\n\t\t\t\tif (token.isMalformed) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W045\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ token.value ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.jsonMode && token.base === 16) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W114\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char,\n\t\t\t\t\t\tdata: [ \"0x-\" ]\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (state.directive[\"use strict\"] && token.base === 8) {\n\t\t\t\t\tthis.trigger(\"warning\", {\n\t\t\t\t\t\tcode: \"W115\",\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.char\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.trigger(\"Number\", {\n\t\t\t\t\tline: this.line,\n\t\t\t\t\tchar: this.character,\n\t\t\t\t\tfrom: this.from,\n\t\t\t\t\tvalue: token.value,\n\t\t\t\t\tbase: token.base,\n\t\t\t\t\tisMalformed: token.malformed\n\t\t\t\t});\n\n\t\t\t\treturn create(\"(number)\", token.value);\n\n\t\t\tcase Token.RegExp:\n\t\t\t\treturn create(\"(regexp)\", token.value);\n\n\t\t\tcase Token.Comment:\n\t\t\t\tstate.tokens.curr.comment = true;\n\n\t\t\t\tif (token.isSpecial) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvalue: token.value,\n\t\t\t\t\t\tbody: token.body,\n\t\t\t\t\t\ttype: token.commentType,\n\t\t\t\t\t\tisSpecial: token.isSpecial,\n\t\t\t\t\t\tline: this.line,\n\t\t\t\t\t\tcharacter: this.character,\n\t\t\t\t\t\tfrom: this.from\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"\":\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn create(\"(punctuator)\", token.value);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.Lexer = Lexer;\n//@ sourceURL=/src/stable/lex.js" -)); - -require.define("/src/stable/reg.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Regular expressions. Some of these are stupidly long.\n */\n\n/*jshint maxlen:1000 */\n\n\"use string\";\n\n// Unsafe comment or string (ax)\nexports.unsafeString =\n\t/@cc|<\\/?|script|\\]\\s*\\]|<\\s*!|</i;\n\n// Unsafe characters that are silently deleted by one or more browsers (cx)\nexports.unsafeChars =\n\t/[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\n// Characters in strings that need escaping (nx and nxg)\nexports.needEsc =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/;\n\nexports.needEscGlobal =\n\t/[\\u0000-\\u001f&<\"\\/\\\\\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n// Star slash (lx)\nexports.starSlash = /\\*\\//;\n\n// Identifier (ix)\nexports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;\n\n// JavaScript URL (jx)\nexports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n// Catches /* falls through */ comments (ft)\nexports.fallsThrough = /^\\s*\\/\\*\\s*falls\\sthrough\\s*\\*\\/\\s*$/;\n//@ sourceURL=/src/stable/reg.js" -)); - -require.define("/src/stable/state.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar state = {\n\tsyntax: {},\n\n\treset: function () {\n\t\tthis.tokens = {\n\t\t\tprev: null,\n\t\t\tnext: null,\n\t\t\tcurr: null\n\t\t},\n\n\t\tthis.option = {};\n\t\tthis.directive = {};\n\t\tthis.jsonMode = false;\n\t\tthis.lines = [];\n\t\tthis.tab = \"\";\n\t\tthis.cache = {}; // Node.JS doesn't have Map. Sniff.\n\t}\n};\n\nexports.state = state;\n//@ sourceURL=/src/stable/state.js" -)); - -require.define("/src/stable/style.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nexports.register = function (linter) {\n\t// Check for properties named __proto__. This special property was\n\t// deprecated and then re-introduced for ES6.\n\n\tlinter.on(\"Identifier\", function style_scanProto(data) {\n\t\tif (linter.getOption(\"proto\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__proto__\") {\n\t\t\tlinter.warn(\"W103\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for properties named __iterator__. This is a special property\n\t// available only in browsers with JavaScript 1.7 implementation.\n\n\tlinter.on(\"Identifier\", function style_scanIterator(data) {\n\t\tif (linter.getOption(\"iterator\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name === \"__iterator__\") {\n\t\t\tlinter.warn(\"W104\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check for dangling underscores.\n\n\tlinter.on(\"Identifier\", function style_scanDangling(data) {\n\t\tif (!linter.getOption(\"nomen\")) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Underscore.js\n\t\tif (data.name === \"_\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// In Node, __dirname and __filename should be ignored.\n\t\tif (linter.getOption(\"node\")) {\n\t\t\tif (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (/^(_+.*|.*_+)$/.test(data.name)) {\n\t\t\tlinter.warn(\"W105\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ \"dangling '_'\", data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Check that all identifiers are using camelCase notation.\n\t// Exceptions: names like MY_VAR and _myVar.\n\n\tlinter.on(\"Identifier\", function style_scanCamelCase(data) {\n\t\tif (!linter.getOption(\"camelcase\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (data.name.replace(/^_+/, \"\").indexOf(\"_\") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) {\n\t\t\tlinter.warn(\"W106\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.from,\n\t\t\t\tdata: [ data.name ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Enforce consistency in style of quoting.\n\n\tlinter.on(\"String\", function style_scanQuotes(data) {\n\t\tvar quotmark = linter.getOption(\"quotmark\");\n\t\tvar code;\n\n\t\tif (!quotmark) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If quotmark is set to 'single' warn about all double-quotes.\n\n\t\tif (quotmark === \"single\" && data.quote !== \"'\") {\n\t\t\tcode = \"W109\";\n\t\t}\n\n\t\t// If quotmark is set to 'double' warn about all single-quotes.\n\n\t\tif (quotmark === \"double\" && data.quote !== \"\\\"\") {\n\t\t\tcode = \"W108\";\n\t\t}\n\n\t\t// If quotmark is set to true, remember the first quotation style\n\t\t// and then warn about all others.\n\n\t\tif (quotmark === true) {\n\t\t\tif (!linter.getCache(\"quotmark\")) {\n\t\t\t\tlinter.setCache(\"quotmark\", data.quote);\n\t\t\t}\n\n\t\t\tif (linter.getCache(\"quotmark\") !== data.quote) {\n\t\t\t\tcode = \"W110\";\n\t\t\t}\n\t\t}\n\n\t\tif (code) {\n\t\t\tlinter.warn(code, {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t});\n\t\t}\n\t});\n\n\tlinter.on(\"Number\", function style_scanNumbers(data) {\n\t\tif (data.value.charAt(0) === \".\") {\n\t\t\t// Warn about a leading decimal point.\n\t\t\tlinter.warn(\"W008\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (data.value.substr(data.value.length - 1) === \".\") {\n\t\t\t// Warn about a trailing decimal point.\n\t\t\tlinter.warn(\"W047\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\n\t\tif (/^00+/.test(data.value)) {\n\t\t\t// Multiple leading zeroes.\n\t\t\tlinter.warn(\"W046\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char,\n\t\t\t\tdata: [ data.value ]\n\t\t\t});\n\t\t}\n\t});\n\n\t// Warn about script URLs.\n\n\tlinter.on(\"String\", function style_scanJavaScriptURLs(data) {\n\t\tvar re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\\s*:/i;\n\n\t\tif (linter.getOption(\"scripturl\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (re.test(data.value)) {\n\t\t\tlinter.warn(\"W107\", {\n\t\t\t\tline: data.line,\n\t\t\t\tchar: data.char\n\t\t\t});\n\t\t}\n\t});\n};\n//@ sourceURL=/src/stable/style.js" -)); - -require.define("/src/stable/jshint.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*!\n * JSHint, by JSHint Community.\n *\n * This file (and this file only) is licensed under the same slightly modified\n * MIT license that JSLint is. It stops evil-doers everywhere:\n *\n *\t Copyright (c) 2002 Douglas Crockford (www.JSLint.com)\n *\n *\t Permission is hereby granted, free of charge, to any person obtaining\n *\t a copy of this software and associated documentation files (the \"Software\"),\n *\t to deal in the Software without restriction, including without limitation\n *\t the rights to use, copy, modify, merge, publish, distribute, sublicense,\n *\t and/or sell copies of the Software, and to permit persons to whom\n *\t the Software is furnished to do so, subject to the following conditions:\n *\n *\t The above copyright notice and this permission notice shall be included\n *\t in all copies or substantial portions of the Software.\n *\n *\t The Software shall be used for Good, not Evil.\n *\n *\t THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *\t IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *\t FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *\t AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *\t LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n *\t FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n *\t DEALINGS IN THE SOFTWARE.\n *\n */\n\n/*jshint quotmark:double */\n\nvar _ = require(\"underscore\");\nvar events = require(\"events\");\nvar vars = require(\"../shared/vars.js\");\nvar messages = require(\"../shared/messages.js\");\nvar Lexer = require(\"./lex.js\").Lexer;\nvar reg = require(\"./reg.js\");\nvar state = require(\"./state.js\").state;\nvar style = require(\"./style.js\");\n\n// We build the application inside a function so that we produce only a single\n// global variable. That function will be invoked immediately, and its return\n// value is the JSHINT function itself.\n\nvar JSHINT = (function () {\n\t\"use strict\";\n\n\tvar anonname,\t\t// The guessed name for anonymous functions.\n\n// These are operators that should not be used with the ! operator.\n\n\t\tbang = {\n\t\t\t\"<\" : true,\n\t\t\t\"<=\" : true,\n\t\t\t\"==\" : true,\n\t\t\t\"===\": true,\n\t\t\t\"!==\": true,\n\t\t\t\"!=\" : true,\n\t\t\t\">\" : true,\n\t\t\t\">=\" : true,\n\t\t\t\"+\" : true,\n\t\t\t\"-\" : true,\n\t\t\t\"*\" : true,\n\t\t\t\"/\" : true,\n\t\t\t\"%\" : true\n\t\t},\n\n\t\t// These are the JSHint boolean options.\n\t\tboolOptions = {\n\t\t\tasi : true, // if automatic semicolon insertion should be tolerated\n\t\t\tbitwise : true, // if bitwise operators should not be allowed\n\t\t\tboss : true, // if advanced usage of assignments should be allowed\n\t\t\tbrowser : true, // if the standard browser globals should be predefined\n\t\t\tcamelcase : true, // if identifiers should be required in camel case\n\t\t\tcouch : true, // if CouchDB globals should be predefined\n\t\t\tcurly : true, // if curly braces around all blocks should be required\n\t\t\tdebug : true, // if debugger statements should be allowed\n\t\t\tdevel : true, // if logging globals should be predefined (console, alert, etc.)\n\t\t\tdojo : true, // if Dojo Toolkit globals should be predefined\n\t\t\teqeqeq : true, // if === should be required\n\t\t\teqnull : true, // if == null comparisons should be tolerated\n\t\t\tes5 : true, // if ES5 syntax should be allowed\n\t\t\tesnext : true, // if es.next specific syntax should be allowed\n\t\t\tevil : true, // if eval should be allowed\n\t\t\texpr : true, // if ExpressionStatement should be allowed as Programs\n\t\t\tforin : true, // if for in statements must filter\n\t\t\tfuncscope : true, // if only function scope should be used for scope tests\n\t\t\tglobalstrict: true, // if global \"use strict\"; should be allowed (also enables 'strict')\n\t\t\timmed : true, // if immediate invocations must be wrapped in parens\n\t\t\titerator : true, // if the `__iterator__` property should be allowed\n\t\t\tjquery : true, // if jQuery globals should be predefined\n\t\t\tlastsemic : true, // if semicolons may be ommitted for the trailing\n\t\t\t // statements inside of a one-line blocks.\n\t\t\tlatedef : true, // if the use before definition should not be tolerated\n\t\t\tlaxbreak : true, // if line breaks should not be checked\n\t\t\tlaxcomma : true, // if line breaks should not be checked around commas\n\t\t\tloopfunc : true, // if functions should be allowed to be defined within\n\t\t\t // loops\n\t\t\tmootools : true, // if MooTools globals should be predefined\n\t\t\tmultistr : true, // allow multiline strings\n\t\t\tnewcap : true, // if constructor names must be capitalized\n\t\t\tnoarg : true, // if arguments.caller and arguments.callee should be\n\t\t\t // disallowed\n\t\t\tnode : true, // if the Node.js environment globals should be\n\t\t\t // predefined\n\t\t\tnoempty : true, // if empty blocks should be disallowed\n\t\t\tnonew : true, // if using `new` for side-effects should be disallowed\n\t\t\tnonstandard : true, // if non-standard (but widely adopted) globals should\n\t\t\t // be predefined\n\t\t\tnomen : true, // if names should be checked\n\t\t\tonevar : true, // if only one var statement per function should be\n\t\t\t // allowed\n\t\t\tpassfail : true, // if the scan should stop on first error\n\t\t\tplusplus : true, // if increment/decrement should not be allowed\n\t\t\tproto : true, // if the `__proto__` property should be allowed\n\t\t\tprototypejs : true, // if Prototype and Scriptaculous globals should be\n\t\t\t // predefined\n\t\t\trhino : true, // if the Rhino environment globals should be predefined\n\t\t\tundef : true, // if variables should be declared before used\n\t\t\tunused : true, // if variables should be always used\n\t\t\tscripturl : true, // if script-targeted URLs should be tolerated\n\t\t\tshadow : true, // if variable shadowing should be tolerated\n\t\t\tsmarttabs : true, // if smarttabs should be tolerated\n\t\t\t // (http://www.emacswiki.org/emacs/SmartTabs)\n\t\t\tstrict : true, // require the \"use strict\"; pragma\n\t\t\tsub : true, // if all forms of subscript notation are tolerated\n\t\t\tsupernew : true, // if `new function () { ... };` and `new Object;`\n\t\t\t // should be tolerated\n\t\t\ttrailing : true, // if trailing whitespace rules apply\n\t\t\tvalidthis : true, // if 'this' inside a non-constructor function is valid.\n\t\t\t // This is a function scoped option only.\n\t\t\twithstmt : true, // if with statements should be allowed\n\t\t\twhite : true, // if strict whitespace rules apply\n\t\t\tworker : true, // if Web Worker script symbols should be allowed\n\t\t\twsh : true, // if the Windows Scripting Host environment globals\n\t\t\t // should be predefined\n\t\t\tyui : true, // YUI variables should be predefined\n\n\t\t\t// Obsolete options\n\t\t\tonecase : true, // if one case switch statements should be allowed\n\t\t\tregexp : true, // if the . should not be allowed in regexp literals\n\t\t\tregexdash : true // if unescaped first/last dash (-) inside brackets\n\t\t\t // should be tolerated\n\t\t},\n\n\t\t// These are the JSHint options that can take any value\n\t\t// (we use this object to detect invalid options)\n\t\tvalOptions = {\n\t\t\tmaxlen : false,\n\t\t\tindent : false,\n\t\t\tmaxerr : false,\n\t\t\tpredef : false,\n\t\t\tquotmark : false, //'single'|'double'|true\n\t\t\tscope : false,\n\t\t\tmaxstatements: false, // {int} max statements per function\n\t\t\tmaxdepth : false, // {int} max nested block depth per function\n\t\t\tmaxparams : false, // {int} max params per function\n\t\t\tmaxcomplexity: false // {int} max cyclomatic complexity per function\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the definition in JSHint is opposite JSLint\n\t\tinvertedOptions = {\n\t\t\tbitwise : true,\n\t\t\tforin : true,\n\t\t\tnewcap : true,\n\t\t\tnomen : true,\n\t\t\tplusplus: true,\n\t\t\tregexp : true,\n\t\t\tundef : true,\n\t\t\twhite : true,\n\n\t\t\t// Inverted and renamed, use JSHint name here\n\t\t\teqeqeq : true,\n\t\t\tonevar : true\n\t\t},\n\n\t\t// These are JSHint boolean options which are shared with JSLint\n\t\t// where the name has been changed but the effect is unchanged\n\t\trenamedOptions = {\n\t\t\teqeq : \"eqeqeq\",\n\t\t\tvars : \"onevar\",\n\t\t\twindows: \"wsh\"\n\t\t},\n\n\t\tdeclared, // Globals that were declared using /*global ... */ syntax.\n\t\texported, // Variables that are used outside of the current file.\n\n\t\tfunctionicity = [\n\t\t\t\"closure\", \"exception\", \"global\", \"label\",\n\t\t\t\"outer\", \"unused\", \"var\"\n\t\t],\n\n\t\tfunct, // The current function\n\t\tfunctions, // All of the functions\n\n\t\tglobal, // The global scope\n\t\tignored, // Ignored warnings\n\t\timplied, // Implied globals\n\t\tinblock,\n\t\tindent,\n\t\tlookahead,\n\t\tlex,\n\t\tmember,\n\t\tmembersOnly,\n\t\tnoreach,\n\t\tpredefined,\t\t// Global variables defined by option\n\n\t\tscope, // The current scope\n\t\tstack,\n\t\tunuseds,\n\t\turls,\n\t\tuseESNextSyntax,\n\t\twarnings,\n\n\t\textraModules = [],\n\t\temitter = new events.EventEmitter();\n\n\tfunction checkOption(name, t) {\n\t\tname = name.trim();\n\n\t\tif (/^-W\\d{3}$/g.test(name)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (valOptions[name] === undefined && boolOptions[name] === undefined) {\n\t\t\tif (t.type !== \"jslint\" || renamedOptions[name] === undefined) {\n\t\t\t\terror(\"E001\", t, name);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction isString(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object String]\";\n\t}\n\n\tfunction isIdentifier(tkn, value) {\n\t\tif (!tkn)\n\t\t\treturn false;\n\n\t\tif (!tkn.identifier || tkn.value !== value)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}\n\n\tfunction isReserved(token) {\n\t\tif (!token.reserved) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (token.meta && token.meta.isFutureReservedWord) {\n\t\t\t// ES3 FutureReservedWord in an ES5 environment.\n\t\t\tif (state.option.es5 && !token.meta.es5) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Some ES5 FutureReservedWord identifiers are active only\n\t\t\t// within a strict mode environment.\n\t\t\tif (token.meta.strictOnly) {\n\t\t\t\tif (!state.option.strict && !state.directive[\"use strict\"]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (token.isProperty) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction supplant(str, data) {\n\t\treturn str.replace(/\\{([^{}]*)\\}/g, function (a, b) {\n\t\t\tvar r = data[b];\n\t\t\treturn typeof r === \"string\" || typeof r === \"number\" ? r : a;\n\t\t});\n\t}\n\n\tfunction combine(t, o) {\n\t\tvar n;\n\t\tfor (n in o) {\n\t\t\tif (_.has(o, n) && !_.has(JSHINT.blacklist, n)) {\n\t\t\t\tt[n] = o[n];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction updatePredefined() {\n\t\tObject.keys(JSHINT.blacklist).forEach(function (key) {\n\t\t\tdelete predefined[key];\n\t\t});\n\t}\n\n\tfunction assume() {\n\t\tif (state.option.couch) {\n\t\t\tcombine(predefined, vars.couch);\n\t\t}\n\n\t\tif (state.option.rhino) {\n\t\t\tcombine(predefined, vars.rhino);\n\t\t}\n\n\t\tif (state.option.prototypejs) {\n\t\t\tcombine(predefined, vars.prototypejs);\n\t\t}\n\n\t\tif (state.option.node) {\n\t\t\tcombine(predefined, vars.node);\n\t\t}\n\n\t\tif (state.option.devel) {\n\t\t\tcombine(predefined, vars.devel);\n\t\t}\n\n\t\tif (state.option.dojo) {\n\t\t\tcombine(predefined, vars.dojo);\n\t\t}\n\n\t\tif (state.option.browser) {\n\t\t\tcombine(predefined, vars.browser);\n\t\t}\n\n\t\tif (state.option.nonstandard) {\n\t\t\tcombine(predefined, vars.nonstandard);\n\t\t}\n\n\t\tif (state.option.jquery) {\n\t\t\tcombine(predefined, vars.jquery);\n\t\t}\n\n\t\tif (state.option.mootools) {\n\t\t\tcombine(predefined, vars.mootools);\n\t\t}\n\n\t\tif (state.option.worker) {\n\t\t\tcombine(predefined, vars.worker);\n\t\t}\n\n\t\tif (state.option.wsh) {\n\t\t\tcombine(predefined, vars.wsh);\n\t\t}\n\n\t\tif (state.option.esnext) {\n\t\t\tuseESNextSyntax();\n\t\t}\n\n\t\tif (state.option.globalstrict && state.option.strict !== false) {\n\t\t\tstate.option.strict = true;\n\t\t}\n\n\t\tif (state.option.yui) {\n\t\t\tcombine(predefined, vars.yui);\n\t\t}\n\t}\n\n\n\t// Produce an error warning.\n\tfunction quit(code, line, chr) {\n\t\tvar percentage = Math.floor((line / state.lines.length) * 100);\n\t\tvar message = messages.errors[code].desc;\n\n\t\tthrow {\n\t\t\tname: \"JSHintError\",\n\t\t\tline: line,\n\t\t\tcharacter: chr,\n\t\t\tmessage: message + \" (\" + percentage + \"% scanned).\",\n\t\t\traw: message\n\t\t};\n\t}\n\n\tfunction isundef(scope, code, token, a) {\n\t\treturn JSHINT.undefs.push([scope, code, token, a]);\n\t}\n\n\tfunction warning(code, t, a, b, c, d) {\n\t\tvar ch, l, w, msg;\n\n\t\tif (/^W\\d{3}$/.test(code)) {\n\t\t\tif (ignored[code]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmsg = messages.warnings[code];\n\t\t} else if (/E\\d{3}/.test(code)) {\n\t\t\tmsg = messages.errors[code];\n\t\t} else if (/I\\d{3}/.test(code)) {\n\t\t\tmsg = messages.info[code];\n\t\t}\n\n\t\tt = t || state.tokens.next;\n\t\tif (t.id === \"(end)\") { // `~\n\t\t\tt = state.tokens.curr;\n\t\t}\n\n\t\tl = t.line || 0;\n\t\tch = t.from || 0;\n\n\t\tw = {\n\t\t\tid: \"(error)\",\n\t\t\traw: msg.desc,\n\t\t\tcode: msg.code,\n\t\t\tevidence: state.lines[l - 1] || \"\",\n\t\t\tline: l,\n\t\t\tcharacter: ch,\n\t\t\tscope: JSHINT.scope,\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\td: d\n\t\t};\n\n\t\tw.reason = supplant(msg.desc, w);\n\t\tJSHINT.errors.push(w);\n\n\t\tif (state.option.passfail) {\n\t\t\tquit(\"E042\", l, ch);\n\t\t}\n\n\t\twarnings += 1;\n\t\tif (warnings >= state.option.maxerr) {\n\t\t\tquit(\"E043\", l, ch);\n\t\t}\n\n\t\treturn w;\n\t}\n\n\tfunction warningAt(m, l, ch, a, b, c, d) {\n\t\treturn warning(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\tfunction error(m, t, a, b, c, d) {\n\t\twarning(m, t, a, b, c, d);\n\t}\n\n\tfunction errorAt(m, l, ch, a, b, c, d) {\n\t\treturn error(m, {\n\t\t\tline: l,\n\t\t\tfrom: ch\n\t\t}, a, b, c, d);\n\t}\n\n\t// Tracking of \"internal\" scripts, like eval containing a static string\n\tfunction addInternalSrc(elem, src) {\n\t\tvar i;\n\t\ti = {\n\t\t\tid: \"(internal)\",\n\t\t\telem: elem,\n\t\t\tvalue: src\n\t\t};\n\t\tJSHINT.internals.push(i);\n\t\treturn i;\n\t}\n\n\tfunction addlabel(t, type, tkn) {\n\t\t// Define t in the current function in the current scope.\n\t\tif (type === \"exception\") {\n\t\t\tif (_.has(funct[\"(context)\"], t)) {\n\t\t\t\tif (funct[t] !== true && !state.option.node) {\n\t\t\t\t\twarning(\"W002\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (_.has(funct, t) && !funct[\"(global)\"]) {\n\t\t\tif (funct[t] === true) {\n\t\t\t\tif (state.option.latedef)\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t} else {\n\t\t\t\tif (!state.option.shadow && type !== \"exception\") {\n\t\t\t\t\twarning(\"W004\", state.tokens.next, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunct[t] = type;\n\n\t\tif (tkn) {\n\t\t\tfunct[\"(tokens)\"][t] = tkn;\n\t\t}\n\n\t\tif (funct[\"(global)\"]) {\n\t\t\tglobal[t] = funct;\n\t\t\tif (_.has(implied, t)) {\n\t\t\t\tif (state.option.latedef) {\n\t\t\t\t\twarning(\"W003\", state.tokens.next, t);\n\t\t\t\t}\n\n\t\t\t\tdelete implied[t];\n\t\t\t}\n\t\t} else {\n\t\t\tscope[t] = funct;\n\t\t}\n\t}\n\n\tfunction doOption() {\n\t\tvar nt = state.tokens.next;\n\t\tvar body = nt.body.split(\",\").map(function (s) { return s.trim(); });\n\t\tvar predef = {};\n\n\t\tif (nt.type === \"globals\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = g[0];\n\t\t\t\tvar val = g[1];\n\n\t\t\t\tif (key.charAt(0) === \"-\") {\n\t\t\t\t\tkey = key.slice(1);\n\t\t\t\t\tval = false;\n\n\t\t\t\t\tJSHINT.blacklist[key] = key;\n\t\t\t\t\tupdatePredefined();\n\t\t\t\t} else {\n\t\t\t\t\tpredef[key] = (val === \"true\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tcombine(predefined, predef);\n\n\t\t\tfor (var key in predef) {\n\t\t\t\tif (_.has(predef, key)) {\n\t\t\t\t\tdeclared[key] = nt;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (nt.type === \"exported\") {\n\t\t\tbody.forEach(function (e) {\n\t\t\t\texported[e] = true;\n\t\t\t});\n\t\t}\n\n\t\tif (nt.type === \"members\") {\n\t\t\tmembersOnly = membersOnly || {};\n\n\t\t\tbody.forEach(function (m) {\n\t\t\t\tvar ch1 = m.charAt(0);\n\t\t\t\tvar ch2 = m.charAt(m.length - 1);\n\n\t\t\t\tif (ch1 === ch2 && (ch1 === \"\\\"\" || ch1 === \"'\")) {\n\t\t\t\t\tm = m\n\t\t\t\t\t\t.substr(1, m.length - 2)\n\t\t\t\t\t\t.replace(\"\\\\b\", \"\\b\")\n\t\t\t\t\t\t.replace(\"\\\\t\", \"\\t\")\n\t\t\t\t\t\t.replace(\"\\\\n\", \"\\n\")\n\t\t\t\t\t\t.replace(\"\\\\v\", \"\\v\")\n\t\t\t\t\t\t.replace(\"\\\\f\", \"\\f\")\n\t\t\t\t\t\t.replace(\"\\\\r\", \"\\r\")\n\t\t\t\t\t\t.replace(\"\\\\\\\\\", \"\\\\\")\n\t\t\t\t\t\t.replace(\"\\\\\\\"\", \"\\\"\");\n\t\t\t\t}\n\n\t\t\t\tmembersOnly[m] = false;\n\t\t\t});\n\t\t}\n\n\t\tvar numvals = [\n\t\t\t\"maxstatements\",\n\t\t\t\"maxparams\",\n\t\t\t\"maxdepth\",\n\t\t\t\"maxcomplexity\",\n\t\t\t\"maxerr\",\n\t\t\t\"maxlen\",\n\t\t\t\"indent\"\n\t\t];\n\n\t\tif (nt.type === \"jshint\" || nt.type === \"jslint\") {\n\t\t\tbody.forEach(function (g) {\n\t\t\t\tg = g.split(\":\");\n\t\t\t\tvar key = (g[0] || \"\").trim();\n\t\t\t\tvar val = (g[1] || \"\").trim();\n\n\t\t\t\tif (!checkOption(key, nt)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (numvals.indexOf(key) >= 0) {\n\t\t\t\t\tval = +val;\n\n\t\t\t\t\tif (typeof val !== \"number\" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) {\n\t\t\t\t\t\terror(\"E032\", nt, g[1].trim());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"indent\") {\n\t\t\t\t\t\tstate.option[\"(explicitIndent)\"] = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.option[key] = val;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"validthis\") {\n\t\t\t\t\t// `validthis` is valid only within a function scope.\n\t\t\t\t\tif (funct[\"(global)\"]) {\n\t\t\t\t\t\terror(\"E009\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\t\t\tstate.option.validthis = (val === \"true\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key === \"quotmark\") {\n\t\t\t\t\tswitch (val) {\n\t\t\t\t\tcase \"true\":\n\t\t\t\t\tcase \"false\":\n\t\t\t\t\t\tstate.option.quotmark = (val === \"true\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\tcase \"single\":\n\t\t\t\t\t\tstate.option.quotmark = val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E002\", nt);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (/^-W\\d{3}$/g.test(key)) {\n\t\t\t\t\tignored[key.slice(1)] = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tn;\n\t\t\t\tif (val === \"true\" || val === \"false\") {\n\t\t\t\t\tif (nt.type === \"jslint\") {\n\t\t\t\t\t\ttn = renamedOptions[key] || key;\n\t\t\t\t\t\tstate.option[tn] = (val === \"true\");\n\n\t\t\t\t\t\tif (invertedOptions[tn] !== undefined) {\n\t\t\t\t\t\t\tstate.option[tn] = !state.option[tn];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.option[key] = (val === \"true\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === \"newcap\") {\n\t\t\t\t\t\tstate.option[\"(explicitNewcap)\"] = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\terror(\"E002\", nt);\n\t\t\t});\n\n\t\t\tassume();\n\t\t}\n\t}\n\n\t// We need a peek function. If it has an argument, it peeks that much farther\n\t// ahead. It is used to distinguish\n\t//\t for ( var i in ...\n\t// from\n\t//\t for ( var i = ...\n\n\tfunction peek(p) {\n\t\tvar i = p || 0, j = 0, t;\n\n\t\twhile (j <= i) {\n\t\t\tt = lookahead[j];\n\t\t\tif (!t) {\n\t\t\t\tt = lookahead[j] = lex.token();\n\t\t\t}\n\t\t\tj += 1;\n\t\t}\n\t\treturn t;\n\t}\n\n\t// Produce the next token. It looks for programming errors.\n\n\tfunction advance(id, t) {\n\t\tswitch (state.tokens.curr.id) {\n\t\tcase \"(number)\":\n\t\t\tif (state.tokens.next.id === \".\") {\n\t\t\t\twarning(\"W005\", state.tokens.curr);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tif (state.tokens.next.id === \"-\" || state.tokens.next.id === \"--\") {\n\t\t\t\twarning(\"W006\");\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"+\":\n\t\t\tif (state.tokens.next.id === \"+\" || state.tokens.next.id === \"++\") {\n\t\t\t\twarning(\"W007\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tif (state.tokens.curr.type === \"(string)\" || state.tokens.curr.identifier) {\n\t\t\tanonname = state.tokens.curr.value;\n\t\t}\n\n\t\tif (id && state.tokens.next.id !== id) {\n\t\t\tif (t) {\n\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\terror(\"E019\", t, t.id);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E020\", state.tokens.next, id, t.id, t.line, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t} else if (state.tokens.next.type !== \"(identifier)\" || state.tokens.next.value !== id) {\n\t\t\t\twarning(\"W116\", state.tokens.next, id, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\n\t\tstate.tokens.prev = state.tokens.curr;\n\t\tstate.tokens.curr = state.tokens.next;\n\t\tfor (;;) {\n\t\t\tstate.tokens.next = lookahead.shift() || lex.token();\n\n\t\t\tif (!state.tokens.next) { // No more tokens left, give up\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \"(end)\" || state.tokens.next.id === \"(error)\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (state.tokens.next.isSpecial) {\n\t\t\t\tdoOption();\n\t\t\t} else {\n\t\t\t\tif (state.tokens.next.id !== \"(endline)\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it\n\t// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is\n\t// like .nud except that it is only used on the first token of a statement.\n\t// Having .fud makes it much easier to define statement-oriented languages like\n\t// JavaScript. I retained Pratt's nomenclature.\n\n\t// .nud Null denotation\n\t// .fud First null denotation\n\t// .led Left denotation\n\t// lbp Left binding power\n\t// rbp Right binding power\n\n\t// They are elements of the parsing method called Top Down Operator Precedence.\n\n\tfunction expression(rbp, initial) {\n\t\tvar left, isArray = false, isObject = false;\n\n\t\tif (state.tokens.next.id === \"(end)\")\n\t\t\terror(\"E006\", state.tokens.curr);\n\n\t\tadvance();\n\n\t\tif (initial) {\n\t\t\tanonname = \"anonymous\";\n\t\t\tfunct[\"(verb)\"] = state.tokens.curr.value;\n\t\t}\n\n\t\tif (initial === true && state.tokens.curr.fud) {\n\t\t\tleft = state.tokens.curr.fud();\n\t\t} else {\n\t\t\tif (state.tokens.curr.nud) {\n\t\t\t\tleft = state.tokens.curr.nud();\n\t\t\t} else {\n\t\t\t\terror(\"E030\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t}\n\n\t\t\twhile (rbp < state.tokens.next.lbp) {\n\t\t\t\tisArray = state.tokens.curr.value === \"Array\";\n\t\t\t\tisObject = state.tokens.curr.value === \"Object\";\n\n\t\t\t\t// #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object()\n\t\t\t\t// Line breaks in IfStatement heads exist to satisfy the checkJSHint\n\t\t\t\t// \"Line too long.\" error.\n\t\t\t\tif (left && (left.value || (left.first && left.first.value))) {\n\t\t\t\t\t// If the left.value is not \"new\", or the left.first.value is a \".\"\n\t\t\t\t\t// then safely assume that this is not \"new Array()\" and possibly\n\t\t\t\t\t// not \"new Object()\"...\n\t\t\t\t\tif (left.value !== \"new\" ||\n\t\t\t\t\t (left.first && left.first.value && left.first.value === \".\")) {\n\t\t\t\t\t\tisArray = false;\n\t\t\t\t\t\t// ...In the case of Object, if the left.value and state.tokens.curr.value\n\t\t\t\t\t\t// are not equal, then safely assume that this not \"new Object()\"\n\t\t\t\t\t\tif (left.value !== state.tokens.curr.value) {\n\t\t\t\t\t\t\tisObject = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tadvance();\n\n\t\t\t\tif (isArray && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W009\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (isObject && state.tokens.curr.id === \"(\" && state.tokens.next.id === \")\") {\n\t\t\t\t\twarning(\"W010\", state.tokens.curr);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.led) {\n\t\t\t\t\tleft = state.tokens.curr.led(left);\n\t\t\t\t} else {\n\t\t\t\t\terror(\"E033\", state.tokens.curr, state.tokens.curr.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn left;\n\t}\n\n\n// Functions for conformance of style.\n\n\tfunction adjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white) {\n\t\t\tif (left.character !== right.from && left.line === right.line) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W011\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreak(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && (left.character !== right.from || left.line !== right.line)) {\n\t\t\twarning(\"W012\", right, right.value);\n\t\t}\n\t}\n\n\tfunction nospace(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (state.option.white && !left.comment) {\n\t\t\tif (left.line === right.line) {\n\t\t\t\tadjacent(left, right);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nonadjacent(left, right) {\n\t\tif (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\n\t\t\tif (left.value === \";\" && right.value === \";\") {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (left.line === right.line && left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction nobreaknonadjacent(left, right) {\n\t\tleft = left || state.tokens.curr;\n\t\tright = right || state.tokens.next;\n\t\tif (!state.option.laxbreak && left.line !== right.line) {\n\t\t\twarning(\"W014\", right, right.id);\n\t\t} else if (state.option.white) {\n\t\t\tleft = left || state.tokens.curr;\n\t\t\tright = right || state.tokens.next;\n\t\t\tif (left.character === right.from) {\n\t\t\t\tleft.from += (left.character - left.from);\n\t\t\t\twarning(\"W013\", left, left.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction indentation(bias) {\n\t\tif (!state.option.white && !state.option[\"(explicitIndent)\"]) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = indent + (bias || 0);\n\t\tif (state.tokens.next.from !== i) {\n\t\t\twarning(\"W015\", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from);\n\t\t}\n\t}\n\n\tfunction nolinebreak(t) {\n\t\tt = t || state.tokens.curr;\n\t\tif (t.line !== state.tokens.next.line) {\n\t\t\twarning(\"E022\", t, t.value);\n\t\t}\n\t}\n\n\n\tfunction comma(opts) {\n\t\topts = opts || {};\n\n\t\tif (state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\tif (!state.option.laxcomma) {\n\t\t\t\tif (comma.first) {\n\t\t\t\t\twarning(\"I001\");\n\t\t\t\t\tcomma.first = false;\n\t\t\t\t}\n\t\t\t\twarning(\"W014\", state.tokens.curr, state.tokens.next.id);\n\t\t\t}\n\t\t} else if (!state.tokens.curr.comment &&\n\t\t\t\tstate.tokens.curr.character !== state.tokens.next.from && state.option.white) {\n\t\t\tstate.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from);\n\t\t\twarning(\"W011\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\n\t\tadvance(\",\");\n\n\t\t// TODO: This is a temporary solution to fight against false-positives in\n\t\t// arrays and objects with trailing commas (see GH-363). The best solution\n\t\t// would be to extract all whitespace rules out of parser.\n\n\t\tif (state.tokens.next.value !== \"]\" && state.tokens.next.value !== \"}\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\n\t\tif (state.tokens.next.identifier) {\n\t\t\t// Keywords that cannot follow a comma operator.\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"break\":\n\t\t\tcase \"case\":\n\t\t\tcase \"catch\":\n\t\t\tcase \"continue\":\n\t\t\tcase \"default\":\n\t\t\tcase \"do\":\n\t\t\tcase \"else\":\n\t\t\tcase \"finally\":\n\t\t\tcase \"for\":\n\t\t\tcase \"if\":\n\t\t\tcase \"in\":\n\t\t\tcase \"instanceof\":\n\t\t\tcase \"return\":\n\t\t\tcase \"switch\":\n\t\t\tcase \"throw\":\n\t\t\tcase \"try\":\n\t\t\tcase \"var\":\n\t\t\tcase \"while\":\n\t\t\tcase \"with\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.type === \"(punctuator)\") {\n\t\t\tswitch (state.tokens.next.value) {\n\t\t\tcase \"}\":\n\t\t\tcase \"]\":\n\t\t\tcase \",\":\n\t\t\t\tif (opts.allowTrailing) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* falls through */\n\t\t\tcase \")\":\n\t\t\t\terror(\"E024\", state.tokens.next, state.tokens.next.value);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Functional constructors for making the symbols that will be inherited by\n\t// tokens.\n\n\tfunction symbol(s, p) {\n\t\tvar x = state.syntax[s];\n\t\tif (!x || typeof x !== \"object\") {\n\t\t\tstate.syntax[s] = x = {\n\t\t\t\tid: s,\n\t\t\t\tlbp: p,\n\t\t\t\tvalue: s\n\t\t\t};\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction delim(s) {\n\t\treturn symbol(s, 0);\n\t}\n\n\tfunction stmt(s, f) {\n\t\tvar x = delim(s);\n\t\tx.identifier = x.reserved = true;\n\t\tx.fud = f;\n\t\treturn x;\n\t}\n\n\tfunction blockstmt(s, f) {\n\t\tvar x = stmt(s, f);\n\t\tx.block = true;\n\t\treturn x;\n\t}\n\n\tfunction reserveName(x) {\n\t\tvar c = x.id.charAt(0);\n\t\tif ((c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\")) {\n\t\t\tx.identifier = x.reserved = true;\n\t\t}\n\t\treturn x;\n\t}\n\n\tfunction prefix(s, f) {\n\t\tvar x = symbol(s, 150);\n\t\treserveName(x);\n\t\tx.nud = (typeof f === \"function\") ? f : function () {\n\t\t\tthis.right = expression(150);\n\t\t\tthis.arity = \"unary\";\n\t\t\tif (this.id === \"++\" || this.id === \"--\") {\n\t\t\t\tif (state.option.plusplus) {\n\t\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t\t} else if ((!this.right.identifier || isReserved(this.right)) &&\n\t\t\t\t\t\tthis.right.id !== \".\" && this.right.id !== \"[\") {\n\t\t\t\t\twarning(\"W017\", this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction type(s, f) {\n\t\tvar x = delim(s);\n\t\tx.type = s;\n\t\tx.nud = f;\n\t\treturn x;\n\t}\n\n\tfunction reserve(name, func) {\n\t\tvar x = type(name, func);\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\treturn x;\n\t}\n\n\tfunction FutureReservedWord(name, meta) {\n\t\tvar x = type(name, function () {\n\t\t\treturn this;\n\t\t});\n\n\t\tmeta = meta || {};\n\t\tmeta.isFutureReservedWord = true;\n\n\t\tx.value = name;\n\t\tx.identifier = true;\n\t\tx.reserved = true;\n\t\tx.meta = meta;\n\n\t\treturn x;\n\t}\n\n\tfunction reservevar(s, v) {\n\t\treturn reserve(s, function () {\n\t\t\tif (typeof v === \"function\") {\n\t\t\t\tv(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t}\n\n\tfunction infix(s, f, p, w) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = function (left) {\n\t\t\tif (!w) {\n\t\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t\tif (s === \"in\" && left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\t\t\tif (typeof f === \"function\") {\n\t\t\t\treturn f(left, this);\n\t\t\t} else {\n\t\t\t\tthis.left = left;\n\t\t\t\tthis.right = expression(p);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction relation(s, f) {\n\t\tvar x = symbol(s, 100);\n\n\t\tx.led = function (left) {\n\t\t\tnobreaknonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tvar right = expression(100);\n\n\t\t\tif (isIdentifier(left, \"NaN\") || isIdentifier(right, \"NaN\")) {\n\t\t\t\twarning(\"W019\", this);\n\t\t\t} else if (f) {\n\t\t\t\tf.apply(this, [left, right]);\n\t\t\t}\n\n\t\t\tif (!left || !right) {\n\t\t\t\tquit(\"E041\", state.tokens.curr.line);\n\t\t\t}\n\n\t\t\tif (left.id === \"!\") {\n\t\t\t\twarning(\"W018\", left, \"!\");\n\t\t\t}\n\n\t\t\tif (right.id === \"!\") {\n\t\t\t\twarning(\"W018\", right, \"!\");\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\tfunction isPoorRelation(node) {\n\t\treturn node &&\n\t\t\t ((node.type === \"(number)\" && +node.value === 0) ||\n\t\t\t (node.type === \"(string)\" && node.value === \"\") ||\n\t\t\t (node.type === \"null\" && !state.option.eqnull) ||\n\t\t\t\tnode.type === \"true\" ||\n\t\t\t\tnode.type === \"false\" ||\n\t\t\t\tnode.type === \"undefined\");\n\t}\n\n\tfunction assignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\n\t\treturn infix(s, function (left, that) {\n\t\t\tthat.left = left;\n\n\t\t\tif (predefined[left.value] === false &&\n\t\t\t\t\tscope[left.value][\"(global)\"] === true) {\n\t\t\t\twarning(\"W020\", left);\n\t\t\t} else if (left[\"function\"]) {\n\t\t\t\twarning(\"W021\", left, left.value);\n\t\t\t}\n\n\t\t\tif (left) {\n\t\t\t\tif (state.option.esnext && funct[left.value] === \"const\") {\n\t\t\t\t\terror(\"E013\", left, left.value);\n\t\t\t\t}\n\n\t\t\t\tif (left.id === \".\" || left.id === \"[\") {\n\t\t\t\t\tif (!left.left || left.left.value === \"arguments\") {\n\t\t\t\t\t\twarning(\"E031\", that);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t} else if (left.identifier && !isReserved(left)) {\n\t\t\t\t\tif (funct[left.value] === \"exception\") {\n\t\t\t\t\t\twarning(\"W022\", left);\n\t\t\t\t\t}\n\t\t\t\t\tthat.right = expression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction bitwise(s, f, p) {\n\t\tvar x = symbol(s, p);\n\t\treserveName(x);\n\t\tx.led = (typeof f === \"function\") ? f : function (left) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t}\n\t\t\tthis.left = left;\n\t\t\tthis.right = expression(p);\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\n\tfunction bitwiseassignop(s) {\n\t\tsymbol(s, 20).exps = true;\n\t\treturn infix(s, function (left, that) {\n\t\t\tif (state.option.bitwise) {\n\t\t\t\twarning(\"W016\", that, that.id);\n\t\t\t}\n\t\t\tnonadjacent(state.tokens.prev, state.tokens.curr);\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tif (left) {\n\t\t\t\tif (left.id === \".\" || left.id === \"[\" ||\n\t\t\t\t\t\t(left.identifier && !isReserved(left))) {\n\t\t\t\t\texpression(19);\n\t\t\t\t\treturn that;\n\t\t\t\t}\n\t\t\t\tif (left === state.syntax[\"function\"]) {\n\t\t\t\t\twarning(\"W023\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t}\n\t\t\terror(\"E031\", that);\n\t\t}, 20);\n\t}\n\n\n\tfunction suffix(s) {\n\t\tvar x = symbol(s, 150);\n\n\t\tx.led = function (left) {\n\t\t\tif (state.option.plusplus) {\n\t\t\t\twarning(\"W016\", this, this.id);\n\t\t\t} else if ((!left.identifier || isReserved(left)) && left.id !== \".\" && left.id !== \"[\") {\n\t\t\t\twarning(\"W017\", this);\n\t\t\t}\n\n\t\t\tthis.left = left;\n\t\t\treturn this;\n\t\t};\n\t\treturn x;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument (see identifier())\n\t// prop means that this identifier is that of an object property\n\n\tfunction optionalidentifier(fnparam, prop) {\n\t\tif (!state.tokens.next.identifier) {\n\t\t\treturn;\n\t\t}\n\n\t\tadvance();\n\n\t\tvar curr = state.tokens.curr;\n\t\tvar meta = curr.meta || {};\n\t\tvar val = state.tokens.curr.value;\n\n\t\tif (!isReserved(curr)) {\n\t\t\treturn val;\n\t\t}\n\n\t\tif (prop) {\n\t\t\tif (state.option.es5 || meta.isFutureReservedWord) {\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\n\t\tif (fnparam && val === \"undefined\") {\n\t\t\treturn val;\n\t\t}\n\n\t\twarning(\"W024\", state.tokens.curr, state.tokens.curr.id);\n\t\treturn val;\n\t}\n\n\t// fnparam means that this identifier is being defined as a function\n\t// argument\n\t// prop means that this identifier is that of an object property\n\tfunction identifier(fnparam, prop) {\n\t\tvar i = optionalidentifier(fnparam, prop);\n\t\tif (i) {\n\t\t\treturn i;\n\t\t}\n\t\tif (state.tokens.curr.id === \"function\" && state.tokens.next.id === \"(\") {\n\t\t\twarning(\"W025\");\n\t\t} else {\n\t\t\terror(\"E030\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t}\n\n\n\tfunction reachable(s) {\n\t\tvar i = 0, t;\n\t\tif (state.tokens.next.id !== \";\" || noreach) {\n\t\t\treturn;\n\t\t}\n\t\tfor (;;) {\n\t\t\tt = peek(i);\n\t\t\tif (t.reach) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (t.id !== \"(endline)\") {\n\t\t\t\tif (t.id === \"function\") {\n\t\t\t\t\tif (!state.option.latedef) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\twarning(\"W026\", t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twarning(\"W027\", t, t.value, s);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti += 1;\n\t\t}\n\t}\n\n\n\tfunction statement(noindent) {\n\t\tvar i = indent, r, s = scope, t = state.tokens.next;\n\n\t\tif (t.id === \";\") {\n\t\t\tadvance(\";\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Is this a labelled statement?\n\t\tvar res = isReserved(t);\n\n\t\t// We're being more tolerant here: if someone uses\n\t\t// a FutureReservedWord as a label, we warn but proceed\n\t\t// anyway.\n\n\t\tif (res && t.meta && t.meta.isFutureReservedWord) {\n\t\t\twarning(\"W024\", t, t.id);\n\t\t\tres = false;\n\t\t}\n\n\t\tif (t.identifier && !res && peek().id === \":\") {\n\t\t\tadvance();\n\t\t\tadvance(\":\");\n\t\t\tscope = Object.create(s);\n\t\t\taddlabel(t.value, \"label\");\n\n\t\t\tif (!state.tokens.next.labelled && state.tokens.next.value !== \"{\") {\n\t\t\t\twarning(\"W028\", state.tokens.next, t.value, state.tokens.next.value);\n\t\t\t}\n\n\t\t\tif (reg.javascriptURL.test(t.value + \":\")) {\n\t\t\t\twarning(\"W029\", t, t.value);\n\t\t\t}\n\n\t\t\tstate.tokens.next.label = t.value;\n\t\t\tt = state.tokens.next;\n\t\t}\n\n\t\t// Is it a lonely block?\n\n\t\tif (t.id === \"{\") {\n\t\t\tblock(true, true);\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse the statement.\n\n\t\tif (!noindent) {\n\t\t\tindentation();\n\t\t}\n\t\tr = expression(0, true);\n\n\t\t// Look for the final semicolon.\n\n\t\tif (!t.block) {\n\t\t\tif (!state.option.expr && (!r || !r.exps)) {\n\t\t\t\twarning(\"W030\", state.tokens.curr);\n\t\t\t} else if (state.option.nonew && r.id === \"(\" && r.left.id === \"new\") {\n\t\t\t\twarning(\"W031\", t);\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\treturn comma();\n\t\t\t}\n\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (!state.option.asi) {\n\t\t\t\t\t// If this is the last statement in a block that ends on\n\t\t\t\t\t// the same line *and* option lastsemic is on, ignore the warning.\n\t\t\t\t\t// Otherwise, complain about missing semicolon.\n\t\t\t\t\tif (!state.option.lastsemic || state.tokens.next.id !== \"}\" ||\n\t\t\t\t\t\tstate.tokens.next.line !== state.tokens.curr.line) {\n\t\t\t\t\t\twarningAt(\"W033\", state.tokens.curr.line, state.tokens.curr.character);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\";\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t}\n\t\t}\n\n\t\t// Restore the indentation.\n\n\t\tindent = i;\n\t\tscope = s;\n\t\treturn r;\n\t}\n\n\n\tfunction statements(startLine) {\n\t\tvar a = [], p;\n\n\t\twhile (!state.tokens.next.reach && state.tokens.next.id !== \"(end)\") {\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\tp = peek();\n\n\t\t\t\tif (!p || (p.id !== \"(\" && p.id !== \"[\")) {\n\t\t\t\t\twarning(\"W032\");\n\t\t\t\t}\n\n\t\t\t\tadvance(\";\");\n\t\t\t} else {\n\t\t\t\ta.push(statement(startLine === state.tokens.next.line));\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n\n\n\t/*\n\t * read all directives\n\t * recognizes a simple form of asi, but always\n\t * warns, if it is used\n\t */\n\tfunction directives() {\n\t\tvar i, p, pn;\n\n\t\tfor (;;) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tp = peek(0);\n\t\t\t\tif (p.id === \"(endline)\") {\n\t\t\t\t\ti = 1;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tpn = peek(i);\n\t\t\t\t\t\ti = i + 1;\n\t\t\t\t\t} while (pn.id === \"(endline)\");\n\n\t\t\t\t\tif (pn.id !== \";\") {\n\t\t\t\t\t\tif (pn.id !== \"(string)\" && pn.id !== \"(number)\" &&\n\t\t\t\t\t\t\tpn.id !== \"(regexp)\" && pn.identifier !== true &&\n\t\t\t\t\t\t\tpn.id !== \"}\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twarning(\"W033\", state.tokens.next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp = pn;\n\t\t\t\t\t}\n\t\t\t\t} else if (p.id === \"}\") {\n\t\t\t\t\t// Directive with no other statements, warn about missing semicolon\n\t\t\t\t\twarning(\"W033\", p);\n\t\t\t\t} else if (p.id !== \";\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tindentation();\n\t\t\t\tadvance();\n\t\t\t\tif (state.directive[state.tokens.curr.value]) {\n\t\t\t\t\twarning(\"W034\", state.tokens.curr, state.tokens.curr.value);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.curr.value === \"use strict\") {\n\t\t\t\t\tif (!state.option[\"(explicitNewcap)\"])\n\t\t\t\t\t\tstate.option.newcap = true;\n\t\t\t\t\tstate.option.undef = true;\n\t\t\t\t}\n\n\t\t\t\t// there's no directive negation, so always set to true\n\t\t\t\tstate.directive[state.tokens.curr.value] = true;\n\n\t\t\t\tif (p.id === \";\") {\n\t\t\t\t\tadvance(\";\");\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\t/*\n\t * Parses a single block. A block is a sequence of statements wrapped in\n\t * braces.\n\t *\n\t * ordinary - true for everything but function bodies and try blocks.\n\t * stmt\t\t- true if block can be a single statement (e.g. in if/for/while).\n\t * isfunc\t- true if block is a function body\n\t */\n\tfunction block(ordinary, stmt, isfunc) {\n\t\tvar a,\n\t\t\tb = inblock,\n\t\t\told_indent = indent,\n\t\t\tm,\n\t\t\ts = scope,\n\t\t\tt,\n\t\t\tline,\n\t\t\td;\n\n\t\tinblock = ordinary;\n\n\t\tif (!ordinary || !state.option.funcscope)\n\t\t\tscope = Object.create(scope);\n\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\n\t\tvar metrics = funct[\"(metrics)\"];\n\t\tmetrics.nestedBlockDepth += 1;\n\t\tmetrics.verifyMaxNestedBlockDepthPerFunction();\n\n\t\tif (state.tokens.next.id === \"{\") {\n\t\t\tadvance(\"{\");\n\t\t\tline = state.tokens.curr.line;\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\twhile (!ordinary && state.tokens.next.from > indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tm = {};\n\t\t\t\t\tfor (d in state.directive) {\n\t\t\t\t\t\tif (_.has(state.directive, d)) {\n\t\t\t\t\t\t\tm[d] = state.directive[d];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectives();\n\n\t\t\t\t\tif (state.option.strict && funct[\"(context)\"][\"(global)\"]) {\n\t\t\t\t\t\tif (!m[\"use strict\"] && !state.directive[\"use strict\"]) {\n\t\t\t\t\t\t\twarning(\"E007\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ta = statements(line);\n\n\t\t\t\tmetrics.statementCount += a.length;\n\n\t\t\t\tif (isfunc) {\n\t\t\t\t\tstate.directive = m;\n\t\t\t\t}\n\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tif (line !== state.tokens.next.line) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\t\t\t} else if (line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", t);\n\t\t\tindent = old_indent;\n\t\t} else if (!ordinary) {\n\t\t\terror(\"E021\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t} else {\n\t\t\tif (!stmt || state.option.curly) {\n\t\t\t\twarning(\"W116\", state.tokens.next, \"{\", state.tokens.next.value);\n\t\t\t}\n\n\t\t\tnoreach = true;\n\t\t\tindent += state.option.indent;\n\t\t\t// test indentation only if statement is in new line\n\t\t\ta = [statement(state.tokens.next.line === state.tokens.curr.line)];\n\t\t\tindent -= state.option.indent;\n\t\t\tnoreach = false;\n\t\t}\n\t\tfunct[\"(verb)\"] = null;\n\t\tif (!ordinary || !state.option.funcscope) scope = s;\n\t\tinblock = b;\n\t\tif (ordinary && state.option.noempty && (!a || a.length === 0)) {\n\t\t\twarning(\"W035\");\n\t\t}\n\t\tmetrics.nestedBlockDepth -= 1;\n\t\treturn a;\n\t}\n\n\n\tfunction countMember(m) {\n\t\tif (membersOnly && typeof membersOnly[m] !== \"boolean\") {\n\t\t\twarning(\"W036\", state.tokens.curr, m);\n\t\t}\n\t\tif (typeof member[m] === \"number\") {\n\t\t\tmember[m] += 1;\n\t\t} else {\n\t\t\tmember[m] = 1;\n\t\t}\n\t}\n\n\n\tfunction note_implied(tkn) {\n\t\tvar name = tkn.value, line = tkn.line, a = implied[name];\n\t\tif (typeof a === \"function\") {\n\t\t\ta = false;\n\t\t}\n\n\t\tif (!a) {\n\t\t\ta = [line];\n\t\t\timplied[name] = a;\n\t\t} else if (a[a.length - 1] !== line) {\n\t\t\ta.push(line);\n\t\t}\n\t}\n\n\n\t// Build the syntax table by declaring the syntactic elements of the language.\n\n\ttype(\"(number)\", function () {\n\t\treturn this;\n\t});\n\n\ttype(\"(string)\", function () {\n\t\treturn this;\n\t});\n\n\tstate.syntax[\"(identifier)\"] = {\n\t\ttype: \"(identifier)\",\n\t\tlbp: 0,\n\t\tidentifier: true,\n\t\tnud: function () {\n\t\t\tvar v = this.value,\n\t\t\t\ts = scope[v],\n\t\t\t\tf;\n\n\t\t\tif (typeof s === \"function\") {\n\t\t\t\t// Protection against accidental inheritance.\n\t\t\t\ts = undefined;\n\t\t\t} else if (typeof s === \"boolean\") {\n\t\t\t\tf = funct;\n\t\t\t\tfunct = functions[0];\n\t\t\t\taddlabel(v, \"var\");\n\t\t\t\ts = funct;\n\t\t\t\tfunct = f;\n\t\t\t}\n\n\t\t\t// The name is in scope and defined in the current function.\n\t\t\tif (funct === s) {\n\t\t\t\t// Change 'unused' to 'var', and reject labels.\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[v] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"unction\":\n\t\t\t\t\tfunct[v] = \"function\";\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"function\":\n\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (funct[\"(global)\"]) {\n\t\t\t\t// The name is not defined in the function. If we are in the global\n\t\t\t\t// scope, then we have an undefined variable.\n\t\t\t\t//\n\t\t\t\t// Operators typeof and delete do not raise runtime errors even if\n\t\t\t\t// the base object of a reference is null so no need to display warning\n\t\t\t\t// if we're inside of typeof or delete.\n\n\t\t\t\tif (typeof predefined[v] !== \"boolean\") {\n\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t(state.tokens.next && (state.tokens.next.value === \".\" ||\n\t\t\t\t\t\t\tstate.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t} else {\n\t\t\t\t// If the name is already defined in the current\n\t\t\t\t// function, but not as outer, then there is a scope error.\n\n\t\t\t\tswitch (funct[v]) {\n\t\t\t\tcase \"closure\":\n\t\t\t\tcase \"function\":\n\t\t\t\tcase \"var\":\n\t\t\t\tcase \"unused\":\n\t\t\t\t\twarning(\"W038\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"label\":\n\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outer\":\n\t\t\t\tcase \"global\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// If the name is defined in an outer function, make an outer entry,\n\t\t\t\t\t// and if it was unused, make it var.\n\t\t\t\t\tif (s === true) {\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t} else if (s === null) {\n\t\t\t\t\t\twarning(\"W039\", state.tokens.curr, v);\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else if (typeof s !== \"object\") {\n\t\t\t\t\t\t// Operators typeof and delete do not raise runtime errors even\n\t\t\t\t\t\t// if the base object of a reference is null so no need to\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// display warning if we're inside of typeof or delete.\n\t\t\t\t\t\t// Attempting to subscript a null reference will throw an\n\t\t\t\t\t\t// error, even within the typeof and delete operators\n\t\t\t\t\t\tif (!(anonname === \"typeof\" || anonname === \"delete\") ||\n\t\t\t\t\t\t\t(state.tokens.next &&\n\t\t\t\t\t\t\t\t(state.tokens.next.value === \".\" || state.tokens.next.value === \"[\"))) {\n\n\t\t\t\t\t\t\tisundef(funct, \"W117\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfunct[v] = true;\n\t\t\t\t\t\tnote_implied(state.tokens.curr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (s[v]) {\n\t\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\tcase \"unction\":\n\t\t\t\t\t\t\tthis[\"function\"] = true;\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"var\":\n\t\t\t\t\t\tcase \"unused\":\n\t\t\t\t\t\t\ts[v] = \"closure\";\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"closure\":\n\t\t\t\t\t\t\tfunct[v] = s[\"(global)\"] ? \"global\" : \"outer\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"label\":\n\t\t\t\t\t\t\twarning(\"W037\", state.tokens.curr, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tled: function () {\n\t\t\terror(\"E033\", state.tokens.next, state.tokens.next.value);\n\t\t}\n\t};\n\n\ttype(\"(regexp)\", function () {\n\t\treturn this;\n\t});\n\n\t// ECMAScript parser\n\n\tdelim(\"(endline)\");\n\tdelim(\"(begin)\");\n\tdelim(\"(end)\").reach = true;\n\tdelim(\"(error)\").reach = true;\n\tdelim(\"}\").reach = true;\n\tdelim(\")\");\n\tdelim(\"]\");\n\tdelim(\"\\\"\").reach = true;\n\tdelim(\"'\").reach = true;\n\tdelim(\";\");\n\tdelim(\":\").reach = true;\n\tdelim(\",\");\n\tdelim(\"#\");\n\n\treserve(\"else\");\n\treserve(\"case\").reach = true;\n\treserve(\"catch\");\n\treserve(\"default\").reach = true;\n\treserve(\"finally\");\n\treservevar(\"arguments\", function (x) {\n\t\tif (state.directive[\"use strict\"] && funct[\"(global)\"]) {\n\t\t\twarning(\"E008\", x);\n\t\t}\n\t});\n\treservevar(\"eval\");\n\treservevar(\"false\");\n\treservevar(\"Infinity\");\n\treservevar(\"null\");\n\treservevar(\"this\", function (x) {\n\t\tif (state.directive[\"use strict\"] && !state.option.validthis && ((funct[\"(statement)\"] &&\n\t\t\t\tfunct[\"(name)\"].charAt(0) > \"Z\") || funct[\"(global)\"])) {\n\t\t\twarning(\"W040\", x);\n\t\t}\n\t});\n\treservevar(\"true\");\n\treservevar(\"undefined\");\n\n\tassignop(\"=\", \"assign\", 20);\n\tassignop(\"+=\", \"assignadd\", 20);\n\tassignop(\"-=\", \"assignsub\", 20);\n\tassignop(\"*=\", \"assignmult\", 20);\n\tassignop(\"/=\", \"assigndiv\", 20).nud = function () {\n\t\terror(\"E014\");\n\t};\n\tassignop(\"%=\", \"assignmod\", 20);\n\n\tbitwiseassignop(\"&=\", \"assignbitand\", 20);\n\tbitwiseassignop(\"|=\", \"assignbitor\", 20);\n\tbitwiseassignop(\"^=\", \"assignbitxor\", 20);\n\tbitwiseassignop(\"<<=\", \"assignshiftleft\", 20);\n\tbitwiseassignop(\">>=\", \"assignshiftright\", 20);\n\tbitwiseassignop(\">>>=\", \"assignshiftrightunsigned\", 20);\n\tinfix(\"?\", function (left, that) {\n\t\tthat.left = left;\n\t\tthat.right = expression(10);\n\t\tadvance(\":\");\n\t\tthat[\"else\"] = expression(10);\n\t\treturn that;\n\t}, 30);\n\n\tinfix(\"||\", \"or\", 40);\n\tinfix(\"&&\", \"and\", 50);\n\tbitwise(\"|\", \"bitor\", 70);\n\tbitwise(\"^\", \"bitxor\", 80);\n\tbitwise(\"&\", \"bitand\", 90);\n\trelation(\"==\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull && (left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq)\n\t\t\twarning(\"W116\", this, \"===\", \"==\");\n\t\telse if (isPoorRelation(left))\n\t\t\twarning(\"W041\", this, \"===\", left.value);\n\t\telse if (isPoorRelation(right))\n\t\t\twarning(\"W041\", this, \"===\", right.value);\n\n\t\treturn this;\n\t});\n\trelation(\"===\");\n\trelation(\"!=\", function (left, right) {\n\t\tvar eqnull = state.option.eqnull &&\n\t\t\t\t(left.value === \"null\" || right.value === \"null\");\n\n\t\tif (!eqnull && state.option.eqeqeq) {\n\t\t\twarning(\"W116\", this, \"!==\", \"!=\");\n\t\t} else if (isPoorRelation(left)) {\n\t\t\twarning(\"W041\", this, \"!==\", left.value);\n\t\t} else if (isPoorRelation(right)) {\n\t\t\twarning(\"W041\", this, \"!==\", right.value);\n\t\t}\n\t\treturn this;\n\t});\n\trelation(\"!==\");\n\trelation(\"<\");\n\trelation(\">\");\n\trelation(\"<=\");\n\trelation(\">=\");\n\tbitwise(\"<<\", \"shiftleft\", 120);\n\tbitwise(\">>\", \"shiftright\", 120);\n\tbitwise(\">>>\", \"shiftrightunsigned\", 120);\n\tinfix(\"in\", \"in\", 120);\n\tinfix(\"instanceof\", \"instanceof\", 120);\n\tinfix(\"+\", function (left, that) {\n\t\tvar right = expression(130);\n\t\tif (left && right && left.id === \"(string)\" && right.id === \"(string)\") {\n\t\t\tleft.value += right.value;\n\t\t\tleft.character = right.character;\n\t\t\tif (!state.option.scripturl && reg.javascriptURL.test(left.value)) {\n\t\t\t\twarning(\"W050\", left);\n\t\t\t}\n\t\t\treturn left;\n\t\t}\n\t\tthat.left = left;\n\t\tthat.right = right;\n\t\treturn that;\n\t}, 130);\n\tprefix(\"+\", \"num\");\n\tprefix(\"+++\", function () {\n\t\twarning(\"W007\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"+++\", function (left) {\n\t\twarning(\"W007\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"-\", \"sub\", 130);\n\tprefix(\"-\", \"neg\");\n\tprefix(\"---\", function () {\n\t\twarning(\"W006\");\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\t\treturn this;\n\t});\n\tinfix(\"---\", function (left) {\n\t\twarning(\"W006\");\n\t\tthis.left = left;\n\t\tthis.right = expression(130);\n\t\treturn this;\n\t}, 130);\n\tinfix(\"*\", \"mult\", 140);\n\tinfix(\"/\", \"div\", 140);\n\tinfix(\"%\", \"mod\", 140);\n\n\tsuffix(\"++\", \"postinc\");\n\tprefix(\"++\", \"preinc\");\n\tstate.syntax[\"++\"].exps = true;\n\n\tsuffix(\"--\", \"postdec\");\n\tprefix(\"--\", \"predec\");\n\tstate.syntax[\"--\"].exps = true;\n\tprefix(\"delete\", function () {\n\t\tvar p = expression(0);\n\t\tif (!p || (p.id !== \".\" && p.id !== \"[\")) {\n\t\t\twarning(\"W051\");\n\t\t}\n\t\tthis.first = p;\n\t\treturn this;\n\t}).exps = true;\n\n\tprefix(\"~\", function () {\n\t\tif (state.option.bitwise) {\n\t\t\twarning(\"W052\", this, \"~\");\n\t\t}\n\t\texpression(150);\n\t\treturn this;\n\t});\n\n\tprefix(\"!\", function () {\n\t\tthis.right = expression(150);\n\t\tthis.arity = \"unary\";\n\n\t\tif (!this.right) { // '!' followed by nothing? Give up.\n\t\t\tquit(\"E041\", this.line || 0);\n\t\t}\n\n\t\tif (bang[this.right.id] === true) {\n\t\t\twarning(\"W018\", this, \"!\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"typeof\", \"typeof\");\n\tprefix(\"new\", function () {\n\t\tvar c = expression(155), i;\n\t\tif (c && c.id !== \"function\") {\n\t\t\tif (c.identifier) {\n\t\t\t\tc[\"new\"] = true;\n\t\t\t\tswitch (c.value) {\n\t\t\t\tcase \"Number\":\n\t\t\t\tcase \"String\":\n\t\t\t\tcase \"Boolean\":\n\t\t\t\tcase \"Math\":\n\t\t\t\tcase \"JSON\":\n\t\t\t\t\twarning(\"W053\", state.tokens.prev, c.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Function\":\n\t\t\t\t\tif (!state.option.evil) {\n\t\t\t\t\t\twarning(\"W054\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Date\":\n\t\t\t\tcase \"RegExp\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (c.id !== \"function\") {\n\t\t\t\t\t\ti = c.value.substr(0, 1);\n\t\t\t\t\t\tif (state.option.newcap && (i < \"A\" || i > \"Z\") && !_.has(global, c.value)) {\n\t\t\t\t\t\t\twarning(\"W055\", state.tokens.curr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (c.id !== \".\" && c.id !== \"[\" && c.id !== \"(\") {\n\t\t\t\t\twarning(\"W056\", state.tokens.curr);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!state.option.supernew)\n\t\t\t\twarning(\"W057\", this);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\tif (state.tokens.next.id !== \"(\" && !state.option.supernew) {\n\t\t\twarning(\"W058\", state.tokens.curr, state.tokens.curr.value);\n\t\t}\n\t\tthis.first = c;\n\t\treturn this;\n\t});\n\tstate.syntax[\"new\"].exps = true;\n\n\tprefix(\"void\").exps = true;\n\n\tinfix(\".\", function (left, that) {\n\t\tadjacent(state.tokens.prev, state.tokens.curr);\n\t\tnobreak();\n\t\tvar m = identifier(false, true);\n\n\t\tif (typeof m === \"string\") {\n\t\t\tcountMember(m);\n\t\t}\n\n\t\tthat.left = left;\n\t\tthat.right = m;\n\n\t\tif (m && m === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tif (left && left.value === \"arguments\" && (m === \"callee\" || m === \"caller\")) {\n\t\t\tif (state.option.noarg)\n\t\t\t\twarning(\"W059\", left, m);\n\t\t\telse if (state.directive[\"use strict\"])\n\t\t\t\terror(\"E008\");\n\t\t} else if (!state.option.evil && left && left.value === \"document\" &&\n\t\t\t\t(m === \"write\" || m === \"writeln\")) {\n\t\t\twarning(\"W060\", left);\n\t\t}\n\n\t\tif (!state.option.evil && (m === \"eval\" || m === \"execScript\")) {\n\t\t\twarning(\"W061\");\n\t\t}\n\n\t\treturn that;\n\t}, 160, true);\n\n\tinfix(\"(\", function (left, that) {\n\t\tif (state.tokens.prev.id !== \"}\" && state.tokens.prev.id !== \")\") {\n\t\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\t}\n\n\t\tnospace();\n\t\tif (state.option.immed && !left.immed && left.id === \"function\") {\n\t\t\twarning(\"W062\");\n\t\t}\n\n\t\tvar n = 0;\n\t\tvar p = [];\n\n\t\tif (left) {\n\t\t\tif (left.type === \"(identifier)\") {\n\t\t\t\tif (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {\n\t\t\t\t\tif (\"Number String Boolean Date Object\".indexOf(left.value) === -1) {\n\t\t\t\t\t\tif (left.value === \"Math\") {\n\t\t\t\t\t\t\twarning(\"W063\", left);\n\t\t\t\t\t\t} else if (state.option.newcap) {\n\t\t\t\t\t\t\twarning(\"W064\", left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\tp[p.length] = expression(10);\n\t\t\t\tn += 1;\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\");\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\n\t\tif (typeof left === \"object\") {\n\t\t\tif (left.value === \"parseInt\" && n === 1) {\n\t\t\t\twarning(\"W065\", state.tokens.curr);\n\t\t\t}\n\t\t\tif (!state.option.evil) {\n\t\t\t\tif (left.value === \"eval\" || left.value === \"Function\" ||\n\t\t\t\t\t\tleft.value === \"execScript\") {\n\t\t\t\t\twarning(\"W061\", left);\n\n\t\t\t\t\tif (p[0] && [0].id === \"(string)\") {\n\t\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t\t}\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t (left.value === \"setTimeout\" ||\n\t\t\t\t\t\tleft.value === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\n\t\t\t\t// window.setTimeout/setInterval\n\t\t\t\t} else if (p[0] && p[0].id === \"(string)\" &&\n\t\t\t\t\t left.value === \".\" &&\n\t\t\t\t\t left.left.value === \"window\" &&\n\t\t\t\t\t (left.right === \"setTimeout\" ||\n\t\t\t\t\t\tleft.right === \"setInterval\")) {\n\t\t\t\t\twarning(\"W066\", left);\n\t\t\t\t\taddInternalSrc(left, p[0].value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!left.identifier && left.id !== \".\" && left.id !== \"[\" &&\n\t\t\t\t\tleft.id !== \"(\" && left.id !== \"&&\" && left.id !== \"||\" &&\n\t\t\t\t\tleft.id !== \"?\") {\n\t\t\t\twarning(\"W067\", left);\n\t\t\t}\n\t\t}\n\n\t\tthat.left = left;\n\t\treturn that;\n\t}, 155, true).exps = true;\n\n\tprefix(\"(\", function () {\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \"function\") {\n\t\t\tstate.tokens.next.immed = true;\n\t\t}\n\n\t\tvar exprs = [];\n\n\t\tif (state.tokens.next.id !== \")\") {\n\t\t\tfor (;;) {\n\t\t\t\texprs.push(expression(0));\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t}\n\n\t\tadvance(\")\", this);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tif (state.option.immed && exprs[0].id === \"function\") {\n\t\t\tif (state.tokens.next.id !== \"(\" &&\n\t\t\t (state.tokens.next.id !== \".\" || (peek().value !== \"call\" && peek().value !== \"apply\"))) {\n\t\t\t\twarning(\"W068\", this);\n\t\t\t}\n\t\t}\n\n\t\treturn exprs[0];\n\t});\n\n\tinfix(\"[\", function (left, that) {\n\t\tnobreak(state.tokens.prev, state.tokens.curr);\n\t\tnospace();\n\t\tvar e = expression(0), s;\n\t\tif (e && e.type === \"(string)\") {\n\t\t\tif (!state.option.evil && (e.value === \"eval\" || e.value === \"execScript\")) {\n\t\t\t\twarning(\"W061\", that);\n\t\t\t}\n\n\t\t\tcountMember(e.value);\n\t\t\tif (!state.option.sub && reg.identifier.test(e.value)) {\n\t\t\t\ts = state.syntax[e.value];\n\t\t\t\tif (!s || !isReserved(s)) {\n\t\t\t\t\twarning(\"W069\", state.tokens.prev, e.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tadvance(\"]\", that);\n\n\t\tif (e && e.value === \"hasOwnProperty\" && state.tokens.next.value === \"=\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tthat.left = left;\n\t\tthat.right = e;\n\t\treturn that;\n\t}, 160, true);\n\n\tprefix(\"[\", function () {\n\t\tvar b = state.tokens.curr.line !== state.tokens.next.line;\n\t\tthis.first = [];\n\t\tif (b) {\n\t\t\tindent += state.option.indent;\n\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t}\n\t\t}\n\t\twhile (state.tokens.next.id !== \"(end)\") {\n\t\t\twhile (state.tokens.next.id === \",\") {\n\t\t\t\tif (!state.option.es5)\n\t\t\t\t\twarning(\"W070\");\n\t\t\t\tadvance(\",\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id === \"]\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (b && state.tokens.curr.line !== state.tokens.next.line) {\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tthis.first.push(expression(10));\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\tif (state.tokens.next.id === \"]\" && !state.option.es5) {\n\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (b) {\n\t\t\tindent -= state.option.indent;\n\t\t\tindentation();\n\t\t}\n\t\tadvance(\"]\", this);\n\t\treturn this;\n\t}, 160);\n\n\n\tfunction property_name() {\n\t\tvar id = optionalidentifier(false, true);\n\n\t\tif (!id) {\n\t\t\tif (state.tokens.next.id === \"(string)\") {\n\t\t\t\tid = state.tokens.next.value;\n\t\t\t\tadvance();\n\t\t\t} else if (state.tokens.next.id === \"(number)\") {\n\t\t\t\tid = state.tokens.next.value.toString();\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\n\t\tif (id === \"hasOwnProperty\") {\n\t\t\twarning(\"W001\");\n\t\t}\n\n\t\treturn id;\n\t}\n\n\n\tfunction functionparams() {\n\t\tvar next = state.tokens.next;\n\t\tvar params = [];\n\t\tvar ident;\n\n\t\tadvance(\"(\");\n\t\tnospace();\n\n\t\tif (state.tokens.next.id === \")\") {\n\t\t\tadvance(\")\");\n\t\t\treturn;\n\t\t}\n\n\t\tfor (;;) {\n\t\t\tident = identifier(true);\n\t\t\tparams.push(ident);\n\t\t\taddlabel(ident, \"unused\", state.tokens.curr);\n\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\tcomma();\n\t\t\t} else {\n\t\t\t\tadvance(\")\", next);\n\t\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\t\treturn params;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfunction doFunction(name, statement) {\n\t\tvar f;\n\t\tvar oldOption = state.option;\n\t\tvar oldScope = scope;\n\n\t\tstate.option = Object.create(state.option);\n\t\tscope = Object.create(scope);\n\n\t\tfunct = {\n\t\t\t\"(name)\" : name || \"\\\"\" + anonname + \"\\\"\",\n\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\"(context)\" : funct,\n\t\t\t\"(breakage)\" : 0,\n\t\t\t\"(loopage)\" : 0,\n\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\"(scope)\" : scope,\n\t\t\t\"(statement)\": statement,\n\t\t\t\"(tokens)\" : {}\n\t\t};\n\n\t\tf = funct;\n\t\tstate.tokens.curr.funct = funct;\n\n\t\tfunctions.push(funct);\n\n\t\tif (name) {\n\t\t\taddlabel(name, \"function\");\n\t\t}\n\n\t\tfunct[\"(params)\"] = functionparams();\n\t\tfunct[\"(metrics)\"].verifyMaxParametersPerFunction(funct[\"(params)\"]);\n\n\t\tblock(false, false, true);\n\n\t\tfunct[\"(metrics)\"].verifyMaxStatementsPerFunction();\n\t\tfunct[\"(metrics)\"].verifyMaxComplexityPerFunction();\n\n\t\tif (state.option.unused === false) {\n\t\t\tfunct[\"(ignoreUnused)\"] = true;\n\t\t}\n\n\t\tscope = oldScope;\n\t\tstate.option = oldOption;\n\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\tfunct = funct[\"(context)\"];\n\n\t\treturn f;\n\t}\n\n\tfunction createMetrics(functionStartToken) {\n\t\treturn {\n\t\t\tstatementCount: 0,\n\t\t\tnestedBlockDepth: -1,\n\t\t\tComplexityCount: 1,\n\t\t\tverifyMaxStatementsPerFunction: function () {\n\t\t\t\tif (state.option.maxstatements &&\n\t\t\t\t\tthis.statementCount > state.option.maxstatements) {\n\t\t\t\t\twarning(\"W071\", functionStartToken, this.statementCount);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxParametersPerFunction: function (params) {\n\t\t\t\tparams = params || [];\n\n\t\t\t\tif (state.option.maxparams && params.length > state.option.maxparams) {\n\t\t\t\t\twarning(\"W072\", functionStartToken, params.length);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxNestedBlockDepthPerFunction: function () {\n\t\t\t\tif (state.option.maxdepth &&\n\t\t\t\t\tthis.nestedBlockDepth > 0 &&\n\t\t\t\t\tthis.nestedBlockDepth === state.option.maxdepth + 1) {\n\t\t\t\t\twarning(\"W073\", null, this.nestedBlockDepth);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tverifyMaxComplexityPerFunction: function () {\n\t\t\t\tvar max = state.option.maxcomplexity;\n\t\t\t\tvar cc = this.ComplexityCount;\n\t\t\t\tif (max && cc > max) {\n\t\t\t\t\twarning(\"W074\", functionStartToken, cc);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction increaseComplexityCount() {\n\t\tfunct[\"(metrics)\"].ComplexityCount += 1;\n\t}\n\n\t// Parse assignments that were found instead of conditionals.\n\t// For example: if (a = 1) { ... }\n\n\tfunction parseCondAssignment() {\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"=\":\n\t\tcase \"+=\":\n\t\tcase \"-=\":\n\t\tcase \"*=\":\n\t\tcase \"%=\":\n\t\tcase \"&=\":\n\t\tcase \"|=\":\n\t\tcase \"^=\":\n\t\tcase \"/=\":\n\t\t\tif (!state.option.boss) {\n\t\t\t\twarning(\"W084\");\n\t\t\t}\n\n\t\t\tadvance(state.tokens.next.id);\n\t\t\texpression(20);\n\t\t}\n\t}\n\n\n\t(function (x) {\n\t\tx.nud = function () {\n\t\t\tvar b, f, i, p, t;\n\t\t\tvar props = {}; // All properties, including accessors\n\n\t\t\tfunction saveProperty(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name))\n\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\telse\n\t\t\t\t\tprops[name] = {};\n\n\t\t\t\tprops[name].basic = true;\n\t\t\t\tprops[name].basictkn = tkn;\n\t\t\t}\n\n\t\t\tfunction saveSetter(name, tkn) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].setter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].setter = true;\n\t\t\t\tprops[name].setterToken = tkn;\n\t\t\t}\n\n\t\t\tfunction saveGetter(name) {\n\t\t\t\tif (props[name] && _.has(props, name)) {\n\t\t\t\t\tif (props[name].basic || props[name].getter)\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, i);\n\t\t\t\t} else {\n\t\t\t\t\tprops[name] = {};\n\t\t\t\t}\n\n\t\t\t\tprops[name].getter = true;\n\t\t\t\tprops[name].getterToken = state.tokens.curr;\n\t\t\t}\n\n\t\t\tb = state.tokens.curr.line !== state.tokens.next.line;\n\t\t\tif (b) {\n\t\t\t\tindent += state.option.indent;\n\t\t\t\tif (state.tokens.next.from === indent + state.option.indent) {\n\t\t\t\t\tindent += state.option.indent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (;;) {\n\t\t\t\tif (state.tokens.next.id === \"}\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (b) {\n\t\t\t\t\tindentation();\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.value === \"get\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"get\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveGetter(i);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (p) {\n\t\t\t\t\t\twarning(\"W076\", t, p[0], i);\n\t\t\t\t\t}\n\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t} else if (state.tokens.next.value === \"set\" && peek().id !== \":\") {\n\t\t\t\t\tadvance(\"set\");\n\n\t\t\t\t\tif (!state.option.es5) {\n\t\t\t\t\t\terror(\"E034\");\n\t\t\t\t\t}\n\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tif (!i) {\n\t\t\t\t\t\terror(\"E035\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsaveSetter(i, state.tokens.next);\n\t\t\t\t\tt = state.tokens.next;\n\t\t\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tf = doFunction();\n\t\t\t\t\tp = f[\"(params)\"];\n\n\t\t\t\t\tif (!p || p.length !== 1) {\n\t\t\t\t\t\twarning(\"W077\", t, i);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ti = property_name();\n\t\t\t\t\tsaveProperty(i, state.tokens.next);\n\n\t\t\t\t\tif (typeof i !== \"string\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\texpression(10);\n\t\t\t\t}\n\n\t\t\t\tcountMember(i);\n\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\tcomma({ allowTrailing: true });\n\t\t\t\t\tif (state.tokens.next.id === \",\") {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\" && !state.option.es5) {\n\t\t\t\t\t\twarning(\"W070\", state.tokens.curr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t}\n\t\t\tadvance(\"}\", this);\n\n\t\t\t// Check for lonely setters if in the ES5 mode.\n\t\t\tif (state.option.es5) {\n\t\t\t\tfor (var name in props) {\n\t\t\t\t\tif (_.has(props, name) && props[name].setter && !props[name].getter) {\n\t\t\t\t\t\twarning(\"W078\", props[name].setterToken);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\t\tx.fud = function () {\n\t\t\terror(\"E036\", state.tokens.curr);\n\t\t};\n\t}(delim(\"{\")));\n\n\t// This Function is called when esnext option is set to true\n\t// it adds the `const` statement to JSHINT\n\n\tuseESNextSyntax = function () {\n\t\tvar conststatement = stmt(\"const\", function (prefix) {\n\t\t\tvar id, name, value;\n\n\t\t\tthis.first = [];\n\t\t\tfor (;;) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tid = identifier();\n\t\t\t\tif (funct[id] === \"const\") {\n\t\t\t\t\twarning(\"E011\", null, id);\n\t\t\t\t}\n\t\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\taddlabel(id, \"const\");\n\t\t\t\tif (prefix) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tname = state.tokens.curr;\n\t\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\t\tif (state.tokens.next.id !== \"=\") {\n\t\t\t\t\twarning(\"E012\", state.tokens.curr, id);\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tadvance(\"=\");\n\t\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t\t}\n\t\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\t\terror(\"E037\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue = expression(0);\n\t\t\t\t\tname.first = value;\n\t\t\t\t}\n\n\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcomma();\n\t\t\t}\n\t\t\treturn this;\n\t\t});\n\t\tconststatement.exps = true;\n\t};\n\n\tvar varstatement = stmt(\"var\", function (prefix) {\n\t\t// JavaScript does not have block scope. It only has function scope. So,\n\t\t// declaring a variable in a block can have unexpected consequences.\n\t\tvar id, name, value;\n\n\t\tif (funct[\"(onevar)\"] && state.option.onevar) {\n\t\t\twarning(\"W081\");\n\t\t} else if (!funct[\"(global)\"]) {\n\t\t\tfunct[\"(onevar)\"] = true;\n\t\t}\n\n\t\tthis.first = [];\n\n\t\tfor (;;) {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tid = identifier();\n\n\t\t\tif (state.option.esnext && funct[id] === \"const\") {\n\t\t\t\twarning(\"E011\", null, id);\n\t\t\t}\n\n\t\t\tif (funct[\"(global)\"] && predefined[id] === false) {\n\t\t\t\twarning(\"W079\", state.tokens.curr, id);\n\t\t\t}\n\n\t\t\taddlabel(id, \"unused\", state.tokens.curr);\n\n\t\t\tif (prefix) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tname = state.tokens.curr;\n\t\t\tthis.first.push(state.tokens.curr);\n\n\t\t\tif (state.tokens.next.id === \"=\") {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tadvance(\"=\");\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tif (state.tokens.next.id === \"undefined\") {\n\t\t\t\t\twarning(\"W080\", state.tokens.curr, id);\n\t\t\t\t}\n\t\t\t\tif (peek(0).id === \"=\" && state.tokens.next.identifier) {\n\t\t\t\t\terror(\"E038\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tvalue = expression(0);\n\t\t\t\tname.first = value;\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcomma();\n\t\t}\n\t\treturn this;\n\t});\n\tvarstatement.exps = true;\n\n\tblockstmt(\"function\", function () {\n\t\tif (inblock) {\n\t\t\twarning(\"W082\", state.tokens.curr);\n\n\t\t}\n\t\tvar i = identifier();\n\t\tif (state.option.esnext && funct[i] === \"const\") {\n\t\t\twarning(\"E011\", null, i);\n\t\t}\n\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\taddlabel(i, \"unction\", state.tokens.curr);\n\n\t\tdoFunction(i, { statement: true });\n\t\tif (state.tokens.next.id === \"(\" && state.tokens.next.line === state.tokens.curr.line) {\n\t\t\terror(\"E039\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tprefix(\"function\", function () {\n\t\tvar i = optionalidentifier();\n\t\tif (i) {\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t} else {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t}\n\t\tdoFunction(i);\n\t\tif (!state.option.loopfunc && funct[\"(loopage)\"]) {\n\t\t\twarning(\"W083\");\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"if\", function () {\n\t\tvar t = state.tokens.next;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tif (state.tokens.next.id === \"else\") {\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"else\");\n\t\t\tif (state.tokens.next.id === \"if\" || state.tokens.next.id === \"switch\") {\n\t\t\t\tstatement(true);\n\t\t\t} else {\n\t\t\t\tblock(true, true);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t});\n\n\tblockstmt(\"try\", function () {\n\t\tvar b;\n\n\t\tfunction doCatch() {\n\t\t\tvar oldScope = scope;\n\t\t\tvar e;\n\n\t\t\tadvance(\"catch\");\n\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(\");\n\n\t\t\tscope = Object.create(oldScope);\n\n\t\t\te = state.tokens.next.value;\n\t\t\tif (state.tokens.next.type !== \"(identifier)\") {\n\t\t\t\te = null;\n\t\t\t\twarning(\"E030\", state.tokens.next, e);\n\t\t\t}\n\n\t\t\tadvance();\n\t\t\tadvance(\")\");\n\n\t\t\tfunct = {\n\t\t\t\t\"(name)\" : \"(catch)\",\n\t\t\t\t\"(line)\" : state.tokens.next.line,\n\t\t\t\t\"(character)\": state.tokens.next.character,\n\t\t\t\t\"(context)\" : funct,\n\t\t\t\t\"(breakage)\" : funct[\"(breakage)\"],\n\t\t\t\t\"(loopage)\" : funct[\"(loopage)\"],\n\t\t\t\t\"(scope)\" : scope,\n\t\t\t\t\"(statement)\": false,\n\t\t\t\t\"(metrics)\" : createMetrics(state.tokens.next),\n\t\t\t\t\"(catch)\" : true,\n\t\t\t\t\"(tokens)\" : {}\n\t\t\t};\n\n\t\t\tif (e) {\n\t\t\t\taddlabel(e, \"exception\");\n\t\t\t}\n\n\t\t\tstate.tokens.curr.funct = funct;\n\t\t\tfunctions.push(funct);\n\n\t\t\tblock(false);\n\n\t\t\tscope = oldScope;\n\n\t\t\tfunct[\"(last)\"] = state.tokens.curr.line;\n\t\t\tfunct[\"(lastcharacter)\"] = state.tokens.curr.character;\n\t\t\tfunct = funct[\"(context)\"];\n\t\t}\n\n\t\tblock(false);\n\n\t\tif (state.tokens.next.id === \"catch\") {\n\t\t\tincreaseComplexityCount();\n\t\t\tdoCatch();\n\t\t\tb = true;\n\t\t}\n\n\t\tif (state.tokens.next.id === \"finally\") {\n\t\t\tadvance(\"finally\");\n\t\t\tblock(false);\n\t\t\treturn;\n\t\t} else if (!b) {\n\t\t\terror(\"E021\", state.tokens.next, \"catch\", state.tokens.next.value);\n\t\t}\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"while\", function () {\n\t\tvar t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(20);\n\t\tparseCondAssignment();\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\t\tfunct[\"(breakage)\"] -= 1;\n\t\tfunct[\"(loopage)\"] -= 1;\n\t\treturn this;\n\t}).labelled = true;\n\n\tblockstmt(\"with\", function () {\n\t\tvar t = state.tokens.next;\n\t\tif (state.directive[\"use strict\"]) {\n\t\t\terror(\"E010\", state.tokens.curr);\n\t\t} else if (!state.option.withstmt) {\n\t\t\twarning(\"W085\", state.tokens.curr);\n\t\t}\n\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\texpression(0);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tblock(true, true);\n\n\t\treturn this;\n\t});\n\n\tblockstmt(\"switch\", function () {\n\t\tvar t = state.tokens.next,\n\t\t\tg = false;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tthis.condition = expression(20);\n\t\tadvance(\")\", t);\n\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tt = state.tokens.next;\n\t\tadvance(\"{\");\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tindent += state.option.indent;\n\t\tthis.cases = [];\n\n\t\tfor (;;) {\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"case\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"case\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"switch\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// You can tell JSHint that you don't use break intentionally by\n\t\t\t\t\t// adding a comment /* falls through */ on a line just before\n\t\t\t\t\t// the next `case`.\n\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"case\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"case\");\n\t\t\t\tthis.cases.push(expression(20));\n\t\t\t\tincreaseComplexityCount();\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tfunct[\"(verb)\"] = \"case\";\n\t\t\t\tbreak;\n\t\t\tcase \"default\":\n\t\t\t\tswitch (funct[\"(verb)\"]) {\n\t\t\t\tcase \"break\":\n\t\t\t\tcase \"continue\":\n\t\t\t\tcase \"return\":\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Do not display a warning if 'default' is the first statement or if\n\t\t\t\t\t// there is a special /* falls through */ comment.\n\t\t\t\t\tif (this.cases.length) {\n\t\t\t\t\t\tif (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) {\n\t\t\t\t\t\t\twarning(\"W086\", state.tokens.curr, \"default\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindentation(-state.option.indent);\n\t\t\t\tadvance(\"default\");\n\t\t\t\tg = true;\n\t\t\t\tadvance(\":\");\n\t\t\t\tbreak;\n\t\t\tcase \"}\":\n\t\t\t\tindent -= state.option.indent;\n\t\t\t\tindentation();\n\t\t\t\tadvance(\"}\", t);\n\t\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\t\tfunct[\"(verb)\"] = undefined;\n\t\t\t\treturn;\n\t\t\tcase \"(end)\":\n\t\t\t\terror(\"E023\", state.tokens.next, \"}\");\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\tif (g) {\n\t\t\t\t\tswitch (state.tokens.curr.id) {\n\t\t\t\t\tcase \",\":\n\t\t\t\t\t\terror(\"E040\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \":\":\n\t\t\t\t\t\tg = false;\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\terror(\"E025\", state.tokens.curr);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (state.tokens.curr.id === \":\") {\n\t\t\t\t\t\tadvance(\":\");\n\t\t\t\t\t\terror(\"E024\", state.tokens.curr, \":\");\n\t\t\t\t\t\tstatements();\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(\"E021\", state.tokens.next, \"case\", state.tokens.next.value);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).labelled = true;\n\n\tstmt(\"debugger\", function () {\n\t\tif (!state.option.debug) {\n\t\t\twarning(\"W087\");\n\t\t}\n\t\treturn this;\n\t}).exps = true;\n\n\t(function () {\n\t\tvar x = stmt(\"do\", function () {\n\t\t\tfunct[\"(breakage)\"] += 1;\n\t\t\tfunct[\"(loopage)\"] += 1;\n\t\t\tincreaseComplexityCount();\n\n\t\t\tthis.first = block(true);\n\t\t\tadvance(\"while\");\n\t\t\tvar t = state.tokens.next;\n\t\t\tnonadjacent(state.tokens.curr, t);\n\t\t\tadvance(\"(\");\n\t\t\tnospace();\n\t\t\texpression(20);\n\t\t\tparseCondAssignment();\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t});\n\t\tx.labelled = true;\n\t\tx.exps = true;\n\t}());\n\n\tblockstmt(\"for\", function () {\n\t\tvar s, t = state.tokens.next;\n\t\tfunct[\"(breakage)\"] += 1;\n\t\tfunct[\"(loopage)\"] += 1;\n\t\tincreaseComplexityCount();\n\t\tadvance(\"(\");\n\t\tnonadjacent(this, t);\n\t\tnospace();\n\t\tif (peek(state.tokens.next.id === \"var\" ? 1 : 0).id === \"in\") {\n\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\tadvance(\"var\");\n\t\t\t\tvarstatement.fud.call(varstatement, true);\n\t\t\t} else {\n\t\t\t\tswitch (funct[state.tokens.next.value]) {\n\t\t\t\tcase \"unused\":\n\t\t\t\t\tfunct[state.tokens.next.value] = \"var\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"var\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twarning(\"W088\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t}\n\t\t\t\tadvance();\n\t\t\t}\n\t\t\tadvance(\"in\");\n\t\t\texpression(20);\n\t\t\tadvance(\")\", t);\n\t\t\ts = block(true, true);\n\t\t\tif (state.option.forin && s && (s.length > 1 || typeof s[0] !== \"object\" ||\n\t\t\t\t\ts[0].value !== \"if\")) {\n\t\t\t\twarning(\"W089\", this);\n\t\t\t}\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t} else {\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\tif (state.tokens.next.id === \"var\") {\n\t\t\t\t\tadvance(\"var\");\n\t\t\t\t\tvarstatement.fud.call(varstatement);\n\t\t\t\t} else {\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomma();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id !== \";\") {\n\t\t\t\texpression(20);\n\t\t\t\tparseCondAssignment();\n\t\t\t}\n\t\t\tnolinebreak(state.tokens.curr);\n\t\t\tadvance(\";\");\n\t\t\tif (state.tokens.next.id === \";\") {\n\t\t\t\terror(\"E021\", state.tokens.next, \")\", \";\");\n\t\t\t}\n\t\t\tif (state.tokens.next.id !== \")\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\texpression(0, \"for\");\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcomma();\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\")\", t);\n\t\t\tnospace(state.tokens.prev, state.tokens.curr);\n\t\t\tblock(true, true);\n\t\t\tfunct[\"(breakage)\"] -= 1;\n\t\t\tfunct[\"(loopage)\"] -= 1;\n\t\t\treturn this;\n\t\t}\n\t}).labelled = true;\n\n\n\tstmt(\"break\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t}\n\t\treachable(\"break\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"continue\", function () {\n\t\tvar v = state.tokens.next.value;\n\n\t\tif (funct[\"(breakage)\"] === 0)\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\n\t\tif (!state.option.asi)\n\t\t\tnolinebreak(this);\n\n\t\tif (state.tokens.next.id !== \";\") {\n\t\t\tif (state.tokens.curr.line === state.tokens.next.line) {\n\t\t\t\tif (funct[v] !== \"label\") {\n\t\t\t\t\twarning(\"W090\", state.tokens.next, v);\n\t\t\t\t} else if (scope[v] !== funct) {\n\t\t\t\t\twarning(\"W091\", state.tokens.next, v);\n\t\t\t\t}\n\t\t\t\tthis.first = state.tokens.next;\n\t\t\t\tadvance();\n\t\t\t}\n\t\t} else if (!funct[\"(loopage)\"]) {\n\t\t\twarning(\"W052\", state.tokens.next, this.value);\n\t\t}\n\t\treachable(\"continue\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"return\", function () {\n\t\tif (this.line === state.tokens.next.line) {\n\t\t\tif (state.tokens.next.id === \"(regexp)\")\n\t\t\t\twarning(\"W092\");\n\n\t\t\tif (state.tokens.next.id !== \";\" && !state.tokens.next.reach) {\n\t\t\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\t\t\tthis.first = expression(0);\n\n\t\t\t\tif (this.first.value === \"=\" && !state.option.boss) {\n\t\t\t\t\twarningAt(\"W093\", this.first.line, this.first.character);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!state.option.asi) {\n\t\t\tnolinebreak(this); // always warn (Line breaking error)\n\t\t}\n\t\treachable(\"return\");\n\t\treturn this;\n\t}).exps = true;\n\n\n\tstmt(\"throw\", function () {\n\t\tnolinebreak(this);\n\t\tnonadjacent(state.tokens.curr, state.tokens.next);\n\t\tthis.first = expression(20);\n\t\treachable(\"throw\");\n\t\treturn this;\n\t}).exps = true;\n\n\t// Future Reserved Words\n\n\tFutureReservedWord(\"abstract\");\n\tFutureReservedWord(\"boolean\");\n\tFutureReservedWord(\"byte\");\n\tFutureReservedWord(\"char\");\n\tFutureReservedWord(\"class\", { es5: true });\n\tFutureReservedWord(\"double\");\n\tFutureReservedWord(\"enum\", { es5: true });\n\tFutureReservedWord(\"export\", { es5: true });\n\tFutureReservedWord(\"extends\", { es5: true });\n\tFutureReservedWord(\"final\");\n\tFutureReservedWord(\"float\");\n\tFutureReservedWord(\"goto\");\n\tFutureReservedWord(\"implements\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"import\", { es5: true });\n\tFutureReservedWord(\"int\");\n\tFutureReservedWord(\"interface\");\n\tFutureReservedWord(\"let\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"long\");\n\tFutureReservedWord(\"native\");\n\tFutureReservedWord(\"package\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"private\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"protected\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"public\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"short\");\n\tFutureReservedWord(\"static\", { es5: true, strictOnly: true });\n\tFutureReservedWord(\"super\", { es5: true });\n\tFutureReservedWord(\"synchronized\");\n\tFutureReservedWord(\"throws\");\n\tFutureReservedWord(\"transient\");\n\tFutureReservedWord(\"volatile\");\n\tFutureReservedWord(\"yield\", { es5: true, strictOnly: true });\n\n\t// Parse JSON\n\n\tfunction jsonValue() {\n\n\t\tfunction jsonObject() {\n\t\t\tvar o = {}, t = state.tokens.next;\n\t\t\tadvance(\"{\");\n\t\t\tif (state.tokens.next.id !== \"}\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E026\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"}\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t} else if (state.tokens.next.id !== \"(string)\") {\n\t\t\t\t\t\twarning(\"W095\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t}\n\t\t\t\t\tif (o[state.tokens.next.value] === true) {\n\t\t\t\t\t\twarning(\"W075\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else if ((state.tokens.next.value === \"__proto__\" &&\n\t\t\t\t\t\t!state.option.proto) || (state.tokens.next.value === \"__iterator__\" &&\n\t\t\t\t\t\t!state.option.iterator)) {\n\t\t\t\t\t\twarning(\"W096\", state.tokens.next, state.tokens.next.value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\to[state.tokens.next.value] = true;\n\t\t\t\t\t}\n\t\t\t\t\tadvance();\n\t\t\t\t\tadvance(\":\");\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"}\");\n\t\t}\n\n\t\tfunction jsonArray() {\n\t\t\tvar t = state.tokens.next;\n\t\t\tadvance(\"[\");\n\t\t\tif (state.tokens.next.id !== \"]\") {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tif (state.tokens.next.id === \"(end)\") {\n\t\t\t\t\t\terror(\"E027\", state.tokens.next, t.line);\n\t\t\t\t\t} else if (state.tokens.next.id === \"]\") {\n\t\t\t\t\t\twarning(\"W094\", state.tokens.curr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (state.tokens.next.id === \",\") {\n\t\t\t\t\t\terror(\"E028\", state.tokens.next);\n\t\t\t\t\t}\n\t\t\t\t\tjsonValue();\n\t\t\t\t\tif (state.tokens.next.id !== \",\") {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tadvance(\",\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tadvance(\"]\");\n\t\t}\n\n\t\tswitch (state.tokens.next.id) {\n\t\tcase \"{\":\n\t\t\tjsonObject();\n\t\t\tbreak;\n\t\tcase \"[\":\n\t\t\tjsonArray();\n\t\t\tbreak;\n\t\tcase \"true\":\n\t\tcase \"false\":\n\t\tcase \"null\":\n\t\tcase \"(number)\":\n\t\tcase \"(string)\":\n\t\t\tadvance();\n\t\t\tbreak;\n\t\tcase \"-\":\n\t\t\tadvance(\"-\");\n\t\t\tif (state.tokens.curr.character !== state.tokens.next.from) {\n\t\t\t\twarning(\"W011\", state.tokens.curr);\n\t\t\t}\n\t\t\tadjacent(state.tokens.curr, state.tokens.next);\n\t\t\tadvance(\"(number)\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\terror(\"E003\", state.tokens.next);\n\t\t}\n\t}\n\n\n\t// The actual JSHINT function itself.\n\tvar itself = function (s, o, g) {\n\t\tvar a, i, k, x;\n\t\tvar optionKeys;\n\t\tvar newOptionObj = {};\n\n\t\tstate.reset();\n\n\t\tif (o && o.scope) {\n\t\t\tJSHINT.scope = o.scope;\n\t\t} else {\n\t\t\tJSHINT.errors = [];\n\t\t\tJSHINT.undefs = [];\n\t\t\tJSHINT.internals = [];\n\t\t\tJSHINT.blacklist = {};\n\t\t\tJSHINT.scope = \"(main)\";\n\t\t}\n\n\t\tpredefined = Object.create(null);\n\t\tcombine(predefined, vars.ecmaIdentifiers);\n\t\tcombine(predefined, vars.reservedVars);\n\n\t\tcombine(predefined, g || {});\n\n\t\tdeclared = Object.create(null);\n\t\texported = Object.create(null);\n\t\tignored = Object.create(null);\n\n\t\tif (o) {\n\t\t\ta = o.predef;\n\t\t\tif (a) {\n\t\t\t\tif (!Array.isArray(a) && typeof a === \"object\") {\n\t\t\t\t\ta = Object.keys(a);\n\t\t\t\t}\n\n\t\t\t\ta.forEach(function (item) {\n\t\t\t\t\tvar slice, prop;\n\n\t\t\t\t\tif (item[0] === \"-\") {\n\t\t\t\t\t\tslice = item.slice(1);\n\t\t\t\t\t\tJSHINT.blacklist[slice] = slice;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprop = Object.getOwnPropertyDescriptor(o.predef, item);\n\t\t\t\t\t\tpredefined[item] = prop ? prop.value : false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\toptionKeys = Object.keys(o);\n\t\t\tfor (x = 0; x < optionKeys.length; x++) {\n\t\t\t\tif (/^-W\\d{3}$/g.test(optionKeys[x])) {\n\t\t\t\t\tignored[optionKeys[x].slice(1)] = true;\n\t\t\t\t} else {\n\t\t\t\t\tnewOptionObj[optionKeys[x]] = o[optionKeys[x]];\n\n\t\t\t\t\tif (optionKeys[x] === \"newcap\" && o[optionKeys[x]] === false)\n\t\t\t\t\t\tnewOptionObj[\"(explicitNewcap)\"] = true;\n\n\t\t\t\t\tif (optionKeys[x] === \"indent\")\n\t\t\t\t\t\tnewOptionObj[\"(explicitIndent)\"] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstate.option = newOptionObj;\n\n\t\tstate.option.indent = state.option.indent || 4;\n\t\tstate.option.maxerr = state.option.maxerr || 50;\n\n\t\tindent = 1;\n\t\tglobal = Object.create(predefined);\n\t\tscope = global;\n\t\tfunct = {\n\t\t\t\"(global)\": true,\n\t\t\t\"(name)\":\t \"(global)\",\n\t\t\t\"(scope)\":\t scope,\n\t\t\t\"(breakage)\": 0,\n\t\t\t\"(loopage)\": 0,\n\t\t\t\"(tokens)\": {},\n\t\t\t\"(metrics)\": createMetrics(state.tokens.next)\n\t\t};\n\t\tfunctions = [funct];\n\t\turls = [];\n\t\tstack = null;\n\t\tmember = {};\n\t\tmembersOnly = null;\n\t\timplied = {};\n\t\tinblock = false;\n\t\tlookahead = [];\n\t\twarnings = 0;\n\t\tunuseds = [];\n\n\t\tif (!isString(s) && !Array.isArray(s)) {\n\t\t\terrorAt(\"E004\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isString(s) && /^\\s*$/g.test(s)) {\n\t\t\terrorAt(\"E005\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (s.length === 0) {\n\t\t\terrorAt(\"E005\", 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tvar api = {\n\t\t\tget isJSON() {\n\t\t\t\treturn state.jsonMode;\n\t\t\t},\n\n\t\t\tgetOption: function (name) {\n\t\t\t\treturn state.option[name] || null;\n\t\t\t},\n\n\t\t\tgetCache: function (name) {\n\t\t\t\treturn state.cache[name];\n\t\t\t},\n\n\t\t\tsetCache: function (name, value) {\n\t\t\t\tstate.cache[name] = value;\n\t\t\t},\n\n\t\t\twarn: function (code, data) {\n\t\t\t\twarningAt.apply(null, [ code, data.line, data.char ].concat(data.data));\n\t\t\t},\n\n\t\t\ton: function (names, listener) {\n\t\t\t\tnames.split(\" \").forEach(function (name) {\n\t\t\t\t\temitter.on(name, listener);\n\t\t\t\t}.bind(this));\n\t\t\t}\n\t\t};\n\n\t\temitter.removeAllListeners();\n\t\t(extraModules || []).forEach(function (func) {\n\t\t\tfunc(api);\n\t\t});\n\n\t\tstate.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax[\"(begin)\"];\n\n\t\tlex = new Lexer(s);\n\n\t\tlex.on(\"warning\", function (ev) {\n\t\t\twarningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"error\", function (ev) {\n\t\t\terrorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data));\n\t\t});\n\n\t\tlex.on(\"fatal\", function (ev) {\n\t\t\tquit(\"E041\", ev.line, ev.from);\n\t\t});\n\n\t\tlex.on(\"Identifier\", function (ev) {\n\t\t\temitter.emit(\"Identifier\", ev);\n\t\t});\n\n\t\tlex.on(\"String\", function (ev) {\n\t\t\temitter.emit(\"String\", ev);\n\t\t});\n\n\t\tlex.on(\"Number\", function (ev) {\n\t\t\temitter.emit(\"Number\", ev);\n\t\t});\n\n\t\tlex.start();\n\n\t\t// Check options\n\t\tfor (var name in o) {\n\t\t\tif (_.has(o, name)) {\n\t\t\t\tcheckOption(name, state.tokens.curr);\n\t\t\t}\n\t\t}\n\n\t\tassume();\n\n\t\t// combine the passed globals after we've assumed all our options\n\t\tcombine(predefined, g || {});\n\n\t\t//reset values\n\t\tcomma.first = true;\n\n\t\ttry {\n\t\t\tadvance();\n\t\t\tswitch (state.tokens.next.id) {\n\t\t\tcase \"{\":\n\t\t\tcase \"[\":\n\t\t\t\tstate.option.laxbreak = true;\n\t\t\t\tstate.jsonMode = true;\n\t\t\t\tjsonValue();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdirectives();\n\n\t\t\t\tif (state.directive[\"use strict\"]) {\n\t\t\t\t\tif (!state.option.globalstrict && !state.option.node) {\n\t\t\t\t\t\twarning(\"W097\", state.tokens.prev);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstatements();\n\t\t\t}\n\t\t\tadvance((state.tokens.next && state.tokens.next.value !== \".\")\t? \"(end)\" : undefined);\n\n\t\t\tvar markDefined = function (name, context) {\n\t\t\t\tdo {\n\t\t\t\t\tif (typeof context[name] === \"string\") {\n\t\t\t\t\t\t// JSHINT marks unused variables as 'unused' and\n\t\t\t\t\t\t// unused function declaration as 'unction'. This\n\t\t\t\t\t\t// code changes such instances back 'var' and\n\t\t\t\t\t\t// 'closure' so that the code in JSHINT.data()\n\t\t\t\t\t\t// doesn't think they're unused.\n\n\t\t\t\t\t\tif (context[name] === \"unused\")\n\t\t\t\t\t\t\tcontext[name] = \"var\";\n\t\t\t\t\t\telse if (context[name] === \"unction\")\n\t\t\t\t\t\t\tcontext[name] = \"closure\";\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext = context[\"(context)\"];\n\t\t\t\t} while (context);\n\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tvar clearImplied = function (name, line) {\n\t\t\t\tif (!implied[name])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar newImplied = [];\n\t\t\t\tfor (var i = 0; i < implied[name].length; i += 1) {\n\t\t\t\t\tif (implied[name][i] !== line)\n\t\t\t\t\t\tnewImplied.push(implied[name][i]);\n\t\t\t\t}\n\n\t\t\t\tif (newImplied.length === 0)\n\t\t\t\t\tdelete implied[name];\n\t\t\t\telse\n\t\t\t\t\timplied[name] = newImplied;\n\t\t\t};\n\n\t\t\tvar warnUnused = function (name, tkn) {\n\t\t\t\tvar line = tkn.line;\n\t\t\t\tvar chr = tkn.character;\n\n\t\t\t\tif (state.option.unused)\n\t\t\t\t\twarningAt(\"W098\", line, chr, name);\n\n\t\t\t\tunuseds.push({\n\t\t\t\t\tname: name,\n\t\t\t\t\tline: line,\n\t\t\t\t\tcharacter: chr\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tvar checkUnused = function (func, key) {\n\t\t\t\tvar type = func[key];\n\t\t\t\tvar tkn = func[\"(tokens)\"][key];\n\n\t\t\t\tif (key.charAt(0) === \"(\")\n\t\t\t\t\treturn;\n\n\t\t\t\tif (type !== \"unused\" && type !== \"unction\")\n\t\t\t\t\treturn;\n\n\t\t\t\t// Params are checked separately from other variables.\n\t\t\t\tif (func[\"(params)\"] && func[\"(params)\"].indexOf(key) !== -1)\n\t\t\t\t\treturn;\n\n\t\t\t\t// Variable is in global scope and defined as exported.\n\t\t\t\tif (func[\"(global)\"] && _.has(exported, key)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twarnUnused(key, tkn);\n\t\t\t};\n\n\t\t\t// Check queued 'x is not defined' instances to see if they're still undefined.\n\t\t\tfor (i = 0; i < JSHINT.undefs.length; i += 1) {\n\t\t\t\tk = JSHINT.undefs[i].slice(0);\n\n\t\t\t\tif (markDefined(k[2].value, k[0])) {\n\t\t\t\t\tclearImplied(k[2].value, k[2].line);\n\t\t\t\t} else if (state.option.undef) {\n\t\t\t\t\twarning.apply(warning, k.slice(1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunctions.forEach(function (func) {\n\t\t\t\tif (func[\"(ignoreUnused)\"]) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in func) {\n\t\t\t\t\tif (_.has(func, key)) {\n\t\t\t\t\t\tcheckUnused(func, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!func[\"(params)\"])\n\t\t\t\t\treturn;\n\n\t\t\t\tvar params = func[\"(params)\"].slice();\n\t\t\t\tvar param = params.pop();\n\t\t\t\tvar type;\n\n\t\t\t\twhile (param) {\n\t\t\t\t\ttype = func[param];\n\n\t\t\t\t\t// 'undefined' is a special case for (function (window, undefined) { ... })();\n\t\t\t\t\t// patterns.\n\n\t\t\t\t\tif (param === \"undefined\")\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (type !== \"unused\" && type !== \"unction\")\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\twarnUnused(param, func[\"(tokens)\"][param]);\n\t\t\t\t\tparam = params.pop();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfor (var key in declared) {\n\t\t\t\tif (_.has(declared, key) && !_.has(global, key)) {\n\t\t\t\t\twarnUnused(key, declared[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tif (err && err.name === \"JSHintError\") {\n\t\t\t\tvar nt = state.tokens.next || {};\n\t\t\t\tJSHINT.errors.push({\n\t\t\t\t\tscope : \"(main)\",\n\t\t\t\t\traw : err.raw,\n\t\t\t\t\treason : err.message,\n\t\t\t\t\tline : err.line || nt.line,\n\t\t\t\t\tcharacter : err.character || nt.from\n\t\t\t\t}, null);\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\n\t\t// Loop over the listed \"internals\", and check them as well.\n\n\t\tif (JSHINT.scope === \"(main)\") {\n\t\t\to = o || {};\n\n\t\t\tfor (i = 0; i < JSHINT.internals.length; i += 1) {\n\t\t\t\tk = JSHINT.internals[i];\n\t\t\t\to.scope = k.elem;\n\t\t\t\titself(k.value, o, g);\n\t\t\t}\n\t\t}\n\n\t\treturn JSHINT.errors.length === 0;\n\t};\n\n\t// Modules.\n\titself.addModule = function (func) {\n\t\textraModules.push(func);\n\t};\n\n\titself.addModule(style.register);\n\n\t// Data summary.\n\titself.data = function () {\n\t\tvar data = {\n\t\t\tfunctions: [],\n\t\t\toptions: state.option\n\t\t};\n\t\tvar implieds = [];\n\t\tvar members = [];\n\t\tvar fu, f, i, j, n, globals;\n\n\t\tif (itself.errors.length) {\n\t\t\tdata.errors = itself.errors;\n\t\t}\n\n\t\tif (state.jsonMode) {\n\t\t\tdata.json = true;\n\t\t}\n\n\t\tfor (n in implied) {\n\t\t\tif (_.has(implied, n)) {\n\t\t\t\timplieds.push({\n\t\t\t\t\tname: n,\n\t\t\t\t\tline: implied[n]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (implieds.length > 0) {\n\t\t\tdata.implieds = implieds;\n\t\t}\n\n\t\tif (urls.length > 0) {\n\t\t\tdata.urls = urls;\n\t\t}\n\n\t\tglobals = Object.keys(scope);\n\t\tif (globals.length > 0) {\n\t\t\tdata.globals = globals;\n\t\t}\n\n\t\tfor (i = 1; i < functions.length; i += 1) {\n\t\t\tf = functions[i];\n\t\t\tfu = {};\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tfu[functionicity[j]] = [];\n\t\t\t}\n\n\t\t\tfor (j = 0; j < functionicity.length; j += 1) {\n\t\t\t\tif (fu[functionicity[j]].length === 0) {\n\t\t\t\t\tdelete fu[functionicity[j]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfu.name = f[\"(name)\"];\n\t\t\tfu.param = f[\"(params)\"];\n\t\t\tfu.line = f[\"(line)\"];\n\t\t\tfu.character = f[\"(character)\"];\n\t\t\tfu.last = f[\"(last)\"];\n\t\t\tfu.lastcharacter = f[\"(lastcharacter)\"];\n\t\t\tdata.functions.push(fu);\n\t\t}\n\n\t\tif (unuseds.length > 0) {\n\t\t\tdata.unused = unuseds;\n\t\t}\n\n\t\tmembers = [];\n\t\tfor (n in member) {\n\t\t\tif (typeof member[n] === \"number\") {\n\t\t\t\tdata.member = member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t};\n\n\titself.jshint = itself;\n\n\treturn itself;\n}());\n\n// Make JSHINT a Node module, if possible.\nif (typeof exports === \"object\" && exports) {\n\texports.JSHINT = JSHINT;\n}\n\n//@ sourceURL=/src/stable/jshint.js" -)); -require("/src/stable/jshint.js"); diff --git a/deploy/core/node_modules/jshint/jshint.json b/deploy/core/node_modules/jshint/jshint.json deleted file mode 100644 index 6a1e63f04..000000000 --- a/deploy/core/node_modules/jshint/jshint.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "es5": true, - "boss": true, - "node": true, - "strict": true, - "white": true, - "smarttabs": true, - "maxlen": 100, - "newcap": false, - "undef": true, - "unused": true, - "onecase": true, - "indent": 2 -} \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/README.md b/deploy/core/node_modules/jshint/node_modules/cli/README.md deleted file mode 100644 index 0fe30d4fb..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/README.md +++ /dev/null @@ -1,196 +0,0 @@ -**cli is a toolkit for rapidly building command line apps - it includes:** - -- Full featured opts/args parser -- Plugin support for adding common options and switches -- Helper methods for working with input/output and spawning child processes -- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js) -- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js) - -Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app. - -## Example apps - -### sort.js - -```javascript -#!/usr/bin/env node -require('cli').withStdinLines(function(lines, newline) { - this.output(lines.sort().join(newline)); -}); -``` - -Try it out - -```bash -$ ./sort.js < input.txt -``` - -Let's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!) - -```javascript -var cli = require('cli'), options = cli.parse(); - -cli.withStdinLines(function(lines, newline) { - lines.sort(!options.n ? null : function(a, b) { - return parseInt(a) > parseInt(b); - }); - if (options.r) lines.reverse(); - this.output(lines.join(newline)); -}); -``` - -### static.js - -Let's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon` - -```javascript -var cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins - -cli.parse({ - log: ['l', 'Enable logging'], - port: ['p', 'Listen on this port', 'number', 8080], - serve: [false, 'Serve static files from PATH', 'path', './public'] -}); - -cli.main(function(args, options) { - var server, middleware = []; - - if (options.log) { - this.debug('Enabling logging'); - middleware.push(require('creationix/log')()); - } - - this.debug('Serving files from ' + options.serve); - middleware.push(require('creationix/static')('/', options.serve, 'index.html')); - - server = this.createServer(middleware).listen(options.port); - - this.ok('Listening on port ' + options.port); -}); -``` - -To output usage information - -```bash -$ ./static.js --help -``` - -To create a daemon that serves files from */tmp*, run - -```bash -$ ./static.js -ld --serve=/tmp -``` - -For more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples) - -## Helper methods - -cli has methods that collect stdin (newline is autodetected as \n or \r\n) - -```javascript -cli.withStdin(callback); //callback receives stdin as a string -cli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline) -``` - -cli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). - -```javascript -cli.withInput(file, function (line, newline, eof) { - if (!eof) { - this.output(line + newline); - } -}); -``` - -*Note: `file` can be omitted if you want to work with stdin* - -To output a progress bar, call - -```javascript -cli.progress(progress); //Where 0 <= progress <= 1 -``` - -To spawn a child process, use - -```javascript -cli.exec(cmd, callback); //callback receives the output of the process (split into lines) -``` - -cli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer) - -## Plugins - -Plugins are a way of adding common opts and can be enabled using - -```javascript -cli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method -``` - -**help** - *enabled by default* - -Adds `-h,--help` to output auto-generated usage information - -**version** - -Adds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json* - -To set your own app name and version, use `cli.setApp(app_name, version)` - -**status** - -Adds options to show/hide the stylized status messages that are output to the console when using one of these methods - -```javascript -cli.debug(msg); //Only shown when using --debug -cli.error(msg); -cli.fatal(msg); //Exits the process after outputting msg -cli.info(msg); -cli.ok(msg); -``` - -`-k,--no-color` will omit ANSI color escapes from the output - -**glob** - *requires* `npm install glob` - -Enables glob matching of arguments - -**daemon** - *requires* `npm install daemon` - -Adds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon - -`ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr) - -**timeout** - -Adds `-t,--timeout N` to exit the process after N seconds with an error - -**catchall** - -Adds `-c,--catch` to catch and output uncaughtExceptions and resume execution - -*Note: Plugins are automatically disabled if an option or switch of the same name is already defined* - -## LICENSE - -(MIT license) - -Copyright (c) 2010 Chris O'Hara - -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 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. diff --git a/deploy/core/node_modules/jshint/node_modules/cli/cli.js b/deploy/core/node_modules/jshint/node_modules/cli/cli.js deleted file mode 100644 index e9230fc0b..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/cli.js +++ /dev/null @@ -1,1127 +0,0 @@ -/** - * Copyright (c) 2010 Chris O'Hara - * - * 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 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. - */ - - //Note: cli includes kof/node-natives and creationix/stack. I couldn't find - //license information for either - contact me if you want your license added - -var cli = exports, - argv, curr_opt, curr_val, full_opt, is_long, - short_tags = [], opt_list, parsed = {}, - usage, argv_parsed, command_list, commands, - daemon, daemon_arg, no_color, show_debug; - -cli.app = null; -cli.version = null; -cli.argv = []; -cli.argc = 0; - -cli.options = {}; -cli.args = []; -cli.command; - -cli.width = 70; -cli.option_width = 25; - -/** - * Bind kof's node-natives (https://github.com/kof/node-natives) to `cli.native` - * - * Rather than requiring node natives (e.g. var fs = require('fs')), all - * native modules can be accessed like `cli.native.fs` - */ -cli.native = {}; -var define_native = function (module) { - Object.defineProperty(cli.native, module, { - enumerable: true, - configurable: true, - get: function() { - delete cli.native[module]; - return cli.native[module] = require(module); - } - }); -}; -var natives = process.binding('natives'); -for (var module in natives) { - define_native(module); -} - -cli.output = cli.native.util.print; -cli.exit = process.exit; - -/** - * Define plugins. Plugins can be enabled and disabled by calling: - * - * `cli.enable(plugin1, [plugin2, ...])` - * `cli.disable(plugin1, [plugin2, ...])` - * - * Methods are chainable - `cli.enable(plugin).disable(plugin2)`. - * - * The 'help' plugin is enabled by default. - */ -var enable = { - help: true, //Adds -h, --help - version: false, //Adds -v,--version => gets version by parsing a nearby package.json - daemon: false, //Adds -d,--daemon [ARG] => (see cli.daemon() below) - status: false, //Adds -k,--no-color & --debug => display plain status messages /display debug messages - timeout: false, //Adds -t,--timeout N => timeout the process after N seconds - catchall: false, //Adds -c,--catch => catch and output uncaughtExceptions - glob: false //Adds glob matching => use cli.glob(arg) -} -cli.enable = function (/*plugins*/) { - Array.prototype.slice.call(arguments).forEach(function (plugin) { - switch (plugin) { - case 'daemon': - try { - daemon = require('daemon'); - if (typeof daemon.daemonize !== 'function') { - throw 'Invalid module'; - } - } catch (e) { - cli.fatal('daemon.node not installed. Please run `npm install daemon`'); - } - break; - case 'catchall': - process.on('uncaughtException', function (err) { - cli.error('Uncaught exception: ' + (err.msg || err)); - }); - break; - case 'help': case 'version': case 'status': - case 'autocomplete': case 'timeout': - //Just add switches. - break; - case 'glob': - cli.glob = require('glob'); - break; - default: - cli.fatal('Unknown plugin "' + plugin + '"'); - break; - } - enable[plugin] = true; - }); - return cli; -} -cli.disable = function (/*plugins*/) { - Array.prototype.slice.call(arguments).forEach(function (plugin) { - if (enable[plugin]) { - enable[plugin] = false; - } - }); - return cli; -} - -/** - * Sets argv (default is process.argv). - * - * @param {Array|String} argv - * @param {Boolean} keep_arg0 (optional - default is false) - * @api public - */ -cli.setArgv = function (arr, keep_arg0) { - if (typeof arr == 'string') { - arr = arr.split(' '); - } else { - arr = arr.slice(); - } - cli.app = arr.shift(); - //Strip off argv[0] if it's a node binary - if (!keep_arg0 && ('node' === cli.native.path.basename(cli.app) - || process.execPath === cli.app)) { - cli.app = arr.shift(); - } - cli.app = cli.native.path.basename(cli.app); - argv_parsed = false; - cli.args = cli.argv = argv = arr; - cli.argc = argv.length; - cli.options = {}; - cli.command = null; -}; -cli.setArgv(process.argv); - -/** - * Returns the next opt, or false if no opts are found. - * - * @return {String} opt - * @api public - */ -cli.next = function () { - if (!argv_parsed) { - cli.args = []; - argv_parsed = true; - } - - curr_val = null; - - //If we're currently in a group of short opts (e.g. -abc), return the next opt - if (short_tags.length) { - curr_opt = short_tags.shift(); - full_opt = '-' + curr_opt; - return curr_opt; - } - - if (!argv.length) { - return false; - } - - curr_opt = argv.shift(); - - //If an escape sequence is found (- or --), subsequent opts are ignored - if (curr_opt === '-' || curr_opt === '--') { - while (argv.length) { - cli.args.push(argv.shift()); - } - return false; - } - - //If the next element in argv isn't an opt, add it to the list of args - if (curr_opt[0] !== '-') { - cli.args.push(curr_opt); - return cli.next(); - } else { - //Check if the opt is short/long - is_long = curr_opt[1] === '-'; - curr_opt = curr_opt.substr(is_long ? 2 : 1); - } - - //Accept grouped short opts, e.g. -abc => -a -b -c - if (!is_long && curr_opt.length > 1) { - short_tags = curr_opt.split(''); - return cli.next(); - } - - var eq, len; - - //Check if the long opt is in the form --option=VALUE - if (is_long && (eq = curr_opt.indexOf('=')) >= 0) { - curr_val = curr_opt.substr(eq + 1); - curr_opt = curr_opt.substr(0, eq); - len = curr_val.length; - //Allow values to be quoted - if ((curr_val[0] === '"' && curr_val[len - 1] === '"') || - (curr_val[0] === "'" && curr_val[len - 1] === "'")) - { - curr_val = curr_val.substr(1, len-2); - } - if (curr_val.match(/^[0-9]+$/)) { - curr_val = parseInt(curr_val, 10); - } - } - - //Save the opt representation for later - full_opt = (is_long ? '--' : '-') + curr_opt; - - return curr_opt; -}; - -/** - * Parses command line opts. - * - * `opts` must be an object with opts defined like: - * long_tag: [short_tag, description, value_type, default_value]; - * - * `commands` is an optional array or object for apps that are of the form - * my_app [OPTIONS] [ARGS] - * The command list is output with usage information + there is bundled - * support for auto-completion, etc. - * - * See README.md for more information. - * - * @param {Object} opts - * @param {Object} commands (optional) - * @return {Object} opts (parsed) - * @api public - */ -cli.parse = function (opts, command_def) { - var default_val, i, parsed = cli.options, seen, - catch_all = !opts; - opt_list = opts || {}; - commands = command_def; - command_list = commands || []; - if (commands && !Array.isArray(commands)) { - command_list = Object.keys(commands); - } - while (o = cli.next()) { - seen = false; - for (opt in opt_list) { - if (!(opt_list[opt] instanceof Array)) { - continue; - } - if (!opt_list[opt][0]) { - opt_list[opt][0] = opt; - } - if (o === opt || o === opt_list[opt][0]) { - seen = true; - if (opt_list[opt].length === 2) { - parsed[opt] = true; - break; - } - default_val = null; - if (opt_list[opt].length === 4) { - default_val = opt_list[opt][3]; - } - if (opt_list[opt][2] instanceof Array) { - for (i = 0, l = opt_list[opt][2].length; i < l; i++) { - if (typeof opt_list[opt][2][i] === 'number') { - opt_list[opt][2][i] += ''; - } - } - parsed[opt] = cli.getArrayValue(opt_list[opt][2], is_long ? null : default_val); - break; - } - if (opt_list[opt][2].toLowerCase) { - opt_list[opt][2] = opt_list[opt][2].toLowerCase(); - } - switch (opt_list[opt][2]) { - case 'string': case 1: case true: - parsed[opt] = cli.getValue(default_val); - break; - case 'int': case 'number': case 'num': - case 'time': case 'seconds': case 'secs': case 'minutes': case 'mins': - case 'x': case 'n': - parsed[opt] = cli.getInt(default_val); - break; - case 'float': case 'decimal': - parsed[opt] = cli.getFloat(default_val); - break; - case 'path': case 'file': case 'directory': case 'dir': - parsed[opt] = cli.getPath(default_val, opt_list[opt][2]); - break; - case 'email': - parsed[opt] = cli.getEmail(default_val); - break; - case 'url': case 'uri': case 'domain': case 'host': - parsed[opt] = cli.getUrl(default_val, opt_list[opt][2]); - break; - case 'ip': - parsed[opt] = cli.getIp(default_val); - break; - case 'bool': case 'boolean': case 'on': - parsed[opt] = true; - break; - case 'false': case 'off': case false: case 0: - parsed[opt] = false; - break; - default: - cli.fatal('Unknown opt type "' + opt_list[opt][2] + '"'); - } - break; - } - } - if (process.env.NODE_DISABLE_COLORS) { - no_color = true; - } - if (!seen) { - if (enable.help && (o === 'h' || o === 'help')) { - cli.getUsage(); - process.exit(); - } else if (enable.version && (o === 'v' || o === 'version')) { - if (cli.version == null) { - cli.parsePackageJson(); - } - console.error(cli.app + ' v' + cli.version); - process.exit(); - } else if (enable.daemon && (o === 'd' || o === 'daemon')) { - daemon_arg = cli.getArrayValue(['start','stop','restart','pid','log'], is_long ? null : 'start'); - continue; - } else if (enable.catchall && (o === 'c' || o === 'catch')) { - continue; - } else if (enable.status && (o === 'k' || o === 'no-color' || o === 'debug')) { - no_color = (o === 'k' || o === 'no-color'); - show_debug = o === 'debug'; - continue; - } else if (enable.timeout && (o === 't' || o === 'timeout')) { - var secs = cli.getInt(); - setTimeout(function () { - cli.fatal('Process timed out after ' + secs + 's'); - }, secs * 1000); - continue; - } else if (catch_all) { - parsed[o] = curr_val || true; - continue; - } - cli.fatal('Unknown option ' + full_opt); - } - } - //Fill the remaining options with their default value or null - for (opt in opt_list) { - default_val = opt_list[opt].length === 4 ? opt_list[opt][3] : null; - if (!(opt_list[opt] instanceof Array)) { - parsed[opt] = opt_list[opt]; - continue; - } else if (typeof parsed[opt] === 'undefined') { - parsed[opt] = default_val; - } - } - if (command_list.length) { - if (cli.args.length === 0) { - if (enable.help) { - cli.getUsage(); - } else { - cli.fatal('A command is required (' + command_list.join(', ') + ').'); - } - process.exit(1); - } else { - cli.command = cli.autocompleteCommand(cli.args.shift()); - } - } - cli.argc = cli.args.length; - return parsed; -}; - -/** - * Helper method for matching a command from the command list. - * - * @param {String} command - * @return {String} full_command - * @api public - */ -cli.autocompleteCommand = function (command) { - var list; - if (!(command_list instanceof Array)) { - list = Object.keys(command_list); - } else { - list = command_list; - } - var i, j = 0, c = command.length, tmp_list; - if (list.length === 0 || list.indexOf(command) !== -1) { - return command; - } - for (i = 0; i < c; i++) { - tmp_list = []; - l = list.length; - if (l <= 1) break; - for (j = 0; j < l; j++) - if (list[j].length >= i && list[j][i] === command[i]) - tmp_list.push(list[j]); - list = tmp_list; - } - l = list.length; - if (l === 1) { - return list[0]; - } else if (l === 0) { - cli.fatal('Unknown command "' + command + '"' + (enable.help ? '. Please see --help for more information' : '')); - } else { - list.sort(); - cli.fatal('The command "' + command + '" is ambiguous and could mean "' + list.join('", "') + '"'); - } -}; - -/** - * Adds methods to output styled status messages to stderr. - * - * Added methods are cli.info(msg), cli.error(msg), cli.ok(msg), and - * cli.debug(msg). - * - * To control status messages, use the 'status' plugin - * 1) debug() messages are hidden by default. Display them with - * the --debug opt. - * 2) to hide all status messages, use the -s or --silent opt. - * - * @api private - */ -cli.status = function (msg, type) { - var pre; - switch (type) { - case 'info': - pre = no_color ? 'INFO:' : '\x1B[33mINFO\x1B[0m:'; - break; - case 'debug': - pre = no_color ? 'DEBUG:' : '\x1B[36mDEBUG\x1B[0m:'; - break; - case 'error': - case 'fatal': - pre = no_color ? 'ERROR:' : '\x1B[31mERROR\x1B[0m:'; - break; - case 'ok': - pre = no_color ? 'OK:' : '\x1B[32mOK\x1B[0m:'; - break; - } - msg = pre + ' ' + msg; - if (type === 'fatal') { - console.error(msg); - process.exit(1); - } - if (enable.status && !show_debug && type === 'debug') { - return; - } - console.error(msg); -}; -['info','error','ok','debug','fatal'].forEach(function (type) { - cli[type] = function (msg) { - cli.status(msg, type); - }; -}); - -/** - * Sets the app name and version. - * - * Usage: - * setApp('myapp', '0.1.0'); - * setApp('./package.json'); //Pull name/version from package.json - * - * @param {String} name - * @return cli (for chaining) - * @api public - */ -cli.setApp = function (name, version) { - if (name.indexOf('package.json') !== -1) { - cli.parsePackageJson(name); - } else { - cli.app = name; - cli.version = version; - } - return cli; -}; - -/** - * Parses the version number from package.json. If no path is specified, cli - * will attempt to locate a package.json in ./, ../ or ../../ - * - * @param {String} path (optional) - * @api public - */ -cli.parsePackageJson = function (path) { - var parse_packagejson = function (path) { - var packagejson = JSON.parse(cli.native.fs.readFileSync(path, 'utf8')); - cli.version = packagejson.version; - cli.app = packagejson.name; - }; - var try_all = function (arr, func, err) { - for (var i = 0, l = arr.length; i < l; i++) { - try { - func(arr[i]); - return; - } catch (e) { - if (i === l-1) { - cli.fatal(err); - } - } - } - }; - try { - if (path) { - return parse_packagejson(path); - } - try_all([ - __dirname + '/package.json', - __dirname + '/../package.json', - __dirname + '/../../package.json' - ], parse_packagejson); - } catch (e) { - cli.fatal('Could not detect ' + cli.app + ' version'); - } -}; - -/** - * Sets the usage string - default is `app [OPTIONS] [ARGS]`. - * - * @param {String} u - * @return cli (for chaining) - * @api public - */ -cli.setUsage = function (u) { - usage = u; - return cli; -}; - -var pad = function (str, len) { - if (typeof len === 'undefined') { - len = str; - str = ''; - } - if (str.length < len) { - len -= str.length; - while (len--) str += ' '; - } - return str; -}; - -/** - * Automatically build usage information from the opts list. If the help - * plugin is enabled (default), this info is displayed with -h, --help. - * - * @api public - */ -cli.getUsage = function () { - var short, desc, optional, line, seen_opts = [], - switch_pad = cli.option_width; - - var trunc_desc = function (pref, desc, len) { - var pref_len = pref.length, - desc_len = cli.width - pref_len, - truncated = ''; - if (desc.length <= desc_len) { - return desc; - } - var desc_words = (desc+'').split(' '), chars = 0, word; - while (desc_words.length) { - truncated += (word = desc_words.shift()) + ' '; - chars += word.length; - if (desc_words.length && chars + desc_words[0].length > desc_len) { - truncated += '\n' + pad(pref_len); - chars = 0; - } - } - return truncated; - }; - - usage = usage || cli.app + ' [OPTIONS]' + (command_list.length ? ' ' : '') + ' [ARGS]'; - if (no_color) { - console.error('Usage:\n ' + usage); - console.error('Options: '); - } else { - console.error('\x1b[1mUsage\x1b[0m:\n ' + usage); - console.error('\n\x1b[1mOptions\x1b[0m: '); - } - for (opt in opt_list) { - - if (opt.length === 1) { - long = opt_list[opt][0]; - short = opt; - } else { - long = opt; - short = opt_list[opt][0]; - } - - //Parse opt_list - desc = opt_list[opt][1].trim(); - type = opt_list[opt].length >= 3 ? opt_list[opt][2] : null; - optional = opt_list[opt].length === 4 ? opt_list[opt][3] : null; - - //Build usage line - if (short === long) { - if (short.length === 1) { - line = ' -' + short; - } else { - line = ' --' + long; - } - } else { - line = ' -' + short + ', --' + long; - } - line += ' '; - - if (type) { - if (type instanceof Array) { - desc += '. VALUE must be either [' + type.join('|') + ']'; - type = 'VALUE'; - } - if (type === true || type === 1) { - type = long.toUpperCase(); - } - type = type.toUpperCase(); - if (type === 'FLOAT' || type === 'INT') { - type = 'NUMBER'; - } - line += optional ? '[' + type + ']' : type; - } - line = pad(line, switch_pad); - line += trunc_desc(line, desc); - line += optional ? ' (Default is ' + optional + ')' : ''; - console.error(line.replace('%s', '%\0s')); - - seen_opts.push(short); - seen_opts.push(long); - } - if (enable.timeout && seen_opts.indexOf('t') === -1 && seen_opts.indexOf('timeout') === -1) { - console.error(pad(' -t, --timeout N', switch_pad) + 'Exit if the process takes longer than N seconds'); - } - if (enable.status) { - if (seen_opts.indexOf('k') === -1 && seen_opts.indexOf('no-color') === -1) { - console.error(pad(' -k, --no-color', switch_pad) + 'Omit color from output'); - } - if (seen_opts.indexOf('debug') === -1) { - console.error(pad(' --debug', switch_pad) + 'Show debug information'); - } - } - if (enable.catchall && seen_opts.indexOf('c') === -1 && seen_opts.indexOf('catch') === -1) { - console.error(pad(' -c, --catch', switch_pad) + 'Catch unanticipated errors'); - } - if (enable.daemon && seen_opts.indexOf('d') === -1 && seen_opts.indexOf('daemon') === -1) { - console.error(pad(' -d, --daemon [ARG]', switch_pad) + 'Daemonize the process. Control the daemon using [start, stop, restart, log, pid]'); - } - if (enable.version && seen_opts.indexOf('v') === -1 && seen_opts.indexOf('version') === -1) { - console.error(pad(' -v, --version', switch_pad) + 'Display the current version'); - } - if (enable.help && seen_opts.indexOf('h') === -1 && seen_opts.indexOf('help') === -1) { - console.error(pad(' -h, --help', switch_pad) + 'Display help and usage details'); - } - if (command_list.length) { - console.error('\n\x1b[1mCommands\x1b[0m: '); - if (!Array.isArray(commands)) { - for (var c in commands) { - line = ' ' + pad(c, switch_pad - 2); - line += trunc_desc(line, commands[c]); - console.error(line); - } - } else { - command_list.sort(); - console.error(' ' + trunc_desc(' ', command_list.join(', '))); - } - } - process.exit(); -}; - -/** - * Generates an error message when an opt is incorrectly used. - * - * @param {String} expects (e.g. 'a value') - * @param {String} type (e.g. 'VALUE') - * @api public - */ -cli.getOptError = function (expects, type) { - var err = full_opt + ' expects ' + expects - + '. Use `' + cli.app + ' ' + full_opt + (is_long ? '=' : ' ') + type + '`'; - return err; -}; - -/** - * Gets the next opt value and validates it with an optional validation - * function. If validation fails or no value can be obtained, this method - * will return the default value (if specified) or exit with err_msg. - * - * @param {String} default_val - * @param {Function} validate_func - * @param {String} err_msg - * @api public - */ -cli.getValue = function (default_val, validate_func, err_msg) { - err_msg = err_msg || cli.getOptError('a value', 'VALUE'); - - var value; - - try { - if (curr_val) { - if (validate_func) { - curr_val = validate_func(curr_val); - } - return curr_val; - } - - //Grouped short opts aren't allowed to have values - if (short_tags.length) { - throw 'Short tags'; - } - - //If there's no args left or the next arg is an opt, return the - //default value (if specified) - otherwise fail - if (!argv.length || argv[0][0] === '-') { - throw 'No value'; - } - - value = argv.shift(); - - if (value.match(/^[0-9]+$/)) { - value = parseInt(value, 10); - } - - //Run the value through a validation/transformation function if specified - if (validate_func) { - value = validate_func(value); - } - } catch (e) { - - //The value didn't pass the validation/transformation. Unshift the value and - //return the default value (if specified) - if (value) { - argv.unshift(value); - } - return default_val != null ? default_val : cli.fatal(err_msg); - } - return value; -}; - -cli.getInt = function (default_val) { - return cli.getValue(default_val, function (value) { - if (typeof value === 'number') return value; - if (!value.match(/^(?:-?(?:0|[1-9][0-9]*))$/)) { - throw 'Invalid int'; - } - return parseInt(value); - }, cli.getOptError('a number', 'NUMBER')); -} - -cli.getFloat = function (default_val) { - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:-?(?:0|[1-9][0-9]*))?(?:\.[0-9]*)?$/)) { - throw 'Invalid float'; - } - return parseFloat(value, 10); - }, cli.getOptError('a number', 'NUMBER')); -} - -cli.getUrl = function (default_val, identifier) { - identifier = identifier || 'url'; - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?:\w+:\w+@)?((?:(?:[-\w\d{1-3}]+\.)+(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|edu|co\.uk|ac\.uk|it|fr|tv|museum|asia|local|travel|[a-z]{2})?)|((\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)(\.(\b25[0-5]\b|\b[2][0-4][0-9]\b|\b[0-1]?[0-9]?[0-9]\b)){3}))(?::[\d]{1,5})?(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?:#(?:[-\w~!$ |\/.,*:;=]|%[a-f\d]{2})*)?$/i)) { - throw 'Invalid URL'; - } - return value; - }, cli.getOptError('a ' + identifier, identifier.toUpperCase())); -} - -cli.getEmail = function (default_val) { - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/)) { - throw 'Invalid email'; - } - return value; - }, cli.getOptError('an email', 'EMAIL')); -} - -cli.getIp = function (default_val) { - return cli.getValue(default_val, function (value) { - if (!value.match(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/)) { - throw 'Invalid IP'; - } - return value; - }, cli.getOptError('an IP', 'IP')); -} - -cli.getPath = function (default_val, identifier) { - identifier = identifier || 'path'; - return cli.getValue(default_val, function (value) { - if (value.match(/[?*:;{}]/)) { - throw 'Invalid path'; - } - return value; - }, cli.getOptError('a ' + identifier, identifier.toUpperCase())); -} - -cli.getArrayValue = function (arr, default_val) { - return cli.getValue(default_val, function (value) { - if (arr.indexOf(value) === -1) { - throw 'Unexpected value'; - } - return value; - }, cli.getOptError('either [' + arr.join('|') + ']', 'VALUE')); -} - -/** - * Gets all data from STDIN (with optional encoding) and sends it to callback. - * - * @param {String} encoding (optional - default is 'utf8') - * @param {Function} callback - * @api public - */ -cli.withStdin = function (encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding; - encoding = 'utf8'; - } - var stream = process.openStdin(), data = ''; - stream.setEncoding(encoding); - stream.on('data', function (chunk) { - data += chunk; - }); - stream.on('end', function () { - callback.apply(cli, [data]); - }); -}; - -/** - * Gets all data from STDIN, splits the data into lines and sends it - * to callback (callback isn't called until all of STDIN is read. To - * process each line as it's received, see the method below - * - * @param {Function} callback - * @api public - */ -cli.withStdinLines = function (callback) { - cli.withStdin(function (data) { - var sep = data.indexOf('\r\n') !== -1 ? '\r\n' : '\n'; - callback.apply(cli, [data.split(sep), sep]); - }); -}; - -/** - * Asynchronously reads a file line by line. When a line is received, - * callback is called with (line, sep) - when EOF is reached, callback - * receives (null, null, true) - * - * @param {String} file (optional - default is 'stdin') - * @param {String} encoding (optional - default is 'utf8') - * @param {Function} callback (line, sep, eof) - * @api public - */ -cli.withInput = function (file, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding; - encoding = 'utf8'; - } else if (typeof file === 'function') { - callback = file; - encoding = 'utf8'; - file = 'stdin'; - } - if (file === 'stdin') { - file = process.openStdin(); - } else { - try { - file = cli.native.fs.createReadStream(file); - file.on('error', cli.fatal); - } catch (e) { - return cli.fatal(e); - } - } - file.setEncoding(encoding); - var lines = [], data = '', eof, sep; - file.on('data', function (chunk) { - if (eof) return; - data += chunk; - if (!sep) { - if (data.indexOf('\r\n') !== -1) { - sep = '\r\n'; - } else if (data.indexOf('\n') !== -1) { - sep = '\n'; - } else { - last_line = data; - return; - } - } - lines = data.split(sep); - data = eof ? null : lines.pop(); - while (lines.length) { - callback.apply(cli, [lines.shift(), sep, false]); - } - }); - file.on('end', function () { - eof = true; - if (data.length) { - callback.apply(cli, [data, sep || '', false]); - } - callback.apply(cli, [null, null, true]); - }); -}; - -/** - * A method for creating and controlling a daemon. - * - * `arg` can be: - * start = daemonizes the process - * stop = stops the daemon if it is running - * restart = alias for stop -> start - * pid = outputs the daemon's PID if it is running - * log = outputs the daemon's log file (stdout + stderr) - * - * @param {String} arg (Optional - default is 'start') - * @param {Function} callback - * @api public - */ -cli.daemon = function (arg, callback) { - if (typeof daemon === 'undefined') { - cli.fatal('Daemon is not initialized'); - } - - if (typeof arg === 'function') { - callback = arg; - arg = 'start'; - } - - var lock_file = '/tmp/' + cli.app + '.pid', - log_file = '/tmp/' + cli.app + '.log'; - - var start = function () { - daemon.daemonize(log_file, lock_file, function (err) { - if (err) return cli.error('Error starting daemon: ' + err); - callback(); - }); - }; - - var stop = function () { - try { - cli.native.fs.readFileSync(lock_file); - } catch (e) { - return cli.error('Daemon is not running'); - }; - daemon.kill(lock_file, function (err, pid) { - if (err && err.errno === 3) { - return cli.error('Daemon is not running'); - } else if (err) { - return cli.error('Error stopping daemon: ' + err.errno); - } - cli.ok('Successfully stopped daemon with pid: ' + pid); - }); - }; - - switch(arg) { - case 'stop': - stop(); - break; - case 'restart': - daemon.stop(lock_file, function () { - start(); - }); - break; - case 'log': - try { - cli.native.fs.createReadStream(log_file, {encoding: 'utf8'}).pipe(process.stdout); - } catch (e) { - return cli.error('No daemon log file'); - }; - break; - case 'pid': - try { - var pid = cli.native.fs.readFileSync(lock_file, 'utf8'); - cli.native.fs.statSync('/proc/' + pid); - cli.info(pid); - } catch (e) { - return cli.error('Daemon is not running'); - }; - break; - default: - start(); - break; - } -} - -/** - * The main entry method. Calling cli.main() is only necessary in - * scripts that have daemon support enabled. `callback` receives (args, options) - * - * @param {Function} callback - * @api public - */ -cli.main = function (callback) { - var after = function () { - callback.apply(cli, [cli.args, cli.options]); - }; - if (enable.daemon && daemon_arg) { - cli.daemon(daemon_arg, after); - } else { - after(); - } -} - -/** - * Bind creationix's stack (https://github.com/creationix/stack). - * - * Create a simple middleware stack by calling: - * - * cli.createServer(middleware).listen(port); - * - * @return {Server} server - * @api public - */ -cli.createServer = function(/*layers*/) { - var defaultStackErrorHandler = function (req, res, err) { - if (err) { - console.error(err.stack); - res.writeHead(500, {"Content-Type": "text/plain"}); - return res.end(err.stack + "\n"); - } - res.writeHead(404, {"Content-Type": "text/plain"}); - res.end("Not Found\n"); - }; - var handle = error = defaultStackErrorHandler, - layers = Array.prototype.slice.call(arguments); - - //Allow createServer(a,b,c) and createServer([a,b,c]) - if (layers.length && layers[0] instanceof Array) { - layers = layers[0]; - } - layers.reverse().forEach(function (layer) { - var child = handle; - handle = function (req, res) { - try { - layer(req, res, function (err) { - if (err) return error(req, res, err); - child(req, res); - }); - } catch (err) { - error(req, res, err); - } - }; - }); - return cli.native.http.createServer(handle); -}; - -/** - * A wrapper for child_process.exec(). - * - * If the child_process exits successfully, `callback` receives an array of - * stdout lines. The current process exits if the child process has an error - * and `errback` isn't defined. - * - * @param {String} cmd - * @param {Function} callback (optional) - * @param {Function} errback (optional) - * @api public - */ -cli.exec = function (cmd, callback, errback) { - cli.native.child_process.exec(cmd, function (err, stdout, stderr) { - err = err || stderr; - if (err) { - if (errback) { - return errback(err, stdout); - } - return cli.fatal('exec() failed\n' + err); - } - if (callback) { - callback(stdout.split('\n')); - } - }); -}; - -/** - * Helper method for outputting a progress bar to the console. - * - * @param {Number} progress (0 <= progress <= 1) - * @api public - */ -var last_progress_call, progress_len = 74; -cli.progress = function (progress) { - if (progress < 0 || progress > 1 || isNaN(progress)) return; - var now = (new Date()).getTime(); - if (last_progress_call && (now - last_progress_call) < 100 && progress !== 1) { - return; //Throttle progress calls - } - last_progress_call = now; - - - var barLength = Math.floor(progress_len * progress), - str = ''; - if (barLength == 0 && progress > 0) { - barLength = 1; - } - for (var i = 1; i <= progress_len; i++) { - str += i <= barLength ? '#' : ' '; - } - cli.native.util.print('[' + str + '] ' + Math.floor(progress * 100) + '%' + (progress === 1 ? '\n' : '\u000D')); -}; - -/** - * Helper method for outputting a spinner to the console. - * - * @param {String|Boolean} prefix (optional) - * @api public - */ -var spinnerInterval; -cli.spinner = function (prefix, end) { - if (end) { - cli.native.util.print('\u000D' + prefix); - return clearInterval(spinnerInterval); - } - prefix = prefix + ' ' || ''; - var spinner = ['-','\\','|','/'], i = 0, l = spinner.length; - spinnerInterval = setInterval(function () { - cli.native.util.print('\u000D' + prefix + spinner[i++]); - if (i == l) i = 0; - }, 200); -}; diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/cat.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/cat.js deleted file mode 100755 index 14c4e79c4..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/cat.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -var output_file = function (file) { - cli.withInput(file, function (line, sep, eof) { - if (!eof) { - cli.output(line + sep); - } else if (cli.args.length) { - output_file(cli.args.shift()); - } - }); -}; - -if (cli.args.length) { - output_file(cli.args.shift()); -} \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/command.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/command.js deleted file mode 100755 index 2f04491e7..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/command.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -//The second (optional) argument of cli.parse() is a command list -//Type `./command.js --help` for usage info - -//cli enables auto-completion of commands (similiar to npm), e.g. all of -//the following are equivalent and result in "Command is: install": -// $ ./command.js install -// $ ./command.js inst -// $ ./command.js i - -cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']); - -console.log('Command is: ' + cli.command); diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/echo.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/echo.js deleted file mode 100755 index dac9ccaf1..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/echo.js +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env node - -/* All of the following commands are equivalent and write `foo\tbar foo` to out.txt - $ ./echo.js -n -e --output=out.txt "foo\tbar" "foo" - $ ./echo.js --newline --escape --output "out.txt" "foo\tbar" "foo" - $ ./echo.js -ne --output=out.txt "foo\tbar" "foo" - $ ./echo.js -en --output="out.txt" "foo\tbar" "foo" -*/ - -var cli = require('cli'); - -cli.parse({ - newline: ['n', 'Do not output the trailing newline'], - escape: ['e', 'Enable interpretation of backslash escapes'], - separator: ['s', 'Separate arguments using this value', 'string', ' '], - output: [false, 'Write to FILE rather than the console', 'file'] -}); - -cli.main(function (args, options) { - var output = '', i, j, l, output_stream; - - if (this.argc) { - if (options.escape) { - var replace = {'\\n':'\n','\\r':'\r','\\t':'\t','\\e':'\e','\\v':'\v','\\f':'\f','\\c':'\c','\\b':'\b','\\a':'\a','\\\\':'\\'}; - var escape = function (str) { - string += ''; - for (j in replace) { - string = string.replace(i, replace[i]); - } - return string; - } - for (i = 0, l = this.argc; i < l; i++) { - args[i] = escape(args[i]); - } - options.separator = escape(options.separator); - } - output += args.join(options.separator); - } - - if (!options.newline) { - output += '\n'; - } - - try { - if (options.output) { - output_stream = this.native.fs.createWriteStream(options.output) - } else { - output_stream = process.stdout; - } - output_stream.write(output); - } catch (e) { - this.fatal('Could not write to output stream'); - } -}); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/glob.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/glob.js deleted file mode 100755 index 12585c01f..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/glob.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli').enable('glob'); - -//Running `./glob.js *.js` will output a list of .js files in this directory -console.log(cli.args); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/long_desc.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/long_desc.js deleted file mode 100755 index 63632f4bb..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/long_desc.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node - -var cli = require('../'); - -//You can (optionally) boost the width of output with: -//cli.width = 120; - -//You can also adjust the width of the options/command definitions -//cli.option_width = 25; - -var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s ' - + 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make' - + ' a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, ' - + 'remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing ' - + 'Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions' - + ' of Lorem Ipsum.'; - -cli.parse({ - foo: ['f', long_desc] -}); diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/progress.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/progress.js deleted file mode 100755 index 300c67405..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/progress.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -var i = 0, interval = setInterval(function () { - cli.progress(++i / 100); - if (i === 100) { - clearInterval(interval); - cli.ok('Finished!'); - } -}, 50); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/sort.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/sort.js deleted file mode 100755 index 5d223133f..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/sort.js +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -var options = cli.parse({ - numeric: ['n', 'Compare using a numeric sort'], - reverse: ['r', 'Reverse the results'] -}); - -cli.withStdinLines(function (lines, newline) { - lines.sort(!options.numeric ? null : function (a, b) { - return parseInt(a) > parseInt(b); - }); - if (options.reverse) { - lines.reverse(); - } - this.output(lines.join(newline)); -}); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/spinner.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/spinner.js deleted file mode 100755 index 61000013a..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/spinner.js +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli'); - -cli.spinner('Working..'); - -setTimeout(function () { - cli.spinner('Working.. done!', true); //End the spinner -}, 3000); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/static.coffee b/deploy/core/node_modules/jshint/node_modules/cli/examples/static.coffee deleted file mode 100755 index cbf3b16e1..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/static.coffee +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env coffee - -cli = require 'cli' - -cli.enable('daemon','status') - .setUsage('static.coffee [OPTIONS]') - -cli.parse { - log: ['l', 'Enable logging'] - port: ['p', 'Listen on this port', 'number', 8080] - serve: [false, 'Serve static files from PATH', 'path', './public'] -} - -middleware = [] - -cli.main (args, options) -> - - if options.log - @debug 'Enabling logging' - middleware.push require('creationix/log')() - - @debug 'Serving files from ' + options.serve - middleware.push require('creationix/static')('/', options.serve, 'index.html') - - server = @createServer(middleware).listen options.port - - @ok 'Listening on port ' + options.port \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/examples/static.js b/deploy/core/node_modules/jshint/node_modules/cli/examples/static.js deleted file mode 100755 index eb6fd2481..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/examples/static.js +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env node - -var cli = require('cli').enable('status', 'daemon'); - -cli.parse({ - log: ['l', 'Enable logging'], - port: ['p', 'Listen on this port', 'number', 8080], - serve: [false, 'Serve static files from PATH', 'path', './public'] -}); - -cli.main(function (args, options) { - var server, middleware = []; - - if (options.log) { - this.debug('Enabling logging'); - middleware.push(require('creationix/log')()); - } - - this.debug('Serving files from ' + options.serve); - middleware.push(require('creationix/static')('/', options.serve, 'index.html')); - - server = this.createServer(middleware).listen(options.port); - - this.ok('Listening on port ' + options.port); -}); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/cli/index.js b/deploy/core/node_modules/jshint/node_modules/cli/index.js deleted file mode 100644 index 3966bd737..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./cli'); diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71c9..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031d5..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae716..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. 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 AUTHOR 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 THE AUTHOR OR CONTRIBUTORS -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. diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/README.md b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/README.md deleted file mode 100644 index cc6916451..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -## Attention: node-glob users! - -The API has changed dramatically between 2.x and 3.x. This library is -now 100% JavaScript, and the integer flags have been replaced with an -options object. - -Also, there's an event emitter class, proper tests, and all the other -things you've come to expect from node modules. - -And best of all, no compilation! - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Features - -Please see the [minimatch -documentation](https://github.com/isaacs/minimatch) for more details. - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instanting the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `error` The error encountered. When an error is encountered, the - glob object is in an undefined state, and should be discarded. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `statCache` Collection of all the stat results the glob search - performed. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `1` - Path exists, and is not a directory - * `2` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `abort` Stop the search. - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the glob object, as well. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. It will cause - ELOOP to be triggered one level sooner in the case of cyclical - symbolic links. -* `silent` When an unusual error is encountered - when attempting to read a directory, a warning will be printed to - stderr. Set the `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered - when attempting to read a directory, the process will just continue on - in search of other matches. Set the `strict` option to raise an error - in these cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary to - set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `sync` Perform a synchronous glob search. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. - Set this flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `nocase` Perform a case-insensitive match. Note that case-insensitive - filesystems will sometimes result in glob returning results that are - case-insensitively matched anyway, since readdir and stat will not - raise an error. -* `debug` Set to enable debug logging in minimatch and glob. -* `globDebug` Set to enable debug logging in glob, but not minimatch. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js deleted file mode 100644 index be122df00..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "test/a/**/[cg]/../[cg]" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425e4..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "{./*/*,/*,/usr/local/*}" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js deleted file mode 100644 index f0118a4f4..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +++ /dev/null @@ -1,675 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// readdir(PREFIX) as ENTRIES -// If fails, END -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $]) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - - - -module.exports = glob - -var fs = require("graceful-fs") -, minimatch = require("minimatch") -, Minimatch = minimatch.Minimatch -, inherits = require("inherits") -, EE = require("events").EventEmitter -, path = require("path") -, isDir = {} -, assert = require("assert").ok - -function glob (pattern, options, cb) { - if (typeof options === "function") cb = options, options = {} - if (!options) options = {} - - if (typeof options === "number") { - deprecated() - return - } - - var g = new Glob(pattern, options, cb) - return g.sync ? g.found : g -} - -glob.fnmatch = deprecated - -function deprecated () { - throw new Error("glob's interface has changed. Please see the docs.") -} - -glob.sync = globSync -function globSync (pattern, options) { - if (typeof options === "number") { - deprecated() - return - } - - options = options || {} - options.sync = true - return glob(pattern, options) -} - - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (!(this instanceof Glob)) { - return new Glob(pattern, options, cb) - } - - if (typeof cb === "function") { - this.on("error", cb) - this.on("end", function (matches) { - cb(null, matches) - }) - } - - options = options || {} - - this.EOF = {} - this._emitQueue = [] - - this.maxDepth = options.maxDepth || 1000 - this.maxLength = options.maxLength || Infinity - this.cache = options.cache || {} - this.statCache = options.statCache || {} - - this.changedCwd = false - var cwd = process.cwd() - if (!options.hasOwnProperty("cwd")) this.cwd = cwd - else { - this.cwd = options.cwd - this.changedCwd = path.resolve(options.cwd) !== cwd - } - - this.root = options.root || path.resolve(this.cwd, "/") - this.root = path.resolve(this.root) - if (process.platform === "win32") - this.root = this.root.replace(/\\/g, "/") - - this.nomount = !!options.nomount - - if (!pattern) { - throw new Error("must provide pattern") - } - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - this.strict = options.strict !== false - this.dot = !!options.dot - this.mark = !!options.mark - this.sync = !!options.sync - this.nounique = !!options.nounique - this.nonull = !!options.nonull - this.nosort = !!options.nosort - this.nocase = !!options.nocase - this.stat = !!options.stat - - this.debug = !!options.debug || !!options.globDebug - if (this.debug) - this.log = console.error - - this.silent = !!options.silent - - var mm = this.minimatch = new Minimatch(pattern, options) - this.options = mm.options - pattern = this.pattern = mm.pattern - - this.error = null - this.aborted = false - - // list of all the patterns that ** has resolved do, so - // we can avoid visiting multiple times. - this._globstars = {} - - EE.call(this) - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - this.minimatch.set.forEach(iterator.bind(this)) - function iterator (pattern, i, set) { - this._process(pattern, 0, i, function (er) { - if (er) this.emit("error", er) - if (-- n <= 0) this._finish() - }) - } -} - -Glob.prototype.log = function () {} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - - var nou = this.nounique - , all = nou ? [] : {} - - for (var i = 0, l = this.matches.length; i < l; i ++) { - var matches = this.matches[i] - this.log("matches[%d] =", i, matches) - // do like the shell, and spit out the literal glob - if (!matches) { - if (this.nonull) { - var literal = this.minimatch.globSet[i] - if (nou) all.push(literal) - else all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) all.push.apply(all, m) - else m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) all = Object.keys(all) - - if (!this.nosort) { - all = all.sort(this.nocase ? alphasorti : alphasort) - } - - if (this.mark) { - // at *some* point we statted all of these - all = all.map(function (m) { - var sc = this.cache[m] - if (!sc) - return m - var isDir = (Array.isArray(sc) || sc === 2) - if (isDir && m.slice(-1) !== "/") { - return m + "/" - } - if (!isDir && m.slice(-1) === "/") { - return m.replace(/\/+$/, "") - } - return m - }, this) - } - - this.log("emitting end", all) - - this.EOF = this.found = all - this.emitMatch(this.EOF) -} - -function alphasorti (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return alphasort(a, b) -} - -function alphasort (a, b) { - return a > b ? 1 : a < b ? -1 : 0 -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit("abort") -} - -Glob.prototype.pause = function () { - if (this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = true - this.emit("pause") -} - -Glob.prototype.resume = function () { - if (!this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = false - this.emit("resume") - this._processEmitQueue() - //process.nextTick(this.emit.bind(this, "resume")) -} - -Glob.prototype.emitMatch = function (m) { - if (!this.stat || this.statCache[m] || m === this.EOF) { - this._emitQueue.push(m) - this._processEmitQueue() - } else { - this._stat(m, function(exists, isDir) { - if (exists) { - this._emitQueue.push(m) - this._processEmitQueue() - } - }) - } -} - -Glob.prototype._processEmitQueue = function (m) { - while (!this._processingEmitQueue && - !this.paused) { - this._processingEmitQueue = true - var m = this._emitQueue.shift() - if (!m) { - this._processingEmitQueue = false - break - } - - this.log('emit!', m === this.EOF ? "end" : "match") - - this.emit(m === this.EOF ? "end" : "match", m) - this._processingEmitQueue = false - } -} - -Glob.prototype._process = function (pattern, depth, index, cb_) { - assert(this instanceof Glob) - - var cb = function cb (er, res) { - assert(this instanceof Glob) - if (this.paused) { - if (!this._processQueue) { - this._processQueue = [] - this.once("resume", function () { - var q = this._processQueue - this._processQueue = null - q.forEach(function (cb) { cb() }) - }) - } - this._processQueue.push(cb_.bind(this, er, res)) - } else { - cb_.call(this, er, res) - } - }.bind(this) - - if (this.aborted) return cb() - - if (depth > this.maxDepth) return cb() - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === "string") { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - prefix = pattern.join("/") - this._stat(prefix, function (exists, isDir) { - // either it's there, or it isn't. - // nothing more to do, either way. - if (exists) { - if (prefix && isAbsolute(prefix) && !this.nomount) { - if (prefix.charAt(0) === "/") { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - } - } - - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][prefix] = true - this.emitMatch(prefix) - } - return cb() - }) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's "absolute" like /foo/bar, - // or "relative" like "../baz" - prefix = pattern.slice(0, n) - prefix = prefix.join("/") - break - } - - // get the list of entries. - var read - if (prefix === null) read = "." - else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { - if (!prefix || !isAbsolute(prefix)) { - prefix = path.join("/", prefix) - } - read = prefix = path.resolve(prefix) - - // if (process.platform === "win32") - // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") - - this.log('absolute: ', prefix, this.root, pattern, read) - } else { - read = prefix - } - - this.log('readdir(%j)', read, this.cwd, this.root) - - return this._readdir(read, function (er, entries) { - if (er) { - // not a directory! - // this means that, whatever else comes after this, it can never match - return cb() - } - - // globstar is special - if (pattern[n] === minimatch.GLOBSTAR) { - // test without the globstar, and with every child both below - // and replacing the globstar. - var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] - entries.forEach(function (e) { - if (e.charAt(0) === "." && !this.dot) return - // instead of the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) - // below the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) - }, this) - - s = s.filter(function (pattern) { - var key = gsKey(pattern) - var seen = !this._globstars[key] - this._globstars[key] = true - return seen - }, this) - - if (!s.length) - return cb() - - // now asyncForEach over this - var l = s.length - , errState = null - s.forEach(function (gsPattern) { - this._process(gsPattern, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l <= 0) return cb() - }) - }, this) - - return - } - - // not a globstar - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = pattern[n] - var rawGlob = pattern[n]._glob - , dotOk = this.dot || rawGlob.charAt(0) === "." - - entries = entries.filter(function (e) { - return (e.charAt(0) !== "." || dotOk) && - e.match(pattern[n]) - }) - - // If n === pattern.length - 1, then there's no need for the extra stat - // *unless* the user has specified "mark" or "stat" explicitly. - // We know that they exist, since the readdir returned them. - if (n === pattern.length - 1 && - !this.mark && - !this.stat) { - entries.forEach(function (e) { - if (prefix) { - if (prefix !== "/") e = prefix + "/" + e - else e = prefix + e - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path.join(this.root, e) - } - - if (process.platform === "win32") - e = e.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][e] = true - this.emitMatch(e) - }, this) - return cb.call(this) - } - - - // now test all the remaining entries as stand-ins for that part - // of the pattern. - var l = entries.length - , errState = null - if (l === 0) return cb() // no matches possible - entries.forEach(function (e) { - var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) - this._process(p, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l === 0) return cb.call(this) - }) - }, this) - }) - -} - -function gsKey (pattern) { - return '**' + pattern.map(function (p) { - return (p === minimatch.GLOBSTAR) ? '**' : (''+p) - }).join('/') -} - -Glob.prototype._stat = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } - - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterStat(f, abs, cb, er) - } - - this.log('stat', [this.cwd, f, '=', abs]) - - if (!this.stat && this.cache.hasOwnProperty(f)) { - var exists = this.cache[f] - , isDir = exists && (Array.isArray(exists) || exists === 2) - if (this.sync) return cb.call(this, !!exists, isDir) - return process.nextTick(cb.bind(this, !!exists, isDir)) - } - - var stat = this.statCache[abs] - if (this.sync || stat) { - var er - try { - stat = fs.statSync(abs) - } catch (e) { - er = e - } - this._afterStat(f, abs, cb, er, stat) - } else { - fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) - } -} - -Glob.prototype._afterStat = function (f, abs, cb, er, stat) { - var exists - assert(this instanceof Glob) - - if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { - this.log("should be ENOTDIR, fake it") - - er = new Error("ENOTDIR, not a directory '" + abs + "'") - er.path = abs - er.code = "ENOTDIR" - stat = null - } - - var emit = !this.statCache[abs] - this.statCache[abs] = stat - - if (er || !stat) { - exists = false - } else { - exists = stat.isDirectory() ? 2 : 1 - if (emit) - this.emit('stat', f, stat) - } - this.cache[f] = this.cache[f] || exists - cb.call(this, !!exists, exists === 2) -} - -Glob.prototype._readdir = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (isAbsolute(f)) { - abs = f - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } - - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterReaddir(f, abs, cb, er) - } - - this.log('readdir', [this.cwd, f, abs]) - if (this.cache.hasOwnProperty(f)) { - var c = this.cache[f] - if (Array.isArray(c)) { - if (this.sync) return cb.call(this, null, c) - return process.nextTick(cb.bind(this, null, c)) - } - - if (!c || c === 1) { - // either ENOENT or ENOTDIR - var code = c ? "ENOTDIR" : "ENOENT" - , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) - er.path = f - er.code = code - this.log(f, er) - if (this.sync) return cb.call(this, er) - return process.nextTick(cb.bind(this, er)) - } - - // at this point, c === 2, meaning it's a dir, but we haven't - // had to read it yet, or c === true, meaning it's *something* - // but we don't have any idea what. Need to read it, either way. - } - - if (this.sync) { - var er, entries - try { - entries = fs.readdirSync(abs) - } catch (e) { - er = e - } - return this._afterReaddir(f, abs, cb, er, entries) - } - - fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) -} - -Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { - assert(this instanceof Glob) - if (entries && !er) { - this.cache[f] = entries - // if we haven't asked to stat everything for suresies, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. This also gets us one step - // further into ELOOP territory. - if (!this.mark && !this.stat) { - entries.forEach(function (e) { - if (f === "/") e = f + e - else e = f + "/" + e - this.cache[e] = true - }, this) - } - - return cb.call(this, er, entries) - } - - // now handle errors, and cache the information - if (er) switch (er.code) { - case "ENOTDIR": // totally normal. means it *does* exist. - this.cache[f] = 1 - return cb.call(this, er) - case "ENOENT": // not terribly unusual - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.cache[f] = false - return cb.call(this, er) - default: // some unusual error. Treat as failure. - this.cache[f] = false - if (this.strict) this.emit("error", er) - if (!this.silent) console.error("glob error", er) - return cb.call(this, er) - } -} - -var isAbsolute = process.platform === "win32" ? absWin : absUnix - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - , result = splitDeviceRe.exec(p) - , device = result[1] || '' - , isUnc = device && device.charAt(1) !== ':' - , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a401094..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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 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. diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6b6..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over fs module - -graceful-fs: - -* keeps track of how many file descriptors are open, and by default - limits this to 1024. Any further requests to open a file are put in a - queue until new slots become available. If 1024 turns out to be too - much, it decreases the limit further. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## Configuration - -The maximum number of open file descriptors that graceful-fs manages may -be adjusted by setting `fs.MAX_OPEN` to a different number. The default -is 1024. diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fe9c3f4ca..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,316 +0,0 @@ -// this keeps a queue of opened file descriptors, and will make -// fs operations wait until some have closed before trying to open more. - -var fs_ = require("fs") - -var fs = module.exports = {} - -Object.getOwnPropertyNames(fs_).forEach(function(prop) { - var desc = Object.getOwnPropertyDescriptor(fs_, prop) - Object.defineProperty(fs, prop, desc) -}) - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// prevent EMFILE errors -function OpenReq (path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb -} - -function noop () {} - -fs.open = gracefulOpen - -function gracefulOpen (path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new OpenReq(path, flags, mode, cb)) - setTimeout(flush) - return - } - open(path, flags, mode, function (er, fd) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - // that was too many. reduce max, get back in queue. - // this should only happen once in a great while, and only - // if the ulimit -n is set lower than 1024. - fs.MAX_OPEN = fs._curOpen - 1 - return fs.open(path, flags, mode, cb) - } - cb(er, fd) - }) -} - -function open (path, flags, mode, cb) { - cb = cb || noop - fs._curOpen ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.call(fs, path, flags, mode) - fs._curOpen ++ - return ret -} - -function onclose () { - fs._curOpen -- - flush() -} - -function flush () { - while (fs._curOpen < fs.MAX_OPEN) { - var req = queue.shift() - if (!req) return - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (re-)implement some things that are known busted or missing. - -var constants = require("constants") - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index 0d674ecc6..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "A drop-in replacement for fs, making various improvements.", - "version": "1.2.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "BSD", - "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* keeps track of how many file descriptors are open, and by default\n limits this to 1024. Any further requests to open a file are put in a\n queue until new slots become available. If 1024 turns out to be too\n much, it decreases the limit further.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## Configuration\n\nThe maximum number of open file descriptors that graceful-fs manages may\nbe adjusted by setting `fs.MAX_OPEN` to a different number. The default\nis 1024.\n", - "readmeFilename": "README.md", - "_id": "graceful-fs@1.2.1", - "dist": { - "shasum": "deee07901b7e5f4f9d5ac609375cd4256e5131ff" - }, - "_from": "graceful-fs@~1.2.0", - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.1.tgz" -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d53257..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is not fs', function (t) { - t.notEqual(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var start = fs._curOpen - var fd = fs.openSync(__filename, 'r') - t.equal(fs._curOpen, start + 1) - fs.closeSync(fd) - t.equal(fs._curOpen, start) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - t.equal(fs._curOpen, start + 1) - fs.close(fd, function (er) { - if (er) throw er - t.equal(fs._curOpen, start) - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var start = fs._curOpen - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - t.end() - }) -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b2beaed93..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -A dead simple way to do inheritance in JS. - - var inherits = require("inherits") - - function Animal () { - this.alive = true - } - Animal.prototype.say = function (what) { - console.log(what) - } - - inherits(Dog, Animal) - function Dog () { - Dog.super.apply(this) - } - Dog.prototype.sniff = function () { - this.say("sniff sniff") - } - Dog.prototype.bark = function () { - this.say("woof woof") - } - - inherits(Chihuahua, Dog) - function Chihuahua () { - Chihuahua.super.apply(this) - } - Chihuahua.prototype.bark = function () { - this.say("yip yip") - } - - // also works - function Cat () { - Cat.super.apply(this) - } - Cat.prototype.hiss = function () { - this.say("CHSKKSS!!") - } - inherits(Cat, Animal, { - meow: function () { this.say("miao miao") } - }) - Cat.prototype.purr = function () { - this.say("purr purr") - } - - - var c = new Chihuahua - assert(c instanceof Chihuahua) - assert(c instanceof Dog) - assert(c instanceof Animal) - -The actual function is laughably small. 10-lines small. diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 061b39620..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = inherits - -function inherits (c, p, proto) { - proto = proto || {} - var e = {} - ;[c.prototype, proto].forEach(function (s) { - Object.getOwnPropertyNames(s).forEach(function (k) { - e[k] = Object.getOwnPropertyDescriptor(s, k) - }) - }) - c.prototype = Object.create(p.prototype, e) - c.super = p -} - -//function Child () { -// Child.super.call(this) -// console.error([this -// ,this.constructor -// ,this.constructor === Child -// ,this.constructor.super === Parent -// ,Object.getPrototypeOf(this) === Child.prototype -// ,Object.getPrototypeOf(Object.getPrototypeOf(this)) -// === Parent.prototype -// ,this instanceof Child -// ,this instanceof Parent]) -//} -//function Parent () {} -//inherits(Child, Parent) -//new Child diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index ada613725..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "inherits", - "description": "A tiny simple way to do classic inheritance in js", - "version": "1.0.0", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented" - ], - "main": "./inherits.js", - "repository": { - "type": "git", - "url": "https://github.com/isaacs/inherits" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", - "readmeFilename": "README.md", - "_id": "inherits@1.0.0", - "_from": "inherits@1" -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/package.json b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/package.json deleted file mode 100644 index 82e570d89..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "3.2.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "engines": { - "node": "*" - }, - "dependencies": { - "minimatch": "~0.2.11", - "graceful-fs": "~1.2.0", - "inherits": "1" - }, - "devDependencies": { - "tap": "~0.4.0", - "mkdirp": "0", - "rimraf": "1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "license": "BSD", - "readme": "# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `1` - Path exists, and is not a directory\n * `2` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n", - "readmeFilename": "README.md", - "_id": "glob@3.2.1", - "_from": "glob@>= 3.1.4" -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afafda..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// just a little pre-run script to set up the fixtures. -// zz-finish cleans it up - -var mkdirp = require("mkdirp") -var path = require("path") -var i = 0 -var tap = require("tap") -var fs = require("fs") -var rimraf = require("rimraf") - -var files = -[ "a/.abcdef/x/y/z/a" -, "a/abcdef/g/h" -, "a/abcfed/g/h" -, "a/b/c/d" -, "a/bc/e/f" -, "a/c/d/c/b" -, "a/cb/e/f" -] - -var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") -var symlinkFrom = "../.." - -files = files.map(function (f) { - return path.resolve(__dirname, f) -}) - -tap.test("remove fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "remove fixtures") - t.end() - }) -}) - -files.forEach(function (f) { - tap.test(f, function (t) { - var d = path.dirname(f) - mkdirp(d, 0755, function (er) { - if (er) { - t.fail(er) - return t.bailout() - } - fs.writeFile(f, "i like tests", function (er) { - t.ifError(er, "make file") - t.end() - }) - }) - }) -}) - -if (process.platform !== "win32") { - tap.test("symlinky", function (t) { - var d = path.dirname(symlinkTo) - console.error("mkdirp", d) - mkdirp(d, 0755, function (er) { - t.ifError(er) - fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { - t.ifError(er, "make symlink") - t.end() - }) - }) - }) -} - -;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { - w = "/tmp/glob-test/" + w - tap.test("create " + w, function (t) { - mkdirp(w, function (er) { - if (er) - throw er - t.pass(w) - t.end() - }) - }) -}) - - -// generate the bash pattern test-fixtures if possible -if (process.platform === "win32" || !process.env.TEST_REGEN) { - console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") - return -} - -var spawn = require("child_process").spawn; -var globs = - // put more patterns here. - // anything that would be directly in / should be in /tmp/glob-test - ["test/a/*/+(c|g)/./d" - ,"test/a/**/[cg]/../[cg]" - ,"test/a/{b,c,d,e,f}/**/g" - ,"test/a/b/**" - ,"test/**/g" - ,"test/a/abc{fed,def}/g/h" - ,"test/a/abc{fed/g,def}/**/" - ,"test/a/abc{fed/g,def}/**///**/" - ,"test/**/a/**/" - ,"test/+(a|b|c)/a{/,bc*}/**" - ,"test/*/*/*/f" - ,"test/**/f" - ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" - ,"{./*/*,/tmp/glob-test/*}" - ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! - ,"test/a/!(symlink)/**" - ] -var bashOutput = {} -var fs = require("fs") - -globs.forEach(function (pattern) { - tap.test("generate fixture " + pattern, function (t) { - var cmd = "shopt -s globstar && " + - "shopt -s extglob && " + - "shopt -s nullglob && " + - // "shopt >&2; " + - "eval \'for i in " + pattern + "; do echo $i; done\'" - var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) - var out = [] - cp.stdout.on("data", function (c) { - out.push(c) - }) - cp.stderr.pipe(process.stderr) - cp.on("close", function (code) { - out = flatten(out) - if (!out) - out = [] - else - out = cleanResults(out.split(/\r*\n/)) - - bashOutput[pattern] = out - t.notOk(code, "bash test should finish nicely") - t.end() - }) - }) -}) - -tap.test("save fixtures", function (t) { - var fname = path.resolve(__dirname, "bash-results.json") - var data = JSON.stringify(bashOutput, null, 2) + "\n" - fs.writeFile(fname, data, function (er) { - t.ifError(er) - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -function flatten (chunks) { - var s = 0 - chunks.forEach(function (c) { s += c.length }) - var out = new Buffer(s) - s = 0 - chunks.forEach(function (c) { - c.copy(out, s) - s += c.length - }) - - return out.toString().trim() -} - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a9c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// basic test -// show that it does the same thing by default as the shell. -var tap = require("tap") -, child_process = require("child_process") -, bashResults = require("./bash-results.json") -, globs = Object.keys(bashResults) -, glob = require("../") -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -globs.forEach(function (pattern) { - var expect = bashResults[pattern] - // anything regarding the symlink thing will fail on windows, so just skip it - if (process.platform === "win32" && - expect.some(function (m) { - return /\/symlink\//.test(m) - })) - return - - tap.test(pattern, function (t) { - glob(pattern, function (er, matches) { - if (er) - throw er - - // sort and unmark, just to match the shell results - matches = cleanResults(matches) - - t.deepEqual(matches, expect, pattern) - t.end() - }) - }) - - tap.test(pattern + " sync", function (t) { - var matches = cleanResults(glob.sync(pattern)) - - t.deepEqual(matches, expect, "should match shell") - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') - }) -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json deleted file mode 100644 index a9bc347de..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "test/a/*/+(c|g)/./d": [ - "test/a/b/c/./d" - ], - "test/a/**/[cg]/../[cg]": [ - "test/a/abcdef/g/../g", - "test/a/abcfed/g/../g", - "test/a/b/c/../c", - "test/a/c/../c", - "test/a/c/d/c/../c", - "test/a/symlink/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" - ], - "test/a/{b,c,d,e,f}/**/g": [], - "test/a/b/**": [ - "test/a/b", - "test/a/b/c", - "test/a/b/c/d" - ], - "test/**/g": [ - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed,def}/g/h": [ - "test/a/abcdef/g/h", - "test/a/abcfed/g/h" - ], - "test/a/abc{fed/g,def}/**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed/g,def}/**///**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/**/a/**/": [ - "test/a", - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/b", - "test/a/b/c", - "test/a/bc", - "test/a/bc/e", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/cb", - "test/a/cb/e", - "test/a/symlink", - "test/a/symlink/a", - "test/a/symlink/a/b", - "test/a/symlink/a/b/c", - "test/a/symlink/a/b/c/a", - "test/a/symlink/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" - ], - "test/+(a|b|c)/a{/,bc*}/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h" - ], - "test/*/*/*/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/**/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" - ], - "{./*/*,/tmp/glob-test/*}": [ - "./examples/g.js", - "./examples/usr-local.js", - "./node_modules/graceful-fs", - "./node_modules/inherits", - "./node_modules/minimatch", - "./node_modules/mkdirp", - "./node_modules/rimraf", - "./node_modules/tap", - "./test/00-setup.js", - "./test/a", - "./test/bash-comparison.js", - "./test/bash-results.json", - "./test/cwd-test.js", - "./test/globstar-match.js", - "./test/mark.js", - "./test/nocase-nomagic.js", - "./test/pause-resume.js", - "./test/root-nomount.js", - "./test/root.js", - "./test/stat.js", - "./test/zz-cleanup.js", - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq" - ], - "{/tmp/glob-test/*,*}": [ - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq", - "examples", - "glob.js", - "LICENSE", - "node_modules", - "package.json", - "README.md", - "test" - ], - "test/a/!(symlink)/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h", - "test/a/b", - "test/a/b/c", - "test/a/b/c/d", - "test/a/bc", - "test/a/bc/e", - "test/a/bc/e/f", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/c/d/c/b", - "test/a/cb", - "test/a/cb/e", - "test/a/cb/e/f" - ] -} diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27efa..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing cwd and searching for **/d", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('**/d', function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('a', function (t) { - glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'b/c/d', 'c/d' ]) - t.end() - }) - }) - - t.test('a/b', function (t) { - glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('a/b/', function (t) { - glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('.', function (t) { - glob('**/d', {cwd: process.cwd()}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js deleted file mode 100644 index 9b234fa2a..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +++ /dev/null @@ -1,19 +0,0 @@ -var Glob = require("../glob.js").Glob -var test = require('tap').test - -test('globstar should not have dupe matches', function(t) { - var pattern = 'a/**/[gh]' - var g = new Glob(pattern, { cwd: __dirname }) - var matches = [] - g.on('match', function(m) { - console.error('match %j', m) - matches.push(m) - }) - g.on('end', function(set) { - console.error('set', set) - matches = matches.sort() - set = set.sort() - t.same(matches, set, 'should have same set of matches') - t.end() - }) -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js deleted file mode 100644 index ed68a335c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +++ /dev/null @@ -1,74 +0,0 @@ -var test = require("tap").test -var glob = require('../') -process.chdir(__dirname) - -test("mark, no / on pattern", function (t) { - glob("a/*", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - - if (process.platform !== "win32") - expect.push('a/symlink/') - - t.same(results, expect) - t.end() - }) -}) - -test("mark=false, no / on pattern", function (t) { - glob("a/*", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef', - 'a/abcfed', - 'a/b', - 'a/bc', - 'a/c', - 'a/cb' ] - - if (process.platform !== "win32") - expect.push('a/symlink') - t.same(results, expect) - t.end() - }) -}) - -test("mark=true, / on pattern", function (t) { - glob("a/*/", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }) -}) - -test("mark=false, / on pattern", function (t) { - glob("a/*/", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }) -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index d86297098..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,113 +0,0 @@ -var fs = require('graceful-fs'); -var test = require('tap').test; -var glob = require('../'); - -test('mock fs', function(t) { - var stat = fs.stat - var statSync = fs.statSync - var readdir = fs.readdir - var readdirSync = fs.readdirSync - - function fakeStat(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': - ret = { isDirectory: function() { return true } } - break - case '/tmp/a': - ret = { isDirectory: function() { return false } } - break - } - return ret - } - - fs.stat = function(path, cb) { - var f = fakeStat(path); - if (f) { - process.nextTick(function() { - cb(null, f) - }) - } else { - stat.call(fs, path, cb) - } - } - - fs.statSync = function(path) { - return fakeStat(path) || statSync.call(fs, path) - } - - function fakeReaddir(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': - ret = [ 'a', 'A' ] - break - case '/': - ret = ['tmp', 'tMp', 'tMP', 'TMP'] - } - return ret - } - - fs.readdir = function(path, cb) { - var f = fakeReaddir(path) - if (f) - process.nextTick(function() { - cb(null, f) - }) - else - readdir.call(fs, path, cb) - } - - fs.readdirSync = function(path) { - return fakeReaddir(path) || readdirSync.call(fs, path) - } - - t.pass('mocked') - t.end() -}) - -test('nocase, nomagic', function(t) { - var n = 2 - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - glob('/tmp/a', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) - glob('/tmp/A', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) -}) - -test('nocase, with some magic', function(t) { - t.plan(2) - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab1c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// show that no match events happen while paused. -var tap = require("tap") -, child_process = require("child_process") -// just some gnarly pattern with lots of matches -, pattern = "test/a/!(symlink)/**" -, bashResults = require("./bash-results.json") -, patterns = Object.keys(bashResults) -, glob = require("../") -, Glob = glob.Glob -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -var globResults = [] -tap.test("use a Glob object, and pause/resume it", function (t) { - var g = new Glob(pattern) - , paused = false - , res = [] - , expect = bashResults[pattern] - - g.on("pause", function () { - console.error("pause") - }) - - g.on("resume", function () { - console.error("resume") - }) - - g.on("match", function (m) { - t.notOk(g.paused, "must not be paused") - globResults.push(m) - g.pause() - t.ok(g.paused, "must be paused") - setTimeout(g.resume.bind(g), 10) - }) - - g.on("end", function (matches) { - t.pass("reached glob end") - globResults = cleanResults(globResults) - matches = cleanResults(matches) - t.deepEqual(matches, globResults, - "end event matches should be the same as match events") - - t.deepEqual(matches, expect, - "glob matches should be the same as bash results") - - t.end() - }) -}) - diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979b0..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing root and searching for /b*/**", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) - }) - - t.test('a', function (t) { - glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f99c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -var t = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -var glob = require('../') -var path = require('path') - -t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) -}) - - -t.test('a', function (t) { - console.error("root=" + path.resolve('a')) - glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { - t.ifError(er) - var wanted = [ - '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' - ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - }) - - t.like(matches, wanted) - t.end() - }) -}) - -t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - })) - t.end() - }) -}) - -t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js deleted file mode 100644 index 62917114b..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +++ /dev/null @@ -1,32 +0,0 @@ -var glob = require('../') -var test = require('tap').test -var path = require('path') - -test('stat all the things', function(t) { - var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) - var matches = [] - g.on('match', function(m) { - matches.push(m) - }) - var stats = [] - g.on('stat', function(m) { - stats.push(m) - }) - g.on('end', function(eof) { - stats = stats.sort() - matches = matches.sort() - eof = eof.sort() - t.same(stats, matches) - t.same(eof, matches) - var cache = Object.keys(this.statCache) - t.same(cache.map(function (f) { - return path.relative(__dirname, f) - }).sort(), matches) - - cache.forEach(function(c) { - t.equal(typeof this.statCache[c], 'object') - }, this) - - t.end() - }) -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js b/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0fa7..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// remove the fixtures -var tap = require("tap") -, rimraf = require("rimraf") -, path = require("path") - -tap.test("cleanup fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "removed") - t.end() - }) -}) diff --git a/deploy/core/node_modules/jshint/node_modules/cli/package.json b/deploy/core/node_modules/jshint/node_modules/cli/package.json deleted file mode 100755 index 0b3f53fba..000000000 --- a/deploy/core/node_modules/jshint/node_modules/cli/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "cli", - "description": "A tool for rapidly building command line apps", - "version": "0.4.4-2", - "homepage": "http://github.com/chriso/cli", - "keywords": [ - "cli", - "command line", - "opts", - "parseopt", - "opt", - "args", - "console", - "argsparse", - "optparse", - "daemon", - "autocomplete", - "command", - "autocompletion" - ], - "author": { - "name": "Chris O'Hara", - "email": "cohara87@gmail.com" - }, - "main": "cli.js", - "bugs": { - "mail": "cohara87@gmail.com", - "url": "http://github.com/chriso/cli/issues" - }, - "repository": { - "type": "git", - "url": "http://github.com/chriso/cli.git" - }, - "dependencies": { - "glob": ">= 3.1.4" - }, - "contributors": [ - { - "name": "Douglas Meyer" - } - ], - "engines": { - "node": ">=0.2.5" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "readme": "**cli is a toolkit for rapidly building command line apps - it includes:**\n\n- Full featured opts/args parser\n- Plugin support for adding common options and switches\n- Helper methods for working with input/output and spawning child processes\n- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js)\n- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js)\n\nInstall using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app.\n\n## Example apps\n\n### sort.js\n\n```javascript\n#!/usr/bin/env node\nrequire('cli').withStdinLines(function(lines, newline) {\n this.output(lines.sort().join(newline));\n});\n```\n\nTry it out\n\n```bash\n$ ./sort.js < input.txt\n```\n\nLet's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!)\n\n```javascript\nvar cli = require('cli'), options = cli.parse();\n\ncli.withStdinLines(function(lines, newline) {\n lines.sort(!options.n ? null : function(a, b) {\n return parseInt(a) > parseInt(b);\n });\n if (options.r) lines.reverse();\n this.output(lines.join(newline));\n});\n```\n\n### static.js\n\nLet's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon`\n\n```javascript\nvar cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins\n\ncli.parse({\n log: ['l', 'Enable logging'],\n port: ['p', 'Listen on this port', 'number', 8080],\n serve: [false, 'Serve static files from PATH', 'path', './public']\n});\n\ncli.main(function(args, options) {\n var server, middleware = [];\n\n if (options.log) {\n this.debug('Enabling logging');\n middleware.push(require('creationix/log')());\n }\n\n this.debug('Serving files from ' + options.serve);\n middleware.push(require('creationix/static')('/', options.serve, 'index.html'));\n\n server = this.createServer(middleware).listen(options.port);\n\n this.ok('Listening on port ' + options.port);\n});\n```\n\nTo output usage information\n\n```bash\n$ ./static.js --help\n```\n\nTo create a daemon that serves files from */tmp*, run\n\n```bash\n$ ./static.js -ld --serve=/tmp\n```\n\nFor more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples)\n\n## Helper methods\n\ncli has methods that collect stdin (newline is autodetected as \\n or \\r\\n)\n\n```javascript\ncli.withStdin(callback); //callback receives stdin as a string\ncli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline)\n```\n\ncli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). \n\n```javascript\ncli.withInput(file, function (line, newline, eof) {\n if (!eof) {\n this.output(line + newline);\n }\n});\n```\n\n*Note: `file` can be omitted if you want to work with stdin*\n\nTo output a progress bar, call\n\n```javascript\ncli.progress(progress); //Where 0 <= progress <= 1\n```\n\nTo spawn a child process, use\n\n```javascript\ncli.exec(cmd, callback); //callback receives the output of the process (split into lines)\n```\n\ncli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer)\n\n## Plugins\n\nPlugins are a way of adding common opts and can be enabled using \n\n```javascript\ncli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method\n```\n\n**help** - *enabled by default*\n\nAdds `-h,--help` to output auto-generated usage information\n\n**version**\n\nAdds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json*\n\nTo set your own app name and version, use `cli.setApp(app_name, version)`\n\n**status**\n\nAdds options to show/hide the stylized status messages that are output to the console when using one of these methods\n\n```javascript\ncli.debug(msg); //Only shown when using --debug\ncli.error(msg);\ncli.fatal(msg); //Exits the process after outputting msg\ncli.info(msg);\ncli.ok(msg);\n```\n\n`-k,--no-color` will omit ANSI color escapes from the output\n\n**glob** - *requires* `npm install glob`\n\nEnables glob matching of arguments\n\n**daemon** - *requires* `npm install daemon`\n\nAdds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon\n\n`ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr)\n\n**timeout**\n\nAdds `-t,--timeout N` to exit the process after N seconds with an error\n\n**catchall**\n\nAdds `-c,--catch` to catch and output uncaughtExceptions and resume execution\n\n*Note: Plugins are automatically disabled if an option or switch of the same name is already defined*\n\n## LICENSE\n\n(MIT license)\n\nCopyright (c) 2010 Chris O'Hara \n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "README.md", - "_id": "cli@0.4.4-2", - "_from": "cli@0.4.x" -} diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/.npmignore b/deploy/core/node_modules/jshint/node_modules/console-browserify/.npmignore deleted file mode 100644 index aa3fd4b85..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/.testem.json b/deploy/core/node_modules/jshint/node_modules/console-browserify/.testem.json deleted file mode 100644 index 633c2ba84..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "launchers": { - "node": { - "command": "npm test" - } - }, - "src_files": [ - "./**/*.js" - ], - "before_tests": "npm run build", - "on_exit": "rm test/static/bundle.js", - "test_page": "test/static/index.html", - "launch_in_dev": ["node", "phantomjs"] -} diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/.travis.yml b/deploy/core/node_modules/jshint/node_modules/console-browserify/.travis.yml deleted file mode 100644 index ed178f635..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/LICENCE b/deploy/core/node_modules/jshint/node_modules/console-browserify/LICENCE deleted file mode 100644 index a23e08a85..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Raynos. - -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 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. \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/README.md b/deploy/core/node_modules/jshint/node_modules/console-browserify/README.md deleted file mode 100644 index 5e480ba5d..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# console-browserify - -[![build status][1]][2] - -[![browser support][3]][4] - -Emulate console for all the browsers - -## Example - -```js -var console = require("console-browserify") - -console.log("hello world!") -``` - -## Installation - -`npm install console-browserify` - -## Contributors - - - Raynos - -## MIT Licenced - - - - [1]: https://secure.travis-ci.org/Raynos/console-browserify.png - [2]: http://travis-ci.org/Raynos/console-browserify - [3]: http://ci.testling.com/Raynos/console-browserify.png - [4]: http://ci.testling.com/Raynos/console-browserify diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/index.js b/deploy/core/node_modules/jshint/node_modules/console-browserify/index.js deleted file mode 100644 index bfdf4b358..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/index.js +++ /dev/null @@ -1,85 +0,0 @@ -/*global window, global*/ -var util = require("util") -var assert = require("assert") - -var slice = Array.prototype.slice -var console -var times = {} - -if (typeof global !== "undefined" && global.console) { - console = global.console -} else if (typeof window !== "undefined" && window.console) { - console = window.console -} else { - console = window.console = {} -} - -var functions = [ - [log, "log"] - , [info, "info"] - , [warn, "warn"] - , [error, "error"] - , [time, "time"] - , [timeEnd, "timeEnd"] - , [trace, "trace"] - , [dir, "dir"] - , [assert, "assert"] -] - -for (var i = 0; i < functions.length; i++) { - var tuple = functions[i] - var f = tuple[0] - var name = tuple[1] - - if (!console[name]) { - console[name] = f - } -} - -module.exports = console - -function log() {} - -function info() { - console.log.apply(console, arguments) -} - -function warn() { - console.log.apply(console, arguments) -} - -function error() { - console.warn.apply(console, arguments) -} - -function time(label) { - times[label] = Date.now() -} - -function timeEnd(label) { - var time = times[label] - if (!time) { - throw new Error("No such label: " + label) - } - - var duration = Date.now() - time - console.log(label + ": " + duration + "ms") -} - -function trace() { - var err = new Error() - err.name = "Trace" - err.message = util.format.apply(null, arguments) - console.error(err.stack) -} - -function dir(object) { - console.log(util.inspect(object) + "\n") -} - -function assert(expression) { - if (!expression) { - var arr = slice.call(arguments, 1) - assert.ok(false, util.format.apply(null, arr)) - } -} diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/package.json b/deploy/core/node_modules/jshint/node_modules/console-browserify/package.json deleted file mode 100644 index 72dc038e5..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "console-browserify", - "version": "0.1.6", - "description": "Emulate console for all the browsers", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/console-browserify.git" - }, - "main": "index", - "homepage": "https://github.com/Raynos/console-browserify", - "contributors": [ - { - "name": "Raynos" - } - ], - "bugs": { - "url": "https://github.com/Raynos/console-browserify/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~0.2.2", - "browserify": "https://github.com/raynos/node-browserify/tarball/master", - "testem": "~0.2.55", - "jsonify": "0.0.0" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/console-browserify/raw/master/LICENSE" - } - ], - "scripts": { - "test": "node ./test", - "build": "browserify test/index.js -o test/static/bundle.js", - "testem": "testem" - }, - "testling": { - "files": "test/index.js", - "browsers": { - "ie": [ - "6", - "7", - "8", - "9", - "10" - ], - "firefox": [ - "16", - "17", - "nightly" - ], - "chrome": [ - "22", - "23", - "canary" - ], - "opera": [ - "12", - "next" - ], - "safari": [ - "5.1" - ] - } - }, - "readme": "# console-browserify\n\n[![build status][1]][2]\n\n[![browser support][3]][4]\n\nEmulate console for all the browsers\n\n## Example\n\n```js\nvar console = require(\"console-browserify\")\n\nconsole.log(\"hello world!\")\n```\n\n## Installation\n\n`npm install console-browserify`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n\n\n [1]: https://secure.travis-ci.org/Raynos/console-browserify.png\n [2]: http://travis-ci.org/Raynos/console-browserify\n [3]: http://ci.testling.com/Raynos/console-browserify.png\n [4]: http://ci.testling.com/Raynos/console-browserify\n", - "readmeFilename": "README.md", - "_id": "console-browserify@0.1.6", - "dist": { - "shasum": "de147fc21be8eedd535f133dfc59730431858504" - }, - "_from": "console-browserify@0.1.x", - "_resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-0.1.6.tgz" -} diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/test/index.js b/deploy/core/node_modules/jshint/node_modules/console-browserify/test/index.js deleted file mode 100644 index 26dfaad6e..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/test/index.js +++ /dev/null @@ -1,67 +0,0 @@ -var console = require("../index") -var test = require("tape") - -if (typeof window !== "undefined" && !window.JSON) { - window.JSON = require("jsonify") -} - -test("console has expected methods", function (assert) { - assert.ok(console.log) - assert.ok(console.info) - assert.ok(console.warn) - assert.ok(console.dir) - assert.ok(console.time, "time") - assert.ok(console.timeEnd, "timeEnd") - assert.ok(console.trace, "trace") - assert.ok(console.assert) - - assert.end() -}) - -test("invoke console.log", function (assert) { - console.log("test-log") - - assert.end() -}) - -test("invoke console.info", function (assert) { - console.info("test-info") - - assert.end() -}) - -test("invoke console.warn", function (assert) { - console.warn("test-warn") - - assert.end() -}) - -test("invoke console.time", function (assert) { - console.time("label") - - assert.end() -}) - -test("invoke console.trace", function (assert) { - console.trace("test-trace") - - assert.end() -}) - -test("invoke console.assert", function (assert) { - console.assert(true) - - assert.end() -}) - -test("invoke console.dir", function (assert) { - console.dir("test-dir") - - assert.end() -}) - -test("invoke console.timeEnd", function (assert) { - console.timeEnd("label") - - assert.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/index.html b/deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/index.html deleted file mode 100644 index dd55012f0..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - TAPE Example - - - - - - - diff --git a/deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js b/deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js deleted file mode 100644 index 8b4c12dc5..000000000 --- a/deploy/core/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +++ /dev/null @@ -1,53 +0,0 @@ -(function () { - var Testem = window.Testem - var regex = /^((?:not )?ok) (\d+) (.+)$/ - - Testem.useCustomAdapter(tapAdapter) - - function tapAdapter(socket){ - var results = { - failed: 0 - , passed: 0 - , total: 0 - , tests: [] - } - - socket.emit('tests-start') - - Testem.handleConsoleMessage = function(msg){ - var m = msg.match(regex) - if (m) { - var passed = m[1] === 'ok' - var test = { - passed: passed ? 1 : 0, - failed: passed ? 0 : 1, - total: 1, - id: m[2], - name: m[3], - items: [] - } - - if (passed) { - results.passed++ - } else { - console.error("failure", m) - - results.failed++ - } - - results.total++ - - // console.log("emitted test", test) - socket.emit('test-result', test) - results.tests.push(test) - } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ - // console.log("emitted all test") - socket.emit('all-test-results', results) - } - - // return false if you want to prevent the console message from - // going to the console - // return false - } - } -}()) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/LICENSE b/deploy/core/node_modules/jshint/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a401094..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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 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. diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/README.md b/deploy/core/node_modules/jshint/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2e9..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -Eventually, it will replace the C binding in node-glob. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. **Note that this is different from the way that `**` is -handled by ruby's `Dir` class.** - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself. When set, an empty list is returned if there are -no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/minimatch.js b/deploy/core/node_modules/jshint/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b67..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(function (require, exports, module, platform) { - -if (module) module.exports = minimatch -else exports.minimatch = minimatch - -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} - -minimatch.Minimatch = Minimatch - -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") - -var path = require("path") - // any single thing other than / - // don't need to escape / when using new RegExp() - , qmark = "[^/]" - - // * => any number of characters - , star = qmark + "*?" - - // ** when dots are allowed. Anything goes, except .. and . - // not (^ or / followed by one or two dots followed by $ or /), - // followed by anything, any number of times. - , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" - - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" - - // characters that need to be escaped in RegExp. - , reSpecials = charSet("().*{}+?[]^$\\!") - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split("").reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - - -function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - return false - } - - // "" only matches "" - if (pattern.trim() === "") return p === "" - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) - } - - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - pattern = pattern.split("\\").join("/") - } - - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) console.error(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - , negate = false - , options = this.options - , negateOffset = 0 - - if (options.nonegate) return - - for ( var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === "!" - ; i ++) { - negate = !negate - negateOffset ++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() -} - -Minimatch.prototype.braceExpand = braceExpand -function braceExpand (pattern, options) { - options = options || this.options - pattern = typeof pattern === "undefined" - ? this.pattern : pattern - - if (typeof pattern === "undefined") { - throw new Error("undefined pattern") - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(pattern.substr(numset[0].length), options) - , start = +numset[1] - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - for (var i = start; i != (end + inc); i += inc) { - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(i + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === "**") return GLOBSTAR - if (pattern === "") return "" - - var re = "" - , hasMagic = !!options.nocase - , escaping = false - // ? => one single character - , patternListStack = [] - , plType - , stateChar - , inClass = false - , reClassStart = -1 - , classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - , patternStart = pattern.charAt(0) === "." ? "" // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" - : "(?!\\.)" - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case "*": - re += star - hasMagic = true - break - case "?": - re += qmark - hasMagic = true - break - default: - re += "\\"+stateChar - break - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%s\t%s %s %j", pattern, i, re, c) - } - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += "\\" + c - escaping = false - continue - } - - SWITCH: switch (c) { - case "/": - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case "\\": - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - if (options.debug) { - console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c) - } - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - if (c === "!" && i === classStart + 1) c = "^" - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case "(": - if (inClass) { - re += "(" - continue - } - - if (!stateChar) { - re += "\\(" - continue - } - - plType = stateChar - patternListStack.push({ type: plType - , start: i - 1 - , reStart: re.length }) - // negation is (?:(?!js)[^/]*) - re += stateChar === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - hasMagic = true - re += ")" - plType = patternListStack.pop().type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case "!": - re += "[^/]*?)" - break - case "?": - case "+": - case "*": re += plType - case "@": break // the default anyway - } - continue - - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|" - escaping = false - continue - } - - re += "|" - continue - - // these are mostly the same in regexp and glob - case "[": - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += "\\" + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case "]": - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += "\\" + c - escaping = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === "^" && inClass)) { - re += "\\" - } - - re += c - - } // switch - } // for - - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - var cs = pattern.substr(classStart + 1) - , sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + "\\[" + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - var pl - while (pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = "\\" - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + "|" - }) - - // console.error("tail=%j\n %s", tail, tail) - var t = pl.type === "*" ? star - : pl.type === "?" ? qmark - : "\\" + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) - + t + "\\(" - + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += "\\\\" - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case ".": - case "[": - case "(": addPatternStart = true - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== "" && hasMagic) re = "(?=.)" + re - - if (addPatternStart) re = patternStart + re - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [ re, hasMagic ] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? "i" : "" - , regExp = new RegExp("^" + re + "$", flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) return this.regexp = false - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - , flags = options.nocase ? "i" : "" - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === "string") ? regExpEscape(p) - : p._src - }).join("\\\/") - }).join("|") - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = "^(?:" + re + ")$" - - // can match anything, as long as it's not this. - if (this.negate) re = "^(?!" + re + ").*$" - - try { - return this.regexp = new RegExp(re, flags) - } catch (ex) { - return this.regexp = false - } -} - -minimatch.match = function (list, pattern, options) { - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - // console.error("match", f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === "" - - if (f === "/" && partial) return true - - var options = this.options - - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - f = f.split("\\").join("/") - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - if (options.debug) { - console.error(this.pattern, "split", f) - } - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - , pr = pi + 1 - if (pr === pl) { - if (options.debug) - console.error('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for ( ; fi < fl; fi ++) { - if (file[fi] === "." || file[fi] === ".." || - (!options.dot && file[fi].charAt(0) === ".")) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - WHILE: while (fr < fl) { - var swallowee = file[fr] - - if (options.debug) { - console.error('\nglobstar while', - file, fr, pattern, pr, swallowee) - } - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - if (options.debug) - console.error('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === "." || swallowee === ".." || - (!options.dot && swallowee.charAt(0) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('globstar swallow a segment, and continue') - fr ++ - } - } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - // console.error("\n>>> no match, partial?", file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === "string") { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("pattern match", p, f, hit) - } - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") - return emptyFileEnd - } - - // should be unreachable. - throw new Error("wtf?") -} - - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, "$1") -} - - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") -} - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e472c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fbe1..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a401094..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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 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. diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f985..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `n` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 8c80853fd..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,257 +0,0 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function naiveLength () { return 1 } - -function LRUCache (options) { - if (!(this instanceof LRUCache)) { - return new LRUCache(options) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - fn.call(thisp, hit.value, hit.key, this) - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 111e5d7c2..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.0", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "scripts": { - "test": "tap test --gc" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "", - "weak": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", - "readmeFilename": "README.md", - "_id": "lru-cache@2.3.0", - "_from": "lru-cache@2" -} diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/s.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/s.js deleted file mode 100644 index c2a9e548f..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/s.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 1024; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8beb..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -var test = require("tap").test - , LRU = require("../") - -test("basic", function (t) { - var cache = new LRU({max: 10}) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.max, 10) - t.end() -}) - -test("least recently set", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test("del", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("max", function (t) { - var cache = new LRU(3) - - // test changing the max, verify that the LRU items get dropped. - cache.max = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the max restriction, and try again. - cache.max = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test("reset", function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.max, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - - -// Note: `.dump()` is a debugging tool only. No guarantees are made -// about the format/layout of the response. -test("dump", function (t) { - var cache = new LRU(10) - var d = cache.dump(); - t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") - cache.set("a", "A") - var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } - t.ok(d.a) - t.equal(d.a.key, "a") - t.equal(d.a.value, "A") - t.equal(d.a.lu, 0) - - cache.set("b", "B") - cache.get("b") - d = cache.dump() - t.ok(d.b) - t.equal(d.b.key, "b") - t.equal(d.b.value, "B") - t.equal(d.b.lu, 2) - - t.end() -}) - - -test("basic with weighed length", function (t) { - var cache = new LRU({ - max: 100, - length: function (item) { return item.size } - }) - cache.set("key", {val: "value", size: 50}) - t.equal(cache.get("key").val, "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.lengthCalculator(cache.get("key")), 50) - t.equal(cache.length, 50) - t.equal(cache.max, 100) - t.end() -}) - - -test("weighed length item too large", function (t) { - var cache = new LRU({ - max: 10, - length: function (item) { return item.size } - }) - t.equal(cache.max, 10) - - // should fall out immediately - cache.set("key", {val: "value", size: 50}) - - t.equal(cache.length, 0) - t.equal(cache.get("key"), undefined) - t.end() -}) - -test("least recently set with weighed length", function (t) { - var cache = new LRU({ - max:8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.set("d", "DDDD") - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("c"), "CCC") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.get("a") - cache.get("b") - cache.set("d", "DDDD") - t.equal(cache.get("c"), undefined) - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("b"), "BB") - t.equal(cache.get("a"), "A") - t.end() -}) - -test("set returns proper booleans", function(t) { - var cache = new LRU({ - max: 5, - length: function (item) { return item.length } - }) - - t.equal(cache.set("a", "A"), true) - - // should return false for max exceeded - t.equal(cache.set("b", "donuts"), false) - - t.equal(cache.set("b", "B"), true) - t.equal(cache.set("c", "CCCC"), true) - t.end() -}) - -test("drop the old items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A") - - setTimeout(function () { - cache.set("b", "b") - t.equal(cache.get("a"), "A") - }, 25) - - setTimeout(function () { - cache.set("c", "C") - // timed out - t.notOk(cache.get("a")) - }, 60) - - setTimeout(function () { - t.notOk(cache.get("b")) - t.equal(cache.get("c"), "C") - }, 90) - - setTimeout(function () { - t.notOk(cache.get("c")) - t.end() - }, 155) -}) - -test("disposal function", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - dispose: function (k, n) { - disposed = n - } - }) - - cache.set(1, 1) - cache.set(2, 2) - t.equal(disposed, 1) - cache.set(3, 3) - t.equal(disposed, 2) - cache.reset() - t.equal(disposed, 3) - t.end() -}) - -test("disposal function on too big of item", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - length: function (k) { - return k.length - }, - dispose: function (k, n) { - disposed = n - } - }) - var obj = [ 1, 2 ] - - t.equal(disposed, false) - cache.set("obj", obj) - t.equal(disposed, obj) - t.end() -}) - -test("has()", function(t) { - var cache = new LRU({ - max: 1, - maxAge: 10 - }) - - cache.set('foo', 'bar') - t.equal(cache.has('foo'), true) - cache.set('blu', 'baz') - t.equal(cache.has('foo'), false) - t.equal(cache.has('blu'), true) - setTimeout(function() { - t.equal(cache.has('blu'), false) - t.end() - }, 15) -}) - -test("stale", function(t) { - var cache = new LRU({ - maxAge: 10, - stale: true - }) - - cache.set('foo', 'bar') - t.equal(cache.get('foo'), 'bar') - t.equal(cache.has('foo'), true) - setTimeout(function() { - t.equal(cache.has('foo'), false) - t.equal(cache.get('foo'), 'bar') - t.equal(cache.get('foo'), undefined) - t.end() - }, 15) -}) - -test("lru update via set", function(t) { - var cache = LRU({ max: 2 }); - - cache.set('foo', 1); - cache.set('bar', 2); - cache.del('bar'); - cache.set('baz', 3); - cache.set('qux', 4); - - t.equal(cache.get('foo'), undefined) - t.equal(cache.get('bar'), undefined) - t.equal(cache.get('baz'), 3) - t.equal(cache.get('qux'), 4) - t.end() -}) - -test("least recently set w/ peek", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - t.equal(cache.peek("a"), "A") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d9d..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('forEach', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 9 - l.forEach(function (val, key, cache) { - t.equal(cache, l) - t.equal(key, i.toString()) - t.equal(val, i.toString(2)) - i -= 1 - }) - - // get in order of most recently used - l.get(6) - l.get(8) - - var order = [ 8, 6, 9, 7, 5 ] - var i = 0 - - l.forEach(function (val, key, cache) { - var j = order[i ++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - - t.end() -}) - -test('keys() and values()', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - t.similar(l.keys(), ['9', '8', '7', '6', '5']) - t.similar(l.values(), ['1001', '1000', '111', '110', '101']) - - // get in order of most recently used - l.get(6) - l.get(8) - - t.similar(l.keys(), ['8', '6', '9', '7', '5']) - t.similar(l.values(), ['1000', '110', '1001', '111', '101']) - - t.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b022..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node --expose_gc - -var weak = require('weak'); -var test = require('tap').test -var LRU = require('../') -var l = new LRU({ max: 10 }) -var refs = 0 -function X() { - refs ++ - weak(this, deref) -} - -function deref() { - refs -- -} - -test('no leaks', function (t) { - // fill up the cache - for (var i = 0; i < 100; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var start = process.memoryUsage() - - // capture the memory - var startRefs = refs - - // do it again, but more - for (var i = 0; i < 10000; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var end = process.memoryUsage() - t.equal(refs, startRefs, 'no leaky refs') - - console.error('start: %j\n' + - 'end: %j', start, end); - t.pass(); - t.end(); -}) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae716..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. 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 AUTHOR 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 THE AUTHOR OR CONTRIBUTORS -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. diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e365129e..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached) - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocain-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `sys.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d90..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// different ways to id objects -// use a req/res pair, since it's crazy deep and cyclical - -// sparseFE10 and sigmund are usually pretty close, which is to be expected, -// since they are essentially the same algorithm, except that sigmund handles -// regular expression objects properly. - - -var http = require('http') -var util = require('util') -var sigmund = require('./sigmund.js') -var sreq, sres, creq, cres, test - -http.createServer(function (q, s) { - sreq = q - sres = s - sres.end('ok') - this.close(function () { setTimeout(function () { - start() - }, 200) }) -}).listen(1337, function () { - creq = http.get({ port: 1337 }) - creq.on('response', function (s) { cres = s }) -}) - -function start () { - test = [sreq, sres, creq, cres] - // test = sreq - // sreq.sres = sres - // sreq.creq = creq - // sreq.cres = cres - - for (var i in exports.compare) { - console.log(i) - var hash = exports.compare[i]() - console.log(hash) - console.log(hash.length) - console.log('') - } - - require('bench').runMain() -} - -function customWs (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return customWs(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + customWs(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function custom (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return '' + obj - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return custom(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + custom(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function sparseFE2 (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k + ':' - ch(v[k], depth + 1) - }) - soFar += '}' - } - ch(obj, 0) - return soFar -} - -function sparseFE (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k - ch(v[k], depth + 1) - }) - } - ch(obj, 0) - return soFar -} - -function sparse (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k - ch(v[k], depth + 1) - } - } - ch(obj, 0) - return soFar -} - -function noCommas (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - - -function flatten (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - soFar += ',' - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - -exports.compare = -{ - // 'custom 2': function () { - // return custom(test, 2, 0) - // }, - // 'customWs 2': function () { - // return customWs(test, 2, 0) - // }, - 'JSON.stringify (guarded)': function () { - var seen = [] - return JSON.stringify(test, function (k, v) { - if (typeof v !== 'object' || !v) return v - if (seen.indexOf(v) !== -1) return undefined - seen.push(v) - return v - }) - }, - - 'flatten 10': function () { - return flatten(test, 10) - }, - - // 'flattenFE 10': function () { - // return flattenFE(test, 10) - // }, - - 'noCommas 10': function () { - return noCommas(test, 10) - }, - - 'sparse 10': function () { - return sparse(test, 10) - }, - - 'sparseFE 10': function () { - return sparseFE(test, 10) - }, - - 'sparseFE2 10': function () { - return sparseFE2(test, 10) - }, - - sigmund: function() { - return sigmund(test, 10) - }, - - - // 'util.inspect 1': function () { - // return util.inspect(test, false, 1, false) - // }, - // 'util.inspect undefined': function () { - // util.inspect(test) - // }, - // 'util.inspect 2': function () { - // util.inspect(test, false, 2, false) - // }, - // 'util.inspect 3': function () { - // util.inspect(test, false, 3, false) - // }, - // 'util.inspect 4': function () { - // util.inspect(test, false, 4, false) - // }, - // 'util.inspect Infinity': function () { - // util.inspect(test, false, Infinity, false) - // } -} - -/** results -**/ diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index 92a63e961..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "sigmund", - "version": "1.0.0", - "description": "Quick and dirty signatures for Objects.", - "main": "sigmund.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js", - "bench": "node bench.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund" - }, - "keywords": [ - "object", - "signature", - "key", - "data", - "psychoanalysis" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", - "readmeFilename": "README.md", - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8ce..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = sigmund -function sigmund (subject, maxSessions) { - maxSessions = maxSessions || 10; - var notes = []; - var analysis = ''; - var RE = RegExp; - - function psychoAnalyze (subject, session) { - if (session > maxSessions) return; - - if (typeof subject === 'function' || - typeof subject === 'undefined') { - return; - } - - if (typeof subject !== 'object' || !subject || - (subject instanceof RE)) { - analysis += subject; - return; - } - - if (notes.indexOf(subject) !== -1 || session === maxSessions) return; - - notes.push(subject); - analysis += '{'; - Object.keys(subject).forEach(function (issue, _, __) { - // pseudo-private values. skip those. - if (issue.charAt(0) === '_') return; - var to = typeof subject[issue]; - if (to === 'function' || to === 'undefined') return; - analysis += issue; - psychoAnalyze(subject[issue], session + 1); - }); - } - psychoAnalyze(subject, 0); - return analysis; -} - -// vim: set softtabstop=4 shiftwidth=4: diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a13e..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test -var sigmund = require('../sigmund.js') - - -// occasionally there are duplicates -// that's an acceptable edge-case. JSON.stringify and util.inspect -// have some collision potential as well, though less, and collision -// detection is expensive. -var hash = '{abc/def/g{0h1i2{jkl' -var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} -var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -var obj3 = JSON.parse(JSON.stringify(obj1)) -obj3.c = /def/ -obj3.g[2].cycle = obj3 -var cycleHash = '{abc/def/g{0h1i2{jklcycle' - -test('basic', function (t) { - t.equal(sigmund(obj1), hash) - t.equal(sigmund(obj2), hash) - t.equal(sigmund(obj3), cycleHash) - t.end() -}) - diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/package.json b/deploy/core/node_modules/jshint/node_modules/minimatch/package.json deleted file mode 100644 index 452e6a3ce..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "0.2.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" - }, - "devDependencies": { - "tap": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, - "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n### Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n", - "readmeFilename": "README.md", - "_id": "minimatch@0.2.12", - "_from": "minimatch@0.x.x" -} diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/test/basic.js b/deploy/core/node_modules/jshint/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73c7..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - - -var patterns = - [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - // https://github.com/isaacs/minimatch/issues/5 - , function () { - files = [ 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' - , 'a/b/.x' - , 'a/b/.x/' - , 'a/.x/b' - , '.x' - , '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b/.x/c' - , '.x/.x' ] - } - , ["**/.x/**", [ '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b' - , 'a/b/.x/' - , 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' ] ] - - ] - -var regexps = - [ '/^(?:(?=.)a[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:\\*)$/', - '/^(?:(?=.)\\*[^/]*?)$/', - '/^(?:\\*\\*)$/', - '/^(?:(?=.)b[^/]*?\\/)$/', - '/^(?:(?=.)c[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', - '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', - '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', - '/^(?:(?=.)a[^/]*?[^c])$/', - '/^(?:(?=.)a[X-]b)$/', - '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', - '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[^/]c)$/', - '/^(?:a\\*c)$/', - 'false', - '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', - '/^(?:man\\/man1\\/bash\\.1)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[-abc])$/', - '/^(?:(?!\\.)(?=.)[abc-])$/', - '/^(?:\\\\)$/', - '/^(?:(?!\\.)(?=.)[\\\\])$/', - '/^(?:(?!\\.)(?=.)[\\[])$/', - '/^(?:\\[)$/', - '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[\\]])$/', - '/^(?:(?!\\.)(?=.)[\\]-])$/', - '/^(?:(?!\\.)(?=.)[a-z])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:\\[\\])$/', - '/^(?:\\[abc)$/', - '/^(?:(?=.)XYZ)$/i', - '/^(?:(?=.)ab[^/]*?)$/i', - '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', - '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', - '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', - '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', - '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', - '/^(?:(?=.)a[^/]b)$/', - '/^(?:(?=.)#[^/]*?)$/', - '/^(?!^(?:(?=.)a[^/]*?)$).*$/', - '/^(?:(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)a[^/]*?)$/', - '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] -var re = 0; - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - patterns.forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var m = new mm.Minimatch(pattern, options) - var r = m.makeRe() - var expectRe = regexps[re++] - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - - t.equal(tapOpts.re, expectRe, tapOpts) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/test/brace-expand.js b/deploy/core/node_modules/jshint/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a27..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -var tap = require("tap") - , minimatch = require("../") - -tap.test("brace expansion", function (t) { - // [ pattern, [expanded] ] - ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" - , [ "abxy" - , "abxz" - , "acdxy" - , "acdxz" - , "acexy" - , "acexz" - , "afhxy" - , "afhxz" - , "aghxy" - , "aghxz" ] ] - , [ "a{1..5}b" - , [ "a1b" - , "a2b" - , "a3b" - , "a4b" - , "a5b" ] ] - , [ "a{b}c", ["a{b}c"] ] - ].forEach(function (tc) { - var p = tc[0] - , expect = tc[1] - t.equivalent(minimatch.braceExpand(p), expect, p) - }) - console.error("ending") - t.end() -}) - - diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/test/caching.js b/deploy/core/node_modules/jshint/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0fa..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -var Minimatch = require("../minimatch.js").Minimatch -var tap = require("tap") -tap.test("cache test", function (t) { - var mm1 = new Minimatch("a?b") - var mm2 = new Minimatch("a?b") - t.equal(mm1, mm2, "should get the same object") - // the lru should drop it after 100 entries - for (var i = 0; i < 100; i ++) { - new Minimatch("a"+i) - } - mm2 = new Minimatch("a?b") - t.notEqual(mm1, mm2, "cache should have dropped") - t.end() -}) diff --git a/deploy/core/node_modules/jshint/node_modules/minimatch/test/defaults.js b/deploy/core/node_modules/jshint/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f601c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - ; [ "http://www.bashcookbook.com/bashinfo" + - "/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - ].forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var Class = mm.defaults(options).Minimatch - var m = new Class(pattern, {}) - var r = m.makeRe() - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/.documentup.json b/deploy/core/node_modules/jshint/node_modules/shelljs/.documentup.json deleted file mode 100644 index 57fe30116..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/.documentup.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ShellJS", - "twitter": [ - "r2r" - ] -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/.npmignore b/deploy/core/node_modules/jshint/node_modules/shelljs/.npmignore deleted file mode 100644 index c2658d7d1..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/.travis.yml b/deploy/core/node_modules/jshint/node_modules/shelljs/.travis.yml deleted file mode 100644 index 5caf59981..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/LICENSE b/deploy/core/node_modules/jshint/node_modules/shelljs/LICENSE deleted file mode 100644 index 1b35ee9fb..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Artur Adib -All rights reserved. - -You may use this project under the terms of the New BSD license as follows: - -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. - * Neither the name of Artur Adib nor the - names of the contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -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 ARTUR ADIB 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. diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/README.md b/deploy/core/node_modules/jshint/node_modules/shelljs/README.md deleted file mode 100644 index 8b4559293..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/README.md +++ /dev/null @@ -1,513 +0,0 @@ -# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs) - -ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! - -The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like: - -+ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader -+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger -+ [JSHint](http://jshint.com) - Most popular JavaScript linter -+ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers -+ [Yeoman](http://yeoman.io/) - Web application stack and development tool -+ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation - -and [many more](https://npmjs.org/browse/depended/shelljs). - -## Installing - -Via npm: - -```bash -$ npm install [-g] shelljs -``` - -If the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to -run ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder: - -```bash -$ shjs my_script -``` - -You can also just copy `shell.js` into your project's directory, and `require()` accordingly. - - -## Examples - -### JavaScript - -```javascript -require('shelljs/global'); - -if (!which('git')) { - echo('Sorry, this script requires git'); - exit(1); -} - -// Copy files to release dir -mkdir('-p', 'out/Release'); -cp('-R', 'stuff/*', 'out/Release'); - -// Replace macros in each .js file -cd('lib'); -ls('*.js').forEach(function(file) { - sed('-i', 'BUILD_VERSION', 'v0.1.2', file); - sed('-i', /.*REMOVE_THIS_LINE.*\n/, '', file); - sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file); -}); -cd('..'); - -// Run external tool synchronously -if (exec('git commit -am "Auto-commit"').code !== 0) { - echo('Error: Git commit failed'); - exit(1); -} -``` - -### CoffeeScript - -```coffeescript -require 'shelljs/global' - -if not which 'git' - echo 'Sorry, this script requires git' - exit 1 - -# Copy files to release dir -mkdir '-p', 'out/Release' -cp '-R', 'stuff/*', 'out/Release' - -# Replace macros in each .js file -cd 'lib' -for file in ls '*.js' - sed '-i', 'BUILD_VERSION', 'v0.1.2', file - sed '-i', /.*REMOVE_THIS_LINE.*\n/, '', file - sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat 'macro.js', file -cd '..' - -# Run external tool synchronously -if (exec 'git commit -am "Auto-commit"').code != 0 - echo 'Error: Git commit failed' - exit 1 -``` - -## Global vs. Local - -The example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`. - -Example: - -```javascript -var shell = require('shelljs'); -shell.echo('hello world'); -``` - -## Make tool - -A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script. - -Example (CoffeeScript): - -```coffeescript -require 'shelljs/make' - -target.all = -> - target.bundle() - target.docs() - -target.bundle = -> - cd __dirname - mkdir 'build' - cd 'lib' - (cat '*.js').to '../build/output.js' - -target.docs = -> - cd __dirname - mkdir 'docs' - cd 'lib' - for file in ls '*.js' - text = grep '//@', file # extract special comments - text.replace '//@', '' # remove comment tags - text.to 'docs/my_docs.md' -``` - -To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`, and so on. - - - - - - -## Command reference - - -All commands run synchronously, unless otherwise stated. - - -### cd('dir') -Changes to directory `dir` for the duration of the script - -### pwd() -Returns the current directory. - -### ls([options ,] path [,path ...]) -### ls([options ,] path_array) -Available options: - -+ `-R`: recursive -+ `-A`: all files (include files beginning with `.`, except for `.` and `..`) - -Examples: - -```javascript -ls('projs/*.js'); -ls('-R', '/users/me', '/tmp'); -ls('-R', ['/users/me', '/tmp']); // same as above -``` - -Returns array of files in the given path, or in current directory if no path provided. - -### find(path [,path ...]) -### find(path_array) -Examples: - -```javascript -find('src', 'lib'); -find(['src', 'lib']); // same as above -find('.').filter(function(file) { return file.match(/\.js$/); }); -``` - -Returns array of all files (however deep) in the given paths. - -The main difference from `ls('-R', path)` is that the resulting file names -include the base directories, e.g. `lib/resources/file1` instead of just `file1`. - -### cp([options ,] source [,source ...], dest) -### cp([options ,] source_array, dest) -Available options: - -+ `-f`: force -+ `-r, -R`: recursive - -Examples: - -```javascript -cp('file1', 'dir1'); -cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); -cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above -``` - -Copies files. The wildcard `*` is accepted. - -### rm([options ,] file [, file ...]) -### rm([options ,] file_array) -Available options: - -+ `-f`: force -+ `-r, -R`: recursive - -Examples: - -```javascript -rm('-rf', '/tmp/*'); -rm('some_file.txt', 'another_file.txt'); -rm(['some_file.txt', 'another_file.txt']); // same as above -``` - -Removes files. The wildcard `*` is accepted. - -### mv(source [, source ...], dest') -### mv(source_array, dest') -Available options: - -+ `f`: force - -Examples: - -```javascript -mv('-f', 'file', 'dir/'); -mv('file1', 'file2', 'dir/'); -mv(['file1', 'file2'], 'dir/'); // same as above -``` - -Moves files. The wildcard `*` is accepted. - -### mkdir([options ,] dir [, dir ...]) -### mkdir([options ,] dir_array) -Available options: - -+ `p`: full path (will create intermediate dirs if necessary) - -Examples: - -```javascript -mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); -mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above -``` - -Creates directories. - -### test(expression) -Available expression primaries: - -+ `'-b', 'path'`: true if path is a block device -+ `'-c', 'path'`: true if path is a character device -+ `'-d', 'path'`: true if path is a directory -+ `'-e', 'path'`: true if path exists -+ `'-f', 'path'`: true if path is a regular file -+ `'-L', 'path'`: true if path is a symboilc link -+ `'-p', 'path'`: true if path is a pipe (FIFO) -+ `'-S', 'path'`: true if path is a socket - -Examples: - -```javascript -if (test('-d', path)) { /* do something with dir */ }; -if (!test('-f', path)) continue; // skip if it's a regular file -``` - -Evaluates expression using the available primaries and returns corresponding value. - -### cat(file [, file ...]) -### cat(file_array) - -Examples: - -```javascript -var str = cat('file*.txt'); -var str = cat('file1', 'file2'); -var str = cat(['file1', 'file2']); // same as above -``` - -Returns a string containing the given file, or a concatenated string -containing the files if more than one file is given (a new line character is -introduced between each file). Wildcard `*` accepted. - -### 'string'.to(file) - -Examples: - -```javascript -cat('input.txt').to('output.txt'); -``` - -Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as -those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ - -### sed([options ,] search_regex, replace_str, file) -Available options: - -+ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ - -Examples: - -```javascript -sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); -sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); -``` - -Reads an input string from `file` and performs a JavaScript `replace()` on the input -using the given search regex and replacement string. Returns the new string after replacement. - -### grep([options ,] regex_filter, file [, file ...]) -### grep([options ,] regex_filter, file_array) -Available options: - -+ `-v`: Inverse the sense of the regex and print the lines not matching the criteria. - -Examples: - -```javascript -grep('-v', 'GLOBAL_VARIABLE', '*.js'); -grep('GLOBAL_VARIABLE', '*.js'); -``` - -Reads input string from given files and returns a string containing all lines of the -file that match the given `regex_filter`. Wildcard `*` accepted. - -### which(command) - -Examples: - -```javascript -var nodeExec = which('node'); -``` - -Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. -Returns string containing the absolute path to the command. - -### echo(string [,string ...]) - -Examples: - -```javascript -echo('hello world'); -var str = echo('hello world'); -``` - -Prints string to stdout, and returns string with additional utility methods -like `.to()`. - -### dirs([options | '+N' | '-N']) - -Available options: - -+ `-c`: Clears the directory stack by deleting all of the elements. - -Arguments: - -+ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. -+ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. - -Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. - -See also: pushd, popd - -### pushd([options,] [dir | '-N' | '+N']) - -Available options: - -+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. - -Arguments: - -+ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. -+ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -+ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. - -Examples: - -```javascript -// process.cwd() === '/usr' -pushd('/etc'); // Returns /etc /usr -pushd('+1'); // Returns /usr /etc -``` - -Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. - -### popd([options,] ['-N' | '+N']) - -Available options: - -+ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. - -Arguments: - -+ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. -+ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. - -Examples: - -```javascript -echo(process.cwd()); // '/usr' -pushd('/etc'); // '/etc /usr' -echo(process.cwd()); // '/etc' -popd(); // '/usr' -echo(process.cwd()); // '/usr' -``` - -When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. - -### exit(code) -Exits the current process with the given exit code. - -### env['VAR_NAME'] -Object containing environment variables (both getter and setter). Shortcut to process.env. - -### exec(command [, options] [, callback]) -Available options (all `false` by default): - -+ `async`: Asynchronous execution. Defaults to true if a callback is provided. -+ `silent`: Do not echo program output to console. - -Examples: - -```javascript -var version = exec('node --version', {silent:true}).output; - -var child = exec('some_long_running_process', {async:true}); -child.stdout.on('data', function(data) { - /* ... do something with data ... */ -}); - -exec('some_long_running_process', function(code, output) { - console.log('Exit code:', code); - console.log('Program output:', output); -}); -``` - -Executes the given `command` _synchronously_, unless otherwise specified. -When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's -`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and -the `callback` gets the arguments `(code, output)`. - -**Note:** For long-lived processes, it's best to run `exec()` asynchronously as -the current synchronous implementation uses a lot of CPU. This should be getting -fixed soon. - -### chmod(octal_mode || octal_string, file) -### chmod(symbolic_mode, file) - -Available options: - -+ `-v`: output a diagnostic for every file processed -+ `-c`: like verbose but report only when a change is made -+ `-R`: change files and directories recursively - -Examples: - -```javascript -chmod(755, '/Users/brandon'); -chmod('755', '/Users/brandon'); // same as above -chmod('u+x', '/Users/brandon'); -``` - -Alters the permissions of a file or directory by either specifying the -absolute permissions in octal form or expressing the changes in symbols. -This command tries to mimic the POSIX behavior as much as possible. -Notable exceptions: - -+ In symbolic modes, 'a-r' and '-r' are identical. No consideration is - given to the umask. -+ There is no "quiet" option since default behavior is to run silent. - -## Configuration - - -### config.silent -Example: - -```javascript -var silentState = config.silent; // save old silent state -config.silent = true; -/* ... */ -config.silent = silentState; // restore old silent state -``` - -Suppresses all command output if `true`, except for `echo()` calls. -Default is `false`. - -### config.fatal -Example: - -```javascript -config.fatal = true; -cp('this_file_does_not_exist', '/dev/null'); // dies here -/* more commands... */ -``` - -If `true` the script will die on errors. Default is `false`. - -## Non-Unix commands - - -### tempdir() -Searches and returns string containing a writeable, platform-dependent temporary directory. -Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). - -### error() -Tests if error occurred in the last command. Returns `null` if no error occurred, -otherwise returns string explaining the error diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/bin/shjs b/deploy/core/node_modules/jshint/node_modules/shelljs/bin/shjs deleted file mode 100755 index d239a7ad4..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/bin/shjs +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -if (process.argv.length < 3) { - console.log('ShellJS: missing argument (script name)'); - console.log(); - process.exit(1); -} - -var args, - scriptName = process.argv[2]; -env['NODE_PATH'] = __dirname + '/../..'; - -if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { - if (test('-f', scriptName + '.js')) - scriptName += '.js'; - if (test('-f', scriptName + '.coffee')) - scriptName += '.coffee'; -} - -if (!test('-f', scriptName)) { - console.log('ShellJS: script not found ('+scriptName+')'); - console.log(); - process.exit(1); -} - -args = process.argv.slice(3); - -for (var i = 0, l = args.length; i < l; i++) { - if (args[i][0] !== "-"){ - args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words - } -} - -if (scriptName.match(/\.coffee$/)) { - // - // CoffeeScript - // - if (which('coffee')) { - exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); - } else { - console.log('ShellJS: CoffeeScript interpreter not found'); - console.log(); - process.exit(1); - } -} else { - // - // JavaScript - // - exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/global.js b/deploy/core/node_modules/jshint/node_modules/shelljs/global.js deleted file mode 100644 index 97f0033cc..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/global.js +++ /dev/null @@ -1,3 +0,0 @@ -var shell = require('./shell.js'); -for (var cmd in shell) - global[cmd] = shell[cmd]; diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/jshint.json b/deploy/core/node_modules/jshint/node_modules/shelljs/jshint.json deleted file mode 100644 index 205ed9c27..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/jshint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "loopfunc": true, - "sub": true -} \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/make.js b/deploy/core/node_modules/jshint/node_modules/shelljs/make.js deleted file mode 100644 index b636447e5..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/make.js +++ /dev/null @@ -1,48 +0,0 @@ -require('./global'); -config.fatal = true; - -global.target = {}; - -// This ensures we only execute the script targets after the entire script has -// been evaluated -var args = process.argv.slice(2); -setTimeout(function() { - var t; - - if (args.length === 1 && args[0] === '--help') { - console.log('Available targets:'); - for (t in target) - console.log(' ' + t); - return; - } - - // Wrap targets to prevent duplicate execution - for (t in target) { - (function(t, oldTarget){ - - // Wrap it - target[t] = function(force) { - if (oldTarget.done && !force) - return; - oldTarget.done = true; - return oldTarget.apply(oldTarget, arguments); - }; - - })(t, target[t]); - } - - // Execute desired targets - if (args.length > 0) { - args.forEach(function(arg) { - if (arg in target) - target[arg](); - else { - console.log('no such target: ' + arg); - exit(1); - } - }); - } else if ('all' in target) { - target.all(); - } - -}, 0); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/package.json b/deploy/core/node_modules/jshint/node_modules/shelljs/package.json deleted file mode 100644 index 665423839..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "shelljs", - "version": "0.1.4", - "author": { - "name": "Artur Adib", - "email": "aadib@mozilla.com" - }, - "description": "Portable Unix shell commands for Node.js", - "keywords": [ - "unix", - "shell", - "makefile", - "make", - "jake", - "synchronous" - ], - "repository": { - "type": "git", - "url": "git://github.com/arturadib/shelljs.git" - }, - "homepage": "http://github.com/arturadib/shelljs", - "main": "./shell.js", - "scripts": { - "test": "node scripts/run-tests" - }, - "bin": { - "shjs": "./bin/shjs" - }, - "dependencies": {}, - "devDependencies": { - "jshint": "~1.1.0" - }, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs)\n\nShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts!\n\nThe project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like:\n\n+ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader\n+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger\n+ [JSHint](http://jshint.com) - Most popular JavaScript linter\n+ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers\n+ [Yeoman](http://yeoman.io/) - Web application stack and development tool\n+ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation\n\nand [many more](https://npmjs.org/browse/depended/shelljs).\n\n## Installing\n\nVia npm:\n\n```bash\n$ npm install [-g] shelljs\n```\n\nIf the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to\nrun ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder:\n\n```bash\n$ shjs my_script\n```\n\nYou can also just copy `shell.js` into your project's directory, and `require()` accordingly.\n\n\n## Examples\n\n### JavaScript\n\n```javascript\nrequire('shelljs/global');\n\nif (!which('git')) {\n echo('Sorry, this script requires git');\n exit(1);\n}\n\n// Copy files to release dir\nmkdir('-p', 'out/Release');\ncp('-R', 'stuff/*', 'out/Release');\n\n// Replace macros in each .js file\ncd('lib');\nls('*.js').forEach(function(file) {\n sed('-i', 'BUILD_VERSION', 'v0.1.2', file);\n sed('-i', /.*REMOVE_THIS_LINE.*\\n/, '', file);\n sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\\n/, cat('macro.js'), file);\n});\ncd('..');\n\n// Run external tool synchronously\nif (exec('git commit -am \"Auto-commit\"').code !== 0) {\n echo('Error: Git commit failed');\n exit(1);\n}\n```\n\n### CoffeeScript\n\n```coffeescript\nrequire 'shelljs/global'\n\nif not which 'git'\n echo 'Sorry, this script requires git'\n exit 1\n\n# Copy files to release dir\nmkdir '-p', 'out/Release'\ncp '-R', 'stuff/*', 'out/Release'\n\n# Replace macros in each .js file\ncd 'lib'\nfor file in ls '*.js'\n sed '-i', 'BUILD_VERSION', 'v0.1.2', file\n sed '-i', /.*REMOVE_THIS_LINE.*\\n/, '', file\n sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\\n/, cat 'macro.js', file\ncd '..'\n\n# Run external tool synchronously\nif (exec 'git commit -am \"Auto-commit\"').code != 0\n echo 'Error: Git commit failed'\n exit 1\n```\n\n## Global vs. Local\n\nThe example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`.\n\nExample:\n\n```javascript\nvar shell = require('shelljs');\nshell.echo('hello world');\n```\n\n## Make tool\n\nA convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script.\n\nExample (CoffeeScript):\n\n```coffeescript\nrequire 'shelljs/make'\n\ntarget.all = ->\n target.bundle()\n target.docs()\n\ntarget.bundle = ->\n cd __dirname\n mkdir 'build'\n cd 'lib'\n (cat '*.js').to '../build/output.js'\n\ntarget.docs = ->\n cd __dirname\n mkdir 'docs'\n cd 'lib'\n for file in ls '*.js'\n text = grep '//@', file # extract special comments\n text.replace '//@', '' # remove comment tags\n text.to 'docs/my_docs.md'\n```\n\nTo run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`, and so on.\n\n\n\n\n\n\n## Command reference\n\n\nAll commands run synchronously, unless otherwise stated.\n\n\n### cd('dir')\nChanges to directory `dir` for the duration of the script\n\n### pwd()\nReturns the current directory.\n\n### ls([options ,] path [,path ...])\n### ls([options ,] path_array)\nAvailable options:\n\n+ `-R`: recursive\n+ `-A`: all files (include files beginning with `.`, except for `.` and `..`)\n\nExamples:\n\n```javascript\nls('projs/*.js');\nls('-R', '/users/me', '/tmp');\nls('-R', ['/users/me', '/tmp']); // same as above\n```\n\nReturns array of files in the given path, or in current directory if no path provided.\n\n### find(path [,path ...])\n### find(path_array)\nExamples:\n\n```javascript\nfind('src', 'lib');\nfind(['src', 'lib']); // same as above\nfind('.').filter(function(file) { return file.match(/\\.js$/); });\n```\n\nReturns array of all files (however deep) in the given paths.\n\nThe main difference from `ls('-R', path)` is that the resulting file names\ninclude the base directories, e.g. `lib/resources/file1` instead of just `file1`.\n\n### cp([options ,] source [,source ...], dest)\n### cp([options ,] source_array, dest)\nAvailable options:\n\n+ `-f`: force\n+ `-r, -R`: recursive\n\nExamples:\n\n```javascript\ncp('file1', 'dir1');\ncp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp');\ncp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above\n```\n\nCopies files. The wildcard `*` is accepted.\n\n### rm([options ,] file [, file ...])\n### rm([options ,] file_array)\nAvailable options:\n\n+ `-f`: force\n+ `-r, -R`: recursive\n\nExamples:\n\n```javascript\nrm('-rf', '/tmp/*');\nrm('some_file.txt', 'another_file.txt');\nrm(['some_file.txt', 'another_file.txt']); // same as above\n```\n\nRemoves files. The wildcard `*` is accepted.\n\n### mv(source [, source ...], dest')\n### mv(source_array, dest')\nAvailable options:\n\n+ `f`: force\n\nExamples:\n\n```javascript\nmv('-f', 'file', 'dir/');\nmv('file1', 'file2', 'dir/');\nmv(['file1', 'file2'], 'dir/'); // same as above\n```\n\nMoves files. The wildcard `*` is accepted.\n\n### mkdir([options ,] dir [, dir ...])\n### mkdir([options ,] dir_array)\nAvailable options:\n\n+ `p`: full path (will create intermediate dirs if necessary)\n\nExamples:\n\n```javascript\nmkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g');\nmkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above\n```\n\nCreates directories.\n\n### test(expression)\nAvailable expression primaries:\n\n+ `'-b', 'path'`: true if path is a block device\n+ `'-c', 'path'`: true if path is a character device\n+ `'-d', 'path'`: true if path is a directory\n+ `'-e', 'path'`: true if path exists\n+ `'-f', 'path'`: true if path is a regular file\n+ `'-L', 'path'`: true if path is a symboilc link\n+ `'-p', 'path'`: true if path is a pipe (FIFO)\n+ `'-S', 'path'`: true if path is a socket\n\nExamples:\n\n```javascript\nif (test('-d', path)) { /* do something with dir */ };\nif (!test('-f', path)) continue; // skip if it's a regular file\n```\n\nEvaluates expression using the available primaries and returns corresponding value.\n\n### cat(file [, file ...])\n### cat(file_array)\n\nExamples:\n\n```javascript\nvar str = cat('file*.txt');\nvar str = cat('file1', 'file2');\nvar str = cat(['file1', 'file2']); // same as above\n```\n\nReturns a string containing the given file, or a concatenated string\ncontaining the files if more than one file is given (a new line character is\nintroduced between each file). Wildcard `*` accepted.\n\n### 'string'.to(file)\n\nExamples:\n\n```javascript\ncat('input.txt').to('output.txt');\n```\n\nAnalogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as\nthose returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_\n\n### sed([options ,] search_regex, replace_str, file)\nAvailable options:\n\n+ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_\n\nExamples:\n\n```javascript\nsed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');\nsed(/.*DELETE_THIS_LINE.*\\n/, '', 'source.js');\n```\n\nReads an input string from `file` and performs a JavaScript `replace()` on the input\nusing the given search regex and replacement string. Returns the new string after replacement.\n\n### grep([options ,] regex_filter, file [, file ...])\n### grep([options ,] regex_filter, file_array)\nAvailable options:\n\n+ `-v`: Inverse the sense of the regex and print the lines not matching the criteria.\n\nExamples:\n\n```javascript\ngrep('-v', 'GLOBAL_VARIABLE', '*.js');\ngrep('GLOBAL_VARIABLE', '*.js');\n```\n\nReads input string from given files and returns a string containing all lines of the\nfile that match the given `regex_filter`. Wildcard `*` accepted.\n\n### which(command)\n\nExamples:\n\n```javascript\nvar nodeExec = which('node');\n```\n\nSearches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions.\nReturns string containing the absolute path to the command.\n\n### echo(string [,string ...])\n\nExamples:\n\n```javascript\necho('hello world');\nvar str = echo('hello world');\n```\n\nPrints string to stdout, and returns string with additional utility methods\nlike `.to()`.\n\n### dirs([options | '+N' | '-N'])\n\nAvailable options:\n\n+ `-c`: Clears the directory stack by deleting all of the elements.\n\nArguments:\n\n+ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.\n+ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.\n\nDisplay the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.\n\nSee also: pushd, popd\n\n### pushd([options,] [dir | '-N' | '+N'])\n\nAvailable options:\n\n+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.\n\nArguments:\n\n+ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`.\n+ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n+ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n\nExamples:\n\n```javascript\n// process.cwd() === '/usr'\npushd('/etc'); // Returns /etc /usr\npushd('+1'); // Returns /usr /etc\n```\n\nSave the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.\n\n### popd([options,] ['-N' | '+N'])\n\nAvailable options:\n\n+ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated.\n\nArguments:\n\n+ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.\n+ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.\n\nExamples:\n\n```javascript\necho(process.cwd()); // '/usr'\npushd('/etc'); // '/etc /usr'\necho(process.cwd()); // '/etc'\npopd(); // '/usr'\necho(process.cwd()); // '/usr'\n```\n\nWhen no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.\n\n### exit(code)\nExits the current process with the given exit code.\n\n### env['VAR_NAME']\nObject containing environment variables (both getter and setter). Shortcut to process.env.\n\n### exec(command [, options] [, callback])\nAvailable options (all `false` by default):\n\n+ `async`: Asynchronous execution. Defaults to true if a callback is provided.\n+ `silent`: Do not echo program output to console.\n\nExamples:\n\n```javascript\nvar version = exec('node --version', {silent:true}).output;\n\nvar child = exec('some_long_running_process', {async:true});\nchild.stdout.on('data', function(data) {\n /* ... do something with data ... */\n});\n\nexec('some_long_running_process', function(code, output) {\n console.log('Exit code:', code);\n console.log('Program output:', output);\n});\n```\n\nExecutes the given `command` _synchronously_, unless otherwise specified.\nWhen in synchronous mode returns the object `{ code:..., output:... }`, containing the program's\n`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and\nthe `callback` gets the arguments `(code, output)`.\n\n**Note:** For long-lived processes, it's best to run `exec()` asynchronously as\nthe current synchronous implementation uses a lot of CPU. This should be getting\nfixed soon.\n\n### chmod(octal_mode || octal_string, file)\n### chmod(symbolic_mode, file)\n\nAvailable options:\n\n+ `-v`: output a diagnostic for every file processed\n+ `-c`: like verbose but report only when a change is made\n+ `-R`: change files and directories recursively\n\nExamples:\n\n```javascript\nchmod(755, '/Users/brandon');\nchmod('755', '/Users/brandon'); // same as above \nchmod('u+x', '/Users/brandon');\n```\n\nAlters the permissions of a file or directory by either specifying the\nabsolute permissions in octal form or expressing the changes in symbols.\nThis command tries to mimic the POSIX behavior as much as possible.\nNotable exceptions:\n\n+ In symbolic modes, 'a-r' and '-r' are identical. No consideration is\n given to the umask.\n+ There is no \"quiet\" option since default behavior is to run silent.\n\n## Configuration\n\n\n### config.silent\nExample:\n\n```javascript\nvar silentState = config.silent; // save old silent state\nconfig.silent = true;\n/* ... */\nconfig.silent = silentState; // restore old silent state\n```\n\nSuppresses all command output if `true`, except for `echo()` calls.\nDefault is `false`.\n\n### config.fatal\nExample:\n\n```javascript\nconfig.fatal = true;\ncp('this_file_does_not_exist', '/dev/null'); // dies here\n/* more commands... */\n```\n\nIf `true` the script will die on errors. Default is `false`.\n\n## Non-Unix commands\n\n\n### tempdir()\nSearches and returns string containing a writeable, platform-dependent temporary directory.\nFollows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir).\n\n### error()\nTests if error occurred in the last command. Returns `null` if no error occurred,\notherwise returns string explaining the error\n", - "readmeFilename": "README.md", - "_id": "shelljs@0.1.4", - "_from": "shelljs@0.1.x" -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/scripts/docs.js b/deploy/core/node_modules/jshint/node_modules/shelljs/scripts/docs.js deleted file mode 100755 index 68a2138e5..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/scripts/docs.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -echo('Appending docs to README.md'); - -cd(__dirname + '/..'); - -// Extract docs from shell.js -var docs = grep('//@', 'shell.js'); -// Remove '//@' -docs = docs.replace(/\/\/\@ ?/g, ''); -// Append docs to README -sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); - -echo('All done.'); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js b/deploy/core/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js deleted file mode 100755 index a9d32fcac..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -var path = require('path'); - -var failed = false; - -// -// Lint -// -JSHINT_BIN = './node_modules/jshint/bin/jshint'; -cd(__dirname + '/..'); - -if (!test('-f', JSHINT_BIN)) { - echo('JSHint not found. Run `npm install` in the root dir first.'); - exit(1); -} - -if (exec(JSHINT_BIN + ' --config jshint.json *.js test/*.js').code !== 0) { - failed = true; - echo('*** JSHINT FAILED! (return code != 0)'); - echo(); -} else { - echo('All JSHint tests passed'); - echo(); -} - -// -// Unit tests -// -cd(__dirname + '/../test'); -ls('*.js').forEach(function(file) { - echo('Running test:', file); - if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit) - failed = true; - echo('*** TEST FAILED! (missing exit code "123")'); - echo(); - } -}); - -if (failed) { - echo(); - echo('*******************************************************'); - echo('WARNING: Some tests did not pass!'); - echo('*******************************************************'); - exit(1); -} else { - echo(); - echo('All tests passed.'); -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/shell.js b/deploy/core/node_modules/jshint/node_modules/shelljs/shell.js deleted file mode 100644 index 7a4f4c8ac..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/shell.js +++ /dev/null @@ -1,1901 +0,0 @@ -// -// ShellJS -// Unix shell commands on top of Node's API -// -// Copyright (c) 2012 Artur Adib -// http://github.com/arturadib/shelljs -// - -var fs = require('fs'), - path = require('path'), - util = require('util'), - vm = require('vm'), - child = require('child_process'), - os = require('os'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -var config = { - silent: false, - fatal: false -}; - -var state = { - error: null, - currentCmd: 'shell.js', - tempDir: null - }, - platform = os.type().match(/^Win/) ? 'win' : 'unix'; - - -//@ -//@ All commands run synchronously, unless otherwise stated. -//@ - - -//@ -//@ ### cd('dir') -//@ Changes to directory `dir` for the duration of the script -function _cd(options, dir) { - if (!dir) - error('directory not specified'); - - if (!fs.existsSync(dir)) - error('no such file or directory: ' + dir); - - if (!fs.statSync(dir).isDirectory()) - error('not a directory: ' + dir); - - process.chdir(dir); -} -exports.cd = wrap('cd', _cd); - -//@ -//@ ### pwd() -//@ Returns the current directory. -function _pwd(options) { - var pwd = path.resolve(process.cwd()); - return ShellString(pwd); -} -exports.pwd = wrap('pwd', _pwd); - - -//@ -//@ ### ls([options ,] path [,path ...]) -//@ ### ls([options ,] path_array) -//@ Available options: -//@ -//@ + `-R`: recursive -//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ ls('projs/*.js'); -//@ ls('-R', '/users/me', '/tmp'); -//@ ls('-R', ['/users/me', '/tmp']); // same as above -//@ ``` -//@ -//@ Returns array of files in the given path, or in current directory if no path provided. -function _ls(options, paths) { - options = parseOptions(options, { - 'R': 'recursive', - 'A': 'all', - 'a': 'all_deprecated' - }); - - if (options.all_deprecated) { - // We won't support the -a option as it's hard to image why it's useful - // (it includes '.' and '..' in addition to '.*' files) - // For backwards compatibility we'll dump a deprecated message and proceed as before - log('ls: Option -a is deprecated. Use -A instead'); - options.all = true; - } - - if (!paths) - paths = ['.']; - else if (typeof paths === 'object') - paths = paths; // assume array - else if (typeof paths === 'string') - paths = [].slice.call(arguments, 1); - - var list = []; - - // Conditionally pushes file to list - returns true if pushed, false otherwise - // (e.g. prevents hidden files to be included unless explicitly told so) - function pushFile(file, query) { - // hidden file? - if (path.basename(file)[0] === '.') { - // not explicitly asking for hidden files? - if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) - return false; - } - - if (platform === 'win') - file = file.replace(/\\/g, '/'); - - list.push(file); - return true; - } - - paths.forEach(function(p) { - if (fs.existsSync(p)) { - var stats = fs.statSync(p); - // Simple file? - if (stats.isFile()) { - pushFile(p, p); - return; // continue - } - - // Simple dir? - if (stats.isDirectory()) { - // Iterate over p contents - fs.readdirSync(p).forEach(function(file) { - if (!pushFile(file, p)) - return; - - // Recursive? - if (options.recursive) { - var oldDir = _pwd(); - _cd('', p); - if (fs.statSync(file).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); - _cd('', oldDir); - } - }); - return; // continue - } - } - - // p does not exist - possible wildcard present - - var basename = path.basename(p); - var dirname = path.dirname(p); - // Wildcard present on an existing dir? (e.g. '/tmp/*.js') - if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { - // Escape special regular expression chars - var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); - // Translates wildcard into regex - regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; - // Iterate over directory contents - fs.readdirSync(dirname).forEach(function(file) { - if (file.match(new RegExp(regexp))) { - if (!pushFile(path.normalize(dirname+'/'+file), basename)) - return; - - // Recursive? - if (options.recursive) { - var pp = dirname + '/' + file; - if (fs.lstatSync(pp).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); - } // recursive - } // if file matches - }); // forEach - return; - } - - error('no such file or directory: ' + p, true); - }); - - return list; -} -exports.ls = wrap('ls', _ls); - - -//@ -//@ ### find(path [,path ...]) -//@ ### find(path_array) -//@ Examples: -//@ -//@ ```javascript -//@ find('src', 'lib'); -//@ find(['src', 'lib']); // same as above -//@ find('.').filter(function(file) { return file.match(/\.js$/); }); -//@ ``` -//@ -//@ Returns array of all files (however deep) in the given paths. -//@ -//@ The main difference from `ls('-R', path)` is that the resulting file names -//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. -function _find(options, paths) { - if (!paths) - error('no path specified'); - else if (typeof paths === 'object') - paths = paths; // assume array - else if (typeof paths === 'string') - paths = [].slice.call(arguments, 1); - - var list = []; - - function pushFile(file) { - if (platform === 'win') - file = file.replace(/\\/g, '/'); - list.push(file); - } - - // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs - // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory - - paths.forEach(function(file) { - pushFile(file); - - if (fs.statSync(file).isDirectory()) { - _ls('-RA', file+'/*').forEach(function(subfile) { - pushFile(subfile); - }); - } - }); - - return list; -} -exports.find = wrap('find', _find); - - -//@ -//@ ### cp([options ,] source [,source ...], dest) -//@ ### cp([options ,] source_array, dest) -//@ Available options: -//@ -//@ + `-f`: force -//@ + `-r, -R`: recursive -//@ -//@ Examples: -//@ -//@ ```javascript -//@ cp('file1', 'dir1'); -//@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); -//@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above -//@ ``` -//@ -//@ Copies files. The wildcard `*` is accepted. -function _cp(options, sources, dest) { - options = parseOptions(options, { - 'f': 'force', - 'R': 'recursive', - 'r': 'recursive' - }); - - // Get sources, dest - if (arguments.length < 3) { - error('missing and/or '); - } else if (arguments.length > 3) { - sources = [].slice.call(arguments, 1, arguments.length - 1); - dest = arguments[arguments.length - 1]; - } else if (typeof sources === 'string') { - sources = [sources]; - } else if ('length' in sources) { - sources = sources; // no-op for array - } else { - error('invalid arguments'); - } - - var exists = fs.existsSync(dest), - stats = exists && fs.statSync(dest); - - // Dest is not existing dir, but multiple sources given - if ((!exists || !stats.isDirectory()) && sources.length > 1) - error('dest is not a directory (too many sources)'); - - // Dest is an existing file, but no -f given - if (exists && stats.isFile() && !options.force) - error('dest file already exists: ' + dest); - - if (options.recursive) { - // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" - // (see Github issue #15) - sources.forEach(function(src, i) { - if (src[src.length - 1] === '/') - sources[i] += '*'; - }); - - // Create dest - try { - fs.mkdirSync(dest, parseInt('0777', 8)); - } catch (e) { - // like Unix's cp, keep going even if we can't create dest dir - } - } - - sources = expand(sources); - - sources.forEach(function(src) { - if (!fs.existsSync(src)) { - error('no such file or directory: '+src, true); - return; // skip file - } - - // If here, src exists - if (fs.statSync(src).isDirectory()) { - if (!options.recursive) { - // Non-Recursive - log(src + ' is a directory (not copied)'); - } else { - // Recursive - // 'cp /a/source dest' should create 'source' in 'dest' - var newDest = path.join(dest, path.basename(src)), - checkDir = fs.statSync(src); - try { - fs.mkdirSync(newDest, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') throw e; - } - - cpdirSyncRecursive(src, newDest, {force: options.force}); - } - return; // done with dir - } - - // If here, src is a file - - // When copying to '/path/dir': - // thisDest = '/path/dir/file1' - var thisDest = dest; - if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) - thisDest = path.normalize(dest + '/' + path.basename(src)); - - if (fs.existsSync(thisDest) && !options.force) { - error('dest file already exists: ' + thisDest, true); - return; // skip file - } - - copyFileSync(src, thisDest); - }); // forEach(src) -} -exports.cp = wrap('cp', _cp); - -//@ -//@ ### rm([options ,] file [, file ...]) -//@ ### rm([options ,] file_array) -//@ Available options: -//@ -//@ + `-f`: force -//@ + `-r, -R`: recursive -//@ -//@ Examples: -//@ -//@ ```javascript -//@ rm('-rf', '/tmp/*'); -//@ rm('some_file.txt', 'another_file.txt'); -//@ rm(['some_file.txt', 'another_file.txt']); // same as above -//@ ``` -//@ -//@ Removes files. The wildcard `*` is accepted. -function _rm(options, files) { - options = parseOptions(options, { - 'f': 'force', - 'r': 'recursive', - 'R': 'recursive' - }); - if (!files) - error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 1); - // if it's array leave it as it is - - files = expand(files); - - files.forEach(function(file) { - if (!fs.existsSync(file)) { - // Path does not exist, no force flag given - if (!options.force) - error('no such file or directory: '+file, true); - - return; // skip file - } - - // If here, path exists - - var stats = fs.statSync(file); - // Remove simple file - if (stats.isFile()) { - - // Do not check for file writing permissions - if (options.force) { - _unlinkSync(file); - return; - } - - if (isWriteable(file)) - _unlinkSync(file); - else - error('permission denied: '+file, true); - - return; - } // simple file - - // Path is an existing directory, but no -r flag given - if (stats.isDirectory() && !options.recursive) { - error('path is a directory', true); - return; // skip path - } - - // Recursively remove existing directory - if (stats.isDirectory() && options.recursive) { - rmdirSyncRecursive(file, options.force); - } - }); // forEach(file) -} // rm -exports.rm = wrap('rm', _rm); - -//@ -//@ ### mv(source [, source ...], dest') -//@ ### mv(source_array, dest') -//@ Available options: -//@ -//@ + `f`: force -//@ -//@ Examples: -//@ -//@ ```javascript -//@ mv('-f', 'file', 'dir/'); -//@ mv('file1', 'file2', 'dir/'); -//@ mv(['file1', 'file2'], 'dir/'); // same as above -//@ ``` -//@ -//@ Moves files. The wildcard `*` is accepted. -function _mv(options, sources, dest) { - options = parseOptions(options, { - 'f': 'force' - }); - - // Get sources, dest - if (arguments.length < 3) { - error('missing and/or '); - } else if (arguments.length > 3) { - sources = [].slice.call(arguments, 1, arguments.length - 1); - dest = arguments[arguments.length - 1]; - } else if (typeof sources === 'string') { - sources = [sources]; - } else if ('length' in sources) { - sources = sources; // no-op for array - } else { - error('invalid arguments'); - } - - sources = expand(sources); - - var exists = fs.existsSync(dest), - stats = exists && fs.statSync(dest); - - // Dest is not existing dir, but multiple sources given - if ((!exists || !stats.isDirectory()) && sources.length > 1) - error('dest is not a directory (too many sources)'); - - // Dest is an existing file, but no -f given - if (exists && stats.isFile() && !options.force) - error('dest file already exists: ' + dest); - - sources.forEach(function(src) { - if (!fs.existsSync(src)) { - error('no such file or directory: '+src, true); - return; // skip file - } - - // If here, src exists - - // When copying to '/path/dir': - // thisDest = '/path/dir/file1' - var thisDest = dest; - if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) - thisDest = path.normalize(dest + '/' + path.basename(src)); - - if (fs.existsSync(thisDest) && !options.force) { - error('dest file already exists: ' + thisDest, true); - return; // skip file - } - - if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { - error('cannot move to self: '+src, true); - return; // skip file - } - - fs.renameSync(src, thisDest); - }); // forEach(src) -} // mv -exports.mv = wrap('mv', _mv); - -//@ -//@ ### mkdir([options ,] dir [, dir ...]) -//@ ### mkdir([options ,] dir_array) -//@ Available options: -//@ -//@ + `p`: full path (will create intermediate dirs if necessary) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); -//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above -//@ ``` -//@ -//@ Creates directories. -function _mkdir(options, dirs) { - options = parseOptions(options, { - 'p': 'fullpath' - }); - if (!dirs) - error('no paths given'); - - if (typeof dirs === 'string') - dirs = [].slice.call(arguments, 1); - // if it's array leave it as it is - - dirs.forEach(function(dir) { - if (fs.existsSync(dir)) { - if (!options.fullpath) - error('path already exists: ' + dir, true); - return; // skip dir - } - - // Base dir does not exist, and no -p option given - var baseDir = path.dirname(dir); - if (!fs.existsSync(baseDir) && !options.fullpath) { - error('no such file or directory: ' + baseDir, true); - return; // skip dir - } - - if (options.fullpath) - mkdirSyncRecursive(dir); - else - fs.mkdirSync(dir, parseInt('0777', 8)); - }); -} // mkdir -exports.mkdir = wrap('mkdir', _mkdir); - -//@ -//@ ### test(expression) -//@ Available expression primaries: -//@ -//@ + `'-b', 'path'`: true if path is a block device -//@ + `'-c', 'path'`: true if path is a character device -//@ + `'-d', 'path'`: true if path is a directory -//@ + `'-e', 'path'`: true if path exists -//@ + `'-f', 'path'`: true if path is a regular file -//@ + `'-L', 'path'`: true if path is a symboilc link -//@ + `'-p', 'path'`: true if path is a pipe (FIFO) -//@ + `'-S', 'path'`: true if path is a socket -//@ -//@ Examples: -//@ -//@ ```javascript -//@ if (test('-d', path)) { /* do something with dir */ }; -//@ if (!test('-f', path)) continue; // skip if it's a regular file -//@ ``` -//@ -//@ Evaluates expression using the available primaries and returns corresponding value. -function _test(options, path) { - if (!path) - error('no path given'); - - // hack - only works with unary primaries - options = parseOptions(options, { - 'b': 'block', - 'c': 'character', - 'd': 'directory', - 'e': 'exists', - 'f': 'file', - 'L': 'link', - 'p': 'pipe', - 'S': 'socket' - }); - - var canInterpret = false; - for (var key in options) - if (options[key] === true) { - canInterpret = true; - break; - } - - if (!canInterpret) - error('could not interpret expression'); - - if (options.link) { - try { - return fs.lstatSync(path).isSymbolicLink(); - } catch(e) { - return false; - } - } - - if (!fs.existsSync(path)) - return false; - - if (options.exists) - return true; - - var stats = fs.statSync(path); - - if (options.block) - return stats.isBlockDevice(); - - if (options.character) - return stats.isCharacterDevice(); - - if (options.directory) - return stats.isDirectory(); - - if (options.file) - return stats.isFile(); - - if (options.pipe) - return stats.isFIFO(); - - if (options.socket) - return stats.isSocket(); -} // test -exports.test = wrap('test', _test); - - -//@ -//@ ### cat(file [, file ...]) -//@ ### cat(file_array) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var str = cat('file*.txt'); -//@ var str = cat('file1', 'file2'); -//@ var str = cat(['file1', 'file2']); // same as above -//@ ``` -//@ -//@ Returns a string containing the given file, or a concatenated string -//@ containing the files if more than one file is given (a new line character is -//@ introduced between each file). Wildcard `*` accepted. -function _cat(options, files) { - var cat = ''; - - if (!files) - error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 1); - // if it's array leave it as it is - - files = expand(files); - - files.forEach(function(file) { - if (!fs.existsSync(file)) - error('no such file or directory: ' + file); - - cat += fs.readFileSync(file, 'utf8') + '\n'; - }); - - if (cat[cat.length-1] === '\n') - cat = cat.substring(0, cat.length-1); - - return ShellString(cat); -} -exports.cat = wrap('cat', _cat); - -//@ -//@ ### 'string'.to(file) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ cat('input.txt').to('output.txt'); -//@ ``` -//@ -//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as -//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ -function _to(options, file) { - if (!file) - error('wrong arguments'); - - if (!fs.existsSync( path.dirname(file) )) - error('no such file or directory: ' + path.dirname(file)); - - try { - fs.writeFileSync(file, this.toString(), 'utf8'); - } catch(e) { - error('could not write to file (code '+e.code+'): '+file, true); - } -} -// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. -// For now, this is a dummy function to bookmark places we need such strings -function ShellString(str) { - return str; -} -String.prototype.to = wrap('to', _to); - -//@ -//@ ### sed([options ,] search_regex, replace_str, file) -//@ Available options: -//@ -//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ -//@ -//@ Examples: -//@ -//@ ```javascript -//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); -//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); -//@ ``` -//@ -//@ Reads an input string from `file` and performs a JavaScript `replace()` on the input -//@ using the given search regex and replacement string. Returns the new string after replacement. -function _sed(options, regex, replacement, file) { - options = parseOptions(options, { - 'i': 'inplace' - }); - - if (typeof replacement === 'string') - replacement = replacement; // no-op - else if (typeof replacement === 'number') - replacement = replacement.toString(); // fallback - else - error('invalid replacement string'); - - if (!file) - error('no file given'); - - if (!fs.existsSync(file)) - error('no such file or directory: ' + file); - - var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); - if (options.inplace) - fs.writeFileSync(file, result, 'utf8'); - - return ShellString(result); -} -exports.sed = wrap('sed', _sed); - -//@ -//@ ### grep([options ,] regex_filter, file [, file ...]) -//@ ### grep([options ,] regex_filter, file_array) -//@ Available options: -//@ -//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); -//@ grep('GLOBAL_VARIABLE', '*.js'); -//@ ``` -//@ -//@ Reads input string from given files and returns a string containing all lines of the -//@ file that match the given `regex_filter`. Wildcard `*` accepted. -function _grep(options, regex, files) { - options = parseOptions(options, { - 'v': 'inverse' - }); - - if (!files) - error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 2); - // if it's array leave it as it is - - files = expand(files); - - var grep = ''; - files.forEach(function(file) { - if (!fs.existsSync(file)) { - error('no such file or directory: ' + file, true); - return; - } - - var contents = fs.readFileSync(file, 'utf8'), - lines = contents.split(/\r*\n/); - lines.forEach(function(line) { - var matched = line.match(regex); - if ((options.inverse && !matched) || (!options.inverse && matched)) - grep += line + '\n'; - }); - }); - - return ShellString(grep); -} -exports.grep = wrap('grep', _grep); - - -//@ -//@ ### which(command) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var nodeExec = which('node'); -//@ ``` -//@ -//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. -//@ Returns string containing the absolute path to the command. -function _which(options, cmd) { - if (!cmd) - error('must specify command'); - - var pathEnv = process.env.path || process.env.Path || process.env.PATH, - pathArray = splitPath(pathEnv), - where = null; - - // No relative/absolute paths provided? - if (cmd.search(/\//) === -1) { - // Search for command in PATH - pathArray.forEach(function(dir) { - if (where) - return; // already found it - - var attempt = path.resolve(dir + '/' + cmd); - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - - if (platform === 'win') { - var baseAttempt = attempt; - attempt = baseAttempt + '.exe'; - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - attempt = baseAttempt + '.cmd'; - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - attempt = baseAttempt + '.bat'; - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - } // if 'win' - }); - } - - // Command not found anywhere? - if (!fs.existsSync(cmd) && !where) - return null; - - where = where || path.resolve(cmd); - - return ShellString(where); -} -exports.which = wrap('which', _which); - -//@ -//@ ### echo(string [,string ...]) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ echo('hello world'); -//@ var str = echo('hello world'); -//@ ``` -//@ -//@ Prints string to stdout, and returns string with additional utility methods -//@ like `.to()`. -function _echo() { - var messages = [].slice.call(arguments, 0); - console.log.apply(this, messages); - return ShellString(messages.join(' ')); -} -exports.echo = _echo; // don't wrap() as it could parse '-options' - -// Pushd/popd/dirs internals -var _dirStack = []; - -function _isStackIndex(index) { - return (/^[\-+]\d+$/).test(index); -} - -function _parseStackIndex(index) { - if (_isStackIndex(index)) { - if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd - return (/^-/).test(index) ? Number(index) - 1 : Number(index); - } else { - error(index + ': directory stack index out of range'); - } - } else { - error(index + ': invalid number'); - } -} - -function _actualDirStack() { - return [process.cwd()].concat(_dirStack); -} - -//@ -//@ ### dirs([options | '+N' | '-N']) -//@ -//@ Available options: -//@ -//@ + `-c`: Clears the directory stack by deleting all of the elements. -//@ -//@ Arguments: -//@ -//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. -//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. -//@ -//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. -//@ -//@ See also: pushd, popd -function _dirs(options, index) { - if (_isStackIndex(options)) { - index = options; - options = ''; - } - - options = parseOptions(options, { - 'c' : 'clear' - }); - - if (options['clear']) { - _dirStack = []; - return _dirStack; - } - - var stack = _actualDirStack(); - - if (index) { - index = _parseStackIndex(index); - - if (index < 0) { - index = stack.length + index; - } - - log(stack[index]); - return stack[index]; - } - - log(stack.join(' ')); - - return stack; -} -exports.dirs = wrap("dirs", _dirs); - -//@ -//@ ### pushd([options,] [dir | '-N' | '+N']) -//@ -//@ Available options: -//@ -//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. -//@ -//@ Arguments: -//@ -//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. -//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ // process.cwd() === '/usr' -//@ pushd('/etc'); // Returns /etc /usr -//@ pushd('+1'); // Returns /usr /etc -//@ ``` -//@ -//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. -function _pushd(options, dir) { - if (_isStackIndex(options)) { - dir = options; - options = ''; - } - - options = parseOptions(options, { - 'n' : 'no-cd' - }); - - var dirs = _actualDirStack(); - - if (dir === '+0') { - return dirs; // +0 is a noop - } else if (!dir) { - if (dirs.length > 1) { - dirs = dirs.splice(1, 1).concat(dirs); - } else { - return error('no other directory'); - } - } else if (_isStackIndex(dir)) { - var n = _parseStackIndex(dir); - dirs = dirs.slice(n).concat(dirs.slice(0, n)); - } else { - if (options['no-cd']) { - dirs.splice(1, 0, dir); - } else { - dirs.unshift(dir); - } - } - - if (options['no-cd']) { - dirs = dirs.slice(1); - } else { - dir = path.resolve(dirs.shift()); - _cd('', dir); - } - - _dirStack = dirs; - return _dirs(''); -} -exports.pushd = wrap('pushd', _pushd); - -//@ -//@ ### popd([options,] ['-N' | '+N']) -//@ -//@ Available options: -//@ -//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. -//@ -//@ Arguments: -//@ -//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. -//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ echo(process.cwd()); // '/usr' -//@ pushd('/etc'); // '/etc /usr' -//@ echo(process.cwd()); // '/etc' -//@ popd(); // '/usr' -//@ echo(process.cwd()); // '/usr' -//@ ``` -//@ -//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. -function _popd(options, index) { - if (_isStackIndex(options)) { - index = options; - options = ''; - } - - options = parseOptions(options, { - 'n' : 'no-cd' - }); - - if (!_dirStack.length) { - return error('directory stack empty'); - } - - index = _parseStackIndex(index || '+0'); - - if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { - index = index > 0 ? index - 1 : index; - _dirStack.splice(index, 1); - } else { - var dir = path.resolve(_dirStack.shift()); - _cd('', dir); - } - - return _dirs(''); -} -exports.popd = wrap("popd", _popd); - -//@ -//@ ### exit(code) -//@ Exits the current process with the given exit code. -exports.exit = process.exit; - -//@ -//@ ### env['VAR_NAME'] -//@ Object containing environment variables (both getter and setter). Shortcut to process.env. -exports.env = process.env; - -//@ -//@ ### exec(command [, options] [, callback]) -//@ Available options (all `false` by default): -//@ -//@ + `async`: Asynchronous execution. Defaults to true if a callback is provided. -//@ + `silent`: Do not echo program output to console. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var version = exec('node --version', {silent:true}).output; -//@ -//@ var child = exec('some_long_running_process', {async:true}); -//@ child.stdout.on('data', function(data) { -//@ /* ... do something with data ... */ -//@ }); -//@ -//@ exec('some_long_running_process', function(code, output) { -//@ console.log('Exit code:', code); -//@ console.log('Program output:', output); -//@ }); -//@ ``` -//@ -//@ Executes the given `command` _synchronously_, unless otherwise specified. -//@ When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's -//@ `output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and -//@ the `callback` gets the arguments `(code, output)`. -//@ -//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as -//@ the current synchronous implementation uses a lot of CPU. This should be getting -//@ fixed soon. -function _exec(command, options, callback) { - if (!command) - error('must specify command'); - - // Callback is defined instead of options. - if (typeof options === 'function') { - callback = options; - options = { async: true }; - } - - // Callback is defined with options. - if (typeof options === 'object' && typeof callback === 'function') { - options.async = true; - } - - options = extend({ - silent: config.silent, - async: false - }, options); - - if (options.async) - return execAsync(command, options, callback); - else - return execSync(command, options); -} -exports.exec = wrap('exec', _exec, {notUnix:true}); - -var PERMS = (function (base) { - return { - OTHER_EXEC : base.EXEC, - OTHER_WRITE : base.WRITE, - OTHER_READ : base.READ, - - GROUP_EXEC : base.EXEC << 3, - GROUP_WRITE : base.WRITE << 3, - GROUP_READ : base.READ << 3, - - OWNER_EXEC : base.EXEC << 6, - OWNER_WRITE : base.WRITE << 6, - OWNER_READ : base.READ << 6, - - // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is - // the preferred way, else a jshint warning is thrown. - STICKY : parseInt('01000', 8), - SETGID : parseInt('02000', 8), - SETUID : parseInt('04000', 8), - - TYPE_MASK : parseInt('0770000', 8) - }; -})({ - EXEC : 1, - WRITE : 2, - READ : 4 -}); - - -//@ -//@ ### chmod(octal_mode || octal_string, file) -//@ ### chmod(symbolic_mode, file) -//@ -//@ Available options: -//@ -//@ + `-v`: output a diagnostic for every file processed//@ -//@ + `-c`: like verbose but report only when a change is made//@ -//@ + `-R`: change files and directories recursively//@ -//@ -//@ Examples: -//@ -//@ ```javascript -//@ chmod(755, '/Users/brandon'); -//@ chmod('755', '/Users/brandon'); // same as above -//@ chmod('u+x', '/Users/brandon'); -//@ ``` -//@ -//@ Alters the permissions of a file or directory by either specifying the -//@ absolute permissions in octal form or expressing the changes in symbols. -//@ This command tries to mimic the POSIX behavior as much as possible. -//@ Notable exceptions: -//@ -//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is -//@ given to the umask. -//@ + There is no "quiet" option since default behavior is to run silent. -function _chmod(options, mode, filePattern) { - if (!filePattern) { - if (options.length > 0 && options.charAt(0) === '-') { - // Special case where the specified file permissions started with - to subtract perms, which - // get picked up by the option parser as command flags. - // If we are down by one argument and options starts with -, shift everything over. - filePattern = mode; - mode = options; - options = ''; - } - else { - error('You must specify a file.'); - } - } - - options = parseOptions(options, { - 'R': 'recursive', - 'c': 'changes', - 'v': 'verbose' - }); - - if (typeof filePattern === 'string') { - filePattern = [ filePattern ]; - } - - var files; - - if (options.recursive) { - files = []; - expand(filePattern).forEach(function addFile(expandedFile) { - var stat = fs.lstatSync(expandedFile); - - if (!stat.isSymbolicLink()) { - files.push(expandedFile); - - if (stat.isDirectory()) { // intentionally does not follow symlinks. - fs.readdirSync(expandedFile).forEach(function (child) { - addFile(expandedFile + '/' + child); - }); - } - } - }); - } - else { - files = expand(filePattern); - } - - files.forEach(function innerChmod(file) { - file = path.resolve(file); - if (!fs.existsSync(file)) { - error('File not found: ' + file); - } - - // When recursing, don't follow symlinks. - if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { - return; - } - - var perms = fs.statSync(file).mode; - var type = perms & PERMS.TYPE_MASK; - - var newPerms = perms; - - if (isNaN(parseInt(mode, 8))) { - // parse options - mode.split(',').forEach(function (symbolicMode) { - /*jshint regexdash:true */ - var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; - var matches = pattern.exec(symbolicMode); - - if (matches) { - var applyTo = matches[1]; - var operator = matches[2]; - var change = matches[3]; - - var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; - var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; - var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; - - var changeRead = change.indexOf('r') != -1; - var changeWrite = change.indexOf('w') != -1; - var changeExec = change.indexOf('x') != -1; - var changeSticky = change.indexOf('t') != -1; - var changeSetuid = change.indexOf('s') != -1; - - var mask = 0; - if (changeOwner) { - mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); - } - if (changeGroup) { - mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); - } - if (changeOther) { - mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); - } - - // Sticky bit is special - it's not tied to user, group or other. - if (changeSticky) { - mask |= PERMS.STICKY; - } - - switch (operator) { - case '+': - newPerms |= mask; - break; - - case '-': - newPerms &= ~mask; - break; - - case '=': - newPerms = type + mask; - - // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. - if (fs.statSync(file).isDirectory()) { - newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; - } - break; - } - - if (options.verbose) { - log(file + ' -> ' + newPerms.toString(8)); - } - - if (perms != newPerms) { - if (!options.verbose && options.changes) { - log(file + ' -> ' + newPerms.toString(8)); - } - fs.chmodSync(file, newPerms); - } - } - else { - error('Invalid symbolic mode change: ' + symbolicMode); - } - }); - } - else { - // they gave us a full number - newPerms = type + parseInt(mode, 8); - - // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. - if (fs.statSync(file).isDirectory()) { - newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; - } - - fs.chmodSync(file, newPerms); - } - }); -} -exports.chmod = wrap('chmod', _chmod); - - -//@ -//@ ## Configuration -//@ - - - -exports.config = config; - -//@ -//@ ### config.silent -//@ Example: -//@ -//@ ```javascript -//@ var silentState = config.silent; // save old silent state -//@ config.silent = true; -//@ /* ... */ -//@ config.silent = silentState; // restore old silent state -//@ ``` -//@ -//@ Suppresses all command output if `true`, except for `echo()` calls. -//@ Default is `false`. - -//@ -//@ ### config.fatal -//@ Example: -//@ -//@ ```javascript -//@ config.fatal = true; -//@ cp('this_file_does_not_exist', '/dev/null'); // dies here -//@ /* more commands... */ -//@ ``` -//@ -//@ If `true` the script will die on errors. Default is `false`. - - - - -//@ -//@ ## Non-Unix commands -//@ - - - - - - -//@ -//@ ### tempdir() -//@ Searches and returns string containing a writeable, platform-dependent temporary directory. -//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). -exports.tempdir = wrap('tempdir', tempDir); - - -//@ -//@ ### error() -//@ Tests if error occurred in the last command. Returns `null` if no error occurred, -//@ otherwise returns string explaining the error -exports.error = function() { - return state.error; -}; - - - - - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -// Auxiliary functions (internal use only) -// - -function log() { - if (!config.silent) - console.log.apply(this, arguments); -} - -function deprecate(what, msg) { - console.log('*** ShellJS.'+what+': This function is deprecated.', msg); -} - -function write(msg) { - if (!config.silent) - process.stdout.write(msg); -} - -// Shows error message. Throws unless _continue or config.fatal are true -function error(msg, _continue) { - if (state.error === null) - state.error = ''; - state.error += state.currentCmd + ': ' + msg + '\n'; - - log(state.error); - - if (config.fatal) - process.exit(1); - - if (!_continue) - throw ''; -} - -// Returns {'alice': true, 'bob': false} when passed: -// parseOptions('-a', {'a':'alice', 'b':'bob'}); -function parseOptions(str, map) { - if (!map) - error('parseOptions() internal error: no map given'); - - // All options are false by default - var options = {}; - for (var letter in map) - options[map[letter]] = false; - - if (!str) - return options; // defaults - - if (typeof str !== 'string') - error('parseOptions() internal error: wrong str'); - - // e.g. match[1] = 'Rf' for str = '-Rf' - var match = str.match(/^\-(.+)/); - if (!match) - return options; - - // e.g. chars = ['R', 'f'] - var chars = match[1].split(''); - - chars.forEach(function(c) { - if (c in map) - options[map[c]] = true; - else - error('option not recognized: '+c); - }); - - return options; -} - -// Common wrapper for all Unix-like commands -function wrap(cmd, fn, options) { - return function() { - var retValue = null; - - state.currentCmd = cmd; - state.error = null; - - try { - var args = [].slice.call(arguments, 0); - - if (options && options.notUnix) { - retValue = fn.apply(this, args); - } else { - if (args.length === 0 || typeof args[0] !== 'string' || args[0][0] !== '-') - args.unshift(''); // only add dummy option if '-option' not already present - retValue = fn.apply(this, args); - } - } catch (e) { - if (!state.error) { - // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug... - console.log('shell.js: internal error'); - console.log(e.stack || e); - process.exit(1); - } - if (config.fatal) - throw e; - } - - state.currentCmd = 'shell.js'; - return retValue; - }; -} // wrap - -// Buffered file copy, synchronous -// (Using readFileSync() + writeFileSync() could easily cause a memory overflow -// with large files) -function copyFileSync(srcFile, destFile) { - if (!fs.existsSync(srcFile)) - error('copyFileSync: no such file or directory: ' + srcFile); - - var BUF_LENGTH = 64*1024, - buf = new Buffer(BUF_LENGTH), - bytesRead = BUF_LENGTH, - pos = 0, - fdr = null, - fdw = null; - - try { - fdr = fs.openSync(srcFile, 'r'); - } catch(e) { - error('copyFileSync: could not read src file ('+srcFile+')'); - } - - try { - fdw = fs.openSync(destFile, 'w'); - } catch(e) { - error('copyFileSync: could not write to dest file (code='+e.code+'):'+destFile); - } - - while (bytesRead === BUF_LENGTH) { - bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos); - fs.writeSync(fdw, buf, 0, bytesRead); - pos += bytesRead; - } - - fs.closeSync(fdr); - fs.closeSync(fdw); -} - -// Recursively copies 'sourceDir' into 'destDir' -// Adapted from https://github.com/ryanmcgrath/wrench-js -// -// Copyright (c) 2010 Ryan McGrath -// Copyright (c) 2012 Artur Adib -// -// Licensed under the MIT License -// http://www.opensource.org/licenses/mit-license.php -function cpdirSyncRecursive(sourceDir, destDir, opts) { - if (!opts) opts = {}; - - /* Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */ - var checkDir = fs.statSync(sourceDir); - try { - fs.mkdirSync(destDir, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') throw e; - } - - var files = fs.readdirSync(sourceDir); - - for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); - - if (currFile.isDirectory()) { - /* recursion this thing right on back. */ - cpdirSyncRecursive(sourceDir + "/" + files[i], destDir + "/" + files[i], opts); - } else if (currFile.isSymbolicLink()) { - var symlinkFull = fs.readlinkSync(sourceDir + "/" + files[i]); - fs.symlinkSync(symlinkFull, destDir + "/" + files[i]); - } else { - /* At this point, we've hit a file actually worth copying... so copy it on over. */ - if (fs.existsSync(destDir + "/" + files[i]) && !opts.force) { - log('skipping existing file: ' + files[i]); - } else { - copyFileSync(sourceDir + "/" + files[i], destDir + "/" + files[i]); - } - } - - } // for files -} // cpdirSyncRecursive - -// Recursively removes 'dir' -// Adapted from https://github.com/ryanmcgrath/wrench-js -// -// Copyright (c) 2010 Ryan McGrath -// Copyright (c) 2012 Artur Adib -// -// Licensed under the MIT License -// http://www.opensource.org/licenses/mit-license.php -function rmdirSyncRecursive(dir, force) { - var files; - - files = fs.readdirSync(dir); - - // Loop through and delete everything in the sub-tree after checking it - for(var i = 0; i < files.length; i++) { - var file = dir + "/" + files[i], - currFile = fs.lstatSync(file); - - if(currFile.isDirectory()) { // Recursive function back to the beginning - rmdirSyncRecursive(file, force); - } - - else if(currFile.isSymbolicLink()) { // Unlink symlinks - if (force || isWriteable(file)) { - try { - _unlinkSync(file); - } catch (e) { - error('could not remove file (code '+e.code+'): ' + file, true); - } - } - } - - else // Assume it's a file - perhaps a try/catch belongs here? - if (force || isWriteable(file)) { - try { - _unlinkSync(file); - } catch (e) { - error('could not remove file (code '+e.code+'): ' + file, true); - } - } - } - - // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. - // Huzzah for the shopkeep. - - var result; - try { - result = fs.rmdirSync(dir); - } catch(e) { - error('could not remove directory (code '+e.code+'): ' + dir, true); - } - - return result; -} // rmdirSyncRecursive - -// Recursively creates 'dir' -function mkdirSyncRecursive(dir) { - var baseDir = path.dirname(dir); - - // Base dir exists, no recursion necessary - if (fs.existsSync(baseDir)) { - fs.mkdirSync(dir, parseInt('0777', 8)); - return; - } - - // Base dir does not exist, go recursive - mkdirSyncRecursive(baseDir); - - // Base dir created, can create dir - fs.mkdirSync(dir, parseInt('0777', 8)); -} - -// e.g. 'shelljs_a5f185d0443ca...' -function randomFileName() { - function randomHash(count) { - if (count === 1) - return parseInt(16*Math.random(), 10).toString(16); - else { - var hash = ''; - for (var i=0; i&1'; // works on both win/unix - - var script = - "var child = require('child_process')," + - " fs = require('fs');" + - "child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {" + - " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');" + - "});"; - - if (fs.existsSync(scriptFile)) _unlinkSync(scriptFile); - if (fs.existsSync(stdoutFile)) _unlinkSync(stdoutFile); - if (fs.existsSync(codeFile)) _unlinkSync(codeFile); - - fs.writeFileSync(scriptFile, script); - child.exec('"'+process.execPath+'" '+scriptFile, { - env: process.env, - cwd: exports.pwd(), - maxBuffer: 20*1024*1024 - }); - - // The wait loop - // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage - // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing - // CPU usage, though apparently not so much on Windows) - while (!fs.existsSync(codeFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - while (!fs.existsSync(stdoutFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - - // At this point codeFile exists, but it's not necessarily flushed yet. - // Keep reading it until it is. - var code = parseInt('', 10); - while (isNaN(code)) { - code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); - } - - var stdout = fs.readFileSync(stdoutFile, 'utf8'); - - // No biggie if we can't erase the files now -- they're in a temp dir anyway - try { _unlinkSync(scriptFile); } catch(e) {} - try { _unlinkSync(stdoutFile); } catch(e) {} - try { _unlinkSync(codeFile); } catch(e) {} - try { _unlinkSync(sleepFile); } catch(e) {} - - // True if successful, false if not - var obj = { - code: code, - output: stdout - }; - return obj; -} // execSync() - -// Expands wildcards with matching file names. For a given array of file names 'list', returns -// another array containing all file names as per ls(list[i]). -// For example: -// expand(['file*.js']) = ['file1.js', 'file2.js', ...] -// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) -function expand(list) { - var expanded = []; - list.forEach(function(listEl) { - // Wildcard present? - if (listEl.search(/\*/) > -1) { - _ls('', listEl).forEach(function(file) { - expanded.push(file); - }); - } else { - expanded.push(listEl); - } - }); - return expanded; -} - -// Cross-platform method for splitting environment PATH variables -function splitPath(p) { - if (!p) - return []; - - if (platform === 'win') - return p.split(';'); - else - return p.split(':'); -} - -// extend(target_obj, source_obj1 [, source_obj2 ...]) -// Shallow extend, e.g.: -// extend({A:1}, {b:2}, {c:3}) returns {A:1, b:2, c:3} -function extend(target) { - var sources = [].slice.call(arguments, 1); - sources.forEach(function(source) { - for (var key in source) - target[key] = source[key]; - }); - - return target; -} - -// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. -// file can be unlinked even if it's read-only, see joyent/node#3006 -function _unlinkSync(file) { - try { - fs.unlinkSync(file); - } catch(e) { - // Try to override file permission - if (e.code === 'EPERM') { - fs.chmodSync(file, '0666'); - fs.unlinkSync(file); - } else { - throw e; - } - } -} - -// Hack to determine if file has write permissions for current user -// Avoids having to check user, group, etc, but it's probably slow -function isWriteable(file) { - var writePermission = true; - try { - var __fd = fs.openSync(file, 'a'); - fs.closeSync(__fd); - } catch(e) { - writePermission = false; - } - - return writePermission; -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/.npmignore b/deploy/core/node_modules/jshint/node_modules/shelljs/test/.npmignore deleted file mode 100644 index a1632ab58..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -tmp/ - diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/cat.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/cat.js deleted file mode 100644 index d0d9ddb04..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/cat.js +++ /dev/null @@ -1,57 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// save current dir -var cur = shell.pwd(); - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.cat(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.cat('/adsfasdf'); // file does not exist -assert.ok(shell.error()); - -// -// Valids -// - -// simple -var result = shell.cat('resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'test1'); - -// multiple files -var result = shell.cat('resources/file2', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'test2\ntest1'); - -// multiple files, array syntax -var result = shell.cat(['resources/file2', 'resources/file1']); -assert.equal(shell.error(), null); -assert.equal(result, 'test2\ntest1'); - -var result = shell.cat('resources/file*.txt'); -assert.equal(shell.error(), null); -assert.ok(result.search('test1') > -1); // file order might be random -assert.ok(result.search('test2') > -1); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/cd.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/cd.js deleted file mode 100644 index e6f6c387d..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/cd.js +++ /dev/null @@ -1,64 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// save current dir -var cur = shell.pwd(); - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.cd(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.cd('/adsfasdf'); // dir does not exist -assert.ok(shell.error()); - -assert.equal(fs.existsSync('resources/file1'), true); // sanity check -shell.cd('resources/file1'); // file, not dir -assert.ok(shell.error()); - -// -// Valids -// - -shell.cd(cur); -shell.cd('tmp'); -assert.equal(shell.error(), null); -assert.equal(path.basename(process.cwd()), 'tmp'); - -shell.cd(cur); -shell.cd('/'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), path.resolve('/')); - -// cd + other commands - -shell.cd(cur); -shell.rm('-f', 'tmp/*'); -assert.equal(fs.existsSync('tmp/file1'), false); -shell.cd('resources'); -assert.equal(shell.error(), null); -shell.cp('file1', '../tmp'); -assert.equal(shell.error(), null); -shell.cd('../tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), true); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/chmod.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/chmod.js deleted file mode 100644 index b31e25e0b..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/chmod.js +++ /dev/null @@ -1,81 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -shell.config.silent = true; - -// -// Invalids -// - -shell.chmod('blah'); // missing args -assert.ok(shell.error()); -shell.chmod('893', 'resources/chmod'); // invalid permissions - mode must be in octal -assert.ok(shell.error()); - -// -// Valids -// - -// Test files - the bitmasking is to ignore the upper bits. -shell.chmod('755', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('755', 8)); -shell.chmod('644', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); - -shell.chmod('o+x', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('007', 8), parseInt('005', 8)); -shell.chmod('644', 'resources/chmod/file1'); - -shell.chmod('+x', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('755', 8)); -shell.chmod('644', 'resources/chmod/file1'); - -// Test setuid -shell.chmod('u+s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('4000', 8), parseInt('4000', 8)); -shell.chmod('u-s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); - -// according to POSIX standards at http://linux.die.net/man/1/chmod, -// setuid is never cleared from a directory unless explicitly asked for. -shell.chmod('u+s', 'resources/chmod/c'); -shell.chmod('755', 'resources/chmod/c'); -assert.equal(fs.statSync('resources/chmod/c').mode & parseInt('4000', 8), parseInt('4000', 8)); -shell.chmod('u-s', 'resources/chmod/c'); - -// Test setgid -shell.chmod('g+s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('2000', 8), parseInt('2000', 8)); -shell.chmod('g-s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); - -// Test sticky bit -shell.chmod('+t', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('1000', 8), parseInt('1000', 8)); -shell.chmod('-t', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('1000', 8), 0); - -// Test directories -shell.chmod('a-w', 'resources/chmod/b/a/b'); -assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('555', 8)); -shell.chmod('755', 'resources/chmod/b/a/b'); - -// Test recursion -shell.chmod('-R', 'a+w', 'resources/chmod/b'); -assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('777', 8)); -shell.chmod('-R', '755', 'resources/chmod/b'); -assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('755', 8)); - -// Test symbolic links w/ recursion - WARNING: *nix only -fs.symlinkSync('resources/chmod/b/a', 'resources/chmod/a/b/c/link', 'dir'); -shell.chmod('-R', 'u-w', 'resources/chmod/a/b'); -assert.equal(fs.statSync('resources/chmod/a/b/c').mode & parseInt('700', 8), parseInt('500', 8)); -assert.equal(fs.statSync('resources/chmod/b/a').mode & parseInt('700', 8), parseInt('700', 8)); -shell.chmod('-R', 'u+w', 'resources/chmod/a/b'); -fs.unlinkSync('resources/chmod/a/b/c/link'); - -shell.exit(123); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/config.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/config.js deleted file mode 100644 index bd81ec0cb..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/config.js +++ /dev/null @@ -1,50 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - child = require('child_process'); - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// -// config.silent -// - -assert.equal(shell.config.silent, false); // default - -shell.config.silent = true; -assert.equal(shell.config.silent, true); - -shell.config.silent = false; -assert.equal(shell.config.silent, false); - -// -// config.fatal -// - -assert.equal(shell.config.fatal, false); // default - -// -// config.fatal = false -// -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; config.fatal=false; cp("this_file_doesnt_exist", "."); echo("got here");'; -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout.match('got here')); - - // - // config.fatal = true - // - shell.mkdir('-p', 'tmp'); - var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; config.fatal=true; cp("this_file_doesnt_exist", "."); echo("got here");'; - script.to(file); - child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(!stdout.match('got here')); - - shell.exit(123); - }); -}); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/cp.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/cp.js deleted file mode 100644 index 39b3ba9da..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/cp.js +++ /dev/null @@ -1,143 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.cp(); -assert.ok(shell.error()); - -shell.cp('file1'); -assert.ok(shell.error()); - -shell.cp('-f'); -assert.ok(shell.error()); - -shell.rm('-rf', 'tmp/*'); -shell.cp('-@', 'resources/file1', 'tmp/file1'); // option not supported, files OK -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), false); - -shell.cp('-Z', 'asdfasdf', 'tmp/file2'); // option not supported, files NOT OK -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file2'), false); - -shell.cp('asdfasdf', 'tmp'); // source does not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/asdfasdf'), false); - -shell.cp('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 2); -assert.equal(fs.existsSync('tmp/asdfasdf1'), false); -assert.equal(fs.existsSync('tmp/asdfasdf2'), false); - -shell.cp('asdfasdf1', 'asdfasdf2', 'resources/file1'); // too many sources (dest is file) -assert.ok(shell.error()); - -shell.cp('resources/file1', 'resources/file2'); // dest already exists -assert.ok(shell.error()); - -shell.cp('resources/file1', 'resources/file2', 'tmp/a_file'); // too many sources -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/a_file'), false); - -// -// Valids -// - -// simple - to dir -shell.cp('resources/file1', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); - -// simple - to file -shell.cp('resources/file2', 'tmp/file2'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file2'), true); - -// simple - file list -shell.rm('-rf', 'tmp/*'); -shell.cp('resources/file1', 'resources/file2', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); - -// simple - file list, array syntax -shell.rm('-rf', 'tmp/*'); -shell.cp(['resources/file1', 'resources/file2'], 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); - -shell.cp('resources/file2', 'tmp/file3'); -assert.equal(fs.existsSync('tmp/file3'), true); -shell.cp('-f', 'resources/file2', 'tmp/file3'); // file exists, but -f specified -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file3'), true); - -// wildcard -shell.rm('tmp/file1', 'tmp/file2'); -shell.cp('resources/file*', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); - -//recursive, nothing exists -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(shell.ls('-R', 'resources/cp') + '', shell.ls('-R', 'tmp/cp') + ''); - -//recursive, nothing exists, source ends in '/' (see Github issue #15) -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp/', 'tmp/'); -assert.equal(shell.error(), null); -assert.equal(shell.ls('-R', 'resources/cp') + '', shell.ls('-R', 'tmp') + ''); - -//recursive, everything exists, no force flag -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp', 'tmp'); -shell.cp('-R', 'resources/cp', 'tmp'); -assert.equal(shell.error(), null); // crash test only - -//recursive, everything exists, with force flag -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp', 'tmp'); -'changing things around'.to('tmp/cp/dir_a/z'); -assert.notEqual(shell.cat('resources/cp/dir_a/z'), shell.cat('tmp/cp/dir_a/z')); // before cp -shell.cp('-Rf', 'resources/cp', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(shell.cat('resources/cp/dir_a/z'), shell.cat('tmp/cp/dir_a/z')); // after cp - -//recursive, creates dest dir since it's only one level deep (see Github issue #44) -shell.rm('-rf', 'tmp/*'); -shell.cp('-r', 'resources/issue44/*', 'tmp/dir2'); -assert.equal(shell.error(), null); -assert.equal(shell.ls('-R', 'resources/issue44') + '', shell.ls('-R', 'tmp/dir2') + ''); -assert.equal(shell.cat('resources/issue44/main.js'), shell.cat('tmp/dir2/main.js')); - -//recursive, does *not* create dest dir since it's too deep (see Github issue #44) -shell.rm('-rf', 'tmp/*'); -shell.cp('-r', 'resources/issue44/*', 'tmp/dir2/dir3'); -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/dir2'), false); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/dirs.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/dirs.js deleted file mode 100644 index e9f11e6ca..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/dirs.js +++ /dev/null @@ -1,37 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(); - -shell.pushd('resources/pushd'); -shell.pushd('a'); - -var trail = [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]; - -assert.deepEqual(shell.dirs(), trail); - -// Single items -assert.equal(shell.dirs('+0'), trail[0]); -assert.equal(shell.dirs('+1'), trail[1]); -assert.equal(shell.dirs('+2'), trail[2]); -assert.equal(shell.dirs('-0'), trail[2]); -assert.equal(shell.dirs('-1'), trail[1]); -assert.equal(shell.dirs('-2'), trail[0]); - -// Clearing items -assert.deepEqual(shell.dirs('-c'), []); -assert(!shell.error()); - -shell.exit(123); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/echo.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/echo.js deleted file mode 100644 index 82faa51b1..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/echo.js +++ /dev/null @@ -1,50 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'), - child = require('child_process'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - - -// From here on we use child.exec() to intercept the stdout - - -// simple test with defaults -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); echo("-asdf", "111");'; // test '-' bug (see issue #20) -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout === '-asdf 111\n' || stdout === '-asdf 111\nundefined\n'); // 'undefined' for v0.4 - - // simple test with silent(true) - shell.mkdir('-p', 'tmp'); - var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; echo(555);'; - script.to(file); - child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout === '555\n' || stdout === '555\nundefined\n'); // 'undefined' for v0.4 - - theEnd(); - }); -}); - -function theEnd() { - shell.exit(123); -} diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/env.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/env.js deleted file mode 100644 index 0e041d6ad..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/env.js +++ /dev/null @@ -1,19 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'); - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -assert.equal(shell.env['PATH'], process.env['PATH']); - -shell.env['SHELLJS_TEST'] = 'hello world'; -assert.equal(shell.env['SHELLJS_TEST'], process.env['SHELLJS_TEST']); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/exec.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/exec.js deleted file mode 100644 index e72180811..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/exec.js +++ /dev/null @@ -1,109 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'), - util = require('util'), - child = require('child_process'); - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// -// Invalids -// - -shell.exec(); -assert.ok(shell.error()); - -var result = shell.exec('asdfasdf'); // could not find command -assert.ok(result.code > 0); - - -// -// Valids -// - -// -// sync -// - -// check if stdout goes to output -var result = shell.exec('node -e \"console.log(1234);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 - -// check if stderr goes to output -var result = shell.exec('node -e \"console.error(1234);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 - -// check if stdout + stderr go to output -var result = shell.exec('node -e \"console.error(1234); console.log(666);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n666\n' || result.output === '1234\n666\nundefined\n'); // 'undefined' for v0.4 - -// check exit code -var result = shell.exec('node -e \"process.exit(12);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 12); - -// interaction with cd -shell.cd('resources/external'); -var result = shell.exec('node node_script.js'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.equal(result.output, 'node_script_1234\n'); -shell.cd('../..'); - -// check quotes escaping -var result = shell.exec( util.format('node -e "console.log(%s);"', "\\\"\\'+\\'_\\'+\\'\\\"") ); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.equal(result.output, "'+'_'+'\n"); - -// -// async -// - -// no callback -var c = shell.exec('node -e \"console.log(1234)\"', {async:true}); -assert.equal(shell.error(), null); -assert.ok('stdout' in c, 'async exec returns child process object'); - -// -// callback as 2nd argument -// -shell.exec('node -e \"console.log(5678);\"', function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 - - // - // callback as 3rd argument - // - shell.exec('node -e \"console.log(5566);\"', {async:true}, function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5566\n' || output === '5566\nundefined\n'); // 'undefined' for v0.4 - - // - // callback as 3rd argument (slient:true) - // - shell.exec('node -e \"console.log(5678);\"', {silent:true}, function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 - - shell.exit(123); - - }); - - }); - -}); - -assert.equal(shell.error(), null); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/find.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/find.js deleted file mode 100644 index d375f8693..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/find.js +++ /dev/null @@ -1,56 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -var result = shell.find(); // no paths given -assert.ok(shell.error()); - -// -// Valids -// - -// current path -shell.cd('resources/find'); -var result = shell.find('.'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('.hidden') > -1, true); -assert.equal(result.indexOf('dir1/dir11/a_dir11') > -1, true); -assert.equal(result.length, 11); -shell.cd('../..'); - -// simple path -var result = shell.find('resources/find'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/.hidden') > -1, true); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.length, 11); - -// multiple paths - comma -var result = shell.find('resources/find/dir1', 'resources/find/dir2'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); -assert.equal(result.length, 6); - -// multiple paths - array -var result = shell.find(['resources/find/dir1', 'resources/find/dir2']); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); -assert.equal(result.length, 6); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/grep.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/grep.js deleted file mode 100644 index 71db9820a..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/grep.js +++ /dev/null @@ -1,59 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.grep(); -assert.ok(shell.error()); - -shell.grep(/asdf/g); // too few args -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.grep(/asdf/g, '/asdfasdf'); // no such file -assert.ok(shell.error()); - -// -// Valids -// - -var result = shell.grep('line', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result.split('\n').length - 1, 4); - -var result = shell.grep('-v', 'line', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result.split('\n').length - 1, 8); - -var result = shell.grep('line one', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result, 'This is line one\n'); - -// multiple files -var result = shell.grep(/test/, 'resources/file1.txt', 'resources/file2.txt'); -assert.equal(shell.error(), null); -assert.equal(result, 'test1\ntest2\n'); - -// multiple files, array syntax -var result = shell.grep(/test/, ['resources/file1.txt', 'resources/file2.txt']); -assert.equal(shell.error(), null); -assert.equal(result, 'test1\ntest2\n'); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/ls.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/ls.js deleted file mode 100644 index 5067b7dd9..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/ls.js +++ /dev/null @@ -1,202 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -var result = shell.ls('/asdfasdf'); // no such file or dir -assert.ok(shell.error()); -assert.equal(result.length, 0); - -// -// Valids -// - -var result = shell.ls(); -assert.equal(shell.error(), null); - -var result = shell.ls('/'); -assert.equal(shell.error(), null); - -// no args -shell.cd('resources/ls'); -var result = shell.ls(); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.length, 6); -shell.cd('../..'); - -// simple arg -var result = shell.ls('resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.length, 6); - -// no args, 'all' option -shell.cd('resources/ls'); -var result = shell.ls('-A'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('.hidden_file') > -1, true); -assert.equal(result.indexOf('.hidden_dir') > -1, true); -assert.equal(result.length, 8); -shell.cd('../..'); - -// no args, 'all' option -shell.cd('resources/ls'); -var result = shell.ls('-a'); // (deprecated) backwards compatibility test -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('.hidden_file') > -1, true); -assert.equal(result.indexOf('.hidden_dir') > -1, true); -assert.equal(result.length, 8); -shell.cd('../..'); - -// wildcard, simple -var result = shell.ls('resources/ls/*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/file1') > -1, true); -assert.equal(result.indexOf('resources/ls/file2') > -1, true); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir') > -1, true); -assert.equal(result.length, 6); - -// wildcard, hidden only -var result = shell.ls('resources/ls/.*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/.hidden_file') > -1, true); -assert.equal(result.indexOf('resources/ls/.hidden_dir') > -1, true); -assert.equal(result.length, 2); - -// wildcard, mid-file -var result = shell.ls('resources/ls/f*le*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 5); -assert.equal(result.indexOf('resources/ls/file1') > -1, true); -assert.equal(result.indexOf('resources/ls/file2') > -1, true); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); - -// wildcard, mid-file with dot (should escape dot for regex) -var result = shell.ls('resources/ls/f*le*.js'); -assert.equal(shell.error(), null); -assert.equal(result.length, 2); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); - -// wildcard, should not do partial matches -var result = shell.ls('resources/ls/*.j'); // shouldn't get .js -assert.equal(shell.error(), null); -assert.equal(result.length, 0); - -// wildcard, all files with extension -var result = shell.ls('resources/ls/*.*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 3); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); - -// wildcard, with additional path -var result = shell.ls('resources/ls/f*le*.js', 'resources/ls/a_dir'); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('b_dir') > -1, true); // no wildcard == no path prefix -assert.equal(result.indexOf('nada') > -1, true); // no wildcard == no path prefix - -// wildcard for both paths -var result = shell.ls('resources/ls/f*le*.js', 'resources/ls/a_dir/*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/nada') > -1, true); - -// wildcard for both paths, array -var result = shell.ls(['resources/ls/f*le*.js', 'resources/ls/a_dir/*']); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/nada') > -1, true); - -// recursive, no path -shell.cd('resources/ls'); -var result = shell.ls('-R'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); -shell.cd('../..'); - -// recusive, path given -var result = shell.ls('-R', 'resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); - -// recusive, path given - 'all' flag -var result = shell.ls('-RA', 'resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.indexOf('a_dir/.hidden_dir/nada') > -1, true); -assert.equal(result.length, 14); - -// recursive, wildcard -var result = shell.ls('-R', 'resources/ls/*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/a_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/make.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/make.js deleted file mode 100644 index 3edbd8ce9..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/make.js +++ /dev/null @@ -1,20 +0,0 @@ -var shell = require('..'), - child = require('child_process'), - assert = require('assert'); - -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../make.js\');' + - 'target.all=function(){' + - ' echo("first"); '+ - ' cp("this_file_doesnt_exist", ".");' + - ' echo("second");' + - '}'; - -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout.match('first')); - assert.ok(!stdout.match('second')); // Make should die on errors, so this should never get echoed - - shell.exit(123); -}); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/mkdir.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/mkdir.js deleted file mode 100644 index 1f93422ad..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/mkdir.js +++ /dev/null @@ -1,79 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.mkdir(); -assert.ok(shell.error()); - -var mtime = fs.statSync('tmp').mtime.toString(); -shell.mkdir('tmp'); // dir already exists -assert.ok(shell.error()); -assert.equal(fs.statSync('tmp').mtime.toString(), mtime); // didn't mess with dir - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.mkdir('/asdfasdf/asdfasdf'); // root path does not exist -assert.ok(shell.error()); -assert.equal(fs.existsSync('/asdfasdf'), false); - -// -// Valids -// - -assert.equal(fs.existsSync('tmp/t1'), false); -shell.mkdir('tmp/t1'); // simple dir -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/t1'), true); - -assert.equal(fs.existsSync('tmp/t2'), false); -assert.equal(fs.existsSync('tmp/t3'), false); -shell.mkdir('tmp/t2', 'tmp/t3'); // multiple dirs -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/t2'), true); -assert.equal(fs.existsSync('tmp/t3'), true); - -assert.equal(fs.existsSync('tmp/t1'), true); -assert.equal(fs.existsSync('tmp/t4'), false); -shell.mkdir('tmp/t1', 'tmp/t4'); // one dir exists, one doesn't -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/t1'), true); -assert.equal(fs.existsSync('tmp/t4'), true); - -assert.equal(fs.existsSync('tmp/a'), false); -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', 'tmp/a'); // revert - -// multiple dirs -shell.mkdir('-p', 'tmp/zzza', 'tmp/zzzb', 'tmp/zzzc'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/zzza'), true); -assert.equal(fs.existsSync('tmp/zzzb'), true); -assert.equal(fs.existsSync('tmp/zzzc'), true); - -// multiple dirs, array syntax -shell.mkdir('-p', ['tmp/yyya', 'tmp/yyyb', 'tmp/yyyc']); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/yyya'), true); -assert.equal(fs.existsSync('tmp/yyyb'), true); -assert.equal(fs.existsSync('tmp/yyyc'), true); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/mv.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/mv.js deleted file mode 100644 index 89bca91ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/mv.js +++ /dev/null @@ -1,130 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// Prepare tmp/ -shell.cp('resources/*', 'tmp'); - -// -// Invalids -// - -shell.mv(); -assert.ok(shell.error()); - -shell.mv('file1'); -assert.ok(shell.error()); - -shell.mv('-f'); -assert.ok(shell.error()); - -shell.mv('-Z', 'tmp/file1', 'tmp/file1'); // option not supported -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), true); - -shell.mv('asdfasdf', 'tmp'); // source does not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/asdfasdf'), false); - -shell.mv('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 2); -assert.equal(fs.existsSync('tmp/asdfasdf1'), false); -assert.equal(fs.existsSync('tmp/asdfasdf2'), false); - -shell.mv('asdfasdf1', 'asdfasdf2', 'tmp/file1'); // too many sources (dest is file) -assert.ok(shell.error()); - -shell.mv('tmp/file1', 'tmp/file2'); // dest already exists -assert.ok(shell.error()); - -shell.mv('tmp/file1', 'tmp/file2', 'tmp/a_file'); // too many sources (exist, but dest is file) -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/a_file'), false); - -shell.mv('tmp/file*', 'tmp/file1'); // can't use wildcard when dest is file -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); -assert.equal(fs.existsSync('tmp/file1.js'), true); -assert.equal(fs.existsSync('tmp/file2.js'), true); - -// -// Valids -// - -shell.cd('tmp'); - -// handles self OK -shell.mkdir('tmp2'); -shell.mv('*', 'tmp2'); // has to handle self (tmp2 --> tmp2) without throwing error -assert.ok(shell.error()); // there's an error, but not fatal -assert.equal(fs.existsSync('tmp2/file1'), true); // moved OK -shell.mv('tmp2/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); // moved OK - -shell.mv('file1', 'file3'); // one source -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file3'), true); -shell.mv('file3', 'file1'); // revert -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), true); - -// two sources -shell.rm('-rf', 't'); -shell.mkdir('-p', 't'); -shell.mv('file1', 'file2', 't'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), false); -assert.equal(fs.existsSync('t/file1'), true); -assert.equal(fs.existsSync('t/file2'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); -assert.equal(fs.existsSync('file2'), true); - -// two sources, array style -shell.rm('-rf', 't'); -shell.mkdir('-p', 't'); -shell.mv(['file1', 'file2'], 't'); // two sources -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), false); -assert.equal(fs.existsSync('t/file1'), true); -assert.equal(fs.existsSync('t/file2'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); -assert.equal(fs.existsSync('file2'), true); - -shell.mv('file*.js', 't'); // wildcard -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1.js'), false); -assert.equal(fs.existsSync('file2.js'), false); -assert.equal(fs.existsSync('t/file1.js'), true); -assert.equal(fs.existsSync('t/file2.js'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1.js'), true); -assert.equal(fs.existsSync('file2.js'), true); - -shell.mv('-f', 'file1', 'file2'); // dest exists, but -f given -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), true); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/popd.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/popd.js deleted file mode 100644 index fd795332a..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/popd.js +++ /dev/null @@ -1,118 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(), trail; - -function reset() { - shell.dirs('-c'); - shell.cd(root); -} - -// Valid -shell.pushd('resources/pushd'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -shell.pushd('resources/pushd'); -shell.pushd('a'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -shell.pushd('b'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -shell.pushd('b'); -shell.pushd('c'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 1); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -// Valid by index -shell.pushd('resources/pushd'); -trail = shell.popd('+0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -shell.pushd('resources/pushd'); -trail = shell.popd('+1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-n'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -// Invalid -trail = shell.popd(); -assert.ok(shell.error('popd: directory stack empty\n')); - -// Test that the root dir is not stored -shell.cd('resources/pushd'); -shell.pushd('b'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(trail[0], path.resolve(root, 'resources/pushd')); -assert.equal(process.cwd(), trail[0]); -shell.popd(); -assert.ok(shell.error(), null); - -shell.cd(root); - -shell.exit(123); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/pushd.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/pushd.js deleted file mode 100644 index 32089dc2c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/pushd.js +++ /dev/null @@ -1,228 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(), trail; - -function reset() { - shell.dirs('-c'); - shell.cd(root); -} - -// Push valid directories -trail = shell.pushd('resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('a'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('../b'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('c'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push stuff around with positive indices -trail = shell.pushd('+0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('+1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c') -]); - -trail = shell.pushd('+2'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a') -]); - -trail = shell.pushd('+3'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c') -]); - -trail = shell.pushd('+4'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push stuff around with negative indices -trail = shell.pushd('-0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd') -]); - -trail = shell.pushd('-1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b') -]); - -trail = shell.pushd('-2'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd') -]); - -trail = shell.pushd('-3'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('-4'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push without changing directory or resolving paths -reset(); trail = shell.pushd('-n', 'resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - 'resources/pushd' -]); - -trail = shell.pushd('-n', 'resources/pushd/a'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - 'resources/pushd/a', - 'resources/pushd' -]); - -// Push invalid directory -shell.pushd('does/not/exist'); -assert.equal(shell.error(), 'pushd: no such file or directory: ' + path.resolve('.', 'does/not/exist') + '\n'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments should swap top two directories when stack length is 2 -reset(); trail = shell.pushd('resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(trail.length, 2); -assert.equal(path.relative(root, trail[0]), 'resources/pushd'); -assert.equal(trail[1], root); -assert.equal(process.cwd(), trail[0]); -trail = shell.pushd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 2); -assert.equal(trail[0], root); -assert.equal(path.relative(root, trail[1]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments should swap top two directories when stack length is > 2 -trail = shell.pushd('resources/pushd/a'); -assert.equal(shell.error(), null); -assert.equal(trail.length, 3); -assert.equal(path.relative(root, trail[0]), 'resources/pushd/a'); -assert.equal(trail[1], root); -assert.equal(path.relative(root, trail[2]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -trail = shell.pushd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 3); -assert.equal(trail[0], root); -assert.equal(path.relative(root, trail[1]), 'resources/pushd/a'); -assert.equal(path.relative(root, trail[2]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments invalid when stack is empty -reset(); shell.pushd(); -assert.equal(shell.error(), 'pushd: no other directory\n'); - -shell.exit(123); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/pwd.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/pwd.js deleted file mode 100644 index d1f563f97..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/pwd.js +++ /dev/null @@ -1,28 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'); - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -var _pwd = shell.pwd(); -assert.equal(shell.error(), null); -assert.equal(_pwd, path.resolve('.')); - -shell.cd('tmp'); -var _pwd = shell.pwd(); -assert.equal(shell.error(), null); -assert.equal(path.basename(_pwd), 'tmp'); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/a.txt b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/a.txt deleted file mode 100644 index 356ce4912..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/a.txt +++ /dev/null @@ -1,11 +0,0 @@ -This is line one -This is line two - -This is line four -. -. -More content here -. -. - -This is line eleven diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore deleted file mode 100755 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 deleted file mode 100644 index db3f9ca6e..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 +++ /dev/null @@ -1,2 +0,0 @@ -this is test file 1 -default state should be 0644 (rw-r--r--) diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/a b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/a deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/a +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/b b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/b deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/b +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js deleted file mode 100755 index 3b2d24a06..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('node_script_1234'); - diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1 deleted file mode 100644 index f079749c4..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.js deleted file mode 100644 index 9daeafb98..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt deleted file mode 100644 index a5bce3fd2..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2 deleted file mode 100644 index d606037cb..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2 +++ /dev/null @@ -1 +0,0 @@ -test2 \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.js deleted file mode 100644 index 9daeafb98..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt deleted file mode 100644 index 180cf8328..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/a b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/a deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/a +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/b b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/b deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/b +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js deleted file mode 100644 index d800886d9..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js +++ /dev/null @@ -1 +0,0 @@ -123 \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada deleted file mode 100644 index 5fedf5729..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada +++ /dev/null @@ -1 +0,0 @@ -nada \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 deleted file mode 100644 index 9daeafb98..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js deleted file mode 100644 index 9daeafb98..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 deleted file mode 100644 index 9daeafb98..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js deleted file mode 100644 index 9daeafb98..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped deleted file mode 100644 index 8bd6648ed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy deleted file mode 100644 index 72e12a968..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy +++ /dev/null @@ -1 +0,0 @@ -meh \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy b/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy deleted file mode 100644 index 72e12a968..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy +++ /dev/null @@ -1 +0,0 @@ -meh \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/rm.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/rm.js deleted file mode 100644 index 61182a112..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/rm.js +++ /dev/null @@ -1,183 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.rm(); -assert.ok(shell.error()); - -shell.rm('asdfasdf'); // file does not exist -assert.ok(shell.error()); - -shell.rm('-f'); // no file -assert.ok(shell.error()); - -shell.rm('-@', 'resources/file1'); // invalid option -assert.ok(shell.error()); -assert.equal(fs.existsSync('resources/file1'), true); - -// -// Valids -// - -// file does not exist, but -f specified -shell.rm('-f', 'asdfasdf'); -assert.equal(shell.error(), null); - -// simple rm -shell.cp('-f', 'resources/file1', 'tmp/file1'); -assert.equal(fs.existsSync('tmp/file1'), true); -shell.rm('tmp/file1'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), false); - -// recursive dir removal - small-caps '-r' -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-rf', 'tmp/a'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// recursive dir removal - capital '-R' -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', 'tmp/a'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// recursive dir removal - absolute path -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', path.resolve('./tmp/a')); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// wildcard -shell.cp('-f', 'resources/file*', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); -assert.equal(fs.existsSync('tmp/file1.js'), true); -assert.equal(fs.existsSync('tmp/file2.js'), true); -shell.rm('tmp/file*'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), false); -assert.equal(fs.existsSync('tmp/file2'), false); -assert.equal(fs.existsSync('tmp/file1.js'), false); -assert.equal(fs.existsSync('tmp/file2.js'), false); - -// recursive dir removal -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', 'tmp/*'); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 1); -assert.equal(contents[0], '.hidden'); // shouldn't remove hiddden if no .* given - -// recursive dir removal -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', 'tmp/*', 'tmp/.*'); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 0); - -// recursive dir removal - array-syntax -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', ['tmp/*', 'tmp/.*']); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 0); - -// removal of a read-only file (unforced) -shell.mkdir('-p', 'tmp/readonly'); -'asdf'.to('tmp/readonly/file1'); -fs.chmodSync('tmp/readonly/file1', '0444'); // -r--r--r-- -shell.rm('tmp/readonly/file1'); -assert.equal(fs.existsSync('tmp/readonly/file1'), true); // bash's rm always asks before removing read-only files - // here we just assume "no" - -// removal of a read-only file (forced) -shell.mkdir('-p', 'tmp/readonly'); -'asdf'.to('tmp/readonly/file2'); -fs.chmodSync('tmp/readonly/file2', '0444'); // -r--r--r-- -shell.rm('-f', 'tmp/readonly/file2'); -assert.equal(fs.existsSync('tmp/readonly/file2'), false); - -// removal of a tree containing read-only files (unforced) -shell.mkdir('-p', 'tmp/tree2'); -'asdf'.to('tmp/tree2/file1'); -'asdf'.to('tmp/tree2/file2'); -fs.chmodSync('tmp/tree2/file1', '0444'); // -r--r--r-- -shell.rm('-r', 'tmp/tree2'); -assert.equal(fs.existsSync('tmp/tree2/file1'), true); -assert.equal(fs.existsSync('tmp/tree2/file2'), false); - -// removal of a tree containing read-only files (forced) -shell.mkdir('-p', 'tmp/tree'); -'asdf'.to('tmp/tree/file1'); -'asdf'.to('tmp/tree/file2'); -fs.chmodSync('tmp/tree/file1', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree'); -assert.equal(fs.existsSync('tmp/tree'), false); - -// removal of a sub-tree containing read-only and hidden files - rm('dir/*') -shell.mkdir('-p', 'tmp/tree3'); -shell.mkdir('-p', 'tmp/tree3/subtree'); -shell.mkdir('-p', 'tmp/tree3/.hidden'); -'asdf'.to('tmp/tree3/subtree/file'); -'asdf'.to('tmp/tree3/.hidden/file'); -'asdf'.to('tmp/tree3/file'); -fs.chmodSync('tmp/tree3/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree3/subtree/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree3/.hidden/file', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree3/*', 'tmp/tree3/.*'); // erase dir contents -assert.equal(shell.ls('tmp/tree3').length, 0); - -// removal of a sub-tree containing read-only and hidden files - rm('dir') -shell.mkdir('-p', 'tmp/tree4'); -shell.mkdir('-p', 'tmp/tree4/subtree'); -shell.mkdir('-p', 'tmp/tree4/.hidden'); -'asdf'.to('tmp/tree4/subtree/file'); -'asdf'.to('tmp/tree4/.hidden/file'); -'asdf'.to('tmp/tree4/file'); -fs.chmodSync('tmp/tree4/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree4/subtree/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree4/.hidden/file', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree4'); // erase dir contents -assert.equal(fs.existsSync('tmp/tree4'), false); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/sed.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/sed.js deleted file mode 100644 index d3d66b116..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/sed.js +++ /dev/null @@ -1,58 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.sed(); -assert.ok(shell.error()); - -shell.sed(/asdf/g); // too few args -assert.ok(shell.error()); - -shell.sed(/asdf/g, 'nada'); // too few args -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.sed(/asdf/g, 'nada', '/asdfasdf'); // no such file -assert.ok(shell.error()); - -// -// Valids -// - -shell.cp('-f', 'resources/file1', 'tmp/file1'); -var result = shell.sed('test1', 'hello', 'tmp/file1'); // search string -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); - -var result = shell.sed(/test1/, 'hello', 'tmp/file1'); // search regex -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); - -var result = shell.sed(/test1/, 1234, 'tmp/file1'); // numeric replacement -assert.equal(shell.error(), null); -assert.equal(result, '1234'); - -var result = shell.sed('-i', /test1/, 'hello', 'tmp/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); -assert.equal(shell.cat('tmp/file1'), 'hello'); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/tempdir.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/tempdir.js deleted file mode 100644 index 704ca5611..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/tempdir.js +++ /dev/null @@ -1,27 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -var tmp = shell.tempdir(); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync(tmp), true); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/test.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/test.js deleted file mode 100644 index a824edb32..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/test.js +++ /dev/null @@ -1,91 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -var result = shell.test(); // no expression given -assert.ok(shell.error()); - -var result = shell.test('asdf'); // bad expression -assert.ok(shell.error()); - -var result = shell.test('f', 'resources/file1'); // bad expression -assert.ok(shell.error()); - -var result = shell.test('-f'); // no file -assert.ok(shell.error()); - -// -// Valids -// - -//exists -var result = shell.test('-e', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-e', 'resources/404'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//directory -var result = shell.test('-d', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-f', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-L', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//file -var result = shell.test('-d', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-f', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//link -var result = shell.test('-d', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-f', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/badlink'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/404'); -assert.equal(shell.error(), null); -assert.equal(result, false);//false - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/to.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/to.js deleted file mode 100644 index 2e1253dbe..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/to.js +++ /dev/null @@ -1,39 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -'hello world'.to(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -'hello world'.to('/asdfasdf/file'); -assert.ok(shell.error()); - -// -// Valids -// - -'hello world'.to('tmp/to1'); -var result = shell.cat('tmp/to1'); -assert.equal(shell.error(), null); -assert.equal(result, 'hello world'); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/shelljs/test/which.js b/deploy/core/node_modules/jshint/node_modules/shelljs/test/which.js deleted file mode 100644 index ac9a04d50..000000000 --- a/deploy/core/node_modules/jshint/node_modules/shelljs/test/which.js +++ /dev/null @@ -1,38 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.which(); -assert.ok(shell.error()); - -var result = shell.which('asdfasdfasdfasdfasdf'); // what are the odds... -assert.equal(shell.error(), null); -assert.equal(result, null); - -// -// Valids -// - -var result = shell.which('node'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync(result), true); - -shell.exit(123); diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/.npmignore b/deploy/core/node_modules/jshint/node_modules/underscore/.npmignore deleted file mode 100644 index 4e5886dea..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -test/ -Rakefile -docs/ -raw/ diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/.travis.yml b/deploy/core/node_modules/jshint/node_modules/underscore/.travis.yml deleted file mode 100644 index 99dc7712c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 -notifications: - email: false diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/CNAME b/deploy/core/node_modules/jshint/node_modules/underscore/CNAME deleted file mode 100644 index a007e65c4..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/CNAME +++ /dev/null @@ -1 +0,0 @@ -underscorejs.org diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md b/deploy/core/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md deleted file mode 100644 index de5d5626f..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to contribute to Underscore.js - -* Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. - -* Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). - -* Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). - -* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/LICENSE b/deploy/core/node_modules/jshint/node_modules/underscore/LICENSE deleted file mode 100644 index 0d8dbe40b..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -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 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. diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/README.md b/deploy/core/node_modules/jshint/node_modules/underscore/README.md deleted file mode 100644 index b1f3e50a8..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/favicon.ico b/deploy/core/node_modules/jshint/node_modules/underscore/favicon.ico deleted file mode 100644 index 03049683875ee7207b4ee62241fc6977956723c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZQzU<5(|0R|w+!H~hqz#zuJz@P!dKp_SNAO?x!16vCj7#y|msTh?T4S~@R7;Yi( a|NnmmMkru{0(Aax^D{300E2>o91H*{%ptM> diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/index.html b/deploy/core/node_modules/jshint/node_modules/underscore/index.html deleted file mode 100644 index 7c96b69f8..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/index.html +++ /dev/null @@ -1,2467 +0,0 @@ - - - - - - - - - Underscore.js - - - - -

    - -
    - -

    - -

    - -

    - Underscore is a - utility-belt library for JavaScript that provides a lot of the - functional programming support that you would expect in - Prototype.js - (or Ruby), - but without extending any of the built-in JavaScript objects. It's the - tie to go along with jQuery's tux, - and Backbone.js's suspenders. -

    - -

    - Underscore provides 80-odd functions that support both the usual - functional suspects: map, select, invoke — - as well as more specialized helpers: function binding, javascript - templating, deep equality testing, and so on. It delegates to built-in - functions, if present, so modern browsers will use the - native implementations of forEach, map, reduce, - filter, every, some and indexOf. -

    - -

    - A complete Test & Benchmark Suite - is included for your perusal. -

    - -

    - You may also read through the annotated source code. -

    - -

    - The project is - hosted on GitHub. - You can report bugs and discuss features on the - issues page, - on Freenode in the #documentcloud channel, - or send tweets to @documentcloud. -

    - -

    - Underscore is an open-source component of DocumentCloud. -

    - -

    Downloads (Right-click, and use "Save As")

    - - - - - - - - - - - - - - - - - -
    Development Version (1.4.4)40kb, Uncompressed with Plentiful Comments
    Production Version (1.4.4)4kb, Minified and Gzipped
    Edge VersionUnreleased, current master, use at your own risk
    - -
    - -

    Collection Functions (Arrays or Objects)

    - -

    - each_.each(list, iterator, [context]) - Alias: forEach -
    - Iterates over a list of elements, yielding each in turn to an iterator - function. The iterator is bound to the context object, if one is - passed. Each invocation of iterator is called with three arguments: - (element, index, list). If list is a JavaScript object, iterator's - arguments will be (value, key, list). Delegates to the native - forEach function if it exists. -

    -
    -_.each([1, 2, 3], alert);
    -=> alerts each number in turn...
    -_.each({one : 1, two : 2, three : 3}, alert);
    -=> alerts each number value in turn...
    - -

    - map_.map(list, iterator, [context]) - Alias: collect -
    - Produces a new array of values by mapping each value in list - through a transformation function (iterator). If the native map method - exists, it will be used instead. If list is a JavaScript object, - iterator's arguments will be (value, key, list). -

    -
    -_.map([1, 2, 3], function(num){ return num * 3; });
    -=> [3, 6, 9]
    -_.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
    -=> [3, 6, 9]
    - -

    - reduce_.reduce(list, iterator, memo, [context]) - Aliases: inject, foldl -
    - Also known as inject and foldl, reduce boils down a - list of values into a single value. Memo is the initial state - of the reduction, and each successive step of it should be returned by - iterator. The iterator is passed four arguments: the memo, - then the value and index (or key) of the iteration, - and finally a reference to the entire list. -

    -
    -var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
    -=> 6
    -
    - -

    - reduceRight_.reduceRight(list, iterator, memo, [context]) - Alias: foldr -
    - The right-associative version of reduce. Delegates to the - JavaScript 1.8 version of reduceRight, if it exists. Foldr - is not as useful in JavaScript as it would be in a language with lazy - evaluation. -

    -
    -var list = [[0, 1], [2, 3], [4, 5]];
    -var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
    -=> [4, 5, 2, 3, 0, 1]
    -
    - -

    - find_.find(list, iterator, [context]) - Alias: detect -
    - Looks through each value in the list, returning the first one that - passes a truth test (iterator). The function returns as - soon as it finds an acceptable element, and doesn't traverse the - entire list. -

    -
    -var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
    -=> 2
    -
    - -

    - filter_.filter(list, iterator, [context]) - Alias: select -
    - Looks through each value in the list, returning an array of all - the values that pass a truth test (iterator). Delegates to the - native filter method, if it exists. -

    -
    -var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
    -=> [2, 4, 6]
    -
    - -

    - where_.where(list, properties) -
    - Looks through each value in the list, returning an array of all - the values that contain all of the key-value pairs listed in properties. -

    -
    -_.where(listOfPlays, {author: "Shakespeare", year: 1611});
    -=> [{title: "Cymbeline", author: "Shakespeare", year: 1611},
    -    {title: "The Tempest", author: "Shakespeare", year: 1611}]
    -
    - -

    - findWhere_.findWhere(list, properties) -
    - Looks through the list and returns the first value that matches - all of the key-value pairs listed in properties. -

    -
    -_.findWhere(publicServicePulitzers, {newsroom: "The New York Times"});
    -=> {year: 1918, newsroom: "The New York Times",
    -  reason: "For its public service in publishing in full so many official reports,
    -  documents and speeches by European statesmen relating to the progress and
    -  conduct of the war."}
    -
    - -

    - reject_.reject(list, iterator, [context]) -
    - Returns the values in list without the elements that the truth - test (iterator) passes. The opposite of filter. -

    -
    -var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
    -=> [1, 3, 5]
    -
    - -

    - every_.every(list, iterator, [context]) - Alias: all -
    - Returns true if all of the values in the list pass the iterator - truth test. Delegates to the native method every, if present. -

    -
    -_.every([true, 1, null, 'yes'], _.identity);
    -=> false
    -
    - -

    - some_.some(list, [iterator], [context]) - Alias: any -
    - Returns true if any of the values in the list pass the - iterator truth test. Short-circuits and stops traversing the list - if a true element is found. Delegates to the native method some, - if present. -

    -
    -_.some([null, 0, 'yes', false]);
    -=> true
    -
    - -

    - contains_.contains(list, value) - Alias: include -
    - Returns true if the value is present in the list. - Uses indexOf internally, if list is an Array. -

    -
    -_.contains([1, 2, 3], 3);
    -=> true
    -
    - -

    - invoke_.invoke(list, methodName, [*arguments]) -
    - Calls the method named by methodName on each value in the list. - Any extra arguments passed to invoke will be forwarded on to the - method invocation. -

    -
    -_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
    -=> [[1, 5, 7], [1, 2, 3]]
    -
    - -

    - pluck_.pluck(list, propertyName) -
    - A convenient version of what is perhaps the most common use-case for - map: extracting a list of property values. -

    -
    -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
    -_.pluck(stooges, 'name');
    -=> ["moe", "larry", "curly"]
    -
    - -

    - max_.max(list, [iterator], [context]) -
    - Returns the maximum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

    -
    -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
    -_.max(stooges, function(stooge){ return stooge.age; });
    -=> {name : 'curly', age : 60};
    -
    - -

    - min_.min(list, [iterator], [context]) -
    - Returns the minimum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

    -
    -var numbers = [10, 5, 100, 2, 1000];
    -_.min(numbers);
    -=> 2
    -
    - -

    - sortBy_.sortBy(list, iterator, [context]) -
    - Returns a sorted copy of list, ranked in ascending order by the - results of running each value through iterator. Iterator may - also be the string name of the property to sort by (eg. length). -

    -
    -_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
    -=> [5, 4, 6, 3, 1, 2]
    -
    - -

    - groupBy_.groupBy(list, iterator, [context]) -
    - Splits a collection into sets, grouped by the result of running each - value through iterator. If iterator is a string instead of - a function, groups by the property named by iterator on each of - the values. -

    -
    -_.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); });
    -=> {1: [1.3], 2: [2.1, 2.4]}
    -
    -_.groupBy(['one', 'two', 'three'], 'length');
    -=> {3: ["one", "two"], 5: ["three"]}
    -
    - -

    - countBy_.countBy(list, iterator, [context]) -
    - Sorts a list into groups and returns a count for the number of objects - in each group. - Similar to groupBy, but instead of returning a list of values, - returns a count for the number of values in that group. -

    -
    -_.countBy([1, 2, 3, 4, 5], function(num) {
    -  return num % 2 == 0 ? 'even' : 'odd';
    -});
    -=> {odd: 3, even: 2}
    -
    - -

    - shuffle_.shuffle(list) -
    - Returns a shuffled copy of the list, using a version of the - Fisher-Yates shuffle. -

    -
    -_.shuffle([1, 2, 3, 4, 5, 6]);
    -=> [4, 1, 6, 3, 5, 2]
    -
    - -

    - toArray_.toArray(list) -
    - Converts the list (anything that can be iterated over), into a - real Array. Useful for transmuting the arguments object. -

    -
    -(function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
    -=> [2, 3, 4]
    -
    - -

    - size_.size(list) -
    - Return the number of values in the list. -

    -
    -_.size({one : 1, two : 2, three : 3});
    -=> 3
    -
    - -

    Array Functions

    - -

    - - Note: All array functions will also work on the arguments object. - However, Underscore functions are not designed to work on "sparse" arrays. - -

    - -

    - first_.first(array, [n]) - Alias: head, take -
    - Returns the first element of an array. Passing n will - return the first n elements of the array. -

    -
    -_.first([5, 4, 3, 2, 1]);
    -=> 5
    -
    - -

    - initial_.initial(array, [n]) -
    - Returns everything but the last entry of the array. Especially useful on - the arguments object. Pass n to exclude the last n elements - from the result. -

    -
    -_.initial([5, 4, 3, 2, 1]);
    -=> [5, 4, 3, 2]
    -
    - -

    - last_.last(array, [n]) -
    - Returns the last element of an array. Passing n will return - the last n elements of the array. -

    -
    -_.last([5, 4, 3, 2, 1]);
    -=> 1
    -
    - -

    - rest_.rest(array, [index]) - Alias: tail, drop -
    - Returns the rest of the elements in an array. Pass an index - to return the values of the array from that index onward. -

    -
    -_.rest([5, 4, 3, 2, 1]);
    -=> [4, 3, 2, 1]
    -
    - -

    - compact_.compact(array) -
    - Returns a copy of the array with all falsy values removed. - In JavaScript, false, null, 0, "", - undefined and NaN are all falsy. -

    -
    -_.compact([0, 1, false, 2, '', 3]);
    -=> [1, 2, 3]
    -
    - -

    - flatten_.flatten(array, [shallow]) -
    - Flattens a nested array (the nesting can be to any depth). If you - pass shallow, the array will only be flattened a single level. -

    -
    -_.flatten([1, [2], [3, [[4]]]]);
    -=> [1, 2, 3, 4];
    -
    -_.flatten([1, [2], [3, [[4]]]], true);
    -=> [1, 2, 3, [[4]]];
    -
    - -

    - without_.without(array, [*values]) -
    - Returns a copy of the array with all instances of the values - removed. -

    -
    -_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
    -=> [2, 3, 4]
    -
    - -

    - union_.union(*arrays) -
    - Computes the union of the passed-in arrays: the list of unique items, - in order, that are present in one or more of the arrays. -

    -
    -_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
    -=> [1, 2, 3, 101, 10]
    -
    - -

    - intersection_.intersection(*arrays) -
    - Computes the list of values that are the intersection of all the arrays. - Each value in the result is present in each of the arrays. -

    -
    -_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
    -=> [1, 2]
    -
    - -

    - difference_.difference(array, *others) -
    - Similar to without, but returns the values from array that - are not present in the other arrays. -

    -
    -_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
    -=> [1, 3, 4]
    -
    - -

    - uniq_.uniq(array, [isSorted], [iterator]) - Alias: unique -
    - Produces a duplicate-free version of the array, using === to test - object equality. If you know in advance that the array is sorted, - passing true for isSorted will run a much faster algorithm. - If you want to compute unique items based on a transformation, pass an - iterator function. -

    -
    -_.uniq([1, 2, 1, 3, 1, 4]);
    -=> [1, 2, 3, 4]
    -
    - -

    - zip_.zip(*arrays) -
    - Merges together the values of each of the arrays with the - values at the corresponding position. Useful when you have separate - data sources that are coordinated through matching array indexes. - If you're working with a matrix of nested arrays, zip.apply - can transpose the matrix in a similar fashion. -

    -
    -_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
    -=> [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
    -
    - -

    - object_.object(list, [values]) -
    - Converts arrays into objects. Pass either a single list of - [key, value] pairs, or a list of keys, and a list of values. -

    -
    -_.object(['moe', 'larry', 'curly'], [30, 40, 50]);
    -=> {moe: 30, larry: 40, curly: 50}
    -
    -_.object([['moe', 30], ['larry', 40], ['curly', 50]]);
    -=> {moe: 30, larry: 40, curly: 50}
    -
    - -

    - indexOf_.indexOf(array, value, [isSorted]) -
    - Returns the index at which value can be found in the array, - or -1 if value is not present in the array. Uses the native - indexOf function unless it's missing. If you're working with a - large array, and you know that the array is already sorted, pass true - for isSorted to use a faster binary search ... or, pass a number as - the third argument in order to look for the first matching value in the - array after the given index. -

    -
    -_.indexOf([1, 2, 3], 2);
    -=> 1
    -
    - -

    - lastIndexOf_.lastIndexOf(array, value, [fromIndex]) -
    - Returns the index of the last occurrence of value in the array, - or -1 if value is not present. Uses the native lastIndexOf - function if possible. Pass fromIndex to start your search at a - given index. -

    -
    -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
    -=> 4
    -
    - -

    - sortedIndex_.sortedIndex(list, value, [iterator], [context]) -
    - Uses a binary search to determine the index at which the value - should be inserted into the list in order to maintain the list's - sorted order. If an iterator is passed, it will be used to compute - the sort ranking of each value, including the value you pass. -

    -
    -_.sortedIndex([10, 20, 30, 40, 50], 35);
    -=> 3
    -
    - -

    - range_.range([start], stop, [step]) -
    - A function to create flexibly-numbered lists of integers, handy for - each and map loops. start, if omitted, defaults - to 0; step defaults to 1. Returns a list of integers - from start to stop, incremented (or decremented) by step, - exclusive. -

    -
    -_.range(10);
    -=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    -_.range(1, 11);
    -=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    -_.range(0, 30, 5);
    -=> [0, 5, 10, 15, 20, 25]
    -_.range(0, -10, -1);
    -=> [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
    -_.range(0);
    -=> []
    -
    - -

    Function (uh, ahem) Functions

    - -

    - bind_.bind(function, object, [*arguments]) -
    - Bind a function to an object, meaning that whenever - the function is called, the value of this will be the object. - Optionally, pass arguments to the function to pre-fill them, - also known as partial application. -

    -
    -var func = function(greeting){ return greeting + ': ' + this.name };
    -func = _.bind(func, {name : 'moe'}, 'hi');
    -func();
    -=> 'hi: moe'
    -
    - -

    - bindAll_.bindAll(object, [*methodNames]) -
    - Binds a number of methods on the object, specified by - methodNames, to be run in the context of that object whenever they - are invoked. Very handy for binding functions that are going to be used - as event handlers, which would otherwise be invoked with a fairly useless - this. If no methodNames are provided, all of the object's - function properties will be bound to it. -

    -
    -var buttonView = {
    -  label   : 'underscore',
    -  onClick : function(){ alert('clicked: ' + this.label); },
    -  onHover : function(){ console.log('hovering: ' + this.label); }
    -};
    -_.bindAll(buttonView);
    -jQuery('#underscore_button').bind('click', buttonView.onClick);
    -=> When the button is clicked, this.label will have the correct value...
    -
    - -

    - partial_.partial(function, [*arguments]) -
    - Partially apply a function by filling in any number of its arguments, - without changing its dynamic this value. A close cousin - of bind. -

    -
    -var add = function(a, b) { return a + b; };
    -add5 = _.partial(add, 5);
    -add5(10);
    -=> 15
    -
    - -

    - memoize_.memoize(function, [hashFunction]) -
    - Memoizes a given function by caching the computed result. Useful - for speeding up slow-running computations. If passed an optional - hashFunction, it will be used to compute the hash key for storing - the result, based on the arguments to the original function. The default - hashFunction just uses the first argument to the memoized function - as the key. -

    -
    -var fibonacci = _.memoize(function(n) {
    -  return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
    -});
    -
    - -

    - delay_.delay(function, wait, [*arguments]) -
    - Much like setTimeout, invokes function after wait - milliseconds. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

    -
    -var log = _.bind(console.log, console);
    -_.delay(log, 1000, 'logged later');
    -=> 'logged later' // Appears after one second.
    -
    - -

    - defer_.defer(function, [*arguments]) -
    - Defers invoking the function until the current call stack has cleared, - similar to using setTimeout with a delay of 0. Useful for performing - expensive computations or HTML rendering in chunks without blocking the UI thread - from updating. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

    -
    -_.defer(function(){ alert('deferred'); });
    -// Returns from the function before the alert runs.
    -
    - -

    - throttle_.throttle(function, wait) -
    - Creates and returns a new, throttled version of the passed function, - that, when invoked repeatedly, will only actually call the original function - at most once per every wait - milliseconds. Useful for rate-limiting events that occur faster than you - can keep up with. -

    -
    -var throttled = _.throttle(updatePosition, 100);
    -$(window).scroll(throttled);
    -
    - -

    - debounce_.debounce(function, wait, [immediate]) -
    - Creates and returns a new debounced version of the passed function that - will postpone its execution until after - wait milliseconds have elapsed since the last time it - was invoked. Useful for implementing behavior that should only happen - after the input has stopped arriving. For example: rendering a - preview of a Markdown comment, recalculating a layout after the window - has stopped being resized, and so on. -

    - -

    - Pass true for the immediate parameter to cause - debounce to trigger the function on the leading instead of the - trailing edge of the wait interval. Useful in circumstances like - preventing accidental double-clicks on a "submit" button from firing a - second time. -

    - -
    -var lazyLayout = _.debounce(calculateLayout, 300);
    -$(window).resize(lazyLayout);
    -
    - -

    - once_.once(function) -
    - Creates a version of the function that can only be called one time. - Repeated calls to the modified function will have no effect, returning - the value from the original call. Useful for initialization functions, - instead of having to set a boolean flag and then check it later. -

    -
    -var initialize = _.once(createApplication);
    -initialize();
    -initialize();
    -// Application is only created once.
    -
    - -

    - after_.after(count, function) -
    - Creates a version of the function that will only be run after first - being called count times. Useful for grouping asynchronous responses, - where you want to be sure that all the async calls have finished, before - proceeding. -

    -
    -var renderNotes = _.after(notes.length, render);
    -_.each(notes, function(note) {
    -  note.asyncSave({success: renderNotes});
    -});
    -// renderNotes is run once, after all notes have saved.
    -
    - -

    - wrap_.wrap(function, wrapper) -
    - Wraps the first function inside of the wrapper function, - passing it as the first argument. This allows the wrapper to - execute code before and after the function runs, adjust the arguments, - and execute it conditionally. -

    -
    -var hello = function(name) { return "hello: " + name; };
    -hello = _.wrap(hello, function(func) {
    -  return "before, " + func("moe") + ", after";
    -});
    -hello();
    -=> 'before, hello: moe, after'
    -
    - -

    - compose_.compose(*functions) -
    - Returns the composition of a list of functions, where each function - consumes the return value of the function that follows. In math terms, - composing the functions f(), g(), and h() produces - f(g(h())). -

    -
    -var greet    = function(name){ return "hi: " + name; };
    -var exclaim  = function(statement){ return statement + "!"; };
    -var welcome = _.compose(exclaim, greet);
    -welcome('moe');
    -=> 'hi: moe!'
    -
    - -

    Object Functions

    - -

    - keys_.keys(object) -
    - Retrieve all the names of the object's properties. -

    -
    -_.keys({one : 1, two : 2, three : 3});
    -=> ["one", "two", "three"]
    -
    - -

    - values_.values(object) -
    - Return all of the values of the object's properties. -

    -
    -_.values({one : 1, two : 2, three : 3});
    -=> [1, 2, 3]
    -
    - -

    - pairs_.pairs(object) -
    - Convert an object into a list of [key, value] pairs. -

    -
    -_.pairs({one: 1, two: 2, three: 3});
    -=> [["one", 1], ["two", 2], ["three", 3]]
    -
    - -

    - invert_.invert(object) -
    - Returns a copy of the object where the keys have become the values - and the values the keys. For this to work, all of your object's values - should be unique and string serializable. -

    -
    -_.invert({Moe: "Moses", Larry: "Louis", Curly: "Jerome"});
    -=> {Moses: "Moe", Louis: "Larry", Jerome: "Curly"};
    -
    - -

    - functions_.functions(object) - Alias: methods -
    - Returns a sorted list of the names of every method in an object — - that is to say, the name of every function property of the object. -

    -
    -_.functions(_);
    -=> ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
    -
    - -

    - extend_.extend(destination, *sources) -
    - Copy all of the properties in the source objects over to the - destination object, and return the destination object. - It's in-order, so the last source will override properties of the same - name in previous arguments. -

    -
    -_.extend({name : 'moe'}, {age : 50});
    -=> {name : 'moe', age : 50}
    -
    - -

    - pick_.pick(object, *keys) -
    - Return a copy of the object, filtered to only have values for - the whitelisted keys (or array of valid keys). -

    -
    -_.pick({name : 'moe', age: 50, userid : 'moe1'}, 'name', 'age');
    -=> {name : 'moe', age : 50}
    -
    - -

    - omit_.omit(object, *keys) -
    - Return a copy of the object, filtered to omit the blacklisted - keys (or array of keys). -

    -
    -_.omit({name : 'moe', age : 50, userid : 'moe1'}, 'userid');
    -=> {name : 'moe', age : 50}
    -
    - -

    - defaults_.defaults(object, *defaults) -
    - Fill in null and undefined properties in object with values from the - defaults objects, and return the object. As soon as the - property is filled, further defaults will have no effect. -

    -
    -var iceCream = {flavor : "chocolate"};
    -_.defaults(iceCream, {flavor : "vanilla", sprinkles : "lots"});
    -=> {flavor : "chocolate", sprinkles : "lots"}
    -
    - -

    - clone_.clone(object) -
    - Create a shallow-copied clone of the object. Any nested objects - or arrays will be copied by reference, not duplicated. -

    -
    -_.clone({name : 'moe'});
    -=> {name : 'moe'};
    -
    - -

    - tap_.tap(object, interceptor) -
    - Invokes interceptor with the object, and then returns object. - The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. -

    -
    -_.chain([1,2,3,200])
    -  .filter(function(num) { return num % 2 == 0; })
    -  .tap(alert)
    -  .map(function(num) { return num * num })
    -  .value();
    -=> // [2, 200] (alerted)
    -=> [4, 40000]
    -
    - -

    - has_.has(object, key) -
    - Does the object contain the given key? Identical to - object.hasOwnProperty(key), but uses a safe reference to the - hasOwnProperty function, in case it's been - overridden accidentally. -

    -
    -_.has({a: 1, b: 2, c: 3}, "b");
    -=> true
    -
    - -

    - isEqual_.isEqual(object, other) -
    - Performs an optimized deep comparison between the two objects, to determine - if they should be considered equal. -

    -
    -var moe   = {name : 'moe', luckyNumbers : [13, 27, 34]};
    -var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
    -moe == clone;
    -=> false
    -_.isEqual(moe, clone);
    -=> true
    -
    - -

    - isEmpty_.isEmpty(object) -
    - Returns true if object contains no values. -

    -
    -_.isEmpty([1, 2, 3]);
    -=> false
    -_.isEmpty({});
    -=> true
    -
    - -

    - isElement_.isElement(object) -
    - Returns true if object is a DOM element. -

    -
    -_.isElement(jQuery('body')[0]);
    -=> true
    -
    - -

    - isArray_.isArray(object) -
    - Returns true if object is an Array. -

    -
    -(function(){ return _.isArray(arguments); })();
    -=> false
    -_.isArray([1,2,3]);
    -=> true
    -
    - -

    - isObject_.isObject(value) -
    - Returns true if value is an Object. Note that JavaScript - arrays and functions are objects, while (normal) strings and numbers are not. -

    -
    -_.isObject({});
    -=> true
    -_.isObject(1);
    -=> false
    -
    - -

    - isArguments_.isArguments(object) -
    - Returns true if object is an Arguments object. -

    -
    -(function(){ return _.isArguments(arguments); })(1, 2, 3);
    -=> true
    -_.isArguments([1,2,3]);
    -=> false
    -
    - -

    - isFunction_.isFunction(object) -
    - Returns true if object is a Function. -

    -
    -_.isFunction(alert);
    -=> true
    -
    - -

    - isString_.isString(object) -
    - Returns true if object is a String. -

    -
    -_.isString("moe");
    -=> true
    -
    - -

    - isNumber_.isNumber(object) -
    - Returns true if object is a Number (including NaN). -

    -
    -_.isNumber(8.4 * 5);
    -=> true
    -
    - -

    - isFinite_.isFinite(object) -
    - Returns true if object is a finite Number. -

    -
    -_.isFinite(-101);
    -=> true
    -
    -_.isFinite(-Infinity);
    -=> false
    -
    - -

    - isBoolean_.isBoolean(object) -
    - Returns true if object is either true or false. -

    -
    -_.isBoolean(null);
    -=> false
    -
    - -

    - isDate_.isDate(object) -
    - Returns true if object is a Date. -

    -
    -_.isDate(new Date());
    -=> true
    -
    - -

    - isRegExp_.isRegExp(object) -
    - Returns true if object is a RegExp. -

    -
    -_.isRegExp(/moe/);
    -=> true
    -
    - -

    - isNaN_.isNaN(object) -
    - Returns true if object is NaN.
    Note: this is not - the same as the native isNaN function, which will also return - true if the variable is undefined. -

    -
    -_.isNaN(NaN);
    -=> true
    -isNaN(undefined);
    -=> true
    -_.isNaN(undefined);
    -=> false
    -
    - -

    - isNull_.isNull(object) -
    - Returns true if the value of object is null. -

    -
    -_.isNull(null);
    -=> true
    -_.isNull(undefined);
    -=> false
    -
    - -

    - isUndefined_.isUndefined(value) -
    - Returns true if value is undefined. -

    -
    -_.isUndefined(window.missingVariable);
    -=> true
    -
    - -

    Utility Functions

    - -

    - noConflict_.noConflict() -
    - Give control of the "_" variable back to its previous owner. Returns - a reference to the Underscore object. -

    -
    -var underscore = _.noConflict();
    - -

    - identity_.identity(value) -
    - Returns the same value that is used as the argument. In math: - f(x) = x
    - This function looks useless, but is used throughout Underscore as - a default iterator. -

    -
    -var moe = {name : 'moe'};
    -moe === _.identity(moe);
    -=> true
    - -

    - times_.times(n, iterator, [context]) -
    - Invokes the given iterator function n times. Each invocation of - iterator is called with an index argument. -
    - Note: this example uses the chaining syntax. -

    -
    -_(3).times(function(n){ genie.grantWishNumber(n); });
    - -

    - random_.random(min, max) -
    - Returns a random integer between min and max, inclusive. - If you only pass one argument, it will return a number between 0 - and that number. -

    -
    -_.random(0, 100);
    -=> 42
    - -

    - mixin_.mixin(object) -
    - Allows you to extend Underscore with your own utility functions. Pass - a hash of {name: function} definitions to have your functions - added to the Underscore object, as well as the OOP wrapper. -

    -
    -_.mixin({
    -  capitalize : function(string) {
    -    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
    -  }
    -});
    -_("fabio").capitalize();
    -=> "Fabio"
    -
    - -

    - uniqueId_.uniqueId([prefix]) -
    - Generate a globally-unique id for client-side models or DOM elements - that need one. If prefix is passed, the id will be appended to it. -

    -
    -_.uniqueId('contact_');
    -=> 'contact_104'
    - -

    - escape_.escape(string) -
    - Escapes a string for insertion into HTML, replacing - &, <, >, ", ', and / characters. -

    -
    -_.escape('Curly, Larry & Moe');
    -=> "Curly, Larry &amp; Moe"
    - -

    - unescape_.unescape(string) -
    - The opposite of escape, replaces - &amp;, &lt;, &gt;, - &quot;, &#x27;, and &#x2F; - with their unescaped counterparts. -

    -
    -_.unescape('Curly, Larry &amp; Moe');
    -=> "Curly, Larry & Moe"
    - -

    - result_.result(object, property) -
    - If the value of the named property is a function then invoke it; otherwise, return it. -

    -
    -var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }};
    -_.result(object, 'cheese');
    -=> "crumpets"
    -_.result(object, 'stuff');
    -=> "nonsense"
    - -

    - template_.template(templateString, [data], [settings]) -
    - Compiles JavaScript templates into functions that can be evaluated - for rendering. Useful for rendering complicated bits of HTML from JSON - data sources. Template functions can both interpolate variables, using - <%= … %>, as well as execute arbitrary JavaScript code, with - <% … %>. If you wish to interpolate a value, and have - it be HTML-escaped, use <%- … %> When you evaluate a template function, pass in a - data object that has properties corresponding to the template's free - variables. If you're writing a one-off, you can pass the data - object as the second parameter to template in order to render - immediately instead of returning a template function. The settings argument - should be a hash containing any _.templateSettings that should be overridden. -

    - -
    -var compiled = _.template("hello: <%= name %>");
    -compiled({name : 'moe'});
    -=> "hello: moe"
    -
    -var list = "<% _.each(people, function(name) { %> <li><%= name %></li> <% }); %>";
    -_.template(list, {people : ['moe', 'curly', 'larry']});
    -=> "<li>moe</li><li>curly</li><li>larry</li>"
    -
    -var template = _.template("<b><%- value %></b>");
    -template({value : '<script>'});
    -=> "<b>&lt;script&gt;</b>"
    - -

    - You can also use print from within JavaScript code. This is - sometimes more convenient than using <%= ... %>. -

    - -
    -var compiled = _.template("<% print('Hello ' + epithet); %>");
    -compiled({epithet: "stooge"});
    -=> "Hello stooge."
    - -

    - If ERB-style delimiters aren't your cup of tea, you can change Underscore's - template settings to use different symbols to set off interpolated code. - Define an interpolate regex to match expressions that should be - interpolated verbatim, an escape regex to match expressions that should - be inserted after being HTML escaped, and an evaluate regex to match - expressions that should be evaluated without insertion into the resulting - string. You may define or omit any combination of the three. - For example, to perform - Mustache.js - style templating: -

    - -
    -_.templateSettings = {
    -  interpolate : /\{\{(.+?)\}\}/g
    -};
    -
    -var template = _.template("Hello {{ name }}!");
    -template({name : "Mustache"});
    -=> "Hello Mustache!"
    - -

    - By default, template places the values from your data in the local scope - via the with statement. However, you can specify a single variable name - with the variable setting. This can significantly improve the speed - at which a template is able to render. -

    - -
    -_.template("Using 'with': <%= data.answer %>", {answer: 'no'}, {variable: 'data'});
    -=> "Using 'with': no"
    - -

    - Precompiling your templates can be a big help when debugging errors you can't - reproduce. This is because precompiled templates can provide line numbers and - a stack trace, something that is not possible when compiling templates on the client. - The source property is available on the compiled template - function for easy precompilation. -

    - -
    <script>
    -  JST.project = <%= _.template(jstText).source %>;
    -</script>
    - - -

    Chaining

    - -

    - You can use Underscore in either an object-oriented or a functional style, - depending on your preference. The following two lines of code are - identical ways to double a list of numbers. -

    - -
    -_.map([1, 2, 3], function(n){ return n * 2; });
    -_([1, 2, 3]).map(function(n){ return n * 2; });
    - -

    - Calling chain will cause all future method calls to return - wrapped objects. When you've finished the computation, use - value to retrieve the final value. Here's an example of chaining - together a map/flatten/reduce, in order to get the word count of - every word in a song. -

    - -
    -var lyrics = [
    -  {line : 1, words : "I'm a lumberjack and I'm okay"},
    -  {line : 2, words : "I sleep all night and I work all day"},
    -  {line : 3, words : "They's a lumberjack and they's okay"},
    -  {line : 4, words : "They sleeps all night and they works all day"}
    -];
    -
    -_.chain(lyrics)
    -  .map(function(line) { return line.words.split(' '); })
    -  .flatten()
    -  .reduce(function(counts, word) {
    -    counts[word] = (counts[word] || 0) + 1;
    -    return counts;
    -  }, {})
    -  .value();
    -
    -=> {lumberjack : 2, all : 4, night : 2 ... }
    - -

    - In addition, the - Array prototype's methods - are proxied through the chained Underscore object, so you can slip a - reverse or a push into your chain, and continue to - modify the array. -

    - -

    - chain_.chain(obj) -
    - Returns a wrapped object. Calling methods on this object will continue - to return wrapped objects until value is used. -

    -
    -var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
    -var youngest = _.chain(stooges)
    -  .sortBy(function(stooge){ return stooge.age; })
    -  .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
    -  .first()
    -  .value();
    -=> "moe is 21"
    -
    - -

    - value_(obj).value() -
    - Extracts the value of a wrapped object. -

    -
    -_([1, 2, 3]).value();
    -=> [1, 2, 3]
    -
    - - - -

    - The Underscore documentation is also available in - Simplified Chinese. -

    - -

    - Underscore.lua, - a Lua port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - (source) -

    - -

    - Underscore.m, an Objective-C port - of many of the Underscore.js functions, using a syntax that encourages - chaining. - (source) -

    - -

    - _.m, an alternative - Objective-C port that tries to stick a little closer to the original - Underscore.js API. - (source) -

    - -

    - Underscore.php, - a PHP port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - (source) -

    - -

    - Underscore-perl, - a Perl port of many of the Underscore.js functions, - aimed at on Perl hashes and arrays. - (source) -

    - -

    - Underscore.cfc, - a Coldfusion port of many of the Underscore.js functions. - (source) -

    - -

    - Underscore.string, - an Underscore extension that adds functions for string-manipulation: - trim, startsWith, contains, capitalize, - reverse, sprintf, and more. -

    - -

    - Ruby's Enumerable module. -

    - -

    - Prototype.js, which provides - JavaScript with collection functions in the manner closest to Ruby's Enumerable. -

    - -

    - Oliver Steele's - Functional JavaScript, - which includes comprehensive higher-order function support as well as string lambdas. -

    - -

    - Michael Aufreiter's Data.js, - a data manipulation + persistence library for JavaScript. -

    - -

    - Python's itertools. -

    - -

    Change Log

    - -

    - 1.4.4Jan. 30, 2013Diff
    -

      -
    • - Added _.findWhere, for finding the first element in a list - that matches a particular set of keys and values. -
    • -
    • - Added _.partial, for partially applying a function without - changing its dynamic reference to this. -
    • -
    • - Simplified bind by removing some edge cases involving - constructor functions. In short: don't _.bind your - constructors. -
    • -
    • - A minor optimization to invoke. -
    • -
    • - Fix bug in the minified version due to the minifier incorrectly - optimizing-away isFunction. -
    • -
    -

    - -

    - 1.4.3Dec. 4, 2012Diff
    -

      -
    • - Improved Underscore compatibility with Adobe's JS engine that can be - used to script Illustrator, Photoshop, and friends. -
    • -
    • - Added a default _.identity iterator to countBy and - groupBy. -
    • -
    • - The uniq function can now take array, iterator, context - as the argument list. -
    • -
    • - The times function now returns the mapped array of iterator - results. -
    • -
    • - Simplified and fixed bugs in throttle. -
    • -
    -

    - -

    - 1.4.2Oct. 1, 2012Diff
    -

      -
    • - For backwards compatibility, returned to pre-1.4.0 behavior when - passing null to iteration functions. They now become no-ops - again. -
    • -
    -

    - -

    - 1.4.1Oct. 1, 2012Diff
    -

      -
    • - Fixed a 1.4.0 regression in the lastIndexOf function. -
    • -
    -

    - -

    - 1.4.0Sept. 27, 2012Diff
    -

      -
    • - Added a pairs function, for turning a JavaScript object - into [key, value] pairs ... as well as an object - function, for converting an array of [key, value] pairs - into an object. -
    • -
    • - Added a countBy function, for counting the number of objects - in a list that match a certain criteria. -
    • -
    • - Added an invert function, for performing a simple inversion - of the keys and values in an object. -
    • -
    • - Added a where function, for easy cases of filtering a list - for objects with specific values. -
    • -
    • - Added an omit function, for filtering an object to remove - certain keys. -
    • -
    • - Added a random function, to return a random number in a - given range. -
    • -
    • - _.debounce'd functions now return their last updated value, - just like _.throttle'd functions do. -
    • -
    • - The sortBy function now runs a stable sort algorithm. -
    • -
    • - Added the optional fromIndex option to indexOf and - lastIndexOf. -
    • -
    • - "Sparse" arrays are no longer supported in Underscore iteration - functions. Use a for loop instead (or better yet, an object). -
    • -
    • - The min and max functions may now be called on - very large arrays. -
    • -
    • - Interpolation in templates now represents null and - undefined as the empty string. -
    • -
    • - Underscore iteration functions no longer accept null values - as a no-op argument. You'll get an early error instead. -
    • -
    • - A number of edge-cases fixes and tweaks, which you can spot in the - diff. - Depending on how you're using Underscore, 1.4.0 may be more - backwards-incompatible than usual — please test when you upgrade. -
    • -
    -

    - -

    - 1.3.3April 10, 2012
    -

      -
    • - Many improvements to _.template, which now provides the - source of the template function as a property, for potentially - even more efficient pre-compilation on the server-side. You may now - also set the variable option when creating a template, - which will cause your passed-in data to be made available under the - variable you named, instead of using a with statement — - significantly improving the speed of rendering the template. -
    • -
    • - Added the pick function, which allows you to filter an - object literal with a whitelist of allowed property names. -
    • -
    • - Added the result function, for convenience when working - with APIs that allow either functions or raw properties. -
    • -
    • - Added the isFinite function, because sometimes knowing that - a value is a number just ain't quite enough. -
    • -
    • - The sortBy function may now also be passed the string name - of a property to use as the sort order on each object. -
    • -
    • - Fixed uniq to work with sparse arrays. -
    • -
    • - The difference function now performs a shallow flatten - instead of a deep one when computing array differences. -
    • -
    • - The debounce function now takes an immediate - parameter, which will cause the callback to fire on the leading - instead of the trailing edge. -
    • -
    -

    - -

    - 1.3.1Jan. 23, 2012
    -

      -
    • - Added an _.has function, as a safer way to use hasOwnProperty. -
    • -
    • - Added _.collect as an alias for _.map. Smalltalkers, rejoice. -
    • -
    • - Reverted an old change so that _.extend will correctly copy - over keys with undefined values again. -
    • -
    • - Bugfix to stop escaping slashes within interpolations in _.template. -
    • -
    -

    - -

    - 1.3.0Jan. 11, 2012
    -

      -
    • - Removed AMD (RequireJS) support from Underscore. If you'd like to use - Underscore with RequireJS, you can load it as a normal script, wrap - or patch your copy, or download a forked version. -
    • -
    -

    - -

    - 1.2.4Jan. 4, 2012
    -

      -
    • - You now can (and probably should, as it's simpler) - write _.chain(list) - instead of _(list).chain(). -
    • -
    • - Fix for escaped characters in Underscore templates, and for supporting - customizations of _.templateSettings that only define one or - two of the required regexes. -
    • -
    • - Fix for passing an array as the first argument to an _.wrap'd function. -
    • -
    • - Improved compatibility with ClojureScript, which adds a call - function to String.prototype. -
    • -
    -

    - -

    - 1.2.3Dec. 7, 2011
    -

      -
    • - Dynamic scope is now preserved for compiled _.template functions, - so you can use the value of this if you like. -
    • -
    • - Sparse array support of _.indexOf, _.lastIndexOf. -
    • -
    • - Both _.reduce and _.reduceRight can now be passed an - explicitly undefined value. (There's no reason why you'd - want to do this.) -
    • -
    -

    - -

    - 1.2.2Nov. 14, 2011
    -

      -
    • - Continued tweaks to _.isEqual semantics. Now JS primitives are - considered equivalent to their wrapped versions, and arrays are compared - by their numeric properties only (#351). -
    • -
    • - _.escape no longer tries to be smart about not double-escaping - already-escaped HTML entities. Now it just escapes regardless (#350). -
    • -
    • - In _.template, you may now leave semicolons out of evaluated - statements if you wish: <% }) %> (#369). -
    • -
    • - _.after(callback, 0) will now trigger the callback immediately, - making "after" easier to use with asynchronous APIs (#366). -
    • -
    -

    - -

    - 1.2.1Oct. 24, 2011
    -

      -
    • - Several important bug fixes for _.isEqual, which should now - do better on mutated Arrays, and on non-Array objects with - length properties. (#329) -
    • -
    • - jrburke contributed Underscore exporting for AMD module loaders, - and tonylukasavage for Appcelerator Titanium. - (#335, #338) -
    • -
    • - You can now _.groupBy(list, 'property') as a shortcut for - grouping values by a particular common property. -
    • -
    • - _.throttle'd functions now fire immediately upon invocation, - and are rate-limited thereafter (#170, #266). -
    • -
    • - Most of the _.is[Type] checks no longer ducktype. -
    • -
    • - The _.bind function now also works on constructors, a-la - ES5 ... but you would never want to use _.bind on a - constructor function. -
    • -
    • - _.clone no longer wraps non-object types in Objects. -
    • -
    • - _.find and _.filter are now the preferred names for - _.detect and _.select. -
    • -
    -

    - -

    - 1.2.0Oct. 5, 2011
    -

      -
    • - The _.isEqual function now - supports true deep equality comparisons, with checks for cyclic structures, - thanks to Kit Cambridge. -
    • -
    • - Underscore templates now support HTML escaping interpolations, using - <%- ... %> syntax. -
    • -
    • - Ryan Tenney contributed _.shuffle, which uses a modified - Fisher-Yates to give you a shuffled copy of an array. -
    • -
    • - _.uniq can now be passed an optional iterator, to determine by - what criteria an object should be considered unique. -
    • -
    • - _.last now takes an optional argument which will return the last - N elements of the list. -
    • -
    • - A new _.initial function was added, as a mirror of _.rest, - which returns all the initial values of a list (except the last N). -
    • -
    -

    - -

    - 1.1.7July 13, 2011
    - Added _.groupBy, which aggregates a collection into groups of like items. - Added _.union and _.difference, to complement the - (re-named) _.intersection. - Various improvements for support of sparse arrays. - _.toArray now returns a clone, if directly passed an array. - _.functions now also returns the names of functions that are present - in the prototype chain. -

    - -

    - 1.1.6April 18, 2011
    - Added _.after, which will return a function that only runs after - first being called a specified number of times. - _.invoke can now take a direct function reference. - _.every now requires an iterator function to be passed, which - mirrors the ECMA5 API. - _.extend no longer copies keys when the value is undefined. - _.bind now errors when trying to bind an undefined value. -

    - -

    - 1.1.5Mar 20, 2011
    - Added an _.defaults function, for use merging together JS objects - representing default options. - Added an _.once function, for manufacturing functions that should - only ever execute a single time. - _.bind now delegates to the native ECMAScript 5 version, - where available. - _.keys now throws an error when used on non-Object values, as in - ECMAScript 5. - Fixed a bug with _.keys when used over sparse arrays. -

    - -

    - 1.1.4Jan 9, 2011
    - Improved compliance with ES5's Array methods when passing null - as a value. _.wrap now correctly sets this for the - wrapped function. _.indexOf now takes an optional flag for - finding the insertion index in an array that is guaranteed to already - be sorted. Avoiding the use of .callee, to allow _.isArray - to work properly in ES5's strict mode. -

    - -

    - 1.1.3Dec 1, 2010
    - In CommonJS, Underscore may now be required with just:
    - var _ = require("underscore"). - Added _.throttle and _.debounce functions. - Removed _.breakLoop, in favor of an ECMA5-style un-break-able - each implementation — this removes the try/catch, and you'll now have - better stack traces for exceptions that are thrown within an Underscore iterator. - Improved the isType family of functions for better interoperability - with Internet Explorer host objects. - _.template now correctly escapes backslashes in templates. - Improved _.reduce compatibility with the ECMA5 version: - if you don't pass an initial value, the first item in the collection is used. - _.each no longer returns the iterated collection, for improved - consistency with ES5's forEach. -

    - -

    - 1.1.2
    - Fixed _.contains, which was mistakenly pointing at - _.intersect instead of _.include, like it should - have been. Added _.unique as an alias for _.uniq. -

    - -

    - 1.1.1
    - Improved the speed of _.template, and its handling of multiline - interpolations. Ryan Tenney contributed optimizations to many Underscore - functions. An annotated version of the source code is now available. -

    - -

    - 1.1.0
    - The method signature of _.reduce has been changed to match - the ECMAScript 5 signature, instead of the Ruby/Prototype.js version. - This is a backwards-incompatible change. _.template may now be - called with no arguments, and preserves whitespace. _.contains - is a new alias for _.include. -

    - -

    - 1.0.4
    - Andri Möll contributed the _.memoize - function, which can be used to speed up expensive repeated computations - by caching the results. -

    - -

    - 1.0.3
    - Patch that makes _.isEqual return false if any property - of the compared object has a NaN value. Technically the correct - thing to do, but of questionable semantics. Watch out for NaN comparisons. -

    - -

    - 1.0.2
    - Fixes _.isArguments in recent versions of Opera, which have - arguments objects as real Arrays. -

    - -

    - 1.0.1
    - Bugfix for _.isEqual, when comparing two objects with the same - number of undefined keys, but with different names. -

    - -

    - 1.0.0
    - Things have been stable for many months now, so Underscore is now - considered to be out of beta, at 1.0. Improvements since 0.6 - include _.isBoolean, and the ability to have _.extend - take multiple source objects. -

    - -

    - 0.6.0
    - Major release. Incorporates a number of - Mile Frawley's refactors for - safer duck-typing on collection functions, and cleaner internals. A new - _.mixin method that allows you to extend Underscore with utility - functions of your own. Added _.times, which works the same as in - Ruby or Prototype.js. Native support for ECMAScript 5's Array.isArray, - and Object.keys. -

    - -

    - 0.5.8
    - Fixed Underscore's collection functions to work on - NodeLists and - HTMLCollections - once more, thanks to - Justin Tulloss. -

    - -

    - 0.5.7
    - A safer implementation of _.isArguments, and a - faster _.isNumber,
    thanks to - Jed Schmidt. -

    - -

    - 0.5.6
    - Customizable delimiters for _.template, contributed by - Noah Sloan. -

    - -

    - 0.5.5
    - Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object. -

    - -

    - 0.5.4
    - Fix for multiple single quotes within a template string for - _.template. See: - Rick Strahl's blog post. -

    - -

    - 0.5.2
    - New implementations of isArray, isDate, isFunction, - isNumber, isRegExp, and isString, thanks to - a suggestion from - Robert Kieffer. - Instead of doing Object#toString - comparisons, they now check for expected properties, which is less safe, - but more than an order of magnitude faster. Most other Underscore - functions saw minor speed improvements as a result. - Evgeniy Dolzhenko - contributed _.tap, - similar to Ruby 1.9's, - which is handy for injecting side effects (like logging) into chained calls. -

    - -

    - 0.5.1
    - Added an _.isArguments function. Lots of little safety checks - and optimizations contributed by - Noah Sloan and - Andri Möll. -

    - -

    - 0.5.0
    - [API Changes] _.bindAll now takes the context object as - its first parameter. If no method names are passed, all of the context - object's methods are bound to it, enabling chaining and easier binding. - _.functions now takes a single argument and returns the names - of its Function properties. Calling _.functions(_) will get you - the previous behavior. - Added _.isRegExp so that isEqual can now test for RegExp equality. - All of the "is" functions have been shrunk down into a single definition. - Karl Guertin contributed patches. -

    - -

    - 0.4.7
    - Added isDate, isNaN, and isNull, for completeness. - Optimizations for isEqual when checking equality between Arrays - or Dates. _.keys is now 25%–2X faster (depending on your - browser) which speeds up the functions that rely on it, such as _.each. -

    - -

    - 0.4.6
    - Added the range function, a port of the - Python - function of the same name, for generating flexibly-numbered lists - of integers. Original patch contributed by - Kirill Ishanov. -

    - -

    - 0.4.5
    - Added rest for Arrays and arguments objects, and aliased - first as head, and rest as tail, - thanks to Luke Sutton's patches. - Added tests ensuring that all Underscore Array functions also work on - arguments objects. -

    - -

    - 0.4.4
    - Added isString, and isNumber, for consistency. Fixed - _.isEqual(NaN, NaN) to return true (which is debatable). -

    - -

    - 0.4.3
    - Started using the native StopIteration object in browsers that support it. - Fixed Underscore setup for CommonJS environments. -

    - -

    - 0.4.2
    - Renamed the unwrapping function to value, for clarity. -

    - -

    - 0.4.1
    - Chained Underscore objects now support the Array prototype methods, so - that you can perform the full range of operations on a wrapped array - without having to break your chain. Added a breakLoop method - to break in the middle of any Underscore iteration. Added an - isEmpty function that works on arrays and objects. -

    - -

    - 0.4.0
    - All Underscore functions can now be called in an object-oriented style, - like so: _([1, 2, 3]).map(...);. Original patch provided by - Marc-André Cournoyer. - Wrapped objects can be chained through multiple - method invocations. A functions method - was added, providing a sorted list of all the functions in Underscore. -

    - -

    - 0.3.3
    - Added the JavaScript 1.8 function reduceRight. Aliased it - as foldr, and aliased reduce as foldl. -

    - -

    - 0.3.2
    - Now runs on stock Rhino - interpreters with: load("underscore.js"). - Added identity as a utility function. -

    - -

    - 0.3.1
    - All iterators are now passed in the original collection as their third - argument, the same as JavaScript 1.6's forEach. Iterating over - objects is now called with (value, key, collection), for details - see _.each. -

    - -

    - 0.3.0
    - Added Dmitry Baranovskiy's - comprehensive optimizations, merged in - Kris Kowal's patches to make Underscore - CommonJS and - Narwhal compliant. -

    - -

    - 0.2.0
    - Added compose and lastIndexOf, renamed inject to - reduce, added aliases for inject, filter, - every, some, and forEach. -

    - -

    - 0.1.1
    - Added noConflict, so that the "Underscore" object can be assigned to - other variables. -

    - -

    - 0.1.0
    - Initial release of Underscore.js. -

    - -

    - - A DocumentCloud Project - -

    - -
    - -
    - - - - - - diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/index.js b/deploy/core/node_modules/jshint/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5b0..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/package.json b/deploy/core/node_modules/jshint/node_modules/underscore/package.json deleted file mode 100644 index 13fb1b8b6..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://underscorejs.org", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.4.4", - "devDependencies": { - "phantomjs": "0.2.2" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" - }, - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", - "readmeFilename": "README.md", - "_id": "underscore@1.4.4", - "_from": "underscore@1.4.x" -} diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/underscore-min.js b/deploy/core/node_modules/jshint/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3aed..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/deploy/core/node_modules/jshint/node_modules/underscore/underscore.js b/deploy/core/node_modules/jshint/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d96c..000000000 --- a/deploy/core/node_modules/jshint/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); diff --git a/deploy/core/node_modules/jshint/package.json b/deploy/core/node_modules/jshint/package.json deleted file mode 100644 index 29e4a3031..000000000 --- a/deploy/core/node_modules/jshint/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "jshint", - "version": "2.0.1", - "homepage": "http://jshint.com/", - "description": "Static analysis tool for JavaScript", - "author": { - "name": "Anton Kovalyov", - "email": "anton@kovalyov.net", - "url": "http://anton.kovalyov.net/" - }, - "bin": { - "jshint": "./bin/jshint" - }, - "scripts": { - "build": "node ./make.js build", - "test": "node ./make.js test", - "lint": "node ./make.js lint" - }, - "main": "./src/stable/jshint.js", - "dependencies": { - "shelljs": "0.1.x", - "underscore": "1.4.x", - "cli": "0.4.x", - "minimatch": "0.x.x", - "console-browserify": "0.1.x" - }, - "devDependencies": { - "jshint": "1.1.0", - "shelljs": "0.1.x", - "browserify": "2.12.x", - "coveraje": "0.2.x", - "nodeunit": "0.7.x", - "sinon": "1.6.x" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/jshint/jshint/blob/master/LICENSE" - } - ], - "preferGlobal": true, - "readme": "JSHint, A Static Code Analysis Tool for JavaScript\n==================================================\n[![Build Status](https://travis-ci.org/jshint/jshint.png?branch=master)](https://travis-ci.org/jshint/jshint)\n[![NPM version](https://badge.fury.io/js/jshint.png)](http://badge.fury.io/js/jshint)\n\nJSHint is a community-driven tool to detect errors and potential problems in\nJavaScript code and to enforce your team's coding conventions. We made JSHint\nvery flexible so you can easily adjust it to your particular coding guidelines\nand the environment you expect your code to execute in.\n\nOur goal is to help JavaScript developers write complex programs without\nworrying about typos and language gotchas.\n\nWe believe that static code analysis programs—as well as other code quality\ntools—are important and beneficial to the JavaScript community and, thus,\nshould not alienate their users.\n\nFor general usage and hacking information, visit our website:\n[http://jshint.com/](http://jshint.com/).\n\nBug Bounties\n--------------------------------\n\nSome bugs are so important to us, we will pay you if you fix them! Go to\n[our page on BountySource](https://www.bountysource.com/#trackers/48759-jshint)\nto see which bugs have bounties behind them.\n\nReally want to have something fixed but don't have time? You can add your\nown bounty to any JSHint bug and make it more attractive for potential\ncontributors!\n\n**Rule:** A bug is considered fixed only after it has been merged into the\nmaster branch of the main JSHint repository.\n\nReporting a bug\n---------------\n\nTo report a bug simply create a\n[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe\nyour problem or suggestion. We welcome all kind of feedback regarding\nJSHint including but not limited to:\n\n * When JSHint doesn't work as expected\n * When JSHint complains about valid JavaScript code that works in all browsers\n * When you simply want a new option or feature\n\nBefore reporting a bug look around to see if there are any open or closed tickets\nthat cover your issue. And remember the wisdom: pull request > bug report > tweet.\n\n\nFAQ\n---\n\n#### How do I turn off \"mixed tabs and spaces\" warning?\n\nIf you're using so-called [smart tabs](http://www.emacswiki.org/SmartTabs)\nthen we have an option `smarttabs` for you. Otherwise, your solution is to\nrun JSHint with a custom reporter that discards any warnings you don't like.\nFor example, this [example reporter](https://gist.github.com/3885619)\ndiscards all warnings about mixed tabs and spaces.\n\nContributing\n------------\n\nLook for a file named `CONTRIBUTING.md` in this repository. It contains our\ncontributing guidelines. We also have\n[a mailing list](http://groups.google.com/group/jshint/).\n\nLicense\n-------\n\nJSHint is distributed under the MIT License. One file and one file only\n(src/stable/jshint.js) is distributed under the slightly modified MIT License.\n\nAttribution\n-----------\n\nCore Team members:\n\n * [Anton Kovalyov](http://anton.kovalyov.net/) ([@valueof](http://twitter.com/valueof))\n * [Wolfgang Kluge](http://klugesoftware.de/) ([blog](http://gehirnwindung.de/))\n * [Josh Perez](http://www.goatslacker.com/) ([@goatslacker](http://twitter.com/goatslacker))\n * [Brent Lintner](http://brentlintner.heroku.com/) ([@brentlintner](http://twitter.com/brentlintner))\n\nMaintainer: Anton Kovalyov\n\nThank you!\n----------\n\nWe really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint!\n", - "readmeFilename": "README.md", - "_id": "jshint@2.0.1", - "dist": { - "shasum": "8b2c966e3ab5f2ce40749135d502873237b4126f" - }, - "_from": "jshint@", - "_resolved": "https://registry.npmjs.org/jshint/-/jshint-2.0.1.tgz" -} diff --git a/deploy/core/node_modules/jshint/src/cli/cli.js b/deploy/core/node_modules/jshint/src/cli/cli.js deleted file mode 100644 index 78ef8bce2..000000000 --- a/deploy/core/node_modules/jshint/src/cli/cli.js +++ /dev/null @@ -1,440 +0,0 @@ -"use strict"; - -var cli = require("cli"); -var path = require("path"); -var shjs = require("shelljs"); -var minimatch = require("minimatch"); -var JSHINT = require("../stable/jshint.js").JSHINT; -var defReporter = require("../reporters/default").reporter; - -var OPTIONS = { - "config": ["config", "Custom configuration file", "string", false ], - "reporter": ["reporter", "Custom reporter", "string", undefined ], - "verbose": ["verbose", "Show message codes"], - "show-non-errors": ["show-non-errors", "Show additional data generated by jshint"], - "extra-ext": ["extra-ext", - "Comma-separated list of file extensions to use (default is .js)", "string", ""], - - // Deprecated options. - "jslint-reporter": [ - "jslint-reporter", - deprecated("Use a jslint compatible reporter", "--reporter=jslint") - ], - - "checkstyle-reporter": [ - "checkstyle-reporter", - deprecated("Use a CheckStyle compatible XML reporter", "--reporter=checkstyle") - ] -}; - -/** - * Returns the same text but with a deprecation notice. - * Useful for options descriptions. - * - * @param {string} text - * @param {string} alt (optional) Alternative command to include in the - * deprecation notice. - * - * @returns {string} - */ -function deprecated(text, alt) { - if (!alt) { - return text + " (DEPRECATED)"; - } - - return text + " (DEPRECATED, use " + alt + " instead)"; -} - -/** - * Removes JavaScript comments from a string by replacing - * everything between block comments and everything after - * single-line comments in a non-greedy way. - * - * English version of the regex: - * match '/*' - * then match zero or more instances of any character (incl. \n) - * except for instances of '* /' (without a space, obv.) - * then match '* /' (again, without a space) - * - * @param {string} str a string with potential JavaScript comments. - * @returns {string} a string without JavaScript comments. - */ -function removeComments(str) { - str = str || ""; - - str = str.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\//g, ""); - str = str.replace(/\/\/[^\n\r]*/g, ""); // Everything after '//' - - return str; -} - -/** - * Loads and parses a configuration file. - * - * @param {string} fp a path to the config file - * @returns {object} config object - */ -function loadConfig(fp) { - if (!fp) { - return {}; - } - - if (!shjs.test("-e", fp)) { - cli.error("Can't find config file: " + fp); - process.exit(1); - } - - try { - return JSON.parse(removeComments(shjs.cat(fp))); - } catch (err) { - cli.error("Can't parse config file: " + fp); - process.exit(1); - } -} - -/** - * Tries to find a configuration file in either project directory - * or in the home directory. Configuration files are named - * '.jshintrc'. - * - * @param {sting} file path to the file to be linted - * @returns {string} a path to the config file - */ -function findConfig(file) { - var name = ".jshintrc"; - var dir = path.dirname(path.resolve(file)); - var proj = findFile(name, dir); - var home = path.normalize(path.join(process.env.HOME || process.env.HOMEPATH, name)); - - if (proj) { - return proj; - } - - if (shjs.test("-e", home)) { - return home; - } - - return null; -} - -/** - * Tries to import a reporter file and returns its reference. - * - * @param {string} fp a path to the reporter file - * @returns {object} imported module for the reporter or 'null' - * if a module cannot be imported. - */ -function loadReporter(fp) { - try { - return require(fp).reporter; - } catch (err) { - return null; - } -} - -// Storage for memoized results from find file -// Should prevent lots of directory traversal & -// lookups when liniting an entire project -var findFileResults = {}; -/** - * Searches for a file with a specified name starting with - * 'dir' and going all the way up either until it finds the file - * or hits the root. - * - * @param {string} name filename to search for (e.g. .jshintrc) - * @param {string} dir directory to start search from (default: - * current working directory) - * - * @returns {string} normalized filename - */ -function findFile(name, dir) { - dir = dir || process.cwd(); - - var filename = path.normalize(path.join(dir, name)); - if (findFileResults[filename] !== undefined) { - return findFileResults[filename]; - } - - var parent = path.resolve(dir, "../"); - - if (shjs.test("-e", filename)) { - findFileResults[filename] = filename; - return filename; - } - - if (dir === parent) { - findFileResults[filename] = null; - return null; - } - - return findFile(name, parent); -} - -/** - * Loads a list of files that have to be skipped. JSHint assumes that - * the list is located in a file called '.jshintignore'. - * - * @return {array} a list of files to ignore. - */ -function loadIgnores() { - var file = findFile(".jshintignore"); - - if (!file) { - return; - } - - return shjs.cat(file).split("\n") - .filter(function (line) { - return !!line.trim(); - }) - .map(function (line) { - return path.resolve(path.dirname(file), line.trim()); - }); -} - -/** - * Checks whether we should ignore a file or not. - * - * @param {string} fp a path to a file - * @param {array} patterns a list of patterns for files to ignore - * - * @return {boolean} 'true' if file should be ignored, 'false' otherwise. - */ -function isIgnored(fp, patterns) { - return patterns.some(function (ip) { - if (minimatch(path.resolve(fp), ip, { nocase: true })) { - return true; - } - - if (path.resolve(fp) === ip) { - return true; - } - - if (shjs.test("-d", fp) && ip.match(/^[^\/]*\/?$/) && - fp.match(new RegExp("^" + ip + ".*"))) { - return true; - } - }); -} - -/** - * Recursively gather all files that need to be linted, - * excluding those that user asked to ignore. - * - * @param {string} fp a path to a file or directory to lint - * @param {array} files a pointer to an array that stores a list of files - * @param {array} ignores a list of patterns for files to ignore - * @param {array} ext a list of non-dot-js extensions to lint - */ -function collect(fp, files, ignores, ext) { - if (ignores && isIgnored(fp, ignores)) { - return; - } - - if (!shjs.test("-e", fp)) { - cli.error("Can't open " + fp); - return; - } - - if (shjs.test("-d", fp)) { - shjs.ls(fp).forEach(function (item) { - var itempath = path.join(fp, item); - if (shjs.test("-d", itempath) || item.match(ext)) { - collect(itempath, files, ignores, ext); - } - }); - - return; - } - - files.push(fp); -} - -/** - * Runs JSHint against provided file and saves the result - * - * @param {string} file a path to a file that needs to be linted - * @param {object} results a pointer to an object with results - * @param {object} config an object with JSHint configuration - * @param {object} data a pointer to an object with extra data - */ -function lint(file, results, config, data) { - var buffer; - var globals; - var lintData; - - config = config || {}; - config = JSON.parse(JSON.stringify(config)); - - try { - buffer = shjs.cat(file); - } catch (err) { - cli.error("Can't open " + file); - process.exit(1); - } - - // Remove potential Unicode BOM. - buffer = buffer.replace(/^\uFEFF/, ""); - - if (config.globals) { - globals = config.globals; - delete config.globals; - } - - if (!JSHINT(buffer, config, globals)) { - JSHINT.errors.forEach(function (err) { - if (err) { - results.push({ file: file, error: err }); - } - }); - } - - lintData = JSHINT.data(); - - if (lintData) { - lintData.file = file; - data.push(lintData); - } -} - -var exports = { - /** - * Gathers all files that need to be linted - * - * @param {object} post-processed options from 'interpret': - * args - CLI arguments - * ignores - A list of files/dirs to ignore (defaults to .jshintignores) - * extensions - A list of non-dot-js extensions to check - */ - gather: function (opts) { - var files = []; - var reg = new RegExp("\\.(js" + - (opts.extensions === "" ? "" : "|" + - opts.extensions.replace(/,/g, "|").replace(/[\. ]/g, "")) + ")$"); - - var ignores = !opts.ignores ? loadIgnores() : opts.ignores.map(function (target) { - return path.resolve(target); - }); - - opts.args.forEach(function (target) { - collect(target, files, ignores, reg); - }); - - return files; - }, - - /** - * Gathers all files that need to be linted, lints them, sends them to - * a reporter and returns the overall result. - * - * @param {object} post-processed options from 'interpret': - * args - CLI arguments - * config - Configuration object - * reporter - Reporter function - * ignores - A list of files/dirs to ignore - * extensions - A list of non-dot-js extensions to check - * - * @returns {bool} 'true' if all files passed and 'false' otherwise. - */ - run: function (opts) { - var files = exports.gather(opts); - var results = []; - var data = []; - - files.forEach(function (file) { - var config = opts.config || loadConfig(findConfig(file)); - lint(file, results, config, data); - }); - - (opts.reporter || defReporter)(results, data, { verbose: opts.verbose }); - - return results.length === 0; - }, - - /** - * Helper exposed for testing. - * Used to determine is stdout has any buffered output before exiting the program - */ - getBufferSize: function () { - return process.stdout.bufferSize; - }, - - /** - * Main entrance function. Parses arguments and calls 'run' when - * its done. This function is called from bin/jshint file. - * - * @param {object} args, arguments in the process.argv format. - */ - interpret: function (args) { - cli.setArgv(args); - cli.options = {}; - - cli.enable("version", "glob", "help"); - cli.setApp(path.resolve(__dirname + "/../../package.json")); - - var options = cli.parse(OPTIONS); - // Use config file if specified - var config; - if (options.config) { - config = loadConfig(options.config); - } - - switch (true) { - // JSLint reporter - case options.reporter === "jslint": - case options["jslint-reporter"]: - options.reporter = "../reporters/jslint_xml.js"; - break; - - // CheckStyle (XML) reporter - case options.reporter === "checkstyle": - case options["checkstyle-reporter"]: - options.reporter = "../reporters/checkstyle.js"; - break; - - // Reporter that displays additional JSHint data - case options["show-non-errors"]: - options.reporter = "../reporters/non_error.js"; - break; - - // Custom reporter - case options.reporter !== undefined: - options.reporter = path.resolve(process.cwd(), options.reporter); - } - - var reporter; - if (options.reporter) { - reporter = loadReporter(options.reporter); - - if (reporter === null) { - cli.error("Can't load reporter file: " + options.reporter); - process.exit(1); - } - } - - var passed = exports.run({ - args: cli.args, - config: config, - reporter: reporter, - ignores: loadIgnores(), - extensions: options["extra-ext"], - verbose: options.verbose - }); - - // Patch as per https://github.com/visionmedia/mocha/issues/333 - // fixes issues with piped output on Windows. - // Root issue is here https://github.com/joyent/node/issues/3584 - function exit() { process.exit(passed ? 0 : 2); } - try { - if (exports.getBufferSize()) { - process.stdout.once('drain', exit); - } else { - exit(); - } - } catch (err) { - exit(); - } - } -}; - -module.exports = exports; diff --git a/deploy/core/node_modules/jshint/src/platforms/rhino.js b/deploy/core/node_modules/jshint/src/platforms/rhino.js deleted file mode 100644 index 8f1657bcc..000000000 --- a/deploy/core/node_modules/jshint/src/platforms/rhino.js +++ /dev/null @@ -1,86 +0,0 @@ -/*jshint boss: true, rhino: true, unused: true, undef: true, white: true, quotmark: double */ -/*global JSHINT */ - -(function (args) { - "use strict"; - - var filenames = []; - var optstr; // arg1=val1,arg2=val2,... - var predef; // global1=true,global2,global3,... - var opts = {}; - var retval = 0; - - args.forEach(function (arg) { - if (arg.indexOf("=") > -1) { - if (!optstr) { - // First time it's the options. - optstr = arg; - } else { - predef = arg; - } - - return; - } - - if (optstr) { - predef = arg; - return; - } - - filenames.push(arg); - }); - - if (filenames.length === 0) { - print("Usage: jshint.js file.js"); - quit(1); - } - - if (optstr) { - optstr.split(",").forEach(function (arg) { - var o = arg.split("="); - if (o[0] === "indent") { - opts[o[0]] = parseInt(o[1], 10); - } else { - opts[o[0]] = (function (ov) { - switch (ov) { - case "true": - return true; - case "false": - return false; - default: - return ov; - } - }(o[1])); - } - }); - } - - if (predef) { - opts.predef = {}; - - predef.split(",").forEach(function (arg) { - var global = arg.split("="); - opts.predef[global[0]] = global[1] === "true" ? true : false; - }); - } - - filenames.forEach(function (name) { - var input = readFile(name); - - if (!input) { - print("jshint: Couldn't open file " + name); - quit(1); - } - - if (!JSHINT(input, opts)) { - for (var i = 0, err; err = JSHINT.errors[i]; i += 1) { - print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")"); - print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); - print(""); - } - retval = 1; - } - }); - - quit(retval); -}(arguments)); diff --git a/deploy/core/node_modules/jshint/src/reporters/checkstyle.js b/deploy/core/node_modules/jshint/src/reporters/checkstyle.js deleted file mode 100644 index 4d4039bb7..000000000 --- a/deploy/core/node_modules/jshint/src/reporters/checkstyle.js +++ /dev/null @@ -1,107 +0,0 @@ -// Author: Boy Baukema -// http://github.com/relaxnow -module.exports = -{ - reporter: function (results, data) - { - "use strict"; - - var files = {}, - out = [], - pairs = { - "&": "&", - '"': """, - "'": "'", - "<": "<", - ">": ">" - }, - file, fileName, i, issue, globals, unuseds; - - function encode(s) { - for (var r in pairs) { - if (typeof(s) !== "undefined") { - s = s.replace(new RegExp(r, "g"), pairs[r]); - } - } - return s || ""; - } - - results.forEach(function (result) { - // Register the file - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - - // Add the error - files[result.file].push({ - severity: 'error', - line: result.error.line, - column: result.error.character, - message: result.error.reason, - source: result.error.raw - }); - }); - - data.forEach(function (result) { - file = data.file; - globals = result.implieds; - unuseds = result.unused; - - // Register the file - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - - if (globals) { - globals.forEach(function (global) { - files[result.file].push({ - severity: 'warning', - line: global.line, - column: 0, - message: "Implied global '" + global.name + "'", - source: 'jshint.implied-globals' - }); - }); - } - if (unuseds) { - unuseds.forEach(function (unused) { - files[result.file].push({ - severity: 'warning', - line: unused.line, - column: 0, - message: "Unused variable: '" + unused.name + "'", - source: 'jshint.implied-unuseds' - }); - }); - } - }); - - out.push(""); - out.push(""); - - for (fileName in files) { - if (files.hasOwnProperty(fileName)) { - out.push("\t"); - for (i = 0; i < files[fileName].length; i++) { - issue = files[fileName][i]; - out.push( - "\t\t" - ); - } - out.push("\t"); - } - } - - out.push(""); - - process.stdout.write(out.join("\n") + "\n"); - } -}; diff --git a/deploy/core/node_modules/jshint/src/reporters/default.js b/deploy/core/node_modules/jshint/src/reporters/default.js deleted file mode 100644 index 2a432f18f..000000000 --- a/deploy/core/node_modules/jshint/src/reporters/default.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -module.exports = { - reporter: function (results, data, opts) { - var len = results.length; - var str = ''; - var prevfile; - - opts = opts || {}; - - results.forEach(function (result) { - var file = result.file; - var error = result.error; - - if (prevfile && prevfile !== file) { - str += "\n"; - } - prevfile = file; - - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason; - - if (opts.verbose) { - str += ' (' + error.code + ')'; - } - - str += '\n'; - }); - - if (str) { - process.stdout.write(str + "\n" + len + ' error' + ((len === 1) ? '' : 's') + "\n"); - } - } -}; diff --git a/deploy/core/node_modules/jshint/src/reporters/jslint_xml.js b/deploy/core/node_modules/jshint/src/reporters/jslint_xml.js deleted file mode 100644 index 690047176..000000000 --- a/deploy/core/node_modules/jshint/src/reporters/jslint_xml.js +++ /dev/null @@ -1,57 +0,0 @@ -module.exports = -{ - reporter: function (results) - { - "use strict"; - - var files = {}, - out = [], - pairs = { - "&": "&", - '"': """, - "'": "'", - "<": "<", - ">": ">" - }, - file, i, issue; - - function encode(s) { - for (var r in pairs) { - if (typeof(s) !== "undefined") { - s = s.replace(new RegExp(r, "g"), pairs[r]); - } - } - return s || ""; - } - - - results.forEach(function (result) { - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - files[result.file].push(result.error); - }); - - out.push(""); - out.push(""); - - for (file in files) { - out.push("\t"); - for (i = 0; i < files[file].length; i++) { - issue = files[file][i]; - out.push("\t\t"); - } - out.push("\t"); - } - - out.push(""); - - process.stdout.write(out.join("\n") + "\n"); - } -}; diff --git a/deploy/core/node_modules/jshint/src/reporters/non_error.js b/deploy/core/node_modules/jshint/src/reporters/non_error.js deleted file mode 100644 index f20887397..000000000 --- a/deploy/core/node_modules/jshint/src/reporters/non_error.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -module.exports = { - reporter: function (results, data) { - var len = results.length, - str = '', - file, error, globals, unuseds; - - results.forEach(function (result) { - file = result.file; - error = result.error; - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason + '\n'; - }); - - str += len > 0 ? ("\n" + len + ' error' + ((len === 1) ? '' : 's')) : ""; - - data.forEach(function (data) { - file = data.file; - globals = data.implieds; - unuseds = data.unused; - - if (globals || unuseds) { - str += '\n\n' + file + ' :\n'; - } - - if (globals) { - str += '\tImplied globals:\n'; - globals.forEach(function (global) { - str += '\t\t' + global.name + ': ' + global.line + '\n'; - }); - } - if (unuseds) { - str += '\tUnused Variables:\n\t\t'; - unuseds.forEach(function (unused) { - str += unused.name + '(' + unused.line + '), '; - }); - } - }); - - if (str) { - process.stdout.write(str + "\n"); - } - } -}; diff --git a/deploy/core/node_modules/jshint/src/shared/messages.js b/deploy/core/node_modules/jshint/src/shared/messages.js deleted file mode 100644 index 61b43d1fa..000000000 --- a/deploy/core/node_modules/jshint/src/shared/messages.js +++ /dev/null @@ -1,214 +0,0 @@ -"use strict"; - -var _ = require("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' form line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer or 'false' and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: "Constant {a} was not declared correctly.", - E038: "Variable {a} was not declared correctly.", - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: "'{a}' is already defined and can't be redefined.", - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: "A generator function shall contain a yield statement.", - E048: "Let declaration not directly within block." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing pluses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", - W011: "Unexpected space after '{a}'.", - W012: "Unexpected space before '{a}'.", - W013: "Missing space after '{a}'.", - W014: "Bad line breaking before '{a}'.", - W015: "Expected '{a}' to have an indentation at {b} instead at {c}.", - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' unnecessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate key '{a}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: "Too many var statements.", - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Expected a conditional expression and instead saw an assignment.", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: "Mixed spaces and tabs.", - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: "Trailing whitespace.", - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is only available in JavaScript 1.7.", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option)." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: "Reserved words as properties can be used under the 'es5' option.", - I003: "ES5 option is now set per default" -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function (desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function (desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function (desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); diff --git a/deploy/core/node_modules/jshint/src/shared/vars.js b/deploy/core/node_modules/jshint/src/shared/vars.js deleted file mode 100644 index 796bd4da6..000000000 --- a/deploy/core/node_modules/jshint/src/shared/vars.js +++ /dev/null @@ -1,552 +0,0 @@ -// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - ElementTimeControl : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - SVGAElement : false, - SVGAltGlyphDefElement: false, - SVGAltGlyphElement : false, - SVGAltGlyphItemElement: false, - SVGAngle : false, - SVGAnimateColorElement: false, - SVGAnimateElement : false, - SVGAnimateMotionElement: false, - SVGAnimateTransformElement: false, - SVGAnimatedAngle : false, - SVGAnimatedBoolean : false, - SVGAnimatedEnumeration: false, - SVGAnimatedInteger : false, - SVGAnimatedLength : false, - SVGAnimatedLengthList: false, - SVGAnimatedNumber : false, - SVGAnimatedNumberList: false, - SVGAnimatedPathData : false, - SVGAnimatedPoints : false, - SVGAnimatedPreserveAspectRatio: false, - SVGAnimatedRect : false, - SVGAnimatedString : false, - SVGAnimatedTransformList: false, - SVGAnimationElement : false, - SVGCSSRule : false, - SVGCircleElement : false, - SVGClipPathElement : false, - SVGColor : false, - SVGColorProfileElement: false, - SVGColorProfileRule : false, - SVGComponentTransferFunctionElement: false, - SVGCursorElement : false, - SVGDefsElement : false, - SVGDescElement : false, - SVGDocument : false, - SVGElement : false, - SVGElementInstance : false, - SVGElementInstanceList: false, - SVGEllipseElement : false, - SVGExternalResourcesRequired: false, - SVGFEBlendElement : false, - SVGFEColorMatrixElement: false, - SVGFEComponentTransferElement: false, - SVGFECompositeElement: false, - SVGFEConvolveMatrixElement: false, - SVGFEDiffuseLightingElement: false, - SVGFEDisplacementMapElement: false, - SVGFEDistantLightElement: false, - SVGFEFloodElement : false, - SVGFEFuncAElement : false, - SVGFEFuncBElement : false, - SVGFEFuncGElement : false, - SVGFEFuncRElement : false, - SVGFEGaussianBlurElement: false, - SVGFEImageElement : false, - SVGFEMergeElement : false, - SVGFEMergeNodeElement: false, - SVGFEMorphologyElement: false, - SVGFEOffsetElement : false, - SVGFEPointLightElement: false, - SVGFESpecularLightingElement: false, - SVGFESpotLightElement: false, - SVGFETileElement : false, - SVGFETurbulenceElement: false, - SVGFilterElement : false, - SVGFilterPrimitiveStandardAttributes: false, - SVGFitToViewBox : false, - SVGFontElement : false, - SVGFontFaceElement : false, - SVGFontFaceFormatElement: false, - SVGFontFaceNameElement: false, - SVGFontFaceSrcElement: false, - SVGFontFaceUriElement: false, - SVGForeignObjectElement: false, - SVGGElement : false, - SVGGlyphElement : false, - SVGGlyphRefElement : false, - SVGGradientElement : false, - SVGHKernElement : false, - SVGICCColor : false, - SVGImageElement : false, - SVGLangSpace : false, - SVGLength : false, - SVGLengthList : false, - SVGLineElement : false, - SVGLinearGradientElement: false, - SVGLocatable : false, - SVGMPathElement : false, - SVGMarkerElement : false, - SVGMaskElement : false, - SVGMatrix : false, - SVGMetadataElement : false, - SVGMissingGlyphElement: false, - SVGNumber : false, - SVGNumberList : false, - SVGPaint : false, - SVGPathElement : false, - SVGPathSeg : false, - SVGPathSegArcAbs : false, - SVGPathSegArcRel : false, - SVGPathSegClosePath : false, - SVGPathSegCurvetoCubicAbs: false, - SVGPathSegCurvetoCubicRel: false, - SVGPathSegCurvetoCubicSmoothAbs: false, - SVGPathSegCurvetoCubicSmoothRel: false, - SVGPathSegCurvetoQuadraticAbs: false, - SVGPathSegCurvetoQuadraticRel: false, - SVGPathSegCurvetoQuadraticSmoothAbs: false, - SVGPathSegCurvetoQuadraticSmoothRel: false, - SVGPathSegLinetoAbs : false, - SVGPathSegLinetoHorizontalAbs: false, - SVGPathSegLinetoHorizontalRel: false, - SVGPathSegLinetoRel : false, - SVGPathSegLinetoVerticalAbs: false, - SVGPathSegLinetoVerticalRel: false, - SVGPathSegList : false, - SVGPathSegMovetoAbs : false, - SVGPathSegMovetoRel : false, - SVGPatternElement : false, - SVGPoint : false, - SVGPointList : false, - SVGPolygonElement : false, - SVGPolylineElement : false, - SVGPreserveAspectRatio: false, - SVGRadialGradientElement: false, - SVGRect : false, - SVGRectElement : false, - SVGRenderingIntent : false, - SVGSVGElement : false, - SVGScriptElement : false, - SVGSetElement : false, - SVGStopElement : false, - SVGStringList : false, - SVGStylable : false, - SVGStyleElement : false, - SVGSwitchElement : false, - SVGSymbolElement : false, - SVGTRefElement : false, - SVGTSpanElement : false, - SVGTests : false, - SVGTextContentElement: false, - SVGTextElement : false, - SVGTextPathElement : false, - SVGTextPositioningElement: false, - SVGTitleElement : false, - SVGTransform : false, - SVGTransformList : false, - SVGTransformable : false, - SVGURIReference : false, - SVGUnitTypes : false, - SVGUseElement : false, - SVGVKernElement : false, - SVGViewElement : false, - SVGViewSpec : false, - SVGZoomAndPan : false, - TimeEvent : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - DataView : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval: false -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - diff --git a/deploy/core/node_modules/jshint/src/stable/jshint.js b/deploy/core/node_modules/jshint/src/stable/jshint.js deleted file mode 100644 index bc1e2f9bc..000000000 --- a/deploy/core/node_modules/jshint/src/stable/jshint.js +++ /dev/null @@ -1,4561 +0,0 @@ -/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * 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. - * - */ - -/*jshint quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = require("underscore"); -var events = require("events"); -var vars = require("../shared/vars.js"); -var messages = require("../shared/messages.js"); -var Lexer = require("./lex.js").Lexer; -var reg = require("./reg.js"); -var state = require("./state.js").state; -var style = require("./style.js"); - -// We need this module here because environments such as IE and Rhino -// don't necessarilly expose the 'console' API and browserify uses -// it to log things. It's a sad state of affair, really. -var console = require("console-browserify"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - api, // Extension API - - // These are operators that should not be used with the ! operator. - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es3 : true, // if ES3 syntax should be allowed - es5 : true, // if ES5 syntax should be allowed (is now set per default) - esnext : true, // if es.next specific syntax should be allowed - moz : true, // if mozilla specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - gcl : true, // if JSHint should be compatible with Google Closure Linter - globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - passfail : true, // if the scan should stop on first error - phantom : true, // if PhantomJS symbols should be allowed - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true, // YUI variables should be predefined - - // Obsolete options - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false, // {int} max cyclomatic complexity per function - unused : true, // warn if variables are unused. Available options: - // false - don't check for unused variables - // true - "vars" + check last function param - // "vars" - skip checking unused function params - // "strict" - "vars" + check all function params - latedef : false // warn if the variable is used before its definition - // false - don't emit any warnings - // true - warn if any variable is used before its definition - // "nofunc" - warn for any variable but function declarations - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus: true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true, - strict : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows: "wsh", - sloppy : "strict" - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - noreach, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - warnings, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^[+-]W\d{3}$/g.test(name)) { - return true; - } - - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - if (t.type !== "jslint") { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.inES5(true) && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (_.has(o, n) && !_.has(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (state.option.es5) { - warning("I003"); - } - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - - // let's assume that chronologically ES3 < ES5 < ES6/ESNext < Moz - state.option.inMoz = function (strict) { - if (strict) { - return state.option.moz && !state.option.esnext; - } - return state.option.moz; - }; - state.option.inESNext = function (strict) { - if (strict) { - return !state.option.moz && state.option.esnext; - } - return state.option.moz || state.option.esnext; - }; - state.option.inES5 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && !state.option.es3; - } - return !state.option.es3; - }; - state.option.inES3 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && state.option.es3; - } - return state.option.es3; - }; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, code, token, a) { - return JSHINT.undefs.push([scope, code, token, a]); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (state.ignored[code]) - return; - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - if (state.option.passfail) { - quit("E042", l, ch); - } - - warnings += 1; - if (warnings >= state.option.maxerr) { - quit("E043", l, ch); - } - - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - function addlabel(t, type, tkn, islet) { - // Define t in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], t)) { - if (funct[t] !== true && !state.option.node) { - warning("W002", state.tokens.next, t); - } - } - } - - if (_.has(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - } else { - if (!state.option.shadow && type !== "exception" || - (funct["(blockscope)"].getlabel(t))) { - warning("W004", state.tokens.next, t); - } - } - } - - // a double definition of a let variable in same block throws a TypeError - if (funct["(blockscope)"] && funct["(blockscope)"].current.has(t)) { - error("E044", state.tokens.next, t); - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(t, type, state.tokens.curr); - } else { - - funct[t] = type; - - if (tkn) { - funct["(tokens)"][t] = tkn; - } - - if (funct["(global)"]) { - global[t] = funct; - if (_.has(implied, t)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function (g) { - g = g.split(":"); - var key = g[0]; - var val = g[1]; - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - updatePredefined(); - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function (e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function (m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\b", "\b") - .replace("\\t", "\t") - .replace("\\n", "\n") - .replace("\\v", "\v") - .replace("\\f", "\f") - .replace("\\r", "\r") - .replace("\\\\", "\\") - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - - // GH988 - numeric options can be disabled by setting them to `false` - if (val !== "false") { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - if (key === "indent") { - state.option["(explicitIndent)"] = true; - } - state.option[key] = val; - } else { - if (key === "indent") { - state.option["(explicitIndent)"] = false; - } else { - state.option[key] = false; - } - } - - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - if (funct["(global)"]) { - error("E009"); - } else { - if (val === "true" || val === "false") { - state.option.validthis = (val === "true"); - } else { - error("E002", nt); - } - } - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - var match = /^([+-])(W\d{3})$/g.exec(key); - if (match) { - // ignore for -W..., unignore for +W... - state.ignored[match[2]] = (match[1] === "-"); - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = renamedOptions[key] || key; - state.option[tn] = (val === "true"); - - if (invertedOptions[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - assume(); - } - } - - // We need a peek function. If it has an argument, it peeks that much farther - // ahead. It is used to distinguish - // for ( var i in ... - // from - // for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (state.tokens.curr.type === "(string)" || state.tokens.curr.identifier) { - anonname = state.tokens.curr.value; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.check) { - state.tokens.next.check(); - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - // This is the heart of JSHINT, the Pratt parser. In addition to parsing, it - // is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is - // like .nud except that it is only used on the first token of a statement. - // Having .fud makes it much easier to define statement-oriented languages like - // JavaScript. I retained Pratt's nomenclature. - - // .nud Null denotation - // .fud First null denotation - // .led Left denotation - // lbp Left binding power - // rbp Right binding power - - // They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false, isLetExpr = false; - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.syntax["let"].fud.call(state.syntax["let"].fud, false); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - advance(); - - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = state.tokens.curr.value; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - var end_of_expr = state.tokens.next.identifier && - !state.tokens.curr.led && - state.tokens.curr.line !== state.tokens.next.line; - while (rbp < state.tokens.next.lbp && !end_of_expr) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && (left.character !== right.from || left.line !== right.line)) { - warning("W012", right, right.value); - } - } - - function nospace(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - - if (left.value === ";" && right.value === ";") { - return; - } - - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== right.line) { - warning("W014", right, right.id); - } else if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function indentation(bias) { - if (!state.option.white && !state.option["(explicitIndent)"]) { - return; - } - - if (state.tokens.next.id === "(end)") { - return; - } - - var i = indent + (bias || 0); - if (state.tokens.next.from !== i) { - warning("W015", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== state.tokens.next.line) { - warning("E022", t, t.value); - } - } - - - function comma(opts) { - opts = opts || {}; - - if (state.tokens.curr.line !== state.tokens.next.line) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", state.tokens.curr, state.tokens.next.id); - } - } else if (!state.tokens.curr.comment && - state.tokens.curr.character !== state.tokens.next.from && state.option.white) { - state.tokens.curr.from += (state.tokens.curr.character - state.tokens.curr.from); - warning("W011", state.tokens.curr, state.tokens.curr.value); - } - - advance(","); - - // TODO: This is a temporary solution to fight against false-positives in - // arrays and objects with trailing commas (see GH-363). The best solution - // would be to extract all whitespace rules out of parser. - - if (state.tokens.next.value !== "]" && state.tokens.next.value !== "}") { - nonadjacent(state.tokens.curr, state.tokens.next); - } - - if (state.tokens.next.identifier && !state.option.inES5()) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "yield": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return true; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - return true; - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - return symbol(s, 0); - } - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - return this; - }; - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, function () { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - return x; - } - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function application(s) { - var x = symbol(s, 42); - - x.led = function (left) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "arrow function syntax (=>)"); - } - - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - - this.left = left; - this.right = doFunction(undefined, undefined, false, left); - return this; - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function (left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", right, "!"); - } - - this.left = left; - this.right = right; - return this; - }; - return x; - } - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (left) { - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - - that.right = expression(19); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function (t) { - if (funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - that.right = expression(19); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - nonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(19); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function (left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop) { - if (!state.tokens.next.identifier) { - return; - } - - advance(); - - var curr = state.tokens.curr; - var meta = curr.meta || {}; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.inES5() || meta.isFutureReservedWord) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - // Display an info message about reserved words as properties - // and ES5 but do it only once. - if (prop && !api.getCache("displayed:I002")) { - api.setCache("displayed:I002", true); - warning("I002"); - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop); - if (i) { - return i; - } - if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { - warning("W025"); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (state.tokens.next.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!state.option.latedef) { - break; - } - - warning("W026", t); - break; - } - - warning("W027", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var values; - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord) { - warning("W024", t, t.id); - res = false; - } - - // detect a destructuring assignment - if (_.has(["[", "{"], t.value)) { - if (lookupBlockType().isDestAssign) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - values = destructuringExpression(); - values.forEach(function (tok) { - isundef(funct, "W117", tok.token, tok.id); - }); - advance("="); - destructuringExpressionMatch(values, expression(0, true)); - advance(";"); - return; - } - } - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - - while (state.tokens.next.id === ",") { - if (comma()) { - r = expression(0, true); - } else { - return; - } - } - - if (state.tokens.next.id !== ";") { - if (!state.option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!state.option.lastsemic || state.tokens.next.id !== "}" || - state.tokens.next.line !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - adjacent(state.tokens.curr, state.tokens.next); - advance(";"); - nonadjacent(state.tokens.curr, state.tokens.next); - } - } - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement(startLine === state.tokens.next.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("W033", state.tokens.next); - } else { - p = pn; - } - } else if (p.id === "}") { - // Directive with no other statements, warn about missing semicolon - warning("W033", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) - state.option.newcap = true; - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc, isfatarrow) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - if (line !== state.tokens.next.line) { - indentation(); - } - } else if (line !== state.tokens.next.line) { - indentation(); - } - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - if (stmt && !isfatarrow && !state.option.inMoz(true)) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - if (!stmt) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - } - expression(0); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - noreach = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement(state.tokens.next.line === state.tokens.curr.line)]; - indent -= state.option.indent; - noreach = false; - - delete funct["(nolet)"]; - } - funct["(verb)"] = null; - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035"); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value, line = tkn.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - var block; - if (_.has(funct, "(blockscope)")) { - block = funct["(blockscope)"].getlabel(v); - } - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && (state.tokens.next.value === "." || - state.tokens.next.value === "["))) { - - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - } - } - - note_implied(state.tokens.curr); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // - // display warning if we're inside of typeof or delete. - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && - (state.tokens.next.value === "." || state.tokens.next.value === "["))) { - - isundef(funct, "W117", state.tokens.curr, v); - } - funct[v] = true; - note_implied(state.tokens.curr); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - led: function () { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (state.directive["use strict"] && !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) - warning("W116", this, "===", "=="); - else if (isPoorRelation(left)) - warning("W041", this, "===", left.value); - else if (isPoorRelation(right)) - warning("W041", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("W007"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("W006"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("W051"); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (state.option.bitwise) { - warning("W052", this, "~"); - } - expression(150); - return this; - }); - - prefix("...", function () { - if (!state.option.inESNext()) { - warning("W104", this, "spread/rest operator"); - } - if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.value); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("W053", state.tokens.prev, c.value); - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - adjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(state.tokens.prev, state.tokens.curr); - nobreak(); - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - warning("W061"); - } - - return that; - }, 160, true); - - infix("(", function (left, that) { - if (state.tokens.prev.id !== "}" && state.tokens.prev.id !== ")") { - nobreak(state.tokens.prev, state.tokens.curr); - } - - nospace(); - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - nospace(state.tokens.prev, state.tokens.curr); - - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("W067", left); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - - nospace(); - var bracket, brackets = []; - var pn, pn1, i = 0; - - do { - pn = peek(i); - i += 1; - pn1 = peek(i); - i += 1; - } while (pn.value !== ")" && pn1.value !== "=>" && pn1.value !== ";" && pn1.type !== "(end)"); - - if (state.tokens.next.id === "function") { - state.tokens.next.immed = true; - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - if (pn1.value === "=>" && state.tokens.next.value === "{") { - bracket = state.tokens.next; - bracket.left = destructuringExpression(); - brackets.push(bracket); - for (var t in bracket.left) { - exprs.push(bracket.left[t].token); - } - } else { - exprs.push(expression(0)); - } - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")", this); - nospace(state.tokens.prev, state.tokens.curr); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - (state.tokens.next.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning("W068", this); - } - } - - if (state.tokens.next.value === "=>") { - return exprs; - } - return exprs[0]; - }); - - application("=>"); - - infix("[", function (left, that) { - nobreak(state.tokens.prev, state.tokens.curr); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("W061", that); - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - nospace(state.tokens.prev, state.tokens.curr); - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - res.right = expression(0); - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(0); - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(0); - advance(")"); - } - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function () { - var blocktype = lookupBlockType(true); - if (blocktype.isCompArray) { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== state.tokens.next.line; - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!state.option.inES5()) - warning("W070"); - advance(","); - } - if (state.tokens.next.id === "]") { - break; - } - if (b && state.tokens.curr.line !== state.tokens.next.line) { - indentation(); - } - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(false, true); - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - advance(); - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - advance(); - } - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - - function functionparams(parsed) { - var curr, next; - var params = []; - var ident; - var tokens = []; - var t; - - if (parsed) { - if (parsed instanceof Array) { - for (var i in parsed) { - curr = parsed[i]; - if (_.contains(["{", "["], curr.id)) { - for (t in curr.left) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (curr.value === "...") { - if (!state.option.inESNext()) { - warning("W104", curr, "spread/rest operator"); - } - continue; - } else { - addlabel(curr.value, "unused", curr); - } - } - return params; - } else { - if (parsed.identifier === true) { - addlabel(parsed.value, "unused", parsed); - return [parsed]; - } - } - } - - next = state.tokens.next; - - advance("("); - nospace(); - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (state.tokens.next.value === "...") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "spread/rest operator"); - } - advance("..."); - nospace(); - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } else { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } - if (state.tokens.next.id === ",") { - comma(); - } else { - advance(")", next); - nospace(state.tokens.prev, state.tokens.curr); - return params; - } - } - } - - - function doFunction(name, statement, generator, fatarrowparams) { - var f; - var oldOption = state.option; - var oldIgnored = state.ignored; - var oldScope = scope; - - state.option = Object.create(state.option); - state.ignored = Object.create(state.ignored); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : state.tokens.next.line, - "(character)" : state.tokens.next.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(state.tokens.next), - "(scope)" : scope, - "(statement)" : statement, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)" : funct["(comparray)"] - }; - - if (generator) { - funct["(generator)"] = true; - } - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(fatarrowparams); - - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, true, true, fatarrowparams ? true:false); - - if (generator && funct["(generator)"] !== "yielded") { - error("E047", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - state.ignored = oldIgnored; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function parseCondAssignment() { - switch (state.tokens.next.id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!state.option.boss) { - warning("W084"); - } - - advance(state.tokens.next.id); - expression(20); - } - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t, g; - var props = {}; // All properties, including accessors - - function saveProperty(name, tkn) { - if (props[name] && _.has(props, name)) - warning("W075", state.tokens.next, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basictkn = tkn; - } - - function saveSetter(name, tkn) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].setter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = tkn; - } - - function saveGetter(name) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].getter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = state.tokens.curr; - } - - b = state.tokens.curr.line !== state.tokens.next.line; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - if (b) { - indentation(); - } - - if (state.tokens.next.value === "get" && peek().id !== ":") { - advance("get"); - - if (!state.option.inES5(true)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveGetter(i); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (p) { - warning("W076", t, p[0], i); - } - - adjacent(state.tokens.curr, state.tokens.next); - } else if (state.tokens.next.value === "set" && peek().id !== ":") { - advance("set"); - - if (!state.option.inES5(true)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - saveSetter(i, state.tokens.next); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (!p || p.length !== 1) { - warning("W077", t, i); - } - } else { - g = false; - if (state.tokens.next.value === "*" && state.tokens.next.type === "(punctuator)") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "generator functions"); - } - advance("*"); - g = true; - } - i = property_name(); - saveProperty(i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - - if (state.tokens.next.value === "(") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "concise methods"); - } - doFunction(i, undefined, g); - } else { - advance(":"); - nonadjacent(state.tokens.curr, state.tokens.next); - expression(10); - } - } - - countMember(i); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (state.option.inES5()) { - for (var name in props) { - if (_.has(props, name) && props[name].setter && !props[name].getter) { - warning("W078", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function () { - var ident; - if (_.contains(["[", "{"], state.tokens.next.value)) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (state.tokens.next.value === ",") { - identifiers.push({ id: null, token: state.tokens.curr }); - } else { - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - } - }; - if (state.tokens.next.value === "[") { - advance("["); - nextInnerDE(); - while (state.tokens.next.value !== "]") { - advance(","); - nextInnerDE(); - } - advance("]"); - } else if (state.tokens.next.value === "{") { - advance("{"); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (state.tokens.next.value !== "}") { - advance(","); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - function destructuringExpressionMatch(tokens, value) { - if (value.first) { - _.zip(tokens, value.first).forEach(function (val) { - var token = val[0]; - var value = val[1]; - if (token && value) { - token.first = value; - } else if (token && token.first && !value) { - warning("W080", token.first, token.first.value); - } /* else { - XXX value is discarded: wouldn't it need a warning ? - } */ - }); - } - } - - var conststatement = stmt("const", function (prefix) { - var tokens, value; - // state variable to know if it is a lone identifier, or a destructuring statement. - var lone; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "const"); - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "const"); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var tokens, lone, value; - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "unused", t.token); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E038", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - var letstatement = stmt("let", function (prefix) { - var tokens, lone, value, letblock; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, "unused", t.token, true); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.curr, state.tokens.curr.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - error("E037", state.tokens.next, state.tokens.next.value); - } - value = expression(0); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.inESNext(true)) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = identifier(); - if (funct[i] === "const") { - warning("E011", null, i); - } - adjacent(state.tokens.curr, state.tokens.next); - addlabel(i, "unction", state.tokens.curr); - - doFunction(i, { statement: true }, generator); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - var i = optionalidentifier(); - if (i || state.option.gcl) { - adjacent(state.tokens.curr, state.tokens.next); - } else { - nonadjacent(state.tokens.curr, state.tokens.next); - } - doFunction(i, undefined, generator); - if (!state.option.loopfunc && funct["(loopage)"]) { - warning("W083"); - } - return this; - }); - - blockstmt("if", function () { - var t = state.tokens.next; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - if (state.tokens.next.id === "else") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(state.tokens.curr, state.tokens.next); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = { - "(name)" : "(catch)", - "(line)" : state.tokens.next.line, - "(character)": state.tokens.next.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(state.tokens.next), - "(catch)" : true, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)": funct["(comparray)"] - }; - - if (e) { - addlabel(e, "exception"); - } - - if (state.tokens.next.value === "if") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(false); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.inMoz(true))) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(false); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = state.tokens.next, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - advance("{"); - nonadjacent(state.tokens.curr, state.tokens.next); - indent += state.option.indent; - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - indentation(-state.option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - indentation(-state.option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= state.option.indent; - indentation(); - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!state.option.debug) { - warning("W087"); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = state.tokens.next; - nonadjacent(state.tokens.curr, t); - advance("("); - nospace(); - expression(20); - parseCondAssignment(); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && - nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!state.option.inESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud, true); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud, true); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - if (!funct["(blockscope)"].getlabel(state.tokens.next.value)) - warning("W088", state.tokens.next, state.tokens.next.value); - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - s = block(true, true); - if (state.option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("W089", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - expression(20); - parseCondAssignment(); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";") { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - stmt("yield", function () { - if (state.option.inESNext(true) && funct["(generator)"] !== true) { - error("E046", state.tokens.curr, "yield"); - } else if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface"); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("throws"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine wether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function () { - var pn, pn1; - var i = 0; - var bracketStack = 0; - var ret = {}; - if (_.contains(["[", "{"], state.tokens.curr.value)) - bracketStack += 1; - if (_.contains(["[", "{"], state.tokens.next.value)) - bracketStack += 1; - if (_.contains(["]", "}"], state.tokens.next.value)) - bracketStack -= 1; - do { - pn = peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (_.contains(["[", "{"], pn.value)) { - bracketStack += 1; - } else if (_.contains(["]", "}"], pn.value)) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (_.contains(["}", "]"], pn.value) && pn1.value === "=") { - ret.isDestAssign = true; - ret.notJson = true; - break; - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)" && i < 15); - return ret; - }; - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!state.option.inESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function () { - var CompArray = function () { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function (elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function (elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return {stack: function () { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function () { - _current.variables.filter(function (v) { - if (v.unused) - warning("W098", v.token, v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(_carrays[_carrays.length - 1], 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function (s) { - if (_.contains(["use", "define", "filter"], s)) - _current.mode = s; - }, - check: function (v) { - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false}); - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true}); - } - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (state.tokens.curr.character !== state.tokens.next.from) { - warning("W011", state.tokens.curr); - } - adjacent(state.tokens.curr, state.tokens.next); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function () { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function () { - _current = {}; - _variables.push(_current); - }, - - unstack: function () { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function (l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l)) { - return _variables[i]; - } - } - }, - - current: { - has: function (t) { - return _.has(_current, t); - }, - add: function (t, type, tok) { - _current[t] = { "(type)" : type, - "(token)": tok }; - } - } - }; - }; - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - var newIgnoredObj = {}; - - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - - a.forEach(function (item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - newIgnoredObj[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj["(explicitIndent)"] = o[optionKeys[x]] === false ? false : true; - } - } - } - - state.option = newOptionObj; - state.ignored = newIgnoredObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(state.tokens.next), - "(blockscope)": blockScope(), - "(comparray)": arrayComprehension() - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - warnings = 0; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function (name) { - return state.option[name] || null; - }, - - getCache: function (name) { - return state.cache[name]; - }, - - setCache: function (name, value) { - state.cache[name] = value; - }, - - warn: function (code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function (names, listener) { - names.split(" ").forEach(function (name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function (func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - lex = new Lexer(s); - - lex.on("warning", function (ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function (ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function (ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function (ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function (ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function (ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict && !state.option.node) { - warning("W097", state.tokens.prev); - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.character; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - warningAt("W098", line, chr, name); - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) { - return; - } - - warnUnused(key, tkn, "var"); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_opt; - - while (param) { - type = func[param]; - unused_opt = func["(unusedOption)"] || state.option.unused; - unused_opt = unused_opt === true ? "last-param" : unused_opt; - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], "param", func["(unusedOption)"]); - } else if (unused_opt === "last-param") { - return; - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function (func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: state.option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} diff --git a/deploy/core/node_modules/jshint/src/stable/lex.js b/deploy/core/node_modules/jshint/src/stable/lex.js deleted file mode 100644 index 22efb35c4..000000000 --- a/deploy/core/node_modules/jshint/src/stable/lex.js +++ /dev/null @@ -1,1691 +0,0 @@ -/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = require("underscore"); -var events = require("events"); -var reg = require("./reg.js"); -var state = require("./state.js").state; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9 -}; - -// This is auto generated from the unicode tables. -// The tables are at: -// http://www.fileformat.info/info/unicode/category/Lu/list.htm -// http://www.fileformat.info/info/unicode/category/Ll/list.htm -// http://www.fileformat.info/info/unicode/category/Lt/list.htm -// http://www.fileformat.info/info/unicode/category/Lm/list.htm -// http://www.fileformat.info/info/unicode/category/Lo/list.htm -// http://www.fileformat.info/info/unicode/category/Nl/list.htm - -var unicodeLetterTable = [ - 170, 170, 181, 181, 186, 186, 192, 214, - 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, - 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, - 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, - 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, - 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, - 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, - 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, - 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361, - 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, - 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, - 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, - 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, - 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, - 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, - 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, - 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, - 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, - 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, - 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, - 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, - 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, - 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, - 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, - 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, - 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, - 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, - 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, - 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, - 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, - 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, - 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, - 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346, - 4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696, - 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, - 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, - 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, - 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, - 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, - 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, - 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, - 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, - 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141, - 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, - 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, - 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, - 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, - 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, - 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, - 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, - 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, - 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, - 11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621, - 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, - 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, - 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, - 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, - 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, - 12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312, - 19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124, - 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, - 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, - 42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921, - 43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042, - 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, - 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, - 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, - 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, - 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, - 43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798, - 43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032, - 55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045, - 64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279, - 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, - 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, - 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, - 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, - 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, - 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, - 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, - 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, - 66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511, - 66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592, - 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, - 67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115, - 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, - 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, - 69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894, - 92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964, - 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, - 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, - 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, - 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, - 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, - 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, - 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, - 131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972, - 177984, 177984, 178205, 178205, 194560, 195101 -]; - -var identifierStartTable = []; - -for (var i = 0; i < 128; i++) { - identifierStartTable[i] = - i === 36 || // $ - i >= 65 && i <= 90 || // A-Z - i === 95 || // _ - i >= 97 && i <= 122; // a-z -} - -var identifierPartTable = []; - -for (var i = 0; i < 128; i++) { - identifierPartTable[i] = - identifierStartTable[i] || // $, _, A-Z, a-z - i >= 48 && i <= 57; // 0-9 -} - -// Object that handles postponed lexing verifications that checks the parsed -// environment state. - -function asyncTrigger() { - var _checks = []; - - return { - push: function (fn) { - _checks.push(fn); - }, - - check: function () { - for (var check in _checks) { - _checks[check](); - } - - _checks.splice(0, _checks.length); - } - }; -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function (data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - - if (lines[0] && lines[0].substr(0, 2) === "#!") { - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.lines = lines; - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - get lines() { - this._lines = state.lines; - return this._lines; - }, - - set lines(val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function (i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function (i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function (data) { - * // ... - * }); - */ - on: function (names, listener) { - names.split(" ").forEach(function (name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function () { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Postpone a token event. the checking condition is set as - * last parameter, and the trigger function is called in a - * stored callback. To be later called using the check() function - * by the parser. This avoids parser's peek() to give the lexer - * a false context. - */ - triggerAsync: function (type, args, checks, fn) { - checks.push(function () { - if (fn()) { - this.trigger(type, args); - } - }.bind(this)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function () { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - if (this.peek(1) === "." && this.peek(2) === ".") { - return { - type: Token.Punctuator, - value: "..." - }; - } - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "{": - case "}": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: ">>=" - }; - } - - // Fat arrow punctuator - if (ch1 === "=" && ch2 === ">") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. We need to make sure that this is an - // operator and not a regular expression. - - if (ch1 === "/") { - if (ch2 === "=" && /\/=(?!(\S*\/[gim]?))/.test(this.input)) { - // /= is not a part of a regular expression, return it as a - // punctuator. - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function () { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - special.forEach(function (str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function () { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function () { - var id = ""; - var index = 0; - var type, char; - - // Detects any character in the Unicode categories "Uppercase - // letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter - // (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or - // "Letter number (Nl)". - // - // Both approach and unicodeLetterTable were borrowed from - // Google's Traceur. - - function isUnicodeLetter(code) { - for (var i = 0; i < unicodeLetterTable.length;) { - if (code < unicodeLetterTable[i++]) { - return false; - } - - if (code <= unicodeLetterTable[i++]) { - return true; - } - } - - return false; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function () { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (isUnicodeLetter(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: id - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function () { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - index += 1; - value += char; - - while (index < length) { - char = this.peek(index); - if (!isHexDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 16, - isMalformed: false - }; - } - - // Base-8 numbers. - if (isOctalDigit(char)) { - index += 1; - value += char; - bad = false; - - while (index < length) { - char = this.peek(index); - - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - - if (isDecimalDigit(char)) { - bad = true; - } else if (!isOctalDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 8, - isMalformed: false - }; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 10, - isMalformed: !isFinite(value) - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function (checks) { - /*jshint loopfunc:true */ - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - this.triggerAsync("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }, checks, function () { return state.jsonMode && quote !== "\""; }); - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - this.triggerAsync("warning", { - code: "W043", - line: this.line, - character: this.char - }, checks, function () { return !state.option.multistr; }); - - this.triggerAsync("warning", { - code: "W042", - line: this.line, - character: this.char - }, checks, function () { return state.jsonMode && state.option.multistr; }); - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - isUnclosed: true, - quote: quote - }; - } - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - - if (char === "\\") { - this.skip(); - char = this.peek(); - - switch (char) { - case "'": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }, checks, function () {return state.jsonMode; }); - break; - case "b": - char = "\b"; - break; - case "f": - char = "\f"; - break; - case "n": - char = "\n"; - break; - case "r": - char = "\r"; - break; - case "t": - char = "\t"; - break; - case "0": - char = "\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, - function () { return n >= 0 && n <= 7 && state.directive["use strict"]; }); - break; - case "u": - char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16)); - jump = 5; - break; - case "v": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }, checks, function () { return state.jsonMode; }); - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }, checks, function () { return state.jsonMode; }); - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - case "\"": - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - case "!": - if (value.slice(value.length - 2) === "<") { - break; - } - - /*falls through */ - default: - // Weird escaping. - this.trigger("warning", { - code: "W044", - line: this.line, - character: this.char - }); - } - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function () { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function () { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurence of mixed tabs and spaces. If smarttabs option - * is on, ignore tabs followed by spaces. - * - * Tabs followed by one space followed by a block comment are allowed. - */ - scanMixedSpacesAndTabs: function () { - var at, match; - - if (state.option.smarttabs) { - // Negative look-behind for "//" - match = this.input.match(/(\/\/|^\s?\*)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = this.input.search(/ \t|\t [^\*]/); - } - - return at; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function () { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function (checks) { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - - if (this.peek() === "") { // EOL - if (!/^\s*$/.test(this.lines[this.line - 1]) && state.option.trailing) { - this.trigger("warning", { code: "W102", line: this.line, character: start }); - } - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(checks); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for mixed spaces and tabs - * and other minor warnings. - */ - nextLine: function () { - var char; - - if (this.line >= this.lines.length) { - return false; - } - - this.input = this.lines[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - char = this.scanMixedSpacesAndTabs(); - if (char >= 0) { - this.trigger("warning", { code: "W099", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function () { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It retuns a token in a JSLint-compatible format. - */ - token: function () { - /*jshint loopfunc:true */ - var checks = asyncTrigger(); - var token; - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - - if (token.meta && token.meta.isFutureReservedWord) { - // ES3 FutureReservedWord in an ES5 environment. - if (state.option.inES5(true) && !token.meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (token.meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function (type, value, isProperty) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - obj.check = checks.check; - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(checks); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.triggerAsync("String", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - quote: token.quote - }, checks, function () { return true; }); - - return create("(string)", token.value); - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === "."); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }, checks, function () { return token.base === 16 && state.jsonMode; }); - - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, function () { - return state.directive["use strict"] && token.base === 8; - }); - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; diff --git a/deploy/core/node_modules/jshint/src/stable/reg.js b/deploy/core/node_modules/jshint/src/stable/reg.js deleted file mode 100644 index 5a54a3176..000000000 --- a/deploy/core/node_modules/jshint/src/stable/reg.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use string"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; diff --git a/deploy/core/node_modules/jshint/src/stable/state.js b/deploy/core/node_modules/jshint/src/stable/state.js deleted file mode 100644 index 1dc0d800e..000000000 --- a/deploy/core/node_modules/jshint/src/stable/state.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -var state = { - syntax: {}, - - reset: function () { - this.tokens = { - prev: null, - next: null, - curr: null - }, - - this.option = {}; - this.ignored = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - } -}; - -exports.state = state; diff --git a/deploy/core/node_modules/jshint/src/stable/style.js b/deploy/core/node_modules/jshint/src/stable/style.js deleted file mode 100644 index bb1b3658f..000000000 --- a/deploy/core/node_modules/jshint/src/stable/style.js +++ /dev/null @@ -1,171 +0,0 @@ -"use strict"; - -exports.register = function (linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for dangling underscores. - - linter.on("Identifier", function style_scanDangling(data) { - if (!linter.getOption("nomen")) { - return; - } - - // Underscore.js - if (data.name === "_") { - return; - } - - // In Node, __dirname and __filename should be ignored. - if (linter.getOption("node")) { - if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { - return; - } - } - - if (/^(_+.*|.*_+)$/.test(data.name)) { - linter.warn("W105", { - line: data.line, - char: data.from, - data: [ "dangling '_'", data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+/, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; \ No newline at end of file From ceb705b3cd28ff0e795580a2709e5b8d1b97eee8 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 14 Jan 2016 08:32:11 -0500 Subject: [PATCH 578/656] Remove jshint styling skin styling moved to plugin. structure styling was unused --- deploy/core/css/skins/new-dark.css | 18 ------------------ deploy/core/css/skins/new-dark.stylus | 4 ---- deploy/core/css/structure.css | 3 --- 3 files changed, 25 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 167582890..5a062c5a5 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -564,24 +564,6 @@ input { .CodeMirror .watched { border-bottom: 1px solid #7ffffd; } -.hintwrapper { - padding: 2px 0; - padding-bottom: 5px; - padding-left: 12px; - box-sizing: border-box; -} -.jshinterrors { - display: inline-block; - box-sizing: border-box; - padding: 2px 10px; - border-radius: 0px; - background: #73404c; - color: #ffa6a6; -} -.hintwrapper .spacer { - display: inline-block; - white-space: pre; -} .behavior-helper-line { z-index: 10 !important; } diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index 17e9e50de..2e1e226b2 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -249,10 +249,6 @@ input { color: $highlight-fg; background:$highlight-bg; } .watch-result { display:inline-block; padding-left:2px; vertical-align:top; background:$usage-bg; color:$usage-fg; border-radius:0px; } .CodeMirror .watched { border-bottom:1px solid $usage-fg; } -.hintwrapper { padding:2px 0; padding-bottom:5px; padding-left:12px; box-sizing:border-box; } -.jshinterrors { display:inline-block; box-sizing:border-box; padding:2px 10px; border-radius:0px; background:$error-bg; color:$error-fg; } -.hintwrapper .spacer { display:inline-block; white-space:pre; } - .behavior-helper-line { z-index:10 !important; } .behavior-helper-result { padding-left:10px; margin:0; z-index:10; display:inline-block; width:0; height:10px; overflow:visible; } .behavior-helper-result div { z-index:10; white-space:nowrap; display:inline-block; padding-top:0px; padding-bottom:0px; margin-left:0px; padding-left:0px; box-sizing:border-box; background:none; color:$usage-fg; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 0a68a28fb..5aa813bf5 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -349,9 +349,6 @@ body { -webkit-user-select: none; } .gitmark { height:1em; background:#5fa; display:inline-block; width:5px; } .gitmodified { height:1em; background:#b5f; display:inline-block; width:5px; } -.jshintmarks { width:5px; } -.jshinterror { height:1em; display:inline-block; width:5px; } - .inline-doc { line-height:1.1em; margin-left:-10px; padding:5px 20px; border-radius:0px; } .inline-doc h1 span { font-size:10pt; } .inline-doc h1 { font-size:100%; margin:0; } From bbbcf365b6c3ed6d4181afd44c153e92dcccd753 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 14 Jan 2016 08:49:40 -0500 Subject: [PATCH 579/656] Remove harbor package that has moved to JavaScript plugin --- deploy/core/node_modules/harbor/.npmignore | 8 - deploy/core/node_modules/harbor/History.md | 20 -- deploy/core/node_modules/harbor/README.md | 127 ------------- .../node_modules/harbor/examples/harbor.js | 12 -- deploy/core/node_modules/harbor/index.js | 3 - deploy/core/node_modules/harbor/lib/harbor.js | 176 ------------------ deploy/core/node_modules/harbor/package.json | 35 ---- 7 files changed, 381 deletions(-) delete mode 100644 deploy/core/node_modules/harbor/.npmignore delete mode 100644 deploy/core/node_modules/harbor/History.md delete mode 100644 deploy/core/node_modules/harbor/README.md delete mode 100644 deploy/core/node_modules/harbor/examples/harbor.js delete mode 100644 deploy/core/node_modules/harbor/index.js delete mode 100644 deploy/core/node_modules/harbor/lib/harbor.js delete mode 100644 deploy/core/node_modules/harbor/package.json diff --git a/deploy/core/node_modules/harbor/.npmignore b/deploy/core/node_modules/harbor/.npmignore deleted file mode 100644 index a9f79f513..000000000 --- a/deploy/core/node_modules/harbor/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -docs/ -benchmark/ -test/ -coverage.html -lib-cov -.travis.yml -Makefile -*.swp diff --git a/deploy/core/node_modules/harbor/History.md b/deploy/core/node_modules/harbor/History.md deleted file mode 100644 index 7f6200876..000000000 --- a/deploy/core/node_modules/harbor/History.md +++ /dev/null @@ -1,20 +0,0 @@ - -0.2.0 / 2012-08-10 -================== - - * remove debug dep - * update readme - * conform tests to new export - * refactor main export - * Release 0.1.1 - * bug fix - send callback when trying to claim already existing port - -0.1.1 / 2012-08-07 -================== - - * bug fix - send callback when trying to claim already existing port - -0.1.0 / 2012-08-07 -================== - - * initial commit diff --git a/deploy/core/node_modules/harbor/README.md b/deploy/core/node_modules/harbor/README.md deleted file mode 100644 index 2d2905ff2..000000000 --- a/deploy/core/node_modules/harbor/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# Harbor - -> TCP port availability and assignment utility. - -Harbor is a small little tool to find available TCP ports within a given range. It will remember -what server is assigned to each port, or which ports are unavailable due to system assignment. - -## Installation - -Harbor can be installed via [npm](http://npmjs.org). - -```sh -npm install harbor -``` - -## Quick Start - -Invoke the `harbor` primary export with a lower and upper bounds of port number to query. Then -claim a service name to query for an available port. - -```js -var harbor = require('harbor')(1227, 1337); - -harbor.claim('awesomeness', function (err, port) { - if (err) throw err; - console.log(port); // 1227 -}); -``` - -## API Reference - -### Harbor - -The primary export is a factory, but you can also create new Harbors manually. - -```js -var Harbor = require('harbor') - , harbor = new Harbor(1227, 1337); -``` - -The `harbor` constructor object is also an event emitter. - -- `claim (name, port)` upon claim of a port -- `release (name, port)` upon release of a port -- `full` upon all ports being claimed - -Should you run out of ports, you can adjust the `harbor.min` or `harbor.max` to your needs. - -#### .claim (name, cb) - -- **@param** _{String}_ service name -- **@param** _{Function}_ callback - -Find an available port for a named service. Names must be unique within a given Harbor. If -a claim for a name that already exists, the already assigned port will be returned. - -Will emit `claim` event for new, successful claims. Alternatively could emit `full` event in -addition to returning an error in the callback. - -```js -harbor.claim('awesomeness', function (err, port) { - if (err) throw err; // will occur if all available ports are claimed - console.log(port); // 1227 -}); -``` - -#### .release (name) - -- **@param** _{String}_ service name - -Indicate that the claimed port for `name` is no longer in use and can be returned -to the pool of available ports. - -Will emit `release` event if the port was previously claimed. Releasing a service -name that does not exist has no impact. - -```js -harbor.release('awesomeness'); -``` - -#### .claimed - -- **@returns** _{Array}_ claimed ports - -Get an array of all claimed ports by this harbor interface. Does not include -ports that are in use by system services within the harbor range. - -## Tests - -Tests are written in the BDD styles for the [Mocha](http://visionmedia.github.com/mocha) -test runner using the `should` assertion interface from [Chai](http://chaijs.com). -Running tests is simple: - - make test - -## Contributing - -Interested in contributing? Fork to get started. Contact [@logicalparadox](http://github.com/logicalparadox) -if you are interested in being regular contributor. - -#### Contibutors - -* Jake Luer ([@logicalparadox](http://github.com/logicalparadox)) - -## License - -(The MIT License) - -Copyright (c) 2012 Jake Luer - -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 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. diff --git a/deploy/core/node_modules/harbor/examples/harbor.js b/deploy/core/node_modules/harbor/examples/harbor.js deleted file mode 100644 index 142203921..000000000 --- a/deploy/core/node_modules/harbor/examples/harbor.js +++ /dev/null @@ -1,12 +0,0 @@ -var harbor = require('..')(); - -var names = [ 'one', 'two', 'three', 'four' ] - , count = 4; - -names.forEach(function (name) { - harbor.claim(name, function (err, port) { - if (err) throw err; - console.log('%s => %d', name, port); - --count || console.log(harbor.ports); - }); -}); diff --git a/deploy/core/node_modules/harbor/index.js b/deploy/core/node_modules/harbor/index.js deleted file mode 100644 index 3ca1c43b1..000000000 --- a/deploy/core/node_modules/harbor/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = process.env.HARBOR_COV - ? require('./lib-cov/harbor') - : require('./lib/harbor'); diff --git a/deploy/core/node_modules/harbor/lib/harbor.js b/deploy/core/node_modules/harbor/lib/harbor.js deleted file mode 100644 index 0eb42aee0..000000000 --- a/deploy/core/node_modules/harbor/lib/harbor.js +++ /dev/null @@ -1,176 +0,0 @@ -/*! - * Harbor - * Copyright (c) 2012 Jake Luer - * MIT Licensed - */ - -/*! - * External module dependencies - */ - -var EventEmitter = require('events').EventEmitter - , net = require('net') - , util = require('util'); - -/*! - * Primary export - factory - */ - -module.exports = Harbor; - -/** - * ## Harbor (min, max) - * - * Construct a port finding interface that - * will retain a list of claimed ports within - * a given `min` / `max` set. - * - * Events - * - * - `claim (name, port)` upon the claim of a port - * - `release (name, port)` upon the release of a port - * - `full ()` upon all in bounds being claimed - * - * @param {Number} lower bound inclusive - * @param {Number} upper bound inclusive - * @name Harbor (constructor) - * @api public - */ - -function Harbor (min, max) { - if (!(this instanceof Harbor)) { - return new Harbor(min, max); - } - - EventEmitter.call(this); - this.ports = {}; - this.min = min || 2000; - this.max = max || 20000; -} - -/*! - * Module Version - */ - -Harbor.version = '0.2.0'; - -/*! - * Inherits from EventEmitter - */ - -util.inherits(Harbor, EventEmitter); - -/** - * ### .claimed - * - * Get an array of all claimed ports by this interface. - * - * @returns {Array} ports claimed - * @name claimed - * @api public - */ - -Object.defineProperty(Harbor.prototype, 'claimed', - { get: function () { - var claimed = [] - , keys = Object.keys(this.ports) - , ports = this.ports; - - keys.forEach(function (name) { - claimed.push(ports[name]); - }); - - return claimed; - } -}); - -/** - * ### .claim (name, cb) - * - * Find an available port from the pool of open - * ports and claim it for a given name. - * - * @param {String} name - * @param {Function} callback - * @cb {Error|null} - * @cb {Number} claimed port - * @name claim - * @api public - */ - -Harbor.prototype.claim = function (name, cb) { - var self = this; - - if (this.ports[name]) { - return cb(null, this.ports[name]); - } - - checkPort.call(this, this.min, function (err, port) { - if (err) return cb(err); - self.ports[name] = port; - self.emit('claim', name, port); - cb(null, port); - }); -}; - -/** - * ### .release (name) - * - * Indicate that the claimed port for `name` - * is no longer is use and can be returned to - * the available pool. - * - * @param {String} name - * @name release - * @api public - */ - -Harbor.prototype.release = function (name) { - var port = this.ports[name]; - - if (port) { - delete this.ports[name]; - this.emit('release', name, port); - } -}; - -/** - * # checkPort - * - * Will attempt to connect to a given port. If success, - * will disconnect and pass that number to a callback. - * - * @param {Object} range min/max - * @param {Function} callback - */ - -function checkPort (num, cb) { - var self = this; - - // if already claimed, skip - if (~this.claimed.indexOf(num)) { - return process.nextTick(function () { - checkPort.call(self, ++num, cb); - }); - } - - var server = new net.Server(); - - // if error, we don't want this server - server.on('error', function (err) { - if (num == self.max) { - self.emit('full'); - return cb(new Error('No ports available in range.')); - } - - checkPort.call(self, ++num, cb); - }); - - // if listening, we want to disconnect and pass back port - server.listen(num, function () { - server.on('close', function () { - cb(null, num); - }); - server.close(); - }); -} diff --git a/deploy/core/node_modules/harbor/package.json b/deploy/core/node_modules/harbor/package.json deleted file mode 100644 index de2acee26..000000000 --- a/deploy/core/node_modules/harbor/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "harbor", - "version": "0.2.0", - "description": "TCP port availability and assignment utility.", - "main": "index.js", - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/logicalparadox/harbor.git" - }, - "keywords": [ - "port" - ], - "author": { - "name": "Jake Luer", - "email": "jake@alogicalparadox.com" - }, - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "chai": "*", - "chai-spies": "*" - }, - "readme": "# Harbor\n\n> TCP port availability and assignment utility.\n\nHarbor is a small little tool to find available TCP ports within a given range. It will remember\nwhat server is assigned to each port, or which ports are unavailable due to system assignment.\n\n## Installation\n\nHarbor can be installed via [npm](http://npmjs.org).\n\n```sh\nnpm install harbor\n```\n\n## Quick Start\n\nInvoke the `harbor` primary export with a lower and upper bounds of port number to query. Then\nclaim a service name to query for an available port.\n\n```js\nvar harbor = require('harbor')(1227, 1337);\n\nharbor.claim('awesomeness', function (err, port) {\n if (err) throw err;\n console.log(port); // 1227\n});\n```\n\n## API Reference\n\n### Harbor\n\nThe primary export is a factory, but you can also create new Harbors manually.\n\n```js\nvar Harbor = require('harbor')\n , harbor = new Harbor(1227, 1337);\n```\n\nThe `harbor` constructor object is also an event emitter. \n\n- `claim (name, port)` upon claim of a port\n- `release (name, port)` upon release of a port\n- `full` upon all ports being claimed\n\nShould you run out of ports, you can adjust the `harbor.min` or `harbor.max` to your needs.\n\n#### .claim (name, cb)\n\n- **@param** _{String}_ service name\n- **@param** _{Function}_ callback\n\nFind an available port for a named service. Names must be unique within a given Harbor. If\na claim for a name that already exists, the already assigned port will be returned.\n\nWill emit `claim` event for new, successful claims. Alternatively could emit `full` event in\naddition to returning an error in the callback.\n\n```js\nharbor.claim('awesomeness', function (err, port) {\n if (err) throw err; // will occur if all available ports are claimed\n console.log(port); // 1227\n});\n```\n\n#### .release (name)\n\n- **@param** _{String}_ service name\n\nIndicate that the claimed port for `name` is no longer in use and can be returned\nto the pool of available ports. \n\nWill emit `release` event if the port was previously claimed. Releasing a service \nname that does not exist has no impact.\n\n```js\nharbor.release('awesomeness');\n```\n\n#### .claimed\n\n- **@returns** _{Array}_ claimed ports\n\nGet an array of all claimed ports by this harbor interface. Does not include \nports that are in use by system services within the harbor range.\n\n## Tests\n\nTests are written in the BDD styles for the [Mocha](http://visionmedia.github.com/mocha) \ntest runner using the `should` assertion interface from [Chai](http://chaijs.com). \nRunning tests is simple:\n\n make test\n\n## Contributing\n\nInterested in contributing? Fork to get started. Contact [@logicalparadox](http://github.com/logicalparadox) \nif you are interested in being regular contributor.\n\n#### Contibutors \n\n* Jake Luer ([@logicalparadox](http://github.com/logicalparadox))\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Jake Luer \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", - "readmeFilename": "README.md", - "_id": "harbor@0.2.0", - "dist": { - "shasum": "5a23ed8774ce67b314ee7f7530fd1b0d6900a1ff" - }, - "_from": "harbor@", - "_resolved": "https://registry.npmjs.org/harbor/-/harbor-0.2.0.tgz" -} From 140a6defac2d7b12f531a747d1556327eb429f18 Mon Sep 17 00:00:00 2001 From: Alexey Shamrin Date: Fri, 28 Nov 2014 19:19:10 +0300 Subject: [PATCH 580/656] Cmd/Ctrl-+ to zoom in and Cmd/Ctrl-0 to reset zoom This makes zoom hotkeys compatible with what Chrome/Firefox support. --- deploy/settings/default/default.keymap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 237dc0e0e..1cbb1ff4f 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -8,6 +8,8 @@ [:app "ctrl-shift-d" :docs.search.show] [:app "pmeta-o" :navigate-workspace-transient] [:app "pmeta-shift-=" :window.zoom-in] + [:app "pmeta-=" :window.zoom-in] + [:app "pmeta-0" :window.zoom-reset] [:app "pmeta-r" :refresh-connected-browser] [:app "f11" :window.fullscreen] From e80f1b928890a702f53d519305ebe4b0c2982837 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 16 Jan 2016 01:25:41 -0500 Subject: [PATCH 581/656] Cleanup whitespace --- deploy/settings/default/default.keymap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 1cbb1ff4f..cf8aecc33 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -9,7 +9,7 @@ [:app "pmeta-o" :navigate-workspace-transient] [:app "pmeta-shift-=" :window.zoom-in] [:app "pmeta-=" :window.zoom-in] - [:app "pmeta-0" :window.zoom-reset] + [:app "pmeta-0" :window.zoom-reset] [:app "pmeta-r" :refresh-connected-browser] [:app "f11" :window.fullscreen] From 247755bf4fc0caccd1d0991cd0772c514c53ee48 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 16 Jan 2016 13:27:41 -0500 Subject: [PATCH 582/656] Middle click tab close should not paste - close #1816 Fix inspired by https://github.com/atom/tabs/pull/53 --- src/lt/objs/tabs.cljs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lt/objs/tabs.cljs b/src/lt/objs/tabs.cljs index fefa32261..36dfe623a 100644 --- a/src/lt/objs/tabs.cljs +++ b/src/lt/objs/tabs.cljs @@ -109,6 +109,10 @@ (->name e)] (when (object/raise-reduce e :close-button+ false) (close-tab label))] + ;; Disable middle-click pasting in linux + :mouseup (fn [ev] + (when (or (= 1 (.-button ev)) (.-metaKey ev)) + (dom/prevent ev))) :click (fn [ev] (if (or (= 1 (.-button ev)) (.-metaKey ev)) (object/raise label :close) From c4d30bae1c59af5916d68452100178e9ae13c8c8 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 16 Jan 2016 15:18:31 -0500 Subject: [PATCH 583/656] Bump JavaScript plugin that works with plugin deps removed --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index 5476bb888..01088cff0 100755 --- a/script/build.sh +++ b/script/build.sh @@ -35,7 +35,7 @@ rm -f deploy/core/node_modules/lighttable/bootstrap.js lein cljsbuild once app # Fetch plugins -PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.1.3" +PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.2.0" "Paredit,0.0.4" "Python,0.0.7" "Rainbow,0.0.8") # Plugins cache From 9d3c40f4fa70bcefa40b4f0c708edf3b16dba55f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 16 Jan 2016 15:49:01 -0500 Subject: [PATCH 584/656] Add 4 file types for htmlembedded mode - close #1883 --- deploy/settings/default/default.behaviors | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index fa7dcd5f9..c63bd5386 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -265,6 +265,7 @@ [:files :lt.objs.files/open-failed] [:files :lt.objs.opener/save-failed] [:files :lt.objs.files/file-types [{:exts [:apl :dyalog], :mime "text/apl", :tags [:editor.apl], :name "APL"} + {:exts [:aspx] :mime "application/x-aspx" :tags [:editor.aspx] :name "ASPX"} ;; No extension since .conf is an overloaded extension {:exts [], :mime "text/x-asterisk", :tags [:editor.asterisk], :name "Asterisk Dialplan"} {:exts [:c], :mime "text/x-c", :tags [:editor.c], :name "C"} @@ -283,6 +284,8 @@ {:exts [:ecl], :mime "text/x-ecl", :tags [:editor.ecl], :name "ECL"} {:exts [:edn], :mime "text/x-clojure", :tags [:editor.clj :editor.edn], :name "EDN"} {:exts [:e], :mime "text/x-eiffel", :tags [:editor.eiffel], :name "Eiffel"} + {:exts [:ejs] :mime "application/x-ejs" :tags [:editor.ejs] :name "EJS"} + {:exts [:erb] :mime "application/x-erb" :tags [:editor.erb] :name "ERB"} {:exts [:erl], :mime "text/x-erlang", :tags [:editor.erlang], :name "Erlang"} {:exts [:fs :fsi :fsx], :mime "text/x-fsharp", :tags [:editor.fsharp], :name "F#"} {:exts [:f :f90 :for :f77], :mime "text/x-fortran", :tags [:editor.fortran], :name "Fortran"} @@ -301,6 +304,7 @@ {:exts [:jade], :mime "text/x-jade", :tags [:editor.jade], :name "Jade"} {:exts [:java], :mime "text/x-java", :tags [:editor.java], :name "Java"} {:exts [:jl], :mime "text/x-julia", :tags [:editor.julia], :name "Julia"} + {:exts [:jsp] :mime "application/x-jsp" :tags [:editor.jsp] :name "JSP"} {:exts [:kt], :mime "text/x-kotlin", :tags [:editor.kotlin], :name "Kotlin"} {:exts [:latex :tex], :mime "text/x-stex", :tags [:editor.latex], :name "LaTeX"} {:exts [:less], :mime "text/x-less", :tags [:editor.less], :name "LESS"} From 99bfbde3ac63d61359b15a16cc8e0be8b2fb5b26 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 19 Jan 2016 09:00:18 -0500 Subject: [PATCH 585/656] Update CONTRIBUTING to point people to open issues in plugin repo Motivated by #2122 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7d29714f..a21caea82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ When filing a bug on GitHub, please help us help you by including the following: * Relevant configuration in your user.keymap and user.behaviors. * Error messages you see in your console. In your menu, select`View > Commands` and then search for and execute the `Console: Open the console in a tab` command. Go to the console tab and copy and paste its errors. -Note: The issue tracker is mainly for bugs. Questions should be asked on the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). +Note: The issue tracker is for LightTable bugs. Bugs for a specific language should go in its plugin repository e.g. [Clojure](https://github.com/LightTable/Clojure/issues), [JavaScript](https://github.com/LightTable/JavaScript/issues) and [Python](https://github.com/LightTable/Python/issues). Questions should be asked on the [Light Table Google group](https://groups.google.com/forum/#!forum/light-table-discussion). # Feature Requests From f686b11dd3e2329764595be9752fe1f517c7e4c7 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Tue, 19 Jan 2016 17:52:42 -0500 Subject: [PATCH 586/656] Quote `which` commands in build script so the Bash file existence check handles paths with spaces on Windows. --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build.sh b/script/build.sh index 5476bb888..a77b0e2c8 100755 --- a/script/build.sh +++ b/script/build.sh @@ -8,13 +8,13 @@ set -e # the app before calling build-app.sh to build it. # Check if lein is installed -[ `which lein` ] || { echo >&2 "Please install leiningen before running this script."; exit 1; } +[ "`which lein`" ] || { echo >&2 "Please install leiningen before running this script."; exit 1; } if [ "$(echo `lein version` | grep 'Leiningen \(1.\|2.0\)')" ]; then echo "lein version must be 2.1 or above. Do a lein upgrade first"; exit 1; fi # Check if npm is installed -[ `which npm` ] || { echo >&2 "Please install npm before running this script."; exit 1; } +[ "`which npm`" ] || { echo >&2 "Please install npm before running this script."; exit 1; } # Ensure we start in project root cd "$(dirname "${BASH_SOURCE[0]}")"; cd .. From e323b0effe1be946b0460aea300159dcd7298c91 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 19 Jan 2016 20:20:35 -0500 Subject: [PATCH 587/656] Tweaks to existing behaviors * No need for disable since negating behavior achieves the same thing * Remove lt.object/tags-removed because it overagressively calls behavior (on every tab change) --- deploy/settings/default/default.behaviors | 1 - src/lt/objs/editor.cljs | 15 +++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 0662c6a9c..c63bd5386 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -191,7 +191,6 @@ [:editor :lt.objs.editor/hide-line-numbers] [:editor :lt.objs.editor/hide-fold-gutter] [:editor :lt.objs.editor/no-wrap] - [:editor :lt.objs.editor/disable-brackets-autoclose] [:editor :lt.objs.settings/default-keymap-diffs] [:editor :lt.objs.settings/user-keymap-diffs] [:editor :lt.objs.settings/default-behavior-diffs] diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 7502cdaad..ae34ab183 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -760,10 +760,9 @@ (let [rulers (or rulers [{:lineStyle "dashed" :color "#aff" :column 80}])] (set-options this {:rulers (clj->js rulers)})))) -(behavior ::enable-brackets-autoclose - :triggers #{:object.instant :lt.object/tags-removed} - :desc "Editor: Enable brackets autoclose" - :exclusive [::disable-brackets-autoclose] +(behavior ::autoclose-brackets + :triggers #{:object.instant} + :desc "Editor: Enable autoclose brackets" :type :user :params [{:label "map" :example "{:pairs \"()[]{}''\\\"\\\"\" :explode \"[]{}\"}"}] @@ -771,11 +770,3 @@ (if opts (set-options this {:autoCloseBrackets (clj->js opts)}) (set-options this {:autoCloseBrackets true})))) - -(behavior ::disable-brackets-autoclose - :triggers #{:object.instant :lt.object/tags-removed} - :desc "Editor: Disable brackets autoclose" - :exclusive [::enable-brackets-autoclose] - :type :user - :reaction (fn [this] - (set-options this {:autoCloseBrackets false}))) From 752d1f1d90c4465175a4e0d52170331d582517df Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 20 Jan 2016 00:37:18 -0500 Subject: [PATCH 588/656] Use backspace binding that comes with closebrackets.js --- deploy/settings/default/default.keymap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index cf8aecc33..40a178df4 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -35,7 +35,7 @@ [:editor.keys.normal "pmeta-f" :find.fill-selection :find.show] [:editor.keys.normal "pmeta-g" :find.next] [:editor.keys.normal "tab" :auto-complete] - [:editor.keys.normal "backspace" :editor.backspace-pair :editor.backspace-indent] + [:editor.keys.normal "backspace" :passthrough :editor.backspace-indent] [:filter-list.input "down" (:filter-list.input.move-selection 1)] [:filter-list.input "esc" (:filter-list.input.escape! :force)] From 435b96747bdc2a45e524cc996994946ed4a0952f Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Wed, 20 Jan 2016 01:04:56 -0500 Subject: [PATCH 589/656] Deprecate pair-keymap-diffs Also update user.behaviors to recommend new alternative --- deploy/core/User/user.behaviors | 4 ++-- src/lt/objs/settings.cljs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/core/User/user.behaviors b/deploy/core/User/user.behaviors index 56c72fdab..c11b04bfe 100644 --- a/deploy/core/User/user.behaviors +++ b/deploy/core/User/user.behaviors @@ -44,8 +44,8 @@ ;; [:editor :lt.objs.editor/line-numbers] ;; Customize font ;; [:app :lt.objs.style/font-settings "Courier New" "11"] - ;; Auto-close characters '{[("'. Currently only works in English keyboards - ;; [:app :lt.objs.settings/pair-keymap-diffs] + ;; Auto-close characters e.g. '{[("' + ;; [:app :lt.objs.editor/autoclose-brackets] ;; Tab settings: Use real tabs, tab size in spaces, spaces per indent ;; [:editor :lt.objs.editor/tab-settings false 2 2] ] diff --git a/src/lt/objs/settings.cljs b/src/lt/objs/settings.cljs index 20ee05607..dd49b9073 100644 --- a/src/lt/objs/settings.cljs +++ b/src/lt/objs/settings.cljs @@ -501,6 +501,7 @@ :type :user :triggers #{:keymap.diffs.user+} :reaction (fn [this diffs] + (console/error (str "[:app " ::pair-keymap-diffs "] is deprecated and will be removed in 0.9.0. Use [:editor :lt.objs.editor/autoclose-brackets] instead")) (concat diffs (list {:+ pair-keybindings})))) (behavior ::on-behaviors-editor-save From 0af45fa998824318945372bad3cca6c9aec71e35 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 00:53:21 -0500 Subject: [PATCH 590/656] Remove unused titlebar behavior Looks bad and probably were rudimentary window controls before node-webkit --- deploy/core/css/skins/new-dark.css | 3 --- deploy/core/css/skins/new-dark.stylus | 2 -- deploy/core/css/structure.css | 18 ----------------- src/lt/objs/titlebar.cljs | 28 --------------------------- 4 files changed, 51 deletions(-) diff --git a/deploy/core/css/skins/new-dark.css b/deploy/core/css/skins/new-dark.css index 5a062c5a5..248a00bb6 100644 --- a/deploy/core/css/skins/new-dark.css +++ b/deploy/core/css/skins/new-dark.css @@ -794,9 +794,6 @@ input { height: 20px; background: url("../../img/connectingloader.gif"); } -#titlebar .button { - color: #ccc; -} .load-wrapper .img { background: url("../../img/loaderdark.gif"); } diff --git a/deploy/core/css/skins/new-dark.stylus b/deploy/core/css/skins/new-dark.stylus index 2e1e226b2..7b3be3daa 100644 --- a/deploy/core/css/skins/new-dark.stylus +++ b/deploy/core/css/skins/new-dark.stylus @@ -297,8 +297,6 @@ input { color: $highlight-fg; background:$highlight-bg; } #right-bar .clients .load-wrapper .img { width:20px; height:20px; background:url("../../img/connectingloader.gif") } -#titlebar .button { color:$fg; } - .load-wrapper .img { background:url("../../img/loaderdark.gif"); } .timed { border-bottom:1px solid #fa5; } diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 5aa813bf5..663dca190 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -11,18 +11,6 @@ button { cursor:default; border:none; outline:none; border-radius:0px; padding:2 * { box-sizing: border-box; } -.fullscreen #titlebar { display:none; } -#titlebar { -webkit-app-region: drag; height:29px; } -#titlebar p { text-align:center; padding-top:5px; } -#titlebar .window-buttons { position:absolute; left:8px; top:5px; } -#titlebar .window-buttons .button { position:relative; display:inline-block; border-radius:10px !important; width:12px; height:12px; margin-right:8px; } -#titlebar .window-buttons .button span { font-size:11px; } -#titlebar .window-buttons .close span { position:absolute; top:-3px; left:3px; } -#titlebar .window-buttons .minimize span { position:absolute; top:-5px; left:3px; font-size:14px } -#titlebar .window-buttons .maximize span { position:absolute; top:-3px; left:2px; } -#titlebar .fullscreen { position:absolute; top:5px; right:8px; } -#titlebar .button { -webkit-app-region: no-drag; } - body { -webkit-user-select: none; } #loader { position:absolute; top:0; left:0; right:0; bottom:0; width:100vw; height:100vh; display:table; text-align:center; box-sizing:border-box; vertical-align:middle;} @@ -102,12 +90,6 @@ body { -webkit-user-select: none; } .console td.loc { padding-right:5px; } .console .log-val + .log-val:before { content: ", " } -#multi .fullscreen { display:none; position:absolute; right:8px; top:8px; cursor:default; border-radius:3px; width:13px; height:13px; font-size:11pt; line-height:0.77em; padding-left:3px; box-sizing:border-box; } -.windows.fullscreen #multi .fullscreen { display:block; } -.linux.fullscreen #multi .fullscreen { display:block; } -.windows.fullscreen #multi .tabset:last-child .list {width:calc(100% - 40px);} -.linux.fullscreen #multi .tabset:last-child .list {width:calc(100% - 40px);} - #intro { padding:50px; } #intro h1 { margin-bottom:50px; } #intro h1 img { vertical-align:middle; } diff --git a/src/lt/objs/titlebar.cljs b/src/lt/objs/titlebar.cljs index 51adc771b..f6504f18d 100644 --- a/src/lt/objs/titlebar.cljs +++ b/src/lt/objs/titlebar.cljs @@ -22,34 +22,6 @@ (defn fullscreen [] (.setFullScreen app/win (not (.isFullScreen app/win)))) -(defui button [class action label] - [:span {:class (str "button " (name class)) - :title "Exit fullscreen"} - [:span label]] - :click (fn [] - (action))) - -(defui window-buttons [] - [:div.window-buttons - (button :close close "x") - (button :minimize minimize "-") - (button :maximize maximize "+")]) - -(defui titlebar [] - [:div#titlebar - (window-buttons) - [:p "Light Table"] - (button :fullscreen fullscreen "f")]) - -(behavior ::add-titlebar - :triggers #{:init} - :desc "App: Append custom titlebar" - :reaction (fn [app] - (when-not ($ :#titlebar) - (append ($ :body) (titlebar))))) - -(append ($ :#multi) (button :fullscreen fullscreen "-")) - (cmd/command {:command :window.fullscreen :desc "Window: Toggle fullscreen" :exec (fn [] From 71e9e252e028756f6e0ddd81c02970863aca0ea1 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 00:58:49 -0500 Subject: [PATCH 591/656] Move titlebar window commands next to other window commands --- src/lt/objs/app.cljs | 24 ++++++++++++++++++------ src/lt/objs/titlebar.cljs | 38 -------------------------------------- 2 files changed, 18 insertions(+), 44 deletions(-) delete mode 100644 src/lt/objs/titlebar.cljs diff --git a/src/lt/objs/app.cljs b/src/lt/objs/app.cljs index c78253233..aa669ec61 100644 --- a/src/lt/objs/app.cljs +++ b/src/lt/objs/app.cljs @@ -247,18 +247,30 @@ (cmd/command {:command :window.zoom-in :desc "Window: Zoom in" :exec (fn [] - (.setZoomFactor frame (+ (.getZoomFactor frame) 0.2)) - )}) + (.setZoomFactor frame (+ (.getZoomFactor frame) 0.2)))}) (cmd/command {:command :window.zoom-out :desc "Window: Zoom out" :exec (fn [] (when (> (.getZoomFactor frame) 0) - (.setZoomFactor frame (- (.getZoomFactor frame) 0.2))) - )}) + (.setZoomFactor frame (- (.getZoomFactor frame) 0.2))))}) (cmd/command {:command :window.zoom-reset :desc "Window: Zoom reset" :exec (fn [] - (.setZoomFactor frame default-zoom) - )}) + (.setZoomFactor frame default-zoom))}) + +(cmd/command {:command :window.fullscreen + :desc "Window: Toggle fullscreen" + :exec (fn [] + (.setFullScreen win (not (.isFullScreen win))))}) + +(cmd/command {:command :window.minimize + :desc "Window: Minimize" + :exec (fn [] + (.minimize win))}) + +(cmd/command {:command :window.maximize + :desc "Window: Maximize" + :exec (fn [] + (.maximize win))}) diff --git a/src/lt/objs/titlebar.cljs b/src/lt/objs/titlebar.cljs deleted file mode 100644 index f6504f18d..000000000 --- a/src/lt/objs/titlebar.cljs +++ /dev/null @@ -1,38 +0,0 @@ -(ns lt.objs.titlebar - "Provide titlebar (not enabled by default) and window related commands" - (:require [lt.object :as object] - [lt.objs.app :as app] - [lt.objs.tabs :as tabs] - [lt.objs.sidebar :as sidebar] - [lt.objs.sidebar.command :as cmd] - [lt.objs.canvas :as canvas] - [lt.util.dom :refer [$ append add-class remove-class]] - ) - (:require-macros [lt.macros :refer [behavior defui]])) - -(defn close [] - (.close app/win)) - -(defn minimize [] - (.minimize app/win)) - -(defn maximize [] - (.maximize app/win)) - -(defn fullscreen [] - (.setFullScreen app/win (not (.isFullScreen app/win)))) - -(cmd/command {:command :window.fullscreen - :desc "Window: Toggle fullscreen" - :exec (fn [] - (fullscreen))}) - -(cmd/command {:command :window.minimize - :desc "Window: Minimize" - :exec (fn [] - (minimize))}) - -(cmd/command {:command :window.maximize - :desc "Window: Maximize" - :exec (fn [] - (maximize))}) From 01e02e83ec11b2ae39f200552a74c1ddef0fcfcf Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 01:05:50 -0500 Subject: [PATCH 592/656] Add deprecation warning for js->clj --- src/lt/util/cljs.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/util/cljs.cljs b/src/lt/util/cljs.cljs index a516e3d09..a149dbe10 100644 --- a/src/lt/util/cljs.cljs +++ b/src/lt/util/cljs.cljs @@ -51,8 +51,8 @@ (defn ->dottedkw [& args] (keyword (string/join "." (map name (filter identity args))))) -;; TODO: Remove once remove these references from Clojure, Python and JS plugins (defn js->clj [& args] + (js/lt.objs.console.error "lt.util.cljs/js->clj is deprecated and will be removed in 0.9.0. Use js->clj instead") (apply cljs.core/js->clj args)) (defn str-contains? [str x] From aab4a40f1bcbcc2364faf85a4597cf3c123cf163 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 01:24:12 -0500 Subject: [PATCH 593/656] Remove stale and unused styling in structure.css * .git* were classes associated with repl comments that were removed in 2c9b866d8fd6ed45fb896ed2f9c8edf6e38f6069 * .codex was part of an experimental ui that was removed in f7c2b8e623e70040dba69571bc34dd2fce4f6c87 * .struct-tree was part of an experiment removed in 26f0c19afb7ef8b96be43894754920e5199d5bbf --- deploy/core/css/structure.css | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 663dca190..10eae425b 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -301,36 +301,6 @@ body { -webkit-user-select: none; } .search-results div div { position:relative; } .search-results button { position:absolute; right:0px; margin:2px 0; padding:5px 10px; border-radius:0px; } -.struct-tree { overflow:auto; height:100%; } -.struct-tree span { margin:0 2px; } -.struct-tree div {display:inline-block; width:100%; padding-left:20px; } -.struct-tree > div { background:#444; } -.struct-tree > div > div { background:#464; } -.struct-tree > div > div > div { background:#446; } -.struct-tree > div > div > div > div { background:#446; } -.struct-tree > div > div > div > div > div { background:#466; } -.struct-tree > div > div > div > div > div > div { background:#646; } -.struct-tree > div > div > div > div > div > div > div { background:#844; } -.struct-tree > div > div > div > div > div > div > div > div { background:#666; } -.struct-tree > .tlist { margin-bottom:10px; width:100%; } -.struct-tree .tlist:before { content: "("; } -.struct-tree .tlist:after { content: ")"; } -.struct-tree .vec:before { content: "["; } -.struct-tree .vec:after { content: "]"; } -.struct-tree .map:before { content: "{"; } -.struct-tree .map:after { content: "}"; } -.struct-tree .set:before { content: "#{"; } -.struct-tree .set:after { content: "}"; } - -.codex { height:100%; overflow:auto; } -.codex > li { border-bottom:2px solid #444; } -.codex .CodeMirror { height:auto; position:relative; } -.codex .CodeMirror-scroll { height:auto; } - -.gitmarks { width:5px; } -.gitmark { height:1em; background:#5fa; display:inline-block; width:5px; } -.gitmodified { height:1em; background:#b5f; display:inline-block; width:5px; } - .inline-doc { line-height:1.1em; margin-left:-10px; padding:5px 20px; border-radius:0px; } .inline-doc h1 span { font-size:10pt; } .inline-doc h1 { font-size:100%; margin:0; } From 02e968f869dad546aeb27b7076e993c4a4531727 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 02:07:06 -0500 Subject: [PATCH 594/656] Fix scroll position jumping on save after stripping whitespace #2097 restored cursor but forgot to restore scroll --- src/lt/objs/editor/file.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/editor/file.cljs b/src/lt/objs/editor/file.cljs index 9889f11f5..c586d1842 100644 --- a/src/lt/objs/editor/file.cljs +++ b/src/lt/objs/editor/file.cljs @@ -15,7 +15,9 @@ (let [{:keys [path]} (@editor :info) final (object/raise-reduce editor :save+ (ed/->val editor))] (when (not= final (ed/->val editor)) - (ed/set-val-and-keep-cursor editor final)) + (let [y-position (.-top (.getScrollInfo (ed/->cm-ed editor)))] + (ed/set-val-and-keep-cursor editor final) + (ed/scroll-to editor 0 y-position))) (doc/save path final (fn [] (object/merge! editor {:dirty false From b9518d2134ee0dd1ce8de616d39892563eea8f27 Mon Sep 17 00:00:00 2001 From: kenny-evitt Date: Thu, 21 Jan 2016 17:30:36 -0500 Subject: [PATCH 595/656] Fix script file referenced as containing default plugins and their versions --- doc/for-committers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index 17f09f124..4df5c3c2a 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -69,7 +69,7 @@ This is our release checklist which can be dropped in to an issue: - [ ] Version updates - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj (including the Codox `:source-uri` value) to 0.X.X - [ ] Make sure electron version is up to date in version.json - - [ ] Make sure plugin versions in script/build-app.sh are latest versions + - [ ] Make sure plugin versions in script/build.sh are latest versions - [ ] Add changelog for release to CHANGELOG.md - [ ] Each core developer should QA at least one OS using the [QA checklist](https://github.com/LightTable/LightTable/wiki/QA-Checklist) - [ ] When QA passes freeze master From 7912722e5f9cb146095b54ad3d86828dfc20aaaf Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Thu, 21 Jan 2016 17:32:46 -0500 Subject: [PATCH 596/656] Bump Light Table version to 0.8.1. #2126 --- deploy/core/package.json | 2 +- deploy/core/version.json | 2 +- project.clj | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/core/package.json b/deploy/core/package.json index aac8b795c..f24277abb 100644 --- a/deploy/core/package.json +++ b/deploy/core/package.json @@ -1,7 +1,7 @@ { "name": "LightTable", "description": "LightTable Electron App", - "version": "0.8.0", + "version": "0.8.1", "main": "main.js", "browserWindowOptions": { "icon": "img/lticon.png", diff --git a/deploy/core/version.json b/deploy/core/version.json index aba95ce55..a9ea0da6c 100644 --- a/deploy/core/version.json +++ b/deploy/core/version.json @@ -1 +1 @@ -{"version":"0.8.0","electron":"0.34.5"} +{"version":"0.8.1","electron":"0.34.5"} diff --git a/project.clj b/project.clj index 7b7353981..4c8b37d3f 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject lighttable "0.8.0" +(defproject lighttable "0.8.1" :description "Light Table is a next generation code editor that connects you to your creation with instant feedback. Light Table is very customizable and can display anything a Chromium browser can." :url "http://www.lighttable.com/" :dependencies [[org.clojure/clojure "1.5.1"] @@ -36,7 +36,7 @@ :namespaces [lt.macros lt.object lt.objs.command lt.objs.editor lt.objs.editor.pool lt.objs.files lt.objs.notifos] ;; :source-uri version needs to be bumped per release until codox supports {version} - :source-uri "https://github.com/LightTable/LightTable/blob/0.8.0/{filepath}#L{line}" + :source-uri "https://github.com/LightTable/LightTable/blob/0.8.1/{filepath}#L{line}" ;; Be explicit that undocumented public fns should be documented :metadata {:doc "TODO: Add docstring"}} :source-paths ["src/"] From 94eddec3484931fe427ca2a0f92b32978a3a9871 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Thu, 21 Jan 2016 17:33:23 -0500 Subject: [PATCH 597/656] Update version of default plugin Clojure to 0.3.1. #2126 --- script/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index f02e1949e..31fae1856 100755 --- a/script/build.sh +++ b/script/build.sh @@ -35,7 +35,7 @@ rm -f deploy/core/node_modules/lighttable/bootstrap.js lein cljsbuild once app # Fetch plugins -PLUGINS=("Clojure,0.2.0" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.2.0" +PLUGINS=("Clojure,0.3.1" "CSS,0.0.6" "HTML,0.1.0" "Javascript,0.2.0" "Paredit,0.0.4" "Python,0.0.7" "Rainbow,0.0.8") # Plugins cache From d24be3bf75ff124a50d4e9194627913fe431ec23 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 18:57:32 -0500 Subject: [PATCH 598/656] Add changelog for 0.8.1 --- deploy/core/changelog.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/deploy/core/changelog.md b/deploy/core/changelog.md index 41978f1eb..dd7b5d99a 100644 --- a/deploy/core/changelog.md +++ b/deploy/core/changelog.md @@ -1,5 +1,36 @@ #Changes +## 0.8.1 + +* CHANGED: [:app :lt.objs.settings/pair-keymap-diffs] behavior is being deprecated. Use [:editor :lt.objs.editor/autoclose-brackets] in your user.behaviors instead. lt.objs.editor/autoclose-brackets should fix autoclosing characters e.g. '[{" for international users. +* CHANGED: Backspace key uses the same CodeMirror plugin that lt.objs.editor/autoclose-brackets does +* CHANGED: lt.util.cljs/js->clj is being deprecated. Plugin authors can use the js->clj that comes with ClojureScript +* CHANGED: Removed unused lt.objs.titlebar ns and lt.objs.titlebar/add-titlebar behavior +* CHANGED: Removed unused styling in structure.css +* CHANGED: Removed harbor and jshint node packages that belong to other LightTable plugins +* CHANGED: Removed :hide-connect command which is the same as :show-connect +* CHANGED: Removed light skin which was just a confusing pointer to dark skin +* CHANGED: files/open-sync logs an error when trying to open a nonexistent file. Previously the error was ignored +* CHANGED: Check for updates every hour instead of every 5 minutes +* FIX: Git (vcs) friendly! Changing branches and doing rebases doesn't cause buggy dialogs. If a file is removed, the tab is closed. If a file has a local modification, the user decides whether to overwrite the current file or not +* FIX: LightTable documentation supports navigation as it is now in a browser tab +* FIX: Save and remove trailing whitespace behavior refreshes tab +* FIX: Navigator no longer cuts off end of files i.e. can scroll horizontally +* FIX: Case sensitive renaming of files e.g. readme -> README +* FIX: Faster detection of binaries in build scripts +* FIX: In linux, middle click to close tab doesn't paste clipboard contents +* FIX: :open-path command resolves relative paths before opening them +* FIX: Clearer description of font-settings behavior +* FIX: Clear console error when github endpoints returns invalid JSON +* FIX: All errors are consistently caught and logged to console +* ADDED: Light Table builds without warnings on ClojureScript 1.7.x +* ADDED: Add build target for generating cljsdeps.js (need for ClojureScript upgrade) +* ADDED: Linux and Windows users have access keys on menus +* ADDED: Linux and Windows users have additional menu items under File: Quit Light Table and About Light Table +* ADDED: Added file type definitions for html templates: ERB, ASPX, EJS, JSP +* ADDED: Command-0/Ctrl-0 to reset zoom and Command-=/Ctrl-= to zoom in +* ADDED: Disply notification to user after installing/updating/uninstalling a plugin + ## 0.8.0 * CHANGED: We have switched to Electron from NW.js From 53a90bee4c2c6758e4b5dffdffbc32256a05e00d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 21 Jan 2016 19:15:44 -0500 Subject: [PATCH 599/656] :app has no effect --- deploy/core/User/user.behaviors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/core/User/user.behaviors b/deploy/core/User/user.behaviors index c11b04bfe..2e2135de5 100644 --- a/deploy/core/User/user.behaviors +++ b/deploy/core/User/user.behaviors @@ -45,7 +45,7 @@ ;; Customize font ;; [:app :lt.objs.style/font-settings "Courier New" "11"] ;; Auto-close characters e.g. '{[("' - ;; [:app :lt.objs.editor/autoclose-brackets] + ;; [:editor :lt.objs.editor/autoclose-brackets] ;; Tab settings: Use real tabs, tab size in spaces, spaces per indent ;; [:editor :lt.objs.editor/tab-settings false 2 2] ] From 17e316457bea3f1f12178913de28f7d318ee58d8 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 18 Mar 2016 01:28:55 -0400 Subject: [PATCH 600/656] Add menu for underline-result - close #2161 Also implemented copy for doc underline-result since menu has copy + result but copy wasn't implemented --- deploy/settings/default/default.behaviors | 2 ++ src/lt/objs/eval.cljs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index c63bd5386..93f9d9d60 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -425,6 +425,8 @@ [:inline.underline-result :lt.objs.eval/result-menu+] [:inline.underline-result :lt.objs.eval/ex-clear] [:inline.underline-result :lt.objs.eval/destroy-on-cleared] + [:inline.underline-result :lt.objs.menu/menu!] + [:inline.underline-result :lt.objs.eval/copy-underline-result] [:inline.watch :lt.plugins.watches/clear!] diff --git a/src/lt/objs/eval.cljs b/src/lt/objs/eval.cljs index 39e0c4b1a..b66f5d3c9 100644 --- a/src/lt/objs/eval.cljs +++ b/src/lt/objs/eval.cljs @@ -383,6 +383,12 @@ (object/raise widget :clear!))) (object/update! this [:widgets] assoc [line :underline] res-obj)))) +(behavior ::copy-underline-result + :triggers #{:copy} + :reaction (fn [this] + (platform/copy (string/join "\n" + (map #(.-innerText %) (.-children (:result @this))))))) + ;;**************************************************** ;; inline exception ;;**************************************************** From 6e75444ccbf5db1da55deab4a210cffc1f70159b Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Tue, 5 Apr 2016 15:15:50 -0400 Subject: [PATCH 601/656] Exclude the 'script' sub-directory when building the plugin metadata cache. Fixes #2177 --- src/lt/objs/plugins.cljs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 3831c2a04..47ebc0516 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -202,8 +202,13 @@ (deploy/is-newer? a b) -1 :else 1)) +(defn- valid-plugin-dir? + [path] + (and (files/dir? path) + (not (= "script" (files/basename path))))) + (defn build-cache [sha] - (let [items (filter files/dir? (files/full-path-ls metadata-dir)) + (let [items (filter valid-plugin-dir? (files/full-path-ls metadata-dir)) cache (into {:__sha sha} (for [plugin items :let [versions (->> (files/full-path-ls plugin) From 4dd3c161e8fd16f8ab67b31c0517b24763efa452 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 13 May 2016 19:48:12 -0400 Subject: [PATCH 602/656] Only core team members who are heavily using and understand the full infrastructure should modify these dirs See #2205 for latest motivation. See #2075 and breakage eventually fixed by #2115 for another motivation --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a21caea82..a28ad63df 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,7 @@ When contributing: * For any other contributions, please discuss with us as early as possible. We want your hard work to count. * Please add docstrings to non-trivial functions that are added. Most existing code doesn't have this but we'd like to improve this. * We are not currently seeking refactoring contributions or code convention tweaks e.g. whitespace. This may change at a later point when we have automated tests and an explicit code convention. +* We are not seeking contributions to script/ or deploy/ (core team only) * For contributions to a [vendored dependency](doc/for-committers.md#node-packages), they must be sent upstream and then we can update to the new version. * For plugins and files that come from CodeMirror, usually under codemirror/, we do not take pull requests. Instead, send a pull request [to CodeMirror](https://github.com/codemirror/CodeMirror). Once they release a new version we can From f003331e529b9bb89c6b75a596fc6e568919c99f Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Sat, 30 Apr 2016 11:17:57 -0400 Subject: [PATCH 603/656] Add GitHub issue template. --- .github/ISSUE_TEMPLATE.md | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..d611d1551 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,67 @@ +## *Remove this Section* + +Note that issues for this repo are for bugs with or feature requests for LightTable itself. Bugs or features for a specific language or other plugin should be submitted to their respective GitHub repo e.g. [Clojure](https://github.com/LightTable/Clojure), [JavaScript](https://github.com/LightTable/Javascript), or [Vim](https://github.com/LightTable/Vim). + +Questions should generally be asked on the [Light Table Google Groups group](https://groups.google.com/forum/#!forum/light-table-discussion) or in [the Gitter room for the main GitHub repo](https://gitter.im/LightTable/LightTable). + +Remove any sections in this template that aren't pertinent. Remove the instructions text too, please, before submitting this issue. + +## Request a Feature + +Start with a brief description of what behavior or capability you hope to achieve were the requested feature implemented. It's possible an existing feature, or a plugin, satisfies your requirements. + +Include details about the feature. + +Note whether you can contribute, and in what capacities, e.g. writing code, writing documentation, testing. Depending on the value you place on your own time, you may want to wait for feedback from the core contributors before beginning any work on adding or changing code. + +Keep in mind that Light Table is developed and maintained by a small group of part-time volunteers so it's unlikely your request will be a high priority. Contributing pull requests with (working) code *greatly* increase the chances your feature will be implemented. + +## Report a Bug + +### Steps to Reproduce + + 1. _ + 2. _ + +In general, you cannot be *too* detailed. You don't need to include steps to start the computer, but it's fine to start with starting Light Table itself (unless, e.g. the bug is only observed when Light Table has already been open for some period of time), and it's *fantastic* for you to include every action or command, or even individual clicks or keypresses. + +It's very difficult to fix a bug that we can't reproduce. + +Ideally, include the *minimal* file or files for which you can reproduce the bug. If that's not feasible, including an (appropriately redacted) version of your actual file(s) is great too. If the bug isn't specific to any particular file, note that in this section. + +### Environment + +| Info | Details | +| -------------------------------- | ------- | +| Light Table version | | +| Operating system | | + +#### Relevant Plugins + +| Plugin | Version | +| ------ | ------- | +| | | + +#### Relevant Settings in your *user.keymap* and *user.behaviors* Files + +*user.keymap*: + +``` +Paste relevant settings here +``` + +*user.behaviors*: + +``` +Paste relevant settings here +``` + +### Error Messages + +Include all error messages shown in the Light Table console. + +To access the console, open the command bar (by pressing Ctrl+Space or by opening the *View* menu and selecting *Commands*) and then search for and execute the *Console: Open the console in a tab* command. Go to the console tab and copy and paste any errors or other messages below. + +``` +Paste error messages here +``` From 281e5069e2fe0b900a8ec6a375164ab99ec9b70d Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Fri, 10 Jun 2016 12:39:00 -0400 Subject: [PATCH 604/656] Add note about installing additional Node.js package for Debian-based Linux distros. --- doc/developer-install.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/developer-install.md b/doc/developer-install.md index 6430cd5bb..33b4354c4 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -41,6 +41,8 @@ To run electron on Linux you need to have libgconf-2.so.4 installed. Ref: [Linux (Arch) build depends on libgconf-2.so.4](https://github.com/LightTable/LightTable/issues/1926) +Note that, on Debian-based distros, you may need to install an additional package as there is a pre-existing *node* package and the standard Node.js package on these distros installs a Node.js executable named `nodejs` instead of `node` as our build script expects. See issue [#1931](https://github.com/LightTable/LightTable/issues/1931) for some background. + # Build To build LightTable from scratch on OSX, Windows Cygwin or Linux: From d225109aa7825ca54435ea41ca727055c69e14f5 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Tue, 14 Jun 2016 09:14:43 -0400 Subject: [PATCH 605/656] Change first section to clarify directions for making use of the issue template. --- .github/ISSUE_TEMPLATE.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index d611d1551..f8c043520 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,10 +1,16 @@ -## *Remove this Section* +## *Issue Template* + +This section covers general topics related to all issues, regardless of their subject. Note that issues for this repo are for bugs with or feature requests for LightTable itself. Bugs or features for a specific language or other plugin should be submitted to their respective GitHub repo e.g. [Clojure](https://github.com/LightTable/Clojure), [JavaScript](https://github.com/LightTable/Javascript), or [Vim](https://github.com/LightTable/Vim). Questions should generally be asked on the [Light Table Google Groups group](https://groups.google.com/forum/#!forum/light-table-discussion) or in [the Gitter room for the main GitHub repo](https://gitter.im/LightTable/LightTable). -Remove any sections in this template that aren't pertinent. Remove the instructions text too, please, before submitting this issue. +Please check for an existing or similar issue that covers or is related to your issue before submitting a new issue. + +Remove any sections in this template that aren't pertinent. Remove the instructions text too (including this section), please, before submitting this issue. + +There are separate sections below for requesting a feature or reporting a bug. Edit the relevant sectiont to include the information requested. If you fail to include pertinent info, we're probably going to close your issue. But we'll gladly re-open it once you include the info we need to help you. ## Request a Feature From d6c48bbb7883be8e1810aeb485a4409ccd838aef Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Thu, 16 Jun 2016 23:06:55 -0400 Subject: [PATCH 606/656] Update for-committers doc regarding building API docs and LT version - closes #2202 Bump codox version to 0.9.5 in order to include {version} in :codox :source-url --- doc/for-committers.md | 10 +++------- project.clj | 5 ++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index 4df5c3c2a..c9447b33f 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -67,7 +67,7 @@ This is our release checklist which can be dropped in to an issue: - [ ] Release 0.X.X - [ ] Version updates - - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj (including the Codox `:source-uri` value) to 0.X.X + - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj to 0.X.X - [ ] Make sure electron version is up to date in version.json - [ ] Make sure plugin versions in script/build.sh are latest versions - [ ] Add changelog for release to CHANGELOG.md @@ -84,12 +84,8 @@ This is our release checklist which can be dropped in to an issue: - [ ] Optional blog post if a major release - [ ] After release, [build api documentation](#build-api-documentation) -## Build api documentation +## Build API documentation -To build api documentation for current LT version and publish generated docs: - -1. In project.clj make sure that `[:codox :source-uri]` points to current LT version. - This step will be removed once [there is upstream support for version in :source-uri](https://github.com/weavejester/codox/issues/107) -2. Run `script/build-api-docs.sh` on a clean git state. Make sure there are no pending git changes as this script will change git branches and push generated api docs to gh-pages. +Run `script/build-api-docs.sh` on a clean git state to build API documentation for the current LT version and publish generated docs. Make sure there are no pending git changes as this script will change git branches and push generated API docs to gh-pages. Expect to see a ton of warnings e.g. `WARNING: Use of undeclared Var cljs.core/seq at line 197`. This will be noise we have to live with until we upgrade ClojureScript. diff --git a/project.clj b/project.clj index 4c8b37d3f..ecfc1e559 100644 --- a/project.clj +++ b/project.clj @@ -28,15 +28,14 @@ [org.clojure/clojurescript "1.7.145" :exclusions [org.apache.ant/ant]]]}} :plugins [[lein-cljsbuild "1.0.1"] - [lein-codox "0.9.0"]] + [lein-codox "0.9.5"]] :codox {:language :clojurescript :project {:name "LightTable"} :output-path "codox" :doc-paths [] ;; Disable including doc/ :namespaces [lt.macros lt.object lt.objs.command lt.objs.editor lt.objs.editor.pool lt.objs.files lt.objs.notifos] - ;; :source-uri version needs to be bumped per release until codox supports {version} - :source-uri "https://github.com/LightTable/LightTable/blob/0.8.1/{filepath}#L{line}" + :source-uri "https://github.com/LightTable/LightTable/blob/{version}/{filepath}#L{line}" ;; Be explicit that undocumented public fns should be documented :metadata {:doc "TODO: Add docstring"}} :source-paths ["src/"] From 7ebcad5164a4171ff2ec5ad0c3d825d7a1b62623 Mon Sep 17 00:00:00 2001 From: Tomas Tauber Date: Mon, 25 Jul 2016 00:56:15 +0800 Subject: [PATCH 607/656] folder renaming updated in the document manager - fixes #2232 --- src/lt/objs/sidebar/workspace.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lt/objs/sidebar/workspace.cljs b/src/lt/objs/sidebar/workspace.cljs index b35feccc9..b5cd5200b 100644 --- a/src/lt/objs/sidebar/workspace.cljs +++ b/src/lt/objs/sidebar/workspace.cljs @@ -9,6 +9,7 @@ [lt.objs.popup :as popup] [lt.objs.sidebar :as sidebar] [lt.objs.dialogs :as dialogs] + [lt.objs.document :as document] [lt.objs.menu :as menu] [lt.util.dom :as dom] [lt.util.cljs :refer [->dottedkw]] @@ -302,6 +303,12 @@ (object/merge! this {:path neue :realized? false}) (files/move! path neue) (object/raise this :refresh!) + (let [docs (get-in @document/manager [:files]) + old-path (string/join [path files/separator]) + affected (filter (fn [x] (.startsWith x old-path)) (keys docs))] + (doseq [old-fpath affected] + (let [new-fpath (string/replace-first old-fpath path neue)] + (document/move-doc old-fpath new-fpath)))) (if root? (object/raise workspace/current-ws :rename! path neue) (object/raise workspace/current-ws :watched.rename path neue)) From 813fc480f44d2f1d08c67e0ca5e3e346f592591d Mon Sep 17 00:00:00 2001 From: kenny-evitt Date: Sun, 14 Aug 2016 15:23:04 -0400 Subject: [PATCH 608/656] Add note about removing a Node package. --- doc/for-committers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index c9447b33f..ca9ef2349 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -15,6 +15,8 @@ Current ClojureScript version and libraries we use are in [project.clj](https:// Node package installs last done with node.js v2.5.0 and npm v2.13.2. +If you *remove* a Node package make sure to document that in the release notes, broadcast the change in the Gitter room, and post a topic about it in the Google Groups group. Plugins, including user plugins (i.e. plugins not listed in the official plugin list), might be using a package without including it in its own project. + Node dependencies are at deploy/core/node\_modules/. This directory is currently a mix of vendored dependencies, forked dependencies and Light Table specific libraries: From d79e0ace2f9b808c3c528449ee67cd8edccdc940 Mon Sep 17 00:00:00 2001 From: kenny-evitt Date: Sun, 14 Aug 2016 15:30:36 -0400 Subject: [PATCH 609/656] Add pre-release list with a checklist item about removing Node.js packages. --- doc/for-committers.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index ca9ef2349..8b6305a9c 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -65,6 +65,10 @@ This background thread is invoked with the `background` macro. ## Release process +Pre-release checklist: + + - [ ] Notify users (as described above in the *Node packages* section) if any Node.js packages have been removed as plugins may depend on them + This is our release checklist which can be dropped in to an issue: - [ ] Release 0.X.X @@ -72,7 +76,7 @@ This is our release checklist which can be dropped in to an issue: - [ ] Update deploy/core/package.json, deploy/core/version.json and project.clj to 0.X.X - [ ] Make sure electron version is up to date in version.json - [ ] Make sure plugin versions in script/build.sh are latest versions - - [ ] Add changelog for release to CHANGELOG.md + - [ ] Add changelog with notes for release (i.e release notes) to CHANGELOG.md - [ ] Each core developer should QA at least one OS using the [QA checklist](https://github.com/LightTable/LightTable/wiki/QA-Checklist) - [ ] When QA passes freeze master - [ ] Add changelog to [GH release draft](https://github.com/LightTable/LightTable/releases/new) From d1bb8482d394baf69399bad38ed05f4bbf76fcfe Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sat, 20 Aug 2016 18:59:06 -0400 Subject: [PATCH 610/656] Add initial LightTable Style Guide document --- doc/style-guide.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/style-guide.md diff --git a/doc/style-guide.md b/doc/style-guide.md new file mode 100644 index 000000000..c0825804b --- /dev/null +++ b/doc/style-guide.md @@ -0,0 +1,17 @@ +# LightTable Style Guide + +Follow the [Clojure Style Guide](https://github.com/bbatsov/clojure-style-guide) unless directed otherwise below. The guide is comprehensive, well organized, and common. + +In order to streamline pull requests, prior to opening one, consider running your code through a formatting tool such as [cljfmt](https://github.com/weavejester/cljfmt) or [kibit](https://github.com/jonase/kibit). They are handy for catching any deviations from standard Clojure/script style guidelines. + +## Documentation and Comments + +1. Unless obvious to someone new to the project, yet familiar with Clojure/script, a meaningful docstring should be associated with every class, function, behavior, and object. + +## Behaviors + +1. Add brief docstrings via `:desc` key. + +## Footnotes + +1. This document was inspired by the excellent [Metabase Clojure Style Guide](https://github.com/metabase/metabase/wiki/Metabase-Clojure-Style-Guide). From dea24b16f05a6c9514c1c883cd1296a7dca15227 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sat, 20 Aug 2016 19:16:16 -0400 Subject: [PATCH 611/656] Update for-committers.md to point to style-guide.md for code conventions --- doc/for-committers.md | 5 +---- doc/style-guide.md | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index 4df5c3c2a..3691cbe6b 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -39,10 +39,7 @@ Allows us to build cross platfrom desktop apps. See [Electron guide](electron-gu ### Code Conventions -* Catch blocks should catch on `:default` unless there is a specific exception to be caught. -* Catch blocks should log errors with `lt.objs.console/error`. Namespaces that the console - ns depend on cannot refer to the clojure var but can refer to the js fn e.g. - `(js/lt.objs.console.error err)`. +* See the LightTable Style Guide. ### Code Reading diff --git a/doc/style-guide.md b/doc/style-guide.md index c0825804b..21af59913 100644 --- a/doc/style-guide.md +++ b/doc/style-guide.md @@ -8,6 +8,13 @@ In order to streamline pull requests, prior to opening one, consider running you 1. Unless obvious to someone new to the project, yet familiar with Clojure/script, a meaningful docstring should be associated with every class, function, behavior, and object. +## Errors + +1. Catch blocks should catch on `:default` unless there is a specific exception to be caught. +1. Catch blocks should log errors with `lt.objs.console/error`. Namespaces that the console + ns depend on cannot refer to the clojure var but can refer to the js fn e.g. + `(js/lt.objs.console.error err)`. + ## Behaviors 1. Add brief docstrings via `:desc` key. From 53ad17ddb2016f1468b58d35f3f712a6b4bf5c76 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Tue, 30 Aug 2016 21:48:54 -0400 Subject: [PATCH 612/656] Replace wrench with shelljs across project --- deploy/core/node_modules/wrench/.npmignore | 3 - deploy/core/node_modules/wrench/LICENSE | 21 - deploy/core/node_modules/wrench/lib/wrench.js | 523 ------------------ deploy/core/node_modules/wrench/package.json | 55 -- deploy/core/node_modules/wrench/readme.md | 102 ---- .../wrench/tests/copydirsync_unix.js | 210 ------- .../core/node_modules/wrench/tests/mkdir.js | 26 - .../core/node_modules/wrench/tests/readdir.js | 61 -- .../node_modules/wrench/tests/readdir/bar.txt | 0 .../wrench/tests/readdir/foo/bar/ipsum.js | 0 .../wrench/tests/readdir/foo/dolor.md | 0 .../wrench/tests/readdir/foo/lorem.txt | 0 .../wrench/tests/rmdirSyncRecursive.js | 74 --- .../core/node_modules/wrench/tests/runner.js | 9 - .../wrench/tests/shown/.hidden.txt | 1 - .../wrench/tests/shown/.hidden/dolor.md | 0 .../node_modules/wrench/tests/shown/bar.txt | 1 - .../wrench/tests/shown/foo/bar/ipsum.js | 0 .../wrench/tests/shown/foo/dolor.md | 0 .../wrench/tests/shown/foo/lorem.txt | 0 .../wrench/tests/withsymlinks/test | 1 - deploy/core/package.json | 3 +- src/lt/objs/files.cljs | 12 +- src/lt/objs/platform.cljs | 8 +- 24 files changed, 12 insertions(+), 1098 deletions(-) delete mode 100644 deploy/core/node_modules/wrench/.npmignore delete mode 100644 deploy/core/node_modules/wrench/LICENSE delete mode 100644 deploy/core/node_modules/wrench/lib/wrench.js delete mode 100644 deploy/core/node_modules/wrench/package.json delete mode 100644 deploy/core/node_modules/wrench/readme.md delete mode 100644 deploy/core/node_modules/wrench/tests/copydirsync_unix.js delete mode 100644 deploy/core/node_modules/wrench/tests/mkdir.js delete mode 100644 deploy/core/node_modules/wrench/tests/readdir.js delete mode 100644 deploy/core/node_modules/wrench/tests/readdir/bar.txt delete mode 100644 deploy/core/node_modules/wrench/tests/readdir/foo/bar/ipsum.js delete mode 100644 deploy/core/node_modules/wrench/tests/readdir/foo/dolor.md delete mode 100644 deploy/core/node_modules/wrench/tests/readdir/foo/lorem.txt delete mode 100644 deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js delete mode 100644 deploy/core/node_modules/wrench/tests/runner.js delete mode 100644 deploy/core/node_modules/wrench/tests/shown/.hidden.txt delete mode 100644 deploy/core/node_modules/wrench/tests/shown/.hidden/dolor.md delete mode 100644 deploy/core/node_modules/wrench/tests/shown/bar.txt delete mode 100644 deploy/core/node_modules/wrench/tests/shown/foo/bar/ipsum.js delete mode 100644 deploy/core/node_modules/wrench/tests/shown/foo/dolor.md delete mode 100644 deploy/core/node_modules/wrench/tests/shown/foo/lorem.txt delete mode 100644 deploy/core/node_modules/wrench/tests/withsymlinks/test diff --git a/deploy/core/node_modules/wrench/.npmignore b/deploy/core/node_modules/wrench/.npmignore deleted file mode 100644 index 05ade97ff..000000000 --- a/deploy/core/node_modules/wrench/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -.idea diff --git a/deploy/core/node_modules/wrench/LICENSE b/deploy/core/node_modules/wrench/LICENSE deleted file mode 100644 index a85a94a61..000000000 --- a/deploy/core/node_modules/wrench/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010 Ryan McGrath - -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 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. diff --git a/deploy/core/node_modules/wrench/lib/wrench.js b/deploy/core/node_modules/wrench/lib/wrench.js deleted file mode 100644 index a293fdd40..000000000 --- a/deploy/core/node_modules/wrench/lib/wrench.js +++ /dev/null @@ -1,523 +0,0 @@ -/* wrench.js - * - * A collection of various utility functions I've found myself in need of - * for use with Node.js (http://nodejs.org/). This includes things like: - * - * - Recursively deleting directories in Node.js (Sync, not Async) - * - Recursively copying directories in Node.js (Sync, not Async) - * - Recursively chmoding a directory structure from Node.js (Sync, not Async) - * - Other things that I'll add here as time goes on. Shhhh... - * - * ~ Ryan McGrath (ryan [at] venodesigns.net) - */ - -var fs = require("fs"), - _path = require("path"), - isWindows = !!process.platform.match(/^win/); - -/* wrench.readdirSyncRecursive("directory_path"); - * - * Recursively dives through directories and read the contents of all the - * children directories. - */ -exports.readdirSyncRecursive = function(baseDir) { - baseDir = baseDir.replace(/\/$/, ''); - - var readdirSyncRecursive = function(baseDir) { - var files = [], - curFiles, - nextDirs, - isDir = function(fname){ - return fs.statSync( _path.join(baseDir, fname) ).isDirectory(); - }, - prependBaseDir = function(fname){ - return _path.join(baseDir, fname); - }; - - curFiles = fs.readdirSync(baseDir); - nextDirs = curFiles.filter(isDir); - curFiles = curFiles.map(prependBaseDir); - - files = files.concat( curFiles ); - - while (nextDirs.length) { - files = files.concat( readdirSyncRecursive( _path.join(baseDir, nextDirs.shift()) ) ); - } - - return files; - }; - - // convert absolute paths to relative - var fileList = readdirSyncRecursive(baseDir).map(function(val){ - return _path.relative(baseDir, val); - }); - - return fileList; -}; - -/* wrench.readdirRecursive("directory_path", function(error, files) {}); - * - * Recursively dives through directories and read the contents of all the - * children directories. - * - * Asynchronous, so returns results/error in callback. - * Callback receives the of files in currently recursed directory. - * When no more directories are left, callback is called with null for all arguments. - * - */ -exports.readdirRecursive = function(baseDir, fn) { - baseDir = baseDir.replace(/\/$/, ''); - - var waitCount = 0; - - function readdirRecursive(curDir) { - var prependcurDir = function(fname){ - return _path.join(curDir, fname); - }; - - waitCount++; - fs.readdir(curDir, function(e, curFiles) { - if (e) { - fn(e); - return; - } - waitCount--; - - curFiles = curFiles.map(prependcurDir); - - curFiles.forEach(function(it) { - waitCount++; - - fs.stat(it, function(e, stat) { - waitCount--; - - if (e) { - fn(e); - } else { - if (stat.isDirectory()) { - readdirRecursive(it); - } - } - - if (waitCount == 0) { - fn(null, null); - } - }); - }); - - fn(null, curFiles.map(function(val) { - // convert absolute paths to relative - return _path.relative(baseDir, val); - })); - - if (waitCount == 0) { - fn(null, null); - } - }); - }; - - readdirRecursive(baseDir); -}; - - - - - -/* wrench.rmdirSyncRecursive("directory_path", failSilent); - * - * Recursively dives through directories and obliterates everything about it. This is a - * Sync-function, which blocks things until it's done. No idea why anybody would want an - * Asynchronous version. :\ - */ -exports.rmdirSyncRecursive = function(path, failSilent) { - var files; - - try { - files = fs.readdirSync(path); - } catch (err) { - - if(failSilent) return; - throw new Error(err.message); - } - - /* Loop through and delete everything in the sub-tree after checking it */ - for(var i = 0; i < files.length; i++) { - var file = _path.join(path, files[i]); - var currFile = fs.lstatSync(file); - - if(currFile.isDirectory()) { - // Recursive function back to the beginning - exports.rmdirSyncRecursive(file); - } else if(currFile.isSymbolicLink()) { - // Unlink symlinks - if (isWindows) { - fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. - } - - fs.unlinkSync(file); - } else { - // Assume it's a file - perhaps a try/catch belongs here? - if (isWindows) { - fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. - } - - fs.unlinkSync(file); - } - } - - /* Now that we know everything in the sub-tree has been deleted, we can delete the main - directory. Huzzah for the shopkeep. */ - return fs.rmdirSync(path); -}; - - - -function isFileIncluded(opts, dir, filename) { - - function isMatch(filter) { - if (typeof filter === 'function') { - return filter(filename, dir) === true; - } - else { - // Maintain backwards compatibility and use just the filename - return filename.match(filter); - } - } - - if (opts.include || opts.exclude) { - if (opts.exclude) { - if (isMatch(opts.exclude)) { - return false; - } - } - - if (opts.include) { - if (isMatch(opts.include)) { - return true; - } - else { - return false; - } - } - - return true; - } - else if (opts.filter) { - var filter = opts.filter; - - if (!opts.whitelist) { - // if !opts.whitelist is false every file or directory - // which does match opts.filter will be ignored - return isMatch(filter) ? false : true; - } else { - // if opts.whitelist is true every file or directory - // which doesn't match opts.filter will be ignored - return !isMatch(filter) ? false : true; - } - } - - return true; -} - -/* wrench.copyDirSyncRecursive("directory_to_copy", "new_directory_location", opts); - * - * Recursively dives through a directory and moves all its files to a new location. This is a - * Synchronous function, which blocks things until it's done. If you need/want to do this in - * an Asynchronous manner, look at wrench.copyDirRecursively() below. Specify forceDelete to force directory overwrite. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { - opts = opts || {}; - - try { - if(fs.statSync(newDirLocation).isDirectory()) { - if(opts.forceDelete) { - exports.rmdirSyncRecursive(newDirLocation); - } else { - return new Error('You are trying to delete a directory that already exists. Specify forceDelete in the opts argument to override this. Bailing~'); - } - } - } catch(e) { } - - /* Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */ - var checkDir = fs.statSync(sourceDir); - try { - fs.mkdirSync(newDirLocation, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') throw e; - } - - var files = fs.readdirSync(sourceDir); - var hasFilter = opts.filter || opts.include || opts.exclude; - var preserveFiles = opts.preserveFiles === true; - - for(var i = 0; i < files.length; i++) { - // ignores all files or directories which match the RegExp in opts.filter - if(typeof opts !== 'undefined') { - if (hasFilter) { - if (!isFileIncluded(opts, sourceDir, files[i])) { - continue; - } - } - - if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue; - } - - var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); - - var fCopyFile = function(srcFile, destFile) { - if(typeof opts !== 'undefined' && opts.preserveFiles && fs.existsSync(destFile)) return; - - var contents = fs.readFileSync(srcFile); - fs.writeFileSync(destFile, contents); - var stat = fs.lstatSync(srcFile); - fs.chmodSync(destFile, stat.mode); - }; - - if(currFile.isDirectory()) { - /* recursion this thing right on back. */ - exports.copyDirSyncRecursive(_path.join(sourceDir, files[i]), _path.join(newDirLocation, files[i]), opts); - } else if(currFile.isSymbolicLink()) { - var symlinkFull = fs.readlinkSync(_path.join(sourceDir, files[i])); - - if (typeof opts !== 'undefined' && !opts.inflateSymlinks) { - fs.symlinkSync(symlinkFull, _path.join(newDirLocation, files[i])); - continue; - } - - var tmpCurrFile = fs.lstatSync(_path.join(sourceDir, symlinkFull)); - if (tmpCurrFile.isDirectory()) { - exports.copyDirSyncRecursive(_path.join(sourceDir, symlinkFull), _path.join(newDirLocation, files[i]), opts); - } else { - /* At this point, we've hit a file actually worth copying... so copy it on over. */ - fCopyFile(_path.join(sourceDir, symlinkFull), _path.join(newDirLocation, files[i])); - } - } else { - /* At this point, we've hit a file actually worth copying... so copy it on over. */ - fCopyFile(_path.join(sourceDir, files[i]), _path.join(newDirLocation, files[i])); - } - } -}; - -/* wrench.chmodSyncRecursive("directory", filemode); - * - * Recursively dives through a directory and chmods everything to the desired mode. This is a - * Synchronous function, which blocks things until it's done. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -exports.chmodSyncRecursive = function(sourceDir, filemode) { - var files = fs.readdirSync(sourceDir); - - for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); - - if(currFile.isDirectory()) { - /* ...and recursion this thing right on back. */ - exports.chmodSyncRecursive(_path.join(sourceDir, files[i]), filemode); - } else { - /* At this point, we've hit a file actually worth copying... so copy it on over. */ - fs.chmod(_path.join(sourceDir, files[i]), filemode); - } - } - - /* Finally, chmod the parent directory */ - fs.chmod(sourceDir, filemode); -}; - - -/* wrench.chownSyncRecursive("directory", uid, gid); - * - * Recursively dives through a directory and chowns everything to the desired user and group. This is a - * Synchronous function, which blocks things until it's done. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -exports.chownSyncRecursive = function(sourceDir, uid, gid) { - var files = fs.readdirSync(sourceDir); - - for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); - - if(currFile.isDirectory()) { - /* ...and recursion this thing right on back. */ - exports.chownSyncRecursive(_path.join(sourceDir, files[i]), uid, gid); - } else { - /* At this point, we've hit a file actually worth chowning... so own it. */ - fs.chownSync(_path.join(sourceDir, files[i]), uid, gid); - } - } - - /* Finally, chown the parent directory */ - fs.chownSync(sourceDir, uid, gid); -}; - - - -/* wrench.rmdirRecursive("directory_path", callback); - * - * Recursively dives through directories and obliterates everything about it. - */ -exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){ - if(clbk === null || typeof clbk == 'undefined') - clbk = function(err) {}; - - fs.readdir(dir, function(err, files) { - if(err && typeof failSilent === 'boolean' && !failSilent) - return clbk(err); - - if(typeof failSilent === 'function') - clbk = failSilent; - - (function rmFile(err){ - if (err) return clbk(err); - - var filename = files.shift(); - if (filename === null || typeof filename == 'undefined') - return fs.rmdir(dir, clbk); - - var file = dir+'/'+filename; - fs.lstat(file, function(err, stat){ - if (err) return clbk(err); - if (stat.isDirectory()) - rmdirRecursive(file, rmFile); - else - fs.unlink(file, rmFile); - }); - })(); - }); -}; - -/* wrench.copyDirRecursive("directory_to_copy", "new_location", {forceDelete: bool}, callback); - * - * Recursively dives through a directory and moves all its files to a new - * location. Specify forceDelete to force directory overwrite. - * - * Note: Directories should be passed to this function without a trailing slash. - */ -exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, opts, clbk) { - var originalArguments = Array.prototype.slice.apply(arguments); - srcDir = _path.normalize(srcDir); - newDir = _path.normalize(newDir); - - fs.stat(newDir, function(err, newDirStat) { - if(!err) { - if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete) - return exports.rmdirRecursive(newDir, function(err) { - copyDirRecursive.apply(this, originalArguments); - }); - else - return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.')); - } - - if(typeof opts === 'function') - clbk = opts; - - fs.stat(srcDir, function(err, srcDirStat){ - if (err) return clbk(err); - fs.mkdir(newDir, srcDirStat.mode, function(err){ - if (err) return clbk(err); - fs.readdir(srcDir, function(err, files){ - if (err) return clbk(err); - (function copyFiles(err){ - if (err) return clbk(err); - - var filename = files.shift(); - if (filename === null || typeof filename == 'undefined') - return clbk(null); - - var file = srcDir+'/'+filename, - newFile = newDir+'/'+filename; - - fs.stat(file, function(err, fileStat){ - if (fileStat.isDirectory()) - copyDirRecursive(file, newFile, copyFiles); - else if (fileStat.isSymbolicLink()) - fs.readlink(file, function(err, link){ - fs.symlink(link, newFile, copyFiles); - }); - else - fs.readFile(file, function(err, data){ - fs.writeFile(newFile, data, copyFiles); - }); - }); - })(); - }); - }); - }); - }); -}; - -var mkdirSyncRecursive = function(path, mode) { - var self = this; - path = _path.normalize(path) - - try { - fs.mkdirSync(path, mode); - } catch(err) { - if(err.code == "ENOENT") { - var slashIdx = path.lastIndexOf(_path.sep); - - if(slashIdx > 0) { - var parentPath = path.substring(0, slashIdx); - mkdirSyncRecursive(parentPath, mode); - mkdirSyncRecursive(path, mode); - } else { - throw err; - } - } else if(err.code == "EEXIST") { - return; - } else { - throw err; - } - } -}; -exports.mkdirSyncRecursive = mkdirSyncRecursive; - -exports.LineReader = function(filename, bufferSize) { - this.bufferSize = bufferSize || 8192; - this.buffer = ""; - this.fd = fs.openSync(filename, "r"); - this.currentPosition = 0; -}; - -exports.LineReader.prototype = { - close: function() { - return fs.closeSync(this.fd); - }, - - getBufferAndSetCurrentPosition: function(position) { - var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); - - this.buffer += res[0]; - if(res[1] === 0) { - this.currentPosition = -1; - } else { - this.currentPosition = position + res[1]; - } - - return this.currentPosition; - }, - - hasNextLine: function() { - while(this.buffer.indexOf('\n') === -1) { - this.getBufferAndSetCurrentPosition(this.currentPosition); - if(this.currentPosition === -1) return false; - } - - if(this.buffer.indexOf("\n") > -1 || this.buffer.length !== 0) return true; - return false; - }, - - getNextLine: function() { - var lineEnd = this.buffer.indexOf("\n"), - result = this.buffer.substring(0, lineEnd != -1 ? lineEnd : this.buffer.length); - - this.buffer = this.buffer.substring(result.length + 1, this.buffer.length); - return result; - } -}; - -// vim: et ts=4 sw=4 diff --git a/deploy/core/node_modules/wrench/package.json b/deploy/core/node_modules/wrench/package.json deleted file mode 100644 index c0cc6d2ed..000000000 --- a/deploy/core/node_modules/wrench/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "wrench", - "description": "Recursive filesystem (and other) operations that Node *should* have.", - "version": "1.5.6", - "author": { - "name": "Ryan McGrath", - "email": "ryan@venodesigns.net" - }, - "repository": { - "type": "git", - "url": "https://ryanmcgrath@github.com/ryanmcgrath/wrench-js.git" - }, - "bugs": { - "url": "http://github.com/ryanmcgrath/wrench-js/issues" - }, - "directories": { - "lib": "./lib/" - }, - "dependencies": {}, - "devDependencies": { - "nodeunit": ">= 0.6.4" - }, - "main": "./lib/wrench", - "engines": { - "node": ">=0.1.97" - }, - "scripts": { - "test": "nodeunit tests/runner.js" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" - } - ], - "_id": "wrench@1.5.6", - "dist": { - "shasum": "247b7dfe5d7d4374d5e449761fba634190d9b871", - "tarball": "http://registry.npmjs.org/wrench/-/wrench-1.5.6.tgz" - }, - "_from": "wrench@1.5.6", - "_npmVersion": "1.2.25", - "_npmUser": { - "name": "ryanmcgrath", - "email": "ryan@venodesigns.net" - }, - "maintainers": [ - { - "name": "ryanmcgrath", - "email": "ryan@venodesigns.net" - } - ], - "_shasum": "247b7dfe5d7d4374d5e449761fba634190d9b871", - "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.6.tgz" -} diff --git a/deploy/core/node_modules/wrench/readme.md b/deploy/core/node_modules/wrench/readme.md deleted file mode 100644 index a4e02421a..000000000 --- a/deploy/core/node_modules/wrench/readme.md +++ /dev/null @@ -1,102 +0,0 @@ -wrench.js - Recursive file operations in Node.js ----------------------------------------------------------------------------- -While I love Node.js, I've found myself missing some functions. Things like -recursively deleting/chmodding a directory (or even deep copying a directory), -or even a basic line reader, shouldn't need to be re-invented time and time again. - -That said, here's my attempt at a re-usable solution, at least until something -more formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple -to use - check out the documentation/examples below: - -Possibly Breaking Change in v1.5.0 ------------------------------------------------------------------------------ -In previous versions of Wrench, we went against the OS-default behavior of not -deleting a directory unless the operation is forced. In 1.5.0, this has been -changed to be the behavior people expect there to be - if you try to copy over -a directory that already exists, you'll get an Error returned or thrown stating -that you need to force it. - -Something like this will do the trick: - -``` javascript -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { - forceDelete: true -}); -``` - -If you desire the older behavior of Wrench... hit up your package.json. If you -happen to find bugs in the 1.5.0 release please feel free to file them on the -GitHub issues tracker for this project, or send me a pull request and I'll get to -it as fast as I can. Thanks! - -**If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.** - -Installation ------------------------------------------------------------------------------ - - npm install wrench - -Usage ------------------------------------------------------------------------------ -``` javascript -var wrench = require('wrench'), - util = require('util'); -``` - -### Synchronous operations -``` javascript -// Recursively create directories, sub-trees and all. -wrench.mkdirSyncRecursive(dir, 0777); - -// Recursively delete the entire sub-tree of a directory, then kill the directory -wrench.rmdirSyncRecursive('my_directory_name', failSilently); - -// Recursively read directories contents. -wrench.readdirSyncRecursive('my_directory_name'); - -// Recursively chmod the entire sub-tree of a directory -wrench.chmodSyncRecursive('my_directory_name', 0755); - -// Recursively chown the entire sub-tree of a directory -wrench.chownSyncRecursive("directory", uid, gid); - -// Deep-copy an existing directory -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { - forceDelete: bool, // Whether to overwrite existing directory or not - excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .) - preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing - inflateSymlinks: bool, // Whether to follow symlinks or not when copying files - filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude). - whitelist: bool, // if true every file or directory which doesn't match filter will be ignored - include: regexpOrFunction, // An include filter (either a regexp or a function) - exclude: regexpOrFunction // An exclude filter (either a regexp or a function) -}); - -// Note: If a RegExp is provided then then it will be matched against the filename. If a function is -// provided then the signature should be the following: -// function(filename, dir) { return result; } - -// Read lines in from a file until you hit the end -var f = new wrench.LineReader('x.txt'); -while(f.hasNextLine()) { - util.puts(f.getNextLine()); -} - -// Note: You will need to close that above line reader at some point, otherwise -// you will run into a "too many open files" error. f.close() or fs.closeSync(f.fd) are -// your friends, as only you know when it is safe to close. -``` - -### Asynchronous operations -``` javascript -// Recursively read directories contents -var files = []; -wrench.readdirRecursive('my_directory_name', function(error, curFiles) { - // curFiles is what you want -}); - -// If you're feeling somewhat masochistic -wrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn); -``` - -Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath) diff --git a/deploy/core/node_modules/wrench/tests/copydirsync_unix.js b/deploy/core/node_modules/wrench/tests/copydirsync_unix.js deleted file mode 100644 index 676c9fa70..000000000 --- a/deploy/core/node_modules/wrench/tests/copydirsync_unix.js +++ /dev/null @@ -1,210 +0,0 @@ -var testCase = require('nodeunit').testCase; -var fs = require('fs'); -var wrench = require('../lib/wrench'); -var path = require('path'); - -function checkResultHidden(test, files) { - var check = [ - '.hidden', - '.hidden.txt', - 'bar.txt', - 'foo', - path.join('.hidden', 'dolor.md'), - path.join('foo', 'bar'), - path.join('foo', 'dolor.md'), - path.join('foo', 'lorem.txt'), - path.join('foo', 'bar', 'ipsum.js') - ]; - - test.deepEqual(files, check); -} - -function checkResultShown(test, files) { - var check = [ - 'bar.txt', - 'foo', - path.join('foo', 'bar'), - path.join('foo', 'dolor.md'), - path.join('foo', 'lorem.txt'), - path.join('foo', 'bar', 'ipsum.js') - ]; - - test.deepEqual(files, check); -} - -function checkResultInflate(test, files) { - var check = [ - '.hidden', - 'bar.txt', - 'test', - path.join('.hidden', 'dolor.md') - ]; - - test.deepEqual(files, check); - - test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), false); - test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), false); -} - -function checkResultDontInflate(test, files) { - var check = [ - '.hidden', - 'bar.txt', - 'test', - path.join('.hidden', 'dolor.md') - ]; - - test.deepEqual(files, check); - - test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), true); - test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), true); -} - -function checkResultPreserveFiles(test, files) { - checkResultHidden(test, files); - var contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', '.hidden.txt')), "utf8"); - test.deepEqual(contents, 'hidden file'); - contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', 'bar.txt')), "utf8"); - test.deepEqual(contents, 'shown file'); -} - -function checkResultOverwriteFiles(test, files) { - checkResultHidden(test, files); - var contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', '.hidden.txt')), "utf8"); - test.deepEqual(contents, 'just some text for .hidden.txt'); - contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', 'bar.txt')), "utf8"); - test.deepEqual(contents, 'just some text for bar.txt'); -} - -module.exports = testCase({ - test_copyDirSyncRecursiveWithoutOptions: function(test) { - var dir = path.join(__dirname, 'shown'); - var testdir = path.join(__dirname, 'testdir'); - - wrench.copyDirSyncRecursive(dir, testdir); - - wrench.rmdirSyncRecursive(testdir); - test.done(); - }, - test_copyDirSyncRecursiveHidden: function(test) { - var dir = path.join(__dirname, 'shown'); - var testdir = path.join(__dirname, 'testdir'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - wrench.mkdirSyncRecursive(testdir, 0777); - wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false }); - - var files = wrench.readdirSyncRecursive(testdir); - - checkResultHidden(test, files); - - wrench.rmdirSyncRecursive(testdir); - - test.done(); - }, - test_copyDirSyncRecursiveShown: function(test) { - var dir = path.join(__dirname, 'shown'); - var testdir = path.join(__dirname, 'testdir'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - wrench.mkdirSyncRecursive(testdir, 0777); - wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: true }); - - var files = wrench.readdirSyncRecursive(testdir); - - checkResultShown(test, files); - - wrench.rmdirSyncRecursive(testdir); - - test.done(); - }, - test_copyDirSyncRecursiveInflate: function(test) { - var dir = path.join(__dirname, 'withsymlinks'); - var testdir = path.join(__dirname, 'testdir'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - wrench.mkdirSyncRecursive(testdir, 0777); - wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false, inflateSymlinks: true }); - - var files = wrench.readdirSyncRecursive(testdir); - - checkResultInflate(test, files); - - wrench.rmdirSyncRecursive(testdir); - - test.done(); - }, - test_copyDirSyncRecursiveDontInflate: function(test) { - var dir = path.join(__dirname, 'withsymlinks'); - var testdir = path.join(__dirname, 'testdir'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - wrench.mkdirSyncRecursive(testdir, 0777); - wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false, inflateSymlinks: false }); - - var files = wrench.readdirSyncRecursive(testdir); - - checkResultDontInflate(test, files); - - wrench.rmdirSyncRecursive(testdir); - - test.done(); - }, - test_copyDirSyncRecursivePreserveFiles: function(test) { - var dir = path.join(__dirname, 'shown'), - testdir1 = path.join(__dirname, 'testdir1'), - testdir2 = path.join(__dirname, 'testdir2'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - wrench.mkdirSyncRecursive(testdir1, 0777); - wrench.copyDirSyncRecursive(dir, testdir1, { excludeHiddenUnix: false }); - wrench.copyDirSyncRecursive(dir, testdir2, { excludeHiddenUnix: false }); - - fs.writeFileSync(path.join(testdir1, ".hidden.txt"), 'just some text for .hidden.txt'); - fs.writeFileSync(path.join(testdir1, "bar.txt"), 'just some text for bar.txt'); - - wrench.copyDirSyncRecursive(testdir1, testdir2, { preserve: true, excludeHiddenUnix: false, preserveFiles: true }); - - var files = wrench.readdirSyncRecursive(testdir2); - - checkResultPreserveFiles(test, files); - - wrench.rmdirSyncRecursive(testdir1); - wrench.rmdirSyncRecursive(testdir2); - - test.done(); - }, - test_copyDirSyncRecursiveOverwriteFiles: function(test) { - var dir = path.join(__dirname, 'shown'), - testdir1 = path.join(__dirname, 'testdir1'), - testdir2 = path.join(__dirname, 'testdir2'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - wrench.mkdirSyncRecursive(testdir1, 0777); - wrench.copyDirSyncRecursive(dir, testdir1, { excludeHiddenUnix: false }); - wrench.copyDirSyncRecursive(dir, testdir2, { excludeHiddenUnix: false }); - - fs.writeFileSync(path.join(testdir1, ".hidden.txt"), 'just some text for .hidden.txt'); - fs.writeFileSync(path.join(testdir1, "bar.txt"), 'just some text for bar.txt'); - - wrench.copyDirSyncRecursive(testdir1, testdir2, { preserve: true, excludeHiddenUnix: false, preserveFiles: false }); - - var files = wrench.readdirSyncRecursive(testdir2); - - checkResultOverwriteFiles(test, files); - - wrench.rmdirSyncRecursive(testdir1); - wrench.rmdirSyncRecursive(testdir2); - - test.done(); - } - -}); - -// vim: et ts=4 sw=4 diff --git a/deploy/core/node_modules/wrench/tests/mkdir.js b/deploy/core/node_modules/wrench/tests/mkdir.js deleted file mode 100644 index 933887be9..000000000 --- a/deploy/core/node_modules/wrench/tests/mkdir.js +++ /dev/null @@ -1,26 +0,0 @@ -var testCase = require('nodeunit').testCase; -var fs = require('fs'); -var wrench = require('../lib/wrench'); -var path = require('path'); - -module.exports = testCase({ - test_mkdirSyncRecursive: function(test) { - var dir = __dirname + '/_tmp/foo/bar'; - - test.equals(fs.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); - - wrench.mkdirSyncRecursive(dir, 0777); - - test.equals(fs.existsSync(dir), true, 'Dir should exist now'); - - // clean up - while (dir != __dirname) { - fs.rmdirSync(dir); - dir = path.dirname(dir); - } - - test.done(); - }, -}); - -// vim: et ts=4 sw=4 diff --git a/deploy/core/node_modules/wrench/tests/readdir.js b/deploy/core/node_modules/wrench/tests/readdir.js deleted file mode 100644 index 5e8abf016..000000000 --- a/deploy/core/node_modules/wrench/tests/readdir.js +++ /dev/null @@ -1,61 +0,0 @@ -var testCase = require('nodeunit').testCase; -var fs = require('fs'); -var wrench = require('../lib/wrench'); -var path = require('path'); - - -function checkResult(test, files) { - var check = [ - 'bar.txt', - 'foo', - path.join('foo', 'bar'), - path.join('foo', 'dolor.md'), - path.join('foo', 'lorem.txt'), - path.join('foo', 'bar', 'ipsum.js') - ]; - - test.deepEqual(files, check); - - test.done(); -} - -module.exports = testCase({ - test_readdirSyncRecursive: function(test) { - var dir = path.join(__dirname, 'readdir'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - var files = wrench.readdirSyncRecursive(dir); - - checkResult(test, files); - }, - - test_readdirRecursive: function(test) { - var dir = path.join(__dirname, 'readdir'); - - test.ok(fs.existsSync(dir), 'Folders should exist'); - - var allFiles = []; - - wrench.readdirRecursive(dir, function(e, files) { - if (e) throw e; - - if (files) { - allFiles = allFiles.concat(files); - } else { - checkResult(test, allFiles); - } - }); - }, - - test_readdirRecursiveWithNonExistentDirectory: function(test) { - wrench.readdirRecursive('', function (e, files) { - test.ok(e); - test.equal(e.code, 'ENOENT'); - test.equal(files, null); - test.done(); - }); - } -}); - -// vim: et ts=4 sw=4 diff --git a/deploy/core/node_modules/wrench/tests/readdir/bar.txt b/deploy/core/node_modules/wrench/tests/readdir/bar.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/readdir/foo/bar/ipsum.js b/deploy/core/node_modules/wrench/tests/readdir/foo/bar/ipsum.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/readdir/foo/dolor.md b/deploy/core/node_modules/wrench/tests/readdir/foo/dolor.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/readdir/foo/lorem.txt b/deploy/core/node_modules/wrench/tests/readdir/foo/lorem.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js b/deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js deleted file mode 100644 index 3415e84d0..000000000 --- a/deploy/core/node_modules/wrench/tests/rmdirSyncRecursive.js +++ /dev/null @@ -1,74 +0,0 @@ -var testCase = require('nodeunit').testCase; -var fs = require('fs'); -var wrench = require('../lib/wrench'); -var path = require('path'); - -module.exports = testCase({ - test_rmdirSyncRecursive: function(test) { - var dir = __dirname + '/_tmp2/foo/bar'; - - wrench.mkdirSyncRecursive(dir, '777'); - - var f1Path = path.join(dir, 'test1.txt'); - var f2Path = path.join(path.dirname(dir), 'test2.txt'); - var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); - - fs.writeFileSync(f1Path, 'foo bar baz'); - fs.writeFileSync(f2Path, 'foo bar baz'); - fs.writeFileSync(f3Path, 'foo bar baz'); - - fs.chmodSync(f1Path, '444'); - fs.chmodSync(f2Path, '444'); - fs.chmodSync(f3Path, '444'); - - test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); - test.equals(fs.existsSync(f1Path), true, 'File should exist'); - test.equals(fs.existsSync(f2Path), true, 'File should exist'); - test.equals(fs.existsSync(f3Path), true, 'File should exist'); - - wrench.rmdirSyncRecursive(dir); - - test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); - test.equals(fs.existsSync(f1Path), false, 'File should not exist'); - test.equals(fs.existsSync(f2Path), true, 'File should exist'); - test.equals(fs.existsSync(f3Path), true, 'File should exist'); - - wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); - - test.done(); - }, - - test_rmdirSyncRecursiveFromRoot: function(test) { - var dir = __dirname + '/_tmp3/foo/bar'; - - wrench.mkdirSyncRecursive(dir, '777'); - - var f1Path = path.join(dir, 'test1.txt'); - var f2Path = path.join(path.dirname(dir), 'test2.txt'); - var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); - - fs.writeFileSync(f1Path, 'foo bar baz'); - fs.writeFileSync(f2Path, 'foo bar baz'); - fs.writeFileSync(f3Path, 'foo bar baz'); - - fs.chmodSync(f1Path, '444'); - fs.chmodSync(f2Path, '444'); - fs.chmodSync(f3Path, '444'); - - test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); - test.equals(fs.existsSync(f1Path), true, 'File should exist'); - test.equals(fs.existsSync(f2Path), true, 'File should exist'); - test.equals(fs.existsSync(f3Path), true, 'File should exist'); - - wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); - - test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); - test.equals(fs.existsSync(f1Path), false, 'File should not exist'); - test.equals(fs.existsSync(f2Path), false, 'File should not exist'); - test.equals(fs.existsSync(f3Path), false, 'File should not exist'); - - test.done(); - } -}); - -// vim: et ts=4 sw=4 diff --git a/deploy/core/node_modules/wrench/tests/runner.js b/deploy/core/node_modules/wrench/tests/runner.js deleted file mode 100644 index e321a1584..000000000 --- a/deploy/core/node_modules/wrench/tests/runner.js +++ /dev/null @@ -1,9 +0,0 @@ -// `nodeunit tests/runner` -// will run all the tests - -module.exports = { - group_mkdir: require('./mkdir'), - group_readdir: require('./readdir'), - group_copydir: require('./copydirsync_unix'), - group_rmdir: require('./rmdirSyncRecursive') -}; diff --git a/deploy/core/node_modules/wrench/tests/shown/.hidden.txt b/deploy/core/node_modules/wrench/tests/shown/.hidden.txt deleted file mode 100644 index b96b7256c..000000000 --- a/deploy/core/node_modules/wrench/tests/shown/.hidden.txt +++ /dev/null @@ -1 +0,0 @@ -hidden file \ No newline at end of file diff --git a/deploy/core/node_modules/wrench/tests/shown/.hidden/dolor.md b/deploy/core/node_modules/wrench/tests/shown/.hidden/dolor.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/shown/bar.txt b/deploy/core/node_modules/wrench/tests/shown/bar.txt deleted file mode 100644 index 3d36c5cfc..000000000 --- a/deploy/core/node_modules/wrench/tests/shown/bar.txt +++ /dev/null @@ -1 +0,0 @@ -shown file \ No newline at end of file diff --git a/deploy/core/node_modules/wrench/tests/shown/foo/bar/ipsum.js b/deploy/core/node_modules/wrench/tests/shown/foo/bar/ipsum.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/shown/foo/dolor.md b/deploy/core/node_modules/wrench/tests/shown/foo/dolor.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/shown/foo/lorem.txt b/deploy/core/node_modules/wrench/tests/shown/foo/lorem.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/deploy/core/node_modules/wrench/tests/withsymlinks/test b/deploy/core/node_modules/wrench/tests/withsymlinks/test deleted file mode 100644 index dba688210..000000000 --- a/deploy/core/node_modules/wrench/tests/withsymlinks/test +++ /dev/null @@ -1 +0,0 @@ -aaa bbb ccc ddd \ No newline at end of file diff --git a/deploy/core/package.json b/deploy/core/package.json index f24277abb..2dfc26173 100644 --- a/deploy/core/package.json +++ b/deploy/core/package.json @@ -18,8 +18,7 @@ "dependencies": { "codemirror": "^4.7.0", "optimist": "^0.5.2", - "request": "^2.14.0", - "wrench": "^1.5.6" + "request": "^2.14.0" }, "forkedDependencies": { "replace": "^0.2.7", diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 593681f90..b96cf1157 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -11,8 +11,10 @@ (def ^:private fs (js/require "fs")) (def ^:private fpath (js/require "path")) -(def ^:private wrench (load/node-module "wrench")) -(def ^:private shell (js/require "shell")) +;; https://github.com/shelljs/shelljs +(def ^:private shell (load/node-module "shelljs")) +;; https://github.com/electron/electron/blob/master/docs/api/shell.md +(def ^:private electron-shell (js/require "shell")) (def ^:private os (js/require "os")) (def ^:private data-path (platform/get-data-path)) @@ -231,13 +233,13 @@ (when cb (cb e))))) (defn trash! [path] - (.moveItemTotrash shell path)) + (.moveItemTotrash electron-shell path)) (defn delete! "Delete file or directory" [path] (if (dir? path) - (.rmdirSyncRecursive wrench path) + (.rm shell "-rf" path) (.unlinkSync fs path))) (defn move! @@ -249,7 +251,7 @@ "Copy file or directory to given path" [from to] (if (dir? from) - (.copyDirSyncRecursive wrench from to) + (.cp shell "-R" from to) (save to (:content (open-sync from))))) (defn mkdir diff --git a/src/lt/objs/platform.cljs b/src/lt/objs/platform.cljs index a9cd4328c..0c1a4cb55 100644 --- a/src/lt/objs/platform.cljs +++ b/src/lt/objs/platform.cljs @@ -8,7 +8,7 @@ (def fs (js/require "fs")) (def clipboard (js/require "clipboard")) -(def shell (js/require "shell")) +(def electron-shell (js/require "shell")) (defn get-data-path [] (.getDataPath (.require (js/require "remote") "app"))) @@ -20,18 +20,18 @@ "darwin" :mac)) (defn open-url [path] - (.openExternal shell path)) + (.openExternal electron-shell path)) (defn open "If the given path exists, open it with the desktop's default manner. Otherwise, open it as an external protocol e.g. a url." [path] (if (.existsSync fs path) - (.openItem shell path) + (.openItem electron-shell path) (open-url path))) (defn show-item [path] - (.showItemInFolder shell path)) + (.showItemInFolder electron-shell path)) (defn copy "Copies given text to platform's clipboard" From 3e9e2c45bc6de4534ecd8fc7e4bee77977225f96 Mon Sep 17 00:00:00 2001 From: Marc G Date: Sat, 3 Sep 2016 21:13:46 +0200 Subject: [PATCH 613/656] Chocolatey step as requested by Kenny --- doc/for-committers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index 1fc6ce383..fc8b9219f 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -85,6 +85,7 @@ This is our release checklist which can be dropped in to an issue: - [ ] Update download links on lighttable.com - [ ] Mailing list announcement - [example email](https://gist.github.com/cldwalker/3d67153fe1eade2ae3cf) - [ ] Optional blog post if a major release + - [ ] Inform [Brian Dukes](https://github.com/bdukes) so that he can update the [Chocolatey package](https://chocolatey.org/packages/LightTable) - [ ] After release, [build api documentation](#build-api-documentation) ## Build API documentation From 6cdc6d2d6d3416efea8451fcf8d24152a7fccc52 Mon Sep 17 00:00:00 2001 From: Kenny Evitt Date: Sat, 10 Sep 2016 09:50:59 -0400 Subject: [PATCH 614/656] Add info about whole-file eval for Light Table source files to 'committers' doc. Closes #2254 --- doc/for-committers.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/for-committers.md b/doc/for-committers.md index 1fc6ce383..6a7071bd4 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -39,6 +39,14 @@ Allows us to build cross platfrom desktop apps. See [Electron guide](electron-gu ## Other +### Running Light Table Code in Light Table + +Generally, and unless you know what you're doing, do *not* eval entire files of the Light Table source; eval individual forms. + +As Gabriel explains in [this comment](https://github.com/LightTable/LightTable/issues/2170#issuecomment-201835808) in [issue #2170](https://github.com/LightTable/LightTable/issues/2170): + +> Depending on the file you're re-evaling, a whole file re-eval often redefines core LT object types and recreates LT objects. This can have dire consequences in some files e.g. re-evaling object.cljs will freeze LT as LT no longer has any objects defined. In the case of editor.cljs, if you comment the editor object type and do a file re-eval, you don't see errors. My suggestion is to stick to evaling forms when exploring LT and only do a file eval as you learn more of the codebase and understand the implications of a given file eval. I can add a brief description about this in the wiki or doc/for-committers.md if you think that'd be helpful to others. + ### Code Conventions * See the LightTable Style Guide. From d7c31bc8e9c81f899ba0af09b73202d2246d98a2 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Fri, 16 Sep 2016 22:29:18 -0400 Subject: [PATCH 615/656] Add documentation to editor and files namespaces - closes #2060 --- doc/for-committers.md | 2 + doc/style-guide.md | 4 +- project.clj | 3 +- src/lt/objs/editor.cljs | 458 ++++++++++++++++++++++++++++++++-------- src/lt/objs/files.cljs | 277 ++++++++++++++++++++---- 5 files changed, 610 insertions(+), 134 deletions(-) diff --git a/doc/for-committers.md b/doc/for-committers.md index fc8b9219f..5c1f5d7df 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -93,3 +93,5 @@ This is our release checklist which can be dropped in to an issue: Run `script/build-api-docs.sh` on a clean git state to build API documentation for the current LT version and publish generated docs. Make sure there are no pending git changes as this script will change git branches and push generated API docs to gh-pages. Expect to see a ton of warnings e.g. `WARNING: Use of undeclared Var cljs.core/seq at line 197`. This will be noise we have to live with until we upgrade ClojureScript. + +To build documentation locally for debugging of documentation generation, run `lein with-profile doc codox`. This will create a `codox` directory within the LightTable directory. Do not include in pull requests or commits. Note, the generated documenation will not have styling, and the view source links may be incorrect. diff --git a/doc/style-guide.md b/doc/style-guide.md index 21af59913..c896fbc0e 100644 --- a/doc/style-guide.md +++ b/doc/style-guide.md @@ -4,9 +4,11 @@ Follow the [Clojure Style Guide](https://github.com/bbatsov/clojure-style-guide) In order to streamline pull requests, prior to opening one, consider running your code through a formatting tool such as [cljfmt](https://github.com/weavejester/cljfmt) or [kibit](https://github.com/jonase/kibit). They are handy for catching any deviations from standard Clojure/script style guidelines. -## Documentation and Comments +## Documentation, Comments, and Examples 1. Unless obvious to someone new to the project, yet familiar with Clojure/script, a meaningful docstring should be associated with every class, function, behavior, and object. +2. When adding examples use the [ClojureDocs Example Style Guide](https://clojuredocs.org/examples-styleguide) as a reference for creating quality examples. +3. Good articles for quality documentation can be found [here](https://jacobian.org/writing/great-documentation/) and [here](https://bradfults.com/the-best-api-documentation-b9e46400379a). ## Errors diff --git a/project.clj b/project.clj index ecfc1e559..10f190a41 100644 --- a/project.clj +++ b/project.clj @@ -37,6 +37,7 @@ lt.objs.editor.pool lt.objs.files lt.objs.notifos] :source-uri "https://github.com/LightTable/LightTable/blob/{version}/{filepath}#L{line}" ;; Be explicit that undocumented public fns should be documented - :metadata {:doc "TODO: Add docstring"}} + :metadata {:doc "TODO: Add docstring" + :doc/format :markdown}} :source-paths ["src/"] ) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index ae34ab183..763e7f064 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -1,7 +1,21 @@ (ns lt.objs.editor "Provide fns and behaviors for interfacing with a CodeMirror editor - object. Also manage defining and loading CodeMirror. For more about CodeMirror - objects see http://codemirror.org/doc/manual.html#CodeMirror" + object. Also manage defining and loading [CodeMirror](http://codemirror.net/doc/manual.html). + + Editor objects are frequently used as arguements for functions, but often only the internal + CodeMirror object is actually used. Where the following documentation referers to the editor, + it is informally referring to the editor's CodeMirror object. + + Commonly encountered arguement names: + + * `e` - Editor + * `v` - Value + * `m` - Map + * `cm` - CodeMirror object + * `opts` - Options + * `ev` - Event Handler + * `pos` - Position: depending on the context, either a Javascript object + (e.g., `{\"line\": 0, \"ch\": 0}`) or cljs map (e.g., `{:line 0 :ch 0}`)." (:refer-clojure :exclude [val replace range]) (:require [crate.core :as crate] [lt.objs.context :as ctx-obj] @@ -18,46 +32,52 @@ (:require-macros [lt.macros :refer [behavior]])) (defn ->cm-ed - "Return editor's CodeMirror object" + "Return editor `e`'s CodeMirror object." [e] (if (satisfies? IDeref e) (:ed @e) e)) (defn ->elem - "Return DOM element of editor's CodeMirror object" + "Return DOM element of editor `e`'s CodeMirror object" [e] (.-parentElement (.getScrollerElement (->cm-ed e)))) (defn set-val - "Set content value of editor's CodeMirror object. Cursor position is lost" + "Set content value `v` of editor `e`'s CodeMirror object. Cursor position is lost. Returns `e`." [e v] (. (->cm-ed e) (setValue (or v ""))) e) (defn set-val-and-keep-cursor - "Same as set-val but current cursor position is kept" + "Same as [[set-val]] but current cursor position is kept." [e v] (let [cursor (.getCursor (->cm-ed e))] (set-val e v) (.setCursor (->cm-ed e) cursor))) (defn set-options - "Given a map of options, set each pair as an option on editor's - CodeMirror object" + "Given a map of options, set each pair as an option on editor `e`'s + CodeMirror object. Returns `e`." [e m] (doseq [[k v] m] (.setOption (->cm-ed e) (name k) v)) e) -(defn clear-history [e] +(defn clear-history + "Clear the history of editor `e`. Returns `e`." + [e] (.clearHistory (->cm-ed e)) e) -(defn get-history [e] +(defn get-history + "Returns the history of editor `e`." + [e] (.getHistory (->cm-ed e))) -(defn set-history [e v] +(defn set-history + "Set the history of editor `e` with provided value `v`." + [e v] (.setHistory (->cm-ed e) v) e) @@ -79,7 +99,9 @@ ;; Creating ;;********************************************************* -(defn- headless [opts] +(defn- headless + "Create a headless CodeMirror object using `opts`." + [opts] (-> (js/CodeMirror. (fn [])) (set-options opts))) @@ -101,12 +123,12 @@ e)) (defn on - "Register event handler on editor's CodeMirror object" + "Register event handler `ev`, which fires `func`, on editor `ed`'s CodeMirror object." [ed ev func] (.on (->cm-ed ed) (name ev) func)) (defn off - "Remove event handler on editor's CodeMirror object" + "Remove event handler `ev`, which fires `func`, on editor `ed`'s CodeMirror object." [ed ev func] (.off (->cm-ed ed) (name ev) func)) @@ -129,101 +151,188 @@ ;;********************************************************* (defn ->val - "Return editor's CodeMirror object buffer contents" + "Return editor `e`'s buffer content." [e] (. (->cm-ed e) (getValue))) -(defn ->token [e pos] +(defn ->token + "Returns token located as `pos` within editor `e`. + + See [getTokenAt](http://codemirror.net/doc/manual.html#getTokenAt)." + [e pos] (js->clj (.getTokenAt (->cm-ed e) (clj->js pos)) :keywordize-keys true)) (defn- ->token-js [e pos] (.getTokenAt (->cm-ed e) (clj->js pos))) -(defn ->token-type [e pos] +(defn ->token-type + "Return the type of token located at position `pos` for editor `e`. + + See [getTokenTypeAt](http://codemirror.net/doc/manual.html#getTokenTypeAt)." + [e pos] (.getTokenTypeAt (->cm-ed e) (clj->js pos))) -(defn- ->coords [e] +(defn- ->coords + "Returns cursor's coordinates of the form `{:left :top: bottom}` for editor `e`. + + See [cursorCoords](http://codemirror.net/doc/manual.html#cursorCoords)." + [e] (js->clj (.cursorCoords (->cm-ed e)) :keywordize-keys true :force-obj true)) -(defn- +class [e klass] +(defn- +class + "Add class `klass` to editor `e`. Returns `e`." + [e klass] (add-class (->elem e) (name klass)) e) -(defn- -class [e klass] +(defn- -class + "Remove class `klass` from editor `e`. Returns `e`." + [e klass] (remove-class (->elem e) (name klass)) e) (defn cursor - "Return cursor of editor's CodeMirror object as js object. - Example: #js {:line 144, :ch 9}" + "Return cursor position of editor `e`'s as js object. Returns JSON not edn... + use [[->cursor]] for edn. + + Example: + ``` + (cursor e) + ;;=> {\"line\": 144, \"ch\": 9} + ```" ([e] (cursor e nil)) ([e side] (.getCursor (->cm-ed e) side))) (defn ->cursor - "Same as cursor but returned as cljs map" + "Same as [[cursor]] but returned as edn." [e & [side]] (let [pos (cursor e side)] {:line (.-line pos) :ch (.-ch pos)})) -(defn pos->index [e pos] +(defn pos->index + "Returns integer based on position `pos` from editor's CodeMirror Object. + Position consists of line and character indexes as JSON, such as: + + ``` + {\"line\": 144, \"ch\": 9} + ``` + + Reverse of [posFromIndex](http://codemirror.net/doc/manual.html#posFromIndex)." + [e pos] (.indexFromPos (->cm-ed e) (clj->js pos))) -(defn mark [e from to opts] +(defn mark + "Marks text in editor `e` within range of `from` and `to`. + + See [markText](http://codemirror.net/doc/manual.html#markText)." + [e from to opts] (.markText (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) -(defn find-marks [e pos] +(defn find-marks + "Returns marks found at `pos` in . + + See [findMarksAt](http://codemirror.net/doc/manual.html#findMarksAt)." + [e pos] (.findMarksAt (->cm-ed e) (clj->js pos))) -(defn bookmark [e from widg] +(defn bookmark + "Insert bookmark at position `from` for widget `widg`. + + See [setBookmark](http://codemirror.net/doc/manual.html#setBookmark)." + [e from widg] (.setBookmark (->cm-ed e) (clj->js from) (clj->js widg))) (defn option - "Return value for option name on editor's CodeMirror object" + "Return value for option name `o` on editor `e`. + + See [getOption](http://codemirror.net/doc/manual.html#getOption)." [e o] (.getOption (->cm-ed e) (name o))) -(defn set-mode [e m] +(defn set-mode + "Set mode option for editor `e`. + + See [getOption](http://codemirror.net/doc/manual.html#getOption)." + [e m] (.setOption (->cm-ed e) "mode" m) e) -(defn ->mode [e] +(defn ->mode + "Return outer mode object for editor `e`. + + See [getMode](http://codemirror.net/doc/manual.html#getMode)." + [e] (.getMode (->cm-ed e))) -(defn focus [e] +(defn focus + "Return focus of editor. + + See [focus](http://codemirror.net/doc/manual.html#focus)." + [e] (.focus (->cm-ed e)) e) -(defn input-field [e] +(defn input-field + "Return input field element of editor. + + See [getInputField](http://codemirror.net/doc/manual.html#getInputField)." + [e] (.getInputField e)) -(defn blur [e] +(defn blur + "Blurs input field `e`. Returns `e`." + [e] (.blur (input-field e)) e) -(defn refresh [e] +(defn refresh + "Refreshes editor. Returns `e`. + + See [refresh](http://codemirror.net/doc/manual.html#refresh)." + [e] (.refresh (->cm-ed e)) e) -(defn on-move [e func] +(defn on-move + "Add function `func` to trigger when `onCursorActivity` event fires. + `func` should take two arguments, `ed` and `delta`. Returns `e`. + + See [cursorActivity](http://codemirror.net/doc/manual.html#event_cursorActivity)" + [e func] (.on e "onCursorActivity" (fn [ed delta] (func ed delta))) e) -(defn on-change [e func] +(defn on-change + "Add function `func` to trigger when `onChange` event fires. + `func` should take two arguments, `ed` and `delta`. Returns `e`. + + See [change](http://codemirror.net/doc/manual.html#event_change)" + [e func] (.on e "onChange" (fn [ed delta] (func ed delta))) e) -(defn on-update [e func] +(defn on-update + "Add function `func` to trigger when `onUpdate` event fires. + `func` should take two arguments, `ed` and `delta`. Returns `e`. + + See [update](http://codemirror.net/doc/manual.html#event_update)" + [e func] (.on e "onUpdate" (fn [ed delta] (func ed delta))) e) -(defn on-scroll [e func] +(defn on-scroll + "Add function `func` to trigger when `onScroll` event fires. + `func` should take two arguments, `ed`. Returns `e`. + + See [scroll](http://codemirror.net/doc/manual.html#event_scroll)" + [e func] (.on e "onScroll" (fn [ed] (func ed) @@ -231,131 +340,252 @@ e) (defn replace + "Replace text starting at position `from` for editor with text `v`. If provided, replace will stop at position `to`. + + See [replaceRange](http://codemirror.net/doc/manual.html#replaceRange)." ([e from v] (.replaceRange (->cm-ed e) v (clj->js from))) ([e from to v] (.replaceRange (->cm-ed e) v (clj->js from) (clj->js to)))) -(defn range [e from to] +(defn range + "Returns text between positions `from` and `to`. + + See [getRange](http://codemirror.net/doc/manual.html#getRange)." + [e from to] (.getRange (->cm-ed e) (clj->js from) (clj->js to))) -(defn line-count [e] +(defn line-count + "Returns the number of lines in the editor. + + See [lineCount](http://codemirror.net/doc/manual.html#lineCount)." + [e] (.lineCount (->cm-ed e))) -(defn insert-at-cursor [ed s] +(defn insert-at-cursor + "Insert into editor `ed` text `s` at cursor's position. Returns `ed`." + [ed s] (replace (->cm-ed ed) (->cursor ed) s) ed) -(defn move-cursor [ed pos] +(defn move-cursor + "Moves editor `ed`'s cursor to position `pos`. If `pos` is nil then default position of line 0, ch 0 is used. + + See [setCursor](http://codemirror.net/doc/manual.html#setCursor)." + [ed pos] (.setCursor (->cm-ed ed) (clj->js (or pos {:line 0 :ch 0})))) -(defn scroll-to [ed x y] +(defn scroll-to + "Scroll editor to pixel position `x`,`y`. + + See [scrollTo](http://codemirror.net/doc/manual.html#scrollTo)." + [ed x y] (.scrollTo (->cm-ed ed) x y)) -(defn center-cursor [ed] +(defn center-cursor + "Scrolls editor `ed` to the cursor and places it in the center of screen." + [ed] (let [l (:line (->cursor ed)) y (.-top (.charCoords (->cm-ed ed) (clj->js {:line l :ch 0}) "local")) half-h (/ (.-offsetHeight (.getScrollerElement (->cm-ed ed))) 2)] (scroll-to ed nil (- y half-h -55)))) -(defn selection? [e] +(defn selection? + "True if text is selected in editor. + + See [somethingSelected](http://codemirror.net/doc/manual.html#somethingSelected)." + [e] (.somethingSelected (->cm-ed e))) -(defn selection-bounds [e] +(defn selection-bounds + "When text is selected, returns position `{:from x :to y}` where `x` and `y` are the cursor's start and end values." + [e] (when (selection? e) - {:from (->cursor e"start") + {:from (->cursor e "start") :to (->cursor e "end")})) -(defn selection [e] +(defn selection + "Returns currently selected text in editor. + + See [getSelection](http://codemirror.net/doc/manual.html#getSelection)." + [e] (.getSelection (->cm-ed e))) -(defn set-selection [e start end] +(defn set-selection + "Sets editor's selection to `start` and `end` positions. + + See [setSelection](http://codemirror.net/doc/manual.html#setSelection)." + [e start end] (.setSelection (->cm-ed e) (clj->js start) (clj->js end))) -(defn set-extending [e ext?] +(defn set-extending + "Sets editor's 'extending' flag to `ext?`. + + See [setExtending](http://codemirror.net/doc/manual.html#setExtending)." + [e ext?] (.setExtending (->cm-ed e) ext?)) -(defn replace-selection [e neue & [after]] +(defn replace-selection + "Replace selection with `neue` for editor `e`. + + See [replaceSelection](http://codemirror.net/doc/manual.html#replaceSelection)." + [e neue & [after]] (.replaceSelection (->cm-ed e) neue (name (or after :end)) "+input")) -(defn undo [e] +(defn undo + "Undo one edit for editor `e`, if any exist. + + See [undo](http://codemirror.net/doc/manual.html#undo)." + [e] (.undo (->cm-ed e))) -(defn redo [e] +(defn redo + "Redo one edit for editor `e`, if any exist. + + See [redo](http://codemirror.net/doc/manual.html#redo)." + [e] (.redo (->cm-ed e))) -(defn copy [e] +(defn copy + "Copies currently selected text from editor." + [e] (platform/copy (selection e))) -(defn cut [e] +(defn cut + "Cut currently selected text from editor." + [e] (copy e) (replace-selection e "")) -(defn paste [e] +(defn paste + "Paste into editor's current cursor position " + [e] (replace-selection e (platform/paste))) -(defn char-coords [e pos] +(defn char-coords + "Returns position and dimension, based off of `pos` for editor `e`, in map consisting of `{:left :right :top :bottom}`. + + See [charChords](http://codemirror.net/doc/manual.html#charCoords)." + [e pos] (js->clj (.charCoords (->cm-ed e) (clj->js pos)) :keywordize-keys true :force-obj true)) -(defn operation [e func] +(defn operation + "Returns `e` rather than the return value of your function `func`. + + See [operation](http://codemirror.net/doc/manual.html#operation)." + [e func] (.operation (->cm-ed e) func) e) -(defn on-click [e func] +(defn on-click + "Add function `func` to trigger when `:mousedown` fires. + + Returns editor `e`." + [e func] (let [elem (->elem e)] (ev/capture elem :mousedown func) e)) -(defn extension [name func] +(defn extension + "Add function `func` named `name` to CodeMirror API. + + See [defineExtension](http://codemirror.net/doc/manual.html#defineExtension)." + [name func] (.defineExtension js/CodeMirror name func)) -(defn line-widget [e line elem & [opts]] +(defn line-widget + "Add line widget `elem` (an element), along with any options, at `line` to editor `e`. + + See [addLineWidget](http://codemirror.net/doc/manual.html#addLineWidget)." + [e line elem & [opts]] (.addLineWidget (->cm-ed e) line elem (clj->js opts))) -(defn remove-line-widget [e widg] +(defn remove-line-widget + "Remove widget `widg` from editor `e`. Opposite of `line-widget`." + [e widg] (.removeLineWidget (->cm-ed e) widg)) -(defn line [e l] +(defn line + "Returns the content of line `l` from editor `e`. + + See [getLine](http://codemirror.net/doc/manual.html#getLine)." + [e l] (.getLine (->cm-ed e) l)) -(defn first-line [e] +(defn first-line + "Returns the first line of editor `e`. + + See [firstLine](http://codemirror.net/doc/manual.html#firstLine)." + [e] (.firstLine (->cm-ed e))) -(defn last-line [e] +(defn last-line + "Returns the last line of editor `e`. + + See [lastLine](http://codemirror.net/doc/manual.html#lastLine)." + [e] (.lastLine (->cm-ed e))) -(defn line-handle [e l] +(defn line-handle + "Returns `LineHandle` object from editor `e` for line `l`. + + See [getLineHandle](http://codemirror.net/doc/manual.html#getLineHandle)." + [e l] (.getLineHandle (->cm-ed e) l)) -(defn lh->line [e lh] +(defn lh->line + "Given LineHandle object `lh`, returns integer for corresponding line from editor `e`. + + See [getLineNumber](http://codemirror.net/doc/manual.html#getLineNumber)." + [e lh] (.getLineNumber (->cm-ed e) lh)) -(defn line-length [e l] +(defn line-length + "Returns the length of line `l` from editor `e`." + [e l] (count (line e l))) -(defn select-all [e] +(defn select-all + "Select all lines from editor `e`." + [e] (set-selection e {:line (first-line e) :ch 0} {:line (last-line e)})) -(defn set-line [e l text] +(defn set-line + "Replace content at line `l` with `text` for editor `e`." + [e l text] (let [length (line-length e l)] (replace e {:line l :ch 0} {:line l :ch length} text))) -(defn +line-class [e lh plane class] +(defn +line-class + "Add CSS class name `class` to LineHandle `lh` at element `plane` for editor `e`. + + See [addLineClass](http://codemirror.net/doc/manual.html#addLineClass)." + [e lh plane class] (.addLineClass (->cm-ed e) lh (name plane) (name class))) -(defn -line-class [e lh plane class] +(defn -line-class + "Remove CSS class name `class` from LineHandle `lh` at element `plane` for editor `e`. + Opposite of `+line-class`. + + See [removeLineClass](http://codemirror.net/doc/manual.html#removeLineClass)." + [e lh plane class] (.removeLineClass (->cm-ed e) lh (name plane) (name class))) -(defn show-hints [e hint-fn options] +(defn show-hints + "Display hint `hint-fn` for editor `e` with any provided options. + + See [show-hint.js](http://codemirror.net/addon/hint/show-hint.js)." + [e hint-fn options] (js/CodeMirror.showHint (->cm-ed e) hint-fn (clj->js options)) e) (defn inner-mode + "Sets the innerMode of editor `e`'s CodeMirror object with `state` if provided. Returns the mode." ([e] (inner-mode e nil)) ([e state] (let [state (or state (->> (cursor e) (->token-js e) (.-state)))] @@ -363,22 +593,37 @@ (.-mode))))) (defn adjust-loc + "Adjust position `loc` with integer offset `dir` and the key `axis`. Axis should either be `:line` or `:ch`. + If `axis` is not specified, defaults to `:ch`." ([loc dir] (adjust-loc loc dir :ch)) ([loc dir axis] (when loc (update-in loc [axis] + dir)))) -(defn get-char [ed dir] +(defn get-char + "Returns the characters found from integer offest `dir` to the current cursor position. + + See range." + [ed dir] (let [loc (->cursor ed)] (if (> dir 0) (range ed loc (adjust-loc loc dir)) (range ed (adjust-loc loc dir) loc)))) -(defn indent-line [e l dir] +(defn indent-line + "Indents the line `l` based on the `dir` specified for editor `e`. + + See [indent-line](http://codemirror.net/doc/manual.html#indentLine)." + [e l dir] (.indentLine (->cm-ed e) l dir)) -(defn indent-lines [e from to dir] +(defn indent-lines + "Indents lines within the range resulting from `from` and `to` based on the `dir` specified + for editor `e`. + + See [indent-line](http://codemirror.net/doc/manual.html#indentLine)." + [e from to dir] (let [ed (->cm-ed e) diff (- (:line to) (:line from))] (if (zero? diff) @@ -386,16 +631,32 @@ (dotimes [x (inc diff)] (.indentLine ed (+ (:line from) x)))))) -(defn indent-selection [e dir] +(defn indent-selection + "Intent current selection in editor `e` by integer offset `dir`." + [e dir] (.indentSelection (->cm-ed e) dir)) -(defn line-comment [e from to opts] +(defn line-comment + "Changes lines within range of `from` and `to` into line comments for editor `e`. + + See [lineComment](http://codemirror.net/doc/manual.html#lineComment)." + [e from to opts] (.lineComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) -(defn uncomment [e from to opts] +(defn uncomment + "Attempts to uncomment lines within range of `from` and `to` for editor `e`. + + Returns `true` if comment range was successfully removed. + + See [uncomment](http://codemirror.net/doc/manual.html#uncomment)." + [e from to opts] (.uncomment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) -(defn block-comment [e from to opts] +(defn block-comment + "Wrap lines within range of `from` and `to` for editor `e`. + + See [blockComment](http://codemirror.net/doc/manual.html#blockComment)." + [e from to opts] (.blockComment (->cm-ed e) (clj->js from) (clj->js to) (clj->js opts))) (defn toggle-comment @@ -406,20 +667,41 @@ (block-comment e from to opts) (line-comment e from (->cursor e "end") opts)))) -(defn ->generation [e] +(defn ->generation + "Returns an integer that can be used to test if edits have occurred. + + See [changeGeneration](http://codemirror.net/doc/manual.html#changeGeneration)." + [e] (.changeGeneration (->cm-ed e))) -(defn dirty? [e gen] +(defn dirty? + "Returns true if document is not clean for generation `gen`. The document is not clean if it has been modified since it was in a clean state. + + See [isClean](http://codemirror.net/doc/manual.html#isClean)." + [e gen] (not (.isClean (->cm-ed e) gen))) -(defn get-doc [e] +(defn get-doc + "Returns currently active document for the editor. + + See [getDoc](http://codemirror.net/doc/manual.html#getDoc)." + [e] (.getDoc (->cm-ed e))) -(defn set-doc! [e doc] +(defn set-doc! + "Adds document `doc` to editor `e`. If there is already a document associated with the editor then it is replaced. Returns old document. + + See [swapDoc](http://codemirror.net/doc/manual.html#swapDoc)." + [e doc] (object/merge! e {:doc doc}) (.swapDoc (->cm-ed e) (:doc @doc))) (defn fold-code + "Attempts to fold code starting at position `loc`. If position is not provided then folding will be attempted at the cursor position. + + If the code is already folded then an attempt to unfold will occur. + + See [foldcode.js](http://codemirror.net/addon/fold/foldcode.js) addon." ([e] (fold-code e (->cursor e))) ([e loc] @@ -442,13 +724,17 @@ (if-let [gutter (dom/$ (str "div." k) gutter-div)] (dom/set-css gutter {"width" (str v "px")}))))))) -(defn add-gutter [e class-name width] +(defn add-gutter + "Add gutter with `class-name` of specified `width` to editor `e`." + [e class-name width] (let [gutter-classes (set (conj (js->clj (option e "gutters")) class-name)) current-widths (gutter-widths e) new-gutter-widths (assoc current-widths class-name width)] (update-gutters e gutter-classes new-gutter-widths))) -(defn remove-gutter [e class-name] +(defn remove-gutter + "Remove gutter with `class-name` from editor `e`." + [e class-name] (let [gutter-classes (remove #{class-name} (js->clj (option e "gutters"))) current-widths (gutter-widths e)] (update-gutters e gutter-classes current-widths))) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index b96cf1157..8c447507b 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -1,6 +1,6 @@ (ns lt.objs.files "Provide fns for doing file related operations. A number of fns - use the node fs library - https://nodejs.org/api/fs.html" + use the node [fs library](https://nodejs.org/api/fs.html) or [path library](https://nodejs.org/api/path.html)." (:refer-clojure :exclude [open exists?]) (:require [lt.object :as object] [lt.util.load :as load] @@ -29,7 +29,9 @@ (defn- join [& segs] (apply (.-join fpath) (filter string? (map str segs)))) -(def ignore-pattern #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") +(def ignore-pattern + "Regex pattern consisting of files, folders, etc... to ignore." + #"(^\..*)|\.class$|target/|svn|cvs|\.git|\.pyc|~|\.swp|\.jar|.DS_Store") (declare files-obj) @@ -63,10 +65,10 @@ :exts {} :types {}))) -(def line-ending "Current platform-specific line" (.-EOL os)) -(def separator "Current platform-specific file separator" (.-sep fpath)) +(def line-ending "Current platform-specific line ending." (.-EOL os)) +(def separator "Current platform-specific file separator." (.-sep fpath)) (def ^:private available-drives #{}) -(def cwd "Directory process is started in" (js/process.cwd)) +(def cwd "Directory process is started in." (js/process.cwd)) (when (= separator "\\") (.exec (js/require "child_process") "wmic logicaldisk get name" @@ -77,15 +79,43 @@ ))) (defn basename + "Extracts the basename of the `path`, typically the end of the path. + + If `ext` is provided then the result returned will not contain the extension. + + Example: + ``` + (basename \"/foo/bar/baz.txt\") + ;;=> \"baz.txt\" + + (basename \"/foo/bar/baz.txt\" \".txt\") + ;;=> \"baz\" + ```" ([path] (.basename fpath path)) ([path ext] (.basename fpath path ext))) -(defn get-roots [] +(defn get-roots + "Example: + ``` + (get-roots) ;;=> #{\"/\"} + ```" + [] (if (= separator "\\") available-drives #{"/"})) -(defn- get-file-parts [path] +(defn- get-file-parts + "Returns the exploded basename of `path` with each element after the first split on `.`. + + Example: + ``` + (get-file-parts \"./foo/bar/\") + ;;=> [\"bar\"] + + (get-file-parts \"./foo/bar/bas.txt.md.clj\") + ;;=> [\"bas.txt.md.clj\" \"txt.md.clj\" \"md.clj\" \"clj\"] + ```" + [path] (let [filename (basename path) file-parts (string/split filename #"\.")] (loop [parts file-parts @@ -94,31 +124,112 @@ acc (recur (rest parts) (conj acc (string/join "." parts))))))) -(defn ext [path] +(defn ext + "Returns the last extention of `path`, without the leading `.`, determined by the final `.` of the path. + + Example: + ``` + (ext \"foo.txt\") ;;=> \"txt\" + + (ext \"foo/bar.txt.tar\") ;;=> \"tar\" + + (ext \"foo.\") ;;=> \"\" + + (ext \"foo\") ;;=> \"\" + ```" + [path] (subs (.extname fpath path) 1)) -(defn without-ext [path] +(defn without-ext + "Returns the `path`, but without the last extension, deteremined by the final `.` of the path. + + Example: + ``` + (without-ext \"foo.txt\") ;;=> \"foo\" + + (without-ext \"foo/bar.txt.tar\") ;;=> \"foo/bar.txt\" + + (without-ext \"foo.\") ;;=> \"foo\" + + (without-ext \"foo\") ;;=> \"foo\" + ```" + [path] (let [i (.lastIndexOf path ".")] (if (> i 0) (subs path 0 i) path))) -(defn- ext->type [ext] +(defn- ext->type + "Extracts type information based on `ext`, which must be a keyword. + + Example: + ``` + (ext->type :txt) + ;;=> {:exts [:txt], :mime \"plaintext\", :tags [:editor.plaintext], :name \"Plain Text\"} + + (ext->type :cljs) + ;;=> {:exts [:cljs], :mime \"text/x-clojurescript\", :tags [:editor.cljs :editor.clojurescript], :name \"ClojureScript\"} + + (ext->type :clj) + ;;=> {:exts [:clj], :mime \"text/x-clojure\", :tags [:editor.clj :editor.clojure], :name \"Clojure\"} + ```" + [ext] (let [exts (:exts @files-obj) types (:types @files-obj)] (-> exts (get ext) types))) -(defn ext->mode [ext] +(defn ext->mode + "Extracts the `:mime` information from `ext`, which must be a keyword. + + Example: + ``` + (ext->mode :txt) ;;=> \"plaintext\" + + (ext->mode :cljs) ;;=> \"text/x-clojurescript\" + + (ext->mode :clj) ;;=> \"text/x-clojure\" + ```" + [ext] (:mime (ext->type ext))) -(defn path->type [path] +(defn path->type + "Given a `path`, returns type information if a file. Returns an empty string if `path` is a directory. + + Example: + ``` + (path->type \"/foo/bar/baz.txt\") + ;;=> {:exts [:txt], :mime \"plaintext\", :tags [:editor.plaintext], :name \"Plain Text\"} + + (path->type \"foo.cljs\") + ;;=> {:exts [:cljs], :mime \"text/x-clojurescript\", :tags [:editor.cljs :editor.clojurescript], :name \"ClojureScript\"} + + (path->type \"foo.clj\") + ;;=> {:exts [:clj], :mime \"text/x-clojure\", :tags [:editor.clj :editor.clojure], :name \"Clojure\"} + + (path->type \"/foo/bar/\") + ;;=> \"\" ; No type information is returned as it is a directory. + ```" + [path] (->> path get-file-parts (map #(ext->type (keyword %))) (remove nil?) first)) -(defn path->mode [path] +(defn path->mode + "Given a `path`, returns mime information. + + Example: + ``` + (path->mode \"/foo/bar/baz.txt\") ;;=> \"plaintext\" + + (path->mode \"foo.cljs\") ;;=> \"text/x-clojurescript\" + + (path->mode \"foo.clj\") ;;=> \"text/x-clojure\" + + (path->mode \"foo\") ;;=> \"\" + ```" + [path] (->> path get-file-parts (map #(ext->mode (keyword %))) @@ -135,27 +246,51 @@ (not n) "\r\n" :else "\n"))) -(defn exists? [path] +(defn exists? + "True if `path` exists on filesystem." + [path] (.existsSync fs path)) -(defn stats [path] +(defn stats + "If `path` exists then returns [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) instance." + [path] (when (exists? path) (.statSync fs path))) -(defn dir? [path] +(defn dir? + "True if `path` corresponds to a directory that exists." + [path] (when (exists? path) (let [stat (.statSync fs path)] (.isDirectory stat)))) -(defn file? [path] +(defn file? + "True if `path` corresponds to a file that exists." + [path] (when (exists? path) (let [stat (.statSync fs path)] (.isFile stat)))) -(defn absolute? [path] +(defn absolute? + "True if `path` is formatted as an absolute filepath. False otherwise. + Does not check if `path` exists or otherwise valid. + + Example: + ``` + (absolute? \"/foo/bar/baz\") ;;=> true + + (absolute? \"/foo/bar/baz.txt\") ;;=> true + + (absolute? \"./foo/bar\") ;;=> false + + (absolute? \"foo/bar\") ;;=> false + ```" + [path] (boolean (re-seq #"^[\\\/]|([\w]+:[\\\/])" path))) -(defn writable? [path] +(defn writable? + "Returns 7, 6, 3, or 2 based on file permissions. `path` must exist." + [path] (let [perm (-> (.statSync fs path) (.mode.toString 8) (js/parseInt 10) @@ -163,23 +298,55 @@ perm (subs perm (- (count perm) 3))] (#{"7" "6" "3" "2"} (first perm)))) -(defn resolve [base cur] +(defn resolve + "See [path.resolve](https://nodejs.org/api/path.html#path_path_resolve_path). + + Example: + ``` + (resolve \"/\" \"/home/user\") ;;=> \"/home/user\" + + (resolve \"/foo\" \"./bar/baz\") ;;=> \"/foo/bar/baz\" + + (resolve \"./\" \"codox\") ;;=> \"/home/user/dev/LightTable/codox\" + ```" + [base cur] (.resolve fpath base cur)) -(defn real-path [c] +(defn real-path + "Returns the canonicalized absolute pathname, expanding symbolic links. + + Example: + + Assume current directory is `/foo/bar/` and `/foo/bar/baz` exists too. + ``` + (real-path \"./\") ;;=> \"/foo/bar/\" + + (real-path \".././bar/baz\") ;;=> \"/foo/bar/baz/\" + ```" + [c] (.realpathSync fs c)) -(defn- ->file|dir [path f] +(defn- ->file|dir + "If `path` and `f` together form a valid directory, then `f` is returned as a directory. Otherwise, `f` is returned as a file + + Example: + ``` + (->file|dir \"/foo/\" \"bar.txt\") ;;=> \"bar.txt\" + + (->file|dir \"./foo/\" \"bar/\") ;;=> \"bar/\" + ```" + [path f] (if (dir? (str path separator f)) (str f separator) (str f))) (defn- bomless-read [path] + "Reads file at `path`, removes occurrences of `\uFEFF`, then returns modified result." (let [content (.readFileSync fs path "utf-8")] (string/replace content "\uFEFF" ""))) (defn open - "Open file and in callback return map with file's content in :content" + "Open file and in callback return map with file's content in `:content`" [path cb] (try (let [content (bomless-read path)] @@ -195,7 +362,7 @@ (when cb (cb nil e))))) (defn open-sync - "Open file and return map with file's content in :content" + "Open file and return map with file's content in `:content`." [path] (try (let [content (bomless-read path)] @@ -211,7 +378,7 @@ nil))) (defn save - "Save path with given content. Optional callback called after save" + "Save `path` with given `content`. Optional callback called after save." [path content & [cb]] (try (.writeFileSync fs path content) @@ -222,7 +389,7 @@ (when cb (cb e))))) (defn append - "Append content to path. Optional callback called after append" + "Append `content` to `path`. Optional callback called after append." [path content & [cb]] (try (.appendFileSync fs path content) @@ -232,39 +399,43 @@ (object/raise files-obj :files.save.error path e) (when cb (cb e))))) -(defn trash! [path] +(defn trash! + "Move file to trash and returns boolean status." + [path] (.moveItemTotrash electron-shell path)) (defn delete! - "Delete file or directory" + "Delete file or directory from filesystem." [path] (if (dir? path) (.rm shell "-rf" path) (.unlinkSync fs path))) (defn move! - "Move file or directory to given path" + "Move file or directory to given `path`." [from to] (.renameSync fs from to)) (defn copy - "Copy file or directory to given path" + "Copy file or directory to given `path`." [from to] (if (dir? from) (.cp shell "-R" from to) (save to (:content (open-sync from))))) (defn mkdir - "Make given directory" + "Make given directory." [path] (.mkdirSync fs path)) (defn parent - "Return directory of path" + "Return directory of `path`." [path] (.dirname fpath path)) -(defn- next-available-name [path] +(defn- next-available-name + "Given a `path`, if it already exists then append a digit (starts at 1 and increments after) to the end of `path` and check again." + [path] (if-not (exists? path) path (let [ext (ext path) @@ -277,7 +448,7 @@ (recur (inc x) (join p (str name (inc x) (when ext (str "." ext)))))))))) (defn ls - "Return directory's files" + "Return directory's files." ([path] (ls path nil)) ([path cb] (try @@ -293,8 +464,8 @@ (defn ls-sync "Return directory's files applying ignore-pattern. Takes map of options with keys: - * :files - When set only returns files - * :dirs - When set only return directories" + * `:files` - When set only returns files + * `:dirs` - When set only return directories" [path opts] (try (let [fs (remove #(re-seq ignore-pattern %) (map (partial ->file|dir path) (.readdirSync fs path)))] @@ -306,7 +477,7 @@ (js/lt.objs.console.error e)))) (defn full-path-ls - "Return directory's files as full paths" + "Return directory's files as full paths." [path] (try (doall (map (partial join path) (.readdirSync fs path))) @@ -314,7 +485,7 @@ (js/lt.objs.console.error e)))) (defn dirs - "Return directory's directories" + "Return directory's directories." [path] (try (filter dir? (map (partial join path) (.readdirSync fs path))) @@ -322,7 +493,7 @@ (js/lt.objs.console.error e)))) (defn home - "Return users' home directory (e.g. ~/) or path under it" + "Return users' home directory (e.g. ~/) or path under it." ([] (home nil)) ([path] (let [h (if (= js/process.platform "win32") @@ -331,14 +502,14 @@ (join h (or path separator))))) (defn lt-home - "Return LT's home directory" + "Return LT's home directory." ([] load/dir) ([path] (join (lt-home) path))) (defn lt-user-dir - "Return LT's user directory. Used for storing user-related content e.g. - settings, plugins, logs and caches" + "Return LT's user directory. Used for storing user-related content (e.g., + settings, plugins, logs, and caches)." ([] (lt-user-dir "")) ([path] (if js/process.env.LT_USER_DIR @@ -346,8 +517,8 @@ (join data-path path)))) (defn walk-up-find - "Starting at start path, walk up parent directories and return first path - whose basename matches find" + "Starting at `start` path, walk up parent directories and return first path + whose basename matches find." [start find] (let [roots (get-roots)] (loop [cur start @@ -360,7 +531,9 @@ (join cur find) (recur (parent cur) cur)))))) -(defn relative [a b] +(defn relative + "Returns a relative path, if there is one, from `a` to `b`." + [a b] (.relative fpath a b)) (defn- ->name|path [f & [rel]] @@ -377,7 +550,19 @@ segs)] (vec (map #(str % separator) segs)))) -(defn filter-walk [func path] +(defn filter-walk + "Returns files and directories under `path` where `func` returns true. + + Example: + ``` + (filter-walk + (fn [x] (= (basename x) \"LightTable\")) + \"/home/sbauer/dev/LightTable/\") + ;;=> (\"/home/sbauer/dev/LightTable/builds/lighttable-0.8.1-linux/LightTable\" + \"/home/sbauer/dev/LightTable/.git/refs/remotes/LightTable\" + \"/home/sbauer/dev/LightTable/.git/logs/refs/remotes/LightTable\") + ```" + [func path] (loop [to-walk (dirs path) found (filterv func (full-path-ls path))] (if-not (seq to-walk) From 9db1b509f55e6f82694020d0e56476bbb6a99bc4 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sat, 17 Sep 2016 00:07:05 -0400 Subject: [PATCH 616/656] Fix typos in documentation --- src/lt/objs/editor.cljs | 4 ++-- src/lt/objs/files.cljs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/editor.cljs b/src/lt/objs/editor.cljs index 763e7f064..82f6ecdec 100644 --- a/src/lt/objs/editor.cljs +++ b/src/lt/objs/editor.cljs @@ -2,11 +2,11 @@ "Provide fns and behaviors for interfacing with a CodeMirror editor object. Also manage defining and loading [CodeMirror](http://codemirror.net/doc/manual.html). - Editor objects are frequently used as arguements for functions, but often only the internal + Editor objects are frequently used as arguments for functions, but often only the internal CodeMirror object is actually used. Where the following documentation referers to the editor, it is informally referring to the editor's CodeMirror object. - Commonly encountered arguement names: + Commonly encountered argument names: * `e` - Editor * `v` - Value diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 8c447507b..4e1bea35b 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -141,7 +141,7 @@ (subs (.extname fpath path) 1)) (defn without-ext - "Returns the `path`, but without the last extension, deteremined by the final `.` of the path. + "Returns the `path`, but without the last extension, determined by the final `.` of the path. Example: ``` From 0a76548b27c0b61d44e33e16012bf273454c5c5f Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sun, 25 Sep 2016 02:09:30 -0400 Subject: [PATCH 617/656] Fix language docs sidebar from keeping focus when closed --- deploy/settings/default/default.behaviors | 1 + src/lt/plugins/doc.cljs | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/deploy/settings/default/default.behaviors b/deploy/settings/default/default.behaviors index 1b8fe986e..22dedd639 100644 --- a/deploy/settings/default/default.behaviors +++ b/deploy/settings/default/default.behaviors @@ -517,6 +517,7 @@ [:sidebar.docs.search :lt.plugins.doc/sidebar.doc.search.exec] [:sidebar.docs.search :lt.plugins.doc/doc.search.results] + [:sidebar.docs.search :lt.plugins.doc/focus-on-show] [:sidebar.docs.search :lt.plugins.doc/focus!] [:sidebar.docs.search :lt.plugins.doc/set-item] [:sidebar.docs.search :lt.plugins.doc/clear!] diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index 55dda4c78..1e98d5f05 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -133,7 +133,7 @@ (clients/send c (:trigger cur) {:search v} :only this)))))) (defn ->val [this] - (dom/val (dom/$ :.search (object/->content this)))) + (dom/val (dom/$ :input.search (object/->content this)))) (defn grouped-items [results v prev] (let [normal (dom/fragment []) @@ -199,10 +199,19 @@ (dom/prepend old exact) (dom/append old normal)))) +(behavior ::focus-on-show + :triggers #{:show} + :reaction (fn [this] + (object/raise this :focus!))) + (behavior ::focus! :triggers #{:focus!} :reaction (fn [this] - (dom/focus (dom/$ :input (object/->content this))))) + (if-not (:active @this) + (let [input (dom/$ :input (object/->content this))] + (dom/focus input) + (.select input)) + (object/raise (-> @this :active :options) :focus!)))) (object/object* ::sidebar.doc.search :tags #{:sidebar.docs.search} @@ -230,8 +239,7 @@ :desc "Docs: Search language docs" :exec (fn [force?] (when doc-search - (object/raise sidebar/rightbar :toggle doc-search {:force? force?}) - (object/raise doc-search :focus!)) + (object/raise sidebar/rightbar :toggle doc-search {:force? force?})) )}) (cmd/command {:command :docs.search.hide @@ -239,7 +247,7 @@ :hidden true :exec (fn [force?] (when doc-search - (object/raise sidebar/rightbar :close! doc-search)) + (object/raise sidebar/rightbar :close!)) )}) (behavior ::init-doc-search From 15517abe3c1b908f9d0c5cecd458faac0564c6eb Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Wed, 5 Oct 2016 22:22:50 -0400 Subject: [PATCH 618/656] Document functions of util namespaces. --- src/lt/util/dom.cljs | 320 +++++++++++++++++++++++++++++++++------- src/lt/util/events.cljs | 5 +- src/lt/util/ipc.cljs | 24 +-- src/lt/util/js.cljs | 63 ++++++-- src/lt/util/kahn.cljs | 25 ++-- src/lt/util/load.cljs | 86 +++++++---- src/lt/util/style.cljs | 15 +- 7 files changed, 424 insertions(+), 114 deletions(-) diff --git a/src/lt/util/dom.cljs b/src/lt/util/dom.cljs index 991211c91..21e3a0eac 100644 --- a/src/lt/util/dom.cljs +++ b/src/lt/util/dom.cljs @@ -1,8 +1,9 @@ (ns lt.util.dom - "Provide DOM related fns" + "Provide DOM related functions." (:refer-clojure :exclude [parents remove next val empty])) (defn lazy-nl-via-item + "Return lazy seq of NodeList." ([nl] (lazy-nl-via-item nl 0)) ([nl n] (when (< n (. nl -length)) (lazy-seq @@ -37,92 +38,228 @@ ([this n not-found] (or (.item this n) not-found)))) -(defn text-node [text] +(defn text-node + "Create a text node containing string `text`." + [text] (js/document.createTextNode text)) (defn $$ + "Returns a NodeList of all elements within `elem` that match `query`. + + If `elem` is not specified then the entire document is used." ([query] ($$ query js/document)) ([query elem] (.querySelectorAll elem (name query)))) (defn $ + "Returns the first element found within `elem` that matches `query`. + + If `elem` is not specified then the entire document is used. + + Example: + ``` + ;; Assume there exists a div such as: + ;;
    + + ($ \"div .tabsets\") + ;;=> #<[object HTMLDivElement]> + ```" ([query] ($ query js/document)) ([query elem] (.querySelector elem (name query)))) -(defn append [parent child] +(defn append + "Append `child` to the `parent` as a child node. If `child` already exists + as a node then it is moved to the new location. + + Returns `parent`." + [parent child] (.appendChild parent child) parent) -(defn prepend [parent child] +(defn prepend + "Insert `child` as the first child node of `parent`, if there already exist children nodes. + Otherwise, [[append]] `child`." + [parent child] (if (.-firstChild parent) (.insertBefore parent child (.-firstChild parent)) (append parent child))) -(defn add-class [elem class] +(defn add-class + "Add `class` to the classList of `elem`." + [elem class] (when (and elem (not (empty? (name class)))) (.add (.-classList elem) (name class)))) -(defn remove-class [elem class] +(defn remove-class + "Remove `class` from the classList of `elem`." + [elem class] (when (and elem (not (empty? (name class)))) (.remove (.-classList elem) (name class)))) -(defn has-class? [elem class] +(defn has-class? + "True when `elem` has `class` in its classList." + [elem class] (when (and elem (not (empty? (name class)))) (.contains (.-classList elem) (name class)))) -(defn toggle-class [elem class] +(defn toggle-class + "If `elem` has `class` then remove `class`. Otherwise, `class` is added to `elem`." + [elem class] (if (has-class? elem class) (remove-class elem class) (add-class elem class))) -(defn set-css [elem things] +(defn set-css + "Add each key-value pair in `things` to `elem`'s style. + + Returns `nil`, if change was successful. + + Example: + ``` + ;; Assume there exists a div such as: + ;;
    + + ;; Returns nil, but makes the change. + (dom/set-css ($ \"div\") {\"bottom\" \"50px\"}) + ;;=> nil + ;; div is now:
    + ```" + [elem things] (doseq [[k v] things] (aset (.-style elem) (name k) (if (keyword? v) (name v) v)))) -(defn css [elem things] +(defn css + "If `things` is a map, sets the CSS of `elem` via [[set-css]]. Otherwise, + returns what is located at key `things` in `elem`. + + Example: + ``` + ;; Assume there exists a div such as: + ;;
    + + (css ($ \"div .tabsets\") :bottom) + ;;=> \"34px\" + + ;; Returns nil, but makes the change. + (css ($ \"div .tabsets\") {\"bottom\" \"50px\"}) + ;;=> nil + + (css ($ \"div .tabsets\") \"bottom\") + ;;=> \"50px\" + ```" + [elem things] (let [things (if (= js/Object (type things)) - (js->clj things) - things)] + (js->clj things) + things)] (if (map? things) (set-css elem things) (aget (.-style elem) (name things))))) -(defn set-attr [elem things] +(defn set-attr + "Add each key-value pair in `things` to `elem`'s attributes. + + Returns `nil`, if change was successful. + + Example: + ``` + ;; Assume there exists a div such as: + ;;
    + + ;; Returns nil, but makes the change. + (dom/set-attr ($ \"div .tabsets\") {:draggable \"true\"}) + ;;=> nil + ;; div is now:
    + ```" + [elem things] (doseq [[k v] things] (.setAttribute elem (name k) (if (keyword? v) (name v) v)))) -(defn attr [elem things] +(defn attr + "If `things` is a map, sets the attributes of `elem` via [[set-attr]]. Otherwise, returns + what is located at key `things` in `elem`. + + Example: + ``` + ;; Assume there exists a div such as: + ;;
    + + (attr ($ \"div .tabsets\") \"draggable\") + ;;=> \"true\" + + ;; Returns nil, but makes the change. + (attr ($ \"div .tabsets\") {\"draggable\" \"false\"}) + ;;=> nil + + (attr ($ \"div .tabsets\") \"draggable\") + ;;=> \"false\" + ```" + [elem things] (if (map? things) (set-attr elem things) (.getAttribute elem (name things)))) -(defn parent [elem] +(defn parent + "Return the parent node of `elem`. + + Note: using `parent` on the document node will result in a type error. + + Example: + ``` + (parent ($ \"body\")) + ;;=> #<[object HTMLHtmlElement]> + + (.-nodeName (parent ($ \"body\"))) + ;;=> \"HTML\" + ```" + [elem] (.-parentNode elem)) -(defn children [elem] +(defn children + "Return the child nodes of `elem`." + [elem] (.-children elem)) -(defn remove [elem] +(defn remove + "Remove `elem` from the DOM tree." + [elem] (when-let [p (parent elem)] (.removeChild p elem))) -(defn empty [elem] +(defn empty + "Sets the inner HTML of `elem` to an empty string." + [elem] (set! (.-innerHTML elem) "")) -(defn val [elem & [v]] +(defn val + "If `v` is provided then set the value of `elem` to `v`. Otherwise, return the + current value of `elem`." + [elem & [v]] (if-not v (.-value elem) (set! (.-value elem) v))) -(defn prevent [e] +(defn prevent + "Cancel event `e`, if it is cancelable. Does not stop further propagation. + + See [[stop-propagation]]." + [e] (.preventDefault e)) -(defn stop-propagation [e] +(defn stop-propagation + "Stop further propagation of event `e`. + + See [[prevent]]." + [e] (.stopPropagation e)) -(defn siblings [elem] +(defn siblings + "Return child nodes of `elem`'s parent." + [elem] (.-children (parent elem))) -(defn parents [elem sel] +(defn parents + "Starting with `elem`'s immediate parent going up, returns first parent of + `elem` that has a selector matching `sel` or `nil` if no match is found." + [elem sel] (let [root (parent ($ :body))] (loop [p (parent elem)] (when (and p @@ -131,92 +268,169 @@ p (recur (parent p))))))) -(defn next [elem] +(defn next + "Returns the next element at the same level of `elem` in the DOM tree. + `nil` if there are no siblings." + [elem] (.-nextElementSibling elem)) -(defn before [elem neue] +(defn before + "Insert element `neue` into `elem`'s parent in the position before `elem`. + + See [[after]]." + [elem neue] (.insertBefore (parent elem) neue elem)) -(defn after [elem neue] +(defn after + "Insert element `neue` into `elem`'s parent in the position after `elem`. + + See [[before]]." + [elem neue] (if-let [n (next elem)] (before n neue) (append (parent elem) neue))) -(defn replace-with [orig neue] +(defn replace-with + "Replace `orig` with `neue`." + [orig neue] (when-let [p (parent orig)] (.replaceChild p neue orig))) -(defn height [elem] +(defn height + "Returns the height of the visible area for `elem`, in pixels. The value + contains the height with the padding, but it does not include the scrollBar, + border, and the margin." + [elem] (.-clientHeight elem)) -(defn width [elem] +(defn width + "Returns the width of the visible area for `elem`, in pixels. The value + contains the width with the padding, but it does not include the scrollBar, + border, and the margin." + [elem] (.-clientWidth elem)) -(defn scroll-width [elem] +(defn scroll-width + "Returns, in pixels, whichever is greater, the width of the content within + `elem` or the width of `elem` itself." + [elem] (.-scrollWidth elem)) -(defn offset-top [elem] +(defn offset-top + "Return, in pixels, the offset of `elem` relative to the top of the + parent." + [elem] (.-offsetTop elem)) -(defn scroll-top [elem & [v]] +(defn scroll-top + "Returns or sets the scrollTop value of `elem` depending on if `v` was + provided." + [elem & [v]] (if-not v (.-scrollTop elem) (set! (.-scrollTop elem) v))) -(defn top [elem] +(defn top + "Return the `:top` style of `elem`." + [elem] (css elem :top)) -(defn bottom [elem] +(defn bottom + "Return the `:bottom` style of `elem`." + [elem] (css elem :bottom)) -(defn left [elem] +(defn left + "Return the `:left` style of `elem`." + [elem] (css elem :left)) -(defn right [elem] +(defn right + "Return the `:right` style of `elem`." + [elem] (css elem :right)) -(defn html [elem & [h]] +(defn html + "Return the inner HTML of `elem` or set the inner HTML to `h`." + [elem & [h]] (if-not h (.-innerHTML elem) (set! (.-innerHTML elem) h))) -(defn ->ev [ev] +(defn ->ev + "Convert `ev` to string." + [ev] (str (name ev))) -(defn trigger [elem ev & [opts]] +(defn trigger + "Trigger a HTMLEvents event named `ev` on `elem` with `opts` set on the + event." + [elem ev & [opts]] (let [e (.createEvent js/document "HTMLEvents")] (.initEvent e (name ev) true true) (set! (.-opts e) opts) (.dispatchEvent elem e))) -(defn on [elem ev cb] +(defn on + "Add event listener named `ev` on `elem` with callback function `cb`." + [elem ev cb] (.addEventListener elem (->ev ev) cb)) -(defn off [elem ev cb] +(defn off + "Remove event listener named `ev` on `elem` with callback function `cb`." + [elem ev cb] (.removeEventListener elem (->ev ev) cb)) -(defn on* [elem evs] +(defn on* + "Add multiple event listeners to `elem`. + + `evs` should be a map of the form `{:ev cb}` where `:ev` is the name and + `cb` the callback function." + [elem evs] (doseq [[ev cb] evs] (.addEventListener elem (->ev ev) cb))) -(defn active-element [] +(defn active-element + "Return the active element of the document. + + An active element does not necessarily have focus, but an element with focus + is always the active element in a document." + [] (.-activeElement js/document)) -(defn focus [elem] +(defn focus + "Sets focus on `elem`." + [elem] (.focus elem)) -(defn blur [elem] +(defn blur + "Remove focus from `elem`." + [elem] (.blur elem)) -(defn selection [elem start stop dir] +(defn selection + "Set the current selection range on `elem` with `start` and `stop` being the + indexes which respectively contain the first and last characters of the + selection. + + `dir` can be used to set the direction in which selection occurs." + [elem start stop dir] (.setSelectionRange elem start stop dir)) -(defn make [str] +(defn make + "Create div containing `str` as inner HTML. Returns HTMLCollection of + resulting div. + + See [[children]]." + [str] (let [d (.createElement js/document "div")] (html d str) (children d))) -(defn index [e] +(defn index + "Returns the index of element `e`, which is where `e` is located inside of its + parent's list of children, or -1 if there is no parent." + [e] (let [p (parent e) c (if p (children p) (array)) len (.-length c)] @@ -229,12 +443,16 @@ i (recur (inc i)))))))) -(defn ready [func] +(defn ready + "Trigger `func` when `:DOMContentLoaded` fires on the document." + [func] (on js/document :DOMContentLoaded func)) -(defn fragment [items] +(defn fragment + "Create and return a document fragment with `items` appended to it as + children." + [items] (let [frag (.createDocumentFragment js/document)] (doseq [i items] (.appendChild frag i)) frag)) - diff --git a/src/lt/util/events.cljs b/src/lt/util/events.cljs index 42f6eecb0..f2bc150cd 100644 --- a/src/lt/util/events.cljs +++ b/src/lt/util/events.cljs @@ -1,6 +1,9 @@ (ns lt.util.events - "Provide DOM event related fns") + "Provide DOM event related functions.") (defn capture + "Add function `handler` to trigger when event listener `ev` fires on `elem`. + + If `elem` is not provided then the event `ev` and its `handler` are bound to the document." ([ev handler] (capture js/document ev handler)) ([elem ev handler] (.addEventListener elem (name ev) handler true))) diff --git a/src/lt/util/ipc.cljs b/src/lt/util/ipc.cljs index df1691b51..ea816c9e1 100644 --- a/src/lt/util/ipc.cljs +++ b/src/lt/util/ipc.cljs @@ -1,17 +1,13 @@ (ns lt.util.ipc "Util functions for the ipc renderer - https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md") -(def ipc (js/require "ipc")) +(def ipc "Provides access to the ipc renderer." (js/require "ipc")) -(defn send - "Delegates to ipc.send which asynchronously sends args to the browser process's channel." - [channel & args] - (apply (.-send ipc) channel (clj->js args))) +;; `send` and `on` are declared here with their bodies defined later as otherwise Codox will use the +;; redefined `send` and `on` in the below when block instead. +(declare send) -(defn on - "Delegates to ipc.on which defines a callback to fire for the given channel." - [channel cb] - (.on ipc channel cb)) +(declare on) ;; Set $IPC_DEBUG to debug incoming and outgoing ipc messages for the renderer process (when (aget js/process.env "IPC_DEBUG") @@ -24,3 +20,13 @@ (old-on channel (fn [& args] (prn "->RENDERER" channel args) (apply cb args))))))) + +(defn send + "Delegates to ipc.send, which asynchronously sends args to the browser process's channel." + [channel & args] + (apply (.-send ipc) channel (clj->js args))) + +(defn on + "Delegates to ipc.on, which defines a callback to fire for the given channel." + [channel cb] + (.on ipc channel cb)) diff --git a/src/lt/util/js.cljs b/src/lt/util/js.cljs index e20b5faab..b57537ce4 100644 --- a/src/lt/util/js.cljs +++ b/src/lt/util/js.cljs @@ -1,37 +1,70 @@ (ns lt.util.js - "Provide misc js related fns") + "Provide misc Javascript related functions.") -(defn every [ms func] +(defn every + "Execute `func` every `ms` milliseconds." + [ms func] (js/setInterval func ms)) -(defn wait [ms func] +(defn wait + "Wait `ms` milliseconds before executing `func`." + [ms func] (js/setTimeout func ms)) -(defn now [] +(defn now + "Return the current time in milliseconds starting from the Unix epoch." + [] (.getTime (js/Date.))) -(defn toggler [cur op op2] +(defn toggler + "If `cur` equals `op` then return `op2`. Otherwise return `op`." + [cur op op2] (if (= cur op) op2 op)) -(defn debounce [ts func] +(defn debounce + "Debounce execution of `func` with a delay of `ts` milliseconds. + + In other words, returns a new function that executes `func` only once + after `ts` milliseconds regardless the number of times the new function is called + during the `ts` milliseconds. + + See [[throttle]]." + [ts func] + ;; For js/Cowboy, see deploy/core/node_modules/lighttable/throttle.js (.debounce js/Cowboy ts func)) -(defn throttle [ts func] +(defn throttle + "Throttle execution of `func` with a delay of `ts` milliseconds. + + In other words, returns a new function that executes `func` no more than + once every `ts` milliseconds. + + See [[debounce]]." + [ts func] + ;; For js/Cowboy, see deploy/core/node_modules/lighttable/throttle.js (.throttle js/Cowboy ts func)) -(defn ->clj [data] +(defn ->clj + "Convert JSON `data` to ClojureScript with keywords enabled. + + See [js->clj](http://cljs.github.io/api/cljs.core/js-GTclj)." + [data] (js->clj data :keywordize-keys true)) -(def entities {"&" "&" - "<" "<" - ">" ">" - "\"" """ - "'" "'" - "/" "/"}) +(def entities + "Map of entities, such as `&`, to their corresponding character reference." + {"&" "&" + "<" "<" + ">" ">" + "\"" """ + "'" "'" + "/" "/"}) -(defn escape [str] +(defn escape + "Replace characters in `str` that are in [[entities]] with their escaped equivalent." + [str] (when str (.replace str (js/RegExp. "[&<>\"'/]" "g") (fn [s] (entities s))))) diff --git a/src/lt/util/kahn.cljs b/src/lt/util/kahn.cljs index c8b1372e6..661655379 100644 --- a/src/lt/util/kahn.cljs +++ b/src/lt/util/kahn.cljs @@ -1,36 +1,41 @@ (ns lt.util.kahn - "Provide a Khan sort" + "Provide a [Khan sort](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm)." (:require [clojure.set :as set :refer [difference union intersection]])) (defn without - "Returns set s with x removed." + "Returns set `s` with `x` removed." [s x] (difference s #{x})) (defn take-1 - "Returns the pair [element, s'] where s' is set s with element removed." + "Returns the pair `[element, s']` where `s'` is set `s` with `element` removed." [s] {:pre [(not (empty? s))]} (let [item (first s)] [item (without s item)])) (defn no-incoming - "Returns the set of nodes in graph g for which there are no incoming - edges, where g is a map of nodes to sets of nodes." + "Returns the set of nodes in graph `g` for which there are no incoming + edges, where `g` is a map of nodes to sets of nodes." [g] (let [nodes (set (keys g)) have-incoming (apply union (vals g))] (difference nodes have-incoming))) (defn normalize - "Returns g with empty outgoing edges added for nodes with incoming - edges only. Example: {:a #{:b}} => {:a #{:b}, :b #{}}" + "Returns `g` with empty outgoing edges added for nodes with incoming + edges only. + + Example: + ``` + (normalize {:a #{:b}}) ;;=> {:a #{:b}, :b #{}} + ```" [g] (let [have-incoming (apply union (vals g))] (reduce #(if (get % %2) % (assoc % %2 #{})) g have-incoming))) (defn kahn-sort - "Proposes a topological sort for directed graph g using Kahn's - algorithm, where g is a map of nodes to sets of nodes. If g is - cyclic, returns nil." + "Proposes a topological sort for directed graph `g` using Kahn's + algorithm, where `g` is a map of nodes to sets of nodes. If `g` is + cyclic, returns `nil`." ([g] (kahn-sort (normalize g) [] (no-incoming g))) ([g l s] diff --git a/src/lt/util/load.cljs b/src/lt/util/load.cljs index f204be6b8..bc7ba821e 100644 --- a/src/lt/util/load.cljs +++ b/src/lt/util/load.cljs @@ -1,23 +1,44 @@ (ns lt.util.load - "Provide fns to load js, css and node module assets into LT" + "Provide functions to load js, css and node module assets into LT." (:require [clojure.string :as string])) -(def fpath (js/require "path")) -(def fs (js/require "fs")) +(def fpath "Provides access to Node/Electron [path library](https://nodejs.org/api/path.html)." (js/require "path")) +(def fs "Provides access to Node/Electron [fs library](https://nodejs.org/api/fs.html)." (js/require "fs")) -(def dir (str js/__dirname "/..")) +(def dir "Directory where Light Table is being executed." (str js/__dirname "/..")) -(def ^:dynamic *force-reload* false) +(def ^:dynamic *force-reload* "When true, various parts of Light Table will reload." + false) -(def separator (.-sep fpath)) +(def separator + "Current platform-specific file separator." + (.-sep fpath)) -(defn absolute? [path] +(defn absolute? + "True if `path` is formatted as an absolute filepath. False otherwise. + Does not check if `path` exists or is otherwise valid. + + Example: + ``` + (absolute? \"/foo/bar/baz\") ;;=> true + + (absolute? \"/foo/bar/baz.txt\") ;;=> true + + (absolute? \"./foo/bar\") ;;=> false + + (absolute? \"foo/bar\") ;;=> false + ```" + [path] (boolean (re-seq #"^\s*[\\\/]|([\w]+:[\\\/])" path))) -(defn node-module [path] +(defn node-module + "Requires Light Table's bundled node modules located at `path`." + [path] (js/require (str dir "/core/node_modules/" path))) -(defn- abs-source-mapping-url [code file] +(defn- abs-source-mapping-url + "Converts source mapping to use absolute paths for URLs. Also converts `\\` to `/` in order to maintain compatibility with Windows." + [code file] (if-let [path-to-source-map (second (re-find #"\n//# sourceMappingURL=(.*\.map)" code))] (if-not (absolute? path-to-source-map) (let [abs-path-to-source-map (string/replace (.join fpath (.dirname fpath file) path-to-source-map) "\\" "/") @@ -34,6 +55,9 @@ (str "\n\n//# sourceURL=" (js/encodeURI file)))) (defn js + "Loads `file`, into Light Table and evaluates it. + + If `sync` is not provided then it defaults to `false`. If `sync` is truthy then `file` will be loaded synchronously." ([file] (js file false)) ([file sync] (let [file (if-not (absolute? file) @@ -47,18 +71,22 @@ (js/window.eval (-> (.toString content) (prep file))))))))) -(defn css [file] - (let [link (js/document.createElement "link")] - (set! (.-type link) "text/css") - (set! (.-rel link) "stylesheet") - (set! (.-href link) (if (absolute? file) - (str "file://" file) - file)) - (js/document.head.appendChild link) - link)) - - -(defn obj-exists? [s] +(defn css + "Loads `file` into Light Table as CSS. Returns the resulting link." + [file] + (let [link (js/document.createElement "link")] + (set! (.-type link) "text/css") + (set! (.-rel link) "stylesheet") + (set! (.-href link) (if (absolute? file) + (str "file://" file) + file)) + (js/document.head.appendChild link) + link)) + + +(defn obj-exists? + "When string `s` corresponds to a Javascript object already existing in Light Table then return the found object." + [s] (loop [parts (string/split s ".") cur js/window] (if-not (first parts) @@ -66,15 +94,23 @@ (if-let [cur (aget cur (first parts))] (recur (rest parts) cur))))) -(def provided #js {}) +(def provided + "An empty Javascript object." + #js {}) -(defn provided-ancestors [parent] +(defn provided-ancestors + "Return the number of ancestors of `parent`." + [parent] (count (.filter (js/Object.keys provided) #(> (.indexOf % parent) -1)))) -(defn only-ancestors? [cur s] +(defn only-ancestors? + "True if the number of keys is less than or equal to the number of ancestors found." + [cur s] (<= (.-length (js/Object.keys cur)) (provided-ancestors s))) -(defn provided? [s] +(defn provided? + "No usage was found in Light Table core and is a candidate for deprecation. Do not use." + [s] (if *force-reload* false (let [res (if (aget provided s) diff --git a/src/lt/util/style.cljs b/src/lt/util/style.cljs index 5f8070584..bd945f6b8 100644 --- a/src/lt/util/style.cljs +++ b/src/lt/util/style.cljs @@ -1,5 +1,14 @@ (ns lt.util.style - "Provide style related fns") + "Provide style related functions.") -(defn ->px [s] - (str (or s 0) "px")) +(defn ->px + "Appends \"px\" to `s`. If `s` is falsey then 0 is used. + + Example: + ``` + (->px 75) ;;=> \"75px\" + + (->px false) ;;=> \"0px\" + ```" + [s] + (str (or s 0) "px")) From acf9514f022b61ee2147416e40e81e45ce3f9454 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sun, 9 Oct 2016 16:17:25 -0400 Subject: [PATCH 619/656] Remove unnecessary, and potentially dangerous, -f from delete! function. --- src/lt/objs/files.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lt/objs/files.cljs b/src/lt/objs/files.cljs index 4e1bea35b..7ceb31781 100644 --- a/src/lt/objs/files.cljs +++ b/src/lt/objs/files.cljs @@ -408,7 +408,7 @@ "Delete file or directory from filesystem." [path] (if (dir? path) - (.rm shell "-rf" path) + (.rm shell "-r" path) (.unlinkSync fs path))) (defn move! From 8f20517a287df2ffe3142ea7fb26572b630177ec Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Tue, 4 Oct 2016 22:47:40 -0400 Subject: [PATCH 620/656] Add optional docstring to defui, behavior, and object. Falls back to :desc if :doc is not available. --- src/lt/macros.clj | 25 ++++++++++++++++--------- src/lt/object.cljs | 3 ++- src/lt/plugins/doc.cljs | 38 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/lt/macros.clj b/src/lt/macros.clj index 46b00960f..6768920ca 100644 --- a/src/lt/macros.clj +++ b/src/lt/macros.clj @@ -12,7 +12,8 @@ * :reaction (required) - Function to invoke when behavior is called. First arg is object behavior is attached to * :triggers (required) - Set of keyword triggers that trigger behavior - * :desc - Brief description of behavior + * :desc - Brief description of behavior. + * :doc - Equivalent to a traditional function docstring. * :type - When set to :user, shows up in hints. Not enabled by default * :params - Vector of maps describing behavior args. Each map contains required :label key and optional keys of :type (:string, :number or :list), :items and :example @@ -22,19 +23,25 @@ (if (and (seq? reaction) (= 'fn (first reaction))) (let [[_ args & body] reaction] `(do - (defn- ~(namify "BEH" name) ~args ~@body) + (defn- ~(namify "BEH" name) ~(:doc r "") ~args ~@body) (lt.object/behavior* ~name ~@(apply concat (assoc r :reaction (namify "BEH" name)))))) `(lt.object/behavior* ~name ~@(apply concat r)))) (defmacro defui "Define a UI element for given hiccup data and key-value pairs - of events for element" - [sym params hiccup & events] - `(defn ~sym ~params - (let [e# (crate.core/html ~hiccup)] - (doseq [[ev# func#] (partition 2 ~(vec events))] - (lt.util.dom/on e# ev# func#)) - e#))) + of events for element. Like defn, a docstring is optional." + [sym & decl] + (let [doc (if (string? (first decl)) + (first decl) + "") + [params hiccup & events] (if (string? (first decl)) + (next decl) + decl)] + `(defn ~sym ~doc ~params + (let [e# (crate.core/html ~hiccup)] + (doseq [[ev# func#] (partition 2 ~(vec events))] + (lt.util.dom/on e# ev# func#)) + e#)))) (defmacro ^:private timed [ev & body] `(let [start# (lighttable.util.js/now) diff --git a/src/lt/object.cljs b/src/lt/object.cljs index a5c62cc64..dc70a309f 100644 --- a/src/lt/object.cljs +++ b/src/lt/object.cljs @@ -226,7 +226,8 @@ * :triggers - Set of object's triggers * :init - Init fn called when object is created. Fn's return value is hiccup html content and saved to :content - * :listeners (internal) - Map of triggers to vectors of behaviors" + * :listeners (internal) - Map of triggers to vectors of behaviors + * :doc - Equivalent to a traditional function docstring." [name & r] (-> (apply make-object* name r) (store-object*) diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index 1e98d5f05..3ae2696a4 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -76,12 +76,46 @@ (not= (:doc doc) "nil")) [:pre (:doc doc)])]) +(defn- retrieve-behavior + "Helper method for behavior `editor.doc.show!` to determine if the given `ns` and `name` + match existing behaviors. + + Returns found behavior or `nil`." + [ns name] + (@object/behaviors (keyword (str ns "/" (subs name 2))))) + +(defn- retrieve-object-def + "Helper method for behavior `editor.doc.show!` to determine if the given `ns` and `name` + match existing object defs. Not recommended to print whole object def... use destructuring. + + Returns found object def or `nil`." + [ns name] + (@object/object-defs (keyword (str ns "/" (subs name 2))))) + +(defn- retrieve-docstring + "Helper method for behavior `editor.doc.show!` that returns the docstring for a matching + object or behavior. If `:doc` is not found, then `:desc` is used. Otherwise `nil`." + [ns name] + (let [beh (retrieve-behavior ns name) + beh-doc (or (:doc beh) (:desc beh)) + obj (retrieve-object-def ns name) + obj-doc (or (:doc obj) (:desc obj))] + (if (and (nil? beh-doc) (nil? obj-doc)) + nil + (if (nil? beh-doc) + obj-doc + beh-doc)))) + (behavior ::editor.doc.show! :triggers #{:editor.doc.show!} :reaction (fn [editor doc] (when (not= (:name doc) "") - (inline-doc editor (doc-ui doc) {} (:loc doc))) - )) + ;; If :file and :doc are nil then this is likely a behavior or object. + ;; Check if a match exists and splice the resulting :doc into the doc argument. + (let [doc (if (and (nil? (:file doc)) (nil? (:doc doc))) + (merge doc {:doc (retrieve-docstring (:ns doc) (:name doc))}) + doc)] + (inline-doc editor (doc-ui doc) {} (:loc doc)))))) (defui search-item [item] [:li From 42d0d6e9b3b1084cc431b7281636a57ef9bd01c0 Mon Sep 17 00:00:00 2001 From: Chris Etheridge Date: Tue, 8 Nov 2016 11:45:23 +0200 Subject: [PATCH 621/656] Change source to website. Open source page when clicking plugin title. --- src/lt/objs/plugins.cljs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 47ebc0516..0607b74e8 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -494,7 +494,7 @@ (search-input this)]) (defui source-button [plugin] - [:span.source [:a {:href (:url plugin (:source plugin))} "source"]] + [:span.source [:a {:href (:url plugin (:source plugin))} "website"]] :click (fn [e] (dom/prevent e) (dom/stop-propagation e) @@ -526,6 +526,13 @@ (dom/prevent e) (dom/stop-propagation e))) +(defui plugin-title [plugin] + [:h1 (:name plugin) [:span.version (:version plugin)]] + :click (fn [e] + (dom/prevent e) + (dom/stop-propagation e) + (platform/open-url (:url plugin (:source plugin))))) + (defui server-plugin-ui [plugin] (let [info plugin ver (:version info) @@ -540,7 +547,7 @@ (update-button plugin) [:span.installed])) (source-button plugin) - [:h1 (:name info) [:span.version ver]] + (plugin-title plugin) [:h3 (:author info)] [:p (:desc info)]])) @@ -566,7 +573,7 @@ (update-button (assoc plugin :version cached))) (uninstall-button plugin) (source-button plugin) - [:h1 (:name plugin) [:span.version (:version plugin)]] + (plugin-title plugin) [:h3 (:author plugin)] [:p (:desc plugin)] ])) From 868d6e1514534ca345addf19a565b0d68221c9b1 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Mon, 28 Nov 2016 21:10:22 -0500 Subject: [PATCH 622/656] Update style guide to define expected :desc convention --- doc/style-guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/style-guide.md b/doc/style-guide.md index c896fbc0e..1c9573c1a 100644 --- a/doc/style-guide.md +++ b/doc/style-guide.md @@ -17,6 +17,10 @@ In order to streamline pull requests, prior to opening one, consider running you ns depend on cannot refer to the clojure var but can refer to the js fn e.g. `(js/lt.objs.console.error err)`. +## Plugins + +1. Any `:desc` key should start with the plugin name. For instance, with the Clojure plugin, `:desc "Clojure: Eval editor content"` would be appropriate. This is because the plugin is named Clojure, not because it works with Clojure. + ## Behaviors 1. Add brief docstrings via `:desc` key. From 183b48519f0f03708453d424d919f6641bf20f50 Mon Sep 17 00:00:00 2001 From: bruno-oliveira Date: Thu, 29 Dec 2016 11:48:03 +0000 Subject: [PATCH 623/656] Replaces the goto-line command with go-to-line and fixes keymap for consistency --- deploy/settings/default/default.keymap | 2 +- src/lt/objs/cli.cljs | 2 +- src/lt/objs/find.cljs | 4 ++-- src/lt/objs/search.cljs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 40a178df4..6d6bd5934 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -23,7 +23,7 @@ [:editor "ctrl-," :editor.unjump] [:editor "ctrl-." :editor.jump-to-definition-at-cursor] [:editor "pmeta-shift-s" :save-as] - [:editor "pmeta-l" :goto-line] + [:editor "pmeta-l" :go-to-line] [:editor "pmeta-shift-enter" :eval-editor] [:editor "ctrl-=" :editor.fold-code] [:editor "pmeta-s" :save] diff --git a/src/lt/objs/cli.cljs b/src/lt/objs/cli.cljs index a6ad756d2..052301f21 100644 --- a/src/lt/objs/cli.cljs +++ b/src/lt/objs/cli.cljs @@ -22,7 +22,7 @@ (do (object/raise opener/opener :open! path) (when line - (cmd/exec! :goto-line line)) + (cmd/exec! :go-to-line line)) (when add? (object/raise workspace/current-ws :add.file! path)))) (object/raise opener/opener :new! path)))) diff --git a/src/lt/objs/find.cljs b/src/lt/objs/find.cljs index 9d8bdb41c..2e3258a09 100644 --- a/src/lt/objs/find.cljs +++ b/src/lt/objs/find.cljs @@ -215,8 +215,8 @@ (object/add-behavior! line-input ::exec-active!) -(cmd/command {:command :goto-line - :desc "Editor: Goto line" +(cmd/command {:command :go-to-line + :desc "Editor: Go to line" :options line-input :exec (fn [l] (when (or (number? l) (not (empty? l))) diff --git a/src/lt/objs/search.cljs b/src/lt/objs/search.cljs index 53f2bd23d..4aa449c47 100644 --- a/src/lt/objs/search.cljs +++ b/src/lt/objs/search.cljs @@ -60,7 +60,7 @@ [:p.entry (crate/raw (str "" (.-line r) "
    " (.-text r) "
    "))] :click (fn [] (cmd/exec! :open-path file) - (cmd/exec! :goto-line (.-line r)))) + (cmd/exec! :go-to-line (.-line r)))) (defui ->result-item [r] (let [file (.-file r)] @@ -168,7 +168,7 @@ neue (aget all file)] (object/merge! this {:position [file result]}) (cmd/exec! :open-path (.-file neue)) - (cmd/exec! :goto-line (-> (.-results neue) + (cmd/exec! :go-to-line (-> (.-results neue) (aget result) (.-line))))))) @@ -191,7 +191,7 @@ neue (aget (:results @this) file)] (object/merge! this {:position [file result]}) (cmd/exec! :open-path (.-file neue)) - (cmd/exec! :goto-line (-> (.-results neue) + (cmd/exec! :go-to-line (-> (.-results neue) (aget result) (.-line))))))) (behavior ::on-result From 329137cc06139bfac842b8621cc227f9e6f17c5b Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Wed, 21 Dec 2016 20:06:00 -0500 Subject: [PATCH 624/656] Add label field to the inline doc for behaviors and objects. --- src/lt/plugins/doc.cljs | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/lt/plugins/doc.cljs b/src/lt/plugins/doc.cljs index 3ae2696a4..01a90f8a8 100644 --- a/src/lt/plugins/doc.cljs +++ b/src/lt/plugins/doc.cljs @@ -72,6 +72,9 @@ (when (and (:args doc) (not= (:args doc) "nil")) [:h3 (:args doc)]) + (when (and (:labels doc) + (not= (:labels doc) "")) + [:h3 (str "[" (:labels doc) "]")]) (when (and (:doc doc) (not= (:doc doc) "nil")) [:pre (:doc doc)])]) @@ -92,19 +95,22 @@ [ns name] (@object/object-defs (keyword (str ns "/" (subs name 2))))) +(defn- retrieve + [ns name] + (or (retrieve-behavior ns name) + (retrieve-object-def ns name))) + (defn- retrieve-docstring "Helper method for behavior `editor.doc.show!` that returns the docstring for a matching object or behavior. If `:doc` is not found, then `:desc` is used. Otherwise `nil`." [ns name] - (let [beh (retrieve-behavior ns name) - beh-doc (or (:doc beh) (:desc beh)) - obj (retrieve-object-def ns name) - obj-doc (or (:doc obj) (:desc obj))] - (if (and (nil? beh-doc) (nil? obj-doc)) - nil - (if (nil? beh-doc) - obj-doc - beh-doc)))) + (let [o (retrieve ns name)] + (or (:doc o) (:desc o)))) + +(defn- retrieve-labels + [ns name] + (let [o (retrieve ns name)] + (clojure.string/join ", " (map #(get %1 :label) (:params o []))))) (behavior ::editor.doc.show! :triggers #{:editor.doc.show!} @@ -113,7 +119,8 @@ ;; If :file and :doc are nil then this is likely a behavior or object. ;; Check if a match exists and splice the resulting :doc into the doc argument. (let [doc (if (and (nil? (:file doc)) (nil? (:doc doc))) - (merge doc {:doc (retrieve-docstring (:ns doc) (:name doc))}) + (merge doc {:doc (retrieve-docstring (:ns doc) (:name doc)) + :labels (retrieve-labels (:ns doc) (:name doc))}) doc)] (inline-doc editor (doc-ui doc) {} (:loc doc)))))) From b83f440115726199563c232364e9b3168456b701 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sat, 17 Dec 2016 22:58:04 -0500 Subject: [PATCH 625/656] Bump version in Usage section to 0.8.1 --- doc/developer-install.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/developer-install.md b/doc/developer-install.md index 33b4354c4..2aeae3d06 100644 --- a/doc/developer-install.md +++ b/doc/developer-install.md @@ -66,13 +66,13 @@ line before compiling ClojureScript to get around [issue 1025](https://github.co Once you've built LightTable, run it in one of the following ways: * OSX - * As a commandline executable: `builds/lighttable-0.8.0-mac/light` - * As an application: `open -a $PWD/builds/lighttable-0.8.0-mac/LightTable.app` + * As a commandline executable: `builds/lighttable-0.8.1-mac/light` + * As an application: `open -a $PWD/builds/lighttable-0.8.1-mac/LightTable.app` * Linux - * As a commandline executable: `builds/lighttable-0.8.0-linux/light` - * As an application: `builds/lighttable-0.8.0-linux/LightTable` + * As a commandline executable: `builds/lighttable-0.8.1-linux/light` + * As an application: `builds/lighttable-0.8.1-linux/LightTable` * Windows - * As an application: `builds/lighttable-0.8.0-windows/LightTable.exe` + * As an application: `builds/lighttable-0.8.1-windows/LightTable.exe` You can also run LightTable with `script/light.sh`. This script allows you to skip running `script/build-app.sh`. While it's useful as a dev convenience, From c1e5b06098b336dc96f971c80c6c63e9c5cfe706 Mon Sep 17 00:00:00 2001 From: "Michael.Y.Ma" Date: Mon, 30 Jan 2017 04:16:44 +0800 Subject: [PATCH 626/656] Add link-like appearance and behavior to plugin name in the plugin manager --- deploy/core/css/structure.css | 1 + src/lt/objs/plugins.cljs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index 10eae425b..feb796275 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -315,6 +315,7 @@ body { -webkit-user-select: none; } .plugin-manager .enabled { float:right; position:absolute; right:0; top:1px; overflow:auto; } .plugin-manager .plugins { flex:1; display:block; overflow:auto; } .plugin-manager .server-plugins { flex:1; display:none; overflow:auto; } +.plugin-manager .link { text-decoration:underline; cursor:pointer; } .plugin-manager.server .server-plugins { display:block; } .plugin-manager.server .plugins { display:none; } diff --git a/src/lt/objs/plugins.cljs b/src/lt/objs/plugins.cljs index 0607b74e8..06525cfcc 100644 --- a/src/lt/objs/plugins.cljs +++ b/src/lt/objs/plugins.cljs @@ -526,13 +526,18 @@ (dom/prevent e) (dom/stop-propagation e))) -(defui plugin-title [plugin] - [:h1 (:name plugin) [:span.version (:version plugin)]] +(defui plugin-link-title [plugin] + [:span.link (:name plugin)] :click (fn [e] (dom/prevent e) (dom/stop-propagation e) (platform/open-url (:url plugin (:source plugin))))) +(defui plugin-title [plugin] + [:h1 + (plugin-link-title plugin) + [:span.version (:version plugin)]]) + (defui server-plugin-ui [plugin] (let [info plugin ver (:version info) From 8db0585cfaa857e594149be6833fe7f82bcc9616 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Sun, 29 Jan 2017 15:07:08 -0500 Subject: [PATCH 627/656] Make sure ltcache/default.clj exists before attempting to open it. --- src/lt/objs/cache.cljs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lt/objs/cache.cljs b/src/lt/objs/cache.cljs index 32c96536d..06fea7748 100644 --- a/src/lt/objs/cache.cljs +++ b/src/lt/objs/cache.cljs @@ -10,6 +10,9 @@ (def settings (atom {})) (defn on-disk [cb] + ;; We must ensure the file's existence before attempting to open it. + (when-not (files/file? settings-path) + (files/save settings-path {})) (files/open settings-path (fn [data] (if-not (empty? data) (cb (reader/read-string (:content data))) From 2c579a5e20e60f8297d295ade04308ac1c84d468 Mon Sep 17 00:00:00 2001 From: Aaron Hoffer Date: Tue, 7 Feb 2017 13:49:08 -0700 Subject: [PATCH 628/656] Select text in Plugin Manager Enhancement to select text in Plugin Manager view See issue https://github.com/LightTable/LightTable/issues/2178 --- .gitignore | 2 ++ deploy/core/css/structure.css | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d7faae6b6..bdd546401 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ .lein-plugins/ .nrepl-port /builds/ +.idea +*.iml diff --git a/deploy/core/css/structure.css b/deploy/core/css/structure.css index feb796275..830f55e35 100644 --- a/deploy/core/css/structure.css +++ b/deploy/core/css/structure.css @@ -310,12 +310,12 @@ body { -webkit-user-select: none; } .plugin-manager { padding:10px 5px; overflow:hidden; box-sizing:border-box; display:flex; flex-direction:column; } .plugin-manager h1 { font-size:14pt; margin-bottom:0; line-height:1.3em; } .plugin-manager p { margin-top:10px;} -.plugin-manager li { padding-left:5px; padding-top:8px; margin:0; padding-bottom:12px; position:relative; } +.plugin-manager li { padding-left:5px; padding-top:8px; margin:0; padding-bottom:12px; position:relative; -webkit-user-select: text;} .plugin-manager .tabs { min-height:30px; } .plugin-manager .enabled { float:right; position:absolute; right:0; top:1px; overflow:auto; } .plugin-manager .plugins { flex:1; display:block; overflow:auto; } .plugin-manager .server-plugins { flex:1; display:none; overflow:auto; } -.plugin-manager .link { text-decoration:underline; cursor:pointer; } +.plugin-manager .link { cursor:pointer; } .plugin-manager.server .server-plugins { display:block; } .plugin-manager.server .plugins { display:none; } From 75d65c35edab455dbca5a62250036b0f55dc51cf Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Mon, 30 Jan 2017 23:18:21 -0500 Subject: [PATCH 629/656] Bump Mousetrap version and indicate LT code deviations --- .../node_modules/lighttable/util/keyevents.js | 1341 +++++++++-------- doc/for-committers.md | 2 +- src/lt/objs/keyboard.cljs | 4 +- 3 files changed, 738 insertions(+), 609 deletions(-) diff --git a/deploy/core/node_modules/lighttable/util/keyevents.js b/deploy/core/node_modules/lighttable/util/keyevents.js index c938cd599..47e756761 100644 --- a/deploy/core/node_modules/lighttable/util/keyevents.js +++ b/deploy/core/node_modules/lighttable/util/keyevents.js @@ -1,6 +1,6 @@ /*global define:false */ /** - * Copyright 2013 Craig Campbell + * Copyright 2016 Craig Campbell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,16 @@ * Mousetrap is a simple keyboard shortcut library for Javascript with * no external dependencies * - * @version 1.4.5 + * @version 1.6.0 * @url craig.is/killing/mice */ (function(window, document, undefined) { + // Check if mousetrap is used inside browser, if not, return + if (!window) { + return; + } + /** * mapping of special keycodes to their corresponding keys * @@ -32,162 +37,112 @@ * @type {Object} */ var _MAP = { - 8: 'backspace', - 9: 'tab', - 13: 'enter', - 16: 'shift', - 17: 'ctrl', - 18: 'alt', - 20: 'capslock', - 27: 'esc', - 32: 'space', - 33: 'pageup', - 34: 'pagedown', - 35: 'end', - 36: 'home', - 37: 'left', - 38: 'up', - 39: 'right', - 40: 'down', - 45: 'ins', - 46: 'del', - 91: 'meta', - 93: 'meta', - 224: 'meta' - }, - - /** - * mapping for special characters so they can support - * - * this dictionary is only used incase you want to bind a - * keyup or keydown event to one of these keys - * - * @type {Object} - */ - _KEYCODE_MAP = { - 106: '*', - 107: '+', - 109: '-', - 110: '.', - 111 : '/', - 186: ';', - 187: '=', - 188: ',', - 189: '-', - 190: '.', - 191: '/', - 192: '`', - 219: '[', - 220: '\\', - 221: ']', - 222: '\'' - }, - - /** - * this is a mapping of keys that require shift on a US keypad - * back to the non shift equivelents - * - * this is so you can use keyup events with these keys - * - * note that this will only work reliably on US keyboards - * - * @type {Object} - */ - _SHIFT_MAP = { - '~': '`', - '!': '1', - '@': '2', - '#': '3', - '$': '4', - '%': '5', - '^': '6', - '&': '7', - '*': '8', - '(': '9', - ')': '0', - '_': '-', - '+': '=', - ':': ';', - '\"': '\'', - '<': ',', - '>': '.', - '?': '/', - '|': '\\' - }, - - /** - * this is a list of special strings you can use to map - * to modifier keys when you specify your keyboard shortcuts - * - * @type {Object} - */ - _SPECIAL_ALIASES = { - 'option': 'alt', - 'command': 'meta', - 'return': 'enter', - 'escape': 'esc', - 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl' - }, - - /** - * variable to store the flipped version of _MAP from above - * needed to check if we should use keypress or not when no action - * is specified - * - * @type {Object|undefined} - */ - _REVERSE_MAP, - - /** - * a list of all the callbacks setup via Mousetrap.bind() - * - * @type {Object} - */ - _callbacks = {}, - - /** - * direct map of string combinations to callbacks used for trigger() - * - * @type {Object} - */ - _directMap = {}, - - /** - * keeps track of what level each sequence is at since multiple - * sequences can start out with the same sequence - * - * @type {Object} - */ - _sequenceLevels = {}, + 8: 'backspace', + 9: 'tab', + 13: 'enter', + 16: 'shift', + 17: 'ctrl', + 18: 'alt', + 20: 'capslock', + 27: 'esc', + 32: 'space', + 33: 'pageup', + 34: 'pagedown', + 35: 'end', + 36: 'home', + 37: 'left', + 38: 'up', + 39: 'right', + 40: 'down', + 45: 'ins', + 46: 'del', + 91: 'meta', + 93: 'meta', + 224: 'meta' + }; - /** - * variable to store the setTimeout call - * - * @type {null|number} - */ - _resetTimer, + /** + * mapping for special characters so they can support + * + * this dictionary is only used incase you want to bind a + * keyup or keydown event to one of these keys + * + * @type {Object} + */ + var _KEYCODE_MAP = { + 106: '*', + 107: '+', + 109: '-', + 110: '.', + 111 : '/', + 186: ';', + 187: '=', + 188: ',', + 189: '-', + 190: '.', + 191: '/', + 192: '`', + 219: '[', + 220: '\\', + 221: ']', + 222: '\'' + }; - /** - * temporary state where we will ignore the next keyup - * - * @type {boolean|string} - */ - _ignoreNextKeyup = false, + /** + * this is a mapping of keys that require shift on a US keypad + * back to the non shift equivelents + * + * this is so you can use keyup events with these keys + * + * note that this will only work reliably on US keyboards + * + * @type {Object} + */ + var _SHIFT_MAP = { + '~': '`', + '!': '1', + '@': '2', + '#': '3', + '$': '4', + '%': '5', + '^': '6', + '&': '7', + '*': '8', + '(': '9', + ')': '0', + '_': '-', + '+': '=', + ':': ';', + '\"': '\'', + '<': ',', + '>': '.', + '?': '/', + '|': '\\' + }; - /** - * temporary state where we will ignore the next keypress - * - * @type {boolean} - */ - _ignoreNextKeypress = false, + /** + * this is a list of special strings you can use to map + * to modifier keys when you specify your keyboard shortcuts + * + * @type {Object} + */ + var _SPECIAL_ALIASES = { + 'option': 'alt', + 'command': 'meta', + 'return': 'enter', + 'escape': 'esc', + 'plus': '+', + 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl' + }; - /** - * are we currently inside of a sequence? - * type of action ("keyup" or "keydown" or "keypress") or false - * - * @type {boolean|string} - */ - _nextExpectedAction = false; + /** + * variable to store the flipped version of _MAP from above + * needed to check if we should use keypress or not when no action + * is specified + * + * @type {Object|undefined} + */ + var _REVERSE_MAP; /** * loop through the f keys, f1 to f19 and add them to the map @@ -201,7 +156,13 @@ * loop through to map numbers on the numeric keypad */ for (i = 0; i <= 9; ++i) { - _MAP[i + 96] = i; + + // This needs to use a string cause otherwise since 0 is falsey + // mousetrap will never fire for numpad 0 pressed as part of a keydown + // event. + // + // @see https://github.com/ccampbell/mousetrap/pull/258 + _MAP[i + 96] = i.toString(); } /** @@ -214,7 +175,7 @@ */ function _addEvent(object, type, callback) { if (object.addEventListener) { - object.addEventListener(type, callback, true); + object.addEventListener(type, callback, false); return; } @@ -266,6 +227,7 @@ return String.fromCharCode(e.which).toLowerCase(); } + /** START LIGHT TABLE ADDED FUNCTION **/ function keyDownOnly(e) { if (_MAP[e.which]) { return _MAP[e.which]; @@ -273,6 +235,7 @@ return false; } + /** END LIGHT TABLE ADDED FUNCTION **/ /** * checks if two arrays are equal @@ -285,103 +248,6 @@ return modifiers1.sort().join(',') === modifiers2.sort().join(','); } - /** - * resets all sequence counters except for the ones passed in - * - * @param {Object} doNotReset - * @returns void - */ - function _resetSequences(doNotReset) { - doNotReset = doNotReset || {}; - - var activeSequences = false, - key; - - for (key in _sequenceLevels) { - if (doNotReset[key]) { - activeSequences = true; - continue; - } - _sequenceLevels[key] = 0; - } - - if (!activeSequences) { - _nextExpectedAction = false; - } - } - - /** - * finds all callbacks that match based on the keycode, modifiers, - * and action - * - * @param {string} character - * @param {Array} modifiers - * @param {Event|Object} e - * @param {string=} sequenceName - name of the sequence we are looking for - * @param {string=} combination - * @param {number=} level - * @returns {Array} - */ - function _getMatches(character, modifiers, e, sequenceName, combination, level) { - var i, - callback, - matches = [], - action = e.type; - - // if there are no events related to this keycode - if (!_callbacks[character]) { - return []; - } - - // if a modifier key is coming up on its own we should allow it - if (action == 'keyup' && _isModifier(character)) { - modifiers = [character]; - } - - // loop through all callbacks for the key that was pressed - // and see if any of them match - for (i = 0; i < _callbacks[character].length; ++i) { - callback = _callbacks[character][i]; - - // if a sequence name is not specified, but this is a sequence at - // the wrong level then move onto the next match - if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) { - continue; - } - - // if the action we are looking for doesn't match the action we got - // then we should keep going - if (action != callback.action) { - continue; - } - - // if this is a keypress event and the meta key and control key - // are not pressed that means that we need to only look at the - // character, otherwise check the modifiers as well - // - // chrome will not fire a keypress if meta or control is down - // safari will fire a keypress if meta or meta+shift is down - // firefox will fire a keypress if meta or control is down - if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) { - - // when you bind a combination or sequence a second time it - // should overwrite the first one. if a sequenceName or - // combination is specified in this call it does just that - // - // @todo make deleting its own method? - var deleteCombo = !sequenceName && callback.combo == combination; - var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level; - if (deleteCombo || deleteSequence) { - _callbacks[character].splice(i, 1); - } - - matches.push(callback); - } - } - - return matches; - } - /** * takes a key event and figures out what the modifiers are * @@ -411,168 +277,33 @@ } /** - * actually calls the callback function - * - * if your callback function returns false this will use the jquery - * convention - prevent default and stop propogation on the event + * prevents default for this event * - * @param {Function} callback * @param {Event} e * @returns void */ - function _fireCallback(callback, e, combo, sequence) { - - // if this event should not happen stop here - if (Mousetrap.stopCallback(e, e.target || e.srcElement, combo, sequence)) { + function _preventDefault(e) { + if (e.preventDefault) { + e.preventDefault(); return; } - if (callback(e, combo) === false) { - if (e.preventDefault) { - e.preventDefault(); - } - - if (e.stopPropagation) { - e.stopPropagation(); - } - - e.returnValue = false; - e.cancelBubble = true; - } - } - - /** - * handles a character key event - * - * @param {string} character - * @param {Array} modifiers - * @param {Event} e - * @returns void - */ - function _handleKey(character, modifiers, e) { - var callbacks = _getMatches(character, modifiers, e), - i, - doNotReset = {}, - maxLevel = 0, - processedSequenceCallback = false; - - // Calculate the maxLevel for sequences so we can only execute the longest callback sequence - for (i = 0; i < callbacks.length; ++i) { - if (callbacks[i].seq) { - maxLevel = Math.max(maxLevel, callbacks[i].level); - } - } - - // loop through matching callbacks for this key event - for (i = 0; i < callbacks.length; ++i) { - - // fire for all sequence callbacks - // this is because if for example you have multiple sequences - // bound such as "g i" and "g t" they both need to fire the - // callback for matching g cause otherwise you can only ever - // match the first one - if (callbacks[i].seq) { - - // only fire callbacks for the maxLevel to prevent - // subsequences from also firing - // - // for example 'a option b' should not cause 'option b' to fire - // even though 'option b' is part of the other sequence - // - // any sequences that do not match here will be discarded - // below by the _resetSequences call - if (callbacks[i].level != maxLevel) { - continue; - } - - processedSequenceCallback = true; - - // keep a list of which sequences were matches for later - doNotReset[callbacks[i].seq] = 1; - _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq); - continue; - } - - // if there were no sequence matches but we are still here - // that means this is a regular match so we should fire that - if (!processedSequenceCallback) { - _fireCallback(callbacks[i].callback, e, callbacks[i].combo); - } - } - - // if the key you pressed matches the type of sequence without - // being a modifier (ie "keyup" or "keypress") then we should - // reset all sequences that were not matched by this event - // - // this is so, for example, if you have the sequence "h a t" and you - // type "h e a r t" it does not match. in this case the "e" will - // cause the sequence to reset - // - // modifier keys are ignored because you can have a sequence - // that contains modifiers such as "enter ctrl+space" and in most - // cases the modifier key will be pressed before the next key - // - // also if you have a sequence such as "ctrl+b a" then pressing the - // "b" key will trigger a "keypress" and a "keydown" - // - // the "keydown" is expected when there is a modifier, but the - // "keypress" ends up matching the _nextExpectedAction since it occurs - // after and that causes the sequence to reset - // - // we ignore keypresses in a sequence that directly follow a keydown - // for the same character - var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress; - if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) { - _resetSequences(doNotReset); - } - - _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown'; + e.returnValue = false; } /** - * handles a keydown event + * stops propogation for this event * * @param {Event} e * @returns void */ - function _handleKeyEvent(e) { - - // normalize e.which for key events - // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion - if (typeof e.which !== 'number') { - e.which = e.keyCode; - } - - var character = _characterFromEvent(e); - - // no character found then stop - if (!character) { + function _stopPropagation(e) { + if (e.stopPropagation) { + e.stopPropagation(); return; } - // need to use === for the character check because the character can be 0 - if (e.type == 'keyup' && _ignoreNextKeyup === character) { - _ignoreNextKeyup = false; - return; - } - - - - if (e.type == 'keydown' && (keyDownOnly(e) || e.ctrlKey || e.metaKey || e.altKey)) { - Mousetrap.handleKey(character, "", e); - } else if (e.type == 'keydown') { - Mousetrap._prev_keycode = character; - } else if (e.type == 'keypress') { - var _keyCode = Mousetrap._prev_keycode; - Mousetrap._prev_keycode = null; - Mousetrap._prev_char = character; - Mousetrap.handleKey(_keyCode, character, e); - } else if (e.type == 'keyup') { - var _char = Mousetrap._prev_char; - Mousetrap._prev_char = null; - Mousetrap.handleKeyUp(character, _char, e); - } - + e.cancelBubble = true; } /** @@ -585,19 +316,6 @@ return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta'; } - /** - * called to set a 1 second timeout on the specified sequence - * - * this is so after each key press in the sequence you have 1 second - * to press the next key before you have to start over - * - * @returns void - */ - function _resetSequenceTimer() { - clearTimeout(_resetTimer); - _resetTimer = setTimeout(_resetSequences, 1000); - } - /** * reverses the map lookup so that we can look for specific keys * to see what can and can't use keypress @@ -647,74 +365,6 @@ return action; } - /** - * binds a key sequence to an event - * - * @param {string} combo - combo specified in bind call - * @param {Array} keys - * @param {Function} callback - * @param {string=} action - * @returns void - */ - function _bindSequence(combo, keys, callback, action) { - - // start off by adding a sequence level record for this combination - // and setting the level to 0 - _sequenceLevels[combo] = 0; - - /** - * callback to increase the sequence level for this sequence and reset - * all other sequences that were active - * - * @param {string} nextAction - * @returns {Function} - */ - function _increaseSequence(nextAction) { - return function() { - _nextExpectedAction = nextAction; - ++_sequenceLevels[combo]; - _resetSequenceTimer(); - }; - } - - /** - * wraps the specified callback inside of another function in order - * to reset all sequence counters as soon as this sequence is done - * - * @param {Event} e - * @returns void - */ - function _callbackAndReset(e) { - _fireCallback(callback, e, combo); - - // we should ignore the next key up if the action is key down - // or keypress. this is so if you finish a sequence and - // release the key the final key will not trigger a keyup - if (action !== 'keyup') { - _ignoreNextKeyup = _characterFromEvent(e); - } - - // weird race condition if a sequence ends with the key - // another sequence begins with - setTimeout(_resetSequences, 10); - } - - // loop through keys one at a time and bind the appropriate callback - // function. for any key leading up to the final one it should - // increase the sequence. after the final, it should reset all sequences - // - // if an action is specified in the original bind call then that will - // be used throughout. otherwise we will pass the action that the - // next key in the sequence should match. this allows a sequence - // to mix and match keypress and keydown events depending on which - // ones are better suited to the key provided - for (var i = 0; i < keys.length; ++i) { - var isFinal = i + 1 === keys.length; - var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action); - _bindSingle(keys[i], wrappedCallback, action, combo, i); - } - } - /** * Converts from a string key combination to an array * @@ -726,6 +376,7 @@ return ['+']; } + combination = combination.replace(/\+{2}/g, '+plus'); return combination.split('+'); } @@ -737,10 +388,10 @@ * @returns {Object} */ function _getKeyInfo(combination, action) { - var keys, - key, - i, - modifiers = []; + var keys; + var key; + var i; + var modifiers = []; // take the keys from this pattern and figure out what the actual // pattern is all about @@ -779,179 +430,657 @@ }; } - /** - * binds a single keyboard combination - * - * @param {string} combination - * @param {Function} callback - * @param {string=} action - * @param {string=} sequenceName - name of sequence if part of sequence - * @param {number=} level - what part of the sequence the command is - * @returns void - */ - function _bindSingle(combination, callback, action, sequenceName, level) { + function _belongsTo(element, ancestor) { + if (element === null || element === document) { + return false; + } - // store a direct mapped reference for use with Mousetrap.trigger - _directMap[combination + ':' + action] = callback; + if (element === ancestor) { + return true; + } - // make sure multiple spaces in a row become a single space - combination = combination.replace(/\s+/g, ' '); + return _belongsTo(element.parentNode, ancestor); + } - var sequence = combination.split(' '), - info; + function Mousetrap(targetElement) { + var self = this; - // if this pattern is a sequence of keys then run through this method - // to reprocess each pattern one key at a time - if (sequence.length > 1) { - _bindSequence(combination, sequence, callback, action); - return; + targetElement = targetElement || document; + + if (!(self instanceof Mousetrap)) { + return new Mousetrap(targetElement); } - info = _getKeyInfo(combination, action); + /** + * element to attach key events to + * + * @type {Element} + */ + self.target = targetElement; - // make sure to initialize array if this is the first time - // a callback is added for this key - _callbacks[info.key] = _callbacks[info.key] || []; + /** + * a list of all the callbacks setup via Mousetrap.bind() + * + * @type {Object} + */ + self._callbacks = {}; - // remove an existing match if there is one - _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level); + /** + * direct map of string combinations to callbacks used for trigger() + * + * @type {Object} + */ + self._directMap = {}; - // add this call back to the array - // if it is a sequence put it at the beginning - // if not put it at the end - // - // this is important because the way these are processed expects - // the sequence ones to come first - _callbacks[info.key][sequenceName ? 'unshift' : 'push']({ - callback: callback, - modifiers: info.modifiers, - action: info.action, - seq: sequenceName, - level: level, - combo: combination - }); - } + /** + * keeps track of what level each sequence is at since multiple + * sequences can start out with the same sequence + * + * @type {Object} + */ + var _sequenceLevels = {}; - /** - * binds multiple combinations to the same callback - * - * @param {Array} combinations - * @param {Function} callback - * @param {string|undefined} action - * @returns void - */ - function _bindMultiple(combinations, callback, action) { - for (var i = 0; i < combinations.length; ++i) { - _bindSingle(combinations[i], callback, action); - } - } + /** + * variable to store the setTimeout call + * + * @type {null|number} + */ + var _resetTimer; - // start! - _addEvent(document, 'keypress', _handleKeyEvent, true); - _addEvent(document, 'keydown', _handleKeyEvent, true); - _addEvent(document, 'keyup', _handleKeyEvent, true); + /** + * temporary state where we will ignore the next keyup + * + * @type {boolean|string} + */ + var _ignoreNextKeyup = false; - var Mousetrap = { + /** + * temporary state where we will ignore the next keypress + * + * @type {boolean} + */ + var _ignoreNextKeypress = false; /** - * binds an event to mousetrap + * are we currently inside of a sequence? + * type of action ("keyup" or "keydown" or "keypress") or false * - * can be a single key, a combination of keys separated with +, - * an array of keys, or a sequence of keys separated by spaces + * @type {boolean|string} + */ + var _nextExpectedAction = false; + + /** + * resets all sequence counters except for the ones passed in * - * be sure to list the modifier keys first to make sure that the - * correct key ends up getting bound (the last key in the pattern) + * @param {Object} doNotReset + * @returns void + */ + function _resetSequences(doNotReset) { + doNotReset = doNotReset || {}; + + var activeSequences = false, + key; + + for (key in _sequenceLevels) { + if (doNotReset[key]) { + activeSequences = true; + continue; + } + _sequenceLevels[key] = 0; + } + + if (!activeSequences) { + _nextExpectedAction = false; + } + } + + /** + * finds all callbacks that match based on the keycode, modifiers, + * and action + * + * @param {string} character + * @param {Array} modifiers + * @param {Event|Object} e + * @param {string=} sequenceName - name of the sequence we are looking for + * @param {string=} combination + * @param {number=} level + * @returns {Array} + */ + function _getMatches(character, modifiers, e, sequenceName, combination, level) { + var i; + var callback; + var matches = []; + var action = e.type; + + // if there are no events related to this keycode + if (!self._callbacks[character]) { + return []; + } + + // if a modifier key is coming up on its own we should allow it + if (action == 'keyup' && _isModifier(character)) { + modifiers = [character]; + } + + // loop through all callbacks for the key that was pressed + // and see if any of them match + for (i = 0; i < self._callbacks[character].length; ++i) { + callback = self._callbacks[character][i]; + + // if a sequence name is not specified, but this is a sequence at + // the wrong level then move onto the next match + if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) { + continue; + } + + // if the action we are looking for doesn't match the action we got + // then we should keep going + if (action != callback.action) { + continue; + } + + // if this is a keypress event and the meta key and control key + // are not pressed that means that we need to only look at the + // character, otherwise check the modifiers as well + // + // chrome will not fire a keypress if meta or control is down + // safari will fire a keypress if meta or meta+shift is down + // firefox will fire a keypress if meta or control is down + if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) { + + // when you bind a combination or sequence a second time it + // should overwrite the first one. if a sequenceName or + // combination is specified in this call it does just that + // + // @todo make deleting its own method? + var deleteCombo = !sequenceName && callback.combo == combination; + var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level; + if (deleteCombo || deleteSequence) { + self._callbacks[character].splice(i, 1); + } + + matches.push(callback); + } + } + + return matches; + } + + /** + * actually calls the callback function + * + * if your callback function returns false this will use the jquery + * convention - prevent default and stop propogation on the event * - * @param {string|Array} keys * @param {Function} callback - * @param {string=} action - 'keypress', 'keydown', or 'keyup' + * @param {Event} e * @returns void */ - bind: function(keys, callback, action) { - keys = keys instanceof Array ? keys : [keys]; - _bindMultiple(keys, callback, action); - return this; - }, + function _fireCallback(callback, e, combo, sequence) { + + // if this event should not happen stop here + if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) { + return; + } + + if (callback(e, combo) === false) { + _preventDefault(e); + _stopPropagation(e); + } + } /** - * unbinds an event to mousetrap + * handles a character key event * - * the unbinding sets the callback function of the specified key combo - * to an empty function and deletes the corresponding key in the - * _directMap dict. + * @param {string} character + * @param {Array} modifiers + * @param {Event} e + * @returns void + */ + self._handleKey = function(character, modifiers, e) { + var callbacks = _getMatches(character, modifiers, e); + var i; + var doNotReset = {}; + var maxLevel = 0; + var processedSequenceCallback = false; + + // Calculate the maxLevel for sequences so we can only execute the longest callback sequence + for (i = 0; i < callbacks.length; ++i) { + if (callbacks[i].seq) { + maxLevel = Math.max(maxLevel, callbacks[i].level); + } + } + + // loop through matching callbacks for this key event + for (i = 0; i < callbacks.length; ++i) { + + // fire for all sequence callbacks + // this is because if for example you have multiple sequences + // bound such as "g i" and "g t" they both need to fire the + // callback for matching g cause otherwise you can only ever + // match the first one + if (callbacks[i].seq) { + + // only fire callbacks for the maxLevel to prevent + // subsequences from also firing + // + // for example 'a option b' should not cause 'option b' to fire + // even though 'option b' is part of the other sequence + // + // any sequences that do not match here will be discarded + // below by the _resetSequences call + if (callbacks[i].level != maxLevel) { + continue; + } + + processedSequenceCallback = true; + + // keep a list of which sequences were matches for later + doNotReset[callbacks[i].seq] = 1; + _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq); + continue; + } + + // if there were no sequence matches but we are still here + // that means this is a regular match so we should fire that + if (!processedSequenceCallback) { + _fireCallback(callbacks[i].callback, e, callbacks[i].combo); + } + } + + // if the key you pressed matches the type of sequence without + // being a modifier (ie "keyup" or "keypress") then we should + // reset all sequences that were not matched by this event + // + // this is so, for example, if you have the sequence "h a t" and you + // type "h e a r t" it does not match. in this case the "e" will + // cause the sequence to reset + // + // modifier keys are ignored because you can have a sequence + // that contains modifiers such as "enter ctrl+space" and in most + // cases the modifier key will be pressed before the next key + // + // also if you have a sequence such as "ctrl+b a" then pressing the + // "b" key will trigger a "keypress" and a "keydown" + // + // the "keydown" is expected when there is a modifier, but the + // "keypress" ends up matching the _nextExpectedAction since it occurs + // after and that causes the sequence to reset + // + // we ignore keypresses in a sequence that directly follow a keydown + // for the same character + var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress; + if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) { + _resetSequences(doNotReset); + } + + _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown'; + }; + + /** START LIGHT TABLE ADDED FUNCTION **/ + function _handleKeyUp() { + + }; + /** END LIGHT TABLE ADDED FUNCTION **/ + + /** + * handles a keydown event * - * TODO: actually remove this from the _callbacks dictionary instead - * of binding an empty function + * @param {Event} e + * @returns void + */ + function _handleKeyEvent(e) { + + // normalize e.which for key events + // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion + if (typeof e.which !== 'number') { + e.which = e.keyCode; + } + + var character = _characterFromEvent(e); + + // no character found then stop + if (!character) { + return; + } + + // need to use === for the character check because the character can be 0 + if (e.type == 'keyup' && _ignoreNextKeyup === character) { + _ignoreNextKeyup = false; + return; + } + + /** START LIGHT TABLE DEVIATION **/ + // REPLACED `self.handleKey(character, _eventModifiers(e), e);` with + if (e.type == 'keydown' && (keyDownOnly(e) || e.ctrlKey || e.metaKey || e.altKey)) { + Mousetrap.handleKey(character, "", e); + } else if (e.type == 'keydown') { + Mousetrap._prev_keycode = character; + } else if (e.type == 'keypress') { + var _keyCode = Mousetrap._prev_keycode; + Mousetrap._prev_keycode = null; + Mousetrap._prev_char = character; + Mousetrap.handleKey(_keyCode, character, e); + } else if (e.type == 'keyup') { + var _char = Mousetrap._prev_char; + Mousetrap._prev_char = null; + Mousetrap.handleKeyUp(character, _char, e); + } + /** END LIGHT TABLE DEVIATION **/ + } + + /** + * called to set a 1 second timeout on the specified sequence * - * the keycombo+action has to be exactly the same as - * it was defined in the bind method + * this is so after each key press in the sequence you have 1 second + * to press the next key before you have to start over * - * @param {string|Array} keys - * @param {string} action * @returns void */ - unbind: function(keys, action) { - return Mousetrap.bind(keys, function() {}, action); - }, + function _resetSequenceTimer() { + clearTimeout(_resetTimer); + _resetTimer = setTimeout(_resetSequences, 1000); + } /** - * triggers an event that has already been bound + * binds a key sequence to an event * - * @param {string} keys + * @param {string} combo - combo specified in bind call + * @param {Array} keys + * @param {Function} callback * @param {string=} action * @returns void */ - trigger: function(keys, action) { - if (_directMap[keys + ':' + action]) { - _directMap[keys + ':' + action]({}, keys); + function _bindSequence(combo, keys, callback, action) { + + // start off by adding a sequence level record for this combination + // and setting the level to 0 + _sequenceLevels[combo] = 0; + + /** + * callback to increase the sequence level for this sequence and reset + * all other sequences that were active + * + * @param {string} nextAction + * @returns {Function} + */ + function _increaseSequence(nextAction) { + return function() { + _nextExpectedAction = nextAction; + ++_sequenceLevels[combo]; + _resetSequenceTimer(); + }; + } + + /** + * wraps the specified callback inside of another function in order + * to reset all sequence counters as soon as this sequence is done + * + * @param {Event} e + * @returns void + */ + function _callbackAndReset(e) { + _fireCallback(callback, e, combo); + + // we should ignore the next key up if the action is key down + // or keypress. this is so if you finish a sequence and + // release the key the final key will not trigger a keyup + if (action !== 'keyup') { + _ignoreNextKeyup = _characterFromEvent(e); + } + + // weird race condition if a sequence ends with the key + // another sequence begins with + setTimeout(_resetSequences, 10); + } + + // loop through keys one at a time and bind the appropriate callback + // function. for any key leading up to the final one it should + // increase the sequence. after the final, it should reset all sequences + // + // if an action is specified in the original bind call then that will + // be used throughout. otherwise we will pass the action that the + // next key in the sequence should match. this allows a sequence + // to mix and match keypress and keydown events depending on which + // ones are better suited to the key provided + for (var i = 0; i < keys.length; ++i) { + var isFinal = i + 1 === keys.length; + var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action); + _bindSingle(keys[i], wrappedCallback, action, combo, i); } - return this; - }, + } /** - * resets the library back to its initial state. this is useful - * if you want to clear out the current keyboard shortcuts and bind - * new ones - for example if you switch to another page + * binds a single keyboard combination * + * @param {string} combination + * @param {Function} callback + * @param {string=} action + * @param {string=} sequenceName - name of sequence if part of sequence + * @param {number=} level - what part of the sequence the command is * @returns void */ - reset: function() { - _callbacks = {}; - _directMap = {}; - return this; - }, - - /** - * should we stop this event before firing off callbacks - * - * @param {Event} e - * @param {Element} element - * @return {boolean} - */ - stopCallback: function(e, element) { - - // if the element has the class "mousetrap" then no need to stop - if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) { - return false; + function _bindSingle(combination, callback, action, sequenceName, level) { + + // store a direct mapped reference for use with Mousetrap.trigger + self._directMap[combination + ':' + action] = callback; + + // make sure multiple spaces in a row become a single space + combination = combination.replace(/\s+/g, ' '); + + var sequence = combination.split(' '); + var info; + + // if this pattern is a sequence of keys then run through this method + // to reprocess each pattern one key at a time + if (sequence.length > 1) { + _bindSequence(combination, sequence, callback, action); + return; } - // stop for input, select, and textarea - return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable; - }, + info = _getKeyInfo(combination, action); + + // make sure to initialize array if this is the first time + // a callback is added for this key + self._callbacks[info.key] = self._callbacks[info.key] || []; + + // remove an existing match if there is one + _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level); + + // add this call back to the array + // if it is a sequence put it at the beginning + // if not put it at the end + // + // this is important because the way these are processed expects + // the sequence ones to come first + self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({ + callback: callback, + modifiers: info.modifiers, + action: info.action, + seq: sequenceName, + level: level, + combo: combination + }); + } /** - * exposes _handleKey publicly so it can be overwritten by extensions + * binds multiple combinations to the same callback + * + * @param {Array} combinations + * @param {Function} callback + * @param {string|undefined} action + * @returns void */ - handleKey: function(){}, - handleKeyUp: function(){} + self._bindMultiple = function(combinations, callback, action) { + for (var i = 0; i < combinations.length; ++i) { + _bindSingle(combinations[i], callback, action); + } + }; + + // start! + _addEvent(targetElement, 'keypress', _handleKeyEvent); + _addEvent(targetElement, 'keydown', _handleKeyEvent); + _addEvent(targetElement, 'keyup', _handleKeyEvent); + } + + /** + * binds an event to mousetrap + * + * can be a single key, a combination of keys separated with +, + * an array of keys, or a sequence of keys separated by spaces + * + * be sure to list the modifier keys first to make sure that the + * correct key ends up getting bound (the last key in the pattern) + * + * @param {string|Array} keys + * @param {Function} callback + * @param {string=} action - 'keypress', 'keydown', or 'keyup' + * @returns void + */ + Mousetrap.prototype.bind = function(keys, callback, action) { + var self = this; + keys = keys instanceof Array ? keys : [keys]; + self._bindMultiple.call(self, keys, callback, action); + return self; + }; + + /** + * unbinds an event to mousetrap + * + * the unbinding sets the callback function of the specified key combo + * to an empty function and deletes the corresponding key in the + * _directMap dict. + * + * TODO: actually remove this from the _callbacks dictionary instead + * of binding an empty function + * + * the keycombo+action has to be exactly the same as + * it was defined in the bind method + * + * @param {string|Array} keys + * @param {string} action + * @returns void + */ + Mousetrap.prototype.unbind = function(keys, action) { + var self = this; + return self.bind.call(self, keys, function() {}, action); + }; + + /** + * triggers an event that has already been bound + * + * @param {string} keys + * @param {string=} action + * @returns void + */ + Mousetrap.prototype.trigger = function(keys, action) { + var self = this; + if (self._directMap[keys + ':' + action]) { + self._directMap[keys + ':' + action]({}, keys); + } + return self; + }; + + /** + * resets the library back to its initial state. this is useful + * if you want to clear out the current keyboard shortcuts and bind + * new ones - for example if you switch to another page + * + * @returns void + */ + Mousetrap.prototype.reset = function() { + var self = this; + self._callbacks = {}; + self._directMap = {}; + return self; }; + /** + * should we stop this event before firing off callbacks + * + * @param {Event} e + * @param {Element} element + * @return {boolean} + */ + Mousetrap.prototype.stopCallback = function(e, element) { + var self = this; + + // if the element has the class "mousetrap" then no need to stop + if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) { + return false; + } + + if (_belongsTo(element, self.target)) { + return false; + } + + // stop for input, select, and textarea + return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable; + }; + + /** + * exposes _handleKey publicly so it can be overwritten by extensions + */ + Mousetrap.prototype.handleKey = function() { + var self = this; + return self._handleKey.apply(self, arguments); + }; + + /** START LIGHT TABLE ADDED FUNCTION **/ + /** + * exposes _handleKeyUp publicly so it can be overwritten by extensions + */ + Mousetrap.prototype.handleKeyUp = function() { + var self = this; + return self._handleKeyUp.apply(self, arguments); + }; + /** END LIGHT TABLE ADDED FUNCTION **/ + + /** + * allow custom key mappings + */ + Mousetrap.addKeycodes = function(object) { + for (var key in object) { + if (object.hasOwnProperty(key)) { + _MAP[key] = object[key]; + } + } + _REVERSE_MAP = null; + }; + + /** + * Init the global mousetrap functions + * + * This method is needed to allow the global mousetrap functions to work + * now that mousetrap is a constructor function. + */ + Mousetrap.init = function() { + var documentMousetrap = Mousetrap(document); + for (var method in documentMousetrap) { + if (method.charAt(0) !== '_') { + Mousetrap[method] = (function(method) { + return function() { + return documentMousetrap[method].apply(documentMousetrap, arguments); + }; + } (method)); + } + } + }; + + Mousetrap.init(); + // expose mousetrap to the global object window.Mousetrap = Mousetrap; + // expose as a common js module + if (typeof module !== 'undefined' && module.exports) { + module.exports = Mousetrap; + } + // expose mousetrap as an AMD module if (typeof define === 'function' && define.amd) { - define(Mousetrap); + define(function() { + return Mousetrap; + }); } -}) (window, document); - +}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null); diff --git a/doc/for-committers.md b/doc/for-committers.md index 9605f4b33..08358ba35 100644 --- a/doc/for-committers.md +++ b/doc/for-committers.md @@ -8,7 +8,7 @@ Current ClojureScript version and libraries we use are in [project.clj](https:// ### Notable JS dependencies * [CodeMirror](http://codemirror.org/) for the editor -* [Mousetrap](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/node_modules/lighttable/util/keyevents.js) for handling keyboard shortcuts +* [Mousetrap](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/node_modules/lighttable/util/keyevents.js) for handling keyboard shortcuts. The main deviation introduced is the ability to handle chords and sequences... sections added or changed are wrapped with comments indicating so. The fork is located at [LightTable/mousetrap](https://github.com/LightTable/mousetrap). * [jQuery throttle/debounce plugin](https://github.com/LightTable/LightTable/blob/686c9b1e5e24fcb08ff44eb57eb7889e31e37806/deploy/core/node_modules/lighttable/util/throttle.js) ### Node packages diff --git a/src/lt/objs/keyboard.cljs b/src/lt/objs/keyboard.cljs index ba4e16e74..5c133c242 100644 --- a/src/lt/objs/keyboard.cljs +++ b/src/lt/objs/keyboard.cljs @@ -139,7 +139,7 @@ (defn cmd->current-binding [cmd] (first (filter #((-> % second set) cmd) @key-map))) -(set! js/Mousetrap.handleKey +(set! js/Mousetrap.prototype.handleKey (fn [key char ev] (when (and capturing? (string? key) @@ -147,7 +147,7 @@ (.preventDefault ev) (.stopPropagation ev)))) -(set! js/Mousetrap.handleKeyUp +(set! js/Mousetrap.prototype.handleKeyUp (fn [key char ev] (when (and capturing? (string? key) From 0b026524a3f8d93cf458c4027aae05567adf199b Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Mon, 30 Jan 2017 23:26:28 -0500 Subject: [PATCH 630/656] Add keybinding for ctrl-+ and group zooming related keybindings --- deploy/settings/default/default.keymap | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy/settings/default/default.keymap b/deploy/settings/default/default.keymap index 6d6bd5934..17adcba96 100644 --- a/deploy/settings/default/default.keymap +++ b/deploy/settings/default/default.keymap @@ -3,15 +3,16 @@ [:app "ctrl-space" :show-commandbar-transient] [:app "pmeta-shift-n" :window.new] [:app "pmeta-shift-o" :open-file] - [:app "pmeta--" :window.zoom-out] [:app "pmeta-n" :new-file] [:app "ctrl-shift-d" :docs.search.show] [:app "pmeta-o" :navigate-workspace-transient] - [:app "pmeta-shift-=" :window.zoom-in] + [:app "pmeta--" :window.zoom-out] + [:app "pmeta-+" :window.zoom-in] [:app "pmeta-=" :window.zoom-in] + [:app "pmeta-shift-=" :window.zoom-in] [:app "pmeta-0" :window.zoom-reset] - [:app "pmeta-r" :refresh-connected-browser] [:app "f11" :window.fullscreen] + [:app "pmeta-r" :refresh-connected-browser] [:browser "pmeta-l" :browser.url-bar.focus] From 8ba9ef27f00be6f2217a57b5cd50978129f53d3f Mon Sep 17 00:00:00 2001 From: TimothyDJewell Date: Mon, 10 Apr 2017 20:14:20 -0700 Subject: [PATCH 631/656] Rebrand built exe for Windows (#2324) Add rebranding of build for Windows --- deploy/core/img/lticon.ico | Bin 0 -> 82176 bytes doc/developer-install.md | 3 +++ script/build-app.sh | 12 ++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 deploy/core/img/lticon.ico diff --git a/deploy/core/img/lticon.ico b/deploy/core/img/lticon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2d809d13092e25489b5902cca942098e6f74e7a3 GIT binary patch literal 82176 zcmce7Wm6r#6E5!V?(Xic=ipGRxVyW%>%raK-CYY5@4=y1i)$%vx4*gf{}pa#GRc!{ zGI^2BX0uNqARr+SA^uB{5EKw+zaSto|J6A-{x7bkg@6e8{XdKVQH=%x!GQcvlH&jM zV?aPG68;bW>qmfq@L~E7WBi*B2I2$?0)m1Y5(49&+`m=`8yE-(1it@a1PB{g2nZLU z|M35nXMlu&SQm$ch*eXOM@1q+`nMERAV5arztR6?1h{{Nfm^lJziA-YYX*>?j0=lWR#3u4C??ha1MOmwz-n3QHbS|FwtPCUKwuu?!ct{n`}4g*Iv zy;cp(q+yf7golaS@rk2f4?vIuf^*|1cv@(V@&mv6?+jl1?|RP*l70FVS|@Psc0Bw% z&VMh=U3F#|y#IMb;%-p*>Np(O=lpm%xYPCOwR^So{|9^wIsaKZlT7}|_{_!s{FB_y z{_%@FD7M`fMWkew4@Z4Uj0TqhsbZZ07XU@Y!K}nhqH=Q~DDsJ5BpRMq$#74KIgcOdH9Dl*HG^M0w zu{1H2#2No+J00iI#N1;T1*VtI(9Gb*!s@>e>X$}PA#Bx005Xco4S_OIPE%s6O`=F7FMkk9!=zMtJ zkyKL8rj5wv1T@8uzzjEs^GGN>&`WQ9qj}K3uv7rGjztBNasRp)LI=rTvlA;-jJzZS zW_kQl{rn>SNHqG!Yd2P9{AXiR`136IJN)M|dfW5rbs+!y?dR`n@HxHsv`4S@w6Wax zGQX0um&rKI4?%Ns%@P^`6&HVKe)jz%*zJL^LslhvhBikBhgv&osp`Y97LC0%HQwklA$fc(7$RBk#ha7&27N5}8gcHF*)8L+b&E#W9Lz z_3xs`&ioroJWV*D0AF@G~5 z>a&7KQu19;anhk^!>!QfmCX^QurOBQs*$B61qJ0*Y2pY@=9$Fqr64=0I)&y_Rr+#^Wv+3!T=KQ6A&M5j+{g5^!K^JctGFZ-*UM}AamHagYU!S zyKzbL@#nso2d$S_usX;n$xLE!)un!sG%!%j&B@Q$!n4U!kzbRj1(0DiQn9dw34h9u zYjeIv$|~{5Phe=E#9G@<<%c8CNGg=Xq+(Px9GL8x#lSIQ%LL+4X%QhZTH?^wq%u0B z-dIef&kfHtw{)P&L06)|aWhyS1X6gr{Fxy!YvQ~jizwzo8B&D~DhL6QB>BU5pHg^Z zV}wlP6bvdJJbrl^2zb2y`11Bvl=n>6;hY3>V=VIf^7AnG?LdC_&(3FFTtG{lwtI8{ zq)jM?rK^^YH2_5}Cu>5cYYTdNdvp$UTP!kbA@Oi`XY{lp{yk`**11(6`Wycc4ESv^>+2kE9R*mW`{*CfPtXot_7ugI7Wy~@$zsj zbM!Nif2>ab>7-^O!ALAT>pD+)&tnZN=c%Ec6UEGKs#vpZZ1hFxcB5)L=*w=xg+@sC z07T2$6B|vG(b*yxxi~nsbT@g1H2A0}a7-nz^FcWUqVbMn@M&=O9yxb8Yf5aSqPrUz z_l!x)b5UU<(Mu(#3MzWK=Y!klwuJE2D9FU%^9D(!tJq!oz-ZuvQs1xkM-8+ig(kJB z?4pF%Ji~oeM_c^gi?%1aLj!AqguCm9=D>erMyP$BV93P6>X@k^@*q2*9k`6ixY1$d z4DxVXcY2pPD}AeDUl1a}Hu>oGnEaN2A8Y14z26fACzqe^*~T<08IZ~lfTjSxN}9=M ze3A`PSES16zcSx1hUb6F0st8pQhxwW%+=jJdV03{bYTE1A};TZSO*GI7AXp2mk$N7 z;;y~7p1FaK3PjV#Pw^Y)lkVp{z%;0JoC?_XD;ib=PlykIoUbx@SriCE9%PZZU3ERy z)-?M4F~N=8i0~dw@d_(*8_mL>PeZ?p6Bna*A@E%M!R(X1gWnJvVo_{SV8ldjU~Uy9 zurFHqG5DV@`mZ}~Zx#W}4-~)pM6}|rBRWj5{AoOG+XGx84B52OmI7OjnXw*m>EYUp zvvA>#TY=&0!*J_0%{rz{&GH2Cm^9$VX{4~!0^)16wlY&Jz>uit+WZ4cLW1TYIZisT z`fNfY7*?x6L;|A`W-xFnV9m)SAOQ8cAG+ujs{fAG=MQXm5OL?4mB}38m`n&!D-KRj_9Vc9Y?&u+Q5>(Si6U;?w&lUzUS0w)kuB=Fr`bp^R@u zpT9A_nXy6BDKu^hGUr-{4{quEJdd)xb@4YI4n_PxRe~4j@pl$fZ+QA~&?uJB%a(Tk zHLR5VLxdiuq@T^S3J>7ErIs%g-3X`B;y-`mdT9U!APo_K1TT#b&!I&vb$_f-cfXK` zy!7|HlNpSCKssPKaF107*mD07K-M=TkX6$0y3tX`bE`_pzExqc$pzA+TBLaiLkJ@_ zZgmAB5{cGQ{$Xq=$OF!utX}_KlC>W32tF+=Wr)vZl&>I!mS35)e*ZC-EK&u-96VOP9i1Rs6-82tvZ!w+V= zhTAs&%pOR=x7~nRm5$_k^VTubi(twCovM`9Ty+qDlbBtix#elf4|x? z_7j7`Eh)i_3E~*oXA}G$zk6<35vW5#Y?MYPR&$>kv&A#2Tv@}-NBiTQUwGZnJLrSC z4c?&@GX!$5eeNQS3#yD}lKWS*)aoqNBw{?mG^%wCiq+*~!|6`&L^NMGWnM@vM=6V$ zMCqUrFmIh)D5wnj3V3sVa84x#2U!9dV28|HTw6g2MyvqTax){;YB<8g^AIX5sn}!3 zn#0X=eyTNgFOxz(6|GB|_+ZTVue|ijBsFK=U+hmi2`1!FEoL1!=cpEqOfeyh| zm*I4YMI1_40yt{Mxl#yCd$mEA?-m}OV?KQIW;gBS7*63rk1-YtDm1S-Di7vgO(_eAnVPnuts{iw0)G36uA^%F2+!t3`3Uaivqr; zo*znh{#GPaWvS7BpuSS*y@rAh3llJ%CL&9~!v`65v|wg?aM}Tg9b?lLxXruuwi~`? zhQ%}!Miwya@}j&k>5KhRS7ptW(S5V!j__@Pql>VC5&dmHJ`l&XiAPJPzeBq-b@({* z>^o3Y$@Re&bhO}wbK2Gwj~P-Gd_eDWjQ+6%PY&>_Iuip}?*mWV%Bx)sM0=ZpghuO# zeeRcKK7Yu&2oZfNQY9PSrwaaR5D-n&&?-SakvP_15Co<5e4*d8^-QoOYML$5cde{3 zT!j^RvX)|;O8m)J`FPzVI&;nX1^Pj!^3j>wfg4?Je@C65or5BQN{m#NVcrBQOm=S0 zEW~&Pn(;^qdlp2OIJsZyG2-zK%+(To^>z~j(j!%IKN%U~-84BOrX6Zh1mOGOMHryh}^%-~NMzMg^l*CM5qGb|FMG!9-ru7)B%PsQJ0*}!bIPyv6pf^VD^ zyF=+|C|u5jIB|K|f^u0B9ZT zTuCClu^ku^h%zsaqE$-dZ1x1!!f@f2krW2P<9M7Z4ZU(i@qkPiNg50=-djl z?!2cBCl@(S@NcpyKs1sK-a*r|DxKv^Bg?N?X$nGm^G7|wKc4Oma2lq5H|T2% zAV1K>2$2|#p^D(162X7m9d7mKg$PcTUMEf|T-6zn)fs+#k(duofB2e87&+N+`urMw z1hsu>a@_+#Yy#*PrXd4R*7eRi?|>Jf$o+2FTVGe9O%u>~hnHtm`dXM!%(jhPbjY15 zhd-F8Y|E^*&@MBZRP^VtL12U!p+E3J)xE(*crG~gMh9d@K(jhYr_5GM!szW<2)X}ZdlRWzk)(6tC97RbJpnBJ6ojEu>+Yg1Q#*G zg8BD2YJC#r+p?%mouKS)lRgGWpRbv*sV0p1c*mnv8v-x;Hgbbw1+H&>I(Ttk(ddp; z<=eK&g^eZej@1$aM;dFF;Ito3<8TK}@2lotoC(a=A|M%zM)*bAlAz8J6t#FGGRj-* zmQN!Mk5p%x2}LV|t+9sZKRb1zV)IZ0T}6@BfP}c6Ob!JlN=b=KIU42EzLDWcG>kZm zF*x!9yn+(Qxh8)YMEj}|gEdV(s04ms^u}QRg{8)dyPeATixg!Lx;Myk6yA*IG=7fgDEU3voa@3@`rJZPUK|ID@^gQZH>s>(1~)p;bT7{#EaL5dDrXo{ioy8d(-S* z7pW=#u$&3^jSbGvxzS>URagzG`U6<^nhK84c!5Ra(g~2B#7ehu0)Of4FoqstaDRQ& zOK!+7C><8_y#V%SCXP%xnHqM_M6$niNen&s{Wfw#i`8`Mt#Ov52PHF1mm5&h!_n2g z5;P671N$@h%g3DveC)G)u1BEI8}~dcIfTe+f<7y(Nj%aLM!x9* z{e5DDnd|85W!~?e(kw?xrFSg5H`*6(Oub!)b}ak+KhD-zJiNIg#7Gm)$=^Hr+jo!B zU~gt85QoE_PXk-*U0~;KvP4DPjOM$=2ZLgX5O894zn6{7l>{c`oja=le*O}wpK*Fz z`PONq7ZWWv`fcyv6Ri_n`E&Pbj+%ppAmSV0VE$gH#5n0MnKZosC#fr&eAD`3Pr`|v zf+zvUMZQ!bp&xTitjCM0yQUtezR8VFwht{&^{i^vi!S6y+;ep5Z&EcvF0V$M3u6gA zT+F-fqv`K@Y27PWQ3ii?c%9*02>xtE#1 zX_YBOU6Ej5(^iDfMwCW61Z&9i7yamSf4ZpJrZf`|tU$i{D;BqTk8HJkLK{G5>B>73f9m2~ z(U?K&P2EInFbp~5!= z+p}5H!L6in@+_$6hnZCoS7Ai>i;{KA?<&$4g^rYPDa`n$@*r)V-zX!mc$v*F z`9Ti%rCyFSpAMbMkK~4r3!|R+PW2XTHg&Brpd8_W?Vn&Ji-fIvkLk>b3B#_yY;rM_ z=%|6p(%K)I*nRSsop2&4@RjouJLj+FkFyx36@B72G)v{U$jzFM`&;=^5$O8zyf?7W z6U;Cb8-m@%xrC|l&w#lW#w3Fb1VC1Baig4#k8lJ$Bgi@8ah4kI|$G zKiO_Ed~y7<`OROqsoMr)O4SL50+sIU`Z2Spc_(klM_5m7-Pdfx+98V;;%-NS(K2Qs z^d=&oFu1*-ItI%?7*yB^kbIsO4F27`l;x~8@!a;&F*JF7IngQx(;ej`ccUeb>vu&S zh~I1hG6L7}uhUt3f1>I?J|{OTH&2Vq#>x{^5n(R=LSX0JY(xM63x8P4iKkRhdAJL2 zt%KKS;_MjIdKn~0mZ+Ajqkq3GFvm_-ay|ZJwtWeNQ(ZB1zOH><#*-gak0>E9JzqhB zR6){rRTRTpCdqw_DF(JEh#@i(evfJP_|uLz5hH|vDOz(|@TF>GjUv94IAS4r^tErP z`|4`uK(mstRR>Lo^(gntt8Jy&qSS*uC1wX`#|kZ27O*zXS}YH z==Noj*I8Pu(D4v#$vEBe3Y;#?bUaehGUmJoymtw%H{Ga7BN_J$r6-N{@Fvh4-puz7E)hnytZ5#gzRl?1H$`yzc1r!2{ zR@~7&D67Un`&&_?ujYT$9J&UxrokKahI2DUNG>fwzdI}Mpvw6^7{s+56{r8co1pYD z2R9PGdzDp$I?uAck+!)2pY}6A|T(j ze-up&fndI;SpRyz^thH!>3e?22wbC@sjuX!ku8qj8(RG7pw)LilYZ}oUn`l#iOogu$Dz9B3s9C70e8; zphWC=4-1n@qX?qL3b7b)G|LYF#b6{ncZji$EjN5jr;gUTL}R1f4p-lxd6+kl_7H0} zqfEdPMp5RW2mQ@W7+X*1I$YlqFd2w@g8beR+P((XE(=RM*xntG_FsGambeAc*+_;a zLWI4Wi)~8^cb~ImNeeMO+0X%_A4~+w;ISX4xS8okl(zXIfVXL2BinVihmfZ0U}P|q8DO=Uhu<#a zj^E;mms4SPMcCxr(54fDq>pVFmvKtdR4>y_wt6h_m4efDP1LU0yh%7 z8yK%*XeCjr1;x^OC2S(4(jmbpm3UYt;c+N(#W{8dw@BELRHJmXa1I~wIE`P9HmuBH z{P;)PBga-9z8?7N_Kz)dmSS|(a?&73U(p!QL%}wM?oSv$qAOkR$^pAa@T?=|7~V2j zE<8)7?0JjCzWg&o03J^A)%+g4`#$@ut2>2=D$MWPlTK^LY~5zIXlIM(zw5~-V%0@d z#}Mb3;y{f>86JzOe`Xs9+=b6elRAjH^Ce^$PbvM4e5kC~DYOZ&UE>98Zozu+EF)n? zsd!DCwg9KX#cXe`G2<>+P8DLgx>jPvGF=HZmr0D-tD1NoM$a*Vtu)cLnM^>*GUyi<|uGyg{)OGhiA4PJxDxR>D0EuXn`Kf&hXon? zOq+TFgoE6|Z*mS}1UP44A^}Z>c4^$xZ?VR5A~=8Q;_Cqv5I@~RvOa+U@3v29wsKU% zO(bQSg%!UAvQ@81Uo)!2W^Yr11?j3HdCM{KbEO9FyJHigD5h>`TP|4EMi8^QbWoi8 z<^1-YH{nv!V9mGyz0_zEh#&iK(OqeD90Cfsb8mG0shZl1Yw3YzHBpzL;i)*qNJ$f? z7m5;}z)ho&F(n}K!k5jlEESnX*Xl#y%>SC}AT3~!kSDwMi@}NiBr8!)M~7LPu)rCV z>15x~uXDBBDD4@;nTy=sP_t({UTU%Xm?=VIC?fOLbaW`cTfMS^`1F)O?xU^|*@sf3 z8fpA}hRce5HysMBTnDX?{ns%B+?a zYQo(@baKMbUXq9UDyTy_W~*gWq|b+6?!IlYtI$z=gTy5r#BRr~LE7p%=Cz}F7$ea@KhcuyDgwf)QKaACzrK|P1>AX7$F3Wde{GDkkR$hG&z z_9K`yjUHD80a+W4gjXfkrRyta&3^hOP$Z?4xK@_s8_Qe*rx~Oq;=1r0n;n+SA`h&S zAw^#!&q7)Q5YYlnX6e1qEXYX=p=zPB9J-Y?gOcAv|U*pCDB! zoT77s=GI3|cDH!B#qc!;<1|g-xvwNmOJZr%v|`7#_YtCQe!Px%yJ8D2A2i-9l9}8& zi5zBl^c38VALhCtI1pzcq?Khcnz2Qvr3|)QO~Z7HJk=%C%NI(m$9f^|1-7&Xe#LOD z4td8hgCl?8S!uhLM1YsjN0#}=#@%^vqQ1@p?)$*V;u<`&EZA&dH<-Zv+}yPuxD(FI zpQ+$b-ZH|kQVYw6j5>tsp+Yf_U!%T?!?0cjwp)-P*FB=O)&;GsY^MmN) zc<4@sajxKWeV-hKW62o*485H0pg^mA^aIbvu_9HrqmD%mE>j%wvtb=qn1zp3nSyGf;aw8VkJg2iv$LV1$P5x5r#w#1`>69K{!|0-q29WgT zFMj6O#S699K|aJm_j7tww;o~^RMy_RA(1pHyA??rBJ+dHJaW{uoK)w!`Ayl+7yZ5I zbI(b})}iuY*Y%L$XdRy5-XI7!u4X67QvsLVjR_4DWXx~5~frFj}~`?)EjNApTs-n+(}kB;&VZhCTp%2-j-G^u2T1R zhf(7k503c=7mwO6juF=cSZk#YS`B}D6#>94v=l#&QV5WxCNS#(Eu2MgbfoV8>oUKY>-IHv{2^;bW9FL&NpY6K-GI+k=JF6T0${ z?fS7&vLd!i6J_#AsgsY&tvWr*LZ;lk8HsrQJeK^+dfkCv#I@Vh2;cv#~sta;cEd-v>@*DWY4Z<3;fA5-#$l>HX z8#UTF7su&>y`Uhkjt+W=m000}Xvi0c=)p^+5Amg1?+(A6u@`6Z4Pj5rT*^s>w*Xvj^{35Wd!sED{uuDE7qcwg`PWQ zdSOILL}pqSojqFnQ(0g4(Hd;%FJ#+nV}A`eHtG~;|00_7&vR=(e2B+JZ3|bJg8?@t zOX<*nQB6{iu*}iKG#oz#wfL!I2jU)c$?p&U@?U9thEX8`^$>SE5c1LmD}J>QCr#O& zXz!S-z4ffHva$&RxO|A;pSoPHSBg^Cf=He+8!!vfXF2RBY)Nrh?>SajYLF3zl=?hq zitD8_gk5{GU>4zQnVr59uB^(bfB7^t{0;glUU`qOX$Z~-HyInpW;$C99mFO20}>@< zaCB!1ScjX~;}dyn?ctW*gUaDc1%VNq+J2#MS zeMIhxcMsK@)E0GVTdAMAgd_qoSYX^GoyJ$)ivBt3u0*ZGko+I~W7D+Dekv0=eG5*BtkWr}owsCg-Thu0}I_t`{JTsg<1|flBcU(Sy{HkCFbx z9-6;HD>$uShLF@K3k;8Dh<`r8W(9rgZs`1-R06zn(Clb5uDbdc{sX&J;jr@N^CwvG zZoWDU)Nw1fufjmkyP3_%Yn+=GMI=i>5o}WkIMhpltn41FBNz63Nc$@rc@y5G<_K)CDqnkw~g4G zL85D02g@5*N_SdE(3D7dvXX`B=xQ4-UV}uuh(?t;1NGqjGqWEGTM)iYIdV8@_mgDd zb9t_6o8?okOc){BOTm(D>{t>Axh4!#zN(xV`1v`FQ_jRAT5_849Kn1a)h+>8rHqRy zUzqRC=^#6p3gi-TD7Rm%a8T2MmdLte+&>`yKvR>wqCj6vj%UHIr*A+t(v;~D&~Uct zs_CT4-84TdV@|o2cs;9`gct$Oe>6!+p1uFAmGtX7|EpwyyD11M0FSmxfazzQ&KXUN zp*J^7mfH>`$NGd>F)pltk)L(=YMInx>51)wv$2B#mKHn-4ak5B;I}I#hJEFtiIl zFGK{UANvahe%BG==ogbhU~3gm`i;M))`p7s_UQOHuIqJCH59FWY z?SkB>e)bJDp1c$$+n0>SfT;)Y-#{uwUrug1(Cqj{>hRYuAm3v#cbGigTVK)4?jJ_; zNa;UgIye36hS1dO6b^nEY8K!jTkulrX`z;55^*LG>uY5dvX!YCkvsc4e|;@5+_6Ih zSQx~UN-^!sEf;?IUgllu=c+DF30SgI<9RGjeG~c4S)W`oPm2yWDk=o2t1dz5MbUHX z+{Ss((jsmAkT=^0+@PQOD&jS(kruzz9|0P#&!EW8n)s*bkREJ}XJ<&}IzwtZQgUWW zBsC=5$v@mfqw-Y%b^+p~#0rDb$1eU6BI89vX~~cL5N!kLHwe2Qse{;qS&|G@6l>Lz!)efYa-HFXj|i8)Nx( z|MLCSVr)m5V&k(rmsprz`55Z_$y0vc1KyR=?1SE`C-B)83x_wdJN!>Ez_C%i-V`D* zgtZnPVwZHXHip^N;T&GRuwJslsxEoy=YX9gm!IHwt;&@N_=r%!o?G_v=sAS1KJ;To zcziz1sv1_D8Pf{6iVe1)3N2rwg$u6Bl4S}m?Lq@!dMb6OfbRVK26q|-lPEOA@j z{gmfOdJkrT%%7~|vr~y>=v5NxZ{e(2L)!HogsHyJ!jLau!K%JZK9Q6QA>Pw$6dHbu z76@L9&2xQaBScuBOuf^mMi}3=R~A_E8}~wCEQhi&9qiyC<#^gu#;TP@9wRk7tz%wD zh;#iZp~UF@UK2mi!yO17uVivV)?PNKtuPj*w!GlkSvN*zzI_KY>gDeKWLtDnu6~zM z387*vk!8*XrdpX#E>PkX+cf7WM0l%naB7C?U2yM}mKhV}yKS^e zWNqMMVX`W-9)bh)SSuXD(Yj!myK^^%{-iazwhXAB4A~?Zf{J{993_n;?l* z2a}FSC__+}MThlelVIYQpn?osMhwg@X|ghE?d@`k_9jhzP-s}~%&%=PE_>>!b=P}V zRP~p3!zi*|51_8sQ)9q$$^%%iHxt=~SegrwSd~P%!ozA>v&CN*KBV9m&~TuEA{Q*X zrM|jxH31Q+Xk*e9G|yv|&ms+F58k5rU7DTy|JeqVHR!W%J~jHXW6E@ADgLB?&ch6c z)Z$qI`H6CUI<_P_E@g#P7M;cJ{uyu>sA0`(F&HA^tlggk!Wc>A3Yz8W@5P82FOLN< zBc+mF&fE3DUJd{BAZl{Sv&Mz4uJLem8@0sE+>vK-uV+>G66uoDfYAJi>I;G<_l97a;uE~_Jtrj<4 zYp8fMAz9(Qy<=1sfAuCM!eHs}fqfAUTAR;)xZZ_;{lpy&Qu9qb*H?)l*9b1mAFu7t z3N+WVV@J~~u{7g>)}+A=Ls9;FV7A1j_niI5LB(E-DD36Zv(cai6EY@Xf z8vBTxkk18zHyh!e#m$%N@Eml)1Z0O4gC(~dZf{XA@isB5lU8|F#$M&N1f+FG3^b1x z9z*ay@geHMPOBti!X`aEs)*2qUslf772)%s=|0e(YWg|xB4r~Q-A+)1Ng73X%e&T^6tCSw3*zk?#pT2~oRU1K zfwU>I)f#bOlQS~NkEokj?`1Xd&11u1s(Z35Z}FI^BiHQUPaE6e?h*A>l%aw|)n4W_xq zI87J^{qjj6G^N3We!8TU+q_aO86Q?*+GNFOW-6^NQZW%N)!3KK$4B?n&>3EmQjijEvnVH1oaXh(pLNjJI8ytmy(_!LsZvs z#z9kvHvh3kHSb>2K>On@+%MPQ&i1gORaw=wL@K;2e-^$&?a00`9d8YGsUMfTtv|2r zM4V(+KNO9=Ev_;;#1WA}Cw#qs&C!TQezNL7R)jd*VpZ0V;w*Dpi^)N=(FbFgtq+sP zm_+pHxU3UUQiPKzi<-FE<=Rf13a6+Qyr$K#4gF&4%?)FzPu}o~EslDNig$zcYGBM( zR2NQZ_9s`<`t9b4;%3;gDUkqyhkkAdO!o+>x$N=dvxwJCd)cY=98+aL_u?l+xAH`#z0 z_G5D1wrEG2BF#~z^lOt}28A6IsG#nfKsjbu;f3PkrY<|Vq8GENKzKI=lXE$-DU4zB z-O+pcFD%SQL*&ZRk%?*!+(=M}9zp42&=B82cW1cYMD3e{0hnwe>6q!geOzF0hl&Ph z!;~ms1I8bBdk-gg{&g7RhJ4L>$zf&N0BT+iRHK-!L4kJ$ugjXLgkSlC!cg-8Yl zzhpMPD*i`)P>-^b{RSxpQVdb1XIrYaF)U{VXc`eFVvsoP`yjhXC!&dv?np4uN&a;j zxbcO&&zFLi`LXo68%}XbY%wbYs4Ze`ByEkqUlx5;!nr_<#l7|}JGL-No|skn*6b2* z-#QPcM_aJ!sf>Al4C}2~of3h`z#Xxd!Xo44QowCakMR{FafMAX)wi3*4y~5<5=4+{ z{q0#IwNEk&)UU~M*puf3qI)%YCBH>lsrY&cLm4W#rh~!x@6u@~^R|bsgGi%Ss#DG&qz=U(F&bnBr3rYp$7+v^@J=N%(3I`e+d8-d^5^`0dh$ zFp*P3Upro^o^e@J(%lZj6L~ojI2;KbnhJ#Ar4y2Ib?#X2=PNTTA=F6qS&V3xO2{K6 z>2l#8<{Ud+#q;+H)FXWhOcPeBc)o72j?4qO?0T9vu?g7-yZnS{Q(CfEtVJ5Pw{}1= zBY23nPq~sABn_K9__ZB(0V^9lH!f<$D35(l-n z2u9=%s*t;~BN&*7ctp%#a``Lnzeo|LH1E9JnfJwW)w$`VBkoT?(T;yux|SE^sSB4w z*ff864h^nW4{y#w(5Y15e(&jd=xC2o;VtdtYAW}l`bE1bizqR}C{I|nhGmAexDo*` zQ2@cR>_xlawEEDtkwh%a;<_&JGlzy_2uARQoWebgZ)O<~kYOFk6fIZnq>0!VvunCl z^;NH|2m|%?WHKb=BL_3efbNT>inj}gcNL!HL%>I_i0?x;1|qbNw2ctH?V%@-%sukF zJ!4RT6z?Z}$c!1DA7WXDiRZ)4>@vK5tn~`8ymnJM&D~K(M{CiztVPVFENB0B%)4GP zbAkib!#MCKZ*#0EiDerS6#ln6?^AFOf^mBIpK`yQp~u(zxD)-MyJ@MS`xo2hZb zzaHg)*B>%FAP#M1iX=kmGKEHV{iRNi#=bRzAh7Blr+6nOKJ+|MWr>!R-Qi`X!VA!A zbZc{sbkOaLNb9=M*%^nqMXE%vtASmG_MmYhF7l!Nr)7;U|Iq>`haa!7h+`sT$j$^dnE*?sq&MKvU?XeX&4^n;D zRqS$trc}nC~qRm>Y&*FvN8I40kg1_SHTIflfx6BbK}g5=t{_ zy*fpA1m~zn>$P>qvE~fviXoHs6Wl-Qug9>Tt`XFc9L$N4XQ!nRxYXmQ49Ff$+$}1l zUdT4nw^6?X-+|Q6)a<>)j}i2@6m)RMK&H-+LdN35=vaGgc)nh91j;?qXQ8=gV~h-o zbECCF&u(#tmBb)jq%o48R-Mrc@n%i{2ebDcMkH$BX$xX12H`O11NnW|QqL%5G7pggf>#>Rmw5JlwD zdfnku5)tY5Ag!R=ssrf>P7Sf|=F<3HK7(kg_65@oOXd5l3Wu;#62UA~uEP$k#+bOW z`1{L$=L&(*MT8C~8_g(%0%HOCQ$CH(8c=?_^h~w;83{~sad8i=A&;TL4|3l73$<)U z-#tsebxP73boZc5YIz@I`=@rHn)9=eR#COl_GhHmsh)=Ws5V}fTGG*m!1nO%_zn+O zRS8j8=b0zuTMDK#m%p*r6ex=2-MwxYS5*w#nn1`qW10iWf07Z75}1- zk(BF$7iuqgay7xm{T0KDg}PgDY75!g*^$=m1R#=;G}Az;?0MwAzwM zqOa! zHaHUsFLeMzl)F*8uTF;TM>x_E-cBFnO?Jnsbpu0W`@5sy)SEwvPdbkkTuZDo9<~v* zDLgtzy`-_S;A-!8>8+Q6<$pVQlgCuF@AN#^jqtXaC1`uj&-?7>UTuuxeo&FbVdkN0 zb$@jkD;k{^<^M7ADH7h1_4fr8ai*ogYjIjc=$DKvaLi8zdTG%Cq@ z^z#f_SI1qVm1h&%5)<$Glf>n0^TC5rU~1#h)sW^dj^o$Z=|?##mx;hHoc9XseGj=X z6c|yguQn3o`pgmCWYs?~ED_a@4kwNFr;XxN+mFi=$BG){gNLRC^W#X7{+Nz*zqPjy z`L_0_`|^1fClezonrq~;VaJo<&@&M{6V;~tNzfkDrdjz?s>k4=iP%{;8MKaXhffP3 zcy7xW-w=xwPwWEM@hii8r#21%s0W zT2N(%^Y$6oq(T8I47-RROXpI3_ac}1Y&S(XZ239Vez)RPq54X7&PpaVyawXi5vq@% zvoBYe28J?@Ua4vXNrW&S-CQzWAKa>QKJCjvU#H-|+k-O*e4n8Nm6|!ww ztuU1#hQ_SEvX*XKhFb7f3U=%Y4}UEctL_54E<)LZ>_TQ`rbd)i%=Lzf4F z6bfBI#?tAdcnsP@8Y&9XECpqvUZsDmcY+A6KG=1J0zNjiP<{r>Z)|=ldY0dwer62J zov;ypZs&P-ZCpYHU4!;lpuC;r)tUmafda60n^sM0(H0PzN>4hjROMkYcA7k z*<8(`1)ccJPx6ZXu(hVmY-K~M zeq5Y};j?Nw%n{EtYveocVGVx07pQ$ziF{^ zAEuN2&F%)2s6-XS-^H}j`m8!x7^KqYj`0nG_rSQSWdyAvBYtq(KhRx8Bw{nVG zGayb!d)6wO#HEj_j-)1W#PeC;bl{zL-{Jed^SAQrU-^K){PVwPF3A91=R_9H)=e+! zU*q)>v)4hmd+GTOM{efAp$MBKY*91#s8{JJ(DK5=3>WjNOva{xAk%?mS@`~UA9B4N zRsgTS*3$-ahZL&5reQ`CJ32cg0I5$tqi>b(L)7|@E0l1)#CSW{l^{NJ0i4e5{51$b zY+m@ObwkqWczezM4(L6 zl<$i1A>H}>0zNB|um^Xths{mQb(u@N7YcI zs!oJdA)R2p<=_3uKg5sz-XCJS8CjOXPyhV?$&dWg{~}MHz3dR3#=3;Y1p<VuEzC%!))!-7FHs6aU?Cibji1J>Ca~O{_3$!o@6{Xzz^O%-mYHVxFVr(3YR}TabkF3pT|!G-f-2C}2zUz# zHdVkR1XuMm_S$5s;k87g&(<#5+lU_blDL-C;zLB3#8OZPls#VQBt)brve5gG3jP`) zy7+a18E2q{VXC>Kd*-2m5zm`xv&@MhJ$Hc4mRJ9jW2M5NBw; z`_AY1(SP{wf8(6L@4LQ@-}4Xrpi3zZ2-Q8NSRDWd7%c`+#~E~j`37#E!>ea-cgyMS z#M>qDFbOw0kx@o1460T}N)okvwV22~r$mu~;pPQ0FZ}NB`7J!$Z7#X3f8Dh&JQ(?* zZ@uQAreB9uT~z!a5J)Bb`O4i=n3j+<)&2dmd20>_Pdf8d^iu3qJr+Qqo`0dZ!NcFP z;1yC)O$;g)bfn6NRwwH$W*j_`ITTP2Avb{}F)hhTW0o3Gaj|w;2|!JAOBlfJ)X%3= zD_JENzV5W0Kw}Kdk-mmqE{#(Lp@_d~P;=r@z&N#d5|QT;WG^tXyN2rr@c0otcm&%A zu<^fP12VJ?^sd?)+q`!kKH$;A>yMrH-~Km$2d%7_x(->|oI*nAJqeTRmv^t= zd8CdD92WR!Q8V&|=zsE%?URfCI#CIDEd)}qEL5}Yx3dA28cC|2L8ywB;$hFhXdD)b zS}>GGR-@Kq&IF6c7?K}fCKj=I$#zj2fYH8!iUt0t*l9BZaH^_-g`ZwI?%v`IGZ4Gh z2*Ce(k*a@~BYn8)ps5kD2P8X*mEYuB5ihiXP!-+L9aV8YuH`&L_?eGA zQxl6s91#5CR+r1dg72Qg^Y`KH&%x~@e&gx^n{mS~Ssq1r093>($@;oxU#`XN4rTj* zQI)^^)fZpiru_}t>R}qyJ!po^MUAjd1&#J|a^e6*3l}~c^uj8D#H*5|kTr1%^+>JM zGzdq(Zc(LF9Y4_uDLD2A0f>V)R@@oZ7I#+(B0hbXP3#!NYy_JfTs?&Ax8dq7*gb^Z z&TIlXu>PZ^!?Z#lR!-ZIH+=?!dD9DT$=8G zT1*OOuwvny(nDuehF%;Ht_g+X)@Z0glh% z*#~g_7#>`6y2@PTEh%U2%EB@vPJWuu;3}2?31#C1N>w?&^DX4v6+il4{w)8@_kSmU z-}ihALoL?N%HH{L?ag+>xVe3TPo|3^uV2^)$Mu~V0$3H|2b+OM4|bnC$giQPDoYVc zj`e8~=f|QPNn{n~#f!=;Sj1>KTAKOcmDvFT!7J=JSC0^N!S~gRtc$x{ldBbB%wCka zSizOSy-RK$poj$tndtAa6z=*>m@RD4LK@=`xy!YS5`Yu11ymAS0dZsCvLwdRvauxo zQ>ewM&c%I^c3}mYj+Dz9DA#4ZFa%HC3{!zJm~9|slfjO!;CN-6c=3V{wK?Ibff%3A zf=Jcbb;z&XcOexhZYNO4C(|`wd;}kT2)jod_SgK%u;tzB#CFIWbRiDSSO_nuuVpnS zTi45@&m)h&z`ypZGe7yuzslQZ(Rv7MN;_qDz>H9e)vUKnK}E9jCjm*qt|U%s)pBOc zbu}jQTT6=IA4fK*1w5`m6rWQ-WhC*Pparacw7zJ}8yPx5d-@9NZ|kUqY~1&C)>V_yvVV>YcUHm>Oi zx6k0C_smPNzvlgM%ecur*>2EM*ooDIALUF6)b0raQY@|a(EyL~P?4|qux?cRWL&dv zEaLVWS{{Jyjy!a*XnVE1t>Q z{NgXY&!76~KgU1xJHL$|{lV{Lzxg^rHNYs+0}C7z+!W;`i5Err%Ivn8liPtNH~vkh z=KAXyOW@yJx-AW4_m3$~ze;XLn5^%4;pL*tgRsR2`RsdRbw`yA5gKfZQV<3K#EQp? zW`0vw1QL-PC8nnZ7AZ&(CJ$oJGYe+XUZ4r_ze9RakIy%r(%1;R5wZHOq8Nu6A6%qQ zhIHEuWrXqw_J@|5JD)t%$}uLbf%RkO9b@mNQbR;55$J#OHyT{$Xm*a9_u-?h87?=O z-xvjXoOpXkO^ZNl!H=YL2V@vQ)YZv3rhZfo+zThtLUaoOh<+rQLKG!6>0BwPc!{d0 zNtn1hjn9H>d`{ItnX*Ppx=J_ETC1j0o(mU>^ZO8$SRtwTQ#M z|4(cki>(=lbZQMvs;J`({jfN|9pU&AUcC<=eFZ*x4}JceuihSbu`CSB;%gOEfQ_&= zR@cF!cnK-7t3&_IP7AG?nQ|_SMQ}_QplW&V;7f0md(U2YIvSpa0K(ieG#B@)P%>wt{g`HFsKBX3O}SmEVZ-Bo-$CM@&p#Zkhy8 zxql4U=g<@KO3Z1@O2cE|@8=Vg6P!-yJoBC^GseJbNQ+1Qi746E$ZFvzlUgv4N}|X@ zxv&l3q6A>kFm6Q7_dr%bWufE~6Hz~|)vZg(&PkUfNJ{R}>sd<&39-;MT-R5yCR_L1 zwtcKJs$e42I9S5aHk%u8cV&S=bs~&*14-;puzu(KDu-TmG*pv5*l*ucZGkb??$+Teh7EePhnGcSM|XGV}W0vM;s- zHk3>ufm9^}4IZLH$sKo*5Oirk2Z>IJ4&nz?N&EmhfM_8k8X$^RRfz@y8IY_JDhdn9 zvhlUcd0&}%9ua%5HOHVa#y93zJK{u~^xY+;XX@nMvG!VX&DVIp42uL+NCGSId)u+7 zCW1{u)+}dsj-P)M=!uw}{Z(iC;MJRwOOU zt=;Wk6W9-b1J;25ngWR61x`yI!b9?!T0O3HVQ3tN!s)?z_~`a`hOB+{I0WH@Cpu z8{qiHJqHhwWQ0Hq?!*gC7N_VvtPjj1Q05*iKzuD@mNwRK*DbRAPTecVCf&HU(|n`$H3Vd-j0DU2cSdU0-mwpDQ-$Q#mT*bCf@o~I#} zcrg-2arn4$V!-Q$19!oqz*#J8$_fpW%g=S}Q!^1pdBCFGnc}^a1x)~<>;*t+hed2m z;Tx-S5et0+NY`OSu;>j~Zk+wQIXV~c?lrKycU{2N;Dt%GQ1Yjnb#bwxb5ciSit^;7 z$;*-IQ>nxQ6APno#S!j3Mexu6KOgtv?#tiE9e%AHuq<&V)Tv=YIqHegdfBs zhQ$P}l$U@6?VtMPkM7B)z>i16o8Ivj zz#q}gg9_zMe4S68m=zCa2hs$?n9#%k5#J$Yad|f5{Aru#OaRCVphY#PKrox(PuGFJ zd?Q#DuqeF-^Q0s@W-*34Ot3V;(i#r!yKDxme;8|>l^Nw>C=Xn4Q;Rfr*QE0WZ>skZ zMJDFOUNlHdUC7;2$VU*N#0Sqfbi8vtz;f_^1MWP;P~?xc2DD>@B!~P*1Xlm;#vGzT z0)JIFnIFbBoOS&AClSSX3q3UagQMY#R|ovCH5@{tuBy1fbXpRwQ8FHmfCLdtiN_@r zq_`JLq^$NX{022w9I~>ymFYkvi(I&d+cL37-K46-$}BjSXCfEEo8}QP$g3}aw_oA^ z_=7K>MF0xmUJW9KKUH8b&Y$`IPm!LT?D=-~m3buZ7s3O+XAUnPW4v_#70>}Z@UqAru0JQKhGzAW& zM!?PhUn~k64_0`JZOn5}xSuVkk&62V9GW{b9UH!G-^1%yH~4-SNV;jT-ZO2u>jC|M zZLnleHkk~EVJd>MJ|7VFn^}>^m494Mq<5XNZXg*f^?Mh~+2p(gewcZ&CN$lj2YZCD zUDar4$6FkF!{7hW&z{|q0m09$;ZGH?VL`};PktSq9Om@FKi3D>)Dr=a{l9F99Qd7s zlldFZDfm51g6A+Tp3WHS5ntN@KgcBW;h8au@=9OP8 z^wznVWpiuGYs^n41-ohi+(O-VK#zH%YX3Vbg!vpPWD`#ia&zNiz|CuC3%AY1g!SkE z{#@%vS0XMl0XpYO4uCrJKm=TQ+nhJu)hPrrnoLjbRPyf2X+`KqKs$aq4DHnspD#TC zM6qfKsel8HB0^4M{S-{xSzeb*6I2|{xdwOaK&BzPINzkq9?I&7perz%n+$hbi}GCE z_C)l#+a4B+`h$6y^4_tuhCg}x;n^)YD{#NXT5mRU`ke&0U!yY92dDmnCEFwEM@{hZ zh|*lPLQJv+=@ugWs3?41fzt|{2kxngYLiw_zc*c4!f(bR6~<0jzD~PtT5z!kGdI1s z>!Q;WHOsI@h-G?X>d6>IYcPCW5UZzOBGu+KnJb3)B#>unCd^Zo;zC%UD~m~oA2ZMG zcXJEez6MUO0b8Ta;K7}Uo@?#k&-EBX0LBFV_{W1q=O2*jYbjomi-E~@4$mLhZlh4@ zD?n~=62qU$Ypkzd;rn8Eg@H|)YmW_()&OzfcQ3z*IF*zONGk%+`0-jX4)Yknz8& zo{Z(;Avl1@_wUL9%#iR3&|1c57oWQSGsOlz7b1g(vT=l!XFKD=c7xMR!;K9z5v&E- z@rVmT3Kc^)!|+N;SH%HW&IxEjHfGqYc&iFn18(!!cw=QPma#q)$8iCpuSfDb>+K~{ zK%w;UP)()?{(doFauUe}96U_;;q2761Hdip_(DL+fd~ND#S-KvIRl*>LR*|Fj0ZPI zGJ=rzSWJxi3{iIyVkBdb+F=8K)(&{M>G)?O873rZ?!j;{&p*GI+vJB>T524C16i2N zxD9c)U_*#-&HdLkxCn|5o-x>Bsx}=U=|LC@25J6oW{W1(pSXC>4l=Na>}~^Kjb*d_ zunfJVy8CwTo>52+V5nyRIqi$Gc*Nf*=P8i%rTu?LbZ~KfH<|fC*IkLAqV?nmVBK&& z5B%iV@axhbrZ}VF5YLkT@JQM)1&Slsmpvf9UAuBZ5EeR&a!(gFOKNou?tDet^=1g_ z;Rn|{lL`Di9pU3Q+78RL-K$9H2=s-w+T9m_^yVDE@fC18fV+#1;MRiYTE9R5 zmlT3-%#1Emb!xC}&fbr01|qd6JSkKTaz4Z5)DPeIxNHCtZl-AX`m;Cqy}KLy+R=S5 z3jd<FPSLM> z2ApCdw5hOENJQ3sysakgYO3L1v91pA5BJVZJ=_E1K3M-1dvVRmzFiC$*dwg8Sj8ZB z@;|x04&dyr#;3CvgLydP!`%UT>}W&Lnt0M2Ob*ykv@f2BwC72{JQW2QY1o6Q;2UG6n?7&B9fS|M(x=>zh(yd0#r<2P zP9Zbc{4!Sk41c&C@cE742fg9gJQUVPF&%~mT8L*7I)aIBnQ)noY860zCSI^ZEOOQ( z>IPIBc{FJhH~jr%%yRi-N)(ryPyy*6=X#|3k z;2;M={}Rp`*9HG;a{y{5H(M0KTR0*q6y9aSX_j*HW@tusB%)kTw(Nqk*Nnm_*K3{j zR?Z@U4`H$XeW`tv#fYduVd1xcmZ&*s?FyfhdL(4%XGmxFTx zJy=mjp{crxK%*wT#_!a1oE|)f0BaYhc|V_h58rHpCTR8EQwg)OHAOe%gn&N zN0L&UOd=7lveU|M1wYp<2$sTvecjA(6z53%eqS4k6wZ+lgdZfikhe={!N^zyA#o$|NMh>_!un zhYqK#?43;@C&_5R`qL38NfYI^>I3h9-6<+cq+ON?6q_k}Z|Le}%tqV7q<3&l`|S;I z&v$*ibrZOMBYdMXwOQpr0{W-|mC*e6#h*DxCF8YEF<}X=VOxULkCNvan&s2`IoA;^ zCI+Cd@DqK74>z~?OEOU&IQ#x7TtqWJi88`Sz=CR&f?Ql z<$h0=du-t##O$|+KpMjoqK4iY8jEI#TMiV!P$vx|TwhmgIIH0v9rx1kW-~9A@?2Xt z;O);{OnM;IzlYo9w^++DbvAS<&yw#%-kAHJh@c|*+GHLTgYSiOf9E(l@*nSjhXe3% z2b}NlZT_K-oaJ#e!u!y^_;=qvM!weyQ#^p4} z$SOs0ms++P96WdO%?f#|j0beLS zyjJ{?-r(-g@Y$i^vj!ZR$LKRjCd6=O4P87*NDFrU)SMcNgq5K6(BVYkP2;qDL&?em zH3QKsV1hvQ*5FB2iEIMaJUZ7q9cVa>fzvP;8d_WMV2VE*hM%1`d~ev z;fuat6TyI6%9bkjhEtt9LOQ=#yDkDScLGrptbpfagWxP)?rJgj6+Z}Yt_q<`*0Ewz zQcnt_N+uS7NCe`wWOEVB>Cu1{f=w*7$$^W}1h|9$F5+gFqX0PGITI;y>3U z5CC&yjWq^S$y6&JF>w(9iyO{+0CWp#uiLa;XQ?uJSw)?CMD-dxc;9+*3PvsW_kS69 z{WJ(FUFgqx0JL!d#Ng)TASe%Qp$vhi*>|v4fWuM>`L5> z!Xbw((4r`(5OJ7i?7d$%m^6H7Ubg$I&G2Ek{Es2{YBanWF95=Ja)oJMr=}l~|Bt?q zlzYijPA`wsZSyvx*LA^<)BA0qL~%`Nn>;LnyLBs@Da61~1RIIeMl zdVbM%?b2YYhEsSqm+fxgxj4-{3aW#J5xkkX2w;)(-ZfAcn6%o(O@JOL#{{@D!%3!7 z3*o8<=W(_OSOFkr5fkqsiNT_ZxW_L1iWt7^EdqjAFMuM&b4}*9)N$v5CfHG!mgkBFs2wr`#$vr ze^%a@Si=X=0!rdu8s(g0Kn)zx@gl^ zgGit}m#jbch1QghwA4ox@t}H|S}Y9n1egJ1@eEY&j_!cAG@K0hle>=ZA3E*~SWKg! zNdv7Z>05Ngc4ZO3Y=qM1WG)@D2D*i>GZlZZc=K0HJohV*dn=$08J%bjAgDs1jx~A(6a}1lME7q z1)~#YuA!drVpUI>eM0l^CiwACeAr^`n74nk$lbSjO#d@YFkI$e!aX~4^kV|Fm4gRh z$~8f~W6bl5%=1_eDeG9KlUli-eYSzjR)y6~kRNV=Fm&7=1Ye1#2LCK( z(*wzVrSCE((lz^d5p9o4*Ng^ka&HIudAYAuo$eBt!NHAiVXiOT%mFc(u6bOrqlAYm`O5V!JK^FgYGXu)=UF4G+|R zJTYb}#kYJIej~F_6w}KQj!v^>EVKans5Q_vxPkB@+!nVh zOPdtPI?#$4@ifBu8sCxyE|7n-rjn4q@`!9!PW#n=_`J+G@uEN(r_0X zz#9?VGy=P!si(053~wr<6MMG7&%*Nk$B!&5a7yJa3)=Ywr#a zhsY85DLQ~A1*W6Kc?y^1d3xt1+lf6}%5-4{cgcm z!pv^FKDZg|;e%%ydiA+`Jsv#K2<~n}7QOL2iOT{UdlqjzH^n(DAwQ3#sa@Pca3g}d zKoVcYK{s<_C(W&^0VfG|e>iJ9U;&pF^1U+n-4VbV5t1t%rXqmn;XUx-9kRO2N1GxG zvFs2)MFeCsE)lYnYq`TVJ0;Rz{i+bX}1`sEK$dPi=?NUKSxeLM})j?z(WTf-g@4H+cysM z{mv1=?JL(29FC40j>}|E>1@>m=nbO*XinkZbJ(p;2y^bJz!x`V>MTqIpolEJVf~;B zFB5g19z1jM!#lt};ppyMdV#Dcl>;;EIe-At9R72_RuD$@S!oDSjqfY>r;Z_9z^!>< zm^FL@zPSyr)Q%MmUt05!;c%b4F7xm0stDkY{u!p&M4+QXo8e#{1Mn^un}tFc=)2W>h$1@$n|7h#{jUDdB;Rxj2&hk1P%5aJ%V+@KEG|wGOYIzsTcn9>&eBL?Ex_6 zLw>1+NWt~Jq~JudD2PD{VCT5Y9#!@}pRuXvWk~wM;I2Xt^7XMNwz_z;oPpEN9FZ?; zhz$!)dc>c|f**+B^X4Q}uUr@4x|M-|zmAAL+W<5f8N>mbsq)w=gZ#z>XNi=_k;&zC z?>Kf#KOZv(at+Tw5^CS4;>i{sfJ<`?bcg#3SO8cTPdU{?!Lo^B6Gb;KU)p;26j(bh z;NvYhN@{^yD`)5u_zQsKrIu$YWko@8Ee;NVk%FVa!&lXT91CCpq}u>GOIxjQ$Cr>d zX{A^n{GDqQBuR&-Bk=Gl#DL%m4mZIK+9s1DnX5_Ywco zI)U&4wQmApQfKf6XgBz&9Iz~&-c0N%joP2TUD*)`;`KS*2ViOLz2}}@GG(GN1p(4g z=Kw(yM<8D`!%a8z=6USgxz6jl9RjeoHeCi-kqGpqhHInK2}puc3m~CQ9bq1j7QX86 zv|6`K@L`et!G5NhNSbn-a&P-*TA$qgj?&COXZrBMP6jfZT!QWowy9H09S-Pn?C z1>tt`>#Tb?R)3~<2Q)o9cHROZwC*zY;Sh;Yj?N7nZ-9Q|{T_~v1bR^%_9eKbkOMM< z66FE{gJyz}>C()xg_(|#k>`_hHyZ&YkRL1YPWACeHpS*Yzko-G;1P!}7e8D8d&ZW0 z45^go+_iBp<1(fNR?b7{K41XedBqYj--9N>={5Y!3zW5Q@R$jRU@r1Ble=EdalV z<>GK~gxQyg>?;tF6QONCtLj9?9JkFosy{2;=Y$e03yn&@y~^R>RLUR^;+Ct z6?*l0{$1Y<>=OJ5IX3vX2asWrwZHbkQyHl^mo*x^mZf3U1wTQ<_r`Wr3~*gf!0@zl z2Cd;0JOPC^U>nWdNb8!3V1a}w33$~6x-es{Yy5{05yfNV#quF&&( z1D1Q>idad4WW#~mIv}R#&12DC3-ET4Q0TnO0VLbo!vUx&n-ZXH9PhTD)%;chB_#QWmeNxv9-(U;Ouy3LuI31xs((|Gme+U38p2cz~rXD zDegO%J6VW%2AxrXGM#u{YJ#jwkWNJ9Hz|Kpo6h&-prwcg!TzIR78$YG7bn#WZvXFY zT594x0_R}IlydpvtUj7k?h)y)NNHOOkHSDqgMe2u9Jk_!u&jPB5kMkJe)a+cxS)2x zOyy1`UHnwdbxExY&{gZfbB&0xKKs#U_(Qc4l;5Q7MX~xD$4ZBn9DljKyAONhUFW`T z!8uUDD!|(iz3>L;H(19@K@i`rU0Dapi=UGoE1do}!BBsm0VraYX{SAjMQD44x__XHCtN@v4tG{@Brqwk)Hgoe zq#z3d3i)@rxR2MWY-&ZLp7#Y}AlHz{!O8(D6a)zNJI2wQa{=QVm2b~Zp<7(rB4<5L zv6i6_8QXk^1_IFVL0BSCNmh?b=u)VEAfV)4B8+;61W_nqL4Z5Rl=&~c@d~*oP`>~M zi2d%TGYPRNRZe z6OtI+DHTmD{L)>&u!xH=l9S=HFR%bD*#BO$5EV+!!&A{$yF7T3bDcnR@iz}tiVr-P zT(h9s?GRzj3XD5vE6))uv>criXb=8uvj{TU=KCm807xAH(_M)L5cEj!5Pk_%d=khT zlb6)-bIe49txP@EDa9Tl0?v)dAXw;6F#{68WCkhrS=RnhX43rO;$FG9cJZ8G`mj{e zUJa-*iU9 z3ZTQYou19}03M~eNe_la+|2z-fIDeuaQ(qu=CA`a4g$~m5zLjw{fx*$1t5|Xo$K2| zCKCuwP}lC8hn=bkZknM>i*(qA%>=g)3~H(Y!1TqlHmm*i0?c(&tDPTHo>vQi$7Br| z2$d9zjYuXsSumANQC_8mX!Z{Yftxw`fiIcU5b1c zNWywyN8>PVKvFyjKZQC*nyv&>5eBYL6>G@ps3&(BJd5W2>WioGTeYhqfI|b0VdB`- zO@J#5@6BV)RW&$3FC8_c!J6ME@LF=JUSyJ-(@G#unOGvvJz(bI2G`cedBn8_1iL>= zl9K|R5xEKA)|PJWIrsoZD`Ij1FR+`IdV)g5(-KgqNDJgZ?~S_%6&=d_15>~#P}mha^~kA9F_%EB@$rW9&{%$c8*Z%W417MLeKLGL-;5F{yd%ua`Xr8$8 zo{?y3z&0TEd{R&$g=?Jy#f<$X5|BylnRa*E0&g@wRF&nwbQI#)^K8hRG^sFws6N!xzNhOK8pp0@8cQh zk=x+?3Eyc1aCa17TQD}oFvYt_EZIabnn&=hFq}K^x*3j9O4;DBvWR5tj`wR�JaIN#_*GL4}3VUP5Q#B8SJhJEc-prJEtswUniml3yKcf2O9o6zt5y7W$0O3XFkCAGlaChu$-?iUY zkVPF6kqX2SnwpDV6n%*Fikc;xv!wH4z9Yt_aR$;>u1HsIfzRjd1FqSwiU4k!Ko&Qp zt)}>5G~5F)F}yd$sR`}?d?AsPCiZuUg;N8*M#qP-;fuu;H%$$9J8H*(A^(%!egMKh zKz4i7(hTHiq>DsSO5YvESZR#o#{(Xzm4P)cXQ0(4uFzP3l$)!TcL^sPH4k%bEwZDK zS`_w(fU}c3NmbjP?S7;q!2Vi_(gZ@X*}-`n@V zj7YNXTb*!*3sj0Grw8rOFYJMnG< zLdcJ`3Gs*=7ZrCckU}bjD|^rG_;(;$dS9ZPnO)(VIPgtej5}P{aCcotpytYv*Af9c zXN3)gNW-Bwdfmc3wLFnSH0VG2nu6Wrct7E zpGCYtui0q<3^jZcY`^>1`wQ$Pwo9-(qv;0@OzO*|lRP9_Ib1vKc%^s+n50eCx}43A z4oEKkwm>{B7cj(wP{L4VZsF~x&KJQpr#z%W4A^<>xRklTiG{qLN=9q z`Hq4dE{`1bFxz+751@sof85nUr4@CJh}i4mH;UnFktKP|wER2y1~*-lIXYkmHz?{F5}!g)*i+zRg3! zQe%rSA67Z=nD+wneW{o#oI*ApmTEV*$t6(Fz(dH4#Vq}U$U4*vo^2>7nH-&C0ms+? zY;M25cuALNh>!%idP+(IMFoqVg4=%e+nt4X}p8=2>1Bc#gmo7FB}g`~*NZLl?!HV2wM^Z>-xC!zMydjc{RD_yVw$ zl1;}vSXLok5dH~>Dn&Bk;!ji~_grYRtNi{BWI>GEGI&=VV)@ax%XsuuAzG zvyar06M*76FmJ9l<;p%w0CR^QauxtojTiy=B3l4kU*M61fU~+`78FD(r#irk_hP;_ zkwjWNFe3-6zW{+@cMhO+Si608PaqxWcP?rWa1%IlVUfu~StV$J|E&#a z?j&HdfNQ>kz#scQVy^XCA`Tz}q4Kl)*@;{EBtjBo)?y|a)gBa2<}>XO;}!S&x9;CpBCdfa&2u@Q!qO9{ zGl58<@HLM>E%rhLfN(V?lCTE!Bjkm8jn;ZZGae=-wac4A{g7|LT|8BvpF@TBs z0e`qi_qv^5J&Z} zR6viA<4Yymm&j-ob4-f@*O`jA-~vWNR$oGVYE-jiorbphJwvcd0-CPTTJ}AVE)|0# z)|sA+JK!fmsADY3#QZRLE{E&2>-L5y8f9K`i;;Y{BA$eE0BiShVe5HdgJDRYTou>A zyMo1`ROjBRIhtJK0oMSS9hx5Y6dIpsvQ-`6U@M}w8 zRZ={gl)10)z!jF;D&u2dR02LJ`7$X#^9E4fZ+#-h9$J3JMKGfhB*uI!9*-Ys(%tLv zaDiwo=FNrc(I*3N#yNnsJ7>@$t(u&X%G?(97&h_e+7<|7)XkpU2F#x$_mDwDGW9#V z;Gm*EU`y`nJ8T7*mLAKn;3hzWqMKnu!<`7s8eTWU!%%!M0LHRmhTG;C(}CP@(griZ zs)7!|5e?f|VG(&|;cd5YEg?}Kz!%TUf;qc;0XjGs@E(S5)XkMi{h3LZT*FIkr|gLX zx04B*>lGL^m`uu*SyoT8_c6!vPh!r0h&8!f`z{0kYTuWF`UBEwa$W!KG#5 zGJ{Pg5?lSZv|G!h)JtRsLI8a`AT1B%Hu%mi4*ZdX)fJHOp4`9S8fcbmFC5+0B8dst z1!38l=K+SfR$LRnsXPtIDuA63+S9VGW!|X}wYh)0OiMO%E#yAN{SxOb`z^oK5M%z0 z@313~JAKVV++dL2oDlYgo7Ia=Zj0bxz$;UnSA$x|B7&2w@B)#Z|E!5%G0*Iy3m~Qt z@fx*&IOnF$cMM_mRNzpx=;S2e>$;h{7L!~5LJ#<614^KqL6ppoj*38(>+r{N(<*`>U%9Bhk&1R%BebyIfo0}+HoxT(VJ{gHj9ho_!J zLH8z30hLs^BTbre1Qr(FWTa3FN+16k>nutj1tObX6o4`nt%fNI0MlXsAd{^e4xY07 znP#-Y+#HacLtld3A2VfF3r&9~vJLj1h;I!yYNkLN8z3hnVmqHhSy&3fjuC5SCAI>S z{ioO!BJCcD2mGWspuP_>d@o=0fB1IostAC9;_w%RHv*eAoyzY6+zIU<{`p`Y)_VqE z;u(4ja2H&gl$#vf@R#|!U=hvdRRlttNd3aIzle7^yYbON0LK*jQ4%TyrN zjvKj_K9QF-WUfGz@BQEiV3%#VUm!D5;WjxbDeIbR`SP9^AE0$cqyG#IE_=j#4R9_+ z19`y@DKwN-p|r#jNRJ#;9PX4~D|ca&!y`wK-hjacW;7zRFO_FG?@!@G{~YbQ2*9Q` zzqj!2(*cI-NNZTk0sK`HjNZHkgnF$08Srd8sT3mwVh0BrA+t%`#FDTs@Vy?yxc@C=6#DrVCqw<*%ZG)%76Y zV~(FPa!%d%Niv({eQ@o1I7bB_6FExw0#MN>hNy-T$S%g&gGyU?99jVNPFqiI zl1PAO3-g&B%TLOW`EIWFy1qQ`Z_%zS0{Fn)WZOJfzgeuQKxIXT;3ly8CW1pV+#(ZG z;Rf(f-SF4%7M^oXvnjY?;#>8 z*6yd9U|I{3Q0ips0kTDL5IMq-HA(5~nO2M4Nzz?D`fe_tzyZ`-P4}`RxeTT;vzT*5 z*l;4`O39d)S_Ds#m8ZBsj-bIK9ygy0L#apHpHyDw*&srZP!uM&7XOI&bYSP&e1&#h zGhhI}WRQ(P!b{J&fmSjmJD}e-;2~J}TU(%59f6Q?aU*sdfaKX}aHP{rW;7;vre;#m z4G}L8XKfYWok=K!sIZB7qzzVfA0KZQ6qn`?YIgzbSaDKbvWl5I0LTo$)%`f_4a*%QWwns30kcc}iXD zptJ-Ow(3%inA0b4068r70ol1#c)u5WQxPkBp>BtY&m-?Y_*mOAxrVIf%y|Ve$bDeH z#mu*x%P2!A`<0d{B8ls@E1Ln;WwRDhe8Hxxd8#fQmVs!_Pzr9u%YMHSg<;?Xr}4l% zxBE0%{;naDNJ=r+rCti5+%^BbH9$?#g3CBUibio{H4^Jh-(#rb163DXzQyFy;H2nI~UaStcp) zR5pH8>Q?4Twl{6wGVjmsZNFw8X&Ilvxi%CE5+v{PLmk*mC zT58R)LsV&J&x6fJWIkKDf<`DN(DMNDnF@47E;_H3AtexV_;pM$ctsu*fGeyzouLT0 zQr^vC6}`=QR7G8FiMR_Qnwm}|6-)}L1+npYPJnucVmtpxqs}KqEq1}M?9^WfQc25k zR-_HtBW@})<>;=^Bg}Id=b;mb)BLwgQ9uPd{}1X2+7r4Po*5h1nTxO3u8aUU1^4wQ z0yUfU06YlIWA_i{F6oO14&gbtJ3%sgta7Cr2t22sGYD4h^%IwzKpf02UJbw*+(;fe zY-+n{uPw9KZ^*}+R6wO%LQ0%~RJ)XUI8uMW8|uL>)Vgv2m9nO_gZ;I_HBlUh!$bgQ zx-VKTc44`}s&^umJ^?}iAUJ@wOuH_}0TjTA_06#1vYrIAoEQ5hBB%%<#}i_}YSjH}JUt;2jR1W2C>0cMn?&T;R`%@;%{1^6q%OWEHr zQ?*}W*k7z&IT|p6b=1px8IZLlfaamxK**I2lm`P|EgkRFaMTT|4JUJxVeT_!`B;~& zxiA0OJpAZrfdm@R!fd4B0p?`^4JQ?RCW3|B@q+<>4ho z3pRtHq&27~ftpmN^j&|?gOOyrAQDn5n;Pq+&M;LBj>Z> zwXe!O+UM(<(rVBI?toJ`yULZB`C3@>EX&q`evJ9Ao*Un|9|JRAB=Zlz_fumJ$>EU@ zF*pe*z|XUEy>|6j06%ZOV2;SbB^crrf(>Y`MHQfi1H5j)Z5OQCaWddwhJmOf5GNr+ z;tTNvLT_bojYIrEB+tEW=2U+(;AD!GfRG$Oq5jn@l>qqy*5wN?6+0XR5Au$pf2>cN z_f_EEK?Hv$_2uCPvcgYAEC#q%I?Q{u1Q-u=P1|iPJl^7cBADVppIk=T^aI&dvt&{$ zo902mR5bGUohb~3`js`S`|&CEe*jt2kV?7CsKhl>>@e8QT-$uTs->o`74s*UdAxy& za|I)wZ`~0>J9w@|T|CbOBs?uc)TFYQ$WQ{nFQWz%;eXoHzfHSxLJ*5j&&HGIzX5`Q zt^(;Eo!8(=JIvIp0|{`1;#L~o2Mce_MG5ELoDRGGNQwyU6@go%`6~arAW&YD;2TwJ zqzqd*e7nz2JY
    {3-)CH|;vt~|4um%v~9uAfq6VX6hT_~1oke+R_0pg+luD4$M|W6yIA*pwDv(WqfV~kBh5{~(Ldk-tui@> z6rK1t9;iJt>G)q_n1A}!Y6m3W8XxNgL=03YFIIuGZyX*vufuul&juD?8d!6j^P zXCjK$D-=ToZ#Q$NpDn1?C>!|*%?2m)DU+u;j|WvN+grMOit;DYx*S9K+$r-eem7n# z97ZCASP;hc@75}Spam=2$E1=6nTM|`0P_V!CZ{-|@ma+vU~)vX<|I_0=pe}A7H%wA z?t)ON<>0y2#B%{K>#?E$Xv~AY8oQ<*7A_roc2lN^0xLcbv97&)@X^-bS&Pabm*FMW zPh5xQ$vwrKGqB*OG!%ln;2@nk02r`+hy4INSjS~|&)XkBABbQC<@P;QPt(-}ho-oJ z;J!sr3JjtGYqKIS*)jLTwi!neNVc+uVuD-DBc(8y3Vyt)b7GrLz&8YYt3^v+D4o6R z2=o|WZ30G8F+ss(^InbrrSc9%E6-cSkrfke)c5iL!sre;Sycj?1fnzXLyBO_Xumd_ z$xK9w0+7?G?=8rn$9J002&4x1(JCplm}elDDem8i@nJax&oxtUri( z?%3j<#Uf!%0}O%>k?X^@;Rs-(QVA1)c5bPm$P*?Sf2I-O>V+29DyzMdUu`bXj&hez z_PcwGDM_?w0!M{EK$vFyzNqz`&!eLvD9cWIvM ziMi$%ItJx?boRXiviL5&a1eE!ZQe$JO|H69>*z-#r#+JyDykjTrc;5@8W)t z^)5@9+>cFU)+DmhG+zT9q3EN|A#^HD-GK-(ejS+Bl|UE_l@|E(kjXjG&2@Z-gMnZT z654x;jdh*pV#+-5adt#JRox9*B&lIVpysZ=uyEG%^4<+abjQU$nJZ~G5tst+HuD-E z{71@9ikaBBj&+*AAebXnpbZ|jw+0QN-k3dI=w|S5#OVXi;K$32` zG7$w?_zY$3d#Y0rnPDpVc8m@=5Ziyxu@hioYyxBnEOyig02hFn902y~$NpYI$`GWh zGOH8O)JEAc5onl0FL5xbbA3H7*P(D1Dl;ooi%%9%wc+pY!>t2txX7U4R3%~B>{RwO zPa>0hz;%9EApJJ&st91%NY`ziKSiVpHH%;%3$v$qiZ1{&kAPt@pu6<@*`# zIO{-DgJFR{(E5Og!c4GAhhX3p6zj5J=m~1T=d0l1(4f#1Plvh7a1Sm+;Z_4N!#QHN zO$0Io4{G>EgKOG!0yEt~Ge{;jo@^)qGLuohga8`A^wred)2SVV~ z!{)tOu|Ku&*i!{6^&~!9P@nt_l)b!P+VXR_<#1zz5YuxJu0W#}J55505@TJp-@-DvAXz=WBC7*E}TgF960X1G|HdiJcQ(~DDqe!+8QtL zL~G83z!johSWhYup~K^(oYLBVzbE&kV}*Xv;{b-a{)|& zW)dEmJnvjPa#n@wxKg{W8E{y-l25;Dz|}?R9w_fQ7Jr>AoP;^Yf}Q*}js5`1(gU~z z!be?J42SX=->qD(Y~y7|Px;={+boA=vmYkO$U__t_sEqe0igtRK@lNrj!CiG^EBfD zao{cN>xE0oG-gHN3b>722WD}Wq9Y)8^nzZ-kxN0stGJShG5KlcEGH^o-&;r$jwku*pO9`8^;vi536%L+Y!L(3fs)e+(L}7sSMPY=Kby3)$;)ue1R06 zwrOb{D?Av;+8JUCyg*mze>94DhU3s;j=c}!z69NDw?%Y+hlPKE2{v()-)e@Rt^wp* zC{dWQo9V5%FE$(lWdaHyy}(iw@B_ZjC;YhCBcLr5zg{j+?B!SjbmanoJU~{irRk{v zS3YZxeFf@}n6+q$zDZ#M31^%D`(y;0l<{$$OtDK)LWMTPdoc%$n#tx+Tw+rUs!J7! ziFFx)$V`OEoqR0n@To?GMp5sy&S%vkpa)MN6PwTIytGrQ)@aU+A`SI2AwDIQ3xbm7 z=7n}|=Kv0ypV?C+EtNpZka%u9y|-6rS1t^K#QyXwg#kTe)S+I?p-bd+Gr;1zzo+sI2z!1my!gy)8aIN-DXOpz+*9FzOiD^*QvK@FELaA!QNFce z&A=RA+T-J2rzxz?JAkda+CI@FfxnIeyY1bx`Bv8P;yXV_Ac9f$c1{>mya@!DT$#*w zU7RiS=4QdZx?Z4BXTgco30;@^1J{lPFbiVgRJ|7pVi;geK7nOr9~Y;hKqmxU3|(9V zXaQOtWJPM}=ED`hg8{1=-WjH>pRT?-qx=j=r5}Jv6{MJb;$F(OX)o3n)h>Q!i2zDJ z)F6X0`zZQAl{#$f_6$4DeW@F|g~M(x5dku~#mZH5%vK1C-(J;Tn0Io|aMmTX?P%iC?b zSnCJ?-S*sErU7T8QH{}lhWAjMhu}06C(5ns2&Xe! z-^Hm8z0<6`GZ#qbdkjheYI=Oi**p``a0)`(4Zh$G${co-O!hxN)xP-rSO84IwjSexV*1q!v729K$R{_I za&^kkf%U1hL~#O1FDRX3uAB`p`=N5PQg z;U_1>J%6P5^hvGrnRst%^HJ7;`2#S|hHi6i zn}#S>k)UFx`6_(^bN+%rgt5OZkif32+JY>Ix?yrxb=cRn0$$q_kW8s!3FU~-jUIrm zbQ1uo0r=qjeNz^7=dA@U3JfT=s33b%!`G^KKj5;VHDql%5{ca0x(St4D;S)%^hXDj z2iU2|OO*ls^>2V=}y#% zK8SQ^Uq2EllC2C%lL;Byo_om734}murgClzr8@$9@G`CbwRj;Ee2kTT8Rc8ILLyl{IAwxUg+F#_EH*&^

    a&d3hy#}P*}$q~x6?h9g9LWoXI0(@H>uqB3G4mO|L_fd`1yiA`#Q>- z><(4|hMl&U00m4wkQ#~ zo(bd#QHele^WHS0#^FzVb%9LvVqMrbgN*2#k?Sfz6rFjl(ZS3ehc4HrEL)y|0%U{S zK-|Rhk=cxS=E__+o+Lt6o-MDZLU)Id0{B@`iAh(}qm<^v{qV2RuFFv5+3-vNYHcdP zRVK?XfU57q=@hOQ||NVdMpL8)KDJT1i_g4`F2%P}teF~&ceWr}U{MQW50mPx8ww_&b zo=M$!00XHlOGI61(H%zT)jZj|o9lY8qdk&pAU0~3mp|6A+vI3+OtN2p&J*RmX8SpE zE?q86fNVufcu@u@-_s<^wX?Z~7Kpa4ffezLPD3dwTy`GUOr{ly-hy0zBBMHg)?!42 zE7xnRzC>h7qR@G6uh*_DQ4l)yoTYLu59&z6Ym*R(Q;IwU6 zw}GtcN)JCE7Ap>5j|i)7h`eKEOohVoJoK`_VWQ3F`0o?jfAlZ@8s2;n<*4bjL7O-| zzmm#?xv<*xYiTiH0&4aX<82n7g%!ONU8<*FB0S8o1n?vW&ubNlBKKnQaC&Ud!L*@I-u};@RiqP0j`PwWB{T9H7~z4#Gqo>#EXBr zlHM?2*x*ruYryk1%>Svo|87IEn&E>AzNBM~wrS_LVAW0GSd=BHLxw^_%96dihtUD9 zz*)q-j;Oq1>F#93WKzE7j!Q4KUwU=G-};@u;)<(B9Dur#u$eCsw#juQr(uDFEM!BQ zhfiXDh}2ypu%(zIycPi1#VI%Q2mmhRbskEup!6DoTO(nNxb&Jryd&(=^p+Gql)`!d zi)R*M;)@|jm)L}b5$hkxFeK)d$b$onbxFq}`p}0`vB&%~gd50mWzU^O7(Aw);#JJ? zQC!9a_f>&<38Y7JY=ig1;1i%A4*nZ+e0qt1cqZbXEtu}m!AY@zYCjY;LQp4JzS|r? z76MUVGtI=iPV6Ma0&_NB;h%wkXZ0h&HVk99?&r+K%_y}vpq1?v?6E5lC9GO(;&I++ zm=8-FYO-ESVX-oWwxNAuF^2!(w|*7>)^GjVv_hmzRK$)J>@`hYSuisO&+*ZUktR2r zb4$B&%%K%df-&SoY&&yf!)Iu&hmm=0N1brlcl={|YuPRk0}4liIVT3gm=%`RCW0k* z(#zTiLMIUO1~B6Q;$H&K3nBopr_|JCFbmHkC1U(NbaFd+Ua(*Pq{RH4h`Juia($;0 zsLz*o6VQ1cvLspQuXh*MIwO{|oq?G4Qwl z!IyJP)p4e>j+NS2y!(-sKUQ|<7}DlT< z=k$+-;ekBFq}Z5qOl)5$ngX*DF>^1npMrFV_*(Rx!CC_7>eReAgT3q&6Vw<>S#Pdc z*^6KfavXwrF474H^Xzdi(rK)SS4x1LVpbvjajA%-8F)lwyCTzhFxX}=9ndkbje#)+)=lxS4V-o0WQG&hD;+B^ zsXzjXVajHTU0LP^z!Xglw+6gc#hn4iWZQI77P5=f0~{O^f7>PhAOGFIiofx1{Dyn8 zCBVnn(mi;T>sF|EjEQV=%8@azbk!|mN8u(81Yn(qHu_s&IK%;5sw_@(lfe(#jwKt& z^wopxexZDf&LSJ1%uI~Al{x2H=$y|^-X_4wT!TTDIw2S-Hayqj^>ZBy;z|yH09A+s zkt>sMYP_=&bN-h87X)^4k8Q3GV;hL{*eLc92_=Up$UKJ3)|^VhSmP_Ut0I75BRp{p z!!-RhOx6D$3fmNCRcu3Xwt-D8x$P6&+_#N^vjHE1i^z3L?JY5QTuZi7=3>P^5nvI+ zQ49xBEMmB6hTCqg7D#2EmFMP0-8O;rZ@)}`^S6H!|NDRVui#((_3zDOBwZ%EyvWRj zwzJ){6;2@)Y;jW+iO6;{(~KCh%yb|X0dNpQ6Gdz825?A)An!vGz?(_|t9Ze|Bw$=n zIXV~Zss_u{UZ)GKJm!>l7J>LuHS_E)IhPjzVfV9@e>&Hd{p9)wz$T|yl!NTlE;_GH zPXH$8gvZE()E*aWTDeoHYe-~Hr1@xKzi_*5Mj&`NuM-7@AyRq;@>*k}2E!JRy_sR4 z;RNR(4x8b$ITHCArPOH6aaY;lJUqMxOx8}^=LLd8cZzt21`+Rf3B>a@_T4KHVRC3< zc%7R3Z{Pl68{R#fp-~TE8`2LLd+rYMMkln?cO(gAZ;&oid<^bIOwiDrFiV34x71sNP^;mM0Y7XmdU>KDLDxvpW)hBV zUb*29-mg>HSkGZD3)jE6-g-Ia@_TS&%*Kq`kL7JiEtADA??^2@O5Y!838;lz$-(6f z``_z1s$ySNTDCw8kl>Cgg)(I5bIol??#h4^uPhXWH5)UdQz;VkD8sHJ*1m+UU#VR; z8gPq+Y35T2z$drkq1|2&fHnIz7={h^6Bq+06R5iHU58r@ro1fkz!ZWAApgDrFhp?U zdSKiL@EX8Tyv$f+tA{G^S_~!)p8>E%@Iej33~$L5tKooOe9iy4UwMuH?6-dt`0d}s zdEIb--mnhaO=mX`_@y91ZcVmkvx->a{LR!ufJv0(p+2&6f(pnuC1+f@<3x~&*!kmi)> zfGHL>05(Q2VHQPs#Djgv(hkLgbe!R)z}E)6l~5wWDIAey1F%5xCib8qauCGl8NdN9 z_lp1ro#&`ij26ITggEJO2pfPq0B3QF#Tx+f7^?o;b`TzhR07*naRCri$JY2mf z^FP-1gEvR~_y5jc!(aceeiwh|AH72!d?J7ZP zmlQ>=zh;JmMg$-lR213-V*pKha*7ge!P*4tPz(_qhT;amy&7&rU{EZf`6S-IhhY&x z3(kNAysH9wh_mlECb%_8i`8a86Mt`q;@Aa81Iz@+Kr~_kHN}RAY`h`|@E5uLGe3Ck zKzz73gtj?0x>U(vj8MrP#WR(2N^V8VTq_d!$3uj! zs#0hokS1Q%JNCE15!a16TP?xTCm5PRM|cjZ+x^b~6oO`!#XuKxY;}O(4zBE51UQ=E z&Jfo;lh7i-X9m177ZbXKLty-4O~%$FQ<7Ql(6F(KII_4Apnd+A@c#ZD|Ha?^Kd-q| ze<9m{`geZcJuK5kUJfO_{&t#wp86sl)F?Q51v0LIr!hH#j&uzsm6Qe?zmN4{!{7LC z{@#=0{Ja0pKf?d~dw<}YPWNJocjDr+27w_o^XWER6mf{YR6+?@L`lf}yCSwKQ)VrS zg3Kyn%VC9?HA92j{QhDl1P47t)S!q{ zc`-w};>7h^n~8iBCCd;G793GHhi5>TztZ~@|9^XL6KZR>rG-6XzH6_2&iU?lt*fb0 z(b57HR1iXtRMJdD1Y0(3i1yM6wp1{ZrV^Wp6iHXGIue3lCxoIP2}vPQv=c@ADGR|e zmhtC)_kQQ>z1BO&NMk(DnB!gh+*nn26@18=_nvR>y?)+zzH^SBXZ%hfj{%Rs$$)_Y zw^`3&gNyU+Z{vJ2{PfTLU0im@pZvrB2|m1gzUQ+2yT|=azhBY#>eChf)&KJM@jv~- zzrlH1)SY!*4Api8Rau4nsJb?dP-4i@6i{06jut)O&p{i!&MFAt^a1$tH{yT%U;l6X z(E$G2KmG^tqhEf22k@8wuYZg``P2WWCW6&irTZEr8n_ zi?D?N^jf(dbd6?0MBHe6<+I#&t^Q?g*)MzC^>Y9DPyNi_7-m0dmND$H0q000wwb}r z4(BbprRLw+-s|N$@h@j)5Txf{o0o8Z17Hz&=FFv3hN;hBa(M85M&b&~h(rlw6Ft#n zh-^#lG+`*Vpd-sB(j<8G%yj(mFP<^Mq9+^asW(QmF zP#@loQ73bm8I0L)8<}H3y%h({1|oujFR(FdY$KXULo0=`%Gv?IY{1M(vr+dncE-6l z@DIQHf>#4hme09iA^j_uF|CZmXd7H5$v_ov?Z7(X+wx(kd@BR-61nQi5R19~uGl*l zFC5sf`1Y^=5?_D)g86!7;t}sz$Dp%;OgB-EQmfWJe<<9^XH!+9P>z^VZM<(2f&vTv ztKzU{8A_lyoto}B$NdV-3*cAa^%Z#e2wXk_uU`Xk0p5N1Z}7MO`k(tjJoqae_w@lF zHLe6%z}fLPU$979U0u3^|MOrrAPgr;#=VTDg!uz3l0!0gkDZ?k*lcy~GfOAYuyimA zNQ;e)PZ4X(nCO-{DW`y7klZ6n& zfG^L69|>a>=PK$8H(Zbo+iRo%IoP>Qt)@pUroocL<%p+H7+^09GV$=XR&%Y7(7*uj z{DiN*`!WCCnwpfa0fFqy)KI{oJlWQDgCR+f7%FpbAgc>;e5T$;t@=}F9o}wl-Bb6f zK{G-~$4qwWG6QCd3fyVjKOk)@k}@0&2j)>=AR|N_aKH*d1W}%`vvAa&YyeZB4I>ip zyX_^Y0VEqo+VnzLLU-nALR6Dq%R@>HsE%TW{8F)6WV4bj(vcXTtBBLysa4$oo4_Rk z7k8YQ#rGZt+YEacJ`TrM-4E2I)c>z@M-Opi_Vu0ACZpMt0mlizyUp;yGUO>!$p~dl z#H?3M0t5i}AR?Q(0@;Hx@3ur(UyBQX4+Ho<_wH*;p_+a$GFNF)eX+sf(z1Lu1H*=@ zl^Cd_wMxKvZjP$QN|;EyQ}9&Cv84K1Z-wJ3^Un@%*B>Q-^_hk~K&Ic?UY4-x*W-0e z>kw@}(bk1NhC^y_I|{9QBljD3?g~sIA>#&dLYp9V1XoA8}bJZUEv zX(AUoBH-|q>j9cgr5s{a$_6l7E_wC?i9$@MduW@JfH!1%u|?1cX_#UHGuYVRF<~|` z1Q}^QyqYs2kur@8di1#fhlZjHA_Xatbgic2bvF58s6N49V+FF+-A=e}-3Se02 z*CLMljr&FcC>^Cm=ZHGS+t}^XES-Y;$Roe@IpKTOZST9+k>Up6IRIebG7MW@lp4k0 zSh)qDZy`??)?yC02ey&sK>|wW5%B{f3{R2nyR=9=9bZBzBXDx*zbJEZQkCX&P|QV! zJx?%vK;U)cd4;FxnA36PQcp8XIIiZv2z(46p~ygGzm*nHI4bX-%5bs~j^R2CXE;t6 zpqmlz!|i-onDu_Qk&jzFuY9XMgr8j!j(=SAg z1^N>7cazT9Dcjk2zQ)~ zDNZ)>IPK6fd@p`&`_|pDb_(BD? z{1JwAt$N%BK@NfwOFG|i+}Q`<2dI~hqE*o*c{|~_hGP%latT~#I?=*;Rsv8D`oy&z zSoUm?*mWP{Cd9(3$-J~dGpIK($`RuT&wK^>T=oGBO5i;9E^Xrtx@Jy(N+{6bC~23!=2I4w+@^LuaMwzXr2t19zCm)zZGO7InzNP8#ALNbjCD^Wy-1$TkMv)2t z*x0l)eO$o;Dw<{G#7bc-1uJ&XC`%m9=*V^O+CTH`^{Ar1Jgfy6wqZl?Kw!gg$8Lr* zfYUbcT}z+I>a;7E3#{~5;%zJ9Sp=`vU}I!8*Hm9PY20g*blVaty`oV2br`pQ`$A>C z`mRgS(&+8)!|&~yBW@gn@fjwjhA%;=$U|+y5}My=C!ja=0U!o70u=vFct42_UOn&v z!!-gg?ipLhVW|%Okt-~dc(87>(QCb__L%e#vF;~-6J&2(U4vQ3E z-?l8O`WV@i^xs+t2687Uan$HE_*(ZFN_zr?G870ig=Indf;TYW*SRZ_n6~K;2scLeCk^H^67m&pT%W-c<|=&eONWTkeKXCV`R+qjY!iv6NX{`q03l4aTG5~xK1pfDP!6klZz)-+?yxq45!q;LD6gj)YBnp;Sp7opuZ z3~=9a;3@lwQ>C}pBQwo*WW0YyV3&hz4osI;b$H~_;UcymV;U0q0SUv^9zV5Cmh~D| zR-4g%E7a>-GC}$bP^S|c0GlH2wZy{`FWkyoH3%Nm5<$mingouRk+~0M2Xkf89N7YR z2ggN@OhyAH;jn=POqvgs)kZY3;`+&GCRix{38=Zru<2foOHZu7>Ig>a=0J9j0rvMd-@9Q;VE|8}F&PR?o@yz5d;rUqj8#Zp*!YqW%dA zzv*xA!;L#<0;-JDpc;U*M>F|mM|$yJ-Eei_bq;)r%uu@`iN`~&^4jKdwXW2<5egkk zyXSpU&ZZYU?b7T6kU~9^TUK_efGWj>Eyvi7WSTCc2U(_^yCwmoq@{$uQ90)cO$P=} z8{pWn%`9=A!^$CSo@~4ke*mmwXq0J4vuPs}R>dkv+upJ-BiC9fy3hRXu&Bz%5pke< zuVfhDiQSkE=QeVb)y-$VRiY>Ei$@9)kH9IGAe~4wa~j#D>Ee8V(GY-`ylecPS*Z8x z;mNGkDS0+KnFs<%*io9aEv!CPgNuAf8Mfnx^k+FH`8~%G!5~l_k(F}R0}uLM2?nYk z1J8c&Vwr+lwXI z(9(*HSZYBN^<3kp(;^V#kx`3tZUMgD zfGpV+(^_^N@|l_tSkEoSQNF$$f@&^O!;)g;DBPrd$&6~rZT&kqKG1jniV zwD>twq^3r6Awd&3&b^wD5&=|}VH~e>hjCv4Ag?o$c-+NoftLaJo;K*$d*C(F`S#>q z>98BJ237HP`tVx)A;ofL5*Wb{}J zH7v6h0SZZEC^gJrF?ilWuH8l~AbQ;4xL9T(Dr#_r9{~P96rbf#=B1Yfrtl})_ihiY zt)oN8B!O(uI(>&Z&43sf$eM*O0bDH8m;cSolcMEFPg|N!whq+;l#CJ#R1Jy>h^eG? z1^MLJm&aa{ty%#JgWmne`cG-`wou0J?{j@mkaR5s=QGxO(Vj^^r_l3`JcnT}GoYs& z+hL=A=yB&vz?pG>!5`ZGua*jG_lc_qrcZnXQovDj5>Pe;7nOSmMFn2OKEAK1oA#x`Df_x5@Kx3s9J;wCd+IF z^DGs%2+TnzW;o0<=(Z|h$#6|^TqBiZ9=4haZAutMc1C)ht2Ld$Gjxe$c|%m~gciD> zJS4wUpw0lsT+h-;_TUEt%8wFjh4S89$4k)Pad6-Q=Mnf$0AB-mo%;&)?Xeb;eim$m z{M~4gcefXj$RR6_{O;_uYbg*AM}*PILd;)w&&_KGgb)jT9GJQxj=HX%rMP?fJF+hx z3hqx|*DXisH@GWsHt7sTD^jyuhT$~=Pcv|xj@R9B0q~V=_&%$D3>l(2b!To7q?&Vh zYYM_1LBhGxWRwP5BnH@>{Tpqh4H{{h1VeNKX|pFf8!NS#QeUVf9kV3i$P;$J_aZDA z)(qi+*wP7DY!qAC(h=C;g-#49D9^}L+KVUL-YqK3nRd2NL7>8Z&gcapN}4`NSf9+Y zVM8gb;79FR9WszBaJ0c6Zd=Y1~x+%rt(v-dO|_SI6dAGyic0 z^Z$XbV=Y9$U^9t*!^9J^!Nx>XZB9rZNATd$V6%}W@CP!SH$5}&HZz(4QR^98bVrsO zE1}1X8doA`Gs0q~$eOcrRTNTl%eLgR?WnoK!;rSz0Bn|W0#Xwz24ALzGoRiwY?iII zyck#^@-&yoSOH8z&9#()GZDy+tTcR*_O^V6lLh7+^wgtFeIS|P3WRw9@!fB&054ViriYBz=xVJp%E-gmS@nS+CwufbNU zaf10O0($s{pXqQS2^yS2aqYL6KU6HmtV)L1269Q8Ur4g0}!#|%hJe* zesIVl=+zehl?%`I@YSx%u=3=?)W%C`s?sj2x-V=I;*P-Zz{XgA(s96@O+jE~<|+J$ zx++Qvvuxn zi3=;#GwC;xzbR|^o!4JTB~;KA!0=>}$$9Z3xjqz_;+re?R6=Q&fakin)>bABlueij z`Uw>9VN5ILjYgz7An&*ts(DED^0T!FC8fpSvuS@xZ$Zrl=|RG)a0i*Tm|K#b8z;J` za}gyzb?;lPU=7g(Lzx>8rzJ2pPY8Glz;@unw{XvKR{?N=XWuwy*lGr@yW@(#n8UC6Tt zEV9bezy=$vB9z9rXvi*DQkrL77@1ghIm1T`s{GZAl^6yaGa z<-v#wl8LX#d95;E3OUl2Ql9~^qjhTWvZ zzWg!9FdY(-pD1js)fnV|BYPD@zUS;JVZA%EGOQ2c@hz9?4Pe>A&*FZkk*zA6vmLD8f|d$QVjzcHa%Gu zHGLG5>0vi&+DW@!h~zebM+-A)y8{jSd(#^0E9*L+Q69Q>y(JXDyoKtWpnV_ByWEA7 zmN-y0B?4KE#oz73W#Q36@4v|i!1HhqXZN2A1}<~rC4i3u_>>Lt03aF9R6v_!N3Qv+ z2OVsg%WkwgcP`2^1X~F?StjdPK@yAfup`o^Fo0$Al07qS?zmDwoC%GUv1XtdL1)22 zg@VY2IR-A4Cd9yig|Xdu5}P5zqff{T!p#!G?;*$6gz+S#6N0eWOA|^{BS8N{B9LB$ zW?1jJQj>v0&c8JwB@+h}SkK~OqM5YuvoG^tL6x;|R!~401+dJSRiRH`Lo|eoRInSf zE^}S-NcsIHW9~$UzkC@^O?n1!k=8#M&+CiDEP{Ya`q6P@2$YZD+TZ6wX_XF6JG~c6 zXdGTgd%wM{1eId;+kZWbM-e)}JcUR`AC_=`CwrRZ>jq%E@99+c6#z4}%kGY=10Vg0 zeI|j-7_hmz%sSL)A`aK^7*P0Yx4?<<>yu?X`AW2xTh8+VZNib=dai@@?14(X9hRlJ zCr=EyBdYt2k+`2QvVkdSXdtM`6I?5ubsw3TH#~^e63V7&>S@=?kAXbV$hNc{BSzZI zk>B&Ma-^9n@rYbABU{-+UWLeVp`cC3T*b}h$w+O#HDXPMPXbm;^?*^(1`({H_53*u zd#uh&Q{Dw7$hn-M6sAN~gQzTpf`};kmH+@C07*naR1rXo9c>ehQc(3zb*V%YGv-h5veXliZ*39gg4YNxj!dp5?tU7x`xxxgDc=$J7DdcqO z{IG||+E=yq)1DM(wWDlu^TnRl!+8@Sm3Ky@Uet}ucz$-)=w)8dX*2QllFa>s8Jf4= zbvXCsB<#KQ<uG2-w>6@~$EKhG9(!)znDZR_!Mq z#a0KNsvp|xQJlfDuaPldePfs9yVLKvUL?+qyzD-`BDPS~CcGnJTPW9~B@gq;Wtz=V z;yD^A%`4)@=eT>~iqAF8H@T@Ii|n{9-%~~&$(SGsvi!k8Bg^uG7CV~lE>tMEZ{AV+ zaKpE>O42;L9NnQz!%?Ujyoka*7N#LAtAmkFZ$ z$LLi=ENDpR^0j0{BTlaC(7l-!W>0CXF5Yv6eRn;RL#sJUE}}FR-?ZuVma1Pe8z_cL z4eq4K@8@ACo_T)T@4+HTx*can5ABJNJ}p1?)c}}vJ>0K zh7t=cVyG?HuMa9Ley~__>Ne)aK2#tv#YkJl*CL?e{&p@6gRKJaLjT z6W{nv!A-8BmMh!f&8;nk7ef0u!sGe*`AB~>$ZJ(3jc_7Sy^@Xc+nuk;3rfn{ktr{i z?m8%M-Mg~yuI;{79wB)Oi(-=W)KVe$ISH>x=Ev5Db5)V(q!$}|mak>I)U2ni&KZU8 zv|~N?)`Lk@#~*i{{wz&5N!F=+(EkJwd}qs1--+IaO+3s z629rvwK#H-sswU|KhWN4Bjc8-pPNQ1e(0E=WaSUFk;+>QiFBH^qahGX5{yaw&9-H9a+LHB+xn&~ImC+Cj?QBb;}W z=V8c0mJ8R{&$&2VUEkVRz}H#kn!@;r^J3eR#O@Gt!4oE@N#v?sTtz+g;>|K8E+@ISrP3 z37=M`&rFVzN4D=5-%XcMp1aR$X95}3`lPQF!ljSC9W}KKAp5W<&W}P|dwjZ>M1WL2 ztA>8t8PmDOp_se$?WK1NHhfxQ&;3!GVWgyYWdOy{`efRV>K9P<(`ap#qEETbO9Fo( z{q2WN%_Q_>XjDf@J@$2IA3tNE(q)7Do3E9dYK09c86AArAia3|wZs+a%wm>P6%pb& z)JH@WUTGhpZQI~0ox((O;o0U!YyWw_BH{EiJS{I4Zzgbb#JPVUDP7n8hXLt|Cv^g)O$5S#7jVPy`inpkrAzw-hZCX!PS4tgx(Q%P-5f!x9l2@Ic;=0(g zZC3Q@{Qgh-lyfp1gPnDYb&6<)U)WT)tydlvcl04Ut`{pfxcJ`s_4=0226vUOklp_o z?R$ndo|-F0AtQ7{j%bVe&$`z0n#|;-WM{&IXnf4&cpi|CK-#6=%Yo$D_bL0&(jM5f4m&O++L|4SeIE`HIdVZz=d=E#F}?`Ms`N94~yn>!aK`yW&$7tRueklX}81dA;Nw`Rju00vl8F z6i~lxOhV1$*WYbMQU}!8y!M!yep51~?Q&y#yz+L^x}}$&Ms(h-;B%9ST#bXU;Rthk z1huc~2A#@pM}qH%dPVM`Xt8OMJ$1B?k@w*}mQ7@`S|$rYO2c{cHDLWKtQ@97xaYQ8EcDl2|6Y$HQg`=I~}+qWlk5^TI*Fjan} z-fhV(vTv(CUDo|;(We+ge>K!SN3X(SII|++%IMX-mb|({`xV=^sECw~_LzOR`^e(% zo2)nf_0mJVFXs2+2jQFHHw^GKP51Su@bb-=k+2x?2&GZnUYE_R_hM_QxV`KLAvxEr z<8PN*L%yI+Ybl2E8on8)c{Z^fq4|SR0vunidrw76#}E6&+OGfQZXJ|nw~OP|TzC~9 z$-!2!f`Yq`k&7`k-EwfU zJ8|cY+E$;2O4p-JCVU4S9`~Avi#d7AxL^AaMY=CciRqQW;~$H=UPPP>*dx(g|HavQ zyX!9FM0=x#=iA?(Tld5=+L=2!IEF?1v0DeNPeH)#gzkcc9O0Zvv`q#H&1ck|=2Oj0 zoBf)?__CJ^$%Ox^pos|1TS&`%`uw~qdD+$OS9Oy4q95imG%RRna^uc%yhy(#^?6&UbiE_<;F0o+ zJ%?vgV?N&#YYvH&IaYhel8&sm_R~P*zE2NR?y!*X%!@{6C75$1>|l_3+c8arc#RUB zGhCvDEzWyu>NAb?ZWi7ovZG1brS1lo!;X{T)mwfIcy8F*LN(KV_7_dKK+yBOLs$8) zPm>)uV5G6`l17g7&9l_*esyiasBhk-3b9;q|K(~J^3ATI_1FEYf^HWE8?ug2Syv=X zdlmWJrGmkdet$UTZSA(xpi zRh2lrcc5VM)8qHsIWD83_be9Eq=9d;Xk?GEh+RtCWHtNCMa+3+I;8I7cUchULVR~yj^_cJ>{pE z!^S=p<2eJ#<}eA2zR z#N*!JkhAKgvA`&{VEZ@2fd=85;E#@x!e0moxr)_9AISdX^xASu>f|=oL(A)E2PeG8 zdxQe}7NoqVl?M--c%80NkEYLDD4q^{Rp%xkC!CR5?oP8+;+=Y})t%mxEl2LQj}7T^ z=TKNQ867L_r*yt<1FDGJNX;t}3uy{+7>W z-6$%p5VSe?l05ysr27ec@!UIYKaMM&6%?T@X7#Q5p5;sCSF?F3_hE@#Qu=}K3EU1M zO3D=_HIL<(=%>{T$3mKICwpVxxc8r#vCJ{uX!DLeuYe_NcclrEiT=qTpl&V@WhEWt zx1@GMY~(Q6_$~e~nQZq-9oEI@e({o-U9fA&_Br<9uCrX>4}lJW(ESfsnkZebneKS2 z9>L0@K%T~;n=ZqeMx*(fV%|wla?<{*5_7w|)li)DRSqSSousy8A+I{O^xsZi z%P--59i3*v(RG&WtZ~tL)$X z^_XZUDW&K7!>=l+)$}DQlAZV5+{^GYYOpP>_Gn%rQ$B}BD&@p{%}RR9k0ch)^lcw) zqP%2wvgjzf%zYzn;}E2k18 zG6eXtX)j78WZ}8)*}<&5JsKK|7MlEZQHIF|?^^?GWk=}^3`jRmZaK<9rPV)UP~=Nv zOB&6*{?PY3F}t!SCO171swpdt$Tv~s5IEMhp5(CxZ6}(za;I*`=Um3lk&&YQjom+| zR6b>P`BAjnU2zQ@bBgHya!NHRaLPZ_KeU3UU-Q!hpTnl)h3`e2mzQ}r*;;kPvx*MB z;dt~zg7m~5-pk2_m-?9Jy{0ynq;@j#m7_^o!SJ_5C)Ga}347ODz1w-;d9wp`2$i4U z#^Gfl-gybW8x-kO$7zRmKiPOq+VtZuSGKJr9D}9%c_^(Xv>G4W549XodAj_a@qDlq z`z49xvn>K;6BC~gM>Tp%8mIG|WZAs6cYnoQvOviN5y}}ElUqFxYHH1lBGRp;1%2fE zEY1n!_G|n~DG6R5VHTA3;V8p==+ZakbqD2T_60}FZ#zJF&7!y?>MdEs1|^O4OmE5V zD!aY-T7S5H>y+vTx^E=T%DK5bS3@R!pI;olHOFGw@P2c-TmRgvyJYlS{SvCh+Gn4e zsJ1_fWQzOF(o}QpfRD1Tv7dV2nezpdiXRUQ(Rsm)QF^;R$&X9bVGIotTclj8EZzJ1 zN!I1=@>svAP}`xnw=lh6IB6-f@QFaHo28u)9Z1%R@B_~|Df23}*B2zehyw@%LRKzT;@z^P@P9e3%M*UvyYcG$o^748G9OANgl*(*~XlcQ80j@TEt4_3JQECy8-8L_-59_QIa;yZ14-iMR! znCHyX%E`Ce^St-+x6HLvk5z7xX%fGr5?tZ1cj4xd(`6K$$+9h^MPB#)t#+vMcSIce zMp~r(@or2B2Mx~!G;vPbQ7UXH+$c)t!>h&5=^g{2H8;J^-gi=`DE~z&vHn2i_yfs{ zvPvIl3q8xvS$OJSblHBHw|*suG19cZz^V0&uIr3Xz}+2Zmy7KT+MTwS=m@@TZ@>L6 z>S$jUDd!ob{HNhQKSQduee_B@3kPoKJdD&YDH~y2@UaqhJS2JQ+E2f!-Njrck%N~$ zS63A~&Gde4SN+a4wRkp?#d+1_=zmC_G$T6BApdSVLSM|y1&l>Ez6_ixeZy{joYi0U!cHHdai7L}FFxckr%zTL zw1q#%T-12U{lR(f@X1RHzl1s7@75jJVAd2BWSC~S&tvn;mtGt9_o+2Z@+K4GPOU4ET64(rK3j;5g4{ha^R$8;u^K1(`rXAUoa>(GJlL;tbB~sRy^i7D zd7HkQlOKj}5BcsQ4YKimzfDrfYqvmZWBcaFyBi!Eh2mA6b2n_Jr{lWv^fB)ne$g%k zv7EPaogrNH=eYb>rym-f=nk*Q3%Dd?QNyUYb-!Gp-wkcofaq{5hi^~5h8cAkN(eAa zj<=~!Ho0t7Bfl|VD*qOZyQ9;GE5l6#LV6>=8JOj^UF4rWRU`W{XFZeNtplD{kM1f} zm8S?XA?Z1MBK`FFv1`6^l&)#12R}@Ev{Tjo4FB|H%N{BwgU}5ZBul9*3>haB^tjI^^edy|44h) z*?+0>aW#wFbt^8)&op0|$3tZ_;_lpR;9>XW7;|AAXYNrvL3Li_?31axUwy81XiNB7 zUo-xuD4zDM^OYt|n5F zZd1&DKaMZY=ADkHp4{{Hwc(TDFON85zP}j=iK{dnFQjfd?O(gqwEx6yk*BYnoM^{r zq9X6@s5vGeZf^CA^;M)2-{Y=b=MJ!5D3cUVlU3-isn*Zxy}2$q%U+V?2ycM;h-`(c zaDw(j(K4gtO;LAzr{BHg2{NWRT`|AuqifuKnRz8`zn4PP4^`R>7tg5%WyJU~(BISX zxkLFfZ(i2@LcR96t>5)1rUfl&H3qF~3e@jB_2E~Y5uN4y^lASsQmR|NR*Q_=t+obf z@&sm9e|F2K3Duz7uQ+V&wQ$EQXN8km;ZBmy=a%Hw*ZfN7dapiBu(-9}CO_#=7rVs} zgNjq&R)56wdNbo}ELY+(7PWR6C9U>w`d;p#pwy@`F``R)$TRK9_EFW{W%8F}b9mnH zJ|-XjJlRp{X~LtfediFb6u-yW#Lzl+3zh9g2llwMZ+t@`z%;;YXi}}{FhSb>M0iij z`uKXgPxk$@Z#)Kcwxk)+n&*!$)w%Z0v74GZY_c`h3ubg0s3#9>$XmZr~dSYm`)`YoLc}E0?GDRhKrD$x|44vs_bKgpq>m7=x zeCsr`AE=ko$y0B3@|mE{Cl4{v`OK{39LmUbU<*&uH~$GSsZsc|xW`13`i0t1!mC;_ zDHO!Xy29S~=*cUK-A3ilQ!QRyA15HMS)o~A7NMMz$NI5r&)mBS>ZaOX z$?zvczO9=`+S2Hn<)!nv-S%fUt+R}ymolHDxE=p3TU%R7mT|oS`v>xGzV=?t(xxqa zr+AQFeO<_}IGHy2*9wzjdNw*CXM1%J_v3rpFScKs4LZxb?+v?Lyq4R=E!-#hn&ZB< z(mk2Fd~SjI>&Zzf`1a_Ee(h6MeO>>m!H$uGpjRbtJ7Ms@O!(q|{g6H%ZbX z8k{Llc-vp&k-0OE6Pnv9-?$zWARYRA_iUF`34f(gpoc1zcubb}v_XIQQh0^`eW%MZ zF}?vtKPXI>HuY>$$ZXWGwDjMmzPaGbx8AFv>fa-bi;p-=T=M08e{SHZA&bJnBDy06 zXDo$2u+?=WMvFhGc-Y(U+H2p3c3YoR#iwIV60@zpII1>=i&aJIJUmw<+U_eLRr#ZG z>}B_S)z|B}66OU%Jsn&5lbfwPUM6x|IJnZt5B9|@nY_x&(5@`zdOvIW(*5=?CD%=i zOzk%qNG4X!O`e%-1o?j|w!dHL;eSi*+@)V<7Eu2($@>0GT}`|C>x){BE`D*>6^FKp zZ;WeGbQOAy;?hSmtu?tHp{?x4vegSr+UoDxIpoh3>%Ch}eVusL(3rJ!!^5p&9FRdGy$kOr`e&flM2B zvdBgBiR5?%R@nF6w+Z?xeAvJJq91*&nq0Z^Q?f-hVMeQ9-Qm6N^2cvg41`@dkkEl1u7!>W;&SdI&v?BJE(Wab+ z=x@!HvC*EfgU?JyX~=v|P2C)5&G(s7n{(oy{K6!ce)2~sU8i+ZIl0;kf00*CM@K5S zlDccg-A#B;E1xwsbx|93aj-k_>VU{?p33KbectB%h4W7y*jZ7_XWp}=Je+*L>g!UC zOyNV(`S(>y@k%rbObLhkKJah6_xSrYPvx*7E!9}jrS-O)y!qkV97`!h_iXc$P0(n1 zVJXaLA^$9G?xI@g%N&U`mVUHV`SyFA{f$ZH2SW@84JsE*-J2wKGeV`^VpZQ{3kIOFQ7r<&^u!QKPfbqhOoHW51~D)cXQ+ zlVtaiKKn6L|FAvS=h_s1;#KDH#d)^Ra@Dh~)768M&+Yh>(w)Oce}-FzD}22oEqnC^ z6R*`zlVcKR=hOCBpJQ(tol%dKFyZ2i^*VpuY?J1iGUHo;u`!)G2I{JzgvE6(>l3NV;WMA8<}bHpWjU`SsUW{1LZT)5 z^dY91;dE}y$_@Ma^kwannUS_p)ozBiAPd<5zBnN=5^?44&SMmEqR*#>**A!M=;@yy zquythTNHY8bjet}B68aS0aFV5(ph6o2d4AaKmKg_X!B+MWxrUg7}cjPil*V1vnrEE z4gD5I9=!SdifrS-54z;X3@WRQZ%e-*kM;f*v#IXb#5n1Nl3m9m{T7zbX2|AFjj9K$ z+>~&*p;h<(oA!=hHHU_an=rSVfrR6tWnI)Eeznn!%AQAKzA-LOo85S|aptF9z`B5s z3`-pEl-|8I^z~MF-h3k9-I5EwWALPLju|xyxJnhhk~NulRkk^glM9_r(8zjwi3V%V?U3VEXK5 zIfce?(l1qt8{Wm9q;-F!nWiG>7pL*lOUq_id3c=M;QhT(S@J9;266Sk7LHIBHa&MO zqawQpm)q_O%PJ~dxo}-!Ipy{%dx@I3rKD_r=11v?Z7FkG(r)IC+K;{solkRGjF~p! zf9k%X`eAhC4c^d3`Mip>efZb;)}^6^6H80k?JkRc#XVw@*S=I!-d^B+WN-B00SV17 zJD0Y>lP#@7x>Xvkci1zV(jTenmNOYGUOV!HRaCE`{ov4Rr+v|zE52`d;I;7^>t`;K zx9Kb0x0)+|9A?x}J83%=YdWqTf&5HU0LBfYObJ)ejw| z7us_5v0+>Q%>+Bw?g8e}TG@@IHgEa|D5SQ$R6F-E{=?G=%-Xu7T>axtTa*vO;<+DfCmdWbtZ#sVbqx-l&{?X^M^7$jz@>5m!<-T~5Wb-+G6g{Ru*=_il zOX2FIzU=t4$G#ux@rO3~{`mUf>y44N2h!GE^OvojNC$quyYX!H4|xaAgP5dmcRjY= zCYQ2~mimJa%SpGR3DdCu(H$g#ASv|IMxFk7#p+!FseP22SWr``sx%|Z0u!jD~S-<5620}bXH zeU_dr{TMcg4_IMn^}F^_@%gc~ck5LHEXYE~WUiJwI+XQuhl)btZCmr@(cQtMK8CuPSwe! zD&=My(W&Br-7{8GZd!w;W8OJo98vd>3d))M2_A-%BfR zxXu1XyMi%GgI`ME{rRN`>LrJzw*lWxJ}9mn?C!^OOGjgG@CB;q7t<}OoFVmp^GZ8l zB0wVGMK}D8kd1BcIo`Mac);3sUxSW<{OMbs^A@aCPdXg(EY~kP8J}!-9PS-WS?8O+dT91Ce@=4Hr^RKtYu3UVHY!~TQ{s!v zy4oWxRQIADhwbB#W*IF@H?Y0mutTf3L4t#obwTms=E#0~iOOS7821`!nQ0&OJ^K9M z5pDx>$}6*@=YLTdJ-3^FIez>E{lnIIrHte>db6EMo{Q1Xb2&}vH6$cO>sMaU$Yln7 z+(W|sR9hh1?ZGS^TkTRG%cff(k&xIfR>tTURO}WK47qmld zL!*3T-Og^x@wyQ@T1f{7EN1n#Fx(w57Z8^(w`CO0;n=(J&S7Ca#!V&FCy!`cdee4E zk>-5DKyrUfJxS`a+z;`fL%Xdq)Y{9IFHa?GO%`#gn#|kwon7ydRIo+&Vd1j}9_uum zk+>8d*Y(z;)^y9G5C*SBk54WJd5$LsHQ1V1gTHKO_xya^r)Jsv&d!yVHdmjp?(;GK zSO5L^?!Of9QT$=5ml^9<1c#2M{+=ogi(ny$ivuhGB#0aS|KH>P1r3OBQv8plDarkJ zYV_+V;U*(GrbbSCP?1#1M44RKM43$4M2STCup+7QVFe=m4Y+2aN~3I|!KQ4g!2;N# zY@)tV*;H-4vWW`0@?m92FHfR;NC7Dyg78mX6XLoGlu6)E`4B%0|NF*zjcxffCWT>^x(q$rr2bjk0WKSYAP4k3Kr7-28K`GXMt z#_Bb==Y518dmrb+KIS~w$BY|$A7jVfM;Wm9VbZm{hLF!-4PHiT<#-eMOi0%N>AVla za}L8jxbC5ku&pY>mWmLnAbeH};nRB%KDB!-JOgo$y(q(315w}g|MybZ?W5EVHYdZu zW+bZ!Jce-KQG^4IKu7@M1cJ>-aq!8_IK+B8Kp3zM2V3#LH5MFfPL6|!e5MHd1Ft|6 zw0gdp=Qs@xwpfpYkJI9y<5Un*td(_)1p7f+f-msHE)aU^AnbbpVIMt^Zy(4F@Y6*& z!(!Df{aXQ|tx0vGEJ<;cB?*o?NrEE*5f+&JA+7-yUl#Tn-%akjq#&JNVT zIidPEC*%Om4p74xUg9|2ofohXuo-8#ap4Sieu(oyega$&--6RU0PY)pgC1W2UByEC zB6LmYJ@7XO?y;cv7_gxLXy0d{Ek_ytoqs{Fif*2-2+sAO#JTRIIQKjQfEDL@@#9<{ z5uE2MhV%WTaeja-E(lY@MPYkzQTTpb9A$(HL-)XSX`JUJ2_Z)687oVCg|bnXhmEV%m&~D2;s`m9k?o799M_S zj-wNMsZ8$^z;1ybQ_AdHjD*d^C!oZ9tc+g{}M;=>EL6p04{;gy$B$}6p)9o z{V1@V2(X;1hgk5L7obf9gB_g&{ToR9oqrqf z??~H+Z)F_B?N@f=mRL5xMtn1l9k;~s;Fg4)_-2AA?#MBL_nwRR&#|(+g#Rs8;Q9)r zTUo)kQ`qs1aD;D$Abi~);d)Qdy#vB|=R{VEX^PXr8NfT!66ynx2K7PIMIzWyJhTOZ zzZuxSj@aM%cjq3`?an`n@8+B1u51I`5zm6#A`xznB*7gQC~!wCJ#N21j_+h^;9oyJ zEPII0xLk0lo;g27t_< z=gw$^Z$%;80leFP=WX#@OW)|W#=k6R*DC)uXm`0bU{3@L^#Z%&2z`Gsly&Y_~`?4z7&k`QW-iL2O zJG=qh2{~FouWfL@12}eo44uHcGXi7?1wj4|&_M^t*8=i30RIYTyOqIf{BK>-#l`l} z7T{VT)Jv}Ink?zS{{r|SVjQ|h1Yu?Vzw>`oWv4q-Wsf1mgXJgigY@mVH=Q5%rt#r> zNwoMj!3nr_r>ybs&)Sc#pGCL{WVjBv2{N?9{Z5eMHt@U?2!MLH1Nn&fZIB;+88mK& zbaiKd`+wkn=dv!Ya6-5YPzu*eK$b%2*Djl_^~t7SJ8FUmEAsrE|HxHG-H~ffc;wnC zJXB_i`!WS^UltF9{19^Ed$Hte+B9HI1x6~4!Z3C{&#>sA;T@G4?^GV zaP3c=khj_exDxzB*7V<%ri&|`*L+er_@z>a=YS0neSniX!Z3%yssaeB@co_t<2nc3 z$F)xQajiWbEL6h-**w3&j~`|O(l@Q@@b(}6*}xy#A;JAmJ7@#_5IUwYOkPAP`<-tR_Tk-u1pxgh*AD(#wbW7--XveL*|36)4uRB?5i$_aT@d$7o&Sl5Lc@P3d^7!y*{x&?A%7E`)R#|PotM&uW zyGi&R0KuIA(S~mU{~I6=!Iv0Y5_1t^enNy%pw|@e?b#qxS>PJ~JJ4^I5$zUih8Q~# z>CS4xd<<;IN(sh3atI&UwTi#aU#6;$>5dgE;n7?Uz*Ybkehhja&Ede0^LX&%e2^h$ zEBN;{{tt7Y{esR2z5nq&g#8dciojLSJuxmL<|TyxZ~+jU2wzC}^S}cjhua$eib&nH zai$TB_2J%m$OH4;)%2$|5VipsPAaU{$6xu673|U-1KwjiZdLZh;AL^>nmlQv|ME6(ykLR;0PvkNH ze;NQ89?zx(88+dG97a5zy8(|8$k`12ni^gL{x{wngZhKmZ^M#zl{_K#wK-z@P8${EN6$#`8AtfYyYyG-9^zE+T9|u#J;aQ^aEFs{& z6R-cwZ6>yn{i8B&ge=R2C>t z6i*gQ0Dt+v^DpF9napRwlR0#FB5O_G1pieTAbgatrjtOsHU3_%MCVL1-yUqJuu zQH;PHbY8q2kC(u&IxSZP?7>r&`|wm1pxOZRd|(w*)kb)-*&ToX{2H$;{ls&fK6n!R zMJJ4v;*UWc9EQ4twp0jx-B_*|o-C4ra+UFLfy!U`PZn~jOy&WH92z_Ux*iAo;XfD$ z;}P%~M1L4;ufA%tUbcEzmL0}~ywJbek>i;X0Xzk|A1YGA-#@*?%RfJ^V(I56{0GYr zC$RJr<`3WlR*#isJb%XzPnH3{OBA@k9{M=w!-%B4 z8&s!qsenIP)&E5HnhX!Y=5wH4iT=}C3HoydDtsy24#py+Se1YEodE7np~F*UBEWw; z9xIiA4c`8EVc;TOcz6Xb45s6Sp-e#5zs1{!DNrZ-p`M_9=X2v0pSAfTF%NF?0^5f+ zG*zMucBhUpljBL?P3V8@3XH*m*7_k&;C>3)>PdNo4@njrl&XN7DyzC)JqMkyUaKJNY&YCf!~+Qw zxDe`^7&kS0gZ_(T;X2qN$TwP|@mK!isU%9{si1SOgPR-s{~+R^JPi!#5jyt&mr3FNw9rl9%n-E2mKoob?{pTVr)5;zXfa@+9~*G!kgy6|~9Wi|b(i z@%Qmt)mbE(1-`@|^zR0CL--u0-~5SjFk$od6Ym79Dz@X63C$l z`~XC}2-@zdFCuIR{1UW<8WfV`JdH3PK*J1HxAk?=;7DsjX#XjyJ3xh?uN%dC1{I5s5y`tJ$lx9Vbgg;GU@CRMAeymJljO_r1vRs0=(y896$tBS)wQN0kuVn8<7w6@tD3!8;0cNS+!Ulcz=C zE0KjfJu+26$Wnm`*{F~qcxQ+Xt1%)NyP(tRw8%kYJ%X_SItPF`6oR!>;yCNI?e@qGZ2DzsVEb|V9PBi&5{wt z*se$E4hX@!YIM;Np*LN#Q^iV|EUZUuRFDq&YL#QK!3|$S}f=d0i zp*$aP)E%-8!MYH-2dD@TMm3@A=!%a9YKx>p*?!9C7W9RsAtIljb;Tp}AOUn4un*No@uNoxRH!gyH!2R7M{RLiP*tP^x)~*chLaJxa}lBX$X%#9 zQVr#Y>!b2$75Lg2p|VIF)EqB{;Jp+Y$UvwrP99whw?p^RHX!JC(ePzR@ni5q| zLyRH1nxKUS(%8_=xcz7gr;-p&{#e-x{<7hdeg*Fe>OMj&e(}M zFKMHuOL}N9cN^-+P(tmg+URbE8XC*pj;4xPP*1uZnknHxT{-ILL5?OG%-)NhlyRZ1 zY<<+5Wr#-dRS=Aw(8EF{G*%*sW{P*A+j&ROWVs9)FWG~pD&){ir2?8R*FjIJmC(Hs z3)EZUgeGhDqv6WqsIS5rO;wwsiCP;pT7L>nHM^ntc3U*s5`*S%`=Mu@G3dozKlFYe z0lj~iiWY`)(XWrM(9iE5(ekga=;!hx!Ye-!tN^e2gEfEgKkI)M%z`(;4-s;}4-001 zA0obXhZ57{_5YFb&Yk;Zb`pn@fu6yBB_*YuLPBsRBLn|rwsSGFu@eXPpDY?08ZuHc zQoA(tk9l~UFgU28F11TaT|?=ho|2x7x)c{X_qLs)e1d|1(ras|sUOfdpnpjJgrkR} z<1uYDHFY(OLx(I59nwB@K%S4Ak5^DsLS${h95Nj^aOl9HLx&DnSU6tr2={PuBu?SP z(Zb^R0c}|!ZaxVK30YY=;teNp95%HuH8nkD zQHW1SL`+0vo6uTnj8EIxn4SuB4-Y?Gl2%ht6CQZl-Nrr8E6~Q~^y%ZKieeIiBGS^* zf;^JHGbDw$hqxt1M<->}6xY-gXNI`N#KfdU#{@=4yV)L=7LyQz;$=ntrJq{2kkHKN z%*@Q{+S;2}ucl=rUdqe}&CIwQ8ftseXt$iSoScZDAm4^Rb#SxnG8|P^)ooYXZkA6oSdA((z>Thu+4$^SzcLQu8c^D@HYur?l3ks-mR%1DY%*XH=(Dm#!J&v z)6>)YfBkyjLmbo7)A!ROBK=*=a#wB}Y8e_Et4Isc|Kb1k)tlbb`1q9gfu%3r-Y(w0 zk@4v%DJk)h-Y$ljE4{`hI$D}43W5~mzcajg^>&~qFFwq>cj@stXBThpu&}I@`1sf` zZ=(EOLu*4L6CG*xKgsc{w{Lo`U(XKF@I2y<6zHckf<)RL9~3q<1+V6?D!UvUz)3n?ZUjYwIJ1Vr=XGRsQ?;qkZ@8^)v+C zSsHK#{^ua2v!%0(m6e@c)yiXQYil##K>*~Z4m_(z@i-SptS?!Lb6_B)F`R*>2|%-h>gb_cJJtfnsTG1QS3 z;bv#vz{vQ!{F&~-?x}{s&hE*@38Hjw@AFnF+qk*8`2*J2`G{ zfDDtJQ-h;R11>I*#!wu6*y}E{$ z)|Q5H?94m%9I>)Cln!4hfaHSPgtm#s{wcq+x%pQ2t*(Z_-o*}8Rn^_H++3QmS+{O= zH{VF^Sge&0g49Cd)}7tIGj!f+Zmw@{u5Z4xSS_t7!OJR=+B`h-?AgN1!tluAU0DeU zF+tIz^)r9U@4j`bxxT)>Av<%WfSsM5QnX=sX7c&$?6ZYuGjCU3TggfYiHgO~4EO!c z@H>6I^_dkvQc7~}`r)bP&t~W5W+BU`m5)V+@C3~p!^3~d?^-RszCy%f=?o%aOn){r zGxlU|{`JDb+=pL_pS!{|r6lYJr=Cy#&H(9we6|U@>(Ut#QuC?d>7T#gScHGjem>9K zFp-t^pPG99ukyQqezqYm8*>vS8D0LfshKa|zW?}hyk6+`*HrPJntL|$I|I?AECB)6e&I~3SGni`vfqzkVX=H}*~ zd+Rt)F8r%}F(E!~ZZ0n74YbtMRQAKqAo(ynVe0v7(CX~$>xE(Gy=Lt|?l&QMA#Qed zF7^$KwDeTe_G7EbC&!)urDsqBv#;lFn5gI^5C5O?1^K{UnKw|;!vl^yA;_#!dIA#6 zf*AApI*N*h6~lk@F9hbz#>~t}q^H;Hnj!=xa*V-$bI%uEKl7Cpl2f$K|Dzuh33e`S zpuB-C|ik zH4Eg2pU;4z;J>NaNNzT6J~2&|Kjk+!H^*xNf4cSb^z`ew{hOztbl|djOm&~-W@cyK zCa{U-y)%@8G;GvTu308;?M9%lf&fPeKZ5dR-|{BxfA6*}-kFb@7fjFK1-`ta{U zs{eBRf6xE3oj?=;S9>M^A z9C&go4l<`+OJfZ8O85PHG8X<{Fb7rbAE zIse)J%He`FN!kS~Qhb5iDOQ~_ZyDFIND|dj|R2~ftFo`N{TV>6`T!Wo_d5Z?yh9dJX)f-^lf!gU6G z8P;&Z;CY1H1c>Jo`>Tn)?dP@r`TX*zeQ8Dh+_=b_78m<*;39uvTpTEYOM>NbX`~v4 z`>+RpKQ0Yd!^HtRaj`E4E?!L|3hBgfQNRvd1bg?3eVK3`tgofRng+2Kn%IvR2_U`= zAoM`2alo3^KlERlxG$|1_QqF-a^UI^LD&l~hHD~Z@HN;wUkiKZYhmyF)hIdGzr%y8 z!$fgSxCGpnguV3A_$r_#LJHS}aNsg`*voku)^foNWs2wdEA_+if<(E!L1inU_Uk=?9bk^x=*_`Q5d(T z$m6z4%J}+)ZMZR<3D^6<9yVB$AlA<^Z75gw5MBWu#M&_Ny+kzB0kK8{@8A9*e@EKh zw9ZUp+QOWDXQH(Bak`w1XD6m!u8m`Y$E-lXSzZTRn$%a(%3~{d~1v&&TcN#2U&kBCN&p zC(Ysy_{j!+$f1{In|Ri+KJOZK87{&o9VU&?yN z7R@PZHd(vQnhmyV);_WRG(XH*{ONJCDCE9hqR(f(jyYB4g#X_7*T|=)tD*J#I*T== z&|X59$r{pIdridmcfS^w6EPNEwVmr_%`R&%7~`08=2#=vUb2og-p^V*{i#_*!q!<2 z*P^TBn8?MWC9bbc|7#B0@2kx)f!?qOw3B_1SVIXd>wXjQ!#%Y)8Qo9h2kHBp#~Al1 z>od7c9K!|Qvfvm5=53P$ti_Xu%@UW`qVMEu2*v&9-$$!I`a@hRbF_8G`a`p4DbB^cDb>$d z&ze9<--voyC-~LYPSA(gwyD4N*xNg_&;e?|#j^HK(*I=`2##O4-&8A71N%vFc6g7F zxaG=S<`SP;2hB$vv_5r`Mh;pzXdY^EJ;lqX_e3FVKNhyZ&pfU>8`rDNbr70k{o2%D zceD@chmMSOl>5*JNLuv87F_=~cWQ<26qy)phj^3$Br0}7+bFe{+st}BXiT6NsfX5( z^#HZSq2lGw-{Blxr1%i#b6KZwIRV!UE*|>CHuY? zuzx&vS!1o<-xu|}q5d&#>aWl2yi*GeCTq~@P>)CNgWyteZ*9^4e6Pl}sb71* za0l0WGesZE!5S=Z%F=k90sb9vG-5sM_f8&kVv=Tz^$pMnKwl#1N}z>doz<^3N)3vU z;vB~6fd#OsL*U}^J8jd1ipV z8p&g&P5Yq*`h>BHwG@n%tVdv-25UE1JHxsk9zzYetR-Qs3G^4x%V;I-80$397cJL- zHtL{TWvx$xVw4mo#W4W8aSv*?cZ3bNwW&XS5q-+ovm?lse5o zX9jCmSPR9mB06ZKCEX3%p49)WRYAY7h6|ddmTS<#Ms@&~m!mIP zSH&7*)&`|5pilnx?Vq(Aq3+fO;F3P8KScQzNuU0X?gtJeCx= z=L%>vu^*w(<~ZQ99g?j=o9l?<0r-B9VvoQ6981UO&j%aJ$1`#p*Zpfv#=ldG!Mck7 zD_e`xs1&LJB*TAGGHR*!Kl&*;{bsiS`w7}#8fD*s+-2a?WpB{L{_P0yku+ss2l`;J zo>QOcL=u^btgO{~|wd>Cnbe!0!xb#aN=Cap26|i7@5~b5#l)Z$g-# zQSfAZH{P7qPd1>C$%Yg$g=hsh^wmg+v7oT2Mzm=PxNA=$%&REatE0rJ`%dadh+(EU zB<9v5rkN7vUbJo|fm_$}>YHa7P}0nftvq_Lw+$ioiXwk+M2T~WmV3(xv8=RtZWoDD zkAb})K3C$>qvx5@?)mK`K7HQ;aN6_RQ<5Lic3(q^TS&CW*N74p84$)fW%!!Vz5sB) zNYM-5r1XWR6z6A6xj0T*Y(#s(t>gWWc7aFVzSxwKmm1Tj0lg@DxgjM5*wCko9I0S= zCy7%>>=?;c7)xCG(IAsnK7G%MUX;1Ygmwm5Q(llc9b6AieoYsNS1*E>fw}eE)!nIJ zRS(J!1&0+4RGQM03gX6)JYh5yZ+%zd+G}>1)A8gHq)G$FpD^&;lHc8^w)tTVp(|bw$`i0ct5~qG9)g64g4b>erC-or*x|t=T z(`nPepZB2JtO3-J`xaf!@T5k0Uuw#;2S+}P?&OT1I{7fFIqC_nd_*f(e(k6aspRew zXI?L#L|~^I4=VoI~|RACc+=cy#3wx>M{+S_FvRI}=Rz&o8FC zU#_9M7b57Xu7sX7D(R=jQ}n2@l)kxBN8f*=p&#zuq92=Y6W;IW*>|_-$q#k(=;3$Z z)xV{e&+gGL&wlz>^67m=U---�Vt*%zrIFhj-Is(GYj{(W6I?nLmH}^l@&^Zf@?N zsK&fy*~iiDm6Lta`&005*5*wsKXjku{l4$44`)r1S;-t-27B-s=I|EmyE!#ADcIN7 zciBp$IkJAT!Lq^n3KlQ+-H@Do@Z`yZ$?I2ucwDhQ&_^b79PBFV#XmT`D||=BzJq@_ zeX<~9M@B~0u3h0vy-m(-%({A2@LMz~L_r99R?J`JSum-~s(Q zbN=<~d54QGp8e{p6FE8fn~7B>iTQ0lL! z@5tqwnwpMm-yQ#~IVdP9K5chee8}phFFfaYc}=j=Gn`G@bA>UHKOYT>ii_F4ckA}Z zpfxXM&Ytb*Y9bM)&COq*t2p-Y)BLEQjnUCjDbXRzBVNu9m^Y(e2R^+J-(EYXsfhgf zNK|N4baa59zkg7|iv>}$ow^%I^?!T!+O|rDkgS@i)^yznwNf_E>_*l^zARJ zuB^UR^7KelN=!=7a4RbtnfLQ|hT8S9>eii4Uw*#qYWdZYpVR$T`_CR^?&LAU%lo;F z<4`-hSAv7Gva4lfieI*kA3wO~qElB@s?ziqGUq`~PMK;huP!}bq9}`hvP9Oc+o`M7 zn%dg>yD$BQyErbYy2|;YthA)GY~Yjr1|5!Fy{b{`8g&m|p7(TiIOo(|!U^-e^y=~sPi_y>TYRnX40i+sphsurO~L=n#RVIbtupCsDO9&rqN?hKsPZxs)-LZ!+5eh959IQ~QoO6& z(Z8#-><#}Xj_-PSOlrAm2l`t+r9F=R{s#XJVeUZi^U;cF-Dn%0=ZT9<2=SYEt{Kvq zXhS?x2GH&OhJ-aINS8a5v?l}U@q;?)ge~>`=Ke|R_UO?g{L010W#-PE-eA>cSo8(b zJoA}3b0?1G`gmK|1DJef`=q9&`uL>!%(8Vy{-5TiVZ&Ex-nRCj5c#OMn7<0}a0gPn z&>t43#p;hwpW3(YbWYysy|DoS9w`5!Sbh%F(~t4X?gs>bnml_dK2p6QF+MKz{t^!y z|M_Z8WL(&W__$^Fmtfv2>Q9&B7~6*XOZ-idU!jQ14hstnTh<)f2l?8{%58CRVFC8b zngh&H{&|JGATBI)oW+Euaed8&s8CcE#D@7>ESb;;ako-b<}}$4OGZA9 zXP7G#mD**6_wW>_)o@hg*>}AeWb%B|FC6h73aqolHwYZ$H%53Umn|+ z3@fo|wO0bc9RKWYPVI4ct+KK_5c#&|`eS^dUW)QhZKdN1{G!Z5A%wrV85t-l6)2Kr zKN;uuH#0L>iKEKOakdk2Txf1eHkDPCRhMimKlsht`shRg^s@J?v)tJLo z2SfH3Hkt6|r{Az{*Xlsp8VGcj;b@?lY z=cz94d`Fy5Fc!CpR*CzS`-S@Wa#2?tC~oC@iZk%3%Y%)?^@4E8htEC?zfrHt-zp4L zUC(qAKTQ_1&~AJJ84 zkM@V}#7*4Ha1>W^)`%$hUN|;cd$f0Jd2Lp=YL0p37{>hFYsL5hW+FG-Onh_NS2SPR zB)%=%EFRoEB7Uk)6!5QzJopZ^Ic}}x8!`=VRKefI{M@{e9fc=+TullG_^if?Mx~Ev zIyp}?70neo#EOQ?Ks}9 zCcVG-d~FBz3AL90WF}Q`%nSRu;NuVruy4xa*emv{uulj6tz7t-;72No>Mq4;Ur8`- zwck5g21$jX)PPtQ9sE?f8P23rh8yV+52ZtSBnKVhV|6wAWIFihb?|{VfR9UL`&Fg4 zYcb=0cn=>6fE)8ugMTh@S$>|r#+gpPc@4NHg!@XcJ3{*i{Y>a9LVF4QMHml+{v+H! zLO&4h1>rsrY?aVvf*lh2m@sY$_(8Z|n9pPWjs#2~U<;vNpnXSMFkc7uNb`2s8v%m| z*hIi6!o4D3009FC@$v*)B#dVQZV@nwfK>!rCtwZ1E(rZhz%psxj&VyE{{$Q$aB&1% zB=CX+>>^+uVXP5spMYlsEFkbL>@^hX)&BZ$ucI1e+pY z9>ER>_DxvZhJa}V9Kha$z!zcui}Qq=5yll^Y!mQ-fN_NJO28Ppgaqs$tZhiZJOVBf zY@L9M1WX{<9sv&tct*fS0$yS6YfQj80&Ws8kT8x2V}yW3(0~siU?TQT1WYC1B4LaY zu#PZZ30O%O_k?jz7=r{mCSUM8H?V_{ZF}H|;L^$qC6B$%QbE3F8QR=*M$MV7`mI+))I~C5%e~wh(X$x^QU2^YI>5FqSY* z3Ajrb?*z;t;41+K2-r%%Py!AU@R@)K1Z*JSCjmDJ_(;HS0`3s7n}B5mJcMq169I#u z7f&Q$I{}O6|F?gv2b68LzI_~A2ft<0-_gpr+nY+|s1fgtpEu>b-?@()(8CTto4%OTJ+NZIUZrxNrEz!I0S;JRY`(ND0*y%Ca z0p0x?XMcO%@*#Yq8-RmY!-Zn~P3ibL_{cU`(Eber=*ukzbSlY?3X|MPd&Hj39114g z7azdZ*V3I!(&GfrgIC*7=b_H#1~yNehc9w=vcPmCZSfLs3;fr9d*k&t*_~G>@9kk Date: Mon, 10 Apr 2017 23:19:43 -0400 Subject: [PATCH 632/656] Update Node package *request* to latest version --- .../active-x-obfuscator/..gitignore.un~ | Bin 0 -> 1811 bytes .../active-x-obfuscator/.Readme.md.un~ | Bin 0 -> 1508 bytes .../active-x-obfuscator/.index.js.un~ | Bin 0 -> 220177 bytes .../active-x-obfuscator/.npmignore | 2 + .../active-x-obfuscator/.package.json.un~ | Bin 0 -> 1015 bytes .../active-x-obfuscator/.test.js.un~ | Bin 0 -> 76173 bytes .../active-x-obfuscator/Readme.md | 33 + .../node_modules/active-x-obfuscator/index.js | 83 + .../active-x-obfuscator/package.json | 78 + .../node_modules/active-x-obfuscator/test.js | 53 + .../core/node_modules/ajv/.tonic_example.js | 20 + deploy/core/node_modules/ajv/LICENSE | 22 + deploy/core/node_modules/ajv/README.md | 1211 + .../core/node_modules/ajv/dist/ajv.bundle.js | 8023 ++ deploy/core/node_modules/ajv/dist/ajv.min.js | 6 + .../core/node_modules/ajv/dist/ajv.min.js.map | 1 + .../core/node_modules/ajv/dist/nodent.min.js | 8 + .../node_modules/ajv/dist/regenerator.min.js | 32 + deploy/core/node_modules/ajv/lib/ajv.d.ts | 284 + deploy/core/node_modules/ajv/lib/ajv.js | 420 + deploy/core/node_modules/ajv/lib/async.js | 218 + deploy/core/node_modules/ajv/lib/cache.js | 26 + .../node_modules/ajv/lib/compile/_rules.js | 28 + .../node_modules/ajv/lib/compile/equal.js | 45 + .../node_modules/ajv/lib/compile/formats.js | 164 + .../node_modules/ajv/lib/compile/index.js | 390 + .../node_modules/ajv/lib/compile/resolve.js | 267 + .../node_modules/ajv/lib/compile/rules.js | 40 + .../ajv/lib/compile/schema_obj.js | 9 + .../ajv/lib/compile/ucs2length.js | 20 + .../core/node_modules/ajv/lib/compile/util.js | 257 + .../ajv/lib/compile/validation_error.js | 14 + .../core/node_modules/ajv/lib/dot/_limit.jst | 49 + .../node_modules/ajv/lib/dot/_limitItems.jst | 10 + .../node_modules/ajv/lib/dot/_limitLength.jst | 10 + .../ajv/lib/dot/_limitProperties.jst | 10 + .../core/node_modules/ajv/lib/dot/allOf.jst | 34 + .../core/node_modules/ajv/lib/dot/anyOf.jst | 48 + .../core/node_modules/ajv/lib/dot/coerce.def | 61 + .../core/node_modules/ajv/lib/dot/custom.jst | 184 + .../node_modules/ajv/lib/dot/defaults.def | 32 + .../node_modules/ajv/lib/dot/definitions.def | 182 + .../node_modules/ajv/lib/dot/dependencies.jst | 69 + deploy/core/node_modules/ajv/lib/dot/enum.jst | 30 + .../core/node_modules/ajv/lib/dot/errors.def | 185 + .../core/node_modules/ajv/lib/dot/format.jst | 100 + .../core/node_modules/ajv/lib/dot/items.jst | 101 + .../core/node_modules/ajv/lib/dot/missing.def | 34 + .../node_modules/ajv/lib/dot/multipleOf.jst | 20 + deploy/core/node_modules/ajv/lib/dot/not.jst | 43 + .../core/node_modules/ajv/lib/dot/oneOf.jst | 44 + .../core/node_modules/ajv/lib/dot/pattern.jst | 14 + .../node_modules/ajv/lib/dot/properties.jst | 319 + deploy/core/node_modules/ajv/lib/dot/ref.jst | 86 + .../node_modules/ajv/lib/dot/required.jst | 96 + .../node_modules/ajv/lib/dot/uniqueItems.jst | 38 + .../ajv/lib/dot/v5/_formatLimit.jst | 116 + .../node_modules/ajv/lib/dot/v5/constant.jst | 10 + .../ajv/lib/dot/v5/patternRequired.jst | 28 + .../node_modules/ajv/lib/dot/v5/switch.jst | 73 + .../node_modules/ajv/lib/dot/validate.jst | 210 + .../core/node_modules/ajv/lib/dotjs/README.md | 3 + .../ajv/lib/dotjs/_formatLimit.js | 176 + .../core/node_modules/ajv/lib/dotjs/_limit.js | 124 + .../node_modules/ajv/lib/dotjs/_limitItems.js | 76 + .../ajv/lib/dotjs/_limitLength.js | 81 + .../ajv/lib/dotjs/_limitProperties.js | 76 + .../core/node_modules/ajv/lib/dotjs/allOf.js | 43 + .../core/node_modules/ajv/lib/dotjs/anyOf.js | 65 + .../node_modules/ajv/lib/dotjs/constant.js | 52 + .../core/node_modules/ajv/lib/dotjs/custom.js | 220 + .../ajv/lib/dotjs/dependencies.js | 147 + .../core/node_modules/ajv/lib/dotjs/enum.js | 65 + .../core/node_modules/ajv/lib/dotjs/format.js | 138 + .../core/node_modules/ajv/lib/dotjs/items.js | 144 + .../node_modules/ajv/lib/dotjs/multipleOf.js | 76 + deploy/core/node_modules/ajv/lib/dotjs/not.js | 83 + .../core/node_modules/ajv/lib/dotjs/oneOf.js | 76 + .../node_modules/ajv/lib/dotjs/pattern.js | 74 + .../ajv/lib/dotjs/patternRequired.js | 51 + .../node_modules/ajv/lib/dotjs/properties.js | 445 + deploy/core/node_modules/ajv/lib/dotjs/ref.js | 119 + .../node_modules/ajv/lib/dotjs/required.js | 249 + .../core/node_modules/ajv/lib/dotjs/switch.js | 128 + .../node_modules/ajv/lib/dotjs/uniqueItems.js | 71 + .../node_modules/ajv/lib/dotjs/validate.js | 375 + deploy/core/node_modules/ajv/lib/keyword.js | 129 + .../ajv/lib/refs/json-schema-draft-04.json | 150 + .../ajv/lib/refs/json-schema-v5.json | 328 + deploy/core/node_modules/ajv/lib/v5.js | 52 + deploy/core/node_modules/ajv/package.json | 159 + .../node_modules/ajv/scripts/.eslintrc.yml | 3 + .../core/node_modules/ajv/scripts/bundle.js | 54 + .../node_modules/ajv/scripts/compile-dots.js | 73 + deploy/core/node_modules/ajv/scripts/info | 10 + .../node_modules/ajv/scripts/prepare-tests | 9 + .../node_modules/ajv/scripts/travis-gh-pages | 21 + deploy/core/node_modules/asn1/.npmignore | 2 + deploy/core/node_modules/asn1/.travis.yml | 4 + deploy/core/node_modules/asn1/LICENSE | 19 + deploy/core/node_modules/asn1/README.md | 50 + .../core/node_modules/asn1/lib/ber/errors.js | 13 + .../core/node_modules/asn1/lib/ber/index.js | 27 + .../core/node_modules/asn1/lib/ber/reader.js | 261 + .../core/node_modules/asn1/lib/ber/types.js | 36 + .../core/node_modules/asn1/lib/ber/writer.js | 316 + deploy/core/node_modules/asn1/lib/index.js | 20 + deploy/core/node_modules/asn1/package.json | 90 + .../node_modules/asn1/tst/ber/reader.test.js | 208 + .../node_modules/asn1/tst/ber/writer.test.js | 370 + deploy/core/node_modules/assert-plus/AUTHORS | 6 + .../core/node_modules/assert-plus/CHANGES.md | 8 + .../core/node_modules/assert-plus/README.md | 155 + .../core/node_modules/assert-plus/assert.js | 206 + .../node_modules/assert-plus/package.json | 107 + deploy/core/node_modules/asynckit/LICENSE | 21 + deploy/core/node_modules/asynckit/README.md | 233 + deploy/core/node_modules/asynckit/bench.js | 76 + deploy/core/node_modules/asynckit/index.js | 6 + .../core/node_modules/asynckit/lib/abort.js | 29 + .../core/node_modules/asynckit/lib/async.js | 34 + .../core/node_modules/asynckit/lib/defer.js | 26 + .../core/node_modules/asynckit/lib/iterate.js | 75 + .../asynckit/lib/readable_asynckit.js | 91 + .../asynckit/lib/readable_parallel.js | 25 + .../asynckit/lib/readable_serial.js | 25 + .../asynckit/lib/readable_serial_ordered.js | 29 + .../core/node_modules/asynckit/lib/state.js | 37 + .../node_modules/asynckit/lib/streamify.js | 141 + .../node_modules/asynckit/lib/terminator.js | 29 + .../core/node_modules/asynckit/package.json | 118 + deploy/core/node_modules/asynckit/parallel.js | 43 + deploy/core/node_modules/asynckit/serial.js | 17 + .../node_modules/asynckit/serialOrdered.js | 75 + deploy/core/node_modules/asynckit/stream.js | 21 + deploy/core/node_modules/aws-sign2/LICENSE | 55 + deploy/core/node_modules/aws-sign2/README.md | 4 + deploy/core/node_modules/aws-sign2/index.js | 212 + .../core/node_modules/aws-sign2/package.json | 73 + deploy/core/node_modules/aws4/.npmignore | 4 + deploy/core/node_modules/aws4/.tern-port | 1 + deploy/core/node_modules/aws4/.travis.yml | 5 + deploy/core/node_modules/aws4/LICENSE | 19 + deploy/core/node_modules/aws4/README.md | 523 + deploy/core/node_modules/aws4/aws4.js | 332 + deploy/core/node_modules/aws4/lru.js | 96 + deploy/core/node_modules/aws4/package.json | 132 + .../core/node_modules/bcrypt-pbkdf/README.md | 39 + .../core/node_modules/bcrypt-pbkdf/index.js | 556 + .../node_modules/bcrypt-pbkdf/package.json | 76 + deploy/core/node_modules/boom/.npmignore | 18 + deploy/core/node_modules/boom/.travis.yml | 8 + deploy/core/node_modules/boom/CONTRIBUTING.md | 1 + deploy/core/node_modules/boom/LICENSE | 28 + deploy/core/node_modules/boom/README.md | 652 + deploy/core/node_modules/boom/images/boom.png | Bin 0 -> 29479 bytes deploy/core/node_modules/boom/lib/index.js | 318 + deploy/core/node_modules/boom/package.json | 90 + deploy/core/node_modules/boom/test/index.js | 654 + deploy/core/node_modules/caseless/LICENSE | 28 + deploy/core/node_modules/caseless/README.md | 45 + deploy/core/node_modules/caseless/index.js | 67 + .../core/node_modules/caseless/package.json | 92 + deploy/core/node_modules/caseless/test.js | 67 + deploy/core/node_modules/co/History.md | 172 + deploy/core/node_modules/co/LICENSE | 22 + deploy/core/node_modules/co/Readme.md | 212 + deploy/core/node_modules/co/index.js | 237 + deploy/core/node_modules/co/package.json | 98 + .../core/node_modules/combined-stream/License | 19 + .../node_modules/combined-stream/Readme.md | 138 + .../combined-stream/lib/combined_stream.js | 188 + .../node_modules/combined-stream/package.json | 93 + deploy/core/node_modules/cryptiles/.npmignore | 18 + .../core/node_modules/cryptiles/.travis.yml | 8 + deploy/core/node_modules/cryptiles/LICENSE | 28 + deploy/core/node_modules/cryptiles/README.md | 16 + .../core/node_modules/cryptiles/lib/index.js | 68 + .../core/node_modules/cryptiles/package.json | 86 + .../core/node_modules/cryptiles/test/index.js | 102 + deploy/core/node_modules/dashdash/CHANGES.md | 364 + deploy/core/node_modules/dashdash/LICENSE.txt | 24 + deploy/core/node_modules/dashdash/README.md | 574 + .../dashdash/etc/dashdash.bash_completion.in | 389 + .../node_modules/dashdash/lib/dashdash.js | 1055 + .../dashdash/node_modules/assert-plus/AUTHORS | 6 + .../node_modules/assert-plus/CHANGES.md | 14 + .../node_modules/assert-plus/README.md | 162 + .../node_modules/assert-plus/assert.js | 211 + .../node_modules/assert-plus/package.json | 107 + .../core/node_modules/dashdash/package.json | 117 + .../node_modules/delayed-stream/.npmignore | 1 + .../core/node_modules/delayed-stream/License | 19 + .../core/node_modules/delayed-stream/Makefile | 7 + .../node_modules/delayed-stream/Readme.md | 141 + .../delayed-stream/lib/delayed_stream.js | 107 + .../node_modules/delayed-stream/package.json | 89 + deploy/core/node_modules/ecc-jsbn/.npmignore | 15 + deploy/core/node_modules/ecc-jsbn/LICENSE | 21 + deploy/core/node_modules/ecc-jsbn/README.md | 8 + deploy/core/node_modules/ecc-jsbn/index.js | 57 + .../node_modules/ecc-jsbn/lib/LICENSE-jsbn | 40 + deploy/core/node_modules/ecc-jsbn/lib/ec.js | 561 + deploy/core/node_modules/ecc-jsbn/lib/sec.js | 170 + .../core/node_modules/ecc-jsbn/package.json | 82 + deploy/core/node_modules/ecc-jsbn/test.js | 14 + deploy/core/node_modules/extend/.eslintrc | 192 + deploy/core/node_modules/extend/.jscs.json | 104 + deploy/core/node_modules/extend/.npmignore | 1 + deploy/core/node_modules/extend/.travis.yml | 44 + deploy/core/node_modules/extend/CHANGELOG.md | 69 + deploy/core/node_modules/extend/LICENSE | 23 + deploy/core/node_modules/extend/README.md | 62 + .../core/node_modules/extend/component.json | 32 + deploy/core/node_modules/extend/index.js | 86 + deploy/core/node_modules/extend/package.json | 98 + .../core/node_modules/extsprintf/.gitmodules | 6 + deploy/core/node_modules/extsprintf/LICENSE | 19 + deploy/core/node_modules/extsprintf/Makefile | 23 + .../node_modules/extsprintf/Makefile.deps | 39 + .../node_modules/extsprintf/Makefile.targ | 285 + deploy/core/node_modules/extsprintf/README.md | 39 + .../extsprintf/examples/simple.js | 2 + .../node_modules/extsprintf/jsl.node.conf | 137 + .../node_modules/extsprintf/lib/extsprintf.js | 166 + .../core/node_modules/extsprintf/package.json | 66 + .../core/node_modules/forever-agent/LICENSE | 55 + .../core/node_modules/forever-agent/README.md | 4 + .../core/node_modules/forever-agent/index.js | 138 + .../node_modules/forever-agent/package.json | 80 + deploy/core/node_modules/form-data/License | 19 + deploy/core/node_modules/form-data/README.md | 217 + .../node_modules/form-data/lib/browser.js | 2 + .../node_modules/form-data/lib/form_data.js | 444 + .../node_modules/form-data/lib/populate.js | 10 + .../core/node_modules/form-data/package.json | 137 + deploy/core/node_modules/getpass/.npmignore | 8 + deploy/core/node_modules/getpass/.travis.yml | 9 + deploy/core/node_modules/getpass/LICENSE | 18 + deploy/core/node_modules/getpass/README.md | 32 + deploy/core/node_modules/getpass/lib/index.js | 123 + .../getpass/node_modules/assert-plus/AUTHORS | 6 + .../node_modules/assert-plus/CHANGES.md | 14 + .../node_modules/assert-plus/README.md | 162 + .../node_modules/assert-plus/assert.js | 211 + .../node_modules/assert-plus/package.json | 107 + deploy/core/node_modules/getpass/package.json | 82 + deploy/core/node_modules/har-schema/LICENSE | 13 + deploy/core/node_modules/har-schema/README.md | 49 + .../har-schema/lib/afterRequest.json | 29 + .../har-schema/lib/beforeRequest.json | 29 + .../node_modules/har-schema/lib/browser.json | 19 + .../node_modules/har-schema/lib/cache.json | 20 + .../node_modules/har-schema/lib/content.json | 28 + .../node_modules/har-schema/lib/cookie.json | 35 + .../node_modules/har-schema/lib/creator.json | 19 + .../node_modules/har-schema/lib/entry.json | 52 + .../core/node_modules/har-schema/lib/har.json | 12 + .../node_modules/har-schema/lib/header.json | 19 + .../core/node_modules/har-schema/lib/index.js | 22 + .../core/node_modules/har-schema/lib/log.json | 35 + .../node_modules/har-schema/lib/page.json | 31 + .../har-schema/lib/pageTimings.json | 17 + .../node_modules/har-schema/lib/postData.json | 42 + .../node_modules/har-schema/lib/query.json | 19 + .../node_modules/har-schema/lib/request.json | 56 + .../node_modules/har-schema/lib/response.json | 53 + .../node_modules/har-schema/lib/timings.json | 41 + .../core/node_modules/har-schema/package.json | 114 + .../core/node_modules/har-validator/LICENSE | 13 + .../core/node_modules/har-validator/README.md | 75 + .../har-validator/lib/browser/async.js | 96 + .../har-validator/lib/browser/error.js | 15 + .../har-validator/lib/browser/promise.js | 93 + .../har-validator/lib/node4/async.js | 136 + .../har-validator/lib/node4/error.js | 22 + .../har-validator/lib/node4/promise.js | 132 + .../har-validator/lib/node6/async.js | 133 + .../har-validator/lib/node6/error.js | 22 + .../har-validator/lib/node6/promise.js | 130 + .../har-validator/lib/node7/async.js | 133 + .../har-validator/lib/node7/error.js | 22 + .../har-validator/lib/node7/promise.js | 130 + .../node_modules/har-validator/package.json | 128 + .../node_modules/har-validator/src/async.js | 96 + .../node_modules/har-validator/src/error.js | 15 + .../node_modules/har-validator/src/promise.js | 93 + deploy/core/node_modules/hawk/.npmignore | 20 + deploy/core/node_modules/hawk/.travis.yml | 5 + deploy/core/node_modules/hawk/LICENSE | 28 + deploy/core/node_modules/hawk/README.md | 634 + deploy/core/node_modules/hawk/bower.json | 24 + deploy/core/node_modules/hawk/component.json | 19 + deploy/core/node_modules/hawk/dist/client.js | 343 + .../core/node_modules/hawk/example/usage.js | 78 + deploy/core/node_modules/hawk/images/hawk.png | Bin 0 -> 6945 bytes deploy/core/node_modules/hawk/images/logo.png | Bin 0 -> 71732 bytes deploy/core/node_modules/hawk/lib/browser.js | 637 + deploy/core/node_modules/hawk/lib/client.js | 369 + deploy/core/node_modules/hawk/lib/crypto.js | 126 + deploy/core/node_modules/hawk/lib/index.js | 15 + deploy/core/node_modules/hawk/lib/server.js | 548 + deploy/core/node_modules/hawk/lib/utils.js | 184 + deploy/core/node_modules/hawk/package.json | 93 + deploy/core/node_modules/hawk/test/browser.js | 1492 + deploy/core/node_modules/hawk/test/client.js | 440 + deploy/core/node_modules/hawk/test/crypto.js | 70 + deploy/core/node_modules/hawk/test/index.js | 378 + deploy/core/node_modules/hawk/test/readme.js | 95 + deploy/core/node_modules/hawk/test/server.js | 1329 + deploy/core/node_modules/hawk/test/uri.js | 838 + deploy/core/node_modules/hawk/test/utils.js | 149 + deploy/core/node_modules/hoek/.npmignore | 18 + deploy/core/node_modules/hoek/.travis.yml | 7 + deploy/core/node_modules/hoek/CONTRIBUTING.md | 1 + deploy/core/node_modules/hoek/LICENSE | 31 + deploy/core/node_modules/hoek/README.md | 584 + deploy/core/node_modules/hoek/images/hoek.png | Bin 0 -> 37939 bytes deploy/core/node_modules/hoek/lib/escape.js | 132 + deploy/core/node_modules/hoek/lib/index.js | 993 + deploy/core/node_modules/hoek/package.json | 88 + deploy/core/node_modules/hoek/test/escaper.js | 88 + deploy/core/node_modules/hoek/test/index.js | 2513 + .../node_modules/hoek/test/modules/ignore.txt | 0 .../node_modules/hoek/test/modules/test1.js | 1 + .../node_modules/hoek/test/modules/test2.js | 1 + .../node_modules/hoek/test/modules/test3.js | 1 + .../http-signature/.dir-locals.el | 6 + .../node_modules/http-signature/.npmignore | 7 + .../node_modules/http-signature/CHANGES.md | 46 + .../core/node_modules/http-signature/LICENSE | 18 + .../node_modules/http-signature/README.md | 79 + .../http-signature/http_signing.md | 363 + .../node_modules/http-signature/lib/index.js | 29 + .../node_modules/http-signature/lib/parser.js | 318 + .../node_modules/http-signature/lib/signer.js | 399 + .../node_modules/http-signature/lib/utils.js | 112 + .../node_modules/http-signature/lib/verify.js | 88 + .../node_modules/http-signature/package.json | 108 + .../node_modules/is-typedarray/LICENSE.md | 18 + .../core/node_modules/is-typedarray/README.md | 16 + .../core/node_modules/is-typedarray/index.js | 41 + .../node_modules/is-typedarray/package.json | 82 + .../core/node_modules/is-typedarray/test.js | 34 + deploy/core/node_modules/isstream/.jshintrc | 59 + deploy/core/node_modules/isstream/.npmignore | 1 + deploy/core/node_modules/isstream/.travis.yml | 12 + deploy/core/node_modules/isstream/LICENSE.md | 11 + deploy/core/node_modules/isstream/README.md | 66 + deploy/core/node_modules/isstream/isstream.js | 27 + .../core/node_modules/isstream/package.json | 85 + deploy/core/node_modules/isstream/test.js | 168 + .../core/node_modules/jodid25519/.npmignore | 11 + .../core/node_modules/jodid25519/.travis.yml | 7 + .../core/node_modules/jodid25519/AUTHORS.md | 3 + deploy/core/node_modules/jodid25519/LICENSE | 23 + deploy/core/node_modules/jodid25519/README.md | 51 + deploy/core/node_modules/jodid25519/almond.0 | 42 + deploy/core/node_modules/jodid25519/almond.1 | 13 + deploy/core/node_modules/jodid25519/index.js | 35 + .../core/node_modules/jodid25519/jsdoc.json | 19 + .../core/node_modules/jodid25519/lib/core.js | 481 + .../node_modules/jodid25519/lib/curve255.js | 221 + deploy/core/node_modules/jodid25519/lib/dh.js | 111 + .../core/node_modules/jodid25519/lib/eddsa.js | 573 + .../core/node_modules/jodid25519/lib/utils.js | 198 + .../core/node_modules/jodid25519/package.json | 96 + deploy/core/node_modules/jsbn/.npmignore | 2 + deploy/core/node_modules/jsbn/LICENSE | 40 + deploy/core/node_modules/jsbn/README.md | 175 + deploy/core/node_modules/jsbn/example.html | 12 + deploy/core/node_modules/jsbn/example.js | 3 + deploy/core/node_modules/jsbn/index.js | 1357 + deploy/core/node_modules/jsbn/package.json | 83 + .../core/node_modules/json-schema/README.md | 5 + .../json-schema/draft-00/hyper-schema | 68 + .../json-schema/draft-00/json-ref | 26 + .../node_modules/json-schema/draft-00/links | 33 + .../node_modules/json-schema/draft-00/schema | 155 + .../json-schema/draft-01/hyper-schema | 68 + .../json-schema/draft-01/json-ref | 26 + .../node_modules/json-schema/draft-01/links | 33 + .../node_modules/json-schema/draft-01/schema | 155 + .../json-schema/draft-02/hyper-schema | 68 + .../json-schema/draft-02/json-ref | 26 + .../node_modules/json-schema/draft-02/links | 35 + .../node_modules/json-schema/draft-02/schema | 166 + .../json-schema/draft-03/examples/address | 20 + .../json-schema/draft-03/examples/calendar | 53 + .../json-schema/draft-03/examples/card | 105 + .../json-schema/draft-03/examples/geo | 8 + .../json-schema/draft-03/examples/interfaces | 23 + .../json-schema/draft-03/hyper-schema | 60 + .../json-schema/draft-03/json-ref | 26 + .../node_modules/json-schema/draft-03/links | 35 + .../node_modules/json-schema/draft-03/schema | 174 + .../json-schema/draft-04/hyper-schema | 60 + .../node_modules/json-schema/draft-04/links | 41 + .../node_modules/json-schema/draft-04/schema | 189 + .../json-schema/draft-zyp-json-schema-03.xml | 1120 + .../json-schema/draft-zyp-json-schema-04.xml | 1072 + .../node_modules/json-schema/lib/links.js | 66 + .../node_modules/json-schema/lib/validate.js | 273 + .../node_modules/json-schema/package.json | 92 + .../node_modules/json-schema/test/tests.js | 95 + .../json-stable-stringify/.npmignore | 1 + .../json-stable-stringify/.travis.yml | 4 + .../json-stable-stringify/LICENSE | 18 + .../json-stable-stringify/example/key_cmp.js | 7 + .../json-stable-stringify/example/nested.js | 3 + .../json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../json-stable-stringify/index.js | 84 + .../json-stable-stringify/package.json | 101 + .../json-stable-stringify/readme.markdown | 130 + .../json-stable-stringify/test/cmp.js | 11 + .../json-stable-stringify/test/nested.js | 35 + .../json-stable-stringify/test/replacer.js | 74 + .../json-stable-stringify/test/space.js | 59 + .../json-stable-stringify/test/str.js | 32 + .../json-stable-stringify/test/to-json.js | 20 + .../json-stringify-safe/.npmignore | 1 + .../json-stringify-safe/CHANGELOG.md | 14 + .../node_modules/json-stringify-safe/LICENSE | 15 + .../node_modules/json-stringify-safe/Makefile | 35 + .../json-stringify-safe/README.md | 52 + .../json-stringify-safe/package.json | 94 + .../json-stringify-safe/stringify.js | 27 + .../json-stringify-safe/test/mocha.opts | 2 + .../test/stringify_test.js | 246 + .../core/node_modules/jsonify/README.markdown | 34 + deploy/core/node_modules/jsonify/index.js | 2 + deploy/core/node_modules/jsonify/lib/parse.js | 273 + .../node_modules/jsonify/lib/stringify.js | 154 + deploy/core/node_modules/jsonify/package.json | 82 + .../core/node_modules/jsonify/test/parse.js | 16 + .../node_modules/jsonify/test/stringify.js | 15 + deploy/core/node_modules/jsprim/CHANGES.md | 43 + deploy/core/node_modules/jsprim/LICENSE | 19 + deploy/core/node_modules/jsprim/README.md | 292 + deploy/core/node_modules/jsprim/lib/jsprim.js | 735 + .../jsprim/node_modules/assert-plus/AUTHORS | 6 + .../node_modules/assert-plus/CHANGES.md | 14 + .../jsprim/node_modules/assert-plus/README.md | 162 + .../jsprim/node_modules/assert-plus/assert.js | 211 + .../node_modules/assert-plus/package.json | 107 + deploy/core/node_modules/jsprim/package.json | 78 + deploy/core/node_modules/mime-db/HISTORY.md | 412 + deploy/core/node_modules/mime-db/LICENSE | 22 + deploy/core/node_modules/mime-db/README.md | 82 + deploy/core/node_modules/mime-db/db.json | 6805 + deploy/core/node_modules/mime-db/index.js | 11 + deploy/core/node_modules/mime-db/package.json | 130 + .../core/node_modules/mime-types/HISTORY.md | 223 + deploy/core/node_modules/mime-types/LICENSE | 23 + deploy/core/node_modules/mime-types/README.md | 108 + deploy/core/node_modules/mime-types/index.js | 188 + .../core/node_modules/mime-types/package.json | 120 + deploy/core/node_modules/oauth-sign/LICENSE | 55 + deploy/core/node_modules/oauth-sign/README.md | 4 + deploy/core/node_modules/oauth-sign/index.js | 136 + .../core/node_modules/oauth-sign/package.json | 90 + .../node_modules/performance-now/.npmignore | 1 + .../performance-now/.tm_properties | 7 + .../node_modules/performance-now/.travis.yml | 4 + .../node_modules/performance-now/Makefile | 25 + .../node_modules/performance-now/README.md | 30 + .../performance-now/lib/performance-now.js | 32 + .../node_modules/performance-now/license.txt | 7 + .../node_modules/performance-now/package.json | 77 + .../src/performance-now.coffee | 15 + .../performance-now/test/mocha.opts | 3 + .../test/performance-now.coffee | 38 + .../node_modules/punycode/LICENSE-MIT.txt | 20 + deploy/core/node_modules/punycode/README.md | 176 + .../core/node_modules/punycode/package.json | 119 + deploy/core/node_modules/punycode/punycode.js | 533 + deploy/core/node_modules/qs/.eslintignore | 1 + deploy/core/node_modules/qs/.eslintrc | 18 + deploy/core/node_modules/qs/.jscs.json | 176 + deploy/core/node_modules/qs/CHANGELOG.md | 175 + deploy/core/node_modules/qs/LICENSE | 28 + deploy/core/node_modules/qs/README.md | 440 + deploy/core/node_modules/qs/dist/qs.js | 597 + deploy/core/node_modules/qs/lib/formats.js | 18 + deploy/core/node_modules/qs/lib/index.js | 11 + deploy/core/node_modules/qs/lib/parse.js | 167 + deploy/core/node_modules/qs/lib/stringify.js | 207 + deploy/core/node_modules/qs/lib/utils.js | 182 + deploy/core/node_modules/qs/package.json | 113 + deploy/core/node_modules/qs/test/.eslintrc | 11 + deploy/core/node_modules/qs/test/index.js | 7 + deploy/core/node_modules/qs/test/parse.js | 519 + deploy/core/node_modules/qs/test/stringify.js | 567 + deploy/core/node_modules/qs/test/utils.js | 22 + deploy/core/node_modules/request/CHANGELOG.md | 674 + deploy/core/node_modules/request/README.md | 1016 +- deploy/core/node_modules/request/index.js | 156 + deploy/core/node_modules/request/lib/auth.js | 168 + .../core/node_modules/request/lib/cookies.js | 39 + .../request/lib/getProxyFromURI.js | 79 + deploy/core/node_modules/request/lib/har.js | 215 + .../core/node_modules/request/lib/helpers.js | 66 + .../node_modules/request/lib/multipart.js | 113 + deploy/core/node_modules/request/lib/oauth.js | 148 + .../node_modules/request/lib/querystring.js | 51 + .../core/node_modules/request/lib/redirect.js | 157 + .../core/node_modules/request/lib/tunnel.js | 176 + deploy/core/node_modules/request/package.json | 183 +- deploy/core/node_modules/request/request.js | 1565 + .../core/node_modules/safe-buffer/.travis.yml | 7 + deploy/core/node_modules/safe-buffer/LICENSE | 21 + .../core/node_modules/safe-buffer/README.md | 581 + .../core/node_modules/safe-buffer/browser.js | 1 + deploy/core/node_modules/safe-buffer/index.js | 58 + .../node_modules/safe-buffer/package.json | 96 + deploy/core/node_modules/safe-buffer/test.js | 99 + deploy/core/node_modules/sntp/.npmignore | 18 + deploy/core/node_modules/sntp/.travis.yml | 5 + deploy/core/node_modules/sntp/LICENSE | 28 + deploy/core/node_modules/sntp/Makefile | 9 + deploy/core/node_modules/sntp/README.md | 68 + .../core/node_modules/sntp/examples/offset.js | 16 + .../core/node_modules/sntp/examples/time.js | 25 + deploy/core/node_modules/sntp/index.js | 1 + deploy/core/node_modules/sntp/lib/index.js | 412 + deploy/core/node_modules/sntp/package.json | 90 + deploy/core/node_modules/sntp/test/index.js | 435 + .../ws/node_modules/options/.npmignore | 2 + .../ws/node_modules/options/README.md | 66 + .../ws/node_modules/options/lib/options.js | 23 +- .../ws/node_modules/options/package.json | 78 +- deploy/core/node_modules/sshpk/.npmignore | 9 + deploy/core/node_modules/sshpk/.travis.yml | 11 + deploy/core/node_modules/sshpk/LICENSE | 18 + deploy/core/node_modules/sshpk/README.md | 685 + deploy/core/node_modules/sshpk/bin/sshpk-conv | 201 + deploy/core/node_modules/sshpk/bin/sshpk-sign | 191 + .../core/node_modules/sshpk/bin/sshpk-verify | 166 + deploy/core/node_modules/sshpk/lib/algs.js | 168 + .../node_modules/sshpk/lib/certificate.js | 377 + deploy/core/node_modules/sshpk/lib/dhe.js | 311 + .../core/node_modules/sshpk/lib/ed-compat.js | 96 + deploy/core/node_modules/sshpk/lib/errors.js | 84 + .../node_modules/sshpk/lib/fingerprint.js | 161 + .../node_modules/sshpk/lib/formats/auto.js | 73 + .../sshpk/lib/formats/openssh-cert.js | 289 + .../node_modules/sshpk/lib/formats/pem.js | 186 + .../node_modules/sshpk/lib/formats/pkcs1.js | 320 + .../node_modules/sshpk/lib/formats/pkcs8.js | 505 + .../node_modules/sshpk/lib/formats/rfc4253.js | 146 + .../sshpk/lib/formats/ssh-private.js | 261 + .../node_modules/sshpk/lib/formats/ssh.js | 114 + .../sshpk/lib/formats/x509-pem.js | 77 + .../node_modules/sshpk/lib/formats/x509.js | 699 + .../core/node_modules/sshpk/lib/identity.js | 277 + deploy/core/node_modules/sshpk/lib/index.js | 38 + deploy/core/node_modules/sshpk/lib/key.js | 270 + .../node_modules/sshpk/lib/private-key.js | 231 + .../core/node_modules/sshpk/lib/signature.js | 245 + .../core/node_modules/sshpk/lib/ssh-buffer.js | 148 + deploy/core/node_modules/sshpk/lib/utils.js | 288 + .../node_modules/sshpk/man/man1/sshpk-conv.1 | 135 + .../node_modules/sshpk/man/man1/sshpk-sign.1 | 81 + .../sshpk/man/man1/sshpk-verify.1 | 68 + .../sshpk/node_modules/assert-plus/AUTHORS | 6 + .../sshpk/node_modules/assert-plus/CHANGES.md | 14 + .../sshpk/node_modules/assert-plus/README.md | 162 + .../sshpk/node_modules/assert-plus/assert.js | 211 + .../node_modules/assert-plus/package.json | 107 + deploy/core/node_modules/sshpk/package.json | 127 + .../core/node_modules/stringstream/.npmignore | 15 + .../node_modules/stringstream/.travis.yml | 4 + .../node_modules/stringstream/LICENSE.txt | 22 + .../core/node_modules/stringstream/README.md | 38 + .../core/node_modules/stringstream/example.js | 27 + .../node_modules/stringstream/package.json | 77 + .../node_modules/stringstream/stringstream.js | 102 + deploy/core/node_modules/tough-cookie/LICENSE | 27 + .../core/node_modules/tough-cookie/README.md | 506 + .../node_modules/tough-cookie/lib/cookie.js | 1336 + .../node_modules/tough-cookie/lib/memstore.js | 170 + .../tough-cookie/lib/pathMatch.js | 61 + .../tough-cookie/lib/permuteDomain.js | 56 + .../tough-cookie/lib/pubsuffix.js | 98 + .../node_modules/tough-cookie/lib/store.js | 71 + .../node_modules/tough-cookie/package.json | 127 + deploy/core/node_modules/tunnel-agent/LICENSE | 55 + .../core/node_modules/tunnel-agent/README.md | 4 + .../core/node_modules/tunnel-agent/index.js | 244 + .../node_modules/tunnel-agent/package.json | 94 + deploy/core/node_modules/tweetnacl/.npmignore | 4 + deploy/core/node_modules/tweetnacl/AUTHORS.md | 28 + .../core/node_modules/tweetnacl/CHANGELOG.md | 221 + deploy/core/node_modules/tweetnacl/LICENSE | 24 + .../tweetnacl/PULL_REQUEST_TEMPLATE.md | 20 + deploy/core/node_modules/tweetnacl/README.md | 459 + .../core/node_modules/tweetnacl/nacl-fast.js | 2388 + .../node_modules/tweetnacl/nacl-fast.min.js | 2 + deploy/core/node_modules/tweetnacl/nacl.d.ts | 98 + deploy/core/node_modules/tweetnacl/nacl.js | 1175 + .../core/node_modules/tweetnacl/nacl.min.js | 1 + .../core/node_modules/tweetnacl/package.json | 113 + deploy/core/node_modules/uglify-js/.npmignore | 4 + .../core/node_modules/uglify-js/README.html | 981 + deploy/core/node_modules/uglify-js/README.org | 574 + .../core/node_modules/uglify-js/bin/uglifyjs | 323 + .../core/node_modules/uglify-js/docstyle.css | 75 + .../node_modules/uglify-js/lib/object-ast.js | 75 + .../node_modules/uglify-js/lib/parse-js.js | 1342 + .../node_modules/uglify-js/lib/process.js | 2011 + .../uglify-js/lib/squeeze-more.js | 69 + .../core/node_modules/uglify-js/package.json | 84 + .../core/node_modules/uglify-js/package.json~ | 24 + .../node_modules/uglify-js/test/beautify.js | 28 + .../node_modules/uglify-js/test/testparser.js | 403 + .../test/unit/compress/expected/array1.js | 1 + .../test/unit/compress/expected/array2.js | 1 + .../test/unit/compress/expected/array3.js | 1 + .../test/unit/compress/expected/array4.js | 1 + .../test/unit/compress/expected/assignment.js | 1 + .../unit/compress/expected/concatstring.js | 1 + .../test/unit/compress/expected/const.js | 1 + .../unit/compress/expected/empty-blocks.js | 1 + .../unit/compress/expected/forstatement.js | 1 + .../test/unit/compress/expected/if.js | 1 + .../test/unit/compress/expected/ifreturn.js | 1 + .../test/unit/compress/expected/ifreturn2.js | 1 + .../test/unit/compress/expected/issue10.js | 1 + .../test/unit/compress/expected/issue11.js | 1 + .../test/unit/compress/expected/issue13.js | 1 + .../test/unit/compress/expected/issue14.js | 1 + .../test/unit/compress/expected/issue16.js | 1 + .../test/unit/compress/expected/issue17.js | 1 + .../test/unit/compress/expected/issue20.js | 1 + .../test/unit/compress/expected/issue21.js | 1 + .../test/unit/compress/expected/issue25.js | 1 + .../test/unit/compress/expected/issue27.js | 1 + .../test/unit/compress/expected/issue278.js | 1 + .../test/unit/compress/expected/issue28.js | 1 + .../test/unit/compress/expected/issue29.js | 1 + .../test/unit/compress/expected/issue30.js | 1 + .../test/unit/compress/expected/issue34.js | 1 + .../test/unit/compress/expected/issue4.js | 1 + .../test/unit/compress/expected/issue48.js | 1 + .../test/unit/compress/expected/issue50.js | 1 + .../test/unit/compress/expected/issue53.js | 1 + .../test/unit/compress/expected/issue54.1.js | 1 + .../test/unit/compress/expected/issue68.js | 1 + .../test/unit/compress/expected/issue69.js | 1 + .../test/unit/compress/expected/issue9.js | 1 + .../test/unit/compress/expected/mangle.js | 1 + .../unit/compress/expected/null_string.js | 1 + .../unit/compress/expected/strict-equals.js | 1 + .../test/unit/compress/expected/var.js | 1 + .../test/unit/compress/expected/whitespace.js | 1 + .../test/unit/compress/expected/with.js | 1 + .../test/unit/compress/test/array1.js | 3 + .../test/unit/compress/test/array2.js | 4 + .../test/unit/compress/test/array3.js | 4 + .../test/unit/compress/test/array4.js | 6 + .../test/unit/compress/test/assignment.js | 20 + .../test/unit/compress/test/concatstring.js | 3 + .../test/unit/compress/test/const.js | 5 + .../test/unit/compress/test/empty-blocks.js | 4 + .../test/unit/compress/test/forstatement.js | 10 + .../uglify-js/test/unit/compress/test/if.js | 6 + .../test/unit/compress/test/ifreturn.js | 9 + .../test/unit/compress/test/ifreturn2.js | 16 + .../test/unit/compress/test/issue10.js | 1 + .../test/unit/compress/test/issue11.js | 3 + .../test/unit/compress/test/issue13.js | 1 + .../test/unit/compress/test/issue14.js | 1 + .../test/unit/compress/test/issue16.js | 1 + .../test/unit/compress/test/issue17.js | 4 + .../test/unit/compress/test/issue20.js | 1 + .../test/unit/compress/test/issue21.js | 6 + .../test/unit/compress/test/issue25.js | 7 + .../test/unit/compress/test/issue27.js | 1 + .../test/unit/compress/test/issue278.js | 1 + .../test/unit/compress/test/issue28.js | 3 + .../test/unit/compress/test/issue29.js | 1 + .../test/unit/compress/test/issue30.js | 3 + .../test/unit/compress/test/issue34.js | 3 + .../test/unit/compress/test/issue4.js | 3 + .../test/unit/compress/test/issue48.js | 1 + .../test/unit/compress/test/issue50.js | 9 + .../test/unit/compress/test/issue53.js | 1 + .../test/unit/compress/test/issue54.1.js | 3 + .../test/unit/compress/test/issue68.js | 5 + .../test/unit/compress/test/issue69.js | 1 + .../test/unit/compress/test/issue9.js | 4 + .../test/unit/compress/test/mangle.js | 5 + .../test/unit/compress/test/null_string.js | 1 + .../test/unit/compress/test/strict-equals.js | 3 + .../uglify-js/test/unit/compress/test/var.js | 3 + .../test/unit/compress/test/whitespace.js | 21 + .../uglify-js/test/unit/compress/test/with.js | 2 + .../uglify-js/test/unit/scripts.js | 55 + deploy/core/node_modules/uglify-js/tmp/269.js | 13 + deploy/core/node_modules/uglify-js/tmp/app.js | 22315 +++ .../uglify-js/tmp/embed-tokens.js | 15 + .../core/node_modules/uglify-js/tmp/goto.js | 26 + .../core/node_modules/uglify-js/tmp/goto2.js | 8 + .../core/node_modules/uglify-js/tmp/hoist.js | 33 + .../node_modules/uglify-js/tmp/instrument.js | 97 + .../node_modules/uglify-js/tmp/instrument2.js | 138 + .../node_modules/uglify-js/tmp/liftvars.js | 8 + .../core/node_modules/uglify-js/tmp/test.js | 30 + .../uglify-js/tmp/uglify-hangs.js | 3930 + .../uglify-js/tmp/uglify-hangs2.js | 166 + .../core/node_modules/uglify-js/uglify-js.js | 17 + deploy/core/node_modules/uuid/.npmignore | 8 + deploy/core/node_modules/uuid/.travis.yml | 5 + deploy/core/node_modules/uuid/AUTHORS | 5 + deploy/core/node_modules/uuid/HISTORY.md | 28 + deploy/core/node_modules/uuid/LICENSE.md | 21 + deploy/core/node_modules/uuid/README.md | 132 + deploy/core/node_modules/uuid/bin/uuid | 26 + deploy/core/node_modules/uuid/index.js | 8 + .../core/node_modules/uuid/lib/bytesToUuid.js | 23 + .../core/node_modules/uuid/lib/rng-browser.js | 33 + deploy/core/node_modules/uuid/lib/rng.js | 10 + deploy/core/node_modules/uuid/package.json | 114 + deploy/core/node_modules/uuid/test/mocha.opts | 3 + deploy/core/node_modules/uuid/test/test.js | 96 + deploy/core/node_modules/uuid/v1.js | 103 + deploy/core/node_modules/uuid/v4.js | 29 + deploy/core/node_modules/verror/.gitmodules | 0 deploy/core/node_modules/verror/.npmignore | 1 + deploy/core/node_modules/verror/LICENSE | 19 + deploy/core/node_modules/verror/Makefile | 35 + deploy/core/node_modules/verror/Makefile.targ | 285 + deploy/core/node_modules/verror/README.md | 120 + .../verror/examples/levels-verror.js | 36 + .../verror/examples/levels-werror.js | 34 + .../node_modules/verror/examples/varargs.js | 6 + .../node_modules/verror/examples/verror.js | 13 + .../node_modules/verror/examples/werror.js | 14 + deploy/core/node_modules/verror/jsl.node.conf | 139 + deploy/core/node_modules/verror/lib/verror.js | 157 + deploy/core/node_modules/verror/package.json | 70 + .../node_modules/verror/tests/tst.inherit.js | 100 + .../node_modules/verror/tests/tst.verror.js | 156 + .../node_modules/verror/tests/tst.werror.js | 179 + deploy/core/node_modules/zeparser/.npmignore | 1 + deploy/core/node_modules/zeparser/LICENSE | 19 + deploy/core/node_modules/zeparser/README | 37 + .../core/node_modules/zeparser/Tokenizer.js | 646 + deploy/core/node_modules/zeparser/ZeParser.js | 2180 + .../core/node_modules/zeparser/benchmark.html | 111608 +++++++++++++++ deploy/core/node_modules/zeparser/index.js | 1 + .../core/node_modules/zeparser/package.json | 76 + .../node_modules/zeparser/test-parser.html | 26 + .../node_modules/zeparser/test-tokenizer.html | 23 + deploy/core/node_modules/zeparser/tests.js | 478 + .../zeparser/unicodecategories.js | 49 + deploy/core/package.json | 2 +- 758 files changed, 247631 insertions(+), 183 deletions(-) create mode 100644 deploy/core/node_modules/active-x-obfuscator/..gitignore.un~ create mode 100644 deploy/core/node_modules/active-x-obfuscator/.Readme.md.un~ create mode 100644 deploy/core/node_modules/active-x-obfuscator/.index.js.un~ create mode 100644 deploy/core/node_modules/active-x-obfuscator/.npmignore create mode 100644 deploy/core/node_modules/active-x-obfuscator/.package.json.un~ create mode 100644 deploy/core/node_modules/active-x-obfuscator/.test.js.un~ create mode 100644 deploy/core/node_modules/active-x-obfuscator/Readme.md create mode 100644 deploy/core/node_modules/active-x-obfuscator/index.js create mode 100644 deploy/core/node_modules/active-x-obfuscator/package.json create mode 100644 deploy/core/node_modules/active-x-obfuscator/test.js create mode 100644 deploy/core/node_modules/ajv/.tonic_example.js create mode 100644 deploy/core/node_modules/ajv/LICENSE create mode 100644 deploy/core/node_modules/ajv/README.md create mode 100644 deploy/core/node_modules/ajv/dist/ajv.bundle.js create mode 100644 deploy/core/node_modules/ajv/dist/ajv.min.js create mode 100644 deploy/core/node_modules/ajv/dist/ajv.min.js.map create mode 100644 deploy/core/node_modules/ajv/dist/nodent.min.js create mode 100644 deploy/core/node_modules/ajv/dist/regenerator.min.js create mode 100644 deploy/core/node_modules/ajv/lib/ajv.d.ts create mode 100644 deploy/core/node_modules/ajv/lib/ajv.js create mode 100644 deploy/core/node_modules/ajv/lib/async.js create mode 100644 deploy/core/node_modules/ajv/lib/cache.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/_rules.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/equal.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/formats.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/index.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/resolve.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/rules.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/schema_obj.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/ucs2length.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/util.js create mode 100644 deploy/core/node_modules/ajv/lib/compile/validation_error.js create mode 100644 deploy/core/node_modules/ajv/lib/dot/_limit.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/_limitItems.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/_limitLength.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/_limitProperties.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/allOf.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/anyOf.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/coerce.def create mode 100644 deploy/core/node_modules/ajv/lib/dot/custom.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/defaults.def create mode 100644 deploy/core/node_modules/ajv/lib/dot/definitions.def create mode 100644 deploy/core/node_modules/ajv/lib/dot/dependencies.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/enum.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/errors.def create mode 100644 deploy/core/node_modules/ajv/lib/dot/format.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/items.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/missing.def create mode 100644 deploy/core/node_modules/ajv/lib/dot/multipleOf.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/not.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/oneOf.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/pattern.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/properties.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/ref.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/required.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/uniqueItems.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/v5/_formatLimit.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/v5/constant.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/v5/patternRequired.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/v5/switch.jst create mode 100644 deploy/core/node_modules/ajv/lib/dot/validate.jst create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/README.md create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/_formatLimit.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/_limit.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/_limitItems.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/_limitLength.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/_limitProperties.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/allOf.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/anyOf.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/constant.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/custom.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/dependencies.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/enum.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/format.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/items.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/multipleOf.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/not.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/oneOf.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/pattern.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/patternRequired.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/properties.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/ref.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/required.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/switch.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/uniqueItems.js create mode 100644 deploy/core/node_modules/ajv/lib/dotjs/validate.js create mode 100644 deploy/core/node_modules/ajv/lib/keyword.js create mode 100644 deploy/core/node_modules/ajv/lib/refs/json-schema-draft-04.json create mode 100644 deploy/core/node_modules/ajv/lib/refs/json-schema-v5.json create mode 100644 deploy/core/node_modules/ajv/lib/v5.js create mode 100644 deploy/core/node_modules/ajv/package.json create mode 100644 deploy/core/node_modules/ajv/scripts/.eslintrc.yml create mode 100644 deploy/core/node_modules/ajv/scripts/bundle.js create mode 100644 deploy/core/node_modules/ajv/scripts/compile-dots.js create mode 100755 deploy/core/node_modules/ajv/scripts/info create mode 100755 deploy/core/node_modules/ajv/scripts/prepare-tests create mode 100755 deploy/core/node_modules/ajv/scripts/travis-gh-pages create mode 100644 deploy/core/node_modules/asn1/.npmignore create mode 100644 deploy/core/node_modules/asn1/.travis.yml create mode 100644 deploy/core/node_modules/asn1/LICENSE create mode 100644 deploy/core/node_modules/asn1/README.md create mode 100644 deploy/core/node_modules/asn1/lib/ber/errors.js create mode 100644 deploy/core/node_modules/asn1/lib/ber/index.js create mode 100644 deploy/core/node_modules/asn1/lib/ber/reader.js create mode 100644 deploy/core/node_modules/asn1/lib/ber/types.js create mode 100644 deploy/core/node_modules/asn1/lib/ber/writer.js create mode 100644 deploy/core/node_modules/asn1/lib/index.js create mode 100644 deploy/core/node_modules/asn1/package.json create mode 100644 deploy/core/node_modules/asn1/tst/ber/reader.test.js create mode 100644 deploy/core/node_modules/asn1/tst/ber/writer.test.js create mode 100644 deploy/core/node_modules/assert-plus/AUTHORS create mode 100644 deploy/core/node_modules/assert-plus/CHANGES.md create mode 100644 deploy/core/node_modules/assert-plus/README.md create mode 100644 deploy/core/node_modules/assert-plus/assert.js create mode 100644 deploy/core/node_modules/assert-plus/package.json create mode 100644 deploy/core/node_modules/asynckit/LICENSE create mode 100644 deploy/core/node_modules/asynckit/README.md create mode 100644 deploy/core/node_modules/asynckit/bench.js create mode 100644 deploy/core/node_modules/asynckit/index.js create mode 100644 deploy/core/node_modules/asynckit/lib/abort.js create mode 100644 deploy/core/node_modules/asynckit/lib/async.js create mode 100644 deploy/core/node_modules/asynckit/lib/defer.js create mode 100644 deploy/core/node_modules/asynckit/lib/iterate.js create mode 100644 deploy/core/node_modules/asynckit/lib/readable_asynckit.js create mode 100644 deploy/core/node_modules/asynckit/lib/readable_parallel.js create mode 100644 deploy/core/node_modules/asynckit/lib/readable_serial.js create mode 100644 deploy/core/node_modules/asynckit/lib/readable_serial_ordered.js create mode 100644 deploy/core/node_modules/asynckit/lib/state.js create mode 100644 deploy/core/node_modules/asynckit/lib/streamify.js create mode 100644 deploy/core/node_modules/asynckit/lib/terminator.js create mode 100644 deploy/core/node_modules/asynckit/package.json create mode 100644 deploy/core/node_modules/asynckit/parallel.js create mode 100644 deploy/core/node_modules/asynckit/serial.js create mode 100644 deploy/core/node_modules/asynckit/serialOrdered.js create mode 100644 deploy/core/node_modules/asynckit/stream.js create mode 100644 deploy/core/node_modules/aws-sign2/LICENSE create mode 100644 deploy/core/node_modules/aws-sign2/README.md create mode 100644 deploy/core/node_modules/aws-sign2/index.js create mode 100644 deploy/core/node_modules/aws-sign2/package.json create mode 100644 deploy/core/node_modules/aws4/.npmignore create mode 100644 deploy/core/node_modules/aws4/.tern-port create mode 100644 deploy/core/node_modules/aws4/.travis.yml create mode 100644 deploy/core/node_modules/aws4/LICENSE create mode 100644 deploy/core/node_modules/aws4/README.md create mode 100644 deploy/core/node_modules/aws4/aws4.js create mode 100644 deploy/core/node_modules/aws4/lru.js create mode 100644 deploy/core/node_modules/aws4/package.json create mode 100644 deploy/core/node_modules/bcrypt-pbkdf/README.md create mode 100644 deploy/core/node_modules/bcrypt-pbkdf/index.js create mode 100644 deploy/core/node_modules/bcrypt-pbkdf/package.json create mode 100644 deploy/core/node_modules/boom/.npmignore create mode 100755 deploy/core/node_modules/boom/.travis.yml create mode 100644 deploy/core/node_modules/boom/CONTRIBUTING.md create mode 100755 deploy/core/node_modules/boom/LICENSE create mode 100755 deploy/core/node_modules/boom/README.md create mode 100755 deploy/core/node_modules/boom/images/boom.png create mode 100755 deploy/core/node_modules/boom/lib/index.js create mode 100644 deploy/core/node_modules/boom/package.json create mode 100755 deploy/core/node_modules/boom/test/index.js create mode 100644 deploy/core/node_modules/caseless/LICENSE create mode 100644 deploy/core/node_modules/caseless/README.md create mode 100644 deploy/core/node_modules/caseless/index.js create mode 100644 deploy/core/node_modules/caseless/package.json create mode 100644 deploy/core/node_modules/caseless/test.js create mode 100644 deploy/core/node_modules/co/History.md create mode 100644 deploy/core/node_modules/co/LICENSE create mode 100644 deploy/core/node_modules/co/Readme.md create mode 100644 deploy/core/node_modules/co/index.js create mode 100644 deploy/core/node_modules/co/package.json create mode 100644 deploy/core/node_modules/combined-stream/License create mode 100644 deploy/core/node_modules/combined-stream/Readme.md create mode 100644 deploy/core/node_modules/combined-stream/lib/combined_stream.js create mode 100644 deploy/core/node_modules/combined-stream/package.json create mode 100644 deploy/core/node_modules/cryptiles/.npmignore create mode 100755 deploy/core/node_modules/cryptiles/.travis.yml create mode 100755 deploy/core/node_modules/cryptiles/LICENSE create mode 100644 deploy/core/node_modules/cryptiles/README.md create mode 100755 deploy/core/node_modules/cryptiles/lib/index.js create mode 100644 deploy/core/node_modules/cryptiles/package.json create mode 100755 deploy/core/node_modules/cryptiles/test/index.js create mode 100644 deploy/core/node_modules/dashdash/CHANGES.md create mode 100644 deploy/core/node_modules/dashdash/LICENSE.txt create mode 100644 deploy/core/node_modules/dashdash/README.md create mode 100644 deploy/core/node_modules/dashdash/etc/dashdash.bash_completion.in create mode 100644 deploy/core/node_modules/dashdash/lib/dashdash.js create mode 100644 deploy/core/node_modules/dashdash/node_modules/assert-plus/AUTHORS create mode 100644 deploy/core/node_modules/dashdash/node_modules/assert-plus/CHANGES.md create mode 100644 deploy/core/node_modules/dashdash/node_modules/assert-plus/README.md create mode 100644 deploy/core/node_modules/dashdash/node_modules/assert-plus/assert.js create mode 100644 deploy/core/node_modules/dashdash/node_modules/assert-plus/package.json create mode 100644 deploy/core/node_modules/dashdash/package.json create mode 100644 deploy/core/node_modules/delayed-stream/.npmignore create mode 100644 deploy/core/node_modules/delayed-stream/License create mode 100644 deploy/core/node_modules/delayed-stream/Makefile create mode 100644 deploy/core/node_modules/delayed-stream/Readme.md create mode 100644 deploy/core/node_modules/delayed-stream/lib/delayed_stream.js create mode 100644 deploy/core/node_modules/delayed-stream/package.json create mode 100644 deploy/core/node_modules/ecc-jsbn/.npmignore create mode 100644 deploy/core/node_modules/ecc-jsbn/LICENSE create mode 100644 deploy/core/node_modules/ecc-jsbn/README.md create mode 100644 deploy/core/node_modules/ecc-jsbn/index.js create mode 100644 deploy/core/node_modules/ecc-jsbn/lib/LICENSE-jsbn create mode 100644 deploy/core/node_modules/ecc-jsbn/lib/ec.js create mode 100644 deploy/core/node_modules/ecc-jsbn/lib/sec.js create mode 100644 deploy/core/node_modules/ecc-jsbn/package.json create mode 100644 deploy/core/node_modules/ecc-jsbn/test.js create mode 100644 deploy/core/node_modules/extend/.eslintrc create mode 100644 deploy/core/node_modules/extend/.jscs.json create mode 100644 deploy/core/node_modules/extend/.npmignore create mode 100644 deploy/core/node_modules/extend/.travis.yml create mode 100644 deploy/core/node_modules/extend/CHANGELOG.md create mode 100644 deploy/core/node_modules/extend/LICENSE create mode 100644 deploy/core/node_modules/extend/README.md create mode 100644 deploy/core/node_modules/extend/component.json create mode 100644 deploy/core/node_modules/extend/index.js create mode 100644 deploy/core/node_modules/extend/package.json create mode 100644 deploy/core/node_modules/extsprintf/.gitmodules create mode 100644 deploy/core/node_modules/extsprintf/LICENSE create mode 100644 deploy/core/node_modules/extsprintf/Makefile create mode 100644 deploy/core/node_modules/extsprintf/Makefile.deps create mode 100644 deploy/core/node_modules/extsprintf/Makefile.targ create mode 100644 deploy/core/node_modules/extsprintf/README.md create mode 100644 deploy/core/node_modules/extsprintf/examples/simple.js create mode 100644 deploy/core/node_modules/extsprintf/jsl.node.conf create mode 100644 deploy/core/node_modules/extsprintf/lib/extsprintf.js create mode 100644 deploy/core/node_modules/extsprintf/package.json create mode 100644 deploy/core/node_modules/forever-agent/LICENSE create mode 100644 deploy/core/node_modules/forever-agent/README.md create mode 100644 deploy/core/node_modules/forever-agent/index.js create mode 100644 deploy/core/node_modules/forever-agent/package.json create mode 100644 deploy/core/node_modules/form-data/License create mode 100644 deploy/core/node_modules/form-data/README.md create mode 100644 deploy/core/node_modules/form-data/lib/browser.js create mode 100644 deploy/core/node_modules/form-data/lib/form_data.js create mode 100644 deploy/core/node_modules/form-data/lib/populate.js create mode 100644 deploy/core/node_modules/form-data/package.json create mode 100644 deploy/core/node_modules/getpass/.npmignore create mode 100644 deploy/core/node_modules/getpass/.travis.yml create mode 100644 deploy/core/node_modules/getpass/LICENSE create mode 100644 deploy/core/node_modules/getpass/README.md create mode 100644 deploy/core/node_modules/getpass/lib/index.js create mode 100644 deploy/core/node_modules/getpass/node_modules/assert-plus/AUTHORS create mode 100644 deploy/core/node_modules/getpass/node_modules/assert-plus/CHANGES.md create mode 100644 deploy/core/node_modules/getpass/node_modules/assert-plus/README.md create mode 100644 deploy/core/node_modules/getpass/node_modules/assert-plus/assert.js create mode 100644 deploy/core/node_modules/getpass/node_modules/assert-plus/package.json create mode 100644 deploy/core/node_modules/getpass/package.json create mode 100644 deploy/core/node_modules/har-schema/LICENSE create mode 100644 deploy/core/node_modules/har-schema/README.md create mode 100644 deploy/core/node_modules/har-schema/lib/afterRequest.json create mode 100644 deploy/core/node_modules/har-schema/lib/beforeRequest.json create mode 100644 deploy/core/node_modules/har-schema/lib/browser.json create mode 100644 deploy/core/node_modules/har-schema/lib/cache.json create mode 100644 deploy/core/node_modules/har-schema/lib/content.json create mode 100644 deploy/core/node_modules/har-schema/lib/cookie.json create mode 100644 deploy/core/node_modules/har-schema/lib/creator.json create mode 100644 deploy/core/node_modules/har-schema/lib/entry.json create mode 100644 deploy/core/node_modules/har-schema/lib/har.json create mode 100644 deploy/core/node_modules/har-schema/lib/header.json create mode 100644 deploy/core/node_modules/har-schema/lib/index.js create mode 100644 deploy/core/node_modules/har-schema/lib/log.json create mode 100644 deploy/core/node_modules/har-schema/lib/page.json create mode 100644 deploy/core/node_modules/har-schema/lib/pageTimings.json create mode 100644 deploy/core/node_modules/har-schema/lib/postData.json create mode 100644 deploy/core/node_modules/har-schema/lib/query.json create mode 100644 deploy/core/node_modules/har-schema/lib/request.json create mode 100644 deploy/core/node_modules/har-schema/lib/response.json create mode 100644 deploy/core/node_modules/har-schema/lib/timings.json create mode 100644 deploy/core/node_modules/har-schema/package.json create mode 100644 deploy/core/node_modules/har-validator/LICENSE create mode 100644 deploy/core/node_modules/har-validator/README.md create mode 100644 deploy/core/node_modules/har-validator/lib/browser/async.js create mode 100644 deploy/core/node_modules/har-validator/lib/browser/error.js create mode 100644 deploy/core/node_modules/har-validator/lib/browser/promise.js create mode 100644 deploy/core/node_modules/har-validator/lib/node4/async.js create mode 100644 deploy/core/node_modules/har-validator/lib/node4/error.js create mode 100644 deploy/core/node_modules/har-validator/lib/node4/promise.js create mode 100644 deploy/core/node_modules/har-validator/lib/node6/async.js create mode 100644 deploy/core/node_modules/har-validator/lib/node6/error.js create mode 100644 deploy/core/node_modules/har-validator/lib/node6/promise.js create mode 100644 deploy/core/node_modules/har-validator/lib/node7/async.js create mode 100644 deploy/core/node_modules/har-validator/lib/node7/error.js create mode 100644 deploy/core/node_modules/har-validator/lib/node7/promise.js create mode 100644 deploy/core/node_modules/har-validator/package.json create mode 100644 deploy/core/node_modules/har-validator/src/async.js create mode 100644 deploy/core/node_modules/har-validator/src/error.js create mode 100644 deploy/core/node_modules/har-validator/src/promise.js create mode 100644 deploy/core/node_modules/hawk/.npmignore create mode 100755 deploy/core/node_modules/hawk/.travis.yml create mode 100755 deploy/core/node_modules/hawk/LICENSE create mode 100755 deploy/core/node_modules/hawk/README.md create mode 100644 deploy/core/node_modules/hawk/bower.json create mode 100644 deploy/core/node_modules/hawk/component.json create mode 100644 deploy/core/node_modules/hawk/dist/client.js create mode 100755 deploy/core/node_modules/hawk/example/usage.js create mode 100755 deploy/core/node_modules/hawk/images/hawk.png create mode 100755 deploy/core/node_modules/hawk/images/logo.png create mode 100755 deploy/core/node_modules/hawk/lib/browser.js create mode 100755 deploy/core/node_modules/hawk/lib/client.js create mode 100755 deploy/core/node_modules/hawk/lib/crypto.js create mode 100755 deploy/core/node_modules/hawk/lib/index.js create mode 100755 deploy/core/node_modules/hawk/lib/server.js create mode 100755 deploy/core/node_modules/hawk/lib/utils.js create mode 100644 deploy/core/node_modules/hawk/package.json create mode 100755 deploy/core/node_modules/hawk/test/browser.js create mode 100755 deploy/core/node_modules/hawk/test/client.js create mode 100755 deploy/core/node_modules/hawk/test/crypto.js create mode 100755 deploy/core/node_modules/hawk/test/index.js create mode 100755 deploy/core/node_modules/hawk/test/readme.js create mode 100755 deploy/core/node_modules/hawk/test/server.js create mode 100755 deploy/core/node_modules/hawk/test/uri.js create mode 100755 deploy/core/node_modules/hawk/test/utils.js create mode 100644 deploy/core/node_modules/hoek/.npmignore create mode 100644 deploy/core/node_modules/hoek/.travis.yml create mode 100644 deploy/core/node_modules/hoek/CONTRIBUTING.md create mode 100644 deploy/core/node_modules/hoek/LICENSE create mode 100644 deploy/core/node_modules/hoek/README.md create mode 100644 deploy/core/node_modules/hoek/images/hoek.png create mode 100644 deploy/core/node_modules/hoek/lib/escape.js create mode 100644 deploy/core/node_modules/hoek/lib/index.js create mode 100644 deploy/core/node_modules/hoek/package.json create mode 100644 deploy/core/node_modules/hoek/test/escaper.js create mode 100644 deploy/core/node_modules/hoek/test/index.js create mode 100644 deploy/core/node_modules/hoek/test/modules/ignore.txt create mode 100644 deploy/core/node_modules/hoek/test/modules/test1.js create mode 100644 deploy/core/node_modules/hoek/test/modules/test2.js create mode 100644 deploy/core/node_modules/hoek/test/modules/test3.js create mode 100644 deploy/core/node_modules/http-signature/.dir-locals.el create mode 100644 deploy/core/node_modules/http-signature/.npmignore create mode 100644 deploy/core/node_modules/http-signature/CHANGES.md create mode 100644 deploy/core/node_modules/http-signature/LICENSE create mode 100644 deploy/core/node_modules/http-signature/README.md create mode 100644 deploy/core/node_modules/http-signature/http_signing.md create mode 100644 deploy/core/node_modules/http-signature/lib/index.js create mode 100644 deploy/core/node_modules/http-signature/lib/parser.js create mode 100644 deploy/core/node_modules/http-signature/lib/signer.js create mode 100644 deploy/core/node_modules/http-signature/lib/utils.js create mode 100644 deploy/core/node_modules/http-signature/lib/verify.js create mode 100644 deploy/core/node_modules/http-signature/package.json create mode 100644 deploy/core/node_modules/is-typedarray/LICENSE.md create mode 100644 deploy/core/node_modules/is-typedarray/README.md create mode 100644 deploy/core/node_modules/is-typedarray/index.js create mode 100644 deploy/core/node_modules/is-typedarray/package.json create mode 100644 deploy/core/node_modules/is-typedarray/test.js create mode 100644 deploy/core/node_modules/isstream/.jshintrc create mode 100644 deploy/core/node_modules/isstream/.npmignore create mode 100644 deploy/core/node_modules/isstream/.travis.yml create mode 100644 deploy/core/node_modules/isstream/LICENSE.md create mode 100644 deploy/core/node_modules/isstream/README.md create mode 100644 deploy/core/node_modules/isstream/isstream.js create mode 100644 deploy/core/node_modules/isstream/package.json create mode 100644 deploy/core/node_modules/isstream/test.js create mode 100644 deploy/core/node_modules/jodid25519/.npmignore create mode 100644 deploy/core/node_modules/jodid25519/.travis.yml create mode 100644 deploy/core/node_modules/jodid25519/AUTHORS.md create mode 100644 deploy/core/node_modules/jodid25519/LICENSE create mode 100644 deploy/core/node_modules/jodid25519/README.md create mode 100644 deploy/core/node_modules/jodid25519/almond.0 create mode 100644 deploy/core/node_modules/jodid25519/almond.1 create mode 100644 deploy/core/node_modules/jodid25519/index.js create mode 100644 deploy/core/node_modules/jodid25519/jsdoc.json create mode 100644 deploy/core/node_modules/jodid25519/lib/core.js create mode 100644 deploy/core/node_modules/jodid25519/lib/curve255.js create mode 100644 deploy/core/node_modules/jodid25519/lib/dh.js create mode 100644 deploy/core/node_modules/jodid25519/lib/eddsa.js create mode 100644 deploy/core/node_modules/jodid25519/lib/utils.js create mode 100644 deploy/core/node_modules/jodid25519/package.json create mode 100644 deploy/core/node_modules/jsbn/.npmignore create mode 100644 deploy/core/node_modules/jsbn/LICENSE create mode 100644 deploy/core/node_modules/jsbn/README.md create mode 100644 deploy/core/node_modules/jsbn/example.html create mode 100644 deploy/core/node_modules/jsbn/example.js create mode 100644 deploy/core/node_modules/jsbn/index.js create mode 100644 deploy/core/node_modules/jsbn/package.json create mode 100644 deploy/core/node_modules/json-schema/README.md create mode 100644 deploy/core/node_modules/json-schema/draft-00/hyper-schema create mode 100644 deploy/core/node_modules/json-schema/draft-00/json-ref create mode 100644 deploy/core/node_modules/json-schema/draft-00/links create mode 100644 deploy/core/node_modules/json-schema/draft-00/schema create mode 100644 deploy/core/node_modules/json-schema/draft-01/hyper-schema create mode 100644 deploy/core/node_modules/json-schema/draft-01/json-ref create mode 100644 deploy/core/node_modules/json-schema/draft-01/links create mode 100644 deploy/core/node_modules/json-schema/draft-01/schema create mode 100644 deploy/core/node_modules/json-schema/draft-02/hyper-schema create mode 100644 deploy/core/node_modules/json-schema/draft-02/json-ref create mode 100644 deploy/core/node_modules/json-schema/draft-02/links create mode 100644 deploy/core/node_modules/json-schema/draft-02/schema create mode 100644 deploy/core/node_modules/json-schema/draft-03/examples/address create mode 100644 deploy/core/node_modules/json-schema/draft-03/examples/calendar create mode 100644 deploy/core/node_modules/json-schema/draft-03/examples/card create mode 100644 deploy/core/node_modules/json-schema/draft-03/examples/geo create mode 100644 deploy/core/node_modules/json-schema/draft-03/examples/interfaces create mode 100644 deploy/core/node_modules/json-schema/draft-03/hyper-schema create mode 100644 deploy/core/node_modules/json-schema/draft-03/json-ref create mode 100644 deploy/core/node_modules/json-schema/draft-03/links create mode 100644 deploy/core/node_modules/json-schema/draft-03/schema create mode 100644 deploy/core/node_modules/json-schema/draft-04/hyper-schema create mode 100644 deploy/core/node_modules/json-schema/draft-04/links create mode 100644 deploy/core/node_modules/json-schema/draft-04/schema create mode 100644 deploy/core/node_modules/json-schema/draft-zyp-json-schema-03.xml create mode 100644 deploy/core/node_modules/json-schema/draft-zyp-json-schema-04.xml create mode 100644 deploy/core/node_modules/json-schema/lib/links.js create mode 100644 deploy/core/node_modules/json-schema/lib/validate.js create mode 100644 deploy/core/node_modules/json-schema/package.json create mode 100644 deploy/core/node_modules/json-schema/test/tests.js create mode 100644 deploy/core/node_modules/json-stable-stringify/.npmignore create mode 100644 deploy/core/node_modules/json-stable-stringify/.travis.yml create mode 100644 deploy/core/node_modules/json-stable-stringify/LICENSE create mode 100644 deploy/core/node_modules/json-stable-stringify/example/key_cmp.js create mode 100644 deploy/core/node_modules/json-stable-stringify/example/nested.js create mode 100644 deploy/core/node_modules/json-stable-stringify/example/str.js create mode 100644 deploy/core/node_modules/json-stable-stringify/example/value_cmp.js create mode 100644 deploy/core/node_modules/json-stable-stringify/index.js create mode 100644 deploy/core/node_modules/json-stable-stringify/package.json create mode 100644 deploy/core/node_modules/json-stable-stringify/readme.markdown create mode 100644 deploy/core/node_modules/json-stable-stringify/test/cmp.js create mode 100644 deploy/core/node_modules/json-stable-stringify/test/nested.js create mode 100644 deploy/core/node_modules/json-stable-stringify/test/replacer.js create mode 100644 deploy/core/node_modules/json-stable-stringify/test/space.js create mode 100644 deploy/core/node_modules/json-stable-stringify/test/str.js create mode 100644 deploy/core/node_modules/json-stable-stringify/test/to-json.js create mode 100644 deploy/core/node_modules/json-stringify-safe/.npmignore create mode 100644 deploy/core/node_modules/json-stringify-safe/CHANGELOG.md create mode 100644 deploy/core/node_modules/json-stringify-safe/LICENSE create mode 100644 deploy/core/node_modules/json-stringify-safe/Makefile create mode 100644 deploy/core/node_modules/json-stringify-safe/README.md create mode 100644 deploy/core/node_modules/json-stringify-safe/package.json create mode 100644 deploy/core/node_modules/json-stringify-safe/stringify.js create mode 100644 deploy/core/node_modules/json-stringify-safe/test/mocha.opts create mode 100644 deploy/core/node_modules/json-stringify-safe/test/stringify_test.js create mode 100644 deploy/core/node_modules/jsonify/README.markdown create mode 100644 deploy/core/node_modules/jsonify/index.js create mode 100644 deploy/core/node_modules/jsonify/lib/parse.js create mode 100644 deploy/core/node_modules/jsonify/lib/stringify.js create mode 100644 deploy/core/node_modules/jsonify/package.json create mode 100644 deploy/core/node_modules/jsonify/test/parse.js create mode 100644 deploy/core/node_modules/jsonify/test/stringify.js create mode 100644 deploy/core/node_modules/jsprim/CHANGES.md create mode 100644 deploy/core/node_modules/jsprim/LICENSE create mode 100644 deploy/core/node_modules/jsprim/README.md create mode 100644 deploy/core/node_modules/jsprim/lib/jsprim.js create mode 100644 deploy/core/node_modules/jsprim/node_modules/assert-plus/AUTHORS create mode 100644 deploy/core/node_modules/jsprim/node_modules/assert-plus/CHANGES.md create mode 100644 deploy/core/node_modules/jsprim/node_modules/assert-plus/README.md create mode 100644 deploy/core/node_modules/jsprim/node_modules/assert-plus/assert.js create mode 100644 deploy/core/node_modules/jsprim/node_modules/assert-plus/package.json create mode 100644 deploy/core/node_modules/jsprim/package.json create mode 100644 deploy/core/node_modules/mime-db/HISTORY.md create mode 100644 deploy/core/node_modules/mime-db/LICENSE create mode 100644 deploy/core/node_modules/mime-db/README.md create mode 100644 deploy/core/node_modules/mime-db/db.json create mode 100644 deploy/core/node_modules/mime-db/index.js create mode 100644 deploy/core/node_modules/mime-db/package.json create mode 100644 deploy/core/node_modules/mime-types/HISTORY.md create mode 100644 deploy/core/node_modules/mime-types/LICENSE create mode 100644 deploy/core/node_modules/mime-types/README.md create mode 100644 deploy/core/node_modules/mime-types/index.js create mode 100644 deploy/core/node_modules/mime-types/package.json create mode 100644 deploy/core/node_modules/oauth-sign/LICENSE create mode 100644 deploy/core/node_modules/oauth-sign/README.md create mode 100644 deploy/core/node_modules/oauth-sign/index.js create mode 100644 deploy/core/node_modules/oauth-sign/package.json create mode 100644 deploy/core/node_modules/performance-now/.npmignore create mode 100644 deploy/core/node_modules/performance-now/.tm_properties create mode 100644 deploy/core/node_modules/performance-now/.travis.yml create mode 100644 deploy/core/node_modules/performance-now/Makefile create mode 100644 deploy/core/node_modules/performance-now/README.md create mode 100644 deploy/core/node_modules/performance-now/lib/performance-now.js create mode 100644 deploy/core/node_modules/performance-now/license.txt create mode 100644 deploy/core/node_modules/performance-now/package.json create mode 100644 deploy/core/node_modules/performance-now/src/performance-now.coffee create mode 100644 deploy/core/node_modules/performance-now/test/mocha.opts create mode 100644 deploy/core/node_modules/performance-now/test/performance-now.coffee create mode 100644 deploy/core/node_modules/punycode/LICENSE-MIT.txt create mode 100644 deploy/core/node_modules/punycode/README.md create mode 100644 deploy/core/node_modules/punycode/package.json create mode 100644 deploy/core/node_modules/punycode/punycode.js create mode 100644 deploy/core/node_modules/qs/.eslintignore create mode 100644 deploy/core/node_modules/qs/.eslintrc create mode 100644 deploy/core/node_modules/qs/.jscs.json create mode 100644 deploy/core/node_modules/qs/CHANGELOG.md create mode 100644 deploy/core/node_modules/qs/LICENSE create mode 100644 deploy/core/node_modules/qs/README.md create mode 100644 deploy/core/node_modules/qs/dist/qs.js create mode 100644 deploy/core/node_modules/qs/lib/formats.js create mode 100644 deploy/core/node_modules/qs/lib/index.js create mode 100644 deploy/core/node_modules/qs/lib/parse.js create mode 100644 deploy/core/node_modules/qs/lib/stringify.js create mode 100644 deploy/core/node_modules/qs/lib/utils.js create mode 100644 deploy/core/node_modules/qs/package.json create mode 100644 deploy/core/node_modules/qs/test/.eslintrc create mode 100644 deploy/core/node_modules/qs/test/index.js create mode 100644 deploy/core/node_modules/qs/test/parse.js create mode 100644 deploy/core/node_modules/qs/test/stringify.js create mode 100644 deploy/core/node_modules/qs/test/utils.js create mode 100644 deploy/core/node_modules/request/CHANGELOG.md create mode 100755 deploy/core/node_modules/request/index.js create mode 100644 deploy/core/node_modules/request/lib/auth.js create mode 100644 deploy/core/node_modules/request/lib/cookies.js create mode 100644 deploy/core/node_modules/request/lib/getProxyFromURI.js create mode 100644 deploy/core/node_modules/request/lib/har.js create mode 100644 deploy/core/node_modules/request/lib/helpers.js create mode 100644 deploy/core/node_modules/request/lib/multipart.js create mode 100644 deploy/core/node_modules/request/lib/oauth.js create mode 100644 deploy/core/node_modules/request/lib/querystring.js create mode 100644 deploy/core/node_modules/request/lib/redirect.js create mode 100644 deploy/core/node_modules/request/lib/tunnel.js create mode 100644 deploy/core/node_modules/request/request.js create mode 100644 deploy/core/node_modules/safe-buffer/.travis.yml create mode 100644 deploy/core/node_modules/safe-buffer/LICENSE create mode 100644 deploy/core/node_modules/safe-buffer/README.md create mode 100644 deploy/core/node_modules/safe-buffer/browser.js create mode 100644 deploy/core/node_modules/safe-buffer/index.js create mode 100644 deploy/core/node_modules/safe-buffer/package.json create mode 100644 deploy/core/node_modules/safe-buffer/test.js create mode 100644 deploy/core/node_modules/sntp/.npmignore create mode 100755 deploy/core/node_modules/sntp/.travis.yml create mode 100755 deploy/core/node_modules/sntp/LICENSE create mode 100755 deploy/core/node_modules/sntp/Makefile create mode 100755 deploy/core/node_modules/sntp/README.md create mode 100755 deploy/core/node_modules/sntp/examples/offset.js create mode 100755 deploy/core/node_modules/sntp/examples/time.js create mode 100755 deploy/core/node_modules/sntp/index.js create mode 100755 deploy/core/node_modules/sntp/lib/index.js create mode 100644 deploy/core/node_modules/sntp/package.json create mode 100755 deploy/core/node_modules/sntp/test/index.js create mode 100644 deploy/core/node_modules/sshpk/.npmignore create mode 100644 deploy/core/node_modules/sshpk/.travis.yml create mode 100644 deploy/core/node_modules/sshpk/LICENSE create mode 100644 deploy/core/node_modules/sshpk/README.md create mode 100755 deploy/core/node_modules/sshpk/bin/sshpk-conv create mode 100755 deploy/core/node_modules/sshpk/bin/sshpk-sign create mode 100755 deploy/core/node_modules/sshpk/bin/sshpk-verify create mode 100644 deploy/core/node_modules/sshpk/lib/algs.js create mode 100644 deploy/core/node_modules/sshpk/lib/certificate.js create mode 100644 deploy/core/node_modules/sshpk/lib/dhe.js create mode 100644 deploy/core/node_modules/sshpk/lib/ed-compat.js create mode 100644 deploy/core/node_modules/sshpk/lib/errors.js create mode 100644 deploy/core/node_modules/sshpk/lib/fingerprint.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/auto.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/openssh-cert.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/pem.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/pkcs1.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/pkcs8.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/rfc4253.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/ssh-private.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/ssh.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/x509-pem.js create mode 100644 deploy/core/node_modules/sshpk/lib/formats/x509.js create mode 100644 deploy/core/node_modules/sshpk/lib/identity.js create mode 100644 deploy/core/node_modules/sshpk/lib/index.js create mode 100644 deploy/core/node_modules/sshpk/lib/key.js create mode 100644 deploy/core/node_modules/sshpk/lib/private-key.js create mode 100644 deploy/core/node_modules/sshpk/lib/signature.js create mode 100644 deploy/core/node_modules/sshpk/lib/ssh-buffer.js create mode 100644 deploy/core/node_modules/sshpk/lib/utils.js create mode 100644 deploy/core/node_modules/sshpk/man/man1/sshpk-conv.1 create mode 100644 deploy/core/node_modules/sshpk/man/man1/sshpk-sign.1 create mode 100644 deploy/core/node_modules/sshpk/man/man1/sshpk-verify.1 create mode 100644 deploy/core/node_modules/sshpk/node_modules/assert-plus/AUTHORS create mode 100644 deploy/core/node_modules/sshpk/node_modules/assert-plus/CHANGES.md create mode 100644 deploy/core/node_modules/sshpk/node_modules/assert-plus/README.md create mode 100644 deploy/core/node_modules/sshpk/node_modules/assert-plus/assert.js create mode 100644 deploy/core/node_modules/sshpk/node_modules/assert-plus/package.json create mode 100644 deploy/core/node_modules/sshpk/package.json create mode 100644 deploy/core/node_modules/stringstream/.npmignore create mode 100644 deploy/core/node_modules/stringstream/.travis.yml create mode 100644 deploy/core/node_modules/stringstream/LICENSE.txt create mode 100644 deploy/core/node_modules/stringstream/README.md create mode 100644 deploy/core/node_modules/stringstream/example.js create mode 100644 deploy/core/node_modules/stringstream/package.json create mode 100644 deploy/core/node_modules/stringstream/stringstream.js create mode 100644 deploy/core/node_modules/tough-cookie/LICENSE create mode 100644 deploy/core/node_modules/tough-cookie/README.md create mode 100644 deploy/core/node_modules/tough-cookie/lib/cookie.js create mode 100644 deploy/core/node_modules/tough-cookie/lib/memstore.js create mode 100644 deploy/core/node_modules/tough-cookie/lib/pathMatch.js create mode 100644 deploy/core/node_modules/tough-cookie/lib/permuteDomain.js create mode 100644 deploy/core/node_modules/tough-cookie/lib/pubsuffix.js create mode 100644 deploy/core/node_modules/tough-cookie/lib/store.js create mode 100644 deploy/core/node_modules/tough-cookie/package.json create mode 100644 deploy/core/node_modules/tunnel-agent/LICENSE create mode 100644 deploy/core/node_modules/tunnel-agent/README.md create mode 100644 deploy/core/node_modules/tunnel-agent/index.js create mode 100644 deploy/core/node_modules/tunnel-agent/package.json create mode 100644 deploy/core/node_modules/tweetnacl/.npmignore create mode 100644 deploy/core/node_modules/tweetnacl/AUTHORS.md create mode 100644 deploy/core/node_modules/tweetnacl/CHANGELOG.md create mode 100644 deploy/core/node_modules/tweetnacl/LICENSE create mode 100644 deploy/core/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md create mode 100644 deploy/core/node_modules/tweetnacl/README.md create mode 100644 deploy/core/node_modules/tweetnacl/nacl-fast.js create mode 100644 deploy/core/node_modules/tweetnacl/nacl-fast.min.js create mode 100644 deploy/core/node_modules/tweetnacl/nacl.d.ts create mode 100644 deploy/core/node_modules/tweetnacl/nacl.js create mode 100644 deploy/core/node_modules/tweetnacl/nacl.min.js create mode 100644 deploy/core/node_modules/tweetnacl/package.json create mode 100644 deploy/core/node_modules/uglify-js/.npmignore create mode 100644 deploy/core/node_modules/uglify-js/README.html create mode 100644 deploy/core/node_modules/uglify-js/README.org create mode 100755 deploy/core/node_modules/uglify-js/bin/uglifyjs create mode 100644 deploy/core/node_modules/uglify-js/docstyle.css create mode 100644 deploy/core/node_modules/uglify-js/lib/object-ast.js create mode 100644 deploy/core/node_modules/uglify-js/lib/parse-js.js create mode 100644 deploy/core/node_modules/uglify-js/lib/process.js create mode 100644 deploy/core/node_modules/uglify-js/lib/squeeze-more.js create mode 100644 deploy/core/node_modules/uglify-js/package.json create mode 100644 deploy/core/node_modules/uglify-js/package.json~ create mode 100755 deploy/core/node_modules/uglify-js/test/beautify.js create mode 100755 deploy/core/node_modules/uglify-js/test/testparser.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/array1.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/array2.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/array3.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/array4.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/assignment.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/concatstring.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/const.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/forstatement.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/if.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue10.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue11.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue13.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue14.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue16.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue17.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue20.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue21.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue25.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue27.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue278.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue28.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue29.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue30.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue34.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue4.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue48.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue50.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue53.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue68.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue69.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/issue9.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/mangle.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/null_string.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/var.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/whitespace.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/expected/with.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/array1.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/array2.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/array3.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/array4.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/assignment.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/concatstring.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/const.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/forstatement.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/if.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/ifreturn.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue10.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue11.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue13.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue14.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue16.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue17.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue20.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue21.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue25.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue27.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue278.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue28.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue29.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue30.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue34.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue4.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue48.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue50.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue53.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue54.1.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue68.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue69.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/issue9.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/mangle.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/null_string.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/strict-equals.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/var.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/whitespace.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/compress/test/with.js create mode 100644 deploy/core/node_modules/uglify-js/test/unit/scripts.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/269.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/app.js create mode 100755 deploy/core/node_modules/uglify-js/tmp/embed-tokens.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/goto.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/goto2.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/hoist.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/instrument.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/instrument2.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/liftvars.js create mode 100755 deploy/core/node_modules/uglify-js/tmp/test.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/uglify-hangs.js create mode 100644 deploy/core/node_modules/uglify-js/tmp/uglify-hangs2.js create mode 100644 deploy/core/node_modules/uglify-js/uglify-js.js create mode 100644 deploy/core/node_modules/uuid/.npmignore create mode 100644 deploy/core/node_modules/uuid/.travis.yml create mode 100644 deploy/core/node_modules/uuid/AUTHORS create mode 100644 deploy/core/node_modules/uuid/HISTORY.md create mode 100644 deploy/core/node_modules/uuid/LICENSE.md create mode 100644 deploy/core/node_modules/uuid/README.md create mode 100755 deploy/core/node_modules/uuid/bin/uuid create mode 100644 deploy/core/node_modules/uuid/index.js create mode 100644 deploy/core/node_modules/uuid/lib/bytesToUuid.js create mode 100644 deploy/core/node_modules/uuid/lib/rng-browser.js create mode 100644 deploy/core/node_modules/uuid/lib/rng.js create mode 100644 deploy/core/node_modules/uuid/package.json create mode 100644 deploy/core/node_modules/uuid/test/mocha.opts create mode 100644 deploy/core/node_modules/uuid/test/test.js create mode 100644 deploy/core/node_modules/uuid/v1.js create mode 100644 deploy/core/node_modules/uuid/v4.js create mode 100644 deploy/core/node_modules/verror/.gitmodules create mode 100644 deploy/core/node_modules/verror/.npmignore create mode 100644 deploy/core/node_modules/verror/LICENSE create mode 100644 deploy/core/node_modules/verror/Makefile create mode 100644 deploy/core/node_modules/verror/Makefile.targ create mode 100644 deploy/core/node_modules/verror/README.md create mode 100644 deploy/core/node_modules/verror/examples/levels-verror.js create mode 100644 deploy/core/node_modules/verror/examples/levels-werror.js create mode 100644 deploy/core/node_modules/verror/examples/varargs.js create mode 100644 deploy/core/node_modules/verror/examples/verror.js create mode 100644 deploy/core/node_modules/verror/examples/werror.js create mode 100644 deploy/core/node_modules/verror/jsl.node.conf create mode 100644 deploy/core/node_modules/verror/lib/verror.js create mode 100644 deploy/core/node_modules/verror/package.json create mode 100644 deploy/core/node_modules/verror/tests/tst.inherit.js create mode 100644 deploy/core/node_modules/verror/tests/tst.verror.js create mode 100644 deploy/core/node_modules/verror/tests/tst.werror.js create mode 100644 deploy/core/node_modules/zeparser/.npmignore create mode 100644 deploy/core/node_modules/zeparser/LICENSE create mode 100644 deploy/core/node_modules/zeparser/README create mode 100755 deploy/core/node_modules/zeparser/Tokenizer.js create mode 100755 deploy/core/node_modules/zeparser/ZeParser.js create mode 100755 deploy/core/node_modules/zeparser/benchmark.html create mode 100644 deploy/core/node_modules/zeparser/index.js create mode 100644 deploy/core/node_modules/zeparser/package.json create mode 100755 deploy/core/node_modules/zeparser/test-parser.html create mode 100755 deploy/core/node_modules/zeparser/test-tokenizer.html create mode 100644 deploy/core/node_modules/zeparser/tests.js create mode 100755 deploy/core/node_modules/zeparser/unicodecategories.js diff --git a/deploy/core/node_modules/active-x-obfuscator/..gitignore.un~ b/deploy/core/node_modules/active-x-obfuscator/..gitignore.un~ new file mode 100644 index 0000000000000000000000000000000000000000..46155d4181c8e68001e595ff93d41f3fac4827df GIT binary patch literal 1811 zcmWH`%$*;a=aT=FfvGR@&~9&?qYp9{pOh4@s{ftRQndX{nrU+DA+}cb-phpy3=B*_ zj0_lo92Temh=ySXf1l;~EFf7XhWHCm1<0B~QXmWl|AByk8O9r>sUHHs=tu=e2P4B* z2{hxu(O}vLjwTQrIU+z&h8j(99-1kmTq=YBFq*Q#(Zm3WCgi{dv%!&vEXn|lI8a2v zG9t(!ph$%0H*o$!(FIa63aA$Xz=+F5k2qNHg94saORqGq4jNa;84TnEP`troXEd%r XK|)IajH^6o)dVjK;pLoZL0ckKB7#)7#=wM*@DghLf1Y&6*2E{HYD$rus zv=JO>AQ@Qf0-4|lgj+QlX`mpX0Kh{MXaSg6;=4q%$sB3C!LL(MACxUDRMKZ_^6yKMqe^aR)26vS@BO`F zqe4!`Pb8Hui)=dDmP-E6TVQU_8}C&d)uw+wy>)oSaQQ106S@Zh zvId)CYM`}_QWhTq3karF#k8r$gt5*19uw=1apwbB1EyedmidaPZA{<*fqIVm7cgv% zLhSWM)+^NDb8Po8NhW~h_lL8hz{Cn2q_LzN1O3!+tV5s;bC3!-jL=0=$bGfemPbc&YI->_h^?j{64tR>l4L_a7WA z4_A6Sd;3?H1m<9=w}$ETw%#j(cS4aE)da#EZiW?wDpu$qDOA6~$1 zJPadrkt|HKf)?c;!(g?Jxd4SvVZYCtkG3c@SWuG5%&`~YNt(o&UfKB+|e==qd!22&8$yn z4I%4U$BtIRLiLd>2Z1=-XsuhE)Xb8ZHh1segtR5G0RwB>|T@AM1*9Im_gzSW+7!$-!m%Ueo9Hyy^Tl zA~Qc5U)Su%5v-RmCv1s*&7Kl4s&_CWGjR{(Gko0j0l z86{h#4m5A{`nrfPJuG!pEL5H#*(}KfT=WNN7K;~Qgf7zbqU9jXg)h2CG~>O<4|FL4 z4K@8*^DRJ~=E?@dQvErDbW$5j%2E6vGT>CC)w|Mzqx!R*XeJ->Rr_Va*bmxm_*n?sb2OJ&NAz@$ z$ol^D8nyZkn85NlR|=3dQC0CIXPF$;qw%`ObX6OZc?p;{_j<#77FTBOY&t1R{lmT6 z0z6=y>Bh|g|AH1kt=ra=T+&lMD) z9Hk5eIHP2%9-P;cA&zMQR}UPp*}=ftBI%q^z@FrEcvMO?YL>{%Jut6(csF?uw5b-f zbaB zuh%`ggWe|%k)e~pv*rG9b$O{bXdbYbF|{9WK!NS?lFsK$A|Ndo)f5lGACJ!K9^;B) zJh8s1-^M7n5!YZGLlJ6IuDlSnv4K*LI>ThCo}AY`#gXSk*~rXKY-0nRV3}q)2*_-^ zg2}9sn|m}~_m~d(IuWKdR7Z%Ip30C3gS1E1M`Jx+NC&{;4NzUoau6^!Cn@cinI$ua zf{E8Xy029aJUOB>^ZT$6EIQ&5js~*kfCZD;I5Tge0@>f|9@E$PijsEhWJx+>TBj}n zgD3b{qu@r?>YVrxIf8D7BonZ5Je7jdERmTvmX!U`Y0{8Gl2n%oO|SAO4IC2$0e8Xf z1M@2@GY6Lk!vV98X71|`?-}fKuP|`8>|l3^BonwcB`7S-ESY&@$zauSEMMJbX*2~#^zi9?-Xved?s!KxePXu%3tE^|cyS#$8>Zq70}YGcV@)eU1h>H)iv z3YaIjG61cFE6yOD)D44Thum-lbeFs0f|Wo=3sHQ|StdtqEE%lIQ_cwCis}-syr$j6 zu@gcQciNg8s~W#tso^J#nAL5u&7+!mNV<^=WT5&aNl%o7K%Biba4nQENe5{xDaSy! z=NX`^x={XRrF=@=4QvOcXRM(dCX!i&3$G_jGJz$R2~SUy00tv;kv6|A;b5NMTfLWJ zdMaGZkC)mAjIGBZEvNz2Q&Go+p@XELd(R|vJJ!sZp8Q~E=;cH4sjl1* zhJKlm>x`1ErcnJpPn8{TDs#xR$(%sD!W9yrxV1`gO|wL1o&xcG9wImQ2uQTa)BuMN zN$)2~PCZ*4)YULz_2#g;Zd6&zA+${lZVJ&WC7D2*ZBz0U zjmUWNC<;6`G#CfFr%5t_Yg2;4(#(>XHLlVB6^m2~tkZ%=!`! zVT3M{g7N1kVZ3zBBP@wr;rMh{bQl+|&LExC6t16|#Px}jxHj_%$KM743ym$qX(b%XsMdHiEORt8NDOS@P*f`BokONNq{D}RJjl1O1Z?$5}CQb#L&lGV*jm`^{I6u%#g5|-`50Sd8R7_$oPFL z>k1~U&_S@c)dc8cFul2cA@L(?Oq`32zy*f$*84cd%lq{!isENZAa|W46R2`WM`P_m z(#(>Xr;xnJM@N{R;T^pf6PjI+Jj)dTT-cltiXd|+_l{j1C`-Y)* zy(=I@?H*gHGM!GF+vw4zM98X?lIm&Kn zuuncL6Iw%HJ(o>`0Ft5d0?#bcB~O93cO1M}j{<|ku*OHDw%*sGz`I$J31GP#2#ZQB ziV?aUpkYaAaB)XDwcb5xPiYNjV6* z-ABOdR2Q$iTiKmfvtt?+y#VvNaqm5pFR9(EUx78Zk1%h1;!|nO1Y@a5}CQb zsL;n~I)+a)0o*;kbi19lp(jY?dw2^0f`uF!2R)_B0{m^=mBoj!Mw$iN8HBX`Up!dOcTRAc4 z4dD*R?sO#uCo`{#13IH*t0@ubE5{+!h;-y71m==9uK-B+8XY5>nGU=cvm6AlToh#_ z*DTT{Z!8%sI&M6$hIvL^n;IfRH(?|fQuD5GFAnG6r7mSO5F>m=MMeWZsBZYU@#N%g zm>w@TP-ALuL~_Q@RhK&d3G3mb z6Dtn^?%2WOKdCneE@6l8rL)vq09$D~n!V~<1Z!^soWwSxw*k0V_DeG1LMj)JS)*(2 zFCMS^i|2{{;%Q3f@8+s!K?Cz0d0#`~3H^ z1x#SM*A)e1wq5ZgXP7J%OIiTTP@?HRo_VTbI=c=?7$xE60Rko;fogbzi|Gh+*dQU0 z)%_@mjyH$>HXJnTQMiiK$-_}L7ORI#j!W!-Boi(_`f!_BQ35Qi&_Plzx##$r0n-y? z>Fs@`?ALG++I53B3CxnH&&>qp1{_W{J!kkF`1jKBoKnW8|?cx;bY4fG&Un z%#tJ%ps}?cvVbzPWadr-GiD_uREu%=*^d)3aG@VAfYypWCGFBT$?qz<|!1P z=j%>uRkiL6js}v0t|Z{HHnTKu&M;YON{u-3fE9?${5YE3a0kmvSq=iSGJVOc(KS!; zr25gRFcQbu57U>dK0GJR&~EO(%&eKk1hi#WR)7|W&LExC6o|KKb$D*ws9}2Us}afj zz|q$GY7$f{l1#uzklA*{!<=EVR0d%T4bEY@kNA@?f#rTz1d!o% zD#e@35}A2QMYskN6<$h32&$J!Iur^AMm+2SmJ2$p&_Pl>Y~U+G+AnyY!AZxCdLAuP zLz;n1HswJk-`qjZnnCL+K=tL4Od!rS>ZFCTnI$uCEE%kd?;-e<>T(nDpi=IQGKDhe zCQQwR)GH*JK#}ulU0ukTSu*n!a&Pqh2~KuGAUE+P3$XeswhRJCyEaPQYF5e3Q`o)9 zv!h}(^ZOtZEDyL+fXucln4Dp#A<5* zN9$Ide;Imv5dCUNCeY?IDy0%NOJwGaC1ro~ar2?x>>bf~@^BzLH#8p#c3&gO1g=d9 z3QIFfX5LsbSalrBx3^i^PO!|L4+X~uC7Hn34qR$svr2B>STb03!(6Q=0hU*~Qal(A zsH=+mIm_gzoiW8X6g(*B|5{fDpf!gtpqyoL)W(v*s^k3W9a>LrslyW5JllzS()oY~-s#gsO0$kzL)5>#I=$pnmSS8o59 zMY`lE=>EW?v)eqJ6c5XIz7c}2V*en}rI%5Nnnk+g8zxGfxmi-|2?B#!)CSJXJ#9U1 zYc(tIUd?h4z;eVga%L9kk~fwNR%PM?Ld~kW)U1Ex-4jIYgy5c2z25Ev^D8Se3(Nia zVc)-O>EQC^08w9c(P8;45&X`#;^UgG7u1oz&#KonR;r!A9 zJeT^1_05R!eWgJA23JIYa_Xa5S0G}A4$>K-e(oUn8)&}K6$Wg@-<&}@shv?h27e0= z44cc@v;Cm@CRaQ#HYY4z<}8z=HkJ%l9oO*v@uY@NyzBu(1)A5oQh<$yQl+3WOJwF7 zM#T;mUXI>PNC`NB_c~Wpz;eWLlie95TWu^EtZHuJ?<0M&?RN%~fOEo4c1V4*D;X3y zpPr+*p|ebmnnLbNN^a|Tr<2CczyE4}1dW-o-<0enu6}Hywg$F zVSWUs%X+#JhTqB&g21;hHEVRusnoPdk{o?pMf%sCDW>N_@PjKLdA%ePaM^)MPtL58 zo2R(l-zcK<>KYS7W`5kx#=yYxZ7c@?83)&GO2cMm$;`3%kv!?|y(ckSg#pdSaYCKM zNr1v^c?2k7Y72~5ZDD77tYixGzCw@WgCw#}6(j%ZfN%^OPwtLkW@=medr%P8kR zc*4e$xAVYrLsMH|_XbHOaHRwstgyrgU8J$390Yw!I2bHd7nc7tiDmZG7C3%KI2##^ zDZyndlv)@obdVIT|2~Q9<&!=FapxdByE$@)BHovP<#)Q$!^VZ}yIjej$nGk|E6oy_ISrwEj`L2(4rYFW9>WBd?_oIz$kTtm!m7z{K(pZFF@IIYu8@vx#Z7-`i+K9J->s_vhpv2owVO{Yytk6MH@SWNA zHjnQV^S0sY@{)DbVDxTRD)`}YyaBf`!w6j@h1pr_F|$StB;V^w0j|=BIfHakH;f3= z6X$Q`w4vbw$$MB10xq^IVWL^2OP+$L{!nF@dO`(;`H@OeJI(;ld-*X4=xqB^>6uk> z^Uk=;tHAPot`r~xZHeBUQL@!6OcqZVB9Oe#6#-lfcN9d78jftp^G$@l!Kr%KNUG7N%grsZ@o})o<|Q;r8YHdbj{Nd zUNGu@zJ>(Jhh0g)RS-FYbW&-lw5^dGeOwJW@=Qrm%aVvYQ&u?)-LKA`@G0zvPbXy)p3#=ziRl608)UgqY4K*=h>P z`g1<6Z^upub?AlTQPx4`SfBv>33d+x+|o>%HM-_mKxrm@zzLF{bR_|oK`)VvGfbA6 z5^%m$tIz3JeVX}wzzLS0azy}H@g!%EPHKuL-QVtgTflkb@Df-*?FtA;PFdPDXOwI; z#mBz84bS`7X4ICAC+VRGPW%hq*&lw(;itN8a7OTbT#^ZB z!KrmZaYi#sX5LsbSan?O`YFYE;dpoxM>k>h30Ja@i%vz%9G22O#|T{{h259ED`NVd zBz48$ULTj`pOa()E~26G6qQ+|OP+w}ZJWj++9qeEZrokBb@g8cpBI<*_3yt!rio1* z7Ikp=_Nm@Qz25KA4J5zJau9HFV3iW7m?biEEU6c}M!TT%h5Crs0;=i2bf*UJzkQCg< zD(>wyZiadoZ@o|wAxuQSh2sGV>I?kMbc6rswrV;I#@DB)`gX5OA^GQ7jikSfPUuKw5=MQ)jxba39@9 z#5mi|JK#R?rHh2qHjt~^DekgaQdafG7W z_>irxuOFC?{@UJV>-6nY^}4A$W~2)v;q3HOT_;a%n|aA#acO$$)~RjVw%W}RE`!fX zGT{>8ve?Rsa#>)74w4cXoii>nA_5{ZddZP53*Mmc5MB^m0Ke(}%Um4gf^Y`uq;|d_ z_8<9zcnB{B;D6rzhq*Ay#o!FmN$q?w+;HTJVP|i{O#+aAOVa1Ue~t^FKo7>~oTWhT z`6dC=pCZY3ib3)PR}^raEQy!2lvW!fbdi)`?t*cMtW&(_$bPwDuLSXLyZ;sVxh#0r zy&%U3T_gqhlt+%YF~DocpT16HE^+%<)Z?RZp#F~ge*l~_F$h{9V}vf!SW*sxeswt5 zA=Bl?(6onaRj)z5c3r<-5A&q17jSz^CNV< z&RpN4t@8}A-(&kA(4=FpQaaCOiOjsQr0fqIlf9;hyKYx^y|})yXYR`H5S-nxyS8d& zz2j>mHFng8v~kxnoFIp$>A(nGB;{JXT(8BM`dZu~XX9<8+a(6ahS8dE@R$v>LwISnzIhsKXm^Ys29@CAf43Cq@`s+#y^y>0nA|i zBllkcdBN-q(n;-%IZRm}`{>CAC`0v+-TwsQg|ah9C$%%>D{5zMKU=f`zySTC`%eJ7 z0CooHq^1C_U;nsceC+j<8t~|&V;jH=&M&$D!WTt9P7-ll39T_g7fHeUA|G~PdUmo= znHoB4=|~Z9+uX4)iuxxk2LU46sFeP>St2v{eR76EO??0SP7jVLduD$1oiI%dEPrZy zOAa#IuK1TTOqOaR3+!y;Tj(3c1eX87oP?r{6&{^_Jc?@Y zDAEI0%HPq-@W@pp5dVz*f&f_GQowS78my9=;d|GIozb@jok3{T=k~n)L0?5~mLJUg zzKR6P{|q~mfsE|{Uoc^WE|P-jm5S-I+P}bbx}=LZYiPwl^5-lE0oT!z%IkN`B3<&v zl5!9l9lh`+$CLC?0P&>PdrxA6VA4qE4S`nU6Oh0 zgQZ?GkCe=yu~?ZHMiBL<~GJLK$!r5-1F+OT zyj~fp_T|-3HtkCuU+UlAUsxUXr?>Hw%<^9D>-VGG7Q?~K!{x=LyX#Ft(-AIYF5JJ6 zWWq&_`OAxk%pzTKe<7pmvk;Q|3;7NHLS`c_CN5;IJ$qP&^$(Nucu7_Vf$D#;90ZIw zfl6u3%@Ub;7P{l)WYdy-YYvvbbcFyJC{+q3vqWZ|g6VzU!|)I@zsCfYzjB2D8QW^x zQ!qKpP9mAb@1M6Id?rutEn(f%k*s;1My8 zhX+=J2duwgIS3%}&`Ve@@UTJ$NrCs%9v-Hr9V4zCg=fEj)!+f^Z&?lkNW8PmR5goq z$y4Bc%)`U<$4dg9Ap*(Yu^a?k09GmfWtPayQxN@Z8K%(nohHhN zO&E|_cK|4iia_#zOEQ5niZz{j)11FbhCukWOj}z{hLNdHHA*vz`kcUP};S|Kdss&1S|&sYIP+a?})p7yGCN z({opGMv`_H^yU+52}a;*{X9VZE6YKE$Tp8+xq!n89V7)@{ZL4lmO;<~xE+!JckY^? zbEdg3=w96ewSSXj0@0HtZDmEFh!r|W3dNn?{Z5jTog&F7KBNzXg`fw-|L*=%;Ky+} zXF-k;x=3S5ISBeC;b7c@Ref&HJ7zudw&Py5)^X>qy7qZD@7{IGHCNxcYxgbB+I!8N zx86B-)%DlxzD4fdPc%c}gJ4N@5y=~?itfSg_F&nF#!z<( zz6X;3lw<-fYV8YHQ4nE;4w8cC+Hr_3k(1JBzF>pCH}>@llb*|m_y2MKL#_qt`_kMx zqhza%C4*J34oAX8RhPQ=2G5^JhuGHmPk0FfUD2LYw_}mFp6w3K4&48eWCD1cohci| z*)c*FX)GxRLBBB^4A`m*>>EAoQ{@NhV}t$NBxhd_`6Mp~^nXh-;UeJdCBia`bjjP` zuMY?F;GgTk6JdGqU-4QV-d}eAMXm)3P#oVGC0lJQ8LT>v|6b3Z3+6GBE|o+pzo(Pq zkFV!K@5U{@O@`)>;JTRn36(U>0r!Fl%DljbHs>kSDzdv;Gi$W;!d zsvL^DLZ#Kl2wfzl@~%lfsUA{JC#eA%AzB~_xk{yKd{O zIhEqzW{J!^0sA{Q`9_!SH?g)k_{>_alSVS@UNaCY=G6pIz(7_1E>O)bnK_o+9QH-m zE~(`Bvg&ht-Z}D#z&6y&cqe=oSn<^A*l=pe6f(VHl>*i*k(sA}JEJk55K``isT zxnp44O{S4XS6sL{LlV<$MD!vk;A>-a|C<8-8z+I^bp-I^oO�aqdbVtEm4|FxT*1 zFUwM0cSN1S`E{N%&!6!a(`B4kC*?4j$Qp#c?!zFzpg+;g;wKyNijTAL3x}fC4>Nhx zo6lsq7NyQMg|wNZOO7Qi%t2=?3!y4kU8?eL@ucC(h6r5cGkC&vu(UFeR}35&+&wK3 zn9X2?Rdtqbs(>asZX$rDloDJd2%qDeR)-nYZeYM2MjTR%I=_Y^)$TrN&hSUM4i# z4G!jb=;Iu3^FaIsTv0k7%)1fJrE)j6_b5M>L`EvzU!gIRL3 z6rSJNu1L4b*^K9f>+xLM^$9@5IV)(B!%7weXVI>4ep5ZT?D&vVNGlXc|c%l>$cu2f|98`1RwoArT;dsZ@JSe;jwSm72I&BM2LuN0s^KFLMb>v^<*Mh6w= ztkf9;PlkixS$dLd>1=#W3eTU&;Te09TH{8Z_$EVjL6mK&aLpWD^Aw&xIf>_b74Ft` z9aNmNYR2UPT!8Aj647=fnhx}7<6F?wm}n}xsJLeZ!5~VPavaNwLNu5qH%lS8CE}6L>=0P7fLhu*f`!GFC+2xY(zIfk*Ux-ZUtJv_4TpbkyenAvu6TKFAW|z!- zM)tEYI`nby{>sCnvtZ^2o?#O5)x|8=qR7~`RFP(qE;*JpOz7h<{dF4?KK5iuVDeQY zSm-Z2Ns{3c53ArGL{U;NmjJ~~(j{lIq~Sv!hwmRfzIK2ztMN(C-&-7+{+>D?ORk+t zXKvR28%2&c7cZ?1((P|bWjcZx)0>x?C(1#pOJX?`7v5StF&ZUbOYy{i@}6jjo+9U@ zB7LYlQ3_J&^p5)fqR6=vR7zN5mdMPZc6`_utD3&obh&HwFCH@+5oLneJW;%`x{T#o z6c-iq$t)K{wNw9l{fd#$0gE5fZPaj;5n71yOynh?~f zs)b-}mF&MM1pjRk!L#b9rY6`L-Zq5dfRzTS0UiW4o?;3e$191yOnsnvrc@wNLAYi_##@y?EUrBtqnw294(aV4{9m|S>KA0spGiL0M zPDFzo5xw2C$n$6M_0TdUp z*CSY0TD@qQEG-4m$oEi~CBcA=j$`ZNqQI~<1U$!Ez%%lz21o&^cwBXjY#BuHa$KFU zQ;?cnGV{igvOoIfaGXP?OAK2heMaqdZGdMO!1W#{6?d$z4M&wsS#l;`NK{-BBXp4z ze$VkS3p+4;&25Rb4rsrs!v+Tw=c}F>%cwAM;c_D?8YN##0XXs<1Vdy1&ou{Zo(W!D zxp8@Lu)jQf*$wme^#et5!RoqLOeG4%9_vaqiWNFY3dNh+Zb)-#6b+(2*}X-FdB$QC zN35O|3#v#t&he}(7^7vfv=odZ-=_G=jo*l`R@cY>ghHp@Rw8QYaAGa4md%fdvpi6?>S zp&RlRU#y-J|0fEaGo8S?Qe{TVWN9g&Z}I+!k1>dkqKG;6>8vOo9L$oNHI|eEpg%4g=#c5s7T)GP zxD7EpaskR6JA6Rn-^MO(S=|zjESd7;Y^4^CM#3~K;)Vhm(7jIrN+7$bgH-74D#QNUE7 zn^{pR&|sF_tg)mV0NwnMFh+F=V``|gqwiHSgsur(FNhJBtX>ccs5G1N7J|_-Sz2RB z*?T>L`@LJ5lNrJAggvh4366}bi33)*#o{T>Gh~_9vlSz%;+eFPhVU6{ zJ|Hu5aCtBs3}1GzKNCNF+uPaOzq+(ATpTP-&#w%(_ZFA-_3w{wAQdOAUKsxiO8hKY zK9hCDQKMzDv=quqo-$_VYfeV_oL*0;&Fmj6Uo*dO&vb)QJ+*nYzPM?1hosxP4}L(A1h;KO9utFj^){OCk8661-|W!L2c9 z_3fn)yj|9l=$=6aqe!$nK7WnLxb581gP~X~A4e`V3#VpsN zI8PH@yPd@s%`TZaeL?NVN$$IszW4DFkB~-;h(sSD)h?rjLb6h!R0nl6jEInUfLK{I zYdHj0fDsl4t>#&-MQLkW$#Nka%#xcmmXrga+taBKwkJ|Q>IoaqU9th-F4%ower3gl zv-kCf_YC&=P&NjzFP44olAVGmSI){MQ&fA~R3n`U%gK9nAdrs8yxndey#I2t~%WDg~2SA~VmzL?3dO zBrqKnK9IrYryDiNxQ=8dSljdh*?Qi%ZhJS_pn@x(zYwA5H_>q z=8Yxg0O;fT8Y7>0GM-n<#_-%wUqd{#T9loFC|Ay^r6_f+*(Eb?EEz1iB^<}swe|O& zTE1y4v-=w2pVdoZsg*IM>9MYG#R?rHh3n^hE!_6e%O~|A@9qzuf6L(B{?f|$@d5GI z>fTs-I+zvbDogPEWD*P2Ojzv@6Ngd$^Gm4eAEk(sAp`a&DiIdU?q zTCE?+fmp9^APP@+h<8=@#eyluSy_HK>k2xo&_UYhxTAs4Dyl9caDU{{F;2cqlA)9L zfzgjVJY4Sg+dau473bp1rBA6pTc1)Kv09Qt1W~%PvTzhe-u*Ul{W_pL7U zhR#I%)lC*yCc3?y;P18L;=h9iOTq$S)@~*0`)Jwe`0#RCB)0#DoODpwDt?Q zEov2Std?1>ML}LB`Y|jQkF2ed{TJubx=nKQaUMDHbyGuR@E*amox`zN4E5+sh1yCi zl@f%S-nS~$qGhtQ6l#An$>o}t`Gux&4L|X?Y8cC=Ea3EPr`&JJyX&+55w~eop@JunB`g&BZyCAxuC19lKnTu!$!Vs z+4eA*&~M@bliT+VhB^cjA{6nx>i$?r1zP+s8l;<+;(sF$@gMWQy6*=JTXQ6j6mP6v z7E7#PIbst0U~rsKuwN zuaEx^#ZKH*P)DQWYlJbI!|sh$Wtnk0weZ}YcR$PfH9LTtn;zr)GLs@H@!9HC>{*L~ zZ9=zFNt<0V^Tv|0Kl->x>Us}z1B0&Og4L^Ixs)R3D1)xiDEV3nxjh>o=R2O_Z`EsJ z(Uc?m=v>UFUYiVWJt(V|iEwGCrphx|UC_*?bOv9t=dDMInN zXqhanv83#cKCX{ffBEaW@vUBKdWN4^BQ98dYb=#g7gK3+-cpg~bBlX6mXuZK=Y^jbEK^+u%SPTC-Huo$4ULK8Ro@m4 zC>a>_Bn4eGO1?&Ork0c(eH^-%ww=$~Kth%C4KpNIdg1d^V zR^Jf|u8b+o4%QWSjh4yMQn()STyZHs4ZykU`ZaI7o7~(Z7FVslGZtA9bCa^TYcxu} zmV))LVtrQK4*}_u!}(}XpB`)B(R;)jng}3%TYY!@Unp=cAibwqd^cJqOT&^|!=C6f zK_}o{>(SIF0o?`&QcA*a>JO;1KVxB4DQ-&LPdAyb4B4hIIEvJ|l2?ki<_GVFxl zy}QPPmHUn}O*p)L!gRcbvp8?{Mm?18Y;Xa-%Bo)#}Z$$cngNjRxtarDNSQ+Ta@2 z9kE^>Z=Y)og6KbrKMngkFS$4J-tzTfkgWwy!JcJZMRCrORKlBT#Mr5 z82aXlg3#=end5lY;XxnQ;rTv~kRe@SV?%hVdFlhb{(+T#^DRj6y6Ww+T@Xdceq}0< znWRgeg6(}C8y zN!Lkwn53=dS@rwJq^BtlbB#U=BwM-uioRYqzNJjIUg;m$KeOhQtg@H9Bhq9{)U+mO zl0A@zW&}%Wh3cL40r{(!Aph@DGeo20Yblpq{b|Y@>d=d86Z0d4UMJXv@jwWb-y!SY z#jmv}yKSPE>C|SDE_n*CAM(}2w44p|Bk~A4p+Tf_t8HJv_Omo z>83S-jU0w<%(%M#gOebhj?=A$*x(cYtG+juQBm4OPzDX7Ve&MBBSXd@fa$)euJPSi z*O_e}w1`SPta?u@gCcvXEFZ_Z5>Z9VWNCPoO=-cZCxxScN%grs-+PkxGB$d;q^sF5 zv}WQ()q7d4MR8pr`eRrwh-#~3|4l*kh&G}t<#g9cqBT3ajy@LVr7O90s`=o~OZp4L zsjXK8hT>w?_r)?QPYzNTMx*3wDGX2b3~`^QNgBs+YU>EYty9KOe6V_7ETr<}AXKfz z52Io7v=oMqR)#m#EgJ5#Q<5=k?v}(@Qu>qYzpcRDQy^|xeSa*oA}+2O4bn|Z!FrBj zeQu4l?V6ii_1d^*m8?jXPCUf+0P`e#UbmLwn_Z$S04ul6g|vPH1sq16wtT#Lda$~~6l0mFeJ$ipqQmx2iMBLF_t3oV0lv}$#NEvNxSZ9D;$zhZV<8k7+aAxlf+<=iOY>;F z?lFCB8`G?u>e-UkHf@06*Xt!2K=HBaLoC;#FafPmPyuLm$;>@8uX}*?mJ%`+R(0&Q$1S})up~C32=DZjxda7?8MosABp8sj3cDT)KIGK+~#J#E?jfGHTY+E9dXq0@-qw)H>m}cc%yCgk_b7}`07`6s* z?HP&o`yTcP^``h;^b-^_CHJ*?0{W@TTsq~z$QOF|AwQhjdEd+H~3o;M!h zI&Vqx@BI*$tbSaNs(+Lwq^DRc1l1_{e`aOZBN41;fA6gcTAYbn;)L5q!WC=z7H5Y2 zm0^fGdAIqtX0oYxWAziVV-RIKD+`RE7M>WPi_FT-N8&j$*%Vh|Cj_2n8PC!8xzK}X zhNZ^Q#txVt zsU$VyV|U4I^LuSBi}+miQQb!WC_wfs6W^mz^0h2z%;Yq`8@*G`;dV>%0gHHC^|4q& zg~>K0V2MV_*HQp}#Cshc2f!O7Rg#*HdUHErab@@5zWe%1!);-xMcl9YS=ls*(uCky ztSAvmFiUQhLhz$)f;^jR1e=Z>1h?oNp*0A_0jrP45-Luv0+oW$ERmU~ApDp|i1(QJ zaY73+#mlNs#6l=Cwk;7#G)lgfh3OhO-;I*M)DAL1!|!vF4B^LR)1PCx7R3qb$FW>I zt+q<`-xP$OXnUGR*i@EG<6Isb?k)8X_pVu99xP8cqhR8J)z8NwDozld$-06tS|&^D zj8LDotcO|J2&bkRh~k6QFT?^WP<&XWKr~Ba<|zHY91InmLQZsLS`(+?Q7M!}4% zrOLG`ReZ7fB+IoZR*rWJ%LQd^mF&NbCFKa{I)hpAL#E5EzE63SZE$Dt$^+8Q-g5t? ztBcG1>8bk$`&JM1qc@5tR-cjs22q@xtUN4cCh3wlmXw2_pAilQLe&M~FHS;uHu#=5 zTs$y|p}1i6i{Z$UDNl7=))hC5mdVnv}MN|6CbXAS&yK9^m-t?I*-M24X9D_|D;?4pZ3=P zQ7J5#Kr<@lE-N z<(u=X(rnKxF0CAtH!kR0t8GocR@}P!_4uFCYk*c=@0gbAI$9=6OX2?K%Ki57z1VY` zD2xlh^@u_w7H+AC=T@JQ^lNn~l_(8)8R*Tz*4inB;=d@x7uFOpJr5#2R}yj5=v_^I zy-t#jT?ByQg4J)xx*)*RZFIS~q1h!fPXYL41sDdCp6SdFKpQ&3$37bip~%=)rC>5k zWabH&-n*%d2|v48(po==s^SAQhw59w@0RAcHcI~A6vlJv z$S)cnQ)fEz!l)yQ6IXv6{}%w?G;7Nx<}yoU=2-HPVP9P5)S&M*eQwWtU#*bu9EHqw zj1_0L$p*Qe#Af&6?4b3jxBzWSt&5(DsP5ZPko1X>po& znN4~(0afM~*}oR`u31|u9%Yuu%(3Jn!oJ|-?O6yOrR&9`KH%e@_GJ;?a?D4I9#G`7 zvZuc=ns-IA$%IRznPj$ONBYGfRc-YpIbjgJP^cJG%Ee)p$joPDzaw27^@}TBJifZ! zWpPvM+r2SXj)Tg6q-s}F;f4{bFOL2Xl(|(|C3YG$&c>G-OUkY^ZYER$DpCpju2ur` z6C`bBeZh$pItZ5B8umw@3Hl+^`mVqnRiE&2q#b)wjwCzC{)& z*7>X~u(3i1!IBRT`=i@n2(VQb*mry1HQ0oBz}^vIuMhJOFIbgX15;D>{M~J`Ymn-N za-`d3fd{qpDbGUHY?GN|Nv#YeN7rX6B!{Z%b9>&k;;Axw>LN)`lLS@wwRrEs^1b-& z^7zia{{4-6%0*M@gbvA{B#DZEqm}STjL=ygFGn~&9A(<+drhC)^UnYDAlV4w2GV~4 zb!zkrsPXHWFms|j3qxm-PHGCn|C+=w48Q7EY^Pqh9z<)hrL2{-jTKKab0r*0;Y*E* z6*>r(d{o#U{V_qOMpa!L@xvaX)u_5%7=RKKRq*CYs^RK5`H`#RTsA6*utEnRj5#Lk zkA8O0L8Q7MIzRmM9d$sc8)E!N1 zBUq~w1{|8E#!z$_GcpbT>P`#&3)z^~x)$hR0eLp3@6G+u5v4{#1c$-;Q z;6=-1X({j)*MoPoobrsiiBrdO@Z>8Fp*-3KK48N%;)WIH45DP4O1RK8yJY4mG!J;1 zI1&-7N^m%Fw#x3W%X-Ddb|p-y&D8C079u=^andHH4DqJnW1#gYN#T{{b;my3<(Rwc zCGxJ6DPC|i{yPFvqRK{TIS1_Nksd3lRInJKi=^;g_AWWDpD#!%n_(!0QCwUT#U;C- zv3*kzjSOyMdTLGF?xF1Gix*ZlCd8pZ&UuO_iV->s)WTqyKCExLANpQ{d0KX2G#kuU z5$YhF2Xq8%^=LU_5QWZ}R7wSi0-Bii2+in2a2?1=#y7^|{?%jU z*C2Y8P_%OQ%S_TGPq{MgZ(kY2LQj@N72vOots?=})+<8zEPh={-?Rz?`bv}Y7J_1g z&XPj#t2{vqkvBk4{I5DKmK2)h4s^6fM=gcm1D+tYv-iR9p$hHfY;E1VG$+)-p;%DG zNj3U7)|Cb}S|&?NLHN~^5c)|3Ere6PBDK;{iE4$)nailHnWana8D1m@IzAlCN5e1k z4B3Is2o>r7+aPJvZ-%mxeO}V%Bym;fjD_OeVu>ztj_j-h3z9RDz;vz*)#vuS?Hqq) z$n6!4ZnjHKkaQjISYKS3xpQ#W{?(O*`C)(GNT?)t!RzIzJ7#1um~1dT6-KGH&Aeo= zxHLT_&!BJH8pez_t;#VEOG56KbVw3|R5b0SGRFvAgnlSvhX~E4>EKpzv=vWuWJlV+LR9Jev?IzFf( z1P^+G=4&*S_?paeSndy3mzR1L7P&7g>U=_-wJBTnBoTx)rz!3y*61RzF!8#Fx5vZ7 zZ;rD)LJbKLFW{mhRBA|Xm0TT*n|R$LdX7hg>0!y-Am7HZo&yl3vR>w&5Y1fv%0GYq F{{^OtbU*+A literal 0 HcmV?d00001 diff --git a/deploy/core/node_modules/active-x-obfuscator/.npmignore b/deploy/core/node_modules/active-x-obfuscator/.npmignore new file mode 100644 index 000000000..3f31ac20e --- /dev/null +++ b/deploy/core/node_modules/active-x-obfuscator/.npmignore @@ -0,0 +1,2 @@ +*.un~ +/node_modules diff --git a/deploy/core/node_modules/active-x-obfuscator/.package.json.un~ b/deploy/core/node_modules/active-x-obfuscator/.package.json.un~ new file mode 100644 index 0000000000000000000000000000000000000000..be97928ce1a3dabac3cd410842285d71e10b6db6 GIT binary patch literal 1015 zcmWH`%$*;a=aT=Ffyqhn#_Y6}@w>euF7DFyoul6KXr6dcu*aS)Qh6r|PpUj&U|W^lP|8irPE`PNfKt3r%m}2JfEWZoGz>HN`z+C60m(8l#9si(0s%}R zhz*j08N%=%2*4sBnNdK45CBGpCOA467`{pX&F2APJ|G4~Gbk!>MYU-oIQBqFkO3$r iL9qwYJ{o(VK%glA#-27bGZ7JcdHE^OjB48Wd=&tz@;r(F literal 0 HcmV?d00001 diff --git a/deploy/core/node_modules/active-x-obfuscator/.test.js.un~ b/deploy/core/node_modules/active-x-obfuscator/.test.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..3386aaf0d7be435b4932290ab04897a83f2ad242 GIT binary patch literal 76173 zcmeI5X^>sVRe(o}i4$*bv{NpbY`y>+hSjrl9lGaMNp{p-$;D>!tI zhHE&tQbM1CtL4SnBGDG8EGa3_zaylaH@y>F_`60V*ff7&wn4b2F+26>(dpT#!GVXH z2ag_}8Wl_ez)^h-ltAXHrtzNWsntmS**?;4TdGVmRk zoSUAX+B^Qhp`%A856m@t0tMhHE*s#I(*WlRP^^$4F+hJ#fiCaTmkr+fjuZUK(5LKp^yOMa}*}eb{Q19Z3AV948zv5eFmc%#)+#7zNvH)Db1eQ}> zAwWjvmvOFO!U`D@gXycCnD7!EW>h0gJJa?!G|s9=1(cwBw*(WgRzsG8(#(<=SC$M` zwNA;8Fl#6ckqs(hMwlRbk1HTJx$!#A6@*wJLn=#39_Z(Vyg;bBj4=P!dt)cU%{sz7 za%5_DuGc&PYNv&~i6E*D%|W4v6*44-;y-wb+D3*OLUed`YVPRlOk-y1SmSz|E<7|f zIX5`4dwO!Vd8B!0Zg}tRv0Eo5?rcx~fOxtqHh>FMXOJv42I@cdf;zA?n$SDLl^C*x zrZY&E8bk9$(+hx|$#D>17Jz1r+&Bi{*F3<^Hg<{b2)(mh zp&?skS$a%onG`jK=GQ$<65wz+ly^F?tdd{?vVzI1ksBvrvR2b$0?TSw8jyigrFfHB zA~BA^^bPM#m50a;NsPp{kJ<-T{hB0%b8OwSQ??!MNTP9K>MNHQIvJ zStdn|!TR65ux?)>)_&Ut07v$In7|mWZ0#xTiV<=ohU>R`aot&QJ=AOt#<^_87M2@a z@!?#RsQ9e2Op01rGFY`+2m7{XOM*(OQIQ`jZ91UK@x!ub=fL5?`2&ZyHl`kXL>6BrUkevN`dMulcHitn{A?>9Wr6mr26>SvnxGR+Da2fO*=afF1`<|3tODk zp5u@yoGFDaQxvwCBtv4@o}z45wx=?7KiF=pv7PM#5MY}uiNwI9hG;D*0G(x0)EI#8 z_RiTkrP-Cxn+{doDKO7>kN{mX2aE?l1x|o<3~zuwy?awl^@QqEo%|ZD9LIJ z+xK|K#qZj)MS^Yjo+Ow76!L#28E3a0tEIaA>s$r)a{>0C#q0 zmpNMvWFgfEml8p-kaGsfQe()i=|yf$joj8o8yui6bcJh(&h1ztDoX|!AxC1st?dQw z+#0y%(YZ&C&Ut(dDP6xSAt(zzXOJv49^YxLNk(UjxxOpDs?~(nMXrR9tgz_2sRC`0Wm*W1tqbQg0R1g!jBH|7Zs=gw7>r`Hhy4{)m|n=?n6ho^=QHy@O>xOV>sr%NQ5z)-nzqHr^_B*rn^HY&Gu zZEj|MxUKcvTHRmOdV=awS1>S=Ru|n0I%k=8L>(V{ezT%m-$th`r`!#6_4RKXx=hc= z2&O^^vH@2*aMI=$gw81MoGJ(}R)ibs2(8tupH;sM+dTj^=n4izQt6Uf@jYjmcSIF% zA5d@?wGe?uSGOd__bwP2={oYPdmqq-B$xmch$;o5St2oJ*~_G|s+_pTPL7Yg@XHD@ z3@iObHmn4Re&I1B0+)d;S3Dw2&)04AJ5-@51j!ax0&wX@8qO6ja+XO^ zV-WpnCn7UHO`&-bShl(nfUJ0uGf0-YWK1-6VDg>>lFMB&z{NFX`QI5OS&c#TYn`4% zW5*H(p7cH*xatTZ^}!rKhb5Q*8^F3}tu&Qpmc%#)@NX#K%Uh#H>&*><8I4S4?n%klmwYz=9ES zBnIJ3FN7PqA{=Oc-y2@rT@hgkKix=JT2W`26g7t5Bfa=t(48L}S%%sWfp&!}A3%Xv zR=%83lGPZ9kM@GtSRA5wVjCmaba#CyDoDXt*1>{7vZ5G_vx;%Jz7A&H;UzsVHnzw= z&k}Z5y7I!+W|E~}bcRV%vE*P#2_6%-9CrK@%5tQ|l9{2-{3Jf%^8|e^Ym*hS)~Uaq z<;FV83}-K8VB2~eA!FMGZ)F?|YowaiM#z@qP;Cn2M##0dwYcFjb!aE4gHXRpUv1XN zjbrN6lf9bxyLz_|3o6I(_zfT2bN7wcPuzUd{_Ag?xb2>s_wU_5e#7lI-#F3Hm;id0 z`+QUa!0+K)8Khx_42c2%l!D*Zy<_&m3$XyKg{%X7GpiRqhi~7vO&m=L&zU zkRdVrpXufJA9+Xk?{gzVfWOy$L@ER08NO0oDgZ{vk(dhbtgir=p2ZSI6z#Eroz($J zc%B2Ot0kBKk#RurT(d|{%oxpvfi}7$KR*n7!GojGgtmd}zC7X_4_@z+U;@j+&#aLf zXY=d6qq#k!2G^)7B`6C%XOJv48{Y|bG(+qCu7r?eL)V?0E5jbFkRfze)-|D9GdC~# zIQfo`9dG>z$oAH-*ZMbWJU_&g)xL$!lO0wiGX}i-?9CH!zJ?M6p$-)8W{uo9hI?(F zN+tIK1lO@W1OvOP%2FKH1=hD)Ny2 z0EG!cEr9%49G9jZD`ZF~d0R_>yy`;!4?D>-R<@@8-frZ1=S)s>-=+`k>m-;^6DYIJ zqzZjAOJW>D|BpTW6>=k{w|p7q7l^A_%$cq+Ib!j2L;#)}D z*Jz{J+Z(O5ijy~h1@H$$F^GT_5 z3!nk6&3pmwER&+f0ROlD6X4aCQ2>0q`z*j`B}AnFH%lbOxX!we7Mtv43eeBFmL_j#}%zkk!2+_KWm59;(}$I z;~*g8I&BY%YnoXSV=QScZe>+D=UUvCYVT3yB3fKVG=>Nyx}Ax0BH)7mdJYOAtdJow zh-z<4HAH90P4T2VPHO9EYY9O9ko#Cv0HEszhyvYNCPj^bzOGl7dCMZuyM4i{M_*~Q zp?jD6Ads&H)rGdROp01rGFWvWWI`*f`uNyO8ciI~H9!hJ0G zQ&L@JDxU8wlcL5jA5!K!yL4# zhrOedKnL6sGol+D(O)mEc2+D{@u+=en|(EQ8&Yp+rSA4xqw6Qjjz92_{3@IK z(l-37(uq#ppzl#B^}#HW7{}Cy5nmsu3#-D-AR6~_Q=r`&QV{{v>P6|joneyH7>L_F zL=u?!fw;8&i@@9K3JO?jA_`1rm?X8bq_?W*RU0TR^bQZxKhm1J8w zNsN#ql_ez;^z%Yy^QMb0-R6C%vy&#Tf~9d{UL86h*tM5?&d6$qE?m+ zR_#V{tQW=0Y7`gm{Mv6G2jBr$*89V)w{Wfi#R?e`19V)0Ufo)n?{v%I8qnS&nl{w? zrN|GsVguOL`U+HMm?X7YO_9_(6bZTbHGnUBFQpck`E^_px#vuCZPDFgO>>TbEya*(RBpl?N2)NFc zu!4hv2rFbr45F`kMBrH~VVwjTyU2kh)E<;z0#PW^Ar^`lAxB~;{+&`BZH+^^P#jo% zdQg2i5NhA;3JOswf=cm4vqWMH6n1POl~qM|J=)8gyf6BTthofqG&uwTmu|Aa@g07h>V+N+BoDa~fNO(+4Ti9P)D(N4s z+Cr#(Oo9nSp`mIn#_?b$UT54*Ah8L-St2p6EGg;x zT^` ztuPXkmA>Q6Ud-3HMz7&xHY6ZiBkKrm)YTlW4ZCF2rHN<=$Q&WjY0O!}Cgo5$sf@D{ z9+7}hQ7e;{%BeO<|F5#7WMP$s+wE}BO@oLdS2CNjEuNPnlS@`MJwp4 z)^_(3RM88$<r>tq~W;v_^p< z)aG14AzCOpgJh|moYy_Yf9XYWRjp5HPu;o?Q6ZTt*K#? z-%+pDTmUui3I@ai&KV?2^{~9|!F|0KxYc!VZEkQn=E?@c!p#{ZOZBY0?z#PIFK%^* z>vxNsfO^ao4u}`paT!gUB@$ySd0I&8b-?NQ@v&EG?}}^4A0VsStfr;o3(}E z40OLof(hiw{9;ZN+E^h&3=>(P>w2=pp7vYbO&jt@XcJ(YzN8Jv@0DNzErzT84z|Mz#_xAU2XVpb43ed0 zV;zaX8h+i}QHA2;uH+CdRGmSx)NHCzTd`X|S?{0%@dsSN0bHOugJh}MP%n>h)f*@3 zPl;jpgRb20Eliz3veay*TVt4ZAO+zQuGrwMrpjez<1CY+vU+Y0{wu4>Illl=dndEM z$et>LUKjrSu5;W=h`Lmmx3zot=90==AK=;6UrlK-eI}#S{)9(H2c)Zv#AZ^vL9a zx#p}-KRhx$b8zZ0$slwfRM;OOeGn?Mm810WW|hMpqi&fx>ZWWjg#D-xY`O%OG z5xA^67DUc4NvcOg)6uPsS%ApQPh!IamLKCd2*}Ji3nsHlYV0vB=1F_hlRnz&%B|7% zo&=Ilx)Oj(5pu5d*3L31YGp}DTvdG0-JJ8)dlk|C79tW@UxU8G^?8jh65S78*}WgE zvUC|O=n$zBpORogeHoIVv*}Vt%q)rVC1y#9v8sJdmO7&P_}J^8_8lS@RT9Q5Ao+B4 zvW4q1J1&UK5{YpPqR(_9+9Ed_=7s?g9`qTGgMe$RgyKbJk(@XN(Pup(@LVooL;@|X ztV_6g?LgSs?_M1auOF9S0!#R*j}{j*vn0kb{GRN^Z)2O^s7&v=00h`)UGacf06K$Y zso4OX1CGiX;X((5*ORV{uq^zXL9*0re&>1z?1B$mpL0b7Wx?kRlBLGr`&_T~bG^s6 z(D|VC6Rw1igdX43Eb~N+kRvhlp6W%f*87c&G!_B`*iX7L0#k>loGZf@XPFeWvZN&T zx|`^~{F=^)1Q)H0&lWh#ficgD`belAq#ZA z8-jSoFLq;WQw&*bu_?x=d`Z)sv@w08G1+V$uAZQQ?J3Q=^&dzJMrV*LH5;RQnOqB_ z{?yb0ictH!D=9<^MQ4yKHHPBxUe0(yr!(?4j0=5MlFlo+J%a6LUB{?@9(kxUs3WaKi{W62tBHdU12^=bixCoUV-# zY%jQyf)qDaDeh;MNQ`4J{=UbE2buY4MLS-^7rH(m{j4hz07<3WstPn`nG`h}n)AJ| zwmCdJ++`*QwijIqK}rQsDHzQXiE#|ZKk&YX2knxegG_x40St}^c%%GyUhTYkYVb+m z9hYDNSaLgq69pz#$dDMAf8=2@3^f7W(%-QfxWe%z%Sqzn5~vTQtra6=OAOaP@mz5^ z*y38jB?GAAa^__TCO`w!Mott5#0nV_1L{wEfs&{42RgrcG^lR^9tr>f_KGVaFu|-+ z0GcHd;~0Qn^Z?DvxF4Rjq4pYJ|2FEt4_>cwbr4wEYCv&7vr1|l!|%^LKiWPM_^o)n z`c@xgUbDYR3^hpU_m+yMIm@J|F{Hkvqz<+oA#{>@*W+7dOGHJ>`xNDYT%nahrdyiI zlEJF|;i7qoRhO@vd_!qH*qzp;(AqQev6<$v8QaD({=h?1lXH#cCHq4oj zeN*B`B|IX*HqVqsG8iX0(#6M+y0WSq-(xw-`#D>#7k)~L1Q*#Kb#8aQ99dGD&1H?y zy%{;Kh8hIz!a@$K64;f%pOpicLbs<+9o}8GRJt&&gj9ULqNpw)c*%HbVhL%n8 z{x@jkqI)YtcFyHqdc%)P*2o2GC9IPGS+|9Zy`5pVZmR`#?`>NxmqHC8IoU8?IaNY& zKa7wgr$}O5sgfA|tdQBf>EmP1)Lv}7B3#JDP~66MYI&E$z|7RKdN(*YuzPxPwt1v^ nXl{7#?y*}ZChly%U;>O@KnzxWC|`!6-ZTmN{|DALf8l=tWIajf literal 0 HcmV?d00001 diff --git a/deploy/core/node_modules/active-x-obfuscator/Readme.md b/deploy/core/node_modules/active-x-obfuscator/Readme.md new file mode 100644 index 000000000..34f2514e6 --- /dev/null +++ b/deploy/core/node_modules/active-x-obfuscator/Readme.md @@ -0,0 +1,33 @@ +# active-x-obfuscator + +A module to (safely) obfuscate all occurrences of the string 'ActiveX' inside +any JavaScript code. + +## Why? + +Some corporate firewalls /proxies such as Blue Coat block JavaScript files to be +downloaded if they contain the word `'ActiveX'`. That of course is very annoying +for libraries such as [socket.io][] that need to use `ActiveXObject` for +supporting IE8 and older. + +## Install + +``` +npm install active-x-obfuscator +``` + +## Usage + +```js +var activeXObfuscator = require('active-x-obfuscator'); +var code = 'foo(new ActiveXObject());'; + +var obfuscated = activeXObfuscator(code); +// -> foo(new window[(['Active'].concat('Object').join('X'))]) +``` + +## License + +Licensed under the MIT license. + +[socket.io]: http://socket.io/ diff --git a/deploy/core/node_modules/active-x-obfuscator/index.js b/deploy/core/node_modules/active-x-obfuscator/index.js new file mode 100644 index 000000000..57b421bdc --- /dev/null +++ b/deploy/core/node_modules/active-x-obfuscator/index.js @@ -0,0 +1,83 @@ +var ZeParser = require('zeparser').ZeParser; +var Util = require('util'); + +module.exports = ActiveXObfuscator; +function ActiveXObfuscator(code) { + if (!(this instanceof ActiveXObfuscator)) { + var obfuscator = new ActiveXObfuscator(code); + obfuscator.execute(); + return obfuscator.toString(); + } + + this._parser = ZeParser.createParser(code); +} + +var OBFUSCATED_ACTIVE_X_OBJECT = ActiveXObfuscator.OBFUSCATED_ACTIVE_X_OBJECT = + "(['Active'].concat('Object').join('X'))"; +var OBFUSCATED_ACTIVE_X = ActiveXObfuscator.OBFUSCATED_ACTIVE_X = + "(['Active'].concat('').join('X'))"; + +ActiveXObfuscator.prototype.execute = function() { + this._parser.tokenizer.fixValues(); + this._obfuscate(this.getAst()); +}; + +ActiveXObfuscator.prototype.getAst = function() { + return this._parser.stack; +}; + +ActiveXObfuscator.prototype.getWhiteTokens = function() { + return this._parser.tokenizer.wtree; +}; + +ActiveXObfuscator.prototype._obfuscate = function(ast) { + var self = this; + + ast.forEach(function(node, index) { + if (Array.isArray(node)) { + self._obfuscate(node); + return; + } + + switch (node.value) { + case 'ActiveXObject': + if (!node.isPropertyName) { + node.value = 'window[' + OBFUSCATED_ACTIVE_X_OBJECT + ']'; + break; + } + + var dot = ast[index - 1] + var whiteTokens = self.getWhiteTokens(); + whiteTokens[dot.tokposw].value = ''; + + node.value = '[' + OBFUSCATED_ACTIVE_X_OBJECT + ']'; + break; + case "'ActiveXObject'": + case '"ActiveXObject"': + node.value = OBFUSCATED_ACTIVE_X_OBJECT; + break; + case "'ActiveX'": + case '"ActiveX"': + node.value = OBFUSCATED_ACTIVE_X; + break; + default: + if (!/ActiveX/i.test(node.value)) { + break; + } + + if (!node.isComment) { + throw new Error('Unknown ActiveX occurence in: ' + Util.inspect(node)); + } + + node.value = node.value.replace(/ActiveX/i, 'Ac...eX'); + } + + }); +}; + +ActiveXObfuscator.prototype.toString = function() { + var whiteTokens = this.getWhiteTokens(); + return whiteTokens.reduce(function(output, node) { + return output += node.value; + }, ''); +}; diff --git a/deploy/core/node_modules/active-x-obfuscator/package.json b/deploy/core/node_modules/active-x-obfuscator/package.json new file mode 100644 index 000000000..9f8c35396 --- /dev/null +++ b/deploy/core/node_modules/active-x-obfuscator/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + "active-x-obfuscator@0.0.1", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/socket.io/node_modules/socket.io-client" + ] + ], + "_defaultsLoaded": true, + "_engineSupported": true, + "_from": "active-x-obfuscator@0.0.1", + "_id": "active-x-obfuscator@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/active-x-obfuscator", + "_nodeVersion": "v0.6.11", + "_npmUser": { + "email": "felix@debuggable.com", + "name": "felixge" + }, + "_npmVersion": "1.1.1", + "_phantomChildren": {}, + "_requested": { + "name": "active-x-obfuscator", + "raw": "active-x-obfuscator@0.0.1", + "rawSpec": "0.0.1", + "scope": null, + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/socket.io/socket.io-client" + ], + "_resolved": "https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz", + "_shasum": "089b89b37145ff1d9ec74af6530be5526cae1f1a", + "_shrinkwrap": null, + "_spec": "active-x-obfuscator@0.0.1", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/socket.io/node_modules/socket.io-client", + "author": { + "email": "felix@debuggable.com", + "name": "Felix Geisendörfer", + "url": "http://debuggable.com/" + }, + "bugs": { + "url": "https://github.com/felixge/node-active-x-obfuscator/issues" + }, + "dependencies": { + "zeparser": "0.0.5" + }, + "description": "A module to (safely) obfuscate all occurrences of the string 'ActiveX' inside any JavaScript code.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "089b89b37145ff1d9ec74af6530be5526cae1f1a", + "tarball": "https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/felixge/node-active-x-obfuscator", + "main": "./index", + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + } + ], + "name": "active-x-obfuscator", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-active-x-obfuscator.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "0.0.1" +} diff --git a/deploy/core/node_modules/active-x-obfuscator/test.js b/deploy/core/node_modules/active-x-obfuscator/test.js new file mode 100644 index 000000000..e8fc807fa --- /dev/null +++ b/deploy/core/node_modules/active-x-obfuscator/test.js @@ -0,0 +1,53 @@ +var activeXObfuscator = require('./index'); +var assert = require('assert'); + +var OBFUSCATED_ACTIVE_X_OBJECT = activeXObfuscator.OBFUSCATED_ACTIVE_X_OBJECT; +var OBFUSCATED_ACTIVE_X = activeXObfuscator.OBFUSCATED_ACTIVE_X; + +var input = + "foo(new ActiveXObject('Microsoft.XMLHTTP'))"; +var expected = + "foo(new window[" + OBFUSCATED_ACTIVE_X_OBJECT + "]('Microsoft.XMLHTTP'))"; +assert.equal(activeXObfuscator(input), expected); + +var input = + "var foo = 'ActiveXObject';"; +var expected = + "var foo = " + OBFUSCATED_ACTIVE_X_OBJECT + ";"; +assert.equal(activeXObfuscator(input), expected); + +var input = + 'var foo = "ActiveXObject";'; +var expected = + "var foo = " + OBFUSCATED_ACTIVE_X_OBJECT + ";"; +assert.equal(activeXObfuscator(input), expected); + +var input = + 'var foo = o.ActiveXObject;'; +var expected = + "var foo = o[" + OBFUSCATED_ACTIVE_X_OBJECT + "];"; +assert.equal(activeXObfuscator(input), expected); + +var input = + 'var foo = "ActiveX";'; +var expected = + "var foo = " + OBFUSCATED_ACTIVE_X + ";"; +assert.equal(activeXObfuscator(input), expected); + +var input = + "var foo = 'ActiveX';"; +var expected = + "var foo = " + OBFUSCATED_ACTIVE_X + ";"; +assert.equal(activeXObfuscator(input), expected); + +var input = + "var foo; // ActiveX is cool"; +var expected = + "var foo; // Ac...eX is cool"; +assert.equal(activeXObfuscator(input), expected); + +var input = + "var foo = 'ActiveX is cool';"; +assert.throws(function() { + activeXObfuscator(input); +}, /Unknown ActiveX occurence/); diff --git a/deploy/core/node_modules/ajv/.tonic_example.js b/deploy/core/node_modules/ajv/.tonic_example.js new file mode 100644 index 000000000..0c3cc86ce --- /dev/null +++ b/deploy/core/node_modules/ajv/.tonic_example.js @@ -0,0 +1,20 @@ +var Ajv = require('ajv'); +var ajv = Ajv({allErrors: true}); + +var schema = { + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "number", "maximum": 3 } + } +}; + +var validate = ajv.compile(schema); + +test({"foo": "abc", "bar": 2}); +test({"foo": 2, "bar": 4}); + +function test(data) { + var valid = validate(data); + if (valid) console.log('Valid!'); + else console.log('Invalid: ' + ajv.errorsText(validate.errors)); +} \ No newline at end of file diff --git a/deploy/core/node_modules/ajv/LICENSE b/deploy/core/node_modules/ajv/LICENSE new file mode 100644 index 000000000..810539685 --- /dev/null +++ b/deploy/core/node_modules/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Evgeny Poberezkin + +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 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. + diff --git a/deploy/core/node_modules/ajv/README.md b/deploy/core/node_modules/ajv/README.md new file mode 100644 index 000000000..2bc5d521e --- /dev/null +++ b/deploy/core/node_modules/ajv/README.md @@ -0,0 +1,1211 @@ +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for node.js and browser. Supports [v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals). + + +[![Build Status](https://travis-ci.org/epoberezkin/ajv.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv) +[![npm version](https://badge.fury.io/js/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Code Climate](https://codeclimate.com/github/epoberezkin/ajv/badges/gpa.svg)](https://codeclimate.com/github/epoberezkin/ajv) +[![Coverage Status](https://coveralls.io/repos/epoberezkin/ajv/badge.svg?branch=master&service=github)](https://coveralls.io/github/epoberezkin/ajv?branch=master) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) + + +__Please note__: You can start using NEW beta version [5.0.4](https://github.com/epoberezkin/ajv/releases/tag/5.0.4-beta.1) (see [migration guide from 4.x.x](https://github.com/epoberezkin/ajv/releases/tag/5.0.1-beta.0)) with the support of JSON-Schema draft-06 (not officially published yet): `npm install ajv@^5.0.4-beta`. + +Also see [docs](https://github.com/epoberezkin/ajv/tree/5.0.4-beta.1) for 5.0.4. + + +## Contents + +- [Performance](#performance) +- [Features](#features) +- [Getting started](#getting-started) +- [Frequently Asked Questions](https://github.com/epoberezkin/ajv/blob/master/FAQ.md) +- [Using in browser](#using-in-browser) +- [Command line interface](#command-line-interface) +- Validation + - [Keywords](#validation-keywords) + - [Formats](#formats) + - [$data reference](#data-reference) + - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) + - [Defining custom keywords](#defining-custom-keywords) + - [Asynchronous schema compilation](#asynchronous-compilation) + - [Asynchronous validation](#asynchronous-validation) +- Modifying data during validation + - [Filtering data](#filtering-data) + - [Assigning defaults](#assigning-defaults) + - [Coercing data types](#coercing-data-types) +- API + - [Methods](#api) + - [Options](#options) + - [Validation errors](#validation-errors) +- [Related packages](#related-packages) +- [Packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, History, License](#tests) + + +## Performance + +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + + +Performace of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:%7Cajv%7Cis-my-json-valid%7Cjsen%7Cschemasaurus%7Cthemis%7Cz-schema%7Cjsck%7Cjsonschema%7Cskeemas%7Ctv4%7Cjayschema&chd=t:100,68,61,22.8,17.6,6.6,2.7,0.9,0.7,0.4,0.1)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + + +## Features + +- Ajv implements full [JSON Schema draft 4](http://json-schema.org/) standard: + - all validation keywords (see [JSON-Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md)) + - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs (can be turned off) + - [formats](#formats) defined by JSON Schema draft 4 standard and custom formats (can be turned off) + - [validates schemas against meta-schema](#api-validateschema) +- supports [browsers](#using-in-browser) and nodejs 0.10-6.x +- [asynchronous loading](#asynchronous-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](#options) +- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages +- i18n error messages support with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package +- [filtering data](#filtering-data) from additional properties +- [assigning defaults](#assigning-defaults) to missing properties and items +- [coercing data](#coercing-data-types) to the types specified in `type` keywords +- [custom keywords](#defining-custom-keywords) +- keywords `switch`, `constant`, `contains`, `patternGroups`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON-schema v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [option v5](#options) +- [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#) for schemas using v5 keywords +- [v5 $data reference](#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](#asynchronous-validation) of custom formats and keywords + +Currently Ajv is the only validator that passes all the tests from [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), apart from the test that requires that `1.0` is not an integer that is impossible to satisfy in JavaScript). + + +## Install + +``` +npm install ajv +``` + +To install a stable beta version [5.0.4](https://github.com/epoberezkin/ajv/releases/tag/5.0.4-beta.1) (see [migration guide from 4.x.x](https://github.com/epoberezkin/ajv/releases/tag/5.0.1-beta.0)): + +``` +npm install ajv@^5.0.4-beta +``` + + +## Getting started + +Try it in the node REPL: https://tonicdev.com/npm/ajv + + +The fastest validation call: + +```javascript +var Ajv = require('ajv'); +var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} +var validate = ajv.compile(schema); +var valid = validate(data); +if (!valid) console.log(validate.errors); +``` + +or with less code + +```javascript +// ... +var valid = ajv.validate(schema, data); +if (!valid) console.log(ajv.errors); +// ... +``` + +or + +```javascript +// ... +ajv.addSchema(schema, 'mySchema'); +var valid = ajv.validate('mySchema', data); +if (!valid) console.log(ajv.errorsText()); +// ... +``` + +See [API](#api) and [Options](#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema stringified with [json-stable-stringify](https://github.com/substack/json-stable-stringify) as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +__Please note__: every time validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) + + +## Using in browser + +You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. + +If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). + +Then you need to load Ajv in the browser: +```html + +``` + +This bundle can be used with different module systems or creates global `Ajv` if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +Ajv is tested with these browsers: + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) + +__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/epoberezkin/ajv/issues/234)). + + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/jessedc/ajv-cli). It supports: + +- compiling JSON-schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/epoberezkin/ajv-pack)) +- validating data file(s) against JSON-schema +- testing expected validity of data against JSON-schema +- referenced schemas +- custom meta-schemas +- files in JSON and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + + +## Validation keywords + +Ajv supports all validation keywords from draft 4 of JSON-schema standard: + +- [type](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems +- [for objects](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minproperties, required, properties, patternProperties, additionalProperties, dependencies +- [compound keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, not, oneOf, anyOf, allOf + +With option `v5: true` Ajv also supports all validation keywords and [$data reference](#data-reference) from [v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON-schema standard: + +- [switch](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#switch-v5-proposal) - conditional validation with a sequence of if/then clauses +- [contains](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#contains-v5-proposal) - check that array contains a valid item +- [constant](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#constant-v5-proposal) - check that data is equal to some value +- [patternGroups](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#patterngroups-v5-proposal) - a more powerful alternative to patternProperties +- [patternRequired](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#patternrequired-v5-proposal) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-v5-proposal) - setting limits for date, time, etc. + +See [JSON-Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) for more details. + + +## Formats + +The following formats are supported for string validation with "format" keyword: + +- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). +- _time_: time with optional time-zone. +- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). +- _uri_: full uri with optional protocol. +- _email_: email address. +- _hostname_: host name acording to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). +- _ipv4_: IP address v4. +- _ipv6_: IP address v6. +- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. +- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). +- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). +- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `email`, and `hostname`. See [Options](#options) for details. + +You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. + +The option `unknownFormats` allows to change the behaviour in case an unknown format is encountered - Ajv can either ignore them (default now) or fail schema compilation (will be the default in 5.0.0). + +You can find patterns used for format validation and the sources that were used in [formats.js](https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js). + + +## $data reference + +With `v5` option you can use values from the validated data as the values for the schema keywords. See [v5 proposal](https://github.com/json-schema/json-schema/wiki/$data-(v5-proposal)) for more information about how it works. + +`$data` reference is supported in the keywords: constant, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. + +The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). + +Examples. + +This schema requires that the value in property `smaller` is less or equal than the value in the property larger: + +```javascript +var schema = { + "properties": { + "smaller": { + "type": "number", + "maximum": { "$data": "1/larger" } + }, + "larger": { "type": "number" } + } +}; + +var validData = { + smaller: 5, + larger: 7 +}; +``` + +This schema requires that the properties have the same format as their field names: + +```javascript +var schema = { + "additionalProperties": { + "type": "string", + "format": { "$data": "0#" } + } +}; + +var validData = { + 'date-time': '1963-06-19T08:30:06.283185Z', + email: 'joe.bloggs@example.com' +} +``` + +`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `constant` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. + + +## $merge and $patch keywords + +With v5 option and the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON-schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). + +To add keywords `$merge` and `$patch` to Ajv instance use this code: + +```javascript +require('ajv-merge-patch')(ajv); +``` + +Examples. + +Using `$merge`: + +```json +{ + "$merge": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": { + "properties": { "q": { "type": "number" } } + } + } +} +``` + +Using `$patch`: + +```json +{ + "$patch": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": [ + { "op": "add", "path": "/properties/q", "value": { "type": "number" } } + ] + } +} +``` + +The schemas above are equivalent to this schema: + +```json +{ + "type": "object", + "properties": { + "p": { "type": "string" }, + "q": { "type": "number" } + }, + "additionalProperties": false +} +``` + +The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. + +See the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) for more information. + + +## Defining custom keywords + +The advantages of using custom keywords are: + +- allow creating validation scenarios that cannot be expressed using JSON-Schema +- simplify your schemas +- help bringing a bigger part of the validation logic to your schemas +- make your schemas more expressive, less verbose and closer to your application domain +- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated + +If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). + +The concerns you have to be aware of when extending JSON-schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. + +You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. + +Ajv allows defining keywords with: +- validation function +- compilation function +- macro function +- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. + +Example. `range` and `exclusiveRange` keywords using compiled schema: + +```javascript +ajv.addKeyword('range', { type: 'number', compile: function (sch, parentSchema) { + var min = sch[0]; + var max = sch[1]; + + return parentSchema.exclusiveRange === true + ? function (data) { return data > min && data < max; } + : function (data) { return data >= min && data <= max; } +} }); + +var schema = { "range": [2, 4], "exclusiveRange": true }; +var validate = ajv.compile(schema); +console.log(validate(2.01)); // true +console.log(validate(3.99)); // true +console.log(validate(2)); // false +console.log(validate(4)); // false +``` + +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. + +See [Defining custom keywords](https://github.com/epoberezkin/ajv/blob/master/CUSTOM.md) for more details. + + +## Asynchronous compilation + +During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` method and `loadSchema` [option](#options). + +Example: + +```javascript +var ajv = new Ajv({ loadSchema: loadSchema }); + +ajv.compileAsync(schema, function (err, validate) { + if (err) return; + var valid = validate(data); +}); + +function loadSchema(uri, callback) { + request.json(uri, function(err, res, body) { + if (err || res.statusCode >= 400) + callback(err || new Error('Loading error: ' + res.statusCode)); + else + callback(null, body); + }); +} +``` + +__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. + + +## Asynchronous validation + +Example in node REPL: https://tonicdev.com/esp/ajv-asynchronous-validation + +You can define custom formats and keywords that perform validation asyncronously by accessing database or some service. You should add `async: true` in the keyword or format defnition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). + +If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. + +__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. + +Validation function for an asynchronous custom format/keyword should return a promise that resolves to `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). Ajv compiles asynchronous schemas to either [generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) (default) that can be optionally transpiled with [regenerator](https://github.com/facebook/regenerator) or to [es7 async function](http://tc39.github.io/ecmascript-asyncawait/) that can be transpiled with [nodent](https://github.com/MatAtBread/nodent) or with regenerator as well. You can also supply any other transpiler as a function. See [Options](#options). + +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both syncronous and asynchronous schemas. + +If you are using generators, the compiled validation function can be either wrapped with [co](https://github.com/tj/co) (default) or returned as generator function, that can be used directly, e.g. in [koa](http://koajs.com/) 1.0. `co` is a small library, it is included in Ajv (both as npm dependency and in the browser bundle). + +Generator functions are currently supported in Chrome, Firefox and node.js (0.11+); if you are using Ajv in other browsers or in older versions of node.js you should use one of available transpiling options. All provided async modes use global Promise class. If your platform does not have Promise you should use a polyfill that defines it. + +Validation result will be a promise that resolves to `true` or rejects with an exception `Ajv.ValidationError` that has the array of validation errors in `errors` property. + + +Example: + +```javascript +/** + * without "async" and "transpile" options (or with option {async: true}) + * Ajv will choose the first supported/installed option in this order: + * 1. native generator function wrapped with co + * 2. es7 async functions transpiled with nodent + * 3. es7 async functions transpiled with regenerator + */ + +var ajv = new Ajv; + +ajv.addKeyword('idExists', { + async: true, + type: 'number', + validate: checkIdExists +}); + + +function checkIdExists(schema, data) { + return knex(schema.table) + .select('id') + .where('id', data) + .then(function (rows) { + return !!rows.length; // true if record is found + }); +} + +var schema = { + "$async": true, + "properties": { + "userId": { + "type": "integer", + "idExists": { "table": "users" } + }, + "postId": { + "type": "integer", + "idExists": { "table": "posts" } + } + } +}; + +var validate = ajv.compile(schema); + +validate({ userId: 1, postId: 19 })) +.then(function (valid) { + // "valid" is always true here + console.log('Data is valid'); +}) +.catch(function (err) { + if (!(err instanceof Ajv.ValidationError)) throw err; + // data is invalid + console.log('Validation errors:', err.errors); +}); + +``` + +### Using transpilers with asyncronous validation functions. + +To use a transpiler you should separately install it (or load its bundle in the browser). + +Ajv npm package includes minified browser bundles of regenerator and nodent in dist folder. + + +#### Using nodent + +```javascript +var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +`npm install nodent` or use `nodent.min.js` from dist folder of npm package. + + +#### Using regenerator + +```javascript +var ajv = new Ajv({ /* async: 'es7', */ transpile: 'regenerator' }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +`npm install regenerator` or use `regenerator.min.js` from dist folder of npm package. + + +#### Using other transpilers + +```javascript +var ajv = new Ajv({ async: 'es7', transpile: transpileFunc }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +See [Options](#options). + + +#### Comparison of async modes + +|mode|transpile
    speed*|run-time
    speed*|bundle
    size| +|---|:-:|:-:|:-:| +|generators
    (native)|-|1.0|-| +|es7.nodent|1.35|1.1|183Kb| +|es7.regenerator|1.0|2.7|322Kb| +|regenerator|1.0|3.2|322Kb| + +\* Relative performance in node v.4, smaller is better. + +[nodent](https://github.com/MatAtBread/nodent) has several advantages: + +- much smaller browser bundle than regenerator +- almost the same performance of generated code as native generators in nodejs and the latest Chrome +- much better performace than native generators in other browsers +- works in IE 9 (regenerator does not) + +[regenerator](https://github.com/facebook/regenerator) is a more widely adopted alternative. + + +## Filtering data + +With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. + +This option modifies original data. + +Example: + +```javascript +var ajv = new Ajv({ removeAdditional: true }); +var schema = { + "additionalProperties": false, + "properties": { + "foo": { "type": "number" }, + "bar": { + "additionalProperties": { "type": "number" }, + "properties": { + "baz": { "type": "string" } + } + } + } +} + +var data = { + "foo": 0, + "additional1": 1, // will be removed; `additionalProperties` == false + "bar": { + "baz": "abc", + "additional2": 2 // will NOT be removed; `additionalProperties` != false + }, +} + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } +``` + +If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. + +If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). + +__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: + +```JSON +{ + "type": "object", + "oneOf": [ + { + "properties": { + "foo": { "type": "string" } + }, + "required": [ "foo" ], + "additionalProperties": false + }, + { + "properties": { + "bar": { "type": "integer" } + }, + "required": [ "bar" ], + "additionalProperties": false + } + ] +} +``` + +The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. + +With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). + +While this behaviour is unexpected (issues [#129](https://github.com/epoberezkin/ajv/issues/129), [#134](https://github.com/epoberezkin/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: + +```JSON +{ + "type": "object", + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "integer" } + }, + "additionalProperties": false, + "oneOf": [ + { "required": [ "foo" ] }, + { "required": [ "bar" ] } + ] +} +``` + +The schema above is also more efficient - it will compile into a faster function. + + +## Assigning defaults + +With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. + +This option modifies original data. + +__Please note__: by default the default value is inserted in the generated validation code as a literal (starting from v4.0), so the value inserted in the data will be the deep clone of the default in the schema. + +If you need to insert the default value in the data by reference pass the option `useDefaults: "shared"`. + +Inserting defaults by reference can be faster (in case you have an object in `default`) and it allows to have dynamic values in defaults, e.g. timestamp, without recompiling the schema. The side effect is that modifying the default value in any validated data instance will change the default in the schema and in other validated data instances. See example 3 below. + + +Example 1 (`default` in `properties`): + +```javascript +var ajv = new Ajv({ useDefaults: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "string", "default": "baz" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": 1 }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": "baz" } +``` + +Example 2 (`default` in `items`): + +```javascript +var schema = { + "type": "array", + "items": [ + { "type": "number" }, + { "type": "string", "default": "foo" } + ] +} + +var data = [ 1 ]; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // [ 1, "foo" ] +``` + +Example 3 (inserting "defaults" by reference): + +```javascript +var ajv = new Ajv({ useDefaults: 'shared' }); + +var schema = { + properties: { + foo: { + default: { bar: 1 } + } + } +} + +var validate = ajv.compile(schema); + +var data = {}; +console.log(validate(data)); // true +console.log(data); // { foo: { bar: 1 } } + +data.foo.bar = 2; + +var data2 = {}; +console.log(validate(data2)); // true +console.log(data2); // { foo: { bar: 2 } } +``` + +`default` keywords in other cases are ignored: + +- not in `properties` or `items` subschemas +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/epoberezkin/ajv/issues/42)) +- in `if` subschema of v5 `switch` keyword +- in schemas generated by custom macro keywords + + +## Coercing data types + +When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. + +This option modifies original data. + +__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. + + +Example 1: + +```javascript +var ajv = new Ajv({ coerceTypes: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "boolean" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": "1", "bar": "false" }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": false } +``` + +Example 2 (array coercions): + +```javascript +var ajv = new Ajv({ coerceTypes: 'array' }); +var schema = { + "properties": { + "foo": { "type": "array", "items": { "type": "number" } }, + "bar": { "type": "boolean" } + } +}; + +var data = { "foo": "1", "bar": ["false"] }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": [1], "bar": false } +``` + +The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). + +See [Coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md) for details. + + +## API + +##### new Ajv(Object options) -> Object + +Create Ajv instance. + +All the instance methods below are bound to the instance, so they can be used without the instance. + + +##### .compile(Object schema) -> Function<Object data> + +Generate validating function and cache the compiled schema for future use. + +Validating function returns boolean and has properties `errors` with the errors from the last validation (`null` if there were no errors) and `schema` with the reference to the original schema. + +Unless the option `validateSchema` is false, the schema will be validated against meta-schema and if schema is invalid the error will be thrown. See [options](#options). + + +##### .compileAsync(Object schema, Function callback) + +Asyncronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. Callback will always be called with 2 parameters: error (or null) and validating function. Error will be not null in the following cases: + +- missing schema can't be loaded (`loadSchema` calls callback with error). +- the schema containing missing reference is loaded, but the reference cannot be resolved. +- schema (or some referenced schema) is invalid. + +The function compiles schema and loads the first missing schema multiple times, until all missing schemas are loaded. + +See example in [Asynchronous compilation](#asynchronous-compilation). + + +##### .validate(Object schema|String key|String ref, data) -> Boolean + +Validate data using passed schema (it will be compiled and cached). + +Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. + +Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). + +__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. + +If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). + + +##### .addSchema(Array<Object>|Object schema [, String key]) + +Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. + +Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. + +Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. + + +Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. + +Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. + +By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. + + +##### .addMetaSchema(Array<Object>|Object schema [, String key]) + +Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). + +There is no need to explicitly add draft 4 meta schema (http://json-schema.org/draft-04/schema and http://json-schema.org/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. + +With option `v5: true` [meta-schema that includes v5 keywords](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json) also added. + + +##### .validateSchema(Object schema) -> Boolean + +Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON-Schema standard. + +By default this method is called automatically when the schema is added, so you rarely need to use it directly. + +If schema doesn't have `$schema` property it is validated against draft 4 meta-schema (option `meta` should not be false) or against [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#) if option `v5` is true. + +If schema has `$schema` property then the schema with this id (that should be previously added) is used to validate passed schema. + +Errors will be available at `ajv.errors`. + + +##### .getSchema(String key) -> Function<Object data> + +Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). Returned validating function has `schema` property with the reference to the original schema. + + +##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) + +Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. + +Schema can be removed using: +- key passed to `addSchema` +- it's full reference (id) +- RegExp that should match schema id or key (meta-schemas won't be removed) +- actual schema object that will be stable-stringified to remove schema from cache + +If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. + + +##### .addFormat(String name, String|RegExp|Function|Object format) + +Add custom format to validate strings. It can also be used to replace pre-defined formats for Ajv instance. + +Strings are converted to RegExp. + +Function should return validation result as `true` or `false`. + +If object is passed it should have properties `validate`, `compare` and `async`: + +- _validate_: a string, RegExp or a function as described above. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (from [v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) - `v5` option should be used). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. + +Custom formats can be also added via `formats` option. + + +##### .addKeyword(String keyword, Object definition) + +Add custom validation keyword to Ajv instance. + +Keyword should be different from all standard JSON schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. + +Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. +It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. + +Example Keywords: +- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON schema etc. +- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword + +Keyword definition is an object with the following properties: + +- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. +- _validate_: validating function +- _compile_: compiling function +- _macro_: macro function +- _inline_: compiling function that returns code (as string) +- _schema_: an optional `false` value used with "validate" keyword to not pass schema +- _metaSchema_: an optional meta-schema for keyword schema +- _modifying_: `true` MUST be passed if keyword modifies data +- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. +- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). +- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. +- _errors_: an optional boolean indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. + +_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. + +__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. + +See [Defining custom keywords](#defining-custom-keywords) for more details. + + +##### .getKeyword(String keyword) -> Object|Boolean + +Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. + + +##### .removeKeyword(String keyword) + +Removes custom or pre-defined keyword so you can redefine them. + +While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. + +__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. + + +##### .errorsText([Array<Object> errors [, Object options]]) -> String + +Returns the text with all errors in a String. + +Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). + + +## Options + +Defaults: + +```javascript +{ + // validation and reporting options: + v5: false, + allErrors: false, + verbose: false, + jsonPointers: false, + uniqueItems: true, + unicode: true, + format: 'fast', + formats: {}, + unknownFormats: 'ignore', + schemas: {}, + // referenced schema options: + missingRefs: true, + extendRefs: true, + loadSchema: undefined, // function(uri, cb) { /* ... */ cb(err, schema); }, + // options to modify validated data: + removeAdditional: false, + useDefaults: false, + coerceTypes: false, + // asynchronous validation options: + async: undefined, + transpile: undefined, + // advanced options: + meta: true, + validateSchema: true, + addUsedSchema: true, + inlineRefs: true, + passContext: false, + loopRequired: Infinity, + ownProperties: false, + multipleOfPrecision: false, + errorDataPath: 'object', + sourceCode: true, + messages: true, + beautify: false, + cache: new Cache +} +``` + +##### Validation and reporting options + +- _v5_: add keywords `switch`, `constant`, `contains`, `patternGroups`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON-schema v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals). With this option added schemas without `$schema` property are validated against [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#). `false` by default. +- _allErrors_: check all rules collecting all errors. Default is to return after the first error. +- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _jsonPointers_: set `dataPath` propery of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. +- _uniqueItems_: validate `uniqueItems` keyword (true by default). +- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. +- _format_: formats validation mode ('fast' by default). Pass 'full' for more correct and slow validation or `false` not to validate formats at all. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. +- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _unknownFormats_: handling of unknown formats. Option values: + - `true` (will be default in 5.0.0) - if the unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [v5 $data reference](#data-reference) and it is unknown the validation will fail. + - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if some other unknown format is used. If `format` keyword value is [v5 $data reference](#data-reference) and it is not in this array the validation will fail. + - `"ignore"` (default now) - to log warning during schema compilation and always pass validation. This option is not recommended, as it allows to mistype format name. This behaviour is required by JSON-schema specification. +- _schemas_: an array or object of schemas that will be added to the instance. If the order is important, pass array. In this case schemas must have IDs in them. Otherwise the object can be passed - `addSchema(value, key)` will be called for each schema in this object. + + +##### Referenced schema options + +- _missingRefs_: handling of missing referenced schemas. Option values: + - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). + - `"ignore"` - to log error during compilation and always pass validation. + - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. +- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: + - `true` (default) - validate all keywords in the schemas with `$ref`. + - `"ignore"` - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. + - `"fail"` - if other validation keywords are used together with `$ref` the exception will be throw when the schema is compiled. +- _loadSchema_: asynchronous function that will be used to load remote schemas when the method `compileAsync` is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept 2 parameters: remote schema uri and node-style callback. See example in [Asynchronous compilation](#asynchronous-compilation). + + +##### Options to modify validated data + +- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: + - `false` (default) - not to remove additional properties + - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). + - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. + - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). +- _useDefaults_: replace missing properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: + - `false` (default) - do not use defaults + - `true` - insert defaults by value (safer and slower, object literal is used). + - `"shared"` - insert defaults by reference (faster). If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md). Option values: + - `false` (default) - no type coercion. + - `true` - coerce scalar data types. + - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). + + +##### Asynchronous validation options + +- _async_: determines how Ajv compiles asynchronous schemas (see [Asynchronous validation](#asynchronous-validation)) to functions. Option values: + - `"*"` / `"co*"` - compile to generator function ("co*" - wrapped with `co.wrap`). If generators are not supported and you don't provide `transpile` option, the exception will be thrown when Ajv instance is created. + - `"es7"` - compile to es7 async function. Unless your platform supports them you need to provide `transpile` option. Currently only MS Edge 13 with flag supports es7 async functions according to [compatibility table](http://kangax.github.io/compat-table/es7/)). + - `true` - if transpile option is not passed Ajv will choose the first supported/installed async/transpile modes in this order: "co*" (native generator with co.wrap), "es7"/"nodent", "co*"/"regenerator" during the creation of the Ajv instance. If none of the options is available the exception will be thrown. + - `undefined`- Ajv will choose the first available async mode in the same way as with `true` option but when the first asynchronous schema is compiled. +- _transpile_: determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `"nodent"` - transpile with [nodent](https://github.com/MatAtBread/nodent). If nodent is not installed, the exception will be thrown. nodent can only transpile es7 async functions; it will enforce this mode. + - `"regenerator"` - transpile with [regenerator](https://github.com/facebook/regenerator). If regenerator is not installed, the exception will be thrown. + - a function - this function should accept the code of validation function as a string and return transpiled code. This option allows you to use any other transpiler you prefer. + + +##### Advanced options + +- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). With option `v5: true` [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#) will be added as well. If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can either be http://json-schema.org/schema or http://json-schema.org/draft-04/schema or absent (draft-4 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: + - `true` (default) - if the validation fails, throw the exception. + - `"log"` - if the validation fails, log error. + - `false` - skip schema validation. +- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `id` property that doesn't start with "#". If `id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `id` uniqueness check when these methods are used. This option does not affect `addSchema` method. +- _inlineRefs_: Affects compilation of referenced schemas. Option values: + - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. + - `false` - to not inline referenced schemas (they will be compiled as separate functions). + - integer number - to limit the maximum number of keywords of the schema that will be inlined. +- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. +- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. +- _ownProperties_: by default ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/epoberezkin/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_: set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n)). +- _beautify_: format the generated function with [js-beautify](https://github.com/beautify-web/js-beautify) (the validating function is generated without line-breaks). `npm install js-beautify` to use this option. `true` or js-beautify options can be passed. +- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. + + +## Validation errors + +In case of validation failure Ajv assigns the array of errors to `.errors` property of validation function (or to `.errors` property of Ajv instance in case `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation) the returned promise is rejected with the exception of the class `Ajv.ValidationError` that has `.errors` poperty. + + +### Error objects + +Each error is an object with the following properties: + +- _keyword_: validation keyword. +- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). +- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package). See below for parameters set by all keywords. +- _message_: the standard error message (can be excluded with option `messages` set to false). +- _schema_: the schema of the keyword (added with `verbose` option). +- _parentSchema_: the schema containing the keyword (added with `verbose` option) +- _data_: the data validated by the keyword (added with `verbose` option). + + +### Error parameters + +Properties of `params` object in errors depend on the keyword that failed validation. + +- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). +- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). +- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). +- `patternGroups` (with v5 option) - properties: + - `pattern` + - `reason` ("minimum"/"maximum"), + - `limit` (max/min allowed number of properties matching number) +- `dependencies` - properties: + - `property` (dependent property), + - `missingProperty` (required missing dependency - only the first one is reported currently) + - `deps` (required dependencies, comma separated list as a string), + - `depsCount` (the number of required dependedncies). +- `format` - property `format` (the schema of the keyword). +- `maximum`, `minimum` - properties: + - `limit` (number, the schema of the keyword), + - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), + - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") +- `multipleOf` - property `multipleOf` (the schema of the keyword) +- `pattern` - property `pattern` (the schema of the keyword) +- `required` - property `missingProperty` (required property that is missing). +- `patternRequired` (with v5 option) - property `missingPattern` (required pattern that did not match any property). +- `type` - property `type` (required type(s), a string, can be a comma-separated list) +- `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). +- `$ref` - property `ref` with the referenced schema URI. +- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). + + +## Related packages + +- [ajv-cli](https://github.com/epoberezkin/ajv-cli) - command line interface for Ajv +- [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) - internationalised error messages +- [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) - keywords $merge and $patch from v5 proposals. +- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - several custom keywords that can be used with Ajv (typeof, instanceof, range, propertyNames) + + +## Some packages using Ajv + +- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator +- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON-schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON-schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON-Schema +- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file +- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages + + +## Tests + +``` +npm install +git submodule update --init +npm test +``` + +## Contributing + +All validation functions are generated using doT templates in [dot](https://github.com/epoberezkin/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. + +`npm run build` - compiles templates to [dotjs](https://github.com/epoberezkin/ajv/tree/master/lib/dotjs) folder. + +`npm run watch` - automatically compiles templates when files in dot folder change + +Please see [Contributing guidelines](https://github.com/epoberezkin/ajv/blob/master/CONTRIBUTING.md) + + +## Changes history + +See https://github.com/epoberezkin/ajv/releases + +__Please note__: [Changes in version 5.0.1-beta](https://github.com/epoberezkin/ajv/releases/tag/5.0.1-beta.0). + +[Changes in version 4.6.0](https://github.com/epoberezkin/ajv/releases/tag/4.6.0). + +[Changes in version 4.0.0](https://github.com/epoberezkin/ajv/releases/tag/4.0.0). + +[Changes in version 3.0.0](https://github.com/epoberezkin/ajv/releases/tag/3.0.0). + +[Changes in version 2.0.0](https://github.com/epoberezkin/ajv/releases/tag/2.0.0). + + +## License + +[MIT](https://github.com/epoberezkin/ajv/blob/master/LICENSE) diff --git a/deploy/core/node_modules/ajv/dist/ajv.bundle.js b/deploy/core/node_modules/ajv/dist/ajv.bundle.js new file mode 100644 index 000000000..7a6cdca67 --- /dev/null +++ b/deploy/core/node_modules/ajv/dist/ajv.bundle.js @@ -0,0 +1,8023 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|\:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +function regex(str) { + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + + +function compareDate(d1, d2) { + if (!(d1 && d2)) return; + if (d1 > d2) return 1; + if (d1 < d2) return -1; + if (d1 === d2) return 0; +} + + +function compareTime(t1, t2) { + if (!(t1 && t2)) return; + t1 = t1.match(TIME); + t2 = t2.match(TIME); + if (!(t1 && t2)) return; + t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); + t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); + if (t1 > t2) return 1; + if (t1 < t2) return -1; + if (t1 === t2) return 0; +} + + +function compareDateTime(dt1, dt2) { + if (!(dt1 && dt2)) return; + dt1 = dt1.split(DATE_TIME_SEPARATOR); + dt2 = dt2.split(DATE_TIME_SEPARATOR); + var res = compareDate(dt1[0], dt2[0]); + if (res === undefined) return; + return res || compareTime(dt1[1], dt2[1]); +} + +},{"./util":11}],6:[function(require,module,exports){ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , stableStringify = require('json-stable-stringify') + , async = require('../async'); + +var beautify; + +function loadBeautify(){ + if (beautify === undefined) { + var name = 'js-beautify'; + try { beautify = require(name).js_beautify; } + catch(e) { beautify = false; } + } +} + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var co = require('co'); +var ucs2length = util.ucs2length; +var equal = require('./equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = require('./validation_error'); + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = [] + , keepSourceCode = opts.sourceCode !== false; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (keepSourceCode) cv.sourceCode = v.sourceCode; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + function callValidate() { + var validate = compilation.validate; + var result = validate.apply(null, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + if ($async && !opts.transpile) async.setup(opts); + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.beautify) { + loadBeautify(); + /* istanbul ignore else */ + if (beautify) sourceCode = beautify(sourceCode, opts.beautify); + else console.error('"npm install js-beautify" to use beautify option'); + } + // console.log('\n\n\n *** \n', sourceCode); + var validate, validateCode + , transpile = opts._transpileFunc; + try { + validateCode = $async && transpile + ? transpile(sourceCode) + : sourceCode; + + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'co', + 'equal', + 'ucs2length', + 'ValidationError', + validateCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + co, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + console.error('Error compiling schema, function code:', validateCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (keepSourceCode) validate.sourceCode = sourceCode; + if (opts.sourceCode === true) { + validate.source = { + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (!v) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v) { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + var validateSchema = rule.definition.validateSchema; + if (validateSchema && self._opts.validateSchema !== false) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') console.error(message); + else throw new Error(message); + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + } + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + cleanUpVarErrors: cleanUpVarErrors, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + stableStringify: require('json-stable-stringify'), + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i', + $result = 'result' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); + if (!$exclusive) { + out += '='; + } + out += ' 0;'; + } + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '}'; + return out; +} + +},{}],14:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limit(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<'; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var exclusive' + ($lvl) + '; if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && typeof ' + ($schemaValueExcl) + ' != \'undefined\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ((exclusive' + ($lvl) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ') || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = exclusive' + ($lvl) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp); + if ($exclusive) { + out += '='; + } + out += ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') {'; + } + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],15:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],16:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitLength(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],17:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],18:[function(require,module,exports){ +'use strict'; +module.exports = function generate_allOf(it, $keyword) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],19:[function(require,module,exports){ +'use strict'; +module.exports = function generate_anyOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return it.util.schemaHasRules($sch, it.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],20:[function(require,module,exports){ +'use strict'; +module.exports = function generate_constant(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('constant') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + return out; +} + +},{}],21:[function(require,module,exports){ +'use strict'; +module.exports = function generate_custom(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($validateSchema) { + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') {'; + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += '' + (it.yieldAwait); + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + if ($validateSchema) { + out += ' }'; + } + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],26:[function(require,module,exports){ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],27:[function(require,module,exports){ +'use strict'; +module.exports = function generate_not(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} + +},{}],28:[function(require,module,exports){ +'use strict'; +module.exports = function generate_oneOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; + var $currentBaseId = $it.baseId; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],29:[function(require,module,exports){ +'use strict'; +module.exports = function generate_pattern(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],30:[function(require,module,exports){ +'use strict'; +module.exports = function generate_patternRequired(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $key = 'key' + $lvl, + $matched = 'patternMatched' + $lvl, + $closingBraces = '', + $ownProperties = it.opts.ownProperties; + out += 'var ' + ($valid) + ' = true;'; + var arr1 = $schema; + if (arr1) { + var $pProperty, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $pProperty = arr1[i1 += 1]; + out += ' var ' + ($matched) + ' = false; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; + var $missingPattern = it.util.escapeQuotes($pProperty); + out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + } + out += '' + ($closingBraces); + return out; +} + +},{}],31:[function(require,module,exports){ +'use strict'; +module.exports = function generate_properties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt; + var $schemaKeys = Object.keys($schema || {}), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); + if (it.opts.v5) { + var $pgProperties = it.schema.patternGroups || {}, + $pgPropertyKeys = Object.keys($pgProperties); + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($checkAdditional) { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 5) { + out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + if (it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length) { + var arr3 = $pgPropertyKeys; + if (arr3) { + var $pgProperty, $i = -1, + l3 = arr3.length - 1; + while ($i < l3) { + $pgProperty = arr3[$i += 1]; + out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have additional properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr4 = $schemaKeys; + if (arr4) { + var $propertyKey, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $propertyKey = arr4[i4 += 1]; + var $sch = $schema[$propertyKey]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + var arr5 = $pPropertyKeys; + if (arr5) { + var $pProperty, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $pProperty = arr5[i5 += 1]; + var $sch = $pProperties[$pProperty]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (it.opts.v5) { + var arr6 = $pgPropertyKeys; + if (arr6) { + var $pgProperty, i6 = -1, + l6 = arr6.length - 1; + while (i6 < l6) { + $pgProperty = arr6[i6 += 1]; + var $pgSchema = $pgProperties[$pgProperty], + $sch = $pgSchema.schema; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; + out += ' var pgPropCount' + ($lvl) + ' = 0; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + var $pgMin = $pgSchema.minimum, + $pgMax = $pgSchema.maximum; + if ($pgMin !== undefined || $pgMax !== undefined) { + out += ' var ' + ($valid) + ' = true; '; + var $currErrSchemaPath = $errSchemaPath; + if ($pgMin !== undefined) { + var $limit = $pgMin, + $reason = 'minimum', + $moreOrLess = 'less'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($pgMax !== undefined) { + out += ' else '; + } + } + if ($pgMax !== undefined) { + var $limit = $pgMax, + $reason = 'maximum', + $moreOrLess = 'more'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],32:[function(require,module,exports){ +'use strict'; +module.exports = function generate_ref(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $async, $refCode; + if ($schema == '#' || $schema == '#/') { + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + } else { + var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); + if ($refVal === undefined) { + var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; + if (it.opts.missingRefs == 'fail') { + console.log($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; + } + if (it.opts.verbose) { + out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + if ($breakOnError) { + out += ' if (false) { '; + } + } else if (it.opts.missingRefs == 'ignore') { + console.log($message); + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + } + } else if ($refVal.inline) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); + out += ' ' + ($code) + ' '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + } + } else { + $async = $refVal.$async === true; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + if (it.opts.passContext) { + out += ' ' + ($refCode) + '.call(this, '; + } else { + out += ' ' + ($refCode) + '( '; + } + out += ' ' + ($data) + ', (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it.async) throw new Error('async schema referenced by sync schema'); + out += ' try { '; + if ($breakOnError) { + out += 'var ' + ($valid) + ' ='; + } + out += ' ' + (it.yieldAwait) + ' ' + (__callValidate) + '; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + } + } else { + out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' else { '; + } + } + } + return out; +} + +},{}],33:[function(require,module,exports){ +'use strict'; +module.exports = function generate_required(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $vSchema = 'schema' + $lvl; + if (!$isData) { + if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { + var $required = []; + var arr1 = $schema; + if (arr1) { + var $property, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $property = arr1[i1 += 1]; + var $propertySch = it.schema.properties[$property]; + if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var _$property, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + _$property = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty(_$property); + out += ' ( ' + ($data) + ($prop) + ' === undefined && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $reqProperty, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $reqProperty = arr3[i3 += 1]; + var $prop = it.util.getProperty($reqProperty), + $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + out += ' if (' + ($data) + ($prop) + ' === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} + +},{}],34:[function(require,module,exports){ +'use strict'; +module.exports = function generate_switch(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $ifPassed = 'ifPassed' + it.level, + $currentBaseId = $it.baseId, + $shouldContinue; + out += 'var ' + ($ifPassed) + ';'; + var arr1 = $schema; + if (arr1) { + var $sch, $caseIndex = -1, + l1 = arr1.length - 1; + while ($caseIndex < l1) { + $sch = arr1[$caseIndex += 1]; + if ($caseIndex && !$shouldContinue) { + out += ' if (!' + ($ifPassed) + ') { '; + $closingBraces += '}'; + } + if ($sch.if && it.util.schemaHasRules($sch.if, it.RULES.all)) { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + $it.schema = $sch.if; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; + } else { + out += ' ' + ($ifPassed) + ' = true; '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + } + $shouldContinue = $sch.continue + } + } + out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + '; '; + out = it.util.cleanUpCode(out); + return out; +} + +},{}],35:[function(require,module,exports){ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],36:[function(require,module,exports){ +'use strict'; +module.exports = function generate_validate(it, $keyword) { + var out = ''; + var $async = it.schema.$async === true; + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.root.schema.id); + it.baseId = it.baseId || it.rootId; + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + delete it.isTop; + it.dataPathArr = [undefined]; + out += ' var validate = '; + if ($async) { + if ($es7) { + out += ' (async function '; + } else { + if (it.opts.async == 'co*') { + out += 'co.wrap'; + } + out += '(function* '; + } + } else { + out += ' (function '; + } + out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data;'; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if (it.schema.id) it.baseId = it.resolve.url(it.baseId, it.schema.id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + if ($coerceToTypes) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } } '; + } + } + var $refKeywords; + if (it.schema.$ref && ($refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'))) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs == 'ignore') { + $refKeywords = false; + console.log('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs !== true) { + console.log('$ref: all keywords used in schema at path "' + it.errSchemaPath + '". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour'); + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults && !it.compositeRule) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + out += ' ' + ($rule.code(it, $rule.keyword)) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type) { + var $typeChecked = true; + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($typeSchema && !$typeChecked && !(it.opts.coerceTypes && $coerceToTypes)) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return true; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }); return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top && $breakOnError) { + out = it.util.cleanUpVarErrors(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + for (var i = 0; i < $rulesGroup.rules.length; i++) + if ($shouldUseRule($rulesGroup.rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.keyword == 'properties' && (it.schema.additionalProperties === false || typeof it.schema.additionalProperties == 'object' || (it.schema.patternProperties && Object.keys(it.schema.patternProperties).length) || (it.opts.v5 && it.schema.patternGroups && Object.keys(it.schema.patternGroups).length))); + } + return out; +} + +},{}],37:[function(require,module,exports){ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$\-]*$/i; +var customRuleCode = require('./dotjs/custom'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword +}; + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + if (definition.macro && definition.valid !== undefined) + throw new Error('"valid" option cannot be used with macro keywords'); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + var i, len = dataType.length; + for (i=0; i 2) res = slice.call(arguments, 1); + resolve(res); + }); + }); +} + +/** + * Convert an array of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Array} obj + * @return {Promise} + * @api private + */ + +function arrayToPromise(obj) { + return Promise.all(obj.map(toPromise, this)); +} + +/** + * Convert an object of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Object} obj + * @return {Promise} + * @api private + */ + +function objectToPromise(obj){ + var results = new obj.constructor(); + var keys = Object.keys(obj); + var promises = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var promise = toPromise.call(this, obj[key]); + if (promise && isPromise(promise)) defer(promise, key); + else results[key] = obj[key]; + } + return Promise.all(promises).then(function () { + return results; + }); + + function defer(promise, key) { + // predefine the key in the result + results[key] = undefined; + promises.push(promise.then(function (res) { + results[key] = res; + })); + } +} + +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + +function isPromise(obj) { + return 'function' == typeof obj.then; +} + +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGenerator(obj) { + return 'function' == typeof obj.next && 'function' == typeof obj.throw; +} + +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ +function isGeneratorFunction(obj) { + var constructor = obj.constructor; + if (!constructor) return false; + if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; + return isGenerator(constructor.prototype); +} + +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ + +function isObject(val) { + return Object == val.constructor; +} + +},{}],42:[function(require,module,exports){ +var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); + +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return json.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || json.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return json.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = json.stringify(key) + + colonSeparator + + value; + ; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; + +},{"jsonify":43}],43:[function(require,module,exports){ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); + +},{"./lib/parse":44,"./lib/stringify":45}],44:[function(require,module,exports){ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + +value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } +}; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; +}; + +},{}],45:[function(require,module,exports){ +var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; + +},{}],46:[function(require,module,exports){ +(function (global){ +/*! https://mths.be/punycode v1.4.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],47:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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 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. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{}],48:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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 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. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + +},{}],49:[function(require,module,exports){ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); + +},{"./decode":47,"./encode":48}],50:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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 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. + +'use strict'; + +var punycode = require('punycode'); +var util = require('./util'); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; + +},{"./util":51,"punycode":46,"querystring":49}],51:[function(require,module,exports){ +'use strict'; + +module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } +}; + +},{}],"ajv":[function(require,module,exports){ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , v5 = require('./v5') + , util = require('./compile/util') + , async = require('./async') + , co = require('co'); + +module.exports = Ajv; + +Ajv.prototype.compileAsync = async.compile; + +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.ValidationError = require('./compile/validation_error'); + +var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema'; +var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i; +function SCHEMA_URI_FORMAT_FUNC(str) { + return SCHEMA_URI_FORMAT.test(str); +} + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + var self = this; + + opts = this._opts = util.copy(opts) || {}; + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + + // this is done on purpose, so that methods are bound to the instance + // (without using bind) so that they can be used without the instance + this.validate = validate; + this.compile = compile; + this.addSchema = addSchema; + this.addMetaSchema = addMetaSchema; + this.validateSchema = validateSchema; + this.getSchema = getSchema; + this.removeSchema = removeSchema; + this.addFormat = addFormat; + this.errorsText = errorsText; + + this._addSchema = _addSchema; + this._compile = _compile; + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.async || opts.transpile) async.setup(opts); + if (opts.beautify === true) opts.beautify = { indent_size: 2 }; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + this._metaOpts = getMetaSchemaOptions(); + + if (opts.formats) addInitialFormats(); + addDraft4MetaSchema(); + if (opts.v5) v5.enable(this); + if (typeof opts.meta == 'object') addMetaSchema(opts.meta); + addInitialSchemas(); + + + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = _addSchema(schemaKeyRef); + v = schemaObj.validate || _compile(schemaObj); + } + + var valid = v(data); + if (v.$async === true) + return self._opts.async == '*' ? co(valid) : valid; + self.errors = v.errors; + return valid; + } + + + /** + * Create validating function for passed schema. + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ + function compile(schema, _meta) { + var schemaObj = _addSchema(schema, undefined, _meta); + return schemaObj.validate || _compile(schemaObj); + } + + + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + */ + function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + function errorsText(errors, options) { + errors = errors || self.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i=1&&t<=12&&a>=1&&a<=m[t]}function o(e,r){var t=e.match(v);if(!t)return!1;var a=t[1],s=t[2],o=t[3],i=t[5];return a<=23&&s<=59&&o<=59&&(!r||i)}function i(e){var r=e.split(b);return 2==r.length&&s(r[0])&&o(r[1],!0)}function n(e){return e.length<=255&&y.test(e)}function l(e){return w.test(e)&&g.test(e)}function c(e){try{return new RegExp(e),!0}catch(e){return!1}}function h(e,r){if(e&&r)return e>r?1:er?1:e=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:r,baseId:t},{index:a,compiling:!1})}function i(e,r,t){var a=n.call(this,e,r,t);a>=0&&this._compilations.splice(a,1)}function n(e,r,t){for(var a=0;a=55296&&r<=56319&&s=r)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(a>r)throw new Error("Cannot access data "+a+" levels up, current level is "+r);if(o="data"+(r-a||""),!s)return o}for(var n=o,c=s.split("/"),h=0;h",S="result"+s,$=e.opts.v5&&i&&i.$data;if($?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",g="schema"+s):g=i,w){var x=e.util.getData(b.$data,o,e.dataPathArr),_="exclusive"+s,O="op"+s,R="' + "+O+" + '";a+=" var schemaExcl"+s+" = "+x+"; ",x="schemaExcl"+s,a+=" if (typeof "+x+" != 'boolean' && "+x+" !== undefined) { "+u+" = false; ";var t=E,I=I||[];I.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(t||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var A=a;a=I.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+A+"]); ":" validate.errors = ["+A+"]; return false; ":" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(p+="}",a+=" else { "),$&&(a+=" if ("+g+" === undefined) "+u+" = true; else if (typeof "+g+" != 'string') "+u+" = false; else { ",p+="}"),d&&(a+=" if (!"+y+") "+u+" = true; else { ",p+="}"),a+=" var "+S+" = "+y+"("+h+", ",a+=$?""+g:""+e.util.toQuotedString(i),a+=" ); if ("+S+" === undefined) "+u+" = false; var "+_+" = "+x+" === true; if ("+u+" === undefined) { "+u+" = "+_+" ? "+S+" "+j+" 0 : "+S+" "+j+"= 0; } if (!"+u+") var op"+s+" = "+_+" ? '"+j+"' : '"+j+"=';"}else{var _=!0===b,R=j;_||(R+="=");var O="'"+R+"'";$&&(a+=" if ("+g+" === undefined) "+u+" = true; else if (typeof "+g+" != 'string') "+u+" = false; else { ",p+="}"),d&&(a+=" if (!"+y+") "+u+" = true; else { ",p+="}"),a+=" var "+S+" = "+y+"("+h+", ",a+=$?""+g:""+e.util.toQuotedString(i),a+=" ); if ("+S+" === undefined) "+u+" = false; if ("+u+" === undefined) "+u+" = "+S+" "+j,_||(a+="="),a+=" 0;"}a+=p+"if (!"+u+") { ";var t=r,I=I||[];I.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(t||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+O+", limit: ",a+=$?""+g:""+e.util.toQuotedString(i),a+=" , exclusive: "+_+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be "+R+' "',a+=$?"' + "+g+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=$?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var A=a;return a=I.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+A+"]); ":" validate.errors = ["+A+"]; return false; ":" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="}"}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maximum"==r,p=d?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[p],v=e.opts.v5&&m&&m.$data,y=d?"<":">",g=d?">":"<";if(v){var P=e.util.getData(m.$data,i,e.dataPathArr),E="exclusive"+o,b="op"+o,w="' + "+b+" + '";s+=" var schemaExcl"+o+" = "+P+"; ",P="schemaExcl"+o,s+=" var exclusive"+o+"; if (typeof "+P+" != 'boolean' && typeof "+P+" != 'undefined') { ";var t=p,j=j||[];j.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var S=s;s=j.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ((exclusive"+o+" = "+P+" === true) ? "+u+" "+g+"= "+a+" : "+u+" "+g+" "+a+") || "+u+" !== "+u+") { var op"+o+" = exclusive"+o+" ? '"+y+"' : '"+y+"=';"}else{var E=!0===m,w=y;E||(w+="=");var b="'"+w+"'";s+=" if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+u+" "+g,E&&(s+="="),s+=" "+a+" || "+u+" !== "+u+") {"}var t=r,j=j||[];j.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+b+", limit: "+a+", exclusive: "+E+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+w+" ",s+=f?"' + "+a:n+"'"),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var S=s;return s=j.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",h&&(s+=" else { "),s}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maxItems"==r?">":"<";s+="if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+u+".length "+d+" "+a+") { ";var t=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"less",s+=" than ",s+=f?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maxLength"==r?">":"<";s+="if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=!1===e.opts.unicode?" "+u+".length ":" ucs2length("+u+") ",s+=" "+d+" "+a+") { ";var t=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=f?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n, +s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maxProperties"==r?">":"<";s+="if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+u+").length "+d+" "+a+") { ";var t=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(t||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"less",s+=" than ",s+=f?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],18:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,h=n.baseId,u=!0,f=a;if(f)for(var d,p=-1,m=f.length-1;p "+$+") { ";var _=c+"["+$+"]";f.schema=S,f.schemaPath=i+"["+$+"]",f.errSchemaPath=n+"/"+$,f.errorPath=e.util.getPathExpr(e.errorPath,$,e.opts.jsonPointers,!0),f.dataPathArr[v]=$;var O=e.validate(f);f.baseId=g,e.util.varOccurences(O,y)<2?t+=" "+e.util.varReplace(O,y,_)+" ":t+=" var "+y+" = "+_+"; "+O+" ",t+=" } ",l&&(t+=" if ("+p+") { ",d+="}")}if("object"==typeof P&&e.util.schemaHasRules(P,e.RULES.all)){f.schema=P,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",t+=" "+p+" = true; if ("+c+".length > "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=c+"["+m+"]";f.dataPathArr[v]=m;var O=e.validate(f);f.baseId=g,e.util.varOccurences(O,y)<2?t+=" "+e.util.varReplace(O,y,_)+" ":t+=" var "+y+" = "+_+"; "+O+" ",l&&(t+=" if (!"+p+") break; "),t+=" } } ",l&&(t+=" if ("+p+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){f.schema=o,f.schemaPath=i,f.errSchemaPath=n,t+=" for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=c+"["+m+"]";f.dataPathArr[v]=m;var O=e.validate(f);f.baseId=g,e.util.varOccurences(O,y)<2?t+=" "+e.util.varReplace(O,y,_)+" ":t+=" var "+y+" = "+_+"; "+O+" ",l&&(t+=" if (!"+p+") break; "),t+=" } ",l&&(t+=" if ("+p+") { ",d+="}")}return l&&(t+=" "+d+" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],26:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(o||""),u=e.opts.v5&&i&&i.$data;u?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",t="schema"+s):t=i,a+="var division"+s+";if (",u&&(a+=" "+t+" !== undefined && ( typeof "+t+" != 'number' || "),a+=" (division"+s+" = "+h+" / "+t+", ",a+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+s+" !== parseInt(division"+s+") ",a+=" ) ",u&&(a+=" ) "),a+=" ) { ";var f=f||[];f.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+t+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=u?"' + "+t:i+"'"),e.opts.verbose&&(a+=" , schema: ",a+=u?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var d=a;return a=f.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+d+"]); ":" validate.errors = ["+d+"]; return false; ":" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",c&&(a+=" else { "),a}},{}],27:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),h="errs__"+a,u=e.util.copy(e);u.level++;var f="valid"+u.level;if(e.util.schemaHasRules(o,e.RULES.all)){u.schema=o,u.schemaPath=i,u.errSchemaPath=n,t+=" var "+h+" = errors; ";var d=e.compositeRule;e.compositeRule=u.compositeRule=!0,u.createErrors=!1;var p;u.opts.allErrors&&(p=u.opts.allErrors,u.opts.allErrors=!1),t+=" "+e.validate(u)+" ",u.createErrors=!0,p&&(u.opts.allErrors=p),e.compositeRule=u.compositeRule=d,t+=" if ("+f+") { ";var m=m||[];m.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be valid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var v=t;t=m.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(t+=" } ")}else t+=" var err = ",!1!==e.createErrors?(t+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: {} ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be valid' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ",t+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(t+=" if (false) { ");return t}},{}],28:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),h="valid"+a,u="errs__"+a,f=e.util.copy(e),d="";f.level++;var p="valid"+f.level;t+="var "+u+" = errors;var prevValid"+a+" = false;var "+h+" = false;";var m=f.baseId,v=e.compositeRule;e.compositeRule=f.compositeRule=!0;var y=o;if(y)for(var g,P=-1,E=y.length-1;P5)t+=" || validate.schema"+i+"["+m+"] ";else{var q=g;if(q)for(var D,L=-1,Q=q.length-1;L= "+pe+"; ",n=e.errSchemaPath+"/patternGroups/minimum",t+=" if (!"+h+") { ";var G=G||[];G.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { reason: '"+ye+"', limit: "+ve+", pattern: '"+e.util.escapeQuotes(M)+"' } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have "+ge+" than "+ve+' properties matching pattern "'+e.util.escapeQuotes(M)+"\"' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var K=t;t=G.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+K+"]); ":" validate.errors = ["+K+"]; return false; ":" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } ",void 0!==me&&(t+=" else ")}if(void 0!==me){var ve=me,ye="maximum",ge="more";t+=" "+h+" = pgPropCount"+a+" <= "+me+"; ",n=e.errSchemaPath+"/patternGroups/maximum",t+=" if (!"+h+") { ";var G=G||[];G.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { reason: '"+ye+"', limit: "+ve+", pattern: '"+e.util.escapeQuotes(M)+"' } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have "+ge+" than "+ve+' properties matching pattern "'+e.util.escapeQuotes(M)+"\"' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var K=t;t=G.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+K+"]); ":" validate.errors = ["+K+"]; return false; ":" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } "}n=J,l&&(t+=" if ("+h+") { ",d+="}")}}}}return l&&(t+=" "+d+" if ("+u+" == errors) {"),t=e.util.cleanUpCode(t)}},{}],32:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),u="valid"+o;if("#"==n||"#/"==n)e.isRoot?(t=e.async,a="validate"):(t=!0===e.root.schema.$async,a="root.refVal[0]");else{var f=e.resolveRef(e.baseId,n,e.isRoot);if(void 0===f){var d="can't resolve reference "+n+" from id "+e.baseId;if("fail"==e.opts.missingRefs){console.log(d);var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(n)+"' } ",!1!==e.opts.messages&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(n)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(n)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(s+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs){var v=new Error(d);throw v.missingRef=e.resolve.url(e.baseId,n),v.missingSchema=e.resolve.normalizeId(e.resolve.fullPath(v.missingRef)),v}console.log(d),c&&(s+=" if (true) { ")}}else if(f.inline){var y=e.util.copy(e);y.level++;var g="valid"+y.level;y.schema=f.schema,y.schemaPath="",y.errSchemaPath=n;var P=e.validate(y).replace(/validate\.schema/g,f.code);s+=" "+P+" ",c&&(s+=" if ("+g+") { ")}else t=!0===f.$async,a=f.code}if(a){var p=p||[];p.push(s),s="",s+=e.opts.passContext?" "+a+".call(this, ":" "+a+"( ",s+=" "+h+", (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath);s+=" , "+(i?"data"+(i-1||""):"parentData")+" , "+(i?e.dataPathArr[i]:"parentDataProperty")+", rootData) ";var E=s;if(s=p.pop(),t){if(!e.async)throw new Error("async schema referenced by sync schema");s+=" try { ",c&&(s+="var "+u+" ="),s+=" "+e.yieldAwait+" "+E+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",c&&(s+=" if ("+u+") { ")}else s+=" if (!"+E+") { if (vErrors === null) vErrors = "+a+".errors; else vErrors = vErrors.concat("+a+".errors); errors = vErrors.length; } ",c&&(s+=" else { ")}return s}},{}],33:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),h="valid"+a,u=e.opts.v5&&o&&o.$data;u&&(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ");var f="schema"+a;if(!u)if(o.length=e.opts.loopRequired;if(l)if(t+=" var missing"+a+"; ",E){u||(t+=" var "+f+" = validate.schema"+i+"; ");var b="i"+a,w="schema"+a+"["+b+"]",j="' + "+w+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,w,e.opts.jsonPointers)),t+=" var "+h+" = true; ",u&&(t+=" if (schema"+a+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+a+")) "+h+" = false; else {"),t+=" for (var "+b+" = 0; "+b+" < "+f+".length; "+b+"++) { "+h+" = "+c+"["+f+"["+b+"]] !== undefined; if (!"+h+") break; } ",u&&(t+=" } "),t+=" if (!"+h+") { ";var S=S||[];S.push(t),t="",!1!==e.createErrors?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+j+"' } ",!1!==e.opts.messages&&(t+=" , message: '",t+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+j+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var $=t;t=S.pop(),t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+$+"]); ":" validate.errors = ["+$+"]; return false; ":" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else{t+=" if ( ";var x=d;if(x)for(var _,b=-1,O=x.length-1;b 1) { var i = "+h+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+u+" = false; break outer; } } } } ",f&&(a+=" } "),a+=" if (!"+u+") { ";var d=d||[];d.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema: ",a+=f?"validate.schema"+n:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var p=a;a=d.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(a+=" else { ")}else c&&(a+=" if (true) { ");return a}},{}],36:[function(e,r,t){"use strict";r.exports=function(e,r){function t(r){return void 0!==e.schema[r.keyword]||"properties"==r.keyword&&(!1===e.schema.additionalProperties||"object"==typeof e.schema.additionalProperties||e.schema.patternProperties&&Object.keys(e.schema.patternProperties).length||e.opts.v5&&e.schema.patternGroups&&Object.keys(e.schema.patternGroups).length)}var a="",s=!0===e.schema.$async;if(e.isTop){var o=e.isTop,i=e.level=0,n=e.dataLevel=0,l="data";if(e.rootId=e.resolve.fullPath(e.root.schema.id),e.baseId=e.baseId||e.rootId,s){e.async=!0;var c="es7"==e.opts.async;e.yieldAwait=c?"await":"yield"}delete e.isTop,e.dataPathArr=[void 0],a+=" var validate = ",s?c?a+=" (async function ":("co*"==e.opts.async&&(a+="co.wrap"),a+="(function* "):a+=" (function ",a+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data;"}else{var i=e.level,n=e.dataLevel,l="data"+(n||"");if(e.schema.id&&(e.baseId=e.resolve.url(e.baseId,e.schema.id)),s&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+i+" = errors;"}var h="valid"+i,u=!e.opts.allErrors,f="",d="",p=e.schema.type,m=Array.isArray(p);if(p&&e.opts.coerceTypes){var v=e.util.coerceToTypes(e.opts.coerceTypes,p);if(v){var y=e.schemaPath+".type",g=e.errSchemaPath+"/type",P=m?"checkDataTypes":"checkDataType";a+=" if ("+e.util[P](p,l,!0)+") { ";var E="dataType"+i,b="coerced"+i;a+=" var "+E+" = typeof "+l+"; ","array"==e.opts.coerceTypes&&(a+=" if ("+E+" == 'object' && Array.isArray("+l+")) "+E+" = 'array'; "),a+=" var "+b+" = undefined; ";var w="",j=v;if(j)for(var S,$=-1,x=j.length-1;$2&&(r=f.call(arguments,1)),t(r)})})}function i(e){return Promise.all(e.map(s,this))}function n(e){for(var r=new e.constructor,t=Object.keys(e),a=[],o=0;o="0"&&s<="9";)r+=s,c();if("."===s)for(r+=".";c()&&s>="0"&&s<="9";)r+=s;if("e"===s||"E"===s)for(r+=s,c(),"-"!==s&&"+"!==s||(r+=s,c());s>="0"&&s<="9";)r+=s,c();if(e=+r,isFinite(e))return e;l("Bad number")},u=function(){var e,r,t,a="";if('"'===s)for(;c();){if('"'===s)return c(),a;if("\\"===s)if(c(),"u"===s){for(t=0,r=0;r<4&&(e=parseInt(c(),16),isFinite(e));r+=1)t=16*t+e;a+=String.fromCharCode(t)}else{if("string"!=typeof n[s])break;a+=n[s]}else a+=s}l("Bad string")},f=function(){for(;s&&s<=" ";)c()},d=function(){switch(s){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null}l("Unexpected '"+s+"'")},p=function(){var e=[];if("["===s){if(c("["),f(),"]"===s)return c("]"),e;for(;s;){if(e.push(i()),f(),"]"===s)return c("]"),e;c(","),f()}}l("Bad array")},m=function(){var e,r={};if("{"===s){if(c("{"),f(),"}"===s)return c("}"),r;for(;s;){if(e=u(),f(),c(":"),Object.hasOwnProperty.call(r,e)&&l('Duplicate key "'+e+'"'),r[e]=i(),f(),"}"===s)return c("}"),r;c(","),f()}}l("Bad object")};i=function(){switch(f(),s){case"{":return m();case"[":return p();case'"':return u();case"-":return h();default:return s>="0"&&s<="9"?h():d()}},r.exports=function(e,r){var t;return o=e,a=0,s=" ",t=i(),f(),s&&l("Syntax error"),"function"==typeof r?function e(t,a){var s,o,i=t[a];if(i&&"object"==typeof i)for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(o=e(i,s),void 0!==o?i[s]=o:delete i[s]);return r.call(t,a,i)}({"":t},""):t}},{}],45:[function(e,r,t){function a(e){return l.lastIndex=0,l.test(e)?'"'+e.replace(l,function(e){var r=c[e];return"string"==typeof r?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function s(e,r){var t,l,c,h,u,f=o,d=r[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof n&&(d=n.call(r,e,d)),typeof d){case"string":return a(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(o+=i,u=[],"[object Array]"===Object.prototype.toString.apply(d)){for(h=d.length,t=0;t1&&(a=t[0]+"@",e=t[1]),e=e.replace(q,"."),a+i(e.split("."),r).join(".")}function l(e){for(var r,t,a=[],s=0,o=e.length;s=55296&&r<=56319&&s65535&&(e-=65536,r+=C(e>>>10&1023|55296),e=56320|1023&e),r+=C(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:j}function u(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function f(e,r,t){var a=0;for(e=t?Q(e/_):e>>1,e+=Q(e/r);e>L*$>>1;a+=j)e=Q(e/L);return Q(a+(L+1)*e/(e+x))}function d(e){var r,t,a,s,i,n,l,u,d,p,m=[],v=e.length,y=0,g=R,P=O;for(t=e.lastIndexOf(I),t<0&&(t=0),a=0;a=128&&o("not-basic"),m.push(e.charCodeAt(a));for(s=t>0?t+1:0;s=v&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=j||u>Q((w-y)/n))&&o("overflow"),y+=u*n,d=l<=P?S:l>=P+$?$:l-P,!(uQ(w/p)&&o("overflow"),n*=p;r=m.length+1,P=f(y-i,r,0==i),Q(y/r)>w-g&&o("overflow"),g+=Q(y/r),y%=r,m.splice(y++,0,g)}return c(m)}function p(e){var r,t,a,s,i,n,c,h,d,p,m,v,y,g,P,E=[];for(e=l(e),v=e.length,r=R,t=0,i=O,n=0;n=r&&mQ((w-t)/y)&&o("overflow"),t+=(c-r)*y,r=c,n=0;nw&&o("overflow"),m==r){for(h=t,d=j;p=d<=i?S:d>=i+$?$:d-i,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=j-S,Q=Math.floor,C=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:l,encode:c},decode:d,encode:p,toASCII:v,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return E});else if(y&&g)if(t.exports==y)g.exports=E;else for(b in E)E.hasOwnProperty(b)&&(y[b]=E[b]);else s.punycode=E}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(e,r,t){"use strict";function a(e,r){return Object.prototype.hasOwnProperty.call(e,r)}r.exports=function(e,r,t,o){r=r||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;e=e.split(r);var n=1e3;o&&"number"==typeof o.maxKeys&&(n=o.maxKeys);var l=e.length;n>0&&l>n&&(l=n);for(var c=0;c=0?(h=p.substr(0,m),u=p.substr(m+1)):(h=p,u=""),f=decodeURIComponent(h),d=decodeURIComponent(u),a(i,f)?s(i[f])?i[f].push(d):i[f]=[i[f],d]:i[f]=d}return i};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],48:[function(e,r,t){"use strict";function a(e,r){if(e.map)return e.map(r);for(var t=[],a=0;a",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),v=["%","/","?",";","#"].concat(m),y=["/","?","#"],g={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=e("querystring");a.prototype.parse=function(e,r,t){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a127?A+="x":A+=I[k];if(!A.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var D=O.slice(0,j),L=O.slice(j+1),Q=I.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);Q&&(D.push(Q[1]),L.unshift(Q[2])),L.length&&(i="/"+L.join(".")+i),this.hostname=D.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),_||(this.hostname=l.toASCII(this.hostname));var C=this.port?":"+this.port:"";this.host=(this.hostname||"")+C,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!g[d])for(var j=0,R=m.length;j0)&&t.host.split("@");j&&(t.auth=j.shift(),t.host=t.hostname=j.shift())}return t.search=e.search,t.query=e.query,c.isNull(t.pathname)&&c.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!b.length)return t.pathname=null,t.path=t.search?"/"+t.search:null,t.href=t.format(),t;for(var S=b.slice(-1)[0],$=(t.host||e.host||b.length>1)&&("."===S||".."===S)||""===S,x=0,_=b.length;_>=0;_--)S=b[_],"."===S?b.splice(_,1):".."===S?(b.splice(_,1),x++):x&&(b.splice(_,1),x--);if(!y&&!g)for(;x--;x)b.unshift("..");!y||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),$&&"/"!==b.join("/").substr(-1)&&b.push("");var O=""===b[0]||b[0]&&"/"===b[0].charAt(0);if(w){t.hostname=t.host=O?"":b.length?b.shift():"";var j=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@");j&&(t.auth=j.shift(),t.host=t.hostname=j.shift())}return y=y||t.host&&b.length,y&&!O&&b.unshift(""),b.length?t.pathname=b.join("/"):(t.pathname=null,t.path=null),c.isNull(t.pathname)&&c.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},a.prototype.parseHost=function(){var e=this.host,r=u.exec(e);r&&(r=r[0],":"!==r&&(this.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(this.hostname=e)}},{"./util":51,punycode:46,querystring:49}],51:[function(e,r,t){"use strict";r.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],ajv:[function(e,r,t){"use strict";function a(e){return g.test(e)}function s(r){function t(e,r){var t;if("string"==typeof e){if(!(t=S(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=R(e);t=a.validate||I(a)}var s=t(r);return!0===t.$async?"*"==D._opts.async?m(s):s:(D.errors=t.errors,s)}function v(e,r){var t=R(e,void 0,r);return t.validate||I(t)}function E(e,r,t,a){if(Array.isArray(e))for(var s=0;s=t}function i(e,t,n){var r=t.input.slice(t.start);return n&&(r=r.replace(p,"$1 $3")),e.test(r)}function s(e,t,n,r){var i=new e.constructor(e.options,e.input,t);if(n)for(var s in n)i[s]=n[s];var o=e,a=i;return["inFunction","inAsyncFunction","inAsync","inGenerator","inModule"].forEach(function(e){e in o&&(a[e]=o[e])}),r&&(i.options.preserveParens=!0),i.nextToken(),i}function o(e,t){var n=function(){};e.extend("initialContext",function(r){return function(){return this.options.ecmaVersion<7&&(n=function(t){e.raise(t.start,"async/await keywords only available when ecmaVersion>=7")}),this.reservedWords=new RegExp(this.reservedWords.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.reservedWordsStrict=new RegExp(this.reservedWordsStrict.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.reservedWordsStrictBind=new RegExp(this.reservedWordsStrictBind.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.inAsyncFunction=t.inAsyncFunction,t.awaitAnywhere&&t.inAsyncFunction&&e.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive"),r.apply(this,arguments)}}),e.extend("shouldParseExportStatement",function(e){return function(){return!("name"!==this.type.label||"async"!==this.value||!i(c,this))||e.apply(this,arguments)}}),e.extend("parseStatement",function(e){return function(n,r){var s=this.start,o=this.startLoc;if("name"===this.type.label)if(i(c,this,!0)){var a=this.inAsyncFunction;try{this.inAsyncFunction=!0,this.next();var l=this.parseStatement(n,r);return l.async=!0,l.start=s,l.loc&&(l.loc.start=o),l.range&&(l.range[0]=s),l}finally{this.inAsyncFunction=a}}else if("object"==typeof t&&t.asyncExits&&i(u,this)){this.next();var l=this.parseStatement(n,r);return l.async=!0,l.start=s,l.loc&&(l.loc.start=o),l.range&&(l.range[0]=s),l}return e.apply(this,arguments)}}),e.extend("parseIdent",function(e){return function(t){var n=e.apply(this,arguments);return this.inAsyncFunction&&"await"===n.name&&0===arguments.length&&this.raise(n.start,"'await' is reserved within async functions"),n}}),e.extend("parseExprAtom",function(e){return function(i){var o,u=this.start,c=this.startLoc,p=e.apply(this,arguments);if("Identifier"===p.type)if("async"!==p.name||r(this,p.end)){if("await"===p.name){var h=this.startNodeAt(p.start,p.loc&&p.loc.start);if(this.inAsyncFunction)return o=this.parseExprSubscripts(),h.operator="await",h.argument=o,h=this.finishNodeAt(h,"AwaitExpression",o.end,o.loc&&o.loc.end),n(h),h;if(this.input.slice(p.end).match(l))return t.awaitAnywhere||"module"!==this.options.sourceType?p:this.raise(p.start,"'await' is reserved within modules");if("object"==typeof t&&t.awaitAnywhere&&(u=this.start,o=s(this,u-4).parseExprSubscripts(),o.end<=u))return o=s(this,u).parseExprSubscripts(),h.operator="await",h.argument=o,h=this.finishNodeAt(h,"AwaitExpression",o.end,o.loc&&o.loc.end),this.pos=o.end,this.end=o.end,this.endLoc=o.endLoc,this.next(),n(h),h;if(!t.awaitAnywhere&&"module"===this.options.sourceType)return this.raise(p.start,"'await' is reserved within modules")}}else{var f=this.inAsyncFunction;try{this.inAsyncFunction=!0;var d=this,y=!1,m={parseFunctionBody:function(e,t){try{var n=y;return y=!0,d.parseFunctionBody.apply(this,arguments)}finally{y=n}},raise:function(){try{return d.raise.apply(this,arguments)}catch(e){throw y?e:a}}};if(o=s(this,this.start,m,!0).parseExpression(),"SequenceExpression"===o.type&&(o=o.expressions[0]),"CallExpression"===o.type&&(o=o.callee),"FunctionExpression"===o.type||"FunctionDeclaration"===o.type||"ArrowFunctionExpression"===o.type)return o=s(this,this.start,m).parseExpression(),"SequenceExpression"===o.type&&(o=o.expressions[0]),"CallExpression"===o.type&&(o=o.callee),o.async=!0,o.start=u,o.loc&&(o.loc.start=c),o.range&&(o.range[0]=u),this.pos=o.end,this.end=o.end,this.endLoc=o.endLoc,this.next(),n(o),o}catch(e){if(e!==a)throw e}finally{this.inAsyncFunction=f}}return p}}),e.extend("finishNodeAt",function(e){return function(t,n,r,i){return t.__asyncValue&&(delete t.__asyncValue,t.value.async=!0),e.apply(this,arguments)}}),e.extend("finishNode",function(e){return function(t,n){return t.__asyncValue&&(delete t.__asyncValue,t.value.async=!0),e.apply(this,arguments)}});e.extend("parsePropertyName",function(e){return function(t){var i=(t.key&&t.key.name,e.apply(this,arguments));return"Identifier"!==i.type||"async"!==i.name||r(this,i.end)||this.input.slice(i.end).match(l)||(h.test(this.input.slice(i.end))?(i=e.apply(this,arguments),t.__asyncValue=!0):(n(t),"set"===t.kind&&this.raise(i.start,"'set (value)' cannot be be async"),i=e.apply(this,arguments),"Identifier"===i.type&&"set"===i.name&&this.raise(i.start,"'set (value)' cannot be be async"),t.__asyncValue=!0)),i}}),e.extend("parseClassMethod",function(e){return function(t,n,r){var i;n.__asyncValue&&("constructor"===n.kind&&this.raise(n.start,"class constructor() cannot be be async"),i=this.inAsyncFunction,this.inAsyncFunction=!0);var s=e.apply(this,arguments);return this.inAsyncFunction=i,s}}),e.extend("parseMethod",function(e){return function(t){var n;this.__currentProperty&&this.__currentProperty.__asyncValue&&(n=this.inAsyncFunction,this.inAsyncFunction=!0);var r=e.apply(this,arguments);return this.inAsyncFunction=n,r}}),e.extend("parsePropertyValue",function(e){return function(t,n,r,i,s,o){var a=this.__currentProperty;this.__currentProperty=t;var u;t.__asyncValue&&(u=this.inAsyncFunction,this.inAsyncFunction=!0);var c=e.apply(this,arguments);return this.inAsyncFunction=u,this.__currentProperty=a,c}})}var a={},u=/^async[\t ]+(return|throw)/,c=/^async[\t ]+function/,l=/^\s*[():;]/,p=/([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g,h=/\s*(get|set)\s*\(/;t.exports=o},{}],3:[function(e,t,n){function r(e,t){return e.lineStart>=t}function i(e,t,n){var r=t.input.slice(t.start);return n&&(r=r.replace(c,"$1 $3")),e.test(r)}function s(e,t,n){var r=new e.constructor(e.options,e.input,t);if(n)for(var i in n)r[i]=n[i];var s=e,o=r;return["inFunction","inAsync","inGenerator","inModule"].forEach(function(e){e in s&&(o[e]=s[e])}),r.nextToken(),r}function o(e,t){t&&"object"==typeof t||(t={}),e.extend("parse",function(n){return function(){return this.inAsync=t.inAsyncFunction,t.awaitAnywhere&&t.inAsyncFunction&&e.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive"),n.apply(this,arguments)}}),e.extend("parseStatement",function(e){return function(n,r){var s=this.start,o=this.startLoc;if("name"===this.type.label&&t.asyncExits&&i(a,this)){this.next();var u=this.parseStatement(n,r);return u.async=!0,u.start=s,u.loc&&(u.loc.start=o),u.range&&(u.range[0]=s),u}return e.apply(this,arguments)}}),e.extend("parseIdent",function(e){return function(n){return"module"===this.options.sourceType&&this.options.ecmaVersion>=8&&t.awaitAnywhere?e.call(this,!0):e.apply(this,arguments)}}),e.extend("parseExprAtom",function(e){var n={};return function(r){var i,o=this.start,a=(this.startLoc,e.apply(this,arguments));if("Identifier"===a.type&&"await"===a.name&&!this.inAsync&&t.awaitAnywhere){var u=this.startNodeAt(a.start,a.loc&&a.loc.start);o=this.start;var c={raise:function(){try{return pp.raise.apply(this,arguments)}catch(e){throw n}}};try{if(i=s(this,o-4,c).parseExprSubscripts(),i.end<=o)return i=s(this,o,c).parseExprSubscripts(),u.argument=i,u=this.finishNodeAt(u,"AwaitExpression",i.end,i.loc&&i.loc.end),this.pos=i.end,this.end=i.end,this.endLoc=i.endLoc,this.next(),u}catch(e){if(e===n)return a;throw e}}return a}});var n={undefined:!0,get:!0,set:!0,static:!0,async:!0,constructor:!0};e.extend("parsePropertyName",function(e){return function(t){var i=t.key&&t.key.name,s=e.apply(this,arguments);"get"===this.value&&(t.__maybeStaticAsyncGetter=!0);return n[this.value]?s:("Identifier"!==s.type||"async"!==s.name&&"async"!==i||r(this,s.end)||this.input.slice(s.end).match(u)?delete t.__maybeStaticAsyncGetter:"set"===t.kind||"set"===s.name?this.raise(s.start,"'set (value)' cannot be be async"):(this.__isAsyncProp=!0,s=e.apply(this,arguments),"Identifier"===s.type&&"set"===s.name&&this.raise(s.start,"'set (value)' cannot be be async")),s)}}),e.extend("parseClassMethod",function(e){return function(t,n,r){var i=e.apply(this,arguments);return n.__maybeStaticAsyncGetter&&(delete n.__maybeStaticAsyncGetter,"get"!==n.key.name&&(n.kind="get")),i}}),e.extend("parseFunctionBody",function(e){return function(t,n){var r=this.inAsync;this.__isAsyncProp&&(t.async=!0,this.inAsync=!0,delete this.__isAsyncProp);var i=e.apply(this,arguments);return this.inAsync=r,i}})}var a=/^async[\t ]+(return|throw)/,u=/^\s*[):;]/,c=/([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g;t.exports=o},{}],4:[function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function s(e){var t,n,i,s,o,a,u=e.length;o=r(e),a=new p(3*u/4-o),i=o>0?u-4:u;var c=0;for(t=0,n=0;t>16&255,a[c++]=s>>8&255,a[c++]=255&s;return 2===o?(s=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[c++]=255&s):1===o&&(s=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[c++]=s>>8&255,a[c++]=255&s),a}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function a(e,t,n){for(var r,i=[],s=t;su?u:o+16383));return 1===r?(t=e[n-1],i+=c[t>>2],i+=c[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=c[t>>10],i+=c[t>>4&63],i+=c[t<<2&63],i+="="),s.push(i),s.join("")}n.byteLength=i,n.toByteArray=s,n.fromByteArray=u;for(var c=[],l=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;fH)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(e)}return s(e,t,n)}function s(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?p(e,t,n):"string"==typeof e?c(e,t):h(e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function a(e,t,n){return o(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}function u(e){return o(e),r(e<0?0:0|f(e))}function c(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(e,t),s=r(n),o=s.write(e,t);return o!==n&&(s=s.slice(0,o)),s}function l(e){for(var t=e.length<0?0:0|f(e.length),n=r(t),i=0;i=H)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+H.toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),i.alloc(+e)}function y(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,s){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,s);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,n/=2}var c;if(i){var l=-1;for(c=n;ca&&(n=a-u),c=n;c>=0;c--){for(var p=!0,h=0;hi&&(r=i):r=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o239?4:s>223?3:s>191?2:1;if(i+a<=n){var u,c,l,p;switch(a){case 1:s<128&&(o=s);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&s)<<6|63&u)>127&&(o=p);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(p=(15&s)<<12|(63&u)<<6|63&c)>2047&&(p<55296||p>57343)&&(o=p);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(p=(15&s)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&p<1114112&&(o=p)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return L(r)}function L(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,s,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Y.write(e,t,n,r,23,4),n+4}function I(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Y.write(e,t,n,r,52,8),n+8}function j(e){if(e=M(e).replace(Q,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function M(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,s=[],o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function q(e){for(var t=[],n=0;n>8,i=n%256,s.push(i),s.push(r);return s}function z(e){return J.toByteArray(j(e))}function W(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function G(e){return e!==e}var J=e("base64-js"),Y=e("ieee754");n.Buffer=i,n.SlowBuffer=d,n.INSPECT_MAX_BYTES=50;var H=2147483647;n.kMaxLength=H,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,n){return s(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return a(e,t,n)},i.allocUnsafe=function(e){return u(e)},i.allocUnsafeSlow=function(e){return u(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,s=0,o=Math.min(n,r);s0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},i.prototype.compare=function(e,t,n,r,s){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=n)return 0;if(r>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,s>>>=0,this===e)return 0;for(var o=s-r,a=n-t,u=Math.min(o,a),c=this.slice(r,s),l=e.slice(t,n),p=0;p>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||$(e,t,this.length);for(var r=this[e],i=1,s=0;++s>>=0,t>>>=0,n||$(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return e>>>=0,t||$(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||$(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||$(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||$(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||$(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||$(e,t,this.length);for(var r=this[e],i=1,s=0;++s=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||$(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},i.prototype.readInt8=function(e,t){return e>>>=0,t||$(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||$(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||$(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||$(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||$(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||$(e,4,this.length),Y.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||$(e,4,this.length),Y.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||$(e,8,this.length),Y.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||$(e,8,this.length),Y.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){O(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,!r){O(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return I(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return I(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(s<1e3)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o>1,l=-7,p=n?i-1:0,h=n?-1:1,f=e[t+p];for(p+=h,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+e[t+p],p+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+p],p+=h,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,a,u,c=8*s-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),t+=o+p>=1?h/u:h*Math.pow(2,1-p),t*u>=2&&(o++,u/=2),o+p>=l?(a=0,o=l):o+p>=1?(a=(t*u-1)*Math.pow(2,i),o+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&a,f+=d,a/=256,i-=8);for(o=o<0;e[n+f]=255&o,f+=d,o/=256,c-=8);e[n+f-d]|=128*y}},{}],8:[function(e,t,n){"use strict";function r(e,t){if(Function.prototype.$asyncspawn||Object.defineProperty(Function.prototype,"$asyncspawn",{value:r,enumerable:!1,configurable:!0,writable:!0}),this instanceof Function){var n=this;return new e(function(e,r){function i(t,n){var o;try{if(o=t.call(s,n),o.done){if(o.value!==e){if(o.value&&o.value===o.value.then)return o.value(e,r);e&&e(o.value),e=null}return}o.value.then?o.value.then(function(e){i(s.next,e)},function(e){i(s.throw,e)}):i(s.next,o.value)}catch(e){return r&&r(e),void(r=null)}}var s=n.call(t,e,r);i(s.next)})}}var i=function(e,t){for(var n=t.toString(),r="return "+n,i=n.match(/.*\(([^)]*)\)/)[1],s=/['"]!!!([^'"]*)['"]/g,o=[];;){var a=s.exec(r);if(!a)break;o.push(a)}return o.reverse().forEach(function(t){r=r.slice(0,t.index)+e[t[1]]+r.substr(t.index+t[0].length)}),r=r.replace(/\/\*[^*]*\*\//g," ").replace(/\s+/g," "),new Function(i,r)()}({zousan:e("./zousan").toString(),thenable:e("./thenableFactory").toString()},function e(t,n){function r(){return i.apply(t,arguments)}Function.prototype.$asyncbind||Object.defineProperty(Function.prototype,"$asyncbind",{value:e,enumerable:!1,configurable:!0,writable:!0}),e.trampoline||(e.trampoline=function(e,t,n,r,i){return function s(o){for(;o;){if(o.then)return o=o.then(s,r),i?void 0:o;try{ +if(o.pop){if(o.length)return o.pop()?t.call(e):o;o=n}else o=o.call(e)}catch(e){return r(e)}}}}),e.LazyThenable||(e.LazyThenable="!!!thenable"(),e.EagerThenable=e.Thenable=(e.EagerThenableFactory="!!!zousan")());var i=this;switch(n){case!0:return new e.Thenable(r);case 0:return new e.LazyThenable(r);case void 0:return r.then=r,r;default:return function(){try{return i.apply(t,arguments)}catch(e){return n(e)}}}});i(),r(),t.exports={$asyncbind:i,$asyncspawn:r}},{"./thenableFactory":9,"./zousan":10}],9:[function(e,t,n){t.exports=function(){function e(e){return e&&e instanceof Object&&"function"==typeof e.then}function t(n,r,i){try{var s=i?i(r):r;if(n===s)return n.reject(new TypeError("Promise resolution loop"));e(s)?s.then(function(e){t(n,e)},function(e){n.reject(e)}):n.resolve(s)}catch(e){n.reject(e)}}function n(){}function r(e){}function i(e,t){this.resolve=e,this.reject=t}function s(r,i){var s=new n;try{this._resolver(function(n){return e(n)?n.then(r,i):t(s,n,r)},function(e){t(s,e,i)})}catch(e){t(s,e,i)}return s}function o(e){this._resolver=e,this.then=s}return n.prototype={resolve:r,reject:r,then:i},o.resolve=function(e){return o.isThenable(e)?e:{then:function(t){return t(e)}}},o.isThenable=e,o}},{}],10:[function(e,t,n){(function(e){"use strict";t.exports=function(t){function n(e){if(e){var t=this;e(function(e){t.resolve(e)},function(e){t.reject(e)})}}function r(e,t){if("function"==typeof e.y)try{var n=e.y.call(void 0,t);e.p.resolve(n)}catch(t){e.p.reject(t)}else e.p.resolve(t)}function i(e,t){if("function"==typeof e.n)try{var n=e.n.call(void 0,t);e.p.resolve(n)}catch(t){e.p.reject(t)}else e.p.reject(t)}t=t||"object"==typeof e&&e.nextTick||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,0)};var s=function(){function e(){for(;n.length-r;){try{n[r]()}catch(e){}n[r++]=void 0,r===i&&(n.splice(0,i),r=0)}}var n=[],r=0,i=1024;return function(i){n.push(i),n.length-r==1&&t(e)}}();return n.prototype={resolve:function(e){if(void 0===this.state){if(e===this)return this.reject(new TypeError("Attempt to resolve promise with self"));var t=this;if(e&&("function"==typeof e||"object"==typeof e))try{var n=0,i=e.then;if("function"==typeof i)return void i.call(e,function(e){n++||t.resolve(e)},function(e){n++||t.reject(e)})}catch(e){return void(n||this.reject(e))}this.state=r,this.v=e,t.c&&s(function(){for(var n=0,i=t.c.length;n]*>)(.*)/i,/(.*)(<\/script>)(.*)/i],o=0,a=!0;t=t.split("\n");for(var u=0;u0){if(!a)return t(e);delete e.async}return void(!a&&i?t():(e.type="ReturnStatement",e.$mapped=!0,e.argument={type:"CallExpression",callee:A(s,[n]).$error,arguments:[e.argument]}))}return"TryStatement"===e.type?(i++,t(e),void i--):o(e).isFunction?(r++,t(e),void r--):void t(e)}if(r>0){if(!o(e).isAsync)return t(e);delete e.async}return e.$mapped=!0,void(o(e.argument).isUnaryExpression&&"void"===e.argument.operator?e.argument=e.argument.argument:e.argument={type:"CallExpression",callee:A(s,[n]).$return,arguments:e.argument?[e.argument]:[]})},t)}function $(e,t){return Array.isArray(e)?e.map(function(e){return $(e,t)}):(y.treeWalker(e,function(e,t,n){if(t(),"ConditionalExpression"===e.type&&(u(e.alternate)||u(e.consequent))){h(E("condOp"));i(e,L(y.part("if ($0) return $1 ; return $2",[e.test,e.consequent,e.alternate]).body))}},t),e)}function O(e,t){return Array.isArray(e)?e.map(function(e){return O(e,t)}):(y.treeWalker(e,function(e,t,n){if(t(),"LogicalExpression"===e.type&&u(e.right)){var r,s=h(E("logical"+("&&"===e.operator?"And":"Or")));if("||"===e.operator)r="var $0; if (!($0 = $1)) {$0 = $2} return $0";else{if("&&"!==e.operator)throw new Error(v(e)+"Illegal logical operator: "+e.operator);r="var $0; if ($0 = $1) {$0 = $2} return $0"}i(e,L(y.part(r,[s,e.left,e.right]).body))}},t),e)}function B(e,t,n){if("SwitchCase"!==e.type&&o(e).isBlockStatement)for(var r=0;r { $$setMapped: while (q) { if (q.then) "+(1===s?" return void q.then($idTrampoline, $exit); ":" return q.then($idTrampoline, $exit); ")+" try { if (q.pop) if (q.length) return q.pop() ? $idContinuation.call(this) : q; else q = $idStep; else q = q.call(this) } catch (_exception) { return $exit(_exception); } } }))($idIter)":"($idTrampoline = (function (q) { $$setMapped: while (q) { if (q.then) "+(1===s?" return void q.then($idTrampoline, $exit); ":" return q.then($idTrampoline, $exit); ")+" try { if (q.pop) if (q.length) return q.pop() ? $idContinuation.call(this) : q; else q = $idStep; else q = q.call(this) } catch (_exception) { return $exit(_exception); } } }).bind(this))($idIter)",{setMapped:function(e){return e.$mapped=!0,e},idTrampoline:E,exit:$,idIter:S,idContinuation:_,idStep:k}).expr:y.part("(Function.$0.trampoline(this,$1,$2,$3,$5)($4))",[me.asyncbind,_,k,$,S,b(1===s)]).expr,l.push({type:"ReturnStatement",argument:F}),l.push({$label:e.$label,type:"FunctionDeclaration",id:S,params:[],body:{type:"BlockStatement",body:m}}),d&&l.push({type:"FunctionDeclaration",id:k,params:[],body:{type:"BlockStatement",body:[d,P]}}),!p||"VariableDeclaration"!==p.type||"let"!==p.kind&&"const"!==p.kind?(l.push(x),t[0].replace(l.map(r))):("const"===p.kind&&(p.kind="let"),t[0].replace([{type:"BlockStatement",body:l.map(r)},r(x)]))}}function Y(e,t){return y.treeWalker(e,function(e,t,s){function a(e){return{type:"ReturnStatement",argument:{type:"UnaryExpression",operator:"void",prefix:!0,argument:P(e||S)}}}function c(e,t){if("BreakStatement"===e.type)i(e,r(A(e.label&&n.generatedSymbolPrefix+"Loop_"+e.label.name+"_exit")));else if("ContinueStatement"===e.type)i(e,r(a(e.label&&n.generatedSymbolPrefix+"Loop_"+e.label.name+"_next")));else if(o(e).isFunction)return!0;t()}"ForInStatement"===e.type&&u(e)?W(e,s):"ForOfStatement"===e.type&&u(e)&&G(e,s),t();var p;if(o(e).isLoop&&u(e)){var f=e.init,d=e.test||b(!0),g=e.update,v=e.body,x=l(v);f&&(o(f).isStatement||(f={type:"ExpressionStatement",expression:f})),g=g&&{type:"ExpressionStatement",expression:g},v=o(v).isBlockStatement?r(v).body:[r(v)];var w=e.$label&&e.$label.name;w="Loop_"+(w||ye++);var E=n.generatedSymbolPrefix+(w+"_exit"),S=n.generatedSymbolPrefix+(w+"_next"),k=h(n.generatedSymbolPrefix+w),A=function(e){return{type:"ReturnStatement",argument:{type:"UnaryExpression",operator:"void",prefix:!0,argument:{type:"CallExpression",callee:h(e||E),arguments:[]}}}},_=C(S,[{type:"ReturnStatement",argument:{type:"CallExpression",callee:x?m(k):k,arguments:[h(E),me.error]}}]);g&&_.body.body.unshift(g);for(var L=0;L0&&o(e).isAsync)return delete e.async,e.argument={type:"CallExpression",callee:"ThrowStatement"===e.type?me.error:me.return,arguments:e.argument?[e.argument]:[]},void(e.type="ReturnStatement");n(e)})}function K(e,t){if(n.noRuntime)throw new Error("Nodent: 'noRuntime' option only compatible with -promise and -engine modes");return y.part("{ return (function*($return,$error){ $:body }).$asyncspawn(Promise,this) }",{return:me.return,error:me.error,asyncspawn:me.asyncspawn,body:X(e).concat(t?[{type:"ReturnStatement",argument:me.return}]:[])}).body[0]}function ee(e){e.$asyncgetwarninig||(e.$asyncgetwarninig=!0,d(v(e)+"'async get "+printNode(e)+"(){...}' is non-standard. See https://github.com/MatAtBread/nodent#differences-from-the-es7-specification"))}function te(e,t){function s(e,t){y.treeWalker(e,function(n,r,i){n!==e&&o(n).isFunction||(o(n).isAwait?t?(n.$hidden=!0,r()):(delete n.operator,n.delegate=!1,n.type="YieldExpression",r()):r())})}function a(e){var t=n.promises;n.promises=!0,_(e,!0),n.promises=t}function u(e){return"BlockStatement"!==e.body.type&&(e.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:e.body}]}),e}function c(e,n){n.$asyncexitwarninig||(n.$asyncexitwarninig=!0,d(v(e)+"'async "+{ReturnStatement:"return",ThrowStatement:"throw"}[e.type]+"' not possible in "+(t?"engine":"generator")+" mode. Using Promises for function at "+v(n)))}y.treeWalker(e,function(e,n,r){n();var l,p,h;if(o(e).isAsync&&o(e).isFunction){var f;(f=x(r[0].parent))&&o(f).isAsync&&"get"===r[0].parent.kind&&ee(r[0].parent.key),(p=H(e))?(c(p,e.body),a(e)):t?"get"!==r[0].parent.kind&&s(e,!0):(l=e,delete l.async,h=w(l),s(l,!1),l=u(l),l.body=K(l.body.body,p),h&&D(l.body.body,[ge]),l.id&&"ExpressionStatement"===r[0].parent.type?(l.type="FunctionDeclaration",r[1].replace(l)):r[0].replace(l))}else(l=x(e))&&o(l).isAsync&&((p=H(l))?(c(p,l),a(e)):t&&"get"!==e.kind||(t?a(e):(e.async=!1,h=w(l),s(l,!1),i(l,u(l)),l.body=K(l.body.body,p)),h&&D(l.body.body,[ge])))});var l=r(n);return n.engine=!1,n.generators=!1,ce(e),oe(e),M(e,l.engine),O(e),$(e),U(e,[q,J,R,I,B]),z(e,"warn"),n.engine=l.engine,n.generators=l.generators,e}function ne(e,t,n){var r=[];return y.treeWalker(e,function(i,s,a){return i===e?s():t(i,a)?void r.push([].concat(a)):void(n||o(i).isScope||s())}),r}function re(e,t){var n=[],i={};if(e=e.filter(function(e){return"ExportNamedDeclaration"!==e[0].parent.type}),e.length){var s={};e.forEach(function(e){function t(e){e in s?i[e]=o.declarations[u]:s[e]=o.declarations[u]}for(var n=e[0],o=n.self,a=(o.kind,[]),u=0;u1?{type:"SequenceExpression",expressions:a}:a[0];"For"!==n.parent.type.slice(0,3)&&(p={type:"ExpressionStatement",expression:p}),n.replace(p)}});var o=Object.keys(s);o.length&&(o=o.map(function(e){return{type:"VariableDeclarator",id:h(e),loc:s[e].loc,start:s[e].start,end:s[e].end}}),n[0]&&"VariableDeclaration"===n[0].type?n[0].declarations=n[0].declarations.concat(o):n.unshift({type:"VariableDeclaration",kind:t,declarations:o}))}return{decls:n,duplicates:i}}function ie(e){if(!e)return[];if(Array.isArray(e))return e.reduce(function(e,t){return e.concat(ie(t.id))},[]);switch(e.type){case"Identifier":return[e.name];case"AssignmentPattern":return ie(e.left);case"ArrayPattern":return e.elements.reduce(function(e,t){return e.concat(ie(t))},[]);case"ObjectPattern":return e.properties.reduce(function(e,t){return e.concat(ie(t))},[]);case"ObjectProperty":case"Property":return ie(e.value);case"RestElement":case"RestProperty":return ie(e.argument)}}function se(e){function t(e){d(v(e)+"Possible assignment to 'const "+printNode(e)+"'")}function n(e){switch(e.type){case"Identifier":"const"===r[e.name]&&t(e);break;case"ArrayPattern":e.elements.forEach(function(e){"const"===r[e.name]&&t(e)});break;case"ObjectPattern":e.properties.forEach(function(e){"const"===r[e.key.name]&&t(e)})}}var r={};y.treeWalker(e,function(e,t,i){var s=o(e).isBlockStatement;if(s){r=Object.create(r);for(var a=0;a=0){var r=n[0];return("left"!=r.field||"ForInStatement"!==r.parent.type&&"ForOfStatement"!==r.parent.type)&&("init"!=r.field||"ForStatement"!==r.parent.type||"const"!==t.kind&&"let"!==t.kind)}}}function s(e,t){return!("FunctionDeclaration"!==e.type||!e.id)&&(o(e).isAsync||!e.$continuation)}var c={TemplateLiteral:function(e){return e.expressions},NewExpression:function(e){return e.arguments},CallExpression:function(e){return e.arguments},SequenceExpression:function(e){return e.expressions},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties.map(function(e){return e.value})}};y.treeWalker(e,function(e,n,s){var a;if(n(),e.type in c&&!e.$hoisted){var s,l=c[e.type](e),p=[];for(a=0;a0;a--)if(e.declarations[a]&&e.declarations[a].init&&u(e.declarations[a].init)){var h={type:"VariableDeclaration",kind:e.kind,declarations:e.declarations.splice(a)},f=s[0];if(!("index"in f))throw new Error("VariableDeclaration not in a block");f.parent[f.field].splice(f.index+1,0,h)}}),se(e);var l=!1;return y.treeWalker(e,function(e,t,r){var i=l;if(l=l||pe(e),o(e).isBlockStatement){if(u(e)){var a,c,p,f,y,m=!r[0].parent||o(r[0].parent).isScope;if(m){c=ne(e,n(["const"]),!1);var g={},b={};c.forEach(function(e){e[0].self.declarations.forEach(function(e){ie(e.id).forEach(function(t){g[t]||b[t]?(delete g[t],b[t]=e):g[t]=e})})}),c.forEach(function(e){for(var t=0;t=0&&"ReturnStatement"===i[1].self.type){var s=e.$thisCallName,a=r(de[s].def.body.body);de[s].$inlined=!0,o(i[1].self).isJump||a.push({type:"ReturnStatement"}),i[1].replace(a)}});var n=Object.keys(de).map(function(e){return de[e].$inlined&&de[e].def});y.treeWalker(e,function(e,t,r){t(),n.indexOf(e)>=0&&r[0].remove()})}if(!("Program"===e.type&&"module"===e.sourceType||a(e,function(e){return o(e).isES6},!0))){var i=pe(e);!function(e){y.treeWalker(e,function(e,t,n){if("Program"===e.type||"FunctionDeclaration"===e.type||"FunctionExpression"===e.type){var r=i;if(i=i||pe(e)){t();var s="Program"===e.type?e:e.body,o=ne(s,function(e,t){if("FunctionDeclaration"===e.type)return t[0].parent!==s});o=o.map(function(e){return e[0].remove()}),[].push.apply(s.body,o)}else t();i=r}else t()})}(e)}return y.treeWalker(e,function(e,t,n){t(),Object.keys(e).filter(function(e){return"$"===e[0]}).forEach(function(t){delete e[t]})}),e}var de={},ye=1,me={};Object.keys(n).filter(function(e){return"$"===e[0]}).forEach(function(e){me[e.slice(1)]=h(n[e])});var ge=y.part("var $0 = arguments",[me.arguments]).body[0];return n.engine?(e.ast=ue(e.ast,!0),e.ast=te(e.ast,n.engine),e.ast=le(e.ast),fe(e.ast)):n.generators?(e.ast=ue(e.ast),e.ast=te(e.ast),e.ast=le(e.ast),fe(e.ast)):(e.ast=ue(e.ast),_(e.ast)),n.babelTree&&y.treeWalker(e.ast,function(e,t,n){t(),"Literal"===e.type&&i(e,b(e.value))}),e}var y=e("./parser"),m=e("./output");n.printNode=function e(t){if(!t)return"";if(Array.isArray(t))return t.map(e).join("|\n");try{return m(t)}catch(e){return e.message+": "+(t&&t.type)}};var g={start:!0,end:!0,loc:!0,range:!0},v={getScope:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type&&"BlockStatement"===this.node.body.type?this.node.body.body:"Program"===this.node.type?this.node.body:null},isScope:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"Program"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type&&"BlockStatement"===this.node.body.type},isFunction:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type},isClass:function(){return"ClassDeclaration"===this.node.type||"ClassExpression"===this.node.type},isBlockStatement:function(){return"ClassBody"===this.node.type||"Program"===this.node.type||"BlockStatement"===this.node.type?this.node.body:"SwitchCase"===this.node.type&&this.node.consequent},isExpressionStatement:function(){return"ExpressionStatement"===this.node.type},isLiteral:function(){return"Literal"===this.node.type||"BooleanLiteral"===this.node.type||"RegExpLiteral"===this.node.type||"NumericLiteral"===this.node.type||"StringLiteral"===this.node.type||"NullLiteral"===this.node.type},isDirective:function(){return"ExpressionStatement"===this.node.type&&("StringLiteral"===this.node.expression.type||"Literal"===this.node.expression.type&&"string"==typeof this.node.expression.value)},isUnaryExpression:function(){return"UnaryExpression"===this.node.type},isAwait:function(){return"AwaitExpression"===this.node.type&&!this.node.$hidden},isAsync:function(){return this.node.async},isStatement:function(){return null!==this.node.type.match(/[a-zA-Z]+Declaration/)||null!==this.node.type.match(/[a-zA-Z]+Statement/)},isExpression:function(){return null!==this.node.type.match(/[a-zA-Z]+Expression/)},isLoop:function(){return"ForStatement"===this.node.type||"WhileStatement"===this.node.type||"DoWhileStatement"===this.node.type},isJump:function(){return"ReturnStatement"===this.node.type||"ThrowStatement"===this.node.type||"BreakStatement"===this.node.type||"ContinueStatement"===this.node.type},isES6:function(){switch(this.node.type){case"ExportNamedDeclaration":case"ExportSpecifier":case"ExportDefaultDeclaration":case"ExportAllDeclaration":case"ImportDeclaration":case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ArrowFunctionExpression":case"ForOfStatement":case"YieldExpression":case"Super":case"RestElement":case"RestProperty":case"SpreadElement":case"TemplateLiteral":case"ClassDeclaration":case"ClassExpression":return!0;case"VariableDeclaration":return this.node.kind&&"var"!==this.node.kind;case"FunctionDeclaration":case"FunctionExpression":return!!this.node.generator}}},b={};Object.keys(v).forEach(function(e){Object.defineProperty(b,e,{get:v[e]})}),t.exports={printNode:printNode,babelLiteralNode:p,asynchronize:function(e,t,n,r){try{return d(e,t,n,r)}catch(t){if(t instanceof SyntaxError){var i=e.origCode.substr(t.pos-t.loc.column);i=i.split("\n")[0],t.message+=" (nodent)\n"+i+"\n"+i.replace(/[\S ]/g,"-").substring(0,t.loc.column)+"^",t.stack=""}throw t}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./output":13,"./parser":14}],13:[function(e,t,n){"use strict";function r(e){var t=y[e.type]||y[e.type+e.operator]||y[e.type+e.operator+(e.prefix?"prefix":"")];return void 0!==t?t:20}function i(e,t,n){var r=this[n||e.type];r?r.call(this,e,t):t.write(e,"/*"+e.type+"?*/ "+t.sourceAt(e.start,e.end))}function s(e,t,n,i){2===i||r(n)0){this.out(e[0],t,e[0].type);for(var r=1,i=e.length;r>":13,"BinaryExpression>>>":13,"BinaryExpression<":12,"BinaryExpression<=":12,"BinaryExpression>":12,"BinaryExpression>=":12,BinaryExpressionin:12,BinaryExpressioninstanceof:12,"BinaryExpression==":11,"BinaryExpression===":11,"BinaryExpression!=":11,"BinaryExpression!==":11,"BinaryExpression&":10,"BinaryExpression^":9,"BinaryExpression|":8,"LogicalExpression&&":7,"LogicalExpression||":6,ConditionalExpression:5,AssignmentPattern:4,AssignmentExpression:4,yield:3,YieldExpression:3,SpreadElement:2,"comma-separated-list":1.5,SequenceExpression:1},m={type:"comma-separated-list"},g={out:i,expr:s,formatParameters:o,Program:function(e,t){var n,r,i=h(t.indent,t.indentLevel),s=t.lineEnd;n=e.body;for(var o=0,a=n.length;o0){t.write(null,s);for(var a=0,u=n.length;a0){this.out(n[0],t,"VariableDeclarator");for(var i=1;i0){for(var n=0;n0)for(var r=0;r ")):(this.formatParameters(e.params,t),t.write(e,"=> ")),"ObjectExpression"===e.body.type||"SequenceExpression"===e.body.type?(t.write(null,"("),this.out(e.body,t,e.body.type),t.write(null,")")):this.out(e.body,t,e.body.type)},ThisExpression:function(e,t){t.write(e,"this")},Super:function(e,t){t.write(e,"super")},RestElement:u=function(e,t){t.write(e,"..."),this.out(e.argument,t,e.argument.type)},SpreadElement:u,YieldExpression:function(e,t){t.write(e,e.delegate?"yield*":"yield"),e.argument&&(t.write(null," "),this.expr(t,e,e.argument))},AwaitExpression:function(e,t){t.write(e,"await "),this.expr(t,e,e.argument)},TemplateLiteral:function(e,t){var n,r=e.quasis,i=e.expressions;t.write(e,"`");for(var s=0,o=i.length;s0)for(var n=e.elements,r=n.length,i=0;;){var s=n[i];if(s&&this.expr(t,m,s),i+=1,(i=r)break;t.lineLength()>t.wrapColumn&&t.write(null,t.lineEnd,h(t.indent,t.indentLevel+1))}t.write(null,"]")},ArrayPattern:l,ObjectExpression:function(e,t){var n,r=h(t.indent,t.indentLevel++),i=t.lineEnd,s=r+t.indent;if(t.write(e,"{"),e.properties.length>0){t.write(null,i);for(var o=e.properties,a=o.length,u=0;n=o[u],t.write(null,s),this.out(n,t,"Property"),++ut.wrapColumn&&t.write(null,t.lineEnd,h(t.indent,t.indentLevel+1));t.write(null,i,r,"}")}else t.write(null,"}");t.indentLevel--},Property:function(e,t){e.method||"get"===e.kind||"set"===e.kind?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write(null,"["),this.out(e.key,t,e.key.type),t.write(null,"]")):this.out(e.key,t,e.key.type),t.write(null,": ")),this.expr(t,m,e.value))},ObjectPattern:function(e,t){if(t.write(e,"{"),e.properties.length>0)for(var n=e.properties,r=n.length,i=0;this.out(n[i],t,"Property"),++i0)for(var i=r.length,s=0;s1&&t.write(e," "),this.expr(t,e,e.argument,!0)):(this.expr(t,e,e.argument),t.write(e,e.operator))},UpdateExpression:function(e,t){e.prefix?(t.write(e,e.operator),this.out(e.argument,t,e.argument.type)):(this.out(e.argument,t,e.argument.type),t.write(e,e.operator))},BinaryExpression:c=function(e,t){var n=e.operator;"in"===n&&t.inForInit&&t.write(null,"("),this.expr(t,e,e.left),t.write(e," ",n," "),this.expr(t,e,e.right,"ArrowFunctionExpression"===e.right.type?2:0),"in"===n&&t.inForInit&&t.write(null,")")},LogicalExpression:c,AssignmentExpression:function(e,t){"ObjectPattern"===e.left.type&&t.write(null,"("),this.BinaryExpression(e,t),"ObjectPattern"===e.left.type&&t.write(null,")")},AssignmentPattern:function(e,t){this.expr(t,e,e.left),t.write(e," = "),this.expr(t,e,e.right)},ConditionalExpression:function(e,t){this.expr(t,e,e.test,!0),t.write(e," ? "),this.expr(t,e,e.consequent),t.write(null," : "),this.expr(t,e,e.alternate)},NewExpression:function(e,t){t.write(e,"new "),this.out(e,t,"CallExpression")},CallExpression:function(e,t){this.expr(t,e,e.callee,"ObjectExpression"===e.callee.type?2:0),t.write(e,"(");var n=e.arguments;if(n.length>0)for(var r=n.length,i=0;i=0&&r({self:i,parent:e,field:a[u],index:!0}):c instanceof Object&&i===c&&r({self:i,parent:e,field:a[u]})}})}return n||(n=[{self:e}],n.replace=function(e,t){n[e].replace(t)}),t(e,s,n),e}function s(t,n){var r=[],s={ecmaVersion:8,allowHashBang:!0,allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,locations:!0,onComment:r};if((!n||!n.noNodentExtensions||parseInt(a.version)<4)&&(h||(parseInt(a.version)<4&&console.warn("Nodent: Warning - noNodentExtensions option requires acorn >=v4.x. Extensions installed."),e("acorn-es7-plugin")(a),h=!0),s.plugins=s.plugins||{},s.plugins.asyncawait={asyncExits:!0,awaitAnywhere:!0}),n)for(var o in n)"noNodentExtensions"!==o&&(s[o]=n[o]);var u=a.parse(t,s);return i(u,function(e,t,n){for(t();r.length&&e.loc&&e.loc.start.line>=r[0].loc.start.line&&e.loc.end.line>=r[0].loc.end.line;)e.$comments=e.$comments||[],e.$comments.push(r.shift())}),u}function o(e,t){function n(e,r){if(Array.isArray(r)&&!Array.isArray(e))throw new Error("Can't substitute an array for a node");return r=r||{},Object.keys(e).forEach(function(i){function s(e){return"function"==typeof e&&(e=e()),r=r.concat(e)}function o(e){return"function"==typeof e&&(e=e()),r[i]=e,r}if(!(e[i]instanceof Object))return r[i]=e[i];if(Array.isArray(e[i]))return r[i]=n(e[i],[]);var a;if(a=Array.isArray(r)?s:o,"Identifier"===e[i].type&&"$"===e[i].name[0])return a(t[e[i].name.slice(1)]);if("LabeledStatement"===e[i].type&&"$"===e[i].label.name){var u=e[i].body.expression;return a(t[u.name||u.value])}return a("LabeledStatement"===e[i].type&&"$$"===e[i].label.name.slice(0,2)?t[e[i].label.name.slice(2)](n(e[i]).body):n(e[i]))}),r}f[e]||(f[e]=s(e,{noNodentExtensions:!0,locations:!1,ranges:!1,onComment:null}));var r=n(f[e]);return{body:r.body,expr:"ExpressionStatement"===r.body[0].type?r.body[0].expression:null}}var a=e("acorn"),u=e("acorn/dist/walk"),c={AwaitExpression:function(e,t,n){n(e.argument,t,"Expression")},SwitchStatement:function(e,t,n){n(e.discriminant,t,"Expression");for(var r=0;re)return!1;if((n+=t[r+1])>=e)return!0}}function n(e,n){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&k.test(String.fromCharCode(e)):!1!==n&&t(e,_)))}function r(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&A.test(String.fromCharCode(e)):!1!==n&&(t(e,_)||t(e,C)))))}function i(e,t){ +return new L(e,{beforeExpr:!0,binop:t})}function s(e,t){return void 0===t&&(t={}),t.keyword=e,T[e]=new L(e,t)}function o(e){return 10===e||13===e||8232===e||8233===e}function a(e,t){return j.call(e,t)}function u(e,t){for(var n=1,r=0;;){O.lastIndex=r;var i=O.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),D(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return D(t.onComment)&&(t.onComment=l(t,t.onComment)),t}function l(e,t){return function(n,r,i,s,o,a){var u={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(u.loc=new q(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}function p(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}function h(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}function f(e,t,n,r){try{return new RegExp(e,t)}catch(e){if(void 0!==n)throw e instanceof SyntaxError&&r.raise(n,"Error parsing regular expression: "+e.message),e}}function d(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function y(e,t){return new W(t,e).parse()}function m(e,t,n){var r=new W(n,e,t);return r.nextToken(),r.parseExpression()}function g(e,t){return new W(t,e)}function v(t,n,r){e.parse_dammit=t,e.LooseParser=n,e.pluginsLoose=r}var b={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},x="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",w={5:x,6:x+" const class extends export import super"},E="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",S="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",k=new RegExp("["+E+"]"),A=new RegExp("["+E+S+"]");E=S=null;var _=[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,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],C=[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,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],L=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null},P={beforeExpr:!0},N={startsExpr:!0},T={},F={num:new L("num",N),regexp:new L("regexp",N),string:new L("string",N),name:new L("name",N),eof:new L("eof"),bracketL:new L("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new L("]"),braceL:new L("{",{beforeExpr:!0,startsExpr:!0}),braceR:new L("}"),parenL:new L("(",{beforeExpr:!0,startsExpr:!0}),parenR:new L(")"),comma:new L(",",P),semi:new L(";",P),colon:new L(":",P),dot:new L("."),question:new L("?",P),arrow:new L("=>",P),template:new L("template"),ellipsis:new L("...",P),backQuote:new L("`",N),dollarBraceL:new L("${",{beforeExpr:!0,startsExpr:!0}),eq:new L("=",{beforeExpr:!0,isAssign:!0}),assign:new L("_=",{beforeExpr:!0,isAssign:!0}),incDec:new L("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new L("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:i("||",1),logicalAND:i("&&",2),bitwiseOR:i("|",3),bitwiseXOR:i("^",4),bitwiseAND:i("&",5),equality:i("==/!=",6),relational:i("",7),bitShift:i("<>",8),plusMin:new L("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:i("%",10),star:i("*",10),slash:i("/",10),starstar:new L("**",{beforeExpr:!0}),_break:s("break"),_case:s("case",P),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",P),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",P),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",N),_if:s("if"),_return:s("return",P),_switch:s("switch"),_throw:s("throw",P),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",N),_super:s("super",N),_class:s("class"),_extends:s("extends",P),_export:s("export"),_import:s("import"),_null:s("null",N),_true:s("true",N),_false:s("false",N),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},$=/\r\n?|\n|\u2028|\u2029/,O=new RegExp($.source,"g"),B=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,R=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=Object.prototype,j=I.hasOwnProperty,M=I.toString,D=Array.isArray||function(e){return"[object Array]"===M.call(e)},V=function(e,t){this.line=e,this.column=t};V.prototype.offset=function(e){return new V(this.line,this.column+e)};var q=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},U={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},z={},W=function(e,t,n){this.options=e=c(e),this.sourceFile=e.sourceFile,this.keywords=p(w[e.ecmaVersion>=6?6:5]);var r="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(r=b[i]);i--);"module"==e.sourceType&&(r+=" await")}this.reservedWords=p(r);var s=(r?r+" ":"")+b.strict;this.reservedWordsStrict=p(s),this.reservedWordsStrictBind=p(s+" "+b.strictBind),this.input=String(t),this.containsEsc=!1,this.loadPlugins(e.plugins),n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split($).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=F.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=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope()};W.prototype.isKeyword=function(e){return this.keywords.test(e)},W.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},W.prototype.extend=function(e,t){this[e]=t(this[e])},W.prototype.loadPlugins=function(e){var t=this;for(var n in e){var r=z[n];if(!r)throw new Error("Plugin '"+n+"' not found");r(t,e[n])}},W.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var G=W.prototype,J=/^(?:'((?:[^']|\.)*)'|"((?:[^"]|\.)*)"|;)/;G.strictDirective=function(e){for(var t=this;;){R.lastIndex=e,e+=R.exec(t.input)[0].length;var n=J.exec(t.input.slice(e));if(!n)return!1;if("use strict"==(n[1]||n[2]))return!0;e+=n[0].length}},G.eat=function(e){return this.type===e&&(this.next(),!0)},G.isContextual=function(e){return this.type===F.name&&this.value===e},G.eatContextual=function(e){return this.value===e&&this.eat(F.name)},G.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},G.canInsertSemicolon=function(){return this.type===F.eof||this.type===F.braceR||$.test(this.input.slice(this.lastTokEnd,this.start))},G.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},G.semicolon=function(){this.eat(F.semi)||this.insertSemicolon()||this.unexpected()},G.afterTrailingComma=function(e,t){if(this.type==e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},G.expect=function(e){this.eat(e)||this.unexpected()},G.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var Y=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=-1};G.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},G.checkExpressionErrors=function(e,t){var n=e?e.shorthandAssign:-1;if(!t)return n>=0;n>-1&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")},G.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var Z={kind:"loop"},Q={kind:"switch"};H.isLet=function(){if(this.type!==F.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;R.lastIndex=this.pos;var e=R.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(91===i||123==i)return!0;if(n(i,!0)){for(var s=t+1;r(this.input.charCodeAt(s),!0);)++s;var o=this.input.slice(t,s);if(!this.isKeyword(o))return!0}return!1},H.isAsyncFunction=function(){if(this.type!==F.name||this.options.ecmaVersion<8||"async"!=this.value)return!1;R.lastIndex=this.pos;var e=R.exec(this.input),t=this.pos+e[0].length;return!($.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!=this.input.length&&r(this.input.charAt(t+8)))},H.parseStatement=function(e,t,n){var r,i=this.type,s=this.startNode();switch(this.isLet()&&(i=F._var,r="let"),i){case F._break:case F._continue:return this.parseBreakContinueStatement(s,i.keyword);case F._debugger:return this.parseDebuggerStatement(s);case F._do:return this.parseDoStatement(s);case F._for:return this.parseForStatement(s);case F._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1);case F._class:return e||this.unexpected(),this.parseClass(s,!0);case F._if:return this.parseIfStatement(s);case F._return:return this.parseReturnStatement(s);case F._switch:return this.parseSwitchStatement(s);case F._throw:return this.parseThrowStatement(s);case F._try:return this.parseTryStatement(s);case F._const:case F._var:return r=r||this.value,e||"var"==r||this.unexpected(),this.parseVarStatement(s,r);case F._while:return this.parseWhileStatement(s);case F._with:return this.parseWithStatement(s);case F.braceL:return this.parseBlock();case F.semi:return this.parseEmptyStatement(s);case F._export:case F._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===F._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction()&&e)return this.next(),this.parseFunctionStatement(s,!0);var o=this.value,a=this.parseExpression();return i===F.name&&"Identifier"===a.type&&this.eat(F.colon)?this.parseLabeledStatement(s,o,a):this.parseExpressionStatement(s,a)}},H.parseBreakContinueStatement=function(e,t){var n=this,r="break"==t;this.next(),this.eat(F.semi)||this.insertSemicolon()?e.label=null:this.type!==F.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i=6?this.eat(F.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},H.parseForStatement=function(e){if(this.next(),this.labels.push(Z),this.enterLexicalScope(),this.expect(F.parenL),this.type===F.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===F._var||this.type===F._const||t){var n=this.startNode(),r=t?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===F._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==r&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var i=new Y,s=this.parseExpression(!0,i);return this.type===F._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.toAssignable(s),this.checkLVal(s),this.checkPatternErrors(i,!0),this.parseForIn(e,s)):(this.checkExpressionErrors(i,!0),this.parseFor(e,s))},H.parseFunctionStatement=function(e,t){return this.next(),this.parseFunction(e,!0,!1,t)},H.isFunction=function(){return this.type===F._function||this.isAsyncFunction()},H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!this.strict&&this.isFunction()),e.alternate=this.eat(F._else)?this.parseStatement(!this.strict&&this.isFunction()):null,this.finishNode(e,"IfStatement")},H.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(F.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},H.parseSwitchStatement=function(e){var t=this;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(F.braceL),this.labels.push(Q),this.enterLexicalScope();for(var n,r=!1;this.type!=F.braceR;)if(t.type===F._case||t.type===F._default){var i=t.type===F._case;n&&t.finishNode(n,"SwitchCase"),e.cases.push(n=t.startNode()),n.consequent=[],t.next(),i?n.test=t.parseExpression():(r&&t.raiseRecoverable(t.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),t.expect(F.colon)}else n||t.unexpected(),n.consequent.push(t.parseStatement(!0));return this.exitLexicalScope(),n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},H.parseThrowStatement=function(e){return this.next(),$.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var X=[];H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===F._catch){var t=this.startNode();this.next(),this.expect(F.parenL),t.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(t.param,"let"),this.expect(F.parenR),t.body=this.parseBlock(!1),this.exitLexicalScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(F._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},H.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Z),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},H.parseLabeledStatement=function(e,t,n){for(var r=this,i=0;i=0;o--){var a=r.labels[o];if(a.statementStart!=e.start)break;a.statementStart=r.start,a.kind=s}return this.labels.push({name:t,kind:s,statementStart:this.start}),e.body=this.parseStatement(!0),("ClassDeclaration"==e.body.type||"VariableDeclaration"==e.body.type&&"var"!=e.body.kind||"FunctionDeclaration"==e.body.type&&(this.strict||e.body.generator))&&this.raiseRecoverable(e.body.start,"Invalid labeled declaration"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},H.parseBlock=function(e){var t=this;void 0===e&&(e=!0);var n=this.startNode();for(n.body=[],this.expect(F.braceL),e&&this.enterLexicalScope();!this.eat(F.braceR);){var r=t.parseStatement(!0);n.body.push(r)}return e&&this.exitLexicalScope(),this.finishNode(n,"BlockStatement")},H.parseFor=function(e,t){return e.init=t,this.expect(F.semi),e.test=this.type===F.semi?null:this.parseExpression(),this.expect(F.semi),e.update=this.type===F.parenR?null:this.parseExpression(),this.expect(F.parenR),this.exitLexicalScope(),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},H.parseForIn=function(e,t){var n=this.type===F._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(F.parenR),this.exitLexicalScope(),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},H.parseVar=function(e,t,n){var r=this;for(e.declarations=[],e.kind=n;;){var i=r.startNode();if(r.parseVarId(i,n),r.eat(F.eq)?i.init=r.parseMaybeAssign(t):"const"!==n||r.type===F._in||r.options.ecmaVersion>=6&&r.isContextual("of")?"Identifier"==i.id.type||t&&(r.type===F._in||r.isContextual("of"))?i.init=null:r.raise(r.lastTokEnd,"Complex binding patterns require an initialization value"):r.unexpected(),e.declarations.push(r.finishNode(i,"VariableDeclarator")),!r.eat(F.comma))break}return e},H.parseVarId=function(e,t){e.id=this.parseBindingAtom(t),this.checkLVal(e.id,t,!1)},H.parseFunction=function(e,t,n,r){this.initFunction(e),this.options.ecmaVersion>=6&&!r&&(e.generator=this.eat(F.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&&(e.id="nullableID"===t&&this.type!=F.name?null:this.parseIdent(),e.id&&this.checkLVal(e.id,"var"));var i=this.inGenerator,s=this.inAsync,o=this.yieldPos,a=this.awaitPos,u=this.inFunction;return this.inGenerator=e.generator,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),t||(e.id=this.type==F.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=i,this.inAsync=s,this.yieldPos=o,this.awaitPos=a,this.inFunction=u,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},H.parseFunctionParams=function(e){this.expect(F.parenL),e.params=this.parseBindingList(F.parenR,!1,this.options.ecmaVersion>=8,!0),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(e,t){var n=this;this.next(),this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(F.braceL);!this.eat(F.braceR);)if(!n.eat(F.semi)){var s=n.startNode(),o=n.eat(F.star),a=!1,u=n.type===F.name&&"static"===n.value;n.parsePropertyName(s),s.static=u&&n.type!==F.parenL,s.static&&(o&&n.unexpected(),o=n.eat(F.star),n.parsePropertyName(s)),n.options.ecmaVersion>=8&&!o&&!s.computed&&"Identifier"===s.key.type&&"async"===s.key.name&&n.type!==F.parenL&&!n.canInsertSemicolon()&&(a=!0,n.parsePropertyName(s)),s.kind="method";var c=!1;if(!s.computed){var l=s.key;o||a||"Identifier"!==l.type||n.type===F.parenL||"get"!==l.name&&"set"!==l.name||(c=!0,s.kind=l.name,l=n.parsePropertyName(s)),!s.static&&("Identifier"===l.type&&"constructor"===l.name||"Literal"===l.type&&"constructor"===l.value)&&(i&&n.raise(l.start,"Duplicate constructor in the same class"),c&&n.raise(l.start,"Constructor can't have get/set modifier"),o&&n.raise(l.start,"Constructor can't be a generator"),a&&n.raise(l.start,"Constructor can't be an async method"),s.kind="constructor",i=!0)}if(n.parseClassMethod(r,s,o,a),c){var p="get"===s.kind?0:1;if(s.value.params.length!==p){var h=s.value.start;"get"===s.kind?n.raiseRecoverable(h,"getter should have no params"):n.raiseRecoverable(h,"setter should have exactly one param")}else"set"===s.kind&&"RestElement"===s.value.params[0].type&&n.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},H.parseClassMethod=function(e,t,n,r){t.value=this.parseMethod(n,r),e.body.push(this.finishNode(t,"MethodDefinition"))},H.parseClassId=function(e,t){e.id=this.type===F.name?this.parseIdent():!0===t?this.unexpected():null},H.parseClassSuper=function(e){e.superClass=this.eat(F._extends)?this.parseExprSubscripts():null},H.parseExport=function(e,t){var n=this;if(this.next(),this.eat(F.star))return this.expectContextual("from"),e.source=this.type===F.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(F._default)){this.checkExport(t,"default",this.lastTokStart);var r;if(this.type===F._function||(r=this.isAsyncFunction())){var i=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(i,"nullableID",!1,r)}else if(this.type===F._class){var s=this.startNode();e.declaration=this.parseClass(s,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))e.source=this.type===F.string?this.parseExprAtom():this.unexpected();else{for(var o=0;o=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var r=0;r=6&&(e.computed||e.method||e.shorthand))){var n,r=e.key;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var i=e.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===n&&"init"===i&&(t.proto&&this.raiseRecoverable(r.start,"Redefinition of __proto__ property"),t.proto=!0));n="$"+n;var s=t[n];if(s){var o;o="init"===i?this.strict&&s.init||s.get||s.set:s.init||s[i],o&&this.raiseRecoverable(r.start,"Redefinition of property")}else s=t[n]={init:!1,get:!1,set:!1};s[i]=!0}},ee.parseExpression=function(e,t){var n=this,r=this.start,i=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===F.comma){var o=this.startNodeAt(r,i);for(o.expressions=[s];this.eat(F.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return this.finishNode(o,"SequenceExpression")}return s},ee.parseMaybeAssign=function(e,t,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var r=!1,i=-1,s=-1;t?(i=t.parenthesizedAssign,s=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new Y,r=!0);var o=this.start,a=this.startLoc;this.type!=F.parenL&&this.type!=F.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(e,t);if(n&&(u=n.call(this,u,o,a)),this.type.isAssign){this.checkPatternErrors(t,!0),r||Y.call(t);var c=this.startNodeAt(o,a);return c.operator=this.value,c.left=this.type===F.eq?this.toAssignable(u):u,t.shorthandAssign=-1,this.checkLVal(u),this.next(),c.right=this.parseMaybeAssign(e),this.finishNode(c,"AssignmentExpression")}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),s>-1&&(t.trailingComma=s),u},ee.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(F.question)){var s=this.startNodeAt(n,r);return s.test=i,s.consequent=this.parseMaybeAssign(),this.expect(F.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return i},ee.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)?i:i.start==n&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,n,r,-1,e)},ee.parseExprOp=function(e,t,n,r,i){var s=this.type.binop;if(null!=s&&(!i||this.type!==F._in)&&s>r){var o=this.type===F.logicalOR||this.type===F.logicalAND,a=this.value;this.next();var u=this.start,c=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1),u,c,s,i),p=this.buildBinary(t,n,e,l,a,o);return this.parseExprOp(p,t,n,r,i)}return e},ee.buildBinary=function(e,t,n,r,i,s){var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,s?"LogicalExpression":"BinaryExpression")},ee.parseMaybeUnary=function(e,t){var n,r=this,i=this.start,s=this.startLoc;if(this.inAsync&&this.isContextual("await"))n=this.parseAwait(e),t=!0;else if(this.type.prefix){var o=this.startNode(),a=this.type===F.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),a?this.checkLVal(o.argument):this.strict&&"delete"===o.operator&&"Identifier"===o.argument.type?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):t=!0,n=this.finishNode(o,a?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=r.startNodeAt(i,s);u.operator=r.value,u.prefix=!1,u.argument=n,r.checkLVal(n),r.next(),n=r.finishNode(u,"UpdateExpression")}}return!t&&this.eat(F.starstar)?this.buildBinary(i,s,n,this.parseMaybeUnary(null,!1),"**",!1):n},ee.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e),i="ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||i)return r;var s=this.parseSubscripts(r,t,n);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1)),s},ee.parseSubscripts=function(e,t,n,r){for(var i,s=this,o=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd==e.end&&!this.canInsertSemicolon();;)if((i=s.eat(F.bracketL))||s.eat(F.dot)){var a=s.startNodeAt(t,n);a.object=e,a.property=i?s.parseExpression():s.parseIdent(!0),a.computed=!!i,i&&s.expect(F.bracketR),e=s.finishNode(a,"MemberExpression")}else if(!r&&s.eat(F.parenL)){var u=new Y,c=s.yieldPos,l=s.awaitPos;s.yieldPos=0,s.awaitPos=0;var p=s.parseExprList(F.parenR,s.options.ecmaVersion>=8,!1,u);if(o&&!s.canInsertSemicolon()&&s.eat(F.arrow))return s.checkPatternErrors(u,!1),s.checkYieldAwaitInDefaultParams(),s.yieldPos=c,s.awaitPos=l,s.parseArrowExpression(s.startNodeAt(t,n),p,!0);s.checkExpressionErrors(u,!0),s.yieldPos=c||s.yieldPos,s.awaitPos=l||s.awaitPos;var h=s.startNodeAt(t,n);h.callee=e,h.arguments=p,e=s.finishNode(h,"CallExpression")}else{if(s.type!==F.backQuote)return e;var f=s.startNodeAt(t,n);f.tag=e,f.quasi=s.parseTemplate(),e=s.finishNode(f,"TaggedTemplateExpression")}},ee.parseExprAtom=function(e){var t,n=this.potentialArrowAt==this.start;switch(this.type){case F._super:this.inFunction||this.raise(this.start,"'super' outside of function or class");case F._this:var r=this.type===F._this?"ThisExpression":"Super";return t=this.startNode(),this.next(),this.finishNode(t,r);case F.name:var i=this.start,s=this.startLoc,o=this.parseIdent(this.type!==F.name);if(this.options.ecmaVersion>=8&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(F._function))return this.parseFunction(this.startNodeAt(i,s),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(F.arrow))return this.parseArrowExpression(this.startNodeAt(i,s),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===F.name)return o=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(F.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,s),[o],!0)}return o;case F.regexp:var a=this.value;return t=this.parseLiteral(a.value),t.regex={pattern:a.pattern,flags:a.flags},t;case F.num:case F.string:return this.parseLiteral(this.value);case F._null:case F._true:case F._false:return t=this.startNode(),t.value=this.type===F._null?null:this.type===F._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case F.parenL:var u=this.start,c=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),c;case F.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(F.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case F.braceL:return this.parseObj(!1,e);case F._function:return t=this.startNode(),this.next(),this.parseFunction(t,!1);case F._class:return this.parseClass(this.startNode(),!1);case F._new:return this.parseNew();case F.backQuote:return this.parseTemplate();default:this.unexpected()}},ee.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},ee.parseParenExpression=function(){this.expect(F.parenL);var e=this.parseExpression();return this.expect(F.parenR),e},ee.parseParenAndDistinguishExpression=function(e){var t,n=this,r=this.start,i=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a,u=this.start,c=this.startLoc,l=[],p=!0,h=!1,f=new Y,d=this.yieldPos,y=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==F.parenR;){if(p?p=!1:n.expect(F.comma),s&&n.afterTrailingComma(F.parenR,!0)){h=!0;break}if(n.type===F.ellipsis){o=n.start,l.push(n.parseParenItem(n.parseRest())),n.type===F.comma&&n.raise(n.start,"Comma is not permitted after the rest element");break}n.type!==F.parenL||a||(a=n.start),l.push(n.parseMaybeAssign(!1,f,n.parseParenItem))}var m=this.start,g=this.startLoc;if(this.expect(F.parenR),e&&!this.canInsertSemicolon()&&this.eat(F.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),a&&this.unexpected(a),this.yieldPos=d,this.awaitPos=y,this.parseParenArrowList(r,i,l);l.length&&!h||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=y||this.awaitPos,l.length>1?(t=this.startNodeAt(u,c),t.expressions=l,this.finishNodeAt(t,"SequenceExpression",m,g)):t=l[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(r,i);return v.expression=t,this.finishNode(v,"ParenthesizedExpression")}return t},ee.parseParenItem=function(e){return e},ee.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var te=[];ee.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(F.dot))return e.meta=t,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty");var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.eat(F.parenL)?e.arguments=this.parseExprList(F.parenR,this.options.ecmaVersion>=8,!1):e.arguments=te,this.finishNode(e,"NewExpression")},ee.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===F.backQuote,this.finishNode(e,"TemplateElement")},ee.parseTemplate=function(){var e=this,t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement();for(t.quasis=[n];!n.tail;)e.expect(F.dollarBraceL),t.expressions.push(e.parseExpression()),e.expect(F.braceR),t.quasis.push(n=e.parseTemplateElement());return this.next(),this.finishNode(t,"TemplateLiteral")},ee.parseObj=function(e,t){var n=this,r=this.startNode(),i=!0,s={};for(r.properties=[],this.next();!this.eat(F.braceR);){if(i)i=!1;else if(n.expect(F.comma),n.afterTrailingComma(F.braceR))break;var o,a,u,c,l=n.startNode();n.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(e||t)&&(u=n.start,c=n.startLoc),e||(o=n.eat(F.star))),n.parsePropertyName(l),e||!(n.options.ecmaVersion>=8)||o||l.computed||"Identifier"!==l.key.type||"async"!==l.key.name||n.type===F.parenL||n.type===F.colon||n.canInsertSemicolon()?a=!1:(a=!0,n.parsePropertyName(l,t)),n.parsePropertyValue(l,e,o,a,u,c,t),n.checkPropClash(l,s),r.properties.push(n.finishNode(l,"Property"))}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},ee.parsePropertyValue=function(e,t,n,r,i,s,o){if((n||r)&&this.type===F.colon&&this.unexpected(),this.eat(F.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===F.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(this.options.ecmaVersion>=5&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.type!=F.comma&&this.type!=F.braceR){(n||r||t)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var a="get"===e.kind?0:1;if(e.value.params.length!==a){var u=e.value.start;"get"===e.kind?this.raiseRecoverable(u,"getter should have no params"):this.raiseRecoverable(u,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((this.keywords.test(e.key.name)||(this.strict?this.reservedWordsStrict:this.reservedWords).test(e.key.name)||this.inGenerator&&"yield"==e.key.name||this.inAsync&&"await"==e.key.name)&&this.raiseRecoverable(e.key.start,"'"+e.key.name+"' can not be used as shorthand property"),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===F.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},ee.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(F.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(F.bracketR),e.key;e.computed=!1}return e.key=this.type===F.num||this.type===F.string?this.parseExprAtom():this.parseIdent(!0)},ee.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ee.parseMethod=function(e,t){var n=this.startNode(),r=this.inGenerator,i=this.inAsync,s=this.yieldPos,o=this.awaitPos,a=this.inFunction;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.inGenerator=n.generator,this.inAsync=n.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(F.parenL),n.params=this.parseBindingList(F.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1),this.inGenerator=r,this.inAsync=i,this.yieldPos=s,this.awaitPos=o,this.inFunction=a,this.finishNode(n,"FunctionExpression")},ee.parseArrowExpression=function(e,t,n){var r=this.inGenerator,i=this.inAsync,s=this.yieldPos,o=this.awaitPos,a=this.inFunction;return this.enterFunctionScope(),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.inGenerator=!1,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.inGenerator=r,this.inAsync=i,this.yieldPos=s,this.awaitPos=o,this.inFunction=a,this.finishNode(e,"ArrowFunctionExpression")},ee.parseFunctionBody=function(e,t){var n=t&&this.type!==F.braceL,r=this.strict,i=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!s||(i=this.strictDirective(this.end))&&s&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(e,!r&&!i&&!t&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.labels=o}this.exitFunctionScope(),this.strict&&e.id&&this.checkLVal(e.id,"none"),this.strict=r},ee.isSimpleParamList=function(e){for(var t=0;t=6||-1==this.input.slice(this.start,this.end).indexOf("\\"))&&this.raiseRecoverable(this.start,"The keyword '"+this.value+"' is reserved"),this.inGenerator&&"yield"===this.value&&this.raiseRecoverable(this.start,"Can not use 'yield' as identifier inside a generator"),this.inAsync&&"await"===this.value&&this.raiseRecoverable(this.start,"Can not use 'await' as identifier inside an async function"),t.name=this.value):e&&this.type.keyword?t.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(t,"Identifier")},ee.parseYield=function(){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type==F.semi||this.canInsertSemicolon()||this.type!=F.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(F.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")},ee.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var ne=W.prototype;ne.raise=function(e,t){var n=u(this.input,e);t+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},ne.raiseRecoverable=ne.raise,ne.curPosition=function(){if(this.options.locations)return new V(this.curLine,this.pos-this.lineStart)};var re=W.prototype,ie=Object.assign||function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var r=0;r=0;t--)if(e.context[t].generator)return!0;return!1},ce.updateContext=function(e){var t,n=this.type;n.keyword&&e==F.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},F.parenR.updateContext=F.braceR.updateContext=function(){if(1==this.context.length)return void(this.exprAllowed=!0);var e,t=this.context.pop();t===ue.b_stat&&(e=this.curContext())&&"function"===e.token?(this.context.pop(),this.exprAllowed=!1):t===ue.b_tmpl?this.exprAllowed=!0:this.exprAllowed=!t.isExpr},F.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ue.b_stat:ue.b_expr),this.exprAllowed=!0},F.dollarBraceL.updateContext=function(){this.context.push(ue.b_tmpl),this.exprAllowed=!0},F.parenL.updateContext=function(e){var t=e===F._if||e===F._for||e===F._with||e===F._while;this.context.push(t?ue.p_stat:ue.p_expr),this.exprAllowed=!0},F.incDec.updateContext=function(){},F._function.updateContext=function(e){e.beforeExpr&&e!==F.semi&&e!==F._else&&(e!==F.colon&&e!==F.braceL||this.curContext()!==ue.b_stat)&&this.context.push(ue.f_expr),this.exprAllowed=!1},F.backQuote.updateContext=function(){this.curContext()===ue.q_tmpl?this.context.pop():this.context.push(ue.q_tmpl),this.exprAllowed=!1},F.star.updateContext=function(e){e==F._function&&(this.curContext()===ue.f_expr?this.context[this.context.length-1]=ue.f_expr_gen:this.context.push(ue.f_gen)),this.exprAllowed=!0},F.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&("of"==this.value&&!this.exprAllowed||"yield"==this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var le=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new q(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},pe=W.prototype,he="object"==typeof Packages&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);pe.next=function(){this.options.onToken&&this.options.onToken(new le(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pe.getToken=function(){return this.next(),new le(this)},"undefined"!=typeof Symbol&&(pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===F.eof,value:t}}}}),pe.curContext=function(){return this.context[this.context.length-1]},pe.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(F.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},pe.readToken=function(e){return n(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},pe.skipBlockComment=function(){var e=this,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations){O.lastIndex=n;for(var i;(i=O.exec(this.input))&&i.index8&&t<14||t>=5760&&B.test(String.fromCharCode(t))))break e;++e.pos}}},pe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},pe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(F.ellipsis)):(++this.pos,this.finishToken(F.dot))},pe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(F.assign,2):this.finishOp(F.slash,1)},pe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?F.star:F.modulo;return this.options.ecmaVersion>=7&&42===t&&(++n,r=F.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(F.assign,n+1):this.finishOp(r,n)},pe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?F.logicalOR:F.logicalAND,2):61===t?this.finishOp(F.assign,2):this.finishOp(124===e?F.bitwiseOR:F.bitwiseAND,1)},pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(F.assign,2):this.finishOp(F.bitwiseXOR,1)},pe.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45==t&&62==this.input.charCodeAt(this.pos+2)&&$.test(this.input.slice(this.lastTokEnd,this.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(F.incDec,2):61===t?this.finishOp(F.assign,2):this.finishOp(F.plusMin,1)},pe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(F.assign,n+1):this.finishOp(F.bitShift,n)):33==t&&60==e&&45==this.input.charCodeAt(this.pos+2)&&45==this.input.charCodeAt(this.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(n=2),this.finishOp(F.relational,n))},pe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(F.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(F.arrow)):this.finishOp(61===e?F.eq:F.prefix,1)},pe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(F.parenL);case 41:return++this.pos,this.finishToken(F.parenR);case 59:return++this.pos,this.finishToken(F.semi);case 44:return++this.pos,this.finishToken(F.comma);case 91:return++this.pos,this.finishToken(F.bracketL);case 93:return++this.pos,this.finishToken(F.bracketR);case 123:return++this.pos,this.finishToken(F.braceL);case 125:return++this.pos,this.finishToken(F.braceR);case 58:return++this.pos,this.finishToken(F.colon);case 63:return++this.pos,this.finishToken(F.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(F.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(F.prefix,1)}this.raise(this.pos,"Unexpected character '"+d(e)+"'")},pe.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};var fe=!!f("￿","u");pe.readRegexp=function(){for(var e,t,n=this,r=this.pos;;){n.pos>=n.input.length&&n.raise(r,"Unterminated regular expression");var i=n.input.charAt(n.pos);if($.test(i)&&n.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++n.pos}var s=this.input.slice(r,this.pos);++this.pos;var o=this.readWord1(),a=s,u="";if(o){var c=/^[gim]*$/;this.options.ecmaVersion>=6&&(c=/^[gimuy]*$/),c.test(o)||this.raise(r,"Invalid regular expression flag"),o.indexOf("u")>=0&&(fe?u="u":(a=a.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t,i){return t=Number("0x"+t),t>1114111&&n.raise(r+i+3,"Code point out of bounds"),"x"}),a=a.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"),u=u.replace("u","")))}var l=null;return he||(f(a,u,r,this),l=f(s,o)),this.finishToken(F.regexp,{pattern:s,flags:o,value:l})},pe.readInt=function(e,t){for(var n=this,r=this.pos,i=0,s=0,o=null==t?1/0:t;s=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0)>=e)break;++n.pos,i=i*e+a}return this.pos===r||null!=t&&this.pos-r!==t?null:i},pe.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.start+2,"Expected number in radix "+e),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(F.num,t)},pe.readNumber=function(e){var t=this.pos,r=!1,i=48===this.input.charCodeAt(this.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number"),i&&this.pos==t+1&&(i=!1);var s=this.input.charCodeAt(this.pos);46!==s||i||(++this.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(s=this.input.charCodeAt(++this.pos),43!==s&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),r=!0),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o,a=this.input.slice(t,this.pos);return r?o=parseFloat(a):i&&1!==a.length?/[89]/.test(a)||this.strict?this.raise(t,"Invalid number"):o=parseInt(a,8):o=parseInt(a,10),this.finishToken(F.num,o)},pe.readCodePoint=function(){var e,t=this.input.charCodeAt(this.pos);if(123===t){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.raise(n,"Code point out of bounds")}else e=this.readHexChar(4);return e},pe.readString=function(e){for(var t=this,n="",r=++this.pos;;){t.pos>=t.input.length&&t.raise(t.start,"Unterminated string constant");var i=t.input.charCodeAt(t.pos);if(i===e)break;92===i?(n+=t.input.slice(r,t.pos),n+=t.readEscapedChar(!1),r=t.pos):(o(i)&&t.raise(t.start,"Unterminated string constant"),++t.pos)}return n+=this.input.slice(r,this.pos++),this.finishToken(F.string,n)},pe.readTmplToken=function(){for(var e=this,t="",n=this.pos;;){e.pos>=e.input.length&&e.raise(e.start,"Unterminated template");var r=e.input.charCodeAt(e.pos);if(96===r||36===r&&123===e.input.charCodeAt(e.pos+1))return e.pos===e.start&&e.type===F.template?36===r?(e.pos+=2,e.finishToken(F.dollarBraceL)):(++e.pos,e.finishToken(F.backQuote)):(t+=e.input.slice(n,e.pos),e.finishToken(F.template,t));if(92===r)t+=e.input.slice(n,e.pos),t+=e.readEscapedChar(!0),n=e.pos;else if(o(r)){switch(t+=e.input.slice(n,e.pos),++e.pos,r){case 13:10===e.input.charCodeAt(e.pos)&&++e.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(r)}e.options.locations&&(++e.curLine,e.lineStart=e.pos),n=e.pos}else++e.pos}},pe.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return d(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);return r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),"0"!==n&&(this.strict||e)&&this.raise(this.pos-2,"Octal literal in strict mode"), +this.pos+=n.length-1,String.fromCharCode(r)}return String.fromCharCode(t)}},pe.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.raise(t,"Bad character escape sequence"),n},pe.readWord1=function(){var e=this;this.containsEsc=!1;for(var t="",i=!0,s=this.pos,o=this.options.ecmaVersion>=6;this.pos=r)&&o[u](t,i,e),(null==n||t.start==n)&&(null==r||t.end==r)&&s(u,t))throw new h(t,i)}(t,a)}catch(e){if(e instanceof h)return e;throw e}}function o(t,n,r,s,o){r=i(r),s||(s=e.base);try{!function e(t,i,o){var a=o||t.type;if(!(t.start>n||t.end=n&&r(a,t))throw new h(t,i);s[a](t,i,e)}}(t,o)}catch(e){if(e instanceof h)return e;throw e}}function u(t,n,r,s,o){r=i(r),s||(s=e.base);var a;return function e(t,i,o){if(!(t.start>n)){var u=o||t.type;t.end<=n&&(!a||a.node.end=0&&e>1;return t?-n:n}var s=e("./base64");n.encode=function(e){var t,n="",i=r(e);do{t=31&i,i>>>=5,i>0&&(t|=32),n+=s.encode(t)}while(i>0);return n},n.decode=function(e,t,n){var r,o,a=e.length,u=0,c=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=s.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&o),o&=31,u+=o<0?t-u>1?r(u,t,i,s,o,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,i,s,o,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,i,s){if(0===t.length)return-1;var o=r(-1,t.length,e,t,i,s||n.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===i(t[o],t[o-1],!0);)--o;return o}},{}],21:[function(e,t,n){function r(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,o=t.generatedColumn;return r>n||r==n&&o>=i||s.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var s=e("./util");i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){r(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=i},{"./util":26}],22:[function(e,t,n){function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function i(e,t){return Math.round(e+Math.random()*(t-e))}function s(e,t,n,o){if(n=0){var s=this._originalMappings[i];if(void 0===e.column)for(var o=s.originalLine;s&&s.originalLine===o;)r.push({line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)r.push({line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return r},n.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.fromSourceMap=function(e){var t=Object.create(i.prototype),n=t._names=c.fromArray(e._names.toArray(),!0),r=t._sources=c.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var o=e._mappings.toArray().slice(),u=t.__generatedMappings=[],l=t.__originalMappings=[],h=0,f=o.length;h1&&(n.source=y+i[1],y+=i[1],n.originalLine=f+i[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=m+i[4],m+=i[4])),E.push(n),"number"==typeof n.originalLine&&w.push(n)}p(E,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,p(w,a.compareByOriginalPositions),this.__originalMappings=w},i.prototype._findMapping=function(e,t,n,r,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,s)},i.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=a.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=a.join(this.sourceRoot,s)));var o=a.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:s,line:a.getArg(i,"originalLine",null),column:a.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=a.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=a.getArg(e,"source");if(null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var n={source:t,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=i,o.prototype=Object.create(r.prototype),o.prototype.constructor=r,o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},r.prototype._serializeMappings=function(){for(var e,t,n,r,o=0,a=1,u=0,c=0,l=0,p=0,h="",f=this._mappings.toArray(),d=0,y=f.length;d0){if(!s.compareByGeneratedPositionsInflated(t,f[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=i.encode(r-p),p=r,e+=i.encode(t.originalLine-1-c),c=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-l),l=n)),h+=e}return h},r.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=s.relative(t,e));var n=s.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},r.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=r},{"./array-set":17,"./base64-vlq":18,"./mapping-list":21,"./util":26}],25:[function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[o]=!0,null!=r&&this.add(r)}var i=e("./source-map-generator").SourceMapGenerator,s=e("./util"),o="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)o.add(t);else{var i=n?s.join(n,e.source):e.source;o.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var o=new r,a=e.split(/(\r?\n)/),u=function(){return a.shift()+(a.shift()||"")},c=1,l=0,p=null;return t.eachMapping(function(e){if(null!==p){if(!(c0&&(p&&i(p,u()),o.add(a.join(""))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);null!=r&&(null!=n&&(e=s.join(n,e)),o.setSourceContent(e,r))}),o},r.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},r.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n=0;l--)o=u[l],"."===o?u.splice(l,1):".."===o?c++:c>0&&(""===o?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return t=u.join("/"),""===t&&(t=a?"/":"."),r?(r.path=t,s(r)):t}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),r=i(e);if(r&&(e=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),s(n);if(n||t.match(v))return t;if(r&&!r.host&&!r.path)return r.host=t,s(r);var a="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=a,s(r)):a}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function c(e){return e}function l(e){return h(e)?"$"+e:e}function p(e){return h(e)?e.slice(1):e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1 +;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=e.source-t.source;return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:(r=e.generatedLine-t.generatedLine,0!==r?r:e.name-t.name)}function d(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=e.source-t.source)?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:e.name-t.name)}function y(e,t){return e===t?0:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=y(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:y(e.name,t.name))}n.getArg=r;var g=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,v=/^data:.+\,.+$/;n.urlParse=i,n.urlGenerate=s,n.normalize=o,n.join=a,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(g)},n.relative=u;var b=function(){return!("__proto__"in Object.create(null))}();n.toSetString=b?c:l,n.fromSetString=b?c:p,n.compareByOriginalPositions=f,n.compareByGeneratedPositionsDeflated=d,n.compareByGeneratedPositionsInflated=m},{}],27:[function(e,t,n){n.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,n.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,n.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":23,"./lib/source-map-generator":24,"./lib/source-node":25}],28:[function(e,t,n){t.exports={_args:[[{raw:"nodent@^3.0.17",scope:null,escapedName:"nodent",name:"nodent",rawSpec:"^3.0.17",spec:">=3.0.17 <4.0.0",type:"range"},"/Users/evgenypoberezkin/JSON/ajv-v4"]],_from:"nodent@>=3.0.17 <4.0.0",_id:"nodent@3.0.17",_inCache:!0,_location:"/nodent",_nodeVersion:"6.9.1",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/nodent-3.0.17.tgz_1490780005669_0.5196401283610612"},_npmUser:{name:"matatbread",email:"npm@mailed.me.uk"},_npmVersion:"3.10.8",_phantomChildren:{},_requested:{raw:"nodent@^3.0.17",scope:null,escapedName:"nodent",name:"nodent",rawSpec:"^3.0.17",spec:">=3.0.17 <4.0.0",type:"range"},_requiredBy:["#DEV:/"],_resolved:"https://registry.npmjs.org/nodent/-/nodent-3.0.17.tgz",_shasum:"22df57d33c5346d6acc3722d9d69fa68bff518e4",_shrinkwrap:null,_spec:"nodent@^3.0.17",_where:"/Users/evgenypoberezkin/JSON/ajv-v4",author:{name:"Mat At Bread",email:"nodent@mailed.me.uk"},bin:{nodentjs:"./nodent.js"},bugs:{url:"https://github.com/MatAtBread/nodent/issues"},dependencies:{acorn:">=2.5.2","acorn-es7-plugin":">=1.1.6","nodent-runtime":">=3.0.4",resolve:"^1.2.0","source-map":"^0.5.6"},description:"NoDent - Asynchronous Javascript language extensions",devDependencies:{},directories:{},dist:{shasum:"22df57d33c5346d6acc3722d9d69fa68bff518e4",tarball:"https://registry.npmjs.org/nodent/-/nodent-3.0.17.tgz"},engines:"node >= 0.10.0",gitHead:"1a48bd0e8d0b4df69aa7b4b3cf8483c03c1cfbd5",homepage:"https://github.com/MatAtBread/nodent#readme",keywords:["Javascript","ES7","async","await","language","extensions","Node","callback","generator","Promise","asynchronous"],license:"BSD-2-Clause",main:"nodent.js",maintainers:[{name:"matatbread",email:"npm@mailed.me.uk"}],name:"nodent",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/MatAtBread/nodent.git"},scripts:{cover:"istanbul cover ./nodent.js tests -- --quick --syntax ; open ./coverage/lcov-report/index.html",start:"./nodent.js",test:"cd tests && npm i --prod && cd .. && node --expose-gc ./nodent.js tests --syntax --quick && node --expose-gc ./nodent.js tests --quick --notStrict","test-loader":"cd tests/loader/app && npm test && cd ../../.."},version:"3.0.17"}},{}],29:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;s--){var o=s>=0?arguments[s]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,i="/"===o.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(e){var i=n.isAbsolute(e),s="/"===o(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var i=r(e.split("/")),s=r(t.split("/")),o=Math.min(i.length,s.length),a=o,u=0;u1)for(var n=1;n=(t[n]||0))return!0;return!1}(o))for(var a=0;a"))}return o.promises||o.es7||o.generators||o.engine?((o.promises||o.es7)&&o.generators&&(n("No valid 'use nodent' directive, assumed -es7 mode"),o=I.es7),(o.generators||o.engine)&&(o.promises=!0),o.promises&&(o.es7=!0),o):null}function y(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),"#!"===e.substring(0,2)&&(e="//"+e),e}function m(e){var t;return t=e instanceof i?e:new i(e.toString(),"binary"),t.toString("base64")}function g(e,t){return t=t||e.log,function(n,r,i){var s=y(N.readFileSync(r,"utf8")),o=e.parse(s,r,i);i=i||d(o.ast,t,r),e.asynchronize(o,void 0,i,t),e.prettyPrint(o,i),n._compile(o.code,o.filename)}}function v(e){return e=e||q,function(t,n,r){if(Array.isArray(n)){var i=n;n=function(e,t){return i.indexOf(e)>=0}}else n=n||function(e,t){return!(e.match(/Sync$/)&&e.replace(/Sync$/,"")in t)};r||(r="");var s=Object.create(t);for(var o in s)!function(){var i=o;try{"function"!=typeof t[i]||s[i+r]&&s[i+r].isAsync||!n(i,s)||(s[i+r]=function(){var n=Array.prototype.slice.call(arguments);return new e(function(e,r){var s=function(t,n){if(t)return r(t);switch(arguments.length){case 0:return e();case 2:return e(n);default:return e(Array.prototype.slice.call(arguments,1))}};n.length>t[i].length?n.push(s):n[t[i].length-1]=s;t[i].apply(t,n)})},s[i+r].isAsync=!0)}catch(e){}}();return s.super=t,s}}function b(t,n){var r=t.filename.split("/"),i=r.pop(),s=T(t.ast,n&&n.sourcemap?{map:{startLine:n.mapStartLine||0,file:i+"(original)",sourceMapRoot:r.join("/"),sourceContent:t.origCode}}:null,t.origCode);if(n&&n.sourcemap)try{var o="",a=s.map.toJSON();if(a){var u=e("source-map").SourceMapConsumer;t.sourcemap=a,P[t.filename]={map:a,smc:new u(a)},o="\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+m(JSON.stringify(a))+"\n"}t.code=s.code+o}catch(e){t.code=s}else t.code=s;return t}function x(e,t,n,r){"object"==typeof n&&void 0===r&&(r=n);var i={origCode:e.toString(),filename:t};try{return i.ast=F.parse(i.origCode,r&&r.parser),r.babelTree&&F.treeWalker(i.ast,function(e,t,n){"Literal"===e.type?n[0].replace($.babelLiteralNode(e.value)):"Property"===e.type&&("ClassBody"===n[0].parent.type?e.type="ClassProperty":e.type="ObjectProperty"),t()}),i}catch(e){if(e instanceof SyntaxError){var s=i.origCode.substr(e.pos-e.loc.column);s=s.split("\n")[0],e.message+=" "+t+" (nodent)\n"+s+"\n"+s.replace(/[\S ]/g,"-").substring(0,e.loc.column)+"^",e.stack=""}throw e}}function w(t,n){n=n||{};var r=t+"|"+Object.keys(n).sort().reduce(function(e,t){return e+t+JSON.stringify(n[t])},"");return this.covers[r]||(t.indexOf("/")>=0?this.covers[r]=e(t):this.covers[r]=e(c+"/covers/"+t)),this.covers[r](this,n)}function E(e,t,n,r){"object"==typeof n&&void 0===r&&(r=n),r=r||{};for(var i in R)i in r||(r[i]=R[i]);var s=this.parse(e,t,null,r);return this.asynchronize(s,null,r,this.log||h),this.prettyPrint(s,r),s}function S(t,n,r){var i={},s=this;n||(n=/\.njs$/),r?r.compiler||(r.compiler={}):r={compiler:{}};var o=l([B,r.compiler]);return function(a,u,c){function l(e){u.statusCode=500,u.write(e.toString()),u.end()}if(i[a.url])return u.setHeader("Content-Type",i[a.url].contentType),r.setHeaders&&r.setHeaders(u),u.write(i[a.url].output),void u.end();if(!(a.url.match(n)||r.htmlScriptRegex&&a.url.match(r.htmlScriptRegex)))return c&&c();var p=t+a.url;if(r.extensions&&!N.existsSync(p))for(var h=0;h …"+n.source+":"+n.line+":"+n.column+(e.getFunctionName()?")":"")}}return"\n at "+e}return e+t.map(n).join("")}function _(e){var t={};t[R.$asyncbind]={value:D,writable:!0,enumerable:!1,configurable:!0},t[R.$asyncspawn]={value:V,writable:!0,enumerable:!1,configurable:!0};try{Object.defineProperties(Function.prototype,t)}catch(t){e.log("Function prototypes already assigned: ",t.messsage)}R[R.$error]in r||(r[R[R.$error]]=p),e.augmentObject&&Object.defineProperties(Object.prototype,{asyncify:{value:function(e,t,n){return v(e)(this,t,n)},writable:!0,configurable:!0},isThenable:{value:function(){return q.isThenable(this)},writable:!0,configurable:!0}}),Object[R.$makeThenable]=q.resolve}function C(t){function n(e,t){e=e.split("."),t=t.split(".");for(var n=0;n<3;n++){if(e[n]t[n])return 1}return 0}function r(i,s){if(!s.match(/nodent\/nodent\.js$/)){if(s.match(/node_modules\/nodent\/.*\.js$/))return L(i,s);for(var u=0;u=3&&function(){function t(e,t){try{var n,s;if(o.fromast){if(e=JSON.parse(e),n={origCode:"",filename:i,ast:e},!(s=d(e,a.log))){var u=o.use?'"use nodent-'+o.use+'";':'"use nodent";';s=d(u,a.log),console.warn("/* "+i+": No 'use nodent*' directive, assumed "+u+" */")}}else s=d(o.use?'"use nodent-'+o.use+'";':e,a.log),s||(s=d('"use nodent";',a.log),o.dest||console.warn("/* "+i+": 'use nodent*' directive missing/ignored, assumed 'use nodent;' */")),n=a.parse(e,i,s);if(o.parseast||o.pretty||a.asynchronize(n,void 0,s,a.log),a.prettyPrint(n,s),o.out||o.pretty||o.dest){if(o.dest&&!t)throw new Error("Can't write unknown file to "+o.dest);var c="";o.runtime&&(c+="Function.prototype.$asyncbind = "+Function.prototype.$asyncbind.toString()+";\n",c+="global.$error = global.$error || "+r.$error.toString()+";\n"),c+=n.code,t&&o.dest?(N.writeFileSync(o.dest+t,c),console.log("Compiled",o.dest+t)):console.log(c)}(o.minast||o.parseast)&&console.log(JSON.stringify(n.ast,function(e,t){return"$"===e[0]||e.match(/^(start|end|loc)$/)?void 0:t},2,null)),o.ast&&console.log(JSON.stringify(n.ast,function(e,t){return"$"===e[0]?void 0:t},0)),o.exec&&new Function(n.code)()}catch(e){console.error(e)}}var i,s=e("path"),o=(n.env.NODENT_OPTS&&JSON.parse(n.env.NODENT_OPTS),function(e){for(var t=[],r=e||2;r<]/g}},{}],2:[function(e,t,r){"use strict";function n(){var e={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};return e.colors.grey=e.colors.gray,Object.keys(e).forEach(function(t){var r=e[t];Object.keys(r).forEach(function(t){var n=r[t];e[t]=r[t]={open:"["+n[0]+"m",close:"["+n[1]+"m"}}),Object.defineProperty(e,t,{value:r,enumerable:!1})}),e}Object.defineProperty(t,"exports",{enumerable:!0,get:n})},{}],3:[function(e,t,r){(function(r){"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i=0;o--)if(u[o]!==l[o])return!1;for(o=u.length-1;o>=0;o--)if(a=u[o],!f(e[a],t[a],r,n))return!1;return!0}function y(e,t,r){f(e,t,!0)&&p(e,t,r,"notDeepStrictEqual",y)}function g(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function b(e){var t;try{e()}catch(e){t=e}return t}function v(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=b(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&p(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&x.isError(i),o=!e&&i&&!r;if((a&&s&&g(i,r)||o)&&p(i,r,"Got unwanted exception"+n),e&&i&&r&&!g(i,r)||!e&&i)throw i}var x=e("util/"),E=Object.prototype.hasOwnProperty,A=Array.prototype.slice,D=function(){return"foo"===function(){}.name}(),C=t.exports=h,S=/\s*function\s+([^\(\s]*)\s*/;C.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var t=e.stackStartFunction||p;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=o(t),s=n.indexOf("\n"+i);if(s>=0){var a=n.indexOf("\n",s+1);n=n.substring(a+1)}this.stack=n}}},x.inherits(C.AssertionError,Error),C.fail=p,C.ok=h,C.equal=function(e,t,r){e!=t&&p(e,t,r,"==",C.equal)},C.notEqual=function(e,t,r){e==t&&p(e,t,r,"!=",C.notEqual)},C.deepEqual=function(e,t,r){f(e,t,!1)||p(e,t,r,"deepEqual",C.deepEqual)},C.deepStrictEqual=function(e,t,r){f(e,t,!0)||p(e,t,r,"deepStrictEqual",C.deepStrictEqual)},C.notDeepEqual=function(e,t,r){f(e,t,!1)&&p(e,t,r,"notDeepEqual",C.notDeepEqual)},C.notDeepStrictEqual=y,C.strictEqual=function(e,t,r){e!==t&&p(e,t,r,"===",C.strictEqual)},C.notStrictEqual=function(e,t,r){e===t&&p(e,t,r,"!==",C.notStrictEqual)},C.throws=function(e,t,r){v(!0,e,t,r)},C.doesNotThrow=function(e,t,r){v(!1,e,t,r)},C.ifError=function(e){if(e)throw e};var _=Object.keys||function(e){var t=[];for(var r in e)E.call(e,r)&&t.push(r);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":601}],4:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=t.use(e("../lib/shared")).defaults,i=r.Type.def,s=r.Type.or;i("Noop").bases("Node").build(),i("DoExpression").bases("Expression").build("body").field("body",[i("Statement")]),i("Super").bases("Expression").build(),i("BindExpression").bases("Expression").build("object","callee").field("object",s(i("Expression"),null)).field("callee",i("Expression")),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",s([i("Decorator")],null),n.null),i("MethodDefinition").field("decorators",s([i("Decorator")],null),n.null),i("MetaProperty").bases("Expression").build("meta","property").field("meta",i("Identifier")).field("property",i("Identifier")),i("ParenthesizedExpression").bases("Expression").build("expression").field("expression",i("Expression")),i("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",i("Identifier")),i("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),i("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),i("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",s(i("Declaration"),i("Expression"))),i("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",s(i("Declaration"),null)).field("specifiers",[i("ExportSpecifier")],n.emptyArray).field("source",s(i("Literal"),null),n.null),i("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",i("Identifier")),i("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("ExportAllDeclaration").bases("Declaration").build("exported","source").field("exported",s(i("Identifier"),null)).field("source",i("Literal")),i("CommentBlock").bases("Comment").build("value","leading","trailing"),i("CommentLine").bases("Comment").build("value","leading","trailing")}},{"../lib/shared":20,"../lib/types":21,"./es7":9}],5:[function(e,t,r){t.exports=function(t){t.use(e("./babel")),t.use(e("./flow"));var r=t.use(e("../lib/types")),n=t.use(e("../lib/shared")).defaults,i=r.Type.def,s=r.Type.or;i("Directive").bases("Node").build("value").field("value",i("DirectiveLiteral")),i("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,n["use strict"]),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],n.emptyArray),i("Program").bases("Node").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],n.emptyArray),i("StringLiteral").bases("Literal").build("value").field("value",String),i("NumericLiteral").bases("Literal").build("value").field("value",Number),i("NullLiteral").bases("Literal").build(),i("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),i("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String);var a=s(i("Property"),i("ObjectMethod"),i("ObjectProperty"),i("SpreadProperty"));i("ObjectExpression").bases("Expression").build("properties").field("properties",[a]),i("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",s("method","get","set")).field("key",s(i("Literal"),i("Identifier"),i("Expression"))).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("computed",Boolean,n.false).field("generator",Boolean,n.false).field("async",Boolean,n.false).field("decorators",s([i("Decorator")],null),n.null),i("ObjectProperty").bases("Node").build("key","value").field("key",s(i("Literal"),i("Identifier"),i("Expression"))).field("value",s(i("Expression"),i("Pattern"))).field("computed",Boolean,n.false);var o=s(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassMethod"));i("ClassBody").bases("Declaration").build("body").field("body",[o]),i("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("kind",s("get","set","method","constructor")).field("key",s(i("Literal"),i("Identifier"),i("Expression"))).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("computed",Boolean,n.false).field("static",Boolean,n.false).field("generator",Boolean,n.false).field("async",Boolean,n.false).field("decorators",s([i("Decorator")],null),n.null);var u=s(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"),i("ObjectProperty"),i("RestProperty"));i("ObjectPattern").bases("Pattern").build("properties").field("properties",[u]).field("decorators",s([i("Decorator")],null),n.null),i("SpreadProperty").bases("Node").build("argument").field("argument",i("Expression")),i("RestProperty").bases("Node").build("argument").field("argument",i("Expression")),i("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",s(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("Import").bases("Expression").build()}},{"../lib/shared":20,"../lib/types":21,"./babel":4,"./flow":11}],6:[function(e,t,r){t.exports=function(t){var r=t.use(e("../lib/types")),n=r.Type,i=n.def,s=n.or,a=t.use(e("../lib/shared")),o=a.defaults,u=a.geq;i("Printable").field("loc",s(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",s([i("Comment")],null),o.null,!0),i("SourceLocation").build("start","end","source").field("start",i("Position")).field("end",i("Position")).field("source",s(String,null),o.null),i("Position").build("line","column").field("line",u(1)).field("column",u(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",s(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",s(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",s(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",s(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",s(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",s(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",s(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",s(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",s(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",s(i("VariableDeclaration"),i("Expression"),null)).field("test",s(i("Expression"),null)).field("update",s(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",s(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",s("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",s(i("Expression"),null)),i("Expression").bases("Node","Pattern"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[s(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",s("init","get","set")).field("key",s(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var l=s("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",l).field("argument",i("Expression")).field("prefix",Boolean,o.true);var c=s("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",c).field("left",i("Expression")).field("right",i("Expression"));var p=s("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",p).field("left",i("Pattern")).field("right",i("Expression"));var h=s("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",h).field("argument",i("Expression")).field("prefix",Boolean);var f=s("||","&&");i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",f).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",s(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var e=this.property.type;return"Literal"===e||"MemberExpression"===e||"BinaryExpression"===e}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",s(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Node","Expression","Pattern").build("name").field("name",String),i("Literal").bases("Node","Expression").build("value").field("value",s(String,Boolean,null,Number,RegExp)).field("regex",s({pattern:String,flags:String},null),function(){if(this.value instanceof RegExp){var e="";return this.value.ignoreCase&&(e+="i"),this.value.multiline&&(e+="m"),this.value.global&&(e+="g"),{pattern:this.value.source,flags:e}}return null}),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}},{"../lib/shared":20,"../lib/types":21}],7:[function(e,t,r){t.exports=function(t){t.use(e("./core"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or;n("XMLDefaultDeclaration").bases("Declaration").field("namespace",n("Expression")),n("XMLAnyName").bases("Expression"),n("XMLQualifiedIdentifier").bases("Expression").field("left",i(n("Identifier"),n("XMLAnyName"))).field("right",i(n("Identifier"),n("Expression"))).field("computed",Boolean),n("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",i(n("Identifier"),n("Expression"))).field("computed",Boolean),n("XMLAttributeSelector").bases("Expression").field("attribute",n("Expression")),n("XMLFilterExpression").bases("Expression").field("left",n("Expression")).field("right",n("Expression")),n("XMLElement").bases("XML","Expression").field("contents",[n("XML")]),n("XMLList").bases("XML","Expression").field("contents",[n("XML")]),n("XML").bases("Node"),n("XMLEscape").bases("XML").field("expression",n("Expression")),n("XMLText").bases("XML").field("text",String),n("XMLStartTag").bases("XML").field("contents",[n("XML")]),n("XMLEndTag").bases("XML").field("contents",[n("XML")]),n("XMLPointTag").bases("XML").field("contents",[n("XML")]),n("XMLName").bases("XML").field("contents",i(String,[n("XML")])),n("XMLAttribute").bases("XML").field("value",String),n("XMLCdata").bases("XML").field("contents",String),n("XMLComment").bases("XML").field("contents",String),n("XMLProcessingInstruction").bases("XML").field("target",String).field("contents",i(String,null))}},{"../lib/types":21,"./core":6}],8:[function(e,t,r){t.exports=function(t){t.use(e("./core"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")).defaults;n("Function").field("generator",Boolean,s.false).field("expression",Boolean,s.false).field("defaults",[i(n("Expression"),null)],s.emptyArray).field("rest",i(n("Identifier"),null),s.null),n("RestElement").bases("Pattern").build("argument").field("argument",n("Pattern")),n("SpreadElementPattern").bases("Pattern").build("argument").field("argument",n("Pattern")),n("FunctionDeclaration").build("id","params","body","generator","expression"),n("FunctionExpression").build("id","params","body","generator","expression"),n("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,s.null).field("body",i(n("BlockStatement"),n("Expression"))).field("generator",!1,s.false),n("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(n("Expression"),null)).field("delegate",Boolean,s.false),n("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",n("Expression")).field("blocks",[n("ComprehensionBlock")]).field("filter",i(n("Expression"),null)),n("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",n("Expression")).field("blocks",[n("ComprehensionBlock")]).field("filter",i(n("Expression"),null)),n("ComprehensionBlock").bases("Node").build("left","right","each").field("left",n("Pattern")).field("right",n("Expression")).field("each",Boolean),n("Property").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("value",i(n("Expression"),n("Pattern"))).field("method",Boolean,s.false).field("shorthand",Boolean,s.false).field("computed",Boolean,s.false),n("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("pattern",n("Pattern")).field("computed",Boolean,s.false),n("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(n("PropertyPattern"),n("Property"))]),n("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(n("Pattern"),null)]),n("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("value",n("Function")).field("computed",Boolean,s.false).field("static",Boolean,s.false),n("SpreadElement").bases("Node").build("argument").field("argument",n("Expression")),n("ArrayExpression").field("elements",[i(n("Expression"),n("SpreadElement"),n("RestElement"),null)]),n("NewExpression").field("arguments",[i(n("Expression"),n("SpreadElement"))]),n("CallExpression").field("arguments",[i(n("Expression"),n("SpreadElement"))]),n("AssignmentPattern").bases("Pattern").build("left","right").field("left",n("Pattern")).field("right",n("Expression"));var a=i(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"));n("ClassProperty").bases("Declaration").build("key").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("computed",Boolean,s.false),n("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",a),n("ClassBody").bases("Declaration").build("body").field("body",[a]),n("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(n("Identifier"),null)).field("body",n("ClassBody")).field("superClass",i(n("Expression"),null),s.null),n("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(n("Identifier"),null),s.null).field("body",n("ClassBody")).field("superClass",i(n("Expression"),null),s.null).field("implements",[n("ClassImplements")],s.emptyArray),n("ClassImplements").bases("Node").build("id").field("id",n("Identifier")).field("superClass",i(n("Expression"),null),s.null),n("Specifier").bases("Node"),n("ModuleSpecifier").bases("Specifier").field("local",i(n("Identifier"),null),s.null).field("id",i(n("Identifier"),null),s.null).field("name",i(n("Identifier"),null),s.null),n("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",n("Expression")).field("quasi",n("TemplateLiteral")),n("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[n("TemplateElement")]).field("expressions",[n("Expression")]),n("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean)}},{"../lib/shared":20,"../lib/types":21,"./core":6}],9:[function(e,t,r){t.exports=function(t){t.use(e("./es6"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=(r.builtInTypes,t.use(e("../lib/shared")).defaults);n("Function").field("async",Boolean,s.false),n("SpreadProperty").bases("Node").build("argument").field("argument",n("Expression")),n("ObjectExpression").field("properties",[i(n("Property"),n("SpreadProperty"))]),n("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",n("Pattern")),n("ObjectPattern").field("properties",[i(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"))]),n("AwaitExpression").bases("Expression").build("argument","all").field("argument",i(n("Expression"),null)).field("all",Boolean,s.false)}},{"../lib/shared":20,"../lib/types":21,"./es6":8}],10:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=t.use(e("../lib/shared")).defaults,i=r.Type.def,s=r.Type.or;i("VariableDeclaration").field("declarations",[s(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",s(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[s(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[s(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ImportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("id"),i("ImportDefaultSpecifier").bases("ModuleSpecifier").build("id"),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",s(i("Declaration"),i("Expression"),null)).field("specifiers",[s(i("ExportSpecifier"),i("ExportBatchSpecifier"))],n.emptyArray).field("source",s(i("Literal"),null),n.null),i("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[s(i("ImportSpecifier"),i("ImportNamespaceSpecifier"),i("ImportDefaultSpecifier"))],n.emptyArray).field("source",i("Literal")).field("importKind",s("value","type"),function(){return"value"}),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}},{"../lib/shared":20,"../lib/types":21,"./es7":9}],11:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")).defaults;n("Type").bases("Node"),n("AnyTypeAnnotation").bases("Type").build(),n("EmptyTypeAnnotation").bases("Type").build(),n("MixedTypeAnnotation").bases("Type").build(),n("VoidTypeAnnotation").bases("Type").build(),n("NumberTypeAnnotation").bases("Type").build(),n("NumberLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Number).field("raw",String),n("NumericLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Number).field("raw",String),n("StringTypeAnnotation").bases("Type").build(),n("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",String).field("raw",String),n("BooleanTypeAnnotation").bases("Type").build(),n("BooleanLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Boolean).field("raw",String),n("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n("Type")),n("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",n("Type")),n("NullLiteralTypeAnnotation").bases("Type").build(),n("NullTypeAnnotation").bases("Type").build(),n("ThisTypeAnnotation").bases("Type").build(),n("ExistsTypeAnnotation").bases("Type").build(),n("ExistentialTypeParam").bases("Type").build(),n("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[n("FunctionTypeParam")]).field("returnType",n("Type")).field("rest",i(n("FunctionTypeParam"),null)).field("typeParameters",i(n("TypeParameterDeclaration"),null)),n("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",n("Identifier")).field("typeAnnotation",n("Type")).field("optional",Boolean),n("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",n("Type")),n("ObjectTypeAnnotation").bases("Type").build("properties","indexers","callProperties").field("properties",[n("ObjectTypeProperty")]).field("indexers",[n("ObjectTypeIndexer")],s.emptyArray).field("callProperties",[n("ObjectTypeCallProperty")],s.emptyArray).field("exact",Boolean,s.false),n("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(n("Literal"),n("Identifier"))).field("value",n("Type")).field("optional",Boolean).field("variance",i("plus","minus",null),s.null),n("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",n("Identifier")).field("key",n("Type")).field("value",n("Type")).field("variance",i("plus","minus",null),s.null),n("ObjectTypeCallProperty").bases("Node").build("value").field("value",n("FunctionTypeAnnotation")).field("static",Boolean,s.false),n("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(n("Identifier"),n("QualifiedTypeIdentifier"))).field("id",n("Identifier")),n("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",i(n("Identifier"),n("QualifiedTypeIdentifier"))).field("typeParameters",i(n("TypeParameterInstantiation"),null)),n("MemberTypeAnnotation").bases("Type").build("object","property").field("object",n("Identifier")).field("property",i(n("MemberTypeAnnotation"),n("GenericTypeAnnotation"))),n("UnionTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",n("Type")),n("Identifier").field("typeAnnotation",i(n("TypeAnnotation"),null),s.null),n("TypeParameterDeclaration").bases("Node").build("params").field("params",[n("TypeParameter")]),n("TypeParameterInstantiation").bases("Node").build("params").field("params",[n("Type")]),n("TypeParameter").bases("Type").build("name","variance","bound").field("name",String).field("variance",i("plus","minus",null),s.null).field("bound",i(n("TypeAnnotation"),null),s.null),n("Function").field("returnType",i(n("TypeAnnotation"),null),s.null).field("typeParameters",i(n("TypeParameterDeclaration"),null),s.null),n("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(n("Expression"),null)).field("typeAnnotation",i(n("TypeAnnotation"),null)).field("static",Boolean,s.false).field("variance",i("plus","minus",null),s.null),n("ClassImplements").field("typeParameters",i(n("TypeParameterInstantiation"),null),s.null),n("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",n("Identifier")).field("typeParameters",i(n("TypeParameterDeclaration"),null),s.null).field("body",n("ObjectTypeAnnotation")).field("extends",[n("InterfaceExtends")]),n("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),n("InterfaceExtends").bases("Node").build("id").field("id",n("Identifier")).field("typeParameters",i(n("TypeParameterInstantiation"),null)),n("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",n("Identifier")).field("typeParameters",i(n("TypeParameterDeclaration"),null)).field("right",n("Type")),n("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"), +n("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TypeAnnotation")),n("TupleTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("DeclareVariable").bases("Statement").build("id").field("id",n("Identifier")),n("DeclareFunction").bases("Statement").build("id").field("id",n("Identifier")),n("DeclareClass").bases("InterfaceDeclaration").build("id"),n("DeclareModule").bases("Statement").build("id","body").field("id",i(n("Identifier"),n("Literal"))).field("body",n("BlockStatement")),n("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",n("Type")),n("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(n("DeclareVariable"),n("DeclareFunction"),n("DeclareClass"),n("Type"),null)).field("specifiers",[i(n("ExportSpecifier"),n("ExportBatchSpecifier"))],s.emptyArray).field("source",i(n("Literal"),null),s.null),n("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(n("Literal"),null),s.null)}},{"../lib/shared":20,"../lib/types":21,"./es7":9}],12:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")).defaults;n("JSXAttribute").bases("Node").build("name","value").field("name",i(n("JSXIdentifier"),n("JSXNamespacedName"))).field("value",i(n("Literal"),n("JSXExpressionContainer"),null),s.null),n("JSXIdentifier").bases("Identifier").build("name").field("name",String),n("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",n("JSXIdentifier")).field("name",n("JSXIdentifier")),n("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(n("JSXIdentifier"),n("JSXMemberExpression"))).field("property",n("JSXIdentifier")).field("computed",Boolean,s.false);var a=i(n("JSXIdentifier"),n("JSXNamespacedName"),n("JSXMemberExpression"));n("JSXSpreadAttribute").bases("Node").build("argument").field("argument",n("Expression"));var o=[i(n("JSXAttribute"),n("JSXSpreadAttribute"))];n("JSXExpressionContainer").bases("Expression").build("expression").field("expression",n("Expression")),n("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",n("JSXOpeningElement")).field("closingElement",i(n("JSXClosingElement"),null),s.null).field("children",[i(n("JSXElement"),n("JSXExpressionContainer"),n("JSXText"),n("Literal"))],s.emptyArray).field("name",a,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),n("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",a).field("attributes",o,s.emptyArray).field("selfClosing",Boolean,s.false),n("JSXClosingElement").bases("Node").build("name").field("name",a),n("JSXText").bases("Literal").build("value").field("value",String),n("JSXEmptyExpression").bases("Expression").build()}},{"../lib/shared":20,"../lib/types":21,"./es7":9}],13:[function(e,t,r){t.exports=function(t){t.use(e("./core"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")),a=s.geq,o=s.defaults;n("Function").field("body",i(n("BlockStatement"),n("Expression"))),n("ForInStatement").build("left","right","body","each").field("each",Boolean,o.false),n("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("LetStatement").bases("Statement").build("head","body").field("head",[n("VariableDeclarator")]).field("body",n("Statement")),n("LetExpression").bases("Expression").build("head","body").field("head",[n("VariableDeclarator")]).field("body",n("Expression")),n("GraphExpression").bases("Expression").build("index","expression").field("index",a(0)).field("expression",n("Literal")),n("GraphIndexExpression").bases("Expression").build("index").field("index",a(0))}},{"../lib/shared":20,"../lib/types":21,"./core":6}],14:[function(e,t,r){t.exports=function(t){function r(e){var t=n.indexOf(e);return-1===t&&(t=n.length,n.push(e),i[t]=e(s)),i[t]}var n=[],i=[],s={};s.use=r;var a=r(e("./lib/types"));t.forEach(r),a.finalize();var o={Type:a.Type,builtInTypes:a.builtInTypes,namedTypes:a.namedTypes,builders:a.builders,defineMethod:a.defineMethod,getFieldNames:a.getFieldNames,getFieldValue:a.getFieldValue,eachField:a.eachField,someField:a.someField,getSupertypeNames:a.getSupertypeNames,astNodesAreEquivalent:r(e("./lib/equiv")),finalize:a.finalize,Path:r(e("./lib/path")),NodePath:r(e("./lib/node-path")),PathVisitor:r(e("./lib/path-visitor")),use:r};return o.visit=o.PathVisitor.visit,o}},{"./lib/equiv":15,"./lib/node-path":16,"./lib/path":18,"./lib/path-visitor":17,"./lib/types":21}],15:[function(e,t,r){t.exports=function(t){function r(e,t,r){return c.check(r)?r.length=0:r=null,i(e,t,r)}function n(e){return/[_$a-z][_$a-z0-9]*/i.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function i(e,t,r){return e===t||(c.check(e)?s(e,t,r):p.check(e)?a(e,t,r):h.check(e)?h.check(t)&&+e==+t:f.check(e)?f.check(t)&&e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.ignoreCase===t.ignoreCase:e==t)}function s(e,t,r){c.assert(e);var n=e.length;if(!c.check(t)||t.length!==n)return r&&r.push("length"),!1;for(var s=0;so)return!0;if(t===o&&"right"===this.name){if(n.right!==r)throw new Error("Nodes must be equal");return!0}default:return!1}case"SequenceExpression":switch(n.type){case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==this.name;default:return!0}case"YieldExpression":switch(n.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return"MemberExpression"===n.type&&p.check(r.value)&&"object"===this.name&&n.object===r;case"AssignmentExpression":case"ConditionalExpression":switch(n.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===this.name&&n.callee===r;case"ConditionalExpression":return"test"===this.name&&n.test===r;case"MemberExpression":return"object"===this.name&&n.object===r;default:return!1}default:if("NewExpression"===n.type&&"callee"===this.name&&n.callee===r)return i(r)}return!(!0===e||this.canBeFirstInStatement()||!this.firstInStatement())};var y={};return[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,t){e.forEach(function(e){y[e]=t})}),m.canBeFirstInStatement=function(){var e=this.node;return!l.FunctionExpression.check(e)&&!l.ObjectExpression.check(e)},m.firstInStatement=function(){return s(this)},r}},{"./path":18,"./scope":19,"./types":21}],17:[function(e,t,r){var n=Object.prototype.hasOwnProperty;t.exports=function(t){function r(){if(!(this instanceof r))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=i(this),this._shouldVisitComments=n.call(this._methodNameTable,"Block")||n.call(this._methodNameTable,"Line"),this.Context=o(this),this._visiting=!1,this._changeReported=!1}function i(e){var t=Object.create(null);for(var r in e)/^visit[A-Z]/.test(r)&&(t[r.slice("visit".length)]=!0);for(var n=u.computeSupertypeLookupTable(t),i=Object.create(null),t=Object.keys(n),s=t.length,a=0;a=0&&(s[e.name=a]=e)}else i[e.name]=e.value,s[e.name]=e;if(i[e.name]!==e.value)throw new Error("");if(e.parentPath.get(e.name)!==e)throw new Error("");return e}var l=t.use(e("./types")),c=l.builtInTypes.array,p=l.builtInTypes.number,h=r.prototype;return h.getValueProperty=function(e){return this.value[e]},h.get=function(e){for(var t=this,r=arguments,n=r.length,s=0;s=e},a+" >= "+e)},r.defaults={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){}};var o=i.or(s.string,s.number,s.boolean,s.null,s.undefined);return r.isPrimitive=new i(function(e){if(null===e)return!0;var t=typeof e;return!("object"===t||"function"===t)},o.toString()),r}},{"../lib/types":21}],21:[function(e,t,r){var n=Array.prototype,i=n.slice,s=(n.map,n.forEach,Object.prototype),a=s.toString,o=a.call(function(){}),u=a.call(""),l=s.hasOwnProperty;t.exports=function(){function e(t,r){var n=this;if(!(n instanceof e))throw new Error("Type constructor cannot be invoked without 'new'");if(a.call(t)!==o)throw new Error(t+" is not a function");var i=a.call(r);if(i!==o&&i!==u)throw new Error(r+" is neither a function nor a string");Object.defineProperties(n,{name:{value:r},check:{value:function(e,r){var i=t.call(n,e,r);return!i&&r&&a.call(r)===o&&r(n,e),i}}})}function t(e){return _.check(e)?"{"+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+"}":S.check(e)?"["+e.map(t).join(", ")+"]":JSON.stringify(e)}function r(t,r){var n=a.call(t),i=new e(function(e){return a.call(e)===n},r);return A[r]=i,t&&"function"==typeof t.constructor&&(x.push(t.constructor),E.push(i)),i}function n(t,r){if(t instanceof e)return t;if(t instanceof c)return t.type;if(S.check(t))return e.fromArray(t);if(_.check(t))return e.fromObject(t);if(C.check(t)){var n=x.indexOf(t);return n>=0?E[n]:new e(t,r)}return new e(function(e){return e===t},k.check(r)?function(){return t+""}:r)}function s(e,t,r,i){var a=this;if(!(a instanceof s))throw new Error("Field constructor cannot be invoked without 'new'");D.assert(e),t=n(t);var o={name:{value:e},type:{value:t},hidden:{value:!!i}};C.check(r)&&(o.defaultFn={value:r}),Object.defineProperties(a,o)}function c(t){var r=this;if(!(r instanceof c))throw new Error("Def constructor cannot be invoked without 'new'");Object.defineProperties(r,{typeName:{value:t},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new e(function(e,t){return r.check(e,t)},t)}})}function p(e){return e.replace(/^[A-Z]+/,function(e){var t=e.length;switch(t){case 0:return"";case 1:return e.toLowerCase();default:return e.slice(0,t-1).toLowerCase()+e.charAt(t-1)}})}function h(e){return e=p(e),e.replace(/(Expression)?$/,"Statement")}function f(e){var t=c.fromValue(e);if(t)return t.fieldNames.slice(0);if("type"in e)throw new Error("did not recognize object of type "+JSON.stringify(e.type));return Object.keys(e)}function d(e,t){var r=c.fromValue(e);if(r){var n=r.allFields[t];if(n)return n.getValue(e)}return e&&e[t]}function m(e){var t=h(e);if(!B[t]){var r=B[p(e)];r&&(B[t]=function(){return B.expressionStatement(r.apply(B,arguments))})}}function y(e,t){t.length=0,t.push(e);for(var r=Object.create(null),n=0;n=0&&m(e.typeName)}},b.finalize=function(){Object.keys(T).forEach(function(e){T[e].finalize()})},b}},{}],22:[function(e,t,r){t.exports=e("./fork")([e("./def/core"),e("./def/es6"),e("./def/es7"),e("./def/mozilla"),e("./def/e4x"),e("./def/jsx"),e("./def/flow"),e("./def/esprima"),e("./def/babel"),e("./def/babel6")])},{"./def/babel":4,"./def/babel6":5,"./def/core":6,"./def/e4x":7,"./def/es6":8,"./def/es7":9,"./def/esprima":10,"./def/flow":11,"./def/jsx":12,"./def/mozilla":13,"./fork":14}],23:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return{keyword:e.cyan,capitalized:e.yellow,jsx_tag:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold,gutter:e.grey,marker:e.red.bold}}function s(e){var t=e.slice(-2),r=t[0],n=t[1],i=(0,o.matchToToken)(e);if("name"===i.type){if(c.default.keyword.isReservedWordES6(i.value))return"keyword";if(d.test(i.value)&&("<"===n[r-1]||"3&&void 0!==arguments[3]?arguments[3]:{};r=Math.max(r,0);var s=n.highlightCode&&h.default.supportsColor||n.forceColor,o=h.default;n.forceColor&&(o=new h.default.constructor({enabled:!0}));var u=function(e,t){return s?e(t):t},l=i(o);s&&(e=a(l,e));var c=n.linesAbove||2,p=n.linesBelow||3,d=e.split(f),m=Math.max(t-(c+1),0),y=Math.min(d.length,t+p);t||r||(m=0,y=d.length);var g=String(y).length,b=d.slice(m,y).map(function(e,n){var i=m+1+n,s=(" "+i).slice(-g),a=" "+s+" | ";if(i===t){var o="";if(r){var c=e.slice(0,r-1).replace(/[^\t]/g," ");o=["\n ",u(l.gutter,a.replace(/\d/g," ")),c,u(l.marker,"^")].join("")}return[u(l.marker,">"),u(l.gutter,a),e,o].join("")}return" "+u(l.gutter,a)+e}).join("\n");return s?o.reset(b):b};var o=e("js-tokens"),u=n(o),l=e("esutils"),c=n(l),p=e("chalk"),h=n(p),f=/\r\n|[\n\r\u2028\u2029]/,d=/^[a-z][\w-]*$/i,m=/^[()\[\]{}]$/;t.exports=r.default},{chalk:185,esutils:27,"js-tokens":311}],24:[function(e,t,r){!function(){"use strict";function e(e){if(null==e)return!1;switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function r(e){if(null==e)return!1;switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function n(e){if(null==e)return!1;switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function i(e){return n(e)||null!=e&&"FunctionDeclaration"===e.type}function s(e){switch(e.type){case"IfStatement":return null!=e.alternate?e.alternate:e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function a(e){var t;if("IfStatement"!==e.type)return!1;if(null==e.alternate)return!1;t=e.consequent;do{if("IfStatement"===t.type&&null==t.alternate)return!0;t=s(t)}while(t);return!1}t.exports={isExpression:e,isStatement:n,isIterationStatement:r,isSourceElement:i,isProblematicIfStatement:a,trailingStatement:s}}()},{}],25:[function(e,t,r){!function(){"use strict";function e(e){return 48<=e&&e<=57}function r(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70}function n(e){return e>=48&&e<=55}function i(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&f.indexOf(e)>=0}function s(e){return 10===e||13===e||8232===e||8233===e}function a(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(Math.floor((e-65536)/1024)+55296)+String.fromCharCode((e-65536)%1024+56320)}function o(e){return e<128?d[e]:h.NonAsciiIdentifierStart.test(a(e))}function u(e){return e<128?m[e]:h.NonAsciiIdentifierPart.test(a(e))}function l(e){return e<128?d[e]:p.NonAsciiIdentifierStart.test(a(e))}function c(e){return e<128?m[e]:p.NonAsciiIdentifierPart.test(a(e))}var p,h,f,d,m,y;for(h={NonAsciiIdentifierStart:/[\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-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},p={NonAsciiIdentifierStart:/[\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-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},f=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],d=new Array(128),y=0;y<128;++y)d[y]=y>=97&&y<=122||y>=65&&y<=90||36===y||95===y;for(m=new Array(128),y=0;y<128;++y)m[y]=y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||36===y||95===y;t.exports={isDecimalDigit:e,isHexDigit:r,isOctalDigit:n,isWhiteSpace:i,isLineTerminator:s,isIdentifierStartES5:o,isIdentifierPartES5:u,isIdentifierStartES6:l,isIdentifierPartES6:c}}()},{}],26:[function(e,t,r){!function(){"use strict";function r(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function n(e,t){return!(!t&&"yield"===e)&&i(e,t)}function i(e,t){if(t&&r(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function s(e,t){return"null"===e||"true"===e||"false"===e||n(e,t)}function a(e,t){return"null"===e||"true"===e||"false"===e||i(e,t)}function o(e){return"eval"===e||"arguments"===e}function u(e){var t,r,n;if(0===e.length)return!1;if(n=e.charCodeAt(0),!f.isIdentifierStartES5(n))return!1 +;for(t=1,r=e.length;t=r)return!1;if(!(56320<=(i=e.charCodeAt(t))&&i<=57343))return!1;n=l(n,i)}if(!s(n))return!1;s=f.isIdentifierPartES6}return!0}function p(e,t){return u(e)&&!s(e,t)}function h(e,t){return c(e)&&!a(e,t)}var f=e("./code");t.exports={isKeywordES5:n,isKeywordES6:i,isReservedWordES5:s,isReservedWordES6:a,isRestrictedWord:o,isIdentifierNameES5:u,isIdentifierNameES6:c,isIdentifierES5:p,isIdentifierES6:h}}()},{"./code":25}],27:[function(e,t,r){!function(){"use strict";r.ast=e("./ast"),r.code=e("./code"),r.keyword=e("./keyword")}()},{"./ast":24,"./code":25,"./keyword":26}],28:[function(e,t,r){t.exports=e("./lib/api/node.js")},{"./lib/api/node.js":29}],29:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){throw new Error("The ("+e+") Babel 5 plugin is being run with Babel 6.")}function a(e,t,r){"function"==typeof t&&(r=t,t={}),t.filename=e,y.default.readFile(e,function(e,n){var i=void 0;if(!e)try{i=T(n,t)}catch(t){e=t}e?r(e):r(null,i)})}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.filename=e,T(y.default.readFileSync(e,"utf8"),t)}r.__esModule=!0,r.transformFromAst=r.transform=r.analyse=r.Pipeline=r.OptionManager=r.traverse=r.types=r.messages=r.util=r.version=r.resolvePreset=r.resolvePlugin=r.template=r.buildExternalHelpers=r.options=r.File=void 0;var u=e("../transformation/file");Object.defineProperty(r,"File",{enumerable:!0,get:function(){return i(u).default}});var l=e("../transformation/file/options/config");Object.defineProperty(r,"options",{enumerable:!0,get:function(){return i(l).default}});var c=e("../tools/build-external-helpers");Object.defineProperty(r,"buildExternalHelpers",{enumerable:!0,get:function(){return i(c).default}});var p=e("babel-template");Object.defineProperty(r,"template",{enumerable:!0,get:function(){return i(p).default}});var h=e("../helpers/resolve-plugin");Object.defineProperty(r,"resolvePlugin",{enumerable:!0,get:function(){return i(h).default}});var f=e("../helpers/resolve-preset");Object.defineProperty(r,"resolvePreset",{enumerable:!0,get:function(){return i(f).default}});var d=e("../../package");Object.defineProperty(r,"version",{enumerable:!0,get:function(){return d.version}}),r.Plugin=s,r.transformFile=a,r.transformFileSync=o;var m=e("fs"),y=i(m),g=e("../util"),b=n(g),v=e("babel-messages"),x=n(v),E=e("babel-types"),A=n(E),D=e("babel-traverse"),C=i(D),S=e("../transformation/file/options/option-manager"),_=i(S),w=e("../transformation/pipeline"),k=i(w);r.util=b,r.messages=x,r.types=A,r.traverse=C.default,r.OptionManager=_.default,r.Pipeline=k.default;var F=new k.default,T=(r.analyse=F.analyse.bind(F),r.transform=F.transform.bind(F));r.transformFromAst=F.transformFromAst.bind(F)},{"../../package":66,"../helpers/resolve-plugin":35,"../helpers/resolve-preset":36,"../tools/build-external-helpers":39,"../transformation/file":40,"../transformation/file/options/config":44,"../transformation/file/options/option-manager":46,"../transformation/pipeline":51,"../util":54,"babel-messages":103,"babel-template":132,"babel-traverse":136,"babel-types":169,fs:182}],30:[function(e,t,r){"use strict";function n(e){return["babel-plugin-"+e,e]}r.__esModule=!0,r.default=n,t.exports=r.default},{}],31:[function(e,t,r){"use strict";function n(e){var t=["babel-preset-"+e,e],r=e.match(/^(@[^\/]+)\/(.+)$/);if(r){var n=r[1],i=r[2];t.push(n+"/babel-preset-"+i)}return t}r.__esModule=!0,r.default=n,t.exports=r.default},{}],32:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/core-js/get-iterator"),s=n(i);r.default=function(e,t){if(e&&t)return(0,o.default)(e,t,function(e,t){if(t&&Array.isArray(e)){for(var r=t.slice(0),n=e,i=Array.isArray(n),a=0,n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;r.indexOf(u)<0&&r.push(u)}return r}})};var a=e("lodash/mergeWith"),o=n(a);t.exports=r.default},{"babel-runtime/core-js/get-iterator":113,"lodash/mergeWith":516}],33:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){if(e){if("Program"===e.type)return i.file(e,t||[],r||[]);if("File"===e.type)return e}throw new Error("Not a valid ast?")};var n=e("babel-types"),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);t.exports=r.default},{"babel-types":169}],34:[function(e,t,r){"use strict";function n(e,t){return e.reduce(function(e,r){return e||(0,s.default)(r,t)},null)}r.__esModule=!0,r.default=n;var i=e("./resolve"),s=function(e){return e&&e.__esModule?e:{default:e}}(i);t.exports=r.default},{"./resolve":37}],35:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();return(0,o.default)((0,l.default)(e),t)}r.__esModule=!0,r.default=s;var a=e("./resolve-from-possible-names"),o=i(a),u=e("./get-possible-plugin-names"),l=i(u);t.exports=r.default}).call(this,e("_process"))},{"./get-possible-plugin-names":30,"./resolve-from-possible-names":34,_process:539}],36:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();return(0,o.default)((0,l.default)(e),t)}r.__esModule=!0,r.default=s;var a=e("./resolve-from-possible-names"),o=i(a),u=e("./get-possible-preset-names"),l=i(u);t.exports=r.default}).call(this,e("_process"))},{"./get-possible-preset-names":31,"./resolve-from-possible-names":34,_process:539}],37:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var s=e("babel-runtime/helpers/typeof"),a=i(s);r.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();if("object"===(void 0===u.default?"undefined":(0,a.default)(u.default)))return null;var r=p[t];if(!r){r=new u.default;var i=c.default.join(t,".babelrc");r.id=i,r.filename=i,r.paths=u.default._nodeModulePaths(t),p[t]=r}try{return u.default._resolveFilename(e,r)}catch(e){return null}};var o=e("module"),u=i(o),l=e("path"),c=i(l),p={};t.exports=r.default}).call(this,e("_process"))},{_process:539,"babel-runtime/helpers/typeof":131,module:182,path:535}],38:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/core-js/map"),s=n(i),a=e("babel-runtime/helpers/classCallCheck"),o=n(a),u=e("babel-runtime/helpers/possibleConstructorReturn"),l=n(u),c=e("babel-runtime/helpers/inherits"),p=n(c),h=function(e){function t(){(0,o.default)(this,t);var r=(0,l.default)(this,e.call(this));return r.dynamicData={},r}return(0,p.default)(t,e),t.prototype.setDynamic=function(e,t){this.dynamicData[e]=t},t.prototype.get=function(t){if(this.has(t))return e.prototype.get.call(this,t);if(Object.prototype.hasOwnProperty.call(this.dynamicData,t)){var r=this.dynamicData[t]();return this.set(t,r),r}},t}(s.default);r.default=h,t.exports=r.default},{"babel-runtime/core-js/map":115,"babel-runtime/helpers/classCallCheck":127,"babel-runtime/helpers/inherits":128,"babel-runtime/helpers/possibleConstructorReturn":130}],39:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e,t){var r=[],n=b.functionExpression(null,[b.identifier("global")],b.blockStatement(r)),i=b.program([b.expressionStatement(b.callExpression(n,[c.get("selfGlobal")]))]);return r.push(b.variableDeclaration("var",[b.variableDeclarator(e,b.assignmentExpression("=",b.memberExpression(b.identifier("global"),e),b.objectExpression([])))])),t(r),i}function a(e,t){var r=[];return r.push(b.variableDeclaration("var",[b.variableDeclarator(e,b.identifier("global"))])),t(r),b.program([v({FACTORY_PARAMETERS:b.identifier("global"),BROWSER_ARGUMENTS:b.assignmentExpression("=",b.memberExpression(b.identifier("root"),e),b.objectExpression([])),COMMON_ARGUMENTS:b.identifier("exports"),AMD_ARGUMENTS:b.arrayExpression([b.stringLiteral("exports")]),FACTORY_BODY:r,UMD_ROOT:b.identifier("this")})])}function o(e,t){var r=[];return r.push(b.variableDeclaration("var",[b.variableDeclarator(e,b.objectExpression([]))])),t(r),r.push(b.expressionStatement(e)),b.program(r)}function u(e,t,r){c.list.forEach(function(n){if(!(r&&r.indexOf(n)<0)){var i=b.identifier(n);e.push(b.expressionStatement(b.assignmentExpression("=",b.memberExpression(t,i),c.get(n))))}})}r.__esModule=!0,r.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global",r=b.identifier("babelHelpers"),n=function(t){return u(t,r,e)},i=void 0,l={global:s,umd:a,var:o}[t];if(!l)throw new Error(d.get("unsupportedOutputType",t));return i=l(r,n),(0,h.default)(i).code};var l=e("babel-helpers"),c=i(l),p=e("babel-generator"),h=n(p),f=e("babel-messages"),d=i(f),m=e("babel-template"),y=n(m),g=e("babel-types"),b=i(g),v=(0,y.default)('\n (function (root, factory) {\n if (typeof define === "function" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === "object") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n');t.exports=r.default},{"babel-generator":78,"babel-helpers":102,"babel-messages":103,"babel-template":132,"babel-types":169}],40:[function(e,t,r){(function(t){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.File=void 0;var s=e("babel-runtime/core-js/get-iterator"),a=i(s),o=e("babel-runtime/core-js/object/create"),u=i(o),l=e("babel-runtime/core-js/object/assign"),c=i(l),p=e("babel-runtime/helpers/classCallCheck"),h=i(p),f=e("babel-runtime/helpers/possibleConstructorReturn"),d=i(f),m=e("babel-runtime/helpers/inherits"),y=i(m),g=e("babel-helpers"),b=i(g),v=e("./metadata"),x=n(v),E=e("convert-source-map"),A=i(E),D=e("./options/option-manager"),C=i(D),S=e("../plugin-pass"),_=i(S),w=e("babel-traverse"),k=i(w),F=e("source-map"),T=i(F),P=e("babel-generator"),B=i(P),O=e("babel-code-frame"),j=i(O),N=e("lodash/defaults"),I=i(N),L=e("./logger"),M=i(L),R=e("../../store"),U=i(R),V=e("babylon"),q=e("../../util"),G=n(q),X=e("path"),J=i(X),W=e("babel-types"),K=n(W),z=e("../../helpers/resolve"),Y=i(z),H=e("../internal-plugins/block-hoist"),$=i(H),Q=e("../internal-plugins/shadow-functions"),Z=i(Q),ee=/^#!.*/,te=[[$.default],[Z.default]],re={enter:function(e,t){var r=e.node.loc;r&&(t.loc=r,e.stop())}},ne=function(r){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];(0,h.default)(this,n);var i=(0,d.default)(this,r.call(this));return i.pipeline=t,i.log=new M.default(i,e.filename||"unknown"),i.opts=i.initOptions(e),i.parserOpts={sourceType:i.opts.sourceType,sourceFileName:i.opts.filename,plugins:[]},i.pluginVisitors=[],i.pluginPasses=[],i.buildPluginsForOptions(i.opts),i.opts.passPerPreset&&(i.perPresetOpts=[],i.opts.presets.forEach(function(e){var t=(0,c.default)((0,u.default)(i.opts),e);i.perPresetOpts.push(t),i.buildPluginsForOptions(t)})),i.metadata={usedHelpers:[],marked:[],modules:{imports:[],exports:{exported:[],specifiers:[]}}},i.dynamicImportTypes={},i.dynamicImportIds={},i.dynamicImports=[],i.declarations={},i.usedHelpers={},i.path=null,i.ast={},i.code="",i.shebang="",i.hub=new w.Hub(i),i}return(0,y.default)(n,r),n.prototype.getMetadata=function(){for(var e=!1,t=this.ast.program.body,r=Array.isArray(t),n=0,t=r?t:(0,a.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(K.isModuleDeclaration(s)){e=!0;break}}e&&this.path.traverse(x,this)},n.prototype.initOptions=function(e){e=new C.default(this.log,this.pipeline).init(e),e.inputSourceMap&&(e.sourceMaps=!0),e.moduleId&&(e.moduleIds=!0),e.basename=J.default.basename(e.filename,J.default.extname(e.filename)),e.ignore=G.arrayify(e.ignore,G.regexify),e.only&&(e.only=G.arrayify(e.only,G.regexify)),(0,I.default)(e,{moduleRoot:e.sourceRoot}),(0,I.default)(e,{sourceRoot:e.moduleRoot}),(0,I.default)(e,{filenameRelative:e.filename});var t=J.default.basename(e.filenameRelative);return(0,I.default)(e,{sourceFileName:t,sourceMapTarget:t}),e},n.prototype.buildPluginsForOptions=function(e){if(Array.isArray(e.plugins)){for(var t=e.plugins.concat(te),r=[],n=[],i=t,s=Array.isArray(i),o=0,i=s?i:(0,a.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u,c=l[0],p=l[1];r.push(c.visitor),n.push(new _.default(this,c,p)),c.manipulateOptions&&c.manipulateOptions(e,this.parserOpts,this)}this.pluginVisitors.push(r),this.pluginPasses.push(n)}},n.prototype.getModuleName=function(){var e=this.opts;if(!e.moduleIds)return null;if(null!=e.moduleId&&!e.getModuleId)return e.moduleId;var t=e.filenameRelative,r="";if(null!=e.moduleRoot&&(r=e.moduleRoot+"/"),!e.filenameRelative)return r+e.filename.replace(/^\//,"");if(null!=e.sourceRoot){var n=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(n,"")}return t=t.replace(/\.(\w*?)$/,""),r+=t,r=r.replace(/\\/g,"/"),e.getModuleId?e.getModuleId(r)||r:r},n.prototype.resolveModuleSource=function(e){var t=this.opts.resolveModuleSource;return t&&(e=t(e,this.opts.filename)),e},n.prototype.addImport=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=e+":"+t,i=this.dynamicImportIds[n];if(!i){e=this.resolveModuleSource(e),i=this.dynamicImportIds[n]=this.scope.generateUidIdentifier(r);var s=[];"*"===t?s.push(K.importNamespaceSpecifier(i)):"default"===t?s.push(K.importDefaultSpecifier(i)):s.push(K.importSpecifier(i,K.identifier(t)));var a=K.importDeclaration(s,K.stringLiteral(e));a._blockHoist=3,this.path.unshiftContainer("body",a)}return i},n.prototype.addHelper=function(e){var t=this.declarations[e];if(t)return t;this.usedHelpers[e]||(this.metadata.usedHelpers.push(e),this.usedHelpers[e]=!0);var r=this.get("helperGenerator"),n=this.get("helpersNamespace");if(r){var i=r(e);if(i)return i}else if(n)return K.memberExpression(n,K.identifier(e));var s=(0,b.default)(e),a=this.declarations[e]=this.scope.generateUidIdentifier(e);return K.isFunctionExpression(s)&&!s.id?(s.body._compact=!0,s._generated=!0,s.id=a,s.type="FunctionDeclaration",this.path.unshiftContainer("body",s)):(s._compact=!0,this.scope.push({id:a,init:s,unique:!0})),a},n.prototype.addTemplateObject=function(e,t,r){var n=r.elements.map(function(e){return e.value}),i=e+"_"+r.elements.length+"_"+n.join(","),s=this.declarations[i];if(s)return s;var a=this.declarations[i]=this.scope.generateUidIdentifier("templateObject"),o=this.addHelper(e),u=K.callExpression(o,[t,r]);return u._compact=!0,this.scope.push({id:a,init:u,_blockHoist:1.9}),a},n.prototype.buildCodeFrameError=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SyntaxError,n=e&&(e.loc||e._loc),i=new r(t);return n?i.loc=n.start:((0,k.default)(e,re,this.scope,i),i.message+=" (This is an error on an internal node. Probably an internal error",i.loc&&(i.message+=". Location has been estimated."),i.message+=")"),i},n.prototype.mergeSourceMap=function(e){var t=this.opts.inputSourceMap;if(t){var r=new T.default.SourceMapConsumer(t),n=new T.default.SourceMapConsumer(e),i=new T.default.SourceMapGenerator({file:r.file,sourceRoot:r.sourceRoot}),s=n.sources[0];r.eachMapping(function(e){var t=n.generatedPositionFor({line:e.generatedLine,column:e.generatedColumn,source:s});null!=t.column&&i.addMapping({source:e.source,original:null==e.source?null:{line:e.originalLine,column:e.originalColumn},generated:t})});var a=i.toJSON();return t.mappings=a.mappings,t}return e},n.prototype.parse=function(r){var n=V.parse,i=this.opts.parserOpts;if(i&&(i=(0,c.default)({},this.parserOpts,i),i.parser)){if("string"==typeof i.parser){var s=J.default.dirname(this.opts.filename)||t.cwd(),a=(0,Y.default)(i.parser,s);if(!a)throw new Error("Couldn't find parser "+i.parser+' with "parse" method relative to directory '+s);n=e(a).parse}else n=i.parser;i.parser={parse:function(e){return(0,V.parse)(e,i)}}}this.log.debug("Parse start");var o=n(r,i||this.parserOpts);return this.log.debug("Parse stop"),o},n.prototype._addAst=function(e){this.path=w.NodePath.get({hub:this.hub,parentPath:null,parent:e,container:e,key:"program"}).setContext(),this.scope=this.path.scope,this.ast=e,this.getMetadata()},n.prototype.addAst=function(e){this.log.debug("Start set AST"),this._addAst(e),this.log.debug("End set AST")},n.prototype.transform=function(){for(var e=0;e=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s,u=o.plugin,l=u[e];l&&l.call(o,this)}},n.prototype.parseInputSourceMap=function(e){var t=this.opts;if(!1!==t.inputSourceMap){var r=A.default.fromSource(e);r&&(t.inputSourceMap=r.toObject(),e=A.default.removeComments(e))}return e},n.prototype.parseShebang=function(){var e=ee.exec(this.code);e&&(this.shebang=e[0],this.code=this.code.replace(ee,""))},n.prototype.makeResult=function(e){var t=e.code,r=e.map,n=e.ast,i=e.ignored,s={metadata:null,options:this.opts,ignored:!!i,code:null,ast:null,map:r||null};return this.opts.code&&(s.code=t),this.opts.ast&&(s.ast=n),this.opts.metadata&&(s.metadata=this.metadata),s},n.prototype.generate=function(){var r=this.opts,n=this.ast,i={ast:n};if(!r.code)return this.makeResult(i);var s=B.default;if(r.generatorOpts.generator&&"string"==typeof(s=r.generatorOpts.generator)){var a=J.default.dirname(this.opts.filename)||t.cwd(),o=(0,Y.default)(s,a);if(!o)throw new Error("Couldn't find generator "+s+' with "print" method relative to directory '+a);s=e(o).print}this.log.debug("Generation start");var u=s(n,r.generatorOpts?(0,c.default)(r,r.generatorOpts):r,this.code);return i.code=u.code,i.map=u.map,this.log.debug("Generation end"),this.shebang&&(i.code=this.shebang+"\n"+i.code),i.map&&(i.map=this.mergeSourceMap(i.map)),"inline"!==r.sourceMaps&&"both"!==r.sourceMaps||(i.code+="\n"+A.default.fromObject(i.map).toComment()),"inline"===r.sourceMaps&&(i.map=null),this.makeResult(i)},n}(U.default);r.default=ne,r.File=ne}).call(this,e("_process"))},{"../../helpers/resolve":37,"../../store":38,"../../util":54,"../internal-plugins/block-hoist":49,"../internal-plugins/shadow-functions":50,"../plugin-pass":52,"./logger":41,"./metadata":42,"./options/option-manager":46,_process:539,"babel-code-frame":23,"babel-generator":78,"babel-helpers":102,"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/object/assign":117,"babel-runtime/core-js/object/create":118,"babel-runtime/helpers/classCallCheck":127,"babel-runtime/helpers/inherits":128,"babel-runtime/helpers/possibleConstructorReturn":130,"babel-traverse":136,"babel-types":169,babylon:177,"convert-source-map":187,"lodash/defaults":484,path:535,"source-map":65}],41:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),s=n(i),a=e("debug/node"),o=n(a),u=(0,o.default)("babel:verbose"),l=(0,o.default)("babel"),c=[],p=function(){function e(t,r){(0,s.default)(this,e),this.filename=r,this.file=t}return e.prototype._buildMessage=function(e){var t="[BABEL] "+this.filename;return e&&(t+=": "+e),t},e.prototype.warn=function(e){console.warn(this._buildMessage(e))},e.prototype.error=function(e){throw new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Error)(this._buildMessage(e))},e.prototype.deprecate=function(e){this.file.opts&&this.file.opts.suppressDeprecationMessages||(e=this._buildMessage(e),c.indexOf(e)>=0||(c.push(e),console.error(e)))},e.prototype.verbose=function(e){u.enabled&&u(this._buildMessage(e))},e.prototype.debug=function(e){l.enabled&&l(this._buildMessage(e))},e.prototype.deopt=function(e,t){this.debug(t)},e}();r.default=p,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":127,"debug/node":295}],42:[function(e,t,r){"use strict";function n(e,t){var r=e.node,n=r.source?r.source.value:null,i=t.metadata.modules.exports,s=e.get("declaration");if(s.isStatement()){var o=s.getBindingIdentifiers();for(var l in o)i.exported.push(l),i.specifiers.push({kind:"local",local:l,exported:e.isExportDefaultDeclaration()?"default":l})}if(e.isExportNamedDeclaration()&&r.specifiers)for(var c=r.specifiers,p=Array.isArray(c),h=0,c=p?c:(0,a.default)(c);;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if(h=c.next(),h.done)break;f=h.value}var d=f,m=d.exported.name;i.exported.push(m),u.isExportDefaultSpecifier(d)&&i.specifiers.push({kind:"external",local:m,exported:m,source:n}),u.isExportNamespaceSpecifier(d)&&i.specifiers.push({kind:"external-namespace",exported:m,source:n});var y=d.local;y&&(n&&i.specifiers.push({kind:"external",local:y.name,exported:m,source:n}),n||i.specifiers.push({kind:"local",local:y.name,exported:m}))}e.isExportAllDeclaration()&&i.specifiers.push({kind:"external-all",source:n})}function i(e){e.skip()}r.__esModule=!0,r.ImportDeclaration=r.ModuleDeclaration=void 0;var s=e("babel-runtime/core-js/get-iterator"),a=function(e){return e&&e.__esModule?e:{default:e}}(s);r.ExportDeclaration=n,r.Scope=i;var o=e("babel-types"),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o);r.ModuleDeclaration={enter:function(e,t){var r=e.node;r.source&&(r.source.value=t.resolveModuleSource(r.source.value))}},r.ImportDeclaration={exit:function(e,t){var r=e.node,n=[],i=[];t.metadata.modules.imports.push({source:r.source.value,imported:i,specifiers:n});for(var s=e.get("specifiers"),o=Array.isArray(s),u=0,s=o?s:(0,a.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l,p=c.node.local.name;if(c.isImportDefaultSpecifier()&&(i.push("default"),n.push({kind:"named",imported:"default",local:p})),c.isImportSpecifier()){var h=c.node.imported.name;i.push(h),n.push({kind:"named",imported:h,local:p})}c.isImportNamespaceSpecifier()&&(i.push("*"),n.push({kind:"namespace",local:p}))}}}},{"babel-runtime/core-js/get-iterator":113,"babel-types":169}],43:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=E[e];return null==t?E[e]=x.default.existsSync(e):t}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],r=e.filename,n=new D(t);return!1!==e.babelrc&&n.findConfigs(r),n.mergeConfig({options:e,alias:"base",dirname:r&&b.default.dirname(r)}),n.configs}r.__esModule=!0;var o=e("babel-runtime/core-js/object/assign"),u=i(o),l=e("babel-runtime/helpers/classCallCheck"),c=i(l);r.default=a;var p=e("../../../helpers/resolve"),h=i(p),f=e("json5"),d=i(f),m=e("path-is-absolute"),y=i(m),g=e("path"),b=i(g),v=e("fs"),x=i(v),E={},A={},D=function(){function e(t){(0,c.default)(this,e),this.resolvedConfigs=[],this.configs=[],this.log=t}return e.prototype.findConfigs=function(e){if(e){(0,y.default)(e)||(e=b.default.join(n.cwd(),e));for(var t=!1,r=!1;e!==(e=b.default.dirname(e));){if(!t){var i=b.default.join(e,".babelrc");s(i)&&(this.addConfig(i),t=!0);var a=b.default.join(e,"package.json");!t&&s(a)&&(t=this.addConfig(a,"babel",JSON))}if(!r){var o=b.default.join(e,".babelignore");s(o)&&(this.addIgnoreConfig(o),r=!0)}if(r&&t)return}}},e.prototype.addIgnoreConfig=function(e){var t=x.default.readFileSync(e,"utf8"),r=t.split("\n");r=r.map(function(e){return e.replace(/#(.*?)$/,"").trim()}).filter(function(e){return!!e}),r.length&&this.mergeConfig({options:{ignore:r},alias:e,dirname:b.default.dirname(e)})},e.prototype.addConfig=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d.default;if(this.resolvedConfigs.indexOf(e)>=0)return!1;this.resolvedConfigs.push(e);var n=x.default.readFileSync(e,"utf8"),i=void 0;try{i=A[n]=A[n]||r.parse(n),t&&(i=i[t])}catch(t){throw t.message=e+": Error while parsing JSON - "+t.message,t}return this.mergeConfig({options:i,alias:e,dirname:b.default.dirname(e)}),!!i},e.prototype.mergeConfig=function(e){var t=e.options,r=e.alias,i=e.loc,s=e.dirname;if(!t)return!1;if(t=(0,u.default)({},t),s=s||n.cwd(),i=i||r,t.extends){var a=(0,h.default)(t.extends,s);a?this.addConfig(a):this.log&&this.log.error("Couldn't resolve extends clause of "+t.extends+" in "+r),delete t.extends}this.configs.push({options:t,alias:r,loc:i,dirname:s});var o=void 0,l=n.env.BABEL_ENV||n.env.NODE_ENV||"development";t.env&&(o=t.env[l],delete t.env),this.mergeConfig({options:o,alias:r+".env."+l,dirname:s})},e}();t.exports=r.default}).call(this,e("_process"))},{"../../../helpers/resolve":37,_process:539,"babel-runtime/core-js/object/assign":117,"babel-runtime/helpers/classCallCheck":127,fs:182,json5:313,path:535,"path-is-absolute":536}],44:[function(e,t,r){"use strict";t.exports={filename:{type:"filename",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc",default:"unknown",shorthand:"f"},filenameRelative:{hidden:!0,type:"string"},inputSourceMap:{hidden:!0},env:{hidden:!0,default:{}},mode:{description:"",hidden:!0},retainLines:{type:"boolean",default:!1,description:"retain line numbers - will result in really ugly code"},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean",default:!0},suppressDeprecationMessages:{type:"boolean",default:!1,hidden:!0},presets:{type:"list",description:"",default:[]},plugins:{type:"list",default:[],description:""},ignore:{type:"list",description:"list of glob paths to **not** compile",default:[]},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:!0,default:!0,type:"boolean"},metadata:{hidden:!0,default:!0,type:"boolean"},ast:{hidden:!0,default:!0,type:"boolean"},extends:{type:"string",hidden:!0},comments:{type:"boolean",default:!0,description:"write comments to generated output (true by default)"},shouldPrintComment:{hidden:!0,description:"optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"},wrapPluginVisitorMethod:{hidden:!0,description:"optional callback to wrap all visitor methods"},compact:{type:"booleanString",default:"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},minified:{type:"boolean",default:!1,description:"save as much bytes when printing [true|false]"},sourceMap:{alias:"sourceMaps",hidden:!0},sourceMaps:{type:"booleanString",description:"[true|false|inline]",default:!1,shorthand:"s"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"filename",description:"the root from which all sources are relative"},babelrc:{description:"Whether or not to look up .babelrc and .babelignore files",type:"boolean",default:!0},sourceType:{description:"",default:"module"},auxiliaryCommentBefore:{type:"string",description:"print a comment before any injected non-user code"},auxiliaryCommentAfter:{type:"string",description:"print a comment after any injected non-user code"},resolveModuleSource:{hidden:!0},getModuleId:{hidden:!0},moduleRoot:{type:"filename",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},moduleIds:{type:"boolean",default:!1,shorthand:"M",description:"insert an explicit id for modules"},moduleId:{description:"specify a custom name for module ids",type:"string"},passPerPreset:{description:"Whether to spawn a traversal pass per a preset. By default all presets are merged.",type:"boolean",default:!1,hidden:!0},parserOpts:{description:"Options to pass into the parser, or to change parsers (parserOpts.parser)",default:!1},generatorOpts:{description:"Options to pass into the generator, or to change generators (generatorOpts.generator)",default:!1}}},{}],45:[function(e,t,r){"use strict";function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var r=e[t];if(null!=r){var n=o.default[t];if(n&&n.alias&&(n=o.default[n.alias]),n){var i=s[n.type];i&&(r=i(r)),e[t]=r}}}return e}r.__esModule=!0,r.config=void 0,r.normaliseOptions=n;var i=e("./parsers"),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(i),a=e("./config"),o=function(e){return e&&e.__esModule?e:{default:e}}(a);r.config=o.default},{"./config":44,"./parsers":47}],46:[function(e,t,r){(function(n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var a=e("babel-runtime/helpers/objectWithoutProperties"),o=s(a),u=e("babel-runtime/core-js/json/stringify"),l=s(u),c=e("babel-runtime/core-js/object/assign"),p=s(c),h=e("babel-runtime/core-js/get-iterator"),f=s(h),d=e("babel-runtime/helpers/typeof"),m=s(d),y=e("babel-runtime/helpers/classCallCheck"),g=s(y),b=e("../../../api/node"),v=i(b),x=e("../../plugin"),E=s(x),A=e("babel-messages"),D=i(A),C=e("./index"),S=e("../../../helpers/resolve-plugin"),_=s(S),w=e("../../../helpers/resolve-preset"),k=s(w),F=e("lodash/cloneDeepWith"),T=s(F),P=e("lodash/clone"),B=s(P),O=e("../../../helpers/merge"),j=s(O),N=e("./config"),I=s(N),L=e("./removed"),M=s(L),R=e("./build-config-chain"),U=s(R),V=e("path"),q=s(V),G=function(){function t(e){(0,g.default)(this,t),this.resolvedConfigs=[],this.options=t.createBareOptions(),this.log=e}return t.memoisePluginContainer=function(e,r,n,i){for(var s=t.memoisedPlugins,a=Array.isArray(s),o=0,s=a?s:(0,f.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;if(l.container===e)return l.plugin}var c=void 0;if(c="function"==typeof e?e(v):e,"object"===(void 0===c?"undefined":(0,m.default)(c))){var p=new E.default(c,i);return t.memoisedPlugins.push({container:e,plugin:p}),p}throw new TypeError(D.get("pluginNotObject",r,n,void 0===c?"undefined":(0,m.default)(c))+r+n)},t.createBareOptions=function(){var e={};for(var t in I.default){ +var r=I.default[t];e[t]=(0,B.default)(r.default)}return e},t.normalisePlugin=function(e,r,n,i){if(!((e=e.__esModule?e.default:e)instanceof E.default)){if("function"!=typeof e&&"object"!==(void 0===e?"undefined":(0,m.default)(e)))throw new TypeError(D.get("pluginNotFunction",r,n,void 0===e?"undefined":(0,m.default)(e)));e=t.memoisePluginContainer(e,r,n,i)}return e.init(r,n),e},t.normalisePlugins=function(r,n,i){return i.map(function(i,s){var a=void 0,o=void 0;if(!i)throw new TypeError("Falsy value found in plugins");Array.isArray(i)?(a=i[0],o=i[1]):a=i;var u="string"==typeof a?a:r+"$"+s;if("string"==typeof a){var l=(0,_.default)(a,n);if(!l)throw new ReferenceError(D.get("pluginUnknown",a,r,s,n));a=e(l)}return a=t.normalisePlugin(a,r,s,u),[a,o]})},t.prototype.mergeOptions=function(e){var r=this,i=e.options,s=e.extending,a=e.alias,o=e.loc,u=e.dirname;if(a=a||"foreign",i){("object"!==(void 0===i?"undefined":(0,m.default)(i))||Array.isArray(i))&&this.log.error("Invalid options type for "+a,TypeError);var l=(0,T.default)(i,function(e){if(e instanceof E.default)return e});u=u||n.cwd(),o=o||a;for(var c in l){if(!I.default[c]&&this.log)if(M.default[c])this.log.error("Using removed Babel 5 option: "+a+"."+c+" - "+M.default[c].message,ReferenceError);else{var h="Unknown option: "+a+"."+c+". Check out http://babeljs.io/docs/usage/options/ for more information about options.";this.log.error(h+"\n\nA common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.",ReferenceError)}}(0,C.normaliseOptions)(l),l.plugins&&(l.plugins=t.normalisePlugins(o,u,l.plugins)),l.presets&&(l.passPerPreset?l.presets=this.resolvePresets(l.presets,u,function(e,t){r.mergeOptions({options:e,extending:e,alias:t,loc:t,dirname:u})}):(this.mergePresets(l.presets,u),delete l.presets)),i===s?(0,p.default)(s,l):(0,j.default)(s||this.options,l)}},t.prototype.mergePresets=function(e,t){var r=this;this.resolvePresets(e,t,function(e,t){r.mergeOptions({options:e,alias:t,loc:t,dirname:q.default.dirname(t||"")})})},t.prototype.resolvePresets=function(t,r,n){return t.map(function(t){var i=void 0;if(Array.isArray(t)){if(t.length>2)throw new Error("Unexpected extra options "+(0,l.default)(t.slice(2))+" passed to preset.");var s=t;t=s[0],i=s[1]}var a=void 0;try{if("string"==typeof t){if(!(a=(0,k.default)(t,r)))throw new Error("Couldn't find preset "+(0,l.default)(t)+" relative to directory "+(0,l.default)(r));t=e(a)}if("object"===(void 0===t?"undefined":(0,m.default)(t))&&t.__esModule)if(t.default)t=t.default;else{var u=t,c=(u.__esModule,(0,o.default)(u,["__esModule"]));t=c}if("object"===(void 0===t?"undefined":(0,m.default)(t))&&t.buildPreset&&(t=t.buildPreset),"function"!=typeof t&&void 0!==i)throw new Error("Options "+(0,l.default)(i)+" passed to "+(a||"a preset")+" which does not accept options.");if("function"==typeof t&&(t=t(v,i,{dirname:r})),"object"!==(void 0===t?"undefined":(0,m.default)(t)))throw new Error("Unsupported preset format: "+t+".");n&&n(t,a)}catch(e){throw a&&(e.message+=" (While processing preset: "+(0,l.default)(a)+")"),e}return t})},t.prototype.normaliseOptions=function(){var e=this.options;for(var t in I.default){var r=I.default[t],n=e[t];!n&&r.optional||(r.alias?e[r.alias]=e[r.alias]||n:e[t]=n)}},t.prototype.init=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,U.default)(e,this.log),r=Array.isArray(t),n=0,t=r?t:(0,f.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;this.mergeOptions(s)}return this.normaliseOptions(e),this.options},t}();r.default=G,G.memoisedPlugins=[],t.exports=r.default}).call(this,e("_process"))},{"../../../api/node":29,"../../../helpers/merge":32,"../../../helpers/resolve-plugin":35,"../../../helpers/resolve-preset":36,"../../plugin":53,"./build-config-chain":43,"./config":44,"./index":45,"./removed":48,_process:539,"babel-messages":103,"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/json/stringify":114,"babel-runtime/core-js/object/assign":117,"babel-runtime/helpers/classCallCheck":127,"babel-runtime/helpers/objectWithoutProperties":129,"babel-runtime/helpers/typeof":131,"lodash/clone":480,"lodash/cloneDeepWith":482,path:535}],47:[function(e,t,r){"use strict";function n(e){return!!e}function i(e){return l.booleanify(e)}function s(e){return l.list(e)}r.__esModule=!0,r.filename=void 0,r.boolean=n,r.booleanString=i,r.list=s;var a=e("slash"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),u=e("../../../util"),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);r.filename=o.default},{"../../../util":54,slash:589}],48:[function(e,t,r){"use strict";t.exports={auxiliaryComment:{message:"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"},blacklist:{message:"Put the specific transforms you want in the `plugins` option"},breakConfig:{message:"This is not a necessary option in Babel 6"},experimental:{message:"Put the specific transforms you want in the `plugins` option"},externalHelpers:{message:"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"},extra:{message:""},jsxPragma:{message:"use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"},loose:{message:"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."},metadataUsedHelpers:{message:"Not required anymore as this is enabled by default"},modules:{message:"Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"},nonStandard:{message:"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"},optional:{message:"Put the specific transforms you want in the `plugins` option"},sourceMapName:{message:"Use the `sourceMapTarget` option"},stage:{message:"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"},whitelist:{message:"Put the specific transforms you want in the `plugins` option"}}},{}],49:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("../plugin"),s=n(i),a=e("lodash/sortBy"),o=n(a);r.default=new s.default({name:"internal.blockHoist",visitor:{Block:{exit:function(e){for(var t=e.node,r=!1,n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return t.code=!1,t.mode="lint",this.transform(e,t)},e.prototype.pretransform=function(e,t){var r=new p.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r})},e.prototype.transform=function(e,t){var r=new p.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r.transform()})},e.prototype.analyse=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];return t.code=!1,r&&(t.plugins=t.plugins||[],t.plugins.push(new l.default({visitor:r}))),this.transform(e,t).metadata},e.prototype.transformFromAst=function(e,t,r){e=(0,o.default)(e);var n=new p.default(r,this);return n.wrap(t,function(){return n.addCode(t),n.addAst(e),n.transform()})},e}();r.default=h,t.exports=r.default},{"../helpers/normalize-ast":33,"./file":40,"./plugin":53,"babel-runtime/helpers/classCallCheck":127}],52:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),s=n(i),a=e("babel-runtime/helpers/possibleConstructorReturn"),o=n(a),u=e("babel-runtime/helpers/inherits"),l=n(u),c=e("../store"),p=n(c),h=e("./file"),f=(n(h),function(e){function t(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,s.default)(this,t);var a=(0,o.default)(this,e.call(this));return a.plugin=n,a.key=n.key,a.file=r,a.opts=i,a}return(0,l.default)(t,e),t.prototype.addHelper=function(){var e;return(e=this.file).addHelper.apply(e,arguments)},t.prototype.addImport=function(){var e;return(e=this.file).addImport.apply(e,arguments)},t.prototype.getModuleName=function(){var e;return(e=this.file).getModuleName.apply(e,arguments)},t.prototype.buildCodeFrameError=function(){var e;return(e=this.file).buildCodeFrameError.apply(e,arguments)},t}(p.default));r.default=f,t.exports=r.default},{"../store":38,"./file":40,"babel-runtime/helpers/classCallCheck":127,"babel-runtime/helpers/inherits":128,"babel-runtime/helpers/possibleConstructorReturn":130}],53:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/core-js/get-iterator"),s=n(i),a=e("babel-runtime/helpers/classCallCheck"),o=n(a),u=e("babel-runtime/helpers/possibleConstructorReturn"),l=n(u),c=e("babel-runtime/helpers/inherits"),p=n(c),h=e("./file/options/option-manager"),f=n(h),d=e("babel-messages"),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(d),y=e("../store"),g=n(y),b=e("babel-traverse"),v=n(b),x=e("lodash/assign"),E=n(x),A=e("lodash/clone"),D=n(A),C=["enter","exit"],S=function(e){function t(r,n){(0,o.default)(this,t);var i=(0,l.default)(this,e.call(this));return i.initialized=!1,i.raw=(0,E.default)({},r),i.key=i.take("name")||n,i.manipulateOptions=i.take("manipulateOptions"),i.post=i.take("post"),i.pre=i.take("pre"),i.visitor=i.normaliseVisitor((0,D.default)(i.take("visitor"))||{}),i}return(0,p.default)(t,e),t.prototype.take=function(e){var t=this.raw[e];return delete this.raw[e],t},t.prototype.chain=function(e,t){if(!e[t])return this[t];if(!this[t])return e[t];var r=[e[t],this[t]];return function(){for(var e=void 0,t=arguments.length,n=Array(t),i=0;i=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(c){var p=c.apply(this,n);null!=p&&(e=p)}}return e}},t.prototype.maybeInherit=function(e){var t=this.take("inherits");t&&(t=f.default.normalisePlugin(t,e,"inherits"),this.manipulateOptions=this.chain(t,"manipulateOptions"),this.post=this.chain(t,"post"),this.pre=this.chain(t,"pre"),this.visitor=v.default.visitors.merge([t.visitor,this.visitor]))},t.prototype.init=function(e,t){if(!this.initialized){this.initialized=!0,this.maybeInherit(e);for(var r in this.raw)throw new Error(m.get("pluginInvalidProperty",e,t,r))}},t.prototype.normaliseVisitor=function(e){for(var t=C,r=Array.isArray(t),n=0,t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}if(e[i])throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. Please target individual nodes.")}return v.default.explode(e),e},t}(g.default);r.default=S,t.exports=r.default},{"../store":38,"./file/options/option-manager":46,"babel-messages":103,"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/classCallCheck":127,"babel-runtime/helpers/inherits":128,"babel-runtime/helpers/possibleConstructorReturn":130,"babel-traverse":136,"lodash/assign":477,"lodash/clone":480}],54:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=t||i.EXTENSIONS,n=S.default.extname(e);return(0,E.default)(r,n)}function s(e){return e?Array.isArray(e)?e:"string"==typeof e?e.split(","):[e]:[]}function a(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=new RegExp(e.map(m.default).join("|"),"i")),"string"==typeof e){e=(0,w.default)(e),((0,g.default)(e,"./")||(0,g.default)(e,"*/"))&&(e=e.slice(2)),(0,g.default)(e,"**/")&&(e=e.slice(3));var t=v.default.makeRe(e,{nocase:!0});return new RegExp(t.source.slice(1,-1),"i")}if((0,D.default)(e))return e;throw new TypeError("illegal type for regexify")}function o(e,t){return e?"boolean"==typeof e?o([e],t):"string"==typeof e?o(s(e),t):Array.isArray(e)?(t&&(e=e.map(t)),e):[e]:[]}function u(e){return"true"===e||1==e||!("false"===e||0==e||!e)&&e}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];if(e=e.replace(/\\/g,"/"),r){for(var n=r,i=Array.isArray(n),s=0,n=i?n:(0,h.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}if(c(a,e))return!1}return!0}if(t.length)for(var o=t,u=Array.isArray(o),l=0,o=u?o:(0,h.default)(o);;){var p;if(u){if(l>=o.length)break;p=o[l++]}else{if(l=o.next(),l.done)break;p=l.value}var f=p;if(c(f,e))return!0}return!1}function c(e,t){return"function"==typeof e?e(t):e.test(t)}r.__esModule=!0,r.inspect=r.inherits=void 0;var p=e("babel-runtime/core-js/get-iterator"),h=n(p),f=e("util");Object.defineProperty(r,"inherits",{enumerable:!0,get:function(){return f.inherits}}),Object.defineProperty(r,"inspect",{enumerable:!0,get:function(){return f.inspect}}),r.canCompile=i,r.list=s,r.regexify=a,r.arrayify=o,r.booleanify=u,r.shouldIgnore=l;var d=e("lodash/escapeRegExp"),m=n(d),y=e("lodash/startsWith"),g=n(y),b=e("minimatch"),v=n(b),x=e("lodash/includes"),E=n(x),A=e("lodash/isRegExp"),D=n(A),C=e("path"),S=n(C),_=e("slash"),w=n(_);i.EXTENSIONS=[".js",".jsx",".es6",".es"]},{"babel-runtime/core-js/get-iterator":113,"lodash/escapeRegExp":486,"lodash/includes":496,"lodash/isRegExp":508,"lodash/startsWith":521,minimatch:531,path:535,slash:589,util:601}],55:[function(e,t,r){function n(){this._array=[],this._set=Object.create(null)}var i=e("./util"),s=Object.prototype.hasOwnProperty;n.fromArray=function(e,t){for(var r=new n,i=0,s=e.length;i=0&&e>1;return t?-r:r}var s=e("./base64");r.encode=function(e){var t,r="",i=n(e);do{t=31&i,i>>>=5,i>0&&(t|=32),r+=s.encode(t)}while(i>0);return r},r.decode=function(e,t,r){var n,a,o=e.length,u=0,l=0;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(a=s.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(32&a),a&=31,u+=a<0?t-u>1?n(u,t,i,s,a,o):o==r.LEAST_UPPER_BOUND?t1?n(e,u,i,s,a,o):o==r.LEAST_UPPER_BOUND?u:e<0?-1:e}r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.search=function(e,t,i,s){if(0===t.length)return-1;var a=n(-1,t.length,e,t,i,s||r.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(t[a],t[a-1],!0);)--a;return a}},{}],59:[function(e,t,r){function n(e,t){var r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,a=t.generatedColumn;return n>r||n==r&&a>=i||s.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var s=e("./util");i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},r.MappingList=i},{"./util":64}],60:[function(e,t,r){function n(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function i(e,t){return Math.round(e+Math.random()*(t-e))}function s(e,t,r,a){if(r=0){var s=this._originalMappings[i];if(void 0===e.column)for(var a=s.originalLine;s&&s.originalLine===a;)n.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)n.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return n},r.SourceMapConsumer=n,i.prototype=Object.create(n.prototype),i.prototype.consumer=n,i.fromSourceMap=function(e){var t=Object.create(i.prototype),r=t._names=l.fromArray(e._names.toArray(),!0),n=t._sources=l.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],c=t.__originalMappings=[],h=0,f=a.length;h1&&(r.source=m+i[1],m+=i[1],r.originalLine=f+i[2],f=r.originalLine,r.originalLine+=1,r.originalColumn=d+i[3],d=r.originalColumn,i.length>4&&(r.name=y+i[4],y+=i[4])),A.push(r),"number"==typeof r.originalLine&&E.push(r)}p(A,o.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,p(E,o.compareByOriginalPositions),this.__originalMappings=E},i.prototype._findMapping=function(e,t,r,n,i,s){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return u.search(e,t,i,s)},i.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var s=o.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=o.join(this.sourceRoot,s)));var a=o.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:s,line:o.getArg(i,"originalLine",null),column:o.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=o.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=o.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(n))return this.sourcesContent[this._sources.indexOf(n)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=o.getArg(e,"source");if(null!=this.sourceRoot&&(t=o.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var r={source:t,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===r.source)return{line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},r.BasicSourceMapConsumer=i,a.prototype=Object.create(n.prototype),a.prototype.constructor=n,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},n.prototype._serializeMappings=function(){for(var e,t,r,n,a=0,o=1,u=0,l=0,c=0,p=0,h="",f=this._mappings.toArray(),d=0,m=f.length;d0){if(!s.compareByGeneratedPositionsInflated(t,f[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=i.encode(n-p),p=n,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=i.encode(r-c),c=r)),h+=e}return h},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=s.relative(t,e));var r=s.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},r.SourceMapGenerator=n},{"./array-set":55,"./base64-vlq":56,"./mapping-list":59,"./util":64}],63:[function(e,t,r){function n(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[a]=!0,null!=n&&this.add(n)}var i=e("./source-map-generator").SourceMapGenerator,s=e("./util"),a="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function i(e,t){if(null===e||void 0===e.source)a.add(t);else{var i=r?s.join(r,e.source):e.source;a.add(new n(e.originalLine,e.originalColumn,i,t,e.name))}}var a=new n,o=e.split(/(\r?\n)/),u=function(){return o.shift()+(o.shift()||"")},l=1,c=0,p=null;return t.eachMapping(function(e){if(null!==p){if(!(l0&&(p&&i(p,u()),a.add(o.join(""))),t.sources.forEach(function(e){var n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=s.join(r,e)),a.setSourceContent(e,n))}),a},n.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},n.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r0){for(t=[],r=0;r=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return t=u.join("/"),""===t&&(t=o?"/":"."),n?(n.path=t,s(n)):t}function o(e,t){""===e&&(e="."),""===t&&(t=".");var r=i(t),n=i(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),s(r);if(r||t.match(b))return t;if(n&&!n.host&&!n.path)return n.host=t,s(n);var o="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,s(n)):o}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}function l(e){return e}function c(e){return h(e)?"$"+e:e}function p(e){return h(e)?e.slice(1):e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function f(e,t,r){var n=e.source-t.source;return 0!==n?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)||r?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:(n=e.generatedLine-t.generatedLine,0!==n?n:e.name-t.name)}function d(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)||r?n:0!==(n=e.source-t.source)?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:e.name-t.name)}function m(e,t){return e===t?0:e>t?1:-1}function y(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=m(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:m(e.name,t.name))}r.getArg=n;var g=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,b=/^data:.+\,.+$/;r.urlParse=i,r.urlGenerate=s,r.normalize=a,r.join=o,r.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(g)},r.relative=u;var v=function(){return!("__proto__"in Object.create(null))}();r.toSetString=v?l:c,r.fromSetString=v?l:p,r.compareByOriginalPositions=f,r.compareByGeneratedPositionsDeflated=d,r.compareByGeneratedPositionsInflated=y},{}],65:[function(e,t,r){r.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,r.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,r.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":61,"./lib/source-map-generator":62,"./lib/source-node":63}],66:[function(e,t,r){t.exports={_args:[[{raw:"babel-core@^6.18.2",scope:null,escapedName:"babel-core",name:"babel-core",rawSpec:"^6.18.2",spec:">=6.18.2 <7.0.0",type:"range"},"/Users/evgenypoberezkin/JSON/ajv-v4/node_modules/regenerator"]],_from:"babel-core@>=6.18.2 <7.0.0",_id:"babel-core@6.24.0",_inCache:!0,_location:"/babel-core",_nodeVersion:"6.9.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/babel-core-6.24.0.tgz_1489371490272_0.8722315817140043"},_npmUser:{name:"hzoo",email:"hi@henryzoo.com"},_npmVersion:"3.10.10",_phantomChildren:{},_requested:{raw:"babel-core@^6.18.2",scope:null,escapedName:"babel-core",name:"babel-core",rawSpec:"^6.18.2",spec:">=6.18.2 <7.0.0",type:"range"},_requiredBy:["/babel-register","/regenerator"],_resolved:"https://registry.npmjs.org/babel-core/-/babel-core-6.24.0.tgz",_shasum:"8f36a0a77f5c155aed6f920b844d23ba56742a02",_shrinkwrap:null,_spec:"babel-core@^6.18.2",_where:"/Users/evgenypoberezkin/JSON/ajv-v4/node_modules/regenerator",author:{name:"Sebastian McKenzie",email:"sebmck@gmail.com"},dependencies:{"babel-code-frame":"^6.22.0","babel-generator":"^6.24.0","babel-helpers":"^6.23.0","babel-messages":"^6.23.0","babel-register":"^6.24.0","babel-runtime":"^6.22.0","babel-template":"^6.23.0","babel-traverse":"^6.23.1","babel-types":"^6.23.0",babylon:"^6.11.0","convert-source-map":"^1.1.0",debug:"^2.1.1",json5:"^0.5.0",lodash:"^4.2.0",minimatch:"^3.0.2","path-is-absolute":"^1.0.0",private:"^0.1.6",slash:"^1.0.0","source-map":"^0.5.0"},description:"Babel compiler core.",devDependencies:{"babel-helper-fixtures":"^6.22.0","babel-helper-transform-fixture-test-runner":"^6.24.0","babel-polyfill":"^6.23.0"},directories:{},dist:{shasum:"8f36a0a77f5c155aed6f920b844d23ba56742a02",tarball:"https://registry.npmjs.org/babel-core/-/babel-core-6.24.0.tgz"},homepage:"https://babeljs.io/",keywords:["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],license:"MIT",maintainers:[{name:"amasad",email:"amjad.masad@gmail.com"},{name:"hzoo",email:"hi@henryzoo.com"},{name:"jmm",email:"npm-public@jessemccarthy.net"},{name:"loganfsmyth",email:"loganfsmyth@gmail.com"},{name:"sebmck",email:"sebmck@gmail.com"},{name:"thejameskyle",email:"me@thejameskyle.com"}],name:"babel-core",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"https://github.com/babel/babel/tree/master/packages/babel-core"},scripts:{bench:"make bench",test:"make test"},version:"6.24.0"}},{}],67:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),s=n(i),a=e("trim-right"),o=n(a),u=/^[ \t]+$/,l=function(){function e(t){(0,s.default)(this,e),this._map=null,this._buf=[],this._last="",this._queue=[],this._position={line:1,column:0},this._sourcePosition={identifierName:null,line:null,column:null,filename:null},this._map=t}return e.prototype.get=function(){this._flush();var e=this._map,t={code:(0,o.default)(this._buf.join("")),map:null,rawMappings:e&&e.getRawMappings()};return e&&Object.defineProperty(t,"map",{configurable:!0,enumerable:!0,get:function(){return this.map=e.get()},set:function(e){Object.defineProperty(this,"map",{value:e,writable:!0})}}),t},e.prototype.append=function(e){this._flush();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,s=t.identifierName;this._append(e,r,n,s,i)},e.prototype.queue=function(e){if("\n"===e)for(;this._queue.length>0&&u.test(this._queue[0][0]);)this._queue.shift();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,s=t.identifierName;this._queue.unshift([e,r,n,s,i])},e.prototype._flush=function(){for(var e=void 0;e=this._queue.pop();)this._append.apply(this,e)},e.prototype._append=function(e,t,r,n,i){this._map&&"\n"!==e[0]&&this._map.mark(this._position.line,this._position.column,t,r,n,i),this._buf.push(e),this._last=e[e.length-1];for(var s=0;s0&&"\n"===this._queue[0][0]&&this._queue.shift()},e.prototype.removeLastSemicolon=function(){this._queue.length>0&&";"===this._queue[0][0]&&this._queue.shift()},e.prototype.endsWith=function(e){if(1===e.length){var t=void 0;if(this._queue.length>0){var r=this._queue[0][0];t=r[r.length-1]}else t=this._last;return t===e}var n=this._last+this._queue.reduce(function(e,t){return t[0]+e},"");return e.length<=n.length&&n.slice(-e.length)===e},e.prototype.hasContent=function(){return this._queue.length>0||!!this._last},e.prototype.source=function(e,t){if(!e||t){var r=t?t[e]:null;this._sourcePosition.identifierName=t&&t.identifierName||null,this._sourcePosition.line=r?r.line:null,this._sourcePosition.column=r?r.column:null,this._sourcePosition.filename=t&&t.filename||null}},e.prototype.withSource=function(e,t,r){if(!this._map)return r();var n=this._sourcePosition.line,i=this._sourcePosition.column,s=this._sourcePosition.filename,a=this._sourcePosition.identifierName;this.source(e,t),r(),this._sourcePosition.line=n,this._sourcePosition.column=i,this._sourcePosition.filename=s,this._sourcePosition.identifierName=a},e.prototype.getCurrentColumn=function(){var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=e.lastIndexOf("\n");return-1===t?this._position.column+e.length:e.length-1-t},e.prototype.getCurrentLine=function(){for(var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=0,r=0;r")),this.space(),this.print(e.returnType,e)}function g(e){this.print(e.name,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.typeAnnotation,e)}function b(e){this.print(e.id,e),this.print(e.typeParameters,e)}function v(e){this.print(e.id,e),this.print(e.typeParameters,e),e.extends.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends,e)),e.mixins&&e.mixins.length&&(this.space(),this.word("mixins"),this.space(),this.printList(e.mixins,e)),this.space(),this.print(e.body,e)}function x(e){"plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")}function E(e){this.word("interface"),this.space(),this._interfaceish(e)}function A(){this.space(),this.token("&"),this.space()}function D(e){this.printJoin(e.types,e,{separator:A})}function C(){this.word("mixed")}function S(){this.word("empty")}function _(e){this.token("?"),this.print(e.typeAnnotation,e)}function w(){this.word("number")}function k(){this.word("string")}function F(){this.word("this")}function T(e){this.token("["),this.printList(e.types,e),this.token("]")}function P(e){this.word("typeof"),this.space(),this.print(e.argument,e)}function B(e){this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),this.space(),this.token("="),this.space(),this.print(e.right,e),this.semicolon()}function O(e){this.token(":"),this.space(),e.optional&&this.token("?"),this.print(e.typeAnnotation,e)}function j(e){this._variance(e),this.word(e.name),e.bound&&this.print(e.bound,e),e.default&&(this.space(),this.token("="),this.space(),this.print(e.default,e))}function N(e){this.token("<"),this.printList(e.params,e,{}),this.token(">")}function I(e){var t=this;e.exact?this.token("{|"):this.token("{");var r=e.properties.concat(e.callProperties,e.indexers);r.length&&(this.space(),this.printJoin(r,e,{addNewlines:function(e){if(e&&!r[0])return 1},indent:!0,statement:!0,iterator:function(){1!==r.length&&(t.format.flowCommaSeparator?t.token(","):t.semicolon(),t.space())}}),this.space()),e.exact?this.token("|}"):this.token("}")}function L(e){e.static&&(this.word("static"),this.space()),this.print(e.value,e)}function M(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.token("["),this.print(e.id,e),this.token(":"),this.space(),this.print(e.key,e),this.token("]"),this.token(":"),this.space(),this.print(e.value,e)}function R(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.print(e.key,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.value,e)}function U(e){this.print(e.qualification,e),this.token("."),this.print(e.id,e)}function V(){this.space(),this.token("|"),this.space()}function q(e){this.printJoin(e.types,e,{separator:V})}function G(e){this.token("("),this.print(e.expression,e),this.print(e.typeAnnotation,e),this.token(")")}function X(){this.word("void")}r.__esModule=!0,r.AnyTypeAnnotation=n,r.ArrayTypeAnnotation=i,r.BooleanTypeAnnotation=s,r.BooleanLiteralTypeAnnotation=a,r.NullLiteralTypeAnnotation=o,r.DeclareClass=u,r.DeclareFunction=l,r.DeclareInterface=c,r.DeclareModule=p,r.DeclareModuleExports=h,r.DeclareTypeAlias=f,r.DeclareVariable=d,r.ExistentialTypeParam=m,r.FunctionTypeAnnotation=y,r.FunctionTypeParam=g,r.InterfaceExtends=b,r._interfaceish=v,r._variance=x,r.InterfaceDeclaration=E,r.IntersectionTypeAnnotation=D,r.MixedTypeAnnotation=C,r.EmptyTypeAnnotation=S,r.NullableTypeAnnotation=_;var J=e("./types");Object.defineProperty(r,"NumericLiteralTypeAnnotation",{enumerable:!0,get:function(){return J.NumericLiteral}}),Object.defineProperty(r,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return J.StringLiteral}}),r.NumberTypeAnnotation=w,r.StringTypeAnnotation=k,r.ThisTypeAnnotation=F,r.TupleTypeAnnotation=T,r.TypeofTypeAnnotation=P,r.TypeAlias=B,r.TypeAnnotation=O,r.TypeParameter=j,r.TypeParameterInstantiation=N,r.ObjectTypeAnnotation=I,r.ObjectTypeCallProperty=L,r.ObjectTypeIndexer=M,r.ObjectTypeProperty=R,r.QualifiedTypeIdentifier=U,r.UnionTypeAnnotation=q,r.TypeCastExpression=G,r.VoidTypeAnnotation=X,r.ClassImplements=b,r.GenericTypeAnnotation=b,r.TypeParameterDeclaration=N},{"./types":77}],72:[function(e,t,r){"use strict";function n(e){this.print(e.name,e),e.value&&(this.token("="),this.print(e.value,e))}function i(e){this.word(e.name)}function s(e){this.print(e.namespace,e),this.token(":"),this.print(e.name,e)}function a(e){this.print(e.object,e),this.token("."),this.print(e.property,e)}function o(e){this.token("{"),this.token("..."),this.print(e.argument,e),this.token("}")}function u(e){this.token("{"),this.print(e.expression,e),this.token("}")}function l(e){this.token("{"),this.token("..."),this.print(e.expression,e),this.token("}")}function c(e){this.token(e.value)}function p(e){var t=e.openingElement;if(this.print(t,e),!t.selfClosing){this.indent();for(var r=e.children,n=Array.isArray(r),i=0,r=n?r:(0,g.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;this.print(a,e)}this.dedent(),this.print(e.closingElement,e)}}function h(){this.space()}function f(e){this.token("<"),this.print(e.name,e),e.attributes.length>0&&(this.space(),this.printJoin(e.attributes,e,{separator:h})),e.selfClosing?(this.space(),this.token("/>")):this.token(">")}function d(e){this.token("")}function m(){}r.__esModule=!0;var y=e("babel-runtime/core-js/get-iterator"),g=function(e){return e&&e.__esModule?e:{default:e}}(y);r.JSXAttribute=n,r.JSXIdentifier=i,r.JSXNamespacedName=s,r.JSXMemberExpression=a,r.JSXSpreadAttribute=o,r.JSXExpressionContainer=u,r.JSXSpreadChild=l,r.JSXText=c,r.JSXElement=p,r.JSXOpeningElement=f,r.JSXClosingElement=d,r.JSXEmptyExpression=m},{"babel-runtime/core-js/get-iterator":113}],73:[function(e,t,r){"use strict";function n(e){var t=this;this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e,{iterator:function(e){e.optional&&t.token("?"),t.print(e.typeAnnotation,e)}}),this.token(")"),e.returnType&&this.print(e.returnType,e)}function i(e){var t=e.kind,r=e.key;"method"!==t&&"init"!==t||e.generator&&this.token("*"),"get"!==t&&"set"!==t||(this.word(t),this.space()),e.async&&(this.word("async"),this.space()),e.computed?(this.token("["),this.print(r,e),this.token("]")):this.print(r,e),this._params(e),this.space(),this.print(e.body,e)}function s(e){e.async&&(this.word("async"),this.space()),this.word("function"),e.generator&&this.token("*"),e.id?(this.space(),this.print(e.id,e)):this.space(),this._params(e),this.space(),this.print(e.body,e)}function a(e){e.async&&(this.word("async"),this.space());var t=e.params[0];1===e.params.length&&l.isIdentifier(t)&&!o(e,t)?this.print(t,e):this._params(e),this.space(),this.token("=>"),this.space(),this.print(e.body,e)}function o(e,t){return e.typeParameters||e.returnType||t.typeAnnotation||t.optional||t.trailingComments}r.__esModule=!0,r.FunctionDeclaration=void 0,r._params=n,r._method=i,r.FunctionExpression=s,r.ArrowFunctionExpression=a;var u=e("babel-types"),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);r.FunctionDeclaration=s},{"babel-types":169}],74:[function(e,t,r){"use strict";function n(e){"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space()),this.print(e.imported,e),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local,e))}function i(e){this.print(e.local,e)}function s(e){this.print(e.exported,e)}function a(e){this.print(e.local,e),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e))}function o(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.exported,e)}function u(e){this.word("export"),this.space(),this.token("*"),this.space(),this.word("from"),this.space(),this.print(e.source,e),this.semicolon()}function l(){this.word("export"),this.space(),p.apply(this,arguments)}function c(){this.word("export"),this.space(),this.word("default"),this.space(),p.apply(this,arguments)}function p(e){if(e.declaration){var t=e.declaration;this.print(t,e),m.isStatement(t)||this.semicolon()}else{"type"===e.exportKind&&(this.word("type"),this.space());for(var r=e.specifiers.slice(0),n=!1;;){var i=r[0];if(!m.isExportDefaultSpecifier(i)&&!m.isExportNamespaceSpecifier(i))break;n=!0,this.print(r.shift(),e),r.length&&(this.token(","),this.space())}(r.length||!r.length&&!n)&&(this.token("{"),r.length&&(this.space(),this.printList(r,e),this.space()),this.token("}")),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}}function h(e){this.word("import"),this.space(),"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space());var t=e.specifiers.slice(0);if(t&&t.length){for(;;){var r=t[0];if(!m.isImportDefaultSpecifier(r)&&!m.isImportNamespaceSpecifier(r))break;this.print(t.shift(),e),t.length&&(this.token(","),this.space())}t.length&&(this.token("{"),this.space(),this.printList(t,e),this.space(),this.token("}")),this.space(),this.word("from"),this.space()}this.print(e.source,e),this.semicolon()}function f(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.local,e)}r.__esModule=!0,r.ImportSpecifier=n,r.ImportDefaultSpecifier=i,r.ExportDefaultSpecifier=s,r.ExportSpecifier=a, +r.ExportNamespaceSpecifier=o,r.ExportAllDeclaration=u,r.ExportNamedDeclaration=l,r.ExportDefaultDeclaration=c,r.ImportDeclaration=h,r.ImportNamespaceSpecifier=f;var d=e("babel-types"),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(d)},{"babel-types":169}],75:[function(e,t,r){"use strict";function n(e){this.word("with"),this.space(),this.token("("),this.print(e.object,e),this.token(")"),this.printBlock(e)}function i(e){this.word("if"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.space();var t=e.alternate&&D.isIfStatement(s(e.consequent));t&&(this.token("{"),this.newline(),this.indent()),this.printAndIndentOnComments(e.consequent,e),t&&(this.dedent(),this.newline(),this.token("}")),e.alternate&&(this.endsWith("}")&&this.space(),this.word("else"),this.space(),this.printAndIndentOnComments(e.alternate,e))}function s(e){return D.isStatement(e.body)?s(e.body):e}function a(e){this.word("for"),this.space(),this.token("("),this.inForStatementInitCounter++,this.print(e.init,e),this.inForStatementInitCounter--,this.token(";"),e.test&&(this.space(),this.print(e.test,e)),this.token(";"),e.update&&(this.space(),this.print(e.update,e)),this.token(")"),this.printBlock(e)}function o(e){this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.printBlock(e)}function u(e){this.word("do"),this.space(),this.print(e.body,e),this.space(),this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.semicolon()}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";return function(r){this.word(e);var n=r[t];if(n){this.space();var i=this.startTerminatorless();this.print(n,r),this.endTerminatorless(i)}this.semicolon()}}function c(e){this.print(e.label,e),this.token(":"),this.space(),this.print(e.body,e)}function p(e){this.word("try"),this.space(),this.print(e.block,e),this.space(),e.handlers?this.print(e.handlers[0],e):this.print(e.handler,e),e.finalizer&&(this.space(),this.word("finally"),this.space(),this.print(e.finalizer,e))}function h(e){this.word("catch"),this.space(),this.token("("),this.print(e.param,e),this.token(")"),this.space(),this.print(e.body,e)}function f(e){this.word("switch"),this.space(),this.token("("),this.print(e.discriminant,e),this.token(")"),this.space(),this.token("{"),this.printSequence(e.cases,e,{indent:!0,addNewlines:function(t,r){if(!t&&e.cases[e.cases.length-1]===r)return-1}}),this.token("}")}function d(e){e.test?(this.word("case"),this.space(),this.print(e.test,e),this.token(":")):(this.word("default"),this.token(":")),e.consequent.length&&(this.newline(),this.printSequence(e.consequent,e,{indent:!0}))}function m(){this.word("debugger"),this.semicolon()}function y(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<4;e++)this.space(!0)}function g(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<6;e++)this.space(!0)}function b(e,t){this.word(e.kind),this.space();var r=!1;if(!D.isFor(t))for(var n=e.declarations,i=Array.isArray(n),s=0,n=i?n:(0,E.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;o.init&&(r=!0)}var u=void 0;r&&(u="const"===e.kind?g:y),this.printList(e.declarations,e,{separator:u}),(!D.isFor(t)||t.left!==e&&t.init!==e)&&this.semicolon()}function v(e){this.print(e.id,e),this.print(e.id.typeAnnotation,e),e.init&&(this.space(),this.token("="),this.space(),this.print(e.init,e))}r.__esModule=!0,r.ThrowStatement=r.BreakStatement=r.ReturnStatement=r.ContinueStatement=r.ForAwaitStatement=r.ForOfStatement=r.ForInStatement=void 0;var x=e("babel-runtime/core-js/get-iterator"),E=function(e){return e&&e.__esModule?e:{default:e}}(x);r.WithStatement=n,r.IfStatement=i,r.ForStatement=a,r.WhileStatement=o,r.DoWhileStatement=u,r.LabeledStatement=c,r.TryStatement=p,r.CatchClause=h,r.SwitchStatement=f,r.SwitchCase=d,r.DebuggerStatement=m,r.VariableDeclaration=b,r.VariableDeclarator=v;var A=e("babel-types"),D=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(A),C=function(e){return function(t){this.word("for"),this.space(),"await"===e&&(this.word("await"),this.space()),this.token("("),this.print(t.left,t),this.space(),this.word("await"===e?"of":e),this.space(),this.print(t.right,t),this.token(")"),this.printBlock(t)}};r.ForInStatement=C("in"),r.ForOfStatement=C("of"),r.ForAwaitStatement=C("await"),r.ContinueStatement=l("continue"),r.ReturnStatement=l("return","argument"),r.BreakStatement=l("break"),r.ThrowStatement=l("throw","argument")},{"babel-runtime/core-js/get-iterator":113,"babel-types":169}],76:[function(e,t,r){"use strict";function n(e){this.print(e.tag,e),this.print(e.quasi,e)}function i(e,t){var r=t.quasis[0]===e,n=t.quasis[t.quasis.length-1]===e,i=(r?"`":"}")+e.value.raw+(n?"`":"${");this.token(i)}function s(e){for(var t=e.quasis,r=0;r0&&this.space(),this.print(i,e),n=0||e.indexOf("@preserve")>=0},"auto"===a.compact&&(a.compact=e.length>5e5,a.compact&&console.error("[BABEL] "+g.get("codeGeneratorDeopt",t.filename,"500KB"))),a.compact&&(a.indent.adjustMultilineComment=!1),a}function s(e,t){if(!e)return"double";for(var r={single:0,double:0},n=0,i=0;i=3)break}}return r.single>r.double?"single":"double"}r.__esModule=!0,r.CodeGenerator=void 0;var a=e("babel-runtime/helpers/classCallCheck"),o=n(a),u=e("babel-runtime/helpers/possibleConstructorReturn"),l=n(u),c=e("babel-runtime/helpers/inherits"),p=n(c);r.default=function(e,t,r){return new x(e,t,r).generate()};var h=e("detect-indent"),f=n(h),d=e("./source-map"),m=n(d),y=e("babel-messages"),g=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(y),b=e("./printer"),v=n(b),x=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments[2];(0,o.default)(this,t);var a=r.tokens||[],u=i(s,n,a),c=n.sourceMaps?new m.default(n,s):null,p=(0,l.default)(this,e.call(this,u,c,a));return p.ast=r,p}return(0,p.default)(t,e),t.prototype.generate=function(){return e.prototype.generate.call(this,this.ast)},t}(v.default);r.CodeGenerator=function(){function e(t,r,n){(0,o.default)(this,e),this._generator=new x(t,r,n)}return e.prototype.generate=function(){return this._generator.generate()},e}()},{"./printer":82,"./source-map":83,"babel-messages":103,"babel-runtime/helpers/classCallCheck":127,"babel-runtime/helpers/inherits":128,"babel-runtime/helpers/possibleConstructorReturn":130,"detect-indent":299}],79:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){function t(e,t){var n=r[e];r[e]=n?function(e,r,i){var s=n(e,r,i);return null==s?t(e,r,i):s}:t}for(var r={},n=(0,m.default)(e),i=Array.isArray(n),s=0,n=i?n:(0,f.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a,u=E.FLIPPED_ALIAS_KEYS[o];if(u)for(var l=u,c=Array.isArray(l),p=0,l=c?l:(0,f.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if(p=l.next(),p.done)break;h=p.value}var d=h;t(d,e[o])}else t(o,e[o])}return r}function a(e,t,r,n){var i=e[t.type];return i?i(t,r,n):null}function o(e){return!!E.isCallExpression(e)||!!E.isMemberExpression(e)&&(o(e.object)||!e.computed&&o(e.property))}function u(e,t,r){if(!e)return 0;E.isExpressionStatement(e)&&(e=e.expression);var n=a(D,e,t);if(!n){var i=a(C,e,t);if(i)for(var s=0;ss)return!0}return!1}function u(e,t){return"in"===e.operator&&(v.isVariableDeclarator(t)||v.isFor(t))}function l(e,t){return!(v.isForStatement(t)||v.isThrowStatement(t)||v.isReturnStatement(t)||v.isIfStatement(t)&&t.test===e||v.isWhileStatement(t)&&t.test===e||v.isForInStatement(t)&&t.right===e||v.isSwitchStatement(t)&&t.discriminant===e||v.isExpressionStatement(t)&&t.expression===e)}function c(e,t){return v.isBinary(t)||v.isUnaryLike(t)||v.isCallExpression(t)||v.isMemberExpression(t)||v.isNewExpression(t)||v.isConditionalExpression(t)&&e===t.test}function p(e,t,r){return g(r,{considerDefaultExports:!0})}function h(e,t){return v.isMemberExpression(t,{object:e})||v.isCallExpression(t,{callee:e})||v.isNewExpression(t,{callee:e})}function f(e,t,r){return g(r,{considerDefaultExports:!0})}function d(e,t){return!!(v.isExportDeclaration(t)||v.isBinaryExpression(t)||v.isLogicalExpression(t)||v.isUnaryExpression(t)||v.isTaggedTemplateExpression(t))||h(e,t)}function m(e,t){return!!(v.isUnaryLike(t)||v.isBinary(t)||v.isConditionalExpression(t,{test:e})||v.isAwaitExpression(t))||h(e,t)}function y(e){return!!v.isObjectPattern(e.left)||m.apply(void 0,arguments)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.considerArrow,n=void 0!==r&&r,i=t.considerDefaultExports,s=void 0!==i&&i,a=e.length-1,o=e[a];a--;for(var u=e[a];a>0;){if(v.isExpressionStatement(u,{expression:o})||v.isTaggedTemplateExpression(u)||s&&v.isExportDefaultDeclaration(u,{declaration:o})||n&&v.isArrowFunctionExpression(u,{body:o}))return!0;if(!(v.isCallExpression(u,{callee:o})||v.isSequenceExpression(u)&&u.expressions[0]===o||v.isMemberExpression(u,{object:o})||v.isConditional(u,{test:o})||v.isBinary(u,{left:o})||v.isAssignmentExpression(u,{left:o})))return!1;o=u,a--,u=e[a]}return!1}r.__esModule=!0,r.AwaitExpression=r.FunctionTypeAnnotation=void 0,r.NullableTypeAnnotation=n,r.UpdateExpression=i,r.ObjectExpression=s,r.DoExpression=a,r.Binary=o,r.BinaryExpression=u,r.SequenceExpression=l,r.YieldExpression=c,r.ClassExpression=p,r.UnaryLike=h,r.FunctionExpression=f,r.ArrowFunctionExpression=d,r.ConditionalExpression=m,r.AssignmentExpression=y;var b=e("babel-types"),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(b),x={"||":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10};r.FunctionTypeAnnotation=n,r.AwaitExpression=c},{"babel-types":169}],81:[function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.isMemberExpression(e)?(n(e.object,t),e.computed&&n(e.property,t)):l.isBinary(e)||l.isAssignmentExpression(e)?(n(e.left,t),n(e.right,t)):l.isCallExpression(e)?(t.hasCall=!0,n(e.callee,t)):l.isFunction(e)?t.hasFunction=!0:l.isIdentifier(e)&&(t.hasHelper=t.hasHelper||i(e.callee)),t}function i(e){return l.isMemberExpression(e)?i(e.object)||i(e.property):l.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:l.isCallExpression(e)?i(e.callee):!(!l.isBinary(e)&&!l.isAssignmentExpression(e))&&(l.isIdentifier(e.left)&&i(e.left)||i(e.right))}function s(e){return l.isLiteral(e)||l.isObjectExpression(e)||l.isArrayExpression(e)||l.isIdentifier(e)||l.isMemberExpression(e)}var a=e("lodash/map"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),u=e("babel-types"),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u);r.nodes={AssignmentExpression:function(e){var t=n(e.right);if(t.hasCall&&t.hasHelper||t.hasFunction)return{before:t.hasFunction,after:!0}},SwitchCase:function(e,t){return{before:e.consequent.length||t.cases[0]===e}},LogicalExpression:function(e){if(l.isFunction(e.left)||l.isFunction(e.right))return{after:!0}},Literal:function(e){if("use strict"===e.value)return{after:!0}},CallExpression:function(e){if(l.isFunction(e.callee)||i(e))return{before:!0,after:!0}},VariableDeclaration:function(e){for(var t=0;t0?new F.default(n):null}return e.prototype.generate=function(e){return this.print(e),this._maybeAddAuxComment(),this._buf.get()},e.prototype.indent=function(){this.format.compact||this.format.concise||this._indent++},e.prototype.dedent=function(){this.format.compact||this.format.concise||this._indent--},e.prototype.semicolon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._maybeAddAuxComment(),this._append(";",!e)},e.prototype.rightBrace=function(){this.format.minified&&this._buf.removeLastSemicolon(),this.token("}")},e.prototype.space=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.format.compact||(this._buf.hasContent()&&!this.endsWith(" ")&&!this.endsWith("\n")||e)&&this._space()},e.prototype.word=function(e){this._endsWithWord&&this._space(),this._maybeAddAuxComment(),this._append(e),this._endsWithWord=!0},e.prototype.number=function(e){this.word(e),this._endsWithInteger=(0,E.default)(+e)&&!j.test(e)&&!B.test(e)&&!O.test(e)&&"."!==e[e.length-1]},e.prototype.token=function(e){("--"===e&&this.endsWith("!")||"+"===e[0]&&this.endsWith("+")||"-"===e[0]&&this.endsWith("-")||"."===e[0]&&this._endsWithInteger)&&this._space(),this._maybeAddAuxComment(),this._append(e)},e.prototype.newline=function(e){if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();if(!(this.endsWith("\n\n")||("number"!=typeof e&&(e=1),e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,e<=0)))for(var t=0;t1&&void 0!==arguments[1]&&arguments[1];this._maybeAddParen(e),this._maybeIndent(e),t?this._buf.queue(e):this._buf.append(e),this._endsWithWord=!1,this._endsWithInteger=!1},e.prototype._maybeIndent=function(e){this._indent&&this.endsWith("\n")&&"\n"!==e[0]&&this._buf.queue(this._getIndent())},e.prototype._maybeAddParen=function(e){var t=this._parenPushNewlineState;if(t){this._parenPushNewlineState=null;var r=void 0;for(r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e.length){r.indent&&this.indent();for(var n={addNewlines:r.addNewlines},i=0;i1&&void 0!==arguments[1])||arguments[1];e.innerComments&&(t&&this.indent(),this._printComments(e.innerComments),t&&this.dedent())},e.prototype.printSequence=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.statement=!0,this.printJoin(e,t,r)},e.prototype.printList=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==r.separator&&(r.separator=s),this.printJoin(e,t,r)},e.prototype._printNewline=function(e,t,r,n){var i=this;if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();var s=0;if(null!=t.start&&!t._ignoreUserWhitespace&&this._whitespace)if(e){var a=t.leadingComments,o=a&&(0,g.default)(a,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});s=this._whitespace.getNewlinesBefore(o||t)}else{var u=t.trailingComments,l=u&&(0,v.default)(u,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});s=this._whitespace.getNewlinesAfter(l||t)}else{e||s++,n.addNewlines&&(s+=n.addNewlines(e,t)||0);var c=w.needsWhitespaceAfter;e&&(c=w.needsWhitespaceBefore),c(t,r)&&s++,this._buf.hasContent()||(s=0)}this.newline(s)}},e.prototype._getComments=function(e,t){return t&&(e?t.leadingComments:t.trailingComments)||[]},e.prototype._printComment=function(e){var t=this;if(this.format.shouldPrintComment(e.value)&&!e.ignore&&!this._printedComments.has(e)){if(this._printedComments.add(e),null!=e.start){if(this._printedCommentStarts[e.start])return;this._printedCommentStarts[e.start]=!0}this.newline(this._whitespace?this._whitespace.getNewlinesBefore(e):0),this.endsWith("[")||this.endsWith("{")||this.space();var r="CommentLine"===e.type?"//"+e.value+"\n":"/*"+e.value+"*/";if("CommentBlock"===e.type&&this.format.indent.adjustMultilineComment){var n=e.loc&&e.loc.start.column;if(n){var i=new RegExp("\\n\\s{1,"+n+"}","g");r=r.replace(i,"\n")}var s=Math.max(this._getIndent().length,this._buf.getCurrentColumn());r=r.replace(/\n(?!$)/g,"\n"+(0,D.default)(" ",s))}this.withSource("start",e.loc,function(){t._append(r)}),this.newline((this._whitespace?this._whitespace.getNewlinesAfter(e):0)+("CommentLine"===e.type?-1:0))}},e.prototype._printComments=function(e){if(e&&e.length)for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,l.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;this._printComment(s)}},e}();r.default=N;for(var I=[e("./generators/template-literals"),e("./generators/expressions"),e("./generators/statements"),e("./generators/classes"),e("./generators/methods"),e("./generators/modules"),e("./generators/types"),e("./generators/flow"),e("./generators/base"),e("./generators/jsx")],L=0;L=0){for(;i&&e.start===n[i-1].start;)--i;t=n[i-1],r=n[i]}return this._getNewlinesBetween(t,r)},e.prototype.getNewlinesAfter=function(e){var t=void 0,r=void 0,n=this.tokens,i=this._findToken(function(t){return t.end-e.end},0,n.length);if(i>=0){for(;i&&e.end===n[i-1].end;)--i;t=n[i],r=n[i+1],","===r.type.label&&(r=n[i+2])}return r&&"eof"===r.type.label?1:this._getNewlinesBetween(t,r)},e.prototype._getNewlinesBetween=function(e,t){if(!t||!t.loc)return 0;for(var r=e?e.loc.end.line:1,n=t.loc.start.line,i=0,s=r;s=r)return-1;var n=t+r>>>1,i=e(this.tokens[n]);return i<0?this._findToken(e,n+1,r):i>0?this._findToken(e,t,n):0===i?n:-1},e}();r.default=s,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":127}],85:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./util":94,dup:55}],86:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{"./base64":87,dup:56}],87:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],88:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{dup:58}],89:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./util":94,dup:59}],90:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{dup:60}],91:[function(e,t,r){arguments[4][61][0].apply(r,arguments)},{"./array-set":85,"./base64-vlq":86,"./binary-search":88,"./quick-sort":90,"./util":94,dup:61}],92:[function(e,t,r){arguments[4][62][0].apply(r,arguments)},{"./array-set":85,"./base64-vlq":86,"./mapping-list":89,"./util":94,dup:62}],93:[function(e,t,r){arguments[4][63][0].apply(r,arguments)},{"./source-map-generator":92,"./util":94,dup:63}],94:[function(e,t,r){arguments[4][64][0].apply(r,arguments)},{dup:64}],95:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{"./lib/source-map-consumer":91,"./lib/source-map-generator":92,"./lib/source-node":93,dup:65}],96:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return!g.isClassMethod(e)&&!g.isObjectMethod(e)||"get"!==e.kind&&"set"!==e.kind?"value":e.kind}function s(e,t,r,n,s){var a=g.toKeyAlias(t),o={};if((0,m.default)(e,a)&&(o=e[a]),e[a]=o,o._inherits=o._inherits||[],o._inherits.push(t),o._key=t.key,t.computed&&(o._computed=!0),t.decorators){var u=o.decorators=o.decorators||g.arrayExpression([]);u.elements=u.elements.concat(t.decorators.map(function(e){return e.expression}).reverse())}if(o.value||o.initializer)throw n.buildCodeFrameError(t,"Key conflict with sibling node");var l=void 0,c=void 0;(g.isObjectProperty(t)||g.isObjectMethod(t)||g.isClassMethod(t))&&(l=g.toComputedKey(t,t.key)), +g.isObjectProperty(t)||g.isClassProperty(t)?c=t.value:(g.isObjectMethod(t)||g.isClassMethod(t))&&(c=g.functionExpression(null,t.params,t.body,t.generator,t.async),c.returnType=t.returnType);var p=i(t);return r&&"value"===p||(r=p),s&&g.isStringLiteral(l)&&("value"===r||"initializer"===r)&&g.isFunctionExpression(c)&&(c=(0,f.default)({id:l,node:c,scope:s})),c&&(g.inheritsComments(c,t),o[r]=c),o}function a(e){for(var t in e)if(e[t]._computed)return!0;return!1}function o(e){for(var t=g.arrayExpression([]),r=0;r1&&void 0!==arguments[1]&&arguments[1];(0,l.default)(this,e),this.forceSuperMemoisation=t.forceSuperMemoisation,this.methodPath=t.methodPath,this.methodNode=t.methodNode,this.superRef=t.superRef,this.isStatic=t.isStatic,this.hasSuper=!1,this.inClass=r,this.isLoose=t.isLoose,this.scope=this.methodPath.scope,this.file=t.file,this.opts=t,this.bareSupers=[],this.returns=[],this.thises=[]}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,t,r){return g.callExpression(this.file.addHelper("set"),[o(this.getObjectRef(),this.isStatic),r?e:g.stringLiteral(e.name),t,g.thisExpression()])},e.prototype.getSuperProperty=function(e,t){return g.callExpression(this.file.addHelper("get"),[o(this.getObjectRef(),this.isStatic),t?e:g.stringLiteral(e.name),g.thisExpression()])},e.prototype.replace=function(){this.methodPath.traverse(v,this)},e.prototype.getLooseSuperProperty=function(e,t){var r=this.methodNode,n=this.superRef||g.identifier("Function");return t.property===e?void 0:g.isCallExpression(t,{callee:e})?void 0:g.isMemberExpression(t)&&!r.static?g.memberExpression(n,g.identifier("prototype")):n},e.prototype.looseHandle=function(e){var t=e.node;if(e.isSuper())return this.getLooseSuperProperty(t,e.parent);if(e.isCallExpression()){var r=t.callee;if(!g.isMemberExpression(r))return;if(!g.isSuper(r.object))return;return g.appendToMemberExpression(r,g.identifier("call")),t.arguments.unshift(g.thisExpression()),!0}},e.prototype.specHandleAssignmentExpression=function(e,t,r){return"="===r.operator?this.setSuperProperty(r.left.property,r.right,r.left.computed):(e=e||t.scope.generateUidIdentifier("ref"),[g.variableDeclaration("var",[g.variableDeclarator(e,r.left)]),g.expressionStatement(g.assignmentExpression("=",r.left,g.binaryExpression(r.operator[0],e,r.right)))])},e.prototype.specHandle=function(e){var t=void 0,r=void 0,n=void 0,i=e.parent,o=e.node;if(s(o,i))throw e.buildCodeFrameError(m.get("classesIllegalBareSuper"));if(g.isCallExpression(o)){var u=o.callee;if(g.isSuper(u))return;a(u)&&(t=u.property,r=u.computed,n=o.arguments)}else if(g.isMemberExpression(o)&&g.isSuper(o.object))t=o.property,r=o.computed;else{if(g.isUpdateExpression(o)&&a(o.argument)){var l=g.binaryExpression(o.operator[0],o.argument,g.numericLiteral(1));if(o.prefix)return this.specHandleAssignmentExpression(null,e,l);var c=e.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(c,e,l).concat(g.expressionStatement(c))}if(g.isAssignmentExpression(o)&&a(o.left))return this.specHandleAssignmentExpression(null,e,o)}if(t){var p=this.getSuperProperty(t,r);return n?this.optimiseCall(p,n):p}},e.prototype.optimiseCall=function(e,t){var r=g.thisExpression();return r[b]=!0,(0,f.default)(e,r,t)},e}();r.default=x,t.exports=r.default},{"babel-helper-optimise-call-expression":99,"babel-messages":103,"babel-runtime/core-js/symbol":122,"babel-runtime/helpers/classCallCheck":127,"babel-types":169}],101:[function(e,t,r){"use strict";r.__esModule=!0;var n=e("babel-template"),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s={};r.default=s,s.typeof=(0,i.default)('\n (typeof Symbol === "function" && typeof Symbol.iterator === "symbol")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? "symbol"\n : typeof obj;\n };\n'),s.jsx=(0,i.default)('\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we\'re going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \'\' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n'),s.asyncIterator=(0,i.default)('\n (function (iterable) {\n if (typeof Symbol === "function") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError("Object is not async iterable");\n })\n'),s.asyncGenerator=(0,i.default)('\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume("next", arg); },\n function (arg) { resume("throw", arg); });\n } else {\n settle(result.done ? "return" : "normal", result.value);\n }\n } catch (err) {\n settle("throw", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case "return":\n front.resolve({ value: value, done: true });\n break;\n case "throw":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide "return" method if generator return is not supported\n if (typeof gen.return !== "function") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === "function" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n'),s.asyncGeneratorDelegate=(0,i.default)('\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === "function" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump("next", value);\n };\n\n if (typeof inner.throw === "function") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump("throw", value);\n };\n }\n\n if (typeof inner.return === "function") {\n iter.return = function (value) {\n return pump("return", value);\n };\n }\n\n return iter;\n })\n'),s.asyncToGenerator=(0,i.default)('\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step("next", value);\n }, function (err) {\n step("throw", err);\n });\n }\n }\n\n return step("next");\n });\n };\n })\n'),s.classCallCheck=(0,i.default)('\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n });\n'),s.createClass=(0,i.default)('\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n'),s.defineEnumerableProperties=(0,i.default)('\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ("value" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n'),s.defaults=(0,i.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"),s.defineProperty=(0,i.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"),s.extends=(0,i.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"),s.get=(0,i.default)('\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n'),s.inherits=(0,i.default)('\n (function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n'),s.instanceof=(0,i.default)('\n (function (left, right) {\n if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n'),s.interopRequireDefault=(0,i.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"),s.interopRequireWildcard=(0,i.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"),s.newArrowCheck=(0,i.default)('\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError("Cannot instantiate an arrow function");\n }\n });\n'),s.objectDestructuringEmpty=(0,i.default)('\n (function (obj) {\n if (obj == null) throw new TypeError("Cannot destructure undefined");\n });\n'),s.objectWithoutProperties=(0,i.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"),s.possibleConstructorReturn=(0,i.default)('\n (function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n return call && (typeof call === "object" || typeof call === "function") ? call : self;\n });\n'),s.selfGlobal=(0,i.default)('\n typeof global === "undefined" ? self : global\n'),s.set=(0,i.default)('\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if ("value" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n'),s.slicedToArray=(0,i.default)('\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n })();\n'),s.slicedToArrayLoose=(0,i.default)('\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n });\n'),s.taggedTemplateLiteral=(0,i.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"),s.taggedTemplateLiteralLoose=(0,i.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"),s.temporalRef=(0,i.default)('\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + " is not defined - temporal dead zone");\n } else {\n return val;\n }\n })\n'),s.temporalUndefined=(0,i.default)("\n ({})\n"),s.toArray=(0,i.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"),s.toConsumableArray=(0,i.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"),t.exports=r.default},{"babel-template":132}],102:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u.default[e];if(!t)throw new ReferenceError("Unknown helper "+e);return t().expression}r.__esModule=!0,r.list=void 0;var s=e("babel-runtime/core-js/object/keys"),a=n(s);r.get=i;var o=e("./helpers"),u=n(o);r.list=(0,a.default)(u.default).map(function(e){return e.replace(/^_/,"")}).filter(function(e){return"__esModule"!==e});r.default=i},{"./helpers":101,"babel-runtime/core-js/object/keys":120}],103:[function(e,t,r){"use strict";function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n4&&void 0!==arguments[4]&&arguments[4];if(t||(t=e.node),!v.isFor(r))for(var s=0;s0&&e.traverse(k,t),e.skip()}},g.visitor]),k=y.default.visitors.merge([{ReferencedIdentifier:function(e,t){var r=t.letReferences[e.node.name];if(r){var n=e.scope.getBindingIdentifier(e.node.name);n&&n!==r||(t.closurify=!0)}}},g.visitor]),F={enter:function(e,t){var r=e.node;e.parent;if(e.isForStatement()){if(o(r.init)){var n=t.pushDeclar(r.init);1===n.length?r.init=n[0]:r.init=v.sequenceExpression(n)}}else if(e.isFor())o(r.left)&&(t.pushDeclar(r.left),r.left=r.left.declarations[0].id);else if(o(r))e.replaceWithMultiple(t.pushDeclar(r).map(function(e){return v.expressionStatement(e)}));else if(e.isFunction())return e.skip()}},T={LabeledStatement:function(e,t){var r=e.node;t.innerLabels.push(r.label.name)}},P={enter:function(e,t){if(e.isAssignmentExpression()||e.isUpdateExpression()){var r=e.getBindingIdentifiers();for(var n in r)t.outsideReferences[n]===e.scope.getBindingIdentifier(n)&&(t.reassignments[n]=!0)}}},B={Loop:function(e,t){var r=t.ignoreLabeless;t.ignoreLabeless=!0,e.traverse(B,t),t.ignoreLabeless=r,e.skip()},Function:function(e){e.skip()},SwitchCase:function(e,t){var r=t.inSwitchCase;t.inSwitchCase=!0,e.traverse(B,t),t.inSwitchCase=r,e.skip()},"BreakStatement|ContinueStatement|ReturnStatement":function(e,t){var r=e.node,n=e.parent,i=e.scope;if(!r[this.LOOP_IGNORE]){var s=void 0,a=u(r);if(a){if(r.label){if(t.innerLabels.indexOf(r.label.name)>=0)return;a=a+"|"+r.label.name}else{if(t.ignoreLabeless)return;if(t.inSwitchCase)return;if(v.isBreakStatement(r)&&v.isSwitchCase(n))return}t.hasBreakContinue=!0,t.map[a]=r,s=v.stringLiteral(a)}e.isReturnStatement()&&(t.hasReturn=!0,s=v.objectExpression([v.objectProperty(v.identifier("v"),r.argument||i.buildUndefinedNode())])),s&&(s=v.returnStatement(s),s[this.LOOP_IGNORE]=!0,e.skip(),e.replaceWith(v.inherits(s,r)))}}},O=function(){function e(t,r,n,i,s){(0,d.default)(this,e),this.parent=n,this.scope=i,this.file=s,this.blockPath=r,this.block=r.node,this.outsideLetReferences=(0,h.default)(null),this.hasLetReferences=!1,this.letReferences=(0,h.default)(null),this.body=[],t&&(this.loopParent=t.parent,this.loopLabel=v.isLabeledStatement(this.loopParent)&&this.loopParent.label,this.loopPath=t,this.loop=t.node)}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var t=this.getLetReferences();if(v.isFunction(this.parent)||v.isProgram(this.block))return void this.updateScopeInfo();if(this.hasLetReferences)return t?this.wrapClosure():this.remap(),this.updateScopeInfo(t),this.loopLabel&&!v.isLabeledStatement(this.loopParent)?v.labeledStatement(this.loopLabel,this.loop):void 0}},e.prototype.updateScopeInfo=function(e){var t=this.scope,r=t.getFunctionParent(),n=this.letReferences;for(var i in n){var s=n[i],a=t.getBinding(s.name);a&&("let"!==a.kind&&"const"!==a.kind||(a.kind="var",e?t.removeBinding(s.name):t.moveBindingTo(s.name,r)))}},e.prototype.remap=function(){var e=this.letReferences,t=this.scope;for(var r in e){var n=e[r];(t.parentHasBinding(r)||t.hasGlobal(r))&&(t.hasOwnBinding(r)&&t.rename(n.name),this.blockPath.scope.hasOwnBinding(r)&&this.blockPath.scope.rename(n.name))}},e.prototype.wrapClosure=function(){if(this.file.opts.throwIfClosureRequired)throw this.blockPath.buildCodeFrameError("Compiling let/const in this block would add a closure (throwIfClosureRequired).");var e=this.block,t=this.outsideLetReferences;if(this.loop)for(var r in t){var n=t[r];(this.scope.hasGlobal(n.name)||this.scope.parentHasBinding(n.name))&&(delete t[n.name],delete this.letReferences[n.name],this.scope.rename(n.name),this.letReferences[n.name]=n,t[n.name]=n)}this.has=this.checkLoop(),this.hoistVarDeclarations();var i=(0,E.default)(t),s=(0,E.default)(t),a=this.blockPath.isSwitchStatement(),o=v.functionExpression(null,i,v.blockStatement(a?[e]:e.body));o.shadow=!0,this.addContinuations(o);var u=o;this.loop&&(u=this.scope.generateUidIdentifier("loop"),this.loopPath.insertBefore(v.variableDeclaration("var",[v.variableDeclarator(u,o)])));var l=v.callExpression(u,s),c=this.scope.generateUidIdentifier("ret");y.default.hasType(o.body,this.scope,"YieldExpression",v.FUNCTION_TYPES)&&(o.generator=!0,l=v.yieldExpression(l,!0)),y.default.hasType(o.body,this.scope,"AwaitExpression",v.FUNCTION_TYPES)&&(o.async=!0,l=v.awaitExpression(l)),this.buildClosure(c,l),a?this.blockPath.replaceWithMultiple(this.body):e.body=this.body},e.prototype.buildClosure=function(e,t){var r=this.has;r.hasReturn||r.hasBreakContinue?this.buildHas(e,t):this.body.push(v.expressionStatement(t))},e.prototype.addContinuations=function(e){var t={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(e,P,t);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"value",n=arguments[3],i=void 0;e.static?(this.hasStaticDescriptors=!0,i=this.staticMutatorMap):(this.hasInstanceDescriptors=!0,i=this.instanceMutatorMap);var s=m.push(i,e,r,this.file,n);return t&&(s.enumerable=v.booleanLiteral(!0)),s},e.prototype.constructorMeMaybe=function(){for(var e=!1,t=this.path.get("body.body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,a.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}if(e=s.equals("kind","constructor"))break}if(!e){var o=void 0,u=void 0;if(this.isDerived){var l=x().expression;o=l.params,u=l.body}else o=[],u=v.blockStatement([]);this.path.get("body").unshiftContainer("body",v.classMethod("constructor",v.identifier("constructor"),o,u))}},e.prototype.buildBody=function(){if(this.constructorMeMaybe(),this.pushBody(),this.verifyConstructor(),this.userConstructor){var e=this.constructorBody;e.body=e.body.concat(this.userConstructor.body.body),v.inherits(this.constructor,this.userConstructor),v.inherits(e,this.userConstructor.body)}this.pushDescriptors()},e.prototype.pushBody=function(){for(var e=this.path.get("body.body"),t=e,r=Array.isArray(t),n=0,t=r?t:(0,a.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,o=s.node;if(s.isClassProperty())throw s.buildCodeFrameError("Missing class properties transform.");if(o.decorators)throw s.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");if(v.isClassMethod(o)){var u="constructor"===o.kind;if(u&&(s.traverse(A,this),!this.hasBareSuper&&this.isDerived))throw s.buildCodeFrameError("missing super() call in constructor");var l=new p.default({forceSuperMemoisation:u,methodPath:s,methodNode:o,objectRef:this.classRef,superRef:this.superName,isStatic:o.static,isLoose:this.isLoose,scope:this.scope,file:this.file},!0);l.replace(),u?this.pushConstructor(l,o,s):this.pushMethod(o,s)}}},e.prototype.clearDescriptors=function(){this.hasInstanceDescriptors=!1,this.hasStaticDescriptors=!1,this.instanceMutatorMap={},this.staticMutatorMap={}},e.prototype.pushDescriptors=function(){this.pushInherits();var e=this.body,t=void 0,r=void 0;if(this.hasInstanceDescriptors&&(t=m.toClassObject(this.instanceMutatorMap)),this.hasStaticDescriptors&&(r=m.toClassObject(this.staticMutatorMap)),t||r){t&&(t=m.toComputedObjectFromClass(t)),r&&(r=m.toComputedObjectFromClass(r));var n=v.nullLiteral(),i=[this.classRef,n,n,n,n];t&&(i[1]=t),r&&(i[2]=r),this.instanceInitializersId&&(i[3]=this.instanceInitializersId,e.unshift(this.buildObjectAssignment(this.instanceInitializersId))),this.staticInitializersId&&(i[4]=this.staticInitializersId,e.unshift(this.buildObjectAssignment(this.staticInitializersId)));for(var s=0,a=0;a=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var p=c;this.wrapSuperCall(p,i,s,r),n&&p.find(function(e){return e===t||(e.isLoop()||e.isConditional()?(n=!1,!0):void 0)})}for(var h=this.superThises,f=Array.isArray(h),d=0,h=f?h:(0,a.default)(h);;){var m;if(f){if(d>=h.length)break;m=h[d++]}else{if(d=h.next(),d.done)break;m=d.value}m.replaceWith(s)}var y=function(t){return v.callExpression(e.file.addHelper("possibleConstructorReturn"),[s].concat(t||[]))},g=r.get("body");g.length&&!g.pop().isReturnStatement()&&r.pushContainer("body",v.returnStatement(n?s:y()));for(var b=this.superReturns,x=Array.isArray(b),E=0,b=x?b:(0,a.default)(b);;){var A;if(x){if(E>=b.length)break;A=b[E++]}else{if(E=b.next(),E.done)break;A=E.value}var C=A;if(C.node.argument){var S=C.scope.generateDeclaredUidIdentifier("ret");C.get("argument").replaceWithMultiple([v.assignmentExpression("=",S,C.node.argument),y(S)])}else C.get("argument").replaceWith(y())}}},e.prototype.pushMethod=function(e,t){var r=t?t.scope:this.scope;"method"===e.kind&&this._processMethod(e,r)||this.pushToMap(e,!1,null,r)},e.prototype._processMethod=function(){return!1},e.prototype.pushConstructor=function(e,t,r){this.bareSupers=e.bareSupers,this.superReturns=e.returns,r.scope.hasOwnBinding(this.classRef.name)&&r.scope.rename(this.classRef.name);var n=this.constructor;this.userConstructorPath=r,this.userConstructor=t,this.hasConstructor=!0,v.inheritsComments(n,t),n._ignoreUserWhitespace=!0,n.params=t.params,v.inherits(n.body,t.body),n.body.directives=t.body.directives,this._pushConstructor()},e.prototype._pushConstructor=function(){this.pushedConstructor||(this.pushedConstructor=!0,(this.hasInstanceDescriptors||this.hasStaticDescriptors)&&this.pushDescriptors(),this.body.push(this.constructor),this.pushInherits())},e.prototype.pushInherits=function(){this.isDerived&&!this.pushedInherits&&(this.pushedInherits=!0,this.body.unshift(v.expressionStatement(v.callExpression(this.file.addHelper("inherits"),[this.classRef,this.superName]))))},e}();r.default=C,t.exports=r.default},{"babel-helper-define-map":96,"babel-helper-optimise-call-expression":99,"babel-helper-replace-supers":100,"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/classCallCheck":127,"babel-template":132,"babel-traverse":136,"babel-types":169}],112:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){function t(e){var t=e.node,r=e.scope,n=[],i=t.right;if(!a.isIdentifier(i)||!r.hasBinding(i.name)){var s=r.generateUidIdentifier("arr");n.push(a.variableDeclaration("var",[a.variableDeclarator(s,i)])),i=s}var u=r.generateUidIdentifier("i"),l=o({BODY:t.body,KEY:u,ARR:i});a.inherits(l,t),a.ensureBlock(l);var c=a.memberExpression(i,u,!0),p=t.left;return a.isVariableDeclaration(p)?(p.declarations[0].init=c,l.body.body.unshift(p)):l.body.body.unshift(a.expressionStatement(a.assignmentExpression("=",p,c))),e.parentPath.isLabeledStatement()&&(l=a.labeledStatement(e.parentPath.node.label,l)),n.push(l),n}function r(e,t){var r=e.node,n=e.scope,s=e.parent,o=r.left,l=void 0,c=void 0;if(a.isIdentifier(o)||a.isPattern(o)||a.isMemberExpression(o))c=o;else{if(!a.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));c=n.generateUidIdentifier("ref"),l=a.variableDeclaration(o.kind,[a.variableDeclarator(o.declarations[0].id,c)])}var p=n.generateUidIdentifier("iterator"),h=n.generateUidIdentifier("isArray"),f=u({LOOP_OBJECT:p,IS_ARRAY:h,OBJECT:r.right,INDEX:n.generateUidIdentifier("i"),ID:c});l||f.body.body.shift();var d=a.isLabeledStatement(s),m=void 0;return d&&(m=a.labeledStatement(s.label,f)),{replaceParent:d,declar:l,node:m||f,loop:f}}function n(e,t){var r=e.node,n=e.scope,s=e.parent,o=r.left,u=void 0,c=n.generateUidIdentifier("step"),p=a.memberExpression(c,a.identifier("value"));if(a.isIdentifier(o)||a.isPattern(o)||a.isMemberExpression(o))u=a.expressionStatement(a.assignmentExpression("=",o,p));else{if(!a.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));u=a.variableDeclaration(o.kind,[a.variableDeclarator(o.declarations[0].id,p)])}var h=n.generateUidIdentifier("iterator"),f=l({ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:h,STEP_KEY:c,OBJECT:r.right,BODY:null}),d=a.isLabeledStatement(s),m=f[3].block.body,y=m[0];return d&&(m[0]=a.labeledStatement(s.label,y)),{replaceParent:d,declar:u,loop:y,node:f}}var i=e.messages,s=e.template,a=e.types,o=s("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "),u=s("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "),l=s("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");return{visitor:{ForOfStatement:function(e,i){if(e.get("right").isArrayExpression())return e.parentPath.isLabeledStatement()?e.parentPath.replaceWithMultiple(t(e)):e.replaceWithMultiple(t(e));var s=n;i.opts.loose&&(s=r);var o=e.node,u=s(e,i),l=u.declar,c=u.loop,p=c.body;e.ensureBlock(),l&&p.body.push(l),p.body=p.body.concat(o.body.body),a.inherits(c,o),a.inherits(c.body,o.body),u.replaceParent?(e.parentPath.replaceWithMultiple(u.node),e.remove()):e.replaceWithMultiple(u.node)}}}},t.exports=r.default},{}],113:[function(e,t,r){t.exports={default:e("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":188}],114:[function(e,t,r){t.exports={default:e("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":189}],115:[function(e,t,r){t.exports={default:e("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":190}],116:[function(e,t,r){t.exports={default:e("core-js/library/fn/number/max-safe-integer"),__esModule:!0}},{"core-js/library/fn/number/max-safe-integer":191}],117:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":192}],118:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":193}],119:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/get-own-property-symbols"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-symbols":194}],120:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":195}],121:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/set-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/set-prototype-of":196}],122:[function(e,t,r){t.exports={default:e("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":198}],123:[function(e,t,r){t.exports={default:e("core-js/library/fn/symbol/for"),__esModule:!0}},{"core-js/library/fn/symbol/for":197}],124:[function(e,t,r){t.exports={default:e("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":199}],125:[function(e,t,r){t.exports={default:e("core-js/library/fn/weak-map"),__esModule:!0}},{"core-js/library/fn/weak-map":200}],126:[function(e,t,r){t.exports={default:e("core-js/library/fn/weak-set"),__esModule:!0}},{"core-js/library/fn/weak-set":201}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},{}],128:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("../core-js/object/set-prototype-of"),s=n(i),a=e("../core-js/object/create"),o=n(a),u=e("../helpers/typeof"),l=n(u);r.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,l.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.default?(0,s.default)(e,t):e.__proto__=t)}},{"../core-js/object/create":118,"../core-js/object/set-prototype-of":121,"../helpers/typeof":131}],129:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},{}],130:[function(e,t,r){"use strict";r.__esModule=!0;var n=e("../helpers/typeof"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);r.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},{"../helpers/typeof":131}],131:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("../core-js/symbol/iterator"),s=n(i),a=e("../core-js/symbol"),o=n(a),u="function"==typeof o.default&&"symbol"==typeof s.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};r.default="function"==typeof o.default&&"symbol"===u(s.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":u(e)}},{"../core-js/symbol":122,"../core-js/symbol/iterator":124}],132:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){e=(0,l.default)(e);var r=e,n=r.program;return t.length&&(0,m.default)(e,A,null,t),n.body.length>1?n.body:n.body[0]}r.__esModule=!0;var a=e("babel-runtime/core-js/symbol"),o=i(a);r.default=function(e,t){var r=void 0;try{throw new Error}catch(e){e.stack&&(r=e.stack.split("\n").slice(1).join("\n"))}t=(0,p.default)({allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveComments:!1},t);var n=function(){var i=void 0;try{i=g.parse(e,t),i=m.default.removeProperties(i,{preserveComments:t.preserveComments}),m.default.cheap(i,function(e){e[x]=!0})}catch(e){throw e.stack=e.stack+"from\n"+r,e}return n=function(){return i},i};return function(){for(var e=arguments.length,t=Array(e),r=0;r=n.length)break;o=n[s++]}else{if(s=n.next(),s.done)break;o=s.value}if(e[o])return!0}return!1},e.prototype.create=function(e,t,r,n){return c.default.get({parentPath:this.parentPath,parent:e,container:t,key:r,listKey:n})},e.prototype.maybeQueue=function(e,t){if(this.trap)throw new Error("Infinite cycle detected");this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))},e.prototype.visitMultiple=function(e,t,r){if(0===e.length)return!1;for(var n=[],i=0;i=n.length)break;o=n[s++]}else{if(s=n.next(),s.done)break;o=s.value}var u=o;if(u.resync(),0!==u.contexts.length&&u.contexts[u.contexts.length-1]===this||u.pushContext(this),null!==u.key&&(f&&e.length>=1e4&&(this.trap=!0),!(t.indexOf(u.node)>=0))){if(t.push(u.node),u.visit()){r=!0;break}if(this.priorityQueue.length&&(r=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=e,r))break}}for(var l=e,c=Array.isArray(l),p=0,l=c?l:(0,a.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if(p=l.next(),p.done)break;h=p.value}h.popContext()}return this.queue=null,r},e.prototype.visit=function(e,t){var r=e[t];return!!r&&(Array.isArray(r)?this.visitMultiple(r,e,t):this.visitSingle(e,t))},e}();r.default=d,t.exports=r.default}).call(this,e("_process"))},{"./path":143,_process:539,"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/classCallCheck":127,"babel-types":169}],135:[function(e,t,r){"use strict";r.__esModule=!0;var n=e("babel-runtime/helpers/classCallCheck"),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function e(t,r){(0,i.default)(this,e),this.file=t,this.options=r};r.default=s,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":127}],136:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r,n,i){if(e){if(t||(t={}),!t.noScope&&!r&&"Program"!==e.type&&"File"!==e.type)throw new Error(g.get("traverseNeedsParent",e.type));m.explode(t),s.node(e,t,r,n,i)}}function a(e,t){e.node.type===t.type&&(t.has=!0,e.stop())}r.__esModule=!0,r.visitors=r.Hub=r.Scope=r.NodePath=void 0;var o=e("babel-runtime/core-js/get-iterator"),u=i(o),l=e("./path");Object.defineProperty(r,"NodePath",{enumerable:!0,get:function(){return i(l).default}});var c=e("./scope");Object.defineProperty(r,"Scope",{enumerable:!0,get:function(){return i(c).default}});var p=e("./hub");Object.defineProperty(r,"Hub",{enumerable:!0,get:function(){return i(p).default}}),r.default=s;var h=e("./context"),f=i(h),d=e("./visitors"),m=n(d),y=e("babel-messages"),g=n(y),b=e("lodash/includes"),v=i(b),x=e("babel-types"),E=n(x),A=e("./cache"),D=n(A);r.visitors=m,s.visitors=m,s.verify=m.verify,s.explode=m.explode,s.NodePath=e("./path"),s.Scope=e("./scope"),s.Hub=e("./hub"),s.cheap=function(e,t){return E.traverseFast(e,t)},s.node=function(e,t,r,n,i,s){var a=E.VISITOR_KEYS[e.type];if(a)for(var o=new f.default(r,t,n,i),l=a,c=Array.isArray(l),p=0,l=c?l:(0,u.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if(p=l.next(),p.done)break;h=p.value}var d=h;if((!s||!s[d])&&o.visit(e,d))return}},s.clearNode=function(e,t){E.removeProperties(e,t),D.path.delete(e)},s.removeProperties=function(e,t){return E.traverseFast(e,s.clearNode,t),e},s.hasType=function(e,t,r,n){if((0,v.default)(n,e.type))return!1;if(e.type===r)return!0;var i={has:!1,type:r};return s(e,{blacklist:n,enter:a},t,i),i.has},s.clearCache=function(){D.clear()},s.clearCache.clearPath=D.clearPath,s.clearCache.clearScope=D.clearScope,s.copyCache=function(e,t){D.path.has(e)&&D.path.set(t,D.path.get(e))}},{"./cache":133,"./context":134,"./hub":135,"./path":143,"./scope":155,"./visitors":157,"babel-messages":103,"babel-runtime/core-js/get-iterator":113,"babel-types":169,"lodash/includes":496}],137:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){for(var t=this;t=t.parentPath;)if(e(t))return t;return null}function s(e){var t=this;do{if(e(t))return t}while(t=t.parentPath);return null}function a(){return this.findParent(function(e){return e.isFunction()||e.isProgram()})}function o(){var e=this;do{if(Array.isArray(e.container))return e}while(e=e.parentPath)}function u(e){return this.getDeepestCommonAncestorFrom(e,function(e,t,r){for(var n=void 0,i=b.VISITOR_KEYS[e.type],s=r,a=Array.isArray(s),o=0,s=a?s:(0,y.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u,c=l[t+1];if(n)if(c.listKey&&n.listKey===c.listKey&&c.keyh&&(n=c)}else n=c}return n})}function l(e,t){var r=this;if(!e.length)return this;if(1===e.length)return e[0];var n=1/0,i=void 0,s=void 0,a=e.map(function(e){var t=[];do{t.unshift(e)}while((e=e.parentPath)&&e!==r);return t.length=c.length)break;f=c[h++]}else{if(h=c.next(),h.done)break;f=h.value}var d=f;if(d[u]!==l)break e}i=u,s=l}if(s)return t?t(s,i,a):s;throw new Error("Couldn't find intersection")}function c(){var e=this,t=[];do{t.push(e)}while(e=e.parentPath);return t}function p(e){return e.isDescendant(this)}function h(e){return!!this.findParent(function(t){return t===e})}function f(){for(var e=this;e;){for(var t=arguments,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(e.node.type===s)return!0}e=e.parentPath}return!1}function d(e){var t=this.isFunction()?this:this.findParent(function(e){return e.isFunction()});if(t){if(t.isFunctionExpression()||t.isFunctionDeclaration()){var r=t.node.shadow;if(r&&(!e||!1!==r[e]))return t}else if(t.isArrowFunctionExpression())return t;return null}}r.__esModule=!0;var m=e("babel-runtime/core-js/get-iterator"),y=n(m);r.findParent=i,r.find=s,r.getFunctionParent=a,r.getStatementParent=o,r.getEarliestCommonAncestorFrom=u,r.getDeepestCommonAncestorFrom=l,r.getAncestry=c,r.isAncestor=p,r.isDescendant=h,r.inType=f,r.inShadow=d;var g=e("babel-types"),b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(g),v=e("./index");n(v)},{"./index":143,"babel-runtime/core-js/get-iterator":113,"babel-types":169}],138:[function(e,t,r){"use strict";function n(){if("string"!=typeof this.key){var e=this.node;if(e){var t=e.trailingComments,r=e.leadingComments;if(t||r){var n=this.getSibling(this.key-1),i=this.getSibling(this.key+1);n.node||(n=i),i.node||(i=n),n.addComments("trailing",r),i.addComments("leading",t)}}}}function i(e,t,r){this.addComments(e,[{type:r?"CommentLine":"CommentBlock",value:t}])}function s(e,t){if(t){var r=this.node;if(r){var n=e+"Comments";r[n]?r[n]=r[n].concat(t):r[n]=t}}}r.__esModule=!0,r.shareCommentsWithSiblings=n,r.addComment=i,r.addComments=s},{}],139:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this.opts;return this.debug(function(){return e}),!(!this.node||!this._call(t[e]))||!!this.node&&this._call(t[this.node.type]&&t[this.node.type][e])}function s(e){if(!e)return!1;for(var t=e,r=Array.isArray(t),n=0,t=r?t:(0,S.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;if(s){var a=this.node;if(!a)return!0;if(s.call(this.state,this,this.state))throw new Error("Unexpected return value from visitor method "+s);if(this.node!==a)return!0;if(this.shouldStop||this.shouldSkip||this.removed)return!0}}return!1}function a(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1}function o(){return!!this.node&&(!this.isBlacklisted()&&((!this.opts.shouldSkip||!this.opts.shouldSkip(this))&&(this.call("enter")||this.shouldSkip?(this.debug(function(){return"Skip..."}),this.shouldStop):(this.debug(function(){return"Recursing into..."}),w.default.node(this.node,this.opts,this.scope,this.state,this,this.skipKeys),this.call("exit"),this.shouldStop))))}function u(){this.shouldSkip=!0}function l(e){this.skipKeys[e]=!0}function c(){this.shouldStop=!0,this.shouldSkip=!0}function p(){if(!this.opts||!this.opts.noScope){var e=this.context&&this.context.scope;if(!e)for(var t=this.parentPath;t&&!e;){if(t.opts&&t.opts.noScope)return;e=t.scope,t=t.parentPath}this.scope=this.getScope(e),this.scope&&this.scope.init()}}function h(e){return this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.skipKeys={},e&&(this.context=e,this.state=e.state,this.opts=e.opts),this.setScope(),this}function f(){this.removed||(this._resyncParent(),this._resyncList(),this._resyncKey())}function d(){this.parentPath&&(this.parent=this.parentPath.node)}function m(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:this;if(!e.removed)for(var t=this.contexts,r=t,n=Array.isArray(r),i=0,r=n?r:(0,S.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;a.maybeQueue(e)}}function D(){for(var e=this,t=this.contexts;!t.length;)e=e.parentPath,t=e.contexts;return t}r.__esModule=!0;var C=e("babel-runtime/core-js/get-iterator"),S=n(C);r.call=i,r._call=s,r.isBlacklisted=a,r.visit=o,r.skip=u,r.skipKey=l,r.stop=c,r.setScope=p,r.setContext=h,r.resync=f,r._resyncParent=d,r._resyncKey=m,r._resyncList=y,r._resyncRemoved=g,r.popContext=b,r.pushContext=v,r.setup=x,r.setKey=E,r.requeue=A,r._getQueueContexts=D;var _=e("../index"),w=n(_)},{"../index":136,"babel-runtime/core-js/get-iterator":113}],140:[function(e,t,r){"use strict";function n(){var e=this.node,t=void 0;if(this.isMemberExpression())t=e.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");t=e.key}return e.computed||o.isIdentifier(t)&&(t=o.stringLiteral(t.name)),t}function i(){return o.ensureBlock(this.node)}function s(){if(this.isArrowFunctionExpression()){this.ensureBlock();var e=this.node;e.expression=!1,e.type="FunctionExpression",e.shadow=e.shadow||!0}}r.__esModule=!0,r.toComputedKey=n,r.ensureBlock=i,r.arrowFunctionToShadowed=s;var a=e("babel-types"),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a)},{"babel-types":169}],141:[function(e,t,r){(function(t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this.evaluate();if(e.confident)return!!e.value}function s(){function e(e){i&&(s=e,i=!1)}function r(t){var r=t.node;if(a.has(r)){var s=a.get(r);return s.resolved?s.value:void e(t)}var o={resolved:!1};a.set(r,o);var u=n(t);return i&&(o.resolved=!0,o.value=u),u}function n(n){if(i){var s=n.node;if(n.isSequenceExpression()){var a=n.get("expressions");return r(a[a.length-1])}if(n.isStringLiteral()||n.isNumericLiteral()||n.isBooleanLiteral())return s.value;if(n.isNullLiteral())return null;if(n.isTemplateLiteral()){for(var u="",c=0,p=n.get("expressions"),d=s.quasis,m=Array.isArray(d),y=0,d=m?d:(0,l.default)(d);;){var g;if(m){if(y>=d.length)break;g=d[y++]}else{if(y=d.next(),y.done)break;g=y.value}var b=g;if(!i)break;u+=b.value.cooked;var v=p[c++];v&&(u+=String(r(v)))}if(!i)return;return u}if(n.isConditionalExpression()){var x=r(n.get("test"));if(!i)return;return r(x?n.get("consequent"):n.get("alternate"))}if(n.isExpressionWrapper())return r(n.get("expression"));if(n.isMemberExpression()&&!n.parentPath.isCallExpression({callee:s})){var E=n.get("property"),A=n.get("object");if(A.isLiteral()&&E.isIdentifier()){var D=A.node.value,C=void 0===D?"undefined":(0,o.default)(D);if("number"===C||"string"===C)return D[E.node.name]}}if(n.isReferencedIdentifier()){var S=n.scope.getBinding(s.name);if(S&&S.constantViolations.length>0)return e(S.path);if(S&&n.node.start=P.length)break;j=P[O++]}else{if(O=P.next(),O.done)break;j=O.value}var N=j;if(N=N.evaluate(),!N.confident)return e(N);F.push(N.value)}return F}if(n.isObjectExpression()){for(var I={},L=n.get("properties"),M=L,R=Array.isArray(M),U=0,M=R?M:(0,l.default)(M);;){var V;if(R){if(U>=M.length)break;V=M[U++]}else{if(U=M.next(),U.done)break;V=U.value}var q=V;if(q.isObjectMethod()||q.isSpreadProperty())return e(q);var G=q.get("key"),X=G;if(q.node.computed){if(X=X.evaluate(),!X.confident)return e(G);X=X.value}else X=X.isIdentifier()?X.node.name:X.node.value;var J=q.get("value"),W=J.evaluate();if(!W.confident)return e(J);W=W.value,I[X]=W}return I}if(n.isLogicalExpression()){var K=i,z=r(n.get("left")),Y=i;i=K;var H=r(n.get("right")),$=i;switch(i=Y&&$,s.operator){case"||":if(z&&Y)return i=!0,z;if(!i)return;return z||H;case"&&":if((!z&&Y||!H&&$)&&(i=!0),!i)return;return z&&H}}if(n.isBinaryExpression()){var Q=r(n.get("left"));if(!i)return;var Z=r(n.get("right"));if(!i)return;switch(s.operator){case"-":return Q-Z;case"+":return Q+Z;case"/":return Q/Z;case"*":return Q*Z;case"%":return Q%Z;case"**":return Math.pow(Q,Z);case"<":return Q":return Q>Z;case"<=":return Q<=Z;case">=":return Q>=Z;case"==":return Q==Z;case"!=":return Q!=Z;case"===":return Q===Z;case"!==":return Q!==Z;case"|":return Q|Z;case"&":return Q&Z;case"^":return Q^Z;case"<<":return Q<>":return Q>>Z;case">>>":return Q>>>Z}}if(n.isCallExpression()){var ee=n.get("callee"),te=void 0,re=void 0;if(ee.isIdentifier()&&!n.scope.getBinding(ee.node.name,!0)&&h.indexOf(ee.node.name)>=0&&(re=t[s.callee.name]),ee.isMemberExpression()){var ne=ee.get("object"),ie=ee.get("property");if(ne.isIdentifier()&&ie.isIdentifier()&&h.indexOf(ne.node.name)>=0&&f.indexOf(ie.node.name)<0&&(te=t[ne.node.name],re=te[ie.node.name]),ne.isLiteral()&&ie.isIdentifier()){var se=(0,o.default)(ne.node.value);"string"!==se&&"number"!==se||(te=ne.node.value,re=te[ie.node.name])}}if(re){var ae=n.get("arguments").map(r);if(!i)return;return re.apply(te,ae)}}e(n)}}var i=!0,s=void 0,a=new p.default,u=r(this);return i||(u=void 0),{confident:i,deopt:s,value:u}}r.__esModule=!0;var a=e("babel-runtime/helpers/typeof"),o=n(a),u=e("babel-runtime/core-js/get-iterator"),l=n(u),c=e("babel-runtime/core-js/map"),p=n(c);r.evaluateTruthy=i,r.evaluate=s;var h=["String","Number","Math"],f=["random"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/map":115,"babel-runtime/helpers/typeof":131}],142:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement())break;e=e.parentPath}while(e);if(e&&(e.isProgram()||e.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return e}function s(){return"left"===this.key?this.getSibling("right"):"right"===this.key?this.getSibling("left"):void 0}function a(){var e=[],t=function(t){t&&(e=e.concat(t.getCompletionRecords()))};if(this.isIfStatement())t(this.get("consequent")),t(this.get("alternate"));else if(this.isDoExpression()||this.isFor()||this.isWhile())t(this.get("body"));else if(this.isProgram()||this.isBlockStatement())t(this.get("body").pop());else{if(this.isFunction())return this.get("body").getCompletionRecords();this.isTryStatement()?(t(this.get("block")),t(this.get("handler")),t(this.get("finalizer"))):e.push(this)}return e}function o(e){return C.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e})}function u(){return this.getSibling(this.key-1)}function l(){return this.getSibling(this.key+1)}function c(){for(var e=this.key,t=this.getSibling(++e),r=[];t.node;)r.push(t),t=this.getSibling(++e);return r}function p(){for(var e=this.key,t=this.getSibling(--e),r=[];t.node;)r.push(t),t=this.getSibling(--e);return r}function h(e,t){!0===t&&(t=this.context);var r=e.split(".");return 1===r.length?this._getKey(e,t):this._getPattern(r,t)}function f(e,t){var r=this,n=this.node,i=n[e];return Array.isArray(i)?i.map(function(s,a){return C.default.get({listKey:e,parentPath:r,parent:n,container:i,key:a}).setContext(t)}):C.default.get({parentPath:this,parent:n,container:n,key:e}).setContext(t)}function d(e,t){for(var r=this,n=e,i=Array.isArray(n),s=0,n=i?n:(0,A.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;r="."===o?r.parentPath:Array.isArray(r)?r[o]:r.get(o,t)}return r}function m(e){return _.getBindingIdentifiers(this.node,e)}function y(e){return _.getOuterBindingIdentifiers(this.node,e)}function g(){for(var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this,n=[].concat(r),i=(0,x.default)(null);n.length;){var s=n.shift();if(s&&s.node){var a=_.getBindingIdentifiers.keys[s.node.type];if(s.isIdentifier())if(e){var o=i[s.node.name]=i[s.node.name]||[];o.push(s)}else i[s.node.name]=s;else if(s.isExportDeclaration()){var u=s.get("declaration");u.isDeclaration()&&n.push(u)}else{if(t){if(s.isFunctionDeclaration()){n.push(s.get("id"));continue}if(s.isFunctionExpression())continue}if(a)for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:SyntaxError;return this.hub.file.buildCodeFrameError(this.node,e,t)},e.prototype.traverse=function(e,t){(0,y.default)(this.node,e,this.scope,t,this)},e.prototype.mark=function(e,t){this.hub.file.metadata.marked.push({type:e,message:t,loc:this.node.loc})},e.prototype.set=function(e,t){A.validate(this.node,e,t),this.node[e]=t},e.prototype.getPathLocation=function(){var e=[],t=this;do{var r=t.key;t.inList&&(r=t.listKey+"["+r+"]"),e.unshift(r)}while(t=t.parentPath);return e.join(".")},e.prototype.debug=function(e){C.enabled&&C(this.getPathLocation()+" "+this.type+": "+e())},e}();r.default=S,(0,b.default)(S.prototype,e("./ancestry")),(0,b.default)(S.prototype,e("./inference")),(0,b.default)(S.prototype,e("./replacement")),(0,b.default)(S.prototype,e("./evaluation")),(0,b.default)(S.prototype,e("./conversion")),(0,b.default)(S.prototype,e("./introspection")),(0,b.default)(S.prototype,e("./context")),(0,b.default)(S.prototype,e("./removal")),(0,b.default)(S.prototype,e("./modification")),(0,b.default)(S.prototype,e("./family")),(0,b.default)(S.prototype,e("./comments"));for(var _=A.TYPES,w=Array.isArray(_),k=0,_=w?_:(0,a.default)(_);;){var F;if("break"===function(){if(w){if(k>=_.length)return"break";F=_[k++]}else{if(k=_.next(),k.done)return"break";F=k.value}var e=F,t="is"+e;S.prototype[t]=function(e){return A[t](this.node,e)},S.prototype["assert"+e]=function(r){if(!this[t](r))throw new TypeError("Expected node path of type "+e)}}())break}for(var T in c){(function(e){if("_"===e[0])return"continue";A.TYPES.indexOf(e)<0&&A.TYPES.push(e);var t=c[e];S.prototype["is"+e]=function(e){return t.checkPath(this,e)}})(T)}t.exports=r.default},{"../cache":133,"../index":136,"../scope":155,"./ancestry":137,"./comments":138,"./context":139,"./conversion":140,"./evaluation":141,"./family":142,"./inference":144,"./introspection":147,"./lib/virtual-types":150,"./modification":151,"./removal":152,"./replacement":153,"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/classCallCheck":127,"babel-types":169,debug:296,invariant:307,"lodash/assign":477}],144:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(){if(this.typeAnnotation)return this.typeAnnotation;var e=this._getTypeAnnotation()||y.anyTypeAnnotation();return y.isTypeAnnotation(e)&&(e=e.typeAnnotation),this.typeAnnotation=e}function s(){var e=this.node;{if(e){if(e.typeAnnotation)return e.typeAnnotation;var t=d[e.type];return t?t.call(this,e):(t=d[this.parentPath.type],t&&t.validParent?this.parentPath.getTypeAnnotation():void 0)}if("init"===this.key&&this.parentPath.isVariableDeclarator()){var r=this.parentPath.parentPath,n=r.parentPath;return"left"===r.key&&n.isForInStatement()?y.stringTypeAnnotation():"left"===r.key&&n.isForOfStatement()?y.anyTypeAnnotation():y.voidTypeAnnotation()}}}function a(e,t){return o(e,this.getTypeAnnotation(),t)}function o(e,t,r){if("string"===e)return y.isStringTypeAnnotation(t);if("number"===e)return y.isNumberTypeAnnotation(t);if("boolean"===e)return y.isBooleanTypeAnnotation(t);if("any"===e)return y.isAnyTypeAnnotation(t);if("mixed"===e)return y.isMixedTypeAnnotation(t);if("empty"===e)return y.isEmptyTypeAnnotation(t);if("void"===e)return y.isVoidTypeAnnotation(t);if(r)return!1;throw new Error("Unknown base type "+e)}function u(e){var t=this.getTypeAnnotation();if(y.isAnyTypeAnnotation(t))return!0;if(y.isUnionTypeAnnotation(t)){for(var r=t.types,n=Array.isArray(r),i=0,r=n?r:(0,h.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if(y.isAnyTypeAnnotation(a)||o(e,a,!0))return!0}return!1}return o(e,t,!0)}function l(e){var t=this.getTypeAnnotation();if(e=e.getTypeAnnotation(),!y.isAnyTypeAnnotation(t)&&y.isFlowBaseAnnotation(t))return e.type===t.type}function c(e){var t=this.getTypeAnnotation();return y.isGenericTypeAnnotation(t)&&y.isIdentifier(t.id,{name:e})}r.__esModule=!0;var p=e("babel-runtime/core-js/get-iterator"),h=function(e){return e&&e.__esModule?e:{default:e}}(p);r.getTypeAnnotation=i,r._getTypeAnnotation=s,r.isBaseType=a,r.couldBeBaseType=u,r.baseTypeStrictlyMatches=l,r.isGenericType=c;var f=e("./inferers"),d=n(f),m=e("babel-types"),y=n(m)},{"./inferers":146,"babel-runtime/core-js/get-iterator":113,"babel-types":169}],145:[function(e,t,r){"use strict";function n(e,t){var r=e.scope.getBinding(t),n=[];e.typeAnnotation=p.unionTypeAnnotation(n);var s=[],a=i(r,e,s),u=o(e,t);if(u&&function(){var e=i(r,u.ifStatement);a=a.filter(function(t){return e.indexOf(t)<0}),n.push(u.typeAnnotation)}(),a.length){a=a.concat(s);for(var c=a,h=Array.isArray(c),f=0,c=h?c:(0,l.default)(c);;){var d;if(h){if(f>=c.length)break;d=c[f++]}else{if(f=c.next(),f.done)break;d=f.value}var m=d;n.push(m.getTypeAnnotation())}}if(n.length)return p.createUnionTypeAnnotation(n)}function i(e,t,r){var n=e.constantViolations.slice();return n.unshift(e.path),n.filter(function(e){e=e.resolve();var n=e._guessExecutionStatusRelativeTo(t);return r&&"function"===n&&r.push(e),"before"===n})}function s(e,t){var r=t.node.operator,n=t.get("right").resolve(),i=t.get("left").resolve(),s=void 0;if(i.isIdentifier({name:e})?s=n:n.isIdentifier({name:e})&&(s=i),s)return"==="===r?s.getTypeAnnotation():p.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(r)>=0?p.numberTypeAnnotation():void 0;if("==="===r){var a=void 0,o=void 0;if(i.isUnaryExpression({operator:"typeof"})?(a=i,o=n):n.isUnaryExpression({operator:"typeof"})&&(a=n,o=i),(o||a)&&(o=o.resolve(),o.isLiteral())){if("string"==typeof o.node.value&&a.get("argument").isIdentifier({name:e}))return p.createTypeAnnotationBasedOnTypeof(o.node.value)}}}function a(e){for(var t=void 0;t=e.parentPath;){if(t.isIfStatement()||t.isConditionalExpression())return"test"===e.key?void 0:t;e=t}}function o(e,t){var r=a(e);if(r){var n=r.get("test"),i=[n],u=[];do{var l=i.shift().resolve();if(l.isLogicalExpression()&&(i.push(l.get("left")),i.push(l.get("right"))),l.isBinaryExpression()){var c=s(t,l);c&&u.push(c)}}while(i.length);return u.length?{typeAnnotation:p.createUnionTypeAnnotation(u),ifStatement:r}:o(r,t)}}r.__esModule=!0;var u=e("babel-runtime/core-js/get-iterator"),l=function(e){return e&&e.__esModule?e:{default:e}}(u);r.default=function(e){if(this.isReferenced()){var t=this.scope.getBinding(e.name);return t?t.identifier.typeAnnotation?t.identifier.typeAnnotation:n(this,e.name):"undefined"===e.name?p.voidTypeAnnotation():"NaN"===e.name||"Infinity"===e.name?p.numberTypeAnnotation():void e.name}};var c=e("babel-types"),p=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(c);t.exports=r.default},{"babel-runtime/core-js/get-iterator":113,"babel-types":169}],146:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(){return this.get("id").isIdentifier()?this.get("init").getTypeAnnotation():void 0}function s(e){return e.typeAnnotation}function a(e){if(this.get("callee").isIdentifier())return F.genericTypeAnnotation(e.callee)}function o(){return F.stringTypeAnnotation()}function u(e){var t=e.operator;return"void"===t?F.voidTypeAnnotation():F.NUMBER_UNARY_OPERATORS.indexOf(t)>=0?F.numberTypeAnnotation():F.STRING_UNARY_OPERATORS.indexOf(t)>=0?F.stringTypeAnnotation():F.BOOLEAN_UNARY_OPERATORS.indexOf(t)>=0?F.booleanTypeAnnotation():void 0}function l(e){var t=e.operator;if(F.NUMBER_BINARY_OPERATORS.indexOf(t)>=0)return F.numberTypeAnnotation();if(F.BOOLEAN_BINARY_OPERATORS.indexOf(t)>=0)return F.booleanTypeAnnotation();if("+"===t){var r=this.get("right"),n=this.get("left");return n.isBaseType("number")&&r.isBaseType("number")?F.numberTypeAnnotation():n.isBaseType("string")||r.isBaseType("string")?F.stringTypeAnnotation():F.unionTypeAnnotation([F.stringTypeAnnotation(),F.numberTypeAnnotation()])}}function c(){return F.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])}function p(){return F.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])}function h(){return this.get("expressions").pop().getTypeAnnotation()}function f(){return this.get("right").getTypeAnnotation()}function d(e){var t=e.operator;if("++"===t||"--"===t)return F.numberTypeAnnotation()}function m(){return F.stringTypeAnnotation()}function y(){return F.numberTypeAnnotation()}function g(){return F.booleanTypeAnnotation()}function b(){return F.nullLiteralTypeAnnotation()}function v(){return F.genericTypeAnnotation(F.identifier("RegExp"))}function x(){return F.genericTypeAnnotation(F.identifier("Object"))}function E(){return F.genericTypeAnnotation(F.identifier("Array"))}function A(){return E()}function D(){return F.genericTypeAnnotation(F.identifier("Function"))}function C(){return _(this.get("callee"))}function S(){return _(this.get("tag"))}function _(e){if(e=e.resolve(),e.isFunction()){if(e.is("async"))return e.is("generator")?F.genericTypeAnnotation(F.identifier("AsyncIterator")):F.genericTypeAnnotation(F.identifier("Promise"));if(e.node.returnType)return e.node.returnType}}r.__esModule=!0,r.ClassDeclaration=r.ClassExpression=r.FunctionDeclaration=r.ArrowFunctionExpression=r.FunctionExpression=r.Identifier=void 0;var w=e("./inferer-reference");Object.defineProperty(r,"Identifier",{enumerable:!0,get:function(){return n(w).default}}),r.VariableDeclarator=i, +r.TypeCastExpression=s,r.NewExpression=a,r.TemplateLiteral=o,r.UnaryExpression=u,r.BinaryExpression=l,r.LogicalExpression=c,r.ConditionalExpression=p,r.SequenceExpression=h,r.AssignmentExpression=f,r.UpdateExpression=d,r.StringLiteral=m,r.NumericLiteral=y,r.BooleanLiteral=g,r.NullLiteral=b,r.RegExpLiteral=v,r.ObjectExpression=x,r.ArrayExpression=E,r.RestElement=A,r.CallExpression=C,r.TaggedTemplateExpression=S;var k=e("babel-types"),F=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(k);s.validParent=!0,A.validParent=!0,r.FunctionExpression=D,r.ArrowFunctionExpression=D,r.FunctionDeclaration=D,r.ClassExpression=D,r.ClassDeclaration=D},{"./inferer-reference":145,"babel-types":169}],147:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){function r(e){var t=n[s];return"*"===t||e===t}if(!this.isMemberExpression())return!1;for(var n=e.split("."),i=[this.node],s=0;i.length;){var a=i.shift();if(t&&s===n.length)return!0;if(k.isIdentifier(a)){if(!r(a.name))return!1}else if(k.isLiteral(a)){if(!r(a.value))return!1}else{if(k.isMemberExpression(a)){if(a.computed&&!k.isLiteral(a.property))return!1;i.unshift(a.property),i.unshift(a.object);continue}if(!k.isThisExpression(a))return!1;if(!r("this"))return!1}if(++s>n.length)return!1}return s===n.length}function s(e){var t=this.node&&this.node[e];return t&&Array.isArray(t)?!!t.length:!!t}function a(){return this.scope.isStatic(this.node)}function o(e){return!this.has(e)}function u(e,t){return this.node[e]===t}function l(e){return k.isType(this.type,e)}function c(){return("init"===this.key||"left"===this.key)&&this.parentPath.isFor()}function p(e){return!("body"!==this.key||!this.parentPath.isArrowFunctionExpression())&&(this.isExpression()?k.isBlockStatement(e):!!this.isBlockStatement()&&k.isExpression(e))}function h(e){var t=this,r=!0;do{var n=t.container;if(t.isFunction()&&!r)return!!e;if(r=!1,Array.isArray(n)&&t.key!==n.length-1)return!1}while((t=t.parentPath)&&!t.isProgram());return!0}function f(){return!this.parentPath.isLabeledStatement()&&!k.isBlockStatement(this.container)&&(0,_.default)(k.STATEMENT_OR_BLOCK_KEYS,this.key)}function d(e,t){if(!this.isReferencedIdentifier())return!1;var r=this.scope.getBinding(this.node.name);if(!r||"module"!==r.kind)return!1;var n=r.path,i=n.parentPath;return!!i.isImportDeclaration()&&(i.node.source.value===e&&(!t||(!(!n.isImportDefaultSpecifier()||"default"!==t)||(!(!n.isImportNamespaceSpecifier()||"*"!==t)||!(!n.isImportSpecifier()||n.node.imported.name!==t)))))}function m(){var e=this.node;return e.end?this.hub.file.code.slice(e.start,e.end):""}function y(e){return"after"!==this._guessExecutionStatusRelativeTo(e)}function g(e){var t=e.scope.getFunctionParent(),r=this.scope.getFunctionParent();if(t.node!==r.node){var n=this._guessExecutionStatusRelativeToDifferentFunctions(t);if(n)return n;e=t.path}var i=e.getAncestry();if(i.indexOf(this)>=0)return"after";var s=this.getAncestry(),a=void 0,o=void 0,u=void 0;for(u=0;u=0){a=l;break}}if(!a)return"before";var c=i[o-1],p=s[u-1];return c&&p?c.listKey&&c.container===p.container?c.key>p.key?"before":"after":k.VISITOR_KEYS[c.type].indexOf(c.key)>k.VISITOR_KEYS[p.type].indexOf(p.key)?"before":"after":"before"}function b(e){var t=e.path;if(t.isFunctionDeclaration()){var r=t.scope.getBinding(t.node.id.name);if(!r.references)return"before";for(var n=r.referencePaths,i=n,s=Array.isArray(i),a=0,i=s?i:(0,C.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;if("callee"!==u.key||!u.parentPath.isCallExpression())return}for(var l=void 0,c=n,p=Array.isArray(c),h=0,c=p?c:(0,C.default)(c);;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if(h=c.next(),h.done)break;f=h.value}var d=f;if(!!!d.find(function(e){return e.node===t.node})){var m=this._guessExecutionStatusRelativeTo(d);if(l){if(l!==m)return}else l=m}}return l}}function v(e,t){return this._resolve(e,t)||this}function x(e,t){var r=this;if(!(t&&t.indexOf(this)>=0))if(t=t||[],t.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(e,t)}else if(this.isReferencedIdentifier()){var n=this.scope.getBinding(this.node.name);if(!n)return;if(!n.constant)return;if("module"===n.kind)return;if(n.path!==this){var i=function(){var i=n.path.resolve(e,t);return r.find(function(e){return e.node===i.node})?{v:void 0}:{v:i}}();if("object"===(void 0===i?"undefined":(0,A.default)(i)))return i.v}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(e,t);if(e&&this.isMemberExpression()){var s=this.toComputedKey();if(!k.isLiteral(s))return;var a=s.value,o=this.get("object").resolve(e,t);if(o.isObjectExpression())for(var u=o.get("properties"),l=u,c=Array.isArray(l),p=0,l=c?l:(0,C.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if(p=l.next(),p.done)break;h=p.value}var f=h;if(f.isProperty()){var d=f.get("key"),m=f.isnt("computed")&&d.isIdentifier({name:a});if(m=m||d.isLiteral({value:a}))return f.get("value").resolve(e,t)}}else if(o.isArrayExpression()&&!isNaN(+a)){var y=o.get("elements"),g=y[a];if(g)return g.resolve(e,t)}}}}r.__esModule=!0,r.is=void 0;var E=e("babel-runtime/helpers/typeof"),A=n(E),D=e("babel-runtime/core-js/get-iterator"),C=n(D);r.matchesPattern=i,r.has=s,r.isStatic=a,r.isnt=o,r.equals=u,r.isNodeType=l,r.canHaveVariableDeclarationOrExpression=c,r.canSwapBetweenExpressionAndStatement=p,r.isCompletionRecord=h,r.isStatementOrBlock=f,r.referencesImport=d,r.getSource=m,r.willIMaybeExecuteBefore=y,r._guessExecutionStatusRelativeTo=g,r._guessExecutionStatusRelativeToDifferentFunctions=b,r.resolve=v,r._resolve=x;var S=e("lodash/includes"),_=n(S),w=e("babel-types"),k=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(w);r.is=s},{"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/typeof":131,"babel-types":169,"lodash/includes":496}],148:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/core-js/get-iterator"),s=n(i),a=e("babel-runtime/helpers/classCallCheck"),o=n(a),u=e("babel-types"),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(u),c={ReferencedIdentifier:function(e,t){if(!e.isJSXIdentifier()||!u.react.isCompatTag(e.node.name)||e.parentPath.isJSXMemberExpression()){if("this"===e.node.name){var r=e.scope;do{if(r.path.isFunction()&&!r.path.isArrowFunctionExpression())break}while(r=r.parent);r&&t.breakOnScopePaths.push(r.path)}var n=e.scope.getBinding(e.node.name);n&&n===t.scope.getBinding(e.node.name)&&(t.bindings[e.node.name]=n)}}},p=function(){function e(t,r){(0,o.default)(this,e),this.breakOnScopePaths=[],this.bindings={},this.scopes=[],this.scope=r,this.path=t,this.attachAfter=!1}return e.prototype.isCompatibleScope=function(e){for(var t in this.bindings){var r=this.bindings[t];if(!e.bindingIdentifierEquals(t,r.identifier))return!1}return!0},e.prototype.getCompatibleScopes=function(){var e=this.path.scope;do{if(!this.isCompatibleScope(e))break;if(this.scopes.push(e),this.breakOnScopePaths.indexOf(e.path)>=0)break}while(e=e.parent)},e.prototype.getAttachmentPath=function(){var e=this._getAttachmentPath();if(e){var t=e.scope;if(t.path===e&&(t=e.scope.parent),t.path.isProgram()||t.path.isFunction())for(var r in this.bindings)if(t.hasOwnBinding(r)){var n=this.bindings[r];if("param"!==n.kind&&this.getAttachmentParentForPath(n.path).key>e.key){this.attachAfter=!0,e=n.path;for(var i=n.constantViolations,a=Array.isArray(i),o=0,i=a?i:(0,s.default)(i);;){var u;if(a){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;this.getAttachmentParentForPath(l).key>e.key&&(e=l)}}}return e}},e.prototype._getAttachmentPath=function(){var e=this.scopes,t=e.pop();if(t){if(t.path.isFunction()){if(this.hasOwnParamBindings(t)){if(this.scope===t)return;return t.path.get("body").get("body")[0]}return this.getNextScopeAttachmentParent()}return t.path.isProgram()?this.getNextScopeAttachmentParent():void 0}},e.prototype.getNextScopeAttachmentParent=function(){var e=this.scopes.pop();if(e)return this.getAttachmentParentForPath(e.path)},e.prototype.getAttachmentParentForPath=function(e){do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement()||e.isVariableDeclarator()&&null!==e.parentPath.node&&e.parentPath.node.declarations.length>1)return e}while(e=e.parentPath)},e.prototype.hasOwnParamBindings=function(e){for(var t in this.bindings)if(e.hasOwnBinding(t)){var r=this.bindings[t];if("param"===r.kind&&r.constant)return!0}return!1},e.prototype.run=function(){var e=this.path.node;if(!e._hoisted){e._hoisted=!0,this.path.traverse(c,this),this.getCompatibleScopes();var t=this.getAttachmentPath();if(t&&t.getFunctionParent()!==this.path.getFunctionParent()){var r=t.scope.generateUidIdentifier("ref"),n=l.variableDeclarator(r,this.path.node);t[this.attachAfter?"insertAfter":"insertBefore"]([t.isVariableDeclarator()?n:l.variableDeclaration("var",[n])]);var i=this.path.parentPath;i.isJSXElement()&&this.path.container===i.node.children&&(r=l.JSXExpressionContainer(r)),this.path.replaceWith(r)}}},e}();r.default=p,t.exports=r.default},{"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/classCallCheck":127,"babel-types":169}],149:[function(e,t,r){"use strict";r.__esModule=!0;r.hooks=[function(e,t){if("test"===e.key&&(t.isWhile()||t.isSwitchCase())||"declaration"===e.key&&t.isExportDeclaration()||"body"===e.key&&t.isLabeledStatement()||"declarations"===e.listKey&&t.isVariableDeclaration()&&1===t.node.declarations.length||"expression"===e.key&&t.isExpressionStatement())return t.remove(),!0},function(e,t){if(t.isSequenceExpression()&&1===t.node.expressions.length)return t.replaceWith(t.node.expressions[0]),!0},function(e,t){if(t.isBinary())return"left"===e.key?t.replaceWith(t.node.right):t.replaceWith(t.node.left),!0},function(e,t){if(t.isIfStatement()&&("consequent"===e.key||"alternate"===e.key)||"body"===e.key&&(t.isLoop()||t.isArrowFunctionExpression()))return e.replaceWith({type:"BlockStatement",body:[]}),!0}]},{}],150:[function(e,t,r){"use strict";r.__esModule=!0,r.Flow=r.Pure=r.Generated=r.User=r.Var=r.BlockScoped=r.Referenced=r.Scope=r.Expression=r.Statement=r.BindingIdentifier=r.ReferencedMemberExpression=r.ReferencedIdentifier=void 0;var n=e("babel-types"),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);r.ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function(e,t){var r=e.node,s=e.parent;if(!i.isIdentifier(r,t)&&!i.isJSXMemberExpression(s,t)){if(!i.isJSXIdentifier(r,t))return!1;if(n.react.isCompatTag(r.name))return!1}return i.isReferenced(r,s)}},r.ReferencedMemberExpression={types:["MemberExpression"],checkPath:function(e){var t=e.node,r=e.parent;return i.isMemberExpression(t)&&i.isReferenced(t,r)}},r.BindingIdentifier={types:["Identifier"],checkPath:function(e){var t=e.node,r=e.parent;return i.isIdentifier(t)&&i.isBinding(t,r)}},r.Statement={types:["Statement"],checkPath:function(e){var t=e.node,r=e.parent;if(i.isStatement(t)){if(i.isVariableDeclaration(t)){if(i.isForXStatement(r,{left:t}))return!1;if(i.isForStatement(r,{init:t}))return!1}return!0}return!1}},r.Expression={types:["Expression"],checkPath:function(e){return e.isIdentifier()?e.isReferencedIdentifier():i.isExpression(e.node)}},r.Scope={types:["Scopable"],checkPath:function(e){return i.isScope(e.node,e.parent)}},r.Referenced={checkPath:function(e){return i.isReferenced(e.node,e.parent)}},r.BlockScoped={checkPath:function(e){return i.isBlockScoped(e.node)}},r.Var={types:["VariableDeclaration"],checkPath:function(e){return i.isVar(e.node)}},r.User={checkPath:function(e){return e.node&&!!e.node.loc}},r.Generated={checkPath:function(e){return!e.isUser()}},r.Pure={checkPath:function(e,t){return e.scope.isPure(e.node,t)}},r.Flow={types:["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],checkPath:function(e){var t=e.node;return!!i.isFlow(t)||(i.isImportDeclaration(t)?"type"===t.importKind||"typeof"===t.importKind:i.isExportDeclaration(t)?"type"===t.exportKind:!!i.isImportSpecifier(t)&&("type"===t.importKind||"typeof"===t.importKind))}}},{"babel-types":169}],151:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertBefore(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key)this.node&&e.push(this.node),this.replaceExpressionWithStatements(e);else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertBefore(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.push(this.node),this._replaceWith(S.blockStatement(e))}return[this]}function s(e,t){this.updateSiblingKeys(e,t.length);for(var r=[],n=0;n=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var h=p;h.setScope(),h.debug(function(){return"Inserted."});for(var f=o,d=Array.isArray(f),m=0,f=d?f:(0,b.default)(f);;){var y;if(d){if(m>=f.length)break;y=f[m++]}else{if(m=f.next(),m.done)break;y=m.value}y.maybeQueue(h,!0)}}return r}function a(e){return this._containerInsert(this.key,e)}function o(e){return this._containerInsert(this.key+1,e)}function u(e){var t=e[e.length-1];(S.isIdentifier(t)||S.isExpressionStatement(t)&&S.isIdentifier(t.expression))&&!this.isCompletionRecord()&&e.pop()}function l(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertAfter(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key){if(this.node){var t=this.scope.generateDeclaredUidIdentifier();e.unshift(S.expressionStatement(S.assignmentExpression("=",t,this.node))),e.push(S.expressionStatement(t))}this.replaceExpressionWithStatements(e)}else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertAfter(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.unshift(this.node),this._replaceWith(S.blockStatement(e))}return[this]}function c(e,t){if(this.parent)for(var r=v.path.get(this.parent),n=0;n=e&&(i.key+=t)}}function p(e){if(!e)return[];e.constructor!==Array&&(e=[e]);for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:this.scope;return new E.default(this,e).run()}r.__esModule=!0;var m=e("babel-runtime/helpers/typeof"),y=n(m),g=e("babel-runtime/core-js/get-iterator"),b=n(g);r.insertBefore=i,r._containerInsert=s,r._containerInsertBefore=a,r._containerInsertAfter=o,r._maybePopFromStatements=u,r.insertAfter=l,r.updateSiblingKeys=c,r._verifyNodeList=p,r.unshiftContainer=h,r.pushContainer=f,r.hoist=d;var v=e("../cache"),x=e("./lib/hoister"),E=n(x),A=e("./index"),D=n(A),C=e("babel-types"),S=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(C)},{"../cache":133,"./index":143,"./lib/hoister":148,"babel-runtime/core-js/get-iterator":113,"babel-runtime/helpers/typeof":131,"babel-types":169}],152:[function(e,t,r){"use strict";function n(){if(this._assertUnremoved(),this.resync(),this._callRemovalHooks())return void this._markRemoved();this.shareCommentsWithSiblings(),this._remove(),this._markRemoved()}function i(){for(var e=c.hooks,t=Array.isArray(e),r=0,e=t?e:(0,l.default)(e);;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if(r=e.next(),r.done)break;n=r.value}if(n(this,this.parentPath))return!0}}function s(){Array.isArray(this.container)?(this.container.splice(this.key,1),this.updateSiblingKeys(this.key,-1)):this._replaceWith(null)}function a(){this.shouldSkip=!0,this.removed=!0,this.node=null}function o(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")}r.__esModule=!0;var u=e("babel-runtime/core-js/get-iterator"),l=function(e){return e&&e.__esModule?e:{default:e}}(u);r.remove=n,r._callRemovalHooks=i,r._remove=s,r._markRemoved=a,r._assertUnremoved=o;var c=e("./lib/removal-hooks")},{"./lib/removal-hooks":149,"babel-runtime/core-js/get-iterator":113}],153:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){this.resync(),e=this._verifyNodeList(e),x.inheritLeadingComments(e[0],this.node),x.inheritTrailingComments(e[e.length-1],this.node),this.node=this.container[this.key]=null,this.insertAfter(e),this.node?this.requeue():this.remove()}function s(e){this.resync();try{e="("+e+")",e=(0,b.parse)(e)}catch(r){var t=r.loc;throw t&&(r.message+=" - make sure this is an expression.",r.message+="\n"+(0,f.default)(e,t.line,t.column+1)),r}return e=e.program.body[0].expression,m.default.removeProperties(e),this.replaceWith(e)}function a(e){if(this.resync(),this.removed)throw new Error("You can't replace this node, we've already removed it");if(e instanceof g.default&&(e=e.node),!e)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(this.node!==e){if(this.isProgram()&&!x.isProgram(e))throw new Error("You can only replace a Program root node with another Program node");if(Array.isArray(e))throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");if("string"==typeof e)throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");if(this.isNodeType("Statement")&&x.isExpression(e)&&(this.canHaveVariableDeclarationOrExpression()||this.canSwapBetweenExpressionAndStatement(e)||(e=x.expressionStatement(e))),this.isNodeType("Expression")&&x.isStatement(e)&&!this.canHaveVariableDeclarationOrExpression()&&!this.canSwapBetweenExpressionAndStatement(e))return this.replaceExpressionWithStatements([e]);var t=this.node;t&&(x.inheritsComments(e,t),x.removeComments(t)),this._replaceWith(e),this.type=e.type,this.setScope(),this.requeue()}}function o(e){if(!this.container)throw new ReferenceError("Container is falsy");this.inList?x.validate(this.parent,this.key,[e]):x.validate(this.parent,this.key,e),this.debug(function(){return"Replace with "+(e&&e.type)}),this.node=this.container[this.key]=e}function u(e){this.resync();var t=x.toSequenceExpression(e,this.scope);if(x.isSequenceExpression(t)){var r=t.expressions;r.length>=2&&this.parentPath.isExpressionStatement()&&this._maybePopFromStatements(r),1===r.length?this.replaceWith(r[0]):this.replaceWith(t)}else{if(!t){var n=x.functionExpression(null,[],x.blockStatement(e));n.shadow=!0,this.replaceWith(x.callExpression(n,[])),this.traverse(E);for(var i=this.get("callee").getCompletionRecords(),s=i,a=Array.isArray(s),o=0,s=a?s:(0,p.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;if(l.isExpressionStatement()){var c=l.findParent(function(e){return e.isLoop()});if(c){var h=c.getData("expressionReplacementReturnUid");if(h)h=x.identifier(h.name);else{var f=this.get("callee");h=f.scope.generateDeclaredUidIdentifier("ret"),f.get("body").pushContainer("body",x.returnStatement(h)),c.setData("expressionReplacementReturnUid",h)}l.get("expression").replaceWith(x.assignmentExpression("=",h,l.node.expression))}else l.replaceWith(x.returnStatement(l.node.expression))}}return this.node}this.replaceWith(t)}}function l(e){return this.resync(),Array.isArray(e)?Array.isArray(this.container)?(e=this._verifyNodeList(e),this._containerInsertAfter(e),this.remove()):this.replaceWithMultiple(e):this.replaceWith(e)}r.__esModule=!0;var c=e("babel-runtime/core-js/get-iterator"),p=n(c);r.replaceWithMultiple=i,r.replaceWithSourceString=s,r.replaceWith=a,r._replaceWith=o,r.replaceExpressionWithStatements=u,r.replaceInline=l;var h=e("babel-code-frame"),f=n(h),d=e("../index"),m=n(d),y=e("./index"),g=n(y),b=e("babylon"),v=e("babel-types"),x=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(v),E={Function:function(e){e.skip()},VariableDeclaration:function(e){if("var"===e.node.kind){var t=e.getBindingIdentifiers();for(var r in t)e.scope.push({id:t[r]});for(var n=[],i=e.node.declarations,s=Array.isArray(i),a=0,i=s?i:(0,p.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;u.init&&n.push(x.expressionStatement(x.assignmentExpression("=",u.id,u.init)))}e.replaceWithMultiple(n)}}}},{"../index":136,"./index":143,"babel-code-frame":23,"babel-runtime/core-js/get-iterator":113,"babel-types":169,babylon:177}],154:[function(e,t,r){"use strict";r.__esModule=!0;var n=e("babel-runtime/helpers/classCallCheck"),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function(){function e(t){var r=t.existing,n=t.identifier,s=t.scope,a=t.path,o=t.kind;(0,i.default)(this,e),this.identifier=n,this.scope=s,this.path=a,this.kind=o,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.clearValue(),r&&(this.constantViolations=[].concat(r.path,r.constantViolations,this.constantViolations))}return e.prototype.deoptValue=function(){this.clearValue(),this.hasDeoptedValue=!0},e.prototype.setValue=function(e){this.hasDeoptedValue||(this.hasValue=!0,this.value=e)},e.prototype.clearValue=function(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null},e.prototype.reassign=function(e){this.constant=!1,-1===this.constantViolations.indexOf(e)&&this.constantViolations.push(e)},e.prototype.reference=function(e){-1===this.referencePaths.indexOf(e)&&(this.referenced=!0,this.references++,this.referencePaths.push(e))},e.prototype.dereference=function(){this.references--,this.referenced=!!this.references},e}();r.default=s,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":127}],155:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r){for(var n=N.scope.get(e.node)||[],i=n,s=Array.isArray(i),a=0,i=s?i:(0,y.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;if(u.parent===t&&u.path===e)return u}n.push(r),N.scope.has(e.node)||N.scope.set(e.node,n)}function a(e,t){if(j.isModuleDeclaration(e))if(e.source)a(e.source,t);else if(e.specifiers&&e.specifiers.length)for(var r=e.specifiers,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var o=s;a(o,t)}else e.declaration&&a(e.declaration,t);else if(j.isModuleSpecifier(e))a(e.local,t);else if(j.isMemberExpression(e))a(e.object,t),a(e.property,t);else if(j.isIdentifier(e))t.push(e.name);else if(j.isLiteral(e))t.push(e.value);else if(j.isCallExpression(e))a(e.callee,t);else if(j.isObjectExpression(e)||j.isObjectPattern(e))for(var u=e.properties,l=Array.isArray(u),c=0,u=l?u:(0,y.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var h=p;a(h.key||h.argument,t)}}r.__esModule=!0;var o=e("babel-runtime/core-js/object/keys"),u=i(o),l=e("babel-runtime/core-js/object/create"),c=i(l),p=e("babel-runtime/core-js/map"),h=i(p),f=e("babel-runtime/helpers/classCallCheck"),d=i(f),m=e("babel-runtime/core-js/get-iterator"),y=i(m),g=e("lodash/includes"),b=i(g),v=e("lodash/repeat"),x=i(v),E=e("./lib/renamer"),A=i(E),D=e("../index"),C=i(D),S=e("lodash/defaults"),_=i(S),w=e("babel-messages"),k=n(w),F=e("./binding"),T=i(F),P=e("globals"),B=i(P),O=e("babel-types"),j=n(O),N=e("../cache"),I=0,L={For:function(e){for(var t=j.FOR_INIT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,a=e.get(s);a.isVar()&&e.scope.getFunctionParent().registerBinding("var",a)}},Declaration:function(e){e.isBlockScoped()||e.isExportDeclaration()&&e.get("declaration").isDeclaration()||e.scope.getFunctionParent().registerDeclaration(e)},ReferencedIdentifier:function(e,t){t.references.push(e)},ForXStatement:function(e,t){var r=e.get("left");(r.isPattern()||r.isIdentifier())&&t.constantViolations.push(r)},ExportDeclaration:{exit:function(e){var t=e.node,r=e.scope,n=t.declaration;if(j.isClassDeclaration(n)||j.isFunctionDeclaration(n)){var i=n.id;if(!i)return;var s=r.getBinding(i.name);s&&s.reference(e)}else if(j.isVariableDeclaration(n))for(var a=n.declarations,o=Array.isArray(a),u=0,a=o?a:(0,y.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l,p=j.getBindingIdentifiers(c);for(var h in p){var f=r.getBinding(h);f&&f.reference(e)}}}},LabeledStatement:function(e){e.scope.getProgramParent().addGlobal(e.node),e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression:function(e,t){t.assignments.push(e)},UpdateExpression:function(e,t){t.constantViolations.push(e.get("argument"))},UnaryExpression:function(e,t){"delete"===e.node.operator&&t.constantViolations.push(e.get("argument"))},BlockScoped:function(e){var t=e.scope;t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e)},ClassDeclaration:function(e){var t=e.node.id;if(t){var r=t.name;e.scope.bindings[r]=e.scope.getBinding(r)}},Block:function(e){for(var t=e.get("body"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;a.isFunctionDeclaration()&&e.scope.getBlockParent().registerDeclaration(a)}}},M=0,R=function(){function e(t,r){if((0,d.default)(this,e),r&&r.block===t.node)return r;var n=s(t,r,this);if(n)return n;this.uid=M++,this.parent=r,this.hub=t.hub,this.parentBlock=t.parent,this.block=t.node,this.path=t,this.labels=new h.default}return e.prototype.traverse=function(e,t,r){(0,C.default)(e,t,this,r,this.path)},e.prototype.generateDeclaredUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp",t=this.generateUidIdentifier(e);return this.push({id:t}),t},e.prototype.generateUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";return j.identifier(this.generateUid(e))},e.prototype.generateUid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";e=j.toIdentifier(e).replace(/^_+/,"").replace(/[0-9]+$/g,"");var t=void 0,r=0;do{t=this._generateUid(e,r),r++}while(this.hasLabel(t)||this.hasBinding(t)||this.hasGlobal(t)||this.hasReference(t));var n=this.getProgramParent();return n.references[t]=!0,n.uids[t]=!0,t},e.prototype._generateUid=function(e,t){var r=e;return t>1&&(r+=t),"_"+r},e.prototype.generateUidIdentifierBasedOnNode=function(e,t){var r=e;j.isAssignmentExpression(e)?r=e.left:j.isVariableDeclarator(e)?r=e.id:(j.isObjectProperty(r)||j.isObjectMethod(r))&&(r=r.key);var n=[];a(r,n);var i=n.join("$");return i=i.replace(/^_/,"")||t||"ref",this.generateUidIdentifier(i.slice(0,20))},e.prototype.isStatic=function(e){if(j.isThisExpression(e)||j.isSuper(e))return!0;if(j.isIdentifier(e)){var t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1},e.prototype.maybeGenerateMemoised=function(e,t){if(this.isStatic(e))return null;var r=this.generateUidIdentifierBasedOnNode(e);return t||this.push({id:r}),r},e.prototype.checkBlockScopedCollisions=function(e,t,r,n){if("param"!==t&&("hoisted"!==t||"let"!==e.kind)){if("let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind||"param"===e.kind&&("let"===t||"const"===t))throw this.hub.file.buildCodeFrameError(n,k.get("scopeDuplicateDeclaration",r),TypeError)}},e.prototype.rename=function(e,t,r){var n=this.getBinding(e);if(n)return t=t||this.generateUidIdentifier(e).name,new A.default(n,e,t).rename(r)},e.prototype._renameFromMap=function(e,t,r,n){e[t]&&(e[r]=n,e[t]=null)},e.prototype.dump=function(){var e=(0,x.default)("-",60);console.log(e);var t=this;do{console.log("#",t.block.type);for(var r in t.bindings){var n=t.bindings[r];console.log(" -",r,{constant:n.constant,references:n.references,violations:n.constantViolations.length,kind:n.kind})}}while(t=t.parent);console.log(e)},e.prototype.toArray=function(e,t){var r=this.hub.file;if(j.isIdentifier(e)){var n=this.getBinding(e.name);if(n&&n.constant&&n.path.isGenericType("Array"))return e}if(j.isArrayExpression(e))return e;if(j.isIdentifier(e,{name:"arguments"}))return j.callExpression(j.memberExpression(j.memberExpression(j.memberExpression(j.identifier("Array"),j.identifier("prototype")),j.identifier("slice")),j.identifier("call")),[e]);var i="toArray",s=[e];return!0===t?i="toConsumableArray":t&&(s.push(j.numericLiteral(t)),i="slicedToArray"),j.callExpression(r.addHelper(i),s)},e.prototype.hasLabel=function(e){return!!this.getLabel(e)},e.prototype.getLabel=function(e){return this.labels.get(e)},e.prototype.registerLabel=function(e){this.labels.set(e.node.label.name,e)},e.prototype.registerDeclaration=function(e){if(e.isLabeledStatement())this.registerLabel(e);else if(e.isFunctionDeclaration())this.registerBinding("hoisted",e.get("id"),e);else if(e.isVariableDeclaration())for(var t=e.get("declarations"),r=t,n=Array.isArray(r),i=0,r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;this.registerBinding(e.node.kind,a)}else if(e.isClassDeclaration())this.registerBinding("let",e);else if(e.isImportDeclaration())for(var o=e.get("specifiers"),u=o,l=Array.isArray(u),c=0,u=l?u:(0,y.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var h=p;this.registerBinding("module",h)}else if(e.isExportDeclaration()){var f=e.get("declaration");(f.isClassDeclaration()||f.isFunctionDeclaration()||f.isVariableDeclaration())&&this.registerDeclaration(f)}else this.registerBinding("unknown",e)},e.prototype.buildUndefinedNode=function(){return this.hasBinding("undefined")?j.unaryExpression("void",j.numericLiteral(0),!0):j.identifier("undefined")},e.prototype.registerConstantViolation=function(e){var t=e.getBindingIdentifiers();for(var r in t){var n=this.getBinding(r) +;n&&n.reassign(e)}},e.prototype.registerBinding=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!e)throw new ReferenceError("no `kind`");if(t.isVariableDeclaration())for(var n=t.get("declarations"),i=n,s=Array.isArray(i),a=0,i=s?i:(0,y.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o;this.registerBinding(e,u)}else{var l=this.getProgramParent(),c=t.getBindingIdentifiers(!0);for(var p in c)for(var h=c[p],f=Array.isArray(h),d=0,h=f?h:(0,y.default)(h);;){var m;if(f){if(d>=h.length)break;m=h[d++]}else{if(d=h.next(),d.done)break;m=d.value}var g=m,b=this.getOwnBinding(p);if(b){if(b.identifier===g)continue;this.checkBlockScopedCollisions(b,e,p,g)}b&&b.path.isFlow()&&(b=null),l.references[p]=!0,this.bindings[p]=new T.default({identifier:g,existing:b,scope:this,path:r,kind:e})}}},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasUid=function(e){var t=this;do{if(t.uids[e])return!0}while(t=t.parent);return!1},e.prototype.hasGlobal=function(e){var t=this;do{if(t.globals[e])return!0}while(t=t.parent);return!1},e.prototype.hasReference=function(e){var t=this;do{if(t.references[e])return!0}while(t=t.parent);return!1},e.prototype.isPure=function(e,t){if(j.isIdentifier(e)){var r=this.getBinding(e.name);return!!r&&(!t||r.constant)}if(j.isClass(e))return!(e.superClass&&!this.isPure(e.superClass,t))&&this.isPure(e.body,t);if(j.isClassBody(e)){for(var n=e.body,i=Array.isArray(n),s=0,n=i?n:(0,y.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if(!this.isPure(o,t))return!1}return!0}if(j.isBinary(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(j.isArrayExpression(e)){for(var u=e.elements,l=Array.isArray(u),c=0,u=l?u:(0,y.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var h=p;if(!this.isPure(h,t))return!1}return!0}if(j.isObjectExpression(e)){for(var f=e.properties,d=Array.isArray(f),m=0,f=d?f:(0,y.default)(f);;){var g;if(d){if(m>=f.length)break;g=f[m++]}else{if(m=f.next(),m.done)break;g=m.value}var b=g;if(!this.isPure(b,t))return!1}return!0}return j.isClassMethod(e)?!(e.computed&&!this.isPure(e.key,t))&&("get"!==e.kind&&"set"!==e.kind):j.isClassProperty(e)||j.isObjectProperty(e)?!(e.computed&&!this.isPure(e.key,t))&&this.isPure(e.value,t):j.isUnaryExpression(e)?this.isPure(e.argument,t):j.isPureish(e)},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e){var t=this;do{var r=t.data[e];if(null!=r)return r}while(t=t.parent)},e.prototype.removeData=function(e){var t=this;do{null!=t.data[e]&&(t.data[e]=null)}while(t=t.parent)},e.prototype.init=function(){this.references||this.crawl()},e.prototype.crawl=function(){I++,this._crawl(),I--},e.prototype._crawl=function(){var e=this.path;if(this.references=(0,c.default)(null),this.bindings=(0,c.default)(null),this.globals=(0,c.default)(null),this.uids=(0,c.default)(null),this.data=(0,c.default)(null),e.isLoop())for(var t=j.FOR_INIT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,a=e.get(s);a.isBlockScoped()&&this.registerBinding(a.node.kind,a)}if(e.isFunctionExpression()&&e.has("id")&&(e.get("id").node[j.NOT_LOCAL_BINDING]||this.registerBinding("local",e.get("id"),e)),e.isClassExpression()&&e.has("id")&&(e.get("id").node[j.NOT_LOCAL_BINDING]||this.registerBinding("local",e)),e.isFunction())for(var o=e.get("params"),u=o,l=Array.isArray(u),p=0,u=l?u:(0,y.default)(u);;){var h;if(l){if(p>=u.length)break;h=u[p++]}else{if(p=u.next(),p.done)break;h=p.value}var f=h;this.registerBinding("param",f)}if(e.isCatchClause()&&this.registerBinding("let",e),!this.getProgramParent().crawling){var d={references:[],constantViolations:[],assignments:[]};this.crawling=!0,e.traverse(L,d),this.crawling=!1;for(var m=d.assignments,g=Array.isArray(m),b=0,m=g?m:(0,y.default)(m);;){var v;if(g){if(b>=m.length)break;v=m[b++]}else{if(b=m.next(),b.done)break;v=b.value}var x=v,E=x.getBindingIdentifiers(),A=void 0;for(var D in E)x.scope.getBinding(D)||(A=A||x.scope.getProgramParent(),A.addGlobal(E[D]));x.scope.registerConstantViolation(x)}for(var C=d.references,S=Array.isArray(C),_=0,C=S?C:(0,y.default)(C);;){var w;if(S){if(_>=C.length)break;w=C[_++]}else{if(_=C.next(),_.done)break;w=_.value}var k=w,F=k.scope.getBinding(k.node.name);F?F.reference(k):k.scope.getProgramParent().addGlobal(k.node)}for(var T=d.constantViolations,P=Array.isArray(T),B=0,T=P?T:(0,y.default)(T);;){var O;if(P){if(B>=T.length)break;O=T[B++]}else{if(B=T.next(),B.done)break;O=B.value}var N=O;N.scope.registerConstantViolation(N)}}},e.prototype.push=function(e){var t=this.path;t.isBlockStatement()||t.isProgram()||(t=this.getBlockParent().path),t.isSwitchStatement()&&(t=this.getFunctionParent().path),(t.isLoop()||t.isCatchClause()||t.isFunction())&&(j.ensureBlock(t.node),t=t.get("body"));var r=e.unique,n=e.kind||"var",i=null==e._blockHoist?2:e._blockHoist,s="declaration:"+n+":"+i,a=!r&&t.getData(s);if(!a){var o=j.variableDeclaration(n,[]);o._generated=!0,o._blockHoist=i;a=t.unshiftContainer("body",[o])[0],r||t.setData(s,a)}var u=j.variableDeclarator(e.id,e.init);a.node.declarations.push(u),this.registerBinding(n,a.get("declarations").pop())},e.prototype.getProgramParent=function(){var e=this;do{if(e.path.isProgram())return e}while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getFunctionParent=function(){var e=this;do{if(e.path.isFunctionParent())return e}while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getBlockParent=function(){var e=this;do{if(e.path.isBlockParent())return e}while(e=e.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")},e.prototype.getAllBindings=function(){var e=(0,c.default)(null),t=this;do{(0,_.default)(e,t.bindings),t=t.parent}while(t);return e},e.prototype.getAllBindingsOfKind=function(){for(var e=(0,c.default)(null),t=arguments,r=Array.isArray(t),n=0,t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i,a=this;do{for(var o in a.bindings){var u=a.bindings[o];u.kind===s&&(e[o]=u)}a=a.parent}while(a)}return e},e.prototype.bindingIdentifierEquals=function(e,t){return this.getBindingIdentifier(e)===t},e.prototype.warnOnFlowBinding=function(e){return 0===I&&e&&e.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 "),e},e.prototype.getBinding=function(e){var t=this;do{var r=t.getOwnBinding(e);if(r)return this.warnOnFlowBinding(r)}while(t=t.parent)},e.prototype.getOwnBinding=function(e){return this.warnOnFlowBinding(this.bindings[e])},e.prototype.getBindingIdentifier=function(e){var t=this.getBinding(e);return t&&t.identifier},e.prototype.getOwnBindingIdentifier=function(e){var t=this.bindings[e];return t&&t.identifier},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBinding(e)},e.prototype.hasBinding=function(t,r){return!!t&&(!!this.hasOwnBinding(t)||(!!this.parentHasBinding(t,r)||(!!this.hasUid(t)||(!(r||!(0,b.default)(e.globals,t))||!(r||!(0,b.default)(e.contextVariables,t))))))},e.prototype.parentHasBinding=function(e,t){return this.parent&&this.parent.hasBinding(e,t)},e.prototype.moveBindingTo=function(e,t){var r=this.getBinding(e);r&&(r.scope.removeOwnBinding(e),r.scope=t,t.bindings[e]=r)},e.prototype.removeOwnBinding=function(e){delete this.bindings[e]},e.prototype.removeBinding=function(e){var t=this.getBinding(e);t&&t.scope.removeOwnBinding(e);var r=this;do{r.uids[e]&&(r.uids[e]=!1)}while(r=r.parent)},e}();R.globals=(0,u.default)(B.default.builtin),R.contextVariables=["arguments","undefined","Infinity","NaN"],r.default=R,t.exports=r.default},{"../cache":133,"../index":136,"./binding":154,"./lib/renamer":156,"babel-messages":103,"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/map":115,"babel-runtime/core-js/object/create":118,"babel-runtime/core-js/object/keys":120,"babel-runtime/helpers/classCallCheck":127,"babel-types":169,globals:303,"lodash/defaults":484,"lodash/includes":496,"lodash/repeat":519}],156:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),s=n(i),a=e("../binding"),o=(n(a),e("babel-types")),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(o),l={ReferencedIdentifier:function(e,t){var r=e.node;r.name===t.oldName&&(r.name=t.newName)},Scope:function(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||e.skip()},"AssignmentExpression|Declaration":function(e,t){var r=e.getOuterBindingIdentifiers();for(var n in r)n===t.oldName&&(r[n].name=t.newName)}},c=function(){function e(t,r,n){(0,s.default)(this,e),this.newName=n,this.oldName=r,this.binding=t}return e.prototype.maybeConvertFromExportDeclaration=function(e){var t=e.parentPath.isExportDeclaration()&&e.parentPath;if(t){var r=t.isExportDefaultDeclaration();r&&(e.isFunctionDeclaration()||e.isClassDeclaration())&&!e.node.id&&(e.node.id=e.scope.generateUidIdentifier("default"));var n=e.getOuterBindingIdentifiers(),i=[];for(var s in n){var a=s===this.oldName?this.newName:s,o=r?"default":s;i.push(u.exportSpecifier(u.identifier(a),u.identifier(o)))}if(i.length){var l=u.exportNamedDeclaration(null,i);e.isFunctionDeclaration()&&(l._blockHoist=3),t.insertAfter(l),t.replaceWith(e.node)}}},e.prototype.maybeConvertFromClassFunctionDeclaration=function(e){},e.prototype.maybeConvertFromClassFunctionExpression=function(e){},e.prototype.rename=function(e){var t=this.binding,r=this.oldName,n=this.newName,i=t.scope,s=t.path,a=s.find(function(e){return e.isDeclaration()||e.isFunctionExpression()});a&&this.maybeConvertFromExportDeclaration(a),i.traverse(e||i.block,l,this),e||(i.removeOwnBinding(r),i.bindings[n]=t,this.binding.identifier.name=n),t.type,a&&(this.maybeConvertFromClassFunctionDeclaration(a),this.maybeConvertFromClassFunctionExpression(a))},e}();r.default=c,t.exports=r.default},{"../binding":154,"babel-runtime/helpers/classCallCheck":127,"babel-types":169}],157:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e._exploded)return e;e._exploded=!0;for(var t in e)if(!f(t)){var r=t.split("|");if(1!==r.length){var n=e[t];delete e[t];for(var i=r,s=Array.isArray(i),o=0,i=s?i:(0,x.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;e[l]=n}}}a(e),delete e.__esModule,c(e),p(e);for(var m=(0,b.default)(e),y=Array.isArray(m),g=0,m=y?m:(0,x.default)(m);;){var v;if(y){if(g>=m.length)break;v=m[g++]}else{if(g=m.next(),g.done)break;v=g.value}var E=v;if(!f(E)){var D=A[E];if(D){var C=e[E];for(var S in C)C[S]=h(D,C[S]);if(delete e[E],D.types)for(var w=D.types,F=Array.isArray(w),T=0,w=F?w:(0,x.default)(w);;){var P;if(F){if(T>=w.length)break;P=w[T++]}else{if(T=w.next(),T.done)break;P=T.value}var B=P;e[B]?d(e[B],C):e[B]=C}else d(e,C)}}}for(var O in e)if(!f(O)){var j=e[O],N=_.FLIPPED_ALIAS_KEYS[O],I=_.DEPRECATED_KEYS[O];if(I&&(console.trace("Visitor defined for "+O+" but it has been renamed to "+I),N=[I]),N){delete e[O];for(var L=N,M=Array.isArray(L),R=0,L=M?L:(0,x.default)(L);;){var U;if(M){if(R>=L.length)break;U=L[R++]}else{if(R=L.next(),R.done)break;U=R.value}var V=U,q=e[V];q?d(q,j):e[V]=(0,k.default)(j)}}}for(var G in e)f(G)||p(e[G]);return e}function a(e){if(!e._verified){if("function"==typeof e)throw new Error(C.get("traverseVerifyRootFunction"));for(var t in e)if("enter"!==t&&"exit"!==t||o(t,e[t]),!f(t)){if(_.TYPES.indexOf(t)<0)throw new Error(C.get("traverseVerifyNodeType",t));var r=e[t];if("object"===(void 0===r?"undefined":(0,y.default)(r)))for(var n in r){if("enter"!==n&&"exit"!==n)throw new Error(C.get("traverseVerifyVisitorProperty",t,n));o(t+"."+n,r[n])}}e._verified=!0}}function o(e,t){for(var r=[].concat(t),n=r,i=Array.isArray(n),s=0,n=i?n:(0,x.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if("function"!=typeof o)throw new TypeError("Non-function found defined in "+e+" with type "+(void 0===o?"undefined":(0,y.default)(o)))}}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2],n={},i=0;i","<",">=","<="]),a=r.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],o=r.COMPARISON_BINARY_OPERATORS=[].concat(a,["in","instanceof"]),u=r.BOOLEAN_BINARY_OPERATORS=[].concat(o,s),l=r.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"],c=(r.BINARY_OPERATORS=["+"].concat(l,u),r.BOOLEAN_UNARY_OPERATORS=["delete","!"]),p=r.NUMBER_UNARY_OPERATORS=["+","-","++","--","~"],h=r.STRING_UNARY_OPERATORS=["typeof"];r.UNARY_OPERATORS=["void"].concat(c,p,h),r.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},r.BLOCK_SCOPED_SYMBOL=(0,i.default)("var used to be block scoped"),r.NOT_LOCAL_BINDING=(0,i.default)("should not be considered a local binding")},{"babel-runtime/core-js/symbol/for":123}],159:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key||e.property;return e.computed||C.isIdentifier(t)&&(t=C.stringLiteral(t.name)),t}function s(e,t){function r(e){for(var s=!1,a=[],o=e,u=Array.isArray(o),l=0,o=u?o:(0,b.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var p=c;if(C.isExpression(p))a.push(p);else if(C.isExpressionStatement(p))a.push(p.expression);else{if(C.isVariableDeclaration(p)){if("var"!==p.kind)return i=!0;for(var h=p.declarations,f=Array.isArray(h),d=0,h=f?h:(0,b.default)(h);;){var m;if(f){if(d>=h.length)break;m=h[d++]}else{if(d=h.next(),d.done)break;m=d.value}var y=m,g=C.getBindingIdentifiers(y);for(var v in g)n.push({kind:p.kind,id:g[v]});y.init&&a.push(C.assignmentExpression("=",y.id,y.init))}s=!0;continue}if(C.isIfStatement(p)){var x=p.consequent?r([p.consequent]):t.buildUndefinedNode(),E=p.alternate?r([p.alternate]):t.buildUndefinedNode();if(!x||!E)return i=!0;a.push(C.conditionalExpression(p.test,x,E))}else{if(!C.isBlockStatement(p)){if(C.isEmptyStatement(p)){s=!0;continue}return i=!0}a.push(r(p.body))}}s=!1}return(s||0===a.length)&&a.push(t.buildUndefinedNode()),1===a.length?a[0]:C.sequenceExpression(a)}if(e&&e.length){var n=[],i=!1,s=r(e);if(!i){for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:e.key,r=void 0;return"method"===e.kind?a.increment()+"":(r=C.isIdentifier(t)?t.name:C.isStringLiteral(t)?(0,y.default)(t.value):(0,y.default)(C.removePropertiesDeep(C.cloneDeep(t))),e.computed&&(r="["+r+"]"),e.static&&(r="static:"+r),r)}function o(e){return e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),C.isValidIdentifier(e)||(e="_"+e),e||"_"}function u(e){return e=o(e),"eval"!==e&&"arguments"!==e||(e="_"+e),e}function l(e,t){if(C.isStatement(e))return e;var r=!1,n=void 0;if(C.isClass(e))r=!0,n="ClassDeclaration";else if(C.isFunction(e))r=!0,n="FunctionDeclaration";else if(C.isAssignmentExpression(e))return C.expressionStatement(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=n,e}function c(e){if(C.isExpressionStatement(e)&&(e=e.expression),C.isExpression(e))return e;if(C.isClass(e)?e.type="ClassExpression":C.isFunction(e)&&(e.type="FunctionExpression"),!C.isExpression(e))throw new Error("cannot turn "+e.type+" to an expression");return e}function p(e,t){return C.isBlockStatement(e)?e:(C.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(C.isStatement(e)||(e=C.isFunction(t)?C.returnStatement(e):C.expressionStatement(e)),e=[e]),C.blockStatement(e))}function h(e){if(void 0===e)return C.identifier("undefined");if(!0===e||!1===e)return C.booleanLiteral(e);if(null===e)return C.nullLiteral();if("string"==typeof e)return C.stringLiteral(e);if("number"==typeof e)return C.numericLiteral(e);if((0,A.default)(e)){var t=e.source,r=e.toString().match(/\/([a-z]+|)$/)[1];return C.regExpLiteral(t,r)}if(Array.isArray(e))return C.arrayExpression(e.map(C.valueToNode));if((0,x.default)(e)){var n=[];for(var i in e){var s=void 0;s=C.isValidIdentifier(i)?C.identifier(i):C.stringLiteral(i),n.push(C.objectProperty(s,C.valueToNode(e[i])))}return C.objectExpression(n)}throw new Error("don't know how to turn this value into a node")}r.__esModule=!0;var f=e("babel-runtime/core-js/number/max-safe-integer"),d=n(f),m=e("babel-runtime/core-js/json/stringify"),y=n(m),g=e("babel-runtime/core-js/get-iterator"),b=n(g);r.toComputedKey=i,r.toSequenceExpression=s,r.toKeyAlias=a,r.toIdentifier=o,r.toBindingIdentifierName=u,r.toStatement=l,r.toExpression=c,r.toBlock=p,r.valueToNode=h;var v=e("lodash/isPlainObject"),x=n(v),E=e("lodash/isRegExp"),A=n(E),D=e("./index"),C=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(D);a.uid=0,a.increment=function(){return a.uid>=d.default?a.uid=0:a.uid++}},{"./index":169,"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/json/stringify":114,"babel-runtime/core-js/number/max-safe-integer":116,"lodash/isPlainObject":507,"lodash/isRegExp":508}],160:[function(e,t,r){"use strict";var n=e("../index"),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n),s=e("../constants"),a=e("./index"),o=function(e){return e&&e.__esModule?e:{default:e}}(a);(0,o.default)("ArrayExpression",{fields:{elements:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeOrValueType)("null","Expression","SpreadElement"))),default:[]}},visitor:["elements"],aliases:["Expression"]}),(0,o.default)("AssignmentExpression",{fields:{operator:{validate:(0,a.assertValueType)("string")},left:{validate:(0,a.assertNodeType)("LVal")},right:{validate:(0,a.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),(0,o.default)("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:a.assertOneOf.apply(void 0,s.BINARY_OPERATORS)},left:{validate:(0,a.assertNodeType)("Expression")},right:{validate:(0,a.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),(0,o.default)("Directive",{visitor:["value"],fields:{value:{validate:(0,a.assertNodeType)("DirectiveLiteral")}}}),(0,o.default)("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("string")}}}),(0,o.default)("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Directive"))),default:[]},body:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","Statement"]}),(0,o.default)("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,a.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,o.default)("CallExpression",{visitor:["callee","arguments"],fields:{callee:{validate:(0,a.assertNodeType)("Expression")},arguments:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Expression","SpreadElement")))}},aliases:["Expression"]}),(0,o.default)("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,a.assertNodeType)("Identifier")},body:{validate:(0,a.assertNodeType)("BlockStatement")}},aliases:["Scopable"]}),(0,o.default)("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},consequent:{validate:(0,a.assertNodeType)("Expression")},alternate:{validate:(0,a.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),(0,o.default)("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,a.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,o.default)("DebuggerStatement",{aliases:["Statement"]}),(0,o.default)("DoWhileStatement",{visitor:["test","body"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),(0,o.default)("EmptyStatement",{aliases:["Statement"]}),(0,o.default)("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,a.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),(0,o.default)("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,a.assertNodeType)("Program")}}}),(0,o.default)("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,a.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,a.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,a.assertNodeType)("Expression"),optional:!0},update:{validate:(0,a.assertNodeType)("Expression"),optional:!0},body:{validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","params","body","returnType","typeParameters"],fields:{id:{validate:(0,a.assertNodeType)("Identifier")},params:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("LVal")))},body:{validate:(0,a.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,a.assertValueType)("boolean")},async:{default:!1,validate:(0,a.assertValueType)("boolean")}},aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"]}),(0,o.default)("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{id:{validate:(0,a.assertNodeType)("Identifier"),optional:!0},params:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("LVal")))},body:{validate:(0,a.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,a.assertValueType)("boolean")},async:{default:!1,validate:(0,a.assertValueType)("boolean")}}}),(0,o.default)("Identifier",{builder:["name"],visitor:["typeAnnotation"],aliases:["Expression","LVal"],fields:{name:{validate:function(e,t,r){i.isValidIdentifier(r)}},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator")))}}}),(0,o.default)("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},consequent:{validate:(0,a.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,a.assertNodeType)("Identifier")},body:{validate:(0,a.assertNodeType)("Statement")}}}),(0,o.default)("StringLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,a.assertValueType)("number")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,a.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,o.default)("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Literal"],fields:{pattern:{validate:(0,a.assertValueType)("string")},flags:{validate:(0,a.assertValueType)("string"),default:""}}}),(0,o.default)("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:a.assertOneOf.apply(void 0,s.LOGICAL_OPERATORS)},left:{validate:(0,a.assertNodeType)("Expression")},right:{validate:(0,a.assertNodeType)("Expression")}}}),(0,o.default)("MemberExpression",{builder:["object","property","computed"],visitor:["object","property"],aliases:["Expression","LVal"],fields:{object:{validate:(0,a.assertNodeType)("Expression")},property:{validate:function(e,t,r){var n=e.computed?"Expression":"Identifier";(0,a.assertNodeType)(n)(e,t,r)}},computed:{default:!1}}}),(0,o.default)("NewExpression",{visitor:["callee","arguments"],aliases:["Expression"],fields:{callee:{validate:(0,a.assertNodeType)("Expression")},arguments:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Expression","SpreadElement")))}}}),(0,o.default)("Program",{visitor:["directives","body"],builder:["body","directives"],fields:{directives:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Directive"))),default:[]},body:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","FunctionParent"]}),(0,o.default)("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("ObjectMethod","ObjectProperty","SpreadProperty")))}}}),(0,o.default)("ObjectMethod",{builder:["kind","key","params","body","computed"],fields:{kind:{validate:(0,a.chain)((0,a.assertValueType)("string"),(0,a.assertOneOf)("method","get","set")),default:"method"},computed:{validate:(0,a.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];a.assertNodeType.apply(void 0,n)(e,t,r)}},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator")))},body:{validate:(0,a.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,a.assertValueType)("boolean")},async:{default:!1,validate:(0,a.assertValueType)("boolean")}},visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}),(0,o.default)("ObjectProperty",{builder:["key","value","computed","shorthand","decorators"],fields:{computed:{validate:(0,a.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];a.assertNodeType.apply(void 0,n)(e,t,r)}},value:{validate:(0,a.assertNodeType)("Expression")},shorthand:{validate:(0,a.assertValueType)("boolean"),default:!1},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator"))),optional:!0}},visitor:["key","value","decorators"],aliases:["UserWhitespacable","Property","ObjectMember"]}),(0,o.default)("RestElement",{visitor:["argument","typeAnnotation"],aliases:["LVal"],fields:{argument:{validate:(0,a.assertNodeType)("LVal")},decorators:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Decorator")))}}}),(0,o.default)("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,a.assertNodeType)("Expression"),optional:!0}}}),(0,o.default)("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Expression")))}},aliases:["Expression"]}),(0,o.default)("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,a.assertNodeType)("Expression"),optional:!0},consequent:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("Statement")))}}}),(0,o.default)("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,a.assertNodeType)("Expression")},cases:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("SwitchCase")))}}}),(0,o.default)("ThisExpression",{aliases:["Expression"]}),(0,o.default)("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,a.assertNodeType)("Expression")}}}),(0,o.default)("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{body:{validate:(0,a.assertNodeType)("BlockStatement")},handler:{optional:!0, +handler:(0,a.assertNodeType)("BlockStatement")},finalizer:{optional:!0,validate:(0,a.assertNodeType)("BlockStatement")}}}),(0,o.default)("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,a.assertNodeType)("Expression")},operator:{validate:a.assertOneOf.apply(void 0,s.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),(0,o.default)("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:(0,a.assertNodeType)("Expression")},operator:{validate:a.assertOneOf.apply(void 0,s.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),(0,o.default)("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{kind:{validate:(0,a.chain)((0,a.assertValueType)("string"),(0,a.assertOneOf)("var","let","const"))},declarations:{validate:(0,a.chain)((0,a.assertValueType)("array"),(0,a.assertEach)((0,a.assertNodeType)("VariableDeclarator")))}}}),(0,o.default)("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:(0,a.assertNodeType)("LVal")},init:{optional:!0,validate:(0,a.assertNodeType)("Expression")}}}),(0,o.default)("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("BlockStatement","Statement")}}}),(0,o.default)("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{object:(0,a.assertNodeType)("Expression")},body:{validate:(0,a.assertNodeType)("BlockStatement","Statement")}}})},{"../constants":158,"../index":169,"./index":164}],161:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AssignmentPattern",{visitor:["left","right"],aliases:["Pattern","LVal"],fields:{left:{validate:(0,n.assertNodeType)("Identifier")},right:{validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ArrayPattern",{visitor:["elements","typeAnnotation"],aliases:["Pattern","LVal"],fields:{elements:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Expression")))},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{params:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("LVal")))},body:{validate:(0,n.assertNodeType)("BlockStatement","Expression")},async:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("ClassBody",{visitor:["body"],fields:{body:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ClassMethod","ClassProperty")))}}}),(0,i.default)("ClassDeclaration",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Statement","Declaration","Pureish"],fields:{id:{validate:(0,n.assertNodeType)("Identifier")},body:{validate:(0,n.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ClassExpression",{inherits:"ClassDeclaration",aliases:["Scopable","Class","Expression","Pureish"],fields:{id:{optional:!0,validate:(0,n.assertNodeType)("Identifier")},body:{validate:(0,n.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ExportAllDeclaration",{visitor:["source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{source:{validate:(0,n.assertNodeType)("StringLiteral")}}}),(0,i.default)("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,n.assertNodeType)("FunctionDeclaration","ClassDeclaration","Expression")}}}),(0,i.default)("ExportNamedDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,n.assertNodeType)("Declaration"),optional:!0},specifiers:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ExportSpecifier")))},source:{validate:(0,n.assertNodeType)("StringLiteral"),optional:!0}}}),(0,i.default)("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")},exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ForOfStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,n.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,n.assertNodeType)("Expression")},body:{validate:(0,n.assertNodeType)("Statement")}}}),(0,i.default)("ImportDeclaration",{visitor:["specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration"],fields:{specifiers:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:(0,n.assertNodeType)("StringLiteral")}}}),(0,i.default)("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")},imported:{validate:(0,n.assertNodeType)("Identifier")},importKind:{validate:(0,n.assertOneOf)(null,"type","typeof")}}}),(0,i.default)("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:(0,n.assertValueType)("string")},property:{validate:(0,n.assertValueType)("string")}}}),(0,i.default)("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:{kind:{validate:(0,n.chain)((0,n.assertValueType)("string"),(0,n.assertOneOf)("get","set","method","constructor")),default:"method"},computed:{default:!1,validate:(0,n.assertValueType)("boolean")},static:{default:!1,validate:(0,n.assertValueType)("boolean")},key:{validate:function(e,t,r){var i=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];n.assertNodeType.apply(void 0,i)(e,t,r)}},params:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("LVal")))},body:{validate:(0,n.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,n.assertValueType)("boolean")},async:{default:!1,validate:(0,n.assertValueType)("boolean")}}}),(0,i.default)("ObjectPattern",{visitor:["properties","typeAnnotation"],aliases:["Pattern","LVal"],fields:{properties:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("RestProperty","Property")))},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("Super",{aliases:["Expression"]}),(0,i.default)("TaggedTemplateExpression",{visitor:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,n.assertNodeType)("Expression")},quasi:{validate:(0,n.assertNodeType)("TemplateLiteral")}}}),(0,i.default)("TemplateElement",{builder:["value","tail"],fields:{value:{},tail:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("TemplateElement")))},expressions:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Expression")))}}}),(0,i.default)("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:(0,n.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,n.assertNodeType)("Expression")}}})},{"./index":164}],162:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("ForAwaitStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,n.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,n.assertNodeType)("Expression")},body:{validate:(0,n.assertNodeType)("Statement")}}}),(0,i.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:{}}),(0,i.default)("Import",{aliases:["Expression"]}),(0,i.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("DoExpression",{visitor:["body"],aliases:["Expression"],fields:{body:{validate:(0,n.assertNodeType)("BlockStatement")}}}),(0,i.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("RestProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("LVal")}}}),(0,i.default)("SpreadProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}})},{"./index":164}],163:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AnyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["Flow"],fields:{}}),(0,i.default)("BooleanTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("BooleanLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("NullLiteralTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ClassImplements",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed"],aliases:["Property"],fields:{computed:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("DeclareClass",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareFunction",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareInterface",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareModule",{visitor:["id","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareVariable",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("ExistentialTypeParam",{aliases:["Flow"]}),(0,i.default)("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["Flow"],fields:{}}),(0,i.default)("FunctionTypeParam",{visitor:["name","typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("InterfaceExtends",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("InterfaceDeclaration",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("IntersectionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("MixedTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,i.default)("EmptyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,i.default)("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("NumericLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("NumberTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("StringLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("StringTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ThisTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("TupleTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeofTypeAnnotation",{visitor:["argument"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("TypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["Flow","ExpressionWrapper","Expression"],fields:{}}),(0,i.default)("TypeParameter",{visitor:["bound"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeParameterDeclaration",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeParameterInstantiation",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,i.default)("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties"],aliases:["Flow"],fields:{}}),(0,i.default)("ObjectTypeCallProperty",{visitor:["value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeIndexer",{visitor:["id","key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeProperty",{visitor:["key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("QualifiedTypeIdentifier",{visitor:["id","qualification"],aliases:["Flow"],fields:{}}),(0,i.default)("UnionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("VoidTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}})},{"./index":164}],164:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return Array.isArray(e)?"array":null===e?"null":void 0===e?"undefined":void 0===e?"undefined":(0,g.default)(e)}function s(e){function t(t,r,n){if(Array.isArray(n))for(var i=0;i=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u;if(v.is(l,n)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,m.default)(r)+" but instead got "+(0,m.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(i(n)===c||v.is(c,n)){s=!0;break}}if(!s)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,m.default)(r)+" but instead got "+(0,m.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n=e.length)break;i=e[n++]}else{if(n=e.next(),n.done)break;i=n.value}i.apply(void 0,arguments)}}for(var t=arguments.length,r=Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=t.inherits&&S[t.inherits]||{};t.fields=t.fields||r.fields||{},t.visitor=t.visitor||r.visitor||[],t.aliases=t.aliases||r.aliases||[],t.builder=t.builder||r.builder||t.visitor||[],t.deprecatedAlias&&(C[t.deprecatedAlias]=e);for(var n=t.visitor.concat(t.builder),s=Array.isArray(n),a=0,n=s?n:(0,f.default)(n);;){var o;if(s){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var u=o;t.fields[u]=t.fields[u]||{}}for(var c in t.fields){var p=t.fields[c];-1===t.builder.indexOf(c)&&(p.optional=!0),void 0===p.default?p.default=null:p.validate||(p.validate=l(i(p.default)))}x[e]=t.visitor,D[e]=t.builder,A[e]=t.fields,E[e]=t.aliases,S[e]=t}r.__esModule=!0,r.DEPRECATED_KEYS=r.BUILDER_KEYS=r.NODE_FIELDS=r.ALIAS_KEYS=r.VISITOR_KEYS=void 0;var h=e("babel-runtime/core-js/get-iterator"),f=n(h),d=e("babel-runtime/core-js/json/stringify"),m=n(d),y=e("babel-runtime/helpers/typeof"),g=n(y);r.assertEach=s,r.assertOneOf=a,r.assertNodeType=o,r.assertNodeOrValueType=u,r.assertValueType=l,r.chain=c,r.default=p;var b=e("../index"),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(b),x=r.VISITOR_KEYS={},E=r.ALIAS_KEYS={},A=r.NODE_FIELDS={},D=r.BUILDER_KEYS={},C=r.DEPRECATED_KEYS={},S={}},{"../index":169,"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/json/stringify":114,"babel-runtime/helpers/typeof":131}],165:[function(e,t,r){"use strict";e("./index"),e("./core"),e("./es2015"),e("./flow"),e("./jsx"),e("./misc"),e("./experimental")},{"./core":160,"./es2015":161,"./experimental":162,"./flow":163,"./index":164,"./jsx":166,"./misc":167}],166:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("JSXAttribute",{visitor:["name","value"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,n.assertNodeType)("JSXElement","StringLiteral","JSXExpressionContainer")}}}),(0,i.default)("JSXClosingElement",{visitor:["name"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXMemberExpression")}}}),(0,i.default)("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["JSX","Immutable","Expression"],fields:{openingElement:{validate:(0,n.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,n.assertNodeType)("JSXClosingElement")},children:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement")))}}}),(0,i.default)("JSXEmptyExpression",{aliases:["JSX","Expression"]}),(0,i.default)("JSXExpressionContainer",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXSpreadChild",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXIdentifier",{builder:["name"],aliases:["JSX","Expression"],fields:{name:{validate:(0,n.assertValueType)("string")}}}),(0,i.default)("JSXMemberExpression",{visitor:["object","property"],aliases:["JSX","Expression"],fields:{object:{validate:(0,n.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,n.assertNodeType)("JSXIdentifier")}}}),(0,i.default)("JSXNamespacedName",{visitor:["namespace","name"],aliases:["JSX"],fields:{namespace:{validate:(0,n.assertNodeType)("JSXIdentifier")},name:{validate:(0,n.assertNodeType)("JSXIdentifier")}}}),(0,i.default)("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXMemberExpression")},selfClosing:{default:!1,validate:(0,n.assertValueType)("boolean")},attributes:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))}}}),(0,i.default)("JSXSpreadAttribute",{visitor:["argument"],aliases:["JSX"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXText",{aliases:["JSX","Immutable"],builder:["value"],fields:{value:{validate:(0,n.assertValueType)("string")}}})},{"./index":164}],167:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("Noop",{visitor:[]}),(0,i.default)("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}})},{"./index":164}],168:[function(e,t,r){"use strict";function n(e){var t=i(e);return 1===t.length?t[0]:o.unionTypeAnnotation(t)}function i(e){for(var t={},r={},n=[],s=[],a=0;a=0)){if(o.isAnyTypeAnnotation(u))return[u];if(o.isFlowBaseAnnotation(u))r[u.type]=u;else if(o.isUnionTypeAnnotation(u))n.indexOf(u.types)<0&&(e=e.concat(u.types),n.push(u.types));else if(o.isGenericTypeAnnotation(u)){var l=u.id.name;if(t[l]){var c=t[l];c.typeParameters?u.typeParameters&&(c.typeParameters.params=i(c.typeParameters.params.concat(u.typeParameters.params))):c=u.typeParameters}else t[l]=u}else s.push(u)}}for(var p in r)s.push(r[p]);for(var h in t)s.push(t[h]);return s}function s(e){if("string"===e)return o.stringTypeAnnotation();if("number"===e)return o.numberTypeAnnotation();if("undefined"===e)return o.voidTypeAnnotation();if("boolean"===e)return o.booleanTypeAnnotation();if("function"===e)return o.genericTypeAnnotation(o.identifier("Function"));if("object"===e)return o.genericTypeAnnotation(o.identifier("Object"));if("symbol"===e)return o.genericTypeAnnotation(o.identifier("Symbol"));throw new Error("Invalid typeof value")}r.__esModule=!0,r.createUnionTypeAnnotation=n,r.removeTypeDuplicates=i,r.createTypeAnnotationBasedOnTypeof=s;var a=e("./index"),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a)},{"./index":169}],169:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=H["is"+e];t||(t=H["is"+e]=function(t,r){return H.is(e,t,r)}),H["assert"+e]=function(r,n){if(n=n||{},!t(r,n))throw new Error("Expected type "+(0,N.default)(e)+" with option "+(0,N.default)(n))}}function s(e,t,r){return!!t&&(!!a(t.type,e)&&(void 0===r||H.shallowEqual(t,r)))}function a(e,t){if(e===t)return!0;if(H.ALIAS_KEYS[t])return!1;var r=H.FLIPPED_ALIAS_KEYS[t];if(r){if(r[0]===e)return!0;for(var n=r,i=Array.isArray(n),s=0,n=i?n:(0,P.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}if(e===a)return!0}}return!1}function o(e,t,r){if(e){var n=H.NODE_FIELDS[e.type];if(n){var i=n[t];i&&i.validate&&(i.optional&&null==r||i.validate(e,t,r))}}}function u(e,t){for(var r=(0,O.default)(t),n=r,i=Array.isArray(n),s=0,n=i?n:(0,P.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if(e[o]!==t[o])return!1}return!0}function l(e,t,r){return e.object=H.memberExpression(e.object,e.property,e.computed),e.property=t,e.computed=!!r,e}function c(e,t){return e.object=H.memberExpression(t,e.object),e}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";return e[t]=H.toBlock(e[t],e)}function h(e){if(!e)return e;var t={};for(var r in e)"_"!==r[0]&&(t[r]=e[r]);return t}function f(e){var t=h(e);return delete t.loc,t}function d(e){if(!e)return e;var t={};for(var r in e)if("_"!==r[0]){var n=e[r];n&&(n.type?n=H.cloneDeep(n):Array.isArray(n)&&(n=n.map(H.cloneDeep))),t[r]=n}return t}function m(e,t){var r=e.split(".");return function(e){if(!H.isMemberExpression(e))return!1;for(var n=[e],i=0;n.length;){var s=n.shift();if(t&&i===r.length)return!0;if(H.isIdentifier(s)){if(r[i]!==s.name)return!1}else{if(!H.isStringLiteral(s)){if(H.isMemberExpression(s)){if(s.computed&&!H.isStringLiteral(s.property))return!1;n.push(s.object),n.push(s.property);continue}return!1}if(r[i]!==s.value)return!1}if(++i>r.length)return!1}return!0}}function y(e){for(var t=H.COMMENT_KEYS,r=Array.isArray(t),n=0,t=r?t:(0,P.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}delete e[i]}return e}function g(e,t){return b(e,t),v(e,t),x(e,t),e}function b(e,t){E("trailingComments",e,t)}function v(e,t){E("leadingComments",e,t)}function x(e,t){E("innerComments",e,t)}function E(e,t,r){t&&r&&(t[e]=(0,W.default)([].concat(t[e],r[e]).filter(Boolean)))}function A(e,t){if(!e||!t)return e;for(var r=H.INHERIT_KEYS.optional,n=Array.isArray(r),i=0,r=n?r:(0,P.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;null==e[a]&&(e[a]=t[a])}for(var o in t)"_"===o[0]&&(e[o]=t[o]);for(var u=H.INHERIT_KEYS.force,l=Array.isArray(u),c=0,u=l?u:(0,P.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var h=p;e[h]=t[h]}return H.inheritsComments(e,t),e}function D(e){if(!C(e))throw new TypeError("Not a valid node "+(e&&e.type))}function C(e){return!(!e||!K.VISITOR_KEYS[e.type])}function S(e,t,r){if(e){var n=H.VISITOR_KEYS[e.type];if(n){r=r||{},t(e,r);for(var i=n,s=Array.isArray(i),a=0,i=s?i:(0,P.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var u=o,l=e[u];if(Array.isArray(l))for(var c=l,p=Array.isArray(c),h=0,c=p?c:(0,P.default)(c);;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if(h=c.next(),h.done)break;f=h.value}var d=f;S(d,t,r)}else S(l,t,r)}}}}function _(e,t){t=t||{};for(var r=t.preserveComments?Z:ee,n=r,i=Array.isArray(n),s=0,n=i?n:(0,P.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;null!=e[o]&&(e[o]=void 0)}for(var u in e)"_"===u[0]&&null!=e[u]&&(e[u]=void 0);for(var l=(0,F.default)(e),c=l,p=Array.isArray(c),h=0,c=p?c:(0,P.default)(c);;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if(h=c.next(),h.done)break;f=h.value}e[f]=null}}function w(e,t){return S(e,_,t),e}r.__esModule=!0,r.createTypeAnnotationBasedOnTypeof=r.removeTypeDuplicates=r.createUnionTypeAnnotation=r.valueToNode=r.toBlock=r.toExpression=r.toStatement=r.toBindingIdentifierName=r.toIdentifier=r.toKeyAlias=r.toSequenceExpression=r.toComputedKey=r.isNodesEquivalent=r.isImmutable=r.isScope=r.isSpecifierDefault=r.isVar=r.isBlockScoped=r.isLet=r.isValidIdentifier=r.isReferenced=r.isBinding=r.getOuterBindingIdentifiers=r.getBindingIdentifiers=r.TYPES=r.react=r.DEPRECATED_KEYS=r.BUILDER_KEYS=r.NODE_FIELDS=r.ALIAS_KEYS=r.VISITOR_KEYS=r.NOT_LOCAL_BINDING=r.BLOCK_SCOPED_SYMBOL=r.INHERIT_KEYS=r.UNARY_OPERATORS=r.STRING_UNARY_OPERATORS=r.NUMBER_UNARY_OPERATORS=r.BOOLEAN_UNARY_OPERATORS=r.BINARY_OPERATORS=r.NUMBER_BINARY_OPERATORS=r.BOOLEAN_BINARY_OPERATORS=r.COMPARISON_BINARY_OPERATORS=r.EQUALITY_BINARY_OPERATORS=r.BOOLEAN_NUMBER_BINARY_OPERATORS=r.UPDATE_OPERATORS=r.LOGICAL_OPERATORS=r.COMMENT_KEYS=r.FOR_INIT_KEYS=r.FLATTENABLE_KEYS=r.STATEMENT_OR_BLOCK_KEYS=void 0;var k=e("babel-runtime/core-js/object/get-own-property-symbols"),F=n(k),T=e("babel-runtime/core-js/get-iterator"),P=n(T),B=e("babel-runtime/core-js/object/keys"),O=n(B),j=e("babel-runtime/core-js/json/stringify"),N=n(j),I=e("./constants");Object.defineProperty(r,"STATEMENT_OR_BLOCK_KEYS",{enumerable:!0,get:function(){return I.STATEMENT_OR_BLOCK_KEYS}}),Object.defineProperty(r,"FLATTENABLE_KEYS",{enumerable:!0,get:function(){return I.FLATTENABLE_KEYS}}),Object.defineProperty(r,"FOR_INIT_KEYS",{enumerable:!0,get:function(){return I.FOR_INIT_KEYS}}),Object.defineProperty(r,"COMMENT_KEYS",{enumerable:!0,get:function(){return I.COMMENT_KEYS}}),Object.defineProperty(r,"LOGICAL_OPERATORS",{enumerable:!0,get:function(){return I.LOGICAL_OPERATORS}}),Object.defineProperty(r,"UPDATE_OPERATORS",{enumerable:!0,get:function(){return I.UPDATE_OPERATORS}}),Object.defineProperty(r,"BOOLEAN_NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return I.BOOLEAN_NUMBER_BINARY_OPERATORS}}),Object.defineProperty(r,"EQUALITY_BINARY_OPERATORS",{enumerable:!0,get:function(){return I.EQUALITY_BINARY_OPERATORS}}),Object.defineProperty(r,"COMPARISON_BINARY_OPERATORS",{enumerable:!0,get:function(){return I.COMPARISON_BINARY_OPERATORS}}),Object.defineProperty(r,"BOOLEAN_BINARY_OPERATORS",{enumerable:!0,get:function(){return I.BOOLEAN_BINARY_OPERATORS}}),Object.defineProperty(r,"NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return I.NUMBER_BINARY_OPERATORS}}),Object.defineProperty(r,"BINARY_OPERATORS",{enumerable:!0,get:function(){return I.BINARY_OPERATORS}}),Object.defineProperty(r,"BOOLEAN_UNARY_OPERATORS",{enumerable:!0,get:function(){return I.BOOLEAN_UNARY_OPERATORS}}),Object.defineProperty(r,"NUMBER_UNARY_OPERATORS",{enumerable:!0,get:function(){return I.NUMBER_UNARY_OPERATORS}}),Object.defineProperty(r,"STRING_UNARY_OPERATORS",{enumerable:!0,get:function(){return I.STRING_UNARY_OPERATORS}}),Object.defineProperty(r,"UNARY_OPERATORS",{enumerable:!0,get:function(){return I.UNARY_OPERATORS}}),Object.defineProperty(r,"INHERIT_KEYS",{enumerable:!0,get:function(){return I.INHERIT_KEYS}}),Object.defineProperty(r,"BLOCK_SCOPED_SYMBOL",{enumerable:!0,get:function(){return I.BLOCK_SCOPED_SYMBOL}}),Object.defineProperty(r,"NOT_LOCAL_BINDING",{enumerable:!0,get:function(){return I.NOT_LOCAL_BINDING}}),r.is=s,r.isType=a,r.validate=o,r.shallowEqual=u,r.appendToMemberExpression=l,r.prependToMemberExpression=c,r.ensureBlock=p,r.clone=h,r.cloneWithoutLoc=f,r.cloneDeep=d,r.buildMatchMemberExpression=m,r.removeComments=y,r.inheritsComments=g,r.inheritTrailingComments=b,r.inheritLeadingComments=v,r.inheritInnerComments=x,r.inherits=A,r.assertNode=D,r.isNode=C,r.traverseFast=S,r.removeProperties=_,r.removePropertiesDeep=w;var L=e("./retrievers");Object.defineProperty(r,"getBindingIdentifiers",{enumerable:!0,get:function(){return L.getBindingIdentifiers}}),Object.defineProperty(r,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return L.getOuterBindingIdentifiers}});var M=e("./validators");Object.defineProperty(r,"isBinding",{enumerable:!0,get:function(){return M.isBinding}}),Object.defineProperty(r,"isReferenced",{enumerable:!0,get:function(){return M.isReferenced}}), +Object.defineProperty(r,"isValidIdentifier",{enumerable:!0,get:function(){return M.isValidIdentifier}}),Object.defineProperty(r,"isLet",{enumerable:!0,get:function(){return M.isLet}}),Object.defineProperty(r,"isBlockScoped",{enumerable:!0,get:function(){return M.isBlockScoped}}),Object.defineProperty(r,"isVar",{enumerable:!0,get:function(){return M.isVar}}),Object.defineProperty(r,"isSpecifierDefault",{enumerable:!0,get:function(){return M.isSpecifierDefault}}),Object.defineProperty(r,"isScope",{enumerable:!0,get:function(){return M.isScope}}),Object.defineProperty(r,"isImmutable",{enumerable:!0,get:function(){return M.isImmutable}}),Object.defineProperty(r,"isNodesEquivalent",{enumerable:!0,get:function(){return M.isNodesEquivalent}});var R=e("./converters");Object.defineProperty(r,"toComputedKey",{enumerable:!0,get:function(){return R.toComputedKey}}),Object.defineProperty(r,"toSequenceExpression",{enumerable:!0,get:function(){return R.toSequenceExpression}}),Object.defineProperty(r,"toKeyAlias",{enumerable:!0,get:function(){return R.toKeyAlias}}),Object.defineProperty(r,"toIdentifier",{enumerable:!0,get:function(){return R.toIdentifier}}),Object.defineProperty(r,"toBindingIdentifierName",{enumerable:!0,get:function(){return R.toBindingIdentifierName}}),Object.defineProperty(r,"toStatement",{enumerable:!0,get:function(){return R.toStatement}}),Object.defineProperty(r,"toExpression",{enumerable:!0,get:function(){return R.toExpression}}),Object.defineProperty(r,"toBlock",{enumerable:!0,get:function(){return R.toBlock}}),Object.defineProperty(r,"valueToNode",{enumerable:!0,get:function(){return R.valueToNode}});var U=e("./flow");Object.defineProperty(r,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return U.createUnionTypeAnnotation}}),Object.defineProperty(r,"removeTypeDuplicates",{enumerable:!0,get:function(){return U.removeTypeDuplicates}}),Object.defineProperty(r,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return U.createTypeAnnotationBasedOnTypeof}});var V=e("to-fast-properties"),q=n(V),G=e("lodash/clone"),X=n(G),J=e("lodash/uniq"),W=n(J);e("./definitions/init");var K=e("./definitions"),z=e("./react"),Y=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(z),H=r;r.VISITOR_KEYS=K.VISITOR_KEYS,r.ALIAS_KEYS=K.ALIAS_KEYS,r.NODE_FIELDS=K.NODE_FIELDS,r.BUILDER_KEYS=K.BUILDER_KEYS,r.DEPRECATED_KEYS=K.DEPRECATED_KEYS,r.react=Y;for(var $ in H.VISITOR_KEYS)i($);H.FLIPPED_ALIAS_KEYS={},(0,O.default)(H.ALIAS_KEYS).forEach(function(e){H.ALIAS_KEYS[e].forEach(function(t){(H.FLIPPED_ALIAS_KEYS[t]=H.FLIPPED_ALIAS_KEYS[t]||[]).push(e)})}),(0,O.default)(H.FLIPPED_ALIAS_KEYS).forEach(function(e){H[e.toUpperCase()+"_TYPES"]=H.FLIPPED_ALIAS_KEYS[e],i(e)});r.TYPES=(0,O.default)(H.VISITOR_KEYS).concat((0,O.default)(H.FLIPPED_ALIAS_KEYS)).concat((0,O.default)(H.DEPRECATED_KEYS));(0,O.default)(H.BUILDER_KEYS).forEach(function(e){function t(){if(arguments.length>r.length)throw new Error("t."+e+": Too many arguments passed. Received "+arguments.length+" but can receive no more than "+r.length);var t={};t.type=e;for(var n=0,i=r,s=Array.isArray(i),a=0,i=s?i:(0,P.default)(i);;){var u;if(s){if(a>=i.length)break;u=i[a++]}else{if(a=i.next(),a.done)break;u=a.value}var l=u,c=H.NODE_FIELDS[e][l],p=arguments[n++];void 0===p&&(p=(0,X.default)(c.default)),t[l]=p}for(var h in t)o(t,h,t[h]);return t}var r=H.BUILDER_KEYS[e];H[e]=t,H[e[0].toLowerCase()+e.slice(1)]=t});for(var Q in H.DEPRECATED_KEYS)!function(e){function t(t){return function(){return console.trace("The node type "+e+" has been renamed to "+r),t.apply(this,arguments)}}var r=H.DEPRECATED_KEYS[e];H[e]=H[e[0].toLowerCase()+e.slice(1)]=t(H[r]),H["is"+e]=t(H["is"+r]),H["assert"+e]=t(H["assert"+r])}(Q);(0,q.default)(H),(0,q.default)(H.VISITOR_KEYS);var Z=["tokens","start","end","loc","raw","rawValue"],ee=H.COMMENT_KEYS.concat(["comments"]).concat(Z)},{"./constants":158,"./converters":159,"./definitions":164,"./definitions/init":165,"./flow":168,"./react":170,"./retrievers":171,"./validators":172,"babel-runtime/core-js/get-iterator":113,"babel-runtime/core-js/json/stringify":114,"babel-runtime/core-js/object/get-own-property-symbols":119,"babel-runtime/core-js/object/keys":120,"lodash/clone":480,"lodash/uniq":529,"to-fast-properties":595}],170:[function(e,t,r){"use strict";function n(e){return!!e&&/^[a-z]|\-/.test(e)}function i(e,t){for(var r=e.value.split(/\r\n|\n|\r/),n=0,i=0;i=0)return!0}else if(s===e)return!0}return!1}function s(e,t){switch(t.type){case"BindExpression":return t.object===e||t.callee===e;case"MemberExpression":case"JSXMemberExpression":return!(t.property!==e||!t.computed)||t.object===e;case"MetaProperty":return!1;case"ObjectProperty":if(t.key===e)return t.computed;case"VariableDeclarator":return t.id!==e;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":for(var r=t.params,n=Array.isArray(r),i=0,r=n?r:(0,v.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}if(s===e)return!1}return t.id!==e;case"ExportSpecifier":return!t.source&&t.local===e;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"JSXAttribute":return t.name!==e;case"ClassProperty":return t.key===e?t.computed:t.value===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ClassDeclaration":case"ClassExpression":return t.id!==e;case"ClassMethod":case"ObjectMethod":return t.key===e&&t.computed;case"LabeledStatement":return!1;case"CatchClause":return t.param!==e;case"RestElement":return!1;case"AssignmentExpression":case"AssignmentPattern":return t.right===e;case"ObjectPattern":case"ArrayPattern":return!1}return!0}function a(e){return"string"==typeof e&&!A.default.keyword.isReservedWordES6(e,!0)&&A.default.keyword.isIdentifierNameES6(e)}function o(e){return C.isVariableDeclaration(e)&&("var"!==e.kind||e[S.BLOCK_SCOPED_SYMBOL])}function u(e){return C.isFunctionDeclaration(e)||C.isClassDeclaration(e)||C.isLet(e)}function l(e){return C.isVariableDeclaration(e,{kind:"var"})&&!e[S.BLOCK_SCOPED_SYMBOL]}function c(e){return C.isImportDefaultSpecifier(e)||C.isIdentifier(e.imported||e.exported,{name:"default"})}function p(e,t){return(!C.isBlockStatement(e)||!C.isFunction(t,{body:e}))&&C.isScopable(e)}function h(e){return!!C.isType(e.type,"Immutable")||!!C.isIdentifier(e)&&"undefined"===e.name}function f(e,t){if("object"!==(void 0===e?"undefined":(0,g.default)(e))||"object"!==(void 0===e?"undefined":(0,g.default)(e))||null==e||null==t)return e===t;if(e.type!==t.type)return!1;for(var r=(0,m.default)(C.NODE_FIELDS[e.type]||e.type),n=r,i=Array.isArray(n),s=0,n=i?n:(0,v.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;if((0,g.default)(e[o])!==(0,g.default)(t[o]))return!1;if(Array.isArray(e[o])){if(!Array.isArray(t[o]))return!1;if(e[o].length!==t[o].length)return!1;for(var u=0;u=0}}function i(e,t){for(var r=65536,n=0;ne)return!1;if((r+=t[n+1])>=e)return!0}}function s(e){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&E.test(String.fromCharCode(e)):i(e,D)))}function a(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&A.test(String.fromCharCode(e)):i(e,D)||i(e,C))))}function o(e){var t={};for(var r in S)t[r]=e&&r in e?e[r]:S[r];return t}function u(e){return 10===e||13===e||8232===e||8233===e}function l(e,t){for(var r=1,n=0;;){L.lastIndex=n;var i=L.exec(e);if(!(i&&i.index>10),56320+(e-65536&1023))}function p(e,t,r,n){return e.type=t,e.end=r,e.loc.end=n,this.processComment(e),e}function h(e){return e[e.length-1]}function f(e){return e&&"Property"===e.type&&"init"===e.kind&&!1===e.method}function d(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?d(e.object)+"."+d(e.property):void 0}function m(e,t){return new z(t,e).parse()}function y(e,t){var r=new z(t,e);return r.options.strictMode&&(r.state.strict=!0),r.getExpression()}Object.defineProperty(r,"__esModule",{value:!0});var g={6:n("enum await"),strict:n("implements interface let package private protected public static yield"),strictBind:n("eval arguments")},b=n("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"),v="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",x="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",E=new RegExp("["+v+"]"),A=new RegExp("["+v+x+"]");v=x=null;var D=[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,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],C=[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,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],S={sourceType:"script",sourceFilename:void 0,startLine:1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null},_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},F=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},T=!0,P=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null},B=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(this,t),n.keyword=r,F(this,e.call(this,r,n))}return k(t,e),t}(P),O=function(e){function t(r,n){return w(this,t),F(this,e.call(this,r,{beforeExpr:T,binop:n}))}return k(t,e),t}(P),j={num:new P("num",{startsExpr:!0}),regexp:new P("regexp",{startsExpr:!0}),string:new P("string",{startsExpr:!0}),name:new P("name",{startsExpr:!0}),eof:new P("eof"),bracketL:new P("[",{beforeExpr:T,startsExpr:!0}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:T,startsExpr:!0}),braceBarL:new P("{|",{beforeExpr:T,startsExpr:!0}),braceR:new P("}"),braceBarR:new P("|}"),parenL:new P("(",{beforeExpr:T,startsExpr:!0}),parenR:new P(")"),comma:new P(",",{beforeExpr:T}),semi:new P(";",{beforeExpr:T}),colon:new P(":",{beforeExpr:T}),doubleColon:new P("::",{beforeExpr:T}),dot:new P("."),question:new P("?",{beforeExpr:T}),arrow:new P("=>",{beforeExpr:T}),template:new P("template"),ellipsis:new P("...",{beforeExpr:T}),backQuote:new P("`",{startsExpr:!0}),dollarBraceL:new P("${",{beforeExpr:T,startsExpr:!0}),at:new P("@"),eq:new P("=",{beforeExpr:T,isAssign:!0}),assign:new P("_=",{beforeExpr:T,isAssign:!0}),incDec:new P("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new P("prefix",{beforeExpr:T,prefix:!0,startsExpr:!0}),logicalOR:new O("||",1),logicalAND:new O("&&",2),bitwiseOR:new O("|",3),bitwiseXOR:new O("^",4),bitwiseAND:new O("&",5),equality:new O("==/!=",6),relational:new O("",7),bitShift:new O("<>",8),plusMin:new P("+/-",{beforeExpr:T,binop:9,prefix:!0,startsExpr:!0}),modulo:new O("%",10),star:new O("*",10),slash:new O("/",10),exponent:new P("**",{beforeExpr:T,binop:11,rightAssociative:!0})},N={break:new B("break"),case:new B("case",{beforeExpr:T}),catch:new B("catch"),continue:new B("continue"),debugger:new B("debugger"),default:new B("default",{beforeExpr:T}),do:new B("do",{isLoop:!0,beforeExpr:T}),else:new B("else",{beforeExpr:T}),finally:new B("finally"),for:new B("for",{isLoop:!0}),function:new B("function",{startsExpr:!0}),if:new B("if"),return:new B("return",{beforeExpr:T}),switch:new B("switch"),throw:new B("throw",{beforeExpr:T}),try:new B("try"),var:new B("var"),let:new B("let"),const:new B("const"),while:new B("while",{isLoop:!0}),with:new B("with"),new:new B("new",{beforeExpr:T,startsExpr:!0}),this:new B("this",{startsExpr:!0}),super:new B("super",{startsExpr:!0}),class:new B("class"),extends:new B("extends",{beforeExpr:T}),export:new B("export"),import:new B("import"),yield:new B("yield",{beforeExpr:T,startsExpr:!0}),null:new B("null",{startsExpr:!0}),true:new B("true",{startsExpr:!0}),false:new B("false",{startsExpr:!0}),in:new B("in",{beforeExpr:T,binop:7}),instanceof:new B("instanceof",{beforeExpr:T,binop:7}),typeof:new B("typeof",{beforeExpr:T,prefix:!0,startsExpr:!0}),void:new B("void",{beforeExpr:T,prefix:!0,startsExpr:!0}),delete:new B("delete",{beforeExpr:T,prefix:!0,startsExpr:!0})};Object.keys(N).forEach(function(e){j["_"+e]=N[e]});var I=/\r\n?|\n|\u2028|\u2029/,L=new RegExp(I.source,"g"),M=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,R=function e(t,r,n,i){w(this,e),this.token=t,this.isExpr=!!r,this.preserveSpace=!!n,this.override=i},U={braceStatement:new R("{",!1),braceExpression:new R("{",!0),templateQuasi:new R("${",!0),parenStatement:new R("(",!1),parenExpression:new R("(",!0),template:new R("`",!0,!0,function(e){return e.readTmplToken()}),functionExpression:new R("function",!0)};j.parenR.updateContext=j.braceR.updateContext=function(){if(1===this.state.context.length)return void(this.state.exprAllowed=!0);var e=this.state.context.pop();e===U.braceStatement&&this.curContext()===U.functionExpression?(this.state.context.pop(),this.state.exprAllowed=!1):e===U.templateQuasi?this.state.exprAllowed=!0:this.state.exprAllowed=!e.isExpr},j.name.updateContext=function(e){this.state.exprAllowed=!1,e!==j._let&&e!==j._const&&e!==j._var||I.test(this.input.slice(this.state.end))&&(this.state.exprAllowed=!0)},j.braceL.updateContext=function(e){this.state.context.push(this.braceIsBlock(e)?U.braceStatement:U.braceExpression),this.state.exprAllowed=!0},j.dollarBraceL.updateContext=function(){this.state.context.push(U.templateQuasi),this.state.exprAllowed=!0},j.parenL.updateContext=function(e){var t=e===j._if||e===j._for||e===j._with||e===j._while;this.state.context.push(t?U.parenStatement:U.parenExpression),this.state.exprAllowed=!0},j.incDec.updateContext=function(){},j._function.updateContext=function(){this.curContext()!==U.braceStatement&&this.state.context.push(U.functionExpression),this.state.exprAllowed=!1},j.backQuote.updateContext=function(){this.curContext()===U.template?this.state.context.pop():this.state.context.push(U.template),this.state.exprAllowed=!1};var V=function e(t,r){w(this,e),this.line=t,this.column=r},q=function e(t,r){w(this,e),this.start=t,this.end=r},G=function(){function e(){w(this,e)}return e.prototype.init=function(e,t){return this.strict=!1!==e.strictMode&&"module"===e.sourceType,this.input=t,this.potentialArrowAt=-1,this.inMethod=this.inFunction=this.inGenerator=this.inAsync=this.inPropertyName=this.inType=this.noAnonFunctionType=!1,this.labels=[],this.decorators=[],this.tokens=[],this.comments=[],this.trailingComments=[],this.leadingComments=[],this.commentStack=[],this.pos=this.lineStart=0,this.curLine=e.startLine,this.type=j.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=[U.braceStatement],this.exprAllowed=!0,this.containsEsc=this.containsOctal=!1,this.octalPosition=null,this.exportedIdentifiers=[],this},e.prototype.curPosition=function(){return new V(this.curLine,this.pos-this.lineStart)},e.prototype.clone=function(t){var r=new e;for(var n in this){var i=this[n];t&&"context"!==n||!Array.isArray(i)||(i=i.slice()),r[n]=i}return r},e}(),X=function e(t){w(this,e),this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new q(t.startLoc,t.endLoc)},J=function(){function e(t,r){w(this,e),this.state=new G,this.state.init(t,r)}return e.prototype.next=function(){this.isLookahead||this.state.tokens.push(new X(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()},e.prototype.eat=function(e){return!!this.match(e)&&(this.next(),!0)},e.prototype.match=function(e){return this.state.type===e},e.prototype.isKeyword=function(e){return b(e)},e.prototype.lookahead=function(){var e=this.state;this.state=e.clone(!0),this.isLookahead=!0,this.next(),this.isLookahead=!1;var t=this.state.clone(!0);return this.state=e,t},e.prototype.setStrict=function(e){if(this.state.strict=e,this.match(j.num)||this.match(j.string)){for(this.state.pos=this.state.start;this.state.pos=this.input.length?this.finishToken(j.eof):e.override?e.override(this):this.readToken(this.fullCharCodeAtPos())},e.prototype.readToken=function(e){return s(e)||92===e?this.readWord():this.getTokenFromCode(e)},e.prototype.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.state.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.state.pos+1)-56613888},e.prototype.pushComment=function(e,t,r,n,i,s){var a={type:e?"CommentBlock":"CommentLine",value:t,start:r,end:n,loc:new q(i,s)};this.isLookahead||(this.state.tokens.push(a),this.state.comments.push(a),this.addComment(a))},e.prototype.skipBlockComment=function(){var e=this.state.curPosition(),t=this.state.pos,r=this.input.indexOf("*/",this.state.pos+=2);-1===r&&this.raise(this.state.pos-2,"Unterminated comment"),this.state.pos=r+2,L.lastIndex=t;for(var n=void 0;(n=L.exec(this.input))&&n.index8&&e<14||e>=5760&&M.test(String.fromCharCode(e))))break e;++this.state.pos}}},e.prototype.finishToken=function(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();var r=this.state.type;this.state.type=e,this.state.value=t,this.updateContext(r)},e.prototype.readToken_dot=function(){var e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.state.pos+2);return 46===e&&46===t?(this.state.pos+=3,this.finishToken(j.ellipsis)):(++this.state.pos,this.finishToken(j.dot))},e.prototype.readToken_slash=function(){return this.state.exprAllowed?(++this.state.pos,this.readRegexp()):61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(j.assign,2):this.finishOp(j.slash,1)},e.prototype.readToken_mult_modulo=function(e){var t=42===e?j.star:j.modulo,r=1,n=this.input.charCodeAt(this.state.pos+1);return 42===n&&(r++,n=this.input.charCodeAt(this.state.pos+2),t=j.exponent),61===n&&(r++,t=j.assign),this.finishOp(t,r)},e.prototype.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?this.finishOp(124===e?j.logicalOR:j.logicalAND,2):61===t?this.finishOp(j.assign,2):124===e&&125===t&&this.hasPlugin("flow")?this.finishOp(j.braceBarR,2):this.finishOp(124===e?j.bitwiseOR:j.bitwiseAND,1)},e.prototype.readToken_caret=function(){return 61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(j.assign,2):this.finishOp(j.bitwiseXOR,1)},e.prototype.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?45===t&&62===this.input.charCodeAt(this.state.pos+2)&&I.test(this.input.slice(this.state.lastTokEnd,this.state.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(j.incDec,2):61===t?this.finishOp(j.assign,2):this.finishOp(j.plusMin,1)},e.prototype.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.state.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.state.pos+2)?3:2,61===this.input.charCodeAt(this.state.pos+r)?this.finishOp(j.assign,r+1):this.finishOp(j.bitShift,r)):33===t&&60===e&&45===this.input.charCodeAt(this.state.pos+2)&&45===this.input.charCodeAt(this.state.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(r=2),this.finishOp(j.relational,r))},e.prototype.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.state.pos+1);return 61===t?this.finishOp(j.equality,61===this.input.charCodeAt(this.state.pos+2)?3:2):61===e&&62===t?(this.state.pos+=2,this.finishToken(j.arrow)):this.finishOp(61===e?j.eq:j.prefix,1)},e.prototype.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.state.pos,this.finishToken(j.parenL);case 41:return++this.state.pos,this.finishToken(j.parenR);case 59:return++this.state.pos,this.finishToken(j.semi);case 44:return++this.state.pos,this.finishToken(j.comma);case 91:return++this.state.pos,this.finishToken(j.bracketL);case 93:return++this.state.pos,this.finishToken(j.bracketR);case 123:return this.hasPlugin("flow")&&124===this.input.charCodeAt(this.state.pos+1)?this.finishOp(j.braceBarL,2):(++this.state.pos,this.finishToken(j.braceL));case 125:return++this.state.pos,this.finishToken(j.braceR);case 58:return this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(j.doubleColon,2):(++this.state.pos,this.finishToken(j.colon));case 63:return++this.state.pos,this.finishToken(j.question);case 64:return++this.state.pos,this.finishToken(j.at);case 96:return++this.state.pos,this.finishToken(j.backQuote);case 48:var t=this.input.charCodeAt(this.state.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(j.prefix,1)}this.raise(this.state.pos,"Unexpected character '"+c(e)+"'")},e.prototype.finishOp=function(e,t){var r=this.input.slice(this.state.pos,this.state.pos+t);return this.state.pos+=t,this.finishToken(e,r)},e.prototype.readRegexp=function(){for(var e=this.state.pos,t=void 0,r=void 0;;){this.state.pos>=this.input.length&&this.raise(e,"Unterminated regular expression");var n=this.input.charAt(this.state.pos);if(I.test(n)&&this.raise(e,"Unterminated regular expression"),t)t=!1;else{if("["===n)r=!0;else if("]"===n&&r)r=!1;else if("/"===n&&!r)break;t="\\"===n}++this.state.pos}var i=this.input.slice(e,this.state.pos);++this.state.pos;var s=this.readWord1();if(s){/^[gmsiyu]*$/.test(s)||this.raise(e,"Invalid regular expression flag")}return this.finishToken(j.regexp,{pattern:i,flags:s})},e.prototype.readInt=function(e,t){for(var r=this.state.pos,n=0,i=0,s=null==t?1/0:t;i=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.state.pos,n=n*e+o}return this.state.pos===r||null!=t&&this.state.pos-r!==t?null:n},e.prototype.readRadixNumber=function(e){this.state.pos+=2;var t=this.readInt(e) +;return null==t&&this.raise(this.state.start+2,"Expected number in radix "+e),s(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number"),this.finishToken(j.num,t)},e.prototype.readNumber=function(e){var t=this.state.pos,r=48===this.input.charCodeAt(this.state.pos),n=!1;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.state.pos);46===i&&(++this.state.pos,this.readInt(10),n=!0,i=this.input.charCodeAt(this.state.pos)),69!==i&&101!==i||(i=this.input.charCodeAt(++this.state.pos),43!==i&&45!==i||++this.state.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0),s(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number");var a=this.input.slice(t,this.state.pos),o=void 0;return n?o=parseFloat(a):r&&1!==a.length?/[89]/.test(a)||this.state.strict?this.raise(t,"Invalid number"):o=parseInt(a,8):o=parseInt(a,10),this.finishToken(j.num,o)},e.prototype.readCodePoint=function(){var e=this.input.charCodeAt(this.state.pos),t=void 0;if(123===e){var r=++this.state.pos;t=this.readHexChar(this.input.indexOf("}",this.state.pos)-this.state.pos),++this.state.pos,t>1114111&&this.raise(r,"Code point out of bounds")}else t=this.readHexChar(4);return t},e.prototype.readString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.state.pos),t+=this.readEscapedChar(!1),r=this.state.pos):(u(n)&&this.raise(this.state.start,"Unterminated string constant"),++this.state.pos)}return t+=this.input.slice(r,this.state.pos++),this.finishToken(j.string,t)},e.prototype.readTmplToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated template");var r=this.input.charCodeAt(this.state.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.state.pos+1))return this.state.pos===this.state.start&&this.match(j.template)?36===r?(this.state.pos+=2,this.finishToken(j.dollarBraceL)):(++this.state.pos,this.finishToken(j.backQuote)):(e+=this.input.slice(t,this.state.pos),this.finishToken(j.template,e));if(92===r)e+=this.input.slice(t,this.state.pos),e+=this.readEscapedChar(!0),t=this.state.pos;else if(u(r)){switch(e+=this.input.slice(t,this.state.pos),++this.state.pos,r){case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}++this.state.curLine,this.state.lineStart=this.state.pos,t=this.state.pos}else++this.state.pos}},e.prototype.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return c(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:return this.state.lineStart=this.state.pos,++this.state.curLine,"";default:if(t>=48&&t<=55){var r=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);return n>255&&(r=r.slice(0,-1),n=parseInt(r,8)),n>0&&(this.state.containsOctal||(this.state.containsOctal=!0,this.state.octalPosition=this.state.pos-2),(this.state.strict||e)&&this.raise(this.state.pos-2,"Octal literal in strict mode")),this.state.pos+=r.length-1,String.fromCharCode(n)}return String.fromCharCode(t)}},e.prototype.readHexChar=function(e){var t=this.state.pos,r=this.readInt(16,e);return null===r&&this.raise(t,"Bad character escape sequence"),r},e.prototype.readWord1=function(){this.state.containsEsc=!1;for(var e="",t=!0,r=this.state.pos;this.state.pos-1)||!!this.plugins[e]},t.prototype.extend=function(e,t){this[e]=t(this[e])},t.prototype.loadAllPlugins=function(){var e=this,t=Object.keys(W).filter(function(e){return"flow"!==e&&"estree"!==e});t.push("flow"),t.forEach(function(t){var r=W[t];r&&r(e)})},t.prototype.loadPlugins=function(e){if(e.indexOf("*")>=0)return this.loadAllPlugins(),{"*":!0};var t={};e.indexOf("flow")>=0&&(e=e.filter(function(e){return"flow"!==e}),e.push("flow")),e.indexOf("estree")>=0&&(e=e.filter(function(e){return"estree"!==e}),e.unshift("estree"));for(var r=e,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if(!t[a]){t[a]=!0;var o=W[a];o&&o(this)}}return t},t.prototype.parse=function(){var e=this.startNode(),t=this.startNode();return this.nextToken(),this.parseTopLevel(e,t)},t}(J),Y=z.prototype;Y.addExtra=function(e,t,r){if(e){(e.extra=e.extra||{})[t]=r}},Y.isRelational=function(e){return this.match(j.relational)&&this.state.value===e},Y.expectRelational=function(e){this.isRelational(e)?this.next():this.unexpected(null,j.relational)},Y.isContextual=function(e){return this.match(j.name)&&this.state.value===e},Y.eatContextual=function(e){return this.state.value===e&&this.eat(j.name)},Y.expectContextual=function(e,t){this.eatContextual(e)||this.unexpected(null,t)},Y.canInsertSemicolon=function(){return this.match(j.eof)||this.match(j.braceR)||I.test(this.input.slice(this.state.lastTokEnd,this.state.start))},Y.isLineTerminator=function(){return this.eat(j.semi)||this.canInsertSemicolon()},Y.semicolon=function(){this.isLineTerminator()||this.unexpected(null,j.semi)},Y.expect=function(e,t){return this.eat(e)||this.unexpected(t,e)},Y.unexpected=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unexpected token";t&&"object"===(void 0===t?"undefined":_(t))&&t.label&&(t="Unexpected token, expected "+t.label),this.raise(null!=e?e:this.state.start,t)};var H=z.prototype;H.parseTopLevel=function(e,t){return t.sourceType=this.options.sourceType,this.parseBlockBody(t,!0,!0,j.eof),e.program=this.finishNode(t,"Program"),e.comments=this.state.comments,e.tokens=this.state.tokens,this.finishNode(e,"File")};var $={kind:"loop"},Q={kind:"switch"};H.stmtToDirective=function(e){var t=e.expression,r=this.startNodeAt(t.start,t.loc.start),n=this.startNodeAt(e.start,e.loc.start),i=this.input.slice(t.start,t.end),s=r.value=i.slice(1,-1);return this.addExtra(r,"raw",i),this.addExtra(r,"rawValue",s),n.value=this.finishNodeAt(r,"DirectiveLiteral",t.end,t.loc.end),this.finishNodeAt(n,"Directive",e.end,e.loc.end)},H.parseStatement=function(e,t){this.match(j.at)&&this.parseDecorators(!0);var r=this.state.type,n=this.startNode();switch(r){case j._break:case j._continue:return this.parseBreakContinueStatement(n,r.keyword);case j._debugger:return this.parseDebuggerStatement(n);case j._do:return this.parseDoStatement(n);case j._for:return this.parseForStatement(n);case j._function:return e||this.unexpected(),this.parseFunctionStatement(n);case j._class:return e||this.unexpected(),this.parseClass(n,!0);case j._if:return this.parseIfStatement(n);case j._return:return this.parseReturnStatement(n);case j._switch:return this.parseSwitchStatement(n);case j._throw:return this.parseThrowStatement(n);case j._try:return this.parseTryStatement(n);case j._let:case j._const:e||this.unexpected();case j._var:return this.parseVarStatement(n,r);case j._while:return this.parseWhileStatement(n);case j._with:return this.parseWithStatement(n);case j.braceL:return this.parseBlock();case j.semi:return this.parseEmptyStatement(n);case j._export:case j._import:if(this.hasPlugin("dynamicImport")&&this.lookahead().type===j.parenL)break;return this.options.allowImportExportEverywhere||(t||this.raise(this.state.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.state.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===j._import?this.parseImport(n):this.parseExport(n);case j.name:if("async"===this.state.value){var i=this.state.clone();if(this.next(),this.match(j._function)&&!this.canInsertSemicolon())return this.expect(j._function),this.parseFunction(n,!0,!1,!0);this.state=i}}var s=this.state.value,a=this.parseExpression();return r===j.name&&"Identifier"===a.type&&this.eat(j.colon)?this.parseLabeledStatement(n,s,a):this.parseExpressionStatement(n,a)},H.takeDecorators=function(e){this.state.decorators.length&&(e.decorators=this.state.decorators,this.state.decorators=[])},H.parseDecorators=function(e){for(;this.match(j.at);){var t=this.parseDecorator();this.state.decorators.push(t)}e&&this.match(j._export)||this.match(j._class)||this.raise(this.state.start,"Leading decorators must be attached to a class declaration")},H.parseDecorator=function(){this.hasPlugin("decorators")||this.unexpected();var e=this.startNode();return this.next(),e.expression=this.parseMaybeAssign(),this.finishNode(e,"Decorator")},H.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.isLineTerminator()?e.label=null:this.match(j.name)?(e.label=this.parseIdentifier(),this.semicolon()):this.unexpected();var n=void 0;for(n=0;n=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}a.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.state.type.isLoop?"loop":this.match(j._switch)?"switch":null,u=this.state.labels.length-1;u>=0;u--){var l=this.state.labels[u];if(l.statementStart!==e.start)break;l.statementStart=this.state.start,l.kind=o}return this.state.labels.push({name:t,kind:o,statementStart:this.state.start}),e.body=this.parseStatement(!0),this.state.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},H.parseBlock=function(e){var t=this.startNode();return this.expect(j.braceL),this.parseBlockBody(t,e,!1,j.braceR),this.finishNode(t,"BlockStatement")},H.isValidDirective=function(e){return"ExpressionStatement"===e.type&&"StringLiteral"===e.expression.type&&!e.expression.extra.parenthesized},H.parseBlockBody=function(e,t,r,n){e.body=[],e.directives=[];for(var i=!1,s=void 0,a=void 0;!this.eat(n);){i||!this.state.containsOctal||a||(a=this.state.octalPosition);var o=this.parseStatement(!0,r);if(t&&!i&&this.isValidDirective(o)){var u=this.stmtToDirective(o);e.directives.push(u),void 0===s&&"use strict"===u.value.value&&(s=this.state.strict,this.setStrict(!0),a&&this.raise(a,"Octal literal in strict mode"))}else i=!0,e.body.push(o)}!1===s&&this.setStrict(!1)},H.parseFor=function(e,t){return e.init=t,this.expect(j.semi),e.test=this.match(j.semi)?null:this.parseExpression(),this.expect(j.semi),e.update=this.match(j.parenR)?null:this.parseExpression(),this.expect(j.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"ForStatement")},H.parseForIn=function(e,t,r){var n=void 0;return r?(this.eatContextual("of"),n="ForAwaitStatement"):(n=this.match(j._in)?"ForInStatement":"ForOfStatement",this.next()),e.left=t,e.right=this.parseExpression(),this.expect(j.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,n)},H.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r.keyword;;){var n=this.startNode();if(this.parseVarHead(n),this.eat(j.eq)?n.init=this.parseMaybeAssign(t):r!==j._const||this.match(j._in)||this.isContextual("of")?"Identifier"===n.id.type||t&&(this.match(j._in)||this.isContextual("of"))?n.init=null:this.raise(this.state.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(j.comma))break}return e},H.parseVarHead=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0,void 0,"variable declaration")},H.parseFunction=function(e,t,r,n,i){var s=this.state.inMethod;return this.state.inMethod=!1,this.initFunction(e,n),this.match(j.star)&&(e.async&&!this.hasPlugin("asyncGenerators")?this.unexpected():(e.generator=!0,this.next())),!t||i||this.match(j.name)||this.match(j._yield)||this.unexpected(),(this.match(j.name)||this.match(j._yield))&&(e.id=this.parseBindingIdentifier()),this.parseFunctionParams(e),this.parseFunctionBody(e,r),this.state.inMethod=s,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},H.parseFunctionParams=function(e){this.expect(j.parenL),e.params=this.parseBindingList(j.parenR)},H.parseClass=function(e,t,r){return this.next(),this.takeDecorators(e),this.parseClassId(e,t,r),this.parseClassSuper(e),this.parseClassBody(e),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},H.isClassProperty=function(){return this.match(j.eq)||this.isLineTerminator()},H.isClassMutatorStarter=function(){return!1},H.parseClassBody=function(e){var t=this.state.strict;this.state.strict=!0;var r=!1,n=!1,i=[],s=this.startNode();for(s.body=[],this.expect(j.braceL);!this.eat(j.braceR);)if(this.eat(j.semi))i.length>0&&this.raise(this.state.lastTokEnd,"Decorators must not be followed by a semicolon");else if(this.match(j.at))i.push(this.parseDecorator());else{var a=this.startNode();i.length&&(a.decorators=i,i=[]);var o=!1,u=this.match(j.name)&&"static"===this.state.value,l=this.eat(j.star),c=!1,p=!1;if(this.parsePropertyName(a),a.static=u&&!this.match(j.parenL),a.static&&(l=this.eat(j.star),this.parsePropertyName(a)),!l){if(this.isClassProperty()){s.body.push(this.parseClassProperty(a));continue}"Identifier"===a.key.type&&!a.computed&&this.hasPlugin("classConstructorCall")&&"call"===a.key.name&&this.match(j.name)&&"constructor"===this.state.value&&(o=!0,this.parsePropertyName(a))}var h=!this.match(j.parenL)&&!a.computed&&"Identifier"===a.key.type&&"async"===a.key.name;if(h&&(this.hasPlugin("asyncGenerators")&&this.eat(j.star)&&(l=!0),p=!0,this.parsePropertyName(a)),a.kind="method",!a.computed){var f=a.key;p||l||this.isClassMutatorStarter()||"Identifier"!==f.type||this.match(j.parenL)||"get"!==f.name&&"set"!==f.name||(c=!0,a.kind=f.name,f=this.parsePropertyName(a));var d=!(o||a.static||"constructor"!==f.name&&"constructor"!==f.value);d&&(n&&this.raise(f.start,"Duplicate constructor in the same class"),c&&this.raise(f.start,"Constructor can't have get/set modifier"),l&&this.raise(f.start,"Constructor can't be a generator"),p&&this.raise(f.start,"Constructor can't be an async function"),a.kind="constructor",n=!0);var m=a.static&&("prototype"===f.name||"prototype"===f.value);m&&this.raise(f.start,"Classes may not have static property named prototype")}o&&(r&&this.raise(a.start,"Duplicate constructor call in the same class"),a.kind="constructorCall",r=!0),"constructor"!==a.kind&&"constructorCall"!==a.kind||!a.decorators||this.raise(a.start,"You can't attach decorators to a class constructor"),this.parseClassMethod(s,a,l,p),c&&this.checkGetterSetterParamCount(a)}i.length&&this.raise(this.state.start,"You have trailing decorators with no method"),e.body=this.finishNode(s,"ClassBody"),this.state.strict=t},H.parseClassProperty=function(e){return this.match(j.eq)?(this.hasPlugin("classProperties")||this.unexpected(),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.finishNode(e,"ClassProperty")},H.parseClassMethod=function(e,t,r,n){this.parseMethod(t,r,n),e.body.push(this.finishNode(t,"ClassMethod"))},H.parseClassId=function(e,t,r){this.match(j.name)?e.id=this.parseIdentifier():r||!t?e.id=null:this.unexpected()},H.parseClassSuper=function(e){e.superClass=this.eat(j._extends)?this.parseExprSubscripts():null},H.parseExport=function(e){if(this.next(),this.match(j.star)){var t=this.startNode();if(this.next(),!this.hasPlugin("exportExtensions")||!this.eatContextual("as"))return this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration");t.exported=this.parseIdentifier(),e.specifiers=[this.finishNode(t,"ExportNamespaceSpecifier")],this.parseExportSpecifiersMaybe(e),this.parseExportFrom(e,!0)}else if(this.hasPlugin("exportExtensions")&&this.isExportDefaultSpecifier()){var r=this.startNode();if(r.exported=this.parseIdentifier(!0),e.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],this.match(j.comma)&&this.lookahead().type===j.star){this.expect(j.comma);var n=this.startNode();this.expect(j.star),this.expectContextual("as"),n.exported=this.parseIdentifier(),e.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier"))}else this.parseExportSpecifiersMaybe(e);this.parseExportFrom(e,!0)}else{if(this.eat(j._default)){var i=this.startNode(),s=!1;return this.eat(j._function)?i=this.parseFunction(i,!0,!1,!1,!0):this.match(j._class)?i=this.parseClass(i,!0,!0):(s=!0,i=this.parseMaybeAssign()),e.declaration=i,s&&this.semicolon(),this.checkExport(e,!0,!0),this.finishNode(e,"ExportDefaultDeclaration")}this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.declaration=this.parseExportDeclaration(e)):(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(e))}return this.checkExport(e,!0),this.finishNode(e,"ExportNamedDeclaration")},H.parseExportDeclaration=function(){return this.parseStatement(!0)},H.isExportDefaultSpecifier=function(){if(this.match(j.name))return"type"!==this.state.value&&"async"!==this.state.value&&"interface"!==this.state.value;if(!this.match(j._default))return!1;var e=this.lookahead();return e.type===j.comma||e.type===j.name&&"from"===e.value},H.parseExportSpecifiersMaybe=function(e){this.eat(j.comma)&&(e.specifiers=e.specifiers.concat(this.parseExportSpecifiers()))},H.parseExportFrom=function(e,t){this.eatContextual("from")?(e.source=this.match(j.string)?this.parseExprAtom():this.unexpected(),this.checkExport(e)):t?this.unexpected():e.source=null,this.semicolon()},H.shouldParseExportDeclaration=function(){return"var"===this.state.type.keyword||"const"===this.state.type.keyword||"let"===this.state.type.keyword||"function"===this.state.type.keyword||"class"===this.state.type.keyword||this.isContextual("async")},H.checkExport=function(e,t,r){if(t)if(r)this.checkDuplicateExports(e,"default");else if(e.specifiers&&e.specifiers.length)for(var n=e.specifiers,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;this.checkDuplicateExports(o,o.exported.name)}else if(e.declaration)if("FunctionDeclaration"===e.declaration.type||"ClassDeclaration"===e.declaration.type)this.checkDuplicateExports(e,e.declaration.id.name);else if("VariableDeclaration"===e.declaration.type)for(var u=e.declaration.declarations,l=Array.isArray(u),c=0,u=l?u:u[Symbol.iterator]();;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var h=p;this.checkDeclaration(h.id)}if(this.state.decorators.length){var f=e.declaration&&("ClassDeclaration"===e.declaration.type||"ClassExpression"===e.declaration.type);e.declaration&&f||this.raise(e.start,"You can only use decorators on an export when exporting a class"),this.takeDecorators(e.declaration)}},H.checkDeclaration=function(e){if("ObjectPattern"===e.type)for(var t=e.properties,r=Array.isArray(t),n=0,t=r?t:t[Symbol.iterator]();;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var s=i;this.checkDeclaration(s)}else if("ArrayPattern"===e.type)for(var a=e.elements,o=Array.isArray(a),u=0,a=o?a:a[Symbol.iterator]();;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;c&&this.checkDeclaration(c)}else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type||"RestProperty"===e.type?this.checkDeclaration(e.argument):"Identifier"===e.type&&this.checkDuplicateExports(e,e.name)},H.checkDuplicateExports=function(e,t){this.state.exportedIdentifiers.indexOf(t)>-1&&this.raiseDuplicateExportError(e,t),this.state.exportedIdentifiers.push(t)},H.raiseDuplicateExportError=function(e,t){this.raise(e.start,"default"===t?"Only one default export allowed per module.":"`"+t+"` has already been exported. Exported identifiers must be unique.")},H.parseExportSpecifiers=function(){var e=[],t=!0,r=void 0;for(this.expect(j.braceL);!this.eat(j.braceR);){if(t)t=!1;else if(this.expect(j.comma),this.eat(j.braceR))break;var n=this.match(j._default);n&&!r&&(r=!0);var i=this.startNode();i.local=this.parseIdentifier(n),i.exported=this.eatContextual("as")?this.parseIdentifier(!0):i.local.__clone(),e.push(this.finishNode(i,"ExportSpecifier"))}return r&&!this.isContextual("from")&&this.unexpected(),e},H.parseImport=function(e){return this.eat(j._import),this.match(j.string)?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=[],this.parseImportSpecifiers(e),this.expectContextual("from"),e.source=this.match(j.string)?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},H.parseImportSpecifiers=function(e){var t=!0;if(this.match(j.name)){var r=this.state.start,n=this.state.startLoc;if(e.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(),r,n)),!this.eat(j.comma))return}if(this.match(j.star)){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdentifier(),this.checkLVal(i.local,!0,void 0,"import namespace specifier"),void e.specifiers.push(this.finishNode(i,"ImportNamespaceSpecifier"))}for(this.expect(j.braceL);!this.eat(j.braceR);){if(t)t=!1;else if(this.eat(j.colon)&&this.unexpected(null,"ES2015 named imports do not destructure. Use another statement for destructuring after the import."),this.expect(j.comma),this.eat(j.braceR))break;this.parseImportSpecifier(e)}},H.parseImportSpecifier=function(e){var t=this.startNode();t.imported=this.parseIdentifier(!0),this.eatContextual("as")?t.local=this.parseIdentifier():(this.checkReservedWord(t.imported.name,t.start,!0,!0),t.local=t.imported.__clone()),this.checkLVal(t.local,!0,void 0,"import specifier"),e.specifiers.push(this.finishNode(t,"ImportSpecifier"))},H.parseImportSpecifierDefault=function(e,t,r){var n=this.startNodeAt(t,r);return n.local=e,this.checkLVal(n.local,!0,void 0,"default import specifier"),this.finishNode(n,"ImportDefaultSpecifier")};var ee=z.prototype;ee.toAssignable=function(e,t,r){if(e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=e.properties,i=Array.isArray(n),s=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if(s=n.next(),s.done)break;a=s.value}var o=a;"ObjectMethod"===o.type?"get"===o.kind||"set"===o.kind?this.raise(o.key.start,"Object pattern can't contain getter or setter"):this.raise(o.key.start,"Object pattern can't contain methods"):this.toAssignable(o,t,"object destructuring pattern")}break;case"ObjectProperty":this.toAssignable(e.value,t,r);break;case"SpreadProperty":e.type="RestProperty";break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t,r);break;case"AssignmentExpression":"="===e.operator?(e.type="AssignmentPattern",delete e.operator):this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!t)break;default:var u="Invalid left-hand side"+(r?" in "+r:"expression");this.raise(e.start,u)}return e},ee.toAssignableList=function(e,t,r){var n=e.length;if(n){var i=e[n-1];if(i&&"RestElement"===i.type)--n;else if(i&&"SpreadElement"===i.type){i.type="RestElement";var s=i.argument;this.toAssignable(s,t,r),"Identifier"!==s.type&&"MemberExpression"!==s.type&&"ArrayPattern"!==s.type&&this.unexpected(s.start),--n}}for(var a=0;a=s.length)break;u=s[o++]}else{if(o=s.next(),o.done)break;u=o.value}var l=u +;"ObjectProperty"===l.type&&(l=l.value),this.checkLVal(l,t,r,"object destructuring pattern")}break;case"ArrayPattern":for(var c=e.elements,p=Array.isArray(c),h=0,c=p?c:c[Symbol.iterator]();;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if(h=c.next(),h.done)break;f=h.value}var d=f;d&&this.checkLVal(d,t,r,"array destructuring pattern")}break;case"AssignmentPattern":this.checkLVal(e.left,t,r,"assignment pattern");break;case"RestProperty":this.checkLVal(e.argument,t,r,"rest property");break;case"RestElement":this.checkLVal(e.argument,t,r,"rest element");break;default:var m=(t?"Binding invalid":"Invalid")+" left-hand side"+(n?" in "+n:"expression");this.raise(e.start,m)}};var te=z.prototype;te.checkPropClash=function(e,t){if(!e.computed&&!e.kind){var r=e.key;"__proto__"===("Identifier"===r.type?r.name:String(r.value))&&(t.proto&&this.raise(r.start,"Redefinition of __proto__ property"),t.proto=!0)}},te.getExpression=function(){this.nextToken();var e=this.parseExpression();return this.match(j.eof)||this.unexpected(),e},te.parseExpression=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeAssign(e,t);if(this.match(j.comma)){var s=this.startNodeAt(r,n);for(s.expressions=[i];this.eat(j.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return i},te.parseMaybeAssign=function(e,t,r,n){var i=this.state.start,s=this.state.startLoc;if(this.match(j._yield)&&this.state.inGenerator){var a=this.parseYield();return r&&(a=r.call(this,a,i,s)),a}var o=void 0;t?o=!1:(t={start:0},o=!0),(this.match(j.parenL)||this.match(j.name))&&(this.state.potentialArrowAt=this.state.start);var u=this.parseMaybeConditional(e,t,n);if(r&&(u=r.call(this,u,i,s)),this.state.type.isAssign){var l=this.startNodeAt(i,s);if(l.operator=this.state.value,l.left=this.match(j.eq)?this.toAssignable(u,void 0,"assignment expression"):u,t.start=0,this.checkLVal(u,void 0,void 0,"assignment expression"),u.extra&&u.extra.parenthesized){var c=void 0;"ObjectPattern"===u.type?c="`({a}) = 0` use `({a} = 0)`":"ArrayPattern"===u.type&&(c="`([a]) = 0` use `([a] = 0)`"),c&&this.raise(u.start,"You're trying to assign to a parenthesized expression, eg. instead of "+c)}return this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,"AssignmentExpression")}return o&&t.start&&this.unexpected(t.start),u},te.parseMaybeConditional=function(e,t,r){var n=this.state.start,i=this.state.startLoc,s=this.parseExprOps(e,t);return t&&t.start?s:this.parseConditional(s,e,n,i,r)},te.parseConditional=function(e,t,r,n){if(this.eat(j.question)){var i=this.startNodeAt(r,n);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(j.colon),i.alternate=this.parseMaybeAssign(t),this.finishNode(i,"ConditionalExpression")}return e},te.parseExprOps=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeUnary(t);return t&&t.start?i:this.parseExprOp(i,r,n,-1,e)},te.parseExprOp=function(e,t,r,n,i){var s=this.state.type.binop;if(!(null==s||i&&this.match(j._in))&&s>n){var a=this.startNodeAt(t,r);a.left=e,a.operator=this.state.value,"**"!==a.operator||"UnaryExpression"!==e.type||!e.extra||e.extra.parenthesizedArgument||e.extra.parenthesized||this.raise(e.argument.start,"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");var o=this.state.type;this.next();var u=this.state.start,l=this.state.startLoc;return a.right=this.parseExprOp(this.parseMaybeUnary(),u,l,o.rightAssociative?s-1:s,i),this.finishNode(a,o===j.logicalOR||o===j.logicalAND?"LogicalExpression":"BinaryExpression"),this.parseExprOp(a,t,r,n,i)}return e},te.parseMaybeUnary=function(e){if(this.state.type.prefix){var t=this.startNode(),r=this.match(j.incDec);t.operator=this.state.value,t.prefix=!0,this.next();var n=this.state.type;return t.argument=this.parseMaybeUnary(),this.addExtra(t,"parenthesizedArgument",!(n!==j.parenL||t.argument.extra&&t.argument.extra.parenthesized)),e&&e.start&&this.unexpected(e.start),r?this.checkLVal(t.argument,void 0,void 0,"prefix operation"):this.state.strict&&"delete"===t.operator&&"Identifier"===t.argument.type&&this.raise(t.start,"Deleting local variable in strict mode"),this.finishNode(t,r?"UpdateExpression":"UnaryExpression")}var i=this.state.start,s=this.state.startLoc,a=this.parseExprSubscripts(e);if(e&&e.start)return a;for(;this.state.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,s);o.operator=this.state.value,o.prefix=!1,o.argument=a,this.checkLVal(a,void 0,void 0,"postfix operation"),this.next(),a=this.finishNode(o,"UpdateExpression")}return a},te.parseExprSubscripts=function(e){var t=this.state.start,r=this.state.startLoc,n=this.state.potentialArrowAt,i=this.parseExprAtom(e);return"ArrowFunctionExpression"===i.type&&i.start===n?i:e&&e.start?i:this.parseSubscripts(i,t,r)},te.parseSubscripts=function(e,t,r,n){for(;;){if(!n&&this.eat(j.doubleColon)){var i=this.startNodeAt(t,r);return i.object=e,i.callee=this.parseNoCallExpr(),this.parseSubscripts(this.finishNode(i,"BindExpression"),t,r,n)}if(this.eat(j.dot)){var s=this.startNodeAt(t,r);s.object=e,s.property=this.parseIdentifier(!0),s.computed=!1,e=this.finishNode(s,"MemberExpression")}else if(this.eat(j.bracketL)){var a=this.startNodeAt(t,r);a.object=e,a.property=this.parseExpression(),a.computed=!0,this.expect(j.bracketR),e=this.finishNode(a,"MemberExpression")}else if(!n&&this.match(j.parenL)){var o=this.state.potentialArrowAt===e.start&&"Identifier"===e.type&&"async"===e.name&&!this.canInsertSemicolon();this.next();var u=this.startNodeAt(t,r);if(u.callee=e,u.arguments=this.parseCallExpressionArguments(j.parenR,o),"Import"===u.callee.type&&1!==u.arguments.length&&this.raise(u.start,"import() requires exactly one argument"),e=this.finishNode(u,"CallExpression"),o&&this.shouldParseAsyncArrow())return this.parseAsyncArrowFromCallExpression(this.startNodeAt(t,r),u);this.toReferencedList(u.arguments)}else{if(!this.match(j.backQuote))return e;var l=this.startNodeAt(t,r);l.tag=e,l.quasi=this.parseTemplate(),e=this.finishNode(l,"TaggedTemplateExpression")}}},te.parseCallExpressionArguments=function(e,t){for(var r=[],n=void 0,i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(j.comma),this.eat(e))break;this.match(j.parenL)&&!n&&(n=this.state.start),r.push(this.parseExprListItem(!1,t?{start:0}:void 0,t?{start:0}:void 0))}return t&&n&&this.shouldParseAsyncArrow()&&this.unexpected(),r},te.shouldParseAsyncArrow=function(){return this.match(j.arrow)},te.parseAsyncArrowFromCallExpression=function(e,t){return this.expect(j.arrow),this.parseArrowExpression(e,t.arguments,!0)},te.parseNoCallExpr=function(){var e=this.state.start,t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,t,!0)},te.parseExprAtom=function(e){var t=this.state.potentialArrowAt===this.state.start,r=void 0;switch(this.state.type){case j._super:return this.state.inMethod||this.options.allowSuperOutsideMethod||this.raise(this.state.start,"'super' outside of function or class"),r=this.startNode(),this.next(),this.match(j.parenL)||this.match(j.bracketL)||this.match(j.dot)||this.unexpected(),this.match(j.parenL)&&"constructor"!==this.state.inMethod&&!this.options.allowSuperOutsideMethod&&this.raise(r.start,"super() outside of class constructor"),this.finishNode(r,"Super");case j._import:return this.hasPlugin("dynamicImport")||this.unexpected(),r=this.startNode(),this.next(),this.match(j.parenL)||this.unexpected(null,j.parenL),this.finishNode(r,"Import");case j._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case j._yield:this.state.inGenerator&&this.unexpected();case j.name:r=this.startNode();var n="await"===this.state.value&&this.state.inAsync,i=this.shouldAllowYieldIdentifier(),s=this.parseIdentifier(n||i);if("await"===s.name){if(this.state.inAsync||this.inModule)return this.parseAwait(r)}else{if("async"===s.name&&this.match(j._function)&&!this.canInsertSemicolon())return this.next(),this.parseFunction(r,!1,!1,!0);if(t&&"async"===s.name&&this.match(j.name)){var a=[this.parseIdentifier()];return this.expect(j.arrow),this.parseArrowExpression(r,a,!0)}}return t&&!this.canInsertSemicolon()&&this.eat(j.arrow)?this.parseArrowExpression(r,[s]):s;case j._do:if(this.hasPlugin("doExpressions")){var o=this.startNode();this.next();var u=this.state.inFunction,l=this.state.labels;return this.state.labels=[],this.state.inFunction=!1,o.body=this.parseBlock(!1,!0),this.state.inFunction=u,this.state.labels=l,this.finishNode(o,"DoExpression")}case j.regexp:var c=this.state.value;return r=this.parseLiteral(c.value,"RegExpLiteral"),r.pattern=c.pattern,r.flags=c.flags,r;case j.num:return this.parseLiteral(this.state.value,"NumericLiteral");case j.string:return this.parseLiteral(this.state.value,"StringLiteral");case j._null:return r=this.startNode(),this.next(),this.finishNode(r,"NullLiteral");case j._true:case j._false:return r=this.startNode(),r.value=this.match(j._true),this.next(),this.finishNode(r,"BooleanLiteral");case j.parenL:return this.parseParenAndDistinguishExpression(null,null,t);case j.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(j.bracketR,!0,e),this.toReferencedList(r.elements),this.finishNode(r,"ArrayExpression");case j.braceL:return this.parseObj(!1,e);case j._function:return this.parseFunctionExpression();case j.at:this.parseDecorators();case j._class:return r=this.startNode(),this.takeDecorators(r),this.parseClass(r,!1);case j._new:return this.parseNew();case j.backQuote:return this.parseTemplate();case j.doubleColon:r=this.startNode(),this.next(),r.object=null;var p=r.callee=this.parseNoCallExpr();if("MemberExpression"===p.type)return this.finishNode(r,"BindExpression");this.raise(p.start,"Binding should be performed on object property.");default:this.unexpected()}},te.parseFunctionExpression=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.state.inGenerator&&this.eat(j.dot)&&this.hasPlugin("functionSent")?this.parseMetaProperty(e,t,"sent"):this.parseFunction(e,!1)},te.parseMetaProperty=function(e,t,r){return e.meta=t,e.property=this.parseIdentifier(!0),e.property.name!==r&&this.raise(e.property.start,"The only valid meta property for new is "+t.name+"."+r),this.finishNode(e,"MetaProperty")},te.parseLiteral=function(e,t,r,n){r=r||this.state.start,n=n||this.state.startLoc;var i=this.startNodeAt(r,n);return this.addExtra(i,"rawValue",e),this.addExtra(i,"raw",this.input.slice(r,this.state.end)),i.value=e,this.next(),this.finishNode(i,t)},te.parseParenExpression=function(){this.expect(j.parenL);var e=this.parseExpression();return this.expect(j.parenR),e},te.parseParenAndDistinguishExpression=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;var n=void 0;this.expect(j.parenL);for(var i=this.state.start,s=this.state.startLoc,a=[],o={start:0},u={start:0},l=!0,c=void 0,p=void 0;!this.match(j.parenR);){if(l)l=!1;else if(this.expect(j.comma,u.start||null),this.match(j.parenR)){p=this.state.start;break}if(this.match(j.ellipsis)){var h=this.state.start,f=this.state.startLoc;c=this.state.start,a.push(this.parseParenItem(this.parseRest(),f,h));break}a.push(this.parseMaybeAssign(!1,o,this.parseParenItem,u))}var d=this.state.start,m=this.state.startLoc;this.expect(j.parenR);var y=this.startNodeAt(e,t);if(r&&this.shouldParseArrow()&&(y=this.parseArrow(y))){for(var g=a,b=Array.isArray(g),v=0,g=b?g:g[Symbol.iterator]();;){var x;if(b){if(v>=g.length)break;x=g[v++]}else{if(v=g.next(),v.done)break;x=v.value}var E=x;E.extra&&E.extra.parenthesized&&this.unexpected(E.extra.parenStart)}return this.parseArrowExpression(y,a)}return a.length||this.unexpected(this.state.lastTokStart),p&&this.unexpected(p),c&&this.unexpected(c),o.start&&this.unexpected(o.start),u.start&&this.unexpected(u.start),a.length>1?(n=this.startNodeAt(i,s),n.expressions=a,this.toReferencedList(n.expressions),this.finishNodeAt(n,"SequenceExpression",d,m)):n=a[0],this.addExtra(n,"parenthesized",!0),this.addExtra(n,"parenStart",e),n},te.shouldParseArrow=function(){return!this.canInsertSemicolon()},te.parseArrow=function(e){if(this.eat(j.arrow))return e},te.parseParenItem=function(e){return e},te.parseNew=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.eat(j.dot)?this.parseMetaProperty(e,t,"target"):(e.callee=this.parseNoCallExpr(),this.eat(j.parenL)?(e.arguments=this.parseExprList(j.parenR),this.toReferencedList(e.arguments)):e.arguments=[],this.finishNode(e,"NewExpression"))},te.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.state.start,this.state.end).replace(/\r\n?/g,"\n"),cooked:this.state.value},this.next(),e.tail=this.match(j.backQuote),this.finishNode(e,"TemplateElement")},te.parseTemplate=function(){var e=this.startNode();this.next(),e.expressions=[];var t=this.parseTemplateElement();for(e.quasis=[t];!t.tail;)this.expect(j.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(j.braceR),e.quasis.push(t=this.parseTemplateElement());return this.next(),this.finishNode(e,"TemplateLiteral")},te.parseObj=function(e,t){var r=[],n=Object.create(null),i=!0,s=this.startNode();s.properties=[],this.next();for(var a=null;!this.eat(j.braceR);){if(i)i=!1;else if(this.expect(j.comma),this.eat(j.braceR))break;for(;this.match(j.at);)r.push(this.parseDecorator());var o=this.startNode(),u=!1,l=!1,c=void 0,p=void 0;if(r.length&&(o.decorators=r,r=[]),this.hasPlugin("objectRestSpread")&&this.match(j.ellipsis)){if(o=this.parseSpread(e?{start:0}:void 0),o.type=e?"RestProperty":"SpreadProperty",e&&this.toAssignable(o.argument,!0,"object pattern"),s.properties.push(o),!e)continue;var h=this.state.start;if(null===a){if(this.eat(j.braceR))break;if(this.match(j.comma)&&this.lookahead().type===j.braceR)continue;a=h;continue}this.unexpected(a,"Cannot have multiple rest elements when destructuring")}if(o.method=!1,o.shorthand=!1,(e||t)&&(c=this.state.start,p=this.state.startLoc),e||(u=this.eat(j.star)),!e&&this.isContextual("async")){u&&this.unexpected();var f=this.parseIdentifier();this.match(j.colon)||this.match(j.parenL)||this.match(j.braceR)||this.match(j.eq)||this.match(j.comma)?(o.key=f,o.computed=!1):(l=!0,this.hasPlugin("asyncGenerators")&&(u=this.eat(j.star)),this.parsePropertyName(o))}else this.parsePropertyName(o);this.parseObjPropValue(o,c,p,u,l,e,t),this.checkPropClash(o,n),o.shorthand&&this.addExtra(o,"shorthand",!0),s.properties.push(o)}return null!==a&&this.unexpected(a,"The rest element has to be the last element when destructuring"),r.length&&this.raise(this.state.start,"You have trailing decorators with no property"),this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},te.isGetterOrSetterMethod=function(e,t){return!t&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&(this.match(j.string)||this.match(j.num)||this.match(j.bracketL)||this.match(j.name)||this.state.type.keyword)},te.checkGetterSetterParamCount=function(e){var t="get"===e.kind?0:1;if(e.params.length!==t){var r=e.start;"get"===e.kind?this.raise(r,"getter should have no params"):this.raise(r,"setter should have exactly one param")}},te.parseObjectMethod=function(e,t,r,n){return r||t||this.match(j.parenL)?(n&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,r),this.finishNode(e,"ObjectMethod")):this.isGetterOrSetterMethod(e,n)?((t||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),this.parseMethod(e),this.checkGetterSetterParamCount(e),this.finishNode(e,"ObjectMethod")):void 0},te.parseObjectProperty=function(e,t,r,n,i){return this.eat(j.colon)?(e.value=n?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssign(!1,i),this.finishNode(e,"ObjectProperty")):e.computed||"Identifier"!==e.key.type?void 0:(n?(this.checkReservedWord(e.key.name,e.key.start,!0,!0),e.value=this.parseMaybeDefault(t,r,e.key.__clone())):this.match(j.eq)&&i?(i.start||(i.start=this.state.start),e.value=this.parseMaybeDefault(t,r,e.key.__clone())):e.value=e.key.__clone(),e.shorthand=!0,this.finishNode(e,"ObjectProperty"))},te.parseObjPropValue=function(e,t,r,n,i,s,a){var o=this.parseObjectMethod(e,n,i,s)||this.parseObjectProperty(e,t,r,s,a);return o||this.unexpected(),o},te.parsePropertyName=function(e){if(this.eat(j.bracketL))e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(j.bracketR);else{e.computed=!1;var t=this.state.inPropertyName;this.state.inPropertyName=!0,e.key=this.match(j.num)||this.match(j.string)?this.parseExprAtom():this.parseIdentifier(!0),this.state.inPropertyName=t}return e.key},te.initFunction=function(e,t){e.id=null,e.generator=!1,e.expression=!1,e.async=!!t},te.parseMethod=function(e,t,r){var n=this.state.inMethod;return this.state.inMethod=e.kind||!0,this.initFunction(e,r),this.expect(j.parenL),e.params=this.parseBindingList(j.parenR),e.generator=!!t,this.parseFunctionBody(e),this.state.inMethod=n,e},te.parseArrowExpression=function(e,t,r){return this.initFunction(e,r),e.params=this.toAssignableList(t,!0,"arrow function parameters"),this.parseFunctionBody(e,!0),this.finishNode(e,"ArrowFunctionExpression")},te.isStrictBody=function(e,t){if(!t&&e.body.directives.length)for(var r=e.body.directives,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if("use strict"===a.value.value)return!0}return!1},te.parseFunctionBody=function(e,t){var r=t&&!this.match(j.braceL),n=this.state.inAsync;if(this.state.inAsync=e.async,r)e.body=this.parseMaybeAssign(),e.expression=!0;else{var i=this.state.inFunction,s=this.state.inGenerator,a=this.state.labels;this.state.inFunction=!0,this.state.inGenerator=e.generator,this.state.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.state.inFunction=i,this.state.inGenerator=s,this.state.labels=a}this.state.inAsync=n;var o=this.isStrictBody(e,r),u=this.state.strict||t||o;if(o&&e.id&&"Identifier"===e.id.type&&"yield"===e.id.name&&this.raise(e.id.start,"Binding yield in strict mode"),u){var l=Object.create(null),c=this.state.strict;o&&(this.state.strict=!0),e.id&&this.checkLVal(e.id,!0,void 0,"function name");for(var p=e.params,h=Array.isArray(p),f=0,p=h?p:p[Symbol.iterator]();;){var d;if(h){if(f>=p.length)break;d=p[f++]}else{if(f=p.next(),f.done)break;d=f.value}var m=d;o&&"Identifier"!==m.type&&this.raise(m.start,"Non-simple parameter in strict mode"),this.checkLVal(m,!0,l,"function parameter list")}this.state.strict=c}},te.parseExprList=function(e,t,r){for(var n=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(j.comma),this.eat(e))break;n.push(this.parseExprListItem(t,r))}return n},te.parseExprListItem=function(e,t,r){return e&&this.match(j.comma)?null:this.match(j.ellipsis)?this.parseSpread(t):this.parseMaybeAssign(!1,t,this.parseParenItem,r)},te.parseIdentifier=function(e){var t=this.startNode();return e||this.checkReservedWord(this.state.value,this.state.start,!!this.state.type.keyword,!1),this.match(j.name)?t.name=this.state.value:this.state.type.keyword?t.name=this.state.type.keyword:this.unexpected(),!e&&"await"===t.name&&this.state.inAsync&&this.raise(t.start,"invalid use of await inside of an async function"),t.loc.identifierName=t.name,this.next(),this.finishNode(t,"Identifier")},te.checkReservedWord=function(e,t,r,n){(this.isReservedWord(e)||r&&this.isKeyword(e))&&this.raise(t,e+" is a reserved word"),this.state.strict&&(g.strict(e)||n&&g.strictBind(e))&&this.raise(t,e+" is a reserved word in strict mode")},te.parseAwait=function(e){return this.state.inAsync||this.unexpected(),this.match(j.star)&&this.raise(e.start,"await* has been removed from the async functions proposal. Use Promise.all() instead."),e.argument=this.parseMaybeUnary(),this.finishNode(e,"AwaitExpression")},te.parseYield=function(){var e=this.startNode();return this.next(),this.match(j.semi)||this.canInsertSemicolon()||!this.match(j.star)&&!this.state.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(j.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")};var re=z.prototype,ne=["leadingComments","trailingComments","innerComments"],ie=function(){function e(t,r,n){w(this,e),this.type="",this.start=t,this.end=0,this.loc=new q(r),n&&(this.loc.filename=n)}return e.prototype.__clone=function(){var t=new e;for(var r in this)ne.indexOf(r)<0&&(t[r]=this[r]);return t},e}();re.startNode=function(){return new ie(this.state.start,this.state.startLoc,this.filename)},re.startNodeAt=function(e,t){return new ie(e,t,this.filename)},re.finishNode=function(e,t){return p.call(this,e,t,this.state.lastTokEnd,this.state.lastTokEndLoc)},re.finishNodeAt=function(e,t,r,n){return p.call(this,e,t,r,n)},z.prototype.raise=function(e,t){var r=l(this.input,e);t+=" ("+r.line+":"+r.column+")";var n=new SyntaxError(t);throw n.pos=e,n.loc=r,n};var se=z.prototype;se.addComment=function(e){this.filename&&(e.loc.filename=this.filename),this.state.trailingComments.push(e),this.state.leadingComments.push(e)},se.processComment=function(e){if(!("Program"===e.type&&e.body.length>0)){var t=this.state.commentStack,r=void 0,n=void 0,i=void 0,s=void 0;if(this.state.trailingComments.length>0)this.state.trailingComments[0].start>=e.end?(n=this.state.trailingComments,this.state.trailingComments=[]):this.state.trailingComments.length=0;else{var a=h(t);t.length>0&&a.trailingComments&&a.trailingComments[0].start>=e.end&&(n=a.trailingComments,a.trailingComments=null)}for(;t.length>0&&h(t).start>=e.start;)r=t.pop();if(r){if(r.leadingComments)if(r!==e&&h(r.leadingComments).end<=e.start)e.leadingComments=r.leadingComments,r.leadingComments=null;else for(i=r.leadingComments.length-2;i>=0;--i)if(r.leadingComments[i].end<=e.start){e.leadingComments=r.leadingComments.splice(0,i+1);break}}else if(this.state.leadingComments.length>0)if(h(this.state.leadingComments).end<=e.start){if(this.state.commentPreviousNode)for(s=0;s0&&(e.leadingComments=this.state.leadingComments,this.state.leadingComments=[])}else{for(i=0;ie.start);i++);e.leadingComments=this.state.leadingComments.slice(0,i),0===e.leadingComments.length&&(e.leadingComments=null),n=this.state.leadingComments.slice(i),0===n.length&&(n=null)}this.state.commentPreviousNode=e,n&&(n.length&&n[0].start>=e.start&&h(n).end<=e.end?e.innerComments=n:e.trailingComments=n),t.push(e)}};var ae=z.prototype;ae.estreeParseRegExpLiteral=function(e){var t=e.pattern,r=e.flags,n=null;try{n=new RegExp(t,r)}catch(e){}var i=this.estreeParseLiteral(n);return i.regex={pattern:t,flags:r},i},ae.estreeParseLiteral=function(e){return this.parseLiteral(e,"Literal")},ae.directiveToStmt=function(e){var t=e.value,r=this.startNodeAt(e.start,e.loc.start),n=this.startNodeAt(t.start,t.loc.start);return n.value=t.value,n.raw=t.extra.raw,r.expression=this.finishNodeAt(n,"Literal",t.end,t.loc.end),r.directive=t.extra.raw.slice(1,-1),this.finishNodeAt(r,"ExpressionStatement",e.end,e.loc.end)};var oe=function(e){e.extend("checkDeclaration",function(e){return function(t){f(t)?this.checkDeclaration(t.value):e.call(this,t)}}),e.extend("checkGetterSetterParamCount",function(){return function(e){var t="get"===e.kind?0:1;if(e.value.params.length!==t){var r=e.start;"get"===e.kind?this.raise(r,"getter should have no params"):this.raise(r,"setter should have exactly one param")}}}),e.extend("checkLVal",function(e){return function(t,r,n){var i=this;switch(t.type){case"ObjectPattern":t.properties.forEach(function(e){i.checkLVal("Property"===e.type?e.value:e,r,n,"object destructuring pattern")});break;default:for(var s=arguments.length,a=Array(s>3?s-3:0),o=3;o0)for(var r=e.body.body,n=Array.isArray(r),i=0,r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if(i=r.next(),i.done)break;s=i.value}var a=s;if("ExpressionStatement"!==a.type||"Literal"!==a.expression.type)break;if("use strict"===a.expression.value)return!0}return!1}}),e.extend("isValidDirective",function(){return function(e){return!("ExpressionStatement"!==e.type||"Literal"!==e.expression.type||"string"!=typeof e.expression.value||e.expression.extra&&e.expression.extra.parenthesized)}}),e.extend("parseBlockBody",function(e){return function(t){for(var r=this,n=arguments.length,i=Array(n>1?n-1:0),s=1;s1?r-1:0),i=1;i1?n-1:0),s=1;s2?n-2:0),s=2;s=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;"get"===c.kind||"set"===c.kind?this.raise(c.key.start,"Object pattern can't contain getter or setter"):c.method?this.raise(c.key.start,"Object pattern can't contain methods"):this.toAssignable(c,r,"object destructuring pattern")}return t}return e.call.apply(e,[this,t,r].concat(i))}})},ue=["any","mixed","empty","bool","boolean","number","string","void","null"],le=z.prototype;le.flowParseTypeInitialiser=function(e){var t=this.state.inType;this.state.inType=!0,this.expect(e||j.colon);var r=this.flowParseType();return this.state.inType=t,r},le.flowParsePredicate=function(){var e=this.startNode(),t=this.state.startLoc,r=this.state.start;this.expect(j.modulo);var n=this.state.startLoc;return this.expectContextual("checks"),t.line===n.line&&t.column===n.column-1||this.raise(r,"Spaces between ´%´ and ´checks´ are not allowed here."),this.eat(j.parenL)?(e.expression=this.parseExpression(),this.expect(j.parenR),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")},le.flowParseTypeAndPredicateInitialiser=function(){var e=this.state.inType;this.state.inType=!0,this.expect(j.colon);var t=null,r=null;return this.match(j.modulo)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(j.modulo)&&(r=this.flowParsePredicate())),[t,r]},le.flowParseDeclareClass=function(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")},le.flowParseDeclareFunction=function(e){this.next();var t=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.isRelational("<")?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(j.parenL);var i=this.flowParseFunctionTypeParams();r.params=i.params,r.rest=i.rest,this.expect(j.parenR);var s=null,a=this.flowParseTypeAndPredicateInitialiser();return r.returnType=a[0],s=a[1],n.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),n.predicate=s,t.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.finishNode(t,t.type),this.semicolon(),this.finishNode(e,"DeclareFunction")},le.flowParseDeclare=function(e){return this.match(j._class)?this.flowParseDeclareClass(e):this.match(j._function)?this.flowParseDeclareFunction(e):this.match(j._var)?this.flowParseDeclareVariable(e):this.isContextual("module")?this.lookahead().type===j.dot?this.flowParseDeclareModuleExports(e):this.flowParseDeclareModule(e):this.isContextual("type")?this.flowParseDeclareTypeAlias(e):this.isContextual("interface")?this.flowParseDeclareInterface(e):void this.unexpected()},le.flowParseDeclareVariable=function(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.semicolon(),this.finishNode(e,"DeclareVariable")},le.flowParseDeclareModule=function(e){this.next(),this.match(j.string)?e.id=this.parseExprAtom():e.id=this.parseIdentifier();var t=e.body=this.startNode(),r=t.body=[];for(this.expect(j.braceL);!this.match(j.braceR);){var n=this.startNode();if(this.match(j._import)){var i=this.lookahead();"type"!==i.value&&"typeof"!==i.value&&this.unexpected(null,"Imports within a `declare module` body must always be `import type` or `import typeof`"),this.parseImport(n)}else this.expectContextual("declare","Only declares and type imports are allowed inside declare module"),n=this.flowParseDeclare(n,!0);r.push(n)}return this.expect(j.braceR),this.finishNode(t,"BlockStatement"),this.finishNode(e,"DeclareModule")},le.flowParseDeclareModuleExports=function(e){return this.expectContextual("module"),this.expect(j.dot),this.expectContextual("exports"),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")},le.flowParseDeclareTypeAlias=function(e){return this.next(),this.flowParseTypeAlias(e),this.finishNode(e,"DeclareTypeAlias")},le.flowParseDeclareInterface=function(e){return this.next(),this.flowParseInterfaceish(e),this.finishNode(e,"DeclareInterface")},le.flowParseInterfaceish=function(e,t){if(e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],e.mixins=[],this.eat(j._extends))do{e.extends.push(this.flowParseInterfaceExtends())}while(this.eat(j.comma));if(this.isContextual("mixins")){this.next();do{e.mixins.push(this.flowParseInterfaceExtends())}while(this.eat(j.comma))}e.body=this.flowParseObjectType(t)},le.flowParseInterfaceExtends=function(){var e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")},le.flowParseInterface=function(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")},le.flowParseRestrictedIdentifier=function(e){ +return ue.indexOf(this.state.value)>-1&&this.raise(this.state.start,"Cannot overwrite primitive type "+this.state.value),this.parseIdentifier(e)},le.flowParseTypeAlias=function(e){return e.id=this.flowParseRestrictedIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(j.eq),this.semicolon(),this.finishNode(e,"TypeAlias")},le.flowParseTypeParameter=function(){var e=this.startNode(),t=this.flowParseVariance(),r=this.flowParseTypeAnnotatableIdentifier();return e.name=r.name,e.variance=t,e.bound=r.typeAnnotation,this.match(j.eq)&&(this.eat(j.eq),e.default=this.flowParseType()),this.finishNode(e,"TypeParameter")},le.flowParseTypeParameterDeclaration=function(){var e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.isRelational("<")||this.match(j.jsxTagStart)?this.next():this.unexpected();do{t.params.push(this.flowParseTypeParameter()),this.isRelational(">")||this.expect(j.comma)}while(!this.isRelational(">"));return this.expectRelational(">"),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")},le.flowParseTypeParameterInstantiation=function(){var e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flowParseType()),this.isRelational(">")||this.expect(j.comma);return this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")},le.flowParseObjectPropertyKey=function(){return this.match(j.num)||this.match(j.string)?this.parseExprAtom():this.parseIdentifier(!0)},le.flowParseObjectTypeIndexer=function(e,t,r){return e.static=t,this.expect(j.bracketL),this.lookahead().type===j.colon?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(j.bracketR),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeIndexer")},le.flowParseObjectTypeMethodish=function(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(j.parenL);this.match(j.name);)e.params.push(this.flowParseFunctionTypeParam()),this.match(j.parenR)||this.expect(j.comma);return this.eat(j.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),this.expect(j.parenR),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")},le.flowParseObjectTypeMethod=function(e,t,r,n){var i=this.startNodeAt(e,t);return i.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e,t)),i.static=r,i.key=n,i.optional=!1,this.flowObjectTypeSemicolon(),this.finishNode(i,"ObjectTypeProperty")},le.flowParseObjectTypeCallProperty=function(e,t){var r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeCallProperty")},le.flowParseObjectType=function(e,t){var r=this.state.inType;this.state.inType=!0;var n=this.startNode(),i=void 0,s=void 0,a=!1;n.callProperties=[],n.properties=[],n.indexers=[];var o=void 0,u=void 0;for(t&&this.match(j.braceBarL)?(this.expect(j.braceBarL),o=j.braceBarR,u=!0):(this.expect(j.braceL),o=j.braceR,u=!1),n.exact=u;!this.match(o);){var l=!1,c=this.state.start,p=this.state.startLoc;i=this.startNode(),e&&this.isContextual("static")&&this.lookahead().type!==j.colon&&(this.next(),a=!0);var h=this.state.start,f=this.flowParseVariance();this.match(j.bracketL)?n.indexers.push(this.flowParseObjectTypeIndexer(i,a,f)):this.match(j.parenL)||this.isRelational("<")?(f&&this.unexpected(h),n.callProperties.push(this.flowParseObjectTypeCallProperty(i,a))):(s=this.flowParseObjectPropertyKey(),this.isRelational("<")||this.match(j.parenL)?(f&&this.unexpected(h),n.properties.push(this.flowParseObjectTypeMethod(c,p,a,s))):(this.eat(j.question)&&(l=!0),i.key=s,i.value=this.flowParseTypeInitialiser(),i.optional=l,i.static=a,i.variance=f,this.flowObjectTypeSemicolon(),n.properties.push(this.finishNode(i,"ObjectTypeProperty")))),a=!1}this.expect(o);var d=this.finishNode(n,"ObjectTypeAnnotation");return this.state.inType=r,d},le.flowObjectTypeSemicolon=function(){this.eat(j.semi)||this.eat(j.comma)||this.match(j.braceR)||this.match(j.braceBarR)||this.unexpected()},le.flowParseQualifiedTypeIdentifier=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;for(var n=r||this.parseIdentifier();this.eat(j.dot);){var i=this.startNodeAt(e,t);i.qualification=n,i.id=this.parseIdentifier(),n=this.finishNode(i,"QualifiedTypeIdentifier")}return n},le.flowParseGenericType=function(e,t,r){var n=this.startNodeAt(e,t);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t,r),this.isRelational("<")&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")},le.flowParseTypeofType=function(){var e=this.startNode();return this.expect(j._typeof),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")},le.flowParseTupleType=function(){var e=this.startNode();for(e.types=[],this.expect(j.bracketL);this.state.pos0&&void 0!==arguments[0]?arguments[0]:[],t={params:e,rest:null};!this.match(j.parenR)&&!this.match(j.ellipsis);)t.params.push(this.flowParseFunctionTypeParam()),this.match(j.parenR)||this.expect(j.comma);return this.eat(j.ellipsis)&&(t.rest=this.flowParseFunctionTypeParam()),t},le.flowIdentToTypeAnnotation=function(e,t,r,n){switch(n.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"void":return this.finishNode(r,"VoidTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");default:return this.flowParseGenericType(e,t,n)}},le.flowParsePrimaryType=function(){var e=this.state.start,t=this.state.startLoc,r=this.startNode(),n=void 0,i=void 0,s=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case j.name:return this.flowIdentToTypeAnnotation(e,t,r,this.parseIdentifier());case j.braceL:return this.flowParseObjectType(!1,!1);case j.braceBarL:return this.flowParseObjectType(!1,!0);case j.bracketL:return this.flowParseTupleType();case j.relational:if("<"===this.state.value)return r.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(j.parenL),n=this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(j.parenR),this.expect(j.arrow),r.returnType=this.flowParseType(),this.finishNode(r,"FunctionTypeAnnotation");break;case j.parenL:if(this.next(),!this.match(j.parenR)&&!this.match(j.ellipsis))if(this.match(j.name)){var o=this.lookahead().type;s=o!==j.question&&o!==j.colon}else s=!0;if(s){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(j.comma)||this.match(j.parenR)&&this.lookahead().type===j.arrow))return this.expect(j.parenR),i;this.eat(j.comma)}return n=i?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(j.parenR),this.expect(j.arrow),r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation");case j.string:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case j._true:case j._false:return r.value=this.match(j._true),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case j.plusMin:if("-"===this.state.value)return this.next(),this.match(j.num)||this.unexpected(null,"Unexpected token, expected number"),this.parseLiteral(-this.state.value,"NumericLiteralTypeAnnotation",r.start,r.loc.start);this.unexpected();case j.num:return this.parseLiteral(this.state.value,"NumericLiteralTypeAnnotation");case j._null:return r.value=this.match(j._null),this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case j._this:return r.value=this.match(j._this),this.next(),this.finishNode(r,"ThisTypeAnnotation");case j.star:return this.next(),this.finishNode(r,"ExistentialTypeParam");default:if("typeof"===this.state.type.keyword)return this.flowParseTypeofType()}this.unexpected()},le.flowParsePostfixType=function(){for(var e=this.state.start,t=this.state.startLoc,r=this.flowParsePrimaryType();!this.canInsertSemicolon()&&this.match(j.bracketL);){var n=this.startNodeAt(e,t);n.elementType=r,this.expect(j.bracketL),this.expect(j.bracketR),r=this.finishNode(n,"ArrayTypeAnnotation")}return r},le.flowParsePrefixType=function(){var e=this.startNode();return this.eat(j.question)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()},le.flowParseAnonFunctionWithoutParens=function(){var e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(j.arrow)){var t=this.startNodeAt(e.start,e.loc);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e},le.flowParseIntersectionType=function(){var e=this.startNode();this.eat(j.bitwiseAND);var t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(j.bitwiseAND);)e.types.push(this.flowParseAnonFunctionWithoutParens());return 1===e.types.length?t:this.finishNode(e,"IntersectionTypeAnnotation")},le.flowParseUnionType=function(){var e=this.startNode();this.eat(j.bitwiseOR);var t=this.flowParseIntersectionType();for(e.types=[t];this.eat(j.bitwiseOR);)e.types.push(this.flowParseIntersectionType());return 1===e.types.length?t:this.finishNode(e,"UnionTypeAnnotation")},le.flowParseType=function(){var e=this.state.inType;this.state.inType=!0;var t=this.flowParseUnionType();return this.state.inType=e,t},le.flowParseTypeAnnotation=function(){var e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")},le.flowParseTypeAndPredicateAnnotation=function(){var e=this.startNode(),t=this.flowParseTypeAndPredicateInitialiser();return e.typeAnnotation=t[0],e.predicate=t[1],this.finishNode(e,"TypeAnnotation")},le.flowParseTypeAnnotatableIdentifier=function(){var e=this.flowParseRestrictedIdentifier();return this.match(j.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,e.type)),e},le.typeCastToParameter=function(e){return e.expression.typeAnnotation=e.typeAnnotation,this.finishNodeAt(e.expression,e.expression.type,e.typeAnnotation.end,e.typeAnnotation.loc.end)},le.flowParseVariance=function(){var e=null;return this.match(j.plusMin)&&("+"===this.state.value?e="plus":"-"===this.state.value&&(e="minus"),this.next()),e};var ce=function(e){e.extend("parseFunctionBody",function(e){return function(t,r){return this.match(j.colon)&&!r&&(t.returnType=this.flowParseTypeAndPredicateAnnotation()),e.call(this,t,r)}}),e.extend("parseStatement",function(e){return function(t,r){if(this.state.strict&&this.match(j.name)&&"interface"===this.state.value){var n=this.startNode();return this.next(),this.flowParseInterface(n)}return e.call(this,t,r)}}),e.extend("parseExpressionStatement",function(e){return function(t,r){if("Identifier"===r.type)if("declare"===r.name){if(this.match(j._class)||this.match(j.name)||this.match(j._function)||this.match(j._var))return this.flowParseDeclare(t)}else if(this.match(j.name)){if("interface"===r.name)return this.flowParseInterface(t);if("type"===r.name)return this.flowParseTypeAlias(t)}return e.call(this,t,r)}}),e.extend("shouldParseExportDeclaration",function(e){return function(){return this.isContextual("type")||this.isContextual("interface")||e.call(this)}}),e.extend("parseConditional",function(e){return function(t,r,n,i,s){if(s&&this.match(j.question)){var a=this.state.clone();try{return e.call(this,t,r,n,i)}catch(e){if(e instanceof SyntaxError)return this.state=a,s.start=e.pos||this.state.start,t;throw e}}return e.call(this,t,r,n,i)}}),e.extend("parseParenItem",function(e){return function(t,r,n){if(t=e.call(this,t,r,n),this.eat(j.question)&&(t.optional=!0),this.match(j.colon)){var i=this.startNodeAt(r,n);return i.expression=t,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return t}}),e.extend("parseExport",function(e){return function(t){return t=e.call(this,t),"ExportNamedDeclaration"===t.type&&(t.exportKind=t.exportKind||"value"),t}}),e.extend("parseExportDeclaration",function(e){return function(t){if(this.isContextual("type")){t.exportKind="type";var r=this.startNode();return this.next(),this.match(j.braceL)?(t.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(t),null):this.flowParseTypeAlias(r)}if(this.isContextual("interface")){t.exportKind="type";var n=this.startNode();return this.next(),this.flowParseInterface(n)}return e.call(this,t)}}),e.extend("parseClassId",function(e){return function(t){e.apply(this,arguments),this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}}),e.extend("isKeyword",function(e){return function(t){return(!this.state.inType||"void"!==t)&&e.call(this,t)}}),e.extend("readToken",function(e){return function(t){return!this.state.inType||62!==t&&60!==t?e.call(this,t):this.finishOp(j.relational,1)}}),e.extend("jsx_readToken",function(e){return function(){if(!this.state.inType)return e.call(this)}}),e.extend("toAssignable",function(e){return function(t,r,n){return"TypeCastExpression"===t.type?e.call(this,this.typeCastToParameter(t),r,n):e.call(this,t,r,n)}}),e.extend("toAssignableList",function(e){return function(t,r,n){for(var i=0;i2?n-2:0),s=2;s1114111||fe(a)!=a)throw RangeError("Invalid code point: "+a);a<=65535?e.push(a):(a-=65536,t=55296+(a>>10),r=a%1024+56320,e.push(t,r)),(n+1==i||e.length>16384)&&(s+=he.apply(null,e),e.length=0)}return s}}var de=pe,me={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},ye=/^[\da-fA-F]+$/,ge=/^\d+$/;U.j_oTag=new R("...",!0,!0),j.jsxName=new P("jsxName"),j.jsxText=new P("jsxText",{beforeExpr:!0}),j.jsxTagStart=new P("jsxTagStart",{startsExpr:!0}),j.jsxTagEnd=new P("jsxTagEnd"),j.jsxTagStart.updateContext=function(){this.state.context.push(U.j_expr),this.state.context.push(U.j_oTag),this.state.exprAllowed=!1},j.jsxTagEnd.updateContext=function(e){var t=this.state.context.pop();t===U.j_oTag&&e===j.slash||t===U.j_cTag?(this.state.context.pop(),this.state.exprAllowed=this.curContext()===U.j_expr):this.state.exprAllowed=!0};var be=z.prototype;be.jsxReadToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated JSX contents");var r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:return this.state.pos===this.state.start?60===r&&this.state.exprAllowed?(++this.state.pos,this.finishToken(j.jsxTagStart)):this.getTokenFromCode(r):(e+=this.input.slice(t,this.state.pos),this.finishToken(j.jsxText,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:u(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}},be.jsxReadNewLine=function(e){var t=this.input.charCodeAt(this.state.pos),r=void 0;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,r=e?"\n":"\r\n"):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r},be.jsxReadString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;38===n?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):u(n)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}return t+=this.input.slice(r,this.state.pos++),this.finishToken(j.string,t)},be.jsxReadEntity=function(){for(var e="",t=0,r=void 0,n=this.input[this.state.pos],i=++this.state.pos;this.state.pos")}return r.openingElement=i,r.closingElement=s,r.children=n,this.match(j.relational)&&"<"===this.state.value&&this.raise(this.state.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(r,"JSXElement")},be.jsxParseElement=function(){var e=this.state.start,t=this.state.startLoc;return this.next(),this.jsxParseElementAt(e,t)};var ve=function(e){e.extend("parseExprAtom",function(e){return function(t){if(this.match(j.jsxText)){var r=this.parseLiteral(this.state.value,"JSXText");return r.extra=null,r}return this.match(j.jsxTagStart)?this.jsxParseElement():e.call(this,t)}}),e.extend("readToken",function(e){return function(t){if(this.state.inPropertyName)return e.call(this,t);var r=this.curContext();if(r===U.j_expr)return this.jsxReadToken();if(r===U.j_oTag||r===U.j_cTag){if(s(t))return this.jsxReadWord();if(62===t)return++this.state.pos,this.finishToken(j.jsxTagEnd);if((34===t||39===t)&&r===U.j_oTag)return this.jsxReadString(t)}return 60===t&&this.state.exprAllowed?(++this.state.pos,this.finishToken(j.jsxTagStart)):e.call(this,t)}}),e.extend("updateContext",function(e){return function(t){if(this.match(j.braceL)){var r=this.curContext();r===U.j_oTag?this.state.context.push(U.braceExpression):r===U.j_expr?this.state.context.push(U.templateQuasi):e.call(this,t),this.state.exprAllowed=!0}else{if(!this.match(j.slash)||t!==j.jsxTagStart)return e.call(this,t);this.state.context.length-=2,this.state.context.push(U.j_cTag),this.state.exprAllowed=!1}}})};W.estree=oe,W.flow=ce,W.jsx=ve,r.parse=m,r.parseExpression=y,r.tokTypes=j},{}],178:[function(e,t,r){function n(e,t,r){e instanceof RegExp&&(e=i(e,r)),t instanceof RegExp&&(t=i(t,r));var n=s(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function i(e,t){var r=t.match(e);return r?r[0]:null}function s(e,t,r){var n,i,s,a,o,u=r.indexOf(e),l=r.indexOf(t,u+1),c=u;if(u>=0&&l>0){for(n=[],s=r.length;c>=0&&!o;)c==u?(n.push(c), +u=r.indexOf(e,c+1)):1==n.length?o=[n.pop(),l]:(i=n.pop(),i=0?u:l;n.length&&(o=[s,a])}return o}t.exports=n,n.range=s},{}],179:[function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-n(e)}function s(e){var t,r,i,s,a,o,u=e.length;a=n(e),o=new p(3*u/4-a),i=a>0?u-4:u;var l=0;for(t=0,r=0;t>16&255,o[l++]=s>>8&255,o[l++]=255&s;return 2===a?(s=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[l++]=255&s):1===a&&(s=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[l++]=s>>8&255,o[l++]=255&s),o}function a(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function o(e,t,r){for(var n,i=[],s=t;su?u:a+16383));return 1===n?(t=e[r-1],i+=l[t>>2],i+=l[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=l[t>>10],i+=l[t>>4&63],i+=l[t<<2&63],i+="="),s.push(i),s.join("")}r.byteLength=i,r.toByteArray=s,r.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f=t}function h(e,t){var r=[],i=d("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),m=s||o,y=/^(.*,)+(.+)?$/.test(i.body);if(!m&&!y)return i.post.match(/,.*\}/)?(e=i.pre+"{"+i.body+g+i.post,h(e)):[e];var b;if(m)b=i.body.split(/\.\./);else if(b=a(i.body),1===b.length&&(b=h(b[0],!1).map(u),1===b.length)){var v=i.post.length?h(i.post,!1):[""];return v.map(function(e){return i.pre+b[0]+e})}var x,E=i.pre,v=i.post.length?h(i.post,!1):[""];if(m){var A=n(b[0]),D=n(b[1]),C=Math.max(b[0].length,b[1].length),S=3==b.length?Math.abs(n(b[2])):1,_=c;D0){var P=new Array(T+1).join("0");F=k<0?"-"+P+F.slice(1):P+F}}x.push(F)}}else x=f(b,function(e){return h(e,!1)});for(var B=0;Ba)throw new RangeError("size is too large");var n=r,s=t;void 0===s&&(n=void 0,s=0);var o=new i(e);if("string"==typeof s)for(var u=new i(s,n),l=u.length,c=-1;++ca)throw new RangeError("size is too large");return new i(e)},r.from=function(e,r,n){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,r,n);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,r);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var s=r;if(1===arguments.length)return new i(e);void 0===s&&(s=0);var a=n;if(void 0===a&&(a=e.byteLength-s),s>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(a>e.byteLength-s)throw new RangeError("'length' is out of bounds");return new i(e.slice(s,s+a))}if(i.isBuffer(e)){var o=new i(e.length);return e.copy(o,0,0,e.length),o}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=a)throw new RangeError("size is too large");return new s(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:184}],184:[function(e,t,r){"use strict";function n(e){if(e>Y)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(e)}return s(e,t,r)}function s(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?p(e,t,r):"string"==typeof e?l(e,t):h(e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function o(e,t,r){return a(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}function u(e){return a(e),n(e<0?0:0|f(e))}function l(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(e,t),s=n(r),a=s.write(e,t);return a!==r&&(s=s.slice(0,a)),s}function c(e){for(var t=e.length<0?0:0|f(e.length),r=n(t),i=0;i=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),i.alloc(+e)}function m(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return F(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return _(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,s){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(s)return-1;r=e.length-1}else if(r<0){if(!s)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,s);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;lo&&(r=o-u),l=r;l>=0;l--){for(var p=!0,h=0;hi&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var a=0;a239?4:s>223?3:s>191?2:1;if(i+o<=r){var u,l,c,p;switch(o){case 1:s<128&&(a=s);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&s)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&s)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&s)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return k(n)}function k(e){var t=e.length;if(t<=H)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,s,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),z.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),z.write(e,t,r,n,52,8),r+8}function M(e){if(e=R(e).replace($,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function R(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function q(e){for(var t=[],r=0;r>8,i=r%256,s.push(i),s.push(n);return s}function X(e){return K.toByteArray(M(e))}function J(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e){return e!==e}var K=e("base64-js"),z=e("ieee754");r.Buffer=i,r.SlowBuffer=d,r.INSPECT_MAX_BYTES=50;var Y=2147483647;r.kMaxLength=Y,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return s(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return o(e,t,r)},i.allocUnsafe=function(e){return u(e)},i.allocUnsafeSlow=function(e){return u(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,s=0,a=Math.min(r,n);s0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},i.prototype.compare=function(e,t,r,n,s){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var a=s-n,o=r-t,u=Math.min(a,o),l=this.slice(n,s),c=e.slice(t,r),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return A(this,e,t,r);case"latin1":case"binary":return D(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;i.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,s=0;++s>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},i.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,s=0;++s=i&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},i.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),z.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),z.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),z.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),z.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){j(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){j(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s>0)-o&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(s<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a1)for(var n=1;n0;i--)if(t=n[i],~t.indexOf("sourceMappingURL=data:"))return r.fromComment(t)}var u=e("fs"),l=e("path"),c=/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+;)?base64,(.*)$/gm,p=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm;a.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},a.prototype.toBase64=function(){var e=this.toJSON();return new t(e).toString("base64")},a.prototype.toComment=function(e){var t=this.toBase64(),r="sourceMappingURL=data:application/json;base64,"+t;return e&&e.multiline?"/*# "+r+" */":"//# "+r},a.prototype.toObject=function(){return JSON.parse(this.toJSON())},a.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(e,t)},a.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this},a.prototype.getProperty=function(e){return this.sourcemap[e]},r.fromObject=function(e){return new a(e)},r.fromJSON=function(e){return new a(e,{isJSON:!0})},r.fromBase64=function(e){return new a(e,{isEncoded:!0})},r.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new a(e,{isEncoded:!0,hasComment:!0})},r.fromMapFileComment=function(e,t){return new a(e,{commentFileDir:t,isFileComment:!0,isJSON:!0})},r.fromSource=function(e,t){if(t){var n=o(e);return n||null}var i=e.match(c);return c.lastIndex=0,i?r.fromComment(i.pop()):null},r.fromMapFileSource=function(e,t){var n=e.match(p);return p.lastIndex=0,n?r.fromMapFileComment(n.pop(),t):null},r.removeComments=function(e){return c.lastIndex=0,e.replace(c,"")},r.removeMapFileComments=function(e){return p.lastIndex=0,e.replace(p,"")},Object.defineProperty(r,"commentRegex",{get:function(){return c.lastIndex=0,c}}),Object.defineProperty(r,"mapFileCommentRegex",{get:function(){return p.lastIndex=0,p}})}).call(this,e("buffer").Buffer)},{buffer:184,fs:182,path:535}],188:[function(e,t,r){e("../modules/web.dom.iterable"),e("../modules/es6.string.iterator"),t.exports=e("../modules/core.get-iterator")},{"../modules/core.get-iterator":277,"../modules/es6.string.iterator":286,"../modules/web.dom.iterable":293}],189:[function(e,t,r){var n=e("../../modules/_core"),i=n.JSON||(n.JSON={stringify:JSON.stringify});t.exports=function(e){return i.stringify.apply(i,arguments)}},{"../../modules/_core":217}],190:[function(e,t,r){e("../modules/es6.object.to-string"),e("../modules/es6.string.iterator"),e("../modules/web.dom.iterable"),e("../modules/es6.map"),e("../modules/es7.map.to-json"),t.exports=e("../modules/_core").Map},{"../modules/_core":217,"../modules/es6.map":279,"../modules/es6.object.to-string":285,"../modules/es6.string.iterator":286,"../modules/es7.map.to-json":290,"../modules/web.dom.iterable":293}],191:[function(e,t,r){e("../../modules/es6.number.max-safe-integer"),t.exports=9007199254740991},{"../../modules/es6.number.max-safe-integer":280}],192:[function(e,t,r){e("../../modules/es6.object.assign"),t.exports=e("../../modules/_core").Object.assign},{"../../modules/_core":217,"../../modules/es6.object.assign":281}],193:[function(e,t,r){e("../../modules/es6.object.create");var n=e("../../modules/_core").Object;t.exports=function(e,t){return n.create(e,t)}},{"../../modules/_core":217,"../../modules/es6.object.create":282}],194:[function(e,t,r){e("../../modules/es6.symbol"),t.exports=e("../../modules/_core").Object.getOwnPropertySymbols},{"../../modules/_core":217,"../../modules/es6.symbol":287}],195:[function(e,t,r){e("../../modules/es6.object.keys"),t.exports=e("../../modules/_core").Object.keys},{"../../modules/_core":217,"../../modules/es6.object.keys":283}],196:[function(e,t,r){e("../../modules/es6.object.set-prototype-of"),t.exports=e("../../modules/_core").Object.setPrototypeOf},{"../../modules/_core":217,"../../modules/es6.object.set-prototype-of":284}],197:[function(e,t,r){e("../../modules/es6.symbol"),t.exports=e("../../modules/_core").Symbol.for},{"../../modules/_core":217,"../../modules/es6.symbol":287}],198:[function(e,t,r){e("../../modules/es6.symbol"),e("../../modules/es6.object.to-string"),e("../../modules/es7.symbol.async-iterator"),e("../../modules/es7.symbol.observable"),t.exports=e("../../modules/_core").Symbol},{"../../modules/_core":217,"../../modules/es6.object.to-string":285,"../../modules/es6.symbol":287,"../../modules/es7.symbol.async-iterator":291,"../../modules/es7.symbol.observable":292}],199:[function(e,t,r){e("../../modules/es6.string.iterator"),e("../../modules/web.dom.iterable"),t.exports=e("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":274,"../../modules/es6.string.iterator":286,"../../modules/web.dom.iterable":293}],200:[function(e,t,r){e("../modules/es6.object.to-string"),e("../modules/web.dom.iterable"),e("../modules/es6.weak-map"),t.exports=e("../modules/_core").WeakMap},{"../modules/_core":217,"../modules/es6.object.to-string":285,"../modules/es6.weak-map":288,"../modules/web.dom.iterable":293}],201:[function(e,t,r){e("../modules/es6.object.to-string"),e("../modules/web.dom.iterable"),e("../modules/es6.weak-set"), +t.exports=e("../modules/_core").WeakSet},{"../modules/_core":217,"../modules/es6.object.to-string":285,"../modules/es6.weak-set":289,"../modules/web.dom.iterable":293}],202:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},{}],203:[function(e,t,r){t.exports=function(){}},{}],204:[function(e,t,r){t.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},{}],205:[function(e,t,r){var n=e("./_is-object");t.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},{"./_is-object":235}],206:[function(e,t,r){var n=e("./_for-of");t.exports=function(e,t){var r=[];return n(e,!1,r.push,r,t),r}},{"./_for-of":226}],207:[function(e,t,r){var n=e("./_to-iobject"),i=e("./_to-length"),s=e("./_to-index");t.exports=function(e){return function(t,r,a){var o,u=n(t),l=i(u.length),c=s(a,l);if(e&&r!=r){for(;l>c;)if((o=u[c++])!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}}},{"./_to-index":266,"./_to-iobject":268,"./_to-length":269}],208:[function(e,t,r){var n=e("./_ctx"),i=e("./_iobject"),s=e("./_to-object"),a=e("./_to-length"),o=e("./_array-species-create");t.exports=function(e,t){var r=1==e,u=2==e,l=3==e,c=4==e,p=6==e,h=5==e||p,f=t||o;return function(t,o,d){for(var m,y,g=s(t),b=i(g),v=n(o,d,3),x=a(b.length),E=0,A=r?f(t,x):u?f(t,0):void 0;x>E;E++)if((h||E in b)&&(m=b[E],y=v(m,E,g),e))if(r)A[E]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return E;case 2:A.push(m)}else if(c)return!1;return p?-1:l||c?c:A}}},{"./_array-species-create":210,"./_ctx":218,"./_iobject":232,"./_to-length":269,"./_to-object":270}],209:[function(e,t,r){var n=e("./_is-object"),i=e("./_is-array"),s=e("./_wks")("species");t.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&null===(t=t[s])&&(t=void 0)),void 0===t?Array:t}},{"./_is-array":234,"./_is-object":235,"./_wks":275}],210:[function(e,t,r){var n=e("./_array-species-constructor");t.exports=function(e,t){return new(n(e))(t)}},{"./_array-species-constructor":209}],211:[function(e,t,r){var n=e("./_cof"),i=e("./_wks")("toStringTag"),s="Arguments"==n(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};t.exports=function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=a(t=Object(e),i))?r:s?n(t):"Object"==(o=n(t))&&"function"==typeof t.callee?"Arguments":o}},{"./_cof":212,"./_wks":275}],212:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],213:[function(e,t,r){"use strict";var n=e("./_object-dp").f,i=e("./_object-create"),s=e("./_redefine-all"),a=e("./_ctx"),o=e("./_an-instance"),u=e("./_defined"),l=e("./_for-of"),c=e("./_iter-define"),p=e("./_iter-step"),h=e("./_set-species"),f=e("./_descriptors"),d=e("./_meta").fastKey,m=f?"_s":"size",y=function(e,t){var r,n=d(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r};t.exports={getConstructor:function(e,t,r,c){var p=e(function(e,n){o(e,p,t,"_i"),e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=n&&l(n,r,e[c],e)});return s(p.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var t=this,r=y(t,e);if(r){var n=r.n,i=r.p;delete t._i[r.i],r.r=!0,i&&(i.n=n),n&&(n.p=i),t._f==r&&(t._f=n),t._l==r&&(t._l=i),t[m]--}return!!r},forEach:function(e){o(this,p,"forEach");for(var t,r=a(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!y(this,e)}}),f&&n(p.prototype,"size",{get:function(){return u(this[m])}}),p},def:function(e,t,r){var n,i,s=y(e,t);return s?s.v=r:(e._l=s={i:i=d(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=s),n&&(n.n=s),e[m]++,"F"!==i&&(e._i[i]=s)),e},getEntry:y,setStrong:function(e,t,r){c(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?p(0,r.k):"values"==t?p(0,r.v):p(0,[r.k,r.v]):(e._t=void 0,p(1))},r?"entries":"values",!r,!0),h(t)}}},{"./_an-instance":204,"./_ctx":218,"./_defined":219,"./_descriptors":220,"./_for-of":226,"./_iter-define":238,"./_iter-step":239,"./_meta":243,"./_object-create":245,"./_object-dp":246,"./_redefine-all":258,"./_set-species":261}],214:[function(e,t,r){var n=e("./_classof"),i=e("./_array-from-iterable");t.exports=function(e){return function(){if(n(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},{"./_array-from-iterable":206,"./_classof":211}],215:[function(e,t,r){"use strict";var n=e("./_redefine-all"),i=e("./_meta").getWeak,s=e("./_an-object"),a=e("./_is-object"),o=e("./_an-instance"),u=e("./_for-of"),l=e("./_array-methods"),c=e("./_has"),p=l(5),h=l(6),f=0,d=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},y=function(e,t){return p(e.a,function(e){return e[0]===t})};m.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var r=y(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,r,s){var l=e(function(e,n){o(e,l,t,"_i"),e._i=f++,e._l=void 0,void 0!=n&&u(n,r,e[s],e)});return n(l.prototype,{delete:function(e){if(!a(e))return!1;var t=i(e);return!0===t?d(this).delete(e):t&&c(t,this._i)&&delete t[this._i]},has:function(e){if(!a(e))return!1;var t=i(e);return!0===t?d(this).has(e):t&&c(t,this._i)}}),l},def:function(e,t,r){var n=i(s(t),!0);return!0===n?d(e).set(t,r):n[e._i]=r,e},ufstore:d}},{"./_an-instance":204,"./_an-object":205,"./_array-methods":208,"./_for-of":226,"./_has":228,"./_is-object":235,"./_meta":243,"./_redefine-all":258}],216:[function(e,t,r){"use strict";var n=e("./_global"),i=e("./_export"),s=e("./_meta"),a=e("./_fails"),o=e("./_hide"),u=e("./_redefine-all"),l=e("./_for-of"),c=e("./_an-instance"),p=e("./_is-object"),h=e("./_set-to-string-tag"),f=e("./_object-dp").f,d=e("./_array-methods")(0),m=e("./_descriptors");t.exports=function(e,t,r,y,g,b){var v=n[e],x=v,E=g?"set":"add",A=x&&x.prototype,D={};return m&&"function"==typeof x&&(b||A.forEach&&!a(function(){(new x).entries().next()}))?(x=t(function(t,r){c(t,x,e,"_c"),t._c=new v,void 0!=r&&l(r,g,t[E],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in A&&(!b||"clear"!=e)&&o(x.prototype,e,function(r,n){if(c(this,x,e),!t&&b&&!p(r))return"get"==e&&void 0;var i=this._c[e](0===r?0:r,n);return t?this:i})}),"size"in A&&f(x.prototype,"size",{get:function(){return this._c.size}})):(x=y.getConstructor(t,e,g,E),u(x.prototype,r),s.NEED=!0),h(x,e),D[e]=x,i(i.G+i.W+i.F,D),b||y.setStrong(x,e,g),x}},{"./_an-instance":204,"./_array-methods":208,"./_descriptors":220,"./_export":224,"./_fails":225,"./_for-of":226,"./_global":227,"./_hide":229,"./_is-object":235,"./_meta":243,"./_object-dp":246,"./_redefine-all":258,"./_set-to-string-tag":262}],217:[function(e,t,r){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},{}],218:[function(e,t,r){var n=e("./_a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":202}],219:[function(e,t,r){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],220:[function(e,t,r){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":225}],221:[function(e,t,r){var n=e("./_is-object"),i=e("./_global").document,s=n(i)&&n(i.createElement);t.exports=function(e){return s?i.createElement(e):{}}},{"./_global":227,"./_is-object":235}],222:[function(e,t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],223:[function(e,t,r){var n=e("./_object-keys"),i=e("./_object-gops"),s=e("./_object-pie");t.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,o=r(e),u=s.f,l=0;o.length>l;)u.call(e,a=o[l++])&&t.push(a);return t}},{"./_object-gops":251,"./_object-keys":254,"./_object-pie":255}],224:[function(e,t,r){var n=e("./_global"),i=e("./_core"),s=e("./_ctx"),a=e("./_hide"),o=function(e,t,r){var u,l,c,p=e&o.F,h=e&o.G,f=e&o.S,d=e&o.P,m=e&o.B,y=e&o.W,g=h?i:i[t]||(i[t]={}),b=g.prototype,v=h?n:f?n[t]:(n[t]||{}).prototype;h&&(r=t);for(u in r)(l=!p&&v&&void 0!==v[u])&&u in g||(c=l?v[u]:r[u],g[u]=h&&"function"!=typeof v[u]?r[u]:m&&l?s(c,n):y&&v[u]==c?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(c):d&&"function"==typeof c?s(Function.call,c):c,d&&((g.virtual||(g.virtual={}))[u]=c,e&o.R&&b&&!b[u]&&a(b,u,c)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,t.exports=o},{"./_core":217,"./_ctx":218,"./_global":227,"./_hide":229}],225:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],226:[function(e,t,r){var n=e("./_ctx"),i=e("./_iter-call"),s=e("./_is-array-iter"),a=e("./_an-object"),o=e("./_to-length"),u=e("./core.get-iterator-method"),l={},c={},r=t.exports=function(e,t,r,p,h){var f,d,m,y,g=h?function(){return e}:u(e),b=n(r,p,t?2:1),v=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(s(g)){for(f=o(e.length);f>v;v++)if((y=t?b(a(d=e[v])[0],d[1]):b(e[v]))===l||y===c)return y}else for(m=g.call(e);!(d=m.next()).done;)if((y=i(m,b,d.value,t))===l||y===c)return y};r.BREAK=l,r.RETURN=c},{"./_an-object":205,"./_ctx":218,"./_is-array-iter":233,"./_iter-call":236,"./_to-length":269,"./core.get-iterator-method":276}],227:[function(e,t,r){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],228:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],229:[function(e,t,r){var n=e("./_object-dp"),i=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},{"./_descriptors":220,"./_object-dp":246,"./_property-desc":257}],230:[function(e,t,r){t.exports=e("./_global").document&&document.documentElement},{"./_global":227}],231:[function(e,t,r){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":220,"./_dom-create":221,"./_fails":225}],232:[function(e,t,r){var n=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},{"./_cof":212}],233:[function(e,t,r){var n=e("./_iterators"),i=e("./_wks")("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||s[i]===e)}},{"./_iterators":240,"./_wks":275}],234:[function(e,t,r){var n=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./_cof":212}],235:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],236:[function(e,t,r){var n=e("./_an-object");t.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var s=e.return;throw void 0!==s&&n(s.call(e)),t}}},{"./_an-object":205}],237:[function(e,t,r){"use strict";var n=e("./_object-create"),i=e("./_property-desc"),s=e("./_set-to-string-tag"),a={};e("./_hide")(a,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),s(e,t+" Iterator")}},{"./_hide":229,"./_object-create":245,"./_property-desc":257,"./_set-to-string-tag":262,"./_wks":275}],238:[function(e,t,r){"use strict";var n=e("./_library"),i=e("./_export"),s=e("./_redefine"),a=e("./_hide"),o=e("./_has"),u=e("./_iterators"),l=e("./_iter-create"),c=e("./_set-to-string-tag"),p=e("./_object-gpo"),h=e("./_wks")("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(e,t,r,m,y,g,b){l(r,t,m);var v,x,E,A=function(e){if(!f&&e in _)return _[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},D=t+" Iterator",C="values"==y,S=!1,_=e.prototype,w=_[h]||_["@@iterator"]||y&&_[y],k=w||A(y),F=y?C?A("entries"):k:void 0,T="Array"==t?_.entries||w:w;if(T&&(E=p(T.call(new e)))!==Object.prototype&&(c(E,D,!0),n||o(E,h)||a(E,h,d)),C&&w&&"values"!==w.name&&(S=!0,k=function(){return w.call(this)}),n&&!b||!f&&!S&&_[h]||a(_,h,k),u[t]=k,u[D]=d,y)if(v={values:C?k:A("values"),keys:g?k:A("keys"),entries:F},b)for(x in v)x in _||s(_,x,v[x]);else i(i.P+i.F*(f||S),t,v);return v}},{"./_export":224,"./_has":228,"./_hide":229,"./_iter-create":237,"./_iterators":240,"./_library":242,"./_object-gpo":252,"./_redefine":259,"./_set-to-string-tag":262,"./_wks":275}],239:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],240:[function(e,t,r){t.exports={}},{}],241:[function(e,t,r){var n=e("./_object-keys"),i=e("./_to-iobject");t.exports=function(e,t){for(var r,s=i(e),a=n(s),o=a.length,u=0;o>u;)if(s[r=a[u++]]===t)return r}},{"./_object-keys":254,"./_to-iobject":268}],242:[function(e,t,r){t.exports=!0},{}],243:[function(e,t,r){var n=e("./_uid")("meta"),i=e("./_is-object"),s=e("./_has"),a=e("./_object-dp").f,o=0,u=Object.isExtensible||function(){return!0},l=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,n,{value:{i:"O"+ ++o,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,n)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[n].i},h=function(e,t){if(!s(e,n)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[n].w},f=function(e){return l&&d.NEED&&u(e)&&!s(e,n)&&c(e),e},d=t.exports={KEY:n,NEED:!1,fastKey:p,getWeak:h,onFreeze:f}},{"./_fails":225,"./_has":228,"./_is-object":235,"./_object-dp":246,"./_uid":272}],244:[function(e,t,r){"use strict";var n=e("./_object-keys"),i=e("./_object-gops"),s=e("./_object-pie"),a=e("./_to-object"),o=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function(e,t){for(var r=a(e),u=arguments.length,l=1,c=i.f,p=s.f;u>l;)for(var h,f=o(arguments[l++]),d=c?n(f).concat(c(f)):n(f),m=d.length,y=0;m>y;)p.call(f,h=d[y++])&&(r[h]=f[h]);return r}:u},{"./_fails":225,"./_iobject":232,"./_object-gops":251,"./_object-keys":254,"./_object-pie":255,"./_to-object":270}],245:[function(e,t,r){var n=e("./_an-object"),i=e("./_object-dps"),s=e("./_enum-bug-keys"),a=e("./_shared-key")("IE_PROTO"),o=function(){},u=function(){var t,r=e("./_dom-create")("iframe"),n=s.length;for(r.style.display="none",e("./_html").appendChild(r),r.src="javascript:",t=r.contentWindow.document,t.open(),t.write(""),t.close(),u=t.F;n--;)delete u.prototype[s[n]];return u()};t.exports=Object.create||function(e,t){var r;return null!==e?(o.prototype=n(e),r=new o,o.prototype=null,r[a]=e):r=u(),void 0===t?r:i(r,t)}},{"./_an-object":205,"./_dom-create":221,"./_enum-bug-keys":222,"./_html":230,"./_object-dps":247,"./_shared-key":263}],246:[function(e,t,r){var n=e("./_an-object"),i=e("./_ie8-dom-define"),s=e("./_to-primitive"),a=Object.defineProperty;r.f=e("./_descriptors")?Object.defineProperty:function(e,t,r){if(n(e),t=s(t,!0),n(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},{"./_an-object":205,"./_descriptors":220,"./_ie8-dom-define":231,"./_to-primitive":271}],247:[function(e,t,r){var n=e("./_object-dp"),i=e("./_an-object"),s=e("./_object-keys");t.exports=e("./_descriptors")?Object.defineProperties:function(e,t){i(e);for(var r,a=s(t),o=a.length,u=0;o>u;)n.f(e,r=a[u++],t[r]);return e}},{"./_an-object":205,"./_descriptors":220,"./_object-dp":246,"./_object-keys":254}],248:[function(e,t,r){var n=e("./_object-pie"),i=e("./_property-desc"),s=e("./_to-iobject"),a=e("./_to-primitive"),o=e("./_has"),u=e("./_ie8-dom-define"),l=Object.getOwnPropertyDescriptor;r.f=e("./_descriptors")?l:function(e,t){if(e=s(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(o(e,t))return i(!n.f.call(e,t),e[t])}},{"./_descriptors":220,"./_has":228,"./_ie8-dom-define":231,"./_object-pie":255,"./_property-desc":257,"./_to-iobject":268,"./_to-primitive":271}],249:[function(e,t,r){var n=e("./_to-iobject"),i=e("./_object-gopn").f,s={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function(e){try{return i(e)}catch(e){return a.slice()}};t.exports.f=function(e){return a&&"[object Window]"==s.call(e)?o(e):i(n(e))}},{"./_object-gopn":250,"./_to-iobject":268}],250:[function(e,t,r){var n=e("./_object-keys-internal"),i=e("./_enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},{"./_enum-bug-keys":222,"./_object-keys-internal":253}],251:[function(e,t,r){r.f=Object.getOwnPropertySymbols},{}],252:[function(e,t,r){var n=e("./_has"),i=e("./_to-object"),s=e("./_shared-key")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},{"./_has":228,"./_shared-key":263,"./_to-object":270}],253:[function(e,t,r){var n=e("./_has"),i=e("./_to-iobject"),s=e("./_array-includes")(!1),a=e("./_shared-key")("IE_PROTO");t.exports=function(e,t){var r,o=i(e),u=0,l=[];for(r in o)r!=a&&n(o,r)&&l.push(r);for(;t.length>u;)n(o,r=t[u++])&&(~s(l,r)||l.push(r));return l}},{"./_array-includes":207,"./_has":228,"./_shared-key":263,"./_to-iobject":268}],254:[function(e,t,r){var n=e("./_object-keys-internal"),i=e("./_enum-bug-keys");t.exports=Object.keys||function(e){return n(e,i)}},{"./_enum-bug-keys":222,"./_object-keys-internal":253}],255:[function(e,t,r){r.f={}.propertyIsEnumerable},{}],256:[function(e,t,r){var n=e("./_export"),i=e("./_core"),s=e("./_fails");t.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*s(function(){r(1)}),"Object",a)}},{"./_core":217,"./_export":224,"./_fails":225}],257:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],258:[function(e,t,r){var n=e("./_hide");t.exports=function(e,t,r){for(var i in t)r&&e[i]?e[i]=t[i]:n(e,i,t[i]);return e}},{"./_hide":229}],259:[function(e,t,r){t.exports=e("./_hide")},{"./_hide":229}],260:[function(e,t,r){var n=e("./_is-object"),i=e("./_an-object"),s=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,n){try{n=e("./_ctx")(Function.call,e("./_object-gopd").f(Object.prototype,"__proto__").set,2),n(t,[]),r=!(t instanceof Array)}catch(e){r=!0}return function(e,t){return s(e,t),r?e.__proto__=t:n(e,t),e}}({},!1):void 0),check:s}},{"./_an-object":205,"./_ctx":218,"./_is-object":235,"./_object-gopd":248}],261:[function(e,t,r){"use strict";var n=e("./_global"),i=e("./_core"),s=e("./_object-dp"),a=e("./_descriptors"),o=e("./_wks")("species");t.exports=function(e){var t="function"==typeof i[e]?i[e]:n[e];a&&t&&!t[o]&&s.f(t,o,{configurable:!0,get:function(){return this}})}},{"./_core":217,"./_descriptors":220,"./_global":227,"./_object-dp":246,"./_wks":275}],262:[function(e,t,r){var n=e("./_object-dp").f,i=e("./_has"),s=e("./_wks")("toStringTag");t.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,s)&&n(e,s,{configurable:!0,value:t})}},{"./_has":228,"./_object-dp":246,"./_wks":275}],263:[function(e,t,r){var n=e("./_shared")("keys"),i=e("./_uid");t.exports=function(e){return n[e]||(n[e]=i(e))}},{"./_shared":264,"./_uid":272}],264:[function(e,t,r){var n=e("./_global"),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(e){return i[e]||(i[e]={})}},{"./_global":227}],265:[function(e,t,r){var n=e("./_to-integer"),i=e("./_defined");t.exports=function(e){return function(t,r){var s,a,o=String(i(t)),u=n(r),l=o.length;return u<0||u>=l?e?"":void 0:(s=o.charCodeAt(u),s<55296||s>56319||u+1===l||(a=o.charCodeAt(u+1))<56320||a>57343?e?o.charAt(u):s:e?o.slice(u,u+2):a-56320+(s-55296<<10)+65536)}}},{"./_defined":219,"./_to-integer":267}],266:[function(e,t,r){var n=e("./_to-integer"),i=Math.max,s=Math.min;t.exports=function(e,t){return e=n(e),e<0?i(e+t,0):s(e,t)}},{"./_to-integer":267}],267:[function(e,t,r){var n=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},{}],268:[function(e,t,r){var n=e("./_iobject"),i=e("./_defined");t.exports=function(e){return n(i(e))}},{"./_defined":219,"./_iobject":232}],269:[function(e,t,r){var n=e("./_to-integer"),i=Math.min;t.exports=function(e){return e>0?i(n(e),9007199254740991):0}},{"./_to-integer":267}],270:[function(e,t,r){var n=e("./_defined");t.exports=function(e){return Object(n(e))}},{"./_defined":219}],271:[function(e,t,r){var n=e("./_is-object");t.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":235}],272:[function(e,t,r){var n=0,i=Math.random();t.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},{}],273:[function(e,t,r){var n=e("./_global"),i=e("./_core"),s=e("./_library"),a=e("./_wks-ext"),o=e("./_object-dp").f;t.exports=function(e){var t=i.Symbol||(i.Symbol=s?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||o(t,e,{value:a.f(e)})}},{"./_core":217,"./_global":227,"./_library":242,"./_object-dp":246,"./_wks-ext":274}],274:[function(e,t,r){r.f=e("./_wks")},{"./_wks":275}],275:[function(e,t,r){var n=e("./_shared")("wks"),i=e("./_uid"),s=e("./_global").Symbol,a="function"==typeof s;(t.exports=function(e){return n[e]||(n[e]=a&&s[e]||(a?s:i)("Symbol."+e))}).store=n},{"./_global":227,"./_shared":264,"./_uid":272}],276:[function(e,t,r){var n=e("./_classof"),i=e("./_wks")("iterator"),s=e("./_iterators");t.exports=e("./_core").getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||s[n(e)]}},{"./_classof":211,"./_core":217,"./_iterators":240,"./_wks":275}],277:[function(e,t,r){var n=e("./_an-object"),i=e("./core.get-iterator-method");t.exports=e("./_core").getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},{"./_an-object":205,"./_core":217,"./core.get-iterator-method":276}],278:[function(e,t,r){"use strict";var n=e("./_add-to-unscopables"),i=e("./_iter-step"),s=e("./_iterators"),a=e("./_to-iobject");t.exports=e("./_iter-define")(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,r):"values"==t?i(0,e[r]):i(0,[r,e[r]])},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"./_add-to-unscopables":203,"./_iter-define":238,"./_iter-step":239,"./_iterators":240,"./_to-iobject":268}],279:[function(e,t,r){"use strict";var n=e("./_collection-strong");t.exports=e("./_collection")("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=n.getEntry(this,e);return t&&t.v},set:function(e,t){return n.def(this,0===e?0:e,t)}},n,!0)},{"./_collection":216,"./_collection-strong":213}],280:[function(e,t,r){var n=e("./_export");n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{"./_export":224}],281:[function(e,t,r){var n=e("./_export");n(n.S+n.F,"Object",{assign:e("./_object-assign")})},{"./_export":224,"./_object-assign":244}],282:[function(e,t,r){var n=e("./_export");n(n.S,"Object",{create:e("./_object-create")})},{"./_export":224,"./_object-create":245}],283:[function(e,t,r){var n=e("./_to-object"),i=e("./_object-keys");e("./_object-sap")("keys",function(){return function(e){return i(n(e))}})},{"./_object-keys":254,"./_object-sap":256,"./_to-object":270}],284:[function(e,t,r){var n=e("./_export");n(n.S,"Object",{setPrototypeOf:e("./_set-proto").set})},{"./_export":224,"./_set-proto":260}],285:[function(e,t,r){arguments[4][181][0].apply(r,arguments)},{dup:181}],286:[function(e,t,r){"use strict";var n=e("./_string-at")(!0);e("./_iter-define")(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},{"./_iter-define":238,"./_string-at":265}],287:[function(e,t,r){"use strict";var n=e("./_global"),i=e("./_has"),s=e("./_descriptors"),a=e("./_export"),o=e("./_redefine"),u=e("./_meta").KEY,l=e("./_fails"),c=e("./_shared"),p=e("./_set-to-string-tag"),h=e("./_uid"),f=e("./_wks"),d=e("./_wks-ext"),m=e("./_wks-define"),y=e("./_keyof"),g=e("./_enum-keys"),b=e("./_is-array"),v=e("./_an-object"),x=e("./_to-iobject"),E=e("./_to-primitive"),A=e("./_property-desc"),D=e("./_object-create"),C=e("./_object-gopn-ext"),S=e("./_object-gopd"),_=e("./_object-dp"),w=e("./_object-keys"),k=S.f,F=_.f,T=C.f,P=n.Symbol,B=n.JSON,O=B&&B.stringify,j=f("_hidden"),N=f("toPrimitive"),I={}.propertyIsEnumerable,L=c("symbol-registry"),M=c("symbols"),R=c("op-symbols"),U=Object.prototype,V="function"==typeof P,q=n.QObject,G=!q||!q.prototype||!q.prototype.findChild,X=s&&l(function(){return 7!=D(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=k(U,t);n&&delete U[t],F(e,t,r),n&&e!==U&&F(U,t,n)}:F,J=function(e){var t=M[e]=D(P.prototype);return t._k=e,t},W=V&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},K=function(e,t,r){return e===U&&K(R,t,r),v(e),t=E(t,!0),v(r),i(M,t)?(r.enumerable?(i(e,j)&&e[j][t]&&(e[j][t]=!1),r=D(r,{enumerable:A(0,!1)})):(i(e,j)||F(e,j,A(1,{})),e[j][t]=!0),X(e,t,r)):F(e,t,r)},z=function(e,t){v(e);for(var r,n=g(t=x(t)),i=0,s=n.length;s>i;)K(e,r=n[i++],t[r]);return e},Y=function(e,t){return void 0===t?D(e):z(D(e),t)},H=function(e){var t=I.call(this,e=E(e,!0));return!(this===U&&i(M,e)&&!i(R,e))&&(!(t||!i(this,e)||!i(M,e)||i(this,j)&&this[j][e])||t)},$=function(e,t){if(e=x(e),t=E(t,!0),e!==U||!i(M,t)||i(R,t)){var r=k(e,t);return!r||!i(M,t)||i(e,j)&&e[j][t]||(r.enumerable=!0),r}},Q=function(e){for(var t,r=T(x(e)),n=[],s=0;r.length>s;)i(M,t=r[s++])||t==j||t==u||n.push(t);return n},Z=function(e){for(var t,r=e===U,n=T(r?R:x(e)),s=[],a=0;n.length>a;)!i(M,t=n[a++])||r&&!i(U,t)||s.push(M[t]);return s};V||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(r){this===U&&t.call(R,r),i(this,j)&&i(this[j],e)&&(this[j][e]=!1),X(this,e,A(1,r))};return s&&G&&X(U,e,{configurable:!0,set:t}),J(e)},o(P.prototype,"toString",function(){return this._k}),S.f=$,_.f=K,e("./_object-gopn").f=C.f=Q,e("./_object-pie").f=H,e("./_object-gops").f=Z,s&&!e("./_library")&&o(U,"propertyIsEnumerable",H,!0),d.f=function(e){return J(f(e))}),a(a.G+a.W+a.F*!V,{Symbol:P});for(var ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),te=0;ee.length>te;)f(ee[te++]);for(var ee=w(f.store),te=0;ee.length>te;)m(ee[te++]);a(a.S+a.F*!V,"Symbol",{for:function(e){return i(L,e+="")?L[e]:L[e]=P(e)},keyFor:function(e){if(W(e))return y(L,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){G=!0},useSimple:function(){G=!1}}),a(a.S+a.F*!V,"Object",{create:Y,defineProperty:K,defineProperties:z,getOwnPropertyDescriptor:$,getOwnPropertyNames:Q,getOwnPropertySymbols:Z}),B&&a(a.S+a.F*(!V||l(function(){var e=P();return"[null]"!=O([e])||"{}"!=O({a:e})||"{}"!=O(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!W(e)){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);return t=n[1],"function"==typeof t&&(r=t),!r&&b(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!W(t))return t}),n[1]=t,O.apply(B,n)}}}),P.prototype[N]||e("./_hide")(P.prototype,N,P.prototype.valueOf),p(P,"Symbol"),p(Math,"Math",!0),p(n.JSON,"JSON",!0)},{"./_an-object":205,"./_descriptors":220,"./_enum-keys":223,"./_export":224,"./_fails":225,"./_global":227,"./_has":228,"./_hide":229,"./_is-array":234,"./_keyof":241,"./_library":242,"./_meta":243,"./_object-create":245,"./_object-dp":246,"./_object-gopd":248,"./_object-gopn":250,"./_object-gopn-ext":249,"./_object-gops":251,"./_object-keys":254,"./_object-pie":255,"./_property-desc":257,"./_redefine":259,"./_set-to-string-tag":262,"./_shared":264,"./_to-iobject":268,"./_to-primitive":271,"./_uid":272,"./_wks":275,"./_wks-define":273,"./_wks-ext":274}],288:[function(e,t,r){"use strict";var n,i=e("./_array-methods")(0),s=e("./_redefine"),a=e("./_meta"),o=e("./_object-assign"),u=e("./_collection-weak"),l=e("./_is-object"),c=a.getWeak,p=Object.isExtensible,h=u.ufstore,f={},d=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(e){if(l(e)){var t=c(e);return!0===t?h(this).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(this,e,t)}},y=t.exports=e("./_collection")("WeakMap",d,m,u,!0,!0);7!=(new y).set((Object.freeze||Object)(f),7).get(f)&&(n=u.getConstructor(d),o(n.prototype,m),a.NEED=!0,i(["delete","has","get","set"],function(e){var t=y.prototype,r=t[e];s(t,e,function(t,i){if(l(t)&&!p(t)){this._f||(this._f=new n);var s=this._f[e](t,i);return"set"==e?this:s}return r.call(this,t,i)})}))},{"./_array-methods":208,"./_collection":216,"./_collection-weak":215,"./_is-object":235,"./_meta":243,"./_object-assign":244,"./_redefine":259}],289:[function(e,t,r){"use strict";var n=e("./_collection-weak");e("./_collection")("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(this,e,!0)}},n,!1,!0)},{"./_collection":216,"./_collection-weak":215}],290:[function(e,t,r){var n=e("./_export");n(n.P+n.R,"Map",{toJSON:e("./_collection-to-json")("Map")})},{"./_collection-to-json":214,"./_export":224}],291:[function(e,t,r){e("./_wks-define")("asyncIterator")},{"./_wks-define":273}],292:[function(e,t,r){e("./_wks-define")("observable")},{"./_wks-define":273}],293:[function(e,t,r){e("./es6.array.iterator");for(var n=e("./_global"),i=e("./_hide"),s=e("./_iterators"),a=e("./_wks")("toStringTag"),o=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var l=o[u],c=n[l],p=c&&c.prototype;p&&!p[a]&&i(p,a,l),s[l]=s.Array}},{"./_global":227,"./_hide":229,"./_iterators":240,"./_wks":275,"./es6.array.iterator":278}],294:[function(e,t,r){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===y(e)}function n(e){return"boolean"==typeof e}function i(e){return null===e}function s(e){return null==e}function a(e){return"number"==typeof e}function o(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===y(e)}function p(e){return"object"==typeof e&&null!==e}function h(e){return"[object Date]"===y(e)}function f(e){return"[object Error]"===y(e)||e instanceof Error}function d(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function y(e){return Object.prototype.toString.call(e)}r.isArray=t,r.isBoolean=n,r.isNull=i,r.isNullOrUndefined=s,r.isNumber=a,r.isString=o,r.isSymbol=u,r.isUndefined=l,r.isRegExp=c,r.isObject=p,r.isDate=h,r.isError=f,r.isFunction=d,r.isPrimitive=m, +r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":308}],295:[function(e,t,r){t.exports=e("./src/node")},{"./src/node":298}],296:[function(e,t,r){(function(n){function i(){return!("undefined"==typeof window||!window||void 0===window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function s(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(s=i))}),e.splice(s,0,n)}}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}}function u(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}r=t.exports=e("./debug"),r.log=a,r.formatArgs=s,r.save=o,r.load=u,r.useColors=i,r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(u())}).call(this,e("_process"))},{"./debug":297,_process:539}],297:[function(e,t,r){function n(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function i(e){function t(){if(t.enabled){var e=t,n=+new Date,i=n-(l||n);e.diff=i,e.prev=l,e.curr=n,l=n;for(var s=new Array(arguments.length),a=0;ar||a===r&&o>n)&&(r=a,n=o,t=Number(i))}return t}var i=e("repeating");t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");var t,r,s=0,a=0,o=0,u={};e.split(/\n/g).forEach(function(e){if(e){var n,i=e.match(/^(?:( )+|\t+)/);i?(n=i[0].length,i[1]?a++:s++):n=0;var l=n-o;o=n,l?(r=l>0,t=u[r?l:-l],t?t[0]++:t=u[l]=[1,0]):t&&(t[1]+=Number(r))}});var l,c,p=n(u);return p?a>=s?(l="space",c=i(" ",p)):(l="tab",c=i("\t",p)):(l=null,c=""),{amount:p,type:l,indent:c}}},{repeating:588}],300:[function(e,t,r){"use strict";t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}},{}],301:[function(e,t,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function s(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,r,n,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(r=this._events[e],o(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),l=r.slice(),n=l.length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,s,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],s=r.length,n=-1,r===t||i(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(o=s;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],i(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],302:[function(e,t,r){t.exports={builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es5:{Array:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,propertyIsEnumerable:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1},es6:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{addEventListener:!1,alert:!1,AnalyserNode:!1,Animation:!1,AnimationEffectReadOnly:!1,AnimationEffectTiming:!1,AnimationEffectTimingReadOnly:!1,AnimationEvent:!1,AnimationPlaybackEvent:!1,AnimationTimeline:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AutocompleteErrorEvent:!1,BarProp:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,blur:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CDATASection:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClientRect:!1,ClientRectList:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConvolverNode:!1,Credential:!1,CredentialsContainer:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSAnimation:!1,CSSFontFaceRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CSSTransition:!1,CSSUnknownRule:!1,CSSViewportRule:!1,customElements:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,Debug:!1,defaultStatus:!1,defaultstatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentTimeline:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMParser:!1,DOMSettableTokenList:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,FederatedCredential:!1,fetch:!1,File:!1,FileError:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAppletElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLKeygenElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,ImageBitmap:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,InputMethodContext:!1,IntersectionObserver:!1,IntersectionObserverEntry:!1,Intl:!1,KeyboardEvent:!1,KeyframeEffect:!1,KeyframeEffectReadOnly:!1,length:!1,localStorage:!1,location:!1,Location:!1,locationbar:!1,matchMedia:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyError:!1,MediaKeyEvent:!1,MediaKeyMessageEvent:!1,MediaKeys:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaSource:!1,MediaRecorder:!1,MediaStream:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,navigator:!1,Navigator:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PasswordCredential:!1,Path2D:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,Plugin:!1,PluginArray:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,PromiseRejectionEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,RadioNodeList:!1,Range:!1,ReadableByteStream:!1,ReadableStream:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,requestIdleCallback:!1,resizeBy:!1,resizeTo:!1,Response:!1,RTCIceCandidate:!1,RTCSessionDescription:!1,RTCPeerConnection:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedKeyframeList:!1,SharedWorker:!1,showModalDialog:!1,SiteBoundCredential:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,status:!1,statusbar:!1,stop:!1,Storage:!1,StorageEvent:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,SVGZoomEvent:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeEvent:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,URLSearchParams:!1,ValidityState:!1,VTTCue:!1,WaveShaperNode:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestProgressEvent:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1,XSLTProcessor:!1},worker:{applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,Worker:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,Intl:!1,module:!1,process:!1,require:!1,root:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},commonjs:{exports:!0,module:!1,require:!1,global:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,run:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,check:!1,describe:!1,expect:!1,gen:!1,it:!1,fdescribe:!1,fit:!1,jest:!1,pit:!1,require:!1,test:!1,xdescribe:!1,xit:!1,xtest:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,throws:!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,Java:!1,java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,ln:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,set:!1,target:!1,tempdir:!1,test:!1,touch:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,AccountsClient:!1,AccountsServer:!1,AccountsCommon:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,DDPRateLimiter:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,ServiceConfiguration:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,ISODate:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,NumberInt:!1,NumberLong:!1,ObjectId:!1,PlanCache:!1,print:!1,printjson:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{caches:!1,Cache:!1,CacheStorage:!1,Client:!1,clients:!1,Clients:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,FetchEvent:!1,importScripts:!1,registration:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,skipWaiting:!1,WindowClient:!1},atomtest:{advanceClock:!1,fakeClearInterval:!1,fakeClearTimeout:!1,fakeSetInterval:!1,fakeSetTimeout:!1,resetTimeouts:!1,waitsForPromise:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentURL:!1,fillIn:!1,find:!1,findWithAssert:!1,keyEvent:!1,pauseTest:!1,resumeTest:!1,triggerEvent:!1,visit:!1},protractor:{$:!1,$$:!1,browser:!1,By:!1,by:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1},webextensions:{browser:!1,chrome:!1,opr:!1},greasemonkey:{GM_addStyle:!1,GM_deleteValue:!1,GM_getResourceText:!1,GM_getResourceURL:!1,GM_getValue:!1,GM_info:!1,GM_listValues:!1,GM_log:!1,GM_openInTab:!1,GM_registerMenuCommand:!1,GM_setClipboard:!1,GM_setValue:!1,GM_xmlhttpRequest:!1,unsafeWindow:!1}}},{}],303:[function(e,t,r){t.exports=e("./globals.json")},{"./globals.json":302}],304:[function(e,t,r){"use strict";var n=e("ansi-regex"),i=new RegExp(n().source);t.exports=i.test.bind(i)},{"ansi-regex":1}],305:[function(e,t,r){r.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,u=(1<>1,c=-7,p=r?i-1:0,h=r?-1:1,f=e[t+p];for(p+=h,s=f&(1<<-c)-1,f>>=-c,c+=o;c>0;s=256*s+e[t+p],p+=h,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=h,c-=8);if(0===s)s=1-l;else{if(s===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=l}return(f?-1:1)*a*Math.pow(2,s-n)},r.write=function(e,t,r,n,i,s){var a,o,u,l=8*s-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+p>=1?h/u:h*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=c?(o=0,a=c):a+p>=1?(o=(t*u-1)*Math.pow(2,i),a+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&o,f+=d,o/=256,i-=8);for(a=a<0;e[r+f]=255&a,f+=d,a/=256,l-=8);e[r+f-d]|=128*m}},{}],306:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],307:[function(e,t,r){"use strict";var n=function(e,t,r,n,i,s,a,o){if(void 0===t)throw new Error("invariant requires an error message argument");if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,i,s,a,o],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};t.exports=n},{}],308:[function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}t.exports=function(e){return null!=e&&(n(e)||i(e)||!!e._isBuffer)}},{}],309:[function(e,t,r){"use strict";var n=e("number-is-nan");t.exports=Number.isFinite||function(e){return!("number"!=typeof e||n(e)||e===1/0||e===-1/0)}},{"number-is-nan":533}],310:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],311:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}), +r.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,r.matchToToken=function(e){var t={type:"invalid",value:e[0]};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}},{}],312:[function(e,t,r){(function(e){!function(n){var i="object"==typeof r&&r,s="object"==typeof t&&t&&t.exports==i&&t,a="object"==typeof e&&e;a.global!==a&&a.window!==a||(n=a);var o={},u=o.hasOwnProperty,l=function(e,t){var r;for(r in e)u.call(e,r)&&t(r,e[r])},c=function(e,t){return t?(l(t,function(t,r){e[t]=r}),e):e},p=function(e,t){for(var r=e.length,n=-1;++n=55296&&j<=56319&&R>M+1&&(N=L.charCodeAt(M+1))>=56320&&N<=57343){I=1024*(j-55296)+N-56320+65536;var V=I.toString(16);u||(V=V.toUpperCase()),i+="\\u{"+V+"}",M++}else{if(!t.escapeEverything){if(D.test(U)){i+=U;continue}if('"'==U){i+=s==U?'\\"':U;continue}if("'"==U){i+=s==U?"\\'":U;continue}}if("\0"!=U||n||A.test(L.charAt(M+1)))if(E.test(U))i+=x[U];else{var q=U.charCodeAt(0),V=q.toString(16);u||(V=V.toUpperCase());var G=V.length>2||n,X="\\"+(G?"u":"x")+("0000"+V).slice(G?-4:-2);i+=X}else i+="\\0"}}return t.wrap&&(i=s+i+s),t.escapeEtago?i.replace(/<\/(script|style)/gi,"<\\/$1"):i};C.version="1.3.0","function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return C}):i&&!i.nodeType?s?s.exports=C:i.jsesc=C:n.jsesc=C}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],313:[function(e,t,r){var n="object"==typeof r?r:{};n.parse=function(){"use strict";var e,t,r,n,i,s,a={"'":"'",'"':'"',"\\":"\\","/":"/","\n":"",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=[" ","\t","\r","\n","\v","\f"," ","\ufeff"],u=function(e){return""===e?"EOF":"'"+e+"'"},l=function(n){var s=new SyntaxError;throw s.message=n+" at line "+t+" column "+r+" of the JSON5 data. Still to read: "+JSON.stringify(i.substring(e-1,e+19)),s.at=e,s.lineNumber=t,s.columnNumber=r,s},c=function(s){return s&&s!==n&&l("Expected "+u(s)+" instead of "+u(n)),n=i.charAt(e),e++,r++,("\n"===n||"\r"===n&&"\n"!==p())&&(t++,r=0),n},p=function(){return i.charAt(e)},h=function(){var e=n;for("_"!==n&&"$"!==n&&(n<"a"||n>"z")&&(n<"A"||n>"Z")&&l("Bad identifier as unquoted key");c()&&("_"===n||"$"===n||n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9");)e+=n;return e},f=function(){var e,t="",r="",i=10;if("-"!==n&&"+"!==n||(t=n,c(n)),"I"===n)return e=v(),("number"!=typeof e||isNaN(e))&&l("Unexpected word for number"),"-"===t?-e:e;if("N"===n)return e=v(),isNaN(e)||l("expected word to be NaN"),e;switch("0"===n&&(r+=n,c(),"x"===n||"X"===n?(r+=n,c(),i=16):n>="0"&&n<="9"&&l("Octal literal")),i){case 10:for(;n>="0"&&n<="9";)r+=n,c();if("."===n)for(r+=".";c()&&n>="0"&&n<="9";)r+=n;if("e"===n||"E"===n)for(r+=n,c(),"-"!==n&&"+"!==n||(r+=n,c());n>="0"&&n<="9";)r+=n,c();break;case 16:for(;n>="0"&&n<="9"||n>="A"&&n<="F"||n>="a"&&n<="f";)r+=n,c()}if(e="-"===t?-r:+r,isFinite(e))return e;l("Bad number")},d=function(){var e,t,r,i,s="";if('"'===n||"'"===n)for(r=n;c();){if(n===r)return c(),s;if("\\"===n)if(c(),"u"===n){for(i=0,t=0;t<4&&(e=parseInt(c(),16),isFinite(e));t+=1)i=16*i+e;s+=String.fromCharCode(i)}else if("\r"===n)"\n"===p()&&c();else{if("string"!=typeof a[n])break;s+=a[n]}else{if("\n"===n)break;s+=n}}l("Bad string")},m=function(){"/"!==n&&l("Not an inline comment");do{if(c(),"\n"===n||"\r"===n)return void c()}while(n)},y=function(){"*"!==n&&l("Not a block comment");do{for(c();"*"===n;)if(c("*"),"/"===n)return void c("/")}while(n);l("Unterminated block comment")},g=function(){"/"!==n&&l("Not a comment"),c("/"),"/"===n?m():"*"===n?y():l("Unrecognized comment")},b=function(){for(;n;)if("/"===n)g();else{if(!(o.indexOf(n)>=0))return;c()}},v=function(){switch(n){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null;case"I":return c("I"),c("n"),c("f"),c("i"),c("n"),c("i"),c("t"),c("y"),1/0;case"N":return c("N"),c("a"),c("N"),NaN}l("Unexpected "+u(n))},x=function(){var e=[];if("["===n)for(c("["),b();n;){if("]"===n)return c("]"),e;if(","===n?l("Missing array element"):e.push(s()),b(),","!==n)return c("]"),e;c(","),b()}l("Bad array")},E=function(){var e,t={};if("{"===n)for(c("{"),b();n;){if("}"===n)return c("}"),t;if(e='"'===n||"'"===n?d():h(),b(),c(":"),t[e]=s(),b(),","!==n)return c("}"),t;c(","),b()}l("Bad object")};return s=function(){switch(b(),n){case"{":return E();case"[":return x();case'"':case"'":return d();case"-":case"+":case".":return f();default:return n>="0"&&n<="9"?f():v()}},function(a,o){var u;return i=String(a),e=0,t=1,r=1,n=" ",u=s(),b(),n&&l("Syntax error"),"function"==typeof o?function e(t,r){var n,i,s=t[r];if(s&&"object"==typeof s)for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(i=e(s,n),void 0!==i?s[n]=i:delete s[n]);return o.call(t,r,s)}({"":u},""):u}}(),n.stringify=function(e,t,r){function i(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"_"===e||"$"===e}function s(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||"$"===e}function a(e){if("string"!=typeof e)return!1;if(!s(e[0]))return!1;for(var t=1,r=e.length;t10&&(e=e.substring(0,10));for(var n=r?"":"\n",i=0;i=0?i:void 0:i};n.isWord=a;var d,m=[];r&&("string"==typeof r?d=r:"number"==typeof r&&r>=0&&(d=c(" ",r,!0)));var y=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b={"":e};return void 0===e?f(b,"",!0):h(b,"",!0)}},{}],314:[function(e,t,r){var n=e("./_getNative"),i=e("./_root"),s=n(i,"DataView");t.exports=s},{"./_getNative":418,"./_root":462}],315:[function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1}var i=e("./_baseIndexOf");t.exports=n},{"./_baseIndexOf":357}],332:[function(e,t,r){function n(e,t,r){for(var n=-1,i=null==e?0:e.length;++n=t?e:t)),e}t.exports=n},{}],345:[function(e,t,r){function n(e,t,r,P,B,O){var j,N=t&D,I=t&C,L=t&S;if(r&&(j=B?r(e,P,B,O):r(e)),void 0!==j)return j;if(!E(e))return e;var M=v(e);if(M){if(j=y(e),!N)return c(e,j)}else{var R=m(e),U=R==w||R==k;if(x(e))return l(e,N);if(R==F||R==_||U&&!B){if(j=I||U?{}:b(e),!N)return I?h(e,u(j,e)):p(e,o(j,e))}else{if(!T[R])return B?e:{};j=g(e,R,n,N)}}O||(O=new i);var V=O.get(e);if(V)return V;O.set(e,j);var q=L?I?d:f:I?keysIn:A,G=M?void 0:q(e);return s(G||e,function(i,s){G&&(s=i,i=e[s]),a(j,s,n(i,t,r,s,e,O))}),j}var i=e("./_Stack"),s=e("./_arrayEach"),a=e("./_assignValue"),o=e("./_baseAssign"),u=e("./_baseAssignIn"),l=e("./_cloneBuffer"),c=e("./_copyArray"),p=e("./_copySymbols"),h=e("./_copySymbolsIn"),f=e("./_getAllKeys"),d=e("./_getAllKeysIn"),m=e("./_getTag"),y=e("./_initCloneArray"),g=e("./_initCloneByTag"),b=e("./_initCloneObject"),v=e("./isArray"),x=e("./isBuffer"),E=e("./isObject"),A=e("./keys"),D=1,C=2,S=4,_="[object Arguments]",w="[object Function]",k="[object GeneratorFunction]",F="[object Object]",T={};T[_]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object DataView]"]=T["[object Boolean]"]=T["[object Date]"]=T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Map]"]=T["[object Number]"]=T[F]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object Symbol]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Error]"]=T[w]=T["[object WeakMap]"]=!1,t.exports=n},{"./_Stack":322,"./_arrayEach":329,"./_assignValue":339,"./_baseAssign":341,"./_baseAssignIn":342,"./_cloneBuffer":389,"./_copyArray":398,"./_copySymbols":400,"./_copySymbolsIn":401,"./_getAllKeys":414,"./_getAllKeysIn":415,"./_getTag":423,"./_initCloneArray":431,"./_initCloneByTag":432,"./_initCloneObject":433,"./isArray":498,"./isBuffer":501,"./isObject":505,"./keys":512}],346:[function(e,t,r){var n=e("./isObject"),i=Object.create,s=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();t.exports=s},{"./isObject":505}],347:[function(e,t,r){var n=e("./_baseForOwn"),i=e("./_createBaseEach"),s=i(n);t.exports=s},{"./_baseForOwn":351,"./_createBaseEach":404}],348:[function(e,t,r){function n(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s0&&r(c)?t>1?n(c,t-1,r,a,o):i(o,c):a||(o[o.length]=c)}return o}var i=e("./_arrayPush"),s=e("./_isFlattenable");t.exports=n},{"./_arrayPush":335,"./_isFlattenable":434}],350:[function(e,t,r){var n=e("./_createBaseFor"),i=n();t.exports=i},{"./_createBaseFor":405}],351:[function(e,t,r){function n(e,t){return e&&i(e,t,s)}var i=e("./_baseFor"),s=e("./keys");t.exports=n},{"./_baseFor":350,"./keys":512}],352:[function(e,t,r){function n(e,t){t=i(t,e);for(var r=0,n=t.length;null!=e&&ri)return r;do{t%2&&(r+=e),(t=s(t/2))&&(e+=e)}while(t);return r}var i=9007199254740991,s=Math.floor;t.exports=n},{}],378:[function(e,t,r){function n(e,t){return a(s(e,t,i),e+"")}var i=e("./identity"),s=e("./_overRest"),a=e("./_setToString");t.exports=n},{"./_overRest":461,"./_setToString":466,"./identity":495}],379:[function(e,t,r){var n=e("./constant"),i=e("./_defineProperty"),s=e("./identity"),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:s;t.exports=a},{"./_defineProperty":409,"./constant":483,"./identity":495}],380:[function(e,t,r){function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}t.exports=n},{}],381:[function(e,t,r){function n(e,t){for(var r=-1,n=Array(e);++r=c){var y=t?null:u(e);if(y)return l(y);f=!1,p=o,m=new i}else m=t?[]:d;e:for(;++nt||a&&o&&l&&!u&&!c||n&&o&&l||!r&&l||!s)return 1;if(!n&&!a&&!c&&e=u)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}var i=e("./_compareAscending");t.exports=n},{"./_compareAscending":396}],398:[function(e,t,r){function n(e,t){var r=-1,n=e.length +;for(t||(t=Array(n));++r1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&s(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n-1?o[u?t[l]:l]:void 0}}var i=e("./_baseIteratee"),s=e("./isArrayLike"),a=e("./keys");t.exports=n},{"./_baseIteratee":366,"./isArrayLike":499,"./keys":512}],407:[function(e,t,r){var n=e("./_Set"),i=e("./noop"),s=e("./_setToArray"),a=n&&1/s(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;t.exports=a},{"./_Set":320,"./_setToArray":465,"./noop":517}],408:[function(e,t,r){function n(e,t,r,n){return void 0===e||i(e,s[r])&&!a.call(n,r)?t:e}var i=e("./eq"),s=Object.prototype,a=s.hasOwnProperty;t.exports=n},{"./eq":485}],409:[function(e,t,r){var n=e("./_getNative"),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.exports=i},{"./_getNative":418}],410:[function(e,t,r){function n(e,t,r,n,l,c){var p=r&o,h=e.length,f=t.length;if(h!=f&&!(p&&f>h))return!1;var d=c.get(e);if(d&&c.get(t))return d==t;var m=-1,y=!0,g=r&u?new i:void 0;for(c.set(e,t),c.set(t,e);++m-1&&e%1==0&&e-1}var i=e("./_assocIndexOf");t.exports=n},{"./_assocIndexOf":340}],446:[function(e,t,r){function n(e,t){var r=this.__data__,n=i(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var i=e("./_assocIndexOf");t.exports=n},{"./_assocIndexOf":340}],447:[function(e,t,r){function n(){this.size=0,this.__data__={hash:new i,map:new(a||s),string:new i}}var i=e("./_Hash"),s=e("./_ListCache"),a=e("./_Map");t.exports=n},{"./_Hash":315,"./_ListCache":316,"./_Map":317}],448:[function(e,t,r){function n(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}var i=e("./_getMapData");t.exports=n},{"./_getMapData":416}],449:[function(e,t,r){function n(e){return i(this,e).get(e)}var i=e("./_getMapData");t.exports=n},{"./_getMapData":416}],450:[function(e,t,r){function n(e){return i(this,e).has(e)}var i=e("./_getMapData");t.exports=n},{"./_getMapData":416}],451:[function(e,t,r){function n(e,t){var r=i(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var i=e("./_getMapData");t.exports=n},{"./_getMapData":416}],452:[function(e,t,r){function n(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}t.exports=n},{}],453:[function(e,t,r){function n(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}t.exports=n},{}],454:[function(e,t,r){function n(e){var t=i(e,function(e){return r.size===s&&r.clear(),e}),r=t.cache;return t}var i=e("./memoize"),s=500;t.exports=n},{"./memoize":515}],455:[function(e,t,r){var n=e("./_getNative"),i=n(Object,"create");t.exports=i},{"./_getNative":418}],456:[function(e,t,r){var n=e("./_overArg"),i=n(Object.keys,Object);t.exports=i},{"./_overArg":460}],457:[function(e,t,r){function n(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}t.exports=n},{}],458:[function(e,t,r){var n=e("./_freeGlobal"),i="object"==typeof r&&r&&!r.nodeType&&r,s=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===i,o=a&&n.process,u=function(){try{return o&&o.binding&&o.binding("util")}catch(e){}}();t.exports=u},{"./_freeGlobal":413}],459:[function(e,t,r){function n(e){return s.call(e)}var i=Object.prototype,s=i.toString;t.exports=n},{}],460:[function(e,t,r){function n(e,t){return function(r){return e(t(r))}}t.exports=n},{}],461:[function(e,t,r){function n(e,t,r){return t=s(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,o=s(n.length-t,0),u=Array(o);++a0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var i=800,s=16,a=Date.now;t.exports=n},{}],468:[function(e,t,r){function n(){this.__data__=new i,this.size=0}var i=e("./_ListCache");t.exports=n},{"./_ListCache":316}],469:[function(e,t,r){function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}t.exports=n},{}],470:[function(e,t,r){function n(e){return this.__data__.get(e)}t.exports=n},{}],471:[function(e,t,r){function n(e){return this.__data__.has(e)}t.exports=n},{}],472:[function(e,t,r){function n(e,t){var r=this.__data__;if(r instanceof i){var n=r.__data__;if(!s||n.length-1:!!c&&i(e,t,r)>-1}var i=e("./_baseIndexOf"),s=e("./isArrayLike"),a=e("./isString"),o=e("./toInteger"),u=e("./values"),l=Math.max;t.exports=n},{"./_baseIndexOf":357,"./isArrayLike":499,"./isString":509,"./toInteger":525,"./values":530}],497:[function(e,t,r){var n=e("./_baseIsArguments"),i=e("./isObjectLike"),s=Object.prototype,a=s.hasOwnProperty,o=s.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!o.call(e,"callee")};t.exports=u},{"./_baseIsArguments":358,"./isObjectLike":506}],498:[function(e,t,r){var n=Array.isArray;t.exports=n},{}],499:[function(e,t,r){function n(e){return null!=e&&s(e.length)&&!i(e)}var i=e("./isFunction"),s=e("./isLength");t.exports=n},{"./isFunction":502,"./isLength":504}],500:[function(e,t,r){function n(e){return s(e)&&i(e)}var i=e("./isArrayLike"),s=e("./isObjectLike");t.exports=n},{"./isArrayLike":499,"./isObjectLike":506}],501:[function(e,t,r){var n=e("./_root"),i=e("./stubFalse"),s="object"==typeof r&&r&&!r.nodeType&&r,a=s&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===s,u=o?n.Buffer:void 0,l=u?u.isBuffer:void 0,c=l||i;t.exports=c},{"./_root":462,"./stubFalse":523}],502:[function(e,t,r){function n(e){if(!s(e))return!1;var t=i(e);return t==o||t==u||t==a||t==l}var i=e("./_baseGetTag"),s=e("./isObject"),a="[object AsyncFunction]",o="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";t.exports=n},{"./_baseGetTag":354,"./isObject":505}],503:[function(e,t,r){function n(e){return"number"==typeof e&&e==i(e)}var i=e("./toInteger");t.exports=n},{"./toInteger":525}],504:[function(e,t,r){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}var i=9007199254740991;t.exports=n},{}],505:[function(e,t,r){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=n},{}],506:[function(e,t,r){function n(e){return null!=e&&"object"==typeof e}t.exports=n},{}],507:[function(e,t,r){function n(e){if(!a(e)||i(e)!=o)return!1;var t=s(e);if(null===t)return!0;var r=p.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==h}var i=e("./_baseGetTag"),s=e("./_getPrototype"),a=e("./isObjectLike"),o="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,p=l.hasOwnProperty,h=c.call(Object);t.exports=n},{"./_baseGetTag":354,"./_getPrototype":419,"./isObjectLike":506}],508:[function(e,t,r){var n=e("./_baseIsRegExp"),i=e("./_baseUnary"),s=e("./_nodeUtil"),a=s&&s.isRegExp,o=a?i(a):n;t.exports=o},{"./_baseIsRegExp":364,"./_baseUnary":383,"./_nodeUtil":458}],509:[function(e,t,r){function n(e){return"string"==typeof e||!s(e)&&a(e)&&i(e)==o}var i=e("./_baseGetTag"),s=e("./isArray"),a=e("./isObjectLike"),o="[object String]";t.exports=n},{"./_baseGetTag":354,"./isArray":498,"./isObjectLike":506}],510:[function(e,t,r){function n(e){return"symbol"==typeof e||s(e)&&i(e)==a}var i=e("./_baseGetTag"),s=e("./isObjectLike"),a="[object Symbol]";t.exports=n},{"./_baseGetTag":354,"./isObjectLike":506}],511:[function(e,t,r){var n=e("./_baseIsTypedArray"),i=e("./_baseUnary"),s=e("./_nodeUtil"),a=s&&s.isTypedArray,o=a?i(a):n;t.exports=o},{"./_baseIsTypedArray":365,"./_baseUnary":383,"./_nodeUtil":458}],512:[function(e,t,r){function n(e){return a(e)?i(e):s(e)}var i=e("./_arrayLikeKeys"),s=e("./_baseKeys"),a=e("./isArrayLike");t.exports=n},{"./_arrayLikeKeys":333,"./_baseKeys":367,"./isArrayLike":499}],513:[function(e,t,r){function n(e){return a(e)?i(e,!0):s(e)}var i=e("./_arrayLikeKeys"),s=e("./_baseKeysIn"),a=e("./isArrayLike");t.exports=n},{"./_arrayLikeKeys":333,"./_baseKeysIn":368,"./isArrayLike":499}],514:[function(e,t,r){function n(e,t){return(o(e)?i:a)(e,s(t,3))}var i=e("./_arrayMap"),s=e("./_baseIteratee"),a=e("./_baseMap"),o=e("./isArray");t.exports=n},{"./_arrayMap":334,"./_baseIteratee":366,"./_baseMap":369,"./isArray":498}],515:[function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(n.Cache||i),r}var i=e("./_MapCache"),s="Expected a function";n.Cache=i,t.exports=n},{"./_MapCache":318}],516:[function(e,t,r){var n=e("./_baseMerge"),i=e("./_createAssigner"),s=i(function(e,t,r,i){n(e,t,r,i)});t.exports=s},{"./_baseMerge":372,"./_createAssigner":403}],517:[function(e,t,r){function n(){}t.exports=n},{}],518:[function(e,t,r){function n(e){return a(e)?i(o(e)):s(e)}var i=e("./_baseProperty"),s=e("./_basePropertyDeep"),a=e("./_isKey"),o=e("./_toKey");t.exports=n},{"./_baseProperty":375,"./_basePropertyDeep":376,"./_isKey":437,"./_toKey":475}],519:[function(e,t,r){function n(e,t,r){return t=(r?s(e,t,r):void 0===t)?1:a(t),i(o(e),t)}var i=e("./_baseRepeat"),s=e("./_isIterateeCall"),a=e("./toInteger"),o=e("./toString");t.exports=n},{"./_baseRepeat":377,"./_isIterateeCall":436,"./toInteger":525,"./toString":528}],520:[function(e,t,r){var n=e("./_baseFlatten"),i=e("./_baseOrderBy"),s=e("./_baseRest"),a=e("./_isIterateeCall"),o=s(function(e,t){if(null==e)return[];var r=t.length;return r>1&&a(e,t[0],t[1])?t=[]:r>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,n(t,1),[])});t.exports=o},{"./_baseFlatten":349,"./_baseOrderBy":374,"./_baseRest":378,"./_isIterateeCall":436}],521:[function(e,t,r){function n(e,t,r){return e=o(e),r=null==r?0:i(a(r),0,e.length),t=s(t),e.slice(r,r+t.length)==t}var i=e("./_baseClamp"),s=e("./_baseToString"),a=e("./toInteger"),o=e("./toString");t.exports=n},{"./_baseClamp":344,"./_baseToString":382,"./toInteger":525,"./toString":528}],522:[function(e,t,r){function n(){return[]}t.exports=n},{}],523:[function(e,t,r){function n(){return!1}t.exports=n},{}],524:[function(e,t,r){function n(e){if(!e)return 0===e?e:0;if((e=i(e))===s||e===-s){return(e<0?-1:1)*a}return e===e?e:0}var i=e("./toNumber"),s=1/0,a=1.7976931348623157e308;t.exports=n},{"./toNumber":526}],525:[function(e,t,r){function n(e){var t=i(e),r=t%1;return t===t?r?t-r:t:0}var i=e("./toFinite");t.exports=n},{"./toFinite":524}],526:[function(e,t,r){function n(e){if("number"==typeof e)return e;if(s(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=l.test(e);return r||c.test(e)?p(e.slice(2),r?2:8):u.test(e)?a:+e}var i=e("./isObject"),s=e("./isSymbol"),a=NaN,o=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,p=parseInt;t.exports=n},{"./isObject":505,"./isSymbol":510}],527:[function(e,t,r){function n(e){return i(e,s(e))}var i=e("./_copyObject"),s=e("./keysIn");t.exports=n},{"./_copyObject":399,"./keysIn":513}],528:[function(e,t,r){function n(e){return null==e?"":i(e)}var i=e("./_baseToString");t.exports=n},{"./_baseToString":382}],529:[function(e,t,r){function n(e){return e&&e.length?i(e):[]}var i=e("./_baseUniq");t.exports=n},{"./_baseUniq":384}],530:[function(e,t,r){function n(e){return null==e?[]:i(e,s(e))}var i=e("./_baseValues"),s=e("./keys");t.exports=n},{"./_baseValues":385,"./keys":512}],531:[function(e,t,r){function n(e,t){return t=t||{},function(r,n,i){return s(r,e,t)}}function i(e,t){e=e||{},t=t||{};var r={};return Object.keys(t).forEach(function(e){r[e]=t[e]}),Object.keys(e).forEach(function(t){r[t]=e[t]}),r}function s(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new a(t,r).match(e))}function a(e,t){if(!(this instanceof a))return new a(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==m.sep&&(e=e.split(m.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function o(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(C)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r}}function u(){var e=this.pattern,t=!1,r=this.options,n=0;if(!r.nonegate){for(var i=0,s=e.length;i65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return y;if(""===e)return"";for(var i,s,a="",o=!!n.nocase,u=!1,l=[],c=[],p=!1,h=-1,d=-1,m="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",g=this,E=0,A=e.length;E-1;P--){ +var B=c[P],O=a.slice(0,B.reStart),j=a.slice(B.reStart,B.reEnd-8),N=a.slice(B.reEnd-8,B.reEnd),I=a.slice(B.reEnd);N+=I;var L=O.split("(").length-1,M=I;for(E=0;E=0&&!(i=e[s]);s--);for(s=0;s>> no match, partial?",e,c,t,p),c!==a))}var f;if("string"==typeof u?(f=n.nocase?l.toLowerCase()===u.toLowerCase():l===u,this.debug("string match",u,l,f)):(f=l.match(u),this.debug("pattern match",u,l,f)),!f)return!1}if(i===a&&s===o)return!0;if(i===a)return r;if(s===o){return i===a-1&&""===e[i]}throw new Error("wtf?")}},{"brace-expansion":180,path:535}],532:[function(e,t,r){function n(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*p;case"days":case"day":case"d":return r*c;case"hours":case"hour":case"hrs":case"hr":case"h":return r*l;case"minutes":case"minute":case"mins":case"min":case"m":return r*u;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function i(e){return e>=c?Math.round(e/c)+"d":e>=l?Math.round(e/l)+"h":e>=u?Math.round(e/u)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}function s(e){return a(e,c,"day")||a(e,l,"hour")||a(e,u,"minute")||a(e,o,"second")||e+" ms"}function a(e,t,r){if(!(e0)return n(e);if("number"===r&&!1===isNaN(e))return t.long?s(e):i(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],533:[function(e,t,r){"use strict";t.exports=Number.isNaN||function(e){return e!==e}},{}],534:[function(e,t,r){r.endianness=function(){return"LE"},r.hostname=function(){return"undefined"!=typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n"},{}],535:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!i;s--){var a=s>=0?arguments[s]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),s="/"===a(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),s=n(t.split("/")),a=Math.min(i.length,s.length),o=a,u=0;un&&(t[n]=t[r]),++n);return t.length=n,t},r.makeAccessor=l},{}],538:[function(e,t,r){(function(e){"use strict";function r(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var s,a,o=arguments.length;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(s=new Array(o-1),a=0;a1)for(var r=1;r0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var l;!t.decoder||i||n||(r=t.decoder.write(r),l=!t.objectMode&&0===r.length),i||(t.reading=!1),l||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&h(e))),d(e,t)}else i||(t.reading=!1);return o(t)}function o(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function l(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function c(e,t){var r=null;return j.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function p(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,h(e)}}function h(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(M("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?T(f,e):f(e))}function f(e){M("emit readable"),e.emit("readable"),x(e)}function d(e,t){t.readingMore||(t.readingMore=!0,T(m,e,t))}function m(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=A(e,t.buffer,t.decoder),r}function A(e,t,r){var n;return es.length?s.length:e;if(a===s.length?i+=s:i+=s.slice(0,e),0===(e-=a)){a===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(a));break}++n}return t.length-=n,i}function C(e,t){var r=N.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var s=n.data,a=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,a),0===(e-=a)){a===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(a));break}++i}return t.length-=i,r}function S(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,T(_,t,e))}function _(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function w(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return M("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?S(this):h(this),null;if(0===(e=l(e,t))&&t.ended)return 0===t.length&&S(this),null;var n=t.needReadable;M("need readable",n),(0===t.length||t.length-e0?E(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&S(this)),null!==i&&this.emit("data",i),i},s.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},s.prototype.pipe=function(e,t){function i(e){M("onunpipe"),e===h&&a()}function s(){M("onend"),e.end()}function a(){M("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",g),e.removeListener("error",u),e.removeListener("unpipe",i),h.removeListener("end",s),h.removeListener("end",a),h.removeListener("data",o),b=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||g()}function o(t){M("ondata"),v=!1,!1!==e.write(t)||v||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==k(f.pipes,e))&&!b&&(M("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,v=!0),h.pause())}function u(t){M("onerror",t),p(),e.removeListener("error",u),0===O(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),p()}function c(){M("onfinish"),e.removeListener("close",l),p()}function p(){M("unpipe"),h.unpipe(e)}var h=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,M("pipe count=%d opts=%j",f.pipesCount,t);var d=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,m=d?s:a;f.endEmitted?T(m):h.once("end",m),e.on("unpipe",i);var g=y(h);e.on("drain",g);var b=!1,v=!1;return h.on("data",o),n(e,"error",u),e.once("close",l),e.once("finish",c),e.emit("pipe",h),f.flowing||(M("pipe resume"),h.resume()),e},s.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1?setImmediate:C;a.WritableState=s;var _=e("core-util-is");_.inherits=e("inherits");var w,k={deprecate:e("util-deprecate")};!function(){try{w=e("stream")}catch(e){}finally{w||(w=e("events").EventEmitter)}}();var F=e("buffer").Buffer,T=e("buffer-shims");_.inherits(a,w),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(s.prototype,"buffer",{get:k.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var P;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(P=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!P.call(this,e)||e&&e._writableState instanceof s}})):P=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,r){var i=this._writableState,s=!1,a=F.isBuffer(e);return"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?o(this,r):(a||u(this,i,e,r))&&(i.pendingcb++,s=c(this,i,a,e,t,r)),s},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||g(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||E(this,n,r)}}).call(this,e("_process"))},{"./_stream_duplex":541,_process:539,buffer:184,"buffer-shims":183,"core-util-is":294,events:301,inherits:306,"process-nextick-args":538,"util-deprecate":598}],546:[function(e,t,r){"use strict";function n(){this.head=null,this.tail=null,this.length=0}var i=(e("buffer").Buffer,e("buffer-shims"));t.exports=n,n.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},n.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},n.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},n.prototype.concat=function(e){if(0===this.length)return i.alloc(0) +;if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t}},{buffer:184,"buffer-shims":183}],547:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":542}],548:[function(e,t,r){(function(n){var i=function(){try{return e("stream")}catch(e){}}();r=t.exports=e("./lib/_stream_readable.js"),r.Stream=i||r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&i&&(t.exports=i)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":541,"./lib/_stream_passthrough.js":542,"./lib/_stream_readable.js":543,"./lib/_stream_transform.js":544,"./lib/_stream_writable.js":545,_process:539}],549:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":544}],550:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":545}],551:[function(e,t,r){function n(e,t,r){if(e){if(x.fixFaultyLocations(e,t),r){if(d.Node.check(e)&&d.SourceLocation.check(e.loc)){for(var i=r.length-1;i>=0&&!(E(r[i].loc.end,e.loc.start)<=0);--i);return void r.splice(i+1,0,e)}}else if(e[A])return e[A];var s;if(m.check(e))s=Object.keys(e);else{if(!y.check(e))return;s=f.getFieldNames(e)}r||Object.defineProperty(e,A,{value:r=[],enumerable:!1});for(var i=0,a=s.length;i>1,l=s[u];if(E(l.loc.start,t.loc.start)<=0&&E(t.loc.end,l.loc.end)<=0)return void i(t.enclosingNode=l,t,r);if(E(l.loc.end,t.loc.start)<=0){var c=l;a=u+1}else{if(!(E(t.loc.end,l.loc.start)<=0))throw new Error("Comment location overlaps with node location");var p=l;o=u}}c&&(t.precedingNode=c),p&&(t.followingNode=p)}function s(e,t){var r=e.length;if(0!==r){for(var n=e[0].precedingNode,i=e[0].followingNode,s=i.loc.start,a=r;a>0;--a){var u=e[a-1];h.strictEqual(u.precedingNode,n),h.strictEqual(u.followingNode,i);var c=t.sliceString(u.loc.end,s);if(/\S/.test(c))break;s=u.loc.start}for(;a<=r&&(u=e[a])&&("Line"===u.type||"CommentLine"===u.type)&&u.loc.start.column>i.loc.start.column;)++a;e.forEach(function(e,t){t0){var d=n[f-1];h.strictEqual(d.precedingNode===e.precedingNode,d.followingNode===e.followingNode),d.followingNode!==e.followingNode&&s(n,r)}n.push(e)}else if(a)s(n,r),l(a,e);else if(p)s(n,r),o(p,e);else{if(!c)throw new Error("AST contains no nodes at all?");s(n,r),u(c,e)}}),s(n,r),e.forEach(function(e){delete e.precedingNode,delete e.enclosingNode,delete e.followingNode})}},r.printComments=function(e,t){var r=e.getValue(),n=t(e),i=d.Node.check(r)&&f.getFieldValue(r,"comments");if(!i||0===i.length)return n;var s=[],a=[n];return e.each(function(e){var n=e.getValue(),i=f.getFieldValue(n,"leading"),o=f.getFieldValue(n,"trailing");i||o&&!d.Statement.check(r)&&"Block"!==n.type&&"CommentBlock"!==n.type?s.push(c(e,t)):o&&a.push(p(e,t))},"comments"),s.push.apply(s,a),v(s)}},{"./lines":553,"./types":559,"./util":560,assert:3,private:537}],552:[function(e,t,r){function n(e){o.ok(this instanceof n),this.stack=[e]}function i(e,t){for(var r=e.stack,n=r.length-1;n>=0;n-=2){var i=r[n];if(l.Node.check(i)&&--t<0)return i}return null}function s(e){return l.BinaryExpression.check(e)||l.LogicalExpression.check(e)}function a(e){return!!l.CallExpression.check(e)||(c.check(e)?e.some(a):!!l.Node.check(e)&&u.someField(e,function(e,t){return a(t)}))}var o=e("assert"),u=e("./types"),l=u.namedTypes,c=(l.Node,u.builtInTypes.array),p=u.builtInTypes.number,h=n.prototype;t.exports=n,n.from=function(e){if(e instanceof n)return e.copy();if(e instanceof u.NodePath){for(var t,r=Object.create(n.prototype),i=[e.value];t=e.parentPath;e=t)i.push(e.name,t.value);return r.stack=i.reverse(),r}return new n(e)},h.copy=function(){var e=Object.create(n.prototype);return e.stack=this.stack.slice(0),e},h.getName=function(){var e=this.stack,t=e.length;return t>1?e[t-2]:null},h.getValue=function(){var e=this.stack;return e[e.length-1]},h.getNode=function(e){return i(this,~~e)},h.getParentNode=function(e){return i(this,1+~~e)},h.getRootValue=function(){var e=this.stack;return e.length%2==0?e[1]:e[0]},h.call=function(e){for(var t=this.stack,r=t.length,n=t[r-1],i=arguments.length,s=1;sh)return!0;if(u===h&&"right"===r)return o.strictEqual(t.right,n),!0;default:return!1}case"SequenceExpression":switch(t.type){case"ReturnStatement":case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==r;default:return!0}case"YieldExpression":switch(t.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return"NullableTypeAnnotation"===t.type;case"Literal":return"MemberExpression"===t.type&&p.check(n.value)&&"object"===r&&t.object===n;case"AssignmentExpression":case"ConditionalExpression":switch(t.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===r&&t.callee===n;case"ConditionalExpression":return"test"===r&&t.test===n;case"MemberExpression":return"object"===r&&t.object===n;default:return!1}case"ArrowFunctionExpression":return!(!l.CallExpression.check(t)||"callee"!==r)||(!(!l.MemberExpression.check(t)||"object"!==r)||s(t));case"ObjectExpression":if("ArrowFunctionExpression"===t.type&&"body"===r)return!0;default:if("NewExpression"===t.type&&"callee"===r&&t.callee===n)return a(n)}return!(!0===e||this.canBeFirstInStatement()||!this.firstInStatement())};var f={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%","**"]].forEach(function(e,t){e.forEach(function(e){f[e]=t})}),h.canBeFirstInStatement=function(){var e=this.getNode();return!l.FunctionExpression.check(e)&&!l.ObjectExpression.check(e)},h.firstInStatement=function(){for(var e,t,r,n,i=this.stack,a=i.length-1;a>=0;a-=2)if(l.Node.check(i[a])&&(r=e,n=t,e=i[a-1],t=i[a]),t&&n){if(l.BlockStatement.check(t)&&"body"===e&&0===r)return o.strictEqual(t.body[0],n),!0;if(l.ExpressionStatement.check(t)&&"expression"===r)return o.strictEqual(t.expression,n),!0;if(l.SequenceExpression.check(t)&&"expressions"===e&&0===r)o.strictEqual(t.expressions[0],n);else if(l.CallExpression.check(t)&&"callee"===r)o.strictEqual(t.callee,n);else if(l.MemberExpression.check(t)&&"object"===r)o.strictEqual(t.object,n);else if(l.ConditionalExpression.check(t)&&"test"===r)o.strictEqual(t.test,n);else if(s(t)&&"left"===r)o.strictEqual(t.left,n);else{if(!l.UnaryExpression.check(t)||t.prefix||"argument"!==r)return!1;o.strictEqual(t.argument,n)}}return!0}},{"./types":559,assert:3}],553:[function(e,t,r){function n(e){return e[f]}function i(e,t){c.ok(this instanceof i),c.ok(e.length>0),t?m.assert(t):t=null,Object.defineProperty(this,f,{value:{infos:e,mappings:[],name:t,cachedSourceMap:null}}),t&&n(this).mappings.push(new g(this,{start:this.firstPos(),end:this.lastPos()}))}function s(e){return{line:e.line,indent:e.indent,locked:e.locked,sliceStart:e.sliceStart,sliceEnd:e.sliceEnd}}function a(e,t){for(var r=0,n=e.length,i=0;i0);var s=Math.ceil(r/t)*t;s===r?r+=t:r=s;break;case 11:case 12:case 13:case 65279:break;case 32:default:r+=1}return r}function o(e,t){if(e instanceof i)return e;e+="";var r=t&&t.tabWidth,n=e.indexOf("\t")<0,s=!(!t||!t.locked),o=!t&&n&&e.length<=E;if(c.ok(r||n,"No tab width specified but encountered tabs in string\n"+e),o&&x.call(v,e))return v[e];var u=new i(e.split(D).map(function(e){var t=A.exec(e)[0];return{line:e,indent:a(t,r),locked:s,sliceStart:t.length,sliceEnd:e.length}}),h(t).sourceFileName);return o&&(v[e]=u),u}function u(e){return!/\S/.test(e)}function l(e,t,r){var n=e.sliceStart,i=e.sliceEnd,s=Math.max(e.indent,0),a=s+i-n;return void 0===r&&(r=a),t=Math.max(t,0),r=Math.min(r,a),r=Math.max(r,t),r=0),c.ok(n<=i),c.strictEqual(a,s+i-n),e.indent===s&&e.sliceStart===n&&e.sliceEnd===i?e:{line:e.line,indent:s,locked:!1,sliceStart:n,sliceEnd:i}}var c=e("assert"),p=e("source-map"),h=e("./options").normalize,f=e("private").makeUniqueKey(),d=e("./types"),m=d.builtInTypes.string,y=e("./util").comparePos,g=e("./mapping");r.Lines=i;var b=i.prototype;Object.defineProperties(b,{length:{get:function(){return n(this).infos.length}},name:{get:function(){return n(this).name}}});var v={},x=v.hasOwnProperty,E=10;r.countSpaces=a;var A=/^\s*/,D=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;r.fromString=o,b.toString=function(e){return this.sliceString(this.firstPos(),this.lastPos(),e)},b.getSourceMap=function(e,t){function r(r){return r=r||{},m.assert(e),r.file=e,t&&(m.assert(t),r.sourceRoot=t),r}if(!e)return null;var i=this,s=n(i);if(s.cachedSourceMap)return r(s.cachedSourceMap.toJSON());var a=new p.SourceMapGenerator(r()),o={};return s.mappings.forEach(function(e){for(var t=e.sourceLines.skipSpaces(e.sourceLoc.start)||e.sourceLines.lastPos(),r=i.skipSpaces(e.targetLoc.start)||i.lastPos();y(t,e.sourceLoc.end)<0&&y(r,e.targetLoc.end)<0;){var n=e.sourceLines.charAt(t),s=i.charAt(r);c.strictEqual(n,s);var u=e.sourceLines.name;if(a.addMapping({source:u,original:{line:t.line,column:t.column},generated:{line:r.line,column:r.column}}),!x.call(o,u)){var l=e.sourceLines.toString();a.setSourceContent(u,l),o[u]=l}i.nextPos(r,!0),e.sourceLines.nextPos(t,!0)}}),s.cachedSourceMap=a,a.toJSON()},b.bootstrapCharAt=function(e){c.strictEqual(typeof e,"object"),c.strictEqual(typeof e.line,"number"),c.strictEqual(typeof e.column,"number");var t=e.line,r=e.column,n=this.toString().split(D),i=n[t-1];return void 0===i?"":r===i.length&&t=i.length?"":i.charAt(r)},b.charAt=function(e){c.strictEqual(typeof e,"object"),c.strictEqual(typeof e.line,"number"),c.strictEqual(typeof e.column,"number");var t=e.line,r=e.column,i=n(this),s=i.infos,a=s[t-1],o=r;if(void 0===a||o<0)return"";var u=this.getIndentAt(t);return o=a.sliceEnd?"":a.line.charAt(o))},b.stripMargin=function(e,t){if(0===e)return this;if(c.ok(e>0,"negative margin: "+e),t&&1===this.length)return this;var r=n(this),a=new i(r.infos.map(function(r,n){return r.line&&(n>0||!t)&&(r=s(r),r.indent=Math.max(0,r.indent-e)),r}));if(r.mappings.length>0){var o=n(a).mappings;c.strictEqual(o.length,0),r.mappings.forEach(function(r){o.push(r.indent(e,t,!0))})}return a},b.indent=function(e){if(0===e)return this;var t=n(this),r=new i(t.infos.map(function(t){return t.line&&!t.locked&&(t=s(t),t.indent+=e),t}));if(t.mappings.length>0){var a=n(r).mappings;c.strictEqual(a.length,0),t.mappings.forEach(function(t){a.push(t.indent(e))})}return r},b.indentTail=function(e){if(0===e)return this;if(this.length<2)return this;var t=n(this),r=new i(t.infos.map(function(t,r){return r>0&&t.line&&!t.locked&&(t=s(t),t.indent+=e),t}));if(t.mappings.length>0){var a=n(r).mappings;c.strictEqual(a.length,0),t.mappings.forEach(function(t){a.push(t.indent(e,!0))})}return r},b.lockIndentTail=function(){return this.length<2?this:new i(n(this).infos.map(function(e,t){return e=s(e),e.locked=t>0,e}))},b.getIndentAt=function(e){c.ok(e>=1,"no line "+e+" (line numbers start from 1)");var t=n(this),r=t.infos[e-1];return Math.max(r.indent,0)},b.guessTabWidth=function(){var e=n(this);if(x.call(e,"cachedTabWidth"))return e.cachedTabWidth;for(var t=[],r=0,i=1,s=this.length;i<=s;++i){var a=e.infos[i-1];if(!u(a.line.slice(a.sliceStart,a.sliceEnd))){var o=Math.abs(a.indent-r);t[o]=1+~~t[o],r=a.indent}}for(var l=-1,c=2,p=1;pl&&(l=t[p],c=p);return e.cachedTabWidth=c},b.startsWithComment=function(){var e=n(this);if(0===e.infos.length)return!1;var t=e.infos[0],r=t.sliceStart,i=t.sliceEnd,s=t.line.slice(r,i).trim();return 0===s.length||"//"===s.slice(0,2)||"/*"===s.slice(0,2)},b.isOnlyWhitespace=function(){return u(this.toString())},b.isPrecededOnlyByWhitespace=function(e){var t=n(this),r=t.infos[e.line-1],i=Math.max(r.indent,0),s=e.column-i;if(s<=0)return!0;var a=r.sliceStart,o=Math.min(a+s,r.sliceEnd);return u(r.line.slice(a,o))},b.getLineLength=function(e){var t=n(this),r=t.infos[e-1];return this.getIndentAt(e)+r.sliceEnd-r.sliceStart},b.nextPos=function(e,t){var r=Math.max(e.line,0);return Math.max(e.column,0)0){var o=n(a).mappings;c.strictEqual(o.length,0),r.mappings.forEach(function(r){var n=r.slice(this,e,t);n&&o.push(n)},this)}return a},b.bootstrapSliceString=function(e,t,r){return this.slice(e,t).toString(r)},b.sliceString=function(e,t,r){if(!t){if(!e)return this;t=this.lastPos()}r=h(r);for(var i=n(this).infos,s=[],o=r.tabWidth,c=e.line;c<=t.line;++c){var p=i[c-1];c===e.line?p=c===t.line?l(p,e.column,t.column):l(p,e.column):c===t.line&&(p=l(p,0,t.column));var f=Math.max(p.indent,0),d=p.line.slice(0,p.sliceStart);if(r.reuseWhitespace&&u(d)&&a(d,r.tabWidth)===f)s.push(p.line.slice(0,p.sliceEnd));else{var m=0,y=f;r.useTabs&&(m=Math.floor(f/o),y-=m*o);var g="";m>0&&(g+=new Array(m+1).join("\t")),y>0&&(g+=new Array(y+1).join(" ")),g+=p.line.slice(p.sliceStart,p.sliceEnd),s.push(g)}}return s.join(r.lineTerminator)},b.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1},b.join=function(e){function t(e){if(null!==e){if(a){var t=e.infos[0],r=new Array(t.indent+1).join(" "),n=c.length,i=Math.max(a.indent,0)+a.sliceEnd-a.sliceStart;a.line=a.line.slice(0,a.sliceEnd)+r+t.line.slice(t.sliceStart,t.sliceEnd),a.locked=a.locked||t.locked,a.sliceEnd=a.line.length,e.mappings.length>0&&e.mappings.forEach(function(e){p.push(e.add(n,i))})}else e.mappings.length>0&&p.push.apply(p,e.mappings);e.infos.forEach(function(e,t){(!a||t>0)&&(a=s(e),c.push(a))})}}function r(e,r){r>0&&t(l),t(e)}var a,u=this,l=n(u),c=[],p=[];if(e.map(function(e){var t=o(e);return t.isEmpty()?null:n(t)}).forEach(u.isEmpty()?t:r),c.length<1)return C;var h=new i(c);return n(h).mappings=p,h},r.concat=function(e){return C.join(e)},b.concat=function(e){var t=arguments,r=[this];return r.push.apply(r,t),c.strictEqual(r.length,t.length+1),C.join(r)};var C=o("")},{"./mapping":554,"./options":555,"./types":559,"./util":560,assert:3,private:537,"source-map":573}],554:[function(e,t,r){function n(e,t,r){o.ok(this instanceof n),o.ok(e instanceof h.Lines),c.assert(t),r?o.ok(l.check(r.start.line)&&l.check(r.start.column)&&l.check(r.end.line)&&l.check(r.end.column)):r=t,Object.defineProperties(this,{sourceLines:{value:e},sourceLoc:{value:t},targetLoc:{value:r}})}function i(e,t,r){return{line:e.line+t-1,column:1===e.line?e.column+r:e.column}}function s(e,t,r){return{line:e.line-t+1,column:e.line===t?e.column-r:e.column}}function a(e,t,r,n,i){o.ok(e instanceof h.Lines),o.ok(r instanceof h.Lines),p.assert(t),p.assert(n),p.assert(i);var s=f(n,i);if(0===s)return t;if(s<0){var a=e.skipSpaces(t),u=r.skipSpaces(n),l=i.line-u.line;for(a.line+=l,u.line+=l,l>0?(a.column=0,u.column=0):o.strictEqual(l,0);f(u,i)<0&&r.nextPos(u,!0);)o.ok(e.nextPos(a,!0)),o.strictEqual(e.charAt(a),r.charAt(u))}else{var a=e.skipSpaces(t,!0),u=r.skipSpaces(n,!0),l=i.line-u.line;for(a.line+=l,u.line+=l,l<0?(a.column=e.getLineLength(a.line),u.column=r.getLineLength(u.line)):o.strictEqual(l,0);f(i,u)<0&&r.prevPos(u,!0);)o.ok(e.prevPos(a,!0)),o.strictEqual(e.charAt(a),r.charAt(u))}return a}var o=e("assert"),u=e("./types"),l=(u.builtInTypes.string,u.builtInTypes.number),c=u.namedTypes.SourceLocation,p=u.namedTypes.Position,h=e("./lines"),f=e("./util").comparePos,d=n.prototype;t.exports=n,d.slice=function(e,t,r){function i(n){var i=l[n],s=c[n],p=t;return"end"===n?p=r:o.strictEqual(n,"start"),a(u,i,e,s,p)}o.ok(e instanceof h.Lines),p.assert(t),r?p.assert(r):r=e.lastPos();var u=this.sourceLines,l=this.sourceLoc,c=this.targetLoc;if(f(t,c.start)<=0)if(f(c.end,r)<=0)c={start:s(c.start,t.line,t.column),end:s(c.end,t.line,t.column)};else{if(f(r,c.start)<=0)return null;l={start:l.start,end:i("end")},c={start:s(c.start,t.line,t.column),end:s(r,t.line,t.column)}}else{if(f(c.end,t)<=0)return null;f(c.end,r)<=0?(l={start:i("start"),end:l.end},c={start:{line:1,column:0},end:s(c.end,t.line,t.column)}):(l={start:i("start"),end:i("end")},c={start:{line:1,column:0},end:s(r,t.line,t.column)})}return new n(this.sourceLines,l,c)},d.add=function(e,t){return new n(this.sourceLines,this.sourceLoc,{start:i(this.targetLoc.start,e,t),end:i(this.targetLoc.end,e,t)})},d.subtract=function(e,t){return new n(this.sourceLines,this.sourceLoc,{start:s(this.targetLoc.start,e,t),end:s(this.targetLoc.end,e,t)})},d.indent=function(e,t,r){if(0===e)return this;var i=this.targetLoc,s=i.start.line,a=i.end.line;if(t&&1===s&&1===a)return this;if(i={start:i.start,end:i.end},!t||s>1){var o=i.start.column+e;i.start={line:s,column:r?Math.max(0,o):o}}if(!t||a>1){var u=i.end.column+e;i.end={line:a,column:r?Math.max(0,u):u}}return new n(this.sourceLines,this.sourceLoc,i)}},{"./lines":553,"./types":559,"./util":560,assert:3}],555:[function(e,t,r){var n={parser:e("esprima"),tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:e("os").EOL,wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0},i=n.hasOwnProperty;r.normalize=function(e){function t(t){return i.call(e,t)?e[t]:n[t]}return e=e||n,{tabWidth:+t("tabWidth"),useTabs:!!t("useTabs"),reuseWhitespace:!!t("reuseWhitespace"),lineTerminator:t("lineTerminator"),wrapColumn:Math.max(t("wrapColumn"),0),sourceFileName:t("sourceFileName"),sourceMapName:t("sourceMapName"),sourceRoot:t("sourceRoot"),inputSourceMap:t("inputSourceMap"),parser:t("esprima")||t("parser"),range:t("range"),tolerant:t("tolerant"),quote:t("quote"),trailingComma:t("trailingComma"),arrayBracketSpacing:t("arrayBracketSpacing"),objectCurlySpacing:t("objectCurlySpacing"),arrowParensAlways:t("arrowParensAlways"),flowObjectCommas:t("flowObjectCommas")}}},{esprima:562,os:534}],556:[function(e,t,r){function n(e){i.ok(this instanceof n),this.lines=e,this.indent=0}var i=e("assert"),s=e("./types"),a=(s.namedTypes,s.builders),o=s.builtInTypes.object,u=s.builtInTypes.array,l=(s.builtInTypes.function,e("./patcher").Patcher,e("./options").normalize),c=e("./lines").fromString,p=e("./comments").attach,h=e("./util");r.parse=function(e,t){t=l(t);var r=c(e,t),i=r.toString({tabWidth:t.tabWidth,reuseWhitespace:!1,useTabs:!1}),s=[],o=t.parser.parse(i,{jsx:!0,loc:!0,locations:!0,range:t.range,comment:!0,onComment:s,tolerant:t.tolerant,ecmaVersion:6,sourceType:"module"});h.fixFaultyLocations(o,r),o.loc=o.loc||{start:r.firstPos(),end:r.lastPos()},o.loc.lines=r,o.loc.indent=0;var u=h.getTrueLoc(o,r);o.loc.start=u.start,o.loc.end=u.end,o.comments&&(s=o.comments,delete o.comments);var f=o;if("Program"===f.type){var f=a.file(o,t.sourceFileName||null);f.loc={lines:r,indent:0,start:r.firstPos(),end:r.lastPos()}}else"File"===f.type&&(o=f.program);return p(s,o.body.length?f.program:f,r),new n(r).copy(f)},n.prototype.copy=function(e){if(u.check(e))return e.map(this.copy,this);if(!o.check(e))return e;h.fixFaultyLocations(e,this.lines);var t=Object.create(Object.getPrototypeOf(e),{original:{value:e,configurable:!1,enumerable:!1,writable:!0}}),r=e.loc,n=this.indent,i=n;r&&(("Block"===e.type||"Line"===e.type||"CommentBlock"===e.type||"CommentLine"===e.type||this.lines.isPrecededOnlyByWhitespace(r.start))&&(i=this.indent=r.start.column),r.lines=this.lines,r.indent=i);for(var s=Object.keys(e),a=s.length,l=0;l0||(n(i,e.start),s.push(e.lines),i=e.end)}),n(i,t.end),y.concat(s)}}function i(e){var t=[];return e.comments&&e.comments.length>0&&e.comments.forEach(function(e){(e.leading||e.trailing)&&t.push(e)}),t}function s(e,t,r){var n=A.copyPos(t.start),i=e.prevPos(n)&&e.charAt(n),s=r.charAt(r.firstPos());return i&&k.test(i)&&s&&k.test(s)}function a(e,t,r){var n=e.charAt(t.end),i=r.lastPos(),s=r.prevPos(i)&&r.charAt(i);return s&&k.test(s)&&n&&k.test(n)}function o(e,t){var r=e.getValue();b.assert(r);var n=r.original;if(b.assert(n),m.deepEqual(t,[]),r.type!==n.type)return!1;var i=new C(n),s=d(e,i,t);return s||(t.length=0),s}function u(e,t,r){var n=e.getValue();return n===t.getValue()||(_.check(n)?l(e,t,r):!!S.check(n)&&c(e,t,r))}function l(e,t,r){var n=e.getValue(),i=t.getValue();_.assert(n);var s=n.length;if(!_.check(i)||i.length!==s)return!1;for(var a=0;aa)}var m=e("assert"),y=e("./lines"),g=e("./types"),b=(g.getFieldValue,g.namedTypes.Printable),v=g.namedTypes.Expression,x=g.namedTypes.ReturnStatement,E=g.namedTypes.SourceLocation,A=e("./util"),D=A.comparePos,C=e("./fast-path"),S=g.builtInTypes.object,_=g.builtInTypes.array,w=g.builtInTypes.string,k=/[0-9a-z_$]/i;r.Patcher=n;var F=n.prototype;F.tryToReprintComments=function(e,t,r){var n=this;if(!e.comments&&!t.comments)return!0;var s=C.from(e),a=C.from(t);s.stack.push("comments",i(e)),a.stack.push("comments",i(t));var o=[],u=l(s,a,o);return u&&o.length>0&&o.forEach(function(e){var t=e.oldPath.getValue();m.ok(t.leading||t.trailing),n.replace(t.loc,r(e.newPath).indentTail(t.loc.indent))}),u},F.deleteComments=function(e){if(e.comments){var t=this;e.comments.forEach(function(r){r.leading?t.replace({start:r.loc.start,end:e.loc.lines.skipSpaces(r.loc.end,!1,!1)},""):r.trailing&&t.replace({start:e.loc.lines.skipSpaces(r.loc.start,!0,!1),end:r.loc.end},"")})}},r.getReprinter=function(e){m.ok(e instanceof C);var t=e.getValue();if(b.check(t)){var r=t.original,i=r&&r.loc,u=i&&i.lines,l=[];if(u&&o(e,l))return function(e){var t=new n(u);return l.forEach(function(r){var n=r.newPath.getValue(),i=r.oldPath.getValue();E.assert(i.loc,!0);var o=!t.tryToReprintComments(n,i,e);o&&t.deleteComments(i);var l=e(r.newPath,o).indentTail(i.loc.indent),c=s(u,i.loc,l),p=a(u,i.loc,l);if(c||p){var h=[];c&&h.push(" "),h.push(l),p&&h.push(" "),l=y.concat(h)}t.replace(i.loc,l)}),t.get(i).indentTail(-r.loc.indent)}}};var T={line:1,column:0},P=/\S/},{"./fast-path":552,"./lines":553,"./types":559,"./util":560,assert:3}],558:[function(e,t,r){function n(e,t){D.ok(this instanceof n),B.assert(e),this.code=e,t&&(O.assert(t),this.map=t)}function i(e){function t(e){return D.ok(e instanceof j),C(e,r)}function r(e,r){if(r)return t(e);if(D.ok(e instanceof j),!c){var n=p.tabWidth,i=e.getNode().loc;if(i&&i.lines&&i.lines.guessTabWidth){p.tabWidth=i.lines.guessTabWidth();var s=o(e);return p.tabWidth=n,s}}return o(e)}function o(e){var t=F(e);return t?s(e,t(r)):u(e)}function u(e,r){return r?C(e,u):a(e,p,t)}function l(e){return a(e,p,l)}D.ok(this instanceof i);var c=e&&e.tabWidth,p=k(e);D.notStrictEqual(p,e),p.sourceFileName=null,this.print=function(e){if(!e)return M;var t=r(j.from(e),!0);return new n(t.toString(p),N.composeSourceMaps(p.inputSourceMap,t.getSourceMap(p.sourceMapName,p.sourceRoot)))},this.printGenerically=function(e){if(!e)return M;var t=j.from(e),r=p.reuseWhitespace;p.reuseWhitespace=!1;var i=new n(l(t).toString(p));return p.reuseWhitespace=r,i}}function s(e,t){return e.needsParens()?w(["(",t,")"]):t}function a(e,t,r){D.ok(e instanceof j);var n=e.getValue(),i=[],s=!1,a=o(e,t,r);return!n||a.isEmpty()?a:(n.decorators&&n.decorators.length>0&&!N.getParentExportDeclaration(e)?e.each(function(e){i.push(r(e),"\n")},"decorators"):N.isExportDeclaration(n)&&n.declaration&&n.declaration.decorators?e.each(function(e){i.push(r(e),"\n")},"declaration","decorators"):s=e.needsParens(),s&&i.unshift("("),i.push(a),s&&i.push(")"),w(i))}function o(e,t,r){var n=e.getValue();if(!n)return _("");if("string"==typeof n)return _(n,t);P.Printable.assert(n);var i=[];switch(n.type){case"File":return e.call(r,"program");case"Program":return n.directives&&e.each(function(e){i.push(r(e),";\n")},"directives"),i.push(e.call(function(e){return u(e,t,r)},"body")),w(i);case"Noop":case"EmptyStatement":return _("");case"ExpressionStatement":return w([e.call(r,"expression"),";"]);case"ParenthesizedExpression":return w(["(",e.call(r,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return _(" ").join([e.call(r,"left"),n.operator,e.call(r,"right")]);case"AssignmentPattern":return w([e.call(r,"left")," = ",e.call(r,"right")]);case"MemberExpression":i.push(e.call(r,"object"));var s=e.call(r,"property");return n.computed?i.push("[",s,"]"):i.push(".",s),w(i);case"MetaProperty":return w([e.call(r,"meta"),".",e.call(r,"property")]);case"BindExpression":return n.object&&i.push(e.call(r,"object")),i.push("::",e.call(r,"callee")),w(i);case"Path":return _(".").join(n.body);case"Identifier":return w([_(n.name,t),e.call(r,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"RestElement":return w(["...",e.call(r,"argument")]);case"FunctionDeclaration":case"FunctionExpression":return n.async&&i.push("async "),i.push("function"),n.generator&&i.push("*"),n.id&&i.push(" ",e.call(r,"id"),e.call(r,"typeParameters")),i.push("(",f(e,t,r),")",e.call(r,"returnType")," ",e.call(r,"body")),w(i);case"ArrowFunctionExpression":return n.async&&i.push("async "),n.typeParameters&&i.push(e.call(r,"typeParameters")),t.arrowParensAlways||1!==n.params.length||n.rest||"Identifier"!==n.params[0].type||n.params[0].typeAnnotation||n.returnType?i.push("(",f(e,t,r),")",e.call(r,"returnType")):i.push(e.call(r,"params",0)),i.push(" => ",e.call(r,"body")),w(i);case"MethodDefinition": +return n.static&&i.push("static "),i.push(c(e,t,r)),w(i);case"YieldExpression":return i.push("yield"),n.delegate&&i.push("*"),n.argument&&i.push(" ",e.call(r,"argument")),w(i);case"AwaitExpression":return i.push("await"),n.all&&i.push("*"),n.argument&&i.push(" ",e.call(r,"argument")),w(i);case"ModuleDeclaration":return i.push("module",e.call(r,"id")),n.source?(D.ok(!n.body),i.push("from",e.call(r,"source"))):i.push(e.call(r,"body")),_(" ").join(i);case"ImportSpecifier":return n.imported?(i.push(e.call(r,"imported")),n.local&&n.local.name!==n.imported.name&&i.push(" as ",e.call(r,"local"))):n.id&&(i.push(e.call(r,"id")),n.name&&i.push(" as ",e.call(r,"name"))),w(i);case"ExportSpecifier":return n.local?(i.push(e.call(r,"local")),n.exported&&n.exported.name!==n.local.name&&i.push(" as ",e.call(r,"exported"))):n.id&&(i.push(e.call(r,"id")),n.name&&i.push(" as ",e.call(r,"name"))),w(i);case"ExportBatchSpecifier":return _("*");case"ImportNamespaceSpecifier":return i.push("* as "),n.local?i.push(e.call(r,"local")):n.id&&i.push(e.call(r,"id")),w(i);case"ImportDefaultSpecifier":return n.local?e.call(r,"local"):e.call(r,"id");case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return m(e,t,r);case"ExportAllDeclaration":return i.push("export *"),n.exported&&i.push(" as ",e.call(r,"exported")),i.push(" from ",e.call(r,"source")),w(i);case"ExportNamespaceSpecifier":return w(["* as ",e.call(r,"exported")]);case"ExportDefaultSpecifier":return e.call(r,"exported");case"Import":return _("import",t);case"ImportDeclaration":if(i.push("import "),n.importKind&&"value"!==n.importKind&&i.push(n.importKind+" "),n.specifiers&&n.specifiers.length>0){var a=!1;e.each(function(e){e.getName()>0&&i.push(", ");var n=e.getValue();P.ImportDefaultSpecifier.check(n)||P.ImportNamespaceSpecifier.check(n)?D.strictEqual(a,!1):(P.ImportSpecifier.assert(n),a||(a=!0,i.push(t.objectCurlySpacing?"{ ":"{"))),i.push(r(e))},"specifiers"),a&&i.push(t.objectCurlySpacing?" }":"}"),i.push(" from ")}return i.push(e.call(r,"source"),";"),w(i);case"BlockStatement":var o=e.call(function(e){return u(e,t,r)},"body");return!o.isEmpty()||n.directives&&0!==n.directives.length?(i.push("{\n"),n.directives&&e.each(function(e){i.push(r(e).indent(t.tabWidth),";",n.directives.length>1||!o.isEmpty()?"\n":"")},"directives"),i.push(o.indent(t.tabWidth)),i.push("\n}"),w(i)):_("{}");case"ReturnStatement":if(i.push("return"),n.argument){var l=e.call(r,"argument");l.startsWithComment()||l.length>1&&P.JSXElement&&P.JSXElement.check(n.argument)?i.push(" (\n",l.indent(t.tabWidth),"\n)"):i.push(" ",l)}return i.push(";"),w(i);case"CallExpression":return w([e.call(r,"callee"),h(e,t,r)]);case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":var b=!1,x="ObjectTypeAnnotation"===n.type,A=t.flowObjectCommas?",":x?";":",",C=[];x&&C.push("indexers","callProperties"),C.push("properties");var S=0;C.forEach(function(e){S+=n[e].length});var k=x&&1===S||0===S,F=n.exact?"{|":"{",T=n.exact?"|}":"}";i.push(k?F:F+"\n");var B=i.length-1,O=0;return C.forEach(function(n){e.each(function(e){var n=r(e);k||(n=n.indent(t.tabWidth));var s=!x&&n.length>1;s&&b&&i.push("\n"),i.push(n),O0&&i.push(" "):n=n.indent(t.tabWidth),i.push(n),(r1?i.push(_(",\n").join(L).indentTail(n.kind.length+1)):i.push(L[0]);var U=e.getParentNode();return P.ForStatement.check(U)||P.ForInStatement.check(U)||P.ForOfStatement&&P.ForOfStatement.check(U)||P.ForAwaitStatement&&P.ForAwaitStatement.check(U)||i.push(";"),w(i);case"VariableDeclarator":return n.init?_(" = ").join([e.call(r,"id"),e.call(r,"init")]):e.call(r,"id");case"WithStatement":return w(["with (",e.call(r,"object"),") ",e.call(r,"body")]);case"IfStatement":var V=g(e.call(r,"consequent"),t),i=["if (",e.call(r,"test"),")",V];return n.alternate&&i.push(v(V)?" else":"\nelse",g(e.call(r,"alternate"),t)),w(i);case"ForStatement":var q=e.call(r,"init"),G=q.length>1?";\n":"; ",X=_(G).join([q,e.call(r,"test"),e.call(r,"update")]).indentTail("for (".length),J=w(["for (",X,")"]),W=g(e.call(r,"body"),t),i=[J];return J.length>1&&(i.push("\n"),W=W.trimLeft()),i.push(W),w(i);case"WhileStatement":return w(["while (",e.call(r,"test"),")",g(e.call(r,"body"),t)]);case"ForInStatement":return w([n.each?"for each (":"for (",e.call(r,"left")," in ",e.call(r,"right"),")",g(e.call(r,"body"),t)]);case"ForOfStatement":return w(["for (",e.call(r,"left")," of ",e.call(r,"right"),")",g(e.call(r,"body"),t)]);case"ForAwaitStatement":return w(["for await (",e.call(r,"left")," of ",e.call(r,"right"),")",g(e.call(r,"body"),t)]);case"DoWhileStatement":var K=w(["do",g(e.call(r,"body"),t)]),i=[K];return v(K)?i.push(" while"):i.push("\nwhile"),i.push(" (",e.call(r,"test"),");"),w(i);case"DoExpression":var z=e.call(function(e){return u(e,t,r)},"body");return w(["do {\n",z.indent(t.tabWidth),"\n}"]);case"BreakStatement":return i.push("break"),n.label&&i.push(" ",e.call(r,"label")),i.push(";"),w(i);case"ContinueStatement":return i.push("continue"),n.label&&i.push(" ",e.call(r,"label")),i.push(";"),w(i);case"LabeledStatement":return w([e.call(r,"label"),":\n",e.call(r,"body")]);case"TryStatement":return i.push("try ",e.call(r,"block")),n.handler?i.push(" ",e.call(r,"handler")):n.handlers&&e.each(function(e){i.push(" ",r(e))},"handlers"),n.finalizer&&i.push(" finally ",e.call(r,"finalizer")),w(i);case"CatchClause":return i.push("catch (",e.call(r,"param")),n.guard&&i.push(" if ",e.call(r,"guard")),i.push(") ",e.call(r,"body")),w(i);case"ThrowStatement":return w(["throw ",e.call(r,"argument"),";"]);case"SwitchStatement":return w(["switch (",e.call(r,"discriminant"),") {\n",_("\n").join(e.map(r,"cases")),"\n}"]);case"SwitchCase":return n.test?i.push("case ",e.call(r,"test"),":"):i.push("default:"),n.consequent.length>0&&i.push("\n",e.call(function(e){return u(e,t,r)},"consequent").indent(t.tabWidth)),w(i);case"DebuggerStatement":return _("debugger;");case"JSXAttribute":return i.push(e.call(r,"name")),n.value&&i.push("=",e.call(r,"value")),w(i);case"JSXIdentifier":return _(n.name,t);case"JSXNamespacedName":return _(":").join([e.call(r,"namespace"),e.call(r,"name")]);case"JSXMemberExpression":return _(".").join([e.call(r,"object"),e.call(r,"property")]);case"JSXSpreadAttribute":return w(["{...",e.call(r,"argument"),"}"]);case"JSXExpressionContainer":return w(["{",e.call(r,"expression"),"}"]);case"JSXElement":var Y=e.call(r,"openingElement");if(n.openingElement.selfClosing)return D.ok(!n.closingElement),Y;var H=w(e.map(function(e){var t=e.getValue();if(P.Literal.check(t)&&"string"==typeof t.value){if(/\S/.test(t.value))return t.value.replace(/^\s+|\s+$/g,"");if(/\n/.test(t.value))return"\n"}return r(e)},"children")).indentTail(t.tabWidth),$=e.call(r,"closingElement");return w([Y,H,$]);case"JSXOpeningElement":i.push("<",e.call(r,"name"));var Q=[];e.each(function(e){Q.push(" ",r(e))},"attributes");var Z=w(Q);return(Z.length>1||Z.getLineLength(1)>t.wrapColumn)&&(Q.forEach(function(e,t){" "===e&&(D.strictEqual(t%2,0),Q[t]="\n")}),Z=w(Q).indentTail(t.tabWidth)),i.push(Z,n.selfClosing?" />":">"),w(i);case"JSXClosingElement":return w([""]);case"JSXText":return _(n.value,t);case"JSXEmptyExpression":return _("");case"TypeAnnotatedIdentifier":return w([e.call(r,"annotation")," ",e.call(r,"identifier")]);case"ClassBody":return 0===n.body.length?_("{}"):w(["{\n",e.call(function(e){return u(e,t,r)},"body").indent(t.tabWidth),"\n}"]);case"ClassPropertyDefinition":return i.push("static ",e.call(r,"definition")),P.MethodDefinition.check(n.definition)||i.push(";"),w(i);case"ClassProperty":n.static&&i.push("static ");var j=e.call(r,"key");return n.computed?j=w(["[",j,"]"]):"plus"===n.variance?j=w(["+",j]):"minus"===n.variance&&(j=w(["-",j])),i.push(j),n.typeAnnotation&&i.push(e.call(r,"typeAnnotation")),n.value&&i.push(" = ",e.call(r,"value")),i.push(";"),w(i);case"ClassDeclaration":case"ClassExpression":return i.push("class"),n.id&&i.push(" ",e.call(r,"id"),e.call(r,"typeParameters")),n.superClass&&i.push(" extends ",e.call(r,"superClass"),e.call(r,"superTypeParameters")),n.implements&&n.implements.length>0&&i.push(" implements ",_(", ").join(e.map(r,"implements"))),i.push(" ",e.call(r,"body")),w(i);case"TemplateElement":return _(n.value.raw,t).lockIndentTail();case"TemplateLiteral":var ee=e.map(r,"expressions");return i.push("`"),e.each(function(e){var t=e.getName();i.push(r(e)),t ":": ",e.call(r,"returnType")),w(i);case"FunctionTypeParam":return w([e.call(r,"name"),n.optional?"?":"",": ",e.call(r,"typeAnnotation")]);case"GenericTypeAnnotation":return w([e.call(r,"id"),e.call(r,"typeParameters")]);case"DeclareInterface":i.push("declare ");case"InterfaceDeclaration":return i.push(_("interface ",t),e.call(r,"id"),e.call(r,"typeParameters")," "),n.extends&&i.push("extends ",_(", ").join(e.map(r,"extends"))),i.push(" ",e.call(r,"body")),w(i);case"ClassImplements":case"InterfaceExtends":return w([e.call(r,"id"),e.call(r,"typeParameters")]);case"IntersectionTypeAnnotation":return _(" & ").join(e.map(r,"types"));case"NullableTypeAnnotation":return w(["?",e.call(r,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return _("null",t);case"ThisTypeAnnotation":return _("this",t);case"NumberTypeAnnotation":return _("number",t);case"ObjectTypeCallProperty":return e.call(r,"value");case"ObjectTypeIndexer":var ne="plus"===n.variance?"+":"minus"===n.variance?"-":"";return w([ne,"[",e.call(r,"id"),": ",e.call(r,"key"),"]: ",e.call(r,"value")]);case"ObjectTypeProperty":var ne="plus"===n.variance?"+":"minus"===n.variance?"-":"";return w([ne,e.call(r,"key"),n.optional?"?":"",": ",e.call(r,"value")]);case"QualifiedTypeIdentifier":return w([e.call(r,"qualification"),".",e.call(r,"id")]);case"StringLiteralTypeAnnotation":return _(E(n.value,t),t);case"NumberLiteralTypeAnnotation":case"NumericLiteralTypeAnnotation":return D.strictEqual(typeof n.value,"number"),_(JSON.stringify(n.value),t);case"StringTypeAnnotation":return _("string",t);case"DeclareTypeAlias":i.push("declare ");case"TypeAlias":return w(["type ",e.call(r,"id"),e.call(r,"typeParameters")," = ",e.call(r,"right"),";"]);case"TypeCastExpression":return w(["(",e.call(r,"expression"),e.call(r,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return w(["<",_(", ").join(e.map(r,"params")),">"]);case"TypeParameter":switch(n.variance){case"plus":i.push("+");break;case"minus":i.push("-")}return i.push(e.call(r,"name")),n.bound&&i.push(e.call(r,"bound")),n.default&&i.push("=",e.call(r,"default")),w(i);case"TypeofTypeAnnotation":return w([_("typeof ",t),e.call(r,"argument")]);case"UnionTypeAnnotation":return _(" | ").join(e.map(r,"types"));case"VoidTypeAnnotation":return _("void",t);case"NullTypeAnnotation":return _("null",t);case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:throw new Error("unknown type: "+JSON.stringify(n.type))}return p}function u(e,t,r){var n=(P.ClassBody&&P.ClassBody.check(e.getParentNode()),[]),i=!1,s=!1;e.each(function(e){var t=(e.getName(),e.getValue());t&&"EmptyStatement"!==t.type&&(P.Comment.check(t)?i=!0:P.Statement.check(t)?s=!0:B.assert(t),n.push({node:t,printed:r(e)}))}),i&&D.strictEqual(s,!1,"Comments may appear as statements in otherwise empty statement lists, but may not coexist with non-Comment nodes.");var a=null,o=n.length,u=[];return n.forEach(function(e,r){var n,i,s=e.printed,c=e.node,p=s.length>1,h=r>0,f=rr.length?n:r}function c(e,t,r){var n=e.getNode(),i=n.kind,s=[];"ObjectMethod"===n.type||"ClassMethod"===n.type?n.value=n:P.FunctionExpression.assert(n.value),n.value.async&&s.push("async "),i&&"init"!==i&&"method"!==i&&"constructor"!==i?(D.ok("get"===i||"set"===i),s.push(i," ")):n.value.generator&&s.push("*");var a=e.call(r,"key");return n.computed&&(a=w(["[",a,"]"])),s.push(a,e.call(r,"value","typeParameters"),"(",e.call(function(e){return f(e,t,r)},"value"),")",e.call(r,"value","returnType")," ",e.call(r,"value","body")),w(s)}function h(e,t,r){var n=e.map(r,"arguments"),i=N.isTrailingCommaEnabled(t,"parameters"),s=_(", ").join(n);return s.getLineLength(1)>t.wrapColumn?(s=_(",\n").join(n),w(["(\n",s.indent(t.tabWidth),i?",\n)":"\n)"])):w(["(",s,")"])}function f(e,t,r){var n=e.getValue();P.Function.assert(n);var i=e.map(r,"params");n.defaults&&e.each(function(e){var t=e.getName(),n=i[t];n&&e.getValue()&&(i[t]=w([n," = ",r(e)]))},"defaults"),n.rest&&i.push(w(["...",e.call(r,"rest")]));var s=_(", ").join(i);return s.length>1||s.getLineLength(1)>t.wrapColumn?(s=_(",\n").join(i),s=w(N.isTrailingCommaEnabled(t,"parameters")&&!n.rest&&"RestElement"!==n.params[n.params.length-1].type?[s,",\n"]:[s,"\n"]),w(["\n",s.indent(t.tabWidth)])):s}function d(e,t,r){var n=e.getValue(),i=[];if(n.async&&i.push("async "),n.generator&&i.push("*"),n.method||"get"===n.kind||"set"===n.kind)return c(e,t,r);var s=e.call(r,"key");return n.computed?i.push("[",s,"]"):i.push(s),i.push("(",f(e,t,r),")",e.call(r,"returnType")," ",e.call(r,"body")),w(i)}function m(e,t,r){var n=e.getValue(),i=["export "],s=t.objectCurlySpacing;P.Declaration.assert(n),(n.default||"ExportDefaultDeclaration"===n.type)&&i.push("default "),n.declaration?i.push(e.call(r,"declaration")):n.specifiers&&n.specifiers.length>0&&(1===n.specifiers.length&&"ExportBatchSpecifier"===n.specifiers[0].type?i.push("*"):i.push(s?"{ ":"{",_(", ").join(e.map(r,"specifiers")),s?" }":"}"),n.source&&i.push(" from ",e.call(r,"source")));var a=w(i);return";"===b(a)||n.declaration&&("FunctionDeclaration"===n.declaration.type||"ClassDeclaration"===n.declaration.type)||(a=w([a,";"])),a}function y(e,t){var r=N.getParentExportDeclaration(e);return r?D.strictEqual(r.type,"DeclareExportDeclaration"):t.unshift("declare "),w(t)}function g(e,t){return w(e.length>1?[" ",e]:["\n",A(e).indent(t.tabWidth)])}function b(e){var t=e.lastPos();do{var r=e.charAt(t);if(/\S/.test(r))return r}while(e.prevPos(t))}function v(e){return"}"===b(e)}function x(e){return e.replace(/['"]/g,function(e){return'"'===e?"'":'"'})}function E(e,t){switch(B.assert(e),t.quote){case"auto":var r=JSON.stringify(e),n=x(JSON.stringify(x(e)));return r.length>n.length?n:r;case"single":return x(JSON.stringify(x(e)));case"double":default:return JSON.stringify(e)}}function A(e){var t=b(e);return!t||"\n};".indexOf(t)<0?w([e,";"]):e}var D=e("assert"),C=(e("source-map"),e("./comments").printComments),S=e("./lines"),_=S.fromString,w=S.concat,k=e("./options").normalize,F=e("./patcher").getReprinter,T=e("./types"),P=T.namedTypes,B=T.builtInTypes.string,O=T.builtInTypes.object,j=e("./fast-path"),N=e("./util"),I=n.prototype,L=!1;I.toString=function(){return L||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),L=!0),this.code};var M=new n("");r.Printer=i},{"./comments":551,"./fast-path":552,"./lines":553,"./options":555,"./patcher":557,"./types":559,"./util":560,assert:3,"source-map":573}],559:[function(e,t,r){t.exports=e("ast-types")},{"ast-types":22}],560:[function(e,t,r){function n(){for(var e={},t=arguments.length,r=0;r=0;--i){var s=this.leading[i];t.end.offset>=s.start&&(r.unshift(s.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}r.length&&(e.innerComments=r)}},e.prototype.findTrailingComments=function(e,t){var r=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var i=this.trailing[n];i.start>=t.end.offset&&r.unshift(i.comment)}return this.trailing.length=0,r}var s=this.stack[this.stack.length-1];if(s&&s.node.trailingComments){var a=s.node.trailingComments[0];a&&a.range[0]>=t.end.offset&&(r=s.node.trailingComments,delete s.node.trailingComments)}return r},e.prototype.findLeadingComments=function(e,t){for(var r,n=[];this.stack.length>0;){var i=this.stack[this.stack.length-1];if(!(i&&i.start>=t.start.offset))break;r=this.stack.pop().node}if(r){for(var s=r.leadingComments?r.leadingComments.length:0,a=s-1;a>=0;--a){var o=r.leadingComments[a];o.range[1]<=t.start.offset&&(n.unshift(o),r.leadingComments.splice(a,1))}return r.leadingComments&&0===r.leadingComments.length&&delete r.leadingComments,n}for(var a=this.leading.length-1;a>=0;--a){var i=this.leading[a];i.start<=t.start.offset&&(n.unshift(i.comment),this.leading.splice(a,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===n.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var r=this.findTrailingComments(e,t),i=this.findLeadingComments(e,t);i.length>0&&(e.leadingComments=i),r.length>0&&(e.trailingComments=r),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var r="L"===e.type[0]?"Line":"Block",n={type:r,value:e.value};if(e.range&&(n.range=e.range),e.loc&&(n.loc=e.loc),this.comments.push(n),this.attach){var i={comment:{type:r,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=r,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type?this.visitComment(e,t):"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,r){"use strict";var n=r(4),i=r(5),s=r(6),a=r(7),o=r(8),u=r(2),l=r(10),c=function(){function e(e,t,r){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=r,this.errorHandler=new s.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new o.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.sourceType=t&&"module"===t.sourceType?"module":"script",this.lookahead=null,this.hasLineTerminator=!1,this.context={allowIn:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:"module"===this.sourceType},this.tokens=[],this.startMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.lastMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.nextToken(),this.lastMarker={index:this.scanner.index,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],r=1;r0&&this.delegate)for(var t=0;t>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,r=this.context.isAssignmentTarget,n=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=r,this.context.firstCoverInitializedNameError=n,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,r=this.context.isAssignmentTarget,n=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&r,this.context.firstCoverInitializedNameError=n||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type===a.Token.EOF||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.lineNumber=this.startMarker.lineNumber,this.lastMarker.lineStart=this.startMarker.lineStart)},e.prototype.parsePrimaryExpression=function(){var e,t,r,n=this.createNode();switch(this.lookahead.type){case a.Token.Identifier:"module"===this.sourceType&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.finalize(n,new l.Identifier(this.nextToken().value));break;case a.Token.NumericLiteral:case a.Token.StringLiteral:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,i.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new l.Literal(t.value,r));break;case a.Token.BooleanLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),t.value="true"===t.value,r=this.getTokenRaw(t),e=this.finalize(n,new l.Literal(t.value,r));break;case a.Token.NullLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),t.value=null,r=this.getTokenRaw(t),e=this.finalize(n,new l.Literal(t.value,r));break;case a.Token.Template:e=this.parseTemplateLiteral();break;case a.Token.Punctuator:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),r=this.getTokenRaw(t),e=this.finalize(n,new l.RegexLiteral(t.value,r,t.regex));break;default:this.throwUnexpectedToken(this.nextToken())}break;case a.Token.Keyword:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(n,new l.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(n,new l.ThisExpression)):this.matchKeyword("class")?e=this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new l.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var r=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(r)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new l.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var r=this.parseFormalParameters(),n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,r.params,n,!1))},e.prototype.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),r=null;switch(t.type){case a.Token.StringLiteral:case a.Token.NumericLiteral:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,i.Messages.StrictOctalLiteral);var n=this.getTokenRaw(t);r=this.finalize(e,new l.Literal(t.value,n));break;case a.Token.Identifier:case a.Token.BooleanLiteral:case a.Token.NullLiteral:case a.Token.Keyword:r=this.finalize(e,new l.Identifier(t.value));break;case a.Token.Punctuator:"["===t.value?(r=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):this.throwUnexpectedToken(t);break;default:this.throwUnexpectedToken(t)}return r},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,r,n,s=this.createNode(),o=this.lookahead,u=!1,c=!1,p=!1;o.type===a.Token.Identifier?(this.nextToken(),r=this.finalize(s,new l.Identifier(o.value))):this.match("*")?this.nextToken():(u=this.match("["),r=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(o.type===a.Token.Identifier&&"get"===o.value&&h)t="get",u=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,n=this.parseGetterMethod();else if(o.type===a.Token.Identifier&&"set"===o.value&&h)t="set",u=this.match("["),r=this.parseObjectPropertyKey(),n=this.parseSetterMethod();else if(o.type===a.Token.Punctuator&&"*"===o.value&&h)t="init",u=this.match("["),r=this.parseObjectPropertyKey(),n=this.parseGeneratorMethod(),c=!0;else if(r||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":"))!u&&this.isPropertyKey(r,"__proto__")&&(e.value&&this.tolerateError(i.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),n=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))n=this.parsePropertyMethodFunction(),c=!0;else if(o.type===a.Token.Identifier){var f=this.finalize(s,new l.Identifier(o.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),p=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);n=this.finalize(s,new l.AssignmentPattern(f,d))}else p=!0,n=f}else this.throwUnexpectedToken(this.nextToken());return this.finalize(s,new l.Property(t,r,u,n,c,p))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],r={value:!1};!this.match("}");)t.push(this.parseObjectProperty(r)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new l.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){n.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),r={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(r,t.tail))},e.prototype.parseTemplateElement=function(){this.lookahead.type!==a.Token.Template&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),r={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(r,t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],r=[],n=this.parseTemplateHead();for(r.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize(e,new l.TemplateLiteral(r,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[]};else{var t=this.lookahead,r=[];if(this.match("..."))e=this.parseRestElement(r),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[e]};else{var n=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);this.startMarker.index")||this.expect("=>"),this.context.isBindingElement=!1;for(var s=0;s")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(n=!0,e={type:"ArrowParameterPlaceHolder",params:[e]}),!n)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(var s=0;s0){this.nextToken(),r.prec=n,this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],s=t,a=this.isolateCoverGrammar(this.parseExponentiationExpression),o=[s,r,a];;){if((n=this.binaryPrecedence(this.lookahead))<=0)break;for(;o.length>2&&n<=o[o.length-2].prec;){a=o.pop();var u=o.pop().value;s=o.pop(),i.pop();var c=this.startNode(i[i.length-1]);o.push(this.finalize(c,new l.BinaryExpression(u,s,a)))}r=this.nextToken(),r.prec=n,o.push(r),i.push(this.lookahead),o.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=o.length-1;for(t=o[p],i.pop();p>1;){var c=this.startNode(i.pop());t=this.finalize(c,new l.BinaryExpression(o[p-1].value,o[p-2],t)),p-=2}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var r=this.context.allowIn;this.context.allowIn=!0;var n=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=r,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new l.ConditionalExpression(t,n,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var r=0;r")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=this.reinterpretAsCoverFormalsList(e);if(n){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var s=this.context.strict,a=this.context.allowYield;this.context.allowYield=!0;var o=this.startNode(t);this.expect("=>");var c=this.match("{")?this.parseFunctionSourceElements():this.isolateCoverGrammar(this.parseAssignmentExpression),p=c.type!==u.Syntax.BlockStatement;this.context.strict&&n.firstRestricted&&this.throwUnexpectedToken(n.firstRestricted,n.message),this.context.strict&&n.stricted&&this.tolerateUnexpectedToken(n.stricted,n.message),e=this.finalize(o,new l.ArrowFunctionExpression(n.params,c,p)),this.context.strict=s,this.context.allowYield=a}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var h=e;this.scanner.isRestrictedWord(h.name)&&this.tolerateUnexpectedToken(r,i.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(h.name)&&this.tolerateUnexpectedToken(r,i.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),r=this.nextToken();var f=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(r.value,e,f)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var r=[];for(r.push(t);this.startMarker.index",t.TokenName[r.Identifier]="Identifier",t.TokenName[r.Keyword]="Keyword",t.TokenName[r.NullLiteral]="Null",t.TokenName[r.NumericLiteral]="Numeric",t.TokenName[r.Punctuator]="Punctuator",t.TokenName[r.StringLiteral]="String",t.TokenName[r.RegularExpression]="RegularExpression",t.TokenName[r.Template]="Template" +},function(e,t,r){"use strict";function n(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function i(e){return"01234567".indexOf(e)}var s=r(4),a=r(5),o=r(9),u=r(7),l=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){void 0===e&&(e=a.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,a.Messages.UnexpectedTokenIllegal)},e.prototype.skipSingleLineComment=function(e){var t,r,n;for(this.trackComment&&(t=[],r=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,o.Character.isLineTerminator(i)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var s={multiLine:!1,slice:[r+e,this.index-1],range:[r,this.index-1],loc:n};t.push(s)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var s={multiLine:!1,slice:[r+e,this.index],range:[r,this.index],loc:n};t.push(s)}return t},e.prototype.skipMultiLineComment=function(){var e,t,r;for(this.trackComment&&(e=[],t=this.index-2,r={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var n=this.source.charCodeAt(this.index);if(o.Character.isLineTerminator(n))13===n&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===n){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){r.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:r};e.push(i)}return e}++this.index}else++this.index}if(this.trackComment){r.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:r};e.push(i)}return this.tolerateUnexpectedToken(),e},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var r=this.source.charCodeAt(this.index);if(o.Character.isWhiteSpace(r))++this.index;else if(o.Character.isLineTerminator(r))++this.index,13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===r)if(47===(r=this.source.charCodeAt(this.index+1))){this.index+=2;var n=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(n)),t=!0}else{if(42!==r)break;this.index+=2;var n=this.skipMultiLineComment();this.trackComment&&(e=e.concat(n))}else if(t&&45===r){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3;var n=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(n))}else{if(60!==r)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4;var n=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(n))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var r=this.source.charCodeAt(e+1);if(r>=56320&&r<=57343){t=1024*(t-55296)+r-56320+65536}}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,r=0,i=0;i1114111||"}"!==e)&&this.throwUnexpectedToken(),o.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!o.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=o.Character.fromCodePoint(e);this.index+=t.length;var r;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,r=this.scanUnicodeCodePointEscape()):(r=this.scanHexEscape("u"),e=r.charCodeAt(0),r&&"\\"!==r&&o.Character.isIdentifierStart(e)||this.throwUnexpectedToken()),t=r);!this.eof()&&(e=this.codePointAt(this.index),o.Character.isIdentifierPart(e));)r=o.Character.fromCodePoint(e),t+=r,this.index+=r.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,r=this.scanUnicodeCodePointEscape()):(r=this.scanHexEscape("u"),e=r.charCodeAt(0),r&&"\\"!==r&&o.Character.isIdentifierPart(e)||this.throwUnexpectedToken()),t+=r);return t},e.prototype.octalToDecimal=function(e){var t="0"!==e,r=i(e);return!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,r=8*r+i(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+i(this.source[this.index++]))),{code:r,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,r=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();return e=1===r.length?u.Token.Identifier:this.isKeyword(r)?u.Token.Keyword:"null"===r?u.Token.NullLiteral:"true"===r||"false"===r?u.Token.BooleanLiteral:u.Token.Identifier,{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e={type:u.Token.Punctuator,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index},t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)))}return this.index===e.start&&this.throwUnexpectedToken(),e.end=this.index,e.value=t,e},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&o.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),o.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:u.Token.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,r="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)r+=this.source[this.index++];return 0===r.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(o.Character.isIdentifierStart(t)||o.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:u.Token.NumericLiteral,value:parseInt(r,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var r="",n=!1;for(o.Character.isOctalDigit(e.charCodeAt(0))?(n=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return n||0!==r.length||this.throwUnexpectedToken(),(o.Character.isIdentifierStart(this.source.charCodeAt(this.index))||o.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:u.Token.NumericLiteral,value:parseInt(r,8),octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var i=parseInt(t||r,16);return i>1114111&&n.throwUnexpectedToken(a.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(r)}catch(e){this.throwUnexpectedToken(a.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];s.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],r=!1,n=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],o.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),t+=e;else if(o.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(a.Messages.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){n=!0;break}"["===e&&(r=!0)}return n||this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),{value:t.substr(1,t.length-2),literal:t}},e.prototype.scanRegExpFlags=function(){for(var e="",t="";!this.eof();){var r=this.source[this.index];if(!o.Character.isIdentifierPart(r.charCodeAt(0)))break;if(++this.index,"\\"!==r||this.eof())t+=r,e+=r;else if("u"===(r=this.source[this.index])){++this.index;var n=this.index;if(r=this.scanHexEscape("u"))for(t+=r,e+="\\u";n=55296&&e<57343&&o.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=l},function(e,t){"use strict";var r={NonAsciiIdentifierStart:/[\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-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&r.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){ +return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&r.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,r){"use strict";var n=r(2),i=function(){function e(e){this.type=n.Syntax.ArrayExpression,this.elements=e}return e}();t.ArrayExpression=i;var s=function(){function e(e){this.type=n.Syntax.ArrayPattern,this.elements=e}return e}();t.ArrayPattern=s;var a=function(){function e(e,t,r){this.type=n.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=r}return e}();t.ArrowFunctionExpression=a;var o=function(){function e(e,t,r){this.type=n.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=r}return e}();t.AssignmentExpression=o;var u=function(){function e(e,t){this.type=n.Syntax.AssignmentPattern,this.left=e,this.right=t}return e}();t.AssignmentPattern=u;var l=function(){function e(e,t,r){var i="||"===e||"&&"===e;this.type=i?n.Syntax.LogicalExpression:n.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=r}return e}();t.BinaryExpression=l;var c=function(){function e(e){this.type=n.Syntax.BlockStatement,this.body=e}return e}();t.BlockStatement=c;var p=function(){function e(e){this.type=n.Syntax.BreakStatement,this.label=e}return e}();t.BreakStatement=p;var h=function(){function e(e,t){this.type=n.Syntax.CallExpression,this.callee=e,this.arguments=t}return e}();t.CallExpression=h;var f=function(){function e(e,t){this.type=n.Syntax.CatchClause,this.param=e,this.body=t}return e}();t.CatchClause=f;var d=function(){function e(e){this.type=n.Syntax.ClassBody,this.body=e}return e}();t.ClassBody=d;var m=function(){function e(e,t,r){this.type=n.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=r}return e}();t.ClassDeclaration=m;var y=function(){function e(e,t,r){this.type=n.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=r}return e}();t.ClassExpression=y;var g=function(){function e(e,t){this.type=n.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}return e}();t.ComputedMemberExpression=g;var b=function(){function e(e,t,r){this.type=n.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=r}return e}();t.ConditionalExpression=b;var v=function(){function e(e){this.type=n.Syntax.ContinueStatement,this.label=e}return e}();t.ContinueStatement=v;var x=function(){function e(){this.type=n.Syntax.DebuggerStatement}return e}();t.DebuggerStatement=x;var E=function(){function e(e,t){this.type=n.Syntax.ExpressionStatement,this.expression=e,this.directive=t}return e}();t.Directive=E;var A=function(){function e(e,t){this.type=n.Syntax.DoWhileStatement,this.body=e,this.test=t}return e}();t.DoWhileStatement=A;var D=function(){function e(){this.type=n.Syntax.EmptyStatement}return e}();t.EmptyStatement=D;var C=function(){function e(e){this.type=n.Syntax.ExportAllDeclaration,this.source=e}return e}();t.ExportAllDeclaration=C;var S=function(){function e(e){this.type=n.Syntax.ExportDefaultDeclaration,this.declaration=e}return e}();t.ExportDefaultDeclaration=S;var _=function(){function e(e,t,r){this.type=n.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=r}return e}();t.ExportNamedDeclaration=_;var w=function(){function e(e,t){this.type=n.Syntax.ExportSpecifier,this.exported=t,this.local=e}return e}();t.ExportSpecifier=w;var k=function(){function e(e){this.type=n.Syntax.ExpressionStatement,this.expression=e}return e}();t.ExpressionStatement=k;var F=function(){function e(e,t,r){this.type=n.Syntax.ForInStatement,this.left=e,this.right=t,this.body=r,this.each=!1}return e}();t.ForInStatement=F;var T=function(){function e(e,t,r){this.type=n.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=r}return e}();t.ForOfStatement=T;var P=function(){function e(e,t,r,i){this.type=n.Syntax.ForStatement,this.init=e,this.test=t,this.update=r,this.body=i}return e}();t.ForStatement=P;var B=function(){function e(e,t,r,i){this.type=n.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=r,this.generator=i,this.expression=!1}return e}();t.FunctionDeclaration=B;var O=function(){function e(e,t,r,i){this.type=n.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=r,this.generator=i,this.expression=!1}return e}();t.FunctionExpression=O;var j=function(){function e(e){this.type=n.Syntax.Identifier,this.name=e}return e}();t.Identifier=j;var N=function(){function e(e,t,r){this.type=n.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=r}return e}();t.IfStatement=N;var I=function(){function e(e,t){this.type=n.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}return e}();t.ImportDeclaration=I;var L=function(){function e(e){this.type=n.Syntax.ImportDefaultSpecifier,this.local=e}return e}();t.ImportDefaultSpecifier=L;var M=function(){function e(e){this.type=n.Syntax.ImportNamespaceSpecifier,this.local=e}return e}();t.ImportNamespaceSpecifier=M;var R=function(){function e(e,t){this.type=n.Syntax.ImportSpecifier,this.local=e,this.imported=t}return e}();t.ImportSpecifier=R;var U=function(){function e(e,t){this.type=n.Syntax.LabeledStatement,this.label=e,this.body=t}return e}();t.LabeledStatement=U;var V=function(){function e(e,t){this.type=n.Syntax.Literal,this.value=e,this.raw=t}return e}();t.Literal=V;var q=function(){function e(e,t){this.type=n.Syntax.MetaProperty,this.meta=e,this.property=t}return e}();t.MetaProperty=q;var G=function(){function e(e,t,r,i,s){this.type=n.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=r,this.kind=i,this.static=s}return e}();t.MethodDefinition=G;var X=function(){function e(e,t){this.type=n.Syntax.NewExpression,this.callee=e,this.arguments=t}return e}();t.NewExpression=X;var J=function(){function e(e){this.type=n.Syntax.ObjectExpression,this.properties=e}return e}();t.ObjectExpression=J;var W=function(){function e(e){this.type=n.Syntax.ObjectPattern,this.properties=e}return e}();t.ObjectPattern=W;var K=function(){function e(e,t){this.type=n.Syntax.Program,this.body=e,this.sourceType=t}return e}();t.Program=K;var z=function(){function e(e,t,r,i,s,a){this.type=n.Syntax.Property,this.key=t,this.computed=r,this.value=i,this.kind=e,this.method=s,this.shorthand=a}return e}();t.Property=z;var Y=function(){function e(e,t,r){this.type=n.Syntax.Literal,this.value=e,this.raw=t,this.regex=r}return e}();t.RegexLiteral=Y;var H=function(){function e(e){this.type=n.Syntax.RestElement,this.argument=e}return e}();t.RestElement=H;var $=function(){function e(e){this.type=n.Syntax.ReturnStatement,this.argument=e}return e}();t.ReturnStatement=$;var Q=function(){function e(e){this.type=n.Syntax.SequenceExpression,this.expressions=e}return e}();t.SequenceExpression=Q;var Z=function(){function e(e){this.type=n.Syntax.SpreadElement,this.argument=e}return e}();t.SpreadElement=Z;var ee=function(){function e(e,t){this.type=n.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}return e}();t.StaticMemberExpression=ee;var te=function(){function e(){this.type=n.Syntax.Super}return e}();t.Super=te;var re=function(){function e(e,t){this.type=n.Syntax.SwitchCase,this.test=e,this.consequent=t}return e}();t.SwitchCase=re;var ne=function(){function e(e,t){this.type=n.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}return e}();t.SwitchStatement=ne;var ie=function(){function e(e,t){this.type=n.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}return e}();t.TaggedTemplateExpression=ie;var se=function(){function e(e,t){this.type=n.Syntax.TemplateElement,this.value=e,this.tail=t}return e}();t.TemplateElement=se;var ae=function(){function e(e,t){this.type=n.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}return e}();t.TemplateLiteral=ae;var oe=function(){function e(){this.type=n.Syntax.ThisExpression}return e}();t.ThisExpression=oe;var ue=function(){function e(e){this.type=n.Syntax.ThrowStatement,this.argument=e}return e}();t.ThrowStatement=ue;var le=function(){function e(e,t,r){this.type=n.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=r}return e}();t.TryStatement=le;var ce=function(){function e(e,t){this.type=n.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}return e}();t.UnaryExpression=ce;var pe=function(){function e(e,t,r){this.type=n.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=r}return e}();t.UpdateExpression=pe;var he=function(){function e(e,t){this.type=n.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}return e}();t.VariableDeclaration=he;var fe=function(){function e(e,t){this.type=n.Syntax.VariableDeclarator,this.id=e,this.init=t}return e}();t.VariableDeclarator=fe;var de=function(){function e(e,t){this.type=n.Syntax.WhileStatement,this.test=e,this.body=t}return e}();t.WhileStatement=de;var me=function(){function e(e,t){this.type=n.Syntax.WithStatement,this.object=e,this.body=t}return e}();t.WithStatement=me;var ye=function(){function e(e,t){this.type=n.Syntax.YieldExpression,this.argument=e,this.delegate=t}return e}();t.YieldExpression=ye},function(e,t,r){"use strict";function n(e){var t;switch(e.type){case c.JSXSyntax.JSXIdentifier:t=e.name;break;case c.JSXSyntax.JSXNamespacedName:var r=e;t=n(r.namespace)+":"+n(r.name);break;case c.JSXSyntax.JSXMemberExpression:var i=e;t=n(i.object)+"."+n(i.property)}return t}var i,s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=r(9),o=r(7),u=r(3),l=r(12),c=r(13),p=r(10),h=r(14);!function(e){e[e.Identifier=100]="Identifier",e[e.Text=101]="Text"}(i||(i={})),o.TokenName[i.Identifier]="JSXIdentifier",o.TokenName[i.Text]="JSXText";var f=function(e){function t(t,r,n){e.call(this,t,r,n)}return s(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.lineNumber,this.scanner.lineStart=this.startMarker.lineStart},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",r=!0,n=!1,i=!1,s=!1;!this.scanner.eof()&&r&&!n;){var o=this.scanner.source[this.scanner.index];if(o===e)break;if(n=";"===o,t+=o,++this.scanner.index,!n)switch(t.length){case 2:i="#"===o;break;case 3:i&&(s="x"===o,r=s||a.Character.isDecimalDigit(o.charCodeAt(0)),i=i&&!s);break;default:r=r&&!(i&&!a.Character.isDecimalDigit(o.charCodeAt(0))),r=r&&!(s&&!a.Character.isHexDigit(o.charCodeAt(0)))}}if(r&&n&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):s&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||s||!l.XHTMLEntities[u]||(t=l.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:o.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var r=this.scanner.index,n=this.scanner.source[this.scanner.index++],s="";!this.scanner.eof();){var u=this.scanner.source[this.scanner.index++];if(u===n)break;s+="&"===u?this.scanXHTMLEntity(n):u}return{type:o.Token.StringLiteral,value:s,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:r,end:this.scanner.index}}if(46===e){var l=this.scanner.source.charCodeAt(this.scanner.index+1),c=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===l&&46===c?"...":".",r=this.scanner.index;return this.scanner.index+=t.length,{type:o.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:r,end:this.scanner.index}}if(96===e)return{type:o.Token.Template,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(a.Character.isIdentifierStart(e)&&92!==e){var r=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var u=this.scanner.source.charCodeAt(this.scanner.index);if(a.Character.isIdentifierPart(u)&&92!==u)++this.scanner.index;else{if(45!==u)break;++this.scanner.index}}var p=this.scanner.source.slice(r,this.scanner.index);return{type:i.Identifier,value:p,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:r,end:this.scanner.index}}this.scanner.throwUnexpectedToken()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var r=this.scanner.source[this.scanner.index];if("{"===r||"<"===r)break;++this.scanner.index,t+=r,a.Character.isLineTerminator(r.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===r&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart;var n={type:i.Text,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(n)),n},t.prototype.peekJSXToken=function(){var e=this.scanner.index,t=this.scanner.lineNumber,r=this.scanner.lineStart;this.scanner.scanComments();var n=this.lexJSX();return this.scanner.index=e,this.scanner.lineNumber=t,this.scanner.lineStart=r,n},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();t.type===o.Token.Punctuator&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return t.type===o.Token.Punctuator&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return t.type!==i.Identifier&&this.throwUnexpectedToken(t),this.finalize(e,new h.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=t;this.expectJSX(":");var n=this.parseJSXIdentifier();t=this.finalize(e,new h.JSXNamespacedName(r,n))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var s=this.parseJSXIdentifier();t=this.finalize(e,new h.JSXMemberExpression(i,s))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),r=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=r;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new h.JSXNamespacedName(n,i))}else e=r;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();t.type!==o.Token.StringLiteral&&this.throwUnexpectedToken(t);var r=this.getTokenRaw(t);return this.finalize(e,new p.Literal(t.value,r))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new h.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),r=null;return this.matchJSX("=")&&(this.expectJSX("="),r=this.parseJSXAttributeValue()),this.finalize(e,new h.JSXAttribute(t,r))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new h.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),r=this.parseJSXAttributes(),n=this.matchJSX("/");return n&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new h.JSXOpeningElement(t,n,r))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new h.JSXClosingElement(t))}var r=this.parseJSXElementName(),n=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new h.JSXOpeningElement(r,i,n))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.finalize(e,new h.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t;return this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new h.JSXExpressionContainer(t))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),r=this.nextJSXText();if(r.start0))break;var a=this.finalize(e.node,new h.JSXElement(e.opening,e.children,e.closing));e=t.pop(),e.children.push(a)}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),r=[],n=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:n,children:r});r=i.children,n=i.closing}return this.finalize(e,new h.JSXElement(t,r,n))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t}(u.Parser);t.JSXParser=f},function(e,t){"use strict";t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t){"use strict";t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,r){"use strict";var n=r(13),i=function(){function e(e){this.type=n.JSXSyntax.JSXClosingElement,this.name=e}return e}();t.JSXClosingElement=i;var s=function(){function e(e,t,r){this.type=n.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=r}return e}();t.JSXElement=s;var a=function(){function e(){this.type=n.JSXSyntax.JSXEmptyExpression}return e}();t.JSXEmptyExpression=a;var o=function(){function e(e){this.type=n.JSXSyntax.JSXExpressionContainer,this.expression=e}return e}();t.JSXExpressionContainer=o;var u=function(){function e(e){this.type=n.JSXSyntax.JSXIdentifier,this.name=e}return e}();t.JSXIdentifier=u;var l=function(){function e(e,t){this.type=n.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}return e}();t.JSXMemberExpression=l;var c=function(){function e(e,t){this.type=n.JSXSyntax.JSXAttribute,this.name=e,this.value=t}return e}();t.JSXAttribute=c;var p=function(){function e(e,t){this.type=n.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}return e}();t.JSXNamespacedName=p;var h=function(){function e(e,t,r){this.type=n.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=r}return e}();t.JSXOpeningElement=h;var f=function(){function e(e){this.type=n.JSXSyntax.JSXSpreadAttribute,this.argument=e}return e}();t.JSXSpreadAttribute=f;var d=function(){function e(e,t){this.type=n.JSXSyntax.JSXText,this.value=e,this.raw=t}return e}();t.JSXText=d},function(e,t,r){"use strict";var n=r(8),i=r(6),s=r(7),a=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var r=this.values[this.paren-1];t="if"===r||"while"===r||"for"===r||"with"===r;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var n=this.values[this.curly-4];t=!!n&&!this.beforeFunctionExpression(n)}else if("function"===this.values[this.curly-4]){var i=this.values[this.curly-5];t=!i||!this.beforeFunctionExpression(i)}}return t},e.prototype.push=function(e){e.type===s.Token.Punctuator||e.type===s.Token.Keyword?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),o=function(){function e(e,t){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=!!t&&("boolean"==typeof t.tolerant&&t.tolerant),this.scanner=new n.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&("boolean"==typeof t.comment&&t.comment),this.trackRange=!!t&&("boolean"==typeof t.range&&t.range),this.trackLoc=!!t&&("boolean"==typeof t.loc&&t.loc),this.buffer=[],this.reader=new a}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t=0,s=i&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=e("./runtime"),i)n.regeneratorRuntime=s;else try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=void 0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./runtime":577}],577:[function(e,t,r){(function(e,r){!function(r){"use strict";function n(e,t,r,n){var i=t&&t.prototype instanceof s?t:s,a=Object.create(i.prototype),o=new d(n||[]);return a._invoke=c(e,r,o),a}function i(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function s(){}function a(){}function o(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(t){function r(e,n,s,a){var o=i(t[e],t,n);if("throw"!==o.type){var u=o.arg,l=u.value;return l&&"object"==typeof l&&v.call(l,"__await")?Promise.resolve(l.__await).then(function(e){r("next",e,s,a)},function(e){r("throw",e,s,a)}):Promise.resolve(l).then(function(e){u.value=e,s(u)},a)}a(o.arg)}function n(e,t){function n(){return new Promise(function(n,i){r(e,t,n,i)})}return s=s?s.then(n,n):n()}"object"==typeof e&&e.domain&&(r=e.domain.bind(r));var s;this._invoke=n}function c(e,t,r){var n=S;return function(s,a){if(n===w)throw new Error("Generator is already running");if(n===k){if("throw"===s)throw a;return y()}for(r.method=s,r.arg=a;;){var o=r.delegate;if(o){var u=p(o,r);if(u){if(u===F)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===S)throw n=k,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=w;var l=i(e,t,r);if("normal"===l.type){if(n=r.done?k:_,l.arg===F)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=k,r.method="throw",r.arg=l.arg)}}}function p(e,t){var r=e.iterator[t.method];if(r===g){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=g,p(e,t),"throw"===t.method))return F;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return F}var n=i(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,F;var s=n.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=g),t.delegate=null,F):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,F)}function h(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(h,this),this.reset(!0)}function m(e){if(e){var t=e[E];if(t)return t.call(e);if("function"==typeof e.next)return e +;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--n){var i=this.tryEntries[n],s=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=v.call(i,"catchLoc"),o=v.call(i,"finallyLoc");if(a&&o){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),f(r),F}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;f(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:m(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=g),F}}}("object"==typeof r?r:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:539}],578:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){h.default.ok(this instanceof s),d.assertIdentifier(e),this.nextTempId=0,this.contextId=e,this.listing=[],this.marked=[!0],this.finalLoc=a(),this.tryEntries=[],this.leapManager=new y.LeapManager(this)}function a(){return d.numericLiteral(-1)}function o(e){return new Error("all declarations should have been transformed into assignments before the Exploder began its work: "+(0,c.default)(e))}function u(e){var t=e.type;return"normal"===t?!E.call(e,"target"):"break"===t||"continue"===t?!E.call(e,"value")&&d.isLiteral(e.target):("return"===t||"throw"===t)&&(E.call(e,"value")&&!E.call(e,"target"))}var l=e("babel-runtime/core-js/json/stringify"),c=i(l),p=e("assert"),h=i(p),f=e("babel-types"),d=n(f),m=e("./leap"),y=n(m),g=e("./meta"),b=n(g),v=e("./util"),x=n(v),E=Object.prototype.hasOwnProperty,A=s.prototype;r.Emitter=s,A.mark=function(e){d.assertLiteral(e);var t=this.listing.length;return-1===e.value?e.value=t:h.default.strictEqual(e.value,t),this.marked[t]=!0,e},A.emit=function(e){d.isExpression(e)&&(e=d.expressionStatement(e)),d.assertStatement(e),this.listing.push(e)},A.emitAssign=function(e,t){return this.emit(this.assign(e,t)),e},A.assign=function(e,t){return d.expressionStatement(d.assignmentExpression("=",e,t))},A.contextProperty=function(e,t){return d.memberExpression(this.contextId,t?d.stringLiteral(e):d.identifier(e),!!t)},A.stop=function(e){e&&this.setReturnValue(e),this.jump(this.finalLoc)},A.setReturnValue=function(e){d.assertExpression(e.value),this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))},A.clearPendingException=function(e,t){d.assertLiteral(e);var r=d.callExpression(this.contextProperty("catch",!0),[e]);t?this.emitAssign(t,r):this.emit(r)},A.jump=function(e){this.emitAssign(this.contextProperty("next"),e),this.emit(d.breakStatement())},A.jumpIf=function(e,t){d.assertExpression(e),d.assertLiteral(t),this.emit(d.ifStatement(e,d.blockStatement([this.assign(this.contextProperty("next"),t),d.breakStatement()])))},A.jumpIfNot=function(e,t){d.assertExpression(e),d.assertLiteral(t);var r=void 0;r=d.isUnaryExpression(e)&&"!"===e.operator?e.argument:d.unaryExpression("!",e),this.emit(d.ifStatement(r,d.blockStatement([this.assign(this.contextProperty("next"),t),d.breakStatement()])))},A.makeTempVar=function(){return this.contextProperty("t"+this.nextTempId++)},A.getContextFunction=function(e){return d.functionExpression(e||null,[this.contextId],d.blockStatement([this.getDispatchLoop()]),!1,!1)},A.getDispatchLoop=function(){var e=this,t=[],r=void 0,n=!1;return e.listing.forEach(function(i,s){e.marked.hasOwnProperty(s)&&(t.push(d.switchCase(d.numericLiteral(s),r=[])),n=!1),n||(r.push(i),d.isCompletionStatement(i)&&(n=!0))}),this.finalLoc.value=this.listing.length,t.push(d.switchCase(this.finalLoc,[]),d.switchCase(d.stringLiteral("end"),[d.returnStatement(d.callExpression(this.contextProperty("stop"),[]))])),d.whileStatement(d.numericLiteral(1),d.switchStatement(d.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),t))},A.getTryLocsList=function(){if(0===this.tryEntries.length)return null;var e=0;return d.arrayExpression(this.tryEntries.map(function(t){var r=t.firstLoc.value;h.default.ok(r>=e,"try entries out of order"),e=r;var n=t.catchEntry,i=t.finallyEntry,s=[t.firstLoc,n?n.firstLoc:null];return i&&(s[2]=i.firstLoc,s[3]=i.afterLoc),d.arrayExpression(s)}))},A.explode=function(e,t){var r=e.node,n=this;if(d.assertNode(r),d.isDeclaration(r))throw o(r);if(d.isStatement(r))return n.explodeStatement(e);if(d.isExpression(r))return n.explodeExpression(e,t);switch(r.type){case"Program":return e.get("body").map(n.explodeStatement,n);case"VariableDeclarator":throw o(r);case"Property":case"SwitchCase":case"CatchClause":throw new Error(r.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+(0,c.default)(r.type))}},A.explodeStatement=function(e,t){var r=e.node,n=this,i=void 0,s=void 0,o=void 0;if(d.assertStatement(r),t?d.assertIdentifier(t):t=null,d.isBlockStatement(r))return void e.get("body").forEach(function(e){n.explodeStatement(e)});if(!b.containsLeap(r))return void n.emit(r);switch(r.type){case"ExpressionStatement":n.explodeExpression(e.get("expression"),!0);break;case"LabeledStatement":s=a(),n.leapManager.withEntry(new y.LabeledEntry(s,r.label),function(){n.explodeStatement(e.get("body"),r.label)}),n.mark(s);break;case"WhileStatement":i=a(),s=a(),n.mark(i),n.jumpIfNot(n.explodeExpression(e.get("test")),s),n.leapManager.withEntry(new y.LoopEntry(s,i,t),function(){n.explodeStatement(e.get("body"))}),n.jump(i),n.mark(s);break;case"DoWhileStatement":var u=a(),l=a();s=a(),n.mark(u),n.leapManager.withEntry(new y.LoopEntry(s,l,t),function(){n.explode(e.get("body"))}),n.mark(l),n.jumpIf(n.explodeExpression(e.get("test")),u),n.mark(s);break;case"ForStatement":o=a();var p=a();s=a(),r.init&&n.explode(e.get("init"),!0),n.mark(o),r.test&&n.jumpIfNot(n.explodeExpression(e.get("test")),s),n.leapManager.withEntry(new y.LoopEntry(s,p,t),function(){n.explodeStatement(e.get("body"))}),n.mark(p),r.update&&n.explode(e.get("update"),!0),n.jump(o),n.mark(s);break;case"TypeCastExpression":return n.explodeExpression(e.get("expression"));case"ForInStatement":o=a(),s=a();var f=n.makeTempVar();n.emitAssign(f,d.callExpression(x.runtimeProperty("keys"),[n.explodeExpression(e.get("right"))])),n.mark(o);var m=n.makeTempVar();n.jumpIf(d.memberExpression(d.assignmentExpression("=",m,d.callExpression(f,[])),d.identifier("done"),!1),s),n.emitAssign(r.left,d.memberExpression(m,d.identifier("value"),!1)),n.leapManager.withEntry(new y.LoopEntry(s,o,t),function(){n.explodeStatement(e.get("body"))}),n.jump(o),n.mark(s);break;case"BreakStatement":n.emitAbruptCompletion({type:"break",target:n.leapManager.getBreakLoc(r.label)});break;case"ContinueStatement":n.emitAbruptCompletion({type:"continue",target:n.leapManager.getContinueLoc(r.label)});break;case"SwitchStatement":var g=n.emitAssign(n.makeTempVar(),n.explodeExpression(e.get("discriminant")));s=a();for(var v=a(),E=v,A=[],C=r.cases||[],S=C.length-1;S>=0;--S){var _=C[S];d.assertSwitchCase(_),_.test?E=d.conditionalExpression(d.binaryExpression("===",g,_.test),A[S]=a(),E):A[S]=v}var w=e.get("discriminant");w.replaceWith(E),n.jump(n.explodeExpression(w)),n.leapManager.withEntry(new y.SwitchEntry(s),function(){e.get("cases").forEach(function(e){var t=e.key;n.mark(A[t]),e.get("consequent").forEach(function(e){n.explodeStatement(e)})})}),n.mark(s),-1===v.value&&(n.mark(v),h.default.strictEqual(s.value,v.value));break;case"IfStatement":var k=r.alternate&&a();s=a(),n.jumpIfNot(n.explodeExpression(e.get("test")),k||s),n.explodeStatement(e.get("consequent")),k&&(n.jump(s),n.mark(k),n.explodeStatement(e.get("alternate"))),n.mark(s);break;case"ReturnStatement":n.emitAbruptCompletion({type:"return",value:n.explodeExpression(e.get("argument"))});break;case"WithStatement":throw new Error("WithStatement not supported in generator functions.");case"TryStatement":s=a();var F=r.handler,T=F&&a(),P=T&&new y.CatchEntry(T,F.param),B=r.finalizer&&a(),O=B&&new y.FinallyEntry(B,s),j=new y.TryEntry(n.getUnmarkedCurrentLoc(),P,O);n.tryEntries.push(j),n.updateContextPrevLoc(j.firstLoc),n.leapManager.withEntry(j,function(){if(n.explodeStatement(e.get("block")),T){B?n.jump(B):n.jump(s),n.updateContextPrevLoc(n.mark(T));var t=e.get("handler.body"),r=n.makeTempVar();n.clearPendingException(j.firstLoc,r),t.traverse(D,{safeParam:r,catchParamName:F.param.name}),n.leapManager.withEntry(P,function(){n.explodeStatement(t)})}B&&(n.updateContextPrevLoc(n.mark(B)),n.leapManager.withEntry(O,function(){n.explodeStatement(e.get("finalizer"))}),n.emit(d.returnStatement(d.callExpression(n.contextProperty("finish"),[O.firstLoc]))))}),n.mark(s);break;case"ThrowStatement":n.emit(d.throwStatement(n.explodeExpression(e.get("argument"))));break;default:throw new Error("unknown Statement of type "+(0,c.default)(r.type))}};var D={Identifier:function(e,t){e.node.name===t.catchParamName&&x.isReference(e)&&e.replaceWith(t.safeParam)},Scope:function(e,t){e.scope.hasOwnBinding(t.catchParamName)&&e.skip()}};A.emitAbruptCompletion=function(e){u(e)||h.default.ok(!1,"invalid completion record: "+(0,c.default)(e)),h.default.notStrictEqual(e.type,"normal","normal completions are not abrupt");var t=[d.stringLiteral(e.type)];"break"===e.type||"continue"===e.type?(d.assertLiteral(e.target),t[1]=e.target):"return"!==e.type&&"throw"!==e.type||e.value&&(d.assertExpression(e.value),t[1]=e.value),this.emit(d.returnStatement(d.callExpression(this.contextProperty("abrupt"),t)))},A.getUnmarkedCurrentLoc=function(){return d.numericLiteral(this.listing.length)},A.updateContextPrevLoc=function(e){e?(d.assertLiteral(e),-1===e.value?e.value=this.listing.length:h.default.strictEqual(e.value,this.listing.length)):e=this.getUnmarkedCurrentLoc(),this.emitAssign(this.contextProperty("prev"),e)},A.explodeExpression=function(e,t){function r(e){if(d.assertExpression(e),!t)return e;s.emit(e)}function n(e,t,r){h.default.ok(!r||!e,"Ignoring the result of a child expression but forcing it to be assigned to a temporary variable?");var n=s.explodeExpression(t,r);return r||(e||l&&!d.isLiteral(n))&&(n=s.emitAssign(e||s.makeTempVar(),n)),n}var i=e.node;if(!i)return i;d.assertExpression(i);var s=this,o=void 0,u=void 0;if(!b.containsLeap(i))return r(i);var l=b.containsLeap.onlyChildren(i);switch(i.type){case"MemberExpression":return r(d.memberExpression(s.explodeExpression(e.get("object")),i.computed?n(null,e.get("property")):i.property,i.computed));case"CallExpression":var p=e.get("callee"),f=e.get("arguments"),m=void 0,y=[],g=!1;if(f.forEach(function(e){g=g||b.containsLeap(e.node)}),d.isMemberExpression(p.node))if(g){var v=n(s.makeTempVar(),p.get("object")),x=p.node.computed?n(null,p.get("property")):p.node.property;y.unshift(v),m=d.memberExpression(d.memberExpression(v,x,p.node.computed),d.identifier("call"),!1)}else m=s.explodeExpression(p);else m=n(null,p),d.isMemberExpression(m)&&(m=d.sequenceExpression([d.numericLiteral(0),m]));return f.forEach(function(e){y.push(n(null,e))}),r(d.callExpression(m,y));case"NewExpression":return r(d.newExpression(n(null,e.get("callee")),e.get("arguments").map(function(e){return n(null,e)})));case"ObjectExpression":return r(d.objectExpression(e.get("properties").map(function(e){return e.isObjectProperty()?d.objectProperty(e.node.key,n(null,e.get("value")),e.node.computed):e.node})));case"ArrayExpression":return r(d.arrayExpression(e.get("elements").map(function(e){return n(null,e)})));case"SequenceExpression":var E=i.expressions.length-1;return e.get("expressions").forEach(function(e){e.key===E?o=s.explodeExpression(e,t):s.explodeExpression(e,!0)}),o;case"LogicalExpression":u=a(),t||(o=s.makeTempVar());var A=n(o,e.get("left"));return"&&"===i.operator?s.jumpIfNot(A,u):(h.default.strictEqual(i.operator,"||"),s.jumpIf(A,u)),n(o,e.get("right"),t),s.mark(u),o;case"ConditionalExpression":var D=a();u=a();var C=s.explodeExpression(e.get("test"));return s.jumpIfNot(C,D),t||(o=s.makeTempVar()),n(o,e.get("consequent"),t),s.jump(u),s.mark(D),n(o,e.get("alternate"),t),s.mark(u),o;case"UnaryExpression":return r(d.unaryExpression(i.operator,s.explodeExpression(e.get("argument")),!!i.prefix));case"BinaryExpression":return r(d.binaryExpression(i.operator,n(null,e.get("left")),n(null,e.get("right"))));case"AssignmentExpression":return r(d.assignmentExpression(i.operator,s.explodeExpression(e.get("left")),s.explodeExpression(e.get("right"))));case"UpdateExpression":return r(d.updateExpression(i.operator,s.explodeExpression(e.get("argument")),i.prefix));case"YieldExpression":u=a();var S=i.argument&&s.explodeExpression(e.get("argument"));if(S&&i.delegate){var _=s.makeTempVar();return s.emit(d.returnStatement(d.callExpression(s.contextProperty("delegateYield"),[S,d.stringLiteral(_.property.name),u]))),s.mark(u),_}return s.emitAssign(s.contextProperty("next"),u),s.emit(d.returnStatement(S||null)),s.mark(u),s.contextProperty("sent");default:throw new Error("unknown Expression of type "+(0,c.default)(i.type))}}},{"./leap":581,"./meta":582,"./util":584,assert:3,"babel-runtime/core-js/json/stringify":114,"babel-types":169}],579:[function(e,t,r){"use strict";var n=e("babel-runtime/core-js/object/keys"),i=function(e){return e&&e.__esModule?e:{default:e}}(n),s=e("babel-types"),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),o=Object.prototype.hasOwnProperty;r.hoist=function(e){function t(e,t){a.assertVariableDeclaration(e);var n=[];return e.declarations.forEach(function(e){r[e.id.name]=a.identifier(e.id.name),e.init?n.push(a.assignmentExpression("=",e.id,e.init)):t&&n.push(e.id)}),0===n.length?null:1===n.length?n[0]:a.sequenceExpression(n)}a.assertFunction(e.node);var r={};e.get("body").traverse({VariableDeclaration:{exit:function(e){var r=t(e.node,!1);null===r?e.remove():e.replaceWith(a.expressionStatement(r)),e.skip()}},ForStatement:function(e){var r=e.node.init;a.isVariableDeclaration(r)&&e.get("init").replaceWith(t(r,!1))},ForXStatement:function(e){var r=e.get("left");r.isVariableDeclaration()&&r.replaceWith(t(r.node,!0))},FunctionDeclaration:function(e){var t=e.node;r[t.id.name]=t.id;var n=a.expressionStatement(a.assignmentExpression("=",t.id,a.functionExpression(t.id,t.params,t.body,t.generator,t.expression)));e.parentPath.isBlockStatement()?(e.parentPath.unshiftContainer("body",n),e.remove()):e.replaceWith(n),e.skip()},FunctionExpression:function(e){e.skip()}});var n={};e.get("params").forEach(function(e){var t=e.node;a.isIdentifier(t)&&(n[t.name]=t)});var s=[];return(0,i.default)(r).forEach(function(e){o.call(n,e)||s.push(a.variableDeclarator(r[e],null))}),0===s.length?null:a.variableDeclaration("var",s)}},{"babel-runtime/core-js/object/keys":120,"babel-types":169}],580:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){return e("./visit")}},{"./visit":585}],581:[function(e,t,r){"use strict";function n(){f.default.ok(this instanceof n)}function i(e){n.call(this),m.assertLiteral(e),this.returnLoc=e}function s(e,t,r){n.call(this),m.assertLiteral(e),m.assertLiteral(t),r?m.assertIdentifier(r):r=null,this.breakLoc=e,this.continueLoc=t,this.label=r}function a(e){n.call(this),m.assertLiteral(e),this.breakLoc=e}function o(e,t,r){n.call(this),m.assertLiteral(e),t?f.default.ok(t instanceof u):t=null,r?f.default.ok(r instanceof l):r=null,f.default.ok(t||r),this.firstLoc=e,this.catchEntry=t,this.finallyEntry=r}function u(e,t){n.call(this),m.assertLiteral(e),m.assertIdentifier(t),this.firstLoc=e,this.paramId=t}function l(e,t){n.call(this),m.assertLiteral(e),m.assertLiteral(t),this.firstLoc=e,this.afterLoc=t}function c(e,t){n.call(this),m.assertLiteral(e),m.assertIdentifier(t),this.breakLoc=e,this.label=t}function p(t){f.default.ok(this instanceof p);var r=e("./emit").Emitter;f.default.ok(t instanceof r),this.emitter=t,this.entryStack=[new i(t.finalLoc)]}var h=e("assert"),f=function(e){return e&&e.__esModule?e:{default:e}}(h),d=e("babel-types"),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(d),y=e("util");(0,y.inherits)(i,n),r.FunctionEntry=i,(0,y.inherits)(s,n),r.LoopEntry=s,(0,y.inherits)(a,n),r.SwitchEntry=a,(0,y.inherits)(o,n),r.TryEntry=o,(0,y.inherits)(u,n),r.CatchEntry=u,(0,y.inherits)(l,n),r.FinallyEntry=l,(0,y.inherits)(c,n),r.LabeledEntry=c;var g=p.prototype;r.LeapManager=p,g.withEntry=function(e,t){f.default.ok(e instanceof n),this.entryStack.push(e);try{t.call(this.emitter)}finally{var r=this.entryStack.pop();f.default.strictEqual(r,e)}},g._findLeapLocation=function(e,t){for(var r=this.entryStack.length-1;r>=0;--r){var n=this.entryStack[r],i=n[e];if(i)if(t){if(n.label&&n.label.name===t.name)return i}else if(!(n instanceof c))return i}return null},g.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)},g.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},{"./emit":578,assert:3,"babel-types":169,util:601}],582:[function(e,t,r){"use strict";function n(e,t){function r(e){function t(e){return r||(Array.isArray(e)?e.some(t):o.isNode(e)&&(s.default.strictEqual(r,!1),r=n(e))),r}o.assertNode(e);var r=!1,i=o.VISITOR_KEYS[e.type];if(i)for(var a=0;a0&&(a.node.body=l);var c=s(e);p.assertIdentifier(r.id);var d=p.identifier(r.id.name+"$"),y=(0,h.hoist)(e);if(o(e,i)){y=y||p.variableDeclaration("var",[]);var b=p.identifier("arguments");b._shadowedFunctionLiteral=e,y.declarations.push(p.variableDeclarator(i,b))}var v=new f.Emitter(n);v.explode(e.get("body")),y&&y.declarations.length>0&&u.push(y);var A=[v.getContextFunction(d),r.generator?c:p.nullLiteral(),p.thisExpression()],D=v.getTryLocsList();D&&A.push(D);var C=p.callExpression(g.runtimeProperty(r.async?"async":"wrap"),A);u.push(p.returnStatement(C)),r.body=p.blockStatement(u);var S=a.node.directives;S&&(r.body.directives=S);var _=r.generator;_&&(r.generator=!1),r.async&&(r.async=!1),_&&p.isExpression(r)&&e.replaceWith(p.callExpression(g.runtimeProperty("mark"),[r])),e.requeue()}}};var v={"FunctionExpression|FunctionDeclaration":function(e){e.skip()},Identifier:function(e,t){"arguments"===e.node.name&&g.isReference(e)&&(e.replaceWith(t.argsId),t.didRenameArguments=!0)}},x={MetaProperty:function(e){var t=e.node;"function"===t.meta.name&&"sent"===t.property.name&&e.replaceWith(p.memberExpression(this.context,p.identifier("_sent")))}},E={Function:function(e){e.skip()},AwaitExpression:function(e){var t=e.node.argument;e.replaceWith(p.yieldExpression(p.callExpression(g.runtimeProperty("awrap"),[t]),!1))}}},{"./emit":578,"./hoist":579,"./replaceShorthandObjectMethod":583,"./util":584,assert:3,"babel-types":169,private:537}],586:[function(e,t,r){var n=(e("assert"),e("recast").types),i=n.namedTypes,s=n.builders,a=Object.prototype.hasOwnProperty;r.defaults=function(e){for(var t,r=arguments.length,n=1;n>=1);return r}},{"is-finite":309}],589:[function(e,t,r){"use strict";t.exports=function(e){var t=/^\\\\\?\\/.test(e),r=/[^\x00-\x80]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},{}],590:[function(e,t,r){function n(){i.call(this)}t.exports=n;var i=e("events").EventEmitter;e("inherits")(n,i),n.Readable=e("readable-stream/readable.js"),n.Writable=e("readable-stream/writable.js"),n.Duplex=e("readable-stream/duplex.js"),n.Transform=e("readable-stream/transform.js"),n.PassThrough=e("readable-stream/passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&l.pause&&l.pause()}function n(){l.readable&&l.resume&&l.resume()}function s(){c||(c=!0,e.end())}function a(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function o(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){l.removeListener("data",r),e.removeListener("drain",n),l.removeListener("end",s),l.removeListener("close",a),l.removeListener("error",o),e.removeListener("error",o),l.removeListener("end",u),l.removeListener("close",u),e.removeListener("close",u)}var l=this;l.on("data",r),e.on("drain",n),e._isStdio||t&&!1===t.end||(l.on("end",s),l.on("close",a));var c=!1;return l.on("error",o),e.on("error",o),l.on("end",u),l.on("close",u),e.on("close",u),e.emit("pipe",l),e}},{events:301,inherits:306,"readable-stream/duplex.js":540,"readable-stream/passthrough.js":547,"readable-stream/readable.js":548,"readable-stream/transform.js":549,"readable-stream/writable.js":550}],591:[function(e,t,r){function n(e){if(e&&!u(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function a(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var o=e("buffer").Buffer,u=o.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},l=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),n(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=a;break;default:return void(this.write=i)}this.charBuffer=new o(6),this.charReceived=0,this.charLength=0};l.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,n=t.charCodeAt(i);if(n>=55296&&n<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,i)}return t},l.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},l.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},{buffer:184}],592:[function(e,t,r){"use strict";var n=e("ansi-regex")();t.exports=function(e){return"string"==typeof e?e.replace(n,""):e}},{"ansi-regex":1}], +593:[function(e,t,r){(function(e){"use strict";var r=e.argv,n=r.indexOf("--"),i=function(e){e="--"+e;var t=r.indexOf(e);return-1!==t&&(-1===n||t=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(t)?n.showHidden=t:t&&r._extend(n,t),E(n.showHidden)&&(n.showHidden=!1),E(n.depth)&&(n.depth=2),E(n.colors)&&(n.colors=!1),E(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,e,n.depth)}function s(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function a(e,t){return e}function o(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,t,n){if(e.customInspect&&t&&_(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=u(e,i,n)),i}var s=l(e,t);if(s)return s;var a=Object.keys(t),m=o(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(t);if(0===a.length){if(_(t)){var y=t.name?": "+t.name:"";return e.stylize("[Function"+y+"]","special")}if(A(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(C(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return c(t)}var g="",b=!1,x=["{","}"];if(d(t)&&(b=!0,x=["[","]"]),_(t)){g=" [Function"+(t.name?": "+t.name:"")+"]"}if(A(t)&&(g=" "+RegExp.prototype.toString.call(t)),C(t)&&(g=" "+Date.prototype.toUTCString.call(t)),S(t)&&(g=" "+c(t)),0===a.length&&(!b||0==t.length))return x[0]+g+x[1];if(n<0)return A(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var E;return E=b?p(e,t,n,m,a):a.map(function(r){return h(e,t,n,m,r,b)}),e.seen.pop(),f(E,g,x)}function l(e,t){if(E(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i){for(var s=[],a=0,o=t.length;a-1&&(o=s?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n"))):o=e.stylize("[Circular]","special")),E(a)){if(s&&i.match(/^\d+$/))return o;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+o}function f(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function d(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return null==e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function x(e){return"symbol"==typeof e}function E(e){return void 0===e}function A(e){return D(e)&&"[object RegExp]"===k(e)}function D(e){return"object"==typeof e&&null!==e}function C(e){return D(e)&&"[object Date]"===k(e)}function S(e){return D(e)&&("[object Error]"===k(e)||e instanceof Error)}function _(e){return"function"==typeof e}function w(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function k(e){return Object.prototype.toString.call(e)}function F(e){return e<10?"0"+e.toString(10):e.toString(10)}function T(){var e=new Date,t=[F(e.getHours()),F(e.getMinutes()),F(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.format=function(e){if(!v(e)){for(var t=[],r=0;r=s)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),o=n[r];r any): void; + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + */ + addSchema(schema: Array | Object, key?: string): void; + /** + * Add schema that will be used to validate other schemas + * options in META_IGNORE_OPTIONS are alway set to false + * @param {Object} schema schema object + * @param {String} key optional schema key + */ + addMetaSchema(schema: Object, key?: string): void; + /** + * Validate schema + * @param {Object} schema schema to validate + * @return {Boolean} true if schema is valid + */ + validateSchema(schema: Object): boolean; + /** + * Get compiled schema from the instance by `key` or `ref`. + * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). + * @return {Function} schema validating function (with property `schema`). + */ + getSchema(keyRef: string): ValidateFunction; + /** + * Remove cached schema(s). + * If no parameter is passed all schemas but meta-schemas are removed. + * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object + */ + removeSchema(schemaKeyRef?: Object | string | RegExp): void; + /** + * Add custom format + * @param {String} name format name + * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) + */ + addFormat(name: string, format: FormatValidator | FormatDefinition): void; + /** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords. + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ + addKeyword(keyword: string, definition: KeywordDefinition): void; + /** + * Get keyword definition + * @this Ajv + * @param {String} keyword pre-defined or custom keyword. + * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. + */ + getKeyword(keyword: string): Object | boolean; + /** + * Remove keyword + * @this Ajv + * @param {String} keyword pre-defined or custom keyword. + */ + removeKeyword(keyword: string): void; + /** + * Convert array of error message objects to string + * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + errorsText(errors?: Array, options?: ErrorsTextOptions): string; + errors?: Array; + } + + interface Thenable { + then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + } + + interface ValidateFunction { + ( + data: any, + dataPath?: string, + parentData?: Object | Array, + parentDataProperty?: string | number, + rootData?: Object | Array + ): boolean | Thenable; + errors?: Array; + schema?: Object; + } + + interface Options { + v5?: boolean; + allErrors?: boolean; + verbose?: boolean; + jsonPointers?: boolean; + uniqueItems?: boolean; + unicode?: boolean; + format?: string; + formats?: Object; + unknownFormats?: boolean | string | Array; + schemas?: Array | Object; + ownProperties?: boolean; + missingRefs?: boolean | string; + extendRefs?: boolean | string; + loadSchema?: (uri: string, cb: (err: Error, schema: Object) => any) => any; + removeAdditional?: boolean | string; + useDefaults?: boolean | string; + coerceTypes?: boolean | string; + async?: boolean | string; + transpile?: string | ((code: string) => string); + meta?: boolean | Object; + validateSchema?: boolean | string; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + multipleOfPrecision?: number; + errorDataPath?: string; + messages?: boolean; + sourceCode?: boolean; + beautify?: boolean | Object; + cache?: Object; + } + + type FormatValidator = string | RegExp | ((data: string) => boolean); + + interface FormatDefinition { + validate: FormatValidator; + compare: (data1: string, data2: string) => number; + async?: boolean; + } + + interface KeywordDefinition { + type?: string | Array; + async?: boolean; + errors?: boolean | string; + // schema: false makes validate not to expect schema (ValidateFunction) + schema?: boolean; + modifying?: boolean; + valid?: boolean; + // one and only one of the following properties should be present + validate?: ValidateFunction | SchemaValidateFunction; + compile?: (schema: Object, parentSchema: Object) => ValidateFunction; + macro?: (schema: Object, parentSchema: Object) => Object; + inline?: (it: Object, keyword: string, schema: Object, parentSchema: Object) => string; + } + + interface SchemaValidateFunction { + ( + schema: Object, + data: any, + parentSchema?: Object, + dataPath?: string, + parentData?: Object | Array, + parentDataProperty?: string | number + ): boolean | Thenable; + errors?: Array; + } + + interface ErrorsTextOptions { + separator?: string; + dataVar?: string; + } + + interface ErrorObject { + keyword: string; + dataPath: string; + schemaPath: string; + params: ErrorParameters; + // Excluded if messages set to false. + message?: string; + // These are added with the `verbose` option. + schema?: Object; + parentSchema?: Object; + data?: any; + } + + type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternGroupsParams | PatternRequiredParams | + SwitchParams | NoParams | EnumParams; + + interface RefParams { + ref: string; + } + + interface LimitParams { + limit: number; + } + + interface AdditionalPropertiesParams { + additionalProperty: string; + } + + interface DependenciesParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; + } + + interface FormatParams { + format: string + } + + interface ComparisonParams { + comparison: string; + limit: number | string; + exclusive: boolean; + } + + interface MultipleOfParams { + multipleOf: number; + } + + interface PatternParams { + pattern: string; + } + + interface RequiredParams { + missingProperty: string; + } + + interface TypeParams { + type: string; + } + + interface UniqueItemsParams { + i: number; + j: number; + } + + interface CustomParams { + keyword: string; + } + + interface PatternGroupsParams { + reason: string; + limit: number; + pattern: string; + } + + interface PatternRequiredParams { + missingPattern: string; + } + + interface SwitchParams { + caseIndex: number; + } + + interface NoParams {} + + interface EnumParams { + allowedValues: Array; + } +} + +export = ajv; diff --git a/deploy/core/node_modules/ajv/lib/ajv.js b/deploy/core/node_modules/ajv/lib/ajv.js new file mode 100644 index 000000000..0502c1fd3 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/ajv.js @@ -0,0 +1,420 @@ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , v5 = require('./v5') + , util = require('./compile/util') + , async = require('./async') + , co = require('co'); + +module.exports = Ajv; + +Ajv.prototype.compileAsync = async.compile; + +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.ValidationError = require('./compile/validation_error'); + +var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema'; +var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i; +function SCHEMA_URI_FORMAT_FUNC(str) { + return SCHEMA_URI_FORMAT.test(str); +} + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + var self = this; + + opts = this._opts = util.copy(opts) || {}; + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + + // this is done on purpose, so that methods are bound to the instance + // (without using bind) so that they can be used without the instance + this.validate = validate; + this.compile = compile; + this.addSchema = addSchema; + this.addMetaSchema = addMetaSchema; + this.validateSchema = validateSchema; + this.getSchema = getSchema; + this.removeSchema = removeSchema; + this.addFormat = addFormat; + this.errorsText = errorsText; + + this._addSchema = _addSchema; + this._compile = _compile; + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.async || opts.transpile) async.setup(opts); + if (opts.beautify === true) opts.beautify = { indent_size: 2 }; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + this._metaOpts = getMetaSchemaOptions(); + + if (opts.formats) addInitialFormats(); + addDraft4MetaSchema(); + if (opts.v5) v5.enable(this); + if (typeof opts.meta == 'object') addMetaSchema(opts.meta); + addInitialSchemas(); + + + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = _addSchema(schemaKeyRef); + v = schemaObj.validate || _compile(schemaObj); + } + + var valid = v(data); + if (v.$async === true) + return self._opts.async == '*' ? co(valid) : valid; + self.errors = v.errors; + return valid; + } + + + /** + * Create validating function for passed schema. + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ + function compile(schema, _meta) { + var schemaObj = _addSchema(schema, undefined, _meta); + return schemaObj.validate || _compile(schemaObj); + } + + + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + */ + function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + function errorsText(errors, options) { + errors = errors || self.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|\:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +function regex(str) { + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + + +function compareDate(d1, d2) { + if (!(d1 && d2)) return; + if (d1 > d2) return 1; + if (d1 < d2) return -1; + if (d1 === d2) return 0; +} + + +function compareTime(t1, t2) { + if (!(t1 && t2)) return; + t1 = t1.match(TIME); + t2 = t2.match(TIME); + if (!(t1 && t2)) return; + t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); + t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); + if (t1 > t2) return 1; + if (t1 < t2) return -1; + if (t1 === t2) return 0; +} + + +function compareDateTime(dt1, dt2) { + if (!(dt1 && dt2)) return; + dt1 = dt1.split(DATE_TIME_SEPARATOR); + dt2 = dt2.split(DATE_TIME_SEPARATOR); + var res = compareDate(dt1[0], dt2[0]); + if (res === undefined) return; + return res || compareTime(dt1[1], dt2[1]); +} diff --git a/deploy/core/node_modules/ajv/lib/compile/index.js b/deploy/core/node_modules/ajv/lib/compile/index.js new file mode 100644 index 000000000..c9c6730f8 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/compile/index.js @@ -0,0 +1,390 @@ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , stableStringify = require('json-stable-stringify') + , async = require('../async'); + +var beautify; + +function loadBeautify(){ + if (beautify === undefined) { + var name = 'js-beautify'; + try { beautify = require(name).js_beautify; } + catch(e) { beautify = false; } + } +} + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var co = require('co'); +var ucs2length = util.ucs2length; +var equal = require('./equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = require('./validation_error'); + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = [] + , keepSourceCode = opts.sourceCode !== false; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (keepSourceCode) cv.sourceCode = v.sourceCode; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + function callValidate() { + var validate = compilation.validate; + var result = validate.apply(null, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + if ($async && !opts.transpile) async.setup(opts); + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.beautify) { + loadBeautify(); + /* istanbul ignore else */ + if (beautify) sourceCode = beautify(sourceCode, opts.beautify); + else console.error('"npm install js-beautify" to use beautify option'); + } + // console.log('\n\n\n *** \n', sourceCode); + var validate, validateCode + , transpile = opts._transpileFunc; + try { + validateCode = $async && transpile + ? transpile(sourceCode) + : sourceCode; + + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'co', + 'equal', + 'ucs2length', + 'ValidationError', + validateCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + co, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + console.error('Error compiling schema, function code:', validateCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (keepSourceCode) validate.sourceCode = sourceCode; + if (opts.sourceCode === true) { + validate.source = { + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (!v) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v) { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + var validateSchema = rule.definition.validateSchema; + if (validateSchema && self._opts.validateSchema !== false) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') console.error(message); + else throw new Error(message); + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + } + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; diff --git a/deploy/core/node_modules/ajv/lib/compile/util.js b/deploy/core/node_modules/ajv/lib/compile/util.js new file mode 100644 index 000000000..8451f83ae --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/compile/util.js @@ -0,0 +1,257 @@ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + cleanUpVarErrors: cleanUpVarErrors, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + stableStringify: require('json-stable-stringify'), + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i' + , $notOp = $isMax ? '>' : '<'; +}} + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + var exclusive{{=$lvl}}; + if (typeof {{=$schemaValueExcl}} != 'boolean' && typeof {{=$schemaValueExcl}} != 'undefined') { + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_exclusiveLimit' }} + } else if({{# def.$dataNotType:'number' }} + ((exclusive{{=$lvl}} = {{=$schemaValueExcl}} === true) + ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}}) + || {{=$data}} !== {{=$data}}) { + var op{{=$lvl}} = exclusive{{=$lvl}} ? '{{=$op}}' : '{{=$op}}='; +{{??}} + {{ + var $exclusive = $schemaExcl === true + , $opStr = $op; /*used in error*/ + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + if ({{# def.$dataNotType:'number' }} + {{=$data}} {{=$notOp}}{{?$exclusive}}={{?}} {{=$schemaValue}} + || {{=$data}} !== {{=$data}}) { +{{?}} + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limit' }} + } {{? $breakOnError }} else { {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/_limitItems.jst b/deploy/core/node_modules/ajv/lib/dot/_limitItems.jst new file mode 100644 index 000000000..a3e078e51 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/_limitItems.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitItems' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/_limitLength.jst b/deploy/core/node_modules/ajv/lib/dot/_limitLength.jst new file mode 100644 index 000000000..cfc8dbb01 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/_limitLength.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitLength' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/_limitProperties.jst b/deploy/core/node_modules/ajv/lib/dot/_limitProperties.jst new file mode 100644 index 000000000..da7ea776f --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/_limitProperties.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitProperties' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/allOf.jst b/deploy/core/node_modules/ajv/lib/dot/allOf.jst new file mode 100644 index 000000000..4c2836311 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/allOf.jst @@ -0,0 +1,34 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $allSchemasEmpty = true; +}} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{# def.ifResultValid }} + {{?}} +{{~}} + +{{? $breakOnError }} + {{? $allSchemasEmpty }} + if (true) { + {{??}} + {{= $closingBraces.slice(0,-1) }} + {{?}} +{{?}} + +{{# def.cleanUp }} diff --git a/deploy/core/node_modules/ajv/lib/dot/anyOf.jst b/deploy/core/node_modules/ajv/lib/dot/anyOf.jst new file mode 100644 index 000000000..93c3cd828 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/anyOf.jst @@ -0,0 +1,48 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $noEmptySchema = $schema.every(function($sch) { + return {{# def.nonEmptySchema:$sch }}; + }); +}} +{{? $noEmptySchema }} + {{ var $currentBaseId = $it.baseId; }} + var {{=$errs}} = errors; + var {{=$valid}} = false; + + {{# def.setCompositeRule }} + + {{~ $schema:$sch:$i }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{=$valid}} = {{=$valid}} || {{=$nextValid}}; + + if (!{{=$valid}}) { + {{ $closingBraces += '}'; }} + {{~}} + + {{# def.resetCompositeRule }} + + {{= $closingBraces }} + + if (!{{=$valid}}) { + {{# def.addError:'anyOf' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} + + {{# def.cleanUp }} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/coerce.def b/deploy/core/node_modules/ajv/lib/dot/coerce.def new file mode 100644 index 000000000..86e0e18af --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/coerce.def @@ -0,0 +1,61 @@ +{{## def.coerceType: + {{ + var $dataType = 'dataType' + $lvl + , $coerced = 'coerced' + $lvl; + }} + var {{=$dataType}} = typeof {{=$data}}; + {{? it.opts.coerceTypes == 'array'}} + if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array'; + {{?}} + + var {{=$coerced}} = undefined; + + {{ var $bracesCoercion = ''; }} + {{~ $coerceToTypes:$type:$i }} + {{? $i }} + if ({{=$coerced}} === undefined) { + {{ $bracesCoercion += '}'; }} + {{?}} + + {{? it.opts.coerceTypes == 'array' && $type != 'array' }} + if ({{=$dataType}} == 'array' && {{=$data}}.length == 1) { + {{=$coerced}} = {{=$data}} = {{=$data}}[0]; + {{=$dataType}} = typeof {{=$data}}; + /*if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array';*/ + } + {{?}} + + {{? $type == 'string' }} + if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') + {{=$coerced}} = '' + {{=$data}}; + else if ({{=$data}} === null) {{=$coerced}} = ''; + {{?? $type == 'number' || $type == 'integer' }} + if ({{=$dataType}} == 'boolean' || {{=$data}} === null + || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} + {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) + {{=$coerced}} = +{{=$data}}; + {{?? $type == 'boolean' }} + if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) + {{=$coerced}} = false; + else if ({{=$data}} === 'true' || {{=$data}} === 1) + {{=$coerced}} = true; + {{?? $type == 'null' }} + if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) + {{=$coerced}} = null; + {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} + if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) + {{=$coerced}} = [{{=$data}}]; + {{?}} + {{~}} + + {{= $bracesCoercion }} + + if ({{=$coerced}} === undefined) { + {{# def.error:'type' }} + } else { + {{# def.setParentData }} + {{=$data}} = {{=$coerced}}; + {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} + {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; + } +#}} diff --git a/deploy/core/node_modules/ajv/lib/dot/custom.jst b/deploy/core/node_modules/ajv/lib/dot/custom.jst new file mode 100644 index 000000000..e91c50e6f --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/custom.jst @@ -0,0 +1,184 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $rule = this + , $definition = 'definition' + $lvl + , $rDef = $rule.definition; + var $validate = $rDef.validate; + var $compile, $inline, $macro, $ruleValidate, $validateCode; +}} + +{{? $isData && $rDef.$data }} + {{ + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + }} + var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition; + var {{=$validateCode}} = {{=$definition}}.validate; +{{??}} + {{ + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + }} +{{?}} + +{{ + var $ruleErrs = $validateCode + '.errors' + , $i = 'i' + $lvl + , $ruleErr = 'ruleErr' + $lvl + , $asyncKeyword = $rDef.async; + + if ($asyncKeyword && !it.async) + throw new Error('async keyword in sync schema'); +}} + + +{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} +var {{=$errs}} = errors; +var {{=$valid}}; + +{{## def.callRuleValidate: + {{=$validateCode}}.call( + {{? it.opts.passContext }}this{{??}}self{{?}} + {{? $compile || $rDef.schema === false }} + , {{=$data}} + {{??}} + , {{=$schemaValue}} + , {{=$data}} + , validate.schema{{=it.schemaPath}} + {{?}} + , {{# def.dataPath }} + {{# def.passParentData }} + , rootData + ) +#}} + +{{## def.extendErrors:_inline: + for (var {{=$i}}={{=$errs}}; {{=$i}} {{=$i}}) { + {{ + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + } + + {{# def.ifResultValid }} + {{?}} + {{~}} + + {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }} + {{ + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{= $schema.length }}) { + {{# def.validateItems: $schema.length }} + } + + {{# def.ifResultValid }} + {{?}} + +{{?? {{# def.nonEmptySchema:$schema }} }} + {{ /* 'items' is a single schema */}} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + {{# def.validateItems: 0 }} + {{# def.ifResultValid }} +{{?}} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/deploy/core/node_modules/ajv/lib/dot/missing.def b/deploy/core/node_modules/ajv/lib/dot/missing.def new file mode 100644 index 000000000..23ad04cf4 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/missing.def @@ -0,0 +1,34 @@ +{{## def.checkMissingProperty:_properties: + {{~ _properties:_$property:$i }} + {{?$i}} || {{?}} + {{ var $prop = it.util.getProperty(_$property); }} + ( {{=$data}}{{=$prop}} === undefined && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop) }}) ) + {{~}} +#}} + + +{{## def.errorMissingProperty:_error: + {{ + var $propertyPath = 'missing' + $lvl + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers + ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) + : $currentErrorPath + ' + ' + $propertyPath; + } + }} + {{# def.error:_error }} +#}} + +{{## def.allErrorsMissingProperty:_error: + {{ + var $prop = it.util.getProperty($reqProperty) + , $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + }} + if ({{=$data}}{{=$prop}} === undefined) { + {{# def.addError:_error }} + } +#}} diff --git a/deploy/core/node_modules/ajv/lib/dot/multipleOf.jst b/deploy/core/node_modules/ajv/lib/dot/multipleOf.jst new file mode 100644 index 000000000..5f8dd33b5 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/multipleOf.jst @@ -0,0 +1,20 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +var division{{=$lvl}}; +if ({{?$isData}} + {{=$schemaValue}} !== undefined && ( + typeof {{=$schemaValue}} != 'number' || + {{?}} + (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, + {{? it.opts.multipleOfPrecision }} + Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} + {{??}} + division{{=$lvl}} !== parseInt(division{{=$lvl}}) + {{?}} + ) + {{?$isData}} ) {{?}} ) { + {{# def.error:'multipleOf' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/not.jst b/deploy/core/node_modules/ajv/lib/dot/not.jst new file mode 100644 index 000000000..e03185ae8 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/not.jst @@ -0,0 +1,43 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$errs}} = errors; + + {{# def.setCompositeRule }} + + {{ + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + }} + {{= it.validate($it) }} + {{ + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + }} + + {{# def.resetCompositeRule }} + + if ({{=$nextValid}}) { + {{# def.error:'not' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{# def.addError:'not' }} + {{? $breakOnError}} + if (false) { + {{?}} +{{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/oneOf.jst b/deploy/core/node_modules/ajv/lib/dot/oneOf.jst new file mode 100644 index 000000000..b7f7bff07 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/oneOf.jst @@ -0,0 +1,44 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +var {{=$errs}} = errors; +var prevValid{{=$lvl}} = false; +var {{=$valid}} = false; + +{{ var $currentBaseId = $it.baseId; }} +{{# def.setCompositeRule }} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + {{??}} + var {{=$nextValid}} = true; + {{?}} + + {{? $i }} + if ({{=$nextValid}} && prevValid{{=$lvl}}) + {{=$valid}} = false; + else { + {{ $closingBraces += '}'; }} + {{?}} + + if ({{=$nextValid}}) {{=$valid}} = prevValid{{=$lvl}} = true; +{{~}} + +{{# def.resetCompositeRule }} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{# def.error:'oneOf' }} +} else { + {{# def.resetErrors }} +{{? it.opts.allErrors }} } {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/pattern.jst b/deploy/core/node_modules/ajv/lib/dot/pattern.jst new file mode 100644 index 000000000..3a37ef6cb --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/pattern.jst @@ -0,0 +1,14 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $regexp = $isData + ? '(new RegExp(' + $schemaValue + '))' + : it.usePattern($schema); +}} + +if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) { + {{# def.error:'pattern' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/properties.jst b/deploy/core/node_modules/ajv/lib/dot/properties.jst new file mode 100644 index 000000000..3a4b966ff --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/properties.jst @@ -0,0 +1,319 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateAdditional: + {{ /* additionalProperties is schema */ + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty + ? it.errorPath + : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} +#}} + + +{{ + var $key = 'key' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt; + + var $schemaKeys = Object.keys($schema || {}) + , $pProperties = it.schema.patternProperties || {} + , $pPropertyKeys = Object.keys($pProperties) + , $aProperties = it.schema.additionalProperties + , $someProperties = $schemaKeys.length || $pPropertyKeys.length + , $noAdditional = $aProperties === false + , $additionalIsSchema = typeof $aProperties == 'object' + && Object.keys($aProperties).length + , $removeAdditional = it.opts.removeAdditional + , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + + var $required = it.schema.required; + if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) + var $requiredHash = it.util.toHash($required); + + if (it.opts.v5) { + var $pgProperties = it.schema.patternGroups || {} + , $pgPropertyKeys = Object.keys($pgProperties); + } +}} + + +var {{=$errs}} = errors; +var {{=$nextValid}} = true; + +{{? $checkAdditional }} + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + {{? $someProperties }} + var isAdditional{{=$lvl}} = !(false + {{? $schemaKeys.length }} + {{? $schemaKeys.length > 5 }} + || validate.schema{{=$schemaPath}}[{{=$key}}] + {{??}} + {{~ $schemaKeys:$propertyKey }} + || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} + {{~}} + {{?}} + {{?}} + {{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty:$i }} + || {{= it.usePattern($pProperty) }}.test({{=$key}}) + {{~}} + {{?}} + {{? it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length }} + {{~ $pgPropertyKeys:$pgProperty:$i }} + || {{= it.usePattern($pgProperty) }}.test({{=$key}}) + {{~}} + {{?}} + ); + + if (isAdditional{{=$lvl}}) { + {{?}} + {{? $removeAdditional == 'all' }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{ + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + }} + {{? $noAdditional }} + {{? $removeAdditional }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{=$nextValid}} = false; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + }} + {{# def.error:'additionalProperties' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{? $breakOnError }} break; {{?}} + {{?}} + {{?? $additionalIsSchema }} + {{? $removeAdditional == 'failing' }} + var {{=$errs}} = errors; + {{# def.setCompositeRule }} + + {{# def.validateAdditional }} + + if (!{{=$nextValid}}) { + errors = {{=$errs}}; + if (validate.errors !== null) { + if (errors) validate.errors.length = errors; + else validate.errors = null; + } + delete {{=$data}}[{{=$key}}]; + } + + {{# def.resetCompositeRule }} + {{??}} + {{# def.validateAdditional }} + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + {{?}} + {{?}} + {{ it.errorPath = $currentErrorPath; }} + {{?}} + {{? $someProperties }} + } + {{?}} + } + + {{# def.ifResultValid }} +{{?}} + +{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }} + +{{? $schemaKeys.length }} + {{~ $schemaKeys:$propertyKey }} + {{ var $sch = $schema[$propertyKey]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + var $prop = it.util.getProperty($propertyKey) + , $passData = $data + $prop + , $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + }} + + {{# def.generateSubschemaCode }} + + {{? {{# def.willOptimize }} }} + {{ + $code = {{# def._optimizeValidate }}; + var $useData = $passData; + }} + {{??}} + {{ var $useData = $nextData; }} + var {{=$nextData}} = {{=$passData}}; + {{?}} + + {{? $hasDefault }} + {{= $code }} + {{??}} + {{? $requiredHash && $requiredHash[$propertyKey] }} + if ({{=$useData}} === undefined) { + {{=$nextValid}} = false; + {{ + var $currentErrorPath = it.errorPath + , $currErrSchemaPath = $errSchemaPath + , $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + }} + {{# def.error:'required' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{ it.errorPath = $currentErrorPath; }} + } else { + {{??}} + {{? $breakOnError }} + if ({{=$useData}} === undefined) { + {{=$nextValid}} = true; + } else { + {{??}} + if ({{=$useData}} !== undefined) { + {{?}} + {{?}} + + {{= $code }} + } + {{?}} {{ /* $hasDefault */ }} + {{?}} {{ /* def.nonEmptySchema */ }} + + {{# def.ifResultValid }} + {{~}} +{{?}} + +{{~ $pPropertyKeys:$pProperty }} + {{ var $sch = $pProperties[$pProperty]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + + it.util.escapeFragment($pProperty); + }} + + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + if ({{= it.usePattern($pProperty) }}.test({{=$key}})) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + {{?}} {{ /* def.nonEmptySchema */ }} +{{~}} + + +{{? it.opts.v5 }} + {{~ $pgPropertyKeys:$pgProperty }} + {{ + var $pgSchema = $pgProperties[$pgProperty] + , $sch = $pgSchema.schema; + }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + + it.util.escapeFragment($pgProperty) + + '/schema'; + }} + + var pgPropCount{{=$lvl}} = 0; + + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + if ({{= it.usePattern($pgProperty) }}.test({{=$key}})) { + pgPropCount{{=$lvl}}++; + + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + + {{ + var $pgMin = $pgSchema.minimum + , $pgMax = $pgSchema.maximum; + }} + {{? $pgMin !== undefined || $pgMax !== undefined }} + var {{=$valid}} = true; + + {{ var $currErrSchemaPath = $errSchemaPath; }} + + {{? $pgMin !== undefined }} + {{ var $limit = $pgMin, $reason = 'minimum', $moreOrLess = 'less'; }} + {{=$valid}} = pgPropCount{{=$lvl}} >= {{=$pgMin}}; + {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; }} + {{# def.checkError:'patternGroups' }} + {{? $pgMax !== undefined }} + else + {{?}} + {{?}} + + {{? $pgMax !== undefined }} + {{ var $limit = $pgMax, $reason = 'maximum', $moreOrLess = 'more'; }} + {{=$valid}} = pgPropCount{{=$lvl}} <= {{=$pgMax}}; + {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; }} + {{# def.checkError:'patternGroups' }} + {{?}} + + {{ $errSchemaPath = $currErrSchemaPath; }} + + {{# def.ifValid }} + {{?}} + {{?}} {{ /* def.nonEmptySchema */ }} + {{~}} +{{?}} + + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/deploy/core/node_modules/ajv/lib/dot/ref.jst b/deploy/core/node_modules/ajv/lib/dot/ref.jst new file mode 100644 index 000000000..e8cdc4435 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/ref.jst @@ -0,0 +1,86 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{## def._validateRef:_v: + {{? it.opts.passContext }} + {{=_v}}.call(this, + {{??}} + {{=_v}}( + {{?}} + {{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData) +#}} + +{{ var $async, $refCode; }} +{{? $schema == '#' || $schema == '#/' }} + {{ + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + }} +{{??}} + {{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }} + {{? $refVal === undefined }} + {{ var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; }} + {{? it.opts.missingRefs == 'fail' }} + {{ console.log($message); }} + {{# def.error:'$ref' }} + {{? $breakOnError }} if (false) { {{?}} + {{?? it.opts.missingRefs == 'ignore' }} + {{ console.log($message); }} + {{? $breakOnError }} if (true) { {{?}} + {{??}} + {{ + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + }} + {{?}} + {{?? $refVal.inline }} + {{# def.setupNextLevel }} + {{ + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + }} + {{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }} + {{= $code }} + {{? $breakOnError}} + if ({{=$nextValid}}) { + {{?}} + {{??}} + {{ + $async = $refVal.$async === true; + $refCode = $refVal.code; + }} + {{?}} +{{?}} + +{{? $refCode }} + {{# def.beginDefOut}} + {{# def._validateRef:$refCode }} + {{# def.storeDefOut:__callValidate }} + + {{? $async }} + {{ if (!it.async) throw new Error('async schema referenced by sync schema'); }} + try { {{? $breakOnError }}var {{=$valid}} ={{?}} {{=it.yieldAwait}} {{=__callValidate}}; } + catch (e) { + if (!(e instanceof ValidationError)) throw e; + if (vErrors === null) vErrors = e.errors; + else vErrors = vErrors.concat(e.errors); + errors = vErrors.length; + } + {{? $breakOnError }} if ({{=$valid}}) { {{?}} + {{??}} + if (!{{=__callValidate}}) { + if (vErrors === null) vErrors = {{=$refCode}}.errors; + else vErrors = vErrors.concat({{=$refCode}}.errors); + errors = vErrors.length; + } {{? $breakOnError }} else { {{?}} + {{?}} +{{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/required.jst b/deploy/core/node_modules/ajv/lib/dot/required.jst new file mode 100644 index 000000000..e109568f3 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/required.jst @@ -0,0 +1,96 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.missing }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $vSchema = 'schema' + $lvl; }} + +{{## def.setupLoop: + {{? !$isData }} + var {{=$vSchema}} = validate.schema{{=$schemaPath}}; + {{?}} + + {{ + var $i = 'i' + $lvl + , $propertyPath = 'schema' + $lvl + '[' + $i + ']' + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + }} +#}} + + +{{? !$isData }} + {{? $schema.length < it.opts.loopRequired && + it.schema.properties && Object.keys(it.schema.properties).length }} + {{ var $required = []; }} + {{~ $schema:$property }} + {{ var $propertySch = it.schema.properties[$property]; }} + {{? !($propertySch && {{# def.nonEmptySchema:$propertySch}}) }} + {{ $required[$required.length] = $property; }} + {{?}} + {{~}} + {{??}} + {{ var $required = $schema; }} + {{?}} +{{?}} + + +{{? $isData || $required.length }} + {{ + var $currentErrorPath = it.errorPath + , $loopRequired = $isData || $required.length >= it.opts.loopRequired; + }} + + {{? $breakOnError }} + var missing{{=$lvl}}; + {{? $loopRequired }} + {{# def.setupLoop }} + var {{=$valid}} = true; + + {{?$isData}}{{# def.check$dataIsArray }}{{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined; + if (!{{=$valid}}) break; + } + + {{? $isData }} } {{?}} + + {{# def.checkError:'required' }} + else { + {{??}} + if ({{# def.checkMissingProperty:$required }}) { + {{# def.errorMissingProperty:'required' }} + } else { + {{?}} + {{??}} + {{? $loopRequired }} + {{# def.setupLoop }} + {{? $isData }} + if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) { + {{# def.addError:'required' }} + } else if ({{=$vSchema}} !== undefined) { + {{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined) { + {{# def.addError:'required' }} + } + } + + {{? $isData }} } {{?}} + {{??}} + {{~ $required:$reqProperty }} + {{# def.allErrorsMissingProperty:'required' }} + {{~}} + {{?}} + {{?}} + + {{ it.errorPath = $currentErrorPath; }} + +{{?? $breakOnError }} + if (true) { +{{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/uniqueItems.jst b/deploy/core/node_modules/ajv/lib/dot/uniqueItems.jst new file mode 100644 index 000000000..dfc42b03b --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/uniqueItems.jst @@ -0,0 +1,38 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + + +{{? ($schema || $isData) && it.opts.uniqueItems !== false }} + {{? $isData }} + var {{=$valid}}; + if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined) + {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'boolean') + {{=$valid}} = false; + else { + {{?}} + + var {{=$valid}} = true; + if ({{=$data}}.length > 1) { + var i = {{=$data}}.length, j; + outer: + for (;i--;) { + for (j = i; j--;) { + if (equal({{=$data}}[i], {{=$data}}[j])) { + {{=$valid}} = false; + break outer; + } + } + } + } + + {{? $isData }} } {{?}} + + if (!{{=$valid}}) { + {{# def.error:'uniqueItems' }} + } {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} if (true) { {{?}} +{{?}} diff --git a/deploy/core/node_modules/ajv/lib/dot/v5/_formatLimit.jst b/deploy/core/node_modules/ajv/lib/dot/v5/_formatLimit.jst new file mode 100644 index 000000000..af16b88d8 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/v5/_formatLimit.jst @@ -0,0 +1,116 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +var {{=$valid}} = undefined; + +{{## def.skipFormatLimit: + {{=$valid}} = true; + {{ return out; }} +#}} + +{{## def.compareFormat: + {{? $isData }} + if ({{=$schemaValue}} === undefined) {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'string') {{=$valid}} = false; + else { + {{ $closingBraces += '}'; }} + {{?}} + + {{? $isDataFormat }} + if (!{{=$compare}}) {{=$valid}} = true; + else { + {{ $closingBraces += '}'; }} + {{?}} + + var {{=$result}} = {{=$compare}}({{=$data}}, {{# def.schemaValueQS }}); + + if ({{=$result}} === undefined) {{=$valid}} = false; +#}} + + +{{? it.opts.format === false }}{{# def.skipFormatLimit }}{{?}} + +{{ + var $schemaFormat = it.schema.format + , $isDataFormat = it.opts.v5 && $schemaFormat.$data + , $closingBraces = ''; +}} + +{{? $isDataFormat }} + {{ + var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr) + , $format = 'format' + $lvl + , $compare = 'compare' + $lvl; + }} + + var {{=$format}} = formats[{{=$schemaValueFormat}}] + , {{=$compare}} = {{=$format}} && {{=$format}}.compare; +{{??}} + {{ var $format = it.formats[$schemaFormat]; }} + {{? !($format && $format.compare) }} + {{# def.skipFormatLimit }} + {{?}} + {{ var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; }} +{{?}} + +{{ + var $isMax = $keyword == 'formatMaximum' + , $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum') + , $schemaExcl = it.schema[$exclusiveKeyword] + , $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data + , $op = $isMax ? '<' : '>' + , $result = 'result' + $lvl; +}} + +{{# def.$data }} + + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + if (typeof {{=$schemaValueExcl}} != 'boolean' && {{=$schemaValueExcl}} !== undefined) { + {{=$valid}} = false; + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_formatExclusiveLimit' }} + } + + {{# def.elseIfValid }} + + {{# def.compareFormat }} + var {{=$exclusive}} = {{=$schemaValueExcl}} === true; + + if ({{=$valid}} === undefined) { + {{=$valid}} = {{=$exclusive}} + ? {{=$result}} {{=$op}} 0 + : {{=$result}} {{=$op}}= 0; + } + + if (!{{=$valid}}) var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; +{{??}} + {{ + var $exclusive = $schemaExcl === true + , $opStr = $op; /*used in error*/ + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + {{# def.compareFormat }} + + if ({{=$valid}} === undefined) + {{=$valid}} = {{=$result}} {{=$op}}{{?!$exclusive}}={{?}} 0; +{{?}} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_formatLimit' }} +} diff --git a/deploy/core/node_modules/ajv/lib/dot/v5/constant.jst b/deploy/core/node_modules/ajv/lib/dot/v5/constant.jst new file mode 100644 index 000000000..67969c1b9 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/v5/constant.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{? !$isData }} + var schema{{=$lvl}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}}); +{{# def.checkError:'constant' }} diff --git a/deploy/core/node_modules/ajv/lib/dot/v5/patternRequired.jst b/deploy/core/node_modules/ajv/lib/dot/v5/patternRequired.jst new file mode 100644 index 000000000..9af2cdc9d --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/v5/patternRequired.jst @@ -0,0 +1,28 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{ + var $key = 'key' + $lvl + , $matched = 'patternMatched' + $lvl + , $closingBraces = '' + , $ownProperties = it.opts.ownProperties; +}} + +var {{=$valid}} = true; +{{~ $schema:$pProperty }} + var {{=$matched}} = false; + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + {{=$matched}} = {{= it.usePattern($pProperty) }}.test({{=$key}}); + if ({{=$matched}}) break; + } + + {{ var $missingPattern = it.util.escapeQuotes($pProperty); }} + if (!{{=$matched}}) { + {{=$valid}} = false; + {{# def.addError:'patternRequired' }} + } {{# def.elseIfValid }} +{{~}} + +{{= $closingBraces }} diff --git a/deploy/core/node_modules/ajv/lib/dot/v5/switch.jst b/deploy/core/node_modules/ajv/lib/dot/v5/switch.jst new file mode 100644 index 000000000..389678e34 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/v5/switch.jst @@ -0,0 +1,73 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateIf: + {{# def.setCompositeRule }} + {{ $it.createErrors = false; }} + {{# def._validateSwitchRule:if }} + {{ $it.createErrors = true; }} + {{# def.resetCompositeRule }} + {{=$ifPassed}} = {{=$nextValid}}; +#}} + +{{## def.validateThen: + {{? typeof $sch.then == 'boolean' }} + {{? $sch.then === false }} + {{# def.error:'switch' }} + {{?}} + var {{=$nextValid}} = {{= $sch.then }}; + {{??}} + {{# def._validateSwitchRule:then }} + {{?}} +#}} + +{{## def._validateSwitchRule:_clause: + {{ + $it.schema = $sch._clause; + $it.schemaPath = $schemaPath + '[' + $caseIndex + ']._clause'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/_clause'; + }} + {{# def.insertSubschemaCode }} +#}} + +{{## def.switchCase: + {{? $sch.if && {{# def.nonEmptySchema:$sch.if }} }} + var {{=$errs}} = errors; + {{# def.validateIf }} + if ({{=$ifPassed}}) { + {{# def.validateThen }} + } else { + {{# def.resetErrors }} + } + {{??}} + {{=$ifPassed}} = true; + {{# def.validateThen }} + {{?}} +#}} + + +{{ + var $ifPassed = 'ifPassed' + it.level + , $currentBaseId = $it.baseId + , $shouldContinue; +}} +var {{=$ifPassed}}; + +{{~ $schema:$sch:$caseIndex }} + {{? $caseIndex && !$shouldContinue }} + if (!{{=$ifPassed}}) { + {{ $closingBraces+= '}'; }} + {{?}} + + {{# def.switchCase }} + {{ $shouldContinue = $sch.continue }} +{{~}} + +{{= $closingBraces }} + +var {{=$valid}} = {{=$nextValid}}; + +{{# def.cleanUp }} diff --git a/deploy/core/node_modules/ajv/lib/dot/validate.jst b/deploy/core/node_modules/ajv/lib/dot/validate.jst new file mode 100644 index 000000000..f216864a0 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dot/validate.jst @@ -0,0 +1,210 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.defaults }} +{{# def.coerce }} + +{{ /** + * schema compilation (render) time: + * it = { schema, RULES, _validate, opts } + * it.validate - this template function, + * it is used recursively to generate code for subschemas + * + * runtime: + * "validate" is a variable name to which this function will be assigned + * validateRef etc. are defined in the parent scope in index.js + */ }} + +{{ var $async = it.schema.$async === true; }} + +{{? it.isTop}} + {{ + var $top = it.isTop + , $lvl = it.level = 0 + , $dataLvl = it.dataLevel = 0 + , $data = 'data'; + it.rootId = it.resolve.fullPath(it.root.schema.id); + it.baseId = it.baseId || it.rootId; + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + delete it.isTop; + + it.dataPathArr = [undefined]; + }} + + var validate = + {{? $async }} + {{? $es7 }} + (async function + {{??}} + {{? it.opts.async == 'co*'}}co.wrap{{?}}(function* + {{?}} + {{??}} + (function + {{?}} + (data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; {{ /* don't edit, used in replace */ }} + var errors = 0; {{ /* don't edit, used in replace */ }} + if (rootData === undefined) rootData = data; +{{??}} + {{ + var $lvl = it.level + , $dataLvl = it.dataLevel + , $data = 'data' + ($dataLvl || ''); + + if (it.schema.id) it.baseId = it.resolve.url(it.baseId, it.schema.id); + + if ($async && !it.async) throw new Error('async schema in sync schema'); + }} + + var errs_{{=$lvl}} = errors; +{{?}} + +{{ + var $valid = 'valid' + $lvl + , $breakOnError = !it.opts.allErrors + , $closingBraces1 = '' + , $closingBraces2 = ''; + + var $errorKeyword; + var $typeSchema = it.schema.type + , $typeIsArray = Array.isArray($typeSchema); +}} + +{{## def.checkType: + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type' + , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + }} + + if ({{= it.util[$method]($typeSchema, $data, true) }}) { +#}} + +{{? $typeSchema && it.opts.coerceTypes }} + {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} + {{? $coerceToTypes }} + {{# def.checkType }} + {{# def.coerceType }} + } + {{?}} +{{?}} + +{{ var $refKeywords; }} +{{? it.schema.$ref && ($refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref')) }} + {{? it.opts.extendRefs == 'fail' }} + {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '"'); }} + {{?? it.opts.extendRefs == 'ignore' }} + {{ + $refKeywords = false; + console.log('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + }} + {{?? it.opts.extendRefs !== true }} + {{ console.log('$ref: all keywords used in schema at path "' + it.errSchemaPath + '". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour'); }} + {{?}} +{{?}} + +{{? it.schema.$ref && !$refKeywords }} + {{= it.RULES.all.$ref.code(it, '$ref') }} + {{? $breakOnError }} + } + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} +{{??}} + {{~ it.RULES:$rulesGroup }} + {{? $shouldUseGroup($rulesGroup) }} + {{? $rulesGroup.type }} + if ({{= it.util.checkDataType($rulesGroup.type, $data) }}) { + {{?}} + {{? it.opts.useDefaults && !it.compositeRule }} + {{? $rulesGroup.type == 'object' && it.schema.properties }} + {{# def.defaultProperties }} + {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} + {{# def.defaultItems }} + {{?}} + {{?}} + {{~ $rulesGroup.rules:$rule }} + {{? $shouldUseRule($rule) }} + {{= $rule.code(it, $rule.keyword) }} + {{? $breakOnError }} + {{ $closingBraces1 += '}'; }} + {{?}} + {{?}} + {{~}} + {{? $breakOnError }} + {{= $closingBraces1 }} + {{ $closingBraces1 = ''; }} + {{?}} + {{? $rulesGroup.type }} + } + {{? $typeSchema && $typeSchema === $rulesGroup.type }} + {{ var $typeChecked = true; }} + else { + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.error:'type' }} + } + {{?}} + {{?}} + + {{? $breakOnError }} + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} + {{?}} + {{~}} +{{?}} + +{{? $typeSchema && !$typeChecked && !(it.opts.coerceTypes && $coerceToTypes) }} + {{# def.checkType }} + {{# def.error:'type' }} + } +{{?}} + +{{? $breakOnError }} {{= $closingBraces2 }} {{?}} + +{{? $top }} + {{? $async }} + if (errors === 0) return true; {{ /* don't edit, used in replace */ }} + else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} + {{??}} + validate.errors = vErrors; {{ /* don't edit, used in replace */ }} + return errors === 0; {{ /* don't edit, used in replace */ }} + {{?}} + }); + + return validate; +{{??}} + var {{=$valid}} = errors === errs_{{=$lvl}}; +{{?}} + +{{# def.cleanUp }} + +{{? $top && $breakOnError }} + {{# def.cleanUpVarErrors }} +{{?}} + +{{ + function $shouldUseGroup($rulesGroup) { + for (var i=0; i < $rulesGroup.rules.length; i++) + if ($shouldUseRule($rulesGroup.rules[i])) + return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || + ( $rule.keyword == 'properties' && + ( it.schema.additionalProperties === false || + typeof it.schema.additionalProperties == 'object' + || ( it.schema.patternProperties && + Object.keys(it.schema.patternProperties).length ) + || ( it.opts.v5 && it.schema.patternGroups && + Object.keys(it.schema.patternGroups).length ))); + } +}} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/README.md b/deploy/core/node_modules/ajv/lib/dotjs/README.md new file mode 100644 index 000000000..4d994846c --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/README.md @@ -0,0 +1,3 @@ +These files are compiled dot templates from dot folder. + +Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/deploy/core/node_modules/ajv/lib/dotjs/_formatLimit.js b/deploy/core/node_modules/ajv/lib/dotjs/_formatLimit.js new file mode 100644 index 000000000..996e1f2c2 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/_formatLimit.js @@ -0,0 +1,176 @@ +'use strict'; +module.exports = function generate__formatLimit(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + out += 'var ' + ($valid) + ' = undefined;'; + if (it.opts.format === false) { + out += ' ' + ($valid) + ' = true; '; + return out; + } + var $schemaFormat = it.schema.format, + $isDataFormat = it.opts.v5 && $schemaFormat.$data, + $closingBraces = ''; + if ($isDataFormat) { + var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr), + $format = 'format' + $lvl, + $compare = 'compare' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;'; + } else { + var $format = it.formats[$schemaFormat]; + if (!($format && $format.compare)) { + out += ' ' + ($valid) + ' = true; '; + return out; + } + var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; + } + var $isMax = $keyword == 'formatMaximum', + $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'), + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $result = 'result' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); + if (!$exclusive) { + out += '='; + } + out += ' 0;'; + } + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '}'; + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/_limit.js b/deploy/core/node_modules/ajv/lib/dotjs/_limit.js new file mode 100644 index 000000000..4d92024af --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/_limit.js @@ -0,0 +1,124 @@ +'use strict'; +module.exports = function generate__limit(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<'; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var exclusive' + ($lvl) + '; if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && typeof ' + ($schemaValueExcl) + ' != \'undefined\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ((exclusive' + ($lvl) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ') || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = exclusive' + ($lvl) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp); + if ($exclusive) { + out += '='; + } + out += ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') {'; + } + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/_limitItems.js b/deploy/core/node_modules/ajv/lib/dotjs/_limitItems.js new file mode 100644 index 000000000..6a843627b --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/_limitItems.js @@ -0,0 +1,76 @@ +'use strict'; +module.exports = function generate__limitItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/_limitLength.js b/deploy/core/node_modules/ajv/lib/dotjs/_limitLength.js new file mode 100644 index 000000000..e378104df --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/_limitLength.js @@ -0,0 +1,81 @@ +'use strict'; +module.exports = function generate__limitLength(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/_limitProperties.js b/deploy/core/node_modules/ajv/lib/dotjs/_limitProperties.js new file mode 100644 index 000000000..74c085184 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/_limitProperties.js @@ -0,0 +1,76 @@ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/allOf.js b/deploy/core/node_modules/ajv/lib/dotjs/allOf.js new file mode 100644 index 000000000..0063ecf1a --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/allOf.js @@ -0,0 +1,43 @@ +'use strict'; +module.exports = function generate_allOf(it, $keyword) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/anyOf.js b/deploy/core/node_modules/ajv/lib/dotjs/anyOf.js new file mode 100644 index 000000000..c95f8ff9a --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/anyOf.js @@ -0,0 +1,65 @@ +'use strict'; +module.exports = function generate_anyOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return it.util.schemaHasRules($sch, it.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/constant.js b/deploy/core/node_modules/ajv/lib/dotjs/constant.js new file mode 100644 index 000000000..2a3e147ff --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/constant.js @@ -0,0 +1,52 @@ +'use strict'; +module.exports = function generate_constant(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('constant') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/custom.js b/deploy/core/node_modules/ajv/lib/dotjs/custom.js new file mode 100644 index 000000000..cbd481ccf --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/custom.js @@ -0,0 +1,220 @@ +'use strict'; +module.exports = function generate_custom(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($validateSchema) { + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') {'; + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += '' + (it.yieldAwait); + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + if ($validateSchema) { + out += ' }'; + } + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/multipleOf.js b/deploy/core/node_modules/ajv/lib/dotjs/multipleOf.js new file mode 100644 index 000000000..d0e43daa3 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/multipleOf.js @@ -0,0 +1,76 @@ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/not.js b/deploy/core/node_modules/ajv/lib/dotjs/not.js new file mode 100644 index 000000000..2cb2a4765 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/not.js @@ -0,0 +1,83 @@ +'use strict'; +module.exports = function generate_not(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/oneOf.js b/deploy/core/node_modules/ajv/lib/dotjs/oneOf.js new file mode 100644 index 000000000..39f60e620 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/oneOf.js @@ -0,0 +1,76 @@ +'use strict'; +module.exports = function generate_oneOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; + var $currentBaseId = $it.baseId; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/pattern.js b/deploy/core/node_modules/ajv/lib/dotjs/pattern.js new file mode 100644 index 000000000..5518152a8 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/pattern.js @@ -0,0 +1,74 @@ +'use strict'; +module.exports = function generate_pattern(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/patternRequired.js b/deploy/core/node_modules/ajv/lib/dotjs/patternRequired.js new file mode 100644 index 000000000..07bf31d29 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/patternRequired.js @@ -0,0 +1,51 @@ +'use strict'; +module.exports = function generate_patternRequired(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $key = 'key' + $lvl, + $matched = 'patternMatched' + $lvl, + $closingBraces = '', + $ownProperties = it.opts.ownProperties; + out += 'var ' + ($valid) + ' = true;'; + var arr1 = $schema; + if (arr1) { + var $pProperty, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $pProperty = arr1[i1 += 1]; + out += ' var ' + ($matched) + ' = false; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; + var $missingPattern = it.util.escapeQuotes($pProperty); + out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + } + out += '' + ($closingBraces); + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/properties.js b/deploy/core/node_modules/ajv/lib/dotjs/properties.js new file mode 100644 index 000000000..32eafce6a --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/properties.js @@ -0,0 +1,445 @@ +'use strict'; +module.exports = function generate_properties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt; + var $schemaKeys = Object.keys($schema || {}), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); + if (it.opts.v5) { + var $pgProperties = it.schema.patternGroups || {}, + $pgPropertyKeys = Object.keys($pgProperties); + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($checkAdditional) { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 5) { + out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + if (it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length) { + var arr3 = $pgPropertyKeys; + if (arr3) { + var $pgProperty, $i = -1, + l3 = arr3.length - 1; + while ($i < l3) { + $pgProperty = arr3[$i += 1]; + out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have additional properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr4 = $schemaKeys; + if (arr4) { + var $propertyKey, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $propertyKey = arr4[i4 += 1]; + var $sch = $schema[$propertyKey]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + var arr5 = $pPropertyKeys; + if (arr5) { + var $pProperty, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $pProperty = arr5[i5 += 1]; + var $sch = $pProperties[$pProperty]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (it.opts.v5) { + var arr6 = $pgPropertyKeys; + if (arr6) { + var $pgProperty, i6 = -1, + l6 = arr6.length - 1; + while (i6 < l6) { + $pgProperty = arr6[i6 += 1]; + var $pgSchema = $pgProperties[$pgProperty], + $sch = $pgSchema.schema; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; + out += ' var pgPropCount' + ($lvl) + ' = 0; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + var $pgMin = $pgSchema.minimum, + $pgMax = $pgSchema.maximum; + if ($pgMin !== undefined || $pgMax !== undefined) { + out += ' var ' + ($valid) + ' = true; '; + var $currErrSchemaPath = $errSchemaPath; + if ($pgMin !== undefined) { + var $limit = $pgMin, + $reason = 'minimum', + $moreOrLess = 'less'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($pgMax !== undefined) { + out += ' else '; + } + } + if ($pgMax !== undefined) { + var $limit = $pgMax, + $reason = 'maximum', + $moreOrLess = 'more'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/ref.js b/deploy/core/node_modules/ajv/lib/dotjs/ref.js new file mode 100644 index 000000000..e07c70c3b --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/ref.js @@ -0,0 +1,119 @@ +'use strict'; +module.exports = function generate_ref(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $async, $refCode; + if ($schema == '#' || $schema == '#/') { + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + } else { + var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); + if ($refVal === undefined) { + var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; + if (it.opts.missingRefs == 'fail') { + console.log($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; + } + if (it.opts.verbose) { + out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + if ($breakOnError) { + out += ' if (false) { '; + } + } else if (it.opts.missingRefs == 'ignore') { + console.log($message); + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + } + } else if ($refVal.inline) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); + out += ' ' + ($code) + ' '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + } + } else { + $async = $refVal.$async === true; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + if (it.opts.passContext) { + out += ' ' + ($refCode) + '.call(this, '; + } else { + out += ' ' + ($refCode) + '( '; + } + out += ' ' + ($data) + ', (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it.async) throw new Error('async schema referenced by sync schema'); + out += ' try { '; + if ($breakOnError) { + out += 'var ' + ($valid) + ' ='; + } + out += ' ' + (it.yieldAwait) + ' ' + (__callValidate) + '; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + } + } else { + out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' else { '; + } + } + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/required.js b/deploy/core/node_modules/ajv/lib/dotjs/required.js new file mode 100644 index 000000000..eb32aeae5 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/required.js @@ -0,0 +1,249 @@ +'use strict'; +module.exports = function generate_required(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $vSchema = 'schema' + $lvl; + if (!$isData) { + if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { + var $required = []; + var arr1 = $schema; + if (arr1) { + var $property, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $property = arr1[i1 += 1]; + var $propertySch = it.schema.properties[$property]; + if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var _$property, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + _$property = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty(_$property); + out += ' ( ' + ($data) + ($prop) + ' === undefined && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $reqProperty, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $reqProperty = arr3[i3 += 1]; + var $prop = it.util.getProperty($reqProperty), + $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + out += ' if (' + ($data) + ($prop) + ' === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/switch.js b/deploy/core/node_modules/ajv/lib/dotjs/switch.js new file mode 100644 index 000000000..18f17e487 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/switch.js @@ -0,0 +1,128 @@ +'use strict'; +module.exports = function generate_switch(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $ifPassed = 'ifPassed' + it.level, + $currentBaseId = $it.baseId, + $shouldContinue; + out += 'var ' + ($ifPassed) + ';'; + var arr1 = $schema; + if (arr1) { + var $sch, $caseIndex = -1, + l1 = arr1.length - 1; + while ($caseIndex < l1) { + $sch = arr1[$caseIndex += 1]; + if ($caseIndex && !$shouldContinue) { + out += ' if (!' + ($ifPassed) + ') { '; + $closingBraces += '}'; + } + if ($sch.if && it.util.schemaHasRules($sch.if, it.RULES.all)) { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + $it.schema = $sch.if; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; + } else { + out += ' ' + ($ifPassed) + ' = true; '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + } + $shouldContinue = $sch.continue + } + } + out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + '; '; + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/uniqueItems.js b/deploy/core/node_modules/ajv/lib/dotjs/uniqueItems.js new file mode 100644 index 000000000..2f27b0eea --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/uniqueItems.js @@ -0,0 +1,71 @@ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/dotjs/validate.js b/deploy/core/node_modules/ajv/lib/dotjs/validate.js new file mode 100644 index 000000000..961e33b55 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/dotjs/validate.js @@ -0,0 +1,375 @@ +'use strict'; +module.exports = function generate_validate(it, $keyword) { + var out = ''; + var $async = it.schema.$async === true; + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.root.schema.id); + it.baseId = it.baseId || it.rootId; + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + delete it.isTop; + it.dataPathArr = [undefined]; + out += ' var validate = '; + if ($async) { + if ($es7) { + out += ' (async function '; + } else { + if (it.opts.async == 'co*') { + out += 'co.wrap'; + } + out += '(function* '; + } + } else { + out += ' (function '; + } + out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data;'; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if (it.schema.id) it.baseId = it.resolve.url(it.baseId, it.schema.id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + if ($coerceToTypes) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } } '; + } + } + var $refKeywords; + if (it.schema.$ref && ($refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'))) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs == 'ignore') { + $refKeywords = false; + console.log('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs !== true) { + console.log('$ref: all keywords used in schema at path "' + it.errSchemaPath + '". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour'); + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults && !it.compositeRule) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + out += ' ' + ($rule.code(it, $rule.keyword)) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type) { + var $typeChecked = true; + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($typeSchema && !$typeChecked && !(it.opts.coerceTypes && $coerceToTypes)) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return true; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }); return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top && $breakOnError) { + out = it.util.cleanUpVarErrors(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + for (var i = 0; i < $rulesGroup.rules.length; i++) + if ($shouldUseRule($rulesGroup.rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.keyword == 'properties' && (it.schema.additionalProperties === false || typeof it.schema.additionalProperties == 'object' || (it.schema.patternProperties && Object.keys(it.schema.patternProperties).length) || (it.opts.v5 && it.schema.patternGroups && Object.keys(it.schema.patternGroups).length))); + } + return out; +} diff --git a/deploy/core/node_modules/ajv/lib/keyword.js b/deploy/core/node_modules/ajv/lib/keyword.js new file mode 100644 index 000000000..1c9cccfe6 --- /dev/null +++ b/deploy/core/node_modules/ajv/lib/keyword.js @@ -0,0 +1,129 @@ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$\-]*$/i; +var customRuleCode = require('./dotjs/custom'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword +}; + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + if (definition.macro && definition.valid !== undefined) + throw new Error('"valid" option cannot be used with macro keywords'); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + var i, len = dataType.length; + for (i=0; i=4.9.1 <5.0.0", + "_id": "ajv@4.11.6", + "_inCache": true, + "_installable": true, + "_location": "/ajv", + "_nodeVersion": "4.6.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ajv-4.11.6.tgz_1491605796482_0.05123087880201638" + }, + "_npmUser": { + "email": "e.poberezkin@me.com", + "name": "esp" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "name": "ajv", + "raw": "ajv@^4.9.1", + "rawSpec": "^4.9.1", + "scope": null, + "spec": ">=4.9.1 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/har-validator" + ], + "_resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.6.tgz", + "_shasum": "947e93049790942b2a2d60a8289b28924d39f987", + "_shrinkwrap": null, + "_spec": "ajv@^4.9.1", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/har-validator", + "author": { + "name": "Evgeny Poberezkin" + }, + "bugs": { + "url": "https://github.com/epoberezkin/ajv/issues" + }, + "dependencies": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + }, + "description": "Another JSON Schema Validator", + "devDependencies": { + "bluebird": "^3.1.5", + "brfs": "^1.4.3", + "browserify": "^14.1.0", + "chai": "^3.5.0", + "coveralls": "^2.11.4", + "del-cli": "^0.2.1", + "dot": "^1.0.3", + "eslint": "^3.2.2", + "gh-pages-generator": "^0.2.0", + "glob": "^7.0.0", + "if-node-version": "^1.0.0", + "js-beautify": "^1.5.6", + "jshint": "^2.8.0", + "json-schema-test": "^1.1.1", + "karma": "^1.0.0", + "karma-chrome-launcher": "^2.0.0", + "karma-mocha": "^1.1.1", + "karma-phantomjs-launcher": "^1.0.0", + "karma-sauce-launcher": "^1.1.0", + "mocha": "^3.0.0", + "nodent": "^3.0.17", + "nyc": "^10.0.0", + "phantomjs-prebuilt": "^2.1.4", + "pre-commit": "^1.1.1", + "regenerator": "0.9.7", + "require-globify": "^1.3.0", + "typescript": "^2.0.3", + "uglify-js": "^2.6.1", + "watch": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "947e93049790942b2a2d60a8289b28924d39f987", + "tarball": "https://registry.npmjs.org/ajv/-/ajv-4.11.6.tgz" + }, + "files": [ + ".tonic_example.js", + "LICENSE", + "dist/", + "lib/", + "scripts/" + ], + "gitHead": "75653f78b2a7ef338f8a17a51f0c5cdb79e6e5a3", + "homepage": "https://github.com/epoberezkin/ajv", + "keywords": [ + "JSON", + "json-schema", + "json-schema-validation", + "json-schema-validator", + "jsonschema", + "schema", + "validation", + "validator" + ], + "license": "MIT", + "main": "lib/ajv.js", + "maintainers": [ + { + "name": "blakeembrey", + "email": "hello@blakeembrey.com" + }, + { + "name": "esp", + "email": "e.poberezkin@me.com" + } + ], + "name": "ajv", + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/ajv.git" + }, + "scripts": { + "build": "del-cli lib/dotjs/*.js && node scripts/compile-dots.js", + "bundle": "node ./scripts/bundle.js . Ajv pure_getters", + "bundle-all": "del-cli dist && npm run bundle && npm run bundle-regenerator && npm run bundle-nodent", + "bundle-beautify": "node ./scripts/bundle.js js-beautify", + "bundle-nodent": "node ./scripts/bundle.js nodent", + "bundle-regenerator": "node ./scripts/bundle.js regenerator", + "eslint": "if-node-version \">=4\" eslint lib/*.js lib/compile/*.js spec scripts", + "jshint": "jshint lib/*.js lib/**/*.js --exclude lib/dotjs/**/*", + "prepublish": "npm run build && npm run bundle-all", + "test": "npm run jshint && npm run eslint && npm run test-ts && npm run build && npm run test-cov && if-node-version 4 npm run test-browser", + "test-browser": "del-cli .browser && npm run bundle-all && scripts/prepare-tests && npm run test-karma", + "test-cov": "nyc npm run test-spec", + "test-debug": "mocha spec/*.spec.js --debug-brk -R spec", + "test-fast": "AJV_FAST_TEST=true npm run test-spec", + "test-karma": "karma start --single-run --browsers PhantomJS", + "test-spec": "mocha spec/*.spec.js -R spec", + "test-ts": "tsc --target ES5 --noImplicitAny lib/ajv.d.ts", + "watch": "watch 'npm run build' ./lib/dot" + }, + "tonicExampleFilename": ".tonic_example.js", + "typings": "lib/ajv.d.ts", + "version": "4.11.6", + "webpack": "dist/ajv.bundle.js" +} diff --git a/deploy/core/node_modules/ajv/scripts/.eslintrc.yml b/deploy/core/node_modules/ajv/scripts/.eslintrc.yml new file mode 100644 index 000000000..493d7d312 --- /dev/null +++ b/deploy/core/node_modules/ajv/scripts/.eslintrc.yml @@ -0,0 +1,3 @@ +rules: + no-console: 0 + no-empty: [2, allowEmptyCatch: true] diff --git a/deploy/core/node_modules/ajv/scripts/bundle.js b/deploy/core/node_modules/ajv/scripts/bundle.js new file mode 100644 index 000000000..b3a9890c5 --- /dev/null +++ b/deploy/core/node_modules/ajv/scripts/bundle.js @@ -0,0 +1,54 @@ +'use strict'; + +var fs = require('fs') + , path = require('path') + , browserify = require('browserify') + , uglify = require('uglify-js'); + +var pkg = process.argv[2] + , standalone = process.argv[3] + , compress = process.argv[4]; + +var packageDir = path.join(__dirname, '..'); +if (pkg != '.') packageDir = path.join(packageDir, 'node_modules', pkg); + +var json = require(path.join(packageDir, 'package.json')); + +var distDir = path.join(__dirname, '..', 'dist'); +if (!fs.existsSync(distDir)) fs.mkdirSync(distDir); + +var bOpts = {}; +if (standalone) bOpts.standalone = standalone; + +browserify(bOpts) +.require(path.join(packageDir, json.main), {expose: json.name}) +.bundle(function (err, buf) { + if (err) { + console.error('browserify error:', err); + process.exit(1); + } + + var outputFile = path.join(distDir, json.name); + var outputBundle = outputFile + '.bundle.js'; + fs.writeFileSync(outputBundle, buf); + var uglifyOpts = { + warnings: true, + compress: {}, + output: { + preamble: '/* ' + json.name + ' ' + json.version + ': ' + json.description + ' */' + } + }; + if (compress) { + var compressOpts = compress.split(','); + for (var i=0; i /dev/null 2>&1 + } +fi diff --git a/deploy/core/node_modules/asn1/.npmignore b/deploy/core/node_modules/asn1/.npmignore new file mode 100644 index 000000000..eb03e3e1e --- /dev/null +++ b/deploy/core/node_modules/asn1/.npmignore @@ -0,0 +1,2 @@ +node_modules +*.log diff --git a/deploy/core/node_modules/asn1/.travis.yml b/deploy/core/node_modules/asn1/.travis.yml new file mode 100644 index 000000000..09d3ef378 --- /dev/null +++ b/deploy/core/node_modules/asn1/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.10 diff --git a/deploy/core/node_modules/asn1/LICENSE b/deploy/core/node_modules/asn1/LICENSE new file mode 100644 index 000000000..9b5dcdb7f --- /dev/null +++ b/deploy/core/node_modules/asn1/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Mark Cavage, All rights reserved. + +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 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 diff --git a/deploy/core/node_modules/asn1/README.md b/deploy/core/node_modules/asn1/README.md new file mode 100644 index 000000000..7cebf7a2e --- /dev/null +++ b/deploy/core/node_modules/asn1/README.md @@ -0,0 +1,50 @@ +node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS. +Currently BER encoding is supported; at some point I'll likely have to do DER. + +## Usage + +Mostly, if you're *actually* needing to read and write ASN.1, you probably don't +need this readme to explain what and why. If you have no idea what ASN.1 is, +see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +The source is pretty much self-explanatory, and has read/write methods for the +common types out there. + +### Decoding + +The following reads an ASN.1 sequence with a boolean. + + var Ber = require('asn1').Ber; + + var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff])); + + reader.readSequence(); + console.log('Sequence len: ' + reader.length); + if (reader.peek() === Ber.Boolean) + console.log(reader.readBoolean()); + +### Encoding + +The following generates the same payload as above. + + var Ber = require('asn1').Ber; + + var writer = new Ber.Writer(); + + writer.startSequence(); + writer.writeBoolean(true); + writer.endSequence(); + + console.log(writer.buffer); + +## Installation + + npm install asn1 + +## License + +MIT. + +## Bugs + +See . diff --git a/deploy/core/node_modules/asn1/lib/ber/errors.js b/deploy/core/node_modules/asn1/lib/ber/errors.js new file mode 100644 index 000000000..ff21d4fab --- /dev/null +++ b/deploy/core/node_modules/asn1/lib/ber/errors.js @@ -0,0 +1,13 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + + newInvalidAsn1Error: function(msg) { + var e = new Error(); + e.name = 'InvalidAsn1Error'; + e.message = msg || ''; + return e; + } + +}; diff --git a/deploy/core/node_modules/asn1/lib/ber/index.js b/deploy/core/node_modules/asn1/lib/ber/index.js new file mode 100644 index 000000000..4fb90aea9 --- /dev/null +++ b/deploy/core/node_modules/asn1/lib/ber/index.js @@ -0,0 +1,27 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var errors = require('./errors'); +var types = require('./types'); + +var Reader = require('./reader'); +var Writer = require('./writer'); + + +///--- Exports + +module.exports = { + + Reader: Reader, + + Writer: Writer + +}; + +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} diff --git a/deploy/core/node_modules/asn1/lib/ber/reader.js b/deploy/core/node_modules/asn1/lib/ber/reader.js new file mode 100644 index 000000000..0a00e98e3 --- /dev/null +++ b/deploy/core/node_modules/asn1/lib/ber/reader.js @@ -0,0 +1,261 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); + +var ASN1 = require('./types'); +var errors = require('./errors'); + + +///--- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + + + +///--- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + + this._buf = data; + this._size = data.length; + + // These hold the "current" state + this._len = 0; + this._offset = 0; +} + +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); + +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); + + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function(peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; + + +Reader.prototype.peek = function() { + return this.readByte(true); +}; + + +/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */ +Reader.prototype.readLength = function(offset) { + if (offset === undefined) + offset = this._offset; + + if (offset >= this._size) + return null; + + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; + + if ((lenB & 0x80) == 0x80) { + lenB &= 0x7f; + + if (lenB == 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; + + +/** + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. + */ +Reader.prototype.readSequence = function(tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + this._offset = o; + return seq; +}; + + +Reader.prototype.readInt = function() { + return this._readTag(ASN1.Integer); +}; + + +Reader.prototype.readBoolean = function() { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; + + +Reader.prototype.readEnumeration = function() { + return this._readTag(ASN1.Enumeration); +}; + + +Reader.prototype.readString = function(tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; + + var b = this.peek(); + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + + if (o === null) + return null; + + if (this.length > this._size - o) + return null; + + this._offset = o; + + if (this.length === 0) + return retbuf ? new Buffer(0) : ''; + + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; + + return retbuf ? str : str.toString('utf8'); +}; + +Reader.prototype.readOID = function(tag) { + if (!tag) + tag = ASN1.OID; + + var b = this.readString(tag, true); + if (b === null) + return null; + + var values = []; + var value = 0; + + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) == 0) { + values.push(value); + value = 0; + } + } + + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); + + return values.join('.'); +}; + + +Reader.prototype._readTag = function(tag) { + assert.ok(tag !== undefined); + + var b = this.peek(); + + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); + + if (this.length > this._size - o) + return null; + this._offset = o; + + var fb = this._buf[this._offset]; + var value = 0; + + for (var i = 0; i < this.length; i++) { + value <<= 8; + value |= (this._buf[this._offset++] & 0xff); + } + + if ((fb & 0x80) == 0x80 && i !== 4) + value -= (1 << (i * 8)); + + return value >> 0; +}; + + + +///--- Exported API + +module.exports = Reader; diff --git a/deploy/core/node_modules/asn1/lib/ber/types.js b/deploy/core/node_modules/asn1/lib/ber/types.js new file mode 100644 index 000000000..8aea00013 --- /dev/null +++ b/deploy/core/node_modules/asn1/lib/ber/types.js @@ -0,0 +1,36 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + EOC: 0, + Boolean: 1, + Integer: 2, + BitString: 3, + OctetString: 4, + Null: 5, + OID: 6, + ObjectDescriptor: 7, + External: 8, + Real: 9, // float + Enumeration: 10, + PDV: 11, + Utf8String: 12, + RelativeOID: 13, + Sequence: 16, + Set: 17, + NumericString: 18, + PrintableString: 19, + T61String: 20, + VideotexString: 21, + IA5String: 22, + UTCTime: 23, + GeneralizedTime: 24, + GraphicString: 25, + VisibleString: 26, + GeneralString: 28, + UniversalString: 29, + CharacterString: 30, + BMPString: 31, + Constructor: 32, + Context: 128 +}; diff --git a/deploy/core/node_modules/asn1/lib/ber/writer.js b/deploy/core/node_modules/asn1/lib/ber/writer.js new file mode 100644 index 000000000..d9d99af68 --- /dev/null +++ b/deploy/core/node_modules/asn1/lib/ber/writer.js @@ -0,0 +1,316 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var ASN1 = require('./types'); +var errors = require('./errors'); + + +///--- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + +var DEFAULT_OPTS = { + size: 1024, + growthFactor: 8 +}; + + +///--- Helpers + +function merge(from, to) { + assert.ok(from); + assert.equal(typeof(from), 'object'); + assert.ok(to); + assert.equal(typeof(to), 'object'); + + var keys = Object.getOwnPropertyNames(from); + keys.forEach(function(key) { + if (to[key]) + return; + + var value = Object.getOwnPropertyDescriptor(from, key); + Object.defineProperty(to, key, value); + }); + + return to; +} + + + +///--- API + +function Writer(options) { + options = merge(DEFAULT_OPTS, options || {}); + + this._buf = new Buffer(options.size || 1024); + this._size = this._buf.length; + this._offset = 0; + this._options = options; + + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw new InvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); + } +}); + +Writer.prototype.writeByte = function(b) { + if (typeof(b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; +}; + + +Writer.prototype.writeInt = function(i, tag) { + if (typeof(i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof(tag) !== 'number') + tag = ASN1.Integer; + + var sz = 4; + + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; + } + + if (sz > 4) + throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff'); + + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; + + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; + } + +}; + + +Writer.prototype.writeNull = function() { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; + + +Writer.prototype.writeEnumeration = function(i, tag) { + if (typeof(i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof(tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function(b, tag) { + if (typeof(b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof(tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function(s, tag) { + if (typeof(s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof(s) + ')'); + if (typeof(tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; + } +}; + + +Writer.prototype.writeBuffer = function(buf, tag) { + if (typeof(tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); + + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; + + +Writer.prototype.writeStringArray = function(strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function(s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function(s, tag) { + if (typeof(s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof(tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else { + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } + } + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function(b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function(b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function(len) { + if (typeof(len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else { + throw new InvalidAsn1ERror('Length too long (> 4 bytes)'); + } +}; + +Writer.prototype.startSequence = function(tag) { + if (typeof(tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function() { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; + } else { + throw new InvalidAsn1Error('Sequence too long'); + } +}; + + +Writer.prototype._shift = function(start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function(len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = new Buffer(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; + } +}; + + + +///--- Exported API + +module.exports = Writer; diff --git a/deploy/core/node_modules/asn1/lib/index.js b/deploy/core/node_modules/asn1/lib/index.js new file mode 100644 index 000000000..d1766e7a6 --- /dev/null +++ b/deploy/core/node_modules/asn1/lib/index.js @@ -0,0 +1,20 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +var Ber = require('./ber/index'); + + + +///--- Exported API + +module.exports = { + + Ber: Ber, + + BerReader: Ber.Reader, + + BerWriter: Ber.Writer + +}; diff --git a/deploy/core/node_modules/asn1/package.json b/deploy/core/node_modules/asn1/package.json new file mode 100644 index 000000000..e6f185b3e --- /dev/null +++ b/deploy/core/node_modules/asn1/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "asn1@~0.2.3", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/sshpk" + ] + ], + "_from": "asn1@>=0.2.3 <0.3.0", + "_id": "asn1@0.2.3", + "_inCache": true, + "_installable": true, + "_location": "/asn1", + "_npmUser": { + "email": "patrick.f.mooney@gmail.com", + "name": "pfmooney" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "name": "asn1", + "raw": "asn1@~0.2.3", + "rawSpec": "~0.2.3", + "scope": null, + "spec": ">=0.2.3 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", + "_shrinkwrap": null, + "_spec": "asn1@~0.2.3", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/sshpk", + "author": { + "email": "mcavage@gmail.com", + "name": "Mark Cavage" + }, + "bugs": { + "url": "https://github.com/mcavage/node-asn1/issues" + }, + "contributors": [ + { + "name": "David Gwynne", + "email": "loki@animata.net" + }, + { + "name": "Yunong Xiao", + "email": "yunong@joyent.com" + }, + { + "name": "Alex Wilson", + "email": "alex.wilson@joyent.com" + } + ], + "dependencies": {}, + "description": "Contains parsers and serializers for ASN.1 (currently BER only)", + "devDependencies": { + "tap": "0.4.8" + }, + "directories": {}, + "dist": { + "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", + "tarball": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + }, + "homepage": "https://github.com/mcavage/node-asn1", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "mcavage", + "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "name": "asn1", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mcavage/node-asn1.git" + }, + "scripts": { + "test": "tap ./tst" + }, + "version": "0.2.3" +} diff --git a/deploy/core/node_modules/asn1/tst/ber/reader.test.js b/deploy/core/node_modules/asn1/tst/ber/reader.test.js new file mode 100644 index 000000000..062fd7ee3 --- /dev/null +++ b/deploy/core/node_modules/asn1/tst/ber/reader.test.js @@ -0,0 +1,208 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var test = require('tap').test; + + + +///--- Globals + +var BerReader; + + + +///--- Tests + +test('load library', function(t) { + BerReader = require('../../lib/index').BerReader; + t.ok(BerReader); + try { + new BerReader(); + t.fail('Should have thrown'); + } catch (e) { + t.ok(e instanceof TypeError, 'Should have been a type error'); + } + t.end(); +}); + + +test('read byte', function(t) { + var reader = new BerReader(new Buffer([0xde])); + t.ok(reader); + t.equal(reader.readByte(), 0xde, 'wrong value'); + t.end(); +}); + + +test('read 1 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x01, 0x03])); + t.ok(reader); + t.equal(reader.readInt(), 0x03, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read 2 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde])); + t.ok(reader); + t.equal(reader.readInt(), 0x7ede, 'wrong value'); + t.equal(reader.length, 0x02, 'wrong length'); + t.end(); +}); + + +test('read 3 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03])); + t.ok(reader); + t.equal(reader.readInt(), 0x7ede03, 'wrong value'); + t.equal(reader.length, 0x03, 'wrong length'); + t.end(); +}); + + +test('read 4 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01])); + t.ok(reader); + t.equal(reader.readInt(), 0x7ede0301, 'wrong value'); + t.equal(reader.length, 0x04, 'wrong length'); + t.end(); +}); + + +test('read 1 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x01, 0xdc])); + t.ok(reader); + t.equal(reader.readInt(), -36, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read 2 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x02, 0xc0, 0x4e])); + t.ok(reader); + t.equal(reader.readInt(), -16306, 'wrong value'); + t.equal(reader.length, 0x02, 'wrong length'); + t.end(); +}); + + +test('read 3 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x03, 0xff, 0x00, 0x19])); + t.ok(reader); + t.equal(reader.readInt(), -65511, 'wrong value'); + t.equal(reader.length, 0x03, 'wrong length'); + t.end(); +}); + + +test('read 4 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x04, 0x91, 0x7c, 0x22, 0x1f])); + t.ok(reader); + t.equal(reader.readInt(), -1854135777, 'wrong value'); + t.equal(reader.length, 0x04, 'wrong length'); + t.end(); +}); + + +test('read boolean true', function(t) { + var reader = new BerReader(new Buffer([0x01, 0x01, 0xff])); + t.ok(reader); + t.equal(reader.readBoolean(), true, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read boolean false', function(t) { + var reader = new BerReader(new Buffer([0x01, 0x01, 0x00])); + t.ok(reader); + t.equal(reader.readBoolean(), false, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read enumeration', function(t) { + var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20])); + t.ok(reader); + t.equal(reader.readEnumeration(), 0x20, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read string', function(t) { + var dn = 'cn=foo,ou=unit,o=test'; + var buf = new Buffer(dn.length + 2); + buf[0] = 0x04; + buf[1] = Buffer.byteLength(dn); + buf.write(dn, 2); + var reader = new BerReader(buf); + t.ok(reader); + t.equal(reader.readString(), dn, 'wrong value'); + t.equal(reader.length, dn.length, 'wrong length'); + t.end(); +}); + + +test('read sequence', function(t) { + var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff])); + t.ok(reader); + t.equal(reader.readSequence(), 0x30, 'wrong value'); + t.equal(reader.length, 0x03, 'wrong length'); + t.equal(reader.readBoolean(), true, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('anonymous LDAPv3 bind', function(t) { + var BIND = new Buffer(14); + BIND[0] = 0x30; // Sequence + BIND[1] = 12; // len + BIND[2] = 0x02; // ASN.1 Integer + BIND[3] = 1; // len + BIND[4] = 0x04; // msgid (make up 4) + BIND[5] = 0x60; // Bind Request + BIND[6] = 7; // len + BIND[7] = 0x02; // ASN.1 Integer + BIND[8] = 1; // len + BIND[9] = 0x03; // v3 + BIND[10] = 0x04; // String (bind dn) + BIND[11] = 0; // len + BIND[12] = 0x80; // ContextSpecific (choice) + BIND[13] = 0; // simple bind + + // Start testing ^^ + var ber = new BerReader(BIND); + t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence'); + t.equal(ber.length, 12, 'Message length should be 12'); + t.equal(ber.readInt(), 4, 'Message id should have been 4'); + t.equal(ber.readSequence(), 96, 'Bind Request should have been 96'); + t.equal(ber.length, 7, 'Bind length should have been 7'); + t.equal(ber.readInt(), 3, 'LDAP version should have been 3'); + t.equal(ber.readString(), '', 'Bind DN should have been empty'); + t.equal(ber.length, 0, 'string length should have been 0'); + t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)'); + t.equal(ber.readByte(), 0, 'Should have been simple bind'); + t.equal(null, ber.readByte(), 'Should be out of data'); + t.end(); +}); + + +test('long string', function(t) { + var buf = new Buffer(256); + var o; + var s = + '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' + + 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' + + 'Teena Vradmin\'s description.'; + buf[0] = 0x04; + buf[1] = 0x81; + buf[2] = 0x94; + buf.write(s, 3); + var ber = new BerReader(buf.slice(0, 3 + s.length)); + t.equal(ber.readString(), s); + t.end(); +}); diff --git a/deploy/core/node_modules/asn1/tst/ber/writer.test.js b/deploy/core/node_modules/asn1/tst/ber/writer.test.js new file mode 100644 index 000000000..d87cb7bc9 --- /dev/null +++ b/deploy/core/node_modules/asn1/tst/ber/writer.test.js @@ -0,0 +1,370 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var test = require('tap').test; +var sys = require('sys'); + +///--- Globals + +var BerWriter; + +var BerReader; + + +///--- Tests + +test('load library', function(t) { + BerWriter = require('../../lib/index').BerWriter; + t.ok(BerWriter); + t.ok(new BerWriter()); + t.end(); +}); + + +test('write byte', function(t) { + var writer = new BerWriter(); + + writer.writeByte(0xC2); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 1, 'Wrong length'); + t.equal(ber[0], 0xC2, 'value wrong'); + + t.end(); +}); + + +test('write 1 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7f); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]); + t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]); + t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]); + + t.end(); +}); + + +test('write 2 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7ffe); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 4, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x02, 'length wrong'); + t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); + t.equal(ber[3], 0xfe, 'value wrong (byte 2)'); + + t.end(); +}); + + +test('write 3 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7ffffe); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 5, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x03, 'length wrong'); + t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); + t.equal(ber[3], 0xff, 'value wrong (byte 2)'); + t.equal(ber[4], 0xfe, 'value wrong (byte 3)'); + + t.end(); +}); + + +test('write 4 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7ffffffe); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 6, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x04, 'length wrong'); + t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); + t.equal(ber[3], 0xff, 'value wrong (byte 2)'); + t.equal(ber[4], 0xff, 'value wrong (byte 3)'); + t.equal(ber[5], 0xfe, 'value wrong (byte 4)'); + + t.end(); +}); + + +test('write 1 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-128); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 3, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x01, 'length wrong'); + t.equal(ber[2], 0x80, 'value wrong (byte 1)'); + + t.end(); +}); + + +test('write 2 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-22400); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 4, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x02, 'length wrong'); + t.equal(ber[2], 0xa8, 'value wrong (byte 1)'); + t.equal(ber[3], 0x80, 'value wrong (byte 2)'); + + t.end(); +}); + + +test('write 3 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-481653); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 5, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x03, 'length wrong'); + t.equal(ber[2], 0xf8, 'value wrong (byte 1)'); + t.equal(ber[3], 0xa6, 'value wrong (byte 2)'); + t.equal(ber[4], 0x8b, 'value wrong (byte 3)'); + + t.end(); +}); + + +test('write 4 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-1522904131); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 6, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x04, 'length wrong'); + t.equal(ber[2], 0xa5, 'value wrong (byte 1)'); + t.equal(ber[3], 0x3a, 'value wrong (byte 2)'); + t.equal(ber[4], 0x53, 'value wrong (byte 3)'); + t.equal(ber[5], 0xbd, 'value wrong (byte 4)'); + + t.end(); +}); + + +test('write boolean', function(t) { + var writer = new BerWriter(); + + writer.writeBoolean(true); + writer.writeBoolean(false); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 6, 'Wrong length'); + t.equal(ber[0], 0x01, 'tag wrong'); + t.equal(ber[1], 0x01, 'length wrong'); + t.equal(ber[2], 0xff, 'value wrong'); + t.equal(ber[3], 0x01, 'tag wrong'); + t.equal(ber[4], 0x01, 'length wrong'); + t.equal(ber[5], 0x00, 'value wrong'); + + t.end(); +}); + + +test('write string', function(t) { + var writer = new BerWriter(); + writer.writeString('hello world'); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 13, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + +test('write buffer', function(t) { + var writer = new BerWriter(); + // write some stuff to start with + writer.writeString('hello world'); + var ber = writer.buffer; + var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01, + 0xff, 0x01, 0x01, 0xff]); + writer.writeBuffer(buf.slice(2, buf.length), 0x04); + ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 26, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value'); + t.equal(ber[13], buf[0], 'wrong tag'); + t.equal(ber[14], buf[1], 'wrong length'); + for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) { + t.equal(ber[i], buf[j], 'buffer contents not identical'); + } + t.end(); +}); + +test('write string array', function(t) { + var writer = new BerWriter(); + writer.writeStringArray(['hello world', 'fubar!']); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 21, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value'); + + t.equal(ber[13], 0x04, 'wrong tag'); + t.equal(ber[14], 6, 'wrong length'); + t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value'); + + t.end(); +}); + + +test('resize internal buffer', function(t) { + var writer = new BerWriter({size: 2}); + writer.writeString('hello world'); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 13, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + + +test('sequence', function(t) { + var writer = new BerWriter({size: 25}); + writer.startSequence(); + writer.writeString('hello world'); + writer.endSequence(); + var ber = writer.buffer; + + t.ok(ber); + console.log(ber); + t.equal(ber.length, 15, 'wrong length'); + t.equal(ber[0], 0x30, 'wrong tag'); + t.equal(ber[1], 13, 'wrong length'); + t.equal(ber[2], 0x04, 'wrong tag'); + t.equal(ber[3], 11, 'wrong length'); + t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + + +test('nested sequence', function(t) { + var writer = new BerWriter({size: 25}); + writer.startSequence(); + writer.writeString('hello world'); + writer.startSequence(); + writer.writeString('hello world'); + writer.endSequence(); + writer.endSequence(); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 30, 'wrong length'); + t.equal(ber[0], 0x30, 'wrong tag'); + t.equal(ber[1], 28, 'wrong length'); + t.equal(ber[2], 0x04, 'wrong tag'); + t.equal(ber[3], 11, 'wrong length'); + t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value'); + t.equal(ber[15], 0x30, 'wrong tag'); + t.equal(ber[16], 13, 'wrong length'); + t.equal(ber[17], 0x04, 'wrong tag'); + t.equal(ber[18], 11, 'wrong length'); + t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + + +test('LDAP bind message', function(t) { + var dn = 'cn=foo,ou=unit,o=test'; + var writer = new BerWriter(); + writer.startSequence(); + writer.writeInt(3); // msgid = 3 + writer.startSequence(0x60); // ldap bind + writer.writeInt(3); // ldap v3 + writer.writeString(dn); + writer.writeByte(0x80); + writer.writeByte(0x00); + writer.endSequence(); + writer.endSequence(); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 35, 'wrong length (buffer)'); + t.equal(ber[0], 0x30, 'wrong tag'); + t.equal(ber[1], 33, 'wrong length'); + t.equal(ber[2], 0x02, 'wrong tag'); + t.equal(ber[3], 1, 'wrong length'); + t.equal(ber[4], 0x03, 'wrong value'); + t.equal(ber[5], 0x60, 'wrong tag'); + t.equal(ber[6], 28, 'wrong length'); + t.equal(ber[7], 0x02, 'wrong tag'); + t.equal(ber[8], 1, 'wrong length'); + t.equal(ber[9], 0x03, 'wrong value'); + t.equal(ber[10], 0x04, 'wrong tag'); + t.equal(ber[11], dn.length, 'wrong length'); + t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value'); + t.equal(ber[33], 0x80, 'wrong tag'); + t.equal(ber[34], 0x00, 'wrong len'); + + t.end(); +}); + + +test('Write OID', function(t) { + var oid = '1.2.840.113549.1.1.1'; + var writer = new BerWriter(); + writer.writeOID(oid); + + var ber = writer.buffer; + t.ok(ber); + console.log(require('util').inspect(ber)); + console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86, + 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x01]))); + + t.end(); +}); diff --git a/deploy/core/node_modules/assert-plus/AUTHORS b/deploy/core/node_modules/assert-plus/AUTHORS new file mode 100644 index 000000000..1923524fe --- /dev/null +++ b/deploy/core/node_modules/assert-plus/AUTHORS @@ -0,0 +1,6 @@ +Dave Eddy +Fred Kuo +Lars-Magnus Skog +Mark Cavage +Patrick Mooney +Rob Gulewich diff --git a/deploy/core/node_modules/assert-plus/CHANGES.md b/deploy/core/node_modules/assert-plus/CHANGES.md new file mode 100644 index 000000000..d249d9b2a --- /dev/null +++ b/deploy/core/node_modules/assert-plus/CHANGES.md @@ -0,0 +1,8 @@ +# assert-plus Changelog + +## 0.2.0 + +- Fix `assert.object(null)` so it throws +- Fix optional/arrayOf exports for non-type-of asserts +- Add optiona/arrayOf exports for Stream/Date/Regex/uuid +- Add basic unit test coverage diff --git a/deploy/core/node_modules/assert-plus/README.md b/deploy/core/node_modules/assert-plus/README.md new file mode 100644 index 000000000..0b39593ce --- /dev/null +++ b/deploy/core/node_modules/assert-plus/README.md @@ -0,0 +1,155 @@ +# assert-plus + +This library is a super small wrapper over node's assert module that has two +things: (1) the ability to disable assertions with the environment variable +NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like +`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks +like this: + +```javascript + var assert = require('assert-plus'); + + function fooAccount(options, callback) { + assert.object(options, 'options'); + assert.number(options.id, 'options.id'); + assert.bool(options.isManager, 'options.isManager'); + assert.string(options.name, 'options.name'); + assert.arrayOfString(options.email, 'options.email'); + assert.func(callback, 'callback'); + + // Do stuff + callback(null, {}); + } +``` + +# API + +All methods that *aren't* part of node's core assert API are simply assumed to +take an argument, and then a string 'name' that's not a message; `AssertionError` +will be thrown if the assertion fails with a message like: + + AssertionError: foo (string) is required + at test (/home/mark/work/foo/foo.js:3:9) + at Object. (/home/mark/work/foo/foo.js:15:1) + at Module._compile (module.js:446:26) + at Object..js (module.js:464:10) + at Module.load (module.js:353:31) + at Function._load (module.js:311:12) + at Array.0 (module.js:484:10) + at EventEmitter._tickCallback (node.js:190:38) + +from: + +```javascript + function test(foo) { + assert.string(foo, 'foo'); + } +``` + +There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`: + +```javascript + function test(foo) { + assert.arrayOfString(foo, 'foo'); + } +``` + +You can assert IFF an argument is not `undefined` (i.e., an optional arg): + +```javascript + assert.optionalString(foo, 'foo'); +``` + +Lastly, you can opt-out of assertion checking altogether by setting the +environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have +lots of assertions, and don't want to pay `typeof ()` taxes to v8 in +production. Be advised: The standard functions re-exported from `assert` are +also disabled in assert-plus if NDEBUG is specified. Using them directly from +the `assert` module avoids this behavior. + +The complete list of APIs is: + +* assert.array +* assert.bool +* assert.buffer +* assert.func +* assert.number +* assert.object +* assert.string +* assert.stream +* assert.date +* assert.regex +* assert.uuid +* assert.arrayOfArray +* assert.arrayOfBool +* assert.arrayOfBuffer +* assert.arrayOfFunc +* assert.arrayOfNumber +* assert.arrayOfObject +* assert.arrayOfString +* assert.arrayOfStream +* assert.arrayOfDate +* assert.arrayOfUuid +* assert.optionalArray +* assert.optionalBool +* assert.optionalBuffer +* assert.optionalFunc +* assert.optionalNumber +* assert.optionalObject +* assert.optionalString +* assert.optionalStream +* assert.optionalDate +* assert.optionalUuid +* assert.optionalArrayOfArray +* assert.optionalArrayOfBool +* assert.optionalArrayOfBuffer +* assert.optionalArrayOfFunc +* assert.optionalArrayOfNumber +* assert.optionalArrayOfObject +* assert.optionalArrayOfString +* assert.optionalArrayOfStream +* assert.optionalArrayOfDate +* assert.optionalArrayOfUuid +* assert.AssertionError +* assert.fail +* assert.ok +* assert.equal +* assert.notEqual +* assert.deepEqual +* assert.notDeepEqual +* assert.strictEqual +* assert.notStrictEqual +* assert.throws +* assert.doesNotThrow +* assert.ifError + +# Installation + + npm install assert-plus + +## License + +The MIT License (MIT) +Copyright (c) 2012 Mark Cavage + +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 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. + +## Bugs + +See . diff --git a/deploy/core/node_modules/assert-plus/assert.js b/deploy/core/node_modules/assert-plus/assert.js new file mode 100644 index 000000000..6bce4d8c6 --- /dev/null +++ b/deploy/core/node_modules/assert-plus/assert.js @@ -0,0 +1,206 @@ +// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. + +var assert = require('assert'); +var Stream = require('stream').Stream; +var util = require('util'); + + +///--- Globals + +/* JSSTYLED */ +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; + + +///--- Internal + +function _capitalize(str) { + return (str.charAt(0).toUpperCase() + str.slice(1)); +} + +function _toss(name, expected, oper, arg, actual) { + throw new assert.AssertionError({ + message: util.format('%s (%s) is required', name, expected), + actual: (actual === undefined) ? typeof (arg) : actual(arg), + expected: expected, + operator: oper || '===', + stackStartFunction: _toss.caller + }); +} + +function _getClass(arg) { + return (Object.prototype.toString.call(arg).slice(8, -1)); +} + +function noop() { + // Why even bother with asserts? +} + + +///--- Exports + +var types = { + bool: { + check: function (arg) { return typeof (arg) === 'boolean'; } + }, + func: { + check: function (arg) { return typeof (arg) === 'function'; } + }, + string: { + check: function (arg) { return typeof (arg) === 'string'; } + }, + object: { + check: function (arg) { + return typeof (arg) === 'object' && arg !== null; + } + }, + number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); + } + }, + buffer: { + check: function (arg) { return Buffer.isBuffer(arg); }, + operator: 'Buffer.isBuffer' + }, + array: { + check: function (arg) { return Array.isArray(arg); }, + operator: 'Array.isArray' + }, + stream: { + check: function (arg) { return arg instanceof Stream; }, + operator: 'instanceof', + actual: _getClass + }, + date: { + check: function (arg) { return arg instanceof Date; }, + operator: 'instanceof', + actual: _getClass + }, + regexp: { + check: function (arg) { return arg instanceof RegExp; }, + operator: 'instanceof', + actual: _getClass + }, + uuid: { + check: function (arg) { + return typeof (arg) === 'string' && UUID_REGEXP.test(arg); + }, + operator: 'isUUID' + } +}; + +function _setExports(ndebug) { + var keys = Object.keys(types); + var out; + + /* re-export standard assert */ + if (process.env.NODE_NDEBUG) { + out = noop; + } else { + out = function (arg, msg) { + if (!arg) { + _toss(msg, 'true', arg); + } + }; + } + + /* standard checks */ + keys.forEach(function (k) { + if (ndebug) { + out[k] = noop; + return; + } + var type = types[k]; + out[k] = function (arg, msg) { + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* optional checks */ + keys.forEach(function (k) { + var name = 'optional' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* arrayOf checks */ + keys.forEach(function (k) { + var name = 'arrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* optionalArrayOf checks */ + keys.forEach(function (k) { + var name = 'optionalArrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* re-export built-in assertions */ + Object.keys(assert).forEach(function (k) { + if (k === 'AssertionError') { + out[k] = assert[k]; + return; + } + if (ndebug) { + out[k] = noop; + return; + } + out[k] = assert[k]; + }); + + /* export ourselves (for unit tests _only_) */ + out._setExports = _setExports; + + return out; +} + +module.exports = _setExports(process.env.NODE_NDEBUG); diff --git a/deploy/core/node_modules/assert-plus/package.json b/deploy/core/node_modules/assert-plus/package.json new file mode 100644 index 000000000..886274520 --- /dev/null +++ b/deploy/core/node_modules/assert-plus/package.json @@ -0,0 +1,107 @@ +{ + "_args": [ + [ + "assert-plus@^0.2.0", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/http-signature" + ] + ], + "_from": "assert-plus@>=0.2.0 <0.3.0", + "_id": "assert-plus@0.2.0", + "_inCache": true, + "_installable": true, + "_location": "/assert-plus", + "_nodeVersion": "0.10.36", + "_npmUser": { + "email": "patrick.f.mooney@gmail.com", + "name": "pfmooney" + }, + "_npmVersion": "3.3.8", + "_phantomChildren": {}, + "_requested": { + "name": "assert-plus", + "raw": "assert-plus@^0.2.0", + "rawSpec": "^0.2.0", + "scope": null, + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/http-signature" + ], + "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", + "_shrinkwrap": null, + "_spec": "assert-plus@^0.2.0", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/http-signature", + "author": { + "email": "mcavage@gmail.com", + "name": "Mark Cavage" + }, + "bugs": { + "url": "https://github.com/mcavage/node-assert-plus/issues" + }, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Fred Kuo", + "email": "fred.kuo@joyent.com" + }, + { + "name": "Lars-Magnus Skog", + "email": "ralphtheninja@riseup.net" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Patrick Mooney", + "email": "pmooney@pfmooney.com" + }, + { + "name": "Rob Gulewich", + "email": "robert.gulewich@joyent.com" + } + ], + "dependencies": {}, + "description": "Extra assertions on top of node's assert module", + "devDependencies": { + "faucet": "0.0.1", + "tape": "4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", + "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + }, + "engines": { + "node": ">=0.8" + }, + "homepage": "https://github.com/mcavage/node-assert-plus#readme", + "license": "MIT", + "main": "./assert.js", + "maintainers": [ + { + "name": "mcavage", + "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "name": "assert-plus", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mcavage/node-assert-plus.git" + }, + "scripts": { + "test": "tape tests/*.js | ./node_modules/.bin/faucet" + }, + "version": "0.2.0" +} diff --git a/deploy/core/node_modules/asynckit/LICENSE b/deploy/core/node_modules/asynckit/LICENSE new file mode 100644 index 000000000..c9eca5dd9 --- /dev/null +++ b/deploy/core/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +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 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. diff --git a/deploy/core/node_modules/asynckit/README.md b/deploy/core/node_modules/asynckit/README.md new file mode 100644 index 000000000..ddcc7e6b9 --- /dev/null +++ b/deploy/core/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/deploy/core/node_modules/asynckit/bench.js b/deploy/core/node_modules/asynckit/bench.js new file mode 100644 index 000000000..c612f1a55 --- /dev/null +++ b/deploy/core/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/deploy/core/node_modules/asynckit/index.js b/deploy/core/node_modules/asynckit/index.js new file mode 100644 index 000000000..455f9454e --- /dev/null +++ b/deploy/core/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/deploy/core/node_modules/asynckit/lib/abort.js b/deploy/core/node_modules/asynckit/lib/abort.js new file mode 100644 index 000000000..114367e5f --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/deploy/core/node_modules/asynckit/lib/async.js b/deploy/core/node_modules/asynckit/lib/async.js new file mode 100644 index 000000000..7f1288a4c --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/deploy/core/node_modules/asynckit/lib/defer.js b/deploy/core/node_modules/asynckit/lib/defer.js new file mode 100644 index 000000000..b67110c7a --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/deploy/core/node_modules/asynckit/lib/iterate.js b/deploy/core/node_modules/asynckit/lib/iterate.js new file mode 100644 index 000000000..5d2839a59 --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/deploy/core/node_modules/asynckit/lib/readable_asynckit.js b/deploy/core/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 000000000..78ad240f0 --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/deploy/core/node_modules/asynckit/lib/readable_parallel.js b/deploy/core/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 000000000..5d2929f7a --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/deploy/core/node_modules/asynckit/lib/readable_serial.js b/deploy/core/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 000000000..782269820 --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/deploy/core/node_modules/asynckit/lib/readable_serial_ordered.js b/deploy/core/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 000000000..3de89c472 --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/deploy/core/node_modules/asynckit/lib/state.js b/deploy/core/node_modules/asynckit/lib/state.js new file mode 100644 index 000000000..cbea7ad8f --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/deploy/core/node_modules/asynckit/lib/streamify.js b/deploy/core/node_modules/asynckit/lib/streamify.js new file mode 100644 index 000000000..f56a1c92b --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/deploy/core/node_modules/asynckit/lib/terminator.js b/deploy/core/node_modules/asynckit/lib/terminator.js new file mode 100644 index 000000000..d6eb99219 --- /dev/null +++ b/deploy/core/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/deploy/core/node_modules/asynckit/package.json b/deploy/core/node_modules/asynckit/package.json new file mode 100644 index 000000000..ecaa1f32c --- /dev/null +++ b/deploy/core/node_modules/asynckit/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + "asynckit@^0.4.0", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/form-data" + ] + ], + "_from": "asynckit@>=0.4.0 <0.5.0", + "_id": "asynckit@0.4.0", + "_inCache": true, + "_installable": true, + "_location": "/asynckit", + "_nodeVersion": "0.12.11", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/asynckit-0.4.0.tgz_1465928940169_0.8008207362145185" + }, + "_npmUser": { + "email": "iam@alexindigo.com", + "name": "alexindigo" + }, + "_npmVersion": "2.15.6", + "_phantomChildren": {}, + "_requested": { + "name": "asynckit", + "raw": "asynckit@^0.4.0", + "rawSpec": "^0.4.0", + "scope": null, + "spec": ">=0.4.0 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/form-data" + ], + "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "_shrinkwrap": null, + "_spec": "asynckit@^0.4.0", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/form-data", + "author": { + "email": "iam@alexindigo.com", + "name": "Alex Indigo" + }, + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "dependencies": {}, + "description": "Minimal async jobs utility library, with streams support", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "directories": {}, + "dist": { + "shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "tarball": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" + }, + "gitHead": "583a75ed4fe41761b66416bb6e703ebb1f8963bf", + "homepage": "https://github.com/alexindigo/asynckit#readme", + "keywords": [ + "abort", + "array", + "async", + "destroy", + "iterator", + "jobs", + "object", + "parallel", + "serial", + "stream", + "terminate" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "alexindigo", + "email": "iam@alexindigo.com" + } + ], + "name": "asynckit", + "optionalDependencies": {}, + "pre-commit": [ + "browser", + "clean", + "lint", + "report", + "size", + "test" + ], + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "scripts": { + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "clean": "rimraf coverage", + "debug": "tape test/test-*.js", + "lint": "eslint *.js lib/*.js test/*.js", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js" + }, + "version": "0.4.0" +} diff --git a/deploy/core/node_modules/asynckit/parallel.js b/deploy/core/node_modules/asynckit/parallel.js new file mode 100644 index 000000000..3c50344d8 --- /dev/null +++ b/deploy/core/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/deploy/core/node_modules/asynckit/serial.js b/deploy/core/node_modules/asynckit/serial.js new file mode 100644 index 000000000..6cd949a67 --- /dev/null +++ b/deploy/core/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/deploy/core/node_modules/asynckit/serialOrdered.js b/deploy/core/node_modules/asynckit/serialOrdered.js new file mode 100644 index 000000000..607eafea5 --- /dev/null +++ b/deploy/core/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/deploy/core/node_modules/asynckit/stream.js b/deploy/core/node_modules/asynckit/stream.js new file mode 100644 index 000000000..d43465f90 --- /dev/null +++ b/deploy/core/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/deploy/core/node_modules/aws-sign2/LICENSE b/deploy/core/node_modules/aws-sign2/LICENSE new file mode 100644 index 000000000..a4a9aee0c --- /dev/null +++ b/deploy/core/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +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: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +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 + +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 \ No newline at end of file diff --git a/deploy/core/node_modules/aws-sign2/README.md b/deploy/core/node_modules/aws-sign2/README.md new file mode 100644 index 000000000..763564e0a --- /dev/null +++ b/deploy/core/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/deploy/core/node_modules/aws-sign2/index.js b/deploy/core/node_modules/aws-sign2/index.js new file mode 100644 index 000000000..ac7209308 --- /dev/null +++ b/deploy/core/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * 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. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.queryStringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/deploy/core/node_modules/aws-sign2/package.json b/deploy/core/node_modules/aws-sign2/package.json new file mode 100644 index 000000000..acecbad08 --- /dev/null +++ b/deploy/core/node_modules/aws-sign2/package.json @@ -0,0 +1,73 @@ +{ + "_args": [ + [ + "aws-sign2@~0.6.0", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request" + ] + ], + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_id": "aws-sign2@0.6.0", + "_inCache": true, + "_installable": true, + "_location": "/aws-sign2", + "_nodeVersion": "4.1.2", + "_npmUser": { + "email": "mikeal.rogers@gmail.com", + "name": "mikeal" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "aws-sign2", + "raw": "aws-sign2@~0.6.0", + "rawSpec": "~0.6.0", + "scope": null, + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_shrinkwrap": null, + "_spec": "aws-sign2@~0.6.0", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request", + "author": { + "email": "mikeal.rogers@gmail.com", + "name": "Mikeal Rogers", + "url": "http://www.futurealoof.com" + }, + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" + }, + "dependencies": {}, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "engines": { + "node": "*" + }, + "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", + "homepage": "https://github.com/mikeal/aws-sign#readme", + "license": "Apache-2.0", + "main": "index.js", + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + } + ], + "name": "aws-sign2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" + }, + "scripts": {}, + "version": "0.6.0" +} diff --git a/deploy/core/node_modules/aws4/.npmignore b/deploy/core/node_modules/aws4/.npmignore new file mode 100644 index 000000000..6c6ade6ff --- /dev/null +++ b/deploy/core/node_modules/aws4/.npmignore @@ -0,0 +1,4 @@ +test +examples +example.js +browser diff --git a/deploy/core/node_modules/aws4/.tern-port b/deploy/core/node_modules/aws4/.tern-port new file mode 100644 index 000000000..7fd1b5223 --- /dev/null +++ b/deploy/core/node_modules/aws4/.tern-port @@ -0,0 +1 @@ +62638 \ No newline at end of file diff --git a/deploy/core/node_modules/aws4/.travis.yml b/deploy/core/node_modules/aws4/.travis.yml new file mode 100644 index 000000000..61d063404 --- /dev/null +++ b/deploy/core/node_modules/aws4/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4.2" diff --git a/deploy/core/node_modules/aws4/LICENSE b/deploy/core/node_modules/aws4/LICENSE new file mode 100644 index 000000000..4f321e599 --- /dev/null +++ b/deploy/core/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +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 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. diff --git a/deploy/core/node_modules/aws4/README.md b/deploy/core/node_modules/aws4/README.md new file mode 100644 index 000000000..6b002d02f --- /dev/null +++ b/deploy/core/node_modules/aws4/README.md @@ -0,0 +1,523 @@ +aws4 +---- + +[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4) + +A small utility to sign vanilla node.js http(s) request options using Amazon's +[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html). + +Can also be used [in the browser](./browser). + +This signature is supported by nearly all Amazon services, including +[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/), +[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), +[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html), +[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/), +[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html), +[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/), +[SNS](http://docs.aws.amazon.com/sns/latest/api/), +[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/), +[STS](http://docs.aws.amazon.com/STS/latest/APIReference/), +[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/), +[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/), +[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/), +[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/), +[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/), +[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/), +[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/), +[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/), +[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html), +[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html), +[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/), +[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html), +[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/), +[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/), +[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html), +[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/), +[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/), +[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/), +[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/), +[SES](http://docs.aws.amazon.com/ses/latest/APIReference/), +[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/), +[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/), +[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html), +[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/), +[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/), +[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/), +[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html), +[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/), +[Config](http://docs.aws.amazon.com/config/latest/APIReference/), +[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html), +[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and +[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html). + +Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are +[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and +[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var http = require('http'), + https = require('https'), + aws4 = require('aws4') + +// given an options object you could pass to http.request +var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} + +// alternatively (as aws4 can infer the host): +opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} + +// alternatively (as us-east-1 is default): +opts = {service: 'sqs', path: '/?Action=ListQueues'} + +aws4.sign(opts) // assumes AWS credentials are available in process.env + +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS using the standard node.js http API +http.request(opts, function(res) { res.pipe(process.stdout) }).end() +/* + + +... +*/ +``` + +More options +------------ + +```javascript +// you can also pass AWS credentials in explicitly (otherwise taken from process.env) +aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) + +// can also add the signature to query strings +aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) + +// create a utility function to pipe to stdout (with https this time) +function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) +/* + +... +*/ + +// can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// works with all other services that support Signature Version 4 + +request(aws4.sign({service: 's3', path: '/', signQuery: true})) +/* + +... +*/ + +request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) +/* + +... +*/ + +request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) +/* + +... +*/ + +request(aws4.sign({service: 'appstream', path: '/applications'})) +/* +{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... +... +*/ + +request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) +/* +{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} +... +*/ + +request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) +/* +{"NextPageToken":null,"Pipelines":[]} +... +*/ + +request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) +/* +{"Functions":[],"NextMarker":null} +... +*/ + +request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) +/* + +... +*/ + +request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) +/* +{"Marker":null,"VaultList":[]} +... +*/ + +request(aws4.sign({service: 'storagegateway', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' +}})) +/* +{"Gateways":[]} +... +*/ + +request(aws4.sign({service: 'datapipeline', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'DataPipeline.ListPipelines' +}})) +/* +{"hasMoreResults":false,"pipelineIdList":[]} +... +*/ + +request(aws4.sign({service: 'opsworks', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' +}})) +/* +{"Stacks":[]} +... +*/ + +request(aws4.sign({service: 'route53domains', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' +}})) +/* +{"Domains":[]} +... +*/ + +request(aws4.sign({service: 'kinesis', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Kinesis_20131202.ListStreams' +}})) +/* +{"HasMoreStreams":false,"StreamNames":[]} +... +*/ + +request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' +}})) +/* +{"trailList":[]} +... +*/ + +request(aws4.sign({service: 'logs', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' +}})) +/* +{"logGroups":[]} +... +*/ + +request(aws4.sign({service: 'codedeploy', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' +}})) +/* +{"applications":[]} +... +*/ + +request(aws4.sign({service: 'directconnect', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OvertureService.DescribeConnections' +}})) +/* +{"connections":[]} +... +*/ + +request(aws4.sign({service: 'kms', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'TrentService.ListKeys' +}})) +/* +{"Keys":[],"Truncated":false} +... +*/ + +request(aws4.sign({service: 'config', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' +}})) +/* +{"DeliveryChannels":[]} +... +*/ + +request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' +}})) +/* +{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} +... +*/ + +request(aws4.sign({ + service: 'swf', + body: '{"registrationStatus":"REGISTERED"}', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' + } +})) +/* +{"domainInfos":[]} +... +*/ + +request(aws4.sign({ + service: 'cognito-identity', + body: '{"MaxResults": 1}', + headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' + } +})) +/* +{"IdentityPools":[]} +... +*/ + +request(aws4.sign({ + service: 'mobileanalytics', + path: '/2014-06-05/events', + body: JSON.stringify({events:[{ + eventType: 'a', + timestamp: new Date().toISOString(), + session: {}, + }]}), + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Client-Context': JSON.stringify({ + client: {client_id: 'a', app_title: 'a'}, + custom: {}, + env: {platform: 'a'}, + services: {}, + }), + } +})) +/* +(HTTP 202, empty response) +*/ + +// Generate CodeCommit Git access password +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +This calculates and populates the `Authorization` header of +`requestOptions`, and any other necessary AWS headers and/or request +options. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the node.js +[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will be calculated from `hostname` or `host` if not given) +- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_SECRET_ACCESS_KEY="" +export AWS_ACCESS_KEY_ID="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html). + +Installation +------------ + +With [npm](http://npmjs.org/) do: + +``` +npm install aws4 +``` + +Can also be used [in the browser](./browser). + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. + diff --git a/deploy/core/node_modules/aws4/aws4.js b/deploy/core/node_modules/aws4/aws4.js new file mode 100644 index 000000000..0cff0f0ea --- /dev/null +++ b/deploy/core/node_modules/aws4/aws4.js @@ -0,0 +1,332 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('./lru'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = querystring.unescape(piece) + path.push(encodeRfc3986(querystring.escape(piece))) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return querystring.escape(querystring.unescape(piece)) + }).join('/') + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/deploy/core/node_modules/aws4/lru.js b/deploy/core/node_modules/aws4/lru.js new file mode 100644 index 000000000..333f66a44 --- /dev/null +++ b/deploy/core/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/deploy/core/node_modules/aws4/package.json b/deploy/core/node_modules/aws4/package.json new file mode 100644 index 000000000..a3cb60c08 --- /dev/null +++ b/deploy/core/node_modules/aws4/package.json @@ -0,0 +1,132 @@ +{ + "_args": [ + [ + "aws4@^1.2.1", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request" + ] + ], + "_from": "aws4@>=1.2.1 <2.0.0", + "_id": "aws4@1.6.0", + "_inCache": true, + "_installable": true, + "_location": "/aws4", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/aws4-1.6.0.tgz_1486481933920_0.6127187723759562" + }, + "_npmUser": { + "email": "michael.hart.au@gmail.com", + "name": "hichaelmart" + }, + "_npmVersion": "4.0.5", + "_phantomChildren": {}, + "_requested": { + "name": "aws4", + "raw": "aws4@^1.2.1", + "rawSpec": "^1.2.1", + "scope": null, + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "_shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", + "_shrinkwrap": null, + "_spec": "aws4@^1.2.1", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request", + "author": { + "email": "michael.hart.au@gmail.com", + "name": "Michael Hart", + "url": "http://github.com/mhart" + }, + "bugs": { + "url": "https://github.com/mhart/aws4/issues" + }, + "dependencies": {}, + "description": "Signs and prepares requests using AWS Signature Version 4", + "devDependencies": { + "mocha": "^2.4.5", + "should": "^8.2.2" + }, + "directories": {}, + "dist": { + "shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", + "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz" + }, + "gitHead": "74bf0b64d1e8cbcd184964999c7ef53f52d7ad32", + "homepage": "https://github.com/mhart/aws4#readme", + "keywords": [ + "amazon", + "appstream", + "autoscaling", + "aws", + "cloudformation", + "cloudfront", + "cloudhsm", + "cloudsearch", + "cloudtrail", + "cloudwatch", + "codedeploy", + "cognito", + "cognitoidentity", + "cognitosync", + "config", + "containerservice", + "datapipeline", + "directconnect", + "dynamodb", + "ec2", + "ecs", + "elasticache", + "elasticbeanstalk", + "elasticloadbalancing", + "elasticmapreduce", + "elastictranscoder", + "elb", + "emr", + "glacier", + "iam", + "keymanagementservice", + "kinesis", + "kms", + "lambda", + "logs", + "mobileanalytics", + "monitoring", + "opsworks", + "rds", + "redshift", + "route53", + "route53domains", + "s3", + "ses", + "signature", + "sns", + "sqs", + "storagegateway", + "sts", + "swf" + ], + "license": "MIT", + "main": "aws4.js", + "maintainers": [ + { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + } + ], + "name": "aws4", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/aws4.git" + }, + "scripts": { + "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" + }, + "version": "1.6.0" +} diff --git a/deploy/core/node_modules/bcrypt-pbkdf/README.md b/deploy/core/node_modules/bcrypt-pbkdf/README.md new file mode 100644 index 000000000..12018090b --- /dev/null +++ b/deploy/core/node_modules/bcrypt-pbkdf/README.md @@ -0,0 +1,39 @@ +Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified +version of [Devi Mandiri's port] +(https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js), +with some minor performance improvements. The code is copied verbatim (and +un-styled) from Devi's work. + +This product includes software developed by Niels Provos. + +## API + +### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)` + +Derive a cryptographic key of arbitrary length from a given password and salt, +using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and +SHA-512. + +See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for +further information. + +Parameters: + + * `pass`, a Uint8Array of length `passlen` + * `passlen`, an integer Number + * `salt`, a Uint8Array of length `saltlen` + * `saltlen`, an integer Number + * `key`, a Uint8Array of length `keylen`, will be filled with output + * `keylen`, an integer Number + * `rounds`, an integer Number, number of rounds of the PBKDF to run + +### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)` + +Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as +part of the inner round function in the PBKDF. + +Parameters: + + * `sha2pass`, a Uint8Array of length 64 + * `sha2salt`, a Uint8Array of length 64 + * `out`, a Uint8Array of length 32, will be filled with output diff --git a/deploy/core/node_modules/bcrypt-pbkdf/index.js b/deploy/core/node_modules/bcrypt-pbkdf/index.js new file mode 100644 index 000000000..b1b5ad4b7 --- /dev/null +++ b/deploy/core/node_modules/bcrypt-pbkdf/index.js @@ -0,0 +1,556 @@ +'use strict'; + +var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; + +/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + */ + +/* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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. + */ + +/* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// Ported from OpenBSD bcrypt_pbkdf.c v1.9 + +var BLF_J = 0; + +var Blowfish = function() { + this.S = [ + new Uint32Array([ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), + new Uint32Array([ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), + new Uint32Array([ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), + new Uint32Array([ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) + ]; + this.P = new Uint32Array([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b]); +}; + +function F(S, x8, i) { + return (((S[0][x8[i+3]] + + S[1][x8[i+2]]) ^ + S[2][x8[i+1]]) + + S[3][x8[i]]); +}; + +Blowfish.prototype.encipher = function(x, x8) { + if (x8 === undefined) { + x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + } + x[0] ^= this.P[0]; + for (var i = 1; i < 16; i += 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[17]; + x[1] = t; +}; + +Blowfish.prototype.decipher = function(x) { + var x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + x[0] ^= this.P[17]; + for (var i = 16; i > 0; i -= 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[0]; + x[1] = t; +}; + +function stream2word(data, databytes){ + var i, temp = 0; + for (i = 0; i < 4; i++, BLF_J++) { + if (BLF_J >= databytes) BLF_J = 0; + temp = (temp << 8) | data[BLF_J]; + } + return temp; +}; + +Blowfish.prototype.expand0state = function(key, keybytes) { + var d = new Uint32Array(2), i, k; + var d8 = new Uint8Array(d.buffer); + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + BLF_J = 0; + + for (i = 0; i < 18; i += 2) { + this.encipher(d, d8); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + this.encipher(d, d8); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } +}; + +Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { + var d = new Uint32Array(2), i, k; + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + + for (i = 0, BLF_J = 0; i < 18; i += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } + BLF_J = 0; +}; + +Blowfish.prototype.enc = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.encipher(data.subarray(i*2)); + } +}; + +Blowfish.prototype.dec = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.decipher(data.subarray(i*2)); + } +}; + +var BCRYPT_BLOCKS = 8, + BCRYPT_HASHSIZE = 32; + +function bcrypt_hash(sha2pass, sha2salt, out) { + var state = new Blowfish(), + cdata = new Uint32Array(BCRYPT_BLOCKS), i, + ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, + 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, + 105,116,101]); //"OxychromaticBlowfishSwatDynamite" + + state.expandstate(sha2salt, 64, sha2pass, 64); + for (i = 0; i < 64; i++) { + state.expand0state(sha2salt, 64); + state.expand0state(sha2pass, 64); + } + + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = stream2word(ciphertext, ciphertext.byteLength); + for (i = 0; i < 64; i++) + state.enc(cdata, cdata.byteLength / 8); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + out[4*i+3] = cdata[i] >>> 24; + out[4*i+2] = cdata[i] >>> 16; + out[4*i+1] = cdata[i] >>> 8; + out[4*i+0] = cdata[i]; + } +}; + +function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { + var sha2pass = new Uint8Array(64), + sha2salt = new Uint8Array(64), + out = new Uint8Array(BCRYPT_HASHSIZE), + tmpout = new Uint8Array(BCRYPT_HASHSIZE), + countsalt = new Uint8Array(saltlen+4), + i, j, amt, stride, dest, count, + origkeylen = keylen; + + if (rounds < 1) + return -1; + if (passlen === 0 || saltlen === 0 || keylen === 0 || + keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) + return -1; + + stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); + amt = Math.floor((keylen + stride - 1) / stride); + + for (i = 0; i < saltlen; i++) + countsalt[i] = salt[i]; + + crypto_hash_sha512(sha2pass, pass, passlen); + + for (count = 1; keylen > 0; count++) { + countsalt[saltlen+0] = count >>> 24; + countsalt[saltlen+1] = count >>> 16; + countsalt[saltlen+2] = count >>> 8; + countsalt[saltlen+3] = count; + + crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (i = out.byteLength; i--;) + out[i] = tmpout[i]; + + for (i = 1; i < rounds; i++) { + crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (j = 0; j < out.byteLength; j++) + out[j] ^= tmpout[j]; + } + + amt = Math.min(amt, keylen); + for (i = 0; i < amt; i++) { + dest = i * stride + (count - 1); + if (dest >= origkeylen) + break; + key[dest] = out[i]; + } + keylen -= i; + } + + return 0; +}; + +module.exports = { + BLOCKS: BCRYPT_BLOCKS, + HASHSIZE: BCRYPT_HASHSIZE, + hash: bcrypt_hash, + pbkdf: bcrypt_pbkdf +}; diff --git a/deploy/core/node_modules/bcrypt-pbkdf/package.json b/deploy/core/node_modules/bcrypt-pbkdf/package.json new file mode 100644 index 000000000..b37e3f3e1 --- /dev/null +++ b/deploy/core/node_modules/bcrypt-pbkdf/package.json @@ -0,0 +1,76 @@ +{ + "_args": [ + [ + "bcrypt-pbkdf@^1.0.0", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/sshpk" + ] + ], + "_from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", + "_id": "bcrypt-pbkdf@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/bcrypt-pbkdf", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/bcrypt-pbkdf-1.0.1.tgz_1486007687899_0.974529881728813" + }, + "_npmUser": { + "email": "alex@cooperi.net", + "name": "arekinath" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "bcrypt-pbkdf", + "raw": "bcrypt-pbkdf@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "_shasum": "63bc5dcb61331b92bc05fd528953c33462a06f8d", + "_shrinkwrap": null, + "_spec": "bcrypt-pbkdf@^1.0.0", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/sshpk", + "dependencies": { + "tweetnacl": "^0.14.3" + }, + "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "63bc5dcb61331b92bc05fd528953c33462a06f8d", + "tarball": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz" + }, + "gitHead": "fa2ab3ae9efa15367264151398635a915c7b411d", + "license": "BSD-3-Clause", + "main": "index.js", + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + { + "name": "dap", + "email": "dap@cs.brown.edu" + }, + { + "name": "jclulow", + "email": "josh@sysmgr.org" + }, + { + "name": "trentm", + "email": "trentm@gmail.com" + } + ], + "name": "bcrypt-pbkdf", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "scripts": {}, + "version": "1.0.1" +} diff --git a/deploy/core/node_modules/boom/.npmignore b/deploy/core/node_modules/boom/.npmignore new file mode 100644 index 000000000..77ba16cb0 --- /dev/null +++ b/deploy/core/node_modules/boom/.npmignore @@ -0,0 +1,18 @@ +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov + diff --git a/deploy/core/node_modules/boom/.travis.yml b/deploy/core/node_modules/boom/.travis.yml new file mode 100755 index 000000000..dd1b24f13 --- /dev/null +++ b/deploy/core/node_modules/boom/.travis.yml @@ -0,0 +1,8 @@ +language: node_js + +node_js: + - 0.10 + - 4.0 + +sudo: false + diff --git a/deploy/core/node_modules/boom/CONTRIBUTING.md b/deploy/core/node_modules/boom/CONTRIBUTING.md new file mode 100644 index 000000000..892836159 --- /dev/null +++ b/deploy/core/node_modules/boom/CONTRIBUTING.md @@ -0,0 +1 @@ +Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/deploy/core/node_modules/boom/LICENSE b/deploy/core/node_modules/boom/LICENSE new file mode 100755 index 000000000..394688939 --- /dev/null +++ b/deploy/core/node_modules/boom/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012-2014, Walmart and other contributors. +All rights reserved. + +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. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS 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. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors \ No newline at end of file diff --git a/deploy/core/node_modules/boom/README.md b/deploy/core/node_modules/boom/README.md new file mode 100755 index 000000000..cbd91c931 --- /dev/null +++ b/deploy/core/node_modules/boom/README.md @@ -0,0 +1,652 @@ +![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) + +HTTP-friendly error objects + +[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom) +[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom) + +Lead Maintainer: [Adam Bretz](https://github.com/arb) + +**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response +object (instance of `Error`) which includes the following properties: +- `isBoom` - if `true`, indicates this is a `Boom` object instance. +- `isServer` - convenience bool indicating status code >= 500. +- `message` - the error message. +- `output` - the formatted response. Can be directly manipulated after object construction to return a custom + error response. Allowed root keys: + - `statusCode` - the HTTP status code (typically 4xx or 5xx). + - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content. + - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any + changes will be lost + if `reformat()` is called. Any content allowed and by default includes the following content: + - `statusCode` - the HTTP status code, derived from `error.output.statusCode`. + - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`. + - `message` - the error message derived from `error.message`. +- inherited `Error` properties. + +The `Boom` object also supports the following method: +- `reformat()` - rebuilds `error.output` using the other object properties. + +## Overview + +- Helper methods + - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) + - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) +- HTTP 4xx Errors + - 400: [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) + - 401: [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) + - 403: [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) + - 404: [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) + - 405: [`Boom.methodNotAllowed([message], [data])`](#boommethodnotallowedmessage-data) + - 406: [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) + - 407: [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) + - 408: [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) + - 409: [`Boom.conflict([message], [data])`](#boomconflictmessage-data) + - 410: [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) + - 411: [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) + - 412: [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) + - 413: [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) + - 414: [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) + - 415: [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) + - 416: [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) + - 417: [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) + - 422: [`Boom.badData([message], [data])`](#boombaddatamessage-data) + - 428: [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) + - 429: [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) +- HTTP 5xx Errors + - 500: [`Boom.badImplementation([message], [data])`](#boombadimplementationmessage-data) + - 501: [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) + - 502: [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) + - 503: [`Boom.serverTimeout([message], [data])`](#boomservertimeoutmessage-data) + - 504: [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) +- [FAQ](#faq) + + +## Helper Methods + +### `wrap(error, [statusCode], [message])` + +Decorates an error with the **boom** properties where: +- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object. +- `statusCode` - optional HTTP status code. Defaults to `500`. +- `message` - optional message string. If the error already has a message, it adds the message as a prefix. + Defaults to no message. + +```js +var error = new Error('Unexpected input'); +Boom.wrap(error, 400); +``` + +### `create(statusCode, [message], [data])` + +Generates an `Error` object with the **boom** decorations where: +- `statusCode` - an HTTP error code number. Must be greater or equal 400. +- `message` - optional message string. +- `data` - additional error data set to `error.data` property. + +```js +var error = Boom.create(400, 'Bad request', { timestamp: Date.now() }); +``` + +## HTTP 4xx Errors + +### `Boom.badRequest([message], [data])` + +Returns a 400 Bad Request error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badRequest('invalid query'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 400, + "error": "Bad Request", + "message": "invalid query" +} +``` + +### `Boom.unauthorized([message], [scheme], [attributes])` + +Returns a 401 Unauthorized error where: +- `message` - optional message. +- `scheme` can be one of the following: + - an authentication scheme name + - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. +- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used + when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the + 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. + `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as + the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header + will not be present and `isMissing` will be true on the error object. + +If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response. + +```js +Boom.unauthorized('invalid password'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password" +}, +"headers" {} +``` + +```js +Boom.unauthorized('invalid password', 'sample'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password" + } +}, +"headers" { + "WWW-Authenticate": "sample error=\"invalid password\"" +} +``` + +```js +Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' }); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password", + "ttl": 0, + "cache": "", + "foo": "bar" + } +}, +"headers" { + "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\"" +} +``` + +### `Boom.forbidden([message], [data])` + +Returns a 403 Forbidden error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.forbidden('try again some time'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 403, + "error": "Forbidden", + "message": "try again some time" +} +``` + +### `Boom.notFound([message], [data])` + +Returns a 404 Not Found error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notFound('missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 404, + "error": "Not Found", + "message": "missing" +} +``` + +### `Boom.methodNotAllowed([message], [data])` + +Returns a 405 Method Not Allowed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.methodNotAllowed('that method is not allowed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 405, + "error": "Method Not Allowed", + "message": "that method is not allowed" +} +``` + +### `Boom.notAcceptable([message], [data])` + +Returns a 406 Not Acceptable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notAcceptable('unacceptable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 406, + "error": "Not Acceptable", + "message": "unacceptable" +} +``` + +### `Boom.proxyAuthRequired([message], [data])` + +Returns a 407 Proxy Authentication Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.proxyAuthRequired('auth missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 407, + "error": "Proxy Authentication Required", + "message": "auth missing" +} +``` + +### `Boom.clientTimeout([message], [data])` + +Returns a 408 Request Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.clientTimeout('timed out'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 408, + "error": "Request Time-out", + "message": "timed out" +} +``` + +### `Boom.conflict([message], [data])` + +Returns a 409 Conflict error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.conflict('there was a conflict'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 409, + "error": "Conflict", + "message": "there was a conflict" +} +``` + +### `Boom.resourceGone([message], [data])` + +Returns a 410 Gone error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.resourceGone('it is gone'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 410, + "error": "Gone", + "message": "it is gone" +} +``` + +### `Boom.lengthRequired([message], [data])` + +Returns a 411 Length Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.lengthRequired('length needed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 411, + "error": "Length Required", + "message": "length needed" +} +``` + +### `Boom.preconditionFailed([message], [data])` + +Returns a 412 Precondition Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionFailed(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 412, + "error": "Precondition Failed" +} +``` + +### `Boom.entityTooLarge([message], [data])` + +Returns a 413 Request Entity Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.entityTooLarge('too big'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 413, + "error": "Request Entity Too Large", + "message": "too big" +} +``` + +### `Boom.uriTooLong([message], [data])` + +Returns a 414 Request-URI Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.uriTooLong('uri is too long'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 414, + "error": "Request-URI Too Large", + "message": "uri is too long" +} +``` + +### `Boom.unsupportedMediaType([message], [data])` + +Returns a 415 Unsupported Media Type error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.unsupportedMediaType('that media is not supported'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 415, + "error": "Unsupported Media Type", + "message": "that media is not supported" +} +``` + +### `Boom.rangeNotSatisfiable([message], [data])` + +Returns a 416 Requested Range Not Satisfiable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.rangeNotSatisfiable(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 416, + "error": "Requested Range Not Satisfiable" +} +``` + +### `Boom.expectationFailed([message], [data])` + +Returns a 417 Expectation Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.expectationFailed('expected this to work'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 417, + "error": "Expectation Failed", + "message": "expected this to work" +} +``` + +### `Boom.badData([message], [data])` + +Returns a 422 Unprocessable Entity error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badData('your data is bad and you should feel bad'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 422, + "error": "Unprocessable Entity", + "message": "your data is bad and you should feel bad" +} +``` + +### `Boom.preconditionRequired([message], [data])` + +Returns a 428 Precondition Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionRequired('you must supply an If-Match header'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 428, + "error": "Precondition Required", + "message": "you must supply an If-Match header" +} +``` + +### `Boom.tooManyRequests([message], [data])` + +Returns a 429 Too Many Requests error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.tooManyRequests('you have exceeded your request limit'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 429, + "error": "Too Many Requests", + "message": "you have exceeded your request limit" +} +``` + +## HTTP 5xx Errors + +All 500 errors hide your message from the end user. Your message is recorded in the server log. + +### `Boom.badImplementation([message], [data])` + +Returns a 500 Internal Server Error error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badImplementation('terrible implementation'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 500, + "error": "Internal Server Error", + "message": "An internal server error occurred" +} +``` + +### `Boom.notImplemented([message], [data])` + +Returns a 501 Not Implemented error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notImplemented('method not implemented'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 501, + "error": "Not Implemented", + "message": "method not implemented" +} +``` + +### `Boom.badGateway([message], [data])` + +Returns a 502 Bad Gateway error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badGateway('that is a bad gateway'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 502, + "error": "Bad Gateway", + "message": "that is a bad gateway" +} +``` + +### `Boom.serverTimeout([message], [data])` + +Returns a 503 Service Unavailable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.serverTimeout('unavailable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 503, + "error": "Service Unavailable", + "message": "unavailable" +} +``` + +### `Boom.gatewayTimeout([message], [data])` + +Returns a 504 Gateway Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.gatewayTimeout(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 504, + "error": "Gateway Time-out" +} +``` + +## F.A.Q. + +###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives? + +There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. diff --git a/deploy/core/node_modules/boom/images/boom.png b/deploy/core/node_modules/boom/images/boom.png new file mode 100755 index 0000000000000000000000000000000000000000..373bc13455bc0a71a6a4538158aee59c6994b761 GIT binary patch literal 29479 zcmX_nRal#C(`}IA?(QuPMT!QexVux_9g0iPQmhm!ZUu@2cXxM+y9ReHw!{1V*FH$X zL9Wa^Gi%npX6_+UMM)YRg#-lv0HDjtNU8w8=!YmpG3?_c$V#GxO^&N8}g002hs z+Y2U%8G{r6KvA}lkWf*vc5-)evvzW(l9iC4a&~pHw6V7U0KAqm)vYwt4+wwbiV4_CGlKV!TyNIvah5h+6Jn3N0H@Mi?plEzm7PRju3y3?^ zd9fk+-@Xq&Zu;ii&9&a`jlI;(3q#7TGHWIfJCV?mWw=y71)&v-Q($j|4D|MI?y!l1 zQ0SZiSV%SI)NaqTFo632Ads1+6R{lt<28ed1n5*u@BBy>@rrpUo@xLS6bjSn9?vI_ z6ody5^@$ZP1c*w(1ZDpEpbp4^2YeYZGu;NLumZl&2ky-Pf->(@ePICliPZQoIq?80 zT#Ij#0Bb=&*@V{j&j6i|06a_iUVgv=E8wH7wxtZ9vH{RJj)htcKtcn2RQ(pl2!Qtm zd>N#r^#X*Z0`R0RwSgDRNf7wezt!I06yK_Y_xCDfjA98((v~i-J{nE1!NOHkwZ;a_Tr?U8c<)K$Y*GJ zWlfuOnDDk$aa>|0)1t393uq$6e=_#HpMEvpT4#BL6JGxWsI(P^@r`HwV`v6h;4Nz$=t4A+PZAOQf9IUuG= zG1BWUB9=}BvaWY4U8qlActXYLdb`E3#8J$H$XvfLmIaG5gpXB{GkszID@xAYscIdb z;Eci6t=WhnSO;mZp=0%1JRqdvyN%$jQ z`=J^8p_j;%lOsY$hJ|(xCk~e#%lDf^FE1TVqy#5@(+^nLs^1#ZIMY(oj%u_AEXC>E zG9SJv&@Gq&w7?`Y4&EqAtJh)wdYbhHd4Dcd>T4cM&Xp zaf)f?r>U*}$<@IA6sIQ+&aGFgP>uM5%k7cIKNdnDD_;Q4OPV3ECbYh@sn~aK#$HXL zP)eE9o*p@n-cQ+wyY@sw562G~_-4gGoKA#DWJT;rRPjrpka#AFctGPLFUQd@NGfKk zlco++J(C}P{4h$AT+)XmQYLnd;*!FWwGvd#E6ov&xMCx9|8gl!F7@qVgvUB1)|OIBAId4$ys$M9}R~=uwvVt(sG1yxrPQg=$7zD4~+#Tz&~IIWFxQwW~x+5yb6ZF83MkO2`m~qLizE?`wExj9ZMP zh1?2F92N$4CCMqtI;AqDs-@CLZ9L^CMVWHJJkD|SeX)9HT0GDoF=p-_&58Mv7x# zeO{*kMM3Xjtl%O+Vjz9k$9o??>W)|ufn|%^>ctbW=$s}oe6hG-aPV#ynA&>q_y?H! z4)SX}e%uBlOeJ7{ZW7UC&m^iR0F6E@B1}76B-Z(x4#^Zp$|ujM6$!U>$$yf`l56Q! z9LoF^ta6{2giF|LflIv2+|45WY?ivCvpShNvi9<1{A^6+JdXD5>rW?F5nGvCsN24T zzt{&2oxO9%yRXBF2#VQoSOk(q6}~C)C7z36G5sNket(JU`92oKyPLe*iiUlPXX@L6 zgaH$U(xnWOqR-Fc_|{L}bbVX}EW1si^u<3~70?w{(*?2!(!NqTa0&^uafJMg|KTED zLamrkZ*^$3XZdxc%p$D%rOz>{ft?}=amcRbN7*}FR+M`2!hH=rhIuB$YAXwE%Z{%!-8h>+>kGo=wOPq^_S(v9`Ky60-peT4`0tp*wGhgH zjo<5;9A=eEPqb6Y1KK|LDB6LHx`uR{}SP&H9@!~Bm{=1&Zjb=Y;+>rDQIXOarz zM}9BITP94w4_sha@!BPga2oDNT}iAhF70hHpRk;^JlI=f&C+bf=im-`{f+`%VCieLZ`mf|4CPmH zD{^*Q@wCe{sdV+UM}1TMX5~@gsky^7pC{>MO3Vyypsu&vmBx_G(n0V{g4N|jbY@bf ze*oLV%9rK5dS8gy__{5o(^)f?`{wlL*C>c!tKhi7WuyCL_3|#RcB6J$g@Cccq5C25 zC1FN+pe3Uvt-Q&=uIbdLt6vpiwIY3o5Ee4=5`PniDe*2Y zHEtvvJ^Uz(Pne&7OT_j0;HgMr!hGUG7U4_Y%SbsP0eisx?9u%A)UT=Bl*^Qa4hO%2 z=fln;;)><|?tY5)Aulctqie0llP=E{Px7<;bxh?QKdL~6SL=tW8}-Se#{}YpgjaaD zUsq3NT&&Aby-8&zqoxP|_`C-Ifls-mkC1R+jZ=Cz{%Z)jKqV29+=o6zbxbx$xo@xpbni)G?vlY5|Nt ze#q_nb;(*6npJjvsjRBfH2C{?V&R+WI(`}BVrkdOOq1{W&9nFEaH@ZUjVnZO_wRH{ZrSrO6+`aqz3{^U46L*dOIJB>3T2Aw{D!8~m zcK#hj+f|E<9as7}M3>I%K$EF-Rg?W39T^!}Z_b&zQt4u*FPv@Ma`Q9lF_uCoxgC<_ z>(i>onrT1MzqBkk{b0(W4^CXZ@I#~y))6@IaIf{$O(yp=)RtuorG(c45|sL6N!RI( zwUi%Oa;2&P2`U=PNp+I1RhF1jyAH%ruqF)`T&PuPDAVD9EOZ4@ zMl@m0rsdgpHzOzuwMt!9J?7(w%!w!{ESKvYRvr?vC+C-=uwX~3e`TfSc2vaqv?&Q^ zOEZQg{!Djlj-*`orZ>yaw_j^bg$8hPeO*~u855A7pPx8lF;`(c(c25(WDu)as-+6n zO8xb#v)+Mar27iURaYnVlk; z3@R2<>k?YImJEFRT%vmrqK4diK={A_ce{3!r$BdVgR3>Ea6VJoek~qDlS~28lc4_uA0m zOeHH$9DYoAyjAKot>PGPp&$^C)=~S{KaB9^Bn<>s3<>10ERk#>V%DtY(|tWPoKy~R z7}6+NEX}0rSZNC{-6lqGh!CTfLWsoM>V;_TWKW6acwFnzr74wNF>t(_LgtGb5!*c741s}mWA^=P&CjBpp(Sy1$GK|XwiM#~EyT)y=AjGT< z@3rO_x!&xIL1*uh5WALYG=7(*-!TAKZV&LUDPblY?2Jo@?9eoyz`y8#+H;>onV;fR zAiCh%+JhQ0w#fJ1->nDc(*TN$Dv2JVip;LVkVb8*-YX*1L-M;F`T65(CNhxKa%8CI z{r(g&SW^te+c~G>_0eUyU0SY50*OPI`3dcR(X$HsB8&X3kq|!Ju)ydt>CEr({fmO5 z10v0hd=(mR-Q7j6IjK-R9IRgfa!}qSvJ$OnFE9+bHB5ZP7_88L%GPgC4=|>bE_!n8|QaZ5(LZPf&q$=vDQ{j;g@LP5m}M`?-$eK zvq09_t{hwm8^zCza!g*KojQMh=>A=IBf-YY$f7`N58Wq9G`7w53t1G~M+K?DsD zHvb5lqy6$JyVfwTR#8!wuqKl*ZNNrnxP#KqBG2-z#RH}KKK0(voE+G~kdGAFSyls^ zJBevhHZi4Q(%9lS3md&nW&S}8^>D6JRECW0{<$!c{;F_?I(9JK>V>MJ4!}=z8z?kk~xb42b0~N_fUDI(Kj7Ku&~3 zTp~iw8{v$NT}tnbKV^=b9GspukJX<9Ctiv%?t(@84AlM)fgA|7)L7yx&i3}l%C@_g z2|RYG_YrG~K%rG7IlX&5bu`!~>&t%0qzv8j(HG*JAx4q13tIRPt?2c^+w(jH!UWL3 zxKCIGVNpxF;3xl{F25Iq&`A=MdW(~@qoc=?@Cj7vuhR7#i1ScJLzCJWeaHA-e0a78 z7x#=$*zakK9OM`%?JH8@bXGLs`e#4L6w6WynbvWS)dvW6@d$!vq26yWMJw0_GOrFb zp1F8}pQz-Kw^o(XYdelT0{+?7^SvFUaihQY$QJ8&jbt41U}<40%n8dO-G> zzNqR|;D#38ezRU~AK`c06A?jyr`AUd$^fIhe1Gl!NPoI`89xa*?@=!&Cn$_0)L6*egx&4Yu1N@qfr9>n<+#0=BzfM@ zAg3o)$SBMkFO!)zsrk0p!M?yVm2H8qBH$v9OpzdSwICV3Zhf?i+Q%p?^y%v==%Dy$ zdhxiFD{_Z0JUm<&Jvwz{;w_PcWrI~LQ3ko^B@q+>_nz`$-SzWUzFx|AwsVUvC`?~~ z=Xn9j%t(w9O*E2!>(q1MFgs3h8Z}`Xq*U1RVKIM8qL316ni6!2>x~~2{KS>eo6E0_ zl0qW2S=?M_MWhCQq*|yJ7sK=Z-aXuZg)3atFT}{L4vKqc?~d~%c4uq!^JKFW>SHEl z$L*I~XNNkY*BAw+8(Hv8Ana#1ViIViHiNPGRkg+s#haeGDA!#EMtI=qL>g^TJ2H-` zCcj5^O3WPEY{W+(V85%ku0=sQ#81>7xU;pch`qFBSf^DH7B4ln&d1{R8>RbKJ65S= z$v-s6Oji(Ai!-Q0HX=)9Cd(oi{^RS;0l&oiT`3QP>!A#k%Fr*FxDZ3b()*iRBS%KX ztEtp@=2$%WKyZPVrjzHL2#%%s?C7pFG=AY%T04?pBK!HfZ12~s)xac%gwT_$0>3w^s(g1o4*AraTh1e=)Rc-@6Ce^0CIN20-^w7o2&jk8y^brhTY6Mn z?bz7Z7f)%YiK~R69ZDHSO76@lbSNn}uSJrLRIA9LCzs6L#iC<&JP+$kzifjPR}v4S zm)PN1PnuF=GN-a4jM+CeUA>ZELB_9PpbmZ<#nC_qaDH($)6Ev%bS%`3Zv_IC>cqb- z@--@R__97q$aCN_R8MckwP;`E+4EA4$9!W~QfS-A72iCZ^?#;RC{oM5^6#)^`>&uf z2x$hYS%B*u7cYh_FRrHMJ1J|Eb0cS-6}c1DsYu;SeP9;n-@7?*aXtY*eOz!lv;?qW zTh&PPvsRR2E)8wNTn@vKO%E_|9NPGbF)HDi&I#$h!mG@GuM%}pWf=;*aoV#P!gw(~ z++TW@j(gEI4t!0pUw$EF++}m~eglxn=P0s~`XR`bldu5i6Nqhs@(I$8{%_Wyt$Q}@ zqSMLcEJjp@wBlzGryE&^9+28`=ewdMA${QlH%S99M0*TZ-V@vDsPB6bb}~AXDEk)@ zc>otknYc^7deuIP{^2pzL|BC9mUP<1asTY-(Q3furSI;!)1dH;mw%<;n(E>wJ5;RI zIIR!dk^}EI>GdMJ^yloiH68r(a`3!omuA$FV8qoj`ISuUDFf=f#8nb;0U_08}a%6MPZ`)0M9=D)y08k z%y$4&cb$wf@L|F~@LAO9jP!RRX4=T?8>_Igy4o+-hYv^@xB1>>br{7QKOD8AL)lnS z_?+=i&U;@)WSg)t<~9MxI#HF1ycJF(@ZVn1tvNiwn*Gjvql_G*jLyiS$byz{1SDOd%1LPNN>AYaWJ4?phxUu(kZ_k~K$Ddp) zfI%Vh^5TyveBHuZu+$gfGw%|g@P!G5&5_>)w{HdBC`m7Xtby;d^Kkoj)MmltZ>l*|M3rDKenFn#*Eq(zTl>+x?|Yzs0&I@OR*AWKAebx7-2Q&B-BL!s%mEvPM#(X zqnhTF_%P4bo&_<1*OT56}nua-vZYtqz6 zf9zJPVd?**FvcGDu|kxHOVCl{1#v*Pwuwb?s(iOpb*b1;=9e;@o1k{bON;C@D^1u* z2qCQ7f4ze`10LJ+V(g=cr6PpwIj(E$Nv}RV z0|jXkOivmrs>c&hCuwsGFlw_eEJ~yDqJ!OSNi2%}Nx7!j#!a3TI=yFL0)hRdDlC*d z7API;eSCjWw9;TUU{yDlLXvCtW~J~u8TeC`PV~^wP-%eQ-74=uq3isM@9PJnUk9c% z=ST#T7&-jbp_MUP*XLf?sD3+yN>_v>~hzJOP5!%wQ_yth4 zao2X_Z9I>Ko1f1MY;`>ru+W`5H#8Q)L%#`7G?+S)P?4i4@t{PzY4MSzYLc$(w?QUGQE>es zzb67i=(fUV?lM?`kP8%NTR=pH{WZA+B2}DHhzu14T2mRB*nA`O9^w_T+RUmXtI{QQ zpQ>)xD$8SqYbJ|r`Wi324E5Qq$67vMfceXAismYeo=K>CF-PN}5;PpuUKYV?{OAOPDztu z{0Lg}C~MeG+?)JWbr4dR_(v{&df!N{XQp`?{a{!x;%lc|uShRUV^-L=-c?WK6JMUx3U#0ScidJ1`$g}eH8&p%HdDBLulNZW+P<=1a;%zTWnPrtZuVM-cCf5afWe=ap+T$`!;9*lzI&fK?& z^rRQxS&_bwj?d%{TOsFt$&mUIlj|-#!o6=#`t6_-f_~z!;okX3A6FK*u^I8|w){Q? zNJ^AysNG;N_TjC3Sa`0|%29#=1scnkXRTKi3fgYtI&Ftgr% zkbYJds}eQouX>!I(oYG)kTLR*);j;7r|WA?M5tr(j0FXCS(%nX5YsmXNQyCJO4@s( z9&jmh3cPCxbpJAuMgOWhPg1UInTn!Un%`JUcG$=Gq}QdO3U*J;$FF-LQfelrKKWSp zL?%8kla_~a|C}{@{3qppbElUXg97NKY;3&VVZT@%X3rC)HcVy&^`0;L^LV*o%ic9~ zj?%y8|Cr^yeA3W%@U9qRZF)*s*cu$W)m@F$DlmIsX6?YVk%8%T!+Ens7a1$2w5O3N zzt6y_^AzY$>V0|TSIB-5v1PXRnpF(uYA3%?(}_!193r)Aa~Wk^1?iGDhsoALXntFtyQ$2<5Dwt@{qZEfF?BhK zB^P}8bp8zW(h{TWjk6#N6Fze_B$otO zeuV||SAM3qT8L^q%f^E#KqKSQvpM`;7d*P^xqdTeSJAX5pU&gZyxO}9ZBu)^SzKSv zF<&dIV5E>-!@A`Q<1n54H6c_-CqxOLb%BGe>Fx@=KMLe94k#~~6*L1CNzitsOcH@4 z;{(2^>bq-wjE+VA&I##T0qI!ESJHWpY>KEpl)XWyitX`ca`o}`onUm#t6lC@K5K*U z{$q_W9&_K$Rjrj$sldY7on=rY6EE#V%DB?ovtGGGD>f(fiA}02N}RZw$z1t)uooCh z-f`OgcosNvm3`ORaRHnl(|bb;Ym|w{js!S=y8q6sbfdM5^1HCf}?^roMB7v}i zhySX=R#s66Rf6xL&B?ij9i-r=jhckNrynJy*kSW#>+G>b%f6saboSUpp1N*2NAG^53{(J!>ih`a@g4P^R--5m z0<}|Ak+(@<`qbuTl&Agr3v=xDFSs{N2cf=Qv<Iyls@V`K5*Rr z$T=nW`ew*kM9MX8e#e(5%MHc`74wvw(r==7oPB4puo&R|dV6yAi;T48QfSqVsMhSS z{(B1pnZz?Sb|tBh%y@o66j-EI5~!Hhxb$|AIA>0E>>n7IClherZ}tMlCSGDky@gPV z=eD!6(`J2A&uxHQ#OEm!3b&(i3bX;6|ti) zKHr_>w zGKaYy{m5D;z)OSwNpC4|zw|dAJY7#&W9xh#1bN&$e}nl0jVlJZz%>I5^`ze2vDbd? z`uYx?m)!uB91^fVf6$m_5~RG5PUA?(MpCfn^h%{yE^l#=hBFr*ze$>O7T9+eGyHat zUPc?x5C>5jwU%+!Umyg3nHkdbH@fbT;Z%LVsKus1WM%Yo127^j;3W?EK`D z-y8hE_?8UKol{qF+1Np)_?gptCFaRnJ3C3cwie(yk^;OBJOghT6~2YiozfF+lEP)% zvZJpPSjXUIZw>ug55ufI!Xh>y_nm40d9A>du|qk0(EE*QbCRNu$t1+2EzLjKURRLF z-YQjDa{L(G5T)y4b8~=7b$QHvgA`=O*Aa#Ty-fHmuY)JITjV>tL_aGY z><^`D=o8Qkco+h3F1+T)5h?C#atsb0YI5ZxQNdep(}Y|dBTduQ`7`8shv` z_zC&CT}4A#DF|Ezy!B>S9k!-TTMbD5Frfd>CbRL5ecS!kHE+jjo5OssI@$t8mKG~J zh5H6>qb98@n|nO%$>;cO;k4RH8EToLnGlntwQ85xg7KBOn*&B>R(9Ue30I^NoyJ630u(8TTA$ zrV7P{b%vBF{qE%Cr0t>OoeB#mCMQWEHVn(Upm=W}#sghuL>DiW)H){QOH4wJ7F&fp zUBW8#UMCge5`ne#+-b5wJKB=c{6;(D;cZ7CL>^rvgkv3|Q}LtzZ6q7jOkpJzc2f57 zFz~vVOfStlB)jfg42iF3w!6piw9*KyjL>e#@gK+&#tCLg+1svv;V<-;(x_Zdo9@@U!&! zH?3BTryuIys)2MN`$gnD-3p6OY6prWi5kgq1>uh7k$PQ=fjj-myr1_4lz#mCBGq_%=#7UgzmXNx0d$Bj zyA(8u^Kf|y5UB|Ztg``h&f0a70I#fh3tg=VSYFcXp637IX^eSKO<(aEA7^xE~=@ZU6USG7?oo9yl%j|&s|MQSG)Y_XqRtx2zw{n}& zj029U(lqk3UEAab)^@FNj?;N>7E!F)7)3>)08skaxXCJ`nfe=af}!(Y`S2d8C{%K) ztP|uShSA#DchOQZkRm*3CyxIK(hQQ;38BxD`AgXNAQ^Jx zExM@lcG^Pmm8hm8{snpJU$q!Bi=bGu6S)kkL+JRs$b?b0X^kXvtF~^3q>KeAz77pU zKWf;4dirFU9U}HvD9*X%cj$g1?=pvpS0FjXstH$VAQorUQAJNSRZhwXhVRl5khuYm z5dUe|pfI27D(|bgNWf?y#IiYCk!F^29&En_oF(2&zg}P})h#SXLo}}~&V62m`7-p-lWw+RT|&ydO4Ar%%21dO4vxkDkwlQqprCeR$Oc|>LR4!tN()N&8dW(t z-!q`A8020TQN~ZiL3Uzs^Kz~JTUZ`oT^G<`s8D&C*LR)fk&HQJvX~D9@|)%@Q=o<% zhdwNLy{pt|JRAIvUf%~nm3$jSIjp5?t20;5#>UwVovTi@Vnx_clF40cCB4Vpn^Qk~ z!s2ghYb()UdsWfVdWSXfu0F->Y3(n^mJAN_RDM1zbX0GGE4@9TTLmkPBwOwKsoRwR z&%O*)_WnV)Z4|r z$+%|eK-F;*i_8!_YfXS|7wv2(d))oTipJV&f8jjO=IVKJa7Y_xDh>=v;WFHddtN~wAE`T>!s%OB<(cya^?`fH6A}4z zHx4rcbj=Ja*d5wpFLN;NGD~g%=(r5&eCKj%O>;B(SgD<-p2kLzkayj%O_uIy=U@tv z;NmDfd(b_NJ!UlxpfA*C{+L>iUtOa`BxvD#7bH24sugXpUZd}5UFXVldzR|#4o*&< zWj`b}LwD~Z5rREB)oZsx5~T0ry5Ucz^>jlD)fO(ei?cl9h$PX$Os-TE6QQ>_bHUZc zRM9myxCF-RkVY`D2N!AENl7t1E$JjbNTFc3O2^&_NI_2#$9@gr<}|d}a)ENoOuy$w zgYs1~;N?`DAE|zuFMeAB@o28>VX3#b_X4F()_3j7;j2|fA5o)x&8FqkC2=^+P zw4fz@5Tw%_rE%uNln^ncN2_Jt)N^IHVQs1uY)3dh5Xn+1Qnl?;wO&M+<4}hl@431_(goM>yDStS;{B30yK8yV zUK;MJ%!h<^J|5uH`2;3eqbs^exo+xYzPc*R8HI>Ubs%lW&%?LNQNWZIrO+p=ANFU6 zU`Azf7+QBdr45~Fnwbvlco}w`4eRb(I-X#W3<0^m(hG&|gFnWNfFQNn1+nuUX!|&i z6A7L-4bDzf;2QVWpg45fh0{p4=cdsnB6}5{xgjNV(E~#;+87uw*KXO523YVWI+ucL7qJfkZ3m)` z(0hi2QV@N%S*AQ_9_Dpwt7BKOQ=*gn>Y;L_!HKeF1UhG0fUchLZdK`kvCsjMa1u!$ z)octmE}E;J{W`RA)?Kxt6($*KQDnZNP0n>-kH|{uYJX6&;(r&5phh0jEAVfstDCDB zZ_;M*xJ3Iw#qpOsQj}z45jJ1VD+NrMxoc}p{`Oj~W~ok_&!h^}2E1pd1OOHCmx^>>Un2Mr=jc*5iY9Fza zy1M||W{oHPg~-_@URKSJ*Puy|A@dn9B{8Iopej=Heu5Hwk82f)mu$$$y*E$xW z@W9Yk*j2z`tyz`yT3nJ^-BEeVX}U<`Zt@7q6m7BRuzEG(6OMDm*=7IK^ON1{2S>U3 zcy(qvB3-Bqpv~l41daW@GShIQ{bQZh+k40o(;1I6y=wQ(10yG~V?)CQNhr=i?b0|* zwp}MmKzt?A7iE^OR#@&A%()lx$ImdzziWpHefS+MhPb|B##W<7zt zbek=1pC+v5Hc1^cUrxQkAllA=4bf|>E;3uQ2!btg?lmoh?uE=ixNv>**Os6PKoP>{ z^2~-oe!u&3S|cp+N|V)QrvTgl2%q!2IQJXGsT>z{EKFd4o4v^EWCsXRBrsSEP(H$) zF<=#%EK&LSUI5W$nq0$5>Q9Q55?(f!X;CT;;?I*dX#OQ!nvh_n;T)#70vd*ml_;(B z>7G~J{2Wovb6@__3mt%ZxC3+e5lQ9}vCN#Fu%=hVqBo1MJXGs*x{b z0t5fHJN-M`rd*Y|0i=RNf-IkiyNQya|C#ZE=H-ui{3^AP{$#4P&|1p9yruf?B@}BR z*(31va2E4K@ayqU)=;tZu6%?#Kxa;MQ-PO#shUIkWUjw&e59q0EW zFAnpB3cJFFW)uTHRrG>Qa4X2XFv9CDO~slmxKmYBO=ei{qCB#P?n!_b$A^4Yx0O%q z`hI?D+1GQl-ZM5XZrgj!^y#luO=;nta}DJ;$IF_)TkPAsgXrYrGA`zS(bB)jbfbV$ zP5a@2@C$H2Q9k_!HSA80PShX>_MQ|Ap?@b=o<(v`C%E%2&*BN#Ru)697d1cWwce`k z&3dlf8Edg}M;cTiC7${jm!FoFwu28K!{25xQ^>yVeZ25Kp|eEhFECAx&V7q%<9R!R zfw50;`EjU%A-4zlOp#?ZEWsXn`|B*v<&^{!+sL{nmpW%rSdp=bw?Cp?t3wGjNK8gY zsl@&rx|5j@v1r74eiR>c!GCpKOjj1;M&`A(oATNS20OT#o5NS}X||F2yJiOb{Zhq7 zLdW)wZR@vhAbHHd1GgiA7gi(reZcj#h9OMROyR!N3kktTa>>w6#PlP=Hvl^sAr*TlzoRF3kKZaToIh9rcwyFcx1IwCP2TO*d~SBnbhXP)A3QidehMRG9ihRF zJJac~nTfkQUG<%@n945}=n++qG;afcqRbMOQe=Lqbo-WuajvDer-t_{8cXMbZpiDW zq%S2%zpE7Qoavok1FYWXkU!W!D_lM$pklKpoEDJ0@Z#u;YT+L~YG<;Snvdg%^l>g` zba!^>I-hZsG{Jf`mh=BSj@o%SIdSIH^~gvRhx~j|Q<=$;%XtCWA4YAh!{}Eb07^i) zkTM&p7?Fy%8TVuW*}e7`oD3bd#Nvdy|6E!k1EaBbFeKCpb{Mp zGDRC-tb~)X@#&IX`9m}F`!0UEIs52wfejnItEz+Tr>?)MEY#3`gHF1X(Ny}~X5x1& zok*6Ua_VXceH+T=P-v25jwI*pdu-ri6X<3duv2AnYbhy4J`?a6m+su>7n>R6;-|R$ zE9oz4sV)qXrPdMRzV@c>m1#2?@K}{*L8Yqe9=jur=YBR#_+X!~mn!2lFjvjHon=((1eaD_zMp0&SJ!J(b8zKb|)xf1K9Jc6;q!8Ab%1zP$8I z1fIHy7=yJ4nF*|t7reg=kMD=SDr|r=_;CZPB5^H!S_P-`31Mk)64_xKV}T!9QoOUH z$@O|LVlJ~jugqoR_OpCq=E%*iw3;*ceDx$bo_ZL3->$6ed6zX(Z~t&A1YI2|VGX68 zI3%-@$#k|o^6q2}lQqJJ_p1)X^-u2c+5j8mx*duVBa_gl_C;Eqm-5?&A-BrG;47LL zelwNEy@i*z^p(9XgK6UH>MKIQ3kqQFZ(!zM<8=8^rVSYi73+`jLIYdZ3c~{}N0OJ{ zG*3_6QeNCTIV4`!7|xzH<4k02=WK~gXw@(PBuqPsQQd*^gnCXNs_P;jQzc=ykgGcP z`LS82?7QSl_9qi#c9{0ACnll^<(<~cqzd46`pL=3ta89*Lc_Y--D(9Nf|hZJm2~DL z;f>!$`Yy4NaD80dZMjtfzLmH)Wb9mov}OBuOC_#@R~?O`H$p`QEmEt@apwbNLw*kn z{Rs7H8$uBnkzDbPwZ0R&E!?h}y6LbTF?jEhMS+}=)8){cFU_Tm#GbAYa0_j>wul8| z*WG6nuT~8qK(6z;&dgA;qOtF~_ZAz0e7c0Y;{6B#sP{M4l@HfA0njS3TQFg3P3XI; zZ;Puenq8oAypruqAw0+8tKfEhtY3B%yi%{Q*j%`6ctk{?SP>HNdBC4?_Ah4y>E_}h zW}*63WNe46ISNm=fQ;oVQ!!evAe@sV_+CiV&T8a*#XP~c0j;(a4H-QZ1j=MpS7R-1 zoXcoxscc*1Av%%n3?#LBy=O4`NX-RfV+D+BLf*fO*0*KjJ1Xt${qu2xV44f zz6;r~PP)HO+JZke`cgyYn!O`4QreC!tcW{4JwHD~ujwhRF!NGt={a4rd`Eq$G-b#g z4kO90b@t2h1?hRx`9{=g z3WGN0DtgkhQG}j8!>~)NQL^h0%)+>ff^PVE+(O|DaN5NI*3>Nqj3dx! zx7w^u5f9j3w%ErHa%BqC?gq9m%=&EWO37BcAe7Cb zhAZ;@&LnH(o{^?zNVcT&l{Hvn>uzXGIsVcVhE3!lwL~_^M)@9EK;akaKMOnYVRWr@ z{K`?~!|~4i%>3Q6xNzVfH8yrjhYWT8^=;yMm{*KeSD58N!0X7ca)Yt0(K`c0B4lT4 z?0T!?Ns_O>Fgu2UMb3Mj6#!)z$MgZAbIb0?jJ~{(NqJ#<6Gloy(w(U&h&ObJ;~##C z@k>)R7Fnd^xL|JiWqngW1AdKFFH5jX2f@Mam#11_b zq-c&<|ATlzq0kdut&>y;y|G;6yT^-?9*BM1XlHAO3feT-N|Pb4Ye z@#XNSv64ehda;J=@6*(#+>@oT;H@jdFAZVWqgsX8mhQSeXqwy(UG!NdCXVa3hj`Rh zOXDM1hMj)XjQO>r{$okM=!EzuL_BnC;mu>$b7CMx@r*(UGnb-kz%7q2%=HeBO2)>N zR!rHINOVmf@1?tO&fUg38-G^b#+tlbP!n2`8z>GY7{QXZe4o+1ob2>C1)qy(IRT26gtKAL>WmKug+%kJ}qHhmXtBRL}x z=?$3JT_uORw=SXA`(Qw29rGb*1Mh$eUR)1pL`p!E6SuvXHc$zx|7xE~^uZ&zQ=;V) zY=_cDi}l3kd?l~Jy(31qWB7|(ql|ir(A}K$L}Gdn#>k#k9p_mpu=`Xm9wKSwp6QHY z*A59KkLiv8mGU~hEbR354lXR{)D)KFT-0MQXR>XuBf;T8y0gbGh9;dYIiAO?gPw1J z!cK1}wYFd%X9-l|1AFsW{o_I&!Q{Sr;e|AkExV9JeM(Ss-G;XM|F5L8;A*SuwlG!* zQY2_`cPqu+U5Z1n;_mKViWj#4Ek%k4cPZ}f?(Xi~yx;u+8QJ5Ez1P`m&bgkm>kBpM zV@*NPzdxYyha~kb*Tb$dZmbu^UH;PBt!$oWx8lRm5DjW~Iz~Dkh`2g%)(M;S%-;># zm2{2B!0wv>g{mP0WcwHsSAx5vG~yuO3)i6Co&*oHTH1>vx}xm-o@!Ha(IvSuGeR)$ z-*1yl_~UQ2$v+pwFN_|Mh1uPc9d@sQU3|GqaQ@OYTMleL4-XfcJgg3gW~`Ws(h#$r7B3nP2;l?Rrr z;BmHUpVfu6X(#c!lya5M%V1}-`*H*ZN%IlP*y`S<{@()ze;6;;%;l&g!3M)UN8fo@ z_3GFVl)pCSq+Fyl0ph{G$ck}psAN2tawwq!`RpcTZCqgwGv-xTI^W^eWD%BH!o(Cx zCMH1zG_J{?-}`xecibZGy5kX+%WR85`q0abBOWi7nN{$Ho`d6IvEzN>UKF~%w=2-p z?{Oo7nJ&CMisz4^^Hf{d6&-KK-IJC2WquMoJ~#fX6PsGz(+9$DtRhh`KFrTOzpT=u zqX0!UVW&aZ@XKOU6QFQ~jR>)c;6Tch*B&6)FPm2Jkp7ne$W1Q#Tnpvp=)kZ&Gk2q@ z6L<0vq7#6Z#g5l+?U>u_vRuz*Q|?S$^xGVkniW!WO2a9P^iJvO%pIO%6% zlA?^qM&m1t;TY&Q)Uh2_mlEKJd~ZA!+^@zUMWuj=z#E4xxEICb;7oDv#HquQn$}AP z&h#R7Qrft@$ByuReGv1QD}}~U4*wE08&~9zxx47@y>NYyr67P15AkonPxpH-9vGI? zaj;RBaW#`Qx+M65gl9g00yVu_nc@fbCjV+ z9r_ZA;Hhfum0kyCix@x~+2PcO=lvXm+v(i5T4yP0nwXE>~_t*LaJvXdat71^LM$=Jd!{&l$=EwFy$7U|lwi6lZk zruz_vWp9Gj!KSQ(U*xcS_Fvt{746+tNL*d@fX#g10fb_Y_r>nXTk&^DEeO4_nnt8H zbo-Igu2qe63?sg!uyb1sbNIcln7U|{XX+Jd(l}?wy`l1SxyVIqRn>s?{Is?fTh~-Ln}FdAYP`B zyR@oux@yXZSsY^fdy4N_Q&GkzO&9ISur{vtg zR5w3};qHAu#$}yLoTnR_lRsr_czy|PPJ2)d1f;XVEB+G~PYNe6mu$Ctx?c`am&(j_-GYIVjqei7vo zS7hGe?JFZP-=jv3Ktlr7{wSi&SmO*LnG#2RFs$n|Qo*RH0c})u(l8tD&FFr>gJ950 z)HSp`e^Fw7xwlHhhdky=>yX?kqNOvL4SJpHB5MEtP1K9yg20tGn7zBiIl*+WX&7$& zy3uC2zVdvv9OC=(-60k5vE&yi>4CJZ^iu>2BYqe@6XNjRX7P zfuO2p=0J9%RxUc`=ZO=OUoCszXt*3=@>Y0QtPG<9giYD4{RFv?*3K?B56q6 z$PVHMNA^444FL`IU)i>)sc1m8|rH(WROAp2Fb@>W?L#m~hUv;dug>Td61TmC>55lnN)@3xJu+9`v z88`01{p~mVKRVPToHjxgN;K;E|3uR+SxBR~Hc1yH?)0yU#*^xIAn2IpW~bJuvq)UP zIH75Eufz)3uo@6rYW#Q#NqO{y)nOQ1@zsBf_cVDXVK%q{<`%Iu&04J@iy1c&UNmH60)%eoeeFNn6=sORj>+Q z6y4XYs^JC-d2G{4qxmH#4B;mM*~1X^?O=o!K^Kf-Oz-7>VoKx zh<2jq0Y?`pPf<6I_GBXJ*tB`x|Jn+|-$Y(@d|{{;JFOSt*N(xPykp~ZB2SZK@n_5T zU=HJ+f`*ebJgitf)VSNf`+aaYqtSOP9EBS(hJe=CTmq5{tBmIE-wCB$@ z^H)`8@q*veku?;n!(%U#AEJq2W8iwW9RgLx%d2!0QLFM(mAD{d)IoC~WQsn(bHth8 z@RLwyL1%B6^-?^|$=!0)r3lgZWeZORlkMQoNf_TEXpvg_jkVSlo;?C_Qc>2Pe=(h4 z9^QI7u6W)VeZCjj|2an|f5jG|GZCgvDdr|^K*B;*$B|n?(jzlPrs6Ee(VY^BMwE?U zd&0Xq)rSQg^2wZg0OkI`Zu%)1zn7pc#{uM)GseOWsYc=5n0;_AAGt5_4p1AE*r@sN zK-0yW4x)BQ^Z*MBNCoDFp6Ptgce|+T(k{YKxpx;`l4sW07#Mg%3SRs7FSnT7>tY~* zN~tpTntqJSfD0PZJx;ozzUa2%yYo<0 zZOWNBI;m$~sbwjmD8WVWHcKM=&U!J7bBPmVerS#P&;WX;SChWsk;JNV+&vxMp|Ac% zz15@Z#(nU*9qjqohVGg`qc~e`cV|&>C7g)k1zuWQPEC${I-T<^$Ek08mBjGUrv3~6 z#QH|FuoKV41FGnb8KCIm`eP)R&HqpV704%Qy!~{W+kQNdAo3~x%t?X8#iEVZnn}4U zE|=hI%A7_Be?g}dv>{~M#L@2c9DHOIsn}^!U&;sb8dM>ao*<;rsOgg`REq;R zn}{OJEKy@QJ>=u+R>G|Rkt+U;0@8b83&-TcG7;7Mz50%Cr$z8U>sG9C%xNRi-y!zZ zFgDSs$iS9cvWr&e`ME%eJJncSP@yP^*1SJb4z+-*9p$TPrzcgv9CO!Xa+t2>VopwR zzfs_;=aY}GZdX|e)HA_WdKi=I!kG?4cuR)#hSVt*Z7fQTRp5GjS;Zn5XZv!$Gs)p3 zQ~SbTJh!M9!~?0d7n$lqXR(c_SqJW?a=+1a24X7v-n+ilG#e*e@6d^Oi>>eQqH7zt z&+ebKpSOFSFygg5^ZNddu>cTLP~%%7eUf)GMt%gG2Nn4-1}h9!s$SXRyfA8ZD2qR$ zNn3`N`mHppR2W(yG#Y?p4=1*Jbnq3XjQQ-`w)6>As{bkf1Ojn;Z$^|Iv&Zl!W8@Nz zZs;Qih_ItR(E-``ulkZTM0Gzj=i``@{3w}<`9L~7WV&$8cQ8+IY2Xq(9&^ROV6-5g zK*3yC#RZJ87u5%BX@TvSB`ld0WSGUo`ygSGwqNOwg5Ob}eOQ?(7@jm|;G`|EgoaLF zp{eA+Oyz>J^z?L{xaf2J&wQpzFK1Mpw#cYguT;jm#RarV3n>L2nfC$h;ts#eyT*pz zn}3Yk`64sTy?rt+9CgIzZ_k1%e8)?hc7oaLaYa~X)OG+uOl5<>S2#>Q+aM%DARjzD zDpP>Q8|E#_|z%&Lh68vJLM=L-I$Gl zbW!aOimE)AdF&i&&I6ez`WszZiyd9FV8r~1niBNfulkSj>e8RFA9gf59UA%|=N!b1 zPmSkMSmOoxeyZ~*+Qsy1v^NmyT3YNTQbYh17IxS*2|Ao!SU;O>(ZP=bYu732Q-Z3$ zLP=4S-hy23&+#+}^0v}8O&^rN%VEKY1zxQluTQr;+NGL~pIUh_o7K{mlCG^tVFEsR z;a)g0`)`=sq4C_3gjHdau=rj30ldWW)3U_S9}G6sJMjV0L2S4GUzB)>Vtt(D!*Z4v zvo3go0+H7IV1I!7`o8Nqwz(VU;FQZz1JBfRUv|dNp~1J5?mAGbCvsphOlxORh2Pec zu*9_TE1*GMae>+d-GDL_CRq)qjj_MvRdk5WrZ(u^(n-O0y+-i2*p5*QtqH9C06#8M7% zh{dI{ryE#6=1>la$)={2c#oRebiTOVdN^dJs0!N=^^O5+=QIpVCLkTal0(4&6NRxv z9r{p&%T`$l_SmRvt4Mp;^A$svS&d_L?Z33cFF*J`te~_uN;!f(vG3M1bwkdVuz=W)k-0#KG|D-4)pZ$Dj@CTW47YhM)(e1nDE4-bXwtD$|@l2^kD=P zR&V>G^HqSF`Zm>(gAQ|p!r#wxKv{z4CB59 zjAe3fE3}HN!@d!Ey#oXG7X=aC=kr33L!m|_-Ah59q|V@-Kv;&$=*F-A^(YjEU^cj1 z-qGXTftG92R5tEPcge9Fq3G?8F})^D?xCUUE5iIf(~<=)l%1Z%t$e1pg0|DH*A&(y z%B1B-WZxj3F!T2peoz+7MH|d`ITXd?KL6*eX=a5`vr>7sbel1^#7O1?EXdnyh)#6# z2!1t+Fnq)mP05Yt-rL;)s+fl%A}r7;9>Y0MShV9qMyXWgN;JE>gNSzqlEs!-{^G) z&@D-E@ZBxgR=!F?t)!~c-R6g}lvU0qwC9_&u(M;W16?;%W1v2hyDb|$oBmd?dn$_Y z;(N9dBz|io77c3BcB97^VtARuAIHKt@((|IVp$jjYzX4=eJn~?j>c`kM1ajcJzbZx zs6q17U?j@v8yxBx?So@9%=X#9srrpT!AwLQXsYB0x6$R$y2#Bvo2Q!VS|60 zDbygu(NMReFJy>xRe|Cj;5vrm&SIW}e?tw!sp(aJx5(oy!A#fQju_T%;gmeOb}g$b zZA4-C*1B+q^g!8b6A?n=boT50Ts-fVd#Q0DsK8Bl^*`o7Noc(5gwa(_7j zY2M|+-##He-}^IzqnOe2)R%S+Xz zrKN%VDFm?~ekq#~6bcHO`ecCJ7IJXh)E~?Dc(_=~udr6Z`w<;0_pj`+(1BZ_g8`Mi zNkBiGvy1P?)0$*itS4t?YhzS7OoYvSt{Hv&T4@m8w)(cB(m46)Ze@fyYBXrWCGd=W z+R*wRoQ#ZTD7@&Ta|piRnKRkFU_3OG zx80E^X8l=+X`RPI2g`%^7WR;bNavhNl~eK@puZwRAl>W*jqBsH zVU&Q%kL;K0{r#TDve|gQ(%)2ASTmBNb`__BHl{Z7_jiO7)waA@eKF1~j|)f55!WAwc{H=S;dt+iYRXauR11fS2k`m}i?ZQvWJRZwOPPA#qtF7!N9 zM-s~{&G@A~yF_GM4t=aUbkIs3^?F7^W=F#Tt3X(UE!ktY&fQLlks6N* zbKT@pT+)?>tlQFgj*01rT7hQ$a#)7awlXJ8#3{FPJYiN7_Q9@Bl zT_gHmSu6&e7$aA;^XrpbhYh-p$sCiyN|J9NB8?Sg&zc&;bVP_9ZV4OLf#s>TH*`ZAvh;LX}Py*Sr?A5FWWnbjg?54o}X{{ z>&qHO{`E+UDWTD^<5>6&McgxC-3&VaY4cS;A{*QXvCksESoHJ~30DjLSUSJO`x(?J z!0s4APM#%~q)1J#&8V;x-4zv5>bV#H`7jl)t~l`nPF{aLo#5ML?rO97Z~{3X)wiT% zR%%R*^U5cvuZTogGF|C9-JG9PK<~uGfcZHF*q8e41Y&aHRN>Vm5Y%C?(cYQ?aqDz( zb){}r_5|O<_FFTv7X5bExtp1p$$N*RKzJ1rdUvnY@q584UnGtMTTljtXcrL9MCw(s zLlgF-Bn3F8*xMQGt){spM0;`HI7wx-o+BSABEe;7YF9=kq3H+Ay|d+3=2c(uh{AXZ72i`FG^ zu($F7`nd6;{ck5G{~&qzuJwK7>=0;zu?gc-kZ8q_jP3S%``#!v5WL_SoA2K$ z_$gj@4kMRV=0;0PDNEG3oJfb*?sGvHxn@%bU-o-OMvRm&@1$)k?BdAnWW5{t3 z^J7%CukYId6c83vkqbUSzvOyFJO*MQXBll!0)6#eyLSbc zU$+$#2{5;jXu);_plA8{Up%ZoUEA=9jRa?8?A0PAs7=jIUZ!-1 zcln-w3>hn$_H&H;xU+&H;40IUXG-$fnx&B@I2ky9`*+p`O6tQs9GwiyaI81w;cAz~ zMkJh184nFNhAYoZtYi*~fRf?recdtr?te#++7xvA*Zbi78E!P{kiNDx_p^lUxKs%a zNUi5x?Pc*O7Pbz~4bIcLHlp{IsMsuohc-?a)S#YMDjM}PX71|yF<|V zJX5*nFuD?5XC`1U4RuR&Kf}YURB^Z~|1&94pZ#*+$@h;&5leBG`CHETC>>d z!iJm7FzlZgjH7PewhPTB&YBx4m`5+z9`)fxCODpDsvR1eizQLp=k2Ss+4}qlV~jmf zn(4*-&I#K4^6D(GpHpqaOj`sh=iZ&SE>BQHRQvI+da<+(F%H^m@WBkzbShc_3b;fx zRk&V9?xmwXvdGtP3NdCnD~5I69zEo&&vfd`fD{`)#A(pt&p2J5h@+e#op`-0(BK=r z6q5s-h>JAiTuZt3!EMxU9~UNe&YPn9N+3D6YE)$pAcO!<mxq_Q|*vb;{%_AWVl zd_T*l&#L?$#`8S%BR=-`a<*_bYIMbBbM(~y#YB=$gU;F%b6ska&&gV4lKDSpR{7hn zvhdQV!lAUGKPe10Ag+SybP0laE@UX;mX!m+P^n>Bve{_B zKm06;t>q?!^U-J2f$st-%)bp~*lW#BKWKgjuPbQm7cw`OhgA-VncFBh&Y<(0?ccfo zPp6?HGCb$3XXN8`K}hH63Un)%^2uPZeL{d8)z=_c^s^-mu}-a3L`8RM*xU z4lec6>bukRD0#z_fYf$>EETjK5bFo=2NPFA2^P7yMEs1U&33V-4 zf2+XUnh(cRQ2l93e^u7%kKBGt)v1E-okd2YSZZH?Um8C#U8gUG` zV~sh6B-1ov9|k}BU-y;#p5d%l`^z+?PfYtq{RRLWl5*cJC#B0+F>P8%C49^Gv1P5}JEC-fMzmJ=Q+Jxbu>0 zUjG_dVW^G8t8tvh#Sq|!M}RNBLKpVXe^B>ZY9&H=V?0mdc39ye>-@voe7^mA5JYsf zTJerdE%C7qLiD9^LEw^b63e4}G+%+js2ZiHyAgq#o_;>;Lhm-iF5; z-UBY7RSjfd4eZ*tyP&XhL^cU}e<09r+A(ecVIO?U86{Qr5l?L<>BHPswU5KMyc;A`Ml%(aE>29n05 z!haMLD+*EwCPIcs&h4Ax+@$uI@-a@z<&Ox?0+^D#MfEbx+*t+C`7runyAC5{u%R1I z_sox9x?)czy?LfStZ;ki2ny(<3SM$nu1ha`3Ml52PVc>a-@9D2aXWc4!oEB9z@vCr zFyuH7!+cMge&Q*lSni&3qYKzr6hWV*UJmW z&L>XI(qQk6*^!REN%2QPW9;#?@y#z0(0#tLp6}n>CPu`4^RpF)G(`aJ;gL1fW5{N1 zntlC*k%6Y-+||zxp+IvwtSb+d7^@G9ghW`nU8koy6Q74Z2&`u>f3;|b8u2Px-4Qr$ z4lN|e!__kG=t~u?z|+v3k?{ra(yO}~;-qRGCl9~26ZX<=D3wtdw3((k($2ou=D$07T_ z_j$lE=l0pY^_bhZ{-6})nSSs98HJrx6;3F0)Wv`32ux{NoD1h0q{q{lq7uuzI#LVs z!R!QK-qRoq$3=`}2)4D8?u=KzHsDM4DG3XM8d)s~fL zWK{dhlmr<}a3S%{&&ulIlZyXQO^VubnoZQLYwqjGN~^MX85J7XZxSdX$~-GEWCX;! zw<(B9x1Yp5aK!S6x2{LpmI#Amm&<4$e5}@3Jjq{rS`Kl^MtfeNy2Y&CuSz$hM;WNvIBFKZv*xA7~OVUyW(< z6SBBj%IBYXAiuqKu;-zIdTz?Wzjj{m7>M#Kr~+UWO$nSJ zlS=@9T}1O09v zGU2>hc|jV+$K>1BQ{+r<4Q99K(S?03Lng|4dqu(H=|hioX1MU|tjQAzY>$zT4^; zm(sU6Tq*X8O=A{i;4#W>vXG(3zpsL~=U%)Lvv+2tyv(>|MZ5hU&ce;OgY(OuyofZquOUML&N zVOm~U$~XVDy%JOIm({tXvhb?eDq$k*nlazm4_BWNH18zhuY1fJoRgK!v$gBnKK-G4 z33}{3rYEPc+p6|XiLzfVJZnA?YRqLJVxvq_+(ddyR53tCNU=%D)H9mO3y*_1)s0K^ zZhN`jZ2gd3nE?#@o>AC9g_||0EN=hN`m+08)2cS6s$<{K{lJe837A_l@y$Awh^%yI z(yi(2g+;ogx%|cg-}UmcUK6gpev#0fpubkh>KTcpBL-4AeKcOrv(Oj(u+bj|Th<^0 zdK1UwhKdZiS{Zrmuf*q-)^Z81B@2`Cn*243D)y}hd5&=^DjnDTvqz=h3ybC*KJfp! zZT0?g%?Vgl!n~L;-(iZ6Cyf>Li8gx26g= z<{L!<)4_T<>cIqJ1dCeKBjC(i3_A7VPzmUk>s{iq6?Q&ZsQUGRiI69YYVvAV-7slV zsx^UK&&>ViJV!m1n_MBi4NG7&wnS8Cew)|WV(8AQDXZW(VcLf0{Q1vr?w@&J!r#`I z38{`Kb_J`SkOLDLvuO1%rfzO_LS0_rrjst|5X51Ru1s-6Q>5;fjPkTEwUkn0#U}mt zuaUpo+eMmhs)yU1*2l6t+@FKt*>v=n@9ZMS>@aHQH_T#Sj)p8%ti$Z>OP%w>i!!O) z?3N2bl~vChhETedjEW_GoOy&{Hf=Ns1p@y>G9yi`7QmQmRqM00`i>Q;8fdz{Ny~X($nU>tKs#9Cg*L1_zJ!IUPsx%co;G_LN_YQTf2gl?i9JR zak78fu*i#oN|w5KIpc4S3aIZMlZZ6qY5z_!ZDb4~eTq|rJ%9g6he*@b_QTFQvW zAK+9L9W74-Vv6<-52uTY*Y@{Faqj27^RxB$6$PPq_XL>@{mr!+XR`j1X$}80=+is= zQQ({+a?XumiOWAF&d|HC!wWsbi*Bj)iipb|qPCob6x1Y(+$L4LHds?j1vogvQjB#r z(|XDP1j2xIxSS$F|4>@VYnJ~--S%&C++mqP;;0rMWd~K5R zgyZhRa?9kfd758VE;MN;Z7jknDq&-eJdLj~b+Ay-k;?C9C9PEy5wb19#4gAzxVVl-S&*y6XqQX3;EL`n;z z4)_owdEny7Z%u#ycVSNUi`)ndvK%PI3)}a9{5?J|*D<`b8W*XtGM%sT6yfO(3PtZ* z--#SwPO2s+8~i=*&+zZlhL723(f+AOid%9MDG1uYAdW(f9JjWCZza)ngRIpaC^8{a zncotk5p!6TY4><{6h2s7@ihxHD{FkMm@QEpQ%qvREpEAmnD;Q`;#<9ti(1EG{(=in z1}bpRW1A>s$$#D7+;Xm+i{~xOOsaFB-o)9Ol=UD>1`1@X)L1xO?A1v~ylc_p#pfzN z{0|ijfk~+O4tX6J!sUy{6U;d#1+C8Cw*(&tn3%a-xr;ES<*sWoJAlaKnz_4bllkeA zUV9ltK!-u0yU5Z^>Nhm}hbpzxxC+<}#9@d=Od(eMrJpui3DeUv^NRiuE!Pj?U!4f} z1-TRexo4BNYT@L_e^UCXERDt!rHNBcoUo#+qa5)T{pep*WKdclIp=kPAyA-p0!I3B zqoW6WPEiaHCXFV!@mv4#KTbQdBC= zw0gmmrfu+T*e=(pdaFQGQiisi_-EIA{$3~dObcp|E(lbR-I_9Xv<@?!CFZ7EW)od7I-)m*joKDvAgwH# zI&{1(oHnu=Aj)!{`A1sab497JZ{G0 z81V9MyFa(X*XF3up@1I=pfKoxl^T~FyQ&I~p-{E5Xyy1~_(?`NG0_>ic}bKr?{pHA zar+|+!;|O!((Bo@1G;qnY*wlAFY(jQm-K)as!3(UaCl=SZDUK}s50%| z3?3Wn{*shr^dH?#tGn`q0Vn5Ow8~4V<-8~&FBOYKG&4zEl^=uyMN+70(m&wFX%|)H zQ`4B{XCpwDT9!g?PWMAD5=SfjGAxdf+17$YcpoSR{l0=_A%k{_PU`GSS8&aHJg`=> zc3&J&iw<8C?GW3lM|++^@1yAwECV}A%?_ss5HkRb51GYbpriTOY6`y9U0zOFQH5SlA`~6s<8|{t30UfY?%8 zQuS6(ek_YQ!EoL#^6x(r#;DOUf8!u$icMO`+m3mG<0`G-m*Ko1 zgOtH+F@i8OPq9|{^SWe*N;Qc}@s$*DNR5#RFUtcMNd-L9pP%V@9|10N&CS(&rX&4LmOIRo&=R%zlu}Z|E`>ONqH>~Eu{X!O0VG(+ z1s>K3)h1@A2&c-KV>;5y;y`RQgac7)76kDnajQW)P2+OSgI6pR@o@#-kA<+RGOEbQ zm{$6~%KXd49^?-b(f?Z0z?Dm~UJy8!#*`8Yf6W#`1Wy^xISUTg7pWcIIQLgeZ;2Dz z#rJxcs}--_`uL9*;2Q~Y@N@Ug%-|F z>@9>L{Bj{`WMpKydfm*{elvBJE#Ps}P}k599~;-lm?D1;#UZpr@4DF0rYU&UEion& zN-|7<#(eyU$t&QJOSXJ9Pma*!@}2TyL&-(;0KqswJ@TE%1JW?@Z6p*LQQHeQXll+1 zffNNl78B0Mb_J3>PnFG|`gbuy5sIgMnCO(+4j2DTS~}a8G-zhXq^VP5G1~L6u%N-8 z0Up@B{t_A*y8XF7Ud#ia55a59ABQ1XKx{U#Y^{MpPn z(NOfl+@4ZaVlYZ|u-YJ$6I&}wttN)qQ&d#=w4&C8&k!QJi4Y`e+fh?_-Z= 400, 'First argument must be a number (400+):', statusCode); + + error.isBoom = true; + error.isServer = numberCode >= 500; + + if (!error.hasOwnProperty('data')) { + error.data = null; + } + + error.output = { + statusCode: numberCode, + payload: {}, + headers: {} + }; + + error.reformat = internals.reformat; + error.reformat(); + + if (!message && + !error.message) { + + message = error.output.payload.error; + } + + if (message) { + error.message = (message + (error.message ? ': ' + error.message : '')); + } + + return error; +}; + + +internals.reformat = function () { + + this.output.payload.statusCode = this.output.statusCode; + this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; + + if (this.output.statusCode === 500) { + this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user + } + else if (this.message) { + this.output.payload.message = this.message; + } +}; + + +// 4xx Client Errors + +exports.badRequest = function (message, data) { + + return internals.create(400, message, data, exports.badRequest); +}; + + +exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) + + var err = internals.create(401, message, undefined, exports.unauthorized); + + if (!scheme) { + return err; + } + + var wwwAuthenticate = ''; + var i = 0; + var il = 0; + + if (typeof scheme === 'string') { + + // function (message, scheme, attributes) + + wwwAuthenticate = scheme; + + if (attributes || message) { + err.output.payload.attributes = {}; + } + + if (attributes) { + var names = Object.keys(attributes); + for (i = 0, il = names.length; i < il; ++i) { + var name = names[i]; + if (i) { + wwwAuthenticate += ','; + } + + var value = attributes[name]; + if (value === null || + value === undefined) { // Value can be zero + + value = ''; + } + wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + err.output.payload.attributes[name] = value; + } + } + + if (message) { + if (attributes) { + wwwAuthenticate += ','; + } + wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + err.output.payload.attributes.error = message; + } + else { + err.isMissing = true; + } + } + else { + + // function (message, wwwAuthenticate[]) + + var wwwArray = scheme; + for (i = 0, il = wwwArray.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ', '; + } + + wwwAuthenticate += wwwArray[i]; + } + } + + err.output.headers['WWW-Authenticate'] = wwwAuthenticate; + + return err; +}; + + +exports.forbidden = function (message, data) { + + return internals.create(403, message, data, exports.forbidden); +}; + + +exports.notFound = function (message, data) { + + return internals.create(404, message, data, exports.notFound); +}; + + +exports.methodNotAllowed = function (message, data) { + + return internals.create(405, message, data, exports.methodNotAllowed); +}; + + +exports.notAcceptable = function (message, data) { + + return internals.create(406, message, data, exports.notAcceptable); +}; + + +exports.proxyAuthRequired = function (message, data) { + + return internals.create(407, message, data, exports.proxyAuthRequired); +}; + + +exports.clientTimeout = function (message, data) { + + return internals.create(408, message, data, exports.clientTimeout); +}; + + +exports.conflict = function (message, data) { + + return internals.create(409, message, data, exports.conflict); +}; + + +exports.resourceGone = function (message, data) { + + return internals.create(410, message, data, exports.resourceGone); +}; + + +exports.lengthRequired = function (message, data) { + + return internals.create(411, message, data, exports.lengthRequired); +}; + + +exports.preconditionFailed = function (message, data) { + + return internals.create(412, message, data, exports.preconditionFailed); +}; + + +exports.entityTooLarge = function (message, data) { + + return internals.create(413, message, data, exports.entityTooLarge); +}; + + +exports.uriTooLong = function (message, data) { + + return internals.create(414, message, data, exports.uriTooLong); +}; + + +exports.unsupportedMediaType = function (message, data) { + + return internals.create(415, message, data, exports.unsupportedMediaType); +}; + + +exports.rangeNotSatisfiable = function (message, data) { + + return internals.create(416, message, data, exports.rangeNotSatisfiable); +}; + + +exports.expectationFailed = function (message, data) { + + return internals.create(417, message, data, exports.expectationFailed); +}; + +exports.badData = function (message, data) { + + return internals.create(422, message, data, exports.badData); +}; + + +exports.preconditionRequired = function (message, data) { + + return internals.create(428, message, data, exports.preconditionRequired); +}; + + +exports.tooManyRequests = function (message, data) { + + return internals.create(429, message, data, exports.tooManyRequests); +}; + + +// 5xx Server Errors + +exports.internal = function (message, data, statusCode) { + + return internals.serverError(message, data, statusCode, exports.internal); +}; + +internals.serverError = function (message, data, statusCode, ctor) { + + var error; + if (data instanceof Error) { + error = exports.wrap(data, statusCode, message); + } else { + error = internals.create(statusCode || 500, message, undefined, ctor); + error.data = data; + } + + return error; +}; + + +exports.notImplemented = function (message, data) { + + return internals.serverError(message, data, 501, exports.notImplemented); +}; + + +exports.badGateway = function (message, data) { + + return internals.serverError(message, data, 502, exports.badGateway); +}; + + +exports.serverTimeout = function (message, data) { + + return internals.serverError(message, data, 503, exports.serverTimeout); +}; + + +exports.gatewayTimeout = function (message, data) { + + return internals.serverError(message, data, 504, exports.gatewayTimeout); +}; + + +exports.badImplementation = function (message, data) { + + var err = internals.serverError(message, data, 500, exports.badImplementation); + err.isDeveloperError = true; + return err; +}; diff --git a/deploy/core/node_modules/boom/package.json b/deploy/core/node_modules/boom/package.json new file mode 100644 index 000000000..53cce9ce1 --- /dev/null +++ b/deploy/core/node_modules/boom/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "boom@2.x.x", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/hawk" + ] + ], + "_from": "boom@>=2.0.0 <3.0.0", + "_id": "boom@2.10.1", + "_inCache": true, + "_installable": true, + "_location": "/boom", + "_nodeVersion": "0.10.40", + "_npmUser": { + "email": "arbretz@gmail.com", + "name": "arb" + }, + "_npmVersion": "2.11.1", + "_phantomChildren": {}, + "_requested": { + "name": "boom", + "raw": "boom@2.x.x", + "rawSpec": "2.x.x", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/cryptiles", + "/hawk" + ], + "_resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f", + "_shrinkwrap": null, + "_spec": "boom@2.x.x", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/boom/issues" + }, + "dependencies": { + "hoek": "2.x.x" + }, + "description": "HTTP-friendly error objects", + "devDependencies": { + "code": "1.x.x", + "lab": "7.x.x" + }, + "directories": {}, + "dist": { + "shasum": "39c8918ceff5799f83f9492a848f625add0c766f", + "tarball": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, + "engines": { + "node": ">=0.10.40" + }, + "gitHead": "ff1a662a86b39426cdd18f4441b112d307a34a6f", + "homepage": "https://github.com/hapijs/boom#readme", + "keywords": [ + "error", + "http" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + { + "name": "wyatt", + "email": "wpreul@gmail.com" + }, + { + "name": "arb", + "email": "arbretz@gmail.com" + } + ], + "name": "boom", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/boom.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-cov-html": "lab -a code -r html -o coverage.html -L" + }, + "version": "2.10.1" +} diff --git a/deploy/core/node_modules/boom/test/index.js b/deploy/core/node_modules/boom/test/index.js new file mode 100755 index 000000000..79a59e9f4 --- /dev/null +++ b/deploy/core/node_modules/boom/test/index.js @@ -0,0 +1,654 @@ +// Load modules + +var Code = require('code'); +var Boom = require('../lib'); +var Lab = require('lab'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var describe = lab.describe; +var it = lab.it; +var expect = Code.expect; + + +it('returns the same object when already boom', function (done) { + + var error = Boom.badRequest(); + var wrapped = Boom.wrap(error); + expect(error).to.equal(wrapped); + done(); +}); + +it('returns an error with info when constructed using another error', function (done) { + + var error = new Error('ka-boom'); + error.xyz = 123; + var err = Boom.wrap(error); + expect(err.xyz).to.equal(123); + expect(err.message).to.equal('ka-boom'); + expect(err.output).to.deep.equal({ + statusCode: 500, + payload: { + statusCode: 500, + error: 'Internal Server Error', + message: 'An internal server error occurred' + }, + headers: {} + }); + expect(err.data).to.equal(null); + done(); +}); + +it('does not override data when constructed using another error', function (done) { + + var error = new Error('ka-boom'); + error.data = { useful: 'data' }; + var err = Boom.wrap(error); + expect(err.data).to.equal(error.data); + done(); +}); + +it('sets new message when none exists', function (done) { + + var error = new Error(); + var wrapped = Boom.wrap(error, 400, 'something bad'); + expect(wrapped.message).to.equal('something bad'); + done(); +}); + +it('throws when statusCode is not a number', function (done) { + + expect(function () { + + Boom.create('x'); + }).to.throw('First argument must be a number (400+): x'); + done(); +}); + +it('will cast a number-string to an integer', function (done) { + + var codes = [ + { input: '404', result: 404 }, + { input: '404.1', result: 404 }, + { input: 400, result: 400 }, + { input: 400.123, result: 400 }]; + for (var i = 0, il = codes.length; i < il; ++i) { + var code = codes[i]; + var err = Boom.create(code.input); + expect(err.output.statusCode).to.equal(code.result); + } + + done(); +}); + +it('throws when statusCode is not finite', function (done) { + + expect(function () { + + Boom.create(1 / 0); + }).to.throw('First argument must be a number (400+): null'); + done(); +}); + +it('sets error code to unknown', function (done) { + + var err = Boom.create(999); + expect(err.output.payload.error).to.equal('Unknown'); + done(); +}); + +describe('create()', function () { + + it('does not sets null message', function (done) { + + var error = Boom.unauthorized(null); + expect(error.output.payload.message).to.not.exist(); + expect(error.isServer).to.be.false(); + done(); + }); + + it('sets message and data', function (done) { + + var error = Boom.badRequest('Missing data', { type: 'user' }); + expect(error.data.type).to.equal('user'); + expect(error.output.payload.message).to.equal('Missing data'); + done(); + }); +}); + +describe('isBoom()', function () { + + it('returns true for Boom object', function (done) { + + expect(Boom.badRequest().isBoom).to.equal(true); + done(); + }); + + it('returns false for Error object', function (done) { + + expect((new Error()).isBoom).to.not.exist(); + done(); + }); +}); + +describe('badRequest()', function () { + + it('returns a 400 error statusCode', function (done) { + + var error = Boom.badRequest(); + + expect(error.output.statusCode).to.equal(400); + expect(error.isServer).to.be.false(); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badRequest('my message').message).to.equal('my message'); + done(); + }); + + it('sets the message to HTTP status if none provided', function (done) { + + expect(Boom.badRequest().message).to.equal('Bad Request'); + done(); + }); +}); + +describe('unauthorized()', function () { + + it('returns a 401 error statusCode', function (done) { + + var err = Boom.unauthorized(); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers).to.deep.equal({}); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.unauthorized('my message').message).to.equal('my message'); + done(); + }); + + it('returns a WWW-Authenticate header when passed a scheme', function (done) { + + var err = Boom.unauthorized('boom', 'Test'); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"'); + done(); + }); + + it('returns a WWW-Authenticate header set to the schema array value', function (done) { + + var err = Boom.unauthorized(null, ['Test','one','two']); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two'); + done(); + }); + + it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) { + + var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 }); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"'); + expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' }); + done(); + }); + + it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) { + + var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 }); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"'); + expect(err.isMissing).to.equal(true); + done(); + }); + + it('sets the isMissing flag when error message is empty', function (done) { + + var err = Boom.unauthorized('', 'Basic'); + expect(err.isMissing).to.equal(true); + done(); + }); + + it('does not set the isMissing flag when error message is not empty', function (done) { + + var err = Boom.unauthorized('message', 'Basic'); + expect(err.isMissing).to.equal(undefined); + done(); + }); + + it('sets a WWW-Authenticate when passed as an array', function (done) { + + var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']); + expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"'); + done(); + }); +}); + + +describe('methodNotAllowed()', function () { + + it('returns a 405 error statusCode', function (done) { + + expect(Boom.methodNotAllowed().output.statusCode).to.equal(405); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.methodNotAllowed('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('notAcceptable()', function () { + + it('returns a 406 error statusCode', function (done) { + + expect(Boom.notAcceptable().output.statusCode).to.equal(406); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notAcceptable('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('proxyAuthRequired()', function () { + + it('returns a 407 error statusCode', function (done) { + + expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.proxyAuthRequired('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('clientTimeout()', function () { + + it('returns a 408 error statusCode', function (done) { + + expect(Boom.clientTimeout().output.statusCode).to.equal(408); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.clientTimeout('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('conflict()', function () { + + it('returns a 409 error statusCode', function (done) { + + expect(Boom.conflict().output.statusCode).to.equal(409); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.conflict('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('resourceGone()', function () { + + it('returns a 410 error statusCode', function (done) { + + expect(Boom.resourceGone().output.statusCode).to.equal(410); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.resourceGone('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('lengthRequired()', function () { + + it('returns a 411 error statusCode', function (done) { + + expect(Boom.lengthRequired().output.statusCode).to.equal(411); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.lengthRequired('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('preconditionFailed()', function () { + + it('returns a 412 error statusCode', function (done) { + + expect(Boom.preconditionFailed().output.statusCode).to.equal(412); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.preconditionFailed('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('entityTooLarge()', function () { + + it('returns a 413 error statusCode', function (done) { + + expect(Boom.entityTooLarge().output.statusCode).to.equal(413); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.entityTooLarge('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('uriTooLong()', function () { + + it('returns a 414 error statusCode', function (done) { + + expect(Boom.uriTooLong().output.statusCode).to.equal(414); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.uriTooLong('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('unsupportedMediaType()', function () { + + it('returns a 415 error statusCode', function (done) { + + expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.unsupportedMediaType('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('rangeNotSatisfiable()', function () { + + it('returns a 416 error statusCode', function (done) { + + expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('expectationFailed()', function () { + + it('returns a 417 error statusCode', function (done) { + + expect(Boom.expectationFailed().output.statusCode).to.equal(417); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.expectationFailed('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('badData()', function () { + + it('returns a 422 error statusCode', function (done) { + + expect(Boom.badData().output.statusCode).to.equal(422); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badData('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('preconditionRequired()', function () { + + it('returns a 428 error statusCode', function (done) { + + expect(Boom.preconditionRequired().output.statusCode).to.equal(428); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.preconditionRequired('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('tooManyRequests()', function () { + + it('returns a 429 error statusCode', function (done) { + + expect(Boom.tooManyRequests().output.statusCode).to.equal(429); + done(); + }); + + it('sets the message with the passed-in message', function (done) { + + expect(Boom.tooManyRequests('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('serverTimeout()', function () { + + it('returns a 503 error statusCode', function (done) { + + expect(Boom.serverTimeout().output.statusCode).to.equal(503); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.serverTimeout('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('forbidden()', function () { + + it('returns a 403 error statusCode', function (done) { + + expect(Boom.forbidden().output.statusCode).to.equal(403); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.forbidden('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('notFound()', function () { + + it('returns a 404 error statusCode', function (done) { + + expect(Boom.notFound().output.statusCode).to.equal(404); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notFound('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('internal()', function () { + + it('returns a 500 error statusCode', function (done) { + + expect(Boom.internal().output.statusCode).to.equal(500); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + var err = Boom.internal('my message'); + expect(err.message).to.equal('my message'); + expect(err.isServer).to.true(); + expect(err.output.payload.message).to.equal('An internal server error occurred'); + done(); + }); + + it('passes data on the callback if its passed in', function (done) { + + expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data'); + done(); + }); + + it('returns an error with composite message', function (done) { + + try { + JSON.parse('{'); + } + catch (err) { + var boom = Boom.internal('Someting bad', err); + expect(boom.message).to.equal('Someting bad: Unexpected end of input'); + expect(boom.isServer).to.be.true(); + done(); + } + }); +}); + +describe('notImplemented()', function () { + + it('returns a 501 error statusCode', function (done) { + + expect(Boom.notImplemented().output.statusCode).to.equal(501); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notImplemented('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('badGateway()', function () { + + it('returns a 502 error statusCode', function (done) { + + expect(Boom.badGateway().output.statusCode).to.equal(502); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badGateway('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('gatewayTimeout()', function () { + + it('returns a 504 error statusCode', function (done) { + + expect(Boom.gatewayTimeout().output.statusCode).to.equal(504); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.gatewayTimeout('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('badImplementation()', function () { + + it('returns a 500 error statusCode', function (done) { + + var err = Boom.badImplementation(); + expect(err.output.statusCode).to.equal(500); + expect(err.isDeveloperError).to.equal(true); + expect(err.isServer).to.be.true(); + done(); + }); +}); + +describe('stack trace', function () { + + it('should omit lib', function (done) { + + ['badRequest', 'unauthorized', 'forbidden', 'notFound', 'methodNotAllowed', + 'notAcceptable', 'proxyAuthRequired', 'clientTimeout', 'conflict', + 'resourceGone', 'lengthRequired', 'preconditionFailed', 'entityTooLarge', + 'uriTooLong', 'unsupportedMediaType', 'rangeNotSatisfiable', 'expectationFailed', + 'badData', 'preconditionRequired', 'tooManyRequests', + + // 500s + 'internal', 'notImplemented', 'badGateway', 'serverTimeout', 'gatewayTimeout', + 'badImplementation' + ].forEach(function (name) { + + var err = Boom[name](); + expect(err.stack).to.not.match(/\/lib\/index\.js/); + }); + + done(); + }); +}); diff --git a/deploy/core/node_modules/caseless/LICENSE b/deploy/core/node_modules/caseless/LICENSE new file mode 100644 index 000000000..61789f4a4 --- /dev/null +++ b/deploy/core/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +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: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +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 +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 \ No newline at end of file diff --git a/deploy/core/node_modules/caseless/README.md b/deploy/core/node_modules/caseless/README.md new file mode 100644 index 000000000..e5077a216 --- /dev/null +++ b/deploy/core/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/deploy/core/node_modules/caseless/index.js b/deploy/core/node_modules/caseless/index.js new file mode 100644 index 000000000..b194734ee --- /dev/null +++ b/deploy/core/node_modules/caseless/index.js @@ -0,0 +1,67 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i=0.12.0 <0.13.0", + "_id": "caseless@0.12.0", + "_inCache": true, + "_installable": true, + "_location": "/caseless", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/caseless-0.12.0.tgz_1485466648253_0.3714302028529346" + }, + "_npmUser": { + "email": "mikeal.rogers@gmail.com", + "name": "mikeal" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "name": "caseless", + "raw": "caseless@~0.12.0", + "rawSpec": "~0.12.0", + "scope": null, + "spec": ">=0.12.0 <0.13.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "_shasum": "1b681c21ff84033c826543090689420d187151dc", + "_shrinkwrap": null, + "_spec": "caseless@~0.12.0", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request", + "author": { + "email": "mikeal.rogers@gmail.com", + "name": "Mikeal Rogers" + }, + "bugs": { + "url": "https://github.com/mikeal/caseless/issues" + }, + "dependencies": {}, + "description": "Caseless object set/get/has, very useful when working with HTTP headers.", + "devDependencies": { + "tape": "^2.10.2" + }, + "directories": {}, + "dist": { + "shasum": "1b681c21ff84033c826543090689420d187151dc", + "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" + }, + "gitHead": "af91df7878a8b53cf3dc2e9a086dc57ba8301649", + "homepage": "https://github.com/mikeal/caseless#readme", + "keywords": [ + "caseless", + "headers", + "http" + ], + "license": "Apache-2.0", + "main": "index.js", + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "name": "caseless", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mikeal/caseless.git" + }, + "scripts": { + "test": "node test.js" + }, + "test": "node test.js", + "version": "0.12.0" +} diff --git a/deploy/core/node_modules/caseless/test.js b/deploy/core/node_modules/caseless/test.js new file mode 100644 index 000000000..f55196cc0 --- /dev/null +++ b/deploy/core/node_modules/caseless/test.js @@ -0,0 +1,67 @@ +var tape = require('tape') + , caseless = require('./') + ; + +tape('set get has', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(17) + c.set('a-Header', 'asdf') + t.equal(c.get('a-header'), 'asdf') + t.equal(c.has('a-header'), 'a-Header') + t.ok(!c.has('nothing')) + // old bug where we used the wrong regex + t.ok(!c.has('a-hea')) + c.set('a-header', 'fdsa') + t.equal(c.get('a-header'), 'fdsa') + t.equal(c.get('a-Header'), 'fdsa') + c.set('a-HEADER', 'more', false) + t.equal(c.get('a-header'), 'fdsa,more') + + t.deepEqual(headers, {'a-Header': 'fdsa,more'}) + c.swap('a-HEADER') + t.deepEqual(headers, {'a-HEADER': 'fdsa,more'}) + + c.set('deleteme', 'foobar') + t.ok(c.has('deleteme')) + t.ok(c.del('deleteme')) + t.notOk(c.has('deleteme')) + t.notOk(c.has('idonotexist')) + t.ok(c.del('idonotexist')) + + c.set('tva', 'test1') + c.set('tva-header', 'test2') + t.equal(c.has('tva'), 'tva') + t.notOk(c.has('header')) + + t.equal(c.get('tva'), 'test1') + +}) + +tape('swap', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(4) + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) + // Set Header. + c.set('content-type', 'application/json') + // Swap Header With Itself. + c.swap('content-type') + // Does Not Delete Itself. + t.ok(c.has('content-type')) + // Swap Header With a Different Header. + c.swap('Content-Type') + // Still Has Header. + t.ok(c.has('Content-Type')) + // Delete Header. + c.del('Content-Type') + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) +}) diff --git a/deploy/core/node_modules/co/History.md b/deploy/core/node_modules/co/History.md new file mode 100644 index 000000000..68fbb154d --- /dev/null +++ b/deploy/core/node_modules/co/History.md @@ -0,0 +1,172 @@ +4.6.0 / 2015-07-09 +================== + + * support passing the rest of the arguments to co into the generator + + ```js + function *gen(...args) { } + co(gen, ...args); + ``` + +4.5.0 / 2015-03-17 +================== + + * support regular functions (that return promises) + +4.4.0 / 2015-02-14 +================== + + * refactor `isGeneratorFunction` + * expose generator function from `co.wrap()` + * drop support for node < 0.12 + +4.3.0 / 2015-02-05 +================== + + * check for generator functions in a ES5-transpiler-friendly way + +4.2.0 / 2015-01-20 +================== + + * support comparing generator functions with ES6 transpilers + +4.1.0 / 2014-12-26 +================== + + * fix memory leak #180 + +4.0.2 / 2014-12-18 +================== + + * always return a global promise implementation + +4.0.1 / 2014-11-30 +================== + + * friendlier ES6 module exports + +4.0.0 / 2014-11-15 +================== + + * co now returns a promise and uses promises underneath + * `co.wrap()` for wrapping generator functions + +3.1.0 / 2014-06-30 +================== + + * remove `setImmediate()` shim for node 0.8. semi-backwards breaking. + Users are expected to shim themselves. Also returns CommonJS browser support. + * added key order preservation for objects. thanks @greim + * replace `q` with `bluebird` in benchmarks and tests + +3.0.6 / 2014-05-03 +================== + + * add `setImmediate()` fallback to `process.nextTick` + * remove duplicate code in toThunk + * update thunkify + +3.0.5 / 2014-03-17 +================== + + * fix object/array test failure which tries to enumerate dates. Closes #98 + * fix final callback error propagation. Closes #92 + +3.0.4 / 2014-02-17 +================== + + * fix toThunk object check regression. Closes #89 + +3.0.3 / 2014-02-08 +================== + + * refactor: arrayToThunk @AutoSponge #88 + +3.0.2 / 2014-01-01 +================== + + * fixed: nil arguments replaced with error fn + +3.0.1 / 2013-12-19 +================== + + * fixed: callback passed as an argument to generators + +3.0.0 / 2013-12-19 +================== + + * fixed: callback passed as an argument to generators + * change: `co(function *(){})` now returns a reusable thunk + * change: `this` must now be passed through the returned thunk, ex. `co(function *(){}).call(this)` + * fix "generator already finished" errors + +2.3.0 / 2013-11-12 +================== + + * add `yield object` support + +2.2.0 / 2013-11-05 +================== + + * change: make the `isGenerator()` function more generic + +2.1.0 / 2013-10-21 +================== + + * add passing of arguments into the generator. closes #33. + +2.0.0 / 2013-10-14 +================== + + * remove callback in favour of thunk-only co(). Closes #30 [breaking change] + * remove `co.wrap()` [breaking change] + +1.5.2 / 2013-09-02 +================== + + * fix: preserve receiver with co.wrap() + +1.5.1 / 2013-08-11 +================== + + * remove setImmediate() usage - ~110% perf increase. Closes #14 + +0.5.0 / 2013-08-10 +================== + + * add receiver propagation support + * examples: update streams.js example to use `http.get()` and streams2 API + +1.4.1 / 2013-07-01 +================== + + * fix gen.next(val) for latest v8. Closes #8 + +1.4.0 / 2013-06-21 +================== + + * add promise support to joins + * add `yield generatorFunction` support + * add `yield generator` support + * add nested join support + +1.3.0 / 2013-06-10 +================== + + * add passing of arguments + +1.2.1 / 2013-06-08 +================== + + * fix join() of zero thunks + +1.2.0 / 2013-06-08 +================== + + * add array yielding support. great suggestion by @domenic + +1.1.0 / 2013-06-06 +================== + + * add promise support + * change nextTick to setImmediate diff --git a/deploy/core/node_modules/co/LICENSE b/deploy/core/node_modules/co/LICENSE new file mode 100644 index 000000000..92faba5db --- /dev/null +++ b/deploy/core/node_modules/co/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> + +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 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. diff --git a/deploy/core/node_modules/co/Readme.md b/deploy/core/node_modules/co/Readme.md new file mode 100644 index 000000000..c1d4882a1 --- /dev/null +++ b/deploy/core/node_modules/co/Readme.md @@ -0,0 +1,212 @@ +# co + +[![Gitter][gitter-image]][gitter-url] +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Downloads][downloads-image]][downloads-url] + + Generator based control flow goodness for nodejs and the browser, + using promises, letting you write non-blocking code in a nice-ish way. + +## Co v4 + + `co@4.0.0` has been released, which now relies on promises. + It is a stepping stone towards [ES7 async/await](https://github.com/lukehoban/ecmascript-asyncawait). + The primary API change is how `co()` is invoked. + Before, `co` returned a "thunk", which you then called with a callback and optional arguments. + Now, `co()` returns a promise. + +```js +co(function* () { + var result = yield Promise.resolve(true); + return result; +}).then(function (value) { + console.log(value); +}, function (err) { + console.error(err.stack); +}); +``` + + If you want to convert a `co`-generator-function into a regular function that returns a promise, + you now use `co.wrap(fn*)`. + +```js +var fn = co.wrap(function* (val) { + return yield Promise.resolve(val); +}); + +fn(true).then(function (val) { + +}); +``` + +## Platform Compatibility + + `co@4+` requires a `Promise` implementation. + For versions of node `< 0.11` and for many older browsers, + you should/must include your own `Promise` polyfill. + + When using node 0.11.x or greater, you must use the `--harmony-generators` + flag or just `--harmony` to get access to generators. + + When using node 0.10.x and lower or browsers without generator support, + you must use [gnode](https://github.com/TooTallNate/gnode) and/or [regenerator](http://facebook.github.io/regenerator/). + + io.js is supported out of the box, you can use `co` without flags or polyfills. + +## Installation + +``` +$ npm install co +``` + +## Associated libraries + +Any library that returns promises work well with `co`. + +- [mz](https://github.com/normalize/mz) - wrap all of node's code libraries as promises. + +View the [wiki](https://github.com/visionmedia/co/wiki) for more libraries. + +## Examples + +```js +var co = require('co'); + +co(function *(){ + // yield any promise + var result = yield Promise.resolve(true); +}).catch(onerror); + +co(function *(){ + // resolve multiple promises in parallel + var a = Promise.resolve(1); + var b = Promise.resolve(2); + var c = Promise.resolve(3); + var res = yield [a, b, c]; + console.log(res); + // => [1, 2, 3] +}).catch(onerror); + +// errors can be try/catched +co(function *(){ + try { + yield Promise.reject(new Error('boom')); + } catch (err) { + console.error(err.message); // "boom" + } +}).catch(onerror); + +function onerror(err) { + // log any uncaught errors + // co will not throw any errors you do not handle!!! + // HANDLE ALL YOUR ERRORS!!! + console.error(err.stack); +} +``` + +## Yieldables + + The `yieldable` objects currently supported are: + + - promises + - thunks (functions) + - array (parallel execution) + - objects (parallel execution) + - generators (delegation) + - generator functions (delegation) + +Nested `yieldable` objects are supported, meaning you can nest +promises within objects within arrays, and so on! + +### Promises + +[Read more on promises!](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) + +### Thunks + +Thunks are functions that only have a single argument, a callback. +Thunk support only remains for backwards compatibility and may +be removed in future versions of `co`. + +### Arrays + +`yield`ing an array will resolve all the `yieldables` in parallel. + +```js +co(function* () { + var res = yield [ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ]; + console.log(res); // => [1, 2, 3] +}).catch(onerror); +``` + +### Objects + +Just like arrays, objects resolve all `yieldable`s in parallel. + +```js +co(function* () { + var res = yield { + 1: Promise.resolve(1), + 2: Promise.resolve(2), + }; + console.log(res); // => { 1: 1, 2: 2 } +}).catch(onerror); +``` + +### Generators and Generator Functions + +Any generator or generator function you can pass into `co` +can be yielded as well. This should generally be avoided +as we should be moving towards spec-compliant `Promise`s instead. + +## API + +### co(fn*).then( val => ) + +Returns a promise that resolves a generator, generator function, +or any function that returns a generator. + +```js +co(function* () { + return yield Promise.resolve(true); +}).then(function (val) { + console.log(val); +}, function (err) { + console.error(err.stack); +}); +``` + +### var fn = co.wrap(fn*) + +Convert a generator into a regular function that returns a `Promise`. + +```js +var fn = co.wrap(function* (val) { + return yield Promise.resolve(val); +}); + +fn(true).then(function (val) { + +}); +``` + +## License + + MIT + +[npm-image]: https://img.shields.io/npm/v/co.svg?style=flat-square +[npm-url]: https://npmjs.org/package/co +[travis-image]: https://img.shields.io/travis/tj/co.svg?style=flat-square +[travis-url]: https://travis-ci.org/tj/co +[coveralls-image]: https://img.shields.io/coveralls/tj/co.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/tj/co +[downloads-image]: http://img.shields.io/npm/dm/co.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/co +[gitter-image]: https://badges.gitter.im/Join%20Chat.svg +[gitter-url]: https://gitter.im/tj/co?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge diff --git a/deploy/core/node_modules/co/index.js b/deploy/core/node_modules/co/index.js new file mode 100644 index 000000000..87ba8ba8b --- /dev/null +++ b/deploy/core/node_modules/co/index.js @@ -0,0 +1,237 @@ + +/** + * slice() reference. + */ + +var slice = Array.prototype.slice; + +/** + * Expose `co`. + */ + +module.exports = co['default'] = co.co = co; + +/** + * Wrap the given generator `fn` into a + * function that returns a promise. + * This is a separate function so that + * every `co()` call doesn't create a new, + * unnecessary closure. + * + * @param {GeneratorFunction} fn + * @return {Function} + * @api public + */ + +co.wrap = function (fn) { + createPromise.__generatorFunction__ = fn; + return createPromise; + function createPromise() { + return co.call(this, fn.apply(this, arguments)); + } +}; + +/** + * Execute the generator function or a generator + * and return a promise. + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +function co(gen) { + var ctx = this; + var args = slice.call(arguments, 1) + + // we wrap everything in a promise to avoid promise chaining, + // which leads to memory leak errors. + // see https://github.com/tj/co/issues/180 + return new Promise(function(resolve, reject) { + if (typeof gen === 'function') gen = gen.apply(ctx, args); + if (!gen || typeof gen.next !== 'function') return resolve(gen); + + onFulfilled(); + + /** + * @param {Mixed} res + * @return {Promise} + * @api private + */ + + function onFulfilled(res) { + var ret; + try { + ret = gen.next(res); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * @param {Error} err + * @return {Promise} + * @api private + */ + + function onRejected(err) { + var ret; + try { + ret = gen.throw(err); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * Get the next value in the generator, + * return a promise. + * + * @param {Object} ret + * @return {Promise} + * @api private + */ + + function next(ret) { + if (ret.done) return resolve(ret.value); + var value = toPromise.call(ctx, ret.value); + if (value && isPromise(value)) return value.then(onFulfilled, onRejected); + return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + + 'but the following object was passed: "' + String(ret.value) + '"')); + } + }); +} + +/** + * Convert a `yield`ed value into a promise. + * + * @param {Mixed} obj + * @return {Promise} + * @api private + */ + +function toPromise(obj) { + if (!obj) return obj; + if (isPromise(obj)) return obj; + if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); + if ('function' == typeof obj) return thunkToPromise.call(this, obj); + if (Array.isArray(obj)) return arrayToPromise.call(this, obj); + if (isObject(obj)) return objectToPromise.call(this, obj); + return obj; +} + +/** + * Convert a thunk to a promise. + * + * @param {Function} + * @return {Promise} + * @api private + */ + +function thunkToPromise(fn) { + var ctx = this; + return new Promise(function (resolve, reject) { + fn.call(ctx, function (err, res) { + if (err) return reject(err); + if (arguments.length > 2) res = slice.call(arguments, 1); + resolve(res); + }); + }); +} + +/** + * Convert an array of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Array} obj + * @return {Promise} + * @api private + */ + +function arrayToPromise(obj) { + return Promise.all(obj.map(toPromise, this)); +} + +/** + * Convert an object of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Object} obj + * @return {Promise} + * @api private + */ + +function objectToPromise(obj){ + var results = new obj.constructor(); + var keys = Object.keys(obj); + var promises = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var promise = toPromise.call(this, obj[key]); + if (promise && isPromise(promise)) defer(promise, key); + else results[key] = obj[key]; + } + return Promise.all(promises).then(function () { + return results; + }); + + function defer(promise, key) { + // predefine the key in the result + results[key] = undefined; + promises.push(promise.then(function (res) { + results[key] = res; + })); + } +} + +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + +function isPromise(obj) { + return 'function' == typeof obj.then; +} + +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGenerator(obj) { + return 'function' == typeof obj.next && 'function' == typeof obj.throw; +} + +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ +function isGeneratorFunction(obj) { + var constructor = obj.constructor; + if (!constructor) return false; + if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; + return isGenerator(constructor.prototype); +} + +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ + +function isObject(val) { + return Object == val.constructor; +} diff --git a/deploy/core/node_modules/co/package.json b/deploy/core/node_modules/co/package.json new file mode 100644 index 000000000..7991aae6f --- /dev/null +++ b/deploy/core/node_modules/co/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "co@^4.6.0", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/ajv" + ] + ], + "_from": "co@>=4.6.0 <5.0.0", + "_id": "co@4.6.0", + "_inCache": true, + "_installable": true, + "_location": "/co", + "_nodeVersion": "2.3.3", + "_npmUser": { + "email": "jonathanrichardong@gmail.com", + "name": "jongleberry" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "name": "co", + "raw": "co@^4.6.0", + "rawSpec": "^4.6.0", + "scope": null, + "spec": ">=4.6.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/ajv" + ], + "_resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "_shasum": "6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184", + "_shrinkwrap": null, + "_spec": "co@^4.6.0", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/ajv", + "bugs": { + "url": "https://github.com/tj/co/issues" + }, + "dependencies": {}, + "description": "generator async control flow goodness", + "devDependencies": { + "browserify": "^10.0.0", + "istanbul-harmony": "0", + "mocha": "^2.0.0", + "mz": "^1.0.2" + }, + "directories": {}, + "dist": { + "shasum": "6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184", + "tarball": "https://registry.npmjs.org/co/-/co-4.6.0.tgz" + }, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + }, + "files": [ + "index.js" + ], + "gitHead": "b54d18f8f472ad1314800e786993c4169a5ff9f8", + "homepage": "https://github.com/tj/co#readme", + "keywords": [ + "async", + "coro", + "coroutine", + "flow", + "generator" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "jonathanong", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "co", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/co.git" + }, + "scripts": { + "browserify": "browserify index.js -o ./co-browser.js -s co", + "prepublish": "npm run browserify", + "test": "mocha --harmony", + "test-cov": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot", + "test-travis": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "4.6.0" +} diff --git a/deploy/core/node_modules/combined-stream/License b/deploy/core/node_modules/combined-stream/License new file mode 100644 index 000000000..4804b7ab4 --- /dev/null +++ b/deploy/core/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +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 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. diff --git a/deploy/core/node_modules/combined-stream/Readme.md b/deploy/core/node_modules/combined-stream/Readme.md new file mode 100644 index 000000000..3a9e025fb --- /dev/null +++ b/deploy/core/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams vesrion 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatability with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/deploy/core/node_modules/combined-stream/lib/combined_stream.js b/deploy/core/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 000000000..6b5c21b6b --- /dev/null +++ b/deploy/core/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,188 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/deploy/core/node_modules/combined-stream/package.json b/deploy/core/node_modules/combined-stream/package.json new file mode 100644 index 000000000..b14919b2a --- /dev/null +++ b/deploy/core/node_modules/combined-stream/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "combined-stream@~1.0.5", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request" + ] + ], + "_from": "combined-stream@>=1.0.5 <1.1.0", + "_id": "combined-stream@1.0.5", + "_inCache": true, + "_installable": true, + "_location": "/combined-stream", + "_nodeVersion": "0.12.4", + "_npmUser": { + "email": "iam@alexindigo.com", + "name": "alexindigo" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "name": "combined-stream", + "raw": "combined-stream@~1.0.5", + "rawSpec": "~1.0.5", + "scope": null, + "spec": ">=1.0.5 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/form-data", + "/request" + ], + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "_shrinkwrap": null, + "_spec": "combined-stream@~1.0.5", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/request", + "author": { + "email": "felix@debuggable.com", + "name": "Felix Geisendörfer", + "url": "http://debuggable.com/" + }, + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" + }, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "description": "A stream that emits multiple other streams one after another.", + "devDependencies": { + "far": "~0.0.7" + }, + "directories": {}, + "dist": { + "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "tarball": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", + "homepage": "https://github.com/felixge/node-combined-stream", + "license": "MIT", + "main": "./lib/combined_stream", + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "celer", + "email": "dtyree77@gmail.com" + }, + { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + { + "name": "apechimp", + "email": "apeherder@gmail.com" + } + ], + "name": "combined-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "scripts": { + "test": "node test/run.js" + }, + "version": "1.0.5" +} diff --git a/deploy/core/node_modules/cryptiles/.npmignore b/deploy/core/node_modules/cryptiles/.npmignore new file mode 100644 index 000000000..b3bb51763 --- /dev/null +++ b/deploy/core/node_modules/cryptiles/.npmignore @@ -0,0 +1,18 @@ +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov + diff --git a/deploy/core/node_modules/cryptiles/.travis.yml b/deploy/core/node_modules/cryptiles/.travis.yml new file mode 100755 index 000000000..4d8269258 --- /dev/null +++ b/deploy/core/node_modules/cryptiles/.travis.yml @@ -0,0 +1,8 @@ +language: node_js + +node_js: + - 0.10 + - 4.0 + +sudo: false + diff --git a/deploy/core/node_modules/cryptiles/LICENSE b/deploy/core/node_modules/cryptiles/LICENSE new file mode 100755 index 000000000..cda44736a --- /dev/null +++ b/deploy/core/node_modules/cryptiles/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014, Eran Hammer and other contributors. +All rights reserved. + +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. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS 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. + + * * * + +The complete list of contributors can be found at: https://github.com/hueniverse/cryptiles/graphs/contributors diff --git a/deploy/core/node_modules/cryptiles/README.md b/deploy/core/node_modules/cryptiles/README.md new file mode 100644 index 000000000..400830501 --- /dev/null +++ b/deploy/core/node_modules/cryptiles/README.md @@ -0,0 +1,16 @@ +cryptiles +========= + +General purpose crypto utilities + +[![Build Status](https://secure.travis-ci.org/hapijs/cryptiles.png)](http://travis-ci.org/hapijs/cryptiles) + +Lead Maintainer - [C J Silverio](https://github.com/ceejbot) + +## Methods + +### `randomString( size)` +Returns a cryptographically strong pseudo-random data string. Takes a size argument for the length of the string. + +### `fixedTimeComparison( a, b)` +Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match). Returns `true` if the strings match, `false` if they differ. diff --git a/deploy/core/node_modules/cryptiles/lib/index.js b/deploy/core/node_modules/cryptiles/lib/index.js new file mode 100755 index 000000000..f385870ee --- /dev/null +++ b/deploy/core/node_modules/cryptiles/lib/index.js @@ -0,0 +1,68 @@ +// Load modules + +var Crypto = require('crypto'); +var Boom = require('boom'); + + +// Declare internals + +var internals = {}; + + +// Generate a cryptographically strong pseudo-random data + +exports.randomString = function (size) { + + var buffer = exports.randomBits((size + 1) * 6); + if (buffer instanceof Error) { + return buffer; + } + + var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); + return string.slice(0, size); +}; + + +exports.randomBits = function (bits) { + + if (!bits || + bits < 0) { + + return Boom.internal('Invalid random bits count'); + } + + var bytes = Math.ceil(bits / 8); + try { + return Crypto.randomBytes(bytes); + } + catch (err) { + return Boom.internal('Failed generating random bits: ' + err.message); + } +}; + + +// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match) + +exports.fixedTimeComparison = function (a, b) { + + if (typeof a !== 'string' || + typeof b !== 'string') { + + return false; + } + + var mismatch = (a.length === b.length ? 0 : 1); + if (mismatch) { + b = a; + } + + for (var i = 0, il = a.length; i < il; ++i) { + var ac = a.charCodeAt(i); + var bc = b.charCodeAt(i); + mismatch |= (ac ^ bc); + } + + return (mismatch === 0); +}; + + diff --git a/deploy/core/node_modules/cryptiles/package.json b/deploy/core/node_modules/cryptiles/package.json new file mode 100644 index 000000000..69847d33a --- /dev/null +++ b/deploy/core/node_modules/cryptiles/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + "cryptiles@2.x.x", + "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/hawk" + ] + ], + "_from": "cryptiles@>=2.0.0 <3.0.0", + "_id": "cryptiles@2.0.5", + "_inCache": true, + "_installable": true, + "_location": "/cryptiles", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "eran@hammer.io", + "name": "hueniverse" + }, + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "name": "cryptiles", + "raw": "cryptiles@2.x.x", + "rawSpec": "2.x.x", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/hawk" + ], + "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", + "_shrinkwrap": null, + "_spec": "cryptiles@2.x.x", + "_where": "/home/sbauer/Documents/dev/lt-dev/LightTable-2/deploy/core/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/cryptiles/issues" + }, + "dependencies": { + "boom": "2.x.x" + }, + "description": "General purpose crypto utilities", + "devDependencies": { + "code": "1.x.x", + "lab": "5.x.x" + }, + "directories": {}, + "dist": { + "shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", + "tarball": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "engines": { + "node": ">=0.10.40" + }, + "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649", + "homepage": "https://github.com/hapijs/cryptiles#readme", + "keywords": [ + "cryptography", + "security", + "utilites" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + { + "name": "ceejbot", + "email": "ceejceej@gmail.com" + } + ], + "name": "cryptiles", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/cryptiles.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-cov-html": "lab -a code -r html -o coverage.html" + }, + "version": "2.0.5" +} diff --git a/deploy/core/node_modules/cryptiles/test/index.js b/deploy/core/node_modules/cryptiles/test/index.js new file mode 100755 index 000000000..170393f9b --- /dev/null +++ b/deploy/core/node_modules/cryptiles/test/index.js @@ -0,0 +1,102 @@ +// Load modules + +var Code = require('code'); +var Cryptiles = require('..'); +var Lab = require('lab'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var describe = lab.describe; +var it = lab.it; +var expect = Code.expect; + + +describe('randomString()', function () { + + it('should generate the right length string', function (done) { + + for (var i = 1; i <= 1000; ++i) { + expect(Cryptiles.randomString(i).length).to.equal(i); + } + + done(); + }); + + it('returns an error on invalid bits size', function (done) { + + expect(Cryptiles.randomString(99999999999999999999).message).to.match(/Failed generating random bits/); + done(); + }); +}); + +describe('randomBits()', function () { + + it('returns an error on invalid input', function (done) { + + expect(Cryptiles.randomBits(0).message).to.equal('Invalid random bits count'); + done(); + }); +}); + +describe('fixedTimeComparison()', function () { + + var a = Cryptiles.randomString(50000); + var b = Cryptiles.randomString(150000); + + it('should take the same amount of time comparing different string sizes', function (done) { + + var now = Date.now(); + Cryptiles.fixedTimeComparison(b, a); + var t1 = Date.now() - now; + + now = Date.now(); + Cryptiles.fixedTimeComparison(b, b); + var t2 = Date.now() - now; + + expect(t2 - t1).to.be.within(-20, 20); + done(); + }); + + it('should return true for equal strings', function (done) { + + expect(Cryptiles.fixedTimeComparison(a, a)).to.equal(true); + done(); + }); + + it('should return false for different strings (size, a < b)', function (done) { + + expect(Cryptiles.fixedTimeComparison(a, a + 'x')).to.equal(false); + done(); + }); + + it('should return false for different strings (size, a > b)', function (done) { + + expect(Cryptiles.fixedTimeComparison(a + 'x', a)).to.equal(false); + done(); + }); + + it('should return false for different strings (size, a = b)', function (done) { + + expect(Cryptiles.fixedTimeComparison(a + 'x', a + 'y')).to.equal(false); + done(); + }); + + it('should return false when not a string', function (done) { + + expect(Cryptiles.fixedTimeComparison('x', null)).to.equal(false); + done(); + }); + + it('should return false when not a string (left)', function (done) { + + expect(Cryptiles.fixedTimeComparison(null, 'x')).to.equal(false); + done(); + }); +}); diff --git a/deploy/core/node_modules/dashdash/CHANGES.md b/deploy/core/node_modules/dashdash/CHANGES.md new file mode 100644 index 000000000..d7c8f4ebe --- /dev/null +++ b/deploy/core/node_modules/dashdash/CHANGES.md @@ -0,0 +1,364 @@ +# node-dashdash changelog + +## not yet released + +(nothing yet) + +## 1.14.1 + +- [issue #30] Change the output used by dashdash's Bash completion support to + indicate "there are no completions for this argument" to cope with different + sorting rules on different Bash/platforms. For example: + + $ triton -v -p test2 package get # before + ##-no -tritonpackage- completions-## + + $ triton -v -p test2 package get # after + ##-no-completion- -results-## + +## 1.14.0 + +- New `synopsisFromOpt(